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 |
|---|---|---|---|---|
test/asset/agda-stdlib-1.0/Data/Container/FreeMonad.agda | omega12345/agda-mode | 0 | 10577 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- The free monad construction on containers
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe --sized-types #-}
module Data.Container.FreeMonad where
open import Level
open import Data.Sum using (inj₁; inj₂ ; [_,_]′)
open import Data.Product
open import Data.Container
open import Data.Container.Combinator using (const; _⊎_)
open import Data.W
open import Category.Monad
infixl 1 _⋆C_
infix 1 _⋆_
------------------------------------------------------------------------
-- The free monad construction over a container and a set is, in
-- universal algebra terminology, also known as the term algebra over a
-- signature (a container) and a set (of variable symbols). The return
-- of the free monad corresponds to variables and the bind operator
-- corresponds to (parallel) substitution.
-- A useful intuition is to think of containers describing single
-- operations and the free monad construction over a container and a set
-- describing a tree of operations as nodes and elements of the set as
-- leafs. If one starts at the root, then any path will pass finitely
-- many nodes (operations described by the container) and eventually end
-- up in a leaf (element of the set) -- hence the Kleene star notation
-- (the type can be read as a regular expression).
_⋆C_ : ∀ {x s p} → Container s p → Set x → Container (s ⊔ x) p
C ⋆C X = const X ⊎ C
_⋆_ : ∀ {x s p} → Container s p → Set x → Set (x ⊔ s ⊔ p)
C ⋆ X = μ (C ⋆C X)
module _ {s p} {C : Container s p} where
inn : ∀ {x} {X : Set x} → ⟦ C ⟧ (C ⋆ X) → C ⋆ X
inn (s , f) = sup (inj₂ s , f)
rawMonad : ∀ {x} → RawMonad {s ⊔ p ⊔ x} (C ⋆_)
rawMonad = record { return = return; _>>=_ = _>>=_ }
where
return : ∀ {X} → X → C ⋆ X
return x = sup (inj₁ x , λ ())
_>>=_ : ∀ {X Y} → C ⋆ X → (X → C ⋆ Y) → C ⋆ Y
sup (inj₁ x , _) >>= k = k x
sup (inj₂ s , f) >>= k = inn (s , λ p → f p >>= k)
|
driver/src/clawfc/depscan/PreprocessorOutputSplitter.g4 | clementval/claw-compiler | 29 | 3071 | /*
* This file is released under terms of BSD license
* See LICENSE file for more information
* @author <NAME>
*/
/**
* ANTLR 4 Grammar file for the Preprocessed output splitter. Splits output text added by the preprocessor. Recognizes
* line markers.
*/
grammar PreprocessorOutputSplitter;
root: (non_preproc_line | preproc_line_marker_line | preproc_other_line)* EOF;
non_preproc_line : NON_PREPROC_LINE;
preproc_line_marker_line : PREPROC_LINE_MARKER_LINE;
preproc_other_line : PREPROC_OTHERLINE;
PREPROC_LINE_MARKER_LINE : '#' SEP NUMBER SEP '"' FILENAME_STRING '"' (SEP NUMBER)? SEP? EOL;
PREPROC_OTHERLINE : '#' (~'\n')* EOL;
NON_PREPROC_LINE : EOL | ~[#\n] (~'\n')* EOL;
fragment FILENAME_STRING : (~[\r\n"] | ESCAPED_DQ)+;
fragment ESCAPED_DQ : '\\"';
fragment NUMBER : DIGIT+;
fragment DIGIT : [0-9];
fragment SEP : WS+;
fragment WS : [ \t];
fragment EOL : '\r'? '\n';
|
src/Tactic/Nat/Auto/Lemmas.agda | lclem/agda-prelude | 0 | 6230 |
module Tactic.Nat.Auto.Lemmas where
open import Prelude
open import Tactic.Nat.NF
open import Tactic.Nat.Exp
open import Container.Bag
open import Prelude.Nat.Properties
map++ : ∀ {a b} {A : Set a} {B : Set b} (f : A → B) (xs ys : List A) →
map f (xs ++ ys) ≡ map f xs ++ map f ys
map++ f [] ys = refl
map++ f (x ∷ xs) ys rewrite map++ f xs ys = refl
prod++ : (xs ys : List Nat) → productR (xs ++ ys) ≡ productR xs * productR ys
prod++ [] ys = sym (add-zero-r (productR ys))
prod++ (x ∷ xs) ys rewrite prod++ xs ys = mul-assoc x _ _
private
shuffle₁ : ∀ a b c d → a + ((b + c) + d) ≡ b + c + (a + d)
shuffle₁ a b c d rewrite add-assoc a (b + c) d
| add-commute a (b + c)
| add-assoc (b + c) a d
= refl
shuffle₂ : ∀ a b c d → a + b + (c + d) ≡ a + c + (b + d)
shuffle₂ a b c d rewrite add-assoc (a + b) c d
| sym (add-assoc a b c)
| add-commute b c
| add-assoc a c b
| add-assoc (a + c) b d
= refl
shuffle₃ : ∀ a b c d → (a * b) * (c * d) ≡ (a * c) * (b * d)
shuffle₃ a b c d rewrite mul-assoc (a * b) c d
| sym (mul-assoc a b c)
| mul-commute b c
| mul-assoc a c b
| mul-assoc (a * c) b d = refl
shuffle₄ : ∀ a b c d → a * (b * c * d) ≡ b * c * (a * d)
shuffle₄ a b c d rewrite mul-assoc a (b * c) d
| mul-commute a (b * c)
| mul-assoc (b * c) a d
= refl
module _ {Atom : Set} {{_ : Ord Atom}} where
⟨+⟩-sound : ∀ v₁ v₂ (ρ : Env Atom) → ⟦ v₁ +nf v₂ ⟧n ρ ≡ ⟦ v₁ ⟧n ρ + ⟦ v₂ ⟧n ρ
⟨+⟩-sound [] [] ρ = refl
⟨+⟩-sound [] (_ ∷ _) ρ = refl
⟨+⟩-sound (t ∷ v₁) [] ρ = sym (add-zero-r _)
⟨+⟩-sound ((i , t₁) ∷ v₁) ((j , t₂) ∷ v₂) ρ with compare t₁ t₂
... | less _ rewrite ⟨+⟩-sound v₁ ((j , t₂) ∷ v₂) ρ
= add-assoc (i * productR (map ρ t₁)) _ _
... | equal eq rewrite eq | ⟨+⟩-sound v₁ v₂ ρ
| mul-distr-r i j (productR (map ρ t₂))
= shuffle₂ (⟦ i , t₂ ⟧t ρ) (⟦ j , t₂ ⟧t ρ) _ _
... | greater _ rewrite ⟨+⟩-sound ((i , t₁) ∷ v₁) v₂ ρ
= shuffle₁ (⟦ j , t₂ ⟧t ρ) (⟦ i , t₁ ⟧t ρ) _ _
map-merge : ∀ x y (ρ : Env Atom) → productR (map ρ (merge x y)) ≡ productR (map ρ x) * productR (map ρ y)
map-merge [] [] ρ = refl
map-merge [] (x ∷ xs) ρ = sym (add-zero-r (productR (ρ x ∷ map ρ xs)))
map-merge (x ∷ xs) [] ρ = sym (mul-one-r _)
map-merge (x ∷ xs) (y ∷ ys) ρ with x <? y
... | true rewrite map-merge xs (y ∷ ys) ρ = mul-assoc (ρ x) _ _
... | false rewrite map-merge (x ∷ xs) ys ρ = shuffle₄ (ρ y) (ρ x) _ _
mulTm-sound : ∀ t t′ (ρ : Env Atom) →
⟦ mulTm t t′ ⟧t ρ ≡ ⟦ t ⟧t ρ * ⟦ t′ ⟧t ρ
mulTm-sound (a , x) (b , y) ρ rewrite map-merge x y ρ
= shuffle₃ a b _ _
mulTmDistr : ∀ t v (ρ : Env Atom) → ⟦ map (mulTm t) v ⟧n ρ ≡ ⟦ t ⟧t ρ * ⟦ v ⟧n ρ
mulTmDistr t [] ρ = sym (mul-zero-r (⟦ t ⟧t ρ))
mulTmDistr t (t′ ∷ v) ρ =
⟦ mulTm t t′ ⟧t ρ + ⟦ map (mulTm t) v ⟧n ρ
≡⟨ cong₂ _+_ (mulTm-sound t t′ ρ) (mulTmDistr t v ρ) ⟩
⟦ t ⟧t ρ * ⟦ t′ ⟧t ρ + ⟦ t ⟧t ρ * ⟦ v ⟧n ρ
≡⟨ mul-distr-l (⟦ t ⟧t ρ) _ _ ⟩ʳ
⟦ t ⟧t ρ * ⟦ t′ ∷ v ⟧n ρ ∎
sort-sound : ∀ xs ρ → ⟦ nf-sort xs ⟧n ρ ≡ ⟦ xs ⟧n ρ
sort-sound [] ρ = refl
sort-sound (x ∷ xs) ρ rewrite ⟨+⟩-sound [ x ] (nf-sort xs) ρ
| sort-sound xs ρ
| add-zero-r (⟦ x ⟧t ρ) = refl
⟨*⟩-sound : ∀ v₁ v₂ (ρ : Env Atom) → ⟦ v₁ *nf v₂ ⟧n ρ ≡ ⟦ v₁ ⟧n ρ * ⟦ v₂ ⟧n ρ
⟨*⟩-sound [] v₂ ρ = refl
⟨*⟩-sound (t ∷ v₁) v₂ ρ =
⟦ nf-sort (map (mulTm t) v₂) +nf (v₁ *nf v₂) ⟧n ρ
≡⟨ ⟨+⟩-sound (nf-sort (map (mulTm t) v₂)) (v₁ *nf v₂) ρ ⟩
⟦ nf-sort (map (mulTm t) v₂) ⟧n ρ + ⟦ v₁ *nf v₂ ⟧n ρ
≡⟨ cong (flip _+_ (⟦ v₁ *nf v₂ ⟧n ρ)) (sort-sound (map (mulTm t) v₂) ρ) ⟩
⟦ map (mulTm t) v₂ ⟧n ρ + ⟦ v₁ *nf v₂ ⟧n ρ
≡⟨ cong (_+_ (⟦ map (mulTm t) v₂ ⟧n ρ)) (⟨*⟩-sound v₁ v₂ ρ) ⟩
⟦ map (mulTm t) v₂ ⟧n ρ + ⟦ v₁ ⟧n ρ * ⟦ v₂ ⟧n ρ
≡⟨ cong (flip _+_ (⟦ v₁ ⟧n ρ * ⟦ v₂ ⟧n ρ)) (mulTmDistr t v₂ ρ) ⟩
⟦ t ⟧t ρ * ⟦ v₂ ⟧n ρ + ⟦ v₁ ⟧n ρ * ⟦ v₂ ⟧n ρ
≡⟨ mul-distr-r (⟦ t ⟧t ρ) _ _ ⟩ʳ
⟦ t ∷ v₁ ⟧n ρ * ⟦ v₂ ⟧n ρ ∎
sound : ∀ e (ρ : Env Atom) → ⟦ e ⟧e ρ ≡ ⟦ norm e ⟧n ρ
sound (var x) ρ = mul-one-r (ρ x) ʳ⟨≡⟩ add-zero-r _ ʳ⟨≡⟩ʳ add-zero-r _
sound (lit 0) ρ = refl
sound (lit (suc n)) ρ rewrite mul-one-r n
| add-commute n 1
= sym (add-zero-r _)
sound (e ⟨+⟩ e₁) ρ =
⟦ e ⟧e ρ + ⟦ e₁ ⟧e ρ
≡⟨ cong₂ _+_ (sound e ρ) (sound e₁ ρ) ⟩
⟦ norm e ⟧n ρ + ⟦ norm e₁ ⟧n ρ
≡⟨ ⟨+⟩-sound (norm e) (norm e₁) ρ ⟩ʳ
⟦ norm e +nf norm e₁ ⟧n ρ ∎
sound (e ⟨*⟩ e₁) ρ =
⟦ e ⟧e ρ * ⟦ e₁ ⟧e ρ
≡⟨ cong₂ _*_ (sound e ρ) (sound e₁ ρ) ⟩
⟦ norm e ⟧n ρ * ⟦ norm e₁ ⟧n ρ
≡⟨ ⟨*⟩-sound (norm e) (norm e₁) ρ ⟩ʳ
⟦ norm e *nf norm e₁ ⟧n ρ ∎
module _ (ρ₁ ρ₂ : Env Atom) (eq : ∀ x → ρ₁ x ≡ ρ₂ x) where
private
lem-eval-env-a : ∀ a → productR (map ρ₁ a) ≡ productR (map ρ₂ a)
lem-eval-env-a [] = refl
lem-eval-env-a (x ∷ xs) = _*_ $≡ eq x *≡ lem-eval-env-a xs
lem-eval-env-t : ∀ t → ⟦ t ⟧t ρ₁ ≡ ⟦ t ⟧t ρ₂
lem-eval-env-t (k , a) = _*_ k $≡ lem-eval-env-a a
lem-eval-env : ∀ n → ⟦ n ⟧n ρ₁ ≡ ⟦ n ⟧n ρ₂
lem-eval-env [] = refl
lem-eval-env (x ∷ n) = _+_ $≡ lem-eval-env-t x *≡ lem-eval-env n
|
src/spread/act/file_load.asm | olifink/qspread | 0 | 10474 | <reponame>olifink/qspread<gh_stars>0
* Spreadsheet 11/03/92 O.Fink
* - file loading
include win1_keys_wwork
include win1_keys_wstatus
include win1_keys_qdos_io
include win1_keys_err
include win1_spread_keys
include win1_mac_oli
section prog
xdef fil_load
xref cfg_cgap,cfg_calc
xref.l wst_main,mv_mcnr
xref.s mli.password
*+++
* load a new spreadsheet file
*
* Entry Exit
* a0 channel of save file preserved
* a4 wwork preserved
*
* error codes: err.eof or others
* condition codes set
*---
fil_load subr a0-a3/d1-d4
; ------------------------load header-----------------------------
add.w #1,da_dupdt(a6) ; disable display
clr.w da_saved(a6)
lea da_buff(a6),a1 ; buffer
moveq #10,d2 ; nr. of bytes to fetch
bsr get_mulb
bne load_exit
move.w sfh_init(a1),d2 ; init word
sub.w #sfh.init,d2
bne.s err_icfv
move.l sfh_id(a1),d2 ; application id
sub.l #sfh.id,d2
bne load_exit_err
clr.l da_buff+sfh_pasw(a6) ; assume no password
move.l sfh_vers(a1),d2 ; file format version
move.b d2,d4 ; keep version 2 or 3 here!
cmp.l #sfh.v100,d2 ; 1.00 - ignore password
beq.s ver_old ;;;
cmp.l #sfh.v101,d2 ; 1.01 - ignore password
beq.s ver_old ;;;
cmp.l #sfh.v102,d2 ; 1.02 - ignore password
beq.s ver_102
cmp.l #sfh.v103,d2 ; 1.03 - password never set ...
beq.s ver_103_104 ; ... but compatible to 1.04
cmp.l #sfh.v104,d2 ; 1.04 with proper password
beq.s ver_103_104 ; ... is OK
err_icfv
xlea met_err_icfv,a1
move.l a1,d0
bset #31,d0 ; incompatible file format
bra load_exit_err
ver_old
bra.s ver_102
ver_103_104
lea da_buff+sfh_pasw(a6),a1
moveq #4,d2 ; fetch password
bsr get_mulb
bne load_exit_err
move.b #wsi.avbl,wst_main+ws_litem+mli.password(a6)
clr.l v_password(a6) ; assume no password
lea da_buff(a6),a1 ; back to real buffer
move.l da_buff+sfh_pasw(a6),d2
beq.s ver_102 ; if none given, carry on with 1.02
xjsr check_password ; request password 'til OK or error
bne load_exit_err
move.l d2,v_password(a6) ; store password
move.b #wsi.slct,wst_main+ws_litem+mli.password(a6)
ver_102 ; we skip the password
lea da_buff+sfh_cols(a6),a1 ; so load remaining header
moveq #4,d2 ; only two words left
bsr get_mulb
bne load_exit_err
lea da_buff(a6),a1 ; back to real buffer
move.w sfh_cols(a1),d2
beq.s loa_crsz ; current size of sheet
move.w sfh_cols(a1),da_ncols(a6) ; set new grid size
move.w sfh_rows(a1),da_nrows(a6)
xjsr forg_grd
bne.s err_icfv ; major problem here!!
move.w #1,da_saved(a6)
loa_crsz
addq.w #1,da_dupdt(a6)
; --------------- load column widths ----------------------------------
move.w sfh_cols(a1),d2
beq.s loa_nocl ; no column size information
bsr get_mulb ; load column size info
bne.s load_exit_err
bsr loa_setcs ; set column sizes
loa_nocl
;--------------- load cell informations ------------------------------
move.l a3,-(sp)
xjsr mon_strt
loa_clp
moveq #6,d2 ; load one long word/one word
bsr get_mulb
bne.s loa_clx ; end of file reached
move.l (a1),d1
bpl.s loa_cll
bsr.s loa_env ; environment code
bra.s loa_clp
loa_cll
move.l d1,da_moncl(a6)
adda.w #6,a1
bsr.s skip_value
bsr get_strg ; get formular
bne.s loa_clx
suba.w #6,a1
bsr loa_form ; install formular
bne.s loa_clx
bra loa_clp
loa_clx
xjsr mon_stop
move.l (sp)+,a3
; --------------- redraw window ---------------------------------------
clr.w da_dupdt(a6)
move.w cfg_calc,d1 ; number of calculation
calc_loop
xjsr calc_all ; calculate complete
subq.w #1,d1
bne.s calc_loop
xjsr rdw_grdr
moveq #0,d0
load_exit
tst.l d0
subend
load_exit_err
clr.w da_fname(a6) ; no filename given
bra.s load_exit
skip_value subr a1/d2
cmp.b #'2',d4
blt.s skip_exit
moveq #6,d2
bsr get_mulb
skip_exit subend
; environment codes
loa_env subr a1/a5
move.w sfe_code(a1),d2 ; get environment code
bge.s env_env
bsr.s loa_macro
bra.s env_exit
env_env
lea env_tab,a5
add.w -2(a5,d2.w),a5 ; get routine address
jsr (a5) ; do it
env_exit
subend
loa_macro
move.w d2,d0
neg.w d0
subq.w #1,d0
mulu #80,d0
move.w sfm_macr(a1),d2 ; get macro length
lea mv_mcnr(a6),a1
adda.l d0,a1
move.w d2,(a1)+ ; set macro length
bsr get_mulb ; read macro
rts
env_tab dc.w env_nfmt-env_tab ; number format
dc.w env_err-env_tab ; (string format)
dc.w env_fmtn-env_tab ; format numbers on/off
dc.w env_ordr-env_tab ; entry order
dc.w env_auto-env_tab ; auto calc on/off
dc.w env_zero-env_tab ; empty when zero
dc.w env_same-env_tab ; empty if same as above
env_err
moveq #err.nimp,d0
rts
env_nfmt
move.w sfe_val(a1),da_fword(a6) ; number format
moveq #0,d0
rts
env_fmtn
move.w sfe_val(a1),da_dofmt(a6) ; format numbers on/off
moveq #0,d0
rts
env_ordr
move.w sfe_val(a1),d0 ; calculation/input order
swap d0
move.w sfe_val(a1),d0
bchg #0,d0
move.l d0,da_ordr(a6)
moveq #0,d0
rts
env_auto
move.w sfe_val(a1),da_autoc(a6) ; auto calculation on/off
moveq #0,d0
rts
env_zero
move.w sfe_val(a1),da_emptz(a6) ; empty when zero
moveq #0,d0
rts
env_same
move.w sfe_val(a1),da_esame(a6) ; empty if same as above
moveq #0,d0
rts
; install a new formular
; a1: cell nr (.l)
; format word (.w)
; formular (strg)
;
loa_form subr a0-a4/d1-d3
move.l (a1)+,d1
move.w (a1)+,d2
xjsr acc_putf
xjsr acc_fwrd
moveq #0,d0
subend
; set column sizes
loa_setcs subr a1/a3/d0/d1/d2
move.l da_mspcl(a6),a3 ; column spacing list
bra.s sz_lpe
sz_lp
move.b (a1)+,d1 ; column width in chars
ext.w d1
mulu #qs.xchar,d1 ; in pixels
addq.w #2,d1
move.w d1,wwm_size(a3) ; set hit size
move.b cfg_cgap,d0
beq.s no_gap
addq.w #2,d1
no_gap
move.w d1,wwm_spce(a3) ; set space to the next
adda.w #wwm.slen,a3 ; next column
sz_lpe
dbra d2,sz_lp
subend
; a0 = channel id
; a1 = ptr to string
get_strg subr a1/d2
moveq #2,d2
bsr.s get_mulb
bne.s strg_exit
move.w (a1)+,d2
bsr.s get_mulb
strg_exit
subend
;+++
; fetch multiple bytes
;
; a0 = channel id
; a1 = buffer area
; d2 = number of bytes
;---
get_mulb subr a1/d1
moveq #iob.fmul,d0
move.l d3,-(sp)
moveq #forever,d3
trap #do.io
move.l (sp)+,d3
tst.l d0
subend
end
|
lib/isa-l/crc/crc64_ecma_refl_by8.asm | fossabot/7bgzf | 1 | 21485 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2016 Intel Corporation All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; * Neither the name of Intel Corporation nor the names of its
; contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Function API:
; uint64_t crc64_ecma_refl_by8(
; uint64_t init_crc, //initial CRC value, 64 bits
; const unsigned char *buf, //buffer pointer to calculate CRC on
; uint64_t len //buffer length in bytes (64-bit data)
; );
;
; Reference paper titled "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction"
; sample yasm command line:
; yasm -f x64 -f elf64 -X gnu -g dwarf2 crc64_ecma_refl_by8
%include "reg_sizes.asm"
%define fetch_dist 1024
[bits 64]
default rel
section .text
%ifidn __OUTPUT_FORMAT__, win64
%xdefine arg1 rcx
%xdefine arg2 rdx
%xdefine arg3 r8
%else
%xdefine arg1 rdi
%xdefine arg2 rsi
%xdefine arg3 rdx
%endif
%define TMP 16*0
%ifidn __OUTPUT_FORMAT__, win64
%define XMM_SAVE 16*2
%define VARIABLE_OFFSET 16*10+8
%else
%define VARIABLE_OFFSET 16*2+8
%endif
align 16
global crc64_ecma_refl_by8:ISAL_SYM_TYPE_FUNCTION
crc64_ecma_refl_by8:
; uint64_t c = crc ^ 0xffffffff,ffffffffL;
not arg1
sub rsp, VARIABLE_OFFSET
%ifidn __OUTPUT_FORMAT__, win64
; push the xmm registers into the stack to maintain
movdqa [rsp + XMM_SAVE + 16*0], xmm6
movdqa [rsp + XMM_SAVE + 16*1], xmm7
movdqa [rsp + XMM_SAVE + 16*2], xmm8
movdqa [rsp + XMM_SAVE + 16*3], xmm9
movdqa [rsp + XMM_SAVE + 16*4], xmm10
movdqa [rsp + XMM_SAVE + 16*5], xmm11
movdqa [rsp + XMM_SAVE + 16*6], xmm12
movdqa [rsp + XMM_SAVE + 16*7], xmm13
%endif
; check if smaller than 256B
cmp arg3, 256
; for sizes less than 256, we can't fold 128B at a time...
jl _less_than_256
; load the initial crc value
movq xmm10, arg1 ; initial crc
; receive the initial 128B data, xor the initial crc value
movdqu xmm0, [arg2+16*0]
movdqu xmm1, [arg2+16*1]
movdqu xmm2, [arg2+16*2]
movdqu xmm3, [arg2+16*3]
movdqu xmm4, [arg2+16*4]
movdqu xmm5, [arg2+16*5]
movdqu xmm6, [arg2+16*6]
movdqu xmm7, [arg2+16*7]
; XOR the initial_crc value
pxor xmm0, xmm10
movdqa xmm10, [rk3] ;xmm10 has rk3 and rk4
;imm value of pclmulqdq instruction will determine which constant to use
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; we subtract 256 instead of 128 to save one instruction from the loop
sub arg3, 256
; at this section of the code, there is 128*x+y (0<=y<128) bytes of buffer. The _fold_128_B_loop
; loop will fold 128B at a time until we have 128+y Bytes of buffer
; fold 128B at a time. This section of the code folds 8 xmm registers in parallel
_fold_128_B_loop:
; update the buffer pointer
add arg2, 128
prefetchnta [arg2+fetch_dist+0]
movdqu xmm9, [arg2+16*0]
movdqu xmm12, [arg2+16*1]
movdqa xmm8, xmm0
movdqa xmm13, xmm1
pclmulqdq xmm0, xmm10, 0x10
pclmulqdq xmm8, xmm10 , 0x1
pclmulqdq xmm1, xmm10, 0x10
pclmulqdq xmm13, xmm10 , 0x1
pxor xmm0, xmm9
xorps xmm0, xmm8
pxor xmm1, xmm12
xorps xmm1, xmm13
prefetchnta [arg2+fetch_dist+32]
movdqu xmm9, [arg2+16*2]
movdqu xmm12, [arg2+16*3]
movdqa xmm8, xmm2
movdqa xmm13, xmm3
pclmulqdq xmm2, xmm10, 0x10
pclmulqdq xmm8, xmm10 , 0x1
pclmulqdq xmm3, xmm10, 0x10
pclmulqdq xmm13, xmm10 , 0x1
pxor xmm2, xmm9
xorps xmm2, xmm8
pxor xmm3, xmm12
xorps xmm3, xmm13
prefetchnta [arg2+fetch_dist+64]
movdqu xmm9, [arg2+16*4]
movdqu xmm12, [arg2+16*5]
movdqa xmm8, xmm4
movdqa xmm13, xmm5
pclmulqdq xmm4, xmm10, 0x10
pclmulqdq xmm8, xmm10 , 0x1
pclmulqdq xmm5, xmm10, 0x10
pclmulqdq xmm13, xmm10 , 0x1
pxor xmm4, xmm9
xorps xmm4, xmm8
pxor xmm5, xmm12
xorps xmm5, xmm13
prefetchnta [arg2+fetch_dist+96]
movdqu xmm9, [arg2+16*6]
movdqu xmm12, [arg2+16*7]
movdqa xmm8, xmm6
movdqa xmm13, xmm7
pclmulqdq xmm6, xmm10, 0x10
pclmulqdq xmm8, xmm10 , 0x1
pclmulqdq xmm7, xmm10, 0x10
pclmulqdq xmm13, xmm10 , 0x1
pxor xmm6, xmm9
xorps xmm6, xmm8
pxor xmm7, xmm12
xorps xmm7, xmm13
sub arg3, 128
; check if there is another 128B in the buffer to be able to fold
jge _fold_128_B_loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
add arg2, 128
; at this point, the buffer pointer is pointing at the last y Bytes of the buffer, where 0 <= y < 128
; the 128B of folded data is in 8 of the xmm registers: xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7
; fold the 8 xmm registers to 1 xmm register with different constants
; xmm0 to xmm7
movdqa xmm10, [rk9]
movdqa xmm8, xmm0
pclmulqdq xmm0, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
xorps xmm7, xmm0
;xmm1 to xmm7
movdqa xmm10, [rk11]
movdqa xmm8, xmm1
pclmulqdq xmm1, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
xorps xmm7, xmm1
movdqa xmm10, [rk13]
movdqa xmm8, xmm2
pclmulqdq xmm2, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
pxor xmm7, xmm2
movdqa xmm10, [rk15]
movdqa xmm8, xmm3
pclmulqdq xmm3, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
xorps xmm7, xmm3
movdqa xmm10, [rk17]
movdqa xmm8, xmm4
pclmulqdq xmm4, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
pxor xmm7, xmm4
movdqa xmm10, [rk19]
movdqa xmm8, xmm5
pclmulqdq xmm5, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
xorps xmm7, xmm5
; xmm6 to xmm7
movdqa xmm10, [rk1]
movdqa xmm8, xmm6
pclmulqdq xmm6, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
pxor xmm7, xmm6
; instead of 128, we add 128-16 to the loop counter to save 1 instruction from the loop
; instead of a cmp instruction, we use the negative flag with the jl instruction
add arg3, 128-16
jl _final_reduction_for_128
; now we have 16+y bytes left to reduce. 16 Bytes is in register xmm7 and the rest is in memory
; we can fold 16 bytes at a time if y>=16
; continue folding 16B at a time
_16B_reduction_loop:
movdqa xmm8, xmm7
pclmulqdq xmm7, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
movdqu xmm0, [arg2]
pxor xmm7, xmm0
add arg2, 16
sub arg3, 16
; instead of a cmp instruction, we utilize the flags with the jge instruction
; equivalent of: cmp arg3, 16-16
; check if there is any more 16B in the buffer to be able to fold
jge _16B_reduction_loop
;now we have 16+z bytes left to reduce, where 0<= z < 16.
;first, we reduce the data in the xmm7 register
_final_reduction_for_128:
add arg3, 16
je _128_done
; here we are getting data that is less than 16 bytes.
; since we know that there was data before the pointer, we can offset the input pointer before the actual point, to receive exactly 16 bytes.
; after that the registers need to be adjusted.
_get_last_two_xmms:
movdqa xmm2, xmm7
movdqu xmm1, [arg2 - 16 + arg3]
; get rid of the extra data that was loaded before
; load the shift constant
lea rax, [pshufb_shf_table]
add rax, arg3
movdqu xmm0, [rax]
pshufb xmm7, xmm0
pxor xmm0, [mask3]
pshufb xmm2, xmm0
pblendvb xmm2, xmm1 ;xmm0 is implicit
;;;;;;;;;;
movdqa xmm8, xmm7
pclmulqdq xmm7, xmm10, 0x1
pclmulqdq xmm8, xmm10, 0x10
pxor xmm7, xmm8
pxor xmm7, xmm2
_128_done:
; compute crc of a 128-bit value
movdqa xmm10, [rk5]
movdqa xmm0, xmm7
;64b fold
pclmulqdq xmm7, xmm10, 0
psrldq xmm0, 8
pxor xmm7, xmm0
;barrett reduction
_barrett:
movdqa xmm1, xmm7
movdqa xmm10, [rk7]
pclmulqdq xmm7, xmm10, 0
movdqa xmm2, xmm7
pclmulqdq xmm7, xmm10, 0x10
pslldq xmm2, 8
pxor xmm7, xmm2
pxor xmm7, xmm1
pextrq rax, xmm7, 1
_cleanup:
; return c ^ 0xffffffff, ffffffffL;
not rax
%ifidn __OUTPUT_FORMAT__, win64
movdqa xmm6, [rsp + XMM_SAVE + 16*0]
movdqa xmm7, [rsp + XMM_SAVE + 16*1]
movdqa xmm8, [rsp + XMM_SAVE + 16*2]
movdqa xmm9, [rsp + XMM_SAVE + 16*3]
movdqa xmm10, [rsp + XMM_SAVE + 16*4]
movdqa xmm11, [rsp + XMM_SAVE + 16*5]
movdqa xmm12, [rsp + XMM_SAVE + 16*6]
movdqa xmm13, [rsp + XMM_SAVE + 16*7]
%endif
add rsp, VARIABLE_OFFSET
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 16
_less_than_256:
; check if there is enough buffer to be able to fold 16B at a time
cmp arg3, 32
jl _less_than_32
; if there is, load the constants
movdqa xmm10, [rk1] ; rk1 and rk2 in xmm10
movq xmm0, arg1 ; get the initial crc value
movdqu xmm7, [arg2] ; load the plaintext
pxor xmm7, xmm0
; update the buffer pointer
add arg2, 16
; update the counter. subtract 32 instead of 16 to save one instruction from the loop
sub arg3, 32
jmp _16B_reduction_loop
align 16
_less_than_32:
; mov initial crc to the return value. this is necessary for zero-length buffers.
mov rax, arg1
test arg3, arg3
je _cleanup
movq xmm0, arg1 ; get the initial crc value
cmp arg3, 16
je _exact_16_left
jl _less_than_16_left
movdqu xmm7, [arg2] ; load the plaintext
pxor xmm7, xmm0 ; xor the initial crc value
add arg2, 16
sub arg3, 16
movdqa xmm10, [rk1] ; rk1 and rk2 in xmm10
jmp _get_last_two_xmms
align 16
_less_than_16_left:
; use stack space to load data less than 16 bytes, zero-out the 16B in memory first.
pxor xmm1, xmm1
mov r11, rsp
movdqa [r11], xmm1
; backup the counter value
mov r9, arg3
cmp arg3, 8
jl _less_than_8_left
; load 8 Bytes
mov rax, [arg2]
mov [r11], rax
add r11, 8
sub arg3, 8
add arg2, 8
_less_than_8_left:
cmp arg3, 4
jl _less_than_4_left
; load 4 Bytes
mov eax, [arg2]
mov [r11], eax
add r11, 4
sub arg3, 4
add arg2, 4
_less_than_4_left:
cmp arg3, 2
jl _less_than_2_left
; load 2 Bytes
mov ax, [arg2]
mov [r11], ax
add r11, 2
sub arg3, 2
add arg2, 2
_less_than_2_left:
cmp arg3, 1
jl _zero_left
; load 1 Byte
mov al, [arg2]
mov [r11], al
_zero_left:
movdqa xmm7, [rsp]
pxor xmm7, xmm0 ; xor the initial crc value
lea rax,[pshufb_shf_table]
cmp r9, 8
jl _end_1to7
_end_8to15:
movdqu xmm0, [rax + r9]
pshufb xmm7,xmm0
jmp _128_done
_end_1to7:
; Left shift (8-length) bytes in XMM
movdqu xmm0, [rax + r9 + 8]
pshufb xmm7,xmm0
jmp _barrett
align 16
_exact_16_left:
movdqu xmm7, [arg2]
pxor xmm7, xmm0 ; xor the initial crc value
jmp _128_done
section .data
; precomputed constants
align 16
; rk7 = floor(2^128/Q)
; rk8 = Q
rk1 :
DQ 0xdabe95afc7875f40
rk2 :
DQ 0xe05dd497ca393ae4
rk3 :
DQ 0xd7d86b2af73de740
rk4 :
DQ 0x8757d71d4fcc1000
rk5 :
DQ 0xdabe95afc7875f40
rk6 :
DQ 0x0000000000000000
rk7 :
DQ 0x9c3e466c172963d5
rk8 :
DQ 0x92d8af2baf0e1e84
rk9 :
DQ 0x947874de595052cb
rk10 :
DQ 0x9e735cb59b4724da
rk11 :
DQ 0xe4ce2cd55fea0037
rk12 :
DQ 0x2fe3fd2920ce82ec
rk13 :
DQ 0xe31d519421a63a5
rk14 :
DQ 0x2e30203212cac325
rk15 :
DQ 0x81f6054a7842df4
rk16 :
DQ 0x6ae3efbb9dd441f3
rk17 :
DQ 0x69a35d91c3730254
rk18 :
DQ 0xb5ea1af9c013aca4
rk19 :
DQ 0x3be653a30fe1af51
rk20 :
DQ 0x60095b008a9efa44
pshufb_shf_table:
; use these values for shift constants for the pshufb instruction
; different alignments result in values as shown:
; dq 0x8887868584838281, 0x008f8e8d8c8b8a89 ; shl 15 (16-1) / shr1
; dq 0x8988878685848382, 0x01008f8e8d8c8b8a ; shl 14 (16-3) / shr2
; dq 0x8a89888786858483, 0x0201008f8e8d8c8b ; shl 13 (16-4) / shr3
; dq 0x8b8a898887868584, 0x030201008f8e8d8c ; shl 12 (16-4) / shr4
; dq 0x8c8b8a8988878685, 0x04030201008f8e8d ; shl 11 (16-5) / shr5
; dq 0x8d8c8b8a89888786, 0x0504030201008f8e ; shl 10 (16-6) / shr6
; dq 0x8e8d8c8b8a898887, 0x060504030201008f ; shl 9 (16-7) / shr7
; dq 0x8f8e8d8c8b8a8988, 0x0706050403020100 ; shl 8 (16-8) / shr8
; dq 0x008f8e8d8c8b8a89, 0x0807060504030201 ; shl 7 (16-9) / shr9
; dq 0x01008f8e8d8c8b8a, 0x0908070605040302 ; shl 6 (16-10) / shr10
; dq 0x0201008f8e8d8c8b, 0x0a09080706050403 ; shl 5 (16-11) / shr11
; dq 0x030201008f8e8d8c, 0x0b0a090807060504 ; shl 4 (16-12) / shr12
; dq 0x04030201008f8e8d, 0x0c0b0a0908070605 ; shl 3 (16-13) / shr13
; dq 0x0504030201008f8e, 0x0d0c0b0a09080706 ; shl 2 (16-14) / shr14
; dq 0x060504030201008f, 0x0e0d0c0b0a090807 ; shl 1 (16-15) / shr15
dq 0x8786858483828100, 0x8f8e8d8c8b8a8988
dq 0x0706050403020100, 0x000e0d0c0b0a0908
mask:
dq 0xFFFFFFFFFFFFFFFF, 0x0000000000000000
mask2:
dq 0xFFFFFFFF00000000, 0xFFFFFFFFFFFFFFFF
mask3:
dq 0x8080808080808080, 0x8080808080808080
;;; func core, ver, snum
slversion crc64_ecma_refl_by8, 01, 00, 001d
|
wof/lcs/enemy/8E.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 17485 | <reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data
copyright zengfr site:http://github.com/zengfr/romhack
001590 lea ($20,A0), A0
003D14 move.w (A1)+, ($5e,A0) [enemy+8E]
003D76 move.w (A1)+, ($8e,A0) [enemy+A2]
003D7A move.l (A1)+, ($36,A0) [enemy+8E]
0079F2 move.w (A3)+, D1 [123p+ 8E, enemy+8E]
011B58 move.b (A3)+, D1 [enemy+8E]
011BB0 beq $11bd0 [enemy+8E]
012244 move.b (A6)+, D5 [enemy+8E]
012292 move.l (A2)+, (A3)+ [enemy+88, enemy+8A]
012294 move.l (A2)+, (A3)+ [enemy+8C, enemy+8E]
01A75E dbra D4, $1a75c
05E528 move.w ($8e,A0), D0 [base+192, base+194]
05E52C move.l ($3e,PC,D0.w), D3 [enemy+8E]
copyright zengfr site:http://github.com/zengfr/romhack
|
src/presets/14ice_data.asm | NobodyNada/sm_practice_hack | 0 | 641 | <reponame>NobodyNada/sm_practice_hack<filename>src/presets/14ice_data.asm<gh_stars>0
preset_14ice_crateria_ceres_elevator:
dw #$0000
dw $078D, $AB58 ; DDB
dw $079B, $DF45 ; MDB
dw $07F3, $002D ; Music Bank
dw $07F5, $0006 ; Music Track
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $093F, $0000 ; Ceres escape flag
dw $09A2, $0000 ; Equipped Items
dw $09A4, $0000 ; Collected Items
dw $09A6, $0000 ; Beams
dw $09A8, $0000 ; Beams
dw $09C0, $0000 ; Manual/Auto reserve tank
dw $09C2, $0063 ; Health
dw $09C4, $0063 ; Max health
dw $09C6, $0000 ; Missiles
dw $09C8, $0000 ; Max missiles
dw $09CA, $0000 ; Supers
dw $09CC, $0000 ; Max supers
dw $09CE, $0000 ; Pbs
dw $09D0, $0000 ; Max pbs
dw $09D2, $0000 ; Currently selected item
dw $09D4, $0000 ; Max reserves
dw $09D6, $0000 ; Reserves
dw $0A1C, $0000 ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0A68, $0000 ; Flash suit
dw $0A76, $0000 ; Hyper beam
dw $0AF6, $0080 ; Samus X
dw $0AF8, $0000 ; Samus subpixel X
dw $0AFA, $0048 ; Samus Y
dw $0AFC, $0000 ; Samus subpixel Y
dw $0B3F, $0000 ; Blue suit
dw $D820, $0000 ; Events
dw $D822, $0000 ; Events
dw $D828, $0000 ; Bosses
dw $D82A, $0000 ; Bosses
dw $D82C, $0000 ; Bosses
dw $D82E, $0000 ; Bosses
dw $D870, $0000 ; Items
dw $D872, $0000 ; Items
dw $D874, $0000 ; Items
dw $D876, $0000 ; Items
dw $D878, $0000 ; Items
dw $D87A, $0000 ; Items
dw $D87C, $0000 ; Items
dw $D87E, $0000 ; Items
dw $D880, $0000 ; Items
dw $D882, $0000 ; Items
dw $D8B0, $0000 ; Doors
dw $D8B2, $0000 ; Doors
dw $D8B4, $0000 ; Doors
dw $D8B6, $0000 ; Doors
dw $D8B8, $0000 ; Doors
dw $D8BA, $0000 ; Doors
dw $D8BC, $0000 ; Doors
dw $D8BE, $0000 ; Doors
dw $D8C0, $0000 ; Doors
dw $D8C2, $0000 ; Doors
dw $D8C4, $0000 ; Doors
dw $D908, $0000 ; Map Stations
dw $D90A, $0000 ; Map Stations
dw $D90C, $0000 ; Map Stations
dw #$FFFF
preset_14ice_crateria_ceres_escape:
dw #preset_14ice_crateria_ceres_elevator ; Crateria: Ceres Elevator
dw $078D, $ABAC ; DDB
dw $079B, $E0B5 ; MDB
dw $07F3, $0024 ; Music Bank
dw $07F5, $0007 ; Music Track
dw $090F, $8000 ; Screen subpixel X position
dw $0913, $9400 ; Screen subpixel Y position
dw $093F, $0002 ; Ceres escape flag
dw $09C2, $0018 ; Health
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0033 ; Samus X
dw $0AF8, $B000 ; Samus subpixel X
dw $0AFA, $008B ; Samus Y
dw $0AFC, $FFFF ; Samus subpixel Y
dw $D82E, $0001 ; Bosses
dw #$FFFF
preset_14ice_crateria_ceres_last_3_rooms:
dw #preset_14ice_crateria_ceres_escape ; Crateria: Ceres Escape
dw $078D, $ABA0 ; DDB
dw $079B, $E021 ; MDB
dw $090F, $7400 ; Screen subpixel X position
dw $0913, $F000 ; Screen subpixel Y position
dw $0AF6, $004E ; Samus X
dw $0AFA, $00A2 ; Samus Y
dw #$FFFF
preset_14ice_crateria_ship:
dw #preset_14ice_crateria_ceres_last_3_rooms ; Crateria: Ceres Last 3 Rooms
dw $078D, $88FE ; DDB
dw $079B, $91F8 ; MDB
dw $07F3, $0006 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $8000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0400 ; Screen Y position in pixels
dw $0917, $0200 ; Layer 2 X position
dw $093F, $0000 ; Ceres escape flag
dw $09C2, $0063 ; Health
dw $0A1C, $0000 ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0481 ; Samus X
dw $0AF8, $0000 ; Samus subpixel X
dw $0AFA, $0471 ; Samus Y
dw $0AFC, $8000 ; Samus subpixel Y
dw #$FFFF
preset_14ice_crateria_parlor:
dw #preset_14ice_crateria_ship ; Crateria: Ship
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $1400 ; Screen subpixel Y position
dw $0915, $0400 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0079 ; Samus X
dw $0AFA, $049B ; Samus Y
dw $0AFC, $FFFF ; Samus subpixel Y
dw #$FFFF
preset_14ice_crateria_climb_down:
dw #preset_14ice_crateria_parlor ; Crateria: Parlor
dw $078D, $8916 ; DDB
dw $079B, $92FD ; MDB
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $7BFF ; Screen subpixel Y position
dw $0915, $03F2 ; Screen Y position in pixels
dw $0917, $00C0 ; Layer 2 X position
dw $0919, $02F5 ; Layer 2 Y position
dw $0A1C, $0018 ; Samus position/state
dw $0A1E, $0204 ; More position/state
dw $0AF6, $0199 ; Samus X
dw $0AF8, $8000 ; Samus subpixel X
dw $0AFA, $048A ; Samus Y
dw $0AFC, $0000 ; Samus subpixel Y
dw #$FFFF
preset_14ice_crateria_pit_room:
dw #preset_14ice_crateria_climb_down ; Crateria: Climb Down
dw $078D, $898E ; DDB
dw $079B, $96BA ; MDB
dw $090F, $6FFF ; Screen subpixel X position
dw $0913, $3800 ; Screen subpixel Y position
dw $0915, $0800 ; Screen Y position in pixels
dw $0919, $0600 ; Layer 2 Y position
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $01DB ; Samus X
dw $0AF8, $FFFF ; Samus subpixel X
dw $0AFA, $088B ; Samus Y
dw $0AFC, $FFFF ; Samus subpixel Y
dw #$FFFF
preset_14ice_crateria_morph:
dw #preset_14ice_crateria_pit_room ; Crateria: Pit Room
dw $078D, $8B9E ; DDB
dw $079B, $9E9F ; MDB
dw $07F5, $0007 ; Music Track
dw $090F, $6000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0917, $03C0 ; Layer 2 X position
dw $0919, $0180 ; Layer 2 Y position
dw $0A1C, $0000 ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0580 ; Samus X
dw $0AFA, $02A8 ; Samus Y
dw #$FFFF
preset_14ice_crateria_construction_zone_down:
dw #preset_14ice_crateria_morph ; Crateria: Morph
dw $090F, $2000 ; Screen subpixel X position
dw $0911, $0700 ; Screen X position in pixels
dw $0913, $E400 ; Screen subpixel Y position
dw $0917, $0540 ; Layer 2 X position
dw $09A2, $0004 ; Equipped Items
dw $09A4, $0004 ; Collected Items
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $07AC ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D872, $0400 ; Items
dw #$FFFF
preset_14ice_crateria_construction_zone_up:
dw #preset_14ice_crateria_construction_zone_down ; Crateria: Construction Zone Down
dw $078D, $8EDA ; DDB
dw $079B, $A107 ; MDB
dw $090F, $D000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $6800 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0001 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C6, $0005 ; Missiles
dw $09C8, $0005 ; Max missiles
dw $0AF6, $0055 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D874, $0004 ; Items
dw #$FFFF
preset_14ice_crateria_pit_room_revisit:
dw #preset_14ice_crateria_construction_zone_up ; Crateria: Construction Zone Up
dw $078D, $8EB6 ; DDB
dw $079B, $97B5 ; MDB
dw $07F5, $0003 ; Music Track
dw $090F, $0000 ; Screen subpixel X position
dw $0913, $0000 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $0A1C, $0000 ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0080 ; Samus X
dw $0AFA, $0088 ; Samus Y
dw #$FFFF
preset_14ice_crateria_climb_up:
dw #preset_14ice_crateria_pit_room_revisit ; Crateria: Pit Room Revisit
dw $078D, $8B92 ; DDB
dw $079B, $975C ; MDB
dw $07F3, $0009 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $4000 ; Screen subpixel X position
dw $0913, $CC00 ; Screen subpixel Y position
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0083 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D820, $0001 ; Events
dw $D8B2, $0400 ; Doors
dw #$FFFF
preset_14ice_crateria_parlor_revisit:
dw #preset_14ice_crateria_climb_up ; Crateria: Climb Up
dw $078D, $8B7A ; DDB
dw $079B, $96BA ; MDB
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $C000 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $0AF6, $01A0 ; Samus X
dw $0AFA, $005B ; Samus Y
dw #$FFFF
preset_14ice_crateria_flyway:
dw #preset_14ice_crateria_parlor_revisit ; Crateria: Parlor Revisit
dw $078D, $8B3E ; DDB
dw $079B, $92FD ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0911, $0300 ; Screen X position in pixels
dw $0913, $2BFF ; Screen subpixel Y position
dw $0915, $01E6 ; Screen Y position in pixels
dw $0917, $0240 ; Layer 2 X position
dw $0919, $016C ; Layer 2 Y position
dw $09D2, $0001 ; Currently selected item
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $0369 ; Samus X
dw $0AFA, $026B ; Samus Y
dw #$FFFF
preset_14ice_crateria_bomb_torizo:
dw #preset_14ice_crateria_flyway ; Crateria: Flyway
dw $078D, $8982 ; DDB
dw $079B, $9879 ; MDB
dw $090F, $4000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $D000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C6, $0000 ; Missiles
dw $09D2, $0000 ; Currently selected item
dw $0AF6, $02BE ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D8B2, $2400 ; Doors
dw #$FFFF
preset_14ice_crateria_alcatraz:
dw #preset_14ice_crateria_bomb_torizo ; Crateria: Bomb Torizo
dw $078D, $8BAA ; DDB
dw $090F, $2001 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $09A2, $1004 ; Equipped Items
dw $09A4, $1004 ; Collected Items
dw $09C6, $0005 ; Missiles
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0040 ; Samus X
dw $D828, $0004 ; Bosses
dw $D870, $0080 ; Items
dw $D8B2, $2C00 ; Doors
dw #$FFFF
preset_14ice_crateria_terminator:
dw #preset_14ice_crateria_alcatraz ; Crateria: Alcatraz
dw $078D, $8BB6 ; DDB
dw $079B, $92FD ; MDB
dw $090F, $6000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $5800 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $0A1C, $0041 ; Samus position/state
dw $0A1E, $0404 ; More position/state
dw $0AF6, $0115 ; Samus X
dw $0AFA, $0099 ; Samus Y
dw #$FFFF
preset_14ice_crateria_green_pirate_shaft:
dw #preset_14ice_crateria_terminator ; Crateria: Terminator
dw $078D, $895E ; DDB
dw $079B, $990D ; MDB
dw $090F, $9F00 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $01FC ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $017D ; Layer 2 Y position
dw $09C2, $00C7 ; Health
dw $09C4, $00C7 ; Max health
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0063 ; Samus X
dw $0AFA, $029B ; Samus Y
dw $D870, $0180 ; Items
dw #$FFFF
preset_14ice_brinstar_green_brinstar_elevator:
dw #preset_14ice_crateria_green_pirate_shaft ; Crateria: Green Pirate Shaft
dw $078D, $8C22 ; DDB
dw $079B, $9938 ; MDB
dw $07F5, $0003 ; Music Track
dw $090F, $4000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $A800 ; Screen subpixel Y position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00C7 ; Health
dw $09C4, $00C7 ; Max health
dw $09C6, $0002 ; Missiles
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0082 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D870, $0180 ; Items
dw #$FFFF
preset_14ice_brinstar_big_pink:
dw #preset_14ice_brinstar_green_brinstar_elevator ; Brinstar: Green Brinstar Elevator
dw $078D, $8CE2 ; DDB
dw $079B, $9CB3 ; MDB
dw $07F3, $000F ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $6000 ; Screen subpixel X position
dw $0911, $0600 ; Screen X position in pixels
dw $0913, $C000 ; Screen subpixel Y position
dw $0917, $0480 ; Layer 2 X position
dw $09C6, $0000 ; Missiles
dw $09CA, $0004 ; Supers
dw $09CC, $0005 ; Max supers
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $06AD ; Samus X
dw $D872, $0401 ; Items
dw $D8B4, $0006 ; Doors
dw #$FFFF
preset_14ice_brinstar_red_tower:
dw #preset_14ice_brinstar_big_pink ; Brinstar: Big Pink
dw $078D, $8E92 ; DDB
dw $079B, $9FBA ; MDB
dw $090F, $3000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $E800 ; Screen subpixel Y position
dw $0917, $03C0 ; Layer 2 X position
dw $09A6, $1000 ; Beams
dw $09A8, $1000 ; Beams
dw $0AF6, $05C1 ; Samus X
dw $D872, $0481 ; Items
dw $D8B4, $0206 ; Doors
dw $D8B6, $0008 ; Doors
dw #$FFFF
preset_14ice_brinstar_hellway:
dw #preset_14ice_brinstar_red_tower ; Brinstar: Red Tower
dw $078D, $8F0A ; DDB
dw $079B, $A253 ; MDB
dw $07F3, $0012 ; Music Bank
dw $090F, $5FFF ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $A400 ; Screen subpixel Y position
dw $0915, $000B ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0008 ; Layer 2 Y position
dw $0AF6, $0098 ; Samus X
dw #$FFFF
preset_14ice_brinstar_caterpillar_room:
dw #preset_14ice_brinstar_hellway ; Brinstar: Hellway
dw $078D, $901E ; DDB
dw $079B, $A2F7 ; MDB
dw $090F, $D000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $4400 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00B7 ; Health
dw $09C6, $0002 ; Missiles
dw $0AF6, $0298 ; Samus X
dw #$FFFF
preset_14ice_brinstar_leaving_power_bombs:
dw #preset_14ice_brinstar_caterpillar_room ; Brinstar: Caterpillar Room
dw $078D, $9096 ; DDB
dw $079B, $A3AE ; MDB
dw $07F5, $0003 ; Music Track
dw $090F, $0001 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $0C00 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $09C2, $00AD ; Health
dw $09CA, $0003 ; Supers
dw $09CE, $0005 ; Pbs
dw $09D2, $0003 ; Currently selected item
dw $09D0, $0005 ; Max pbs
dw $0AF6, $0157 ; Samus X
dw $0AFA, $00AB ; Samus Y
dw $D874, $0104 ; Items
dw $D8B6, $2008 ; Doors
dw #$FFFF
preset_14ice_brinstar_kihunter_room:
dw #preset_14ice_brinstar_leaving_power_bombs ; Brinstar: Leaving Power Bombs
dw $078D, $90BA ; DDB
dw $079B, $962A ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $5000 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $09C2, $009E ; Health
dw $09CA, $0005 ; Supers
dw $09CE, $0003 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $008A ; Samus X
dw $0AFA, $005B ; Samus Y
dw $D8B2, $2C01 ; Doors
dw $D8B6, $3008 ; Doors
dw #$FFFF
preset_14ice_brinstar_moat:
dw #preset_14ice_brinstar_kihunter_room ; Brinstar: Kihunter Room
dw $078D, $8AF6 ; DDB
dw $079B, $948C ; MDB
dw $07F5, $0005 ; Music Track
dw $090F, $5C00 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $4800 ; Screen subpixel Y position
dw $0917, $0180 ; Layer 2 X position
dw $09CE, $0001 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $02DB ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D8B0, $6000 ; Doors
dw #$FFFF
preset_14ice_brinstar_ocean:
dw #preset_14ice_brinstar_moat ; Brinstar: Moat
dw $078D, $8A36 ; DDB
dw $079B, $95FF ; MDB
dw $090F, $2000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $09C6, $0007 ; Missiles
dw $09C8, $000A ; Max missiles
dw $09D2, $0000 ; Currently selected item
dw $0AF6, $01A1 ; Samus X
dw $D870, $0190 ; Items
dw #$FFFF
preset_14ice_wrecked_ship_wrecked_ship_shaft:
dw #preset_14ice_brinstar_ocean ; Brinstar: Ocean
dw $078D, $89D6 ; DDB
dw $079B, $CA08 ; MDB
dw $07F3, $0030 ; Music Bank
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $02D8 ; Screen X position in pixels
dw $0917, $0222 ; Layer 2 X position
dw $09CA, $0004 ; Supers
dw $0AF6, $0338 ; Samus X
dw $D8B0, $7000 ; Doors
dw #$FFFF
preset_14ice_wrecked_ship_phantoon:
dw #preset_14ice_wrecked_ship_wrecked_ship_shaft ; Wrecked Ship: Wrecked Ship Shaft
dw $078D, $A21C ; DDB
dw $079B, $CC6F ; MDB
dw $090F, $F000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $7400 ; Screen subpixel Y position
dw $0917, $0300 ; Layer 2 X position
dw $09CA, $0002 ; Supers
dw $0AF6, $04CF ; Samus X
dw $D8C0, $0030 ; Doors
dw #$FFFF
preset_14ice_wrecked_ship_wrecked_ship_supers:
dw #preset_14ice_wrecked_ship_phantoon ; Wrecked Ship: Phantoon
dw $078D, $A2C4 ; DDB
dw $07F5, $0006 ; Music Track
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0229 ; Screen X position in pixels
dw $0913, $AC00 ; Screen subpixel Y position
dw $0917, $019E ; Layer 2 X position
dw $09C2, $00C7 ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $0005 ; Supers
dw $09CE, $0002 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $02C9 ; Samus X
dw $0AFA, $006B ; Samus Y
dw $D82A, $0100 ; Bosses
dw $D8C0, $0070 ; Doors
dw #$FFFF
preset_14ice_wrecked_ship_shaft_revisit:
dw #preset_14ice_wrecked_ship_wrecked_ship_supers ; Wrecked Ship: Wrecked Ship Supers
dw $078D, $A210 ; DDB
dw $079B, $CDA8 ; MDB
dw $090F, $7000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $4800 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $09CA, $000A ; Supers
dw $09CC, $000A ; Max supers
dw $09CE, $0002 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $00C4 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D880, $0020 ; Items
dw $D8C0, $0074 ; Doors
dw #$FFFF
preset_14ice_wrecked_ship_attic:
dw #preset_14ice_wrecked_ship_shaft_revisit ; Wrecked Ship: Shaft Revisit
dw $078D, $A2E8 ; DDB
dw $079B, $CAF6 ; MDB
dw $090F, $E000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $B000 ; Screen subpixel Y position
dw $0917, $0300 ; Layer 2 X position
dw $0AF6, $044D ; Samus X
dw $0AFA, $006B ; Samus Y
dw #$FFFF
preset_14ice_wrecked_ship_bowling_alley_path:
dw #preset_14ice_wrecked_ship_attic ; Wrecked Ship: Attic
dw $078D, $A1E0 ; DDB
dw $079B, $93FE ; MDB
dw $07F3, $000C ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $B000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $1800 ; Screen subpixel Y position
dw $0915, $0202 ; Screen Y position in pixels
dw $09C6, $0003 ; Missiles
dw $0917, $0100 ; Layer 2 X position
dw $09CA, $0009 ; Supers
dw $09CE, $0001 ; Pbs
dw $0AF6, $02C6 ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D8C0, $0174 ; Doors
dw #$FFFF
preset_14ice_wrecked_ship_bowling_alley:
dw #preset_14ice_wrecked_ship_bowling_alley_path ; Wrecked Ship: Bowling Alley Path
dw $078D, $8A1E ; DDB
dw $079B, $968F ; MDB
dw $090F, $3800 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $BC00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $09C2, $00BD ; Health
dw $0AF6, $002E ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_wrecked_ship_leaving_gravity:
dw #preset_14ice_wrecked_ship_bowling_alley ; Wrecked Ship: Bowling Alley
dw $078D, $A1A4 ; DDB
dw $079B, $CE40 ; MDB
dw $07F3, $0030 ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $3000 ; Screen subpixel X position
dw $0913, $5800 ; Screen subpixel Y position
dw $0917, $0001 ; Layer 2 X position
dw $09A2, $1024 ; Equipped Items
dw $09A4, $1024 ; Collected Items
dw $09C2, $0045 ; Health
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0078 ; Samus X
dw $0AFA, $0088 ; Samus Y
dw $D880, $00A0 ; Items
dw #$FFFF
preset_14ice_brinstar_revisit_red_tower_elevator:
dw #preset_14ice_wrecked_ship_leaving_gravity ; Wrecked Ship: Leaving Gravity
dw $078D, $8B02 ; DDB
dw $079B, $A322 ; MDB
dw $07F3, $0012 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0238 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0238 ; Layer 2 Y position
dw $09C2, $0043 ; Health
dw $09C6, $0000 ; Missiles
dw $09CE, $0002 ; Pbs
dw $0AF6, $0080 ; Samus X
dw $0AFA, $02A8 ; Samus Y
dw #$FFFF
preset_14ice_brinstar_revisit_breaking_tube:
dw #preset_14ice_brinstar_revisit_red_tower_elevator ; Brinstar Revisit: Red Tower Elevator
dw $078D, $911A ; DDB
dw $079B, $CF54 ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0913, $5C00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0052 ; Health
dw $09C6, $0008 ; Missiles
dw $09CA, $000A ; Supers
dw $09D2, $0003 ; Currently selected item
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $002C ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_brinstar_revisit_entering_kraids_lair:
dw #preset_14ice_brinstar_revisit_breaking_tube ; Brinstar Revisit: Breaking Tube
dw $078D, $A348 ; DDB
dw $079B, $CF80 ; MDB
dw $090F, $5000 ; Screen subpixel X position
dw $0913, $1801 ; Screen subpixel Y position
dw $0915, $0100 ; Screen Y position in pixels
dw $0919, $0100 ; Layer 2 Y position
dw $09CE, $0001 ; Pbs
dw $09D2, $0000 ; Currently selected item
dw $0AF6, $002E ; Samus X
dw $0AFA, $018B ; Samus Y
dw $D820, $0801 ; Events
dw #$FFFF
preset_14ice_brinstar_revisit_baby_kraid_entering:
dw #preset_14ice_brinstar_revisit_entering_kraids_lair ; Brinstar Revisit: Entering Kraids Lair
dw $078D, $9156 ; DDB
dw $079B, $A4DA ; MDB
dw $090F, $3000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $DC00 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $09CA, $0007 ; Supers
dw $0AF6, $0171 ; Samus X
dw #$FFFF
preset_14ice_brinstar_revisit_kraid:
dw #preset_14ice_brinstar_revisit_baby_kraid_entering ; Brinstar Revisit: Baby Kraid (Entering)
dw $078D, $919E ; DDB
dw $079B, $A56B ; MDB
dw $07F3, $0027 ; Music Bank
dw $07F5, $0006 ; Music Track
dw $090F, $5000 ; Screen subpixel X position
dw $0913, $3800 ; Screen subpixel Y position
dw $0917, $0100 ; Layer 2 X position
dw $09C2, $004D ; Health
dw $09C6, $0005 ; Missiles
dw $09CA, $0009 ; Supers
dw $0AF6, $01C8 ; Samus X
dw $D8B8, $0024 ; Doors
dw #$FFFF
preset_14ice_brinstar_revisit_baby_kraid_exiting:
dw #preset_14ice_brinstar_revisit_kraid ; Brinstar Revisit: Kraid
dw $078D, $91CE ; DDB
dw $07F5, $0003 ; Music Track
dw $090F, $8000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $A800 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $09A2, $1025 ; Equipped Items
dw $09A4, $1025 ; Collected Items
dw $09C2, $008A ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $0007 ; Supers
dw $09CE, $0004 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $005F ; Samus X
dw $D828, $0104 ; Bosses
dw $D876, $0001 ; Items
dw $D8B8, $00E4 ; Doors
dw #$FFFF
preset_14ice_brinstar_revisit_kraid_etank:
dw #preset_14ice_brinstar_revisit_baby_kraid_exiting ; Brinstar Revisit: Baby Kraid (Exiting)
dw $078D, $916E ; DDB
dw $079B, $A471 ; MDB
dw $07F3, $0012 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $4000 ; Screen subpixel X position
dw $0913, $CC00 ; Screen subpixel Y position
dw $09C2, $0085 ; Health
dw $09CA, $000A ; Supers
dw $09CE, $0002 ; Pbs
dw $0AF6, $0056 ; Samus X
dw $D8B8, $00ED ; Doors
dw #$FFFF
preset_14ice_upper_norfair_ice_beam:
dw #preset_14ice_brinstar_revisit_kraid_etank ; Brinstar Revisit: Big Pink
dw $078D, $9246 ; DDB
dw $079B, $A7DE ; MDB
dw $07F3, $0015 ; Music Bank
dw $090F, $8000 ; Screen subpixel X position
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0238 ; Screen Y position in pixels
dw $0919, $01AA ; Layer 2 Y position
dw $09C2, $012B ; Health
dw $09C4, $012B ; Max health
dw $09CA, $0009 ; Supers
dw $09CE, $0005 ; Pbs
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0080 ; Samus X
dw $0AFA, $02A8 ; Samus Y
dw $D874, $0904 ; Items
dw $D8B8, $00EF ; Doors
dw #$FFFF
preset_14ice_upper_norfair_ice_escape:
dw #preset_14ice_upper_norfair_ice_beam ; Upper Norfair: Ice Beam
dw $078D, $935A ; DDB
dw $079B, $A8B9 ; MDB
dw $090F, $6001 ; Screen subpixel X position
dw $0913, $9000 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0919, $0180 ; Layer 2 Y position
dw $09A6, $1002 ; Beams
dw $09A8, $1002 ; Beams
dw $09C2, $0126 ; Health
dw $09CA, $0008 ; Supers
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $00C5 ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D876, $0005 ; Items
dw $D8B8, $08EF ; Doors
dw #$FFFF
preset_14ice_upper_norfair_precathedral:
dw #preset_14ice_upper_norfair_ice_escape ; Upper Norfair: Ice Escape
dw $078D, $932A ; DDB
dw $079B, $A7DE ; MDB
dw $090F, $CFFF ; Screen subpixel X position
dw $0913, $C400 ; Screen subpixel Y position
dw $0915, $0317 ; Screen Y position in pixels
dw $0919, $0251 ; Layer 2 Y position
dw $0AF6, $00A1 ; Samus X
dw $0AFA, $038B ; Samus Y
dw #$FFFF
preset_14ice_upper_norfair_bubble_mountain:
dw #preset_14ice_upper_norfair_precathedral ; Upper Norfair: Pre-Cathedral
dw $078D, $92B2 ; DDB
dw $079B, $A788 ; MDB
dw $090F, $E000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $2000 ; Screen subpixel Y position
dw $0915, $0100 ; Screen Y position in pixels
dw $0917, $0200 ; Layer 2 X position
dw $0919, $0100 ; Layer 2 Y position
dw $09C6, $0009 ; Missiles
dw $09CA, $0006 ; Supers
dw $0AF6, $02B1 ; Samus X
dw $0AFA, $018B ; Samus Y
dw $D8B8, $0EEF ; Doors
dw #$FFFF
preset_14ice_upper_norfair_magdollite_room:
dw #preset_14ice_upper_norfair_bubble_mountain ; Upper Norfair: Bubble Mountain
dw $078D, $9576 ; DDB
dw $079B, $AEDF ; MDB
dw $090F, $9000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $01F4 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0177 ; Layer 2 Y position
dw $09C2, $012B ; Health
dw $09CE, $0004 ; Pbs
dw $0AF6, $005B ; Samus X
dw $0AFA, $028B ; Samus Y
dw #$FFFF
preset_14ice_upper_norfair_kronic_boost:
dw #preset_14ice_upper_norfair_magdollite_room ; Upper Norfair: Magdollite Room
dw $078D, $96BA ; DDB
dw $079B, $AEB4 ; MDB
dw $090F, $F000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $2000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C6, $0008 ; Missiles
dw $09CA, $0007 ; Supers
dw $0AF6, $02B3 ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_lower_norfair_ln_main_hall:
dw #preset_14ice_upper_norfair_kronic_boost ; Upper Norfair: Kronic Boost
dw $078D, $96F6 ; DDB
dw $079B, $B236 ; MDB
dw $07F3, $0018 ; Music Bank
dw $090F, $A000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0917, $0300 ; Layer 2 X position
dw $0919, $0301 ; Layer 2 Y position
dw $09C2, $00F7 ; Health
dw $09C6, $0007 ; Missiles
dw $09D2, $0003 ; Currently selected item
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0480 ; Samus X
dw $0AFA, $0288 ; Samus Y
dw $D8BA, $0100 ; Doors
dw #$FFFF
preset_14ice_lower_norfair_pillars:
dw #preset_14ice_lower_norfair_ln_main_hall ; Lower Norfair: LN Main Hall
dw $078D, $985E ; DDB
dw $079B, $B3A5 ; MDB
dw $090F, $4000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $4000 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0180 ; Layer 2 Y position
dw $09CE, $0005 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $008B ; Samus X
dw $0AFA, $029B ; Samus Y
dw #$FFFF
preset_14ice_lower_norfair_worst_room:
dw #preset_14ice_lower_norfair_pillars ; Lower Norfair: Pillars
dw $078D, $9912 ; DDB
dw $079B, $B457 ; MDB
dw $090F, $2000 ; Screen subpixel X position
dw $0911, $0300 ; Screen X position in pixels
dw $0913, $F000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0240 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00E3 ; Health
dw $09CE, $0003 ; Pbs
dw $0AF6, $03BF ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_lower_norfair_amphitheatre:
dw #preset_14ice_lower_norfair_worst_room ; Lower Norfair: Worst Room
dw $078D, $994E ; DDB
dw $079B, $B4AD ; MDB
dw $090F, $7000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $011C ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $00D5 ; Layer 2 Y position
dw $09C6, $0006 ; Missiles
dw $09CA, $0006 ; Supers
dw $09CE, $0002 ; Pbs
dw $09D2, $0000 ; Currently selected item
dw $0AF6, $00B0 ; Samus X
dw $0AFA, $018B ; Samus Y
dw #$FFFF
preset_14ice_lower_norfair_kihunter_stairs:
dw #preset_14ice_lower_norfair_amphitheatre ; Lower Norfair: Amphitheatre
dw $078D, $997E ; DDB
dw $079B, $B4E5 ; MDB
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $02EC ; Screen X position in pixels
dw $0915, $0033 ; Screen Y position in pixels
dw $0917, $0231 ; Layer 2 X position
dw $0919, $0026 ; Layer 2 Y position
dw $0AF6, $034C ; Samus X
dw $0AFA, $00A3 ; Samus Y
dw #$FFFF
preset_14ice_lower_norfair_wasteland:
dw #preset_14ice_lower_norfair_kihunter_stairs ; Lower Norfair: Kihunter Stairs
dw $078D, $99A2 ; DDB
dw $079B, $B585 ; MDB
dw $090F, $9E00 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $5800 ; Screen subpixel Y position
dw $0915, $0418 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0312 ; Layer 2 Y position
dw $09CE, $0001 ; Pbs
dw $0A1C, $0027 ; Samus position/state
dw $0A1E, $0508 ; More position/state
dw $0AF6, $0244 ; Samus X
dw $0AFA, $0480 ; Samus Y
dw $D8BA, $4100 ; Doors
dw #$FFFF
preset_14ice_lower_norfair_metal_pirates:
dw #preset_14ice_lower_norfair_wasteland ; Lower Norfair: Wasteland
dw $078D, $99EA ; DDB
dw $079B, $B5D5 ; MDB
dw $090F, $3001 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $021B ; Screen Y position in pixels
dw $0917, $00C0 ; Layer 2 X position
dw $0919, $0194 ; Layer 2 Y position
dw $09C2, $00CD ; Health
dw $09CA, $0005 ; Supers
dw $09CE, $0000 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0158 ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D8BA, $C100 ; Doors
dw #$FFFF
preset_14ice_lower_norfair_ridley:
dw #preset_14ice_lower_norfair_metal_pirates ; Lower Norfair: Metal Pirates
dw $078D, $995A ; DDB
dw $079B, $B37A ; MDB
dw $090F, $2000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $8C00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $012B ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $000A ; Supers
dw $09CE, $0003 ; Pbs
dw $0AF6, $0039 ; Samus X
dw $0AFA, $009B ; Samus Y
dw $D8BA, $D100 ; Doors
dw $D8BC, $0001 ; Doors
dw #$FFFF
preset_14ice_lower_norfair_leaving_ridley:
dw #preset_14ice_lower_norfair_ridley ; Lower Norfair: Ridley
dw $078D, $9A62 ; DDB
dw $079B, $B32E ; MDB
dw $07F3, $0024 ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $1000 ; Screen subpixel X position
dw $0913, $A800 ; Screen subpixel Y position
dw $0915, $011F ; Screen Y position in pixels
dw $0917, $0001 ; Layer 2 X position
dw $0919, $00D7 ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $09C4, $018F ; Max health
dw $09C6, $0008 ; Missiles
dw $09CA, $0002 ; Supers
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $005B ; Samus X
dw $0AFA, $019B ; Samus Y
dw $D82A, $0101 ; Bosses
dw $D878, $4000 ; Items
dw $D8BA, $D900 ; Doors
dw #$FFFF
preset_14ice_lower_norfair_wasteland_revisit:
dw #preset_14ice_lower_norfair_leaving_ridley ; Lower Norfair: Leaving Ridley
dw $078D, $9966 ; DDB
dw $079B, $B62B ; MDB
dw $07F3, $0018 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $A400 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0152 ; Health
dw $09CA, $0004 ; Supers
dw $09CE, $0005 ; Pbs
dw $0AF6, $02CB ; Samus X
dw $0AFA, $00AB ; Samus Y
dw $D8BA, $DD00 ; Doors
dw #$FFFF
preset_14ice_lower_norfair_kihunter_stairs_revisit:
dw #preset_14ice_lower_norfair_wasteland_revisit ; Lower Norfair: Wasteland Revisit
dw $078D, $9A3E ; DDB
dw $079B, $B5D5 ; MDB
dw $090F, $1000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $4800 ; Screen subpixel Y position
dw $0917, $03C0 ; Layer 2 X position
dw $09C2, $0123 ; Health
dw $09CE, $0004 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0587 ; Samus X
dw $0AFA, $005B ; Samus Y
dw #$FFFF
preset_14ice_lower_norfair_fireflea_room:
dw #preset_14ice_lower_norfair_kihunter_stairs_revisit ; Lower Norfair: Kihunter Stairs Revisit
dw $078D, $9A26 ; DDB
dw $079B, $B585 ; MDB
dw $090F, $0500 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $C400 ; Screen subpixel Y position
dw $0915, $0011 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $000C ; Layer 2 Y position
dw $09CE, $0003 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $00B9 ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_lower_norfair_three_musketeers:
dw #preset_14ice_lower_norfair_fireflea_room ; Lower Norfair: Fireflea Room
dw $078D, $9A92 ; DDB
dw $079B, $B510 ; MDB
dw $090F, $8000 ; Screen subpixel X position
dw $0913, $2800 ; Screen subpixel Y position
dw $0915, $0010 ; Screen Y position in pixels
dw $09C6, $0006 ; Missiles
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0066 ; Samus X
dw #$FFFF
preset_14ice_lower_norfair_bubble_mountain_revisit:
dw #preset_14ice_lower_norfair_three_musketeers ; Lower Norfair: Three Musketeers
dw $078D, $9A4A ; DDB
dw $079B, $AD5E ; MDB
dw $07F3, $0015 ; Music Bank
dw $090F, $B000 ; Screen subpixel X position
dw $0913, $DC00 ; Screen subpixel Y position
dw $0915, $001C ; Screen Y position in pixels
dw $0919, $0015 ; Layer 2 Y position
dw $09C2, $00B7 ; Health
dw $09C6, $0008 ; Missiles
dw $09CE, $0002 ; Pbs
dw $0AF6, $0085 ; Samus X
dw #$FFFF
preset_14ice_maridia_entering_maridia:
dw #preset_14ice_lower_norfair_bubble_mountain_revisit ; Lower Norfair: Bubble Mountain Revisit
dw $078D, $92EE ; DDB
dw $079B, $A6A1 ; MDB
dw $07F3, $0012 ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $A000 ; Screen subpixel X position
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $000A ; Supers
dw $09CE, $0005 ; Pbs
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0080 ; Samus X
dw $0AFA, $0086 ; Samus Y
dw $D8BA, $DD10 ; Doors
dw #$FFFF
preset_14ice_maridia_mt_everest:
dw #preset_14ice_maridia_entering_maridia ; Maridia: Entering Maridia
dw $078D, $A3B4 ; DDB
dw $079B, $D017 ; MDB
dw $07F3, $001B ; Music Bank
dw $07F5, $0006 ; Music Track
dw $090F, $6000 ; Screen subpixel X position
dw $0911, $0065 ; Screen X position in pixels
dw $0915, $0006 ; Screen Y position in pixels
dw $0917, $004B ; Layer 2 X position
dw $0919, $0004 ; Layer 2 Y position
dw $0A1C, $0028 ; Samus position/state
dw $0A1E, $0504 ; More position/state
dw $0AF6, $00C8 ; Samus X
dw $0AFA, $0070 ; Samus Y
dw #$FFFF
preset_14ice_maridia_ice_clip:
dw #preset_14ice_maridia_mt_everest ; Maridia: Mt Everest
dw $078D, $A4C8 ; DDB
dw $079B, $D5A7 ; MDB
dw $07F5, $0005 ; Music Track
dw $090F, $E000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $3C00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09CA, $0009 ; Supers
dw $09CE, $0004 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $008E ; Samus X
dw $0AFA, $006B ; Samus Y
dw $D8C0, $8174 ; Doors
dw #$FFFF
preset_14ice_maridia_botwoon:
dw #preset_14ice_maridia_ice_clip ; Maridia: Ice Clip
dw $078D, $A72C ; DDB
dw $079B, $D617 ; MDB
dw $090F, $B000 ; Screen subpixel X position
dw $0911, $0300 ; Screen X position in pixels
dw $0913, $3000 ; Screen subpixel Y position
dw $0915, $001F ; Screen Y position in pixels
dw $0917, $0240 ; Layer 2 X position
dw $0919, $001F ; Layer 2 Y position
dw $09C2, $018D ; Health
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $03B3 ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_maridia_botwoon_etank_room:
dw #preset_14ice_maridia_botwoon ; Maridia: Botwoon
dw $078D, $A774 ; DDB
dw $079B, $D95E ; MDB
dw $07F3, $002A ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $3000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $CC00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0100 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $09CA, $0004 ; Supers
dw $0AF6, $01C7 ; Samus X
dw $D82C, $0002 ; Bosses
dw #$FFFF
preset_14ice_maridia_colosseum:
dw #preset_14ice_maridia_botwoon_etank_room ; Maridia: Botwoon E-tank Room
dw $078D, $A870 ; DDB
dw $079B, $D913 ; MDB
dw $07F3, $001B ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $4880 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $001C ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $001C ; Layer 2 Y position
dw $09CA, $000A ; Supers
dw $0AF6, $00C6 ; Samus X
dw #$FFFF
preset_14ice_maridia_draygon:
dw #preset_14ice_maridia_colosseum ; Maridia: Colosseum
dw $078D, $A7F8 ; DDB
dw $079B, $D78F ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0913, $6800 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0919, $0180 ; Layer 2 Y position
dw $09C2, $0180 ; Health
dw $09CA, $0008 ; Supers
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $003C ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D8C2, $0C00 ; Doors
dw #$FFFF
preset_14ice_maridia_colosseum_revisit:
dw #preset_14ice_maridia_draygon ; Maridia: Draygon
dw $078D, $A96C ; DDB
dw $090F, $E001 ; Screen subpixel X position
dw $0913, $3800 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0154 ; Health
dw $09CA, $0002 ; Supers
dw $09CE, $0005 ; Pbs
dw $0AF6, $003D ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D82C, $0003 ; Bosses
dw $D8C2, $4C00 ; Doors
dw #$FFFF
preset_14ice_maridia_reverse_botwoon:
dw #preset_14ice_maridia_colosseum_revisit ; Maridia: Colosseum Revisit
dw $078D, $A7E0 ; DDB
dw $079B, $D913 ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0913, $1800 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0919, $0200 ; Layer 2 Y position
dw $09C2, $0145 ; Health
dw $09C6, $0009 ; Missiles
dw $09CA, $0003 ; Supers
dw $0AF6, $009A ; Samus X
dw $0AFA, $028B ; Samus Y
dw #$FFFF
preset_14ice_maridia_aqueduct_revisit:
dw #preset_14ice_maridia_reverse_botwoon ; Maridia: Reverse Botwoon
dw $078D, $A8B8 ; DDB
dw $079B, $D6FD ; MDB
dw $0913, $4800 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $0AF6, $0041 ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_maridia_everest_revisit:
dw #preset_14ice_maridia_aqueduct_revisit ; Maridia: Aqueduct Revisit
dw $078D, $A708 ; DDB
dw $079B, $D1A3 ; MDB
dw $07F5, $0006 ; Music Track
dw $090F, $4000 ; Screen subpixel X position
dw $0913, $7000 ; Screen subpixel Y position
dw $0915, $01F5 ; Screen Y position in pixels
dw $0919, $0177 ; Layer 2 Y position
dw $09CE, $0004 ; Pbs
dw $0AF6, $006F ; Samus X
dw $0AFA, $028B ; Samus Y
dw #$FFFF
preset_14ice_maridia_red_tower_green_gate:
dw #preset_14ice_maridia_everest_revisit ; Maridia: Everest Revisit
dw $078D, $A42C ; DDB
dw $079B, $D104 ; MDB
dw $090F, $6001 ; Screen subpixel X position
dw $0913, $5800 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0159 ; Health
dw $09CA, $0005 ; Supers
dw $09CE, $0003 ; Pbs
dw $0AF6, $006B ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_tourian_kihunter_room_revisit:
dw #preset_14ice_maridia_red_tower_green_gate ; Maridia: Red Tower Green Gate
dw $078D, $90BA ; DDB
dw $079B, $962A ; MDB
dw $07F3, $0012 ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $6000 ; Screen subpixel X position
dw $0913, $2000 ; Screen subpixel Y position
dw $09CA, $0004 ; Supers
dw $0AF6, $0085 ; Samus X
dw $0AFA, $005B ; Samus Y
dw #$FFFF
preset_14ice_tourian_terminator_revisit:
dw #preset_14ice_tourian_kihunter_room_revisit ; Tourian: Kihunter Room Revisit
dw $078D, $8916 ; DDB
dw $079B, $92FD ; MDB
dw $07F3, $0009 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $B800 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $0C00 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $09CE, $0002 ; Pbs
dw $0A1C, $0041 ; Samus position/state
dw $0A1E, $0404 ; More position/state
dw $0AF6, $0115 ; Samus X
dw $0AFA, $0099 ; Samus Y
dw #$FFFF
preset_14ice_tourian_pirate_shaft_revisit:
dw #preset_14ice_tourian_terminator_revisit ; Tourian: Terminator Revisit
dw $078D, $895E ; DDB
dw $079B, $990D ; MDB
dw $090F, $3E00 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $01F6 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0178 ; Layer 2 Y position
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0055 ; Samus X
dw $0AFA, $0296 ; Samus Y
dw #$FFFF
preset_14ice_tourian_metroids_1:
dw #preset_14ice_tourian_pirate_shaft_revisit ; Tourian: Pirate Shaft Revisit
dw $078D, $9222 ; DDB
dw $079B, $DAAE ; MDB
dw $07F3, $001E ; Music Bank
dw $090F, $8001 ; Screen subpixel X position
dw $0913, $A400 ; Screen subpixel Y position
dw $0915, $0300 ; Screen Y position in pixels
dw $0919, $0240 ; Layer 2 Y position
dw $09C2, $0186 ; Health
dw $09C6, $0006 ; Missiles
dw $09CA, $0003 ; Supers
dw $0AF6, $003D ; Samus X
dw $0AFA, $038B ; Samus Y
dw $D820, $0FC1 ; Events
dw $D8B2, $6C01 ; Doors
dw $D90C, $0100 ; Map Stations
dw #$FFFF
preset_14ice_tourian_metroids_2:
dw #preset_14ice_tourian_metroids_1 ; Tourian: Metroids 1
dw $078D, $A984 ; DDB
dw $079B, $DAE1 ; MDB
dw $090F, $4000 ; Screen subpixel X position
dw $0913, $6400 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0169 ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $0007 ; Supers
dw $0AF6, $0040 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D822, $0001 ; Events
dw $D8C4, $0001 ; Doors
dw #$FFFF
preset_14ice_tourian_metroids_3:
dw #preset_14ice_tourian_metroids_2 ; Tourian: Metroids 2
dw $078D, $A9B4 ; DDB
dw $079B, $DB31 ; MDB
dw $090F, $3000 ; Screen subpixel X position
dw $0913, $E800 ; Screen subpixel Y position
dw $0915, $0113 ; Screen Y position in pixels
dw $0919, $00CE ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $09CA, $0008 ; Supers
dw $09CE, $0003 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $00C9 ; Samus X
dw $0AFA, $018B ; Samus Y
dw $D822, $0003 ; Events
dw $D8C4, $0003 ; Doors
dw #$FFFF
preset_14ice_tourian_metroids_4:
dw #preset_14ice_tourian_metroids_3 ; Tourian: Metroids 3
dw $078D, $A9CC ; DDB
dw $079B, $DB7D ; MDB
dw $090F, $4000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $CC00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $03C0 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0182 ; Health
dw $09CA, $000A ; Supers
dw $09CE, $0004 ; Pbs
dw $0AF6, $05AF ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D822, $0007 ; Events
dw $D8C4, $0007 ; Doors
dw #$FFFF
preset_14ice_tourian_baby:
dw #preset_14ice_tourian_metroids_4 ; Tourian: Metroids 4
dw $078D, $A9E4 ; DDB
dw $079B, $DBCD ; MDB
dw $090F, $8000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $4C00 ; Screen subpixel Y position
dw $0915, $011F ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $00D7 ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $0AF6, $0075 ; Samus X
dw $0AFA, $01CB ; Samus Y
dw $D822, $000F ; Events
dw #$FFFF
preset_14ice_tourian_after_baby:
dw #preset_14ice_tourian_baby ; Tourian: Baby
dw $078D, $AA44 ; DDB
dw $079B, $DCFF ; MDB
dw $07F3, $001E ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $3FFF ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0800 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0006 ; Layer 2 Y position
dw $09C2, $0001 ; Health
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $00AC ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D822, $002F ; Events
dw $D8C4, $002F ; Doors
dw #$FFFF
preset_14ice_tourian_zeb_skip:
dw #preset_14ice_tourian_after_baby ; Tourian: After Baby
dw $078D, $AAA4 ; DDB
dw $079B, $DDF3 ; MDB
dw $090F, $7000 ; Screen subpixel X position
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $021A ; Screen Y position in pixels
dw $0919, $0193 ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $09CA, $0009 ; Supers
dw $0AF6, $0048 ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D8C4, $03AF ; Doors
dw #$FFFF
preset_14ice_tourian_mother_brain_2:
dw #preset_14ice_tourian_zeb_skip ; Tourian: Zeb Skip
dw $078D, $AAC8 ; DDB
dw $079B, $DD58 ; MDB
dw $07F3, $0021 ; Music Bank
dw $07F5, $0000 ; Music Track
dw $090F, $79FF ; Screen subpixel X position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0180 ; Health
dw $09C6, $0001 ; Missiles
dw $09CA, $0000 ; Supers
dw $0AF6, $00CF ; Samus X
dw $0AFA, $009B ; Samus Y
dw $D820, $0FC5 ; Events
dw #$FFFF
preset_14ice_tourian_mother_brain_3:
dw #preset_14ice_tourian_mother_brain_2 ; Tourian: Mother Brain 2
dw $09A6, $1009 ; Beams
dw $09C2, $018F ; Health
dw $09C6, $0000 ; Missiles
dw $09CE, $0000 ; Pbs
dw $0A76, $8000 ; Hyper beam
dw $D82C, $0203 ; Bosses
dw #$FFFF
preset_14ice_tourian_zebes_escape:
dw #preset_14ice_tourian_mother_brain_3 ; Tourian: Mother Brain 3
dw $09A6, $1009 ; Beams
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0025 ; Samus X
dw $0AFA, $009E ; Samus Y
dw $D820, $4FC5 ; Events
dw #$FFFF
preset_14ice_tourian_escape_room_3:
dw #preset_14ice_tourian_zebes_escape ; Tourian: Zebes Escape
dw $078D, $AAEC ; DDB
dw $079B, $DE7A ; MDB
dw $07F3, $0024 ; Music Bank
dw $07F5, $0007 ; Music Track
dw $090F, $6000 ; Screen subpixel X position
dw $0913, $8000 ; Screen subpixel Y position
dw $0915, $0100 ; Screen Y position in pixels
dw $0919, $00C0 ; Layer 2 Y position
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0A76, $8000 ; Hyper beam
dw $0AF6, $00DF ; Samus X
dw $0AFA, $018B ; Samus Y
dw #$FFFF
preset_14ice_tourian_escape_room_4:
dw #preset_14ice_tourian_escape_room_3 ; Tourian: Escape Room 3
dw $078D, $AB04 ; DDB
dw $079B, $DEA7 ; MDB
dw $090F, $3000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $4C00 ; Screen subpixel Y position
dw $0915, $001C ; Screen Y position in pixels
dw $0917, $03C0 ; Layer 2 X position
dw $0919, $0015 ; Layer 2 Y position
dw $0AF6, $05D6 ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14ice_tourian_escape_climb:
dw #preset_14ice_tourian_escape_room_4 ; Tourian: Escape Room 4
dw $078D, $AB1C ; DDB
dw $079B, $DEDE ; MDB
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $00F1 ; Screen X position in pixels
dw $0913, $A400 ; Screen subpixel Y position
dw $0915, $00FB ; Screen Y position in pixels
dw $0917, $00B4 ; Layer 2 X position
dw $0919, $00BC ; Layer 2 Y position
dw $09C2, $0171 ; Health
dw $0AF6, $0151 ; Samus X
dw $0AFA, $018B ; Samus Y
dw #$FFFF
preset_14ice_tourian_escape_parlor:
dw #preset_14ice_tourian_escape_climb ; Tourian: Escape Climb
dw $078D, $AB34 ; DDB
dw $079B, $96BA ; MDB
dw $090F, $8000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $3000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $00C0 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $0AF6, $0163 ; Samus X
dw $0AFA, $005B ; Samus Y
dw #$FFFF
|
src/main/antlr/parser/backtrack/NameListWithParallelAssign.g4 | hengxin/tpdsl | 0 | 3353 | grammar NameListWithParallelAssign;
@header {
package parser.backtrack;
}
// [a, b = c, [d, [e = f]]]
// [a, b = c] = [d, [e = f]]
stat : list EOF
| assign EOF
;
assign : list '=' list ;
list : '[' elements ']' ;
elements : element (',' element)* ;
element : NAME '=' NAME
| NAME
| list
;
LBRACK : '[' ;
RBRACK : ']' ;
COMMA : ',' ;
ASSIGN : '=' ;
NAME : [a-zA-Z]+ ;
WS : [ \t\n\r]+ -> skip ; |
Task/Multiple-distinct-objects/Ada/multiple-distinct-objects-3.ada | LaudateCorpus1/RosettaCodeData | 1 | 1680 | <filename>Task/Multiple-distinct-objects/Ada/multiple-distinct-objects-3.ada
(1..N => V)
|
samples/alocal.asm | wilsonpilon/msx-menu | 0 | 169697 | <filename>samples/alocal.asm
; alocal.asm
; Test of autolocal mode in CP/M.
bdos equ 5
conout equ 2
start org 100h
jp _hola
_exit db "Good morning.\r\n", 0
_hola ld hl, _exit
call showtext
jp hola
showtext
_hola ld a, (hl)
cp 0
jp z, _exit
push hl
ld e, a
ld c, conout
call bdos
pop hl
inc hl
jp _hola
_exit ret
hola ld hl, _exit
call showtext
jp 0
_exit db "Hello, autolocal world\r\n", 0
end start
|
sw/552tests/inst_tests/jal_0.asm | JPShen-UWM/ThreadKraken | 1 | 89618 | // Original test: ./bolanows/hw4/problem6/jal_0.asm
// Author: bolanows
// Test source code follows
JAL 2 // Should jump to the target, PC = 4
Nop
Nop // PC = 4 Target
halt
|
src/ru/mephi/interpreter/generated/Lang.g4 | AVChkadua/interpreter | 1 | 7895 | grammar Lang;
@header {
package ru.mephi.interpreter.generated;
}
main: funcImpl+;
sentence: assign SEMI #Assigning
| forEach SEMI #ForEachCycle
| declarePointer SEMI #PointerDeclaration
| declareVariable SEMI #VariableDeclaration
| declareArray SEMI #ArrayDeclaration
| whileCycling #WhileCycle
| zero #IfZero
| notZero #IfNotZero
| funcImpl #FunctionImplementation
| funcCall SEMI #FunctionCall
| LEFT SEMI #MoveLeft
| RIGHT SEMI #MoveRight
| TOP SEMI #MoveTop
| BOTTOM SEMI #MoveBottom
| PORTAL SEMI #CreatePortal
| TELEPORT SEMI #Teleport
| BREAK SEMI #Breaking
| returnExpr SEMI #Returning
| body #BodyPart
| print SEMI #Write
;
expr: '(' expr ')' #BracedExpr
| '$' variableWithLength #Length
| expr op=('*'|'/'|'%') expr #MultiOp
| expr op=('+'|'-') expr #AddOp
| value #Const
| expr op=('!='|'<='|'>='|'==') expr #Comparing
| funcCall #Call
| CAN_GO_LEFT #CanMoveLeft
| CAN_GO_RIGHT #CanMoveRight
| CAN_GO_TOP #CanMoveTop
| CAN_GO_BOTTOM #CanMoveBottom
| VISITED_LEFT #VisitedLeft
| VISITED_RIGHT #VisitedRight
| VISITED_TOP #VisitedTop
| VISITED_BOTTOM #VisitedBottom
| IS_AT_EXIT #IsAtExit
| NOT_AT_EXIT #NotAtExit
;
assign: declareVariable '=' expr #JustDeclaredVariable
| declarePointer '=' expr #JustDeclaredPointer
| declareArray '=' expr #JustDeclaredArray
| variable '=' expr #ExistingVariable
;
value: INT #ConstValue
| arrayElement #ArrayElementValue
| NAME #NamedVariableValue
| pointerValue #PointerValueValue
| variableAddress #VariableAddressValue
;
variableWithLength: NAME;
variable: NAME #NamedVariable
| arrayElement #ArrayElementVariable
| pointerValue #PointerValueVariable
| variableAddress #PointerAddressVariable
;
argument: INT
| variable;
declareVariable: CONST? VALUE TYPE NAME;
declarePointer: CONST? POINTER CONST? TYPE NAME;
declareArray: CONST? ARRAY_OF TYPE NAME;
pointerValue: '*' NAME;
variableAddress: '&' NAME;
arrayElement: NAME index;
index: '[' expr ']';
whileDeclaration: WHILE '(' expr ')';
finishDeclaration: FINISH;
zeroDeclaration: ZERO '(' expr ')';
notZeroDeclaration: NOT_ZERO '(' expr ')';
forEach: FOR_EACH NAME func=funcCall;
funcCall: NAME '(' (argument(', 'argument)*)? ')';
functionDeclaration: TYPE funcName=NAME '(' (parameter(', ' parameter)*)? ')';
body: '{' sentence* '}';
whileCycling: whileDeclaration body finishDeclaration body;
zero: zeroCond=zeroDeclaration body;
notZero: notZeroCond=notZeroDeclaration body;
funcImpl: functionDeclaration body;
parameter: TYPE NAME;
returnExpr: RETURN expr;
print: PRINT expr;
SPACE: (' ')+ {skip();};
TYPE: 'int'
| 'byte'
| 'long';
TOP: 'top';
BOTTOM: 'bottom';
LEFT: 'left';
RIGHT: 'right';
CAN_GO_TOP: 'can_go_top';
CAN_GO_BOTTOM: 'can_go_bottom';
CAN_GO_LEFT: 'can_go_left';
CAN_GO_RIGHT: 'can_go_right';
VISITED_LEFT: 'visited_left';
VISITED_RIGHT: 'visited_right';
VISITED_TOP: 'visited_top';
VISITED_BOTTOM: 'visited_bottom';
PORTAL: 'portal';
TELEPORT: 'teleport';
CONST: 'const';
VALUE: 'value';
POINTER: 'pointer';
ARRAY_OF: 'array_of';
WHILE: 'while';
FINISH: 'finish';
ZERO: 'zero?';
NOT_ZERO: 'notzero?';
NOT: 'not';
FOR_EACH: 'foreach';
RETURN: 'return';
BREAK: 'break';
SEMI: ';';
PRINT: 'print';
IS_AT_EXIT: 'exit?';
NOT_AT_EXIT: 'not_exit?';
INT: [-]?[0-9]+;
NEWLINE: [\r\n]+ {skip();};
NAME: [a-z][a-zA-Z0-9]*;
|
src/open_weather_map-client.ads | Jellix/open_weather_map_api | 1 | 3806 | <reponame>Jellix/open_weather_map_api
--------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (<EMAIL>)
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
with AWS.Client;
limited with GNATCOLL.JSON;
--------------------------------------------------------------------------------
--% @summary
-- Open_Weather_Map.Client
--
--% @description
--% Provides a wrapper for an HTTP connection object including the
--% implementation of a rate limit.
--------------------------------------------------------------------------------
package Open_Weather_Map.Client is
type T is tagged limited private;
type T_Access is access all T'Class;
-----------------------------------------------------------------------------
-- Create
-----------------------------------------------------------------------------
function Create
(Configuration : in GNATCOLL.JSON.JSON_Value;
Rate_Limit : in Ada.Real_Time.Time_Span := Default_Rate_Limit) return T_Access;
--% Creates (dynamically allocates) and initializes a Client object.
--
--% @param Configuration
--% A JSON value with configuration values for the client stored in it.
--
--% @param Rate_Limit
--% Interval at which API requests should be made at most with this client.
-----------------------------------------------------------------------------
-- Destroy
-----------------------------------------------------------------------------
procedure Destroy (Self : in out T_Access);
--% Destroys a Client object and frees the storage associated with it.
--
--% @param Self
--% The object to be freed.
-----------------------------------------------------------------------------
-- Initialize
-----------------------------------------------------------------------------
procedure Initialize
(Self : out T;
Configuration : in GNATCOLL.JSON.JSON_Value;
Rate_Limit : in Ada.Real_Time.Time_Span := Default_Rate_Limit);
--% Initializes a Client object according to the given configuration.
--
--% @param Self
--% The object to be initialized.
--
--% @param Configuration
--% A JSON value with configuration values for the client stored in it.
--
--% @param Rate_Limit
--% Indicates the minimum time interval at which a call to Connection (see
--% below) can be invoked without suspending the caller.
-----------------------------------------------------------------------------
-- Connection
-----------------------------------------------------------------------------
function Connection
(Self : in out T) return not null AWS.Client.HTTP_Connection_Access;
--% Implements rate limiting by suspending a caller if calls to this function
--% are not at least the time interval given in Rate_Limit apart.
--
--% @param Self
--% The client object.
--
--% @return
--% The HTTP connection associated with the client.
--
-- NOTE: The implementation assumes that the returned connection object will
-- not be stored by the caller, but rather requested each time a
-- connection is being made.
private
type T is new Ada.Finalization.Limited_Controlled with
record
Rate_Limit : Ada.Real_Time.Time_Span;
Last_Access : Ada.Real_Time.Time;
HTTP_Connection : AWS.Client.HTTP_Connection_Access;
end record;
--% The type representing a (HTTP) client.
--
--% @field Rate_Limit
--% The minimum separation interval between HTTP API requests made by this
--% client.
--
--% @field Last_Access
--% The time of the last HTTP query made by the client.
--
--% @field HTTP_Connection
--% The client's HTTP connection to the server.
-----------------------------------------------------------------------------
-- Finalize
-----------------------------------------------------------------------------
overriding procedure Finalize (Self : in out T);
--% Finalizes the client object.
--
--% @param Self
--% The client object being finalized.
end Open_Weather_Map.Client;
|
Formula.g4 | wpc009/antlr4-javascript-example | 0 | 4583 | grammar Formula;
// @header{
// package com.maxtropy.formula.core.base;
// }
// 计算式
formula :expr
;
expr :infixExpr
;
infixExpr :prefixExpr
|infixExpr scaling infixExpr
|infixExpr addition infixExpr
|infixExpr bitwiseShift infixExpr
|infixExpr relational infixExpr
|infixExpr equality infixExpr
|infixExpr and infixExpr
|infixExpr exclusiveOr infixExpr
|infixExpr inclusiveOr infixExpr
|infixExpr conjunction infixExpr
|infixExpr disjunction infixExpr
;
prefixExpr :parenthesesExpr
|not parenthesesExpr
|addition parenthesesExpr
;
parenthesesExpr :simpleExpr
|'('expr')';
simpleExpr :constNumber
|pointCode
|func
;
// 函数。
func :ID '(' argumentList? ')'
;
argumentList : infixExpr (',' infixExpr)*
;
// 常数。
constNumber :(TRUE|FALSE) #bool
|NUMBER_CONST #number
;
// 数据点。
pointCode :POINT
;
// 二元运算符
// 命名与优先级参考:
// http://www.cplusplus.com/doc/tutorial/operators/
BITWISE_NOT :'~';
LOGICAL_NOT :'!';
not :BITWISE_NOT|LOGICAL_NOT;
MULTIPLY :'*';
DIVIDE :'/';
MODULO :'%';
scaling :MULTIPLY|DIVIDE|MODULO;
ADDITION :'+';
SUBTRACTION :'-';
addition :ADDITION|SUBTRACTION;
SHIFT_LEFT :'<<';
SHIFT_RIGHT :'>>';
bitwiseShift :SHIFT_LEFT|SHIFT_RIGHT;
LT :'<';
LTE :'<=';
GT :'>';
GTE :'>=';
relational :LT|LTE|GT|GTE;
EQUALITY :'==';
INEQUALITY :'!=';
equality :EQUALITY|INEQUALITY;
BITWISE_AND :'&';
and :BITWISE_AND;
BITWISE_XOR :'^';
exclusiveOr :BITWISE_XOR;
BITWISE_OR :'|';
inclusiveOr :BITWISE_OR;
LOGICAL_AND :'&&';
conjunction :LOGICAL_AND;
LOGICAL_OR :'||';
disjunction :LOGICAL_OR;
// 关键字定义
TRUE :'true'|'TRUE';
FALSE :'false'|'FALSE';
// 其他元素定义
POINT :[xyz]?'_'[0-9]+;
ID :[a-zA-Z][a-zA-Z0-9]*;
NUMBER_CONST :[0-9]+'.'?[0-9]*;
WS :[ \t\r\n\u000C]+ -> skip; |
bughunt_syscall_x64.asm | k0keoyo/KernelFuzzer | 377 | 93251 | <reponame>k0keoyo/KernelFuzzer
;.686P
;.MODEL FLAT, C
;.STACK 1000h
.CODE
bughunt_syscall PROC
; RCX -> arg1
; RDX -> arg2
; R8 -> arg3
; R9 -> arg4
push rbp ; prologue
mov rbp, rsp
sub rsp, 118h
mov rax, rcx ;
mov r10, rdx
mov rdx, r8
mov r8, r9
; mov rcx, [rbp + XXh] ; main (argv[X + 4])
; push rcx
mov rcx, [rbp + 110h] ; main (argv[28 + 4]) = dw0x1B
push rcx
mov rcx, [rbp + 108h] ; main (argv[28 + 4]) = dw0x1B
push rcx
mov rcx, [rbp + 100h] ; main (argv[27 + 4]) = dw0x1A
push rcx
mov rcx, [rbp + 0F8h] ; main (argv[26 + 4]) = dw0x19
push rcx
mov rcx, [rbp + 0F0h] ; main (argv[25 + 4]) = dw0x18
push rcx
mov rcx, [rbp + 0E8h] ; main (argv[24 + 4]) = dw0x17
push rcx
mov rcx, [rbp + 0E0h] ; main (argv[23 + 4]) = dw0x16
push rcx
mov rcx, [rbp + 0D8h] ; main (argv[22 + 4]) = dw0x15
push rcx
mov rcx, [rbp + 0D0h] ; main (argv[21 + 4]) = dw0x14
push rcx
mov rcx, [rbp + 0C8h] ; main (argv[20 + 4]) = dw0x13
push rcx
mov rcx, [rbp + 0C0h] ; main (argv[19 + 4]) = dw0x12
push rcx
mov rcx, [rbp + 0B8h] ; main (argv[18 + 4]) = dw0x11
push rcx
mov rcx, [rbp + 0B0h] ; main (argv[17 + 4]) = dw0x10
push rcx
mov rcx, [rbp + 0A8h] ; main (argv[16 + 4])
push rcx
mov rcx, [rbp + 0A0h] ; main (argv[15 + 4])
push rcx
mov rcx, [rbp + 98h] ; main (argv[14 + 4])
push rcx
mov rcx, [rbp + 90h] ; main (argv[13 + 4])
push rcx
mov rcx, [rbp + 88h] ; main (argv[12 + 4])
push rcx
mov rcx, [rbp + 80h] ; main (argv[11 + 4])
push rcx
mov rcx, [rbp + 78h] ; main (argv[10 + 4])
push rcx
mov rcx, [rbp + 70h] ; main (argv[9 + 4])
push rcx
mov rcx, [rbp + 68h] ; main (argv[8 + 4])
push rcx
mov rcx, [rbp + 60h] ; main (argv[7 + 4])
push rcx
mov rcx, [rbp + 58h] ; main (argv[6 + 4])
push rcx
mov rcx, [rbp + 50h] ; main (argv[5 + 4])
push rcx
mov rcx, [rbp + 48h] ; main (argv[4 + 4])
push rcx
mov rcx, [rbp + 40h] ; main (argv[3 + 4])
push rcx
mov rcx, [rbp + 38h] ; main (argv[2 + 4])
push rcx
mov r9, [rbp + 30h]
mov rcx, r10
; R9 <- main (argv[4])
; R8 <- main (argv[3])
; RDX <- main (argv[2])
; RCX <- main (argv[1])
syscall ; invoke syscall
mov rsp, rbp ; epilogue, either that or `leave'
pop rbp
ret
bughunt_syscall ENDP
END
|
tests/004_XOR__AND_and_OR.asm | tpisto/pasm | 103 | 97032 | <reponame>tpisto/pasm
; name: XOR, AND and OR
; code: "30C820C008C831C821D109D16631C86621D16609D13501002501000D010081F1010081E1010081C9010030C820C008C86631C86621D16609D131C821D109D16635010066250100660D01006681F101006681E101006681C9010030C820C008C86631C86621D16609D131C821D109D14831C84821D14809D16635010066250100660D01006681F101006681E101006681C90100"
[bits 16]
xor al,cl
and al,al
or al,cl
xor ax,cx
and cx,dx
or cx,dx
xor eax,ecx
and ecx,edx
or ecx,edx
xor ax,0x1
and ax,0x1
or ax,0x1
xor cx,0x1
and cx,0x1
or cx,0x1
[bits 32]
xor al,cl
and al,al
or al,cl
xor ax,cx
and cx,dx
or cx,dx
xor eax,ecx
and ecx,edx
or ecx,edx
xor ax,0x1
and ax,0x1
or ax,0x1
xor cx,0x1
and cx,0x1
or cx,0x1
[bits 64]
xor al,cl
and al,al
or al,cl
xor ax,cx
and cx,dx
or cx,dx
xor eax,ecx
and ecx,edx
or ecx,edx
xor rax,rcx
and rcx,rdx
or rcx,rdx
xor ax,0x1
and ax,0x1
or ax,0x1
xor cx,0x1
and cx,0x1
or cx,0x1
|
prototyping/Examples/OpSem.agda | TheGreatSageEqualToHeaven/luau | 1 | 6540 | <reponame>TheGreatSageEqualToHeaven/luau
{-# OPTIONS --rewriting #-}
module Examples.OpSem where
open import Luau.OpSem using (_⊢_⟶ᴱ_⊣_; _⊢_⟶ᴮ_⊣_; subst)
open import Luau.Syntax using (Block; var; val; nil; local_←_; _∙_; done; return; block_is_end)
open import Luau.Heap using (∅)
ex1 : ∅ ⊢ (local (var "x") ← val nil ∙ return (var "x") ∙ done) ⟶ᴮ (return (val nil) ∙ done) ⊣ ∅
ex1 = subst nil
|
src/Categories/Category/Construction/Properties/Presheaves.agda | MirceaS/agda-categories | 0 | 9882 | {-# OPTIONS --without-K --safe #-}
module Categories.Category.Construction.Properties.Presheaves where
open import Categories.Category.Construction.Properties.Presheaves.Cartesian
using (module IsCartesian)
public
open import Categories.Category.Construction.Properties.Presheaves.CartesianClosed
using (module IsCCC)
public
open import Categories.Category.Construction.Properties.Presheaves.Complete
using (Presheaves-Complete; Presheaves-Cocomplete)
public
|
Projetos/J-VMTranslator/bin/nasm/SimpleGoto.nasm | gabrielvf1/Z01---Grupo-H | 0 | 17844 | <reponame>gabrielvf1/Z01---Grupo-H
; 0 - PUSH constant 5
leaw $5, %A
movw %A, %D
leaw $SP, %A
movw (%A), %A
movw %D, (%A)
leaw $SP, %A
movw (%A), %A
incw %A
movw %A, %D
leaw $SP, %A
movw %D, (%A)
; 1 - Goto Incondicional
leaw $scripts/../../I-VM/src/vmExamples/SimpleGoto-END2, %A
jmp
nop
; Label (marcador)
scripts/../../I-VM/src/vmExamples/SimpleGoto-DUMMY:
; 2 - PUSH constant 3
leaw $3, %A
movw %A, %D
leaw $SP, %A
movw (%A), %A
movw %D, (%A)
leaw $SP, %A
movw (%A), %A
incw %A
movw %A, %D
leaw $SP, %A
movw %D, (%A)
; Label (marcador)
scripts/../../I-VM/src/vmExamples/SimpleGoto-END2:
; 3 - POP temp 0
leaw $SP, %A
movw (%A), %A
decw %A
movw (%A), %D
leaw $5, %A
movw %D, (%A)
leaw $SP, %A
movw (%A), %A
decw %A
movw %A, %D
leaw $SP, %A
movw %D, (%A)
; End
|
prototyping/Examples.agda | TheGreatSageEqualToHeaven/luau | 1 | 7936 | <filename>prototyping/Examples.agda
{-# OPTIONS --rewriting #-}
module Examples where
import Examples.Syntax
import Examples.OpSem
import Examples.Run
import Examples.Type
|
add_by_referance.adb | kylelk/ada-examples | 1 | 3662 | <gh_stars>1-10
with Ada.integer_text_IO;
use Ada;
procedure add_by_referance is
procedure add(a, b: in Integer; c: out Integer) is
begin
c := a + b;
end add;
answer : Integer;
begin
add(3, 5, answer);
integer_text_IO.put(answer);
end add_by_referance;
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_3_668.asm | ljhsiun2/medusa | 9 | 95767 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xeaed, %r8
nop
inc %r10
mov (%r8), %si
nop
nop
nop
xor $34513, %r12
lea addresses_UC_ht+0x14045, %r8
nop
nop
add $23112, %rsi
mov $0x6162636465666768, %rbx
movq %rbx, %xmm6
vmovups %ymm6, (%r8)
xor $13547, %r10
lea addresses_WC_ht+0x1d905, %rax
and $62962, %rdi
mov (%rax), %bx
nop
nop
nop
nop
nop
cmp $25385, %rbx
lea addresses_normal_ht+0x1e285, %r12
nop
xor %r8, %r8
movups (%r12), %xmm3
vpextrq $1, %xmm3, %rax
nop
nop
nop
nop
and %r12, %r12
lea addresses_WC_ht+0x5a05, %r12
clflush (%r12)
xor %rax, %rax
mov (%r12), %esi
nop
nop
nop
sub %rbx, %rbx
lea addresses_UC_ht+0x1ef15, %rsi
lea addresses_normal_ht+0x7d19, %rdi
nop
nop
nop
nop
xor %r10, %r10
mov $21, %rcx
rep movsw
nop
nop
nop
xor $50989, %rcx
lea addresses_UC_ht+0x32f9, %r10
nop
nop
nop
add $2038, %r12
vmovups (%r10), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %rax
nop
nop
nop
nop
mfence
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %rax
push %rbp
push %rbx
push %rsi
// Store
lea addresses_UC+0x19905, %rbp
nop
nop
nop
nop
nop
lfence
movl $0x51525354, (%rbp)
nop
nop
nop
nop
nop
xor %r10, %r10
// Faulty Load
lea addresses_UC+0x19905, %rbx
cmp $10429, %rbp
mov (%rbx), %r10
lea oracles, %rbx
and $0xff, %r10
shlq $12, %r10
mov (%rbx,%r10,1), %r10
pop %rsi
pop %rbx
pop %rbp
pop %rax
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 4}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'54': 3}
54 54 54
*/
|
libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Klausjahn/_ff_ao_Klausjahn.asm | jpoikela/z88dk | 640 | 94584 | <filename>libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Klausjahn/_ff_ao_Klausjahn.asm
SECTION rodata_font
SECTION rodata_font_fzx
PUBLIC _ff_ao_Klausjahn
_ff_ao_Klausjahn:
BINARY "font/fzx/fonts/ao/Klausjahn/Klausjahn.fzx"
|
programs/oeis/291/A291662.asm | karttu/loda | 1 | 163544 | <filename>programs/oeis/291/A291662.asm
; A291662: Number of ordered rooted trees with 2n non-root nodes such that the maximal outdegree equals n.
; 1,1,8,53,326,1997,12370,77513,490306,3124541,20030000,129024469,834451788,5414950283,35240152706,229911617041,1503232609082,9847379391133,64617565719052,424655979547781,2794563003870310,18412956934908669
mov $1,$0
sub $0,1
add $0,$1
mov $2,$1
add $1,$0
bin $1,$0
sub $1,$2
|
src/test/resources/testData/parse/live_samples/mail.scpt | stigger/AppleScript-IDEA | 18 | 4056 | <filename>src/test/resources/testData/parse/live_samples/mail.scpt
property theBusinessName:"This is just for me."
set the_subject to "Hourly report"
set the_content to return & return & "Email to : This is just for me." & return & return & "1 am : 6 ●●●●●●◆◆◆" & return & "2 am : 4 ●●●●◆◆" & return & "3 am : 5 ●●●●●◆" & return
set textcolor to {7 * 256, 93 * 256, 5 * 256}
try
set pathToMe to (path to applications folder) & "Mail Manager:Mail Manager.app:" as text
set logoPath to pathToMe & "Contents:Resources:Report Logo.png" as text
set PosixLogoPath to POSIX path of logoPath
end try
tell application "Mail"
activate
make
delete
set p to 4
set newMessage to make new outgoing message with properties {visible:true, subject:the_subject, content:the_content}
set p to 5
tell content of newMessage
try
set y to count of the_content
set color of characters 1 thru y to textcolor
end try
try
set x to offset of my theBusinessName in the_content
set font of characters x thru (x + (count of my theBusinessName) - 1) to "Helvetica Bold"
set color of characters x thru (x + (count of my theBusinessName) - 1) to {56342, 2442, 607}
end try
try
set x to offset of ("Hourly " & my hourCutOff & " Report" as rich text) in the_content
if x ≠ 0 then
set xx to count of ("Hourly " & (my hourCutOff) & " Report" as rich text)
try
set font of characters x thru (x + xx - 1) to "Cochin"
end try
set size of characters x thru (x + xx - 1) to 20
set color of characters x thru (x + xx - 1) to {43 * 256, 0, 256 * 256 - 1}
end if
end try
try
set x to 0
set xxx to (count of the_content)
repeat
set x to x + 1
if character x of the_content = "●" then
set xx to 0
repeat
set xx to xx + 1
if character (x + xx) of the_content ≠ "●" then
set color of characters x through (x + (xx - 1)) to {56342, 2442, 607}
set x to x + xx
exit repeat
end if
end repeat
end if
if character x of the_content = "◆" then
set xx to 0
repeat
set xx to xx + 1
if character (x + xx) of the_content ≠ "◆" then
set size of characters x through (x + (xx - 1)) to 10
set x to x + xx
exit repeat
end if
end repeat
end if
if x ≥ xxx then exit repeat
end repeat
end try
end tell
activate
tell newMessage
set p to 20.1
try
repeat with themailitem in theCCRecipients
set p to 20.5
make new to recipient at end of to recipients with properties {address:themailitem}
end repeat
end try
try
set p to 20.6
make new attachment with properties {file name:PosixLogoPath as POSIX file} at before first paragraph
on error errmsg number errnum
tell application "System Events" to display dialog "eMailIt setting Logo error " & errmsg & " number " & errnum
end try
end tell
end tell
|
src/pipe_streams.ads | aeszter/sharepoint2ics | 0 | 22911 | with Input_Sources; use Input_Sources;
with Unicode;
with POSIX.IO; use POSIX.IO;
with POSIX.Process_Identification;
with POSIX; use POSIX;
package Pipe_Streams is
-- Stream read from a pipe, used to interface with xmlADA
type Pipe_Stream is new Input_Source with private;
Failed_Creation_Error : exception;
Exception_Error : exception;
Other_Error : exception;
overriding procedure Next_Char (From : in out Pipe_Stream;
C : out Unicode.Unicode_Char);
pragma Inline (Next_Char);
-- Return a single character from From.
overriding function Eof (From : Pipe_Stream) return Boolean;
-- Return True if there is no more character to read on the stream
overriding procedure Close (Input : in out Pipe_Stream);
procedure Execute (P : in out Pipe_Stream;
Command : String;
Arguments : POSIX_String_List);
private
type Pipe_Stream is new Input_Source with record
Pipe : File_Descriptor;
Buffer : IO_Buffer (1 .. 1_024);
Position : Natural := 0;
Last_Read : IO_Count := 0;
-- points after the character last read
Eof_Reached : Boolean := False;
PID : Process_Identification.Process_ID;
end record;
end Pipe_Streams;
|
oeis/142/A142007.asm | neoneye/loda-programs | 11 | 26692 | ; A142007: Primes congruent to 3 mod 31.
; Submitted by <NAME>
; 3,127,251,313,499,809,1181,1367,1429,1553,1801,1987,2111,2297,2731,2917,3041,3413,3847,4157,4219,4591,5087,5273,5521,6079,6203,6389,6451,6637,6761,6823,6947,7691,7753,7877,8311,8807,9241,9551,9613,9923,10357,10667,10729,10853,11287,11411,11597,11783,11969,12527,12589,12713,12899,13147,13457,13829,14387,14449,14759,14821,15131,15193,15937,16061,16433,16619,17053,17239,17921,18169,18541,18913,19037,19471,19843,20029,20773,20897,20959,21269,21517,22013,22447,22571,22943,23563,23687,23873,24121
mov $2,36
mul $2,$0
mov $4,2
lpb $2
mov $3,$4
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,62
lpe
mov $0,$4
add $0,1
|
libsrc/_DEVELOPMENT/adt/wv_priority_queue/z80/asm_wv_priority_queue_resize.asm | meesokim/z88dk | 0 | 23802 | <filename>libsrc/_DEVELOPMENT/adt/wv_priority_queue/z80/asm_wv_priority_queue_resize.asm
; ===============================================================
; Mar 2014
; ===============================================================
;
; int wv_priority_queue_resize(wv_priority_queue_t *q, size_t n)
;
; Attempt to resize the queue to n bytes.
;
; If n <= queue.capacity, the array owned by the queue will
; have its size set to n.
;
; This resize operation does not change the contents of the queue
; array; instead it is assumed the queue array of the new size
; contains all valid data, possibly not in heap order. The
; resize operation therefore triggers a heapify to make sure
; the queue is kept in heap order. This means the caller can
; place data directly into the queue's array and then call this
; function to have it ordered into a heap.
;
; ===============================================================
SECTION code_adt_wv_priority_queue
PUBLIC asm_wv_priority_queue_resize
EXTERN asm_wa_priority_queue_resize
defc asm_wv_priority_queue_resize = asm_wa_priority_queue_resize
; enter : hl = queue *
; de = n = desired size in words
;
; exit : success
;
; hl = 0
; carry reset
;
; fail if queue is too small
;
; hl = -1
; carry set
;
; uses : af, bc, de, hl, ix
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1576.asm | ljhsiun2/medusa | 9 | 92737 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x11965, %r12
nop
nop
nop
nop
xor %r11, %r11
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
and $0xffffffffffffffc0, %r12
vmovaps %ymm3, (%r12)
nop
nop
nop
nop
nop
inc %rax
lea addresses_WT_ht+0x2d4b, %rsi
lea addresses_D_ht+0xc8f, %rdi
nop
nop
nop
add $36366, %r10
mov $70, %rcx
rep movsb
nop
nop
nop
xor %r11, %r11
lea addresses_D_ht+0x280f, %r12
nop
nop
nop
nop
xor %r10, %r10
movw $0x6162, (%r12)
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0x14b03, %rdi
nop
nop
and $14454, %rcx
vmovups (%rdi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %r10
nop
nop
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0xadbf, %rsi
lea addresses_WC_ht+0x18e57, %rdi
nop
nop
nop
add $25472, %rbp
mov $60, %rcx
rep movsq
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x11b0f, %rsi
lea addresses_UC_ht+0x687f, %rdi
nop
nop
nop
and $10802, %rbp
mov $76, %rcx
rep movsw
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_normal_ht+0x1608f, %rdi
nop
and %rax, %rax
movl $0x61626364, (%rdi)
nop
nop
nop
nop
and $57553, %rax
lea addresses_UC_ht+0x8b8f, %r11
nop
nop
nop
nop
nop
add %rax, %rax
movups (%r11), %xmm1
vpextrq $1, %xmm1, %rsi
nop
cmp $26280, %r10
lea addresses_UC_ht+0x1f4f, %rsi
lea addresses_normal_ht+0x7237, %rdi
nop
xor %rbp, %rbp
mov $18, %rcx
rep movsb
nop
add %r12, %r12
lea addresses_A_ht+0xc6ab, %r11
cmp $25934, %rdi
movl $0x61626364, (%r11)
nop
add $27218, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r8
push %rax
push %rbx
push %rcx
push %rdi
// Store
lea addresses_WT+0x148f, %r12
clflush (%r12)
cmp $64188, %rax
mov $0x5152535455565758, %rcx
movq %rcx, (%r12)
nop
nop
dec %rcx
// Faulty Load
lea addresses_RW+0x438f, %rbx
and $64699, %r8
mov (%rbx), %rdi
lea oracles, %rax
and $0xff, %rdi
shlq $12, %rdi
mov (%rax,%rdi,1), %rdi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WT', 'AVXalign': False, 'size': 8}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 32}}
{'src': {'same': True, 'congruent': 1, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}}
{'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
Categories/Agda/ISetoids/Complete.agda | copumpkin/categories | 98 | 3313 | <reponame>copumpkin/categories
module Categories.Agda.ISetoids.Complete where
open import Level
open import Relation.Binary using (Setoid; module Setoid; Preorder; module Preorder; Rel; _=[_]⇒_)
open import Data.Product using (Σ; _,_; proj₁; proj₂)
open import Categories.Support.IProduct
-- import Relation.Binary.EqReasoning as EqReasoning
open import Categories.Support.Equivalence using (module I→R-Wrapper; setoid-i→r; Fam-setoid; ∀[_]-setoid_)
renaming (Setoid to ISetoid; module Setoid to ISetoid)
open import Categories.Support.SetoidFunctions using (module _⟶_)
open import Categories.Support.PropositionalEquality
import Categories.Support.ZigZag as ZigZag
open import Categories.Category
open import Categories.Functor
import Categories.NaturalTransformation as NT
open import Categories.Agda
open import Categories.Colimit
open import Categories.Object.Initial
open import Categories.Cocones
open import Categories.Cocone
ISetoidsComplete : ∀ {o ℓ e c ℓ′} → Cocomplete o ℓ e (Category.op (ISetoids (c ⊔ ℓ′ ⊔ (o ⊔ ℓ ⊔ e)) (c ⊔ (o ⊔ ℓ ⊔ e))))
ISetoidsComplete {o} {ℓ} {e} {c} {cℓ} = record { colimit = colimit }
where
c′ = c ⊔ cℓ ⊔ (o ⊔ ℓ ⊔ e)
ℓ′ = c ⊔ (o ⊔ ℓ ⊔ e)
C = Category.op (ISetoids c′ ℓ′)
colimit : ∀ {J : Category o ℓ e} (F : Functor J C) → Colimit F
colimit {J} F = record { initial = record
{ ⊥ = record
{ N = Fam-setoid (Σ′ (∀ j → Carrier (F₀ j)) (λ f → ∀ {a b} (h : a J.⇒ b) → (F₀ a ≈ F₁ h ⟨$⟩ f b) (f a)))
(∀[ J.Obj ]-setoid F₀) proj₁′
; ψ = λ X → record
{ _⟨$⟩_ = λ f → proj₁′ f X
; cong = λ eq → eq X
}
; commute = λ {X} {Y} h {f} {g} f≈g → trans (F₀ X) (f≈g X) (sym (F₀ X) (proj₂′ g h))
}
; ! = λ {A} → record
{ f = record
{ _⟨$⟩_ = λ X → (λ j → Cocone.ψ A j ⟨$⟩ X) , (λ {a} {b} h → sym (F₀ a) (Cocone.commute A h (refl (Cocone.N A))))
; cong = λ i≈j a → cong (Cocone.ψ A a) i≈j
}
; commute = λ {X} x≈y → cong (Cocone.ψ A X) x≈y
}
; !-unique = λ {A} f x≈y a → sym (F₀ a) (CoconeMorphism.commute f (sym (Cocone.N A) x≈y))
} }
where
module J = Category J
open Functor F
open ISetoid
open _⟶_
|
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_28.asm | ljhsiun2/medusa | 9 | 80257 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x13438, %rdx
clflush (%rdx)
nop
nop
nop
nop
nop
xor %r14, %r14
movb $0x61, (%rdx)
sub %r12, %r12
lea addresses_WT_ht+0xbba4, %rsi
lea addresses_D_ht+0xab38, %rdi
nop
nop
nop
add %rbp, %rbp
mov $119, %rcx
rep movsw
nop
dec %rdx
lea addresses_WT_ht+0x3138, %rbp
nop
nop
nop
nop
sub $57126, %rcx
movb $0x61, (%rbp)
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0x11d38, %rsi
cmp $14287, %rcx
mov (%rsi), %rbp
inc %rdi
lea addresses_normal_ht+0xd658, %rcx
nop
add %r12, %r12
mov (%rcx), %r14w
nop
sub %rsi, %rsi
lea addresses_A_ht+0x6f6c, %rcx
nop
nop
nop
nop
nop
sub $1877, %r12
mov (%rcx), %esi
add %rdx, %rdx
lea addresses_WC_ht+0x196e, %rsi
cmp $4015, %r14
mov (%rsi), %ebp
nop
nop
nop
nop
mfence
lea addresses_A_ht+0x19c90, %rdi
nop
nop
nop
dec %rdx
mov (%rdi), %cx
sub $563, %rsi
lea addresses_UC_ht+0x10938, %r14
nop
add $38066, %r12
mov (%r14), %ebp
nop
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x157dc, %rsi
lea addresses_UC_ht+0x16818, %rdi
add %r13, %r13
mov $114, %rcx
rep movsl
dec %rdi
lea addresses_UC_ht+0x5040, %r13
xor %rbp, %rbp
movb (%r13), %cl
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_UC_ht+0xad38, %r14
cmp $16161, %rcx
movb (%r14), %r13b
nop
nop
nop
sub %r13, %r13
lea addresses_UC_ht+0x3e20, %rsi
lea addresses_A_ht+0x1eb38, %rdi
nop
and $58080, %r12
mov $127, %rcx
rep movsq
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0xaf38, %r13
nop
nop
inc %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm5
vmovups %ymm5, (%r13)
nop
nop
nop
nop
add %rsi, %rsi
lea addresses_A_ht+0x1c8f8, %rdi
nop
nop
nop
cmp $57892, %rbp
movl $0x61626364, (%rdi)
nop
nop
nop
nop
nop
add %r12, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// Store
lea addresses_D+0x1338, %r8
nop
nop
inc %rsi
movl $0x51525354, (%r8)
nop
nop
nop
xor %r8, %r8
// Store
lea addresses_D+0x1338, %rbp
nop
nop
sub $38963, %r9
mov $0x5152535455565758, %r10
movq %r10, %xmm0
movups %xmm0, (%rbp)
nop
nop
nop
nop
and $50457, %rbp
// Faulty Load
lea addresses_D+0x1338, %rsi
nop
nop
xor $5653, %r9
mov (%rsi), %r8w
lea oracles, %rcx
and $0xff, %r8
shlq $12, %r8
mov (%rcx,%r8,1), %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
thirdparty/adasdl/thin/adasdl/AdaSDL_mixer/sdl_mixer.adb | Lucretia/old_nehe_ada95 | 0 | 10697 |
-- ----------------------------------------------------------------- --
-- ASDL_Mixer --
-- Binding to SDL mixer lib --
-- Copyright (C) 2001 A.M.F.Vargas --
-- <NAME> --
-- <NAME> - Azores - Portugal --
-- E-mail: <EMAIL> --
-- ----------------------------------------------------------------- --
-- --
-- This library 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. --
-- --
-- This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public --
-- License along with this library; if not, write to the --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
-- ----------------------------------------------------------------- --
-- **************************************************************** --
-- This is an Ada binding to SDL_mixer lib from Sam Lantinga at --
-- www.libsld.org --
-- **************************************************************** --
package body SDL_Mixer is
use type C.int;
-- ======================================
function LoadWAV (file : CS.chars_ptr) return Chunk_ptr is
begin
return LoadWAV_RW (RW.RWFromFile (file, CS.New_String ("rb")), 1);
end LoadWAV;
-- ======================================
function Load_WAV (file : String) return Chunk_ptr is
begin
return LoadWAV_RW (RW.RW_From_File (file, "rb"), 1);
end Load_WAV;
-- ======================================
function Load_MUS (file : String) return Music_ptr is
begin
return LoadMUS (CS.New_String (file));
end Load_MUS;
-- ======================================
function PlayChannel (
channel : C.int;
chunk : Chunk_ptr;
loops : C.int)
return C.int
is
begin
return PlayChannelTimed (channel, chunk, loops, -1);
end PlayChannel;
-- ======================================
procedure PlayChannel (
channel : C.int;
chunk : Chunk_ptr;
loops : C.int)
is
begin
PlayChannelTimed (channel, chunk, loops, -1);
end PlayChannel;
-- ======================================
function FadeInChannel (
channel : C.int;
chunk : Chunk_ptr;
loops : C.int;
ms : C.int)
return C.int
is
begin
return FadeInChannelTimed (channel, chunk, loops, ms, -1);
end FadeInChannel;
-- ======================================
function Set_Music_CMD (command : String) return Integer is
begin
if command = "" then
return Integer (SetMusicCMD (CS.Null_Ptr));
else
return Integer (SetMusicCMD (CS.New_String (command)));
end if;
end Set_Music_CMD;
-- ======================================
procedure Set_Music_CMD (command : String) is
begin
if command = "" then
SetMusicCMD (CS.Null_Ptr);
else
SetMusicCMD (CS.New_String (command));
end if;
end Set_Music_CMD;
-- ======================================
end SDL_Mixer;
|
Cubical/HITs/CumulativeHierarchy/Base.agda | thomas-lamiaux/cubical | 1 | 17333 | {-# OPTIONS --safe #-}
{-
This file models "ZF - powerset" in cubical agda, via a cumulative hierarchy, in the sense given
in the HoTT book §10.5 "The cumulative hierarchy".
A great amount of inspiration is taken from the Coq implementations found in
<NAME>, Modeling set theory in homotopy type theory, code of which can be found online at
https://github.com/jledent/vset
-}
module Cubical.HITs.CumulativeHierarchy.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Path
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Equiv using (fiber)
open import Cubical.Functions.Logic
open import Cubical.Data.Sigma
open import Cubical.HITs.PropositionalTruncation as P hiding (elim; elim2)
import Cubical.HITs.PropositionalTruncation.Monad as PropMonad
private
variable
ℓ ℓ' : Level
infix 5 _∈_
-- set up the basic hierarchy definition and _∈_ as recursive, higher inductive types
data V (ℓ : Level) : Type (ℓ-suc ℓ)
_∈_ : (S T : V ℓ) → hProp (ℓ-suc ℓ)
eqImage : {X Y : Type ℓ} (ix : X → V ℓ) (iy : Y → V ℓ) → Type (ℓ-suc ℓ)
eqImage {X = X} {Y = Y} ix iy = (∀ (a : X) → ∥ fiber iy (ix a) ∥₁) ⊓′
(∀ (b : Y) → ∥ fiber ix (iy b) ∥₁)
data V ℓ where
sett : (X : Type ℓ) → (X → V ℓ) → V ℓ
seteq : (X Y : Type ℓ) (ix : X → V ℓ) (iy : Y → V ℓ) (eq : eqImage ix iy) → sett X ix ≡ sett Y iy
setIsSet : isSet (V ℓ)
A ∈ sett X ix = ∥ Σ[ i ∈ X ] (ix i ≡ A) ∥ₚ
A ∈ seteq X Y ix iy (f , g) i =
⇔toPath {P = A ∈ sett X ix} {Q = A ∈ sett Y iy}
(λ ax → do (x , xa) ← ax ; (y , ya) ← f x ; ∣ y , ya ∙ xa ∣₁)
(λ ay → do (y , ya) ← ay ; (x , xa) ← g y ; ∣ x , xa ∙ ya ∣₁) i
where open PropMonad
A ∈ setIsSet a b p q i j = isSetHProp (A ∈ a) (A ∈ b) (λ j → A ∈ p j) (λ j → A ∈ q j) i j
-- setup a general eliminator into h-sets
record ElimSet {Z : (s : V ℓ) → Type ℓ'}
(isSetZ : ∀ s → isSet (Z s)) : Type (ℓ-max ℓ' (ℓ-suc ℓ)) where
field
ElimSett :
∀ (X : Type ℓ) (ix : X → V ℓ)
-- ^ the structural parts of the set
→ (rec : ∀ x → Z (ix x))
-- ^ a recursor into the elements
→ Z (sett X ix)
ElimEq :
∀ (X₁ X₂ : Type ℓ) (ix₁ : X₁ → V ℓ) (ix₂ : X₂ → V ℓ) (eq : eqImage ix₁ ix₂)
-- ^ the structural parts of the seteq path
→ (rc₁ : ∀ x₁ → Z (ix₁ x₁)) (rc₂ : ∀ x₂ → Z (ix₂ x₂))
-- ^ recursors into the elements
→ ((x₁ : X₁) → ∃[ (x₂ , p) ∈ fiber ix₂ (ix₁ x₁) ] PathP (λ i → Z (p i)) (rc₂ x₂) (rc₁ x₁))
→ ((x₂ : X₂) → ∃[ (x₁ , p) ∈ fiber ix₁ (ix₂ x₂) ] PathP (λ i → Z (p i)) (rc₁ x₁) (rc₂ x₂))
-- ^ proofs that the recursors have equal images
→ PathP (λ i → Z (seteq X₁ X₂ ix₁ ix₂ eq i)) (ElimSett X₁ ix₁ rc₁) (ElimSett X₂ ix₂ rc₂)
module _ {Z : (s : V ℓ) → Type ℓ'} {isSetZ : ∀ s → isSet (Z s)} (E : ElimSet isSetZ) where
open ElimSet E
elim : (s : V ℓ) → Z s
elim (sett X ix) = ElimSett X ix (elim ∘ ix)
elim (seteq X₁ X₂ ix₁ ix₂ eq i) =
ElimEq X₁ X₂ ix₁ ix₂ eq (elim ∘ ix₁) (elim ∘ ix₂) rec₁→₂ rec₂→₁ i
where
rec₁→₂ :
∀ (x₁ : X₁)
→ ∃[ (x₂ , p) ∈ fiber ix₂ (ix₁ x₁) ] PathP (λ i → Z (p i)) (elim (ix₂ x₂)) (elim (ix₁ x₁))
rec₂→₁ :
∀ (x₂ : X₂)
→ ∃[ (x₁ , p) ∈ fiber ix₁ (ix₂ x₂) ] PathP (λ i → Z (p i)) (elim (ix₁ x₁)) (elim (ix₂ x₂))
-- using a local definition of Prop.rec satisfies the termination checker
rec₁→₂ x₁ = localRec₁ (eq .fst x₁) where
localRec₁ :
∥ fiber ix₂ (ix₁ x₁) ∥₁
→ ∃[ (x₂ , p) ∈ fiber ix₂ (ix₁ x₁) ] PathP (λ i → Z (p i)) (elim (ix₂ x₂)) (elim (ix₁ x₁))
localRec₁ ∣ x₂ , xx ∣₁ = ∣ (x₂ , xx) , (λ i → elim (xx i)) ∣₁
localRec₁ (squash₁ x y i) = squash₁ (localRec₁ x) (localRec₁ y) i
rec₂→₁ x₂ = localRec₂ (eq .snd x₂) where
localRec₂ :
∥ fiber ix₁ (ix₂ x₂) ∥₁
→ ∃[ (x₁ , p) ∈ fiber ix₁ (ix₂ x₂) ] PathP (λ i → Z (p i)) (elim (ix₁ x₁)) (elim (ix₂ x₂))
localRec₂ ∣ x₁ , xx ∣₁ = ∣ (x₁ , xx) , (λ i → elim (xx i)) ∣₁
localRec₂ (squash₁ x y i) = squash₁ (localRec₂ x) (localRec₂ y) i
elim (setIsSet S T x y i j) = isProp→PathP propPathP (cong elim x) (cong elim y) i j where
propPathP : (i : I) → isProp (PathP (λ j → Z (setIsSet S T x y i j)) (elim S) (elim T))
propPathP _ = subst isProp (sym (PathP≡Path _ _ _)) (isSetZ _ _ _)
-- eliminator into propositions
elimProp : {Z : (s : V ℓ) → Type ℓ'} (isPropZ : ∀ s → isProp (Z s))
→ ((X : Type ℓ) → (ix : X → V ℓ) → (∀ x → Z (ix x)) → Z (sett X ix))
→ (s : V ℓ) → Z s
elimProp isPropZ algz (sett X ix) = algz X ix (λ x → elimProp isPropZ algz (ix x))
elimProp isPropZ algz (seteq X Y ix iy eq i) =
isProp→PathP (λ i → isPropZ (seteq X Y ix iy eq i))
(algz X ix (elimProp isPropZ algz ∘ ix))
(algz Y iy (elimProp isPropZ algz ∘ iy)) i
elimProp isPropZ algz (setIsSet S T x y i j) =
isProp→SquareP (λ i j → isPropZ (setIsSet S T x y i j))
(λ _ → elimProp isPropZ algz S)
(λ _ → elimProp isPropZ algz T)
(cong (elimProp isPropZ algz) x)
(cong (elimProp isPropZ algz) y) i j
-- eliminator for two sets at once
record Elim2Set {Z : (s t : V ℓ) → Type ℓ'}
(isSetZ : ∀ s t → isSet (Z s t)) : Type (ℓ-max ℓ' (ℓ-suc ℓ)) where
field
ElimSett2 :
∀ (X : Type ℓ) (ix : X → V ℓ) (Y : Type ℓ) (iy : Y → V ℓ)
-- ^ the structural parts of the set
→ (rec : ∀ x y → Z (ix x) (iy y))
-- ^ a recursor into the elements
→ Z (sett X ix) (sett Y iy)
-- path when the the first argument deforms along seteq and the second argument is held constant
ElimEqFst :
∀ (X₁ X₂ : Type ℓ) (ix₁ : X₁ → V ℓ) (ix₂ : X₂ → V ℓ) (eq : eqImage ix₁ ix₂)
-- ^ the structural parts of the seteq path
→ (Y : Type ℓ) (iy : Y → V ℓ)
-- ^ the second argument held constant
→ (rec₁ : ∀ x₁ y → Z (ix₁ x₁) (iy y)) (rec₂ : ∀ x₂ y → Z (ix₂ x₂) (iy y))
-- ^ recursors into the elements
→ (rec₁→₂ : (x₁ : X₁)
→ ∃[ (x₂ , p) ∈ fiber ix₂ (ix₁ x₁) ]
PathP (λ i → ∀ y → Z (p i) (iy y)) (λ y → rec₂ x₂ y) (λ y → rec₁ x₁ y))
→ (rec₂→₁ : (x₂ : X₂)
→ ∃[ (x₁ , p) ∈ fiber ix₁ (ix₂ x₂) ]
PathP (λ i → ∀ y → Z (p i) (iy y)) (λ y → rec₁ x₁ y) (λ y → rec₂ x₂ y))
-- ^ proofs that the recursors have equal images
→ PathP (λ i → Z (seteq X₁ X₂ ix₁ ix₂ eq i) (sett Y iy))
(ElimSett2 X₁ ix₁ Y iy rec₁)
(ElimSett2 X₂ ix₂ Y iy rec₂)
-- path when the the second argument deforms along seteq and the first argument is held constant
ElimEqSnd :
∀ (X : Type ℓ) (ix : X → V ℓ)
-- ^ the first argument held constant
→ (Y₁ Y₂ : Type ℓ) (iy₁ : Y₁ → V ℓ) (iy₂ : Y₂ → V ℓ) → (eq : eqImage iy₁ iy₂)
-- ^ the structural parts of the seteq path
→ (rec₁ : ∀ x y₁ → Z (ix x) (iy₁ y₁)) (rec₂ : ∀ x y₂ → Z (ix x) (iy₂ y₂))
-- ^ recursors into the elements
→ (rec₁→₂ : (y₁ : Y₁)
→ ∃[ (y₂ , p) ∈ fiber iy₂ (iy₁ y₁) ]
PathP (λ i → ∀ x → Z (ix x) (p i)) (λ x → rec₂ x y₂) (λ x → rec₁ x y₁))
→ (rec₂→₁ : (y₂ : Y₂)
→ ∃[ (y₁ , p) ∈ fiber iy₁ (iy₂ y₂) ]
PathP (λ i → ∀ x → Z (ix x) (p i)) (λ x → rec₁ x y₁) (λ x → rec₂ x y₂))
-- ^ proofs that the recursors have equal images
→ PathP (λ i → Z (sett X ix) (seteq Y₁ Y₂ iy₁ iy₂ eq i))
(ElimSett2 X ix Y₁ iy₁ rec₁)
(ElimSett2 X ix Y₂ iy₂ rec₂)
module _ {Z : (s t : V ℓ) → Type ℓ'} {isSetZ : ∀ s t → isSet (Z s t)} (E : Elim2Set isSetZ) where
open Elim2Set E
open ElimSet
elim2 : (s t : V ℓ) → Z s t
elim2 = elim pElim where
open PropMonad
isSetPElim : ∀ s → isSet (∀ t → Z s t)
isSetPElim s = isSetΠ (isSetZ s)
eliminatorImplX : (X : Type ℓ) (ix : X → V ℓ)
→ (rec : ∀ x y → Z (ix x) y)
→ ElimSet (λ t → isSetZ (sett X ix) t)
ElimSett (eliminatorImplX X ix rec) Y iy _ =
ElimSett2 X ix Y iy (λ x → rec x ∘ iy)
ElimEq (eliminatorImplX X ix rec) Y₁ Y₂ iy₁ iy₂ eq _ _ _ _ =
ElimEqSnd X ix Y₁ Y₂ iy₁ iy₂ eq (λ x → rec x ∘ iy₁) (λ x → rec x ∘ iy₂) rec₁→₂ rec₂→₁
where
rec₁→₂ :
∀ (y₁ : Y₁)
→ ∃[ (y₂ , p) ∈ fiber iy₂ (iy₁ y₁) ]
PathP (λ i → ∀ x → Z (ix x) (p i)) (λ x → rec x (iy₂ y₂)) (λ x → rec x (iy₁ y₁))
rec₂→₁ :
∀ (y₂ : Y₂)
→ ∃[ (y₁ , p) ∈ fiber iy₁ (iy₂ y₂) ]
PathP (λ i → ∀ x → Z (ix x) (p i)) (λ x → rec x (iy₁ y₁)) (λ x → rec x (iy₂ y₂))
rec₁→₂ y₁ = do (y₂ , yy) ← fst eq y₁ ; ∣ (y₂ , yy) , (λ i x → rec x (yy i)) ∣₁
rec₂→₁ y₂ = do (y₁ , yy) ← snd eq y₂ ; ∣ (y₁ , yy) , (λ i x → rec x (yy i)) ∣₁
elimImplS :
∀ (X : Type ℓ) (ix : X → V ℓ)
→ (∀ x t₂ → Z (ix x) t₂)
→ (t : V ℓ) → Z (sett X ix) t
elimImplS X ix rec = elim (eliminatorImplX X ix rec)
elimImplSExt :
∀ (X₁ X₂ : Type ℓ) (ix₁ : X₁ → V ℓ) (ix₂ : X₂ → V ℓ) → (eq : eqImage ix₁ ix₂)
→ (rec₁ : ∀ x₁ t₂ → Z (ix₁ x₁) t₂) (rec₂ : ∀ x₂ t₂ → Z (ix₂ x₂) t₂)
→ ((x₁ : X₁) → ∃[ (x₂ , p) ∈ fiber ix₂ (ix₁ x₁) ]
PathP (λ i → ∀ t → Z (p i) t) (rec₂ x₂) (rec₁ x₁))
→ ((x₂ : X₂) → ∃[ (x₁ , p) ∈ fiber ix₁ (ix₂ x₂) ]
PathP (λ i → ∀ t → Z (p i) t) (rec₁ x₁) (rec₂ x₂))
→ (t : V ℓ)
→ PathP (λ i → Z (seteq X₁ X₂ ix₁ ix₂ eq i) t)
(elimImplS X₁ ix₁ rec₁ t)
(elimImplS X₂ ix₂ rec₂ t)
elimImplSExt X₁ X₂ ix₁ ix₂ eq rec₁ rec₂ rec₁→₂ rec₂→₁ =
elimProp propPathP (λ Y iy _ → elimImplSExtT Y iy)
where
propPathP : (t : V ℓ)
→ isProp (PathP (λ i → Z (seteq X₁ X₂ ix₁ ix₂ eq i) t)
(elimImplS X₁ ix₁ rec₁ t)
(elimImplS X₂ ix₂ rec₂ t))
propPathP _ = subst isProp (sym (PathP≡Path _ _ _)) (isSetZ _ _ _ _)
elimImplSExtT : (Y : Type ℓ) (iy : Y → V ℓ) → _ {- the appropriate path type -}
elimImplSExtT Y iy =
ElimEqFst X₁ X₂ ix₁ ix₂ eq Y iy (λ x₁ y → rec₁ x₁ (iy y))
(λ x₂ y → rec₂ x₂ (iy y)) rec₁→₂Impl rec₂→₁Impl
where
rec₁→₂Impl :
∀ (x₁ : X₁)
→ ∃[ (x₂ , p) ∈ fiber ix₂ (ix₁ x₁) ]
PathP (λ i → ∀ y → Z (p i) (iy y)) (λ y → rec₂ x₂ (iy y)) (λ y → rec₁ x₁ (iy y))
rec₂→₁Impl :
∀ (x₂ : X₂)
→ ∃[ (x₁ , p) ∈ fiber ix₁ (ix₂ x₂) ]
PathP (λ i → ∀ y → Z (p i) (iy y)) (λ y → rec₁ x₁ (iy y)) (λ y → rec₂ x₂ (iy y))
rec₁→₂Impl x₁ = do ((x₂ , xx) , rx) ← rec₁→₂ x₁ ; ∣ (x₂ , xx) , (λ i y → rx i (iy y)) ∣₁
rec₂→₁Impl x₂ = do ((x₁ , xx) , rx) ← rec₂→₁ x₂ ; ∣ (x₁ , xx) , (λ i y → rx i (iy y)) ∣₁
pElim : ElimSet isSetPElim
ElimSett pElim = elimImplS
ElimEq pElim X₁ X₂ ix₁ ix₂ eq rec₁ rec₂ rec₁→₂ rec₂→₁ i t =
elimImplSExt X₁ X₂ ix₁ ix₂ eq rec₁ rec₂ rec₁→₂ rec₂→₁ t i
|
alloy4fun_models/trainstlt/models/5/2Z7ppb6FjBhAtRaF5.als | Kaixi26/org.alloytools.alloy | 0 | 2899 | <filename>alloy4fun_models/trainstlt/models/5/2Z7ppb6FjBhAtRaF5.als<gh_stars>0
open main
pred id2Z7ppb6FjBhAtRaF5_prop6 {
always Signal in Green and after no Green' or no Green and Signal in Green'
}
pred __repair { id2Z7ppb6FjBhAtRaF5_prop6 }
check __repair { id2Z7ppb6FjBhAtRaF5_prop6 <=> prop6o } |
test/Succeed/ProjectionLikeAndConstructorHeaded.agda | cruhland/agda | 1,989 | 13059 | {- Constructor-headedness and projection-likeness don't play well
together. Unless they are kept apart or their differences can
be reconciled this example will leave unsolved metas. The problem
is that invoking constructor-headedness on a projection-like
the dropped arguments won't be checked (or rather, the type of
the eliminatee, which is where the dropped arguments live, isn't
checked).
-}
module ProjectionLikeAndConstructorHeaded where
data ℕ : Set where
zero : ℕ
suc : (n : ℕ) → ℕ
data Fin : ℕ → Set where
zero : {n : ℕ} → Fin (suc n)
suc : {n : ℕ} (i : Fin n) → Fin (suc n)
data ⊥ : Set where
record ⊤ : Set where
data Dec (P : Set) : Set where
yes : ( p : P) → Dec P
no : (¬p : P → ⊥) → Dec P
data Bool : Set where
false true : Bool
T : Bool → Set
T true = ⊤
T false = ⊥
⌊_⌋ : ∀ {P : Set} → Dec P → Bool
⌊ yes _ ⌋ = true
⌊ no _ ⌋ = false
True : ∀ {P : Set} → Dec P → Set
True Q = T ⌊ Q ⌋
toWitness : ∀ {P : Set} {Q : Dec P} → True Q → P
toWitness {Q = yes p} _ = p
toWitness {Q = no _} ()
postulate
_≤_ : ℕ → ℕ → Set
fromℕ≤ : ∀ {m n} → m ≤ n → Fin n
_≤?_ : ∀ n m → Dec (n ≤ m)
#_ : ∀ m {n} {m<n : True (m ≤? n)} → Fin n
#_ m {n} {m<n = m<n} = fromℕ≤ {_} {n} (toWitness {_ ≤ n} {_} m<n)
|
attic/asis/find_entities/adam-assist-query-find_entities-unit_processing.ads | charlie5/aIDE | 3 | 29136 | with
Asis;
package AdaM.Assist.Query.find_Entities.unit_Processing
is
procedure Process_Unit (The_Unit : in Asis.Compilation_Unit);
end AdaM.Assist.Query.find_Entities.unit_Processing;
|
src/main.asm | QuinnPainter/GameBoyFullScreen | 0 | 10702 | INCLUDE "hardware.inc"
SECTION "Image", ROM0
INCBIN "obj/image.2bpp"
SECTION "MainCode", ROM0
ASSERT SIZEOF("Image") <= ((160 * 144 * 2) / 8), "Image is too large! Needs to be 160 x 144"
EntryPoint::
ld sp, $E000 ; Set the stack pointer to the top of RAM to free up HRAM
; Turn off the LCD
.waitVBlank:
ld a, [rLY]
cp 144 ; Check if the LCD is past VBlank
jr c, .waitVBlank
xor a ; turn off the LCD
ld [rLCDC], a
; Copy image tileset into VRAM
ld hl, _VRAM
ld de, STARTOF("Image")
ld bc, SIZEOF("Image")
call memcpy
; Copy first chunk of tilemap into VRAM
ld hl, _SCRN0
xor a
ld bc, 12 ; Offset needed to jump from end of this line to start of next line
ld e, 20 ; 20 tiles in a line
.tilemapCopyLp1:
ld [hli], a
dec e
jr nz, .noNewLine
add hl, bc
ld e, 20
.noNewLine:
inc a
cp $F0
jr nz, .tilemapCopyLp1
; Copy second chunk of tilemap into VRAM
ld hl, _SCRN1 + $180
ld a, -16
ld e, 20
.tilemapCopyLp2:
ld [hli], a
dec e
jr nz, .noNewLine2
add hl, bc
ld e, 20
.noNewLine2:
inc a
cp $68
jr nz, .tilemapCopyLp2
; Init display registers
ld a, %11100100 ; Init background palette
ldh [rBGP], a
xor a ; Init scroll registers
ldh [rSCY], a
ldh [rSCX], a
; Init mid-screen interrupt
ld a, 96 ; Scanline to interrupt on
ld [rLYC], a
ld a, STATF_LYC ; Enable LY=LYC interrupt source
ld [rSTAT], a
; Shut sound down
xor a
ldh [rNR52], a
; Enable screen and initialise screen settings
ld a, LCDCF_ON | LCDCF_WIN9C00 | LCDCF_WINOFF | LCDCF_BG8000 \
| LCDCF_BG9800 | LCDCF_OBJ8 | LCDCF_OBJOFF | LCDCF_BGON
ldh [rLCDC], a
; Disable all interrupts except VBlank and LCDC
ld a, IEF_VBLANK | IEF_LCDC
ldh [rIE], a
ei
MainLoop:
halt
jr MainLoop
VBlank::
ld a, [rLCDC]
set 4, a ; set background tileset to LCDCF_BG8000
res 3, a ; set background tilemap to LCDCF_BG9800
ld [rLCDC], a
reti
LCDInterrupt::
ld a, [rLCDC]
res 4, a ; set background tileset to LCDCF_BG8800
set 3, a ; set background tilemap to LCDCF_BG9C00
ld [rLCDC], a
reti
; Copies a block of data
; Input - HL = Destination address
; Input - DE = Start address
; Input - BC = Data length
; Sets - A B C to 0
; Sets - H L D E to garbage
memcpy::
ld a, [de] ; Grab 1 byte from the source
ld [hli], a ; Place it at the destination, incrementing hl
inc de ; Move to next byte
dec bc ; Decrement count
ld a, b ; Check if count is 0, since `dec bc` doesn't update flags
or c
jr nz, memcpy
ret |
programs/oeis/045/A045809.asm | karttu/loda | 0 | 103955 | <reponame>karttu/loda
; A045809: 9-ish numbers (end in 13, 37, 59, 91).
; 13,37,59,91,113,137,159,191,213,237,259,291,313,337,359,391,413,437,459,491,513,537,559,591,613,637,659,691,713,737,759,791,813,837,859,891,913,937,959,991,1013,1037,1059,1091,1113,1137,1159,1191,1213,1237,1259,1291,1313,1337,1359,1391,1413,1437,1459,1491,1513,1537,1559,1591,1613,1637,1659,1691,1713,1737,1759,1791,1813,1837,1859,1891,1913,1937,1959,1991,2013,2037,2059,2091,2113,2137,2159,2191,2213,2237,2259,2291,2313,2337,2359,2391,2413,2437,2459,2491,2513,2537,2559,2591,2613,2637,2659,2691,2713,2737,2759,2791,2813,2837,2859,2891,2913,2937,2959,2991,3013,3037,3059,3091,3113,3137,3159,3191,3213,3237,3259,3291,3313,3337,3359,3391,3413,3437,3459,3491,3513,3537,3559,3591,3613,3637,3659,3691,3713,3737,3759,3791,3813,3837,3859,3891,3913,3937,3959,3991,4013,4037,4059,4091,4113,4137,4159,4191,4213,4237,4259,4291,4313,4337,4359,4391,4413,4437,4459,4491,4513,4537,4559,4591,4613,4637,4659,4691,4713,4737,4759,4791,4813,4837,4859,4891,4913,4937,4959,4991,5013,5037,5059,5091,5113,5137,5159,5191,5213,5237,5259,5291,5313,5337,5359,5391,5413,5437,5459,5491,5513,5537,5559,5591,5613,5637,5659,5691,5713,5737,5759,5791,5813,5837,5859,5891,5913,5937,5959,5991,6013,6037,6059,6091,6113,6137,6159,6191,6213,6237
mov $2,$0
lpb $0,1
sub $0,1
trn $0,1
trn $1,4
add $1,5
add $3,6
add $4,1
sub $1,$4
sub $3,$1
sub $3,1
mov $4,$1
lpe
mov $1,$3
mul $1,2
lpb $2,1
add $1,22
sub $2,1
lpe
add $1,13
|
count.asm | haniyehnasseri/xv6SystemCalls | 0 | 179970 | <gh_stars>0
_count: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
#include "fcntl.h"
int main(int argc,char* argv[]){
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 56 push %esi
e: 53 push %ebx
f: 51 push %ecx
int n,digits,ret;
n=atoi(argv[1]);
__asm__ ( "movl %%esi, %0;"
10: 89 f3 mov %esi,%ebx
#include "stat.h"
#include "user.h"
#include "fcntl.h"
int main(int argc,char* argv[]){
12: 83 ec 18 sub $0x18,%esp
15: 8b 41 04 mov 0x4(%ecx),%eax
int n,digits,ret;
n=atoi(argv[1]);
18: ff 70 04 pushl 0x4(%eax)
1b: e8 00 02 00 00 call 220 <atoi>
:"=r" (ret)
:
:"%esi"
);
__asm__ ( "movl %0, %%esi;"
20: 89 c6 mov %eax,%esi
:
:"r"(n)
:"%esi"
);
digits=count(n);
22: 89 04 24 mov %eax,(%esp)
25: e8 20 03 00 00 call 34a <count>
__asm__ ( "movl %0, %%esi;"
2a: 89 de mov %ebx,%esi
:"r"(ret)
:"%esi"
);
printf(1,"digits:%d\n",digits);
2c: 83 c4 0c add $0xc,%esp
2f: 50 push %eax
30: 68 30 07 00 00 push $0x730
35: 6a 01 push $0x1
37: e8 d4 03 00 00 call 410 <printf>
exit();
3c: e8 51 02 00 00 call 292 <exit>
41: 66 90 xchg %ax,%ax
43: 66 90 xchg %ax,%ax
45: 66 90 xchg %ax,%ax
47: 66 90 xchg %ax,%ax
49: 66 90 xchg %ax,%ax
4b: 66 90 xchg %ax,%ax
4d: 66 90 xchg %ax,%ax
4f: 90 nop
00000050 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
50: 55 push %ebp
51: 89 e5 mov %esp,%ebp
53: 53 push %ebx
54: 8b 45 08 mov 0x8(%ebp),%eax
57: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
5a: 89 c2 mov %eax,%edx
5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
60: 83 c1 01 add $0x1,%ecx
63: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
67: 83 c2 01 add $0x1,%edx
6a: 84 db test %bl,%bl
6c: 88 5a ff mov %bl,-0x1(%edx)
6f: 75 ef jne 60 <strcpy+0x10>
;
return os;
}
71: 5b pop %ebx
72: 5d pop %ebp
73: c3 ret
74: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
7a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000080 <strcmp>:
int
strcmp(const char *p, const char *q)
{
80: 55 push %ebp
81: 89 e5 mov %esp,%ebp
83: 56 push %esi
84: 53 push %ebx
85: 8b 55 08 mov 0x8(%ebp),%edx
88: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
8b: 0f b6 02 movzbl (%edx),%eax
8e: 0f b6 19 movzbl (%ecx),%ebx
91: 84 c0 test %al,%al
93: 75 1e jne b3 <strcmp+0x33>
95: eb 29 jmp c0 <strcmp+0x40>
97: 89 f6 mov %esi,%esi
99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
a0: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
a3: 0f b6 02 movzbl (%edx),%eax
p++, q++;
a6: 8d 71 01 lea 0x1(%ecx),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
a9: 0f b6 59 01 movzbl 0x1(%ecx),%ebx
ad: 84 c0 test %al,%al
af: 74 0f je c0 <strcmp+0x40>
b1: 89 f1 mov %esi,%ecx
b3: 38 d8 cmp %bl,%al
b5: 74 e9 je a0 <strcmp+0x20>
p++, q++;
return (uchar)*p - (uchar)*q;
b7: 29 d8 sub %ebx,%eax
}
b9: 5b pop %ebx
ba: 5e pop %esi
bb: 5d pop %ebp
bc: c3 ret
bd: 8d 76 00 lea 0x0(%esi),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
c0: 31 c0 xor %eax,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
c2: 29 d8 sub %ebx,%eax
}
c4: 5b pop %ebx
c5: 5e pop %esi
c6: 5d pop %ebp
c7: c3 ret
c8: 90 nop
c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000000d0 <strlen>:
uint
strlen(const char *s)
{
d0: 55 push %ebp
d1: 89 e5 mov %esp,%ebp
d3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
d6: 80 39 00 cmpb $0x0,(%ecx)
d9: 74 12 je ed <strlen+0x1d>
db: 31 d2 xor %edx,%edx
dd: 8d 76 00 lea 0x0(%esi),%esi
e0: 83 c2 01 add $0x1,%edx
e3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
e7: 89 d0 mov %edx,%eax
e9: 75 f5 jne e0 <strlen+0x10>
;
return n;
}
eb: 5d pop %ebp
ec: c3 ret
uint
strlen(const char *s)
{
int n;
for(n = 0; s[n]; n++)
ed: 31 c0 xor %eax,%eax
;
return n;
}
ef: 5d pop %ebp
f0: c3 ret
f1: eb 0d jmp 100 <memset>
f3: 90 nop
f4: 90 nop
f5: 90 nop
f6: 90 nop
f7: 90 nop
f8: 90 nop
f9: 90 nop
fa: 90 nop
fb: 90 nop
fc: 90 nop
fd: 90 nop
fe: 90 nop
ff: 90 nop
00000100 <memset>:
void*
memset(void *dst, int c, uint n)
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 57 push %edi
104: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
107: 8b 4d 10 mov 0x10(%ebp),%ecx
10a: 8b 45 0c mov 0xc(%ebp),%eax
10d: 89 d7 mov %edx,%edi
10f: fc cld
110: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
112: 89 d0 mov %edx,%eax
114: 5f pop %edi
115: 5d pop %ebp
116: c3 ret
117: 89 f6 mov %esi,%esi
119: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000120 <strchr>:
char*
strchr(const char *s, char c)
{
120: 55 push %ebp
121: 89 e5 mov %esp,%ebp
123: 53 push %ebx
124: 8b 45 08 mov 0x8(%ebp),%eax
127: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
12a: 0f b6 10 movzbl (%eax),%edx
12d: 84 d2 test %dl,%dl
12f: 74 1d je 14e <strchr+0x2e>
if(*s == c)
131: 38 d3 cmp %dl,%bl
133: 89 d9 mov %ebx,%ecx
135: 75 0d jne 144 <strchr+0x24>
137: eb 17 jmp 150 <strchr+0x30>
139: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
140: 38 ca cmp %cl,%dl
142: 74 0c je 150 <strchr+0x30>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
144: 83 c0 01 add $0x1,%eax
147: 0f b6 10 movzbl (%eax),%edx
14a: 84 d2 test %dl,%dl
14c: 75 f2 jne 140 <strchr+0x20>
if(*s == c)
return (char*)s;
return 0;
14e: 31 c0 xor %eax,%eax
}
150: 5b pop %ebx
151: 5d pop %ebp
152: c3 ret
153: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
159: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000160 <gets>:
char*
gets(char *buf, int max)
{
160: 55 push %ebp
161: 89 e5 mov %esp,%ebp
163: 57 push %edi
164: 56 push %esi
165: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
166: 31 f6 xor %esi,%esi
cc = read(0, &c, 1);
168: 8d 7d e7 lea -0x19(%ebp),%edi
return 0;
}
char*
gets(char *buf, int max)
{
16b: 83 ec 1c sub $0x1c,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
16e: eb 29 jmp 199 <gets+0x39>
cc = read(0, &c, 1);
170: 83 ec 04 sub $0x4,%esp
173: 6a 01 push $0x1
175: 57 push %edi
176: 6a 00 push $0x0
178: e8 2d 01 00 00 call 2aa <read>
if(cc < 1)
17d: 83 c4 10 add $0x10,%esp
180: 85 c0 test %eax,%eax
182: 7e 1d jle 1a1 <gets+0x41>
break;
buf[i++] = c;
184: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
188: 8b 55 08 mov 0x8(%ebp),%edx
18b: 89 de mov %ebx,%esi
if(c == '\n' || c == '\r')
18d: 3c 0a cmp $0xa,%al
for(i=0; i+1 < max; ){
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
18f: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
193: 74 1b je 1b0 <gets+0x50>
195: 3c 0d cmp $0xd,%al
197: 74 17 je 1b0 <gets+0x50>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
199: 8d 5e 01 lea 0x1(%esi),%ebx
19c: 3b 5d 0c cmp 0xc(%ebp),%ebx
19f: 7c cf jl 170 <gets+0x10>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
1a1: 8b 45 08 mov 0x8(%ebp),%eax
1a4: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
1a8: 8d 65 f4 lea -0xc(%ebp),%esp
1ab: 5b pop %ebx
1ac: 5e pop %esi
1ad: 5f pop %edi
1ae: 5d pop %ebp
1af: c3 ret
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
1b0: 8b 45 08 mov 0x8(%ebp),%eax
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
1b3: 89 de mov %ebx,%esi
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
1b5: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
1b9: 8d 65 f4 lea -0xc(%ebp),%esp
1bc: 5b pop %ebx
1bd: 5e pop %esi
1be: 5f pop %edi
1bf: 5d pop %ebp
1c0: c3 ret
1c1: eb 0d jmp 1d0 <stat>
1c3: 90 nop
1c4: 90 nop
1c5: 90 nop
1c6: 90 nop
1c7: 90 nop
1c8: 90 nop
1c9: 90 nop
1ca: 90 nop
1cb: 90 nop
1cc: 90 nop
1cd: 90 nop
1ce: 90 nop
1cf: 90 nop
000001d0 <stat>:
int
stat(const char *n, struct stat *st)
{
1d0: 55 push %ebp
1d1: 89 e5 mov %esp,%ebp
1d3: 56 push %esi
1d4: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
1d5: 83 ec 08 sub $0x8,%esp
1d8: 6a 00 push $0x0
1da: ff 75 08 pushl 0x8(%ebp)
1dd: e8 f0 00 00 00 call 2d2 <open>
if(fd < 0)
1e2: 83 c4 10 add $0x10,%esp
1e5: 85 c0 test %eax,%eax
1e7: 78 27 js 210 <stat+0x40>
return -1;
r = fstat(fd, st);
1e9: 83 ec 08 sub $0x8,%esp
1ec: ff 75 0c pushl 0xc(%ebp)
1ef: 89 c3 mov %eax,%ebx
1f1: 50 push %eax
1f2: e8 f3 00 00 00 call 2ea <fstat>
1f7: 89 c6 mov %eax,%esi
close(fd);
1f9: 89 1c 24 mov %ebx,(%esp)
1fc: e8 b9 00 00 00 call 2ba <close>
return r;
201: 83 c4 10 add $0x10,%esp
204: 89 f0 mov %esi,%eax
}
206: 8d 65 f8 lea -0x8(%ebp),%esp
209: 5b pop %ebx
20a: 5e pop %esi
20b: 5d pop %ebp
20c: c3 ret
20d: 8d 76 00 lea 0x0(%esi),%esi
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
210: b8 ff ff ff ff mov $0xffffffff,%eax
215: eb ef jmp 206 <stat+0x36>
217: 89 f6 mov %esi,%esi
219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000220 <atoi>:
return r;
}
int
atoi(const char *s)
{
220: 55 push %ebp
221: 89 e5 mov %esp,%ebp
223: 53 push %ebx
224: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
227: 0f be 11 movsbl (%ecx),%edx
22a: 8d 42 d0 lea -0x30(%edx),%eax
22d: 3c 09 cmp $0x9,%al
22f: b8 00 00 00 00 mov $0x0,%eax
234: 77 1f ja 255 <atoi+0x35>
236: 8d 76 00 lea 0x0(%esi),%esi
239: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
240: 8d 04 80 lea (%eax,%eax,4),%eax
243: 83 c1 01 add $0x1,%ecx
246: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
24a: 0f be 11 movsbl (%ecx),%edx
24d: 8d 5a d0 lea -0x30(%edx),%ebx
250: 80 fb 09 cmp $0x9,%bl
253: 76 eb jbe 240 <atoi+0x20>
n = n*10 + *s++ - '0';
return n;
}
255: 5b pop %ebx
256: 5d pop %ebp
257: c3 ret
258: 90 nop
259: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000260 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
260: 55 push %ebp
261: 89 e5 mov %esp,%ebp
263: 56 push %esi
264: 53 push %ebx
265: 8b 5d 10 mov 0x10(%ebp),%ebx
268: 8b 45 08 mov 0x8(%ebp),%eax
26b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
26e: 85 db test %ebx,%ebx
270: 7e 14 jle 286 <memmove+0x26>
272: 31 d2 xor %edx,%edx
274: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
278: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
27c: 88 0c 10 mov %cl,(%eax,%edx,1)
27f: 83 c2 01 add $0x1,%edx
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
282: 39 da cmp %ebx,%edx
284: 75 f2 jne 278 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
286: 5b pop %ebx
287: 5e pop %esi
288: 5d pop %ebp
289: c3 ret
0000028a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
28a: b8 01 00 00 00 mov $0x1,%eax
28f: cd 40 int $0x40
291: c3 ret
00000292 <exit>:
SYSCALL(exit)
292: b8 02 00 00 00 mov $0x2,%eax
297: cd 40 int $0x40
299: c3 ret
0000029a <wait>:
SYSCALL(wait)
29a: b8 03 00 00 00 mov $0x3,%eax
29f: cd 40 int $0x40
2a1: c3 ret
000002a2 <pipe>:
SYSCALL(pipe)
2a2: b8 04 00 00 00 mov $0x4,%eax
2a7: cd 40 int $0x40
2a9: c3 ret
000002aa <read>:
SYSCALL(read)
2aa: b8 05 00 00 00 mov $0x5,%eax
2af: cd 40 int $0x40
2b1: c3 ret
000002b2 <write>:
SYSCALL(write)
2b2: b8 10 00 00 00 mov $0x10,%eax
2b7: cd 40 int $0x40
2b9: c3 ret
000002ba <close>:
SYSCALL(close)
2ba: b8 15 00 00 00 mov $0x15,%eax
2bf: cd 40 int $0x40
2c1: c3 ret
000002c2 <kill>:
SYSCALL(kill)
2c2: b8 06 00 00 00 mov $0x6,%eax
2c7: cd 40 int $0x40
2c9: c3 ret
000002ca <exec>:
SYSCALL(exec)
2ca: b8 07 00 00 00 mov $0x7,%eax
2cf: cd 40 int $0x40
2d1: c3 ret
000002d2 <open>:
SYSCALL(open)
2d2: b8 0f 00 00 00 mov $0xf,%eax
2d7: cd 40 int $0x40
2d9: c3 ret
000002da <mknod>:
SYSCALL(mknod)
2da: b8 11 00 00 00 mov $0x11,%eax
2df: cd 40 int $0x40
2e1: c3 ret
000002e2 <unlink>:
SYSCALL(unlink)
2e2: b8 12 00 00 00 mov $0x12,%eax
2e7: cd 40 int $0x40
2e9: c3 ret
000002ea <fstat>:
SYSCALL(fstat)
2ea: b8 08 00 00 00 mov $0x8,%eax
2ef: cd 40 int $0x40
2f1: c3 ret
000002f2 <link>:
SYSCALL(link)
2f2: b8 13 00 00 00 mov $0x13,%eax
2f7: cd 40 int $0x40
2f9: c3 ret
000002fa <mkdir>:
SYSCALL(mkdir)
2fa: b8 14 00 00 00 mov $0x14,%eax
2ff: cd 40 int $0x40
301: c3 ret
00000302 <chdir>:
SYSCALL(chdir)
302: b8 09 00 00 00 mov $0x9,%eax
307: cd 40 int $0x40
309: c3 ret
0000030a <dup>:
SYSCALL(dup)
30a: b8 0a 00 00 00 mov $0xa,%eax
30f: cd 40 int $0x40
311: c3 ret
00000312 <getpid>:
SYSCALL(getpid)
312: b8 0b 00 00 00 mov $0xb,%eax
317: cd 40 int $0x40
319: c3 ret
0000031a <get_parent_id>:
SYSCALL(get_parent_id)
31a: b8 16 00 00 00 mov $0x16,%eax
31f: cd 40 int $0x40
321: c3 ret
00000322 <getchildren>:
SYSCALL(getchildren)
322: b8 17 00 00 00 mov $0x17,%eax
327: cd 40 int $0x40
329: c3 ret
0000032a <sbrk>:
SYSCALL(sbrk)
32a: b8 0c 00 00 00 mov $0xc,%eax
32f: cd 40 int $0x40
331: c3 ret
00000332 <sleep>:
SYSCALL(sleep)
332: b8 0d 00 00 00 mov $0xd,%eax
337: cd 40 int $0x40
339: c3 ret
0000033a <uptime>:
SYSCALL(uptime)
33a: b8 0e 00 00 00 mov $0xe,%eax
33f: cd 40 int $0x40
341: c3 ret
00000342 <set>:
SYSCALL(set)
342: b8 18 00 00 00 mov $0x18,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <count>:
SYSCALL(count)
34a: b8 19 00 00 00 mov $0x19,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <sleepp>:
SYSCALL(sleepp)
352: b8 1a 00 00 00 mov $0x1a,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <cmos>:
SYSCALL(cmos)
35a: b8 1b 00 00 00 mov $0x1b,%eax
35f: cd 40 int $0x40
361: c3 ret
362: 66 90 xchg %ax,%ax
364: 66 90 xchg %ax,%ax
366: 66 90 xchg %ax,%ax
368: 66 90 xchg %ax,%ax
36a: 66 90 xchg %ax,%ax
36c: 66 90 xchg %ax,%ax
36e: 66 90 xchg %ax,%ax
00000370 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
370: 55 push %ebp
371: 89 e5 mov %esp,%ebp
373: 57 push %edi
374: 56 push %esi
375: 53 push %ebx
376: 89 c6 mov %eax,%esi
378: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
37b: 8b 5d 08 mov 0x8(%ebp),%ebx
37e: 85 db test %ebx,%ebx
380: 74 7e je 400 <printint+0x90>
382: 89 d0 mov %edx,%eax
384: c1 e8 1f shr $0x1f,%eax
387: 84 c0 test %al,%al
389: 74 75 je 400 <printint+0x90>
neg = 1;
x = -xx;
38b: 89 d0 mov %edx,%eax
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
38d: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
x = -xx;
394: f7 d8 neg %eax
396: 89 75 c0 mov %esi,-0x40(%ebp)
} else {
x = xx;
}
i = 0;
399: 31 ff xor %edi,%edi
39b: 8d 5d d7 lea -0x29(%ebp),%ebx
39e: 89 ce mov %ecx,%esi
3a0: eb 08 jmp 3aa <printint+0x3a>
3a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
3a8: 89 cf mov %ecx,%edi
3aa: 31 d2 xor %edx,%edx
3ac: 8d 4f 01 lea 0x1(%edi),%ecx
3af: f7 f6 div %esi
3b1: 0f b6 92 44 07 00 00 movzbl 0x744(%edx),%edx
}while((x /= base) != 0);
3b8: 85 c0 test %eax,%eax
x = xx;
}
i = 0;
do{
buf[i++] = digits[x % base];
3ba: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
3bd: 75 e9 jne 3a8 <printint+0x38>
if(neg)
3bf: 8b 45 c4 mov -0x3c(%ebp),%eax
3c2: 8b 75 c0 mov -0x40(%ebp),%esi
3c5: 85 c0 test %eax,%eax
3c7: 74 08 je 3d1 <printint+0x61>
buf[i++] = '-';
3c9: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
3ce: 8d 4f 02 lea 0x2(%edi),%ecx
3d1: 8d 7c 0d d7 lea -0x29(%ebp,%ecx,1),%edi
3d5: 8d 76 00 lea 0x0(%esi),%esi
3d8: 0f b6 07 movzbl (%edi),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
3db: 83 ec 04 sub $0x4,%esp
3de: 83 ef 01 sub $0x1,%edi
3e1: 6a 01 push $0x1
3e3: 53 push %ebx
3e4: 56 push %esi
3e5: 88 45 d7 mov %al,-0x29(%ebp)
3e8: e8 c5 fe ff ff call 2b2 <write>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
3ed: 83 c4 10 add $0x10,%esp
3f0: 39 df cmp %ebx,%edi
3f2: 75 e4 jne 3d8 <printint+0x68>
putc(fd, buf[i]);
}
3f4: 8d 65 f4 lea -0xc(%ebp),%esp
3f7: 5b pop %ebx
3f8: 5e pop %esi
3f9: 5f pop %edi
3fa: 5d pop %ebp
3fb: c3 ret
3fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
} else {
x = xx;
400: 89 d0 mov %edx,%eax
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
402: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
409: eb 8b jmp 396 <printint+0x26>
40b: 90 nop
40c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000410 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
410: 55 push %ebp
411: 89 e5 mov %esp,%ebp
413: 57 push %edi
414: 56 push %esi
415: 53 push %ebx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
416: 8d 45 10 lea 0x10(%ebp),%eax
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
419: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
41c: 8b 75 0c mov 0xc(%ebp),%esi
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
41f: 8b 7d 08 mov 0x8(%ebp),%edi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
422: 89 45 d0 mov %eax,-0x30(%ebp)
425: 0f b6 1e movzbl (%esi),%ebx
428: 83 c6 01 add $0x1,%esi
42b: 84 db test %bl,%bl
42d: 0f 84 b0 00 00 00 je 4e3 <printf+0xd3>
433: 31 d2 xor %edx,%edx
435: eb 39 jmp 470 <printf+0x60>
437: 89 f6 mov %esi,%esi
439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
440: 83 f8 25 cmp $0x25,%eax
443: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
446: ba 25 00 00 00 mov $0x25,%edx
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
44b: 74 18 je 465 <printf+0x55>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
44d: 8d 45 e2 lea -0x1e(%ebp),%eax
450: 83 ec 04 sub $0x4,%esp
453: 88 5d e2 mov %bl,-0x1e(%ebp)
456: 6a 01 push $0x1
458: 50 push %eax
459: 57 push %edi
45a: e8 53 fe ff ff call 2b2 <write>
45f: 8b 55 d4 mov -0x2c(%ebp),%edx
462: 83 c4 10 add $0x10,%esp
465: 83 c6 01 add $0x1,%esi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
468: 0f b6 5e ff movzbl -0x1(%esi),%ebx
46c: 84 db test %bl,%bl
46e: 74 73 je 4e3 <printf+0xd3>
c = fmt[i] & 0xff;
if(state == 0){
470: 85 d2 test %edx,%edx
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
472: 0f be cb movsbl %bl,%ecx
475: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
478: 74 c6 je 440 <printf+0x30>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
47a: 83 fa 25 cmp $0x25,%edx
47d: 75 e6 jne 465 <printf+0x55>
if(c == 'd'){
47f: 83 f8 64 cmp $0x64,%eax
482: 0f 84 f8 00 00 00 je 580 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
488: 81 e1 f7 00 00 00 and $0xf7,%ecx
48e: 83 f9 70 cmp $0x70,%ecx
491: 74 5d je 4f0 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
493: 83 f8 73 cmp $0x73,%eax
496: 0f 84 84 00 00 00 je 520 <printf+0x110>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
49c: 83 f8 63 cmp $0x63,%eax
49f: 0f 84 ea 00 00 00 je 58f <printf+0x17f>
putc(fd, *ap);
ap++;
} else if(c == '%'){
4a5: 83 f8 25 cmp $0x25,%eax
4a8: 0f 84 c2 00 00 00 je 570 <printf+0x160>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
4ae: 8d 45 e7 lea -0x19(%ebp),%eax
4b1: 83 ec 04 sub $0x4,%esp
4b4: c6 45 e7 25 movb $0x25,-0x19(%ebp)
4b8: 6a 01 push $0x1
4ba: 50 push %eax
4bb: 57 push %edi
4bc: e8 f1 fd ff ff call 2b2 <write>
4c1: 83 c4 0c add $0xc,%esp
4c4: 8d 45 e6 lea -0x1a(%ebp),%eax
4c7: 88 5d e6 mov %bl,-0x1a(%ebp)
4ca: 6a 01 push $0x1
4cc: 50 push %eax
4cd: 57 push %edi
4ce: 83 c6 01 add $0x1,%esi
4d1: e8 dc fd ff ff call 2b2 <write>
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4d6: 0f b6 5e ff movzbl -0x1(%esi),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
4da: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
4dd: 31 d2 xor %edx,%edx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4df: 84 db test %bl,%bl
4e1: 75 8d jne 470 <printf+0x60>
putc(fd, c);
}
state = 0;
}
}
}
4e3: 8d 65 f4 lea -0xc(%ebp),%esp
4e6: 5b pop %ebx
4e7: 5e pop %esi
4e8: 5f pop %edi
4e9: 5d pop %ebp
4ea: c3 ret
4eb: 90 nop
4ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
4f0: 83 ec 0c sub $0xc,%esp
4f3: b9 10 00 00 00 mov $0x10,%ecx
4f8: 6a 00 push $0x0
4fa: 8b 5d d0 mov -0x30(%ebp),%ebx
4fd: 89 f8 mov %edi,%eax
4ff: 8b 13 mov (%ebx),%edx
501: e8 6a fe ff ff call 370 <printint>
ap++;
506: 89 d8 mov %ebx,%eax
508: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
50b: 31 d2 xor %edx,%edx
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
50d: 83 c0 04 add $0x4,%eax
510: 89 45 d0 mov %eax,-0x30(%ebp)
513: e9 4d ff ff ff jmp 465 <printf+0x55>
518: 90 nop
519: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
} else if(c == 's'){
s = (char*)*ap;
520: 8b 45 d0 mov -0x30(%ebp),%eax
523: 8b 18 mov (%eax),%ebx
ap++;
525: 83 c0 04 add $0x4,%eax
528: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
s = "(null)";
52b: b8 3b 07 00 00 mov $0x73b,%eax
530: 85 db test %ebx,%ebx
532: 0f 44 d8 cmove %eax,%ebx
while(*s != 0){
535: 0f b6 03 movzbl (%ebx),%eax
538: 84 c0 test %al,%al
53a: 74 23 je 55f <printf+0x14f>
53c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
540: 88 45 e3 mov %al,-0x1d(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
543: 8d 45 e3 lea -0x1d(%ebp),%eax
546: 83 ec 04 sub $0x4,%esp
549: 6a 01 push $0x1
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
54b: 83 c3 01 add $0x1,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
54e: 50 push %eax
54f: 57 push %edi
550: e8 5d fd ff ff call 2b2 <write>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
555: 0f b6 03 movzbl (%ebx),%eax
558: 83 c4 10 add $0x10,%esp
55b: 84 c0 test %al,%al
55d: 75 e1 jne 540 <printf+0x130>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
55f: 31 d2 xor %edx,%edx
561: e9 ff fe ff ff jmp 465 <printf+0x55>
566: 8d 76 00 lea 0x0(%esi),%esi
569: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
570: 83 ec 04 sub $0x4,%esp
573: 88 5d e5 mov %bl,-0x1b(%ebp)
576: 8d 45 e5 lea -0x1b(%ebp),%eax
579: 6a 01 push $0x1
57b: e9 4c ff ff ff jmp 4cc <printf+0xbc>
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
580: 83 ec 0c sub $0xc,%esp
583: b9 0a 00 00 00 mov $0xa,%ecx
588: 6a 01 push $0x1
58a: e9 6b ff ff ff jmp 4fa <printf+0xea>
58f: 8b 5d d0 mov -0x30(%ebp),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
592: 83 ec 04 sub $0x4,%esp
595: 8b 03 mov (%ebx),%eax
597: 6a 01 push $0x1
599: 88 45 e4 mov %al,-0x1c(%ebp)
59c: 8d 45 e4 lea -0x1c(%ebp),%eax
59f: 50 push %eax
5a0: 57 push %edi
5a1: e8 0c fd ff ff call 2b2 <write>
5a6: e9 5b ff ff ff jmp 506 <printf+0xf6>
5ab: 66 90 xchg %ax,%ax
5ad: 66 90 xchg %ax,%ax
5af: 90 nop
000005b0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
5b0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5b1: a1 e4 09 00 00 mov 0x9e4,%eax
static Header base;
static Header *freep;
void
free(void *ap)
{
5b6: 89 e5 mov %esp,%ebp
5b8: 57 push %edi
5b9: 56 push %esi
5ba: 53 push %ebx
5bb: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5be: 8b 10 mov (%eax),%edx
void
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
5c0: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5c3: 39 c8 cmp %ecx,%eax
5c5: 73 19 jae 5e0 <free+0x30>
5c7: 89 f6 mov %esi,%esi
5c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
5d0: 39 d1 cmp %edx,%ecx
5d2: 72 1c jb 5f0 <free+0x40>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5d4: 39 d0 cmp %edx,%eax
5d6: 73 18 jae 5f0 <free+0x40>
static Header base;
static Header *freep;
void
free(void *ap)
{
5d8: 89 d0 mov %edx,%eax
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5da: 39 c8 cmp %ecx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5dc: 8b 10 mov (%eax),%edx
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5de: 72 f0 jb 5d0 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5e0: 39 d0 cmp %edx,%eax
5e2: 72 f4 jb 5d8 <free+0x28>
5e4: 39 d1 cmp %edx,%ecx
5e6: 73 f0 jae 5d8 <free+0x28>
5e8: 90 nop
5e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
if(bp + bp->s.size == p->s.ptr){
5f0: 8b 73 fc mov -0x4(%ebx),%esi
5f3: 8d 3c f1 lea (%ecx,%esi,8),%edi
5f6: 39 d7 cmp %edx,%edi
5f8: 74 19 je 613 <free+0x63>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
5fa: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
5fd: 8b 50 04 mov 0x4(%eax),%edx
600: 8d 34 d0 lea (%eax,%edx,8),%esi
603: 39 f1 cmp %esi,%ecx
605: 74 23 je 62a <free+0x7a>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
607: 89 08 mov %ecx,(%eax)
freep = p;
609: a3 e4 09 00 00 mov %eax,0x9e4
}
60e: 5b pop %ebx
60f: 5e pop %esi
610: 5f pop %edi
611: 5d pop %ebp
612: c3 ret
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
613: 03 72 04 add 0x4(%edx),%esi
616: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
619: 8b 10 mov (%eax),%edx
61b: 8b 12 mov (%edx),%edx
61d: 89 53 f8 mov %edx,-0x8(%ebx)
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
620: 8b 50 04 mov 0x4(%eax),%edx
623: 8d 34 d0 lea (%eax,%edx,8),%esi
626: 39 f1 cmp %esi,%ecx
628: 75 dd jne 607 <free+0x57>
p->s.size += bp->s.size;
62a: 03 53 fc add -0x4(%ebx),%edx
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
freep = p;
62d: a3 e4 09 00 00 mov %eax,0x9e4
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
632: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
635: 8b 53 f8 mov -0x8(%ebx),%edx
638: 89 10 mov %edx,(%eax)
} else
p->s.ptr = bp;
freep = p;
}
63a: 5b pop %ebx
63b: 5e pop %esi
63c: 5f pop %edi
63d: 5d pop %ebp
63e: c3 ret
63f: 90 nop
00000640 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
640: 55 push %ebp
641: 89 e5 mov %esp,%ebp
643: 57 push %edi
644: 56 push %esi
645: 53 push %ebx
646: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
649: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
64c: 8b 15 e4 09 00 00 mov 0x9e4,%edx
malloc(uint nbytes)
{
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
652: 8d 78 07 lea 0x7(%eax),%edi
655: c1 ef 03 shr $0x3,%edi
658: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
65b: 85 d2 test %edx,%edx
65d: 0f 84 a3 00 00 00 je 706 <malloc+0xc6>
663: 8b 02 mov (%edx),%eax
665: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
668: 39 cf cmp %ecx,%edi
66a: 76 74 jbe 6e0 <malloc+0xa0>
66c: 81 ff 00 10 00 00 cmp $0x1000,%edi
672: be 00 10 00 00 mov $0x1000,%esi
677: 8d 1c fd 00 00 00 00 lea 0x0(,%edi,8),%ebx
67e: 0f 43 f7 cmovae %edi,%esi
681: ba 00 80 00 00 mov $0x8000,%edx
686: 81 ff ff 0f 00 00 cmp $0xfff,%edi
68c: 0f 46 da cmovbe %edx,%ebx
68f: eb 10 jmp 6a1 <malloc+0x61>
691: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
698: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
69a: 8b 48 04 mov 0x4(%eax),%ecx
69d: 39 cf cmp %ecx,%edi
69f: 76 3f jbe 6e0 <malloc+0xa0>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
6a1: 39 05 e4 09 00 00 cmp %eax,0x9e4
6a7: 89 c2 mov %eax,%edx
6a9: 75 ed jne 698 <malloc+0x58>
char *p;
Header *hp;
if(nu < 4096)
nu = 4096;
p = sbrk(nu * sizeof(Header));
6ab: 83 ec 0c sub $0xc,%esp
6ae: 53 push %ebx
6af: e8 76 fc ff ff call 32a <sbrk>
if(p == (char*)-1)
6b4: 83 c4 10 add $0x10,%esp
6b7: 83 f8 ff cmp $0xffffffff,%eax
6ba: 74 1c je 6d8 <malloc+0x98>
return 0;
hp = (Header*)p;
hp->s.size = nu;
6bc: 89 70 04 mov %esi,0x4(%eax)
free((void*)(hp + 1));
6bf: 83 ec 0c sub $0xc,%esp
6c2: 83 c0 08 add $0x8,%eax
6c5: 50 push %eax
6c6: e8 e5 fe ff ff call 5b0 <free>
return freep;
6cb: 8b 15 e4 09 00 00 mov 0x9e4,%edx
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
6d1: 83 c4 10 add $0x10,%esp
6d4: 85 d2 test %edx,%edx
6d6: 75 c0 jne 698 <malloc+0x58>
return 0;
6d8: 31 c0 xor %eax,%eax
6da: eb 1c jmp 6f8 <malloc+0xb8>
6dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
6e0: 39 cf cmp %ecx,%edi
6e2: 74 1c je 700 <malloc+0xc0>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
6e4: 29 f9 sub %edi,%ecx
6e6: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
6e9: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
6ec: 89 78 04 mov %edi,0x4(%eax)
}
freep = prevp;
6ef: 89 15 e4 09 00 00 mov %edx,0x9e4
return (void*)(p + 1);
6f5: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
6f8: 8d 65 f4 lea -0xc(%ebp),%esp
6fb: 5b pop %ebx
6fc: 5e pop %esi
6fd: 5f pop %edi
6fe: 5d pop %ebp
6ff: c3 ret
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
prevp->s.ptr = p->s.ptr;
700: 8b 08 mov (%eax),%ecx
702: 89 0a mov %ecx,(%edx)
704: eb e9 jmp 6ef <malloc+0xaf>
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
706: c7 05 e4 09 00 00 e8 movl $0x9e8,0x9e4
70d: 09 00 00
710: c7 05 e8 09 00 00 e8 movl $0x9e8,0x9e8
717: 09 00 00
base.s.size = 0;
71a: b8 e8 09 00 00 mov $0x9e8,%eax
71f: c7 05 ec 09 00 00 00 movl $0x0,0x9ec
726: 00 00 00
729: e9 3e ff ff ff jmp 66c <malloc+0x2c>
|
tools/src/excel_writer/ieee_754-generic_double_precision.adb | fjudith/sql-benchmark | 24 | 1928 | -- --
-- package Copyright (c) <NAME> --
-- IEEE_754.Generic_Double_Precision Luebeck --
-- Implementation Summer, 2008 --
-- --
-- Last revision : 09:27 06 Nov 2016 --
-- --
-- This library 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. This library --
-- is distributed in the hope that it will be useful, but WITHOUT --
-- ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. You should have --
-- received a copy of the GNU General Public License along with --
-- this library; if not, write to the Free Software Foundation, --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
--____________________________________________________________________--
package body IEEE_754.Generic_Double_Precision is
Exponent_Bias : constant := 2**10 - 1;
Exponent_First : constant := -51;
Exponent_Last : constant := 2**11 - 1;
Fraction_Bits : constant := 52;
Mantissa_Bits : constant := 53;
function Exponent (Value : Float_64) return Integer is
pragma Inline (Exponent);
begin
return
Integer
( Shift_Left (Unsigned_16 (Value (1)) and 16#7F#, 4)
or Shift_Right (Unsigned_16 (Value (2)), 4)
);
end Exponent;
function Mantissa (Value : Float_64) return Unsigned_64 is
pragma Inline (Mantissa);
begin
return
( Unsigned_64 (Value (8))
or Shift_Left (Unsigned_64 (Value (7)), 8 )
or Shift_Left (Unsigned_64 (Value (6)), 2*8)
or Shift_Left (Unsigned_64 (Value (5)), 3*8)
or Shift_Left (Unsigned_64 (Value (4)), 4*8)
or Shift_Left (Unsigned_64 (Value (3)), 5*8)
or Shift_Left (Unsigned_64 (Value (2)) and 16#0F#, 6*8)
or 2 ** Fraction_Bits
);
end Mantissa;
procedure Normalize
( Value : Number;
Mantissa : out Unsigned_64;
Exponent : out Integer
) is
begin
if Number'Machine_Radix = 2 then
--
-- The machine radix is binary. We can use the hardware
-- representation attributes in order to get the exponent and
-- the fraction.
--
Exponent := Number'Exponent (Value) - Mantissa_Bits;
Mantissa := Unsigned_64 (Number'Scaling (Value, -Exponent));
else
--
-- OK, this gets more tricky. The number is normalized to be in
-- the range 2**53 > X >= 2**52, by multiplying to the powers
-- of two. Some optimization is made to factor out the powers
-- 2**(2**n)). Though we do not use powers bigger than 30.
--
declare
Accum : Number := Value;
Shift : Integer;
begin
Exponent := 0;
if Accum < 2.0**Fraction_Bits then
Shift := 24;
while Shift > 0 loop
if Accum < 2.0**(Mantissa_Bits - Shift) then
Accum := Accum * 2.0**Shift;
Exponent := Exponent - Shift;
else
Shift := Shift / 2;
end if;
end loop;
elsif Accum >= 2.0**Mantissa_Bits then
Shift := 8;
while Shift > 0 loop
if Accum >= 2.0**(Fraction_Bits + Shift) then
Accum := Accum / 2.0**Shift;
Exponent := Exponent + Shift;
else
Shift := Shift / 2;
end if;
end loop;
end if;
Mantissa := Unsigned_64 (Accum);
end;
end if;
end Normalize;
function From_IEEE (Value : Float_64) return Number is
begin
if 0 = (Value (1) and 16#7F#)
and then
Value (2) = 0
and then
Value (3) = 0
and then
Value (4) = 0
and then
Value (5) = 0
and then
Value (6) = 0
and then
Value (7) = 0
and then
Value (8) = 0
then
return 0.0;
end if;
declare
Power : Integer := Exponent (Value);
Fraction : Unsigned_64 := Mantissa (Value);
Result : Number;
begin
if Power = Exponent_Last then
if Fraction /= 2#1000_0000_0000# then
raise Not_A_Number_Error;
elsif Value (1) > 127 then
raise Negative_Overflow_Error;
else
raise Positive_Overflow_Error;
end if;
elsif Power = 0 then -- Denormalized number
Fraction := Fraction and 16#0F_FF_FF_FF_FF_FF_FF_FF#;
Power := Exponent_First - Exponent_Bias;
if Number'Machine_Radix = 2 then
Result := Number'Scaling (Number (Fraction), Power);
else
Result := Number (Fraction) * 2.0 ** Power;
end if;
else -- Normalized number
Power := Power - Exponent_Bias - Fraction_Bits;
if Number'Machine_Radix = 2 then
Result := Number'Scaling (Number (Fraction), Power);
else
Result := Number (Fraction) * 2.0 ** Power;
end if;
end if;
if Value (1) > 127 then
return -Result;
else
return Result;
end if;
exception
when Constraint_Error =>
if Value (1) > 127 then
raise Negative_Overflow_Error;
else
raise Positive_Overflow_Error;
end if;
end;
end From_IEEE;
function Is_NaN (Value : Float_64) return Boolean is
begin
return
( Exponent (Value) = Exponent_Last
and then
Mantissa (Value) /= 2 ** Fraction_Bits
);
end Is_NaN;
function Is_Negative (Value : Float_64) return Boolean is
begin
return Value (1) > 127;
end Is_Negative;
function Is_Real (Value : Float_64) return Boolean is
begin
return Exponent (Value) < Exponent_Last;
end Is_Real;
function To_IEEE (Value : Number) return Float_64 is
begin
if Value = 0.0 then
return (others => 0);
end if;
declare
Exponent : Integer;
Fraction : Unsigned_64;
Sign : Byte := 0;
begin
if Value > 0.0 then
Normalize (Value, Fraction, Exponent);
else
Normalize (-Value, Fraction, Exponent);
Sign := 2**7;
end if;
Exponent := Exponent + Exponent_Bias + Fraction_Bits;
if Exponent < Exponent_First then
-- Underflow, resuls in zero
return (others => 0);
elsif Exponent >= Exponent_Last then
-- Overflow, results in infinities
if Sign = 0 then
return Positive_Infinity;
else
return Negative_Infinity;
end if;
elsif Exponent <= 0 then -- Denormalized
Fraction := Shift_Right (Fraction, 1 - Exponent);
Exponent := 0;
end if;
return
( Sign or Byte (Exponent / 2**4),
( Byte (Shift_Right (Fraction, 8*6) and 16#0F#)
or Shift_Left (Byte (Exponent mod 2**4), 4)
),
Byte (Shift_Right (Fraction, 8*5) and 16#FF#),
Byte (Shift_Right (Fraction, 8*4) and 16#FF#),
Byte (Shift_Right (Fraction, 8*3) and 16#FF#),
Byte (Shift_Right (Fraction, 8*2) and 16#FF#),
Byte (Shift_Right (Fraction, 8 ) and 16#FF#),
Byte (Fraction and 16#FF#)
);
end;
end To_IEEE;
end IEEE_754.Generic_Double_Precision;
|
test_expr/grammars/TestParser.g4 | exhu/miod | 1 | 489 | parser grammar TestParser;
options {tokenVocab = TestLexer;}
compUnit: statement+;
/*
bareName: ID | SETTER | GETTER;
qualifName: NAMESPACE_SEP? qualifNameTxt;
qualifNameOnly: NAMESPACE_SEP? qualifNameOnlyTxt;
qualifNameTxt: bareName (NAMESPACE_SEP bareName)*;
qualifNameOnlyTxt: bareName (NAMESPACE_SEP bareName)+;
*/
exprList: expr (COMMA expr)*;
primary
: BASE
| literal
| ID
| OPEN_PAREN expr CLOSE_PAREN
;
expr
: primary
| expr OPEN_PAREN exprList? CLOSE_PAREN
;
statement: expr;
literal: NULL #literalNull
| INTEGER #literalInteger
| INT_OCTAL #literalIntOctal
| INT_HEX #literalIntHex
| INT_BIN #literalIntBin
| FLOAT #literalFloat
| STRING #literalString
| RAW_STRING#literalRawString
| CHAR_STR #literalCharStr
| TRUE #literalTrue
| FALSE #literalFalse
;
|
Cubical/Algebra/DistLattice/BigOps.agda | dolio/cubical | 0 | 17029 | <reponame>dolio/cubical<filename>Cubical/Algebra/DistLattice/BigOps.agda
-- define ⋁ and ⋀ as the bigOps of a Ring when interpreted
-- as an additive/multiplicative monoid
{-# OPTIONS --safe #-}
module Cubical.Algebra.DistLattice.BigOps where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Equiv.HalfAdjoint
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Univalence
open import Cubical.Foundations.Transport
open import Cubical.Foundations.SIP
open import Cubical.Data.Sigma
open import Cubical.Data.Nat using (ℕ ; zero ; suc)
open import Cubical.Data.FinData
open import Cubical.Data.Bool
open import Cubical.Structures.Axioms
open import Cubical.Structures.Auto
open import Cubical.Structures.Macro
open import Cubical.Algebra.Semigroup
open import Cubical.Algebra.Monoid
open import Cubical.Algebra.Monoid.BigOp
open import Cubical.Algebra.CommMonoid
open import Cubical.Algebra.Semilattice
open import Cubical.Algebra.Lattice
open import Cubical.Algebra.DistLattice
open import Cubical.Relation.Binary.Poset
private
variable
ℓ : Level
module KroneckerDelta (L' : DistLattice ℓ) where
private
L = fst L'
open DistLatticeStr (snd L')
δ : {n : ℕ} (i j : Fin n) → L
δ i j = if i == j then 1l else 0l
module Join (L' : DistLattice ℓ) where
private
L = fst L'
open DistLatticeStr (snd L')
open MonoidBigOp (Semilattice→Monoid (Lattice→JoinSemilattice (DistLattice→Lattice L')))
-- extra DistLattice→JoinMonoid?
open LatticeTheory (DistLattice→Lattice L')
open KroneckerDelta L'
⋁ = bigOp
⋁Ext = bigOpExt
⋁0l = bigOpε
⋁Last = bigOpLast
⋁Split : ∀ {n} → (V W : FinVec L n) → ⋁ (λ i → V i ∨l W i) ≡ ⋁ V ∨l ⋁ W
⋁Split = bigOpSplit ∨lComm
⋁Meetrdist : ∀ {n} → (x : L) → (V : FinVec L n)
→ x ∧l ⋁ V ≡ ⋁ λ i → x ∧l V i
⋁Meetrdist {n = zero} x _ = 0lRightAnnihilates∧l x
⋁Meetrdist {n = suc n} x V =
x ∧l (V zero ∨l ⋁ (V ∘ suc)) ≡⟨ ∧lLdist∨l _ _ _ ⟩ --Ldist and Rdist wrong way around?
(x ∧l V zero) ∨l (x ∧l ⋁ (V ∘ suc)) ≡⟨ (λ i → (x ∧l V zero) ∨l ⋁Meetrdist x (V ∘ suc) i) ⟩
(x ∧l V zero) ∨l ⋁ (λ i → x ∧l V (suc i)) ∎
⋁Meetldist : ∀ {n} → (x : L) → (V : FinVec L n)
→ (⋁ V) ∧l x ≡ ⋁ λ i → V i ∧l x
⋁Meetldist {n = zero} x _ = 0lLeftAnnihilates∧l x
⋁Meetldist {n = suc n} x V =
(V zero ∨l ⋁ (V ∘ suc)) ∧l x ≡⟨ ∧lRdist∨l _ _ _ ⟩
(V zero ∧l x) ∨l ((⋁ (V ∘ suc)) ∧l x) ≡⟨ (λ i → (V zero ∧l x) ∨l ⋁Meetldist x (V ∘ suc) i) ⟩
(V zero ∧l x) ∨l ⋁ (λ i → V (suc i) ∧l x) ∎
⋁Meetr0 : ∀ {n} → (V : FinVec L n) → ⋁ (λ i → V i ∧l 0l) ≡ 0l
⋁Meetr0 V = sym (⋁Meetldist 0l V) ∙ 0lRightAnnihilates∧l _
⋁Meet0r : ∀ {n} → (V : FinVec L n) → ⋁ (λ i → 0l ∧l V i) ≡ 0l
⋁Meet0r V = sym (⋁Meetrdist 0l V) ∙ 0lLeftAnnihilates∧l _
⋁Meetr1 : (n : ℕ) (V : FinVec L n) → (j : Fin n) → ⋁ (λ i → V i ∧l δ i j) ≡ V j
⋁Meetr1 (suc n) V zero = (λ k → ∧lRid (V zero) k ∨l ⋁Meetr0 (V ∘ suc) k) ∙ ∨lRid (V zero)
⋁Meetr1 (suc n) V (suc j) =
(λ i → 0lRightAnnihilates∧l (V zero) i ∨l ⋁ (λ x → V (suc x) ∧l δ x j))
∙∙ ∨lLid _ ∙∙ ⋁Meetr1 n (V ∘ suc) j
⋁Meet1r : (n : ℕ) (V : FinVec L n) → (j : Fin n) → ⋁ (λ i → (δ j i) ∧l V i) ≡ V j
⋁Meet1r (suc n) V zero = (λ k → ∧lLid (V zero) k ∨l ⋁Meet0r (V ∘ suc) k) ∙ ∨lRid (V zero)
⋁Meet1r (suc n) V (suc j) =
(λ i → 0lLeftAnnihilates∧l (V zero) i ∨l ⋁ (λ i → (δ j i) ∧l V (suc i)))
∙∙ ∨lLid _ ∙∙ ⋁Meet1r n (V ∘ suc) j
-- inequalities of big joins
open JoinSemilattice (Lattice→JoinSemilattice (DistLattice→Lattice L'))
open PosetReasoning IndPoset
open PosetStr (IndPoset .snd) hiding (_≤_)
⋁IsMax : {n : ℕ} (U : FinVec L n) (x : L) → (∀ i → U i ≤ x) → ⋁ U ≤ x
⋁IsMax {n = zero} _ _ _ = ∨lLid _
⋁IsMax {n = suc n} U x U≤x =
⋁ U ≤⟨ is-refl _ ⟩
U zero ∨l ⋁ (U ∘ suc) ≤⟨ ≤-∨LPres _ _ _ (⋁IsMax _ _ (U≤x ∘ suc)) ⟩
U zero ∨l x ≤⟨ ∨lIsMax _ _ _ (U≤x zero) (is-refl x) ⟩
x ◾
≤-⋁Ext : {n : ℕ} (U W : FinVec L n) → (∀ i → U i ≤ W i) → ⋁ U ≤ ⋁ W
≤-⋁Ext {n = zero} U W U≤W = is-refl 0l
≤-⋁Ext {n = suc n} U W U≤W =
⋁ U ≤⟨ is-refl _ ⟩
U zero ∨l ⋁ (U ∘ suc) ≤⟨ ≤-∨Pres _ _ _ _ (U≤W zero) (≤-⋁Ext _ _ (U≤W ∘ suc)) ⟩
W zero ∨l ⋁ (W ∘ suc) ≤⟨ is-refl _ ⟩
⋁ W ◾
module Meet (L' : DistLattice ℓ) where
private
L = fst L'
open DistLatticeStr (snd L')
open MonoidBigOp (Semilattice→Monoid (Lattice→MeetSemilattice (DistLattice→Lattice L')))
-- extra DistLattice→MeetMonoid?
open LatticeTheory (DistLattice→Lattice L')
open KroneckerDelta L'
⋀ = bigOp
⋀Ext = bigOpExt
⋀1l = bigOpε
⋀Last = bigOpLast
⋀Split : ∀ {n} → (V W : FinVec L n) → ⋀ (λ i → V i ∧l W i) ≡ ⋀ V ∧l ⋀ W
⋀Split = bigOpSplit ∧lComm
⋀Joinrdist : ∀ {n} → (x : L) → (V : FinVec L n)
→ x ∨l ⋀ V ≡ ⋀ λ i → x ∨l V i
⋀Joinrdist {n = zero} x _ = 1lRightAnnihilates∨l x
⋀Joinrdist {n = suc n} x V =
x ∨l (V zero ∧l ⋀ (V ∘ suc)) ≡⟨ ∨lLdist∧l _ _ _ ⟩ --Ldist and Rdist wrong way around?
(x ∨l V zero) ∧l (x ∨l ⋀ (V ∘ suc)) ≡⟨ (λ i → (x ∨l V zero) ∧l ⋀Joinrdist x (V ∘ suc) i) ⟩
(x ∨l V zero) ∧l ⋀ (λ i → x ∨l V (suc i)) ∎
⋀Joinldist : ∀ {n} → (x : L) → (V : FinVec L n)
→ (⋀ V) ∨l x ≡ ⋀ λ i → V i ∨l x
⋀Joinldist {n = zero} x _ = 1lLeftAnnihilates∨l x
⋀Joinldist {n = suc n} x V =
(V zero ∧l ⋀ (V ∘ suc)) ∨l x ≡⟨ ∨lRdist∧l _ _ _ ⟩
(V zero ∨l x) ∧l ((⋀ (V ∘ suc)) ∨l x) ≡⟨ (λ i → (V zero ∨l x) ∧l ⋀Joinldist x (V ∘ suc) i) ⟩
(V zero ∨l x) ∧l ⋀ (λ i → V (suc i) ∨l x) ∎
⋀Joinr1 : ∀ {n} → (V : FinVec L n) → ⋀ (λ i → V i ∨l 1l) ≡ 1l
⋀Joinr1 V = sym (⋀Joinldist 1l V) ∙ 1lRightAnnihilates∨l _
⋀Join1r : ∀ {n} → (V : FinVec L n) → ⋀ (λ i → 1l ∨l V i) ≡ 1l
⋀Join1r V = sym (⋀Joinrdist 1l V) ∙ 1lLeftAnnihilates∨l _
|
L1/TPs/0204-ASM/tp1/cond3.asm | Tehcam/Studies | 0 | 168199 | <filename>L1/TPs/0204-ASM/tp1/cond3.asm
; Initialisation
In ; valeur a (0)
Store Mem[0] ; (1)
In ; valeur b (2)
; Traitement
CMP Mem[0] ; test a-b (3)
JC 7 ; si a < b aller à l'instruction 7 (4)
; Sinon
Load 1 ; (5)
JMP 8; puis aller à la fin du programme (6)
; Alors
Load 0 ; (7)
; Fin du programme
Out ; affiche 0 ou 1 (8)
End ; (9) |
util/menus/info.asm | olifink/smsqe | 0 | 90176 | ; Get various defaults from Menu INFO call 1997 <NAME>
section utility
include dev8_mac_xref
include dev8_keys_menu
include dev8_keys_err
include dev8_keys_thg
include dev8_keys_qlv
xdef mu_getdef ; get various defaults
;+++
; Get various defaults from Menu INFO call (requires Menu 7.02 or higher)
;
; Entry Exit
; d1.b main colourway
; d2.b sub colourway
; d3.b button colourway
; d4.l icon explain delay | update frequency
; d5.b explanation colourway
;
; All possible error returns from Menu.
;---
get_reg reg d7/a0-a2/a4/a6
stk_frm equ $20
mu_getdef
movem.l get_reg,-(sp)
move.l #'INFO',d2
xbsr ut_usmen ; try to use Menu Thing
bne.s err_nomenu
move.l a1,a4 ; address of Thing
sub.l #stk_frm,sp
move.l sp,a1 ; here is our parameter table
move.l #inf.cole,d1 ; everse orer!
bsr.s get_it
bne.s err_menuerr ; error from menu call
move.b d1,d5
move.l #inf.iexp,d1
bsr.s get_it
bne.s err_menuerr
move.b d1,d4
swap d4
move.l #inf.ffui,d1 ; update frequency
bsr.s get_it
bne.s err_menuerr ; error from menu call
move.b d1,d4
move.l #inf.colb,d1 ; next button colourway
bsr.s get_it
bne.s err_menuerr
move.b d1,d3
move.l #inf.cols,d1 ; next comes sub-colourway
bsr.s get_it
bne.s err_menuerr
move.b d1,d2
move.l #inf.colm,d1 ; finally, main colourway
bsr.s get_it ; result comes back in d1
err_menuerr
move.l d1,-(sp)
xbsr ut_frmen ; finally free Menu Extension
move.l (sp)+,d1
add.l #stk_frm,sp ; adjust stack
err_nomenu
movem.l (sp)+,get_reg
tst.l d0
rts
get_it
move.l #(thp.ret+thp.str)<<16,4(a1) ; return parameter is string
move.l d1,(a1) ; inquiry key
lea $c(a1),a2 ; point to return string
move.l a2,inf_ret(a1)
jsr thh_code(a4) ; call routine to get string
movem.l d2-d3/a0-a3,-(sp) ; conversion routine smashes a lot!
sub.l a6,a6 ; relative A6
lea stk_frm(a1),a1 ; return stack
moveq #0,d7
move.w (a2)+,d7
add.l a2,d7 ; end of string
move.l a2,a0 ; start of string
move.w cv.deciw,a2
jsr (a2) ; convert
move.w (a1),d1 ; return value
movem.l (sp)+,d2-d3/a0-a3
tst.l d0
rts
end
|
AKKUSCHRAUBER.asm | Grima04/Akkuschrauber | 0 | 98119 | ; ***********************************************************
; * Akkuschrauber Code: *
; * 4-stufiger Akkuschrauber mit 3 Eindrehgeschwindigkeiten *
; * und 1 Rausdrehgeschwindigkeit *
; * Modi: 20 RPM, 40RPM, 60 RPM, -20 RPM *
; * Ersteller: Grima04 und MatPhil2K *
; * Datum: 14. Dezember 2020 *
; ***********************************************************
CPU 80515 ;MC selection (identical with 80C535)
INCLUDE stddef51 ;SFR definitions
SEGMENT code ;Program code segment starts here
ORG 0000H ;Adresszähler
JMP START ;Springe auf START
ORG 000BH ;Adresszähler für Zähler 0 Interrupt
SETB P4.5 ;setzen des Takt Bits
CLR P4.5 ;Löschen des Takt Bits
MOV TH0,R0 ;High-byte des Zählers wiederherstellen
MOV TL0,R1 ;Low-byte des Zählers wiederherstellen
RETI ;Verlasse den Interrupt
ORG 0100H ;Adresszähler Hauptprogramm
START:
MOV TMOD,#00000001B ;Betriebsart des Zählers setzen
SETB ET0 ;Zähler 0 freigeben
SETB EAL ;Interrupts zulassen
MOV R7,#4 ;Setze Flag für Stop
CALL AUSGABE_7SEGM ;Rufe Anzeige-Unterprogramm auf
CHECK_BTN:
MOV A,P1 ;Kopiere Port1 auf Akku A
CJNE A,#01111111B,EQU7 ;Verzweige, wenn Taste 8 nicht gedrückt
JMP STEP1 ;Springe auf Vorwärtsdrehung 1
EQU7:
MOV A,P1 ;Kopiere Port1 auf Akku A
CJNE A,#10111111B,EQU6 ;Verzweige, wenn Taste 7 nicht gedrückt
JMP STEP2 ;Springe auf Vorwärtsdrehung 2
EQU6:
MOV A,P1 ;Kopiere Port1 auf Akku A
CJNE A,#11011111B,EQU5 ;Verzweige, wenn Taste 6 nicht gedrückt
JMP STEP3 ;Springe auf Vorwärtsdrehung 3
EQU5:
MOV A,P1 ;Kopiere Port1 auf Akku A
CJNE A,#11101111B,CHECK_BTN ;Verzweige, wenn Taste 5 nicht gedrückt
JMP REV ;Springe auf Rückwärtsdrehung
STEP1:
MOV R7,#0 ;Setze Flag für Vorwärtsdrehung 1
CALL AUSGABE_7SEGM ;Rufe Anzeige-Unterprogramm auf
MOV R0,#085H ;Speichere High-byte für Zähler
MOV R1,#0EEH ;Speichere Low-byte für Zähler
MOV TH0,R0 ;High-byte des Zählers setzen
MOV TL0,R1 ;Low-byte des Zählers setzen
CLR P4.7 ;Setze Schrittweite auf Vollschritt
SETB P4.6 ;Setze Drehrichtung auf Rechts
SETB TR0 ;Starte Zähler 0
JMP ENT ;Springe zur Entprellung
STEP2:
MOV R7,#1 ;Setze Flag für Vorwärtsdrehung 2
CALL AUSGABE_7SEGM ;Rufe Anzeige-Unterprogramm auf
MOV R0,#0C2H ;Speichere High-byte für Zähler
MOV R1,#0F7H ;Speichere Low-byte für Zähler
MOV TH0,R0 ;High-byte des Zählers setzen
MOV TL0,R1 ;Low-byte des Zählers setzen
CLR P4.7 ;Setze Schrittweite auf Vollschritt
SETB P4.6 ;Setze Drehrichtung auf Rechts
SETB TR0 ;Starte Zähler 0
JMP ENT ;Springe zur Entprellung
STEP3:
MOV R7,#2 ;Setze Flag für Vorwärtsdrehung 3
CALL AUSGABE_7SEGM ;Rufe Anzeige-Unterprogramm auf
MOV R0,#0D7H ;Speichere High-byte für Zähler
MOV R1,#050H ;Speichere Low-byte für Zähler
MOV TH0,R0 ;High-byte des Zählers setzen
MOV TL0,R1 ;Low-byte des Zählers setzen
CLR P4.7 ;Setze Schrittweite auf Vollschritt
SETB P4.6 ;Setze Drehrichtung auf Rechts
SETB TR0 ;Starte Zähler 0
JMP ENT ;Springe zur Entprellung
REV:
MOV R7,#3 ;Setze Flag für Rückwärtsdrehung
CALL AUSGABE_7SEGM ;Rufe Anzeige-Unterprogramm auf
MOV R0,#0C2H ;Speichere High-byte für Zähler
MOV R1,#0F7H ;Speichere Low-byte für Zähler
MOV TH0,R0 ;High-byte des Zählers setzen
MOV TL0,R1 ;Low-byte des Zählers setzen
SETB P4.7 ;Setze Schrittweite auf Halbschritt
CLR P4.6 ;Setze Drehrichtung auf Links
SETB TR0 ;Starte Zähler 0
JMP ENT ;Springe zur Entprellung
STOP:
MOV R7,#4 ;Setze Flag für Stop
CALL AUSGABE_7SEGM ;Rufe Anzeige-Unterprogramm auf
CLR TR0 ;Stoppe Zähler 0
JMP CHECK_BTN ;Springe auf Taster überprüfen
ENT:
MOV A,P1 ;Kopiere Port1 Auf Akku A
MOV R3,#20 ;Lade Entprell-Zähler mit 20
ENT2:
CJNE A,P1,ENT ;Verzweige, wenn A ungleich Port1
DJNZ R3,ENT2 ;Ende der Schleife erreicht?
MOV A,P1 ;Kopiere Port1 Auf Akku A
EQUBTN8:
CJNE A,#01111111B,EQUBTN7 ;Verzweige, wenn Taste 8 nicht gedrückt
MOV A,P1 ;Kopiere Port1 Auf Akku A
JMP EQUBTN8 ;Wiederhole Tastenprüfung
EQUBTN7:
CJNE A,#10111111B,EQUBTN6 ;Verzweige, wenn Taste 7 nicht gedrückt
MOV A,P1 ;Kopiere Port1 Auf Akku A
JMP EQUBTN7 ;Wiederhole Tastenprüfung
EQUBTN6:
CJNE A,#11011111B,EQUBTN5 ;Verzweige, wenn Taste 6 nicht gedrückt
MOV A,P1 ;Kopiere Port1 Auf Akku A
JMP EQUBTN6 ;Wiederhole Tastenprüfung
EQUBTN5:
CJNE A,#11101111B,STOP ;Verzweige, wenn Taste 5 nicht gedrückt
MOV A,P1 ;Kopiere Port1 Auf Akku A
JMP EQUBTN5 ;Wiederhole Tastenprüfung
AUSGABE_7SEGM:
CJNE R7,#0,RPM40 ;Flag Vorwärtsdrehung 1 gesetzt?
MOV DPTR,#TR20 ;Zeiger auf Sprungtabelle TR20
SJMP AUSGABE_7SEGM_2 ;Springe auf Anzeigenausgabe
RPM40:
CJNE R7,#1,RPM60 ;Flag Vorwärtsdrehung 2 gesetzt?
MOV DPTR,#TR40 ;Zeiger auf Sprungtabelle TR40
SJMP AUSGABE_7SEGM_2 ;Springe auf Anzeigenausgabe
RPM60:
CJNE R7,#2,NEG20RPM ;Flag Vorwärtsdrehung 3 gesetzt?
MOV DPTR,#TR60 ;Zeiger auf Sprungtabelle TR60
SJMP AUSGABE_7SEGM_2 ;Springe auf Anzeigenausgabe
NEG20RPM:
CJNE R7,#3,AUSGESCH ;Flag Rückwärtsdrehung gesetzt?
MOV DPTR,#NEGTR20 ;Zeiger auf Sprungtabelle NEGTR20
SJMP AUSGABE_7SEGM_2 ;Springe auf Anzeigenausgabe
AUSGESCH:
MOV DPTR,#OFF ;Zeiger auf Sprungtabelle OFF
SJMP AUSGABE_7SEGM_2 ;Springe auf Anzeigenausgabe
AUSGABE_7SEGM_2:
CLR A ;Akku A löschen
CALL DPTR_ROUTINE ;Rufe Zeiger auf um Tabelle anzusteuern
CLR P4.3
SETB P4.3 ;Aktualisiere Segmentblock 3
CLR A ;Akku A löschen
CALL DPTR_ROUTINE ;Rufe Zeiger auf um Tabelle anzusteuern
CLR P4.2
SETB P4.2 ;Aktualisiere Segmentblock 2
CLR A ;Akku A löschen
CALL DPTR_ROUTINE ;Rufe Zeiger auf um Tabelle anzusteuern
CLR P4.1
SETB P4.1 ;Aktualisiere Segmentblock 1
CLR A ;Akku A löschen
CALL DPTR_ROUTINE ;Rufe Zeiger auf um Tabelle anzusteuern
CLR P4.0
SETB P4.0 ;Aktualisiere Segmentblock 0
RET ;Verlasse Unterprogramm
DPTR_ROUTINE:
MOVC A,@A+DPTR ;Kopiere Inhalt von Tabellenzeile auf A
INC DPTR ;Erhöhe Zeiger um 1
MOV P5,A ;Anzeige ausgeben
RET ;Unterprogramm verlassen
TR20:
DB 10100100B ;Ziffer 2
DB 11000000B ;Ziffer 0
DB 10000111B ;Ziffer t
DB 10101111B ;Ziffer r
TR40:
DB 10011001B ;Ziffer 4
DB 11000000B ;Ziffer 0
DB 10000111B ;Ziffer t
DB 10101111B ;Ziffer r
TR60:
DB 10000010B ;Ziffer 6
DB 11000000B ;Ziffer 0
DB 10000111B ;Ziffer t
DB 10101111B ;Ziffer r
NEGTR20:
DB 10111111B ;Ziffer -
DB 10100100B ;Ziffer 2
DB 11000000B ;Ziffer 0
DB 10000111B ;Ziffer t
OFF:
DB 11111111B ;Anzeige dunkel
DB 11000000B ;Ziffer 0
DB 10001110B ;Ziffer F
DB 10001110B ;Ziffer F
|
oeis/155/A155132.asm | neoneye/loda-programs | 11 | 20382 | ; A155132: a(n) = 8*a(n-1) + 8*a(n-2), n > 2, a(0)=1, a(1)=7, a(2)=63.
; Submitted by <NAME>
; 1,7,63,560,4984,44352,394688,3512320,31256064,278147072,2475225088,22026977280,196017618944,1744356769792,15522995109888,138138815037440,1229294481178624,10939466369728512,97350086807257088,866316425415884800,7709332097785135104,68605188185608159232,610516162267146354688,5432970803622036111360,48347895727113459728384,430246932245883966717952,3828758623783979411570688,34072044448238907026309120,303206424576183091503038464,2698227752195375988234780672,24011473414172472637902553088
mov $1,1
lpb $0
sub $0,1
mul $1,7
add $1,$2
mov $2,$3
add $3,$1
mov $1,$2
add $1,$3
lpe
mov $0,$1
|
gfx/pokemon/eevee/anim_idle.asm | Dev727/ancientplatinum | 28 | 80287 | <reponame>Dev727/ancientplatinum
setrepeat 3
frame 0, 05
frame 5, 05
dorepeat 1
frame 0, 09
frame 5, 13
endanim
|
Cats/Profunctor.agda | alessio-b-zak/cats | 0 | 14481 | module Cats.Profunctor where
open import Data.Product using (_,_)
open import Level using (suc ; _⊔_)
open import Cats.Category
open import Cats.Category.Op using (_ᵒᵖ)
open import Cats.Category.Product.Binary using (_×_)
open import Cats.Category.Setoids using (Setoids)
open import Cats.Functor
import Cats.Category.Cat as Cat
import Cats.Category.Cat.Facts.Product as Cat
-- The usual definition inverts C and D, so
--
-- Profunctor C D E = Functor (Dᵒᵖ × C) E
--
-- but that's just confusing.
Profunctor : ∀ {lo la l≈ lo′ la′ l≈′ lo″ la″ l≈″}
→ Category lo la l≈
→ Category lo′ la′ l≈′
→ Category lo″ la″ l≈″
→ Set (lo ⊔ la ⊔ l≈ ⊔ lo′ ⊔ la′ ⊔ l≈′ ⊔ lo″ ⊔ la″ ⊔ l≈″)
Profunctor C D E = Functor ((C ᵒᵖ) × D) E
module Profunctor {lo la l≈ lo′ la′ l≈′ lo″ la″ l≈″}
{C : Category lo la l≈}
{D : Category lo′ la′ l≈′}
{E : Category lo″ la″ l≈″}
(F : Profunctor C D E)
where
private
module C = Category C
module D = Category D
module E = Category E
pobj : C.Obj → D.Obj → E.Obj
pobj c d = fobj F (c , d)
pmap : ∀ {c c′} (f : c′ C.⇒ c) {d d′} (g : d D.⇒ d′)
→ pobj c d E.⇒ pobj c′ d′
pmap f g = fmap F (f , g)
pmap₁ : ∀ {c c′ d} (f : c′ C.⇒ c)
→ pobj c d E.⇒ pobj c′ d
pmap₁ f = pmap f D.id
pmap₂ : ∀ {c d d′} (g : d D.⇒ d′)
→ pobj c d E.⇒ pobj c d′
pmap₂ g = pmap C.id g
open Profunctor public
Functor→Profunctor₁ : ∀ {lo la l≈ lo′ la′ l≈′ lo″ la″ l≈″}
→ {C : Category lo la l≈} {D : Category lo′ la′ l≈′} {X : Category lo″ la″ l≈″}
→ Functor (C ᵒᵖ) D
→ Profunctor C X D
Functor→Profunctor₁ F = F Cat.∘ Cat.proj₁
Functor→Profunctor₂ : ∀ {lo la l≈ lo′ la′ l≈′ lo″ la″ l≈″}
→ {C : Category lo la l≈} {D : Category lo′ la′ l≈′} {X : Category lo″ la″ l≈″}
→ Functor C D
→ Profunctor X C D
Functor→Profunctor₂ F = F Cat.∘ Cat.proj₂
|
_build/dispatcher/jmp_ippsGFpECPointInit_9a4f0ce2.asm | zyktrcn/ippcp | 1 | 13180 | <reponame>zyktrcn/ippcp<filename>_build/dispatcher/jmp_ippsGFpECPointInit_9a4f0ce2.asm
extern m7_ippsGFpECPointInit:function
extern n8_ippsGFpECPointInit:function
extern y8_ippsGFpECPointInit:function
extern e9_ippsGFpECPointInit:function
extern l9_ippsGFpECPointInit:function
extern n0_ippsGFpECPointInit:function
extern k0_ippsGFpECPointInit:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpECPointInit
.Larraddr_ippsGFpECPointInit:
dq m7_ippsGFpECPointInit
dq n8_ippsGFpECPointInit
dq y8_ippsGFpECPointInit
dq e9_ippsGFpECPointInit
dq l9_ippsGFpECPointInit
dq n0_ippsGFpECPointInit
dq k0_ippsGFpECPointInit
segment .text
global ippsGFpECPointInit:function (ippsGFpECPointInit.LEndippsGFpECPointInit - ippsGFpECPointInit)
.Lin_ippsGFpECPointInit:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpECPointInit:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpECPointInit]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpECPointInit:
|
alloy4fun_models/trashltl/models/15/tX8KRM22NLQdtNnEQ.als | Kaixi26/org.alloytools.alloy | 0 | 1883 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idtX8KRM22NLQdtNnEQ_prop16 {
always all f:File | f in Protected implies f in Protected'
}
pred __repair { idtX8KRM22NLQdtNnEQ_prop16 }
check __repair { idtX8KRM22NLQdtNnEQ_prop16 <=> prop16o } |
programs/oeis/132/A132030.asm | neoneye/loda | 22 | 28087 | <reponame>neoneye/loda
; A132030: a(n) = Product_{k=0..floor(log_6(n))} floor(n/6^k), n>=1.
; 1,2,3,4,5,6,7,8,9,10,11,24,26,28,30,32,34,54,57,60,63,66,69,96,100,104,108,112,116,150,155,160,165,170,175,216,222,228,234,240,246,294,301,308,315,322,329,384,392,400,408,416,424,486,495,504,513,522,531,600,610,620,630,640,650,726,737,748,759,770,781,1728,1752,1776,1800,1824,1848,2028,2054,2080,2106,2132,2158,2352,2380,2408,2436,2464,2492,2700,2730,2760,2790,2820,2850,3072,3104,3136,3168,3200
add $0,1
mov $1,1
lpb $0
mul $1,$0
div $0,6
lpe
mov $0,$1
|
libtool/src/gmp-6.1.2/mpn/x86_64/sublsh1_n.asm | kroggen/aergo | 1,602 | 100451 | dnl AMD64 mpn_sublsh1_n -- rp[] = up[] - (vp[] << 1)
dnl Copyright 2003, 2005-2007, 2011, 2012 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C AMD K8,K9 2.2
C AMD K10 2.2
C Intel P4 12.75
C Intel core2 3.45
C Intel corei ?
C Intel atom ?
C VIA nano 3.25
C Sometimes speed degenerates, supposedly related to that some operand
C alignments cause cache conflicts.
C The speed is limited by decoding/issue bandwidth. There are 26 instructions
C in the loop, which corresponds to 26/3/4 = 2.167 c/l.
C INPUT PARAMETERS
define(`rp',`%rdi')
define(`up',`%rsi')
define(`vp',`%rdx')
define(`n', `%rcx')
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_sublsh1_n)
FUNC_ENTRY(4)
push %rbx
push %rbp
mov (vp), %r8
mov R32(n), R32(%rax)
lea (rp,n,8), rp
lea (up,n,8), up
lea (vp,n,8), vp
neg n
xor R32(%rbp), R32(%rbp)
and $3, R32(%rax)
je L(b00)
cmp $2, R32(%rax)
jc L(b01)
je L(b10)
L(b11): add %r8, %r8
mov 8(vp,n,8), %r9
adc %r9, %r9
mov 16(vp,n,8), %r10
adc %r10, %r10
sbb R32(%rax), R32(%rax) C save scy
mov (up,n,8), %rbp
mov 8(up,n,8), %rbx
sub %r8, %rbp
sbb %r9, %rbx
mov %rbp, (rp,n,8)
mov %rbx, 8(rp,n,8)
mov 16(up,n,8), %rbp
sbb %r10, %rbp
mov %rbp, 16(rp,n,8)
sbb R32(%rbp), R32(%rbp) C save acy
add $3, n
jmp L(ent)
L(b10): add %r8, %r8
mov 8(vp,n,8), %r9
adc %r9, %r9
sbb R32(%rax), R32(%rax) C save scy
mov (up,n,8), %rbp
mov 8(up,n,8), %rbx
sub %r8, %rbp
sbb %r9, %rbx
mov %rbp, (rp,n,8)
mov %rbx, 8(rp,n,8)
sbb R32(%rbp), R32(%rbp) C save acy
add $2, n
jmp L(ent)
L(b01): add %r8, %r8
sbb R32(%rax), R32(%rax) C save scy
mov (up,n,8), %rbp
sub %r8, %rbp
mov %rbp, (rp,n,8)
sbb R32(%rbp), R32(%rbp) C save acy
inc n
L(ent): jns L(end)
ALIGN(16)
L(top): add R32(%rax), R32(%rax) C restore scy
mov (vp,n,8), %r8
L(b00): adc %r8, %r8
mov 8(vp,n,8), %r9
adc %r9, %r9
mov 16(vp,n,8), %r10
adc %r10, %r10
mov 24(vp,n,8), %r11
adc %r11, %r11
sbb R32(%rax), R32(%rax) C save scy
add R32(%rbp), R32(%rbp) C restore acy
mov (up,n,8), %rbp
mov 8(up,n,8), %rbx
sbb %r8, %rbp
sbb %r9, %rbx
mov %rbp, (rp,n,8)
mov %rbx, 8(rp,n,8)
mov 16(up,n,8), %rbp
mov 24(up,n,8), %rbx
sbb %r10, %rbp
sbb %r11, %rbx
mov %rbp, 16(rp,n,8)
mov %rbx, 24(rp,n,8)
sbb R32(%rbp), R32(%rbp) C save acy
add $4, n
js L(top)
L(end): add R32(%rbp), R32(%rax)
neg R32(%rax)
pop %rbp
pop %rbx
FUNC_EXIT()
ret
EPILOGUE()
|
Override/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm | LeeLeahy/quarkfsp | 2 | 170903 | ;; @file
; Provide FSP API entry points.
;
; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials are licensed and made available
; under the terms and conditions of the BSD License which accompanies this
; distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;;
SECTION .text
;----------------------------------------------------------------------------
; Module Entrypoint API
;----------------------------------------------------------------------------
global ASM_PFX(_ModuleEntryPoint)
ASM_PFX(_ModuleEntryPoint):
jmp $
;----------------------------------------------------------------------------
; Reference the following functions to pull them into the image
;
; Following functions will be provided in C
;----------------------------------------------------------------------------
extern ASM_PFX(FspSiliconInitApi)
extern ASM_PFX(NotifyPhaseApi)
jmp ASM_PFX(FspSiliconInitApi)
jmp ASM_PFX(NotifyPhaseApi)
|
cat.asm | AlonYeroushalmi/Assignment_1 | 0 | 101995 |
_cat: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
}
}
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 57 push %edi
e: 56 push %esi
f: 53 push %ebx
10: 51 push %ecx
11: be 01 00 00 00 mov $0x1,%esi
16: 83 ec 18 sub $0x18,%esp
19: 8b 01 mov (%ecx),%eax
1b: 8b 59 04 mov 0x4(%ecx),%ebx
1e: 83 c3 04 add $0x4,%ebx
int fd, i;
if(argc <= 1){
21: 83 f8 01 cmp $0x1,%eax
}
}
int
main(int argc, char *argv[])
{
24: 89 45 e4 mov %eax,-0x1c(%ebp)
int fd, i;
if(argc <= 1){
27: 7e 54 jle 7d <main+0x7d>
29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
cat(0);
exit();
}
for(i = 1; i < argc; i++){
if((fd = open(argv[i], 0)) < 0){
30: 83 ec 08 sub $0x8,%esp
33: 6a 00 push $0x0
35: ff 33 pushl (%ebx)
37: e8 fc 03 00 00 call 438 <open>
3c: 83 c4 10 add $0x10,%esp
3f: 85 c0 test %eax,%eax
41: 89 c7 mov %eax,%edi
43: 78 24 js 69 <main+0x69>
printf(1, "cat: cannot open %s\n", argv[i]);
exit();
}
cat(fd);
45: 83 ec 0c sub $0xc,%esp
if(argc <= 1){
cat(0);
exit();
}
for(i = 1; i < argc; i++){
48: 83 c6 01 add $0x1,%esi
4b: 83 c3 04 add $0x4,%ebx
if((fd = open(argv[i], 0)) < 0){
printf(1, "cat: cannot open %s\n", argv[i]);
exit();
}
cat(fd);
4e: 50 push %eax
4f: e8 3c 00 00 00 call 90 <cat>
close(fd);
54: 89 3c 24 mov %edi,(%esp)
57: e8 c4 03 00 00 call 420 <close>
if(argc <= 1){
cat(0);
exit();
}
for(i = 1; i < argc; i++){
5c: 83 c4 10 add $0x10,%esp
5f: 39 75 e4 cmp %esi,-0x1c(%ebp)
62: 75 cc jne 30 <main+0x30>
exit();
}
cat(fd);
close(fd);
}
exit();
64: e8 8f 03 00 00 call 3f8 <exit>
exit();
}
for(i = 1; i < argc; i++){
if((fd = open(argv[i], 0)) < 0){
printf(1, "cat: cannot open %s\n", argv[i]);
69: 50 push %eax
6a: ff 33 pushl (%ebx)
6c: 68 a3 08 00 00 push $0x8a3
71: 6a 01 push $0x1
73: e8 e8 04 00 00 call 560 <printf>
exit();
78: e8 7b 03 00 00 call 3f8 <exit>
main(int argc, char *argv[])
{
int fd, i;
if(argc <= 1){
cat(0);
7d: 83 ec 0c sub $0xc,%esp
80: 6a 00 push $0x0
82: e8 09 00 00 00 call 90 <cat>
exit();
87: e8 6c 03 00 00 call 3f8 <exit>
8c: 66 90 xchg %ax,%ax
8e: 66 90 xchg %ax,%ax
00000090 <cat>:
char buf[512];
void
cat(int fd)
{
90: 55 push %ebp
91: 89 e5 mov %esp,%ebp
93: 56 push %esi
94: 53 push %ebx
95: 8b 75 08 mov 0x8(%ebp),%esi
int n;
while((n = read(fd, buf, sizeof(buf))) > 0) {
98: eb 1d jmp b7 <cat+0x27>
9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if (write(1, buf, n) != n) {
a0: 83 ec 04 sub $0x4,%esp
a3: 53 push %ebx
a4: 68 40 0c 00 00 push $0xc40
a9: 6a 01 push $0x1
ab: e8 68 03 00 00 call 418 <write>
b0: 83 c4 10 add $0x10,%esp
b3: 39 c3 cmp %eax,%ebx
b5: 75 26 jne dd <cat+0x4d>
void
cat(int fd)
{
int n;
while((n = read(fd, buf, sizeof(buf))) > 0) {
b7: 83 ec 04 sub $0x4,%esp
ba: 68 00 02 00 00 push $0x200
bf: 68 40 0c 00 00 push $0xc40
c4: 56 push %esi
c5: e8 46 03 00 00 call 410 <read>
ca: 83 c4 10 add $0x10,%esp
cd: 83 f8 00 cmp $0x0,%eax
d0: 89 c3 mov %eax,%ebx
d2: 7f cc jg a0 <cat+0x10>
if (write(1, buf, n) != n) {
printf(1, "cat: write error\n");
exit();
}
}
if(n < 0){
d4: 75 1b jne f1 <cat+0x61>
printf(1, "cat: read error\n");
exit();
}
}
d6: 8d 65 f8 lea -0x8(%ebp),%esp
d9: 5b pop %ebx
da: 5e pop %esi
db: 5d pop %ebp
dc: c3 ret
{
int n;
while((n = read(fd, buf, sizeof(buf))) > 0) {
if (write(1, buf, n) != n) {
printf(1, "cat: write error\n");
dd: 83 ec 08 sub $0x8,%esp
e0: 68 80 08 00 00 push $0x880
e5: 6a 01 push $0x1
e7: e8 74 04 00 00 call 560 <printf>
exit();
ec: e8 07 03 00 00 call 3f8 <exit>
}
}
if(n < 0){
printf(1, "cat: read error\n");
f1: 83 ec 08 sub $0x8,%esp
f4: 68 92 08 00 00 push $0x892
f9: 6a 01 push $0x1
fb: e8 60 04 00 00 call 560 <printf>
exit();
100: e8 f3 02 00 00 call 3f8 <exit>
105: 66 90 xchg %ax,%ax
107: 66 90 xchg %ax,%ax
109: 66 90 xchg %ax,%ax
10b: 66 90 xchg %ax,%ax
10d: 66 90 xchg %ax,%ax
10f: 90 nop
00000110 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
110: 55 push %ebp
111: 89 e5 mov %esp,%ebp
113: 53 push %ebx
114: 8b 45 08 mov 0x8(%ebp),%eax
117: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
11a: 89 c2 mov %eax,%edx
11c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
120: 83 c1 01 add $0x1,%ecx
123: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
127: 83 c2 01 add $0x1,%edx
12a: 84 db test %bl,%bl
12c: 88 5a ff mov %bl,-0x1(%edx)
12f: 75 ef jne 120 <strcpy+0x10>
;
return os;
}
131: 5b pop %ebx
132: 5d pop %ebp
133: c3 ret
134: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
13a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000140 <strncpy>:
char* strncpy(char* s, char* t, int n) {
140: 55 push %ebp
int i = 0;
141: 31 d2 xor %edx,%edx
while((*s++ = *t++) != 0)
;
return os;
}
char* strncpy(char* s, char* t, int n) {
143: 89 e5 mov %esp,%ebp
145: 56 push %esi
146: 53 push %ebx
147: 8b 45 08 mov 0x8(%ebp),%eax
14a: 8b 5d 0c mov 0xc(%ebp),%ebx
14d: 8b 75 10 mov 0x10(%ebp),%esi
int i = 0;
char *os;
os = s;
while(((*s++ = *t++) != 0) && (++i < n));
150: eb 0d jmp 15f <strncpy+0x1f>
152: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
158: 83 c2 01 add $0x1,%edx
15b: 39 f2 cmp %esi,%edx
15d: 7d 0b jge 16a <strncpy+0x2a>
15f: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
163: 84 c9 test %cl,%cl
165: 88 0c 10 mov %cl,(%eax,%edx,1)
168: 75 ee jne 158 <strncpy+0x18>
return os;
}
16a: 5b pop %ebx
16b: 5e pop %esi
16c: 5d pop %ebp
16d: c3 ret
16e: 66 90 xchg %ax,%ax
00000170 <strcmp>:
int
strcmp(const char *p, const char *q)
{
170: 55 push %ebp
171: 89 e5 mov %esp,%ebp
173: 56 push %esi
174: 53 push %ebx
175: 8b 55 08 mov 0x8(%ebp),%edx
178: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
17b: 0f b6 02 movzbl (%edx),%eax
17e: 0f b6 19 movzbl (%ecx),%ebx
181: 84 c0 test %al,%al
183: 75 1e jne 1a3 <strcmp+0x33>
185: eb 29 jmp 1b0 <strcmp+0x40>
187: 89 f6 mov %esi,%esi
189: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
190: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
193: 0f b6 02 movzbl (%edx),%eax
p++, q++;
196: 8d 71 01 lea 0x1(%ecx),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
199: 0f b6 59 01 movzbl 0x1(%ecx),%ebx
19d: 84 c0 test %al,%al
19f: 74 0f je 1b0 <strcmp+0x40>
1a1: 89 f1 mov %esi,%ecx
1a3: 38 d8 cmp %bl,%al
1a5: 74 e9 je 190 <strcmp+0x20>
p++, q++;
return (uchar)*p - (uchar)*q;
1a7: 29 d8 sub %ebx,%eax
}
1a9: 5b pop %ebx
1aa: 5e pop %esi
1ab: 5d pop %ebp
1ac: c3 ret
1ad: 8d 76 00 lea 0x0(%esi),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
1b0: 31 c0 xor %eax,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
1b2: 29 d8 sub %ebx,%eax
}
1b4: 5b pop %ebx
1b5: 5e pop %esi
1b6: 5d pop %ebp
1b7: c3 ret
1b8: 90 nop
1b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000001c0 <strncmp>:
int strncmp(const char *p, const char *q, int n) {
1c0: 55 push %ebp
1c1: 89 e5 mov %esp,%ebp
1c3: 57 push %edi
1c4: 56 push %esi
1c5: 53 push %ebx
1c6: 8b 5d 10 mov 0x10(%ebp),%ebx
1c9: 8b 75 08 mov 0x8(%ebp),%esi
1cc: 8b 7d 0c mov 0xc(%ebp),%edi
int i = 0;
while(i < n && *p == *q)
1cf: 85 db test %ebx,%ebx
1d1: 7e 28 jle 1fb <strncmp+0x3b>
1d3: 0f b6 16 movzbl (%esi),%edx
1d6: 0f b6 0f movzbl (%edi),%ecx
1d9: 38 d1 cmp %dl,%cl
1db: 75 2b jne 208 <strncmp+0x48>
1dd: 31 c0 xor %eax,%eax
1df: eb 13 jmp 1f4 <strncmp+0x34>
1e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1e8: 0f b6 14 06 movzbl (%esi,%eax,1),%edx
1ec: 0f b6 0c 07 movzbl (%edi,%eax,1),%ecx
1f0: 38 ca cmp %cl,%dl
1f2: 75 14 jne 208 <strncmp+0x48>
p++, q++, i++;
1f4: 83 c0 01 add $0x1,%eax
return (uchar)*p - (uchar)*q;
}
int strncmp(const char *p, const char *q, int n) {
int i = 0;
while(i < n && *p == *q)
1f7: 39 c3 cmp %eax,%ebx
1f9: 75 ed jne 1e8 <strncmp+0x28>
p++, q++, i++;
if (i < n)
return (uchar)*p - (uchar)*q;
else
return 0;
}
1fb: 5b pop %ebx
while(i < n && *p == *q)
p++, q++, i++;
if (i < n)
return (uchar)*p - (uchar)*q;
else
return 0;
1fc: 31 c0 xor %eax,%eax
}
1fe: 5e pop %esi
1ff: 5f pop %edi
200: 5d pop %ebp
201: c3 ret
202: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
int strncmp(const char *p, const char *q, int n) {
int i = 0;
while(i < n && *p == *q)
p++, q++, i++;
if (i < n)
return (uchar)*p - (uchar)*q;
208: 0f b6 c2 movzbl %dl,%eax
else
return 0;
}
20b: 5b pop %ebx
int strncmp(const char *p, const char *q, int n) {
int i = 0;
while(i < n && *p == *q)
p++, q++, i++;
if (i < n)
return (uchar)*p - (uchar)*q;
20c: 29 c8 sub %ecx,%eax
else
return 0;
}
20e: 5e pop %esi
20f: 5f pop %edi
210: 5d pop %ebp
211: c3 ret
212: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000220 <strlen>:
uint
strlen(char *s)
{
220: 55 push %ebp
221: 89 e5 mov %esp,%ebp
223: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
226: 80 39 00 cmpb $0x0,(%ecx)
229: 74 12 je 23d <strlen+0x1d>
22b: 31 d2 xor %edx,%edx
22d: 8d 76 00 lea 0x0(%esi),%esi
230: 83 c2 01 add $0x1,%edx
233: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
237: 89 d0 mov %edx,%eax
239: 75 f5 jne 230 <strlen+0x10>
;
return n;
}
23b: 5d pop %ebp
23c: c3 ret
uint
strlen(char *s)
{
int n;
for(n = 0; s[n]; n++)
23d: 31 c0 xor %eax,%eax
;
return n;
}
23f: 5d pop %ebp
240: c3 ret
241: eb 0d jmp 250 <memset>
243: 90 nop
244: 90 nop
245: 90 nop
246: 90 nop
247: 90 nop
248: 90 nop
249: 90 nop
24a: 90 nop
24b: 90 nop
24c: 90 nop
24d: 90 nop
24e: 90 nop
24f: 90 nop
00000250 <memset>:
void*
memset(void *dst, int c, uint n)
{
250: 55 push %ebp
251: 89 e5 mov %esp,%ebp
253: 57 push %edi
254: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
257: 8b 4d 10 mov 0x10(%ebp),%ecx
25a: 8b 45 0c mov 0xc(%ebp),%eax
25d: 89 d7 mov %edx,%edi
25f: fc cld
260: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
262: 89 d0 mov %edx,%eax
264: 5f pop %edi
265: 5d pop %ebp
266: c3 ret
267: 89 f6 mov %esi,%esi
269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000270 <strchr>:
char*
strchr(const char *s, char c)
{
270: 55 push %ebp
271: 89 e5 mov %esp,%ebp
273: 53 push %ebx
274: 8b 45 08 mov 0x8(%ebp),%eax
277: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
27a: 0f b6 10 movzbl (%eax),%edx
27d: 84 d2 test %dl,%dl
27f: 74 1d je 29e <strchr+0x2e>
if(*s == c)
281: 38 d3 cmp %dl,%bl
283: 89 d9 mov %ebx,%ecx
285: 75 0d jne 294 <strchr+0x24>
287: eb 17 jmp 2a0 <strchr+0x30>
289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
290: 38 ca cmp %cl,%dl
292: 74 0c je 2a0 <strchr+0x30>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
294: 83 c0 01 add $0x1,%eax
297: 0f b6 10 movzbl (%eax),%edx
29a: 84 d2 test %dl,%dl
29c: 75 f2 jne 290 <strchr+0x20>
if(*s == c)
return (char*)s;
return 0;
29e: 31 c0 xor %eax,%eax
}
2a0: 5b pop %ebx
2a1: 5d pop %ebp
2a2: c3 ret
2a3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
2a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000002b0 <gets>:
char*
gets(char *buf, int max)
{
2b0: 55 push %ebp
2b1: 89 e5 mov %esp,%ebp
2b3: 57 push %edi
2b4: 56 push %esi
2b5: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
2b6: 31 f6 xor %esi,%esi
cc = read(0, &c, 1);
2b8: 8d 7d e7 lea -0x19(%ebp),%edi
return 0;
}
char*
gets(char *buf, int max)
{
2bb: 83 ec 1c sub $0x1c,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
2be: eb 29 jmp 2e9 <gets+0x39>
cc = read(0, &c, 1);
2c0: 83 ec 04 sub $0x4,%esp
2c3: 6a 01 push $0x1
2c5: 57 push %edi
2c6: 6a 00 push $0x0
2c8: e8 43 01 00 00 call 410 <read>
if(cc < 1)
2cd: 83 c4 10 add $0x10,%esp
2d0: 85 c0 test %eax,%eax
2d2: 7e 1d jle 2f1 <gets+0x41>
break;
buf[i++] = c;
2d4: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
2d8: 8b 55 08 mov 0x8(%ebp),%edx
2db: 89 de mov %ebx,%esi
if(c == '\n' || c == '\r')
2dd: 3c 0a cmp $0xa,%al
for(i=0; i+1 < max; ){
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
2df: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
2e3: 74 1b je 300 <gets+0x50>
2e5: 3c 0d cmp $0xd,%al
2e7: 74 17 je 300 <gets+0x50>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
2e9: 8d 5e 01 lea 0x1(%esi),%ebx
2ec: 3b 5d 0c cmp 0xc(%ebp),%ebx
2ef: 7c cf jl 2c0 <gets+0x10>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
2f1: 8b 45 08 mov 0x8(%ebp),%eax
2f4: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
2f8: 8d 65 f4 lea -0xc(%ebp),%esp
2fb: 5b pop %ebx
2fc: 5e pop %esi
2fd: 5f pop %edi
2fe: 5d pop %ebp
2ff: c3 ret
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
300: 8b 45 08 mov 0x8(%ebp),%eax
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
303: 89 de mov %ebx,%esi
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
305: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
309: 8d 65 f4 lea -0xc(%ebp),%esp
30c: 5b pop %ebx
30d: 5e pop %esi
30e: 5f pop %edi
30f: 5d pop %ebp
310: c3 ret
311: eb 0d jmp 320 <stat>
313: 90 nop
314: 90 nop
315: 90 nop
316: 90 nop
317: 90 nop
318: 90 nop
319: 90 nop
31a: 90 nop
31b: 90 nop
31c: 90 nop
31d: 90 nop
31e: 90 nop
31f: 90 nop
00000320 <stat>:
int
stat(char *n, struct stat *st)
{
320: 55 push %ebp
321: 89 e5 mov %esp,%ebp
323: 56 push %esi
324: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
325: 83 ec 08 sub $0x8,%esp
328: 6a 00 push $0x0
32a: ff 75 08 pushl 0x8(%ebp)
32d: e8 06 01 00 00 call 438 <open>
if(fd < 0)
332: 83 c4 10 add $0x10,%esp
335: 85 c0 test %eax,%eax
337: 78 27 js 360 <stat+0x40>
return -1;
r = fstat(fd, st);
339: 83 ec 08 sub $0x8,%esp
33c: ff 75 0c pushl 0xc(%ebp)
33f: 89 c3 mov %eax,%ebx
341: 50 push %eax
342: e8 09 01 00 00 call 450 <fstat>
close(fd);
347: 89 1c 24 mov %ebx,(%esp)
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
r = fstat(fd, st);
34a: 89 c6 mov %eax,%esi
close(fd);
34c: e8 cf 00 00 00 call 420 <close>
return r;
351: 83 c4 10 add $0x10,%esp
}
354: 8d 65 f8 lea -0x8(%ebp),%esp
357: 89 f0 mov %esi,%eax
359: 5b pop %ebx
35a: 5e pop %esi
35b: 5d pop %ebp
35c: c3 ret
35d: 8d 76 00 lea 0x0(%esi),%esi
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
360: be ff ff ff ff mov $0xffffffff,%esi
365: eb ed jmp 354 <stat+0x34>
367: 89 f6 mov %esi,%esi
369: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000370 <atoi>:
return r;
}
int
atoi(const char *s)
{
370: 55 push %ebp
371: 89 e5 mov %esp,%ebp
373: 53 push %ebx
374: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
377: 0f be 11 movsbl (%ecx),%edx
37a: 8d 42 d0 lea -0x30(%edx),%eax
37d: 3c 09 cmp $0x9,%al
37f: b8 00 00 00 00 mov $0x0,%eax
384: 77 1f ja 3a5 <atoi+0x35>
386: 8d 76 00 lea 0x0(%esi),%esi
389: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
390: 8d 04 80 lea (%eax,%eax,4),%eax
393: 83 c1 01 add $0x1,%ecx
396: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
39a: 0f be 11 movsbl (%ecx),%edx
39d: 8d 5a d0 lea -0x30(%edx),%ebx
3a0: 80 fb 09 cmp $0x9,%bl
3a3: 76 eb jbe 390 <atoi+0x20>
n = n*10 + *s++ - '0';
return n;
}
3a5: 5b pop %ebx
3a6: 5d pop %ebp
3a7: c3 ret
3a8: 90 nop
3a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000003b0 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
3b0: 55 push %ebp
3b1: 89 e5 mov %esp,%ebp
3b3: 56 push %esi
3b4: 53 push %ebx
3b5: 8b 5d 10 mov 0x10(%ebp),%ebx
3b8: 8b 45 08 mov 0x8(%ebp),%eax
3bb: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
3be: 85 db test %ebx,%ebx
3c0: 7e 14 jle 3d6 <memmove+0x26>
3c2: 31 d2 xor %edx,%edx
3c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
3c8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
3cc: 88 0c 10 mov %cl,(%eax,%edx,1)
3cf: 83 c2 01 add $0x1,%edx
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
3d2: 39 da cmp %ebx,%edx
3d4: 75 f2 jne 3c8 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
3d6: 5b pop %ebx
3d7: 5e pop %esi
3d8: 5d pop %ebp
3d9: c3 ret
3da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000003e0 <max>:
int max(int a, int b) {
3e0: 55 push %ebp
3e1: 89 e5 mov %esp,%ebp
3e3: 8b 55 08 mov 0x8(%ebp),%edx
3e6: 8b 45 0c mov 0xc(%ebp),%eax
if (b > a) return b;
else return a;
}
3e9: 5d pop %ebp
3ea: 39 d0 cmp %edx,%eax
3ec: 0f 4c c2 cmovl %edx,%eax
3ef: c3 ret
000003f0 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
3f0: b8 01 00 00 00 mov $0x1,%eax
3f5: cd 40 int $0x40
3f7: c3 ret
000003f8 <exit>:
SYSCALL(exit)
3f8: b8 02 00 00 00 mov $0x2,%eax
3fd: cd 40 int $0x40
3ff: c3 ret
00000400 <wait>:
SYSCALL(wait)
400: b8 03 00 00 00 mov $0x3,%eax
405: cd 40 int $0x40
407: c3 ret
00000408 <pipe>:
SYSCALL(pipe)
408: b8 04 00 00 00 mov $0x4,%eax
40d: cd 40 int $0x40
40f: c3 ret
00000410 <read>:
SYSCALL(read)
410: b8 05 00 00 00 mov $0x5,%eax
415: cd 40 int $0x40
417: c3 ret
00000418 <write>:
SYSCALL(write)
418: b8 10 00 00 00 mov $0x10,%eax
41d: cd 40 int $0x40
41f: c3 ret
00000420 <close>:
SYSCALL(close)
420: b8 15 00 00 00 mov $0x15,%eax
425: cd 40 int $0x40
427: c3 ret
00000428 <kill>:
SYSCALL(kill)
428: b8 06 00 00 00 mov $0x6,%eax
42d: cd 40 int $0x40
42f: c3 ret
00000430 <exec>:
SYSCALL(exec)
430: b8 07 00 00 00 mov $0x7,%eax
435: cd 40 int $0x40
437: c3 ret
00000438 <open>:
SYSCALL(open)
438: b8 0f 00 00 00 mov $0xf,%eax
43d: cd 40 int $0x40
43f: c3 ret
00000440 <mknod>:
SYSCALL(mknod)
440: b8 11 00 00 00 mov $0x11,%eax
445: cd 40 int $0x40
447: c3 ret
00000448 <unlink>:
SYSCALL(unlink)
448: b8 12 00 00 00 mov $0x12,%eax
44d: cd 40 int $0x40
44f: c3 ret
00000450 <fstat>:
SYSCALL(fstat)
450: b8 08 00 00 00 mov $0x8,%eax
455: cd 40 int $0x40
457: c3 ret
00000458 <link>:
SYSCALL(link)
458: b8 13 00 00 00 mov $0x13,%eax
45d: cd 40 int $0x40
45f: c3 ret
00000460 <mkdir>:
SYSCALL(mkdir)
460: b8 14 00 00 00 mov $0x14,%eax
465: cd 40 int $0x40
467: c3 ret
00000468 <chdir>:
SYSCALL(chdir)
468: b8 09 00 00 00 mov $0x9,%eax
46d: cd 40 int $0x40
46f: c3 ret
00000470 <dup>:
SYSCALL(dup)
470: b8 0a 00 00 00 mov $0xa,%eax
475: cd 40 int $0x40
477: c3 ret
00000478 <getpid>:
SYSCALL(getpid)
478: b8 0b 00 00 00 mov $0xb,%eax
47d: cd 40 int $0x40
47f: c3 ret
00000480 <sbrk>:
SYSCALL(sbrk)
480: b8 0c 00 00 00 mov $0xc,%eax
485: cd 40 int $0x40
487: c3 ret
00000488 <sleep>:
SYSCALL(sleep)
488: b8 0d 00 00 00 mov $0xd,%eax
48d: cd 40 int $0x40
48f: c3 ret
00000490 <uptime>:
SYSCALL(uptime)
490: b8 0e 00 00 00 mov $0xe,%eax
495: cd 40 int $0x40
497: c3 ret
00000498 <setVariable>:
SYSCALL(setVariable)
498: b8 17 00 00 00 mov $0x17,%eax
49d: cd 40 int $0x40
49f: c3 ret
000004a0 <getVariable>:
SYSCALL(getVariable)
4a0: b8 18 00 00 00 mov $0x18,%eax
4a5: cd 40 int $0x40
4a7: c3 ret
000004a8 <remVariable>:
SYSCALL(remVariable)
4a8: b8 19 00 00 00 mov $0x19,%eax
4ad: cd 40 int $0x40
4af: c3 ret
000004b0 <wait2>:
SYSCALL(wait2)
4b0: b8 1a 00 00 00 mov $0x1a,%eax
4b5: cd 40 int $0x40
4b7: c3 ret
4b8: 66 90 xchg %ax,%ax
4ba: 66 90 xchg %ax,%ax
4bc: 66 90 xchg %ax,%ax
4be: 66 90 xchg %ax,%ax
000004c0 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
4c0: 55 push %ebp
4c1: 89 e5 mov %esp,%ebp
4c3: 57 push %edi
4c4: 56 push %esi
4c5: 53 push %ebx
4c6: 89 c6 mov %eax,%esi
4c8: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
4cb: 8b 5d 08 mov 0x8(%ebp),%ebx
4ce: 85 db test %ebx,%ebx
4d0: 74 7e je 550 <printint+0x90>
4d2: 89 d0 mov %edx,%eax
4d4: c1 e8 1f shr $0x1f,%eax
4d7: 84 c0 test %al,%al
4d9: 74 75 je 550 <printint+0x90>
neg = 1;
x = -xx;
4db: 89 d0 mov %edx,%eax
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
4dd: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
x = -xx;
4e4: f7 d8 neg %eax
4e6: 89 75 c0 mov %esi,-0x40(%ebp)
} else {
x = xx;
}
i = 0;
4e9: 31 ff xor %edi,%edi
4eb: 8d 5d d7 lea -0x29(%ebp),%ebx
4ee: 89 ce mov %ecx,%esi
4f0: eb 08 jmp 4fa <printint+0x3a>
4f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
4f8: 89 cf mov %ecx,%edi
4fa: 31 d2 xor %edx,%edx
4fc: 8d 4f 01 lea 0x1(%edi),%ecx
4ff: f7 f6 div %esi
501: 0f b6 92 c0 08 00 00 movzbl 0x8c0(%edx),%edx
}while((x /= base) != 0);
508: 85 c0 test %eax,%eax
x = xx;
}
i = 0;
do{
buf[i++] = digits[x % base];
50a: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
50d: 75 e9 jne 4f8 <printint+0x38>
if(neg)
50f: 8b 45 c4 mov -0x3c(%ebp),%eax
512: 8b 75 c0 mov -0x40(%ebp),%esi
515: 85 c0 test %eax,%eax
517: 74 08 je 521 <printint+0x61>
buf[i++] = '-';
519: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
51e: 8d 4f 02 lea 0x2(%edi),%ecx
while(--i >= 0)
521: 8d 79 ff lea -0x1(%ecx),%edi
524: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
528: 0f b6 44 3d d8 movzbl -0x28(%ebp,%edi,1),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
52d: 83 ec 04 sub $0x4,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
530: 83 ef 01 sub $0x1,%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
533: 6a 01 push $0x1
535: 53 push %ebx
536: 56 push %esi
537: 88 45 d7 mov %al,-0x29(%ebp)
53a: e8 d9 fe ff ff call 418 <write>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
53f: 83 c4 10 add $0x10,%esp
542: 83 ff ff cmp $0xffffffff,%edi
545: 75 e1 jne 528 <printint+0x68>
putc(fd, buf[i]);
}
547: 8d 65 f4 lea -0xc(%ebp),%esp
54a: 5b pop %ebx
54b: 5e pop %esi
54c: 5f pop %edi
54d: 5d pop %ebp
54e: c3 ret
54f: 90 nop
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
} else {
x = xx;
550: 89 d0 mov %edx,%eax
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
552: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
559: eb 8b jmp 4e6 <printint+0x26>
55b: 90 nop
55c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000560 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
560: 55 push %ebp
561: 89 e5 mov %esp,%ebp
563: 57 push %edi
564: 56 push %esi
565: 53 push %ebx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
566: 8d 45 10 lea 0x10(%ebp),%eax
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
569: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
56c: 8b 75 0c mov 0xc(%ebp),%esi
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
56f: 8b 7d 08 mov 0x8(%ebp),%edi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
572: 89 45 d0 mov %eax,-0x30(%ebp)
575: 0f b6 1e movzbl (%esi),%ebx
578: 83 c6 01 add $0x1,%esi
57b: 84 db test %bl,%bl
57d: 0f 84 b0 00 00 00 je 633 <printf+0xd3>
583: 31 d2 xor %edx,%edx
585: eb 39 jmp 5c0 <printf+0x60>
587: 89 f6 mov %esi,%esi
589: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
590: 83 f8 25 cmp $0x25,%eax
593: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
596: ba 25 00 00 00 mov $0x25,%edx
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
59b: 74 18 je 5b5 <printf+0x55>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
59d: 8d 45 e2 lea -0x1e(%ebp),%eax
5a0: 83 ec 04 sub $0x4,%esp
5a3: 88 5d e2 mov %bl,-0x1e(%ebp)
5a6: 6a 01 push $0x1
5a8: 50 push %eax
5a9: 57 push %edi
5aa: e8 69 fe ff ff call 418 <write>
5af: 8b 55 d4 mov -0x2c(%ebp),%edx
5b2: 83 c4 10 add $0x10,%esp
5b5: 83 c6 01 add $0x1,%esi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
5b8: 0f b6 5e ff movzbl -0x1(%esi),%ebx
5bc: 84 db test %bl,%bl
5be: 74 73 je 633 <printf+0xd3>
c = fmt[i] & 0xff;
if(state == 0){
5c0: 85 d2 test %edx,%edx
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
5c2: 0f be cb movsbl %bl,%ecx
5c5: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
5c8: 74 c6 je 590 <printf+0x30>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
5ca: 83 fa 25 cmp $0x25,%edx
5cd: 75 e6 jne 5b5 <printf+0x55>
if(c == 'd'){
5cf: 83 f8 64 cmp $0x64,%eax
5d2: 0f 84 f8 00 00 00 je 6d0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
5d8: 81 e1 f7 00 00 00 and $0xf7,%ecx
5de: 83 f9 70 cmp $0x70,%ecx
5e1: 74 5d je 640 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
5e3: 83 f8 73 cmp $0x73,%eax
5e6: 0f 84 84 00 00 00 je 670 <printf+0x110>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5ec: 83 f8 63 cmp $0x63,%eax
5ef: 0f 84 ea 00 00 00 je 6df <printf+0x17f>
putc(fd, *ap);
ap++;
} else if(c == '%'){
5f5: 83 f8 25 cmp $0x25,%eax
5f8: 0f 84 c2 00 00 00 je 6c0 <printf+0x160>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
5fe: 8d 45 e7 lea -0x19(%ebp),%eax
601: 83 ec 04 sub $0x4,%esp
604: c6 45 e7 25 movb $0x25,-0x19(%ebp)
608: 6a 01 push $0x1
60a: 50 push %eax
60b: 57 push %edi
60c: e8 07 fe ff ff call 418 <write>
611: 83 c4 0c add $0xc,%esp
614: 8d 45 e6 lea -0x1a(%ebp),%eax
617: 88 5d e6 mov %bl,-0x1a(%ebp)
61a: 6a 01 push $0x1
61c: 50 push %eax
61d: 57 push %edi
61e: 83 c6 01 add $0x1,%esi
621: e8 f2 fd ff ff call 418 <write>
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
626: 0f b6 5e ff movzbl -0x1(%esi),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
62a: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
62d: 31 d2 xor %edx,%edx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
62f: 84 db test %bl,%bl
631: 75 8d jne 5c0 <printf+0x60>
putc(fd, c);
}
state = 0;
}
}
}
633: 8d 65 f4 lea -0xc(%ebp),%esp
636: 5b pop %ebx
637: 5e pop %esi
638: 5f pop %edi
639: 5d pop %ebp
63a: c3 ret
63b: 90 nop
63c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
640: 83 ec 0c sub $0xc,%esp
643: b9 10 00 00 00 mov $0x10,%ecx
648: 6a 00 push $0x0
64a: 8b 5d d0 mov -0x30(%ebp),%ebx
64d: 89 f8 mov %edi,%eax
64f: 8b 13 mov (%ebx),%edx
651: e8 6a fe ff ff call 4c0 <printint>
ap++;
656: 89 d8 mov %ebx,%eax
658: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
65b: 31 d2 xor %edx,%edx
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
65d: 83 c0 04 add $0x4,%eax
660: 89 45 d0 mov %eax,-0x30(%ebp)
663: e9 4d ff ff ff jmp 5b5 <printf+0x55>
668: 90 nop
669: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
} else if(c == 's'){
s = (char*)*ap;
670: 8b 45 d0 mov -0x30(%ebp),%eax
673: 8b 18 mov (%eax),%ebx
ap++;
675: 83 c0 04 add $0x4,%eax
678: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
67b: 85 db test %ebx,%ebx
67d: 74 7c je 6fb <printf+0x19b>
s = "(null)";
while(*s != 0){
67f: 0f b6 03 movzbl (%ebx),%eax
682: 84 c0 test %al,%al
684: 74 29 je 6af <printf+0x14f>
686: 8d 76 00 lea 0x0(%esi),%esi
689: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
690: 88 45 e3 mov %al,-0x1d(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
693: 8d 45 e3 lea -0x1d(%ebp),%eax
696: 83 ec 04 sub $0x4,%esp
699: 6a 01 push $0x1
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
69b: 83 c3 01 add $0x1,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
69e: 50 push %eax
69f: 57 push %edi
6a0: e8 73 fd ff ff call 418 <write>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
6a5: 0f b6 03 movzbl (%ebx),%eax
6a8: 83 c4 10 add $0x10,%esp
6ab: 84 c0 test %al,%al
6ad: 75 e1 jne 690 <printf+0x130>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
6af: 31 d2 xor %edx,%edx
6b1: e9 ff fe ff ff jmp 5b5 <printf+0x55>
6b6: 8d 76 00 lea 0x0(%esi),%esi
6b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
6c0: 83 ec 04 sub $0x4,%esp
6c3: 88 5d e5 mov %bl,-0x1b(%ebp)
6c6: 8d 45 e5 lea -0x1b(%ebp),%eax
6c9: 6a 01 push $0x1
6cb: e9 4c ff ff ff jmp 61c <printf+0xbc>
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
6d0: 83 ec 0c sub $0xc,%esp
6d3: b9 0a 00 00 00 mov $0xa,%ecx
6d8: 6a 01 push $0x1
6da: e9 6b ff ff ff jmp 64a <printf+0xea>
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
6df: 8b 5d d0 mov -0x30(%ebp),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
6e2: 83 ec 04 sub $0x4,%esp
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
6e5: 8b 03 mov (%ebx),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
6e7: 6a 01 push $0x1
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
6e9: 88 45 e4 mov %al,-0x1c(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
6ec: 8d 45 e4 lea -0x1c(%ebp),%eax
6ef: 50 push %eax
6f0: 57 push %edi
6f1: e8 22 fd ff ff call 418 <write>
6f6: e9 5b ff ff ff jmp 656 <printf+0xf6>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
6fb: b8 28 00 00 00 mov $0x28,%eax
ap++;
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
700: bb b8 08 00 00 mov $0x8b8,%ebx
705: eb 89 jmp 690 <printf+0x130>
707: 66 90 xchg %ax,%ax
709: 66 90 xchg %ax,%ax
70b: 66 90 xchg %ax,%ax
70d: 66 90 xchg %ax,%ax
70f: 90 nop
00000710 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
710: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
711: a1 20 0c 00 00 mov 0xc20,%eax
static Header base;
static Header *freep;
void
free(void *ap)
{
716: 89 e5 mov %esp,%ebp
718: 57 push %edi
719: 56 push %esi
71a: 53 push %ebx
71b: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
71e: 8b 10 mov (%eax),%edx
void
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
720: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
723: 39 c8 cmp %ecx,%eax
725: 73 19 jae 740 <free+0x30>
727: 89 f6 mov %esi,%esi
729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
730: 39 d1 cmp %edx,%ecx
732: 72 1c jb 750 <free+0x40>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
734: 39 d0 cmp %edx,%eax
736: 73 18 jae 750 <free+0x40>
static Header base;
static Header *freep;
void
free(void *ap)
{
738: 89 d0 mov %edx,%eax
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
73a: 39 c8 cmp %ecx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
73c: 8b 10 mov (%eax),%edx
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
73e: 72 f0 jb 730 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
740: 39 d0 cmp %edx,%eax
742: 72 f4 jb 738 <free+0x28>
744: 39 d1 cmp %edx,%ecx
746: 73 f0 jae 738 <free+0x28>
748: 90 nop
749: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
if(bp + bp->s.size == p->s.ptr){
750: 8b 73 fc mov -0x4(%ebx),%esi
753: 8d 3c f1 lea (%ecx,%esi,8),%edi
756: 39 fa cmp %edi,%edx
758: 74 19 je 773 <free+0x63>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
75a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
75d: 8b 50 04 mov 0x4(%eax),%edx
760: 8d 34 d0 lea (%eax,%edx,8),%esi
763: 39 f1 cmp %esi,%ecx
765: 74 23 je 78a <free+0x7a>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
767: 89 08 mov %ecx,(%eax)
freep = p;
769: a3 20 0c 00 00 mov %eax,0xc20
}
76e: 5b pop %ebx
76f: 5e pop %esi
770: 5f pop %edi
771: 5d pop %ebp
772: c3 ret
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
773: 03 72 04 add 0x4(%edx),%esi
776: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
779: 8b 10 mov (%eax),%edx
77b: 8b 12 mov (%edx),%edx
77d: 89 53 f8 mov %edx,-0x8(%ebx)
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
780: 8b 50 04 mov 0x4(%eax),%edx
783: 8d 34 d0 lea (%eax,%edx,8),%esi
786: 39 f1 cmp %esi,%ecx
788: 75 dd jne 767 <free+0x57>
p->s.size += bp->s.size;
78a: 03 53 fc add -0x4(%ebx),%edx
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
freep = p;
78d: a3 20 0c 00 00 mov %eax,0xc20
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
792: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
795: 8b 53 f8 mov -0x8(%ebx),%edx
798: 89 10 mov %edx,(%eax)
} else
p->s.ptr = bp;
freep = p;
}
79a: 5b pop %ebx
79b: 5e pop %esi
79c: 5f pop %edi
79d: 5d pop %ebp
79e: c3 ret
79f: 90 nop
000007a0 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
7a0: 55 push %ebp
7a1: 89 e5 mov %esp,%ebp
7a3: 57 push %edi
7a4: 56 push %esi
7a5: 53 push %ebx
7a6: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7a9: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
7ac: 8b 15 20 0c 00 00 mov 0xc20,%edx
malloc(uint nbytes)
{
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7b2: 8d 78 07 lea 0x7(%eax),%edi
7b5: c1 ef 03 shr $0x3,%edi
7b8: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
7bb: 85 d2 test %edx,%edx
7bd: 0f 84 93 00 00 00 je 856 <malloc+0xb6>
7c3: 8b 02 mov (%edx),%eax
7c5: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
7c8: 39 cf cmp %ecx,%edi
7ca: 76 64 jbe 830 <malloc+0x90>
7cc: 81 ff 00 10 00 00 cmp $0x1000,%edi
7d2: bb 00 10 00 00 mov $0x1000,%ebx
7d7: 0f 43 df cmovae %edi,%ebx
char *p;
Header *hp;
if(nu < 4096)
nu = 4096;
p = sbrk(nu * sizeof(Header));
7da: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
7e1: eb 0e jmp 7f1 <malloc+0x51>
7e3: 90 nop
7e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7e8: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
7ea: 8b 48 04 mov 0x4(%eax),%ecx
7ed: 39 cf cmp %ecx,%edi
7ef: 76 3f jbe 830 <malloc+0x90>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
7f1: 39 05 20 0c 00 00 cmp %eax,0xc20
7f7: 89 c2 mov %eax,%edx
7f9: 75 ed jne 7e8 <malloc+0x48>
char *p;
Header *hp;
if(nu < 4096)
nu = 4096;
p = sbrk(nu * sizeof(Header));
7fb: 83 ec 0c sub $0xc,%esp
7fe: 56 push %esi
7ff: e8 7c fc ff ff call 480 <sbrk>
if(p == (char*)-1)
804: 83 c4 10 add $0x10,%esp
807: 83 f8 ff cmp $0xffffffff,%eax
80a: 74 1c je 828 <malloc+0x88>
return 0;
hp = (Header*)p;
hp->s.size = nu;
80c: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
80f: 83 ec 0c sub $0xc,%esp
812: 83 c0 08 add $0x8,%eax
815: 50 push %eax
816: e8 f5 fe ff ff call 710 <free>
return freep;
81b: 8b 15 20 0c 00 00 mov 0xc20,%edx
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
821: 83 c4 10 add $0x10,%esp
824: 85 d2 test %edx,%edx
826: 75 c0 jne 7e8 <malloc+0x48>
return 0;
828: 31 c0 xor %eax,%eax
82a: eb 1c jmp 848 <malloc+0xa8>
82c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
830: 39 cf cmp %ecx,%edi
832: 74 1c je 850 <malloc+0xb0>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
834: 29 f9 sub %edi,%ecx
836: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
839: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
83c: 89 78 04 mov %edi,0x4(%eax)
}
freep = prevp;
83f: 89 15 20 0c 00 00 mov %edx,0xc20
return (void*)(p + 1);
845: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
848: 8d 65 f4 lea -0xc(%ebp),%esp
84b: 5b pop %ebx
84c: 5e pop %esi
84d: 5f pop %edi
84e: 5d pop %ebp
84f: c3 ret
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
prevp->s.ptr = p->s.ptr;
850: 8b 08 mov (%eax),%ecx
852: 89 0a mov %ecx,(%edx)
854: eb e9 jmp 83f <malloc+0x9f>
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
856: c7 05 20 0c 00 00 24 movl $0xc24,0xc20
85d: 0c 00 00
860: c7 05 24 0c 00 00 24 movl $0xc24,0xc24
867: 0c 00 00
base.s.size = 0;
86a: b8 24 0c 00 00 mov $0xc24,%eax
86f: c7 05 28 0c 00 00 00 movl $0x0,0xc28
876: 00 00 00
879: e9 4e ff ff ff jmp 7cc <malloc+0x2c>
|
programs/oeis/219/A219029.asm | jmorken/loda | 1 | 13977 | <filename>programs/oeis/219/A219029.asm
; A219029: n - 1 - phi(phi(n)).
; -1,0,1,2,2,4,4,5,6,7,6,9,8,11,10,11,8,15,12,15,16,17,12,19,16,21,20,23,16,25,22,23,24,25,26,31,24,31,30,31,24,37,30,35,36,35,24,39,36,41,34,43,28,47,38,47,44,45,30,51,44,53,50,47,48,57,46,51,48,61,46,63,48,61,58,63,60,69,54,63,62,65,42,75,52,73,62,71,48,81,66,71,76,71,70,79,64,85,82,83,60,85,70,87,88,81,54,95,72,93,86,95,64,101,74,91,92,89,86,103,80,105,90,107,84,113,90,95,104,113,82,115,96,113,110,103,72,117,94,123,96,117,110,127,96,121,122,123,76,133,110,127,120,137,122,139,108,133,110,127,120,143,108,131,132,125,84,151,120,137,134,147,88,149,142,143,120,137,90,163,132,157,150,143,136,169,122,143,152,165,118,159,128,161,162,171,112,181,138,167,160,161,154,171,140,173,166,175,160,193,162,163,164,161,166,191,168,181,170,187,156,197,150,191,192,177,114,203,156,189,198,183,120,209,146,179,188,205,142,207,176,201,188,211,196,213,174,215,168,209
mov $1,$0
sub $1,1
mov $4,$0
lpb $0
add $0,$4
mov $4,$0
div $4,2
cal $4,10554 ; a(n) = phi(phi(n)), where phi is the Euler totient function.
add $1,$4
sub $0,$1
sub $0,1
mov $3,$0
mov $0,$2
mov $1,$3
lpe
|
MASM_Practice/51_ASCII_Uncompressed_Decimal_Operation.asm | TuringGu/RELearning | 0 | 6151 | <gh_stars>0
.586
.MODEL flat,stdcall
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
include msvcrt.inc
includelib user32.lib
includelib kernel32.lib
includelib msvcrt.lib
.data
val01 byte '8'
val02 byte '9'
.code
main PROC
;AAA
mov ah,0
mov al,'8' ;al = 00111000
add al,'2' ;al = 00111000 + 00110010 = 01101010 = 6A
aaa ;ax = 0100h = 00000001 00000000
or ax,3030h ;transfer to ascii ax = 3130h = 00110001 00110000
;AAS
mov ah,0
mov al,val01
sub al,val02
aas
pushf ;store cf
or al,30h
popf
;AAM
xor eax,eax
xor ebx,ebx
mov bl,5
mov al,6
mul bl
aam ;ax=0300h=00000011 00000000
;AAD
xor eax,eax
mov ax,0307h ;ax = 00000011 00000111
aad ;al = 25h = 00100101
mov bl,5
div bl ;ax = 00000010 00000111
;Exit
push 0
call ExitProcess
add esp,4
main ENDP
END main
;ASCII + - * / adjust
;AAA AAS AAM AAD
;BCD: Binary Code Decimal
;decimal ASCII Compress BCD Uncompress BCD
;0 00110000 0000 00000000
;1 00110001 0001 00000001
;2 00110010 0010 00000010
;3 00110101 0101 00000101
;......
;5 00111001 1001 00001001
;6 00111010 1010 00001010 |
kernel.asm | brian19991119/changbri_project4_frq | 0 | 104294 | <gh_stars>0
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 a0 2e 10 80 mov $0x80102ea0,%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 a0 6f 10 80 push $0x80106fa0
80100051: 68 c0 b5 10 80 push $0x8010b5c0
80100056: e8 45 42 00 00 call 801042a0 <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 a7 6f 10 80 push $0x80106fa7
80100097: 50 push %eax
80100098: e8 d3 40 00 00 call 80104170 <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 f7 42 00 00 call 801043e0 <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 39 43 00 00 call 801044a0 <release>
acquiresleep(&b->lock);
80100167: 8d 43 0c lea 0xc(%ebx),%eax
8010016a: 89 04 24 mov %eax,(%esp)
8010016d: e8 3e 40 00 00 call 801041b0 <acquiresleep>
80100172: 83 c4 10 add $0x10,%esp
struct buf *b;
b = bget(dev, blockno);
if((b->flags & B_VALID) == 0) {
80100175: f6 03 02 testb $0x2,(%ebx)
80100178: 75 0c jne 80100186 <bread+0xb6>
iderw(b);
8010017a: 83 ec 0c sub $0xc,%esp
8010017d: 53 push %ebx
8010017e: e8 9d 1f 00 00 call 80102120 <iderw>
80100183: 83 c4 10 add $0x10,%esp
}
return b;
}
80100186: 8d 65 f4 lea -0xc(%ebp),%esp
80100189: 89 d8 mov %ebx,%eax
8010018b: 5b pop %ebx
8010018c: 5e pop %esi
8010018d: 5f pop %edi
8010018e: 5d pop %ebp
8010018f: c3 ret
panic("bget: no buffers");
80100190: 83 ec 0c sub $0xc,%esp
80100193: 68 ae 6f 10 80 push $0x80106fae
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 9d 40 00 00 call 80104250 <holdingsleep>
801001b3: 83 c4 10 add $0x10,%esp
801001b6: 85 c0 test %eax,%eax
801001b8: 74 0f je 801001c9 <bwrite+0x29>
panic("bwrite");
b->flags |= B_DIRTY;
801001ba: 83 0b 04 orl $0x4,(%ebx)
iderw(b);
801001bd: 89 5d 08 mov %ebx,0x8(%ebp)
}
801001c0: 8b 5d fc mov -0x4(%ebp),%ebx
801001c3: c9 leave
iderw(b);
801001c4: e9 57 1f 00 00 jmp 80102120 <iderw>
panic("bwrite");
801001c9: 83 ec 0c sub $0xc,%esp
801001cc: 68 bf 6f 10 80 push $0x80106fbf
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 5c 40 00 00 call 80104250 <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 0c 40 00 00 call 80104210 <releasesleep>
acquire(&bcache.lock);
80100204: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp)
8010020b: e8 d0 41 00 00 call 801043e0 <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 3f 42 00 00 jmp 801044a0 <release>
panic("brelse");
80100261: 83 ec 0c sub $0xc,%esp
80100264: 68 c6 6f 10 80 push $0x80106fc6
80100269: e8 22 01 00 00 call 80100390 <panic>
8010026e: 66 90 xchg %ax,%ax
80100270 <consoleread>:
}
}
int
consoleread(struct inode *ip, char *dst, int n)
{
80100270: 55 push %ebp
80100271: 89 e5 mov %esp,%ebp
80100273: 57 push %edi
80100274: 56 push %esi
80100275: 53 push %ebx
80100276: 83 ec 28 sub $0x28,%esp
80100279: 8b 7d 08 mov 0x8(%ebp),%edi
8010027c: 8b 75 0c mov 0xc(%ebp),%esi
uint target;
int c;
iunlock(ip);
8010027f: 57 push %edi
80100280: e8 db 14 00 00 call 80101760 <iunlock>
target = n;
acquire(&cons.lock);
80100285: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
8010028c: e8 4f 41 00 00 call 801043e0 <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 56 3b 00 00 call 80103e20 <sleep>
while(input.r == input.w){
801002ca: 8b 15 a0 ff 10 80 mov 0x8010ffa0,%edx
801002d0: 83 c4 10 add $0x10,%esp
801002d3: 3b 15 a4 ff 10 80 cmp 0x8010ffa4,%edx
801002d9: 75 35 jne 80100310 <consoleread+0xa0>
if(myproc()->killed){
801002db: e8 00 35 00 00 call 801037e0 <myproc>
801002e0: 8b 40 24 mov 0x24(%eax),%eax
801002e3: 85 c0 test %eax,%eax
801002e5: 74 d1 je 801002b8 <consoleread+0x48>
release(&cons.lock);
801002e7: 83 ec 0c sub $0xc,%esp
801002ea: 68 20 a5 10 80 push $0x8010a520
801002ef: e8 ac 41 00 00 call 801044a0 <release>
ilock(ip);
801002f4: 89 3c 24 mov %edi,(%esp)
801002f7: e8 84 13 00 00 call 80101680 <ilock>
return -1;
801002fc: 83 c4 10 add $0x10,%esp
}
release(&cons.lock);
ilock(ip);
return target - n;
}
801002ff: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
80100302: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100307: 5b pop %ebx
80100308: 5e pop %esi
80100309: 5f pop %edi
8010030a: 5d pop %ebp
8010030b: c3 ret
8010030c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = input.buf[input.r++ % INPUT_BUF];
80100310: 8d 42 01 lea 0x1(%edx),%eax
80100313: a3 a0 ff 10 80 mov %eax,0x8010ffa0
80100318: 89 d0 mov %edx,%eax
8010031a: 83 e0 7f and $0x7f,%eax
8010031d: 0f be 80 20 ff 10 80 movsbl -0x7fef00e0(%eax),%eax
if(c == C('D')){ // EOF
80100324: 83 f8 04 cmp $0x4,%eax
80100327: 74 3f je 80100368 <consoleread+0xf8>
*dst++ = c;
80100329: 83 c6 01 add $0x1,%esi
--n;
8010032c: 83 eb 01 sub $0x1,%ebx
if(c == '\n')
8010032f: 83 f8 0a cmp $0xa,%eax
*dst++ = c;
80100332: 88 46 ff mov %al,-0x1(%esi)
if(c == '\n')
80100335: 74 43 je 8010037a <consoleread+0x10a>
while(n > 0){
80100337: 85 db test %ebx,%ebx
80100339: 0f 85 62 ff ff ff jne 801002a1 <consoleread+0x31>
8010033f: 8b 45 10 mov 0x10(%ebp),%eax
release(&cons.lock);
80100342: 83 ec 0c sub $0xc,%esp
80100345: 89 45 e4 mov %eax,-0x1c(%ebp)
80100348: 68 20 a5 10 80 push $0x8010a520
8010034d: e8 4e 41 00 00 call 801044a0 <release>
ilock(ip);
80100352: 89 3c 24 mov %edi,(%esp)
80100355: e8 26 13 00 00 call 80101680 <ilock>
return target - n;
8010035a: 8b 45 e4 mov -0x1c(%ebp),%eax
8010035d: 83 c4 10 add $0x10,%esp
}
80100360: 8d 65 f4 lea -0xc(%ebp),%esp
80100363: 5b pop %ebx
80100364: 5e pop %esi
80100365: 5f pop %edi
80100366: 5d pop %ebp
80100367: c3 ret
80100368: 8b 45 10 mov 0x10(%ebp),%eax
8010036b: 29 d8 sub %ebx,%eax
if(n < target){
8010036d: 3b 5d 10 cmp 0x10(%ebp),%ebx
80100370: 73 d0 jae 80100342 <consoleread+0xd2>
input.r--;
80100372: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0
80100378: eb c8 jmp 80100342 <consoleread+0xd2>
8010037a: 8b 45 10 mov 0x10(%ebp),%eax
8010037d: 29 d8 sub %ebx,%eax
8010037f: eb c1 jmp 80100342 <consoleread+0xd2>
80100381: eb 0d jmp 80100390 <panic>
80100383: 90 nop
80100384: 90 nop
80100385: 90 nop
80100386: 90 nop
80100387: 90 nop
80100388: 90 nop
80100389: 90 nop
8010038a: 90 nop
8010038b: 90 nop
8010038c: 90 nop
8010038d: 90 nop
8010038e: 90 nop
8010038f: 90 nop
80100390 <panic>:
{
80100390: 55 push %ebp
80100391: 89 e5 mov %esp,%ebp
80100393: 56 push %esi
80100394: 53 push %ebx
80100395: 83 ec 30 sub $0x30,%esp
}
static inline void
cli(void)
{
asm volatile("cli");
80100398: fa cli
cons.locking = 0;
80100399: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554
801003a0: 00 00 00
getcallerpcs(&s, pcs);
801003a3: 8d 5d d0 lea -0x30(%ebp),%ebx
801003a6: 8d 75 f8 lea -0x8(%ebp),%esi
cprintf("lapicid %d: panic: ", lapicid());
801003a9: e8 82 23 00 00 call 80102730 <lapicid>
801003ae: 83 ec 08 sub $0x8,%esp
801003b1: 50 push %eax
801003b2: 68 cd 6f 10 80 push $0x80106fcd
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 db 78 10 80 movl $0x801078db,(%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 e3 3e 00 00 call 801042c0 <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 e1 6f 10 80 push $0x80106fe1
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 61 57 00 00 call 80105ba0 <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 af 56 00 00 call 80105ba0 <uartputc>
801004f1: c7 04 24 20 00 00 00 movl $0x20,(%esp)
801004f8: e8 a3 56 00 00 call 80105ba0 <uartputc>
801004fd: c7 04 24 08 00 00 00 movl $0x8,(%esp)
80100504: e8 97 56 00 00 call 80105ba0 <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 77 40 00 00 call 801045a0 <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 aa 3f 00 00 call 801044f0 <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 e5 6f 10 80 push $0x80106fe5
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 10 70 10 80 movzbl -0x7fef8ff0(%edx),%edx
}while((x /= base) != 0);
801005b8: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
801005ba: 88 14 3e mov %dl,(%esi,%edi,1)
}while((x /= base) != 0);
801005bd: 75 e9 jne 801005a8 <printint+0x28>
if(sign)
801005bf: 8b 45 d4 mov -0x2c(%ebp),%eax
801005c2: 85 c0 test %eax,%eax
801005c4: 74 08 je 801005ce <printint+0x4e>
buf[i++] = '-';
801005c6: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
801005cb: 8d 79 02 lea 0x2(%ecx),%edi
801005ce: 8d 5c 3d d7 lea -0x29(%ebp,%edi,1),%ebx
801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
consputc(buf[i]);
801005d8: 0f be 03 movsbl (%ebx),%eax
801005db: 83 eb 01 sub $0x1,%ebx
801005de: e8 2d fe ff ff call 80100410 <consputc>
while(--i >= 0)
801005e3: 39 f3 cmp %esi,%ebx
801005e5: 75 f1 jne 801005d8 <printint+0x58>
}
801005e7: 83 c4 2c add $0x2c,%esp
801005ea: 5b pop %ebx
801005eb: 5e pop %esi
801005ec: 5f pop %edi
801005ed: 5d pop %ebp
801005ee: c3 ret
801005ef: 90 nop
x = -xx;
801005f0: f7 d8 neg %eax
801005f2: eb a9 jmp 8010059d <printint+0x1d>
801005f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801005fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80100600 <consolewrite>:
int
consolewrite(struct inode *ip, char *buf, int n)
{
80100600: 55 push %ebp
80100601: 89 e5 mov %esp,%ebp
80100603: 57 push %edi
80100604: 56 push %esi
80100605: 53 push %ebx
80100606: 83 ec 18 sub $0x18,%esp
80100609: 8b 75 10 mov 0x10(%ebp),%esi
int i;
iunlock(ip);
8010060c: ff 75 08 pushl 0x8(%ebp)
8010060f: e8 4c 11 00 00 call 80101760 <iunlock>
acquire(&cons.lock);
80100614: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp)
8010061b: e8 c0 3d 00 00 call 801043e0 <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 54 3e 00 00 call 801044a0 <release>
ilock(ip);
8010064c: 58 pop %eax
8010064d: ff 75 08 pushl 0x8(%ebp)
80100650: e8 2b 10 00 00 call 80101680 <ilock>
return n;
}
80100655: 8d 65 f4 lea -0xc(%ebp),%esp
80100658: 89 f0 mov %esi,%eax
8010065a: 5b pop %ebx
8010065b: 5e pop %esi
8010065c: 5f pop %edi
8010065d: 5d pop %ebp
8010065e: c3 ret
8010065f: 90 nop
80100660 <cprintf>:
{
80100660: 55 push %ebp
80100661: 89 e5 mov %esp,%ebp
80100663: 57 push %edi
80100664: 56 push %esi
80100665: 53 push %ebx
80100666: 83 ec 1c sub $0x1c,%esp
locking = cons.locking;
80100669: a1 54 a5 10 80 mov 0x8010a554,%eax
if(locking)
8010066e: 85 c0 test %eax,%eax
locking = cons.locking;
80100670: 89 45 dc mov %eax,-0x24(%ebp)
if(locking)
80100673: 0f 85 6f 01 00 00 jne 801007e8 <cprintf+0x188>
if (fmt == 0)
80100679: 8b 45 08 mov 0x8(%ebp),%eax
8010067c: 85 c0 test %eax,%eax
8010067e: 89 c7 mov %eax,%edi
80100680: 0f 84 77 01 00 00 je 801007fd <cprintf+0x19d>
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100686: 0f b6 00 movzbl (%eax),%eax
argp = (uint*)(void*)(&fmt + 1);
80100689: 8d 4d 0c lea 0xc(%ebp),%ecx
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
8010068c: 31 db xor %ebx,%ebx
argp = (uint*)(void*)(&fmt + 1);
8010068e: 89 4d e4 mov %ecx,-0x1c(%ebp)
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100691: 85 c0 test %eax,%eax
80100693: 75 56 jne 801006eb <cprintf+0x8b>
80100695: eb 79 jmp 80100710 <cprintf+0xb0>
80100697: 89 f6 mov %esi,%esi
80100699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[++i] & 0xff;
801006a0: 0f b6 16 movzbl (%esi),%edx
if(c == 0)
801006a3: 85 d2 test %edx,%edx
801006a5: 74 69 je 80100710 <cprintf+0xb0>
801006a7: 83 c3 02 add $0x2,%ebx
switch(c){
801006aa: 83 fa 70 cmp $0x70,%edx
801006ad: 8d 34 1f lea (%edi,%ebx,1),%esi
801006b0: 0f 84 84 00 00 00 je 8010073a <cprintf+0xda>
801006b6: 7f 78 jg 80100730 <cprintf+0xd0>
801006b8: 83 fa 25 cmp $0x25,%edx
801006bb: 0f 84 ff 00 00 00 je 801007c0 <cprintf+0x160>
801006c1: 83 fa 64 cmp $0x64,%edx
801006c4: 0f 85 8e 00 00 00 jne 80100758 <cprintf+0xf8>
printint(*argp++, 10, 1);
801006ca: 8b 45 e4 mov -0x1c(%ebp),%eax
801006cd: ba 0a 00 00 00 mov $0xa,%edx
801006d2: 8d 48 04 lea 0x4(%eax),%ecx
801006d5: 8b 00 mov (%eax),%eax
801006d7: 89 4d e4 mov %ecx,-0x1c(%ebp)
801006da: b9 01 00 00 00 mov $0x1,%ecx
801006df: e8 9c fe ff ff call 80100580 <printint>
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006e4: 0f b6 06 movzbl (%esi),%eax
801006e7: 85 c0 test %eax,%eax
801006e9: 74 25 je 80100710 <cprintf+0xb0>
801006eb: 8d 53 01 lea 0x1(%ebx),%edx
if(c != '%'){
801006ee: 83 f8 25 cmp $0x25,%eax
801006f1: 8d 34 17 lea (%edi,%edx,1),%esi
801006f4: 74 aa je 801006a0 <cprintf+0x40>
801006f6: 89 55 e0 mov %edx,-0x20(%ebp)
consputc(c);
801006f9: e8 12 fd ff ff call 80100410 <consputc>
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006fe: 0f b6 06 movzbl (%esi),%eax
continue;
80100701: 8b 55 e0 mov -0x20(%ebp),%edx
80100704: 89 d3 mov %edx,%ebx
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100706: 85 c0 test %eax,%eax
80100708: 75 e1 jne 801006eb <cprintf+0x8b>
8010070a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(locking)
80100710: 8b 45 dc mov -0x24(%ebp),%eax
80100713: 85 c0 test %eax,%eax
80100715: 74 10 je 80100727 <cprintf+0xc7>
release(&cons.lock);
80100717: 83 ec 0c sub $0xc,%esp
8010071a: 68 20 a5 10 80 push $0x8010a520
8010071f: e8 7c 3d 00 00 call 801044a0 <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 f8 6f 10 80 mov $0x80106ff8,%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 eb 3b 00 00 call 801043e0 <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 ff 6f 10 80 push $0x80106fff
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 b8 3b 00 00 call 801043e0 <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 13 3c 00 00 call 801044a0 <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 b5 36 00 00 call 80103fd0 <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 14 37 00 00 jmp 801040b0 <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 08 70 10 80 push $0x80107008
801009cb: 68 20 a5 10 80 push $0x8010a520
801009d0: e8 cb 38 00 00 call 801042a0 <initlock>
devsw[CONSOLE].write = consolewrite;
devsw[CONSOLE].read = consoleread;
cons.locking = 1;
ioapicenable(IRQ_KBD, 0);
801009d5: 58 pop %eax
801009d6: 5a pop %edx
801009d7: 6a 00 push $0x0
801009d9: 6a 01 push $0x1
devsw[CONSOLE].write = consolewrite;
801009db: c7 05 6c 09 11 80 00 movl $0x80100600,0x8011096c
801009e2: 06 10 80
devsw[CONSOLE].read = consoleread;
801009e5: c7 05 68 09 11 80 70 movl $0x80100270,0x80110968
801009ec: 02 10 80
cons.locking = 1;
801009ef: c7 05 54 a5 10 80 01 movl $0x1,0x8010a554
801009f6: 00 00 00
ioapicenable(IRQ_KBD, 0);
801009f9: e8 d2 18 00 00 call 801022d0 <ioapicenable>
}
801009fe: 83 c4 10 add $0x10,%esp
80100a01: c9 leave
80100a02: c3 ret
80100a03: 66 90 xchg %ax,%ax
80100a05: 66 90 xchg %ax,%ax
80100a07: 66 90 xchg %ax,%ax
80100a09: 66 90 xchg %ax,%ax
80100a0b: 66 90 xchg %ax,%ax
80100a0d: 66 90 xchg %ax,%ax
80100a0f: 90 nop
80100a10 <exec>:
#include "x86.h"
#include "elf.h"
int
exec(char *path, char **argv)
{
80100a10: 55 push %ebp
80100a11: 89 e5 mov %esp,%ebp
80100a13: 57 push %edi
80100a14: 56 push %esi
80100a15: 53 push %ebx
80100a16: 81 ec 0c 01 00 00 sub $0x10c,%esp
uint argc, sz, sp, ustack[3+MAXARG+1];
struct elfhdr elf;
struct inode *ip;
struct proghdr ph;
pde_t *pgdir, *oldpgdir;
struct proc *curproc = myproc();
80100a1c: e8 bf 2d 00 00 call 801037e0 <myproc>
80100a21: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp)
begin_op();
80100a27: e8 74 21 00 00 call 80102ba0 <begin_op>
if((ip = namei(path)) == 0){
80100a2c: 83 ec 0c sub $0xc,%esp
80100a2f: ff 75 08 pushl 0x8(%ebp)
80100a32: e8 a9 14 00 00 call 80101ee0 <namei>
80100a37: 83 c4 10 add $0x10,%esp
80100a3a: 85 c0 test %eax,%eax
80100a3c: 0f 84 91 01 00 00 je 80100bd3 <exec+0x1c3>
end_op();
cprintf("exec: fail\n");
return -1;
}
ilock(ip);
80100a42: 83 ec 0c sub $0xc,%esp
80100a45: 89 c3 mov %eax,%ebx
80100a47: 50 push %eax
80100a48: e8 33 0c 00 00 call 80101680 <ilock>
pgdir = 0;
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf))
80100a4d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax
80100a53: 6a 34 push $0x34
80100a55: 6a 00 push $0x0
80100a57: 50 push %eax
80100a58: 53 push %ebx
80100a59: e8 02 0f 00 00 call 80101960 <readi>
80100a5e: 83 c4 20 add $0x20,%esp
80100a61: 83 f8 34 cmp $0x34,%eax
80100a64: 74 22 je 80100a88 <exec+0x78>
bad:
if(pgdir)
freevm(pgdir);
if(ip){
iunlockput(ip);
80100a66: 83 ec 0c sub $0xc,%esp
80100a69: 53 push %ebx
80100a6a: e8 a1 0e 00 00 call 80101910 <iunlockput>
end_op();
80100a6f: e8 9c 21 00 00 call 80102c10 <end_op>
80100a74: 83 c4 10 add $0x10,%esp
}
return -1;
80100a77: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100a7c: 8d 65 f4 lea -0xc(%ebp),%esp
80100a7f: 5b pop %ebx
80100a80: 5e pop %esi
80100a81: 5f pop %edi
80100a82: 5d pop %ebp
80100a83: c3 ret
80100a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(elf.magic != ELF_MAGIC)
80100a88: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp)
80100a8f: 45 4c 46
80100a92: 75 d2 jne 80100a66 <exec+0x56>
if((pgdir = setupkvm()) == 0)
80100a94: e8 47 62 00 00 call 80106ce0 <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 15 60 00 00 call 80106b10 <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 23 5f 00 00 call 80106a50 <loaduvm>
80100b2d: 83 c4 20 add $0x20,%esp
80100b30: 85 c0 test %eax,%eax
80100b32: 78 35 js 80100b69 <exec+0x159>
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100b34: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax
80100b3b: 83 c6 01 add $0x1,%esi
80100b3e: 39 f0 cmp %esi,%eax
80100b40: 7e 3d jle 80100b7f <exec+0x16f>
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
80100b42: 89 f0 mov %esi,%eax
80100b44: 6a 20 push $0x20
80100b46: c1 e0 05 shl $0x5,%eax
80100b49: 03 85 ec fe ff ff add -0x114(%ebp),%eax
80100b4f: 50 push %eax
80100b50: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax
80100b56: 50 push %eax
80100b57: 53 push %ebx
80100b58: e8 03 0e 00 00 call 80101960 <readi>
80100b5d: 83 c4 10 add $0x10,%esp
80100b60: 83 f8 20 cmp $0x20,%eax
80100b63: 0f 84 5f ff ff ff je 80100ac8 <exec+0xb8>
freevm(pgdir);
80100b69: 83 ec 0c sub $0xc,%esp
80100b6c: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100b72: e8 e9 60 00 00 call 80106c60 <freevm>
80100b77: 83 c4 10 add $0x10,%esp
80100b7a: e9 e7 fe ff ff jmp 80100a66 <exec+0x56>
80100b7f: 81 c7 ff 0f 00 00 add $0xfff,%edi
80100b85: 81 e7 00 f0 ff ff and $0xfffff000,%edi
80100b8b: 8d b7 00 20 00 00 lea 0x2000(%edi),%esi
iunlockput(ip);
80100b91: 83 ec 0c sub $0xc,%esp
80100b94: 53 push %ebx
80100b95: e8 76 0d 00 00 call 80101910 <iunlockput>
end_op();
80100b9a: e8 71 20 00 00 call 80102c10 <end_op>
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
80100b9f: 83 c4 0c add $0xc,%esp
80100ba2: 56 push %esi
80100ba3: 57 push %edi
80100ba4: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100baa: e8 61 5f 00 00 call 80106b10 <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 9a 60 00 00 call 80106c60 <freevm>
80100bc6: 83 c4 10 add $0x10,%esp
return -1;
80100bc9: b8 ff ff ff ff mov $0xffffffff,%eax
80100bce: e9 a9 fe ff ff jmp 80100a7c <exec+0x6c>
end_op();
80100bd3: e8 38 20 00 00 call 80102c10 <end_op>
cprintf("exec: fail\n");
80100bd8: 83 ec 0c sub $0xc,%esp
80100bdb: 68 21 70 10 80 push $0x80107021
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 75 61 00 00 call 80106d80 <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 d2 3a 00 00 call 80104710 <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 bf 3a 00 00 call 80104710 <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 8e 62 00 00 call 80106ef0 <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 24 62 00 00 call 80106ef0 <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 c1 39 00 00 call 801046d0 <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 87 5b 00 00 call 801068c0 <switchuvm>
freevm(oldpgdir);
80100d39: 89 3c 24 mov %edi,(%esp)
80100d3c: e8 1f 5f 00 00 call 80106c60 <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 2d 70 10 80 push $0x8010702d
80100d6b: 68 c0 ff 10 80 push $0x8010ffc0
80100d70: e8 2b 35 00 00 call 801042a0 <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 4a 36 00 00 call 801043e0 <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 da 36 00 00 call 801044a0 <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 c1 36 00 00 call 801044a0 <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 dc 35 00 00 call 801043e0 <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 7f 36 00 00 call 801044a0 <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 34 70 10 80 push $0x80107034
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 8a 35 00 00 call 801043e0 <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 1f 36 00 00 jmp 801044a0 <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 f3 35 00 00 call 801044a0 <release>
if(ff.type == FD_PIPE)
80100ead: 83 c4 10 add $0x10,%esp
80100eb0: 83 ff 01 cmp $0x1,%edi
80100eb3: 74 13 je 80100ec8 <fileclose+0x88>
else if(ff.type == FD_INODE){
80100eb5: 83 ff 02 cmp $0x2,%edi
80100eb8: 74 26 je 80100ee0 <fileclose+0xa0>
}
80100eba: 8d 65 f4 lea -0xc(%ebp),%esp
80100ebd: 5b pop %ebx
80100ebe: 5e pop %esi
80100ebf: 5f pop %edi
80100ec0: 5d pop %ebp
80100ec1: c3 ret
80100ec2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
pipeclose(ff.pipe, ff.writable);
80100ec8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx
80100ecc: 83 ec 08 sub $0x8,%esp
80100ecf: 53 push %ebx
80100ed0: 56 push %esi
80100ed1: e8 7a 24 00 00 call 80103350 <pipeclose>
80100ed6: 83 c4 10 add $0x10,%esp
80100ed9: eb df jmp 80100eba <fileclose+0x7a>
80100edb: 90 nop
80100edc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
begin_op();
80100ee0: e8 bb 1c 00 00 call 80102ba0 <begin_op>
iput(ff.ip);
80100ee5: 83 ec 0c sub $0xc,%esp
80100ee8: ff 75 e0 pushl -0x20(%ebp)
80100eeb: e8 c0 08 00 00 call 801017b0 <iput>
end_op();
80100ef0: 83 c4 10 add $0x10,%esp
}
80100ef3: 8d 65 f4 lea -0xc(%ebp),%esp
80100ef6: 5b pop %ebx
80100ef7: 5e pop %esi
80100ef8: 5f pop %edi
80100ef9: 5d pop %ebp
end_op();
80100efa: e9 11 1d 00 00 jmp 80102c10 <end_op>
panic("fileclose");
80100eff: 83 ec 0c sub $0xc,%esp
80100f02: 68 3c 70 10 80 push $0x8010703c
80100f07: e8 84 f4 ff ff call 80100390 <panic>
80100f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100f10 <filestat>:
// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
80100f10: 55 push %ebp
80100f11: 89 e5 mov %esp,%ebp
80100f13: 53 push %ebx
80100f14: 83 ec 04 sub $0x4,%esp
80100f17: 8b 5d 08 mov 0x8(%ebp),%ebx
if(f->type == FD_INODE){
80100f1a: 83 3b 02 cmpl $0x2,(%ebx)
80100f1d: 75 31 jne 80100f50 <filestat+0x40>
ilock(f->ip);
80100f1f: 83 ec 0c sub $0xc,%esp
80100f22: ff 73 10 pushl 0x10(%ebx)
80100f25: e8 56 07 00 00 call 80101680 <ilock>
stati(f->ip, st);
80100f2a: 58 pop %eax
80100f2b: 5a pop %edx
80100f2c: ff 75 0c pushl 0xc(%ebp)
80100f2f: ff 73 10 pushl 0x10(%ebx)
80100f32: e8 f9 09 00 00 call 80101930 <stati>
iunlock(f->ip);
80100f37: 59 pop %ecx
80100f38: ff 73 10 pushl 0x10(%ebx)
80100f3b: e8 20 08 00 00 call 80101760 <iunlock>
return 0;
80100f40: 83 c4 10 add $0x10,%esp
80100f43: 31 c0 xor %eax,%eax
}
return -1;
}
80100f45: 8b 5d fc mov -0x4(%ebp),%ebx
80100f48: c9 leave
80100f49: c3 ret
80100f4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
80100f50: b8 ff ff ff ff mov $0xffffffff,%eax
80100f55: eb ee jmp 80100f45 <filestat+0x35>
80100f57: 89 f6 mov %esi,%esi
80100f59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100f60 <fileread>:
// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
80100f60: 55 push %ebp
80100f61: 89 e5 mov %esp,%ebp
80100f63: 57 push %edi
80100f64: 56 push %esi
80100f65: 53 push %ebx
80100f66: 83 ec 0c sub $0xc,%esp
80100f69: 8b 5d 08 mov 0x8(%ebp),%ebx
80100f6c: 8b 75 0c mov 0xc(%ebp),%esi
80100f6f: 8b 7d 10 mov 0x10(%ebp),%edi
int r;
if(f->readable == 0)
80100f72: 80 7b 08 00 cmpb $0x0,0x8(%ebx)
80100f76: 74 60 je 80100fd8 <fileread+0x78>
return -1;
if(f->type == FD_PIPE)
80100f78: 8b 03 mov (%ebx),%eax
80100f7a: 83 f8 01 cmp $0x1,%eax
80100f7d: 74 41 je 80100fc0 <fileread+0x60>
return piperead(f->pipe, addr, n);
if(f->type == FD_INODE){
80100f7f: 83 f8 02 cmp $0x2,%eax
80100f82: 75 5b jne 80100fdf <fileread+0x7f>
ilock(f->ip);
80100f84: 83 ec 0c sub $0xc,%esp
80100f87: ff 73 10 pushl 0x10(%ebx)
80100f8a: e8 f1 06 00 00 call 80101680 <ilock>
if((r = readi(f->ip, addr, f->off, n)) > 0)
80100f8f: 57 push %edi
80100f90: ff 73 14 pushl 0x14(%ebx)
80100f93: 56 push %esi
80100f94: ff 73 10 pushl 0x10(%ebx)
80100f97: e8 c4 09 00 00 call 80101960 <readi>
80100f9c: 83 c4 20 add $0x20,%esp
80100f9f: 85 c0 test %eax,%eax
80100fa1: 89 c6 mov %eax,%esi
80100fa3: 7e 03 jle 80100fa8 <fileread+0x48>
f->off += r;
80100fa5: 01 43 14 add %eax,0x14(%ebx)
iunlock(f->ip);
80100fa8: 83 ec 0c sub $0xc,%esp
80100fab: ff 73 10 pushl 0x10(%ebx)
80100fae: e8 ad 07 00 00 call 80101760 <iunlock>
return r;
80100fb3: 83 c4 10 add $0x10,%esp
}
panic("fileread");
}
80100fb6: 8d 65 f4 lea -0xc(%ebp),%esp
80100fb9: 89 f0 mov %esi,%eax
80100fbb: 5b pop %ebx
80100fbc: 5e pop %esi
80100fbd: 5f pop %edi
80100fbe: 5d pop %ebp
80100fbf: c3 ret
return piperead(f->pipe, addr, n);
80100fc0: 8b 43 0c mov 0xc(%ebx),%eax
80100fc3: 89 45 08 mov %eax,0x8(%ebp)
}
80100fc6: 8d 65 f4 lea -0xc(%ebp),%esp
80100fc9: 5b pop %ebx
80100fca: 5e pop %esi
80100fcb: 5f pop %edi
80100fcc: 5d pop %ebp
return piperead(f->pipe, addr, n);
80100fcd: e9 2e 25 00 00 jmp 80103500 <piperead>
80100fd2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
80100fd8: be ff ff ff ff mov $0xffffffff,%esi
80100fdd: eb d7 jmp 80100fb6 <fileread+0x56>
panic("fileread");
80100fdf: 83 ec 0c sub $0xc,%esp
80100fe2: 68 46 70 10 80 push $0x80107046
80100fe7: e8 a4 f3 ff ff call 80100390 <panic>
80100fec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100ff0 <filewrite>:
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
80100ff0: 55 push %ebp
80100ff1: 89 e5 mov %esp,%ebp
80100ff3: 57 push %edi
80100ff4: 56 push %esi
80100ff5: 53 push %ebx
80100ff6: 83 ec 1c sub $0x1c,%esp
80100ff9: 8b 75 08 mov 0x8(%ebp),%esi
80100ffc: 8b 45 0c mov 0xc(%ebp),%eax
int r;
if(f->writable == 0)
80100fff: 80 7e 09 00 cmpb $0x0,0x9(%esi)
{
80101003: 89 45 dc mov %eax,-0x24(%ebp)
80101006: 8b 45 10 mov 0x10(%ebp),%eax
80101009: 89 45 e4 mov %eax,-0x1c(%ebp)
if(f->writable == 0)
8010100c: 0f 84 aa 00 00 00 je 801010bc <filewrite+0xcc>
return -1;
if(f->type == FD_PIPE)
80101012: 8b 06 mov (%esi),%eax
80101014: 83 f8 01 cmp $0x1,%eax
80101017: 0f 84 c3 00 00 00 je 801010e0 <filewrite+0xf0>
return pipewrite(f->pipe, addr, n);
if(f->type == FD_INODE){
8010101d: 83 f8 02 cmp $0x2,%eax
80101020: 0f 85 d9 00 00 00 jne 801010ff <filewrite+0x10f>
// and 2 blocks of slop for non-aligned writes.
// this really belongs lower down, since writei()
// might be writing a device like the console.
int max = ((MAXOPBLOCKS-1-1-2) / 2) * 512;
int i = 0;
while(i < n){
80101026: 8b 45 e4 mov -0x1c(%ebp),%eax
int i = 0;
80101029: 31 ff xor %edi,%edi
while(i < n){
8010102b: 85 c0 test %eax,%eax
8010102d: 7f 34 jg 80101063 <filewrite+0x73>
8010102f: e9 9c 00 00 00 jmp 801010d0 <filewrite+0xe0>
80101034: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
n1 = max;
begin_op();
ilock(f->ip);
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
f->off += r;
80101038: 01 46 14 add %eax,0x14(%esi)
iunlock(f->ip);
8010103b: 83 ec 0c sub $0xc,%esp
8010103e: ff 76 10 pushl 0x10(%esi)
f->off += r;
80101041: 89 45 e0 mov %eax,-0x20(%ebp)
iunlock(f->ip);
80101044: e8 17 07 00 00 call 80101760 <iunlock>
end_op();
80101049: e8 c2 1b 00 00 call 80102c10 <end_op>
8010104e: 8b 45 e0 mov -0x20(%ebp),%eax
80101051: 83 c4 10 add $0x10,%esp
if(r < 0)
break;
if(r != n1)
80101054: 39 c3 cmp %eax,%ebx
80101056: 0f 85 96 00 00 00 jne 801010f2 <filewrite+0x102>
panic("short filewrite");
i += r;
8010105c: 01 df add %ebx,%edi
while(i < n){
8010105e: 39 7d e4 cmp %edi,-0x1c(%ebp)
80101061: 7e 6d jle 801010d0 <filewrite+0xe0>
int n1 = n - i;
80101063: 8b 5d e4 mov -0x1c(%ebp),%ebx
80101066: b8 00 06 00 00 mov $0x600,%eax
8010106b: 29 fb sub %edi,%ebx
8010106d: 81 fb 00 06 00 00 cmp $0x600,%ebx
80101073: 0f 4f d8 cmovg %eax,%ebx
begin_op();
80101076: e8 25 1b 00 00 call 80102ba0 <begin_op>
ilock(f->ip);
8010107b: 83 ec 0c sub $0xc,%esp
8010107e: ff 76 10 pushl 0x10(%esi)
80101081: e8 fa 05 00 00 call 80101680 <ilock>
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
80101086: 8b 45 dc mov -0x24(%ebp),%eax
80101089: 53 push %ebx
8010108a: ff 76 14 pushl 0x14(%esi)
8010108d: 01 f8 add %edi,%eax
8010108f: 50 push %eax
80101090: ff 76 10 pushl 0x10(%esi)
80101093: e8 c8 09 00 00 call 80101a60 <writei>
80101098: 83 c4 20 add $0x20,%esp
8010109b: 85 c0 test %eax,%eax
8010109d: 7f 99 jg 80101038 <filewrite+0x48>
iunlock(f->ip);
8010109f: 83 ec 0c sub $0xc,%esp
801010a2: ff 76 10 pushl 0x10(%esi)
801010a5: 89 45 e0 mov %eax,-0x20(%ebp)
801010a8: e8 b3 06 00 00 call 80101760 <iunlock>
end_op();
801010ad: e8 5e 1b 00 00 call 80102c10 <end_op>
if(r < 0)
801010b2: 8b 45 e0 mov -0x20(%ebp),%eax
801010b5: 83 c4 10 add $0x10,%esp
801010b8: 85 c0 test %eax,%eax
801010ba: 74 98 je 80101054 <filewrite+0x64>
}
return i == n ? n : -1;
}
panic("filewrite");
}
801010bc: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
801010bf: bf ff ff ff ff mov $0xffffffff,%edi
}
801010c4: 89 f8 mov %edi,%eax
801010c6: 5b pop %ebx
801010c7: 5e pop %esi
801010c8: 5f pop %edi
801010c9: 5d pop %ebp
801010ca: c3 ret
801010cb: 90 nop
801010cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return i == n ? n : -1;
801010d0: 39 7d e4 cmp %edi,-0x1c(%ebp)
801010d3: 75 e7 jne 801010bc <filewrite+0xcc>
}
801010d5: 8d 65 f4 lea -0xc(%ebp),%esp
801010d8: 89 f8 mov %edi,%eax
801010da: 5b pop %ebx
801010db: 5e pop %esi
801010dc: 5f pop %edi
801010dd: 5d pop %ebp
801010de: c3 ret
801010df: 90 nop
return pipewrite(f->pipe, addr, n);
801010e0: 8b 46 0c mov 0xc(%esi),%eax
801010e3: 89 45 08 mov %eax,0x8(%ebp)
}
801010e6: 8d 65 f4 lea -0xc(%ebp),%esp
801010e9: 5b pop %ebx
801010ea: 5e pop %esi
801010eb: 5f pop %edi
801010ec: 5d pop %ebp
return pipewrite(f->pipe, addr, n);
801010ed: e9 fe 22 00 00 jmp 801033f0 <pipewrite>
panic("short filewrite");
801010f2: 83 ec 0c sub $0xc,%esp
801010f5: 68 4f 70 10 80 push $0x8010704f
801010fa: e8 91 f2 ff ff call 80100390 <panic>
panic("filewrite");
801010ff: 83 ec 0c sub $0xc,%esp
80101102: 68 55 70 10 80 push $0x80107055
80101107: e8 84 f2 ff ff call 80100390 <panic>
8010110c: 66 90 xchg %ax,%ax
8010110e: 66 90 xchg %ax,%ax
80101110 <bfree>:
}
// Free a disk block.
static void
bfree(int dev, uint b)
{
80101110: 55 push %ebp
80101111: 89 e5 mov %esp,%ebp
80101113: 56 push %esi
80101114: 53 push %ebx
80101115: 89 d3 mov %edx,%ebx
struct buf *bp;
int bi, m;
bp = bread(dev, BBLOCK(b, sb));
80101117: c1 ea 0c shr $0xc,%edx
8010111a: 03 15 d8 09 11 80 add 0x801109d8,%edx
80101120: 83 ec 08 sub $0x8,%esp
80101123: 52 push %edx
80101124: 50 push %eax
80101125: e8 a6 ef ff ff call 801000d0 <bread>
bi = b % BPB;
m = 1 << (bi % 8);
8010112a: 89 d9 mov %ebx,%ecx
if((bp->data[bi/8] & m) == 0)
8010112c: c1 fb 03 sar $0x3,%ebx
m = 1 << (bi % 8);
8010112f: ba 01 00 00 00 mov $0x1,%edx
80101134: 83 e1 07 and $0x7,%ecx
if((bp->data[bi/8] & m) == 0)
80101137: 81 e3 ff 01 00 00 and $0x1ff,%ebx
8010113d: 83 c4 10 add $0x10,%esp
m = 1 << (bi % 8);
80101140: d3 e2 shl %cl,%edx
if((bp->data[bi/8] & m) == 0)
80101142: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx
80101147: 85 d1 test %edx,%ecx
80101149: 74 25 je 80101170 <bfree+0x60>
panic("freeing free block");
bp->data[bi/8] &= ~m;
8010114b: f7 d2 not %edx
8010114d: 89 c6 mov %eax,%esi
log_write(bp);
8010114f: 83 ec 0c sub $0xc,%esp
bp->data[bi/8] &= ~m;
80101152: 21 ca and %ecx,%edx
80101154: 88 54 1e 5c mov %dl,0x5c(%esi,%ebx,1)
log_write(bp);
80101158: 56 push %esi
80101159: e8 12 1c 00 00 call 80102d70 <log_write>
brelse(bp);
8010115e: 89 34 24 mov %esi,(%esp)
80101161: e8 7a f0 ff ff call 801001e0 <brelse>
}
80101166: 83 c4 10 add $0x10,%esp
80101169: 8d 65 f8 lea -0x8(%ebp),%esp
8010116c: 5b pop %ebx
8010116d: 5e pop %esi
8010116e: 5d pop %ebp
8010116f: c3 ret
panic("freeing free block");
80101170: 83 ec 0c sub $0xc,%esp
80101173: 68 5f 70 10 80 push $0x8010705f
80101178: e8 13 f2 ff ff call 80100390 <panic>
8010117d: 8d 76 00 lea 0x0(%esi),%esi
80101180 <balloc>:
{
80101180: 55 push %ebp
80101181: 89 e5 mov %esp,%ebp
80101183: 57 push %edi
80101184: 56 push %esi
80101185: 53 push %ebx
80101186: 83 ec 1c sub $0x1c,%esp
for(b = 0; b < sb.size; b += BPB){
80101189: 8b 0d c0 09 11 80 mov 0x801109c0,%ecx
{
8010118f: 89 45 d8 mov %eax,-0x28(%ebp)
for(b = 0; b < sb.size; b += BPB){
80101192: 85 c9 test %ecx,%ecx
80101194: 0f 84 87 00 00 00 je 80101221 <balloc+0xa1>
8010119a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
bp = bread(dev, BBLOCK(b, sb));
801011a1: 8b 75 dc mov -0x24(%ebp),%esi
801011a4: 83 ec 08 sub $0x8,%esp
801011a7: 89 f0 mov %esi,%eax
801011a9: c1 f8 0c sar $0xc,%eax
801011ac: 03 05 d8 09 11 80 add 0x801109d8,%eax
801011b2: 50 push %eax
801011b3: ff 75 d8 pushl -0x28(%ebp)
801011b6: e8 15 ef ff ff call 801000d0 <bread>
801011bb: 89 45 e4 mov %eax,-0x1c(%ebp)
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
801011be: a1 c0 09 11 80 mov 0x801109c0,%eax
801011c3: 83 c4 10 add $0x10,%esp
801011c6: 89 45 e0 mov %eax,-0x20(%ebp)
801011c9: 31 c0 xor %eax,%eax
801011cb: eb 2f jmp 801011fc <balloc+0x7c>
801011cd: 8d 76 00 lea 0x0(%esi),%esi
m = 1 << (bi % 8);
801011d0: 89 c1 mov %eax,%ecx
if((bp->data[bi/8] & m) == 0){ // Is block free?
801011d2: 8b 55 e4 mov -0x1c(%ebp),%edx
m = 1 << (bi % 8);
801011d5: bb 01 00 00 00 mov $0x1,%ebx
801011da: 83 e1 07 and $0x7,%ecx
801011dd: d3 e3 shl %cl,%ebx
if((bp->data[bi/8] & m) == 0){ // Is block free?
801011df: 89 c1 mov %eax,%ecx
801011e1: c1 f9 03 sar $0x3,%ecx
801011e4: 0f b6 7c 0a 5c movzbl 0x5c(%edx,%ecx,1),%edi
801011e9: 85 df test %ebx,%edi
801011eb: 89 fa mov %edi,%edx
801011ed: 74 41 je 80101230 <balloc+0xb0>
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
801011ef: 83 c0 01 add $0x1,%eax
801011f2: 83 c6 01 add $0x1,%esi
801011f5: 3d 00 10 00 00 cmp $0x1000,%eax
801011fa: 74 05 je 80101201 <balloc+0x81>
801011fc: 39 75 e0 cmp %esi,-0x20(%ebp)
801011ff: 77 cf ja 801011d0 <balloc+0x50>
brelse(bp);
80101201: 83 ec 0c sub $0xc,%esp
80101204: ff 75 e4 pushl -0x1c(%ebp)
80101207: e8 d4 ef ff ff call 801001e0 <brelse>
for(b = 0; b < sb.size; b += BPB){
8010120c: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp)
80101213: 83 c4 10 add $0x10,%esp
80101216: 8b 45 dc mov -0x24(%ebp),%eax
80101219: 39 05 c0 09 11 80 cmp %eax,0x801109c0
8010121f: 77 80 ja 801011a1 <balloc+0x21>
panic("balloc: out of blocks");
80101221: 83 ec 0c sub $0xc,%esp
80101224: 68 72 70 10 80 push $0x80107072
80101229: e8 62 f1 ff ff call 80100390 <panic>
8010122e: 66 90 xchg %ax,%ax
bp->data[bi/8] |= m; // Mark block in use.
80101230: 8b 7d e4 mov -0x1c(%ebp),%edi
log_write(bp);
80101233: 83 ec 0c sub $0xc,%esp
bp->data[bi/8] |= m; // Mark block in use.
80101236: 09 da or %ebx,%edx
80101238: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1)
log_write(bp);
8010123c: 57 push %edi
8010123d: e8 2e 1b 00 00 call 80102d70 <log_write>
brelse(bp);
80101242: 89 3c 24 mov %edi,(%esp)
80101245: e8 96 ef ff ff call 801001e0 <brelse>
bp = bread(dev, bno);
8010124a: 58 pop %eax
8010124b: 5a pop %edx
8010124c: 56 push %esi
8010124d: ff 75 d8 pushl -0x28(%ebp)
80101250: e8 7b ee ff ff call 801000d0 <bread>
80101255: 89 c3 mov %eax,%ebx
memset(bp->data, 0, BSIZE);
80101257: 8d 40 5c lea 0x5c(%eax),%eax
8010125a: 83 c4 0c add $0xc,%esp
8010125d: 68 00 02 00 00 push $0x200
80101262: 6a 00 push $0x0
80101264: 50 push %eax
80101265: e8 86 32 00 00 call 801044f0 <memset>
log_write(bp);
8010126a: 89 1c 24 mov %ebx,(%esp)
8010126d: e8 fe 1a 00 00 call 80102d70 <log_write>
brelse(bp);
80101272: 89 1c 24 mov %ebx,(%esp)
80101275: e8 66 ef ff ff call 801001e0 <brelse>
}
8010127a: 8d 65 f4 lea -0xc(%ebp),%esp
8010127d: 89 f0 mov %esi,%eax
8010127f: 5b pop %ebx
80101280: 5e pop %esi
80101281: 5f pop %edi
80101282: 5d pop %ebp
80101283: c3 ret
80101284: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010128a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80101290 <iget>:
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
80101290: 55 push %ebp
80101291: 89 e5 mov %esp,%ebp
80101293: 57 push %edi
80101294: 56 push %esi
80101295: 53 push %ebx
80101296: 89 c7 mov %eax,%edi
struct inode *ip, *empty;
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
80101298: 31 f6 xor %esi,%esi
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010129a: bb 14 0a 11 80 mov $0x80110a14,%ebx
{
8010129f: 83 ec 28 sub $0x28,%esp
801012a2: 89 55 e4 mov %edx,-0x1c(%ebp)
acquire(&icache.lock);
801012a5: 68 e0 09 11 80 push $0x801109e0
801012aa: e8 31 31 00 00 call 801043e0 <acquire>
801012af: 83 c4 10 add $0x10,%esp
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801012b2: 8b 55 e4 mov -0x1c(%ebp),%edx
801012b5: eb 17 jmp 801012ce <iget+0x3e>
801012b7: 89 f6 mov %esi,%esi
801012b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801012c0: 81 c3 90 00 00 00 add $0x90,%ebx
801012c6: 81 fb 34 26 11 80 cmp $0x80112634,%ebx
801012cc: 73 22 jae 801012f0 <iget+0x60>
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
801012ce: 8b 4b 08 mov 0x8(%ebx),%ecx
801012d1: 85 c9 test %ecx,%ecx
801012d3: 7e 04 jle 801012d9 <iget+0x49>
801012d5: 39 3b cmp %edi,(%ebx)
801012d7: 74 4f je 80101328 <iget+0x98>
ip->ref++;
release(&icache.lock);
return ip;
}
if(empty == 0 && ip->ref == 0) // Remember empty slot.
801012d9: 85 f6 test %esi,%esi
801012db: 75 e3 jne 801012c0 <iget+0x30>
801012dd: 85 c9 test %ecx,%ecx
801012df: 0f 44 f3 cmove %ebx,%esi
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801012e2: 81 c3 90 00 00 00 add $0x90,%ebx
801012e8: 81 fb 34 26 11 80 cmp $0x80112634,%ebx
801012ee: 72 de jb 801012ce <iget+0x3e>
empty = ip;
}
// Recycle an inode cache entry.
if(empty == 0)
801012f0: 85 f6 test %esi,%esi
801012f2: 74 5b je 8010134f <iget+0xbf>
ip = empty;
ip->dev = dev;
ip->inum = inum;
ip->ref = 1;
ip->valid = 0;
release(&icache.lock);
801012f4: 83 ec 0c sub $0xc,%esp
ip->dev = dev;
801012f7: 89 3e mov %edi,(%esi)
ip->inum = inum;
801012f9: 89 56 04 mov %edx,0x4(%esi)
ip->ref = 1;
801012fc: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi)
ip->valid = 0;
80101303: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi)
release(&icache.lock);
8010130a: 68 e0 09 11 80 push $0x801109e0
8010130f: e8 8c 31 00 00 call 801044a0 <release>
return ip;
80101314: 83 c4 10 add $0x10,%esp
}
80101317: 8d 65 f4 lea -0xc(%ebp),%esp
8010131a: 89 f0 mov %esi,%eax
8010131c: 5b pop %ebx
8010131d: 5e pop %esi
8010131e: 5f pop %edi
8010131f: 5d pop %ebp
80101320: c3 ret
80101321: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80101328: 39 53 04 cmp %edx,0x4(%ebx)
8010132b: 75 ac jne 801012d9 <iget+0x49>
release(&icache.lock);
8010132d: 83 ec 0c sub $0xc,%esp
ip->ref++;
80101330: 83 c1 01 add $0x1,%ecx
return ip;
80101333: 89 de mov %ebx,%esi
release(&icache.lock);
80101335: 68 e0 09 11 80 push $0x801109e0
ip->ref++;
8010133a: 89 4b 08 mov %ecx,0x8(%ebx)
release(&icache.lock);
8010133d: e8 5e 31 00 00 call 801044a0 <release>
return ip;
80101342: 83 c4 10 add $0x10,%esp
}
80101345: 8d 65 f4 lea -0xc(%ebp),%esp
80101348: 89 f0 mov %esi,%eax
8010134a: 5b pop %ebx
8010134b: 5e pop %esi
8010134c: 5f pop %edi
8010134d: 5d pop %ebp
8010134e: c3 ret
panic("iget: no inodes");
8010134f: 83 ec 0c sub $0xc,%esp
80101352: 68 88 70 10 80 push $0x80107088
80101357: e8 34 f0 ff ff call 80100390 <panic>
8010135c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101360 <bmap>:
// Return the disk block address of the nth block in inode ip.
// If there is no such block, bmap allocates one.
static uint
bmap(struct inode *ip, uint bn)
{
80101360: 55 push %ebp
80101361: 89 e5 mov %esp,%ebp
80101363: 57 push %edi
80101364: 56 push %esi
80101365: 53 push %ebx
80101366: 89 c6 mov %eax,%esi
80101368: 83 ec 1c sub $0x1c,%esp
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
8010136b: 83 fa 0b cmp $0xb,%edx
8010136e: 77 18 ja 80101388 <bmap+0x28>
80101370: 8d 3c 90 lea (%eax,%edx,4),%edi
if((addr = ip->addrs[bn]) == 0)
80101373: 8b 5f 5c mov 0x5c(%edi),%ebx
80101376: 85 db test %ebx,%ebx
80101378: 74 76 je 801013f0 <bmap+0x90>
brelse(bp);
return addr;
}
panic("bmap: out of range");
}
8010137a: 8d 65 f4 lea -0xc(%ebp),%esp
8010137d: 89 d8 mov %ebx,%eax
8010137f: 5b pop %ebx
80101380: 5e pop %esi
80101381: 5f pop %edi
80101382: 5d pop %ebp
80101383: c3 ret
80101384: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bn -= NDIRECT;
80101388: 8d 5a f4 lea -0xc(%edx),%ebx
if(bn < NINDIRECT){
8010138b: 83 fb 7f cmp $0x7f,%ebx
8010138e: 0f 87 90 00 00 00 ja 80101424 <bmap+0xc4>
if((addr = ip->addrs[NDIRECT]) == 0)
80101394: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx
8010139a: 8b 00 mov (%eax),%eax
8010139c: 85 d2 test %edx,%edx
8010139e: 74 70 je 80101410 <bmap+0xb0>
bp = bread(ip->dev, addr);
801013a0: 83 ec 08 sub $0x8,%esp
801013a3: 52 push %edx
801013a4: 50 push %eax
801013a5: e8 26 ed ff ff call 801000d0 <bread>
if((addr = a[bn]) == 0){
801013aa: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx
801013ae: 83 c4 10 add $0x10,%esp
bp = bread(ip->dev, addr);
801013b1: 89 c7 mov %eax,%edi
if((addr = a[bn]) == 0){
801013b3: 8b 1a mov (%edx),%ebx
801013b5: 85 db test %ebx,%ebx
801013b7: 75 1d jne 801013d6 <bmap+0x76>
a[bn] = addr = balloc(ip->dev);
801013b9: 8b 06 mov (%esi),%eax
801013bb: 89 55 e4 mov %edx,-0x1c(%ebp)
801013be: e8 bd fd ff ff call 80101180 <balloc>
801013c3: 8b 55 e4 mov -0x1c(%ebp),%edx
log_write(bp);
801013c6: 83 ec 0c sub $0xc,%esp
a[bn] = addr = balloc(ip->dev);
801013c9: 89 c3 mov %eax,%ebx
801013cb: 89 02 mov %eax,(%edx)
log_write(bp);
801013cd: 57 push %edi
801013ce: e8 9d 19 00 00 call 80102d70 <log_write>
801013d3: 83 c4 10 add $0x10,%esp
brelse(bp);
801013d6: 83 ec 0c sub $0xc,%esp
801013d9: 57 push %edi
801013da: e8 01 ee ff ff call 801001e0 <brelse>
801013df: 83 c4 10 add $0x10,%esp
}
801013e2: 8d 65 f4 lea -0xc(%ebp),%esp
801013e5: 89 d8 mov %ebx,%eax
801013e7: 5b pop %ebx
801013e8: 5e pop %esi
801013e9: 5f pop %edi
801013ea: 5d pop %ebp
801013eb: c3 ret
801013ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ip->addrs[bn] = addr = balloc(ip->dev);
801013f0: 8b 00 mov (%eax),%eax
801013f2: e8 89 fd ff ff call 80101180 <balloc>
801013f7: 89 47 5c mov %eax,0x5c(%edi)
}
801013fa: 8d 65 f4 lea -0xc(%ebp),%esp
ip->addrs[bn] = addr = balloc(ip->dev);
801013fd: 89 c3 mov %eax,%ebx
}
801013ff: 89 d8 mov %ebx,%eax
80101401: 5b pop %ebx
80101402: 5e pop %esi
80101403: 5f pop %edi
80101404: 5d pop %ebp
80101405: c3 ret
80101406: 8d 76 00 lea 0x0(%esi),%esi
80101409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
80101410: e8 6b fd ff ff call 80101180 <balloc>
80101415: 89 c2 mov %eax,%edx
80101417: 89 86 8c 00 00 00 mov %eax,0x8c(%esi)
8010141d: 8b 06 mov (%esi),%eax
8010141f: e9 7c ff ff ff jmp 801013a0 <bmap+0x40>
panic("bmap: out of range");
80101424: 83 ec 0c sub $0xc,%esp
80101427: 68 98 70 10 80 push $0x80107098
8010142c: e8 5f ef ff ff call 80100390 <panic>
80101431: eb 0d jmp 80101440 <readsb>
80101433: 90 nop
80101434: 90 nop
80101435: 90 nop
80101436: 90 nop
80101437: 90 nop
80101438: 90 nop
80101439: 90 nop
8010143a: 90 nop
8010143b: 90 nop
8010143c: 90 nop
8010143d: 90 nop
8010143e: 90 nop
8010143f: 90 nop
80101440 <readsb>:
{
80101440: 55 push %ebp
80101441: 89 e5 mov %esp,%ebp
80101443: 56 push %esi
80101444: 53 push %ebx
80101445: 8b 75 0c mov 0xc(%ebp),%esi
bp = bread(dev, 1);
80101448: 83 ec 08 sub $0x8,%esp
8010144b: 6a 01 push $0x1
8010144d: ff 75 08 pushl 0x8(%ebp)
80101450: e8 7b ec ff ff call 801000d0 <bread>
80101455: 89 c3 mov %eax,%ebx
memmove(sb, bp->data, sizeof(*sb));
80101457: 8d 40 5c lea 0x5c(%eax),%eax
8010145a: 83 c4 0c add $0xc,%esp
8010145d: 6a 1c push $0x1c
8010145f: 50 push %eax
80101460: 56 push %esi
80101461: e8 3a 31 00 00 call 801045a0 <memmove>
brelse(bp);
80101466: 89 5d 08 mov %ebx,0x8(%ebp)
80101469: 83 c4 10 add $0x10,%esp
}
8010146c: 8d 65 f8 lea -0x8(%ebp),%esp
8010146f: 5b pop %ebx
80101470: 5e pop %esi
80101471: 5d pop %ebp
brelse(bp);
80101472: e9 69 ed ff ff jmp 801001e0 <brelse>
80101477: 89 f6 mov %esi,%esi
80101479: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101480 <iinit>:
{
80101480: 55 push %ebp
80101481: 89 e5 mov %esp,%ebp
80101483: 53 push %ebx
80101484: bb 20 0a 11 80 mov $0x80110a20,%ebx
80101489: 83 ec 0c sub $0xc,%esp
initlock(&icache.lock, "icache");
8010148c: 68 ab 70 10 80 push $0x801070ab
80101491: 68 e0 09 11 80 push $0x801109e0
80101496: e8 05 2e 00 00 call 801042a0 <initlock>
8010149b: 83 c4 10 add $0x10,%esp
8010149e: 66 90 xchg %ax,%ax
initsleeplock(&icache.inode[i].lock, "inode");
801014a0: 83 ec 08 sub $0x8,%esp
801014a3: 68 b2 70 10 80 push $0x801070b2
801014a8: 53 push %ebx
801014a9: 81 c3 90 00 00 00 add $0x90,%ebx
801014af: e8 bc 2c 00 00 call 80104170 <initsleeplock>
for(i = 0; i < NINODE; i++) {
801014b4: 83 c4 10 add $0x10,%esp
801014b7: 81 fb 40 26 11 80 cmp $0x80112640,%ebx
801014bd: 75 e1 jne 801014a0 <iinit+0x20>
readsb(dev, &sb);
801014bf: 83 ec 08 sub $0x8,%esp
801014c2: 68 c0 09 11 80 push $0x801109c0
801014c7: ff 75 08 pushl 0x8(%ebp)
801014ca: e8 71 ff ff ff call 80101440 <readsb>
cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
801014cf: ff 35 d8 09 11 80 pushl 0x801109d8
801014d5: ff 35 d4 09 11 80 pushl 0x801109d4
801014db: ff 35 d0 09 11 80 pushl 0x801109d0
801014e1: ff 35 cc 09 11 80 pushl 0x801109cc
801014e7: ff 35 c8 09 11 80 pushl 0x801109c8
801014ed: ff 35 c4 09 11 80 pushl 0x801109c4
801014f3: ff 35 c0 09 11 80 pushl 0x801109c0
801014f9: 68 18 71 10 80 push $0x80107118
801014fe: e8 5d f1 ff ff call 80100660 <cprintf>
}
80101503: 83 c4 30 add $0x30,%esp
80101506: 8b 5d fc mov -0x4(%ebp),%ebx
80101509: c9 leave
8010150a: c3 ret
8010150b: 90 nop
8010150c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101510 <ialloc>:
{
80101510: 55 push %ebp
80101511: 89 e5 mov %esp,%ebp
80101513: 57 push %edi
80101514: 56 push %esi
80101515: 53 push %ebx
80101516: 83 ec 1c sub $0x1c,%esp
for(inum = 1; inum < sb.ninodes; inum++){
80101519: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8
{
80101520: 8b 45 0c mov 0xc(%ebp),%eax
80101523: 8b 75 08 mov 0x8(%ebp),%esi
80101526: 89 45 e4 mov %eax,-0x1c(%ebp)
for(inum = 1; inum < sb.ninodes; inum++){
80101529: 0f 86 91 00 00 00 jbe 801015c0 <ialloc+0xb0>
8010152f: bb 01 00 00 00 mov $0x1,%ebx
80101534: eb 21 jmp 80101557 <ialloc+0x47>
80101536: 8d 76 00 lea 0x0(%esi),%esi
80101539: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
brelse(bp);
80101540: 83 ec 0c sub $0xc,%esp
for(inum = 1; inum < sb.ninodes; inum++){
80101543: 83 c3 01 add $0x1,%ebx
brelse(bp);
80101546: 57 push %edi
80101547: e8 94 ec ff ff call 801001e0 <brelse>
for(inum = 1; inum < sb.ninodes; inum++){
8010154c: 83 c4 10 add $0x10,%esp
8010154f: 39 1d c8 09 11 80 cmp %ebx,0x801109c8
80101555: 76 69 jbe 801015c0 <ialloc+0xb0>
bp = bread(dev, IBLOCK(inum, sb));
80101557: 89 d8 mov %ebx,%eax
80101559: 83 ec 08 sub $0x8,%esp
8010155c: c1 e8 03 shr $0x3,%eax
8010155f: 03 05 d4 09 11 80 add 0x801109d4,%eax
80101565: 50 push %eax
80101566: 56 push %esi
80101567: e8 64 eb ff ff call 801000d0 <bread>
8010156c: 89 c7 mov %eax,%edi
dip = (struct dinode*)bp->data + inum%IPB;
8010156e: 89 d8 mov %ebx,%eax
if(dip->type == 0){ // a free inode
80101570: 83 c4 10 add $0x10,%esp
dip = (struct dinode*)bp->data + inum%IPB;
80101573: 83 e0 07 and $0x7,%eax
80101576: c1 e0 06 shl $0x6,%eax
80101579: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx
if(dip->type == 0){ // a free inode
8010157d: 66 83 39 00 cmpw $0x0,(%ecx)
80101581: 75 bd jne 80101540 <ialloc+0x30>
memset(dip, 0, sizeof(*dip));
80101583: 83 ec 04 sub $0x4,%esp
80101586: 89 4d e0 mov %ecx,-0x20(%ebp)
80101589: 6a 40 push $0x40
8010158b: 6a 00 push $0x0
8010158d: 51 push %ecx
8010158e: e8 5d 2f 00 00 call 801044f0 <memset>
dip->type = type;
80101593: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax
80101597: 8b 4d e0 mov -0x20(%ebp),%ecx
8010159a: 66 89 01 mov %ax,(%ecx)
log_write(bp); // mark it allocated on the disk
8010159d: 89 3c 24 mov %edi,(%esp)
801015a0: e8 cb 17 00 00 call 80102d70 <log_write>
brelse(bp);
801015a5: 89 3c 24 mov %edi,(%esp)
801015a8: e8 33 ec ff ff call 801001e0 <brelse>
return iget(dev, inum);
801015ad: 83 c4 10 add $0x10,%esp
}
801015b0: 8d 65 f4 lea -0xc(%ebp),%esp
return iget(dev, inum);
801015b3: 89 da mov %ebx,%edx
801015b5: 89 f0 mov %esi,%eax
}
801015b7: 5b pop %ebx
801015b8: 5e pop %esi
801015b9: 5f pop %edi
801015ba: 5d pop %ebp
return iget(dev, inum);
801015bb: e9 d0 fc ff ff jmp 80101290 <iget>
panic("ialloc: no inodes");
801015c0: 83 ec 0c sub $0xc,%esp
801015c3: 68 b8 70 10 80 push $0x801070b8
801015c8: e8 c3 ed ff ff call 80100390 <panic>
801015cd: 8d 76 00 lea 0x0(%esi),%esi
801015d0 <iupdate>:
{
801015d0: 55 push %ebp
801015d1: 89 e5 mov %esp,%ebp
801015d3: 56 push %esi
801015d4: 53 push %ebx
801015d5: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801015d8: 83 ec 08 sub $0x8,%esp
801015db: 8b 43 04 mov 0x4(%ebx),%eax
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
801015de: 83 c3 5c add $0x5c,%ebx
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801015e1: c1 e8 03 shr $0x3,%eax
801015e4: 03 05 d4 09 11 80 add 0x801109d4,%eax
801015ea: 50 push %eax
801015eb: ff 73 a4 pushl -0x5c(%ebx)
801015ee: e8 dd ea ff ff call 801000d0 <bread>
801015f3: 89 c6 mov %eax,%esi
dip = (struct dinode*)bp->data + ip->inum%IPB;
801015f5: 8b 43 a8 mov -0x58(%ebx),%eax
dip->type = ip->type;
801015f8: 0f b7 53 f4 movzwl -0xc(%ebx),%edx
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
801015fc: 83 c4 0c add $0xc,%esp
dip = (struct dinode*)bp->data + ip->inum%IPB;
801015ff: 83 e0 07 and $0x7,%eax
80101602: c1 e0 06 shl $0x6,%eax
80101605: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax
dip->type = ip->type;
80101609: 66 89 10 mov %dx,(%eax)
dip->major = ip->major;
8010160c: 0f b7 53 f6 movzwl -0xa(%ebx),%edx
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
80101610: 83 c0 0c add $0xc,%eax
dip->major = ip->major;
80101613: 66 89 50 f6 mov %dx,-0xa(%eax)
dip->minor = ip->minor;
80101617: 0f b7 53 f8 movzwl -0x8(%ebx),%edx
8010161b: 66 89 50 f8 mov %dx,-0x8(%eax)
dip->nlink = ip->nlink;
8010161f: 0f b7 53 fa movzwl -0x6(%ebx),%edx
80101623: 66 89 50 fa mov %dx,-0x6(%eax)
dip->size = ip->size;
80101627: 8b 53 fc mov -0x4(%ebx),%edx
8010162a: 89 50 fc mov %edx,-0x4(%eax)
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010162d: 6a 34 push $0x34
8010162f: 53 push %ebx
80101630: 50 push %eax
80101631: e8 6a 2f 00 00 call 801045a0 <memmove>
log_write(bp);
80101636: 89 34 24 mov %esi,(%esp)
80101639: e8 32 17 00 00 call 80102d70 <log_write>
brelse(bp);
8010163e: 89 75 08 mov %esi,0x8(%ebp)
80101641: 83 c4 10 add $0x10,%esp
}
80101644: 8d 65 f8 lea -0x8(%ebp),%esp
80101647: 5b pop %ebx
80101648: 5e pop %esi
80101649: 5d pop %ebp
brelse(bp);
8010164a: e9 91 eb ff ff jmp 801001e0 <brelse>
8010164f: 90 nop
80101650 <idup>:
{
80101650: 55 push %ebp
80101651: 89 e5 mov %esp,%ebp
80101653: 53 push %ebx
80101654: 83 ec 10 sub $0x10,%esp
80101657: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&icache.lock);
8010165a: 68 e0 09 11 80 push $0x801109e0
8010165f: e8 7c 2d 00 00 call 801043e0 <acquire>
ip->ref++;
80101664: 83 43 08 01 addl $0x1,0x8(%ebx)
release(&icache.lock);
80101668: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
8010166f: e8 2c 2e 00 00 call 801044a0 <release>
}
80101674: 89 d8 mov %ebx,%eax
80101676: 8b 5d fc mov -0x4(%ebp),%ebx
80101679: c9 leave
8010167a: c3 ret
8010167b: 90 nop
8010167c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101680 <ilock>:
{
80101680: 55 push %ebp
80101681: 89 e5 mov %esp,%ebp
80101683: 56 push %esi
80101684: 53 push %ebx
80101685: 8b 5d 08 mov 0x8(%ebp),%ebx
if(ip == 0 || ip->ref < 1)
80101688: 85 db test %ebx,%ebx
8010168a: 0f 84 b7 00 00 00 je 80101747 <ilock+0xc7>
80101690: 8b 53 08 mov 0x8(%ebx),%edx
80101693: 85 d2 test %edx,%edx
80101695: 0f 8e ac 00 00 00 jle 80101747 <ilock+0xc7>
acquiresleep(&ip->lock);
8010169b: 8d 43 0c lea 0xc(%ebx),%eax
8010169e: 83 ec 0c sub $0xc,%esp
801016a1: 50 push %eax
801016a2: e8 09 2b 00 00 call 801041b0 <acquiresleep>
if(ip->valid == 0){
801016a7: 8b 43 4c mov 0x4c(%ebx),%eax
801016aa: 83 c4 10 add $0x10,%esp
801016ad: 85 c0 test %eax,%eax
801016af: 74 0f je 801016c0 <ilock+0x40>
}
801016b1: 8d 65 f8 lea -0x8(%ebp),%esp
801016b4: 5b pop %ebx
801016b5: 5e pop %esi
801016b6: 5d pop %ebp
801016b7: c3 ret
801016b8: 90 nop
801016b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801016c0: 8b 43 04 mov 0x4(%ebx),%eax
801016c3: 83 ec 08 sub $0x8,%esp
801016c6: c1 e8 03 shr $0x3,%eax
801016c9: 03 05 d4 09 11 80 add 0x801109d4,%eax
801016cf: 50 push %eax
801016d0: ff 33 pushl (%ebx)
801016d2: e8 f9 e9 ff ff call 801000d0 <bread>
801016d7: 89 c6 mov %eax,%esi
dip = (struct dinode*)bp->data + ip->inum%IPB;
801016d9: 8b 43 04 mov 0x4(%ebx),%eax
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
801016dc: 83 c4 0c add $0xc,%esp
dip = (struct dinode*)bp->data + ip->inum%IPB;
801016df: 83 e0 07 and $0x7,%eax
801016e2: c1 e0 06 shl $0x6,%eax
801016e5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax
ip->type = dip->type;
801016e9: 0f b7 10 movzwl (%eax),%edx
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
801016ec: 83 c0 0c add $0xc,%eax
ip->type = dip->type;
801016ef: 66 89 53 50 mov %dx,0x50(%ebx)
ip->major = dip->major;
801016f3: 0f b7 50 f6 movzwl -0xa(%eax),%edx
801016f7: 66 89 53 52 mov %dx,0x52(%ebx)
ip->minor = dip->minor;
801016fb: 0f b7 50 f8 movzwl -0x8(%eax),%edx
801016ff: 66 89 53 54 mov %dx,0x54(%ebx)
ip->nlink = dip->nlink;
80101703: 0f b7 50 fa movzwl -0x6(%eax),%edx
80101707: 66 89 53 56 mov %dx,0x56(%ebx)
ip->size = dip->size;
8010170b: 8b 50 fc mov -0x4(%eax),%edx
8010170e: 89 53 58 mov %edx,0x58(%ebx)
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101711: 6a 34 push $0x34
80101713: 50 push %eax
80101714: 8d 43 5c lea 0x5c(%ebx),%eax
80101717: 50 push %eax
80101718: e8 83 2e 00 00 call 801045a0 <memmove>
brelse(bp);
8010171d: 89 34 24 mov %esi,(%esp)
80101720: e8 bb ea ff ff call 801001e0 <brelse>
if(ip->type == 0)
80101725: 83 c4 10 add $0x10,%esp
80101728: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx)
ip->valid = 1;
8010172d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx)
if(ip->type == 0)
80101734: 0f 85 77 ff ff ff jne 801016b1 <ilock+0x31>
panic("ilock: no type");
8010173a: 83 ec 0c sub $0xc,%esp
8010173d: 68 d0 70 10 80 push $0x801070d0
80101742: e8 49 ec ff ff call 80100390 <panic>
panic("ilock");
80101747: 83 ec 0c sub $0xc,%esp
8010174a: 68 ca 70 10 80 push $0x801070ca
8010174f: e8 3c ec ff ff call 80100390 <panic>
80101754: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010175a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80101760 <iunlock>:
{
80101760: 55 push %ebp
80101761: 89 e5 mov %esp,%ebp
80101763: 56 push %esi
80101764: 53 push %ebx
80101765: 8b 5d 08 mov 0x8(%ebp),%ebx
if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101768: 85 db test %ebx,%ebx
8010176a: 74 28 je 80101794 <iunlock+0x34>
8010176c: 8d 73 0c lea 0xc(%ebx),%esi
8010176f: 83 ec 0c sub $0xc,%esp
80101772: 56 push %esi
80101773: e8 d8 2a 00 00 call 80104250 <holdingsleep>
80101778: 83 c4 10 add $0x10,%esp
8010177b: 85 c0 test %eax,%eax
8010177d: 74 15 je 80101794 <iunlock+0x34>
8010177f: 8b 43 08 mov 0x8(%ebx),%eax
80101782: 85 c0 test %eax,%eax
80101784: 7e 0e jle 80101794 <iunlock+0x34>
releasesleep(&ip->lock);
80101786: 89 75 08 mov %esi,0x8(%ebp)
}
80101789: 8d 65 f8 lea -0x8(%ebp),%esp
8010178c: 5b pop %ebx
8010178d: 5e pop %esi
8010178e: 5d pop %ebp
releasesleep(&ip->lock);
8010178f: e9 7c 2a 00 00 jmp 80104210 <releasesleep>
panic("iunlock");
80101794: 83 ec 0c sub $0xc,%esp
80101797: 68 df 70 10 80 push $0x801070df
8010179c: e8 ef eb ff ff call 80100390 <panic>
801017a1: eb 0d jmp 801017b0 <iput>
801017a3: 90 nop
801017a4: 90 nop
801017a5: 90 nop
801017a6: 90 nop
801017a7: 90 nop
801017a8: 90 nop
801017a9: 90 nop
801017aa: 90 nop
801017ab: 90 nop
801017ac: 90 nop
801017ad: 90 nop
801017ae: 90 nop
801017af: 90 nop
801017b0 <iput>:
{
801017b0: 55 push %ebp
801017b1: 89 e5 mov %esp,%ebp
801017b3: 57 push %edi
801017b4: 56 push %esi
801017b5: 53 push %ebx
801017b6: 83 ec 28 sub $0x28,%esp
801017b9: 8b 5d 08 mov 0x8(%ebp),%ebx
acquiresleep(&ip->lock);
801017bc: 8d 7b 0c lea 0xc(%ebx),%edi
801017bf: 57 push %edi
801017c0: e8 eb 29 00 00 call 801041b0 <acquiresleep>
if(ip->valid && ip->nlink == 0){
801017c5: 8b 53 4c mov 0x4c(%ebx),%edx
801017c8: 83 c4 10 add $0x10,%esp
801017cb: 85 d2 test %edx,%edx
801017cd: 74 07 je 801017d6 <iput+0x26>
801017cf: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx)
801017d4: 74 32 je 80101808 <iput+0x58>
releasesleep(&ip->lock);
801017d6: 83 ec 0c sub $0xc,%esp
801017d9: 57 push %edi
801017da: e8 31 2a 00 00 call 80104210 <releasesleep>
acquire(&icache.lock);
801017df: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
801017e6: e8 f5 2b 00 00 call 801043e0 <acquire>
ip->ref--;
801017eb: 83 6b 08 01 subl $0x1,0x8(%ebx)
release(&icache.lock);
801017ef: 83 c4 10 add $0x10,%esp
801017f2: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp)
}
801017f9: 8d 65 f4 lea -0xc(%ebp),%esp
801017fc: 5b pop %ebx
801017fd: 5e pop %esi
801017fe: 5f pop %edi
801017ff: 5d pop %ebp
release(&icache.lock);
80101800: e9 9b 2c 00 00 jmp 801044a0 <release>
80101805: 8d 76 00 lea 0x0(%esi),%esi
acquire(&icache.lock);
80101808: 83 ec 0c sub $0xc,%esp
8010180b: 68 e0 09 11 80 push $0x801109e0
80101810: e8 cb 2b 00 00 call 801043e0 <acquire>
int r = ip->ref;
80101815: 8b 73 08 mov 0x8(%ebx),%esi
release(&icache.lock);
80101818: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
8010181f: e8 7c 2c 00 00 call 801044a0 <release>
if(r == 1){
80101824: 83 c4 10 add $0x10,%esp
80101827: 83 fe 01 cmp $0x1,%esi
8010182a: 75 aa jne 801017d6 <iput+0x26>
8010182c: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx
80101832: 89 7d e4 mov %edi,-0x1c(%ebp)
80101835: 8d 73 5c lea 0x5c(%ebx),%esi
80101838: 89 cf mov %ecx,%edi
8010183a: eb 0b jmp 80101847 <iput+0x97>
8010183c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101840: 83 c6 04 add $0x4,%esi
{
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101843: 39 fe cmp %edi,%esi
80101845: 74 19 je 80101860 <iput+0xb0>
if(ip->addrs[i]){
80101847: 8b 16 mov (%esi),%edx
80101849: 85 d2 test %edx,%edx
8010184b: 74 f3 je 80101840 <iput+0x90>
bfree(ip->dev, ip->addrs[i]);
8010184d: 8b 03 mov (%ebx),%eax
8010184f: e8 bc f8 ff ff call 80101110 <bfree>
ip->addrs[i] = 0;
80101854: c7 06 00 00 00 00 movl $0x0,(%esi)
8010185a: eb e4 jmp 80101840 <iput+0x90>
8010185c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
}
if(ip->addrs[NDIRECT]){
80101860: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax
80101866: 8b 7d e4 mov -0x1c(%ebp),%edi
80101869: 85 c0 test %eax,%eax
8010186b: 75 33 jne 801018a0 <iput+0xf0>
bfree(ip->dev, ip->addrs[NDIRECT]);
ip->addrs[NDIRECT] = 0;
}
ip->size = 0;
iupdate(ip);
8010186d: 83 ec 0c sub $0xc,%esp
ip->size = 0;
80101870: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx)
iupdate(ip);
80101877: 53 push %ebx
80101878: e8 53 fd ff ff call 801015d0 <iupdate>
ip->type = 0;
8010187d: 31 c0 xor %eax,%eax
8010187f: 66 89 43 50 mov %ax,0x50(%ebx)
iupdate(ip);
80101883: 89 1c 24 mov %ebx,(%esp)
80101886: e8 45 fd ff ff call 801015d0 <iupdate>
ip->valid = 0;
8010188b: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx)
80101892: 83 c4 10 add $0x10,%esp
80101895: e9 3c ff ff ff jmp 801017d6 <iput+0x26>
8010189a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
bp = bread(ip->dev, ip->addrs[NDIRECT]);
801018a0: 83 ec 08 sub $0x8,%esp
801018a3: 50 push %eax
801018a4: ff 33 pushl (%ebx)
801018a6: e8 25 e8 ff ff call 801000d0 <bread>
801018ab: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx
801018b1: 89 7d e0 mov %edi,-0x20(%ebp)
801018b4: 89 45 e4 mov %eax,-0x1c(%ebp)
a = (uint*)bp->data;
801018b7: 8d 70 5c lea 0x5c(%eax),%esi
801018ba: 83 c4 10 add $0x10,%esp
801018bd: 89 cf mov %ecx,%edi
801018bf: eb 0e jmp 801018cf <iput+0x11f>
801018c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801018c8: 83 c6 04 add $0x4,%esi
for(j = 0; j < NINDIRECT; j++){
801018cb: 39 fe cmp %edi,%esi
801018cd: 74 0f je 801018de <iput+0x12e>
if(a[j])
801018cf: 8b 16 mov (%esi),%edx
801018d1: 85 d2 test %edx,%edx
801018d3: 74 f3 je 801018c8 <iput+0x118>
bfree(ip->dev, a[j]);
801018d5: 8b 03 mov (%ebx),%eax
801018d7: e8 34 f8 ff ff call 80101110 <bfree>
801018dc: eb ea jmp 801018c8 <iput+0x118>
brelse(bp);
801018de: 83 ec 0c sub $0xc,%esp
801018e1: ff 75 e4 pushl -0x1c(%ebp)
801018e4: 8b 7d e0 mov -0x20(%ebp),%edi
801018e7: e8 f4 e8 ff ff call 801001e0 <brelse>
bfree(ip->dev, ip->addrs[NDIRECT]);
801018ec: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx
801018f2: 8b 03 mov (%ebx),%eax
801018f4: e8 17 f8 ff ff call 80101110 <bfree>
ip->addrs[NDIRECT] = 0;
801018f9: c7 83 8c 00 00 00 00 movl $0x0,0x8c(%ebx)
80101900: 00 00 00
80101903: 83 c4 10 add $0x10,%esp
80101906: e9 62 ff ff ff jmp 8010186d <iput+0xbd>
8010190b: 90 nop
8010190c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101910 <iunlockput>:
{
80101910: 55 push %ebp
80101911: 89 e5 mov %esp,%ebp
80101913: 53 push %ebx
80101914: 83 ec 10 sub $0x10,%esp
80101917: 8b 5d 08 mov 0x8(%ebp),%ebx
iunlock(ip);
8010191a: 53 push %ebx
8010191b: e8 40 fe ff ff call 80101760 <iunlock>
iput(ip);
80101920: 89 5d 08 mov %ebx,0x8(%ebp)
80101923: 83 c4 10 add $0x10,%esp
}
80101926: 8b 5d fc mov -0x4(%ebp),%ebx
80101929: c9 leave
iput(ip);
8010192a: e9 81 fe ff ff jmp 801017b0 <iput>
8010192f: 90 nop
80101930 <stati>:
// Copy stat information from inode.
// Caller must hold ip->lock.
void
stati(struct inode *ip, struct stat *st)
{
80101930: 55 push %ebp
80101931: 89 e5 mov %esp,%ebp
80101933: 8b 55 08 mov 0x8(%ebp),%edx
80101936: 8b 45 0c mov 0xc(%ebp),%eax
st->dev = ip->dev;
80101939: 8b 0a mov (%edx),%ecx
8010193b: 89 48 04 mov %ecx,0x4(%eax)
st->ino = ip->inum;
8010193e: 8b 4a 04 mov 0x4(%edx),%ecx
80101941: 89 48 08 mov %ecx,0x8(%eax)
st->type = ip->type;
80101944: 0f b7 4a 50 movzwl 0x50(%edx),%ecx
80101948: 66 89 08 mov %cx,(%eax)
st->nlink = ip->nlink;
8010194b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx
8010194f: 66 89 48 0c mov %cx,0xc(%eax)
st->size = ip->size;
80101953: 8b 52 58 mov 0x58(%edx),%edx
80101956: 89 50 10 mov %edx,0x10(%eax)
}
80101959: 5d pop %ebp
8010195a: c3 ret
8010195b: 90 nop
8010195c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101960 <readi>:
//PAGEBREAK!
// Read data from inode.
// Caller must hold ip->lock.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101960: 55 push %ebp
80101961: 89 e5 mov %esp,%ebp
80101963: 57 push %edi
80101964: 56 push %esi
80101965: 53 push %ebx
80101966: 83 ec 1c sub $0x1c,%esp
80101969: 8b 45 08 mov 0x8(%ebp),%eax
8010196c: 8b 75 0c mov 0xc(%ebp),%esi
8010196f: 8b 7d 14 mov 0x14(%ebp),%edi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101972: 66 83 78 50 03 cmpw $0x3,0x50(%eax)
{
80101977: 89 75 e0 mov %esi,-0x20(%ebp)
8010197a: 89 45 d8 mov %eax,-0x28(%ebp)
8010197d: 8b 75 10 mov 0x10(%ebp),%esi
80101980: 89 7d e4 mov %edi,-0x1c(%ebp)
if(ip->type == T_DEV){
80101983: 0f 84 a7 00 00 00 je 80101a30 <readi+0xd0>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
return -1;
return devsw[ip->major].read(ip, dst, n);
}
if(off > ip->size || off + n < off)
80101989: 8b 45 d8 mov -0x28(%ebp),%eax
8010198c: 8b 40 58 mov 0x58(%eax),%eax
8010198f: 39 c6 cmp %eax,%esi
80101991: 0f 87 ba 00 00 00 ja 80101a51 <readi+0xf1>
80101997: 8b 7d e4 mov -0x1c(%ebp),%edi
8010199a: 89 f9 mov %edi,%ecx
8010199c: 01 f1 add %esi,%ecx
8010199e: 0f 82 ad 00 00 00 jb 80101a51 <readi+0xf1>
return -1;
if(off + n > ip->size)
n = ip->size - off;
801019a4: 89 c2 mov %eax,%edx
801019a6: 29 f2 sub %esi,%edx
801019a8: 39 c8 cmp %ecx,%eax
801019aa: 0f 43 d7 cmovae %edi,%edx
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
801019ad: 31 ff xor %edi,%edi
801019af: 85 d2 test %edx,%edx
n = ip->size - off;
801019b1: 89 55 e4 mov %edx,-0x1c(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
801019b4: 74 6c je 80101a22 <readi+0xc2>
801019b6: 8d 76 00 lea 0x0(%esi),%esi
801019b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
801019c0: 8b 5d d8 mov -0x28(%ebp),%ebx
801019c3: 89 f2 mov %esi,%edx
801019c5: c1 ea 09 shr $0x9,%edx
801019c8: 89 d8 mov %ebx,%eax
801019ca: e8 91 f9 ff ff call 80101360 <bmap>
801019cf: 83 ec 08 sub $0x8,%esp
801019d2: 50 push %eax
801019d3: ff 33 pushl (%ebx)
801019d5: e8 f6 e6 ff ff call 801000d0 <bread>
m = min(n - tot, BSIZE - off%BSIZE);
801019da: 8b 5d e4 mov -0x1c(%ebp),%ebx
bp = bread(ip->dev, bmap(ip, off/BSIZE));
801019dd: 89 c2 mov %eax,%edx
m = min(n - tot, BSIZE - off%BSIZE);
801019df: 89 f0 mov %esi,%eax
801019e1: 25 ff 01 00 00 and $0x1ff,%eax
801019e6: b9 00 02 00 00 mov $0x200,%ecx
801019eb: 83 c4 0c add $0xc,%esp
801019ee: 29 c1 sub %eax,%ecx
memmove(dst, bp->data + off%BSIZE, m);
801019f0: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax
801019f4: 89 55 dc mov %edx,-0x24(%ebp)
m = min(n - tot, BSIZE - off%BSIZE);
801019f7: 29 fb sub %edi,%ebx
801019f9: 39 d9 cmp %ebx,%ecx
801019fb: 0f 46 d9 cmovbe %ecx,%ebx
memmove(dst, bp->data + off%BSIZE, m);
801019fe: 53 push %ebx
801019ff: 50 push %eax
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101a00: 01 df add %ebx,%edi
memmove(dst, bp->data + off%BSIZE, m);
80101a02: ff 75 e0 pushl -0x20(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101a05: 01 de add %ebx,%esi
memmove(dst, bp->data + off%BSIZE, m);
80101a07: e8 94 2b 00 00 call 801045a0 <memmove>
brelse(bp);
80101a0c: 8b 55 dc mov -0x24(%ebp),%edx
80101a0f: 89 14 24 mov %edx,(%esp)
80101a12: e8 c9 e7 ff ff call 801001e0 <brelse>
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101a17: 01 5d e0 add %ebx,-0x20(%ebp)
80101a1a: 83 c4 10 add $0x10,%esp
80101a1d: 39 7d e4 cmp %edi,-0x1c(%ebp)
80101a20: 77 9e ja 801019c0 <readi+0x60>
}
return n;
80101a22: 8b 45 e4 mov -0x1c(%ebp),%eax
}
80101a25: 8d 65 f4 lea -0xc(%ebp),%esp
80101a28: 5b pop %ebx
80101a29: 5e pop %esi
80101a2a: 5f pop %edi
80101a2b: 5d pop %ebp
80101a2c: c3 ret
80101a2d: 8d 76 00 lea 0x0(%esi),%esi
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80101a30: 0f bf 40 52 movswl 0x52(%eax),%eax
80101a34: 66 83 f8 09 cmp $0x9,%ax
80101a38: 77 17 ja 80101a51 <readi+0xf1>
80101a3a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax
80101a41: 85 c0 test %eax,%eax
80101a43: 74 0c je 80101a51 <readi+0xf1>
return devsw[ip->major].read(ip, dst, n);
80101a45: 89 7d 10 mov %edi,0x10(%ebp)
}
80101a48: 8d 65 f4 lea -0xc(%ebp),%esp
80101a4b: 5b pop %ebx
80101a4c: 5e pop %esi
80101a4d: 5f pop %edi
80101a4e: 5d pop %ebp
return devsw[ip->major].read(ip, dst, n);
80101a4f: ff e0 jmp *%eax
return -1;
80101a51: b8 ff ff ff ff mov $0xffffffff,%eax
80101a56: eb cd jmp 80101a25 <readi+0xc5>
80101a58: 90 nop
80101a59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101a60 <writei>:
// PAGEBREAK!
// Write data to inode.
// Caller must hold ip->lock.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101a60: 55 push %ebp
80101a61: 89 e5 mov %esp,%ebp
80101a63: 57 push %edi
80101a64: 56 push %esi
80101a65: 53 push %ebx
80101a66: 83 ec 1c sub $0x1c,%esp
80101a69: 8b 45 08 mov 0x8(%ebp),%eax
80101a6c: 8b 75 0c mov 0xc(%ebp),%esi
80101a6f: 8b 7d 14 mov 0x14(%ebp),%edi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101a72: 66 83 78 50 03 cmpw $0x3,0x50(%eax)
{
80101a77: 89 75 dc mov %esi,-0x24(%ebp)
80101a7a: 89 45 d8 mov %eax,-0x28(%ebp)
80101a7d: 8b 75 10 mov 0x10(%ebp),%esi
80101a80: 89 7d e0 mov %edi,-0x20(%ebp)
if(ip->type == T_DEV){
80101a83: 0f 84 b7 00 00 00 je 80101b40 <writei+0xe0>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
return -1;
return devsw[ip->major].write(ip, src, n);
}
if(off > ip->size || off + n < off)
80101a89: 8b 45 d8 mov -0x28(%ebp),%eax
80101a8c: 39 70 58 cmp %esi,0x58(%eax)
80101a8f: 0f 82 eb 00 00 00 jb 80101b80 <writei+0x120>
80101a95: 8b 7d e0 mov -0x20(%ebp),%edi
80101a98: 31 d2 xor %edx,%edx
80101a9a: 89 f8 mov %edi,%eax
80101a9c: 01 f0 add %esi,%eax
80101a9e: 0f 92 c2 setb %dl
return -1;
if(off + n > MAXFILE*BSIZE)
80101aa1: 3d 00 18 01 00 cmp $0x11800,%eax
80101aa6: 0f 87 d4 00 00 00 ja 80101b80 <writei+0x120>
80101aac: 85 d2 test %edx,%edx
80101aae: 0f 85 cc 00 00 00 jne 80101b80 <writei+0x120>
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101ab4: 85 ff test %edi,%edi
80101ab6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
80101abd: 74 72 je 80101b31 <writei+0xd1>
80101abf: 90 nop
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101ac0: 8b 7d d8 mov -0x28(%ebp),%edi
80101ac3: 89 f2 mov %esi,%edx
80101ac5: c1 ea 09 shr $0x9,%edx
80101ac8: 89 f8 mov %edi,%eax
80101aca: e8 91 f8 ff ff call 80101360 <bmap>
80101acf: 83 ec 08 sub $0x8,%esp
80101ad2: 50 push %eax
80101ad3: ff 37 pushl (%edi)
80101ad5: e8 f6 e5 ff ff call 801000d0 <bread>
m = min(n - tot, BSIZE - off%BSIZE);
80101ada: 8b 5d e0 mov -0x20(%ebp),%ebx
80101add: 2b 5d e4 sub -0x1c(%ebp),%ebx
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101ae0: 89 c7 mov %eax,%edi
m = min(n - tot, BSIZE - off%BSIZE);
80101ae2: 89 f0 mov %esi,%eax
80101ae4: b9 00 02 00 00 mov $0x200,%ecx
80101ae9: 83 c4 0c add $0xc,%esp
80101aec: 25 ff 01 00 00 and $0x1ff,%eax
80101af1: 29 c1 sub %eax,%ecx
memmove(bp->data + off%BSIZE, src, m);
80101af3: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax
m = min(n - tot, BSIZE - off%BSIZE);
80101af7: 39 d9 cmp %ebx,%ecx
80101af9: 0f 46 d9 cmovbe %ecx,%ebx
memmove(bp->data + off%BSIZE, src, m);
80101afc: 53 push %ebx
80101afd: ff 75 dc pushl -0x24(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101b00: 01 de add %ebx,%esi
memmove(bp->data + off%BSIZE, src, m);
80101b02: 50 push %eax
80101b03: e8 98 2a 00 00 call 801045a0 <memmove>
log_write(bp);
80101b08: 89 3c 24 mov %edi,(%esp)
80101b0b: e8 60 12 00 00 call 80102d70 <log_write>
brelse(bp);
80101b10: 89 3c 24 mov %edi,(%esp)
80101b13: e8 c8 e6 ff ff call 801001e0 <brelse>
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101b18: 01 5d e4 add %ebx,-0x1c(%ebp)
80101b1b: 01 5d dc add %ebx,-0x24(%ebp)
80101b1e: 83 c4 10 add $0x10,%esp
80101b21: 8b 45 e4 mov -0x1c(%ebp),%eax
80101b24: 39 45 e0 cmp %eax,-0x20(%ebp)
80101b27: 77 97 ja 80101ac0 <writei+0x60>
}
if(n > 0 && off > ip->size){
80101b29: 8b 45 d8 mov -0x28(%ebp),%eax
80101b2c: 3b 70 58 cmp 0x58(%eax),%esi
80101b2f: 77 37 ja 80101b68 <writei+0x108>
ip->size = off;
iupdate(ip);
}
return n;
80101b31: 8b 45 e0 mov -0x20(%ebp),%eax
}
80101b34: 8d 65 f4 lea -0xc(%ebp),%esp
80101b37: 5b pop %ebx
80101b38: 5e pop %esi
80101b39: 5f pop %edi
80101b3a: 5d pop %ebp
80101b3b: c3 ret
80101b3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80101b40: 0f bf 40 52 movswl 0x52(%eax),%eax
80101b44: 66 83 f8 09 cmp $0x9,%ax
80101b48: 77 36 ja 80101b80 <writei+0x120>
80101b4a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax
80101b51: 85 c0 test %eax,%eax
80101b53: 74 2b je 80101b80 <writei+0x120>
return devsw[ip->major].write(ip, src, n);
80101b55: 89 7d 10 mov %edi,0x10(%ebp)
}
80101b58: 8d 65 f4 lea -0xc(%ebp),%esp
80101b5b: 5b pop %ebx
80101b5c: 5e pop %esi
80101b5d: 5f pop %edi
80101b5e: 5d pop %ebp
return devsw[ip->major].write(ip, src, n);
80101b5f: ff e0 jmp *%eax
80101b61: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
ip->size = off;
80101b68: 8b 45 d8 mov -0x28(%ebp),%eax
iupdate(ip);
80101b6b: 83 ec 0c sub $0xc,%esp
ip->size = off;
80101b6e: 89 70 58 mov %esi,0x58(%eax)
iupdate(ip);
80101b71: 50 push %eax
80101b72: e8 59 fa ff ff call 801015d0 <iupdate>
80101b77: 83 c4 10 add $0x10,%esp
80101b7a: eb b5 jmp 80101b31 <writei+0xd1>
80101b7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80101b80: b8 ff ff ff ff mov $0xffffffff,%eax
80101b85: eb ad jmp 80101b34 <writei+0xd4>
80101b87: 89 f6 mov %esi,%esi
80101b89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101b90 <namecmp>:
//PAGEBREAK!
// Directories
int
namecmp(const char *s, const char *t)
{
80101b90: 55 push %ebp
80101b91: 89 e5 mov %esp,%ebp
80101b93: 83 ec 0c sub $0xc,%esp
return strncmp(s, t, DIRSIZ);
80101b96: 6a 0e push $0xe
80101b98: ff 75 0c pushl 0xc(%ebp)
80101b9b: ff 75 08 pushl 0x8(%ebp)
80101b9e: e8 6d 2a 00 00 call 80104610 <strncmp>
}
80101ba3: c9 leave
80101ba4: c3 ret
80101ba5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101ba9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101bb0 <dirlookup>:
// Look for a directory entry in a directory.
// If found, set *poff to byte offset of entry.
struct inode*
dirlookup(struct inode *dp, char *name, uint *poff)
{
80101bb0: 55 push %ebp
80101bb1: 89 e5 mov %esp,%ebp
80101bb3: 57 push %edi
80101bb4: 56 push %esi
80101bb5: 53 push %ebx
80101bb6: 83 ec 1c sub $0x1c,%esp
80101bb9: 8b 5d 08 mov 0x8(%ebp),%ebx
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
80101bbc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80101bc1: 0f 85 85 00 00 00 jne 80101c4c <dirlookup+0x9c>
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
80101bc7: 8b 53 58 mov 0x58(%ebx),%edx
80101bca: 31 ff xor %edi,%edi
80101bcc: 8d 75 d8 lea -0x28(%ebp),%esi
80101bcf: 85 d2 test %edx,%edx
80101bd1: 74 3e je 80101c11 <dirlookup+0x61>
80101bd3: 90 nop
80101bd4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101bd8: 6a 10 push $0x10
80101bda: 57 push %edi
80101bdb: 56 push %esi
80101bdc: 53 push %ebx
80101bdd: e8 7e fd ff ff call 80101960 <readi>
80101be2: 83 c4 10 add $0x10,%esp
80101be5: 83 f8 10 cmp $0x10,%eax
80101be8: 75 55 jne 80101c3f <dirlookup+0x8f>
panic("dirlookup read");
if(de.inum == 0)
80101bea: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80101bef: 74 18 je 80101c09 <dirlookup+0x59>
return strncmp(s, t, DIRSIZ);
80101bf1: 8d 45 da lea -0x26(%ebp),%eax
80101bf4: 83 ec 04 sub $0x4,%esp
80101bf7: 6a 0e push $0xe
80101bf9: 50 push %eax
80101bfa: ff 75 0c pushl 0xc(%ebp)
80101bfd: e8 0e 2a 00 00 call 80104610 <strncmp>
continue;
if(namecmp(name, de.name) == 0){
80101c02: 83 c4 10 add $0x10,%esp
80101c05: 85 c0 test %eax,%eax
80101c07: 74 17 je 80101c20 <dirlookup+0x70>
for(off = 0; off < dp->size; off += sizeof(de)){
80101c09: 83 c7 10 add $0x10,%edi
80101c0c: 3b 7b 58 cmp 0x58(%ebx),%edi
80101c0f: 72 c7 jb 80101bd8 <dirlookup+0x28>
return iget(dp->dev, inum);
}
}
return 0;
}
80101c11: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
80101c14: 31 c0 xor %eax,%eax
}
80101c16: 5b pop %ebx
80101c17: 5e pop %esi
80101c18: 5f pop %edi
80101c19: 5d pop %ebp
80101c1a: c3 ret
80101c1b: 90 nop
80101c1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(poff)
80101c20: 8b 45 10 mov 0x10(%ebp),%eax
80101c23: 85 c0 test %eax,%eax
80101c25: 74 05 je 80101c2c <dirlookup+0x7c>
*poff = off;
80101c27: 8b 45 10 mov 0x10(%ebp),%eax
80101c2a: 89 38 mov %edi,(%eax)
inum = de.inum;
80101c2c: 0f b7 55 d8 movzwl -0x28(%ebp),%edx
return iget(dp->dev, inum);
80101c30: 8b 03 mov (%ebx),%eax
80101c32: e8 59 f6 ff ff call 80101290 <iget>
}
80101c37: 8d 65 f4 lea -0xc(%ebp),%esp
80101c3a: 5b pop %ebx
80101c3b: 5e pop %esi
80101c3c: 5f pop %edi
80101c3d: 5d pop %ebp
80101c3e: c3 ret
panic("dirlookup read");
80101c3f: 83 ec 0c sub $0xc,%esp
80101c42: 68 f9 70 10 80 push $0x801070f9
80101c47: e8 44 e7 ff ff call 80100390 <panic>
panic("dirlookup not DIR");
80101c4c: 83 ec 0c sub $0xc,%esp
80101c4f: 68 e7 70 10 80 push $0x801070e7
80101c54: e8 37 e7 ff ff call 80100390 <panic>
80101c59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101c60 <namex>:
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
// Must be called inside a transaction since it calls iput().
static struct inode*
namex(char *path, int nameiparent, char *name)
{
80101c60: 55 push %ebp
80101c61: 89 e5 mov %esp,%ebp
80101c63: 57 push %edi
80101c64: 56 push %esi
80101c65: 53 push %ebx
80101c66: 89 cf mov %ecx,%edi
80101c68: 89 c3 mov %eax,%ebx
80101c6a: 83 ec 1c sub $0x1c,%esp
struct inode *ip, *next;
if(*path == '/')
80101c6d: 80 38 2f cmpb $0x2f,(%eax)
{
80101c70: 89 55 e0 mov %edx,-0x20(%ebp)
if(*path == '/')
80101c73: 0f 84 67 01 00 00 je 80101de0 <namex+0x180>
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(myproc()->cwd);
80101c79: e8 62 1b 00 00 call 801037e0 <myproc>
acquire(&icache.lock);
80101c7e: 83 ec 0c sub $0xc,%esp
ip = idup(myproc()->cwd);
80101c81: 8b 70 68 mov 0x68(%eax),%esi
acquire(&icache.lock);
80101c84: 68 e0 09 11 80 push $0x801109e0
80101c89: e8 52 27 00 00 call 801043e0 <acquire>
ip->ref++;
80101c8e: 83 46 08 01 addl $0x1,0x8(%esi)
release(&icache.lock);
80101c92: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp)
80101c99: e8 02 28 00 00 call 801044a0 <release>
80101c9e: 83 c4 10 add $0x10,%esp
80101ca1: eb 08 jmp 80101cab <namex+0x4b>
80101ca3: 90 nop
80101ca4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
path++;
80101ca8: 83 c3 01 add $0x1,%ebx
while(*path == '/')
80101cab: 0f b6 03 movzbl (%ebx),%eax
80101cae: 3c 2f cmp $0x2f,%al
80101cb0: 74 f6 je 80101ca8 <namex+0x48>
if(*path == 0)
80101cb2: 84 c0 test %al,%al
80101cb4: 0f 84 ee 00 00 00 je 80101da8 <namex+0x148>
while(*path != '/' && *path != 0)
80101cba: 0f b6 03 movzbl (%ebx),%eax
80101cbd: 3c 2f cmp $0x2f,%al
80101cbf: 0f 84 b3 00 00 00 je 80101d78 <namex+0x118>
80101cc5: 84 c0 test %al,%al
80101cc7: 89 da mov %ebx,%edx
80101cc9: 75 09 jne 80101cd4 <namex+0x74>
80101ccb: e9 a8 00 00 00 jmp 80101d78 <namex+0x118>
80101cd0: 84 c0 test %al,%al
80101cd2: 74 0a je 80101cde <namex+0x7e>
path++;
80101cd4: 83 c2 01 add $0x1,%edx
while(*path != '/' && *path != 0)
80101cd7: 0f b6 02 movzbl (%edx),%eax
80101cda: 3c 2f cmp $0x2f,%al
80101cdc: 75 f2 jne 80101cd0 <namex+0x70>
80101cde: 89 d1 mov %edx,%ecx
80101ce0: 29 d9 sub %ebx,%ecx
if(len >= DIRSIZ)
80101ce2: 83 f9 0d cmp $0xd,%ecx
80101ce5: 0f 8e 91 00 00 00 jle 80101d7c <namex+0x11c>
memmove(name, s, DIRSIZ);
80101ceb: 83 ec 04 sub $0x4,%esp
80101cee: 89 55 e4 mov %edx,-0x1c(%ebp)
80101cf1: 6a 0e push $0xe
80101cf3: 53 push %ebx
80101cf4: 57 push %edi
80101cf5: e8 a6 28 00 00 call 801045a0 <memmove>
path++;
80101cfa: 8b 55 e4 mov -0x1c(%ebp),%edx
memmove(name, s, DIRSIZ);
80101cfd: 83 c4 10 add $0x10,%esp
path++;
80101d00: 89 d3 mov %edx,%ebx
while(*path == '/')
80101d02: 80 3a 2f cmpb $0x2f,(%edx)
80101d05: 75 11 jne 80101d18 <namex+0xb8>
80101d07: 89 f6 mov %esi,%esi
80101d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
path++;
80101d10: 83 c3 01 add $0x1,%ebx
while(*path == '/')
80101d13: 80 3b 2f cmpb $0x2f,(%ebx)
80101d16: 74 f8 je 80101d10 <namex+0xb0>
while((path = skipelem(path, name)) != 0){
ilock(ip);
80101d18: 83 ec 0c sub $0xc,%esp
80101d1b: 56 push %esi
80101d1c: e8 5f f9 ff ff call 80101680 <ilock>
if(ip->type != T_DIR){
80101d21: 83 c4 10 add $0x10,%esp
80101d24: 66 83 7e 50 01 cmpw $0x1,0x50(%esi)
80101d29: 0f 85 91 00 00 00 jne 80101dc0 <namex+0x160>
iunlockput(ip);
return 0;
}
if(nameiparent && *path == '\0'){
80101d2f: 8b 55 e0 mov -0x20(%ebp),%edx
80101d32: 85 d2 test %edx,%edx
80101d34: 74 09 je 80101d3f <namex+0xdf>
80101d36: 80 3b 00 cmpb $0x0,(%ebx)
80101d39: 0f 84 b7 00 00 00 je 80101df6 <namex+0x196>
// Stop one level early.
iunlock(ip);
return ip;
}
if((next = dirlookup(ip, name, 0)) == 0){
80101d3f: 83 ec 04 sub $0x4,%esp
80101d42: 6a 00 push $0x0
80101d44: 57 push %edi
80101d45: 56 push %esi
80101d46: e8 65 fe ff ff call 80101bb0 <dirlookup>
80101d4b: 83 c4 10 add $0x10,%esp
80101d4e: 85 c0 test %eax,%eax
80101d50: 74 6e je 80101dc0 <namex+0x160>
iunlock(ip);
80101d52: 83 ec 0c sub $0xc,%esp
80101d55: 89 45 e4 mov %eax,-0x1c(%ebp)
80101d58: 56 push %esi
80101d59: e8 02 fa ff ff call 80101760 <iunlock>
iput(ip);
80101d5e: 89 34 24 mov %esi,(%esp)
80101d61: e8 4a fa ff ff call 801017b0 <iput>
80101d66: 8b 45 e4 mov -0x1c(%ebp),%eax
80101d69: 83 c4 10 add $0x10,%esp
80101d6c: 89 c6 mov %eax,%esi
80101d6e: e9 38 ff ff ff jmp 80101cab <namex+0x4b>
80101d73: 90 nop
80101d74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(*path != '/' && *path != 0)
80101d78: 89 da mov %ebx,%edx
80101d7a: 31 c9 xor %ecx,%ecx
memmove(name, s, len);
80101d7c: 83 ec 04 sub $0x4,%esp
80101d7f: 89 55 dc mov %edx,-0x24(%ebp)
80101d82: 89 4d e4 mov %ecx,-0x1c(%ebp)
80101d85: 51 push %ecx
80101d86: 53 push %ebx
80101d87: 57 push %edi
80101d88: e8 13 28 00 00 call 801045a0 <memmove>
name[len] = 0;
80101d8d: 8b 4d e4 mov -0x1c(%ebp),%ecx
80101d90: 8b 55 dc mov -0x24(%ebp),%edx
80101d93: 83 c4 10 add $0x10,%esp
80101d96: c6 04 0f 00 movb $0x0,(%edi,%ecx,1)
80101d9a: 89 d3 mov %edx,%ebx
80101d9c: e9 61 ff ff ff jmp 80101d02 <namex+0xa2>
80101da1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
}
iunlockput(ip);
ip = next;
}
if(nameiparent){
80101da8: 8b 45 e0 mov -0x20(%ebp),%eax
80101dab: 85 c0 test %eax,%eax
80101dad: 75 5d jne 80101e0c <namex+0x1ac>
iput(ip);
return 0;
}
return ip;
}
80101daf: 8d 65 f4 lea -0xc(%ebp),%esp
80101db2: 89 f0 mov %esi,%eax
80101db4: 5b pop %ebx
80101db5: 5e pop %esi
80101db6: 5f pop %edi
80101db7: 5d pop %ebp
80101db8: c3 ret
80101db9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
iunlock(ip);
80101dc0: 83 ec 0c sub $0xc,%esp
80101dc3: 56 push %esi
80101dc4: e8 97 f9 ff ff call 80101760 <iunlock>
iput(ip);
80101dc9: 89 34 24 mov %esi,(%esp)
return 0;
80101dcc: 31 f6 xor %esi,%esi
iput(ip);
80101dce: e8 dd f9 ff ff call 801017b0 <iput>
return 0;
80101dd3: 83 c4 10 add $0x10,%esp
}
80101dd6: 8d 65 f4 lea -0xc(%ebp),%esp
80101dd9: 89 f0 mov %esi,%eax
80101ddb: 5b pop %ebx
80101ddc: 5e pop %esi
80101ddd: 5f pop %edi
80101dde: 5d pop %ebp
80101ddf: c3 ret
ip = iget(ROOTDEV, ROOTINO);
80101de0: ba 01 00 00 00 mov $0x1,%edx
80101de5: b8 01 00 00 00 mov $0x1,%eax
80101dea: e8 a1 f4 ff ff call 80101290 <iget>
80101def: 89 c6 mov %eax,%esi
80101df1: e9 b5 fe ff ff jmp 80101cab <namex+0x4b>
iunlock(ip);
80101df6: 83 ec 0c sub $0xc,%esp
80101df9: 56 push %esi
80101dfa: e8 61 f9 ff ff call 80101760 <iunlock>
return ip;
80101dff: 83 c4 10 add $0x10,%esp
}
80101e02: 8d 65 f4 lea -0xc(%ebp),%esp
80101e05: 89 f0 mov %esi,%eax
80101e07: 5b pop %ebx
80101e08: 5e pop %esi
80101e09: 5f pop %edi
80101e0a: 5d pop %ebp
80101e0b: c3 ret
iput(ip);
80101e0c: 83 ec 0c sub $0xc,%esp
80101e0f: 56 push %esi
return 0;
80101e10: 31 f6 xor %esi,%esi
iput(ip);
80101e12: e8 99 f9 ff ff call 801017b0 <iput>
return 0;
80101e17: 83 c4 10 add $0x10,%esp
80101e1a: eb 93 jmp 80101daf <namex+0x14f>
80101e1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101e20 <dirlink>:
{
80101e20: 55 push %ebp
80101e21: 89 e5 mov %esp,%ebp
80101e23: 57 push %edi
80101e24: 56 push %esi
80101e25: 53 push %ebx
80101e26: 83 ec 20 sub $0x20,%esp
80101e29: 8b 5d 08 mov 0x8(%ebp),%ebx
if((ip = dirlookup(dp, name, 0)) != 0){
80101e2c: 6a 00 push $0x0
80101e2e: ff 75 0c pushl 0xc(%ebp)
80101e31: 53 push %ebx
80101e32: e8 79 fd ff ff call 80101bb0 <dirlookup>
80101e37: 83 c4 10 add $0x10,%esp
80101e3a: 85 c0 test %eax,%eax
80101e3c: 75 67 jne 80101ea5 <dirlink+0x85>
for(off = 0; off < dp->size; off += sizeof(de)){
80101e3e: 8b 7b 58 mov 0x58(%ebx),%edi
80101e41: 8d 75 d8 lea -0x28(%ebp),%esi
80101e44: 85 ff test %edi,%edi
80101e46: 74 29 je 80101e71 <dirlink+0x51>
80101e48: 31 ff xor %edi,%edi
80101e4a: 8d 75 d8 lea -0x28(%ebp),%esi
80101e4d: eb 09 jmp 80101e58 <dirlink+0x38>
80101e4f: 90 nop
80101e50: 83 c7 10 add $0x10,%edi
80101e53: 3b 7b 58 cmp 0x58(%ebx),%edi
80101e56: 73 19 jae 80101e71 <dirlink+0x51>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101e58: 6a 10 push $0x10
80101e5a: 57 push %edi
80101e5b: 56 push %esi
80101e5c: 53 push %ebx
80101e5d: e8 fe fa ff ff call 80101960 <readi>
80101e62: 83 c4 10 add $0x10,%esp
80101e65: 83 f8 10 cmp $0x10,%eax
80101e68: 75 4e jne 80101eb8 <dirlink+0x98>
if(de.inum == 0)
80101e6a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80101e6f: 75 df jne 80101e50 <dirlink+0x30>
strncpy(de.name, name, DIRSIZ);
80101e71: 8d 45 da lea -0x26(%ebp),%eax
80101e74: 83 ec 04 sub $0x4,%esp
80101e77: 6a 0e push $0xe
80101e79: ff 75 0c pushl 0xc(%ebp)
80101e7c: 50 push %eax
80101e7d: e8 ee 27 00 00 call 80104670 <strncpy>
de.inum = inum;
80101e82: 8b 45 10 mov 0x10(%ebp),%eax
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101e85: 6a 10 push $0x10
80101e87: 57 push %edi
80101e88: 56 push %esi
80101e89: 53 push %ebx
de.inum = inum;
80101e8a: 66 89 45 d8 mov %ax,-0x28(%ebp)
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101e8e: e8 cd fb ff ff call 80101a60 <writei>
80101e93: 83 c4 20 add $0x20,%esp
80101e96: 83 f8 10 cmp $0x10,%eax
80101e99: 75 2a jne 80101ec5 <dirlink+0xa5>
return 0;
80101e9b: 31 c0 xor %eax,%eax
}
80101e9d: 8d 65 f4 lea -0xc(%ebp),%esp
80101ea0: 5b pop %ebx
80101ea1: 5e pop %esi
80101ea2: 5f pop %edi
80101ea3: 5d pop %ebp
80101ea4: c3 ret
iput(ip);
80101ea5: 83 ec 0c sub $0xc,%esp
80101ea8: 50 push %eax
80101ea9: e8 02 f9 ff ff call 801017b0 <iput>
return -1;
80101eae: 83 c4 10 add $0x10,%esp
80101eb1: b8 ff ff ff ff mov $0xffffffff,%eax
80101eb6: eb e5 jmp 80101e9d <dirlink+0x7d>
panic("dirlink read");
80101eb8: 83 ec 0c sub $0xc,%esp
80101ebb: 68 08 71 10 80 push $0x80107108
80101ec0: e8 cb e4 ff ff call 80100390 <panic>
panic("dirlink");
80101ec5: 83 ec 0c sub $0xc,%esp
80101ec8: 68 06 77 10 80 push $0x80107706
80101ecd: e8 be e4 ff ff call 80100390 <panic>
80101ed2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101ee0 <namei>:
struct inode*
namei(char *path)
{
80101ee0: 55 push %ebp
char name[DIRSIZ];
return namex(path, 0, name);
80101ee1: 31 d2 xor %edx,%edx
{
80101ee3: 89 e5 mov %esp,%ebp
80101ee5: 83 ec 18 sub $0x18,%esp
return namex(path, 0, name);
80101ee8: 8b 45 08 mov 0x8(%ebp),%eax
80101eeb: 8d 4d ea lea -0x16(%ebp),%ecx
80101eee: e8 6d fd ff ff call 80101c60 <namex>
}
80101ef3: c9 leave
80101ef4: c3 ret
80101ef5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101ef9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101f00 <nameiparent>:
struct inode*
nameiparent(char *path, char *name)
{
80101f00: 55 push %ebp
return namex(path, 1, name);
80101f01: ba 01 00 00 00 mov $0x1,%edx
{
80101f06: 89 e5 mov %esp,%ebp
return namex(path, 1, name);
80101f08: 8b 4d 0c mov 0xc(%ebp),%ecx
80101f0b: 8b 45 08 mov 0x8(%ebp),%eax
}
80101f0e: 5d pop %ebp
return namex(path, 1, name);
80101f0f: e9 4c fd ff ff jmp 80101c60 <namex>
80101f14: 66 90 xchg %ax,%ax
80101f16: 66 90 xchg %ax,%ax
80101f18: 66 90 xchg %ax,%ax
80101f1a: 66 90 xchg %ax,%ax
80101f1c: 66 90 xchg %ax,%ax
80101f1e: 66 90 xchg %ax,%ax
80101f20 <idestart>:
}
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
80101f20: 55 push %ebp
80101f21: 89 e5 mov %esp,%ebp
80101f23: 57 push %edi
80101f24: 56 push %esi
80101f25: 53 push %ebx
80101f26: 83 ec 0c sub $0xc,%esp
if(b == 0)
80101f29: 85 c0 test %eax,%eax
80101f2b: 0f 84 b4 00 00 00 je 80101fe5 <idestart+0xc5>
panic("idestart");
if(b->blockno >= FSSIZE)
80101f31: 8b 58 08 mov 0x8(%eax),%ebx
80101f34: 89 c6 mov %eax,%esi
80101f36: 81 fb e7 03 00 00 cmp $0x3e7,%ebx
80101f3c: 0f 87 96 00 00 00 ja 80101fd8 <idestart+0xb8>
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80101f42: b9 f7 01 00 00 mov $0x1f7,%ecx
80101f47: 89 f6 mov %esi,%esi
80101f49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101f50: 89 ca mov %ecx,%edx
80101f52: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80101f53: 83 e0 c0 and $0xffffffc0,%eax
80101f56: 3c 40 cmp $0x40,%al
80101f58: 75 f6 jne 80101f50 <idestart+0x30>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80101f5a: 31 ff xor %edi,%edi
80101f5c: ba f6 03 00 00 mov $0x3f6,%edx
80101f61: 89 f8 mov %edi,%eax
80101f63: ee out %al,(%dx)
80101f64: b8 01 00 00 00 mov $0x1,%eax
80101f69: ba f2 01 00 00 mov $0x1f2,%edx
80101f6e: ee out %al,(%dx)
80101f6f: ba f3 01 00 00 mov $0x1f3,%edx
80101f74: 89 d8 mov %ebx,%eax
80101f76: ee out %al,(%dx)
idewait(0);
outb(0x3f6, 0); // generate interrupt
outb(0x1f2, sector_per_block); // number of sectors
outb(0x1f3, sector & 0xff);
outb(0x1f4, (sector >> 8) & 0xff);
80101f77: 89 d8 mov %ebx,%eax
80101f79: ba f4 01 00 00 mov $0x1f4,%edx
80101f7e: c1 f8 08 sar $0x8,%eax
80101f81: ee out %al,(%dx)
80101f82: ba f5 01 00 00 mov $0x1f5,%edx
80101f87: 89 f8 mov %edi,%eax
80101f89: ee out %al,(%dx)
outb(0x1f5, (sector >> 16) & 0xff);
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
80101f8a: 0f b6 46 04 movzbl 0x4(%esi),%eax
80101f8e: ba f6 01 00 00 mov $0x1f6,%edx
80101f93: c1 e0 04 shl $0x4,%eax
80101f96: 83 e0 10 and $0x10,%eax
80101f99: 83 c8 e0 or $0xffffffe0,%eax
80101f9c: ee out %al,(%dx)
if(b->flags & B_DIRTY){
80101f9d: f6 06 04 testb $0x4,(%esi)
80101fa0: 75 16 jne 80101fb8 <idestart+0x98>
80101fa2: b8 20 00 00 00 mov $0x20,%eax
80101fa7: 89 ca mov %ecx,%edx
80101fa9: ee out %al,(%dx)
outb(0x1f7, write_cmd);
outsl(0x1f0, b->data, BSIZE/4);
} else {
outb(0x1f7, read_cmd);
}
}
80101faa: 8d 65 f4 lea -0xc(%ebp),%esp
80101fad: 5b pop %ebx
80101fae: 5e pop %esi
80101faf: 5f pop %edi
80101fb0: 5d pop %ebp
80101fb1: c3 ret
80101fb2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101fb8: b8 30 00 00 00 mov $0x30,%eax
80101fbd: 89 ca mov %ecx,%edx
80101fbf: ee out %al,(%dx)
asm volatile("cld; rep outsl" :
80101fc0: b9 80 00 00 00 mov $0x80,%ecx
outsl(0x1f0, b->data, BSIZE/4);
80101fc5: 83 c6 5c add $0x5c,%esi
80101fc8: ba f0 01 00 00 mov $0x1f0,%edx
80101fcd: fc cld
80101fce: f3 6f rep outsl %ds:(%esi),(%dx)
}
80101fd0: 8d 65 f4 lea -0xc(%ebp),%esp
80101fd3: 5b pop %ebx
80101fd4: 5e pop %esi
80101fd5: 5f pop %edi
80101fd6: 5d pop %ebp
80101fd7: c3 ret
panic("incorrect blockno");
80101fd8: 83 ec 0c sub $0xc,%esp
80101fdb: 68 74 71 10 80 push $0x80107174
80101fe0: e8 ab e3 ff ff call 80100390 <panic>
panic("idestart");
80101fe5: 83 ec 0c sub $0xc,%esp
80101fe8: 68 6b 71 10 80 push $0x8010716b
80101fed: e8 9e e3 ff ff call 80100390 <panic>
80101ff2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101ff9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102000 <ideinit>:
{
80102000: 55 push %ebp
80102001: 89 e5 mov %esp,%ebp
80102003: 83 ec 10 sub $0x10,%esp
initlock(&idelock, "ide");
80102006: 68 86 71 10 80 push $0x80107186
8010200b: 68 80 a5 10 80 push $0x8010a580
80102010: e8 8b 22 00 00 call 801042a0 <initlock>
ioapicenable(IRQ_IDE, ncpu - 1);
80102015: 58 pop %eax
80102016: a1 00 2d 11 80 mov 0x80112d00,%eax
8010201b: 5a pop %edx
8010201c: 83 e8 01 sub $0x1,%eax
8010201f: 50 push %eax
80102020: 6a 0e push $0xe
80102022: e8 a9 02 00 00 call 801022d0 <ioapicenable>
80102027: 83 c4 10 add $0x10,%esp
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010202a: ba f7 01 00 00 mov $0x1f7,%edx
8010202f: 90 nop
80102030: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102031: 83 e0 c0 and $0xffffffc0,%eax
80102034: 3c 40 cmp $0x40,%al
80102036: 75 f8 jne 80102030 <ideinit+0x30>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102038: b8 f0 ff ff ff mov $0xfffffff0,%eax
8010203d: ba f6 01 00 00 mov $0x1f6,%edx
80102042: ee out %al,(%dx)
80102043: b9 e8 03 00 00 mov $0x3e8,%ecx
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102048: ba f7 01 00 00 mov $0x1f7,%edx
8010204d: eb 06 jmp 80102055 <ideinit+0x55>
8010204f: 90 nop
for(i=0; i<1000; i++){
80102050: 83 e9 01 sub $0x1,%ecx
80102053: 74 0f je 80102064 <ideinit+0x64>
80102055: ec in (%dx),%al
if(inb(0x1f7) != 0){
80102056: 84 c0 test %al,%al
80102058: 74 f6 je 80102050 <ideinit+0x50>
havedisk1 = 1;
8010205a: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560
80102061: 00 00 00
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102064: b8 e0 ff ff ff mov $0xffffffe0,%eax
80102069: ba f6 01 00 00 mov $0x1f6,%edx
8010206e: ee out %al,(%dx)
}
8010206f: c9 leave
80102070: c3 ret
80102071: eb 0d jmp 80102080 <ideintr>
80102073: 90 nop
80102074: 90 nop
80102075: 90 nop
80102076: 90 nop
80102077: 90 nop
80102078: 90 nop
80102079: 90 nop
8010207a: 90 nop
8010207b: 90 nop
8010207c: 90 nop
8010207d: 90 nop
8010207e: 90 nop
8010207f: 90 nop
80102080 <ideintr>:
// Interrupt handler.
void
ideintr(void)
{
80102080: 55 push %ebp
80102081: 89 e5 mov %esp,%ebp
80102083: 57 push %edi
80102084: 56 push %esi
80102085: 53 push %ebx
80102086: 83 ec 18 sub $0x18,%esp
struct buf *b;
// First queued buffer is the active request.
acquire(&idelock);
80102089: 68 80 a5 10 80 push $0x8010a580
8010208e: e8 4d 23 00 00 call 801043e0 <acquire>
if((b = idequeue) == 0){
80102093: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx
80102099: 83 c4 10 add $0x10,%esp
8010209c: 85 db test %ebx,%ebx
8010209e: 74 67 je 80102107 <ideintr+0x87>
release(&idelock);
return;
}
idequeue = b->qnext;
801020a0: 8b 43 58 mov 0x58(%ebx),%eax
801020a3: a3 64 a5 10 80 mov %eax,0x8010a564
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
801020a8: 8b 3b mov (%ebx),%edi
801020aa: f7 c7 04 00 00 00 test $0x4,%edi
801020b0: 75 31 jne 801020e3 <ideintr+0x63>
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801020b2: ba f7 01 00 00 mov $0x1f7,%edx
801020b7: 89 f6 mov %esi,%esi
801020b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801020c0: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
801020c1: 89 c6 mov %eax,%esi
801020c3: 83 e6 c0 and $0xffffffc0,%esi
801020c6: 89 f1 mov %esi,%ecx
801020c8: 80 f9 40 cmp $0x40,%cl
801020cb: 75 f3 jne 801020c0 <ideintr+0x40>
if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
801020cd: a8 21 test $0x21,%al
801020cf: 75 12 jne 801020e3 <ideintr+0x63>
insl(0x1f0, b->data, BSIZE/4);
801020d1: 8d 7b 5c lea 0x5c(%ebx),%edi
asm volatile("cld; rep insl" :
801020d4: b9 80 00 00 00 mov $0x80,%ecx
801020d9: ba f0 01 00 00 mov $0x1f0,%edx
801020de: fc cld
801020df: f3 6d rep insl (%dx),%es:(%edi)
801020e1: 8b 3b mov (%ebx),%edi
// Wake process waiting for this buf.
b->flags |= B_VALID;
b->flags &= ~B_DIRTY;
801020e3: 83 e7 fb and $0xfffffffb,%edi
wakeup(b);
801020e6: 83 ec 0c sub $0xc,%esp
b->flags &= ~B_DIRTY;
801020e9: 89 f9 mov %edi,%ecx
801020eb: 83 c9 02 or $0x2,%ecx
801020ee: 89 0b mov %ecx,(%ebx)
wakeup(b);
801020f0: 53 push %ebx
801020f1: e8 da 1e 00 00 call 80103fd0 <wakeup>
// Start disk on next buf in queue.
if(idequeue != 0)
801020f6: a1 64 a5 10 80 mov 0x8010a564,%eax
801020fb: 83 c4 10 add $0x10,%esp
801020fe: 85 c0 test %eax,%eax
80102100: 74 05 je 80102107 <ideintr+0x87>
idestart(idequeue);
80102102: e8 19 fe ff ff call 80101f20 <idestart>
release(&idelock);
80102107: 83 ec 0c sub $0xc,%esp
8010210a: 68 80 a5 10 80 push $0x8010a580
8010210f: e8 8c 23 00 00 call 801044a0 <release>
release(&idelock);
}
80102114: 8d 65 f4 lea -0xc(%ebp),%esp
80102117: 5b pop %ebx
80102118: 5e pop %esi
80102119: 5f pop %edi
8010211a: 5d pop %ebp
8010211b: c3 ret
8010211c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102120 <iderw>:
// Sync buf with disk.
// If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID.
// Else if B_VALID is not set, read buf from disk, set B_VALID.
void
iderw(struct buf *b)
{
80102120: 55 push %ebp
80102121: 89 e5 mov %esp,%ebp
80102123: 53 push %ebx
80102124: 83 ec 10 sub $0x10,%esp
80102127: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf **pp;
if(!holdingsleep(&b->lock))
8010212a: 8d 43 0c lea 0xc(%ebx),%eax
8010212d: 50 push %eax
8010212e: e8 1d 21 00 00 call 80104250 <holdingsleep>
80102133: 83 c4 10 add $0x10,%esp
80102136: 85 c0 test %eax,%eax
80102138: 0f 84 c6 00 00 00 je 80102204 <iderw+0xe4>
panic("iderw: buf not locked");
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
8010213e: 8b 03 mov (%ebx),%eax
80102140: 83 e0 06 and $0x6,%eax
80102143: 83 f8 02 cmp $0x2,%eax
80102146: 0f 84 ab 00 00 00 je 801021f7 <iderw+0xd7>
panic("iderw: nothing to do");
if(b->dev != 0 && !havedisk1)
8010214c: 8b 53 04 mov 0x4(%ebx),%edx
8010214f: 85 d2 test %edx,%edx
80102151: 74 0d je 80102160 <iderw+0x40>
80102153: a1 60 a5 10 80 mov 0x8010a560,%eax
80102158: 85 c0 test %eax,%eax
8010215a: 0f 84 b1 00 00 00 je 80102211 <iderw+0xf1>
panic("iderw: ide disk 1 not present");
acquire(&idelock); //DOC:acquire-lock
80102160: 83 ec 0c sub $0xc,%esp
80102163: 68 80 a5 10 80 push $0x8010a580
80102168: e8 73 22 00 00 call 801043e0 <acquire>
// Append b to idequeue.
b->qnext = 0;
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010216d: 8b 15 64 a5 10 80 mov 0x8010a564,%edx
80102173: 83 c4 10 add $0x10,%esp
b->qnext = 0;
80102176: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx)
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010217d: 85 d2 test %edx,%edx
8010217f: 75 09 jne 8010218a <iderw+0x6a>
80102181: eb 6d jmp 801021f0 <iderw+0xd0>
80102183: 90 nop
80102184: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102188: 89 c2 mov %eax,%edx
8010218a: 8b 42 58 mov 0x58(%edx),%eax
8010218d: 85 c0 test %eax,%eax
8010218f: 75 f7 jne 80102188 <iderw+0x68>
80102191: 83 c2 58 add $0x58,%edx
;
*pp = b;
80102194: 89 1a mov %ebx,(%edx)
// Start disk if necessary.
if(idequeue == b)
80102196: 39 1d 64 a5 10 80 cmp %ebx,0x8010a564
8010219c: 74 42 je 801021e0 <iderw+0xc0>
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
8010219e: 8b 03 mov (%ebx),%eax
801021a0: 83 e0 06 and $0x6,%eax
801021a3: 83 f8 02 cmp $0x2,%eax
801021a6: 74 23 je 801021cb <iderw+0xab>
801021a8: 90 nop
801021a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
sleep(b, &idelock);
801021b0: 83 ec 08 sub $0x8,%esp
801021b3: 68 80 a5 10 80 push $0x8010a580
801021b8: 53 push %ebx
801021b9: e8 62 1c 00 00 call 80103e20 <sleep>
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
801021be: 8b 03 mov (%ebx),%eax
801021c0: 83 c4 10 add $0x10,%esp
801021c3: 83 e0 06 and $0x6,%eax
801021c6: 83 f8 02 cmp $0x2,%eax
801021c9: 75 e5 jne 801021b0 <iderw+0x90>
}
release(&idelock);
801021cb: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp)
}
801021d2: 8b 5d fc mov -0x4(%ebp),%ebx
801021d5: c9 leave
release(&idelock);
801021d6: e9 c5 22 00 00 jmp 801044a0 <release>
801021db: 90 nop
801021dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
idestart(b);
801021e0: 89 d8 mov %ebx,%eax
801021e2: e8 39 fd ff ff call 80101f20 <idestart>
801021e7: eb b5 jmp 8010219e <iderw+0x7e>
801021e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
801021f0: ba 64 a5 10 80 mov $0x8010a564,%edx
801021f5: eb 9d jmp 80102194 <iderw+0x74>
panic("iderw: nothing to do");
801021f7: 83 ec 0c sub $0xc,%esp
801021fa: 68 a0 71 10 80 push $0x801071a0
801021ff: e8 8c e1 ff ff call 80100390 <panic>
panic("iderw: buf not locked");
80102204: 83 ec 0c sub $0xc,%esp
80102207: 68 8a 71 10 80 push $0x8010718a
8010220c: e8 7f e1 ff ff call 80100390 <panic>
panic("iderw: ide disk 1 not present");
80102211: 83 ec 0c sub $0xc,%esp
80102214: 68 b5 71 10 80 push $0x801071b5
80102219: e8 72 e1 ff ff call 80100390 <panic>
8010221e: 66 90 xchg %ax,%ax
80102220 <ioapicinit>:
ioapic->data = data;
}
void
ioapicinit(void)
{
80102220: 55 push %ebp
int i, id, maxintr;
ioapic = (volatile struct ioapic*)IOAPIC;
80102221: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634
80102228: 00 c0 fe
{
8010222b: 89 e5 mov %esp,%ebp
8010222d: 56 push %esi
8010222e: 53 push %ebx
ioapic->reg = reg;
8010222f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000
80102236: 00 00 00
return ioapic->data;
80102239: a1 34 26 11 80 mov 0x80112634,%eax
8010223e: 8b 58 10 mov 0x10(%eax),%ebx
ioapic->reg = reg;
80102241: c7 00 00 00 00 00 movl $0x0,(%eax)
return ioapic->data;
80102247: 8b 0d 34 26 11 80 mov 0x80112634,%ecx
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
id = ioapicread(REG_ID) >> 24;
if(id != ioapicid)
8010224d: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
80102254: c1 eb 10 shr $0x10,%ebx
return ioapic->data;
80102257: 8b 41 10 mov 0x10(%ecx),%eax
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
8010225a: 0f b6 db movzbl %bl,%ebx
id = ioapicread(REG_ID) >> 24;
8010225d: c1 e8 18 shr $0x18,%eax
if(id != ioapicid)
80102260: 39 c2 cmp %eax,%edx
80102262: 74 16 je 8010227a <ioapicinit+0x5a>
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
80102264: 83 ec 0c sub $0xc,%esp
80102267: 68 d4 71 10 80 push $0x801071d4
8010226c: e8 ef e3 ff ff call 80100660 <cprintf>
80102271: 8b 0d 34 26 11 80 mov 0x80112634,%ecx
80102277: 83 c4 10 add $0x10,%esp
8010227a: 83 c3 21 add $0x21,%ebx
{
8010227d: ba 10 00 00 00 mov $0x10,%edx
80102282: b8 20 00 00 00 mov $0x20,%eax
80102287: 89 f6 mov %esi,%esi
80102289: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
ioapic->reg = reg;
80102290: 89 11 mov %edx,(%ecx)
ioapic->data = data;
80102292: 8b 0d 34 26 11 80 mov 0x80112634,%ecx
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
80102298: 89 c6 mov %eax,%esi
8010229a: 81 ce 00 00 01 00 or $0x10000,%esi
801022a0: 83 c0 01 add $0x1,%eax
ioapic->data = data;
801022a3: 89 71 10 mov %esi,0x10(%ecx)
801022a6: 8d 72 01 lea 0x1(%edx),%esi
801022a9: 83 c2 02 add $0x2,%edx
for(i = 0; i <= maxintr; i++){
801022ac: 39 d8 cmp %ebx,%eax
ioapic->reg = reg;
801022ae: 89 31 mov %esi,(%ecx)
ioapic->data = data;
801022b0: 8b 0d 34 26 11 80 mov 0x80112634,%ecx
801022b6: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx)
for(i = 0; i <= maxintr; i++){
801022bd: 75 d1 jne 80102290 <ioapicinit+0x70>
ioapicwrite(REG_TABLE+2*i+1, 0);
}
}
801022bf: 8d 65 f8 lea -0x8(%ebp),%esp
801022c2: 5b pop %ebx
801022c3: 5e pop %esi
801022c4: 5d pop %ebp
801022c5: c3 ret
801022c6: 8d 76 00 lea 0x0(%esi),%esi
801022c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801022d0 <ioapicenable>:
void
ioapicenable(int irq, int cpunum)
{
801022d0: 55 push %ebp
ioapic->reg = reg;
801022d1: 8b 0d 34 26 11 80 mov 0x80112634,%ecx
{
801022d7: 89 e5 mov %esp,%ebp
801022d9: 8b 45 08 mov 0x8(%ebp),%eax
// Mark interrupt edge-triggered, active high,
// enabled, and routed to the given cpunum,
// which happens to be that cpu's APIC ID.
ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
801022dc: 8d 50 20 lea 0x20(%eax),%edx
801022df: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax
ioapic->reg = reg;
801022e3: 89 01 mov %eax,(%ecx)
ioapic->data = data;
801022e5: 8b 0d 34 26 11 80 mov 0x80112634,%ecx
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801022eb: 83 c0 01 add $0x1,%eax
ioapic->data = data;
801022ee: 89 51 10 mov %edx,0x10(%ecx)
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801022f1: 8b 55 0c mov 0xc(%ebp),%edx
ioapic->reg = reg;
801022f4: 89 01 mov %eax,(%ecx)
ioapic->data = data;
801022f6: a1 34 26 11 80 mov 0x80112634,%eax
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801022fb: c1 e2 18 shl $0x18,%edx
ioapic->data = data;
801022fe: 89 50 10 mov %edx,0x10(%eax)
}
80102301: 5d pop %ebp
80102302: c3 ret
80102303: 66 90 xchg %ax,%ax
80102305: 66 90 xchg %ax,%ax
80102307: 66 90 xchg %ax,%ax
80102309: 66 90 xchg %ax,%ax
8010230b: 66 90 xchg %ax,%ax
8010230d: 66 90 xchg %ax,%ax
8010230f: 90 nop
80102310 <kfree>:
// which normally should have been returned by a
// call to kalloc(). (The exception is when
// initializing the allocator; see kinit above.)
void
kfree(char *v)
{
80102310: 55 push %ebp
80102311: 89 e5 mov %esp,%ebp
80102313: 53 push %ebx
80102314: 83 ec 04 sub $0x4,%esp
80102317: 8b 5d 08 mov 0x8(%ebp),%ebx
struct run *r;
if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
8010231a: f7 c3 ff 0f 00 00 test $0xfff,%ebx
80102320: 75 70 jne 80102392 <kfree+0x82>
80102322: 81 fb a8 54 11 80 cmp $0x801154a8,%ebx
80102328: 72 68 jb 80102392 <kfree+0x82>
8010232a: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
80102330: 3d ff ff ff 0d cmp $0xdffffff,%eax
80102335: 77 5b ja 80102392 <kfree+0x82>
panic("kfree");
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
80102337: 83 ec 04 sub $0x4,%esp
8010233a: 68 00 10 00 00 push $0x1000
8010233f: 6a 01 push $0x1
80102341: 53 push %ebx
80102342: e8 a9 21 00 00 call 801044f0 <memset>
if(kmem.use_lock)
80102347: 8b 15 74 26 11 80 mov 0x80112674,%edx
8010234d: 83 c4 10 add $0x10,%esp
80102350: 85 d2 test %edx,%edx
80102352: 75 2c jne 80102380 <kfree+0x70>
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
80102354: a1 78 26 11 80 mov 0x80112678,%eax
80102359: 89 03 mov %eax,(%ebx)
kmem.freelist = r;
if(kmem.use_lock)
8010235b: a1 74 26 11 80 mov 0x80112674,%eax
kmem.freelist = r;
80102360: 89 1d 78 26 11 80 mov %ebx,0x80112678
if(kmem.use_lock)
80102366: 85 c0 test %eax,%eax
80102368: 75 06 jne 80102370 <kfree+0x60>
release(&kmem.lock);
}
8010236a: 8b 5d fc mov -0x4(%ebp),%ebx
8010236d: c9 leave
8010236e: c3 ret
8010236f: 90 nop
release(&kmem.lock);
80102370: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp)
}
80102377: 8b 5d fc mov -0x4(%ebp),%ebx
8010237a: c9 leave
release(&kmem.lock);
8010237b: e9 20 21 00 00 jmp 801044a0 <release>
acquire(&kmem.lock);
80102380: 83 ec 0c sub $0xc,%esp
80102383: 68 40 26 11 80 push $0x80112640
80102388: e8 53 20 00 00 call 801043e0 <acquire>
8010238d: 83 c4 10 add $0x10,%esp
80102390: eb c2 jmp 80102354 <kfree+0x44>
panic("kfree");
80102392: 83 ec 0c sub $0xc,%esp
80102395: 68 06 72 10 80 push $0x80107206
8010239a: e8 f1 df ff ff call 80100390 <panic>
8010239f: 90 nop
801023a0 <freerange>:
{
801023a0: 55 push %ebp
801023a1: 89 e5 mov %esp,%ebp
801023a3: 56 push %esi
801023a4: 53 push %ebx
p = (char*)PGROUNDUP((uint)vstart);
801023a5: 8b 45 08 mov 0x8(%ebp),%eax
{
801023a8: 8b 75 0c mov 0xc(%ebp),%esi
p = (char*)PGROUNDUP((uint)vstart);
801023ab: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
801023b1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801023b7: 81 c3 00 10 00 00 add $0x1000,%ebx
801023bd: 39 de cmp %ebx,%esi
801023bf: 72 23 jb 801023e4 <freerange+0x44>
801023c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
kfree(p);
801023c8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
801023ce: 83 ec 0c sub $0xc,%esp
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801023d1: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
801023d7: 50 push %eax
801023d8: e8 33 ff ff ff call 80102310 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801023dd: 83 c4 10 add $0x10,%esp
801023e0: 39 f3 cmp %esi,%ebx
801023e2: 76 e4 jbe 801023c8 <freerange+0x28>
}
801023e4: 8d 65 f8 lea -0x8(%ebp),%esp
801023e7: 5b pop %ebx
801023e8: 5e pop %esi
801023e9: 5d pop %ebp
801023ea: c3 ret
801023eb: 90 nop
801023ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801023f0 <kinit1>:
{
801023f0: 55 push %ebp
801023f1: 89 e5 mov %esp,%ebp
801023f3: 56 push %esi
801023f4: 53 push %ebx
801023f5: 8b 75 0c mov 0xc(%ebp),%esi
initlock(&kmem.lock, "kmem");
801023f8: 83 ec 08 sub $0x8,%esp
801023fb: 68 0c 72 10 80 push $0x8010720c
80102400: 68 40 26 11 80 push $0x80112640
80102405: e8 96 1e 00 00 call 801042a0 <initlock>
p = (char*)PGROUNDUP((uint)vstart);
8010240a: 8b 45 08 mov 0x8(%ebp),%eax
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010240d: 83 c4 10 add $0x10,%esp
kmem.use_lock = 0;
80102410: c7 05 74 26 11 80 00 movl $0x0,0x80112674
80102417: 00 00 00
p = (char*)PGROUNDUP((uint)vstart);
8010241a: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80102420: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102426: 81 c3 00 10 00 00 add $0x1000,%ebx
8010242c: 39 de cmp %ebx,%esi
8010242e: 72 1c jb 8010244c <kinit1+0x5c>
kfree(p);
80102430: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
80102436: 83 ec 0c sub $0xc,%esp
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102439: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
8010243f: 50 push %eax
80102440: e8 cb fe ff ff call 80102310 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102445: 83 c4 10 add $0x10,%esp
80102448: 39 de cmp %ebx,%esi
8010244a: 73 e4 jae 80102430 <kinit1+0x40>
}
8010244c: 8d 65 f8 lea -0x8(%ebp),%esp
8010244f: 5b pop %ebx
80102450: 5e pop %esi
80102451: 5d pop %ebp
80102452: c3 ret
80102453: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102460 <kinit2>:
{
80102460: 55 push %ebp
80102461: 89 e5 mov %esp,%ebp
80102463: 56 push %esi
80102464: 53 push %ebx
p = (char*)PGROUNDUP((uint)vstart);
80102465: 8b 45 08 mov 0x8(%ebp),%eax
{
80102468: 8b 75 0c mov 0xc(%ebp),%esi
p = (char*)PGROUNDUP((uint)vstart);
8010246b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80102471: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102477: 81 c3 00 10 00 00 add $0x1000,%ebx
8010247d: 39 de cmp %ebx,%esi
8010247f: 72 23 jb 801024a4 <kinit2+0x44>
80102481: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
kfree(p);
80102488: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
8010248e: 83 ec 0c sub $0xc,%esp
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102491: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
80102497: 50 push %eax
80102498: e8 73 fe ff ff call 80102310 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010249d: 83 c4 10 add $0x10,%esp
801024a0: 39 de cmp %ebx,%esi
801024a2: 73 e4 jae 80102488 <kinit2+0x28>
kmem.use_lock = 1;
801024a4: c7 05 74 26 11 80 01 movl $0x1,0x80112674
801024ab: 00 00 00
}
801024ae: 8d 65 f8 lea -0x8(%ebp),%esp
801024b1: 5b pop %ebx
801024b2: 5e pop %esi
801024b3: 5d pop %ebp
801024b4: c3 ret
801024b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801024b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801024c0 <kalloc>:
char*
kalloc(void)
{
struct run *r;
if(kmem.use_lock)
801024c0: a1 74 26 11 80 mov 0x80112674,%eax
801024c5: 85 c0 test %eax,%eax
801024c7: 75 1f jne 801024e8 <kalloc+0x28>
acquire(&kmem.lock);
r = kmem.freelist;
801024c9: a1 78 26 11 80 mov 0x80112678,%eax
if(r)
801024ce: 85 c0 test %eax,%eax
801024d0: 74 0e je 801024e0 <kalloc+0x20>
kmem.freelist = r->next;
801024d2: 8b 10 mov (%eax),%edx
801024d4: 89 15 78 26 11 80 mov %edx,0x80112678
801024da: c3 ret
801024db: 90 nop
801024dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(kmem.use_lock)
release(&kmem.lock);
return (char*)r;
}
801024e0: f3 c3 repz ret
801024e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
{
801024e8: 55 push %ebp
801024e9: 89 e5 mov %esp,%ebp
801024eb: 83 ec 24 sub $0x24,%esp
acquire(&kmem.lock);
801024ee: 68 40 26 11 80 push $0x80112640
801024f3: e8 e8 1e 00 00 call 801043e0 <acquire>
r = kmem.freelist;
801024f8: a1 78 26 11 80 mov 0x80112678,%eax
if(r)
801024fd: 83 c4 10 add $0x10,%esp
80102500: 8b 15 74 26 11 80 mov 0x80112674,%edx
80102506: 85 c0 test %eax,%eax
80102508: 74 08 je 80102512 <kalloc+0x52>
kmem.freelist = r->next;
8010250a: 8b 08 mov (%eax),%ecx
8010250c: 89 0d 78 26 11 80 mov %ecx,0x80112678
if(kmem.use_lock)
80102512: 85 d2 test %edx,%edx
80102514: 74 16 je 8010252c <kalloc+0x6c>
release(&kmem.lock);
80102516: 83 ec 0c sub $0xc,%esp
80102519: 89 45 f4 mov %eax,-0xc(%ebp)
8010251c: 68 40 26 11 80 push $0x80112640
80102521: e8 7a 1f 00 00 call 801044a0 <release>
return (char*)r;
80102526: 8b 45 f4 mov -0xc(%ebp),%eax
release(&kmem.lock);
80102529: 83 c4 10 add $0x10,%esp
}
8010252c: c9 leave
8010252d: c3 ret
8010252e: 66 90 xchg %ax,%ax
80102530 <kbdgetc>:
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102530: ba 64 00 00 00 mov $0x64,%edx
80102535: ec in (%dx),%al
normalmap, shiftmap, ctlmap, ctlmap
};
uint st, data, c;
st = inb(KBSTATP);
if((st & KBS_DIB) == 0)
80102536: a8 01 test $0x1,%al
80102538: 0f 84 c2 00 00 00 je 80102600 <kbdgetc+0xd0>
8010253e: ba 60 00 00 00 mov $0x60,%edx
80102543: ec in (%dx),%al
return -1;
data = inb(KBDATAP);
80102544: 0f b6 d0 movzbl %al,%edx
80102547: 8b 0d b4 a5 10 80 mov 0x8010a5b4,%ecx
if(data == 0xE0){
8010254d: 81 fa e0 00 00 00 cmp $0xe0,%edx
80102553: 0f 84 7f 00 00 00 je 801025d8 <kbdgetc+0xa8>
{
80102559: 55 push %ebp
8010255a: 89 e5 mov %esp,%ebp
8010255c: 53 push %ebx
8010255d: 89 cb mov %ecx,%ebx
8010255f: 83 e3 40 and $0x40,%ebx
shift |= E0ESC;
return 0;
} else if(data & 0x80){
80102562: 84 c0 test %al,%al
80102564: 78 4a js 801025b0 <kbdgetc+0x80>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
shift &= ~(shiftcode[data] | E0ESC);
return 0;
} else if(shift & E0ESC){
80102566: 85 db test %ebx,%ebx
80102568: 74 09 je 80102573 <kbdgetc+0x43>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
8010256a: 83 c8 80 or $0xffffff80,%eax
shift &= ~E0ESC;
8010256d: 83 e1 bf and $0xffffffbf,%ecx
data |= 0x80;
80102570: 0f b6 d0 movzbl %al,%edx
}
shift |= shiftcode[data];
80102573: 0f b6 82 40 73 10 80 movzbl -0x7fef8cc0(%edx),%eax
8010257a: 09 c1 or %eax,%ecx
shift ^= togglecode[data];
8010257c: 0f b6 82 40 72 10 80 movzbl -0x7fef8dc0(%edx),%eax
80102583: 31 c1 xor %eax,%ecx
c = charcode[shift & (CTL | SHIFT)][data];
80102585: 89 c8 mov %ecx,%eax
shift ^= togglecode[data];
80102587: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4
c = charcode[shift & (CTL | SHIFT)][data];
8010258d: 83 e0 03 and $0x3,%eax
if(shift & CAPSLOCK){
80102590: 83 e1 08 and $0x8,%ecx
c = charcode[shift & (CTL | SHIFT)][data];
80102593: 8b 04 85 20 72 10 80 mov -0x7fef8de0(,%eax,4),%eax
8010259a: 0f b6 04 10 movzbl (%eax,%edx,1),%eax
if(shift & CAPSLOCK){
8010259e: 74 31 je 801025d1 <kbdgetc+0xa1>
if('a' <= c && c <= 'z')
801025a0: 8d 50 9f lea -0x61(%eax),%edx
801025a3: 83 fa 19 cmp $0x19,%edx
801025a6: 77 40 ja 801025e8 <kbdgetc+0xb8>
c += 'A' - 'a';
801025a8: 83 e8 20 sub $0x20,%eax
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
}
return c;
}
801025ab: 5b pop %ebx
801025ac: 5d pop %ebp
801025ad: c3 ret
801025ae: 66 90 xchg %ax,%ax
data = (shift & E0ESC ? data : data & 0x7F);
801025b0: 83 e0 7f and $0x7f,%eax
801025b3: 85 db test %ebx,%ebx
801025b5: 0f 44 d0 cmove %eax,%edx
shift &= ~(shiftcode[data] | E0ESC);
801025b8: 0f b6 82 40 73 10 80 movzbl -0x7fef8cc0(%edx),%eax
801025bf: 83 c8 40 or $0x40,%eax
801025c2: 0f b6 c0 movzbl %al,%eax
801025c5: f7 d0 not %eax
801025c7: 21 c1 and %eax,%ecx
return 0;
801025c9: 31 c0 xor %eax,%eax
shift &= ~(shiftcode[data] | E0ESC);
801025cb: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4
}
801025d1: 5b pop %ebx
801025d2: 5d pop %ebp
801025d3: c3 ret
801025d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
shift |= E0ESC;
801025d8: 83 c9 40 or $0x40,%ecx
return 0;
801025db: 31 c0 xor %eax,%eax
shift |= E0ESC;
801025dd: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4
return 0;
801025e3: c3 ret
801025e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
else if('A' <= c && c <= 'Z')
801025e8: 8d 48 bf lea -0x41(%eax),%ecx
c += 'a' - 'A';
801025eb: 8d 50 20 lea 0x20(%eax),%edx
}
801025ee: 5b pop %ebx
c += 'a' - 'A';
801025ef: 83 f9 1a cmp $0x1a,%ecx
801025f2: 0f 42 c2 cmovb %edx,%eax
}
801025f5: 5d pop %ebp
801025f6: c3 ret
801025f7: 89 f6 mov %esi,%esi
801025f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
80102600: b8 ff ff ff ff mov $0xffffffff,%eax
}
80102605: c3 ret
80102606: 8d 76 00 lea 0x0(%esi),%esi
80102609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102610 <kbdintr>:
void
kbdintr(void)
{
80102610: 55 push %ebp
80102611: 89 e5 mov %esp,%ebp
80102613: 83 ec 14 sub $0x14,%esp
consoleintr(kbdgetc);
80102616: 68 30 25 10 80 push $0x80102530
8010261b: e8 f0 e1 ff ff call 80100810 <consoleintr>
}
80102620: 83 c4 10 add $0x10,%esp
80102623: c9 leave
80102624: c3 ret
80102625: 66 90 xchg %ax,%ax
80102627: 66 90 xchg %ax,%ax
80102629: 66 90 xchg %ax,%ax
8010262b: 66 90 xchg %ax,%ax
8010262d: 66 90 xchg %ax,%ax
8010262f: 90 nop
80102630 <lapicinit>:
}
void
lapicinit(void)
{
if(!lapic)
80102630: a1 7c 26 11 80 mov 0x8011267c,%eax
{
80102635: 55 push %ebp
80102636: 89 e5 mov %esp,%ebp
if(!lapic)
80102638: 85 c0 test %eax,%eax
8010263a: 0f 84 c8 00 00 00 je 80102708 <lapicinit+0xd8>
lapic[index] = value;
80102640: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax)
80102647: 01 00 00
lapic[ID]; // wait for write to finish, by reading
8010264a: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
8010264d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax)
80102654: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102657: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
8010265a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax)
80102661: 00 02 00
lapic[ID]; // wait for write to finish, by reading
80102664: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102667: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax)
8010266e: 96 98 00
lapic[ID]; // wait for write to finish, by reading
80102671: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102674: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax)
8010267b: 00 01 00
lapic[ID]; // wait for write to finish, by reading
8010267e: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102681: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax)
80102688: 00 01 00
lapic[ID]; // wait for write to finish, by reading
8010268b: 8b 50 20 mov 0x20(%eax),%edx
lapicw(LINT0, MASKED);
lapicw(LINT1, MASKED);
// Disable performance counter overflow interrupts
// on machines that provide that interrupt entry.
if(((lapic[VER]>>16) & 0xFF) >= 4)
8010268e: 8b 50 30 mov 0x30(%eax),%edx
80102691: c1 ea 10 shr $0x10,%edx
80102694: 80 fa 03 cmp $0x3,%dl
80102697: 77 77 ja 80102710 <lapicinit+0xe0>
lapic[index] = value;
80102699: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax)
801026a0: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026a3: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026a6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801026ad: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026b0: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026b3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801026ba: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026bd: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026c0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
801026c7: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026ca: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026cd: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax)
801026d4: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801026d7: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801026da: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax)
801026e1: 85 08 00
lapic[ID]; // wait for write to finish, by reading
801026e4: 8b 50 20 mov 0x20(%eax),%edx
801026e7: 89 f6 mov %esi,%esi
801026e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
lapicw(EOI, 0);
// Send an Init Level De-Assert to synchronise arbitration ID's.
lapicw(ICRHI, 0);
lapicw(ICRLO, BCAST | INIT | LEVEL);
while(lapic[ICRLO] & DELIVS)
801026f0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx
801026f6: 80 e6 10 and $0x10,%dh
801026f9: 75 f5 jne 801026f0 <lapicinit+0xc0>
lapic[index] = value;
801026fb: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax)
80102702: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102705: 8b 40 20 mov 0x20(%eax),%eax
;
// Enable interrupts on the APIC (but not on the processor).
lapicw(TPR, 0);
}
80102708: 5d pop %ebp
80102709: c3 ret
8010270a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
lapic[index] = value;
80102710: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax)
80102717: 00 01 00
lapic[ID]; // wait for write to finish, by reading
8010271a: 8b 50 20 mov 0x20(%eax),%edx
8010271d: e9 77 ff ff ff jmp 80102699 <lapicinit+0x69>
80102722: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102730 <lapicid>:
int
lapicid(void)
{
if (!lapic)
80102730: 8b 15 7c 26 11 80 mov 0x8011267c,%edx
{
80102736: 55 push %ebp
80102737: 31 c0 xor %eax,%eax
80102739: 89 e5 mov %esp,%ebp
if (!lapic)
8010273b: 85 d2 test %edx,%edx
8010273d: 74 06 je 80102745 <lapicid+0x15>
return 0;
return lapic[ID] >> 24;
8010273f: 8b 42 20 mov 0x20(%edx),%eax
80102742: c1 e8 18 shr $0x18,%eax
}
80102745: 5d pop %ebp
80102746: c3 ret
80102747: 89 f6 mov %esi,%esi
80102749: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102750 <lapiceoi>:
// Acknowledge interrupt.
void
lapiceoi(void)
{
if(lapic)
80102750: a1 7c 26 11 80 mov 0x8011267c,%eax
{
80102755: 55 push %ebp
80102756: 89 e5 mov %esp,%ebp
if(lapic)
80102758: 85 c0 test %eax,%eax
8010275a: 74 0d je 80102769 <lapiceoi+0x19>
lapic[index] = value;
8010275c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
80102763: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102766: 8b 40 20 mov 0x20(%eax),%eax
lapicw(EOI, 0);
}
80102769: 5d pop %ebp
8010276a: c3 ret
8010276b: 90 nop
8010276c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102770 <microdelay>:
// Spin for a given number of microseconds.
// On real hardware would want to tune this dynamically.
void
microdelay(int us)
{
80102770: 55 push %ebp
80102771: 89 e5 mov %esp,%ebp
}
80102773: 5d pop %ebp
80102774: c3 ret
80102775: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102780 <lapicstartap>:
// Start additional processor running entry code at addr.
// See Appendix B of MultiProcessor Specification.
void
lapicstartap(uchar apicid, uint addr)
{
80102780: 55 push %ebp
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102781: b8 0f 00 00 00 mov $0xf,%eax
80102786: ba 70 00 00 00 mov $0x70,%edx
8010278b: 89 e5 mov %esp,%ebp
8010278d: 53 push %ebx
8010278e: 8b 4d 0c mov 0xc(%ebp),%ecx
80102791: 8b 5d 08 mov 0x8(%ebp),%ebx
80102794: ee out %al,(%dx)
80102795: b8 0a 00 00 00 mov $0xa,%eax
8010279a: ba 71 00 00 00 mov $0x71,%edx
8010279f: ee out %al,(%dx)
// and the warm reset vector (DWORD based at 40:67) to point at
// the AP startup code prior to the [universal startup algorithm]."
outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code
outb(CMOS_PORT+1, 0x0A);
wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector
wrv[0] = 0;
801027a0: 31 c0 xor %eax,%eax
wrv[1] = addr >> 4;
// "Universal startup algorithm."
// Send INIT (level-triggered) interrupt to reset other CPU.
lapicw(ICRHI, apicid<<24);
801027a2: c1 e3 18 shl $0x18,%ebx
wrv[0] = 0;
801027a5: 66 a3 67 04 00 80 mov %ax,0x80000467
wrv[1] = addr >> 4;
801027ab: 89 c8 mov %ecx,%eax
// when it is in the halted state due to an INIT. So the second
// should be ignored, but it is part of the official Intel algorithm.
// Bochs complains about the second one. Too bad for Bochs.
for(i = 0; i < 2; i++){
lapicw(ICRHI, apicid<<24);
lapicw(ICRLO, STARTUP | (addr>>12));
801027ad: c1 e9 0c shr $0xc,%ecx
wrv[1] = addr >> 4;
801027b0: c1 e8 04 shr $0x4,%eax
lapicw(ICRHI, apicid<<24);
801027b3: 89 da mov %ebx,%edx
lapicw(ICRLO, STARTUP | (addr>>12));
801027b5: 80 cd 06 or $0x6,%ch
wrv[1] = addr >> 4;
801027b8: 66 a3 69 04 00 80 mov %ax,0x80000469
lapic[index] = value;
801027be: a1 7c 26 11 80 mov 0x8011267c,%eax
801027c3: 89 98 10 03 00 00 mov %ebx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
801027c9: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
801027cc: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax)
801027d3: c5 00 00
lapic[ID]; // wait for write to finish, by reading
801027d6: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
801027d9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax)
801027e0: 85 00 00
lapic[ID]; // wait for write to finish, by reading
801027e3: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
801027e6: 89 90 10 03 00 00 mov %edx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
801027ec: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
801027ef: 89 88 00 03 00 00 mov %ecx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
801027f5: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
801027f8: 89 90 10 03 00 00 mov %edx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
801027fe: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102801: 89 88 00 03 00 00 mov %ecx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
80102807: 8b 40 20 mov 0x20(%eax),%eax
microdelay(200);
}
}
8010280a: 5b pop %ebx
8010280b: 5d pop %ebp
8010280c: c3 ret
8010280d: 8d 76 00 lea 0x0(%esi),%esi
80102810 <cmostime>:
}
// qemu seems to use 24-hour GWT and the values are BCD encoded
void
cmostime(struct rtcdate *r)
{
80102810: 55 push %ebp
80102811: b8 0b 00 00 00 mov $0xb,%eax
80102816: ba 70 00 00 00 mov $0x70,%edx
8010281b: 89 e5 mov %esp,%ebp
8010281d: 57 push %edi
8010281e: 56 push %esi
8010281f: 53 push %ebx
80102820: 83 ec 4c sub $0x4c,%esp
80102823: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102824: ba 71 00 00 00 mov $0x71,%edx
80102829: ec in (%dx),%al
8010282a: 83 e0 04 and $0x4,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010282d: bb 70 00 00 00 mov $0x70,%ebx
80102832: 88 45 b3 mov %al,-0x4d(%ebp)
80102835: 8d 76 00 lea 0x0(%esi),%esi
80102838: 31 c0 xor %eax,%eax
8010283a: 89 da mov %ebx,%edx
8010283c: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010283d: b9 71 00 00 00 mov $0x71,%ecx
80102842: 89 ca mov %ecx,%edx
80102844: ec in (%dx),%al
80102845: 88 45 b7 mov %al,-0x49(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102848: 89 da mov %ebx,%edx
8010284a: b8 02 00 00 00 mov $0x2,%eax
8010284f: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102850: 89 ca mov %ecx,%edx
80102852: ec in (%dx),%al
80102853: 88 45 b6 mov %al,-0x4a(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102856: 89 da mov %ebx,%edx
80102858: b8 04 00 00 00 mov $0x4,%eax
8010285d: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010285e: 89 ca mov %ecx,%edx
80102860: ec in (%dx),%al
80102861: 88 45 b5 mov %al,-0x4b(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102864: 89 da mov %ebx,%edx
80102866: b8 07 00 00 00 mov $0x7,%eax
8010286b: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010286c: 89 ca mov %ecx,%edx
8010286e: ec in (%dx),%al
8010286f: 88 45 b4 mov %al,-0x4c(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102872: 89 da mov %ebx,%edx
80102874: b8 08 00 00 00 mov $0x8,%eax
80102879: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010287a: 89 ca mov %ecx,%edx
8010287c: ec in (%dx),%al
8010287d: 89 c7 mov %eax,%edi
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010287f: 89 da mov %ebx,%edx
80102881: b8 09 00 00 00 mov $0x9,%eax
80102886: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102887: 89 ca mov %ecx,%edx
80102889: ec in (%dx),%al
8010288a: 89 c6 mov %eax,%esi
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010288c: 89 da mov %ebx,%edx
8010288e: b8 0a 00 00 00 mov $0xa,%eax
80102893: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102894: 89 ca mov %ecx,%edx
80102896: ec in (%dx),%al
bcd = (sb & (1 << 2)) == 0;
// make sure CMOS doesn't modify time while we read it
for(;;) {
fill_rtcdate(&t1);
if(cmos_read(CMOS_STATA) & CMOS_UIP)
80102897: 84 c0 test %al,%al
80102899: 78 9d js 80102838 <cmostime+0x28>
return inb(CMOS_RETURN);
8010289b: 0f b6 45 b7 movzbl -0x49(%ebp),%eax
8010289f: 89 fa mov %edi,%edx
801028a1: 0f b6 fa movzbl %dl,%edi
801028a4: 89 f2 mov %esi,%edx
801028a6: 0f b6 f2 movzbl %dl,%esi
801028a9: 89 7d c8 mov %edi,-0x38(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801028ac: 89 da mov %ebx,%edx
801028ae: 89 75 cc mov %esi,-0x34(%ebp)
801028b1: 89 45 b8 mov %eax,-0x48(%ebp)
801028b4: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax
801028b8: 89 45 bc mov %eax,-0x44(%ebp)
801028bb: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax
801028bf: 89 45 c0 mov %eax,-0x40(%ebp)
801028c2: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax
801028c6: 89 45 c4 mov %eax,-0x3c(%ebp)
801028c9: 31 c0 xor %eax,%eax
801028cb: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801028cc: 89 ca mov %ecx,%edx
801028ce: ec in (%dx),%al
801028cf: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801028d2: 89 da mov %ebx,%edx
801028d4: 89 45 d0 mov %eax,-0x30(%ebp)
801028d7: b8 02 00 00 00 mov $0x2,%eax
801028dc: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801028dd: 89 ca mov %ecx,%edx
801028df: ec in (%dx),%al
801028e0: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801028e3: 89 da mov %ebx,%edx
801028e5: 89 45 d4 mov %eax,-0x2c(%ebp)
801028e8: b8 04 00 00 00 mov $0x4,%eax
801028ed: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801028ee: 89 ca mov %ecx,%edx
801028f0: ec in (%dx),%al
801028f1: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
801028f4: 89 da mov %ebx,%edx
801028f6: 89 45 d8 mov %eax,-0x28(%ebp)
801028f9: b8 07 00 00 00 mov $0x7,%eax
801028fe: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801028ff: 89 ca mov %ecx,%edx
80102901: ec in (%dx),%al
80102902: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102905: 89 da mov %ebx,%edx
80102907: 89 45 dc mov %eax,-0x24(%ebp)
8010290a: b8 08 00 00 00 mov $0x8,%eax
8010290f: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102910: 89 ca mov %ecx,%edx
80102912: ec in (%dx),%al
80102913: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102916: 89 da mov %ebx,%edx
80102918: 89 45 e0 mov %eax,-0x20(%ebp)
8010291b: b8 09 00 00 00 mov $0x9,%eax
80102920: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102921: 89 ca mov %ecx,%edx
80102923: ec in (%dx),%al
80102924: 0f b6 c0 movzbl %al,%eax
continue;
fill_rtcdate(&t2);
if(memcmp(&t1, &t2, sizeof(t1)) == 0)
80102927: 83 ec 04 sub $0x4,%esp
return inb(CMOS_RETURN);
8010292a: 89 45 e4 mov %eax,-0x1c(%ebp)
if(memcmp(&t1, &t2, sizeof(t1)) == 0)
8010292d: 8d 45 d0 lea -0x30(%ebp),%eax
80102930: 6a 18 push $0x18
80102932: 50 push %eax
80102933: 8d 45 b8 lea -0x48(%ebp),%eax
80102936: 50 push %eax
80102937: e8 04 1c 00 00 call 80104540 <memcmp>
8010293c: 83 c4 10 add $0x10,%esp
8010293f: 85 c0 test %eax,%eax
80102941: 0f 85 f1 fe ff ff jne 80102838 <cmostime+0x28>
break;
}
// convert
if(bcd) {
80102947: 80 7d b3 00 cmpb $0x0,-0x4d(%ebp)
8010294b: 75 78 jne 801029c5 <cmostime+0x1b5>
#define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
CONV(second);
8010294d: 8b 45 b8 mov -0x48(%ebp),%eax
80102950: 89 c2 mov %eax,%edx
80102952: 83 e0 0f and $0xf,%eax
80102955: c1 ea 04 shr $0x4,%edx
80102958: 8d 14 92 lea (%edx,%edx,4),%edx
8010295b: 8d 04 50 lea (%eax,%edx,2),%eax
8010295e: 89 45 b8 mov %eax,-0x48(%ebp)
CONV(minute);
80102961: 8b 45 bc mov -0x44(%ebp),%eax
80102964: 89 c2 mov %eax,%edx
80102966: 83 e0 0f and $0xf,%eax
80102969: c1 ea 04 shr $0x4,%edx
8010296c: 8d 14 92 lea (%edx,%edx,4),%edx
8010296f: 8d 04 50 lea (%eax,%edx,2),%eax
80102972: 89 45 bc mov %eax,-0x44(%ebp)
CONV(hour );
80102975: 8b 45 c0 mov -0x40(%ebp),%eax
80102978: 89 c2 mov %eax,%edx
8010297a: 83 e0 0f and $0xf,%eax
8010297d: c1 ea 04 shr $0x4,%edx
80102980: 8d 14 92 lea (%edx,%edx,4),%edx
80102983: 8d 04 50 lea (%eax,%edx,2),%eax
80102986: 89 45 c0 mov %eax,-0x40(%ebp)
CONV(day );
80102989: 8b 45 c4 mov -0x3c(%ebp),%eax
8010298c: 89 c2 mov %eax,%edx
8010298e: 83 e0 0f and $0xf,%eax
80102991: c1 ea 04 shr $0x4,%edx
80102994: 8d 14 92 lea (%edx,%edx,4),%edx
80102997: 8d 04 50 lea (%eax,%edx,2),%eax
8010299a: 89 45 c4 mov %eax,-0x3c(%ebp)
CONV(month );
8010299d: 8b 45 c8 mov -0x38(%ebp),%eax
801029a0: 89 c2 mov %eax,%edx
801029a2: 83 e0 0f and $0xf,%eax
801029a5: c1 ea 04 shr $0x4,%edx
801029a8: 8d 14 92 lea (%edx,%edx,4),%edx
801029ab: 8d 04 50 lea (%eax,%edx,2),%eax
801029ae: 89 45 c8 mov %eax,-0x38(%ebp)
CONV(year );
801029b1: 8b 45 cc mov -0x34(%ebp),%eax
801029b4: 89 c2 mov %eax,%edx
801029b6: 83 e0 0f and $0xf,%eax
801029b9: c1 ea 04 shr $0x4,%edx
801029bc: 8d 14 92 lea (%edx,%edx,4),%edx
801029bf: 8d 04 50 lea (%eax,%edx,2),%eax
801029c2: 89 45 cc mov %eax,-0x34(%ebp)
#undef CONV
}
*r = t1;
801029c5: 8b 75 08 mov 0x8(%ebp),%esi
801029c8: 8b 45 b8 mov -0x48(%ebp),%eax
801029cb: 89 06 mov %eax,(%esi)
801029cd: 8b 45 bc mov -0x44(%ebp),%eax
801029d0: 89 46 04 mov %eax,0x4(%esi)
801029d3: 8b 45 c0 mov -0x40(%ebp),%eax
801029d6: 89 46 08 mov %eax,0x8(%esi)
801029d9: 8b 45 c4 mov -0x3c(%ebp),%eax
801029dc: 89 46 0c mov %eax,0xc(%esi)
801029df: 8b 45 c8 mov -0x38(%ebp),%eax
801029e2: 89 46 10 mov %eax,0x10(%esi)
801029e5: 8b 45 cc mov -0x34(%ebp),%eax
801029e8: 89 46 14 mov %eax,0x14(%esi)
r->year += 2000;
801029eb: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi)
}
801029f2: 8d 65 f4 lea -0xc(%ebp),%esp
801029f5: 5b pop %ebx
801029f6: 5e pop %esi
801029f7: 5f pop %edi
801029f8: 5d pop %ebp
801029f9: c3 ret
801029fa: 66 90 xchg %ax,%ax
801029fc: 66 90 xchg %ax,%ax
801029fe: 66 90 xchg %ax,%ax
80102a00 <install_trans>:
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102a00: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx
80102a06: 85 c9 test %ecx,%ecx
80102a08: 0f 8e 8a 00 00 00 jle 80102a98 <install_trans+0x98>
{
80102a0e: 55 push %ebp
80102a0f: 89 e5 mov %esp,%ebp
80102a11: 57 push %edi
80102a12: 56 push %esi
80102a13: 53 push %ebx
for (tail = 0; tail < log.lh.n; tail++) {
80102a14: 31 db xor %ebx,%ebx
{
80102a16: 83 ec 0c sub $0xc,%esp
80102a19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
80102a20: a1 b4 26 11 80 mov 0x801126b4,%eax
80102a25: 83 ec 08 sub $0x8,%esp
80102a28: 01 d8 add %ebx,%eax
80102a2a: 83 c0 01 add $0x1,%eax
80102a2d: 50 push %eax
80102a2e: ff 35 c4 26 11 80 pushl 0x801126c4
80102a34: e8 97 d6 ff ff call 801000d0 <bread>
80102a39: 89 c7 mov %eax,%edi
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102a3b: 58 pop %eax
80102a3c: 5a pop %edx
80102a3d: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4)
80102a44: ff 35 c4 26 11 80 pushl 0x801126c4
for (tail = 0; tail < log.lh.n; tail++) {
80102a4a: 83 c3 01 add $0x1,%ebx
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102a4d: e8 7e d6 ff ff call 801000d0 <bread>
80102a52: 89 c6 mov %eax,%esi
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
80102a54: 8d 47 5c lea 0x5c(%edi),%eax
80102a57: 83 c4 0c add $0xc,%esp
80102a5a: 68 00 02 00 00 push $0x200
80102a5f: 50 push %eax
80102a60: 8d 46 5c lea 0x5c(%esi),%eax
80102a63: 50 push %eax
80102a64: e8 37 1b 00 00 call 801045a0 <memmove>
bwrite(dbuf); // write dst to disk
80102a69: 89 34 24 mov %esi,(%esp)
80102a6c: e8 2f d7 ff ff call 801001a0 <bwrite>
brelse(lbuf);
80102a71: 89 3c 24 mov %edi,(%esp)
80102a74: e8 67 d7 ff ff call 801001e0 <brelse>
brelse(dbuf);
80102a79: 89 34 24 mov %esi,(%esp)
80102a7c: e8 5f d7 ff ff call 801001e0 <brelse>
for (tail = 0; tail < log.lh.n; tail++) {
80102a81: 83 c4 10 add $0x10,%esp
80102a84: 39 1d c8 26 11 80 cmp %ebx,0x801126c8
80102a8a: 7f 94 jg 80102a20 <install_trans+0x20>
}
}
80102a8c: 8d 65 f4 lea -0xc(%ebp),%esp
80102a8f: 5b pop %ebx
80102a90: 5e pop %esi
80102a91: 5f pop %edi
80102a92: 5d pop %ebp
80102a93: c3 ret
80102a94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102a98: f3 c3 repz ret
80102a9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102aa0 <write_head>:
// Write in-memory log header to disk.
// This is the true point at which the
// current transaction commits.
static void
write_head(void)
{
80102aa0: 55 push %ebp
80102aa1: 89 e5 mov %esp,%ebp
80102aa3: 56 push %esi
80102aa4: 53 push %ebx
struct buf *buf = bread(log.dev, log.start);
80102aa5: 83 ec 08 sub $0x8,%esp
80102aa8: ff 35 b4 26 11 80 pushl 0x801126b4
80102aae: ff 35 c4 26 11 80 pushl 0x801126c4
80102ab4: e8 17 d6 ff ff call 801000d0 <bread>
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
80102ab9: 8b 1d c8 26 11 80 mov 0x801126c8,%ebx
for (i = 0; i < log.lh.n; i++) {
80102abf: 83 c4 10 add $0x10,%esp
struct buf *buf = bread(log.dev, log.start);
80102ac2: 89 c6 mov %eax,%esi
for (i = 0; i < log.lh.n; i++) {
80102ac4: 85 db test %ebx,%ebx
hb->n = log.lh.n;
80102ac6: 89 58 5c mov %ebx,0x5c(%eax)
for (i = 0; i < log.lh.n; i++) {
80102ac9: 7e 16 jle 80102ae1 <write_head+0x41>
80102acb: c1 e3 02 shl $0x2,%ebx
80102ace: 31 d2 xor %edx,%edx
hb->block[i] = log.lh.block[i];
80102ad0: 8b 8a cc 26 11 80 mov -0x7feed934(%edx),%ecx
80102ad6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1)
80102ada: 83 c2 04 add $0x4,%edx
for (i = 0; i < log.lh.n; i++) {
80102add: 39 da cmp %ebx,%edx
80102adf: 75 ef jne 80102ad0 <write_head+0x30>
}
bwrite(buf);
80102ae1: 83 ec 0c sub $0xc,%esp
80102ae4: 56 push %esi
80102ae5: e8 b6 d6 ff ff call 801001a0 <bwrite>
brelse(buf);
80102aea: 89 34 24 mov %esi,(%esp)
80102aed: e8 ee d6 ff ff call 801001e0 <brelse>
}
80102af2: 83 c4 10 add $0x10,%esp
80102af5: 8d 65 f8 lea -0x8(%ebp),%esp
80102af8: 5b pop %ebx
80102af9: 5e pop %esi
80102afa: 5d pop %ebp
80102afb: c3 ret
80102afc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102b00 <initlog>:
{
80102b00: 55 push %ebp
80102b01: 89 e5 mov %esp,%ebp
80102b03: 53 push %ebx
80102b04: 83 ec 2c sub $0x2c,%esp
80102b07: 8b 5d 08 mov 0x8(%ebp),%ebx
initlock(&log.lock, "log");
80102b0a: 68 40 74 10 80 push $0x80107440
80102b0f: 68 80 26 11 80 push $0x80112680
80102b14: e8 87 17 00 00 call 801042a0 <initlock>
readsb(dev, &sb);
80102b19: 58 pop %eax
80102b1a: 8d 45 dc lea -0x24(%ebp),%eax
80102b1d: 5a pop %edx
80102b1e: 50 push %eax
80102b1f: 53 push %ebx
80102b20: e8 1b e9 ff ff call 80101440 <readsb>
log.size = sb.nlog;
80102b25: 8b 55 e8 mov -0x18(%ebp),%edx
log.start = sb.logstart;
80102b28: 8b 45 ec mov -0x14(%ebp),%eax
struct buf *buf = bread(log.dev, log.start);
80102b2b: 59 pop %ecx
log.dev = dev;
80102b2c: 89 1d c4 26 11 80 mov %ebx,0x801126c4
log.size = sb.nlog;
80102b32: 89 15 b8 26 11 80 mov %edx,0x801126b8
log.start = sb.logstart;
80102b38: a3 b4 26 11 80 mov %eax,0x801126b4
struct buf *buf = bread(log.dev, log.start);
80102b3d: 5a pop %edx
80102b3e: 50 push %eax
80102b3f: 53 push %ebx
80102b40: e8 8b d5 ff ff call 801000d0 <bread>
log.lh.n = lh->n;
80102b45: 8b 58 5c mov 0x5c(%eax),%ebx
for (i = 0; i < log.lh.n; i++) {
80102b48: 83 c4 10 add $0x10,%esp
80102b4b: 85 db test %ebx,%ebx
log.lh.n = lh->n;
80102b4d: 89 1d c8 26 11 80 mov %ebx,0x801126c8
for (i = 0; i < log.lh.n; i++) {
80102b53: 7e 1c jle 80102b71 <initlog+0x71>
80102b55: c1 e3 02 shl $0x2,%ebx
80102b58: 31 d2 xor %edx,%edx
80102b5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
log.lh.block[i] = lh->block[i];
80102b60: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx
80102b64: 83 c2 04 add $0x4,%edx
80102b67: 89 8a c8 26 11 80 mov %ecx,-0x7feed938(%edx)
for (i = 0; i < log.lh.n; i++) {
80102b6d: 39 d3 cmp %edx,%ebx
80102b6f: 75 ef jne 80102b60 <initlog+0x60>
brelse(buf);
80102b71: 83 ec 0c sub $0xc,%esp
80102b74: 50 push %eax
80102b75: e8 66 d6 ff ff call 801001e0 <brelse>
static void
recover_from_log(void)
{
read_head();
install_trans(); // if committed, copy from log to disk
80102b7a: e8 81 fe ff ff call 80102a00 <install_trans>
log.lh.n = 0;
80102b7f: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8
80102b86: 00 00 00
write_head(); // clear the log
80102b89: e8 12 ff ff ff call 80102aa0 <write_head>
}
80102b8e: 83 c4 10 add $0x10,%esp
80102b91: 8b 5d fc mov -0x4(%ebp),%ebx
80102b94: c9 leave
80102b95: c3 ret
80102b96: 8d 76 00 lea 0x0(%esi),%esi
80102b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102ba0 <begin_op>:
}
// called at the start of each FS system call.
void
begin_op(void)
{
80102ba0: 55 push %ebp
80102ba1: 89 e5 mov %esp,%ebp
80102ba3: 83 ec 14 sub $0x14,%esp
acquire(&log.lock);
80102ba6: 68 80 26 11 80 push $0x80112680
80102bab: e8 30 18 00 00 call 801043e0 <acquire>
80102bb0: 83 c4 10 add $0x10,%esp
80102bb3: eb 18 jmp 80102bcd <begin_op+0x2d>
80102bb5: 8d 76 00 lea 0x0(%esi),%esi
while(1){
if(log.committing){
sleep(&log, &log.lock);
80102bb8: 83 ec 08 sub $0x8,%esp
80102bbb: 68 80 26 11 80 push $0x80112680
80102bc0: 68 80 26 11 80 push $0x80112680
80102bc5: e8 56 12 00 00 call 80103e20 <sleep>
80102bca: 83 c4 10 add $0x10,%esp
if(log.committing){
80102bcd: a1 c0 26 11 80 mov 0x801126c0,%eax
80102bd2: 85 c0 test %eax,%eax
80102bd4: 75 e2 jne 80102bb8 <begin_op+0x18>
} else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
80102bd6: a1 bc 26 11 80 mov 0x801126bc,%eax
80102bdb: 8b 15 c8 26 11 80 mov 0x801126c8,%edx
80102be1: 83 c0 01 add $0x1,%eax
80102be4: 8d 0c 80 lea (%eax,%eax,4),%ecx
80102be7: 8d 14 4a lea (%edx,%ecx,2),%edx
80102bea: 83 fa 1e cmp $0x1e,%edx
80102bed: 7f c9 jg 80102bb8 <begin_op+0x18>
// this op might exhaust log space; wait for commit.
sleep(&log, &log.lock);
} else {
log.outstanding += 1;
release(&log.lock);
80102bef: 83 ec 0c sub $0xc,%esp
log.outstanding += 1;
80102bf2: a3 bc 26 11 80 mov %eax,0x801126bc
release(&log.lock);
80102bf7: 68 80 26 11 80 push $0x80112680
80102bfc: e8 9f 18 00 00 call 801044a0 <release>
break;
}
}
}
80102c01: 83 c4 10 add $0x10,%esp
80102c04: c9 leave
80102c05: c3 ret
80102c06: 8d 76 00 lea 0x0(%esi),%esi
80102c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102c10 <end_op>:
// called at the end of each FS system call.
// commits if this was the last outstanding operation.
void
end_op(void)
{
80102c10: 55 push %ebp
80102c11: 89 e5 mov %esp,%ebp
80102c13: 57 push %edi
80102c14: 56 push %esi
80102c15: 53 push %ebx
80102c16: 83 ec 18 sub $0x18,%esp
int do_commit = 0;
acquire(&log.lock);
80102c19: 68 80 26 11 80 push $0x80112680
80102c1e: e8 bd 17 00 00 call 801043e0 <acquire>
log.outstanding -= 1;
80102c23: a1 bc 26 11 80 mov 0x801126bc,%eax
if(log.committing)
80102c28: 8b 35 c0 26 11 80 mov 0x801126c0,%esi
80102c2e: 83 c4 10 add $0x10,%esp
log.outstanding -= 1;
80102c31: 8d 58 ff lea -0x1(%eax),%ebx
if(log.committing)
80102c34: 85 f6 test %esi,%esi
log.outstanding -= 1;
80102c36: 89 1d bc 26 11 80 mov %ebx,0x801126bc
if(log.committing)
80102c3c: 0f 85 1a 01 00 00 jne 80102d5c <end_op+0x14c>
panic("log.committing");
if(log.outstanding == 0){
80102c42: 85 db test %ebx,%ebx
80102c44: 0f 85 ee 00 00 00 jne 80102d38 <end_op+0x128>
// begin_op() may be waiting for log space,
// and decrementing log.outstanding has decreased
// the amount of reserved space.
wakeup(&log);
}
release(&log.lock);
80102c4a: 83 ec 0c sub $0xc,%esp
log.committing = 1;
80102c4d: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0
80102c54: 00 00 00
release(&log.lock);
80102c57: 68 80 26 11 80 push $0x80112680
80102c5c: e8 3f 18 00 00 call 801044a0 <release>
}
static void
commit()
{
if (log.lh.n > 0) {
80102c61: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx
80102c67: 83 c4 10 add $0x10,%esp
80102c6a: 85 c9 test %ecx,%ecx
80102c6c: 0f 8e 85 00 00 00 jle 80102cf7 <end_op+0xe7>
struct buf *to = bread(log.dev, log.start+tail+1); // log block
80102c72: a1 b4 26 11 80 mov 0x801126b4,%eax
80102c77: 83 ec 08 sub $0x8,%esp
80102c7a: 01 d8 add %ebx,%eax
80102c7c: 83 c0 01 add $0x1,%eax
80102c7f: 50 push %eax
80102c80: ff 35 c4 26 11 80 pushl 0x801126c4
80102c86: e8 45 d4 ff ff call 801000d0 <bread>
80102c8b: 89 c6 mov %eax,%esi
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102c8d: 58 pop %eax
80102c8e: 5a pop %edx
80102c8f: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4)
80102c96: ff 35 c4 26 11 80 pushl 0x801126c4
for (tail = 0; tail < log.lh.n; tail++) {
80102c9c: 83 c3 01 add $0x1,%ebx
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102c9f: e8 2c d4 ff ff call 801000d0 <bread>
80102ca4: 89 c7 mov %eax,%edi
memmove(to->data, from->data, BSIZE);
80102ca6: 8d 40 5c lea 0x5c(%eax),%eax
80102ca9: 83 c4 0c add $0xc,%esp
80102cac: 68 00 02 00 00 push $0x200
80102cb1: 50 push %eax
80102cb2: 8d 46 5c lea 0x5c(%esi),%eax
80102cb5: 50 push %eax
80102cb6: e8 e5 18 00 00 call 801045a0 <memmove>
bwrite(to); // write the log
80102cbb: 89 34 24 mov %esi,(%esp)
80102cbe: e8 dd d4 ff ff call 801001a0 <bwrite>
brelse(from);
80102cc3: 89 3c 24 mov %edi,(%esp)
80102cc6: e8 15 d5 ff ff call 801001e0 <brelse>
brelse(to);
80102ccb: 89 34 24 mov %esi,(%esp)
80102cce: e8 0d d5 ff ff call 801001e0 <brelse>
for (tail = 0; tail < log.lh.n; tail++) {
80102cd3: 83 c4 10 add $0x10,%esp
80102cd6: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx
80102cdc: 7c 94 jl 80102c72 <end_op+0x62>
write_log(); // Write modified blocks from cache to log
write_head(); // Write header to disk -- the real commit
80102cde: e8 bd fd ff ff call 80102aa0 <write_head>
install_trans(); // Now install writes to home locations
80102ce3: e8 18 fd ff ff call 80102a00 <install_trans>
log.lh.n = 0;
80102ce8: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8
80102cef: 00 00 00
write_head(); // Erase the transaction from the log
80102cf2: e8 a9 fd ff ff call 80102aa0 <write_head>
acquire(&log.lock);
80102cf7: 83 ec 0c sub $0xc,%esp
80102cfa: 68 80 26 11 80 push $0x80112680
80102cff: e8 dc 16 00 00 call 801043e0 <acquire>
wakeup(&log);
80102d04: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
log.committing = 0;
80102d0b: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0
80102d12: 00 00 00
wakeup(&log);
80102d15: e8 b6 12 00 00 call 80103fd0 <wakeup>
release(&log.lock);
80102d1a: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102d21: e8 7a 17 00 00 call 801044a0 <release>
80102d26: 83 c4 10 add $0x10,%esp
}
80102d29: 8d 65 f4 lea -0xc(%ebp),%esp
80102d2c: 5b pop %ebx
80102d2d: 5e pop %esi
80102d2e: 5f pop %edi
80102d2f: 5d pop %ebp
80102d30: c3 ret
80102d31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
wakeup(&log);
80102d38: 83 ec 0c sub $0xc,%esp
80102d3b: 68 80 26 11 80 push $0x80112680
80102d40: e8 8b 12 00 00 call 80103fd0 <wakeup>
release(&log.lock);
80102d45: c7 04 24 80 26 11 80 movl $0x80112680,(%esp)
80102d4c: e8 4f 17 00 00 call 801044a0 <release>
80102d51: 83 c4 10 add $0x10,%esp
}
80102d54: 8d 65 f4 lea -0xc(%ebp),%esp
80102d57: 5b pop %ebx
80102d58: 5e pop %esi
80102d59: 5f pop %edi
80102d5a: 5d pop %ebp
80102d5b: c3 ret
panic("log.committing");
80102d5c: 83 ec 0c sub $0xc,%esp
80102d5f: 68 44 74 10 80 push $0x80107444
80102d64: e8 27 d6 ff ff call 80100390 <panic>
80102d69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102d70 <log_write>:
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
80102d70: 55 push %ebp
80102d71: 89 e5 mov %esp,%ebp
80102d73: 53 push %ebx
80102d74: 83 ec 04 sub $0x4,%esp
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80102d77: 8b 15 c8 26 11 80 mov 0x801126c8,%edx
{
80102d7d: 8b 5d 08 mov 0x8(%ebp),%ebx
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80102d80: 83 fa 1d cmp $0x1d,%edx
80102d83: 0f 8f 9d 00 00 00 jg 80102e26 <log_write+0xb6>
80102d89: a1 b8 26 11 80 mov 0x801126b8,%eax
80102d8e: 83 e8 01 sub $0x1,%eax
80102d91: 39 c2 cmp %eax,%edx
80102d93: 0f 8d 8d 00 00 00 jge 80102e26 <log_write+0xb6>
panic("too big a transaction");
if (log.outstanding < 1)
80102d99: a1 bc 26 11 80 mov 0x801126bc,%eax
80102d9e: 85 c0 test %eax,%eax
80102da0: 0f 8e 8d 00 00 00 jle 80102e33 <log_write+0xc3>
panic("log_write outside of trans");
acquire(&log.lock);
80102da6: 83 ec 0c sub $0xc,%esp
80102da9: 68 80 26 11 80 push $0x80112680
80102dae: e8 2d 16 00 00 call 801043e0 <acquire>
for (i = 0; i < log.lh.n; i++) {
80102db3: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx
80102db9: 83 c4 10 add $0x10,%esp
80102dbc: 83 f9 00 cmp $0x0,%ecx
80102dbf: 7e 57 jle 80102e18 <log_write+0xa8>
if (log.lh.block[i] == b->blockno) // log absorbtion
80102dc1: 8b 53 08 mov 0x8(%ebx),%edx
for (i = 0; i < log.lh.n; i++) {
80102dc4: 31 c0 xor %eax,%eax
if (log.lh.block[i] == b->blockno) // log absorbtion
80102dc6: 3b 15 cc 26 11 80 cmp 0x801126cc,%edx
80102dcc: 75 0b jne 80102dd9 <log_write+0x69>
80102dce: eb 38 jmp 80102e08 <log_write+0x98>
80102dd0: 39 14 85 cc 26 11 80 cmp %edx,-0x7feed934(,%eax,4)
80102dd7: 74 2f je 80102e08 <log_write+0x98>
for (i = 0; i < log.lh.n; i++) {
80102dd9: 83 c0 01 add $0x1,%eax
80102ddc: 39 c1 cmp %eax,%ecx
80102dde: 75 f0 jne 80102dd0 <log_write+0x60>
break;
}
log.lh.block[i] = b->blockno;
80102de0: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4)
if (i == log.lh.n)
log.lh.n++;
80102de7: 83 c0 01 add $0x1,%eax
80102dea: a3 c8 26 11 80 mov %eax,0x801126c8
b->flags |= B_DIRTY; // prevent eviction
80102def: 83 0b 04 orl $0x4,(%ebx)
release(&log.lock);
80102df2: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp)
}
80102df9: 8b 5d fc mov -0x4(%ebp),%ebx
80102dfc: c9 leave
release(&log.lock);
80102dfd: e9 9e 16 00 00 jmp 801044a0 <release>
80102e02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
log.lh.block[i] = b->blockno;
80102e08: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4)
80102e0f: eb de jmp 80102def <log_write+0x7f>
80102e11: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102e18: 8b 43 08 mov 0x8(%ebx),%eax
80102e1b: a3 cc 26 11 80 mov %eax,0x801126cc
if (i == log.lh.n)
80102e20: 75 cd jne 80102def <log_write+0x7f>
80102e22: 31 c0 xor %eax,%eax
80102e24: eb c1 jmp 80102de7 <log_write+0x77>
panic("too big a transaction");
80102e26: 83 ec 0c sub $0xc,%esp
80102e29: 68 53 74 10 80 push $0x80107453
80102e2e: e8 5d d5 ff ff call 80100390 <panic>
panic("log_write outside of trans");
80102e33: 83 ec 0c sub $0xc,%esp
80102e36: 68 69 74 10 80 push $0x80107469
80102e3b: e8 50 d5 ff ff call 80100390 <panic>
80102e40 <mpmain>:
}
// Common CPU setup code.
static void
mpmain(void)
{
80102e40: 55 push %ebp
80102e41: 89 e5 mov %esp,%ebp
80102e43: 53 push %ebx
80102e44: 83 ec 04 sub $0x4,%esp
cprintf("cpu%d: starting %d\n", cpuid(), cpuid());
80102e47: e8 74 09 00 00 call 801037c0 <cpuid>
80102e4c: 89 c3 mov %eax,%ebx
80102e4e: e8 6d 09 00 00 call 801037c0 <cpuid>
80102e53: 83 ec 04 sub $0x4,%esp
80102e56: 53 push %ebx
80102e57: 50 push %eax
80102e58: 68 84 74 10 80 push $0x80107484
80102e5d: e8 fe d7 ff ff call 80100660 <cprintf>
idtinit(); // load idt register
80102e62: e8 49 29 00 00 call 801057b0 <idtinit>
xchg(&(mycpu()->started), 1); // tell startothers() we're up
80102e67: e8 d4 08 00 00 call 80103740 <mycpu>
80102e6c: 89 c2 mov %eax,%edx
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
80102e6e: b8 01 00 00 00 mov $0x1,%eax
80102e73: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx)
scheduler(); // start running processes
80102e7a: e8 21 0c 00 00 call 80103aa0 <scheduler>
80102e7f: 90 nop
80102e80 <mpenter>:
{
80102e80: 55 push %ebp
80102e81: 89 e5 mov %esp,%ebp
80102e83: 83 ec 08 sub $0x8,%esp
switchkvm();
80102e86: e8 15 3a 00 00 call 801068a0 <switchkvm>
seginit();
80102e8b: e8 f0 38 00 00 call 80106780 <seginit>
lapicinit();
80102e90: e8 9b f7 ff ff call 80102630 <lapicinit>
mpmain();
80102e95: e8 a6 ff ff ff call 80102e40 <mpmain>
80102e9a: 66 90 xchg %ax,%ax
80102e9c: 66 90 xchg %ax,%ax
80102e9e: 66 90 xchg %ax,%ax
80102ea0 <main>:
{
80102ea0: 8d 4c 24 04 lea 0x4(%esp),%ecx
80102ea4: 83 e4 f0 and $0xfffffff0,%esp
80102ea7: ff 71 fc pushl -0x4(%ecx)
80102eaa: 55 push %ebp
80102eab: 89 e5 mov %esp,%ebp
80102ead: 53 push %ebx
80102eae: 51 push %ecx
kinit1(end, P2V(4*1024*1024)); // phys page allocator
80102eaf: 83 ec 08 sub $0x8,%esp
80102eb2: 68 00 00 40 80 push $0x80400000
80102eb7: 68 a8 54 11 80 push $0x801154a8
80102ebc: e8 2f f5 ff ff call 801023f0 <kinit1>
kvmalloc(); // kernel page table
80102ec1: e8 9a 3e 00 00 call 80106d60 <kvmalloc>
mpinit(); // detect other processors
80102ec6: e8 75 01 00 00 call 80103040 <mpinit>
lapicinit(); // interrupt controller
80102ecb: e8 60 f7 ff ff call 80102630 <lapicinit>
seginit(); // segment descriptors
80102ed0: e8 ab 38 00 00 call 80106780 <seginit>
picinit(); // disable pic
80102ed5: e8 46 03 00 00 call 80103220 <picinit>
ioapicinit(); // another interrupt controller
80102eda: e8 41 f3 ff ff call 80102220 <ioapicinit>
consoleinit(); // console hardware
80102edf: e8 dc da ff ff call 801009c0 <consoleinit>
uartinit(); // serial port
80102ee4: e8 f7 2b 00 00 call 80105ae0 <uartinit>
pinit(); // process table
80102ee9: e8 32 08 00 00 call 80103720 <pinit>
tvinit(); // trap vectors
80102eee: e8 3d 28 00 00 call 80105730 <tvinit>
binit(); // buffer cache
80102ef3: e8 48 d1 ff ff call 80100040 <binit>
fileinit(); // file table
80102ef8: e8 63 de ff ff call 80100d60 <fileinit>
ideinit(); // disk
80102efd: e8 fe f0 ff ff call 80102000 <ideinit>
// Write entry code to unused memory at 0x7000.
// The linker has placed the image of entryother.S in
// _binary_entryother_start.
code = P2V(0x7000);
memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
80102f02: 83 c4 0c add $0xc,%esp
80102f05: 68 8a 00 00 00 push $0x8a
80102f0a: 68 8c a4 10 80 push $0x8010a48c
80102f0f: 68 00 70 00 80 push $0x80007000
80102f14: e8 87 16 00 00 call 801045a0 <memmove>
for(c = cpus; c < cpus+ncpu; c++){
80102f19: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax
80102f20: 00 00 00
80102f23: 83 c4 10 add $0x10,%esp
80102f26: 05 80 27 11 80 add $0x80112780,%eax
80102f2b: 3d 80 27 11 80 cmp $0x80112780,%eax
80102f30: 76 71 jbe 80102fa3 <main+0x103>
80102f32: bb 80 27 11 80 mov $0x80112780,%ebx
80102f37: 89 f6 mov %esi,%esi
80102f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(c == mycpu()) // We've started already.
80102f40: e8 fb 07 00 00 call 80103740 <mycpu>
80102f45: 39 d8 cmp %ebx,%eax
80102f47: 74 41 je 80102f8a <main+0xea>
continue;
// Tell entryother.S what stack to use, where to enter, and what
// pgdir to use. We cannot use kpgdir yet, because the AP processor
// is running in low memory, so we use entrypgdir for the APs too.
stack = kalloc();
80102f49: e8 72 f5 ff ff call 801024c0 <kalloc>
*(void**)(code-4) = stack + KSTACKSIZE;
80102f4e: 05 00 10 00 00 add $0x1000,%eax
*(void(**)(void))(code-8) = mpenter;
80102f53: c7 05 f8 6f 00 80 80 movl $0x80102e80,0x80006ff8
80102f5a: 2e 10 80
*(int**)(code-12) = (void *) V2P(entrypgdir);
80102f5d: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4
80102f64: 90 10 00
*(void**)(code-4) = stack + KSTACKSIZE;
80102f67: a3 fc 6f 00 80 mov %eax,0x80006ffc
lapicstartap(c->apicid, V2P(code));
80102f6c: 0f b6 03 movzbl (%ebx),%eax
80102f6f: 83 ec 08 sub $0x8,%esp
80102f72: 68 00 70 00 00 push $0x7000
80102f77: 50 push %eax
80102f78: e8 03 f8 ff ff call 80102780 <lapicstartap>
80102f7d: 83 c4 10 add $0x10,%esp
// wait for cpu to finish mpmain()
while(c->started == 0)
80102f80: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax
80102f86: 85 c0 test %eax,%eax
80102f88: 74 f6 je 80102f80 <main+0xe0>
for(c = cpus; c < cpus+ncpu; c++){
80102f8a: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax
80102f91: 00 00 00
80102f94: 81 c3 b0 00 00 00 add $0xb0,%ebx
80102f9a: 05 80 27 11 80 add $0x80112780,%eax
80102f9f: 39 c3 cmp %eax,%ebx
80102fa1: 72 9d jb 80102f40 <main+0xa0>
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
80102fa3: 83 ec 08 sub $0x8,%esp
80102fa6: 68 00 00 00 8e push $0x8e000000
80102fab: 68 00 00 40 80 push $0x80400000
80102fb0: e8 ab f4 ff ff call 80102460 <kinit2>
userinit(); // first user process
80102fb5: e8 56 08 00 00 call 80103810 <userinit>
mpmain(); // finish this processor's setup
80102fba: e8 81 fe ff ff call 80102e40 <mpmain>
80102fbf: 90 nop
80102fc0 <mpsearch1>:
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
80102fc0: 55 push %ebp
80102fc1: 89 e5 mov %esp,%ebp
80102fc3: 57 push %edi
80102fc4: 56 push %esi
uchar *e, *p, *addr;
addr = P2V(a);
80102fc5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi
{
80102fcb: 53 push %ebx
e = addr+len;
80102fcc: 8d 1c 16 lea (%esi,%edx,1),%ebx
{
80102fcf: 83 ec 0c sub $0xc,%esp
for(p = addr; p < e; p += sizeof(struct mp))
80102fd2: 39 de cmp %ebx,%esi
80102fd4: 72 10 jb 80102fe6 <mpsearch1+0x26>
80102fd6: eb 50 jmp 80103028 <mpsearch1+0x68>
80102fd8: 90 nop
80102fd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102fe0: 39 fb cmp %edi,%ebx
80102fe2: 89 fe mov %edi,%esi
80102fe4: 76 42 jbe 80103028 <mpsearch1+0x68>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80102fe6: 83 ec 04 sub $0x4,%esp
80102fe9: 8d 7e 10 lea 0x10(%esi),%edi
80102fec: 6a 04 push $0x4
80102fee: 68 98 74 10 80 push $0x80107498
80102ff3: 56 push %esi
80102ff4: e8 47 15 00 00 call 80104540 <memcmp>
80102ff9: 83 c4 10 add $0x10,%esp
80102ffc: 85 c0 test %eax,%eax
80102ffe: 75 e0 jne 80102fe0 <mpsearch1+0x20>
80103000: 89 f1 mov %esi,%ecx
80103002: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
sum += addr[i];
80103008: 0f b6 11 movzbl (%ecx),%edx
8010300b: 83 c1 01 add $0x1,%ecx
8010300e: 01 d0 add %edx,%eax
for(i=0; i<len; i++)
80103010: 39 f9 cmp %edi,%ecx
80103012: 75 f4 jne 80103008 <mpsearch1+0x48>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80103014: 84 c0 test %al,%al
80103016: 75 c8 jne 80102fe0 <mpsearch1+0x20>
return (struct mp*)p;
return 0;
}
80103018: 8d 65 f4 lea -0xc(%ebp),%esp
8010301b: 89 f0 mov %esi,%eax
8010301d: 5b pop %ebx
8010301e: 5e pop %esi
8010301f: 5f pop %edi
80103020: 5d pop %ebp
80103021: c3 ret
80103022: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103028: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
8010302b: 31 f6 xor %esi,%esi
}
8010302d: 89 f0 mov %esi,%eax
8010302f: 5b pop %ebx
80103030: 5e pop %esi
80103031: 5f pop %edi
80103032: 5d pop %ebp
80103033: c3 ret
80103034: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010303a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80103040 <mpinit>:
return conf;
}
void
mpinit(void)
{
80103040: 55 push %ebp
80103041: 89 e5 mov %esp,%ebp
80103043: 57 push %edi
80103044: 56 push %esi
80103045: 53 push %ebx
80103046: 83 ec 1c sub $0x1c,%esp
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80103049: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax
80103050: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx
80103057: c1 e0 08 shl $0x8,%eax
8010305a: 09 d0 or %edx,%eax
8010305c: c1 e0 04 shl $0x4,%eax
8010305f: 85 c0 test %eax,%eax
80103061: 75 1b jne 8010307e <mpinit+0x3e>
p = ((bda[0x14]<<8)|bda[0x13])*1024;
80103063: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax
8010306a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx
80103071: c1 e0 08 shl $0x8,%eax
80103074: 09 d0 or %edx,%eax
80103076: c1 e0 0a shl $0xa,%eax
if((mp = mpsearch1(p-1024, 1024)))
80103079: 2d 00 04 00 00 sub $0x400,%eax
if((mp = mpsearch1(p, 1024)))
8010307e: ba 00 04 00 00 mov $0x400,%edx
80103083: e8 38 ff ff ff call 80102fc0 <mpsearch1>
80103088: 85 c0 test %eax,%eax
8010308a: 89 45 e4 mov %eax,-0x1c(%ebp)
8010308d: 0f 84 3d 01 00 00 je 801031d0 <mpinit+0x190>
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
80103093: 8b 45 e4 mov -0x1c(%ebp),%eax
80103096: 8b 58 04 mov 0x4(%eax),%ebx
80103099: 85 db test %ebx,%ebx
8010309b: 0f 84 4f 01 00 00 je 801031f0 <mpinit+0x1b0>
conf = (struct mpconf*) P2V((uint) mp->physaddr);
801030a1: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi
if(memcmp(conf, "PCMP", 4) != 0)
801030a7: 83 ec 04 sub $0x4,%esp
801030aa: 6a 04 push $0x4
801030ac: 68 b5 74 10 80 push $0x801074b5
801030b1: 56 push %esi
801030b2: e8 89 14 00 00 call 80104540 <memcmp>
801030b7: 83 c4 10 add $0x10,%esp
801030ba: 85 c0 test %eax,%eax
801030bc: 0f 85 2e 01 00 00 jne 801031f0 <mpinit+0x1b0>
if(conf->version != 1 && conf->version != 4)
801030c2: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax
801030c9: 3c 01 cmp $0x1,%al
801030cb: 0f 95 c2 setne %dl
801030ce: 3c 04 cmp $0x4,%al
801030d0: 0f 95 c0 setne %al
801030d3: 20 c2 and %al,%dl
801030d5: 0f 85 15 01 00 00 jne 801031f0 <mpinit+0x1b0>
if(sum((uchar*)conf, conf->length) != 0)
801030db: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi
for(i=0; i<len; i++)
801030e2: 66 85 ff test %di,%di
801030e5: 74 1a je 80103101 <mpinit+0xc1>
801030e7: 89 f0 mov %esi,%eax
801030e9: 01 f7 add %esi,%edi
sum = 0;
801030eb: 31 d2 xor %edx,%edx
801030ed: 8d 76 00 lea 0x0(%esi),%esi
sum += addr[i];
801030f0: 0f b6 08 movzbl (%eax),%ecx
801030f3: 83 c0 01 add $0x1,%eax
801030f6: 01 ca add %ecx,%edx
for(i=0; i<len; i++)
801030f8: 39 c7 cmp %eax,%edi
801030fa: 75 f4 jne 801030f0 <mpinit+0xb0>
801030fc: 84 d2 test %dl,%dl
801030fe: 0f 95 c2 setne %dl
struct mp *mp;
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
if((conf = mpconfig(&mp)) == 0)
80103101: 85 f6 test %esi,%esi
80103103: 0f 84 e7 00 00 00 je 801031f0 <mpinit+0x1b0>
80103109: 84 d2 test %dl,%dl
8010310b: 0f 85 df 00 00 00 jne 801031f0 <mpinit+0x1b0>
panic("Expect to run on an SMP");
ismp = 1;
lapic = (uint*)conf->lapicaddr;
80103111: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax
80103117: a3 7c 26 11 80 mov %eax,0x8011267c
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
8010311c: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx
80103123: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax
ismp = 1;
80103129: bb 01 00 00 00 mov $0x1,%ebx
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
8010312e: 01 d6 add %edx,%esi
80103130: 39 c6 cmp %eax,%esi
80103132: 76 23 jbe 80103157 <mpinit+0x117>
switch(*p){
80103134: 0f b6 10 movzbl (%eax),%edx
80103137: 80 fa 04 cmp $0x4,%dl
8010313a: 0f 87 ca 00 00 00 ja 8010320a <mpinit+0x1ca>
80103140: ff 24 95 dc 74 10 80 jmp *-0x7fef8b24(,%edx,4)
80103147: 89 f6 mov %esi,%esi
80103149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p += sizeof(struct mpioapic);
continue;
case MPBUS:
case MPIOINTR:
case MPLINTR:
p += 8;
80103150: 83 c0 08 add $0x8,%eax
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80103153: 39 c6 cmp %eax,%esi
80103155: 77 dd ja 80103134 <mpinit+0xf4>
default:
ismp = 0;
break;
}
}
if(!ismp)
80103157: 85 db test %ebx,%ebx
80103159: 0f 84 9e 00 00 00 je 801031fd <mpinit+0x1bd>
panic("Didn't find a suitable machine");
if(mp->imcrp){
8010315f: 8b 45 e4 mov -0x1c(%ebp),%eax
80103162: 80 78 0c 00 cmpb $0x0,0xc(%eax)
80103166: 74 15 je 8010317d <mpinit+0x13d>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103168: b8 70 00 00 00 mov $0x70,%eax
8010316d: ba 22 00 00 00 mov $0x22,%edx
80103172: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80103173: ba 23 00 00 00 mov $0x23,%edx
80103178: ec in (%dx),%al
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb(0x22, 0x70); // Select IMCR
outb(0x23, inb(0x23) | 1); // Mask external interrupts.
80103179: 83 c8 01 or $0x1,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010317c: ee out %al,(%dx)
}
}
8010317d: 8d 65 f4 lea -0xc(%ebp),%esp
80103180: 5b pop %ebx
80103181: 5e pop %esi
80103182: 5f pop %edi
80103183: 5d pop %ebp
80103184: c3 ret
80103185: 8d 76 00 lea 0x0(%esi),%esi
if(ncpu < NCPU) {
80103188: 8b 0d 00 2d 11 80 mov 0x80112d00,%ecx
8010318e: 83 f9 07 cmp $0x7,%ecx
80103191: 7f 19 jg 801031ac <mpinit+0x16c>
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
80103193: 0f b6 50 01 movzbl 0x1(%eax),%edx
80103197: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi
ncpu++;
8010319d: 83 c1 01 add $0x1,%ecx
801031a0: 89 0d 00 2d 11 80 mov %ecx,0x80112d00
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
801031a6: 88 97 80 27 11 80 mov %dl,-0x7feed880(%edi)
p += sizeof(struct mpproc);
801031ac: 83 c0 14 add $0x14,%eax
continue;
801031af: e9 7c ff ff ff jmp 80103130 <mpinit+0xf0>
801031b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ioapicid = ioapic->apicno;
801031b8: 0f b6 50 01 movzbl 0x1(%eax),%edx
p += sizeof(struct mpioapic);
801031bc: 83 c0 08 add $0x8,%eax
ioapicid = ioapic->apicno;
801031bf: 88 15 60 27 11 80 mov %dl,0x80112760
continue;
801031c5: e9 66 ff ff ff jmp 80103130 <mpinit+0xf0>
801031ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return mpsearch1(0xF0000, 0x10000);
801031d0: ba 00 00 01 00 mov $0x10000,%edx
801031d5: b8 00 00 0f 00 mov $0xf0000,%eax
801031da: e8 e1 fd ff ff call 80102fc0 <mpsearch1>
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801031df: 85 c0 test %eax,%eax
return mpsearch1(0xF0000, 0x10000);
801031e1: 89 45 e4 mov %eax,-0x1c(%ebp)
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801031e4: 0f 85 a9 fe ff ff jne 80103093 <mpinit+0x53>
801031ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
panic("Expect to run on an SMP");
801031f0: 83 ec 0c sub $0xc,%esp
801031f3: 68 9d 74 10 80 push $0x8010749d
801031f8: e8 93 d1 ff ff call 80100390 <panic>
panic("Didn't find a suitable machine");
801031fd: 83 ec 0c sub $0xc,%esp
80103200: 68 bc 74 10 80 push $0x801074bc
80103205: e8 86 d1 ff ff call 80100390 <panic>
ismp = 0;
8010320a: 31 db xor %ebx,%ebx
8010320c: e9 26 ff ff ff jmp 80103137 <mpinit+0xf7>
80103211: 66 90 xchg %ax,%ax
80103213: 66 90 xchg %ax,%ax
80103215: 66 90 xchg %ax,%ax
80103217: 66 90 xchg %ax,%ax
80103219: 66 90 xchg %ax,%ax
8010321b: 66 90 xchg %ax,%ax
8010321d: 66 90 xchg %ax,%ax
8010321f: 90 nop
80103220 <picinit>:
#define IO_PIC2 0xA0 // Slave (IRQs 8-15)
// Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware.
void
picinit(void)
{
80103220: 55 push %ebp
80103221: b8 ff ff ff ff mov $0xffffffff,%eax
80103226: ba 21 00 00 00 mov $0x21,%edx
8010322b: 89 e5 mov %esp,%ebp
8010322d: ee out %al,(%dx)
8010322e: ba a1 00 00 00 mov $0xa1,%edx
80103233: ee out %al,(%dx)
// mask all interrupts
outb(IO_PIC1+1, 0xFF);
outb(IO_PIC2+1, 0xFF);
}
80103234: 5d pop %ebp
80103235: c3 ret
80103236: 66 90 xchg %ax,%ax
80103238: 66 90 xchg %ax,%ax
8010323a: 66 90 xchg %ax,%ax
8010323c: 66 90 xchg %ax,%ax
8010323e: 66 90 xchg %ax,%ax
80103240 <pipealloc>:
int writeopen; // write fd is still open
};
int
pipealloc(struct file **f0, struct file **f1)
{
80103240: 55 push %ebp
80103241: 89 e5 mov %esp,%ebp
80103243: 57 push %edi
80103244: 56 push %esi
80103245: 53 push %ebx
80103246: 83 ec 0c sub $0xc,%esp
80103249: 8b 5d 08 mov 0x8(%ebp),%ebx
8010324c: 8b 75 0c mov 0xc(%ebp),%esi
struct pipe *p;
p = 0;
*f0 = *f1 = 0;
8010324f: c7 06 00 00 00 00 movl $0x0,(%esi)
80103255: c7 03 00 00 00 00 movl $0x0,(%ebx)
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
8010325b: e8 20 db ff ff call 80100d80 <filealloc>
80103260: 85 c0 test %eax,%eax
80103262: 89 03 mov %eax,(%ebx)
80103264: 74 22 je 80103288 <pipealloc+0x48>
80103266: e8 15 db ff ff call 80100d80 <filealloc>
8010326b: 85 c0 test %eax,%eax
8010326d: 89 06 mov %eax,(%esi)
8010326f: 74 3f je 801032b0 <pipealloc+0x70>
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
80103271: e8 4a f2 ff ff call 801024c0 <kalloc>
80103276: 85 c0 test %eax,%eax
80103278: 89 c7 mov %eax,%edi
8010327a: 75 54 jne 801032d0 <pipealloc+0x90>
//PAGEBREAK: 20
bad:
if(p)
kfree((char*)p);
if(*f0)
8010327c: 8b 03 mov (%ebx),%eax
8010327e: 85 c0 test %eax,%eax
80103280: 75 34 jne 801032b6 <pipealloc+0x76>
80103282: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
fileclose(*f0);
if(*f1)
80103288: 8b 06 mov (%esi),%eax
8010328a: 85 c0 test %eax,%eax
8010328c: 74 0c je 8010329a <pipealloc+0x5a>
fileclose(*f1);
8010328e: 83 ec 0c sub $0xc,%esp
80103291: 50 push %eax
80103292: e8 a9 db ff ff call 80100e40 <fileclose>
80103297: 83 c4 10 add $0x10,%esp
return -1;
}
8010329a: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
8010329d: b8 ff ff ff ff mov $0xffffffff,%eax
}
801032a2: 5b pop %ebx
801032a3: 5e pop %esi
801032a4: 5f pop %edi
801032a5: 5d pop %ebp
801032a6: c3 ret
801032a7: 89 f6 mov %esi,%esi
801032a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(*f0)
801032b0: 8b 03 mov (%ebx),%eax
801032b2: 85 c0 test %eax,%eax
801032b4: 74 e4 je 8010329a <pipealloc+0x5a>
fileclose(*f0);
801032b6: 83 ec 0c sub $0xc,%esp
801032b9: 50 push %eax
801032ba: e8 81 db ff ff call 80100e40 <fileclose>
if(*f1)
801032bf: 8b 06 mov (%esi),%eax
fileclose(*f0);
801032c1: 83 c4 10 add $0x10,%esp
if(*f1)
801032c4: 85 c0 test %eax,%eax
801032c6: 75 c6 jne 8010328e <pipealloc+0x4e>
801032c8: eb d0 jmp 8010329a <pipealloc+0x5a>
801032ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
initlock(&p->lock, "pipe");
801032d0: 83 ec 08 sub $0x8,%esp
p->readopen = 1;
801032d3: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax)
801032da: 00 00 00
p->writeopen = 1;
801032dd: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax)
801032e4: 00 00 00
p->nwrite = 0;
801032e7: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax)
801032ee: 00 00 00
p->nread = 0;
801032f1: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax)
801032f8: 00 00 00
initlock(&p->lock, "pipe");
801032fb: 68 f0 74 10 80 push $0x801074f0
80103300: 50 push %eax
80103301: e8 9a 0f 00 00 call 801042a0 <initlock>
(*f0)->type = FD_PIPE;
80103306: 8b 03 mov (%ebx),%eax
return 0;
80103308: 83 c4 10 add $0x10,%esp
(*f0)->type = FD_PIPE;
8010330b: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f0)->readable = 1;
80103311: 8b 03 mov (%ebx),%eax
80103313: c6 40 08 01 movb $0x1,0x8(%eax)
(*f0)->writable = 0;
80103317: 8b 03 mov (%ebx),%eax
80103319: c6 40 09 00 movb $0x0,0x9(%eax)
(*f0)->pipe = p;
8010331d: 8b 03 mov (%ebx),%eax
8010331f: 89 78 0c mov %edi,0xc(%eax)
(*f1)->type = FD_PIPE;
80103322: 8b 06 mov (%esi),%eax
80103324: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f1)->readable = 0;
8010332a: 8b 06 mov (%esi),%eax
8010332c: c6 40 08 00 movb $0x0,0x8(%eax)
(*f1)->writable = 1;
80103330: 8b 06 mov (%esi),%eax
80103332: c6 40 09 01 movb $0x1,0x9(%eax)
(*f1)->pipe = p;
80103336: 8b 06 mov (%esi),%eax
80103338: 89 78 0c mov %edi,0xc(%eax)
}
8010333b: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
8010333e: 31 c0 xor %eax,%eax
}
80103340: 5b pop %ebx
80103341: 5e pop %esi
80103342: 5f pop %edi
80103343: 5d pop %ebp
80103344: c3 ret
80103345: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103350 <pipeclose>:
void
pipeclose(struct pipe *p, int writable)
{
80103350: 55 push %ebp
80103351: 89 e5 mov %esp,%ebp
80103353: 56 push %esi
80103354: 53 push %ebx
80103355: 8b 5d 08 mov 0x8(%ebp),%ebx
80103358: 8b 75 0c mov 0xc(%ebp),%esi
acquire(&p->lock);
8010335b: 83 ec 0c sub $0xc,%esp
8010335e: 53 push %ebx
8010335f: e8 7c 10 00 00 call 801043e0 <acquire>
if(writable){
80103364: 83 c4 10 add $0x10,%esp
80103367: 85 f6 test %esi,%esi
80103369: 74 45 je 801033b0 <pipeclose+0x60>
p->writeopen = 0;
wakeup(&p->nread);
8010336b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
80103371: 83 ec 0c sub $0xc,%esp
p->writeopen = 0;
80103374: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx)
8010337b: 00 00 00
wakeup(&p->nread);
8010337e: 50 push %eax
8010337f: e8 4c 0c 00 00 call 80103fd0 <wakeup>
80103384: 83 c4 10 add $0x10,%esp
} else {
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
80103387: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx
8010338d: 85 d2 test %edx,%edx
8010338f: 75 0a jne 8010339b <pipeclose+0x4b>
80103391: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax
80103397: 85 c0 test %eax,%eax
80103399: 74 35 je 801033d0 <pipeclose+0x80>
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
8010339b: 89 5d 08 mov %ebx,0x8(%ebp)
}
8010339e: 8d 65 f8 lea -0x8(%ebp),%esp
801033a1: 5b pop %ebx
801033a2: 5e pop %esi
801033a3: 5d pop %ebp
release(&p->lock);
801033a4: e9 f7 10 00 00 jmp 801044a0 <release>
801033a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
wakeup(&p->nwrite);
801033b0: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax
801033b6: 83 ec 0c sub $0xc,%esp
p->readopen = 0;
801033b9: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx)
801033c0: 00 00 00
wakeup(&p->nwrite);
801033c3: 50 push %eax
801033c4: e8 07 0c 00 00 call 80103fd0 <wakeup>
801033c9: 83 c4 10 add $0x10,%esp
801033cc: eb b9 jmp 80103387 <pipeclose+0x37>
801033ce: 66 90 xchg %ax,%ax
release(&p->lock);
801033d0: 83 ec 0c sub $0xc,%esp
801033d3: 53 push %ebx
801033d4: e8 c7 10 00 00 call 801044a0 <release>
kfree((char*)p);
801033d9: 89 5d 08 mov %ebx,0x8(%ebp)
801033dc: 83 c4 10 add $0x10,%esp
}
801033df: 8d 65 f8 lea -0x8(%ebp),%esp
801033e2: 5b pop %ebx
801033e3: 5e pop %esi
801033e4: 5d pop %ebp
kfree((char*)p);
801033e5: e9 26 ef ff ff jmp 80102310 <kfree>
801033ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801033f0 <pipewrite>:
//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
801033f0: 55 push %ebp
801033f1: 89 e5 mov %esp,%ebp
801033f3: 57 push %edi
801033f4: 56 push %esi
801033f5: 53 push %ebx
801033f6: 83 ec 28 sub $0x28,%esp
801033f9: 8b 5d 08 mov 0x8(%ebp),%ebx
int i;
acquire(&p->lock);
801033fc: 53 push %ebx
801033fd: e8 de 0f 00 00 call 801043e0 <acquire>
for(i = 0; i < n; i++){
80103402: 8b 45 10 mov 0x10(%ebp),%eax
80103405: 83 c4 10 add $0x10,%esp
80103408: 85 c0 test %eax,%eax
8010340a: 0f 8e c9 00 00 00 jle 801034d9 <pipewrite+0xe9>
80103410: 8b 4d 0c mov 0xc(%ebp),%ecx
80103413: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
if(p->readopen == 0 || myproc()->killed){
release(&p->lock);
return -1;
}
wakeup(&p->nread);
80103419: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi
8010341f: 89 4d e4 mov %ecx,-0x1c(%ebp)
80103422: 03 4d 10 add 0x10(%ebp),%ecx
80103425: 89 4d e0 mov %ecx,-0x20(%ebp)
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103428: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx
8010342e: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx
80103434: 39 d0 cmp %edx,%eax
80103436: 75 71 jne 801034a9 <pipewrite+0xb9>
if(p->readopen == 0 || myproc()->killed){
80103438: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax
8010343e: 85 c0 test %eax,%eax
80103440: 74 4e je 80103490 <pipewrite+0xa0>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
80103442: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi
80103448: eb 3a jmp 80103484 <pipewrite+0x94>
8010344a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
wakeup(&p->nread);
80103450: 83 ec 0c sub $0xc,%esp
80103453: 57 push %edi
80103454: e8 77 0b 00 00 call 80103fd0 <wakeup>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
80103459: 5a pop %edx
8010345a: 59 pop %ecx
8010345b: 53 push %ebx
8010345c: 56 push %esi
8010345d: e8 be 09 00 00 call 80103e20 <sleep>
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103462: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax
80103468: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx
8010346e: 83 c4 10 add $0x10,%esp
80103471: 05 00 02 00 00 add $0x200,%eax
80103476: 39 c2 cmp %eax,%edx
80103478: 75 36 jne 801034b0 <pipewrite+0xc0>
if(p->readopen == 0 || myproc()->killed){
8010347a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax
80103480: 85 c0 test %eax,%eax
80103482: 74 0c je 80103490 <pipewrite+0xa0>
80103484: e8 57 03 00 00 call 801037e0 <myproc>
80103489: 8b 40 24 mov 0x24(%eax),%eax
8010348c: 85 c0 test %eax,%eax
8010348e: 74 c0 je 80103450 <pipewrite+0x60>
release(&p->lock);
80103490: 83 ec 0c sub $0xc,%esp
80103493: 53 push %ebx
80103494: e8 07 10 00 00 call 801044a0 <release>
return -1;
80103499: 83 c4 10 add $0x10,%esp
8010349c: b8 ff ff ff ff mov $0xffffffff,%eax
p->data[p->nwrite++ % PIPESIZE] = addr[i];
}
wakeup(&p->nread); //DOC: pipewrite-wakeup1
release(&p->lock);
return n;
}
801034a1: 8d 65 f4 lea -0xc(%ebp),%esp
801034a4: 5b pop %ebx
801034a5: 5e pop %esi
801034a6: 5f pop %edi
801034a7: 5d pop %ebp
801034a8: c3 ret
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
801034a9: 89 c2 mov %eax,%edx
801034ab: 90 nop
801034ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
p->data[p->nwrite++ % PIPESIZE] = addr[i];
801034b0: 8b 75 e4 mov -0x1c(%ebp),%esi
801034b3: 8d 42 01 lea 0x1(%edx),%eax
801034b6: 81 e2 ff 01 00 00 and $0x1ff,%edx
801034bc: 89 83 38 02 00 00 mov %eax,0x238(%ebx)
801034c2: 83 c6 01 add $0x1,%esi
801034c5: 0f b6 4e ff movzbl -0x1(%esi),%ecx
for(i = 0; i < n; i++){
801034c9: 3b 75 e0 cmp -0x20(%ebp),%esi
801034cc: 89 75 e4 mov %esi,-0x1c(%ebp)
p->data[p->nwrite++ % PIPESIZE] = addr[i];
801034cf: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1)
for(i = 0; i < n; i++){
801034d3: 0f 85 4f ff ff ff jne 80103428 <pipewrite+0x38>
wakeup(&p->nread); //DOC: pipewrite-wakeup1
801034d9: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
801034df: 83 ec 0c sub $0xc,%esp
801034e2: 50 push %eax
801034e3: e8 e8 0a 00 00 call 80103fd0 <wakeup>
release(&p->lock);
801034e8: 89 1c 24 mov %ebx,(%esp)
801034eb: e8 b0 0f 00 00 call 801044a0 <release>
return n;
801034f0: 83 c4 10 add $0x10,%esp
801034f3: 8b 45 10 mov 0x10(%ebp),%eax
801034f6: eb a9 jmp 801034a1 <pipewrite+0xb1>
801034f8: 90 nop
801034f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103500 <piperead>:
int
piperead(struct pipe *p, char *addr, int n)
{
80103500: 55 push %ebp
80103501: 89 e5 mov %esp,%ebp
80103503: 57 push %edi
80103504: 56 push %esi
80103505: 53 push %ebx
80103506: 83 ec 18 sub $0x18,%esp
80103509: 8b 75 08 mov 0x8(%ebp),%esi
8010350c: 8b 7d 0c mov 0xc(%ebp),%edi
int i;
acquire(&p->lock);
8010350f: 56 push %esi
80103510: e8 cb 0e 00 00 call 801043e0 <acquire>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103515: 83 c4 10 add $0x10,%esp
80103518: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx
8010351e: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx
80103524: 75 6a jne 80103590 <piperead+0x90>
80103526: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx
8010352c: 85 db test %ebx,%ebx
8010352e: 0f 84 c4 00 00 00 je 801035f8 <piperead+0xf8>
if(myproc()->killed){
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
80103534: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx
8010353a: eb 2d jmp 80103569 <piperead+0x69>
8010353c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103540: 83 ec 08 sub $0x8,%esp
80103543: 56 push %esi
80103544: 53 push %ebx
80103545: e8 d6 08 00 00 call 80103e20 <sleep>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
8010354a: 83 c4 10 add $0x10,%esp
8010354d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx
80103553: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx
80103559: 75 35 jne 80103590 <piperead+0x90>
8010355b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx
80103561: 85 d2 test %edx,%edx
80103563: 0f 84 8f 00 00 00 je 801035f8 <piperead+0xf8>
if(myproc()->killed){
80103569: e8 72 02 00 00 call 801037e0 <myproc>
8010356e: 8b 48 24 mov 0x24(%eax),%ecx
80103571: 85 c9 test %ecx,%ecx
80103573: 74 cb je 80103540 <piperead+0x40>
release(&p->lock);
80103575: 83 ec 0c sub $0xc,%esp
return -1;
80103578: bb ff ff ff ff mov $0xffffffff,%ebx
release(&p->lock);
8010357d: 56 push %esi
8010357e: e8 1d 0f 00 00 call 801044a0 <release>
return -1;
80103583: 83 c4 10 add $0x10,%esp
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
release(&p->lock);
return i;
}
80103586: 8d 65 f4 lea -0xc(%ebp),%esp
80103589: 89 d8 mov %ebx,%eax
8010358b: 5b pop %ebx
8010358c: 5e pop %esi
8010358d: 5f pop %edi
8010358e: 5d pop %ebp
8010358f: c3 ret
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103590: 8b 45 10 mov 0x10(%ebp),%eax
80103593: 85 c0 test %eax,%eax
80103595: 7e 61 jle 801035f8 <piperead+0xf8>
if(p->nread == p->nwrite)
80103597: 31 db xor %ebx,%ebx
80103599: eb 13 jmp 801035ae <piperead+0xae>
8010359b: 90 nop
8010359c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801035a0: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx
801035a6: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx
801035ac: 74 1f je 801035cd <piperead+0xcd>
addr[i] = p->data[p->nread++ % PIPESIZE];
801035ae: 8d 41 01 lea 0x1(%ecx),%eax
801035b1: 81 e1 ff 01 00 00 and $0x1ff,%ecx
801035b7: 89 86 34 02 00 00 mov %eax,0x234(%esi)
801035bd: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax
801035c2: 88 04 1f mov %al,(%edi,%ebx,1)
for(i = 0; i < n; i++){ //DOC: piperead-copy
801035c5: 83 c3 01 add $0x1,%ebx
801035c8: 39 5d 10 cmp %ebx,0x10(%ebp)
801035cb: 75 d3 jne 801035a0 <piperead+0xa0>
wakeup(&p->nwrite); //DOC: piperead-wakeup
801035cd: 8d 86 38 02 00 00 lea 0x238(%esi),%eax
801035d3: 83 ec 0c sub $0xc,%esp
801035d6: 50 push %eax
801035d7: e8 f4 09 00 00 call 80103fd0 <wakeup>
release(&p->lock);
801035dc: 89 34 24 mov %esi,(%esp)
801035df: e8 bc 0e 00 00 call 801044a0 <release>
return i;
801035e4: 83 c4 10 add $0x10,%esp
}
801035e7: 8d 65 f4 lea -0xc(%ebp),%esp
801035ea: 89 d8 mov %ebx,%eax
801035ec: 5b pop %ebx
801035ed: 5e pop %esi
801035ee: 5f pop %edi
801035ef: 5d pop %ebp
801035f0: c3 ret
801035f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801035f8: 31 db xor %ebx,%ebx
801035fa: eb d1 jmp 801035cd <piperead+0xcd>
801035fc: 66 90 xchg %ax,%ax
801035fe: 66 90 xchg %ax,%ax
80103600 <allocproc>:
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc*
allocproc(void)
{
80103600: 55 push %ebp
80103601: 89 e5 mov %esp,%ebp
80103603: 53 push %ebx
struct proc *p;
char *sp;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103604: bb 54 2d 11 80 mov $0x80112d54,%ebx
{
80103609: 83 ec 10 sub $0x10,%esp
acquire(&ptable.lock);
8010360c: 68 20 2d 11 80 push $0x80112d20
80103611: e8 ca 0d 00 00 call 801043e0 <acquire>
80103616: 83 c4 10 add $0x10,%esp
80103619: eb 10 jmp 8010362b <allocproc+0x2b>
8010361b: 90 nop
8010361c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103620: 83 c3 7c add $0x7c,%ebx
80103623: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx
80103629: 73 75 jae 801036a0 <allocproc+0xa0>
if(p->state == UNUSED)
8010362b: 8b 43 0c mov 0xc(%ebx),%eax
8010362e: 85 c0 test %eax,%eax
80103630: 75 ee jne 80103620 <allocproc+0x20>
release(&ptable.lock);
return 0;
found:
p->state = EMBRYO;
p->pid = nextpid++;
80103632: a1 04 a0 10 80 mov 0x8010a004,%eax
release(&ptable.lock);
80103637: 83 ec 0c sub $0xc,%esp
p->state = EMBRYO;
8010363a: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx)
p->pid = nextpid++;
80103641: 8d 50 01 lea 0x1(%eax),%edx
80103644: 89 43 10 mov %eax,0x10(%ebx)
release(&ptable.lock);
80103647: 68 20 2d 11 80 push $0x80112d20
p->pid = nextpid++;
8010364c: 89 15 04 a0 10 80 mov %edx,0x8010a004
release(&ptable.lock);
80103652: e8 49 0e 00 00 call 801044a0 <release>
// Allocate kernel stack.
if((p->kstack = kalloc()) == 0){
80103657: e8 64 ee ff ff call 801024c0 <kalloc>
8010365c: 83 c4 10 add $0x10,%esp
8010365f: 85 c0 test %eax,%eax
80103661: 89 43 08 mov %eax,0x8(%ebx)
80103664: 74 53 je 801036b9 <allocproc+0xb9>
return 0;
}
sp = p->kstack + KSTACKSIZE;
// Leave room for trap frame.
sp -= sizeof *p->tf;
80103666: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx
sp -= 4;
*(uint*)sp = (uint)trapret;
sp -= sizeof *p->context;
p->context = (struct context*)sp;
memset(p->context, 0, sizeof *p->context);
8010366c: 83 ec 04 sub $0x4,%esp
sp -= sizeof *p->context;
8010366f: 05 9c 0f 00 00 add $0xf9c,%eax
sp -= sizeof *p->tf;
80103674: 89 53 18 mov %edx,0x18(%ebx)
*(uint*)sp = (uint)trapret;
80103677: c7 40 14 19 57 10 80 movl $0x80105719,0x14(%eax)
p->context = (struct context*)sp;
8010367e: 89 43 1c mov %eax,0x1c(%ebx)
memset(p->context, 0, sizeof *p->context);
80103681: 6a 14 push $0x14
80103683: 6a 00 push $0x0
80103685: 50 push %eax
80103686: e8 65 0e 00 00 call 801044f0 <memset>
p->context->eip = (uint)forkret;
8010368b: 8b 43 1c mov 0x1c(%ebx),%eax
return p;
8010368e: 83 c4 10 add $0x10,%esp
p->context->eip = (uint)forkret;
80103691: c7 40 10 d0 36 10 80 movl $0x801036d0,0x10(%eax)
}
80103698: 89 d8 mov %ebx,%eax
8010369a: 8b 5d fc mov -0x4(%ebp),%ebx
8010369d: c9 leave
8010369e: c3 ret
8010369f: 90 nop
release(&ptable.lock);
801036a0: 83 ec 0c sub $0xc,%esp
return 0;
801036a3: 31 db xor %ebx,%ebx
release(&ptable.lock);
801036a5: 68 20 2d 11 80 push $0x80112d20
801036aa: e8 f1 0d 00 00 call 801044a0 <release>
}
801036af: 89 d8 mov %ebx,%eax
return 0;
801036b1: 83 c4 10 add $0x10,%esp
}
801036b4: 8b 5d fc mov -0x4(%ebp),%ebx
801036b7: c9 leave
801036b8: c3 ret
p->state = UNUSED;
801036b9: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
return 0;
801036c0: 31 db xor %ebx,%ebx
801036c2: eb d4 jmp 80103698 <allocproc+0x98>
801036c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801036ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801036d0 <forkret>:
// A fork child's very first scheduling by scheduler()
// will swtch here. "Return" to user space.
void
forkret(void)
{
801036d0: 55 push %ebp
801036d1: 89 e5 mov %esp,%ebp
801036d3: 83 ec 14 sub $0x14,%esp
static int first = 1;
// Still holding ptable.lock from scheduler.
release(&ptable.lock);
801036d6: 68 20 2d 11 80 push $0x80112d20
801036db: e8 c0 0d 00 00 call 801044a0 <release>
if (first) {
801036e0: a1 00 a0 10 80 mov 0x8010a000,%eax
801036e5: 83 c4 10 add $0x10,%esp
801036e8: 85 c0 test %eax,%eax
801036ea: 75 04 jne 801036f0 <forkret+0x20>
iinit(ROOTDEV);
initlog(ROOTDEV);
}
// Return to "caller", actually trapret (see allocproc).
}
801036ec: c9 leave
801036ed: c3 ret
801036ee: 66 90 xchg %ax,%ax
iinit(ROOTDEV);
801036f0: 83 ec 0c sub $0xc,%esp
first = 0;
801036f3: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000
801036fa: 00 00 00
iinit(ROOTDEV);
801036fd: 6a 01 push $0x1
801036ff: e8 7c dd ff ff call 80101480 <iinit>
initlog(ROOTDEV);
80103704: c7 04 24 01 00 00 00 movl $0x1,(%esp)
8010370b: e8 f0 f3 ff ff call 80102b00 <initlog>
80103710: 83 c4 10 add $0x10,%esp
}
80103713: c9 leave
80103714: c3 ret
80103715: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103720 <pinit>:
{
80103720: 55 push %ebp
80103721: 89 e5 mov %esp,%ebp
80103723: 83 ec 10 sub $0x10,%esp
initlock(&ptable.lock, "ptable");
80103726: 68 f5 74 10 80 push $0x801074f5
8010372b: 68 20 2d 11 80 push $0x80112d20
80103730: e8 6b 0b 00 00 call 801042a0 <initlock>
}
80103735: 83 c4 10 add $0x10,%esp
80103738: c9 leave
80103739: c3 ret
8010373a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103740 <mycpu>:
{
80103740: 55 push %ebp
80103741: 89 e5 mov %esp,%ebp
80103743: 56 push %esi
80103744: 53 push %ebx
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103745: 9c pushf
80103746: 58 pop %eax
if(readeflags()&FL_IF)
80103747: f6 c4 02 test $0x2,%ah
8010374a: 75 5e jne 801037aa <mycpu+0x6a>
apicid = lapicid();
8010374c: e8 df ef ff ff call 80102730 <lapicid>
for (i = 0; i < ncpu; ++i) {
80103751: 8b 35 00 2d 11 80 mov 0x80112d00,%esi
80103757: 85 f6 test %esi,%esi
80103759: 7e 42 jle 8010379d <mycpu+0x5d>
if (cpus[i].apicid == apicid)
8010375b: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx
80103762: 39 d0 cmp %edx,%eax
80103764: 74 30 je 80103796 <mycpu+0x56>
80103766: b9 30 28 11 80 mov $0x80112830,%ecx
for (i = 0; i < ncpu; ++i) {
8010376b: 31 d2 xor %edx,%edx
8010376d: 8d 76 00 lea 0x0(%esi),%esi
80103770: 83 c2 01 add $0x1,%edx
80103773: 39 f2 cmp %esi,%edx
80103775: 74 26 je 8010379d <mycpu+0x5d>
if (cpus[i].apicid == apicid)
80103777: 0f b6 19 movzbl (%ecx),%ebx
8010377a: 81 c1 b0 00 00 00 add $0xb0,%ecx
80103780: 39 c3 cmp %eax,%ebx
80103782: 75 ec jne 80103770 <mycpu+0x30>
80103784: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax
8010378a: 05 80 27 11 80 add $0x80112780,%eax
}
8010378f: 8d 65 f8 lea -0x8(%ebp),%esp
80103792: 5b pop %ebx
80103793: 5e pop %esi
80103794: 5d pop %ebp
80103795: c3 ret
if (cpus[i].apicid == apicid)
80103796: b8 80 27 11 80 mov $0x80112780,%eax
return &cpus[i];
8010379b: eb f2 jmp 8010378f <mycpu+0x4f>
panic("unknown apicid\n");
8010379d: 83 ec 0c sub $0xc,%esp
801037a0: 68 fc 74 10 80 push $0x801074fc
801037a5: e8 e6 cb ff ff call 80100390 <panic>
panic("mycpu called with interrupts enabled\n");
801037aa: 83 ec 0c sub $0xc,%esp
801037ad: 68 d8 75 10 80 push $0x801075d8
801037b2: e8 d9 cb ff ff call 80100390 <panic>
801037b7: 89 f6 mov %esi,%esi
801037b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801037c0 <cpuid>:
cpuid() {
801037c0: 55 push %ebp
801037c1: 89 e5 mov %esp,%ebp
801037c3: 83 ec 08 sub $0x8,%esp
return mycpu()-cpus;
801037c6: e8 75 ff ff ff call 80103740 <mycpu>
801037cb: 2d 80 27 11 80 sub $0x80112780,%eax
}
801037d0: c9 leave
return mycpu()-cpus;
801037d1: c1 f8 04 sar $0x4,%eax
801037d4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax
}
801037da: c3 ret
801037db: 90 nop
801037dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801037e0 <myproc>:
myproc(void) {
801037e0: 55 push %ebp
801037e1: 89 e5 mov %esp,%ebp
801037e3: 53 push %ebx
801037e4: 83 ec 04 sub $0x4,%esp
pushcli();
801037e7: e8 24 0b 00 00 call 80104310 <pushcli>
c = mycpu();
801037ec: e8 4f ff ff ff call 80103740 <mycpu>
p = c->proc;
801037f1: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
801037f7: e8 54 0b 00 00 call 80104350 <popcli>
}
801037fc: 83 c4 04 add $0x4,%esp
801037ff: 89 d8 mov %ebx,%eax
80103801: 5b pop %ebx
80103802: 5d pop %ebp
80103803: c3 ret
80103804: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010380a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80103810 <userinit>:
{
80103810: 55 push %ebp
80103811: 89 e5 mov %esp,%ebp
80103813: 53 push %ebx
80103814: 83 ec 04 sub $0x4,%esp
p = allocproc();
80103817: e8 e4 fd ff ff call 80103600 <allocproc>
8010381c: 89 c3 mov %eax,%ebx
initproc = p;
8010381e: a3 b8 a5 10 80 mov %eax,0x8010a5b8
if((p->pgdir = setupkvm()) == 0)
80103823: e8 b8 34 00 00 call 80106ce0 <setupkvm>
80103828: 85 c0 test %eax,%eax
8010382a: 89 43 04 mov %eax,0x4(%ebx)
8010382d: 0f 84 bd 00 00 00 je 801038f0 <userinit+0xe0>
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
80103833: 83 ec 04 sub $0x4,%esp
80103836: 68 2c 00 00 00 push $0x2c
8010383b: 68 60 a4 10 80 push $0x8010a460
80103840: 50 push %eax
80103841: e8 8a 31 00 00 call 801069d0 <inituvm>
memset(p->tf, 0, sizeof(*p->tf));
80103846: 83 c4 0c add $0xc,%esp
p->sz = PGSIZE;
80103849: c7 03 00 10 00 00 movl $0x1000,(%ebx)
memset(p->tf, 0, sizeof(*p->tf));
8010384f: 6a 4c push $0x4c
80103851: 6a 00 push $0x0
80103853: ff 73 18 pushl 0x18(%ebx)
80103856: e8 95 0c 00 00 call 801044f0 <memset>
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
8010385b: 8b 43 18 mov 0x18(%ebx),%eax
8010385e: ba 1b 00 00 00 mov $0x1b,%edx
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103863: b9 23 00 00 00 mov $0x23,%ecx
safestrcpy(p->name, "initcode", sizeof(p->name));
80103868: 83 c4 0c add $0xc,%esp
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
8010386b: 66 89 50 3c mov %dx,0x3c(%eax)
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
8010386f: 8b 43 18 mov 0x18(%ebx),%eax
80103872: 66 89 48 2c mov %cx,0x2c(%eax)
p->tf->es = p->tf->ds;
80103876: 8b 43 18 mov 0x18(%ebx),%eax
80103879: 0f b7 50 2c movzwl 0x2c(%eax),%edx
8010387d: 66 89 50 28 mov %dx,0x28(%eax)
p->tf->ss = p->tf->ds;
80103881: 8b 43 18 mov 0x18(%ebx),%eax
80103884: 0f b7 50 2c movzwl 0x2c(%eax),%edx
80103888: 66 89 50 48 mov %dx,0x48(%eax)
p->tf->eflags = FL_IF;
8010388c: 8b 43 18 mov 0x18(%ebx),%eax
8010388f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax)
p->tf->esp = PGSIZE;
80103896: 8b 43 18 mov 0x18(%ebx),%eax
80103899: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax)
p->tf->eip = 0; // beginning of initcode.S
801038a0: 8b 43 18 mov 0x18(%ebx),%eax
801038a3: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax)
safestrcpy(p->name, "initcode", sizeof(p->name));
801038aa: 8d 43 6c lea 0x6c(%ebx),%eax
801038ad: 6a 10 push $0x10
801038af: 68 25 75 10 80 push $0x80107525
801038b4: 50 push %eax
801038b5: e8 16 0e 00 00 call 801046d0 <safestrcpy>
p->cwd = namei("/");
801038ba: c7 04 24 2e 75 10 80 movl $0x8010752e,(%esp)
801038c1: e8 1a e6 ff ff call 80101ee0 <namei>
801038c6: 89 43 68 mov %eax,0x68(%ebx)
acquire(&ptable.lock);
801038c9: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
801038d0: e8 0b 0b 00 00 call 801043e0 <acquire>
p->state = RUNNABLE;
801038d5: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx)
release(&ptable.lock);
801038dc: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
801038e3: e8 b8 0b 00 00 call 801044a0 <release>
}
801038e8: 83 c4 10 add $0x10,%esp
801038eb: 8b 5d fc mov -0x4(%ebp),%ebx
801038ee: c9 leave
801038ef: c3 ret
panic("userinit: out of memory?");
801038f0: 83 ec 0c sub $0xc,%esp
801038f3: 68 0c 75 10 80 push $0x8010750c
801038f8: e8 93 ca ff ff call 80100390 <panic>
801038fd: 8d 76 00 lea 0x0(%esi),%esi
80103900 <growproc>:
{
80103900: 55 push %ebp
80103901: 89 e5 mov %esp,%ebp
80103903: 56 push %esi
80103904: 53 push %ebx
80103905: 8b 75 08 mov 0x8(%ebp),%esi
pushcli();
80103908: e8 03 0a 00 00 call 80104310 <pushcli>
c = mycpu();
8010390d: e8 2e fe ff ff call 80103740 <mycpu>
p = c->proc;
80103912: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103918: e8 33 0a 00 00 call 80104350 <popcli>
if(n > 0){
8010391d: 83 fe 00 cmp $0x0,%esi
sz = curproc->sz;
80103920: 8b 03 mov (%ebx),%eax
if(n > 0){
80103922: 7f 1c jg 80103940 <growproc+0x40>
} else if(n < 0){
80103924: 75 3a jne 80103960 <growproc+0x60>
switchuvm(curproc);
80103926: 83 ec 0c sub $0xc,%esp
curproc->sz = sz;
80103929: 89 03 mov %eax,(%ebx)
switchuvm(curproc);
8010392b: 53 push %ebx
8010392c: e8 8f 2f 00 00 call 801068c0 <switchuvm>
return 0;
80103931: 83 c4 10 add $0x10,%esp
80103934: 31 c0 xor %eax,%eax
}
80103936: 8d 65 f8 lea -0x8(%ebp),%esp
80103939: 5b pop %ebx
8010393a: 5e pop %esi
8010393b: 5d pop %ebp
8010393c: c3 ret
8010393d: 8d 76 00 lea 0x0(%esi),%esi
if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103940: 83 ec 04 sub $0x4,%esp
80103943: 01 c6 add %eax,%esi
80103945: 56 push %esi
80103946: 50 push %eax
80103947: ff 73 04 pushl 0x4(%ebx)
8010394a: e8 c1 31 00 00 call 80106b10 <allocuvm>
8010394f: 83 c4 10 add $0x10,%esp
80103952: 85 c0 test %eax,%eax
80103954: 75 d0 jne 80103926 <growproc+0x26>
return -1;
80103956: b8 ff ff ff ff mov $0xffffffff,%eax
8010395b: eb d9 jmp 80103936 <growproc+0x36>
8010395d: 8d 76 00 lea 0x0(%esi),%esi
if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103960: 83 ec 04 sub $0x4,%esp
80103963: 01 c6 add %eax,%esi
80103965: 56 push %esi
80103966: 50 push %eax
80103967: ff 73 04 pushl 0x4(%ebx)
8010396a: e8 c1 32 00 00 call 80106c30 <deallocuvm>
8010396f: 83 c4 10 add $0x10,%esp
80103972: 85 c0 test %eax,%eax
80103974: 75 b0 jne 80103926 <growproc+0x26>
80103976: eb de jmp 80103956 <growproc+0x56>
80103978: 90 nop
80103979: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103980 <fork>:
{
80103980: 55 push %ebp
80103981: 89 e5 mov %esp,%ebp
80103983: 57 push %edi
80103984: 56 push %esi
80103985: 53 push %ebx
80103986: 83 ec 1c sub $0x1c,%esp
pushcli();
80103989: e8 82 09 00 00 call 80104310 <pushcli>
c = mycpu();
8010398e: e8 ad fd ff ff call 80103740 <mycpu>
p = c->proc;
80103993: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103999: e8 b2 09 00 00 call 80104350 <popcli>
if((np = allocproc()) == 0){
8010399e: e8 5d fc ff ff call 80103600 <allocproc>
801039a3: 85 c0 test %eax,%eax
801039a5: 89 45 e4 mov %eax,-0x1c(%ebp)
801039a8: 0f 84 b7 00 00 00 je 80103a65 <fork+0xe5>
if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){
801039ae: 83 ec 08 sub $0x8,%esp
801039b1: ff 33 pushl (%ebx)
801039b3: ff 73 04 pushl 0x4(%ebx)
801039b6: 89 c7 mov %eax,%edi
801039b8: e8 f3 33 00 00 call 80106db0 <copyuvm>
801039bd: 83 c4 10 add $0x10,%esp
801039c0: 85 c0 test %eax,%eax
801039c2: 89 47 04 mov %eax,0x4(%edi)
801039c5: 0f 84 a1 00 00 00 je 80103a6c <fork+0xec>
np->sz = curproc->sz;
801039cb: 8b 03 mov (%ebx),%eax
801039cd: 8b 4d e4 mov -0x1c(%ebp),%ecx
801039d0: 89 01 mov %eax,(%ecx)
np->parent = curproc;
801039d2: 89 59 14 mov %ebx,0x14(%ecx)
801039d5: 89 c8 mov %ecx,%eax
*np->tf = *curproc->tf;
801039d7: 8b 79 18 mov 0x18(%ecx),%edi
801039da: 8b 73 18 mov 0x18(%ebx),%esi
801039dd: b9 13 00 00 00 mov $0x13,%ecx
801039e2: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
for(i = 0; i < NOFILE; i++)
801039e4: 31 f6 xor %esi,%esi
np->tf->eax = 0;
801039e6: 8b 40 18 mov 0x18(%eax),%eax
801039e9: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
if(curproc->ofile[i])
801039f0: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax
801039f4: 85 c0 test %eax,%eax
801039f6: 74 13 je 80103a0b <fork+0x8b>
np->ofile[i] = filedup(curproc->ofile[i]);
801039f8: 83 ec 0c sub $0xc,%esp
801039fb: 50 push %eax
801039fc: e8 ef d3 ff ff call 80100df0 <filedup>
80103a01: 8b 55 e4 mov -0x1c(%ebp),%edx
80103a04: 83 c4 10 add $0x10,%esp
80103a07: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4)
for(i = 0; i < NOFILE; i++)
80103a0b: 83 c6 01 add $0x1,%esi
80103a0e: 83 fe 10 cmp $0x10,%esi
80103a11: 75 dd jne 801039f0 <fork+0x70>
np->cwd = idup(curproc->cwd);
80103a13: 83 ec 0c sub $0xc,%esp
80103a16: ff 73 68 pushl 0x68(%ebx)
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103a19: 83 c3 6c add $0x6c,%ebx
np->cwd = idup(curproc->cwd);
80103a1c: e8 2f dc ff ff call 80101650 <idup>
80103a21: 8b 7d e4 mov -0x1c(%ebp),%edi
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103a24: 83 c4 0c add $0xc,%esp
np->cwd = idup(curproc->cwd);
80103a27: 89 47 68 mov %eax,0x68(%edi)
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103a2a: 8d 47 6c lea 0x6c(%edi),%eax
80103a2d: 6a 10 push $0x10
80103a2f: 53 push %ebx
80103a30: 50 push %eax
80103a31: e8 9a 0c 00 00 call 801046d0 <safestrcpy>
pid = np->pid;
80103a36: 8b 5f 10 mov 0x10(%edi),%ebx
acquire(&ptable.lock);
80103a39: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103a40: e8 9b 09 00 00 call 801043e0 <acquire>
np->state = RUNNABLE;
80103a45: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi)
release(&ptable.lock);
80103a4c: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103a53: e8 48 0a 00 00 call 801044a0 <release>
return pid;
80103a58: 83 c4 10 add $0x10,%esp
}
80103a5b: 8d 65 f4 lea -0xc(%ebp),%esp
80103a5e: 89 d8 mov %ebx,%eax
80103a60: 5b pop %ebx
80103a61: 5e pop %esi
80103a62: 5f pop %edi
80103a63: 5d pop %ebp
80103a64: c3 ret
return -1;
80103a65: bb ff ff ff ff mov $0xffffffff,%ebx
80103a6a: eb ef jmp 80103a5b <fork+0xdb>
kfree(np->kstack);
80103a6c: 8b 5d e4 mov -0x1c(%ebp),%ebx
80103a6f: 83 ec 0c sub $0xc,%esp
80103a72: ff 73 08 pushl 0x8(%ebx)
80103a75: e8 96 e8 ff ff call 80102310 <kfree>
np->kstack = 0;
80103a7a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
np->state = UNUSED;
80103a81: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
return -1;
80103a88: 83 c4 10 add $0x10,%esp
80103a8b: bb ff ff ff ff mov $0xffffffff,%ebx
80103a90: eb c9 jmp 80103a5b <fork+0xdb>
80103a92: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103a99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103aa0 <scheduler>:
{
80103aa0: 55 push %ebp
80103aa1: 89 e5 mov %esp,%ebp
80103aa3: 57 push %edi
80103aa4: 56 push %esi
80103aa5: 53 push %ebx
80103aa6: 83 ec 0c sub $0xc,%esp
struct cpu *c = mycpu();
80103aa9: e8 92 fc ff ff call 80103740 <mycpu>
80103aae: 8d 78 04 lea 0x4(%eax),%edi
80103ab1: 89 c6 mov %eax,%esi
c->proc = 0;
80103ab3: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax)
80103aba: 00 00 00
80103abd: 8d 76 00 lea 0x0(%esi),%esi
asm volatile("sti");
80103ac0: fb sti
acquire(&ptable.lock);
80103ac1: 83 ec 0c sub $0xc,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103ac4: bb 54 2d 11 80 mov $0x80112d54,%ebx
acquire(&ptable.lock);
80103ac9: 68 20 2d 11 80 push $0x80112d20
80103ace: e8 0d 09 00 00 call 801043e0 <acquire>
80103ad3: 83 c4 10 add $0x10,%esp
80103ad6: 8d 76 00 lea 0x0(%esi),%esi
80103ad9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(p->state != RUNNABLE)
80103ae0: 83 7b 0c 03 cmpl $0x3,0xc(%ebx)
80103ae4: 75 33 jne 80103b19 <scheduler+0x79>
switchuvm(p);
80103ae6: 83 ec 0c sub $0xc,%esp
c->proc = p;
80103ae9: 89 9e ac 00 00 00 mov %ebx,0xac(%esi)
switchuvm(p);
80103aef: 53 push %ebx
80103af0: e8 cb 2d 00 00 call 801068c0 <switchuvm>
swtch(&(c->scheduler), p->context);
80103af5: 58 pop %eax
80103af6: 5a pop %edx
80103af7: ff 73 1c pushl 0x1c(%ebx)
80103afa: 57 push %edi
p->state = RUNNING;
80103afb: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx)
swtch(&(c->scheduler), p->context);
80103b02: e8 24 0c 00 00 call 8010472b <swtch>
switchkvm();
80103b07: e8 94 2d 00 00 call 801068a0 <switchkvm>
c->proc = 0;
80103b0c: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi)
80103b13: 00 00 00
80103b16: 83 c4 10 add $0x10,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103b19: 83 c3 7c add $0x7c,%ebx
80103b1c: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx
80103b22: 72 bc jb 80103ae0 <scheduler+0x40>
release(&ptable.lock);
80103b24: 83 ec 0c sub $0xc,%esp
80103b27: 68 20 2d 11 80 push $0x80112d20
80103b2c: e8 6f 09 00 00 call 801044a0 <release>
sti();
80103b31: 83 c4 10 add $0x10,%esp
80103b34: eb 8a jmp 80103ac0 <scheduler+0x20>
80103b36: 8d 76 00 lea 0x0(%esi),%esi
80103b39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103b40 <sched>:
{
80103b40: 55 push %ebp
80103b41: 89 e5 mov %esp,%ebp
80103b43: 56 push %esi
80103b44: 53 push %ebx
pushcli();
80103b45: e8 c6 07 00 00 call 80104310 <pushcli>
c = mycpu();
80103b4a: e8 f1 fb ff ff call 80103740 <mycpu>
p = c->proc;
80103b4f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103b55: e8 f6 07 00 00 call 80104350 <popcli>
if(!holding(&ptable.lock))
80103b5a: 83 ec 0c sub $0xc,%esp
80103b5d: 68 20 2d 11 80 push $0x80112d20
80103b62: e8 49 08 00 00 call 801043b0 <holding>
80103b67: 83 c4 10 add $0x10,%esp
80103b6a: 85 c0 test %eax,%eax
80103b6c: 74 4f je 80103bbd <sched+0x7d>
if(mycpu()->ncli != 1)
80103b6e: e8 cd fb ff ff call 80103740 <mycpu>
80103b73: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax)
80103b7a: 75 68 jne 80103be4 <sched+0xa4>
if(p->state == RUNNING)
80103b7c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx)
80103b80: 74 55 je 80103bd7 <sched+0x97>
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103b82: 9c pushf
80103b83: 58 pop %eax
if(readeflags()&FL_IF)
80103b84: f6 c4 02 test $0x2,%ah
80103b87: 75 41 jne 80103bca <sched+0x8a>
intena = mycpu()->intena;
80103b89: e8 b2 fb ff ff call 80103740 <mycpu>
swtch(&p->context, mycpu()->scheduler);
80103b8e: 83 c3 1c add $0x1c,%ebx
intena = mycpu()->intena;
80103b91: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi
swtch(&p->context, mycpu()->scheduler);
80103b97: e8 a4 fb ff ff call 80103740 <mycpu>
80103b9c: 83 ec 08 sub $0x8,%esp
80103b9f: ff 70 04 pushl 0x4(%eax)
80103ba2: 53 push %ebx
80103ba3: e8 83 0b 00 00 call 8010472b <swtch>
mycpu()->intena = intena;
80103ba8: e8 93 fb ff ff call 80103740 <mycpu>
}
80103bad: 83 c4 10 add $0x10,%esp
mycpu()->intena = intena;
80103bb0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax)
}
80103bb6: 8d 65 f8 lea -0x8(%ebp),%esp
80103bb9: 5b pop %ebx
80103bba: 5e pop %esi
80103bbb: 5d pop %ebp
80103bbc: c3 ret
panic("sched ptable.lock");
80103bbd: 83 ec 0c sub $0xc,%esp
80103bc0: 68 30 75 10 80 push $0x80107530
80103bc5: e8 c6 c7 ff ff call 80100390 <panic>
panic("sched interruptible");
80103bca: 83 ec 0c sub $0xc,%esp
80103bcd: 68 5c 75 10 80 push $0x8010755c
80103bd2: e8 b9 c7 ff ff call 80100390 <panic>
panic("sched running");
80103bd7: 83 ec 0c sub $0xc,%esp
80103bda: 68 4e 75 10 80 push $0x8010754e
80103bdf: e8 ac c7 ff ff call 80100390 <panic>
panic("sched locks");
80103be4: 83 ec 0c sub $0xc,%esp
80103be7: 68 42 75 10 80 push $0x80107542
80103bec: e8 9f c7 ff ff call 80100390 <panic>
80103bf1: eb 0d jmp 80103c00 <sleep1>
80103bf3: 90 nop
80103bf4: 90 nop
80103bf5: 90 nop
80103bf6: 90 nop
80103bf7: 90 nop
80103bf8: 90 nop
80103bf9: 90 nop
80103bfa: 90 nop
80103bfb: 90 nop
80103bfc: 90 nop
80103bfd: 90 nop
80103bfe: 90 nop
80103bff: 90 nop
80103c00 <sleep1>:
{
80103c00: 55 push %ebp
80103c01: 89 e5 mov %esp,%ebp
80103c03: 56 push %esi
80103c04: 53 push %ebx
80103c05: 8b 5d 0c mov 0xc(%ebp),%ebx
pushcli();
80103c08: e8 03 07 00 00 call 80104310 <pushcli>
c = mycpu();
80103c0d: e8 2e fb ff ff call 80103740 <mycpu>
p = c->proc;
80103c12: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi
popcli();
80103c18: e8 33 07 00 00 call 80104350 <popcli>
if(p == 0)
80103c1d: 85 f6 test %esi,%esi
80103c1f: 74 57 je 80103c78 <sleep1+0x78>
if(lk == 0)
80103c21: 85 db test %ebx,%ebx
80103c23: 74 60 je 80103c85 <sleep1+0x85>
acquire(&ptable.lock);
80103c25: 83 ec 0c sub $0xc,%esp
80103c28: 68 20 2d 11 80 push $0x80112d20
80103c2d: e8 ae 07 00 00 call 801043e0 <acquire>
p->chan = chan;
80103c32: 8b 45 08 mov 0x8(%ebp),%eax
lk->locked = 0;
80103c35: c7 03 00 00 00 00 movl $0x0,(%ebx)
p->state = SLEEPING;
80103c3b: c7 46 0c 02 00 00 00 movl $0x2,0xc(%esi)
p->chan = chan;
80103c42: 89 46 20 mov %eax,0x20(%esi)
sched();
80103c45: e8 f6 fe ff ff call 80103b40 <sched>
p->chan = 0;
80103c4a: c7 46 20 00 00 00 00 movl $0x0,0x20(%esi)
release(&ptable.lock);
80103c51: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103c58: e8 43 08 00 00 call 801044a0 <release>
while(xchg(&lk->locked, 1) != 0)
80103c5d: 83 c4 10 add $0x10,%esp
asm volatile("lock; xchgl %0, %1" :
80103c60: ba 01 00 00 00 mov $0x1,%edx
80103c65: 8d 76 00 lea 0x0(%esi),%esi
80103c68: 89 d0 mov %edx,%eax
80103c6a: f0 87 03 lock xchg %eax,(%ebx)
80103c6d: 85 c0 test %eax,%eax
80103c6f: 75 f7 jne 80103c68 <sleep1+0x68>
}
80103c71: 8d 65 f8 lea -0x8(%ebp),%esp
80103c74: 5b pop %ebx
80103c75: 5e pop %esi
80103c76: 5d pop %ebp
80103c77: c3 ret
panic("sleep");
80103c78: 83 ec 0c sub $0xc,%esp
80103c7b: 68 70 75 10 80 push $0x80107570
80103c80: e8 0b c7 ff ff call 80100390 <panic>
panic("sleep without lk");
80103c85: 83 ec 0c sub $0xc,%esp
80103c88: 68 76 75 10 80 push $0x80107576
80103c8d: e8 fe c6 ff ff call 80100390 <panic>
80103c92: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103ca0 <exit>:
{
80103ca0: 55 push %ebp
80103ca1: 89 e5 mov %esp,%ebp
80103ca3: 57 push %edi
80103ca4: 56 push %esi
80103ca5: 53 push %ebx
80103ca6: 83 ec 0c sub $0xc,%esp
pushcli();
80103ca9: e8 62 06 00 00 call 80104310 <pushcli>
c = mycpu();
80103cae: e8 8d fa ff ff call 80103740 <mycpu>
p = c->proc;
80103cb3: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi
popcli();
80103cb9: e8 92 06 00 00 call 80104350 <popcli>
if(curproc == initproc)
80103cbe: 39 35 b8 a5 10 80 cmp %esi,0x8010a5b8
80103cc4: 8d 5e 28 lea 0x28(%esi),%ebx
80103cc7: 8d 7e 68 lea 0x68(%esi),%edi
80103cca: 0f 84 e7 00 00 00 je 80103db7 <exit+0x117>
if(curproc->ofile[fd]){
80103cd0: 8b 03 mov (%ebx),%eax
80103cd2: 85 c0 test %eax,%eax
80103cd4: 74 12 je 80103ce8 <exit+0x48>
fileclose(curproc->ofile[fd]);
80103cd6: 83 ec 0c sub $0xc,%esp
80103cd9: 50 push %eax
80103cda: e8 61 d1 ff ff call 80100e40 <fileclose>
curproc->ofile[fd] = 0;
80103cdf: c7 03 00 00 00 00 movl $0x0,(%ebx)
80103ce5: 83 c4 10 add $0x10,%esp
80103ce8: 83 c3 04 add $0x4,%ebx
for(fd = 0; fd < NOFILE; fd++){
80103ceb: 39 fb cmp %edi,%ebx
80103ced: 75 e1 jne 80103cd0 <exit+0x30>
begin_op();
80103cef: e8 ac ee ff ff call 80102ba0 <begin_op>
iput(curproc->cwd);
80103cf4: 83 ec 0c sub $0xc,%esp
80103cf7: ff 76 68 pushl 0x68(%esi)
80103cfa: e8 b1 da ff ff call 801017b0 <iput>
end_op();
80103cff: e8 0c ef ff ff call 80102c10 <end_op>
curproc->cwd = 0;
80103d04: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi)
acquire(&ptable.lock);
80103d0b: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103d12: e8 c9 06 00 00 call 801043e0 <acquire>
wakeup1(curproc->parent);
80103d17: 8b 56 14 mov 0x14(%esi),%edx
80103d1a: 83 c4 10 add $0x10,%esp
static void
wakeup1(void *chan)
{
struct proc *p;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103d1d: b8 54 2d 11 80 mov $0x80112d54,%eax
80103d22: eb 0e jmp 80103d32 <exit+0x92>
80103d24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103d28: 83 c0 7c add $0x7c,%eax
80103d2b: 3d 54 4c 11 80 cmp $0x80114c54,%eax
80103d30: 73 1c jae 80103d4e <exit+0xae>
if(p->state == SLEEPING && p->chan == chan)
80103d32: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80103d36: 75 f0 jne 80103d28 <exit+0x88>
80103d38: 3b 50 20 cmp 0x20(%eax),%edx
80103d3b: 75 eb jne 80103d28 <exit+0x88>
p->state = RUNNABLE;
80103d3d: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103d44: 83 c0 7c add $0x7c,%eax
80103d47: 3d 54 4c 11 80 cmp $0x80114c54,%eax
80103d4c: 72 e4 jb 80103d32 <exit+0x92>
p->parent = initproc;
80103d4e: 8b 0d b8 a5 10 80 mov 0x8010a5b8,%ecx
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103d54: ba 54 2d 11 80 mov $0x80112d54,%edx
80103d59: eb 10 jmp 80103d6b <exit+0xcb>
80103d5b: 90 nop
80103d5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103d60: 83 c2 7c add $0x7c,%edx
80103d63: 81 fa 54 4c 11 80 cmp $0x80114c54,%edx
80103d69: 73 33 jae 80103d9e <exit+0xfe>
if(p->parent == curproc){
80103d6b: 39 72 14 cmp %esi,0x14(%edx)
80103d6e: 75 f0 jne 80103d60 <exit+0xc0>
if(p->state == ZOMBIE)
80103d70: 83 7a 0c 05 cmpl $0x5,0xc(%edx)
p->parent = initproc;
80103d74: 89 4a 14 mov %ecx,0x14(%edx)
if(p->state == ZOMBIE)
80103d77: 75 e7 jne 80103d60 <exit+0xc0>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103d79: b8 54 2d 11 80 mov $0x80112d54,%eax
80103d7e: eb 0a jmp 80103d8a <exit+0xea>
80103d80: 83 c0 7c add $0x7c,%eax
80103d83: 3d 54 4c 11 80 cmp $0x80114c54,%eax
80103d88: 73 d6 jae 80103d60 <exit+0xc0>
if(p->state == SLEEPING && p->chan == chan)
80103d8a: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80103d8e: 75 f0 jne 80103d80 <exit+0xe0>
80103d90: 3b 48 20 cmp 0x20(%eax),%ecx
80103d93: 75 eb jne 80103d80 <exit+0xe0>
p->state = RUNNABLE;
80103d95: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
80103d9c: eb e2 jmp 80103d80 <exit+0xe0>
curproc->state = ZOMBIE;
80103d9e: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi)
sched();
80103da5: e8 96 fd ff ff call 80103b40 <sched>
panic("zombie exit");
80103daa: 83 ec 0c sub $0xc,%esp
80103dad: 68 94 75 10 80 push $0x80107594
80103db2: e8 d9 c5 ff ff call 80100390 <panic>
panic("init exiting");
80103db7: 83 ec 0c sub $0xc,%esp
80103dba: 68 87 75 10 80 push $0x80107587
80103dbf: e8 cc c5 ff ff call 80100390 <panic>
80103dc4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103dca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80103dd0 <yield>:
{
80103dd0: 55 push %ebp
80103dd1: 89 e5 mov %esp,%ebp
80103dd3: 53 push %ebx
80103dd4: 83 ec 10 sub $0x10,%esp
acquire(&ptable.lock); //DOC: yieldlock
80103dd7: 68 20 2d 11 80 push $0x80112d20
80103ddc: e8 ff 05 00 00 call 801043e0 <acquire>
pushcli();
80103de1: e8 2a 05 00 00 call 80104310 <pushcli>
c = mycpu();
80103de6: e8 55 f9 ff ff call 80103740 <mycpu>
p = c->proc;
80103deb: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103df1: e8 5a 05 00 00 call 80104350 <popcli>
myproc()->state = RUNNABLE;
80103df6: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx)
sched();
80103dfd: e8 3e fd ff ff call 80103b40 <sched>
release(&ptable.lock);
80103e02: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103e09: e8 92 06 00 00 call 801044a0 <release>
}
80103e0e: 83 c4 10 add $0x10,%esp
80103e11: 8b 5d fc mov -0x4(%ebp),%ebx
80103e14: c9 leave
80103e15: c3 ret
80103e16: 8d 76 00 lea 0x0(%esi),%esi
80103e19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103e20 <sleep>:
{
80103e20: 55 push %ebp
80103e21: 89 e5 mov %esp,%ebp
80103e23: 57 push %edi
80103e24: 56 push %esi
80103e25: 53 push %ebx
80103e26: 83 ec 0c sub $0xc,%esp
80103e29: 8b 7d 08 mov 0x8(%ebp),%edi
80103e2c: 8b 75 0c mov 0xc(%ebp),%esi
pushcli();
80103e2f: e8 dc 04 00 00 call 80104310 <pushcli>
c = mycpu();
80103e34: e8 07 f9 ff ff call 80103740 <mycpu>
p = c->proc;
80103e39: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103e3f: e8 0c 05 00 00 call 80104350 <popcli>
if(p == 0)
80103e44: 85 db test %ebx,%ebx
80103e46: 0f 84 87 00 00 00 je 80103ed3 <sleep+0xb3>
if(lk == 0)
80103e4c: 85 f6 test %esi,%esi
80103e4e: 74 76 je 80103ec6 <sleep+0xa6>
if(lk != &ptable.lock){ //DOC: sleeplock0
80103e50: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi
80103e56: 74 50 je 80103ea8 <sleep+0x88>
acquire(&ptable.lock); //DOC: sleeplock1
80103e58: 83 ec 0c sub $0xc,%esp
80103e5b: 68 20 2d 11 80 push $0x80112d20
80103e60: e8 7b 05 00 00 call 801043e0 <acquire>
release(lk);
80103e65: 89 34 24 mov %esi,(%esp)
80103e68: e8 33 06 00 00 call 801044a0 <release>
p->chan = chan;
80103e6d: 89 7b 20 mov %edi,0x20(%ebx)
p->state = SLEEPING;
80103e70: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx)
sched();
80103e77: e8 c4 fc ff ff call 80103b40 <sched>
p->chan = 0;
80103e7c: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx)
release(&ptable.lock);
80103e83: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
80103e8a: e8 11 06 00 00 call 801044a0 <release>
acquire(lk);
80103e8f: 89 75 08 mov %esi,0x8(%ebp)
80103e92: 83 c4 10 add $0x10,%esp
}
80103e95: 8d 65 f4 lea -0xc(%ebp),%esp
80103e98: 5b pop %ebx
80103e99: 5e pop %esi
80103e9a: 5f pop %edi
80103e9b: 5d pop %ebp
acquire(lk);
80103e9c: e9 3f 05 00 00 jmp 801043e0 <acquire>
80103ea1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
p->chan = chan;
80103ea8: 89 7b 20 mov %edi,0x20(%ebx)
p->state = SLEEPING;
80103eab: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx)
sched();
80103eb2: e8 89 fc ff ff call 80103b40 <sched>
p->chan = 0;
80103eb7: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx)
}
80103ebe: 8d 65 f4 lea -0xc(%ebp),%esp
80103ec1: 5b pop %ebx
80103ec2: 5e pop %esi
80103ec3: 5f pop %edi
80103ec4: 5d pop %ebp
80103ec5: c3 ret
panic("sleep without lk");
80103ec6: 83 ec 0c sub $0xc,%esp
80103ec9: 68 76 75 10 80 push $0x80107576
80103ece: e8 bd c4 ff ff call 80100390 <panic>
panic("sleep");
80103ed3: 83 ec 0c sub $0xc,%esp
80103ed6: 68 70 75 10 80 push $0x80107570
80103edb: e8 b0 c4 ff ff call 80100390 <panic>
80103ee0 <wait>:
{
80103ee0: 55 push %ebp
80103ee1: 89 e5 mov %esp,%ebp
80103ee3: 56 push %esi
80103ee4: 53 push %ebx
pushcli();
80103ee5: e8 26 04 00 00 call 80104310 <pushcli>
c = mycpu();
80103eea: e8 51 f8 ff ff call 80103740 <mycpu>
p = c->proc;
80103eef: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi
popcli();
80103ef5: e8 56 04 00 00 call 80104350 <popcli>
acquire(&ptable.lock);
80103efa: 83 ec 0c sub $0xc,%esp
80103efd: 68 20 2d 11 80 push $0x80112d20
80103f02: e8 d9 04 00 00 call 801043e0 <acquire>
80103f07: 83 c4 10 add $0x10,%esp
havekids = 0;
80103f0a: 31 c0 xor %eax,%eax
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103f0c: bb 54 2d 11 80 mov $0x80112d54,%ebx
80103f11: eb 10 jmp 80103f23 <wait+0x43>
80103f13: 90 nop
80103f14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103f18: 83 c3 7c add $0x7c,%ebx
80103f1b: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx
80103f21: 73 1b jae 80103f3e <wait+0x5e>
if(p->parent != curproc)
80103f23: 39 73 14 cmp %esi,0x14(%ebx)
80103f26: 75 f0 jne 80103f18 <wait+0x38>
if(p->state == ZOMBIE){
80103f28: 83 7b 0c 05 cmpl $0x5,0xc(%ebx)
80103f2c: 74 32 je 80103f60 <wait+0x80>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103f2e: 83 c3 7c add $0x7c,%ebx
havekids = 1;
80103f31: b8 01 00 00 00 mov $0x1,%eax
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103f36: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx
80103f3c: 72 e5 jb 80103f23 <wait+0x43>
if(!havekids || curproc->killed){
80103f3e: 85 c0 test %eax,%eax
80103f40: 74 74 je 80103fb6 <wait+0xd6>
80103f42: 8b 46 24 mov 0x24(%esi),%eax
80103f45: 85 c0 test %eax,%eax
80103f47: 75 6d jne 80103fb6 <wait+0xd6>
sleep(curproc, &ptable.lock); //DOC: wait-sleep
80103f49: 83 ec 08 sub $0x8,%esp
80103f4c: 68 20 2d 11 80 push $0x80112d20
80103f51: 56 push %esi
80103f52: e8 c9 fe ff ff call 80103e20 <sleep>
havekids = 0;
80103f57: 83 c4 10 add $0x10,%esp
80103f5a: eb ae jmp 80103f0a <wait+0x2a>
80103f5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
kfree(p->kstack);
80103f60: 83 ec 0c sub $0xc,%esp
80103f63: ff 73 08 pushl 0x8(%ebx)
pid = p->pid;
80103f66: 8b 73 10 mov 0x10(%ebx),%esi
kfree(p->kstack);
80103f69: e8 a2 e3 ff ff call 80102310 <kfree>
freevm(p->pgdir);
80103f6e: 5a pop %edx
80103f6f: ff 73 04 pushl 0x4(%ebx)
p->kstack = 0;
80103f72: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
freevm(p->pgdir);
80103f79: e8 e2 2c 00 00 call 80106c60 <freevm>
release(&ptable.lock);
80103f7e: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp)
p->pid = 0;
80103f85: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx)
p->parent = 0;
80103f8c: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx)
p->name[0] = 0;
80103f93: c6 43 6c 00 movb $0x0,0x6c(%ebx)
p->killed = 0;
80103f97: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx)
p->state = UNUSED;
80103f9e: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
release(&ptable.lock);
80103fa5: e8 f6 04 00 00 call 801044a0 <release>
return pid;
80103faa: 83 c4 10 add $0x10,%esp
}
80103fad: 8d 65 f8 lea -0x8(%ebp),%esp
80103fb0: 89 f0 mov %esi,%eax
80103fb2: 5b pop %ebx
80103fb3: 5e pop %esi
80103fb4: 5d pop %ebp
80103fb5: c3 ret
release(&ptable.lock);
80103fb6: 83 ec 0c sub $0xc,%esp
return -1;
80103fb9: be ff ff ff ff mov $0xffffffff,%esi
release(&ptable.lock);
80103fbe: 68 20 2d 11 80 push $0x80112d20
80103fc3: e8 d8 04 00 00 call 801044a0 <release>
return -1;
80103fc8: 83 c4 10 add $0x10,%esp
80103fcb: eb e0 jmp 80103fad <wait+0xcd>
80103fcd: 8d 76 00 lea 0x0(%esi),%esi
80103fd0 <wakeup>:
}
// Wake up all processes sleeping on chan.
void
wakeup(void *chan)
{
80103fd0: 55 push %ebp
80103fd1: 89 e5 mov %esp,%ebp
80103fd3: 53 push %ebx
80103fd4: 83 ec 10 sub $0x10,%esp
80103fd7: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ptable.lock);
80103fda: 68 20 2d 11 80 push $0x80112d20
80103fdf: e8 fc 03 00 00 call 801043e0 <acquire>
80103fe4: 83 c4 10 add $0x10,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103fe7: b8 54 2d 11 80 mov $0x80112d54,%eax
80103fec: eb 0c jmp 80103ffa <wakeup+0x2a>
80103fee: 66 90 xchg %ax,%ax
80103ff0: 83 c0 7c add $0x7c,%eax
80103ff3: 3d 54 4c 11 80 cmp $0x80114c54,%eax
80103ff8: 73 1c jae 80104016 <wakeup+0x46>
if(p->state == SLEEPING && p->chan == chan)
80103ffa: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80103ffe: 75 f0 jne 80103ff0 <wakeup+0x20>
80104000: 3b 58 20 cmp 0x20(%eax),%ebx
80104003: 75 eb jne 80103ff0 <wakeup+0x20>
p->state = RUNNABLE;
80104005: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010400c: 83 c0 7c add $0x7c,%eax
8010400f: 3d 54 4c 11 80 cmp $0x80114c54,%eax
80104014: 72 e4 jb 80103ffa <wakeup+0x2a>
wakeup1(chan);
release(&ptable.lock);
80104016: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp)
}
8010401d: 8b 5d fc mov -0x4(%ebp),%ebx
80104020: c9 leave
release(&ptable.lock);
80104021: e9 7a 04 00 00 jmp 801044a0 <release>
80104026: 8d 76 00 lea 0x0(%esi),%esi
80104029: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104030 <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)
{
80104030: 55 push %ebp
80104031: 89 e5 mov %esp,%ebp
80104033: 53 push %ebx
80104034: 83 ec 10 sub $0x10,%esp
80104037: 8b 5d 08 mov 0x8(%ebp),%ebx
struct proc *p;
acquire(&ptable.lock);
8010403a: 68 20 2d 11 80 push $0x80112d20
8010403f: e8 9c 03 00 00 call 801043e0 <acquire>
80104044: 83 c4 10 add $0x10,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104047: b8 54 2d 11 80 mov $0x80112d54,%eax
8010404c: eb 0c jmp 8010405a <kill+0x2a>
8010404e: 66 90 xchg %ax,%ax
80104050: 83 c0 7c add $0x7c,%eax
80104053: 3d 54 4c 11 80 cmp $0x80114c54,%eax
80104058: 73 36 jae 80104090 <kill+0x60>
if(p->pid == pid){
8010405a: 39 58 10 cmp %ebx,0x10(%eax)
8010405d: 75 f1 jne 80104050 <kill+0x20>
p->killed = 1;
// Wake process from sleep if necessary.
if(p->state == SLEEPING)
8010405f: 83 78 0c 02 cmpl $0x2,0xc(%eax)
p->killed = 1;
80104063: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
if(p->state == SLEEPING)
8010406a: 75 07 jne 80104073 <kill+0x43>
p->state = RUNNABLE;
8010406c: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
release(&ptable.lock);
80104073: 83 ec 0c sub $0xc,%esp
80104076: 68 20 2d 11 80 push $0x80112d20
8010407b: e8 20 04 00 00 call 801044a0 <release>
return 0;
80104080: 83 c4 10 add $0x10,%esp
80104083: 31 c0 xor %eax,%eax
}
}
release(&ptable.lock);
return -1;
}
80104085: 8b 5d fc mov -0x4(%ebp),%ebx
80104088: c9 leave
80104089: c3 ret
8010408a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
release(&ptable.lock);
80104090: 83 ec 0c sub $0xc,%esp
80104093: 68 20 2d 11 80 push $0x80112d20
80104098: e8 03 04 00 00 call 801044a0 <release>
return -1;
8010409d: 83 c4 10 add $0x10,%esp
801040a0: b8 ff ff ff ff mov $0xffffffff,%eax
}
801040a5: 8b 5d fc mov -0x4(%ebp),%ebx
801040a8: c9 leave
801040a9: c3 ret
801040aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801040b0 <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)
{
801040b0: 55 push %ebp
801040b1: 89 e5 mov %esp,%ebp
801040b3: 57 push %edi
801040b4: 56 push %esi
801040b5: 53 push %ebx
801040b6: 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++){
801040b9: bb 54 2d 11 80 mov $0x80112d54,%ebx
{
801040be: 83 ec 3c sub $0x3c,%esp
801040c1: eb 24 jmp 801040e7 <procdump+0x37>
801040c3: 90 nop
801040c4: 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");
801040c8: 83 ec 0c sub $0xc,%esp
801040cb: 68 db 78 10 80 push $0x801078db
801040d0: e8 8b c5 ff ff call 80100660 <cprintf>
801040d5: 83 c4 10 add $0x10,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801040d8: 83 c3 7c add $0x7c,%ebx
801040db: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx
801040e1: 0f 83 81 00 00 00 jae 80104168 <procdump+0xb8>
if(p->state == UNUSED)
801040e7: 8b 43 0c mov 0xc(%ebx),%eax
801040ea: 85 c0 test %eax,%eax
801040ec: 74 ea je 801040d8 <procdump+0x28>
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
801040ee: 83 f8 05 cmp $0x5,%eax
state = "???";
801040f1: ba a0 75 10 80 mov $0x801075a0,%edx
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
801040f6: 77 11 ja 80104109 <procdump+0x59>
801040f8: 8b 14 85 00 76 10 80 mov -0x7fef8a00(,%eax,4),%edx
state = "???";
801040ff: b8 a0 75 10 80 mov $0x801075a0,%eax
80104104: 85 d2 test %edx,%edx
80104106: 0f 44 d0 cmove %eax,%edx
cprintf("%d %s %s", p->pid, state, p->name);
80104109: 8d 43 6c lea 0x6c(%ebx),%eax
8010410c: 50 push %eax
8010410d: 52 push %edx
8010410e: ff 73 10 pushl 0x10(%ebx)
80104111: 68 a4 75 10 80 push $0x801075a4
80104116: e8 45 c5 ff ff call 80100660 <cprintf>
if(p->state == SLEEPING){
8010411b: 83 c4 10 add $0x10,%esp
8010411e: 83 7b 0c 02 cmpl $0x2,0xc(%ebx)
80104122: 75 a4 jne 801040c8 <procdump+0x18>
getcallerpcs((uint*)p->context->ebp+2, pc);
80104124: 8d 45 c0 lea -0x40(%ebp),%eax
80104127: 83 ec 08 sub $0x8,%esp
8010412a: 8d 7d c0 lea -0x40(%ebp),%edi
8010412d: 50 push %eax
8010412e: 8b 43 1c mov 0x1c(%ebx),%eax
80104131: 8b 40 0c mov 0xc(%eax),%eax
80104134: 83 c0 08 add $0x8,%eax
80104137: 50 push %eax
80104138: e8 83 01 00 00 call 801042c0 <getcallerpcs>
8010413d: 83 c4 10 add $0x10,%esp
for(i=0; i<10 && pc[i] != 0; i++)
80104140: 8b 17 mov (%edi),%edx
80104142: 85 d2 test %edx,%edx
80104144: 74 82 je 801040c8 <procdump+0x18>
cprintf(" %p", pc[i]);
80104146: 83 ec 08 sub $0x8,%esp
80104149: 83 c7 04 add $0x4,%edi
8010414c: 52 push %edx
8010414d: 68 e1 6f 10 80 push $0x80106fe1
80104152: e8 09 c5 ff ff call 80100660 <cprintf>
for(i=0; i<10 && pc[i] != 0; i++)
80104157: 83 c4 10 add $0x10,%esp
8010415a: 39 fe cmp %edi,%esi
8010415c: 75 e2 jne 80104140 <procdump+0x90>
8010415e: e9 65 ff ff ff jmp 801040c8 <procdump+0x18>
80104163: 90 nop
80104164: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
}
80104168: 8d 65 f4 lea -0xc(%ebp),%esp
8010416b: 5b pop %ebx
8010416c: 5e pop %esi
8010416d: 5f pop %edi
8010416e: 5d pop %ebp
8010416f: c3 ret
80104170 <initsleeplock>:
#include "spinlock.h"
#include "sleeplock.h"
void
initsleeplock(struct sleeplock *lk, char *name)
{
80104170: 55 push %ebp
80104171: 89 e5 mov %esp,%ebp
80104173: 53 push %ebx
80104174: 83 ec 0c sub $0xc,%esp
80104177: 8b 5d 08 mov 0x8(%ebp),%ebx
initlock(&lk->lk, "sleep lock");
8010417a: 68 18 76 10 80 push $0x80107618
8010417f: 8d 43 04 lea 0x4(%ebx),%eax
80104182: 50 push %eax
80104183: e8 18 01 00 00 call 801042a0 <initlock>
lk->name = name;
80104188: 8b 45 0c mov 0xc(%ebp),%eax
lk->locked = 0;
8010418b: c7 03 00 00 00 00 movl $0x0,(%ebx)
lk->pid = 0;
}
80104191: 83 c4 10 add $0x10,%esp
lk->pid = 0;
80104194: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
lk->name = name;
8010419b: 89 43 38 mov %eax,0x38(%ebx)
}
8010419e: 8b 5d fc mov -0x4(%ebp),%ebx
801041a1: c9 leave
801041a2: c3 ret
801041a3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801041a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801041b0 <acquiresleep>:
void
acquiresleep(struct sleeplock *lk)
{
801041b0: 55 push %ebp
801041b1: 89 e5 mov %esp,%ebp
801041b3: 56 push %esi
801041b4: 53 push %ebx
801041b5: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&lk->lk);
801041b8: 83 ec 0c sub $0xc,%esp
801041bb: 8d 73 04 lea 0x4(%ebx),%esi
801041be: 56 push %esi
801041bf: e8 1c 02 00 00 call 801043e0 <acquire>
while (lk->locked) {
801041c4: 8b 13 mov (%ebx),%edx
801041c6: 83 c4 10 add $0x10,%esp
801041c9: 85 d2 test %edx,%edx
801041cb: 74 16 je 801041e3 <acquiresleep+0x33>
801041cd: 8d 76 00 lea 0x0(%esi),%esi
sleep(lk, &lk->lk);
801041d0: 83 ec 08 sub $0x8,%esp
801041d3: 56 push %esi
801041d4: 53 push %ebx
801041d5: e8 46 fc ff ff call 80103e20 <sleep>
while (lk->locked) {
801041da: 8b 03 mov (%ebx),%eax
801041dc: 83 c4 10 add $0x10,%esp
801041df: 85 c0 test %eax,%eax
801041e1: 75 ed jne 801041d0 <acquiresleep+0x20>
}
lk->locked = 1;
801041e3: c7 03 01 00 00 00 movl $0x1,(%ebx)
lk->pid = myproc()->pid;
801041e9: e8 f2 f5 ff ff call 801037e0 <myproc>
801041ee: 8b 40 10 mov 0x10(%eax),%eax
801041f1: 89 43 3c mov %eax,0x3c(%ebx)
release(&lk->lk);
801041f4: 89 75 08 mov %esi,0x8(%ebp)
}
801041f7: 8d 65 f8 lea -0x8(%ebp),%esp
801041fa: 5b pop %ebx
801041fb: 5e pop %esi
801041fc: 5d pop %ebp
release(&lk->lk);
801041fd: e9 9e 02 00 00 jmp 801044a0 <release>
80104202: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104210 <releasesleep>:
void
releasesleep(struct sleeplock *lk)
{
80104210: 55 push %ebp
80104211: 89 e5 mov %esp,%ebp
80104213: 56 push %esi
80104214: 53 push %ebx
80104215: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&lk->lk);
80104218: 83 ec 0c sub $0xc,%esp
8010421b: 8d 73 04 lea 0x4(%ebx),%esi
8010421e: 56 push %esi
8010421f: e8 bc 01 00 00 call 801043e0 <acquire>
lk->locked = 0;
80104224: c7 03 00 00 00 00 movl $0x0,(%ebx)
lk->pid = 0;
8010422a: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
wakeup(lk);
80104231: 89 1c 24 mov %ebx,(%esp)
80104234: e8 97 fd ff ff call 80103fd0 <wakeup>
release(&lk->lk);
80104239: 89 75 08 mov %esi,0x8(%ebp)
8010423c: 83 c4 10 add $0x10,%esp
}
8010423f: 8d 65 f8 lea -0x8(%ebp),%esp
80104242: 5b pop %ebx
80104243: 5e pop %esi
80104244: 5d pop %ebp
release(&lk->lk);
80104245: e9 56 02 00 00 jmp 801044a0 <release>
8010424a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104250 <holdingsleep>:
int
holdingsleep(struct sleeplock *lk)
{
80104250: 55 push %ebp
80104251: 89 e5 mov %esp,%ebp
80104253: 57 push %edi
80104254: 56 push %esi
80104255: 53 push %ebx
80104256: 31 ff xor %edi,%edi
80104258: 83 ec 18 sub $0x18,%esp
8010425b: 8b 5d 08 mov 0x8(%ebp),%ebx
int r;
acquire(&lk->lk);
8010425e: 8d 73 04 lea 0x4(%ebx),%esi
80104261: 56 push %esi
80104262: e8 79 01 00 00 call 801043e0 <acquire>
r = lk->locked && (lk->pid == myproc()->pid);
80104267: 8b 03 mov (%ebx),%eax
80104269: 83 c4 10 add $0x10,%esp
8010426c: 85 c0 test %eax,%eax
8010426e: 74 13 je 80104283 <holdingsleep+0x33>
80104270: 8b 5b 3c mov 0x3c(%ebx),%ebx
80104273: e8 68 f5 ff ff call 801037e0 <myproc>
80104278: 39 58 10 cmp %ebx,0x10(%eax)
8010427b: 0f 94 c0 sete %al
8010427e: 0f b6 c0 movzbl %al,%eax
80104281: 89 c7 mov %eax,%edi
release(&lk->lk);
80104283: 83 ec 0c sub $0xc,%esp
80104286: 56 push %esi
80104287: e8 14 02 00 00 call 801044a0 <release>
return r;
}
8010428c: 8d 65 f4 lea -0xc(%ebp),%esp
8010428f: 89 f8 mov %edi,%eax
80104291: 5b pop %ebx
80104292: 5e pop %esi
80104293: 5f pop %edi
80104294: 5d pop %ebp
80104295: c3 ret
80104296: 66 90 xchg %ax,%ax
80104298: 66 90 xchg %ax,%ax
8010429a: 66 90 xchg %ax,%ax
8010429c: 66 90 xchg %ax,%ax
8010429e: 66 90 xchg %ax,%ax
801042a0 <initlock>:
#include "proc.h"
#include "spinlock.h"
void
initlock(struct spinlock *lk, char *name)
{
801042a0: 55 push %ebp
801042a1: 89 e5 mov %esp,%ebp
801042a3: 8b 45 08 mov 0x8(%ebp),%eax
lk->name = name;
801042a6: 8b 55 0c mov 0xc(%ebp),%edx
lk->locked = 0;
801042a9: c7 00 00 00 00 00 movl $0x0,(%eax)
lk->name = name;
801042af: 89 50 04 mov %edx,0x4(%eax)
lk->cpu = 0;
801042b2: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
801042b9: 5d pop %ebp
801042ba: c3 ret
801042bb: 90 nop
801042bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801042c0 <getcallerpcs>:
}
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
801042c0: 55 push %ebp
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
801042c1: 31 d2 xor %edx,%edx
{
801042c3: 89 e5 mov %esp,%ebp
801042c5: 53 push %ebx
ebp = (uint*)v - 2;
801042c6: 8b 45 08 mov 0x8(%ebp),%eax
{
801042c9: 8b 4d 0c mov 0xc(%ebp),%ecx
ebp = (uint*)v - 2;
801042cc: 83 e8 08 sub $0x8,%eax
801042cf: 90 nop
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
801042d0: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx
801042d6: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx
801042dc: 77 1a ja 801042f8 <getcallerpcs+0x38>
break;
pcs[i] = ebp[1]; // saved %eip
801042de: 8b 58 04 mov 0x4(%eax),%ebx
801042e1: 89 1c 91 mov %ebx,(%ecx,%edx,4)
for(i = 0; i < 10; i++){
801042e4: 83 c2 01 add $0x1,%edx
ebp = (uint*)ebp[0]; // saved %ebp
801042e7: 8b 00 mov (%eax),%eax
for(i = 0; i < 10; i++){
801042e9: 83 fa 0a cmp $0xa,%edx
801042ec: 75 e2 jne 801042d0 <getcallerpcs+0x10>
}
for(; i < 10; i++)
pcs[i] = 0;
}
801042ee: 5b pop %ebx
801042ef: 5d pop %ebp
801042f0: c3 ret
801042f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801042f8: 8d 04 91 lea (%ecx,%edx,4),%eax
801042fb: 83 c1 28 add $0x28,%ecx
801042fe: 66 90 xchg %ax,%ax
pcs[i] = 0;
80104300: c7 00 00 00 00 00 movl $0x0,(%eax)
80104306: 83 c0 04 add $0x4,%eax
for(; i < 10; i++)
80104309: 39 c1 cmp %eax,%ecx
8010430b: 75 f3 jne 80104300 <getcallerpcs+0x40>
}
8010430d: 5b pop %ebx
8010430e: 5d pop %ebp
8010430f: c3 ret
80104310 <pushcli>:
// it takes two popcli to undo two pushcli. Also, if interrupts
// are off, then pushcli, popcli leaves them off.
void
pushcli(void)
{
80104310: 55 push %ebp
80104311: 89 e5 mov %esp,%ebp
80104313: 53 push %ebx
80104314: 83 ec 04 sub $0x4,%esp
asm volatile("pushfl; popl %0" : "=r" (eflags));
80104317: 9c pushf
80104318: 5b pop %ebx
asm volatile("cli");
80104319: fa cli
int eflags;
eflags = readeflags();
cli();
if(mycpu()->ncli == 0)
8010431a: e8 21 f4 ff ff call 80103740 <mycpu>
8010431f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax
80104325: 85 c0 test %eax,%eax
80104327: 75 11 jne 8010433a <pushcli+0x2a>
mycpu()->intena = eflags & FL_IF;
80104329: 81 e3 00 02 00 00 and $0x200,%ebx
8010432f: e8 0c f4 ff ff call 80103740 <mycpu>
80104334: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax)
mycpu()->ncli += 1;
8010433a: e8 01 f4 ff ff call 80103740 <mycpu>
8010433f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax)
}
80104346: 83 c4 04 add $0x4,%esp
80104349: 5b pop %ebx
8010434a: 5d pop %ebp
8010434b: c3 ret
8010434c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104350 <popcli>:
void
popcli(void)
{
80104350: 55 push %ebp
80104351: 89 e5 mov %esp,%ebp
80104353: 83 ec 08 sub $0x8,%esp
asm volatile("pushfl; popl %0" : "=r" (eflags));
80104356: 9c pushf
80104357: 58 pop %eax
if(readeflags()&FL_IF)
80104358: f6 c4 02 test $0x2,%ah
8010435b: 75 35 jne 80104392 <popcli+0x42>
panic("popcli - interruptible");
if(--mycpu()->ncli < 0)
8010435d: e8 de f3 ff ff call 80103740 <mycpu>
80104362: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax)
80104369: 78 34 js 8010439f <popcli+0x4f>
panic("popcli");
if(mycpu()->ncli == 0 && mycpu()->intena)
8010436b: e8 d0 f3 ff ff call 80103740 <mycpu>
80104370: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx
80104376: 85 d2 test %edx,%edx
80104378: 74 06 je 80104380 <popcli+0x30>
sti();
}
8010437a: c9 leave
8010437b: c3 ret
8010437c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(mycpu()->ncli == 0 && mycpu()->intena)
80104380: e8 bb f3 ff ff call 80103740 <mycpu>
80104385: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax
8010438b: 85 c0 test %eax,%eax
8010438d: 74 eb je 8010437a <popcli+0x2a>
asm volatile("sti");
8010438f: fb sti
}
80104390: c9 leave
80104391: c3 ret
panic("popcli - interruptible");
80104392: 83 ec 0c sub $0xc,%esp
80104395: 68 23 76 10 80 push $0x80107623
8010439a: e8 f1 bf ff ff call 80100390 <panic>
panic("popcli");
8010439f: 83 ec 0c sub $0xc,%esp
801043a2: 68 3a 76 10 80 push $0x8010763a
801043a7: e8 e4 bf ff ff call 80100390 <panic>
801043ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801043b0 <holding>:
{
801043b0: 55 push %ebp
801043b1: 89 e5 mov %esp,%ebp
801043b3: 56 push %esi
801043b4: 53 push %ebx
801043b5: 8b 75 08 mov 0x8(%ebp),%esi
801043b8: 31 db xor %ebx,%ebx
pushcli();
801043ba: e8 51 ff ff ff call 80104310 <pushcli>
r = lock->locked && lock->cpu == mycpu();
801043bf: 8b 06 mov (%esi),%eax
801043c1: 85 c0 test %eax,%eax
801043c3: 74 10 je 801043d5 <holding+0x25>
801043c5: 8b 5e 08 mov 0x8(%esi),%ebx
801043c8: e8 73 f3 ff ff call 80103740 <mycpu>
801043cd: 39 c3 cmp %eax,%ebx
801043cf: 0f 94 c3 sete %bl
801043d2: 0f b6 db movzbl %bl,%ebx
popcli();
801043d5: e8 76 ff ff ff call 80104350 <popcli>
}
801043da: 89 d8 mov %ebx,%eax
801043dc: 5b pop %ebx
801043dd: 5e pop %esi
801043de: 5d pop %ebp
801043df: c3 ret
801043e0 <acquire>:
{
801043e0: 55 push %ebp
801043e1: 89 e5 mov %esp,%ebp
801043e3: 56 push %esi
801043e4: 53 push %ebx
pushcli(); // disable interrupts to avoid deadlock.
801043e5: e8 26 ff ff ff call 80104310 <pushcli>
if(holding(lk))
801043ea: 8b 5d 08 mov 0x8(%ebp),%ebx
801043ed: 83 ec 0c sub $0xc,%esp
801043f0: 53 push %ebx
801043f1: e8 ba ff ff ff call 801043b0 <holding>
801043f6: 83 c4 10 add $0x10,%esp
801043f9: 85 c0 test %eax,%eax
801043fb: 0f 85 83 00 00 00 jne 80104484 <acquire+0xa4>
80104401: 89 c6 mov %eax,%esi
asm volatile("lock; xchgl %0, %1" :
80104403: ba 01 00 00 00 mov $0x1,%edx
80104408: eb 09 jmp 80104413 <acquire+0x33>
8010440a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104410: 8b 5d 08 mov 0x8(%ebp),%ebx
80104413: 89 d0 mov %edx,%eax
80104415: f0 87 03 lock xchg %eax,(%ebx)
while(xchg(&lk->locked, 1) != 0)
80104418: 85 c0 test %eax,%eax
8010441a: 75 f4 jne 80104410 <acquire+0x30>
__sync_synchronize();
8010441c: f0 83 0c 24 00 lock orl $0x0,(%esp)
lk->cpu = mycpu();
80104421: 8b 5d 08 mov 0x8(%ebp),%ebx
80104424: e8 17 f3 ff ff call 80103740 <mycpu>
getcallerpcs(&lk, lk->pcs);
80104429: 8d 53 0c lea 0xc(%ebx),%edx
lk->cpu = mycpu();
8010442c: 89 43 08 mov %eax,0x8(%ebx)
ebp = (uint*)v - 2;
8010442f: 89 e8 mov %ebp,%eax
80104431: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80104438: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx
8010443e: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx
80104444: 77 1a ja 80104460 <acquire+0x80>
pcs[i] = ebp[1]; // saved %eip
80104446: 8b 48 04 mov 0x4(%eax),%ecx
80104449: 89 0c b2 mov %ecx,(%edx,%esi,4)
for(i = 0; i < 10; i++){
8010444c: 83 c6 01 add $0x1,%esi
ebp = (uint*)ebp[0]; // saved %ebp
8010444f: 8b 00 mov (%eax),%eax
for(i = 0; i < 10; i++){
80104451: 83 fe 0a cmp $0xa,%esi
80104454: 75 e2 jne 80104438 <acquire+0x58>
}
80104456: 8d 65 f8 lea -0x8(%ebp),%esp
80104459: 5b pop %ebx
8010445a: 5e pop %esi
8010445b: 5d pop %ebp
8010445c: c3 ret
8010445d: 8d 76 00 lea 0x0(%esi),%esi
80104460: 8d 04 b2 lea (%edx,%esi,4),%eax
80104463: 83 c2 28 add $0x28,%edx
80104466: 8d 76 00 lea 0x0(%esi),%esi
80104469: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
pcs[i] = 0;
80104470: c7 00 00 00 00 00 movl $0x0,(%eax)
80104476: 83 c0 04 add $0x4,%eax
for(; i < 10; i++)
80104479: 39 d0 cmp %edx,%eax
8010447b: 75 f3 jne 80104470 <acquire+0x90>
}
8010447d: 8d 65 f8 lea -0x8(%ebp),%esp
80104480: 5b pop %ebx
80104481: 5e pop %esi
80104482: 5d pop %ebp
80104483: c3 ret
panic("acquire");
80104484: 83 ec 0c sub $0xc,%esp
80104487: 68 41 76 10 80 push $0x80107641
8010448c: e8 ff be ff ff call 80100390 <panic>
80104491: eb 0d jmp 801044a0 <release>
80104493: 90 nop
80104494: 90 nop
80104495: 90 nop
80104496: 90 nop
80104497: 90 nop
80104498: 90 nop
80104499: 90 nop
8010449a: 90 nop
8010449b: 90 nop
8010449c: 90 nop
8010449d: 90 nop
8010449e: 90 nop
8010449f: 90 nop
801044a0 <release>:
{
801044a0: 55 push %ebp
801044a1: 89 e5 mov %esp,%ebp
801044a3: 53 push %ebx
801044a4: 83 ec 10 sub $0x10,%esp
801044a7: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holding(lk))
801044aa: 53 push %ebx
801044ab: e8 00 ff ff ff call 801043b0 <holding>
801044b0: 83 c4 10 add $0x10,%esp
801044b3: 85 c0 test %eax,%eax
801044b5: 74 22 je 801044d9 <release+0x39>
lk->pcs[0] = 0;
801044b7: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
lk->cpu = 0;
801044be: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
__sync_synchronize();
801044c5: f0 83 0c 24 00 lock orl $0x0,(%esp)
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
801044ca: c7 03 00 00 00 00 movl $0x0,(%ebx)
}
801044d0: 8b 5d fc mov -0x4(%ebp),%ebx
801044d3: c9 leave
popcli();
801044d4: e9 77 fe ff ff jmp 80104350 <popcli>
panic("release");
801044d9: 83 ec 0c sub $0xc,%esp
801044dc: 68 49 76 10 80 push $0x80107649
801044e1: e8 aa be ff ff call 80100390 <panic>
801044e6: 66 90 xchg %ax,%ax
801044e8: 66 90 xchg %ax,%ax
801044ea: 66 90 xchg %ax,%ax
801044ec: 66 90 xchg %ax,%ax
801044ee: 66 90 xchg %ax,%ax
801044f0 <memset>:
#include "types.h"
#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
801044f0: 55 push %ebp
801044f1: 89 e5 mov %esp,%ebp
801044f3: 57 push %edi
801044f4: 53 push %ebx
801044f5: 8b 55 08 mov 0x8(%ebp),%edx
801044f8: 8b 4d 10 mov 0x10(%ebp),%ecx
if ((int)dst%4 == 0 && n%4 == 0){
801044fb: f6 c2 03 test $0x3,%dl
801044fe: 75 05 jne 80104505 <memset+0x15>
80104500: f6 c1 03 test $0x3,%cl
80104503: 74 13 je 80104518 <memset+0x28>
asm volatile("cld; rep stosb" :
80104505: 89 d7 mov %edx,%edi
80104507: 8b 45 0c mov 0xc(%ebp),%eax
8010450a: fc cld
8010450b: 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;
}
8010450d: 5b pop %ebx
8010450e: 89 d0 mov %edx,%eax
80104510: 5f pop %edi
80104511: 5d pop %ebp
80104512: c3 ret
80104513: 90 nop
80104514: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c &= 0xFF;
80104518: 0f b6 7d 0c movzbl 0xc(%ebp),%edi
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
8010451c: c1 e9 02 shr $0x2,%ecx
8010451f: 89 f8 mov %edi,%eax
80104521: 89 fb mov %edi,%ebx
80104523: c1 e0 18 shl $0x18,%eax
80104526: c1 e3 10 shl $0x10,%ebx
80104529: 09 d8 or %ebx,%eax
8010452b: 09 f8 or %edi,%eax
8010452d: c1 e7 08 shl $0x8,%edi
80104530: 09 f8 or %edi,%eax
asm volatile("cld; rep stosl" :
80104532: 89 d7 mov %edx,%edi
80104534: fc cld
80104535: f3 ab rep stos %eax,%es:(%edi)
}
80104537: 5b pop %ebx
80104538: 89 d0 mov %edx,%eax
8010453a: 5f pop %edi
8010453b: 5d pop %ebp
8010453c: c3 ret
8010453d: 8d 76 00 lea 0x0(%esi),%esi
80104540 <memcmp>:
int
memcmp(const void *v1, const void *v2, uint n)
{
80104540: 55 push %ebp
80104541: 89 e5 mov %esp,%ebp
80104543: 57 push %edi
80104544: 56 push %esi
80104545: 53 push %ebx
80104546: 8b 5d 10 mov 0x10(%ebp),%ebx
80104549: 8b 75 08 mov 0x8(%ebp),%esi
8010454c: 8b 7d 0c mov 0xc(%ebp),%edi
const uchar *s1, *s2;
s1 = v1;
s2 = v2;
while(n-- > 0){
8010454f: 85 db test %ebx,%ebx
80104551: 74 29 je 8010457c <memcmp+0x3c>
if(*s1 != *s2)
80104553: 0f b6 16 movzbl (%esi),%edx
80104556: 0f b6 0f movzbl (%edi),%ecx
80104559: 38 d1 cmp %dl,%cl
8010455b: 75 2b jne 80104588 <memcmp+0x48>
8010455d: b8 01 00 00 00 mov $0x1,%eax
80104562: eb 14 jmp 80104578 <memcmp+0x38>
80104564: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104568: 0f b6 14 06 movzbl (%esi,%eax,1),%edx
8010456c: 83 c0 01 add $0x1,%eax
8010456f: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx
80104574: 38 ca cmp %cl,%dl
80104576: 75 10 jne 80104588 <memcmp+0x48>
while(n-- > 0){
80104578: 39 d8 cmp %ebx,%eax
8010457a: 75 ec jne 80104568 <memcmp+0x28>
return *s1 - *s2;
s1++, s2++;
}
return 0;
}
8010457c: 5b pop %ebx
return 0;
8010457d: 31 c0 xor %eax,%eax
}
8010457f: 5e pop %esi
80104580: 5f pop %edi
80104581: 5d pop %ebp
80104582: c3 ret
80104583: 90 nop
80104584: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return *s1 - *s2;
80104588: 0f b6 c2 movzbl %dl,%eax
}
8010458b: 5b pop %ebx
return *s1 - *s2;
8010458c: 29 c8 sub %ecx,%eax
}
8010458e: 5e pop %esi
8010458f: 5f pop %edi
80104590: 5d pop %ebp
80104591: c3 ret
80104592: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104599: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801045a0 <memmove>:
void*
memmove(void *dst, const void *src, uint n)
{
801045a0: 55 push %ebp
801045a1: 89 e5 mov %esp,%ebp
801045a3: 56 push %esi
801045a4: 53 push %ebx
801045a5: 8b 45 08 mov 0x8(%ebp),%eax
801045a8: 8b 5d 0c mov 0xc(%ebp),%ebx
801045ab: 8b 75 10 mov 0x10(%ebp),%esi
const char *s;
char *d;
s = src;
d = dst;
if(s < d && s + n > d){
801045ae: 39 c3 cmp %eax,%ebx
801045b0: 73 26 jae 801045d8 <memmove+0x38>
801045b2: 8d 0c 33 lea (%ebx,%esi,1),%ecx
801045b5: 39 c8 cmp %ecx,%eax
801045b7: 73 1f jae 801045d8 <memmove+0x38>
s += n;
d += n;
while(n-- > 0)
801045b9: 85 f6 test %esi,%esi
801045bb: 8d 56 ff lea -0x1(%esi),%edx
801045be: 74 0f je 801045cf <memmove+0x2f>
*--d = *--s;
801045c0: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
801045c4: 88 0c 10 mov %cl,(%eax,%edx,1)
while(n-- > 0)
801045c7: 83 ea 01 sub $0x1,%edx
801045ca: 83 fa ff cmp $0xffffffff,%edx
801045cd: 75 f1 jne 801045c0 <memmove+0x20>
} else
while(n-- > 0)
*d++ = *s++;
return dst;
}
801045cf: 5b pop %ebx
801045d0: 5e pop %esi
801045d1: 5d pop %ebp
801045d2: c3 ret
801045d3: 90 nop
801045d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(n-- > 0)
801045d8: 31 d2 xor %edx,%edx
801045da: 85 f6 test %esi,%esi
801045dc: 74 f1 je 801045cf <memmove+0x2f>
801045de: 66 90 xchg %ax,%ax
*d++ = *s++;
801045e0: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
801045e4: 88 0c 10 mov %cl,(%eax,%edx,1)
801045e7: 83 c2 01 add $0x1,%edx
while(n-- > 0)
801045ea: 39 d6 cmp %edx,%esi
801045ec: 75 f2 jne 801045e0 <memmove+0x40>
}
801045ee: 5b pop %ebx
801045ef: 5e pop %esi
801045f0: 5d pop %ebp
801045f1: c3 ret
801045f2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801045f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104600 <memcpy>:
// memcpy exists to placate GCC. Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
80104600: 55 push %ebp
80104601: 89 e5 mov %esp,%ebp
return memmove(dst, src, n);
}
80104603: 5d pop %ebp
return memmove(dst, src, n);
80104604: eb 9a jmp 801045a0 <memmove>
80104606: 8d 76 00 lea 0x0(%esi),%esi
80104609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104610 <strncmp>:
int
strncmp(const char *p, const char *q, uint n)
{
80104610: 55 push %ebp
80104611: 89 e5 mov %esp,%ebp
80104613: 57 push %edi
80104614: 56 push %esi
80104615: 8b 7d 10 mov 0x10(%ebp),%edi
80104618: 53 push %ebx
80104619: 8b 4d 08 mov 0x8(%ebp),%ecx
8010461c: 8b 75 0c mov 0xc(%ebp),%esi
while(n > 0 && *p && *p == *q)
8010461f: 85 ff test %edi,%edi
80104621: 74 2f je 80104652 <strncmp+0x42>
80104623: 0f b6 01 movzbl (%ecx),%eax
80104626: 0f b6 1e movzbl (%esi),%ebx
80104629: 84 c0 test %al,%al
8010462b: 74 37 je 80104664 <strncmp+0x54>
8010462d: 38 c3 cmp %al,%bl
8010462f: 75 33 jne 80104664 <strncmp+0x54>
80104631: 01 f7 add %esi,%edi
80104633: eb 13 jmp 80104648 <strncmp+0x38>
80104635: 8d 76 00 lea 0x0(%esi),%esi
80104638: 0f b6 01 movzbl (%ecx),%eax
8010463b: 84 c0 test %al,%al
8010463d: 74 21 je 80104660 <strncmp+0x50>
8010463f: 0f b6 1a movzbl (%edx),%ebx
80104642: 89 d6 mov %edx,%esi
80104644: 38 d8 cmp %bl,%al
80104646: 75 1c jne 80104664 <strncmp+0x54>
n--, p++, q++;
80104648: 8d 56 01 lea 0x1(%esi),%edx
8010464b: 83 c1 01 add $0x1,%ecx
while(n > 0 && *p && *p == *q)
8010464e: 39 fa cmp %edi,%edx
80104650: 75 e6 jne 80104638 <strncmp+0x28>
if(n == 0)
return 0;
return (uchar)*p - (uchar)*q;
}
80104652: 5b pop %ebx
return 0;
80104653: 31 c0 xor %eax,%eax
}
80104655: 5e pop %esi
80104656: 5f pop %edi
80104657: 5d pop %ebp
80104658: c3 ret
80104659: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104660: 0f b6 5e 01 movzbl 0x1(%esi),%ebx
return (uchar)*p - (uchar)*q;
80104664: 29 d8 sub %ebx,%eax
}
80104666: 5b pop %ebx
80104667: 5e pop %esi
80104668: 5f pop %edi
80104669: 5d pop %ebp
8010466a: c3 ret
8010466b: 90 nop
8010466c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104670 <strncpy>:
char*
strncpy(char *s, const char *t, int n)
{
80104670: 55 push %ebp
80104671: 89 e5 mov %esp,%ebp
80104673: 56 push %esi
80104674: 53 push %ebx
80104675: 8b 45 08 mov 0x8(%ebp),%eax
80104678: 8b 5d 0c mov 0xc(%ebp),%ebx
8010467b: 8b 4d 10 mov 0x10(%ebp),%ecx
char *os;
os = s;
while(n-- > 0 && (*s++ = *t++) != 0)
8010467e: 89 c2 mov %eax,%edx
80104680: eb 19 jmp 8010469b <strncpy+0x2b>
80104682: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104688: 83 c3 01 add $0x1,%ebx
8010468b: 0f b6 4b ff movzbl -0x1(%ebx),%ecx
8010468f: 83 c2 01 add $0x1,%edx
80104692: 84 c9 test %cl,%cl
80104694: 88 4a ff mov %cl,-0x1(%edx)
80104697: 74 09 je 801046a2 <strncpy+0x32>
80104699: 89 f1 mov %esi,%ecx
8010469b: 85 c9 test %ecx,%ecx
8010469d: 8d 71 ff lea -0x1(%ecx),%esi
801046a0: 7f e6 jg 80104688 <strncpy+0x18>
;
while(n-- > 0)
801046a2: 31 c9 xor %ecx,%ecx
801046a4: 85 f6 test %esi,%esi
801046a6: 7e 17 jle 801046bf <strncpy+0x4f>
801046a8: 90 nop
801046a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
*s++ = 0;
801046b0: c6 04 0a 00 movb $0x0,(%edx,%ecx,1)
801046b4: 89 f3 mov %esi,%ebx
801046b6: 83 c1 01 add $0x1,%ecx
801046b9: 29 cb sub %ecx,%ebx
while(n-- > 0)
801046bb: 85 db test %ebx,%ebx
801046bd: 7f f1 jg 801046b0 <strncpy+0x40>
return os;
}
801046bf: 5b pop %ebx
801046c0: 5e pop %esi
801046c1: 5d pop %ebp
801046c2: c3 ret
801046c3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801046c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801046d0 <safestrcpy>:
// Like strncpy but guaranteed to NUL-terminate.
char*
safestrcpy(char *s, const char *t, int n)
{
801046d0: 55 push %ebp
801046d1: 89 e5 mov %esp,%ebp
801046d3: 56 push %esi
801046d4: 53 push %ebx
801046d5: 8b 4d 10 mov 0x10(%ebp),%ecx
801046d8: 8b 45 08 mov 0x8(%ebp),%eax
801046db: 8b 55 0c mov 0xc(%ebp),%edx
char *os;
os = s;
if(n <= 0)
801046de: 85 c9 test %ecx,%ecx
801046e0: 7e 26 jle 80104708 <safestrcpy+0x38>
801046e2: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi
801046e6: 89 c1 mov %eax,%ecx
801046e8: eb 17 jmp 80104701 <safestrcpy+0x31>
801046ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return os;
while(--n > 0 && (*s++ = *t++) != 0)
801046f0: 83 c2 01 add $0x1,%edx
801046f3: 0f b6 5a ff movzbl -0x1(%edx),%ebx
801046f7: 83 c1 01 add $0x1,%ecx
801046fa: 84 db test %bl,%bl
801046fc: 88 59 ff mov %bl,-0x1(%ecx)
801046ff: 74 04 je 80104705 <safestrcpy+0x35>
80104701: 39 f2 cmp %esi,%edx
80104703: 75 eb jne 801046f0 <safestrcpy+0x20>
;
*s = 0;
80104705: c6 01 00 movb $0x0,(%ecx)
return os;
}
80104708: 5b pop %ebx
80104709: 5e pop %esi
8010470a: 5d pop %ebp
8010470b: c3 ret
8010470c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104710 <strlen>:
int
strlen(const char *s)
{
80104710: 55 push %ebp
int n;
for(n = 0; s[n]; n++)
80104711: 31 c0 xor %eax,%eax
{
80104713: 89 e5 mov %esp,%ebp
80104715: 8b 55 08 mov 0x8(%ebp),%edx
for(n = 0; s[n]; n++)
80104718: 80 3a 00 cmpb $0x0,(%edx)
8010471b: 74 0c je 80104729 <strlen+0x19>
8010471d: 8d 76 00 lea 0x0(%esi),%esi
80104720: 83 c0 01 add $0x1,%eax
80104723: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
80104727: 75 f7 jne 80104720 <strlen+0x10>
;
return n;
}
80104729: 5d pop %ebp
8010472a: c3 ret
8010472b <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
8010472b: 8b 44 24 04 mov 0x4(%esp),%eax
movl 8(%esp), %edx
8010472f: 8b 54 24 08 mov 0x8(%esp),%edx
# Save old callee-saved registers
pushl %ebp
80104733: 55 push %ebp
pushl %ebx
80104734: 53 push %ebx
pushl %esi
80104735: 56 push %esi
pushl %edi
80104736: 57 push %edi
# Switch stacks
movl %esp, (%eax)
80104737: 89 20 mov %esp,(%eax)
movl %edx, %esp
80104739: 89 d4 mov %edx,%esp
# Load new callee-saved registers
popl %edi
8010473b: 5f pop %edi
popl %esi
8010473c: 5e pop %esi
popl %ebx
8010473d: 5b pop %ebx
popl %ebp
8010473e: 5d pop %ebp
ret
8010473f: c3 ret
80104740 <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)
{
80104740: 55 push %ebp
80104741: 89 e5 mov %esp,%ebp
80104743: 53 push %ebx
80104744: 83 ec 04 sub $0x4,%esp
80104747: 8b 5d 08 mov 0x8(%ebp),%ebx
struct proc *curproc = myproc();
8010474a: e8 91 f0 ff ff call 801037e0 <myproc>
if(addr >= curproc->sz || addr+4 > curproc->sz)
8010474f: 8b 00 mov (%eax),%eax
80104751: 39 d8 cmp %ebx,%eax
80104753: 76 1b jbe 80104770 <fetchint+0x30>
80104755: 8d 53 04 lea 0x4(%ebx),%edx
80104758: 39 d0 cmp %edx,%eax
8010475a: 72 14 jb 80104770 <fetchint+0x30>
return -1;
*ip = *(int*)(addr);
8010475c: 8b 45 0c mov 0xc(%ebp),%eax
8010475f: 8b 13 mov (%ebx),%edx
80104761: 89 10 mov %edx,(%eax)
return 0;
80104763: 31 c0 xor %eax,%eax
}
80104765: 83 c4 04 add $0x4,%esp
80104768: 5b pop %ebx
80104769: 5d pop %ebp
8010476a: c3 ret
8010476b: 90 nop
8010476c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80104770: b8 ff ff ff ff mov $0xffffffff,%eax
80104775: eb ee jmp 80104765 <fetchint+0x25>
80104777: 89 f6 mov %esi,%esi
80104779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104780 <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)
{
80104780: 55 push %ebp
80104781: 89 e5 mov %esp,%ebp
80104783: 53 push %ebx
80104784: 83 ec 04 sub $0x4,%esp
80104787: 8b 5d 08 mov 0x8(%ebp),%ebx
char *s, *ep;
struct proc *curproc = myproc();
8010478a: e8 51 f0 ff ff call 801037e0 <myproc>
if(addr >= curproc->sz)
8010478f: 39 18 cmp %ebx,(%eax)
80104791: 76 29 jbe 801047bc <fetchstr+0x3c>
return -1;
*pp = (char*)addr;
80104793: 8b 4d 0c mov 0xc(%ebp),%ecx
80104796: 89 da mov %ebx,%edx
80104798: 89 19 mov %ebx,(%ecx)
ep = (char*)curproc->sz;
8010479a: 8b 00 mov (%eax),%eax
for(s = *pp; s < ep; s++){
8010479c: 39 c3 cmp %eax,%ebx
8010479e: 73 1c jae 801047bc <fetchstr+0x3c>
if(*s == 0)
801047a0: 80 3b 00 cmpb $0x0,(%ebx)
801047a3: 75 10 jne 801047b5 <fetchstr+0x35>
801047a5: eb 39 jmp 801047e0 <fetchstr+0x60>
801047a7: 89 f6 mov %esi,%esi
801047a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801047b0: 80 3a 00 cmpb $0x0,(%edx)
801047b3: 74 1b je 801047d0 <fetchstr+0x50>
for(s = *pp; s < ep; s++){
801047b5: 83 c2 01 add $0x1,%edx
801047b8: 39 d0 cmp %edx,%eax
801047ba: 77 f4 ja 801047b0 <fetchstr+0x30>
return -1;
801047bc: b8 ff ff ff ff mov $0xffffffff,%eax
return s - *pp;
}
return -1;
}
801047c1: 83 c4 04 add $0x4,%esp
801047c4: 5b pop %ebx
801047c5: 5d pop %ebp
801047c6: c3 ret
801047c7: 89 f6 mov %esi,%esi
801047c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801047d0: 83 c4 04 add $0x4,%esp
801047d3: 89 d0 mov %edx,%eax
801047d5: 29 d8 sub %ebx,%eax
801047d7: 5b pop %ebx
801047d8: 5d pop %ebp
801047d9: c3 ret
801047da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(*s == 0)
801047e0: 31 c0 xor %eax,%eax
return s - *pp;
801047e2: eb dd jmp 801047c1 <fetchstr+0x41>
801047e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801047ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801047f0 <argint>:
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
801047f0: 55 push %ebp
801047f1: 89 e5 mov %esp,%ebp
801047f3: 56 push %esi
801047f4: 53 push %ebx
return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
801047f5: e8 e6 ef ff ff call 801037e0 <myproc>
801047fa: 8b 40 18 mov 0x18(%eax),%eax
801047fd: 8b 55 08 mov 0x8(%ebp),%edx
80104800: 8b 40 44 mov 0x44(%eax),%eax
80104803: 8d 1c 90 lea (%eax,%edx,4),%ebx
struct proc *curproc = myproc();
80104806: e8 d5 ef ff ff call 801037e0 <myproc>
if(addr >= curproc->sz || addr+4 > curproc->sz)
8010480b: 8b 00 mov (%eax),%eax
return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
8010480d: 8d 73 04 lea 0x4(%ebx),%esi
if(addr >= curproc->sz || addr+4 > curproc->sz)
80104810: 39 c6 cmp %eax,%esi
80104812: 73 1c jae 80104830 <argint+0x40>
80104814: 8d 53 08 lea 0x8(%ebx),%edx
80104817: 39 d0 cmp %edx,%eax
80104819: 72 15 jb 80104830 <argint+0x40>
*ip = *(int*)(addr);
8010481b: 8b 45 0c mov 0xc(%ebp),%eax
8010481e: 8b 53 04 mov 0x4(%ebx),%edx
80104821: 89 10 mov %edx,(%eax)
return 0;
80104823: 31 c0 xor %eax,%eax
}
80104825: 5b pop %ebx
80104826: 5e pop %esi
80104827: 5d pop %ebp
80104828: c3 ret
80104829: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80104830: b8 ff ff ff ff mov $0xffffffff,%eax
return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104835: eb ee jmp 80104825 <argint+0x35>
80104837: 89 f6 mov %esi,%esi
80104839: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104840 <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)
{
80104840: 55 push %ebp
80104841: 89 e5 mov %esp,%ebp
80104843: 56 push %esi
80104844: 53 push %ebx
80104845: 83 ec 10 sub $0x10,%esp
80104848: 8b 5d 10 mov 0x10(%ebp),%ebx
int i;
struct proc *curproc = myproc();
8010484b: e8 90 ef ff ff call 801037e0 <myproc>
80104850: 89 c6 mov %eax,%esi
if(argint(n, &i) < 0)
80104852: 8d 45 f4 lea -0xc(%ebp),%eax
80104855: 83 ec 08 sub $0x8,%esp
80104858: 50 push %eax
80104859: ff 75 08 pushl 0x8(%ebp)
8010485c: e8 8f ff ff ff call 801047f0 <argint>
return -1;
if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz)
80104861: 83 c4 10 add $0x10,%esp
80104864: 85 c0 test %eax,%eax
80104866: 78 28 js 80104890 <argptr+0x50>
80104868: 85 db test %ebx,%ebx
8010486a: 78 24 js 80104890 <argptr+0x50>
8010486c: 8b 16 mov (%esi),%edx
8010486e: 8b 45 f4 mov -0xc(%ebp),%eax
80104871: 39 c2 cmp %eax,%edx
80104873: 76 1b jbe 80104890 <argptr+0x50>
80104875: 01 c3 add %eax,%ebx
80104877: 39 da cmp %ebx,%edx
80104879: 72 15 jb 80104890 <argptr+0x50>
return -1;
*pp = (char*)i;
8010487b: 8b 55 0c mov 0xc(%ebp),%edx
8010487e: 89 02 mov %eax,(%edx)
return 0;
80104880: 31 c0 xor %eax,%eax
}
80104882: 8d 65 f8 lea -0x8(%ebp),%esp
80104885: 5b pop %ebx
80104886: 5e pop %esi
80104887: 5d pop %ebp
80104888: c3 ret
80104889: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80104890: b8 ff ff ff ff mov $0xffffffff,%eax
80104895: eb eb jmp 80104882 <argptr+0x42>
80104897: 89 f6 mov %esi,%esi
80104899: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801048a0 <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)
{
801048a0: 55 push %ebp
801048a1: 89 e5 mov %esp,%ebp
801048a3: 83 ec 20 sub $0x20,%esp
int addr;
if(argint(n, &addr) < 0)
801048a6: 8d 45 f4 lea -0xc(%ebp),%eax
801048a9: 50 push %eax
801048aa: ff 75 08 pushl 0x8(%ebp)
801048ad: e8 3e ff ff ff call 801047f0 <argint>
801048b2: 83 c4 10 add $0x10,%esp
801048b5: 85 c0 test %eax,%eax
801048b7: 78 17 js 801048d0 <argstr+0x30>
return -1;
return fetchstr(addr, pp);
801048b9: 83 ec 08 sub $0x8,%esp
801048bc: ff 75 0c pushl 0xc(%ebp)
801048bf: ff 75 f4 pushl -0xc(%ebp)
801048c2: e8 b9 fe ff ff call 80104780 <fetchstr>
801048c7: 83 c4 10 add $0x10,%esp
}
801048ca: c9 leave
801048cb: c3 ret
801048cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
801048d0: b8 ff ff ff ff mov $0xffffffff,%eax
}
801048d5: c9 leave
801048d6: c3 ret
801048d7: 89 f6 mov %esi,%esi
801048d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801048e0 <syscall>:
[SYS_cv_signal] sys_cv_signal,
};
void
syscall(void)
{
801048e0: 55 push %ebp
801048e1: 89 e5 mov %esp,%ebp
801048e3: 53 push %ebx
801048e4: 83 ec 04 sub $0x4,%esp
int num;
struct proc *curproc = myproc();
801048e7: e8 f4 ee ff ff call 801037e0 <myproc>
801048ec: 89 c3 mov %eax,%ebx
num = curproc->tf->eax;
801048ee: 8b 40 18 mov 0x18(%eax),%eax
801048f1: 8b 40 1c mov 0x1c(%eax),%eax
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
801048f4: 8d 50 ff lea -0x1(%eax),%edx
801048f7: 83 fa 16 cmp $0x16,%edx
801048fa: 77 1c ja 80104918 <syscall+0x38>
801048fc: 8b 14 85 80 76 10 80 mov -0x7fef8980(,%eax,4),%edx
80104903: 85 d2 test %edx,%edx
80104905: 74 11 je 80104918 <syscall+0x38>
curproc->tf->eax = syscalls[num]();
80104907: ff d2 call *%edx
80104909: 8b 53 18 mov 0x18(%ebx),%edx
8010490c: 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;
}
}
8010490f: 8b 5d fc mov -0x4(%ebp),%ebx
80104912: c9 leave
80104913: c3 ret
80104914: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cprintf("%d %s: unknown sys call %d\n",
80104918: 50 push %eax
curproc->pid, curproc->name, num);
80104919: 8d 43 6c lea 0x6c(%ebx),%eax
cprintf("%d %s: unknown sys call %d\n",
8010491c: 50 push %eax
8010491d: ff 73 10 pushl 0x10(%ebx)
80104920: 68 51 76 10 80 push $0x80107651
80104925: e8 36 bd ff ff call 80100660 <cprintf>
curproc->tf->eax = -1;
8010492a: 8b 43 18 mov 0x18(%ebx),%eax
8010492d: 83 c4 10 add $0x10,%esp
80104930: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax)
}
80104937: 8b 5d fc mov -0x4(%ebp),%ebx
8010493a: c9 leave
8010493b: c3 ret
8010493c: 66 90 xchg %ax,%ax
8010493e: 66 90 xchg %ax,%ax
80104940 <create>:
return -1;
}
static struct inode*
create(char *path, short type, short major, short minor)
{
80104940: 55 push %ebp
80104941: 89 e5 mov %esp,%ebp
80104943: 57 push %edi
80104944: 56 push %esi
80104945: 53 push %ebx
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80104946: 8d 75 da lea -0x26(%ebp),%esi
{
80104949: 83 ec 34 sub $0x34,%esp
8010494c: 89 4d d0 mov %ecx,-0x30(%ebp)
8010494f: 8b 4d 08 mov 0x8(%ebp),%ecx
if((dp = nameiparent(path, name)) == 0)
80104952: 56 push %esi
80104953: 50 push %eax
{
80104954: 89 55 d4 mov %edx,-0x2c(%ebp)
80104957: 89 4d cc mov %ecx,-0x34(%ebp)
if((dp = nameiparent(path, name)) == 0)
8010495a: e8 a1 d5 ff ff call 80101f00 <nameiparent>
8010495f: 83 c4 10 add $0x10,%esp
80104962: 85 c0 test %eax,%eax
80104964: 0f 84 46 01 00 00 je 80104ab0 <create+0x170>
return 0;
ilock(dp);
8010496a: 83 ec 0c sub $0xc,%esp
8010496d: 89 c3 mov %eax,%ebx
8010496f: 50 push %eax
80104970: e8 0b cd ff ff call 80101680 <ilock>
if((ip = dirlookup(dp, name, 0)) != 0){
80104975: 83 c4 0c add $0xc,%esp
80104978: 6a 00 push $0x0
8010497a: 56 push %esi
8010497b: 53 push %ebx
8010497c: e8 2f d2 ff ff call 80101bb0 <dirlookup>
80104981: 83 c4 10 add $0x10,%esp
80104984: 85 c0 test %eax,%eax
80104986: 89 c7 mov %eax,%edi
80104988: 74 36 je 801049c0 <create+0x80>
iunlockput(dp);
8010498a: 83 ec 0c sub $0xc,%esp
8010498d: 53 push %ebx
8010498e: e8 7d cf ff ff call 80101910 <iunlockput>
ilock(ip);
80104993: 89 3c 24 mov %edi,(%esp)
80104996: e8 e5 cc ff ff call 80101680 <ilock>
if(type == T_FILE && ip->type == T_FILE)
8010499b: 83 c4 10 add $0x10,%esp
8010499e: 66 83 7d d4 02 cmpw $0x2,-0x2c(%ebp)
801049a3: 0f 85 97 00 00 00 jne 80104a40 <create+0x100>
801049a9: 66 83 7f 50 02 cmpw $0x2,0x50(%edi)
801049ae: 0f 85 8c 00 00 00 jne 80104a40 <create+0x100>
panic("create: dirlink");
iunlockput(dp);
return ip;
}
801049b4: 8d 65 f4 lea -0xc(%ebp),%esp
801049b7: 89 f8 mov %edi,%eax
801049b9: 5b pop %ebx
801049ba: 5e pop %esi
801049bb: 5f pop %edi
801049bc: 5d pop %ebp
801049bd: c3 ret
801049be: 66 90 xchg %ax,%ax
if((ip = ialloc(dp->dev, type)) == 0)
801049c0: 0f bf 45 d4 movswl -0x2c(%ebp),%eax
801049c4: 83 ec 08 sub $0x8,%esp
801049c7: 50 push %eax
801049c8: ff 33 pushl (%ebx)
801049ca: e8 41 cb ff ff call 80101510 <ialloc>
801049cf: 83 c4 10 add $0x10,%esp
801049d2: 85 c0 test %eax,%eax
801049d4: 89 c7 mov %eax,%edi
801049d6: 0f 84 e8 00 00 00 je 80104ac4 <create+0x184>
ilock(ip);
801049dc: 83 ec 0c sub $0xc,%esp
801049df: 50 push %eax
801049e0: e8 9b cc ff ff call 80101680 <ilock>
ip->major = major;
801049e5: 0f b7 45 d0 movzwl -0x30(%ebp),%eax
801049e9: 66 89 47 52 mov %ax,0x52(%edi)
ip->minor = minor;
801049ed: 0f b7 45 cc movzwl -0x34(%ebp),%eax
801049f1: 66 89 47 54 mov %ax,0x54(%edi)
ip->nlink = 1;
801049f5: b8 01 00 00 00 mov $0x1,%eax
801049fa: 66 89 47 56 mov %ax,0x56(%edi)
iupdate(ip);
801049fe: 89 3c 24 mov %edi,(%esp)
80104a01: e8 ca cb ff ff call 801015d0 <iupdate>
if(type == T_DIR){ // Create . and .. entries.
80104a06: 83 c4 10 add $0x10,%esp
80104a09: 66 83 7d d4 01 cmpw $0x1,-0x2c(%ebp)
80104a0e: 74 50 je 80104a60 <create+0x120>
if(dirlink(dp, name, ip->inum) < 0)
80104a10: 83 ec 04 sub $0x4,%esp
80104a13: ff 77 04 pushl 0x4(%edi)
80104a16: 56 push %esi
80104a17: 53 push %ebx
80104a18: e8 03 d4 ff ff call 80101e20 <dirlink>
80104a1d: 83 c4 10 add $0x10,%esp
80104a20: 85 c0 test %eax,%eax
80104a22: 0f 88 8f 00 00 00 js 80104ab7 <create+0x177>
iunlockput(dp);
80104a28: 83 ec 0c sub $0xc,%esp
80104a2b: 53 push %ebx
80104a2c: e8 df ce ff ff call 80101910 <iunlockput>
return ip;
80104a31: 83 c4 10 add $0x10,%esp
}
80104a34: 8d 65 f4 lea -0xc(%ebp),%esp
80104a37: 89 f8 mov %edi,%eax
80104a39: 5b pop %ebx
80104a3a: 5e pop %esi
80104a3b: 5f pop %edi
80104a3c: 5d pop %ebp
80104a3d: c3 ret
80104a3e: 66 90 xchg %ax,%ax
iunlockput(ip);
80104a40: 83 ec 0c sub $0xc,%esp
80104a43: 57 push %edi
return 0;
80104a44: 31 ff xor %edi,%edi
iunlockput(ip);
80104a46: e8 c5 ce ff ff call 80101910 <iunlockput>
return 0;
80104a4b: 83 c4 10 add $0x10,%esp
}
80104a4e: 8d 65 f4 lea -0xc(%ebp),%esp
80104a51: 89 f8 mov %edi,%eax
80104a53: 5b pop %ebx
80104a54: 5e pop %esi
80104a55: 5f pop %edi
80104a56: 5d pop %ebp
80104a57: c3 ret
80104a58: 90 nop
80104a59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
dp->nlink++; // for ".."
80104a60: 66 83 43 56 01 addw $0x1,0x56(%ebx)
iupdate(dp);
80104a65: 83 ec 0c sub $0xc,%esp
80104a68: 53 push %ebx
80104a69: e8 62 cb ff ff call 801015d0 <iupdate>
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
80104a6e: 83 c4 0c add $0xc,%esp
80104a71: ff 77 04 pushl 0x4(%edi)
80104a74: 68 fc 76 10 80 push $0x801076fc
80104a79: 57 push %edi
80104a7a: e8 a1 d3 ff ff call 80101e20 <dirlink>
80104a7f: 83 c4 10 add $0x10,%esp
80104a82: 85 c0 test %eax,%eax
80104a84: 78 1c js 80104aa2 <create+0x162>
80104a86: 83 ec 04 sub $0x4,%esp
80104a89: ff 73 04 pushl 0x4(%ebx)
80104a8c: 68 fb 76 10 80 push $0x801076fb
80104a91: 57 push %edi
80104a92: e8 89 d3 ff ff call 80101e20 <dirlink>
80104a97: 83 c4 10 add $0x10,%esp
80104a9a: 85 c0 test %eax,%eax
80104a9c: 0f 89 6e ff ff ff jns 80104a10 <create+0xd0>
panic("create dots");
80104aa2: 83 ec 0c sub $0xc,%esp
80104aa5: 68 ef 76 10 80 push $0x801076ef
80104aaa: e8 e1 b8 ff ff call 80100390 <panic>
80104aaf: 90 nop
return 0;
80104ab0: 31 ff xor %edi,%edi
80104ab2: e9 fd fe ff ff jmp 801049b4 <create+0x74>
panic("create: dirlink");
80104ab7: 83 ec 0c sub $0xc,%esp
80104aba: 68 fe 76 10 80 push $0x801076fe
80104abf: e8 cc b8 ff ff call 80100390 <panic>
panic("create: ialloc");
80104ac4: 83 ec 0c sub $0xc,%esp
80104ac7: 68 e0 76 10 80 push $0x801076e0
80104acc: e8 bf b8 ff ff call 80100390 <panic>
80104ad1: eb 0d jmp 80104ae0 <argfd.constprop.0>
80104ad3: 90 nop
80104ad4: 90 nop
80104ad5: 90 nop
80104ad6: 90 nop
80104ad7: 90 nop
80104ad8: 90 nop
80104ad9: 90 nop
80104ada: 90 nop
80104adb: 90 nop
80104adc: 90 nop
80104add: 90 nop
80104ade: 90 nop
80104adf: 90 nop
80104ae0 <argfd.constprop.0>:
argfd(int n, int *pfd, struct file **pf)
80104ae0: 55 push %ebp
80104ae1: 89 e5 mov %esp,%ebp
80104ae3: 56 push %esi
80104ae4: 53 push %ebx
80104ae5: 89 c3 mov %eax,%ebx
if(argint(n, &fd) < 0)
80104ae7: 8d 45 f4 lea -0xc(%ebp),%eax
argfd(int n, int *pfd, struct file **pf)
80104aea: 89 d6 mov %edx,%esi
80104aec: 83 ec 18 sub $0x18,%esp
if(argint(n, &fd) < 0)
80104aef: 50 push %eax
80104af0: 6a 00 push $0x0
80104af2: e8 f9 fc ff ff call 801047f0 <argint>
80104af7: 83 c4 10 add $0x10,%esp
80104afa: 85 c0 test %eax,%eax
80104afc: 78 2a js 80104b28 <argfd.constprop.0+0x48>
if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
80104afe: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
80104b02: 77 24 ja 80104b28 <argfd.constprop.0+0x48>
80104b04: e8 d7 ec ff ff call 801037e0 <myproc>
80104b09: 8b 55 f4 mov -0xc(%ebp),%edx
80104b0c: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax
80104b10: 85 c0 test %eax,%eax
80104b12: 74 14 je 80104b28 <argfd.constprop.0+0x48>
if(pfd)
80104b14: 85 db test %ebx,%ebx
80104b16: 74 02 je 80104b1a <argfd.constprop.0+0x3a>
*pfd = fd;
80104b18: 89 13 mov %edx,(%ebx)
*pf = f;
80104b1a: 89 06 mov %eax,(%esi)
return 0;
80104b1c: 31 c0 xor %eax,%eax
}
80104b1e: 8d 65 f8 lea -0x8(%ebp),%esp
80104b21: 5b pop %ebx
80104b22: 5e pop %esi
80104b23: 5d pop %ebp
80104b24: c3 ret
80104b25: 8d 76 00 lea 0x0(%esi),%esi
return -1;
80104b28: b8 ff ff ff ff mov $0xffffffff,%eax
80104b2d: eb ef jmp 80104b1e <argfd.constprop.0+0x3e>
80104b2f: 90 nop
80104b30 <sys_dup>:
{
80104b30: 55 push %ebp
if(argfd(0, 0, &f) < 0)
80104b31: 31 c0 xor %eax,%eax
{
80104b33: 89 e5 mov %esp,%ebp
80104b35: 56 push %esi
80104b36: 53 push %ebx
if(argfd(0, 0, &f) < 0)
80104b37: 8d 55 f4 lea -0xc(%ebp),%edx
{
80104b3a: 83 ec 10 sub $0x10,%esp
if(argfd(0, 0, &f) < 0)
80104b3d: e8 9e ff ff ff call 80104ae0 <argfd.constprop.0>
80104b42: 85 c0 test %eax,%eax
80104b44: 78 42 js 80104b88 <sys_dup+0x58>
if((fd=fdalloc(f)) < 0)
80104b46: 8b 75 f4 mov -0xc(%ebp),%esi
for(fd = 0; fd < NOFILE; fd++){
80104b49: 31 db xor %ebx,%ebx
struct proc *curproc = myproc();
80104b4b: e8 90 ec ff ff call 801037e0 <myproc>
80104b50: eb 0e jmp 80104b60 <sys_dup+0x30>
80104b52: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(fd = 0; fd < NOFILE; fd++){
80104b58: 83 c3 01 add $0x1,%ebx
80104b5b: 83 fb 10 cmp $0x10,%ebx
80104b5e: 74 28 je 80104b88 <sys_dup+0x58>
if(curproc->ofile[fd] == 0){
80104b60: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx
80104b64: 85 d2 test %edx,%edx
80104b66: 75 f0 jne 80104b58 <sys_dup+0x28>
curproc->ofile[fd] = f;
80104b68: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4)
filedup(f);
80104b6c: 83 ec 0c sub $0xc,%esp
80104b6f: ff 75 f4 pushl -0xc(%ebp)
80104b72: e8 79 c2 ff ff call 80100df0 <filedup>
return fd;
80104b77: 83 c4 10 add $0x10,%esp
}
80104b7a: 8d 65 f8 lea -0x8(%ebp),%esp
80104b7d: 89 d8 mov %ebx,%eax
80104b7f: 5b pop %ebx
80104b80: 5e pop %esi
80104b81: 5d pop %ebp
80104b82: c3 ret
80104b83: 90 nop
80104b84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104b88: 8d 65 f8 lea -0x8(%ebp),%esp
return -1;
80104b8b: bb ff ff ff ff mov $0xffffffff,%ebx
}
80104b90: 89 d8 mov %ebx,%eax
80104b92: 5b pop %ebx
80104b93: 5e pop %esi
80104b94: 5d pop %ebp
80104b95: c3 ret
80104b96: 8d 76 00 lea 0x0(%esi),%esi
80104b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104ba0 <sys_read>:
{
80104ba0: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104ba1: 31 c0 xor %eax,%eax
{
80104ba3: 89 e5 mov %esp,%ebp
80104ba5: 83 ec 18 sub $0x18,%esp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104ba8: 8d 55 ec lea -0x14(%ebp),%edx
80104bab: e8 30 ff ff ff call 80104ae0 <argfd.constprop.0>
80104bb0: 85 c0 test %eax,%eax
80104bb2: 78 4c js 80104c00 <sys_read+0x60>
80104bb4: 8d 45 f0 lea -0x10(%ebp),%eax
80104bb7: 83 ec 08 sub $0x8,%esp
80104bba: 50 push %eax
80104bbb: 6a 02 push $0x2
80104bbd: e8 2e fc ff ff call 801047f0 <argint>
80104bc2: 83 c4 10 add $0x10,%esp
80104bc5: 85 c0 test %eax,%eax
80104bc7: 78 37 js 80104c00 <sys_read+0x60>
80104bc9: 8d 45 f4 lea -0xc(%ebp),%eax
80104bcc: 83 ec 04 sub $0x4,%esp
80104bcf: ff 75 f0 pushl -0x10(%ebp)
80104bd2: 50 push %eax
80104bd3: 6a 01 push $0x1
80104bd5: e8 66 fc ff ff call 80104840 <argptr>
80104bda: 83 c4 10 add $0x10,%esp
80104bdd: 85 c0 test %eax,%eax
80104bdf: 78 1f js 80104c00 <sys_read+0x60>
return fileread(f, p, n);
80104be1: 83 ec 04 sub $0x4,%esp
80104be4: ff 75 f0 pushl -0x10(%ebp)
80104be7: ff 75 f4 pushl -0xc(%ebp)
80104bea: ff 75 ec pushl -0x14(%ebp)
80104bed: e8 6e c3 ff ff call 80100f60 <fileread>
80104bf2: 83 c4 10 add $0x10,%esp
}
80104bf5: c9 leave
80104bf6: c3 ret
80104bf7: 89 f6 mov %esi,%esi
80104bf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
80104c00: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104c05: c9 leave
80104c06: c3 ret
80104c07: 89 f6 mov %esi,%esi
80104c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104c10 <sys_write>:
{
80104c10: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104c11: 31 c0 xor %eax,%eax
{
80104c13: 89 e5 mov %esp,%ebp
80104c15: 83 ec 18 sub $0x18,%esp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104c18: 8d 55 ec lea -0x14(%ebp),%edx
80104c1b: e8 c0 fe ff ff call 80104ae0 <argfd.constprop.0>
80104c20: 85 c0 test %eax,%eax
80104c22: 78 4c js 80104c70 <sys_write+0x60>
80104c24: 8d 45 f0 lea -0x10(%ebp),%eax
80104c27: 83 ec 08 sub $0x8,%esp
80104c2a: 50 push %eax
80104c2b: 6a 02 push $0x2
80104c2d: e8 be fb ff ff call 801047f0 <argint>
80104c32: 83 c4 10 add $0x10,%esp
80104c35: 85 c0 test %eax,%eax
80104c37: 78 37 js 80104c70 <sys_write+0x60>
80104c39: 8d 45 f4 lea -0xc(%ebp),%eax
80104c3c: 83 ec 04 sub $0x4,%esp
80104c3f: ff 75 f0 pushl -0x10(%ebp)
80104c42: 50 push %eax
80104c43: 6a 01 push $0x1
80104c45: e8 f6 fb ff ff call 80104840 <argptr>
80104c4a: 83 c4 10 add $0x10,%esp
80104c4d: 85 c0 test %eax,%eax
80104c4f: 78 1f js 80104c70 <sys_write+0x60>
return filewrite(f, p, n);
80104c51: 83 ec 04 sub $0x4,%esp
80104c54: ff 75 f0 pushl -0x10(%ebp)
80104c57: ff 75 f4 pushl -0xc(%ebp)
80104c5a: ff 75 ec pushl -0x14(%ebp)
80104c5d: e8 8e c3 ff ff call 80100ff0 <filewrite>
80104c62: 83 c4 10 add $0x10,%esp
}
80104c65: c9 leave
80104c66: c3 ret
80104c67: 89 f6 mov %esi,%esi
80104c69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
80104c70: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104c75: c9 leave
80104c76: c3 ret
80104c77: 89 f6 mov %esi,%esi
80104c79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104c80 <sys_close>:
{
80104c80: 55 push %ebp
80104c81: 89 e5 mov %esp,%ebp
80104c83: 83 ec 18 sub $0x18,%esp
if(argfd(0, &fd, &f) < 0)
80104c86: 8d 55 f4 lea -0xc(%ebp),%edx
80104c89: 8d 45 f0 lea -0x10(%ebp),%eax
80104c8c: e8 4f fe ff ff call 80104ae0 <argfd.constprop.0>
80104c91: 85 c0 test %eax,%eax
80104c93: 78 2b js 80104cc0 <sys_close+0x40>
myproc()->ofile[fd] = 0;
80104c95: e8 46 eb ff ff call 801037e0 <myproc>
80104c9a: 8b 55 f0 mov -0x10(%ebp),%edx
fileclose(f);
80104c9d: 83 ec 0c sub $0xc,%esp
myproc()->ofile[fd] = 0;
80104ca0: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4)
80104ca7: 00
fileclose(f);
80104ca8: ff 75 f4 pushl -0xc(%ebp)
80104cab: e8 90 c1 ff ff call 80100e40 <fileclose>
return 0;
80104cb0: 83 c4 10 add $0x10,%esp
80104cb3: 31 c0 xor %eax,%eax
}
80104cb5: c9 leave
80104cb6: c3 ret
80104cb7: 89 f6 mov %esi,%esi
80104cb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
80104cc0: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104cc5: c9 leave
80104cc6: c3 ret
80104cc7: 89 f6 mov %esi,%esi
80104cc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104cd0 <sys_fstat>:
{
80104cd0: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80104cd1: 31 c0 xor %eax,%eax
{
80104cd3: 89 e5 mov %esp,%ebp
80104cd5: 83 ec 18 sub $0x18,%esp
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80104cd8: 8d 55 f0 lea -0x10(%ebp),%edx
80104cdb: e8 00 fe ff ff call 80104ae0 <argfd.constprop.0>
80104ce0: 85 c0 test %eax,%eax
80104ce2: 78 2c js 80104d10 <sys_fstat+0x40>
80104ce4: 8d 45 f4 lea -0xc(%ebp),%eax
80104ce7: 83 ec 04 sub $0x4,%esp
80104cea: 6a 14 push $0x14
80104cec: 50 push %eax
80104ced: 6a 01 push $0x1
80104cef: e8 4c fb ff ff call 80104840 <argptr>
80104cf4: 83 c4 10 add $0x10,%esp
80104cf7: 85 c0 test %eax,%eax
80104cf9: 78 15 js 80104d10 <sys_fstat+0x40>
return filestat(f, st);
80104cfb: 83 ec 08 sub $0x8,%esp
80104cfe: ff 75 f4 pushl -0xc(%ebp)
80104d01: ff 75 f0 pushl -0x10(%ebp)
80104d04: e8 07 c2 ff ff call 80100f10 <filestat>
80104d09: 83 c4 10 add $0x10,%esp
}
80104d0c: c9 leave
80104d0d: c3 ret
80104d0e: 66 90 xchg %ax,%ax
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_link>:
{
80104d20: 55 push %ebp
80104d21: 89 e5 mov %esp,%ebp
80104d23: 57 push %edi
80104d24: 56 push %esi
80104d25: 53 push %ebx
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80104d26: 8d 45 d4 lea -0x2c(%ebp),%eax
{
80104d29: 83 ec 34 sub $0x34,%esp
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80104d2c: 50 push %eax
80104d2d: 6a 00 push $0x0
80104d2f: e8 6c fb ff ff call 801048a0 <argstr>
80104d34: 83 c4 10 add $0x10,%esp
80104d37: 85 c0 test %eax,%eax
80104d39: 0f 88 fb 00 00 00 js 80104e3a <sys_link+0x11a>
80104d3f: 8d 45 d0 lea -0x30(%ebp),%eax
80104d42: 83 ec 08 sub $0x8,%esp
80104d45: 50 push %eax
80104d46: 6a 01 push $0x1
80104d48: e8 53 fb ff ff call 801048a0 <argstr>
80104d4d: 83 c4 10 add $0x10,%esp
80104d50: 85 c0 test %eax,%eax
80104d52: 0f 88 e2 00 00 00 js 80104e3a <sys_link+0x11a>
begin_op();
80104d58: e8 43 de ff ff call 80102ba0 <begin_op>
if((ip = namei(old)) == 0){
80104d5d: 83 ec 0c sub $0xc,%esp
80104d60: ff 75 d4 pushl -0x2c(%ebp)
80104d63: e8 78 d1 ff ff call 80101ee0 <namei>
80104d68: 83 c4 10 add $0x10,%esp
80104d6b: 85 c0 test %eax,%eax
80104d6d: 89 c3 mov %eax,%ebx
80104d6f: 0f 84 ea 00 00 00 je 80104e5f <sys_link+0x13f>
ilock(ip);
80104d75: 83 ec 0c sub $0xc,%esp
80104d78: 50 push %eax
80104d79: e8 02 c9 ff ff call 80101680 <ilock>
if(ip->type == T_DIR){
80104d7e: 83 c4 10 add $0x10,%esp
80104d81: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80104d86: 0f 84 bb 00 00 00 je 80104e47 <sys_link+0x127>
ip->nlink++;
80104d8c: 66 83 43 56 01 addw $0x1,0x56(%ebx)
iupdate(ip);
80104d91: 83 ec 0c sub $0xc,%esp
if((dp = nameiparent(new, name)) == 0)
80104d94: 8d 7d da lea -0x26(%ebp),%edi
iupdate(ip);
80104d97: 53 push %ebx
80104d98: e8 33 c8 ff ff call 801015d0 <iupdate>
iunlock(ip);
80104d9d: 89 1c 24 mov %ebx,(%esp)
80104da0: e8 bb c9 ff ff call 80101760 <iunlock>
if((dp = nameiparent(new, name)) == 0)
80104da5: 58 pop %eax
80104da6: 5a pop %edx
80104da7: 57 push %edi
80104da8: ff 75 d0 pushl -0x30(%ebp)
80104dab: e8 50 d1 ff ff call 80101f00 <nameiparent>
80104db0: 83 c4 10 add $0x10,%esp
80104db3: 85 c0 test %eax,%eax
80104db5: 89 c6 mov %eax,%esi
80104db7: 74 5b je 80104e14 <sys_link+0xf4>
ilock(dp);
80104db9: 83 ec 0c sub $0xc,%esp
80104dbc: 50 push %eax
80104dbd: e8 be c8 ff ff call 80101680 <ilock>
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
80104dc2: 83 c4 10 add $0x10,%esp
80104dc5: 8b 03 mov (%ebx),%eax
80104dc7: 39 06 cmp %eax,(%esi)
80104dc9: 75 3d jne 80104e08 <sys_link+0xe8>
80104dcb: 83 ec 04 sub $0x4,%esp
80104dce: ff 73 04 pushl 0x4(%ebx)
80104dd1: 57 push %edi
80104dd2: 56 push %esi
80104dd3: e8 48 d0 ff ff call 80101e20 <dirlink>
80104dd8: 83 c4 10 add $0x10,%esp
80104ddb: 85 c0 test %eax,%eax
80104ddd: 78 29 js 80104e08 <sys_link+0xe8>
iunlockput(dp);
80104ddf: 83 ec 0c sub $0xc,%esp
80104de2: 56 push %esi
80104de3: e8 28 cb ff ff call 80101910 <iunlockput>
iput(ip);
80104de8: 89 1c 24 mov %ebx,(%esp)
80104deb: e8 c0 c9 ff ff call 801017b0 <iput>
end_op();
80104df0: e8 1b de ff ff call 80102c10 <end_op>
return 0;
80104df5: 83 c4 10 add $0x10,%esp
80104df8: 31 c0 xor %eax,%eax
}
80104dfa: 8d 65 f4 lea -0xc(%ebp),%esp
80104dfd: 5b pop %ebx
80104dfe: 5e pop %esi
80104dff: 5f pop %edi
80104e00: 5d pop %ebp
80104e01: c3 ret
80104e02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
iunlockput(dp);
80104e08: 83 ec 0c sub $0xc,%esp
80104e0b: 56 push %esi
80104e0c: e8 ff ca ff ff call 80101910 <iunlockput>
goto bad;
80104e11: 83 c4 10 add $0x10,%esp
ilock(ip);
80104e14: 83 ec 0c sub $0xc,%esp
80104e17: 53 push %ebx
80104e18: e8 63 c8 ff ff call 80101680 <ilock>
ip->nlink--;
80104e1d: 66 83 6b 56 01 subw $0x1,0x56(%ebx)
iupdate(ip);
80104e22: 89 1c 24 mov %ebx,(%esp)
80104e25: e8 a6 c7 ff ff call 801015d0 <iupdate>
iunlockput(ip);
80104e2a: 89 1c 24 mov %ebx,(%esp)
80104e2d: e8 de ca ff ff call 80101910 <iunlockput>
end_op();
80104e32: e8 d9 dd ff ff call 80102c10 <end_op>
return -1;
80104e37: 83 c4 10 add $0x10,%esp
}
80104e3a: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
80104e3d: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104e42: 5b pop %ebx
80104e43: 5e pop %esi
80104e44: 5f pop %edi
80104e45: 5d pop %ebp
80104e46: c3 ret
iunlockput(ip);
80104e47: 83 ec 0c sub $0xc,%esp
80104e4a: 53 push %ebx
80104e4b: e8 c0 ca ff ff call 80101910 <iunlockput>
end_op();
80104e50: e8 bb dd ff ff call 80102c10 <end_op>
return -1;
80104e55: 83 c4 10 add $0x10,%esp
80104e58: b8 ff ff ff ff mov $0xffffffff,%eax
80104e5d: eb 9b jmp 80104dfa <sys_link+0xda>
end_op();
80104e5f: e8 ac dd ff ff call 80102c10 <end_op>
return -1;
80104e64: b8 ff ff ff ff mov $0xffffffff,%eax
80104e69: eb 8f jmp 80104dfa <sys_link+0xda>
80104e6b: 90 nop
80104e6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104e70 <sys_unlink>:
{
80104e70: 55 push %ebp
80104e71: 89 e5 mov %esp,%ebp
80104e73: 57 push %edi
80104e74: 56 push %esi
80104e75: 53 push %ebx
if(argstr(0, &path) < 0)
80104e76: 8d 45 c0 lea -0x40(%ebp),%eax
{
80104e79: 83 ec 44 sub $0x44,%esp
if(argstr(0, &path) < 0)
80104e7c: 50 push %eax
80104e7d: 6a 00 push $0x0
80104e7f: e8 1c fa ff ff call 801048a0 <argstr>
80104e84: 83 c4 10 add $0x10,%esp
80104e87: 85 c0 test %eax,%eax
80104e89: 0f 88 77 01 00 00 js 80105006 <sys_unlink+0x196>
if((dp = nameiparent(path, name)) == 0){
80104e8f: 8d 5d ca lea -0x36(%ebp),%ebx
begin_op();
80104e92: e8 09 dd ff ff call 80102ba0 <begin_op>
if((dp = nameiparent(path, name)) == 0){
80104e97: 83 ec 08 sub $0x8,%esp
80104e9a: 53 push %ebx
80104e9b: ff 75 c0 pushl -0x40(%ebp)
80104e9e: e8 5d d0 ff ff call 80101f00 <nameiparent>
80104ea3: 83 c4 10 add $0x10,%esp
80104ea6: 85 c0 test %eax,%eax
80104ea8: 89 c6 mov %eax,%esi
80104eaa: 0f 84 60 01 00 00 je 80105010 <sys_unlink+0x1a0>
ilock(dp);
80104eb0: 83 ec 0c sub $0xc,%esp
80104eb3: 50 push %eax
80104eb4: e8 c7 c7 ff ff call 80101680 <ilock>
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
80104eb9: 58 pop %eax
80104eba: 5a pop %edx
80104ebb: 68 fc 76 10 80 push $0x801076fc
80104ec0: 53 push %ebx
80104ec1: e8 ca cc ff ff call 80101b90 <namecmp>
80104ec6: 83 c4 10 add $0x10,%esp
80104ec9: 85 c0 test %eax,%eax
80104ecb: 0f 84 03 01 00 00 je 80104fd4 <sys_unlink+0x164>
80104ed1: 83 ec 08 sub $0x8,%esp
80104ed4: 68 fb 76 10 80 push $0x801076fb
80104ed9: 53 push %ebx
80104eda: e8 b1 cc ff ff call 80101b90 <namecmp>
80104edf: 83 c4 10 add $0x10,%esp
80104ee2: 85 c0 test %eax,%eax
80104ee4: 0f 84 ea 00 00 00 je 80104fd4 <sys_unlink+0x164>
if((ip = dirlookup(dp, name, &off)) == 0)
80104eea: 8d 45 c4 lea -0x3c(%ebp),%eax
80104eed: 83 ec 04 sub $0x4,%esp
80104ef0: 50 push %eax
80104ef1: 53 push %ebx
80104ef2: 56 push %esi
80104ef3: e8 b8 cc ff ff call 80101bb0 <dirlookup>
80104ef8: 83 c4 10 add $0x10,%esp
80104efb: 85 c0 test %eax,%eax
80104efd: 89 c3 mov %eax,%ebx
80104eff: 0f 84 cf 00 00 00 je 80104fd4 <sys_unlink+0x164>
ilock(ip);
80104f05: 83 ec 0c sub $0xc,%esp
80104f08: 50 push %eax
80104f09: e8 72 c7 ff ff call 80101680 <ilock>
if(ip->nlink < 1)
80104f0e: 83 c4 10 add $0x10,%esp
80104f11: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx)
80104f16: 0f 8e 10 01 00 00 jle 8010502c <sys_unlink+0x1bc>
if(ip->type == T_DIR && !isdirempty(ip)){
80104f1c: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80104f21: 74 6d je 80104f90 <sys_unlink+0x120>
memset(&de, 0, sizeof(de));
80104f23: 8d 45 d8 lea -0x28(%ebp),%eax
80104f26: 83 ec 04 sub $0x4,%esp
80104f29: 6a 10 push $0x10
80104f2b: 6a 00 push $0x0
80104f2d: 50 push %eax
80104f2e: e8 bd f5 ff ff call 801044f0 <memset>
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80104f33: 8d 45 d8 lea -0x28(%ebp),%eax
80104f36: 6a 10 push $0x10
80104f38: ff 75 c4 pushl -0x3c(%ebp)
80104f3b: 50 push %eax
80104f3c: 56 push %esi
80104f3d: e8 1e cb ff ff call 80101a60 <writei>
80104f42: 83 c4 20 add $0x20,%esp
80104f45: 83 f8 10 cmp $0x10,%eax
80104f48: 0f 85 eb 00 00 00 jne 80105039 <sys_unlink+0x1c9>
if(ip->type == T_DIR){
80104f4e: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80104f53: 0f 84 97 00 00 00 je 80104ff0 <sys_unlink+0x180>
iunlockput(dp);
80104f59: 83 ec 0c sub $0xc,%esp
80104f5c: 56 push %esi
80104f5d: e8 ae c9 ff ff call 80101910 <iunlockput>
ip->nlink--;
80104f62: 66 83 6b 56 01 subw $0x1,0x56(%ebx)
iupdate(ip);
80104f67: 89 1c 24 mov %ebx,(%esp)
80104f6a: e8 61 c6 ff ff call 801015d0 <iupdate>
iunlockput(ip);
80104f6f: 89 1c 24 mov %ebx,(%esp)
80104f72: e8 99 c9 ff ff call 80101910 <iunlockput>
end_op();
80104f77: e8 94 dc ff ff call 80102c10 <end_op>
return 0;
80104f7c: 83 c4 10 add $0x10,%esp
80104f7f: 31 c0 xor %eax,%eax
}
80104f81: 8d 65 f4 lea -0xc(%ebp),%esp
80104f84: 5b pop %ebx
80104f85: 5e pop %esi
80104f86: 5f pop %edi
80104f87: 5d pop %ebp
80104f88: c3 ret
80104f89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80104f90: 83 7b 58 20 cmpl $0x20,0x58(%ebx)
80104f94: 76 8d jbe 80104f23 <sys_unlink+0xb3>
80104f96: bf 20 00 00 00 mov $0x20,%edi
80104f9b: eb 0f jmp 80104fac <sys_unlink+0x13c>
80104f9d: 8d 76 00 lea 0x0(%esi),%esi
80104fa0: 83 c7 10 add $0x10,%edi
80104fa3: 3b 7b 58 cmp 0x58(%ebx),%edi
80104fa6: 0f 83 77 ff ff ff jae 80104f23 <sys_unlink+0xb3>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80104fac: 8d 45 d8 lea -0x28(%ebp),%eax
80104faf: 6a 10 push $0x10
80104fb1: 57 push %edi
80104fb2: 50 push %eax
80104fb3: 53 push %ebx
80104fb4: e8 a7 c9 ff ff call 80101960 <readi>
80104fb9: 83 c4 10 add $0x10,%esp
80104fbc: 83 f8 10 cmp $0x10,%eax
80104fbf: 75 5e jne 8010501f <sys_unlink+0x1af>
if(de.inum != 0)
80104fc1: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80104fc6: 74 d8 je 80104fa0 <sys_unlink+0x130>
iunlockput(ip);
80104fc8: 83 ec 0c sub $0xc,%esp
80104fcb: 53 push %ebx
80104fcc: e8 3f c9 ff ff call 80101910 <iunlockput>
goto bad;
80104fd1: 83 c4 10 add $0x10,%esp
iunlockput(dp);
80104fd4: 83 ec 0c sub $0xc,%esp
80104fd7: 56 push %esi
80104fd8: e8 33 c9 ff ff call 80101910 <iunlockput>
end_op();
80104fdd: e8 2e dc ff ff call 80102c10 <end_op>
return -1;
80104fe2: 83 c4 10 add $0x10,%esp
80104fe5: b8 ff ff ff ff mov $0xffffffff,%eax
80104fea: eb 95 jmp 80104f81 <sys_unlink+0x111>
80104fec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
dp->nlink--;
80104ff0: 66 83 6e 56 01 subw $0x1,0x56(%esi)
iupdate(dp);
80104ff5: 83 ec 0c sub $0xc,%esp
80104ff8: 56 push %esi
80104ff9: e8 d2 c5 ff ff call 801015d0 <iupdate>
80104ffe: 83 c4 10 add $0x10,%esp
80105001: e9 53 ff ff ff jmp 80104f59 <sys_unlink+0xe9>
return -1;
80105006: b8 ff ff ff ff mov $0xffffffff,%eax
8010500b: e9 71 ff ff ff jmp 80104f81 <sys_unlink+0x111>
end_op();
80105010: e8 fb db ff ff call 80102c10 <end_op>
return -1;
80105015: b8 ff ff ff ff mov $0xffffffff,%eax
8010501a: e9 62 ff ff ff jmp 80104f81 <sys_unlink+0x111>
panic("isdirempty: readi");
8010501f: 83 ec 0c sub $0xc,%esp
80105022: 68 20 77 10 80 push $0x80107720
80105027: e8 64 b3 ff ff call 80100390 <panic>
panic("unlink: nlink < 1");
8010502c: 83 ec 0c sub $0xc,%esp
8010502f: 68 0e 77 10 80 push $0x8010770e
80105034: e8 57 b3 ff ff call 80100390 <panic>
panic("unlink: writei");
80105039: 83 ec 0c sub $0xc,%esp
8010503c: 68 32 77 10 80 push $0x80107732
80105041: e8 4a b3 ff ff call 80100390 <panic>
80105046: 8d 76 00 lea 0x0(%esi),%esi
80105049: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105050 <sys_open>:
int
sys_open(void)
{
80105050: 55 push %ebp
80105051: 89 e5 mov %esp,%ebp
80105053: 57 push %edi
80105054: 56 push %esi
80105055: 53 push %ebx
char *path;
int fd, omode;
struct file *f;
struct inode *ip;
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
80105056: 8d 45 e0 lea -0x20(%ebp),%eax
{
80105059: 83 ec 24 sub $0x24,%esp
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
8010505c: 50 push %eax
8010505d: 6a 00 push $0x0
8010505f: e8 3c f8 ff ff call 801048a0 <argstr>
80105064: 83 c4 10 add $0x10,%esp
80105067: 85 c0 test %eax,%eax
80105069: 0f 88 1d 01 00 00 js 8010518c <sys_open+0x13c>
8010506f: 8d 45 e4 lea -0x1c(%ebp),%eax
80105072: 83 ec 08 sub $0x8,%esp
80105075: 50 push %eax
80105076: 6a 01 push $0x1
80105078: e8 73 f7 ff ff call 801047f0 <argint>
8010507d: 83 c4 10 add $0x10,%esp
80105080: 85 c0 test %eax,%eax
80105082: 0f 88 04 01 00 00 js 8010518c <sys_open+0x13c>
return -1;
begin_op();
80105088: e8 13 db ff ff call 80102ba0 <begin_op>
if(omode & O_CREATE){
8010508d: f6 45 e5 02 testb $0x2,-0x1b(%ebp)
80105091: 0f 85 a9 00 00 00 jne 80105140 <sys_open+0xf0>
if(ip == 0){
end_op();
return -1;
}
} else {
if((ip = namei(path)) == 0){
80105097: 83 ec 0c sub $0xc,%esp
8010509a: ff 75 e0 pushl -0x20(%ebp)
8010509d: e8 3e ce ff ff call 80101ee0 <namei>
801050a2: 83 c4 10 add $0x10,%esp
801050a5: 85 c0 test %eax,%eax
801050a7: 89 c6 mov %eax,%esi
801050a9: 0f 84 b2 00 00 00 je 80105161 <sys_open+0x111>
end_op();
return -1;
}
ilock(ip);
801050af: 83 ec 0c sub $0xc,%esp
801050b2: 50 push %eax
801050b3: e8 c8 c5 ff ff call 80101680 <ilock>
if(ip->type == T_DIR && omode != O_RDONLY){
801050b8: 83 c4 10 add $0x10,%esp
801050bb: 66 83 7e 50 01 cmpw $0x1,0x50(%esi)
801050c0: 0f 84 aa 00 00 00 je 80105170 <sys_open+0x120>
end_op();
return -1;
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
801050c6: e8 b5 bc ff ff call 80100d80 <filealloc>
801050cb: 85 c0 test %eax,%eax
801050cd: 89 c7 mov %eax,%edi
801050cf: 0f 84 a6 00 00 00 je 8010517b <sys_open+0x12b>
struct proc *curproc = myproc();
801050d5: e8 06 e7 ff ff call 801037e0 <myproc>
for(fd = 0; fd < NOFILE; fd++){
801050da: 31 db xor %ebx,%ebx
801050dc: eb 0e jmp 801050ec <sys_open+0x9c>
801050de: 66 90 xchg %ax,%ax
801050e0: 83 c3 01 add $0x1,%ebx
801050e3: 83 fb 10 cmp $0x10,%ebx
801050e6: 0f 84 ac 00 00 00 je 80105198 <sys_open+0x148>
if(curproc->ofile[fd] == 0){
801050ec: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx
801050f0: 85 d2 test %edx,%edx
801050f2: 75 ec jne 801050e0 <sys_open+0x90>
fileclose(f);
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
801050f4: 83 ec 0c sub $0xc,%esp
curproc->ofile[fd] = f;
801050f7: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4)
iunlock(ip);
801050fb: 56 push %esi
801050fc: e8 5f c6 ff ff call 80101760 <iunlock>
end_op();
80105101: e8 0a db ff ff call 80102c10 <end_op>
f->type = FD_INODE;
80105106: c7 07 02 00 00 00 movl $0x2,(%edi)
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
8010510c: 8b 55 e4 mov -0x1c(%ebp),%edx
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
8010510f: 83 c4 10 add $0x10,%esp
f->ip = ip;
80105112: 89 77 10 mov %esi,0x10(%edi)
f->off = 0;
80105115: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi)
f->readable = !(omode & O_WRONLY);
8010511c: 89 d0 mov %edx,%eax
8010511e: f7 d0 not %eax
80105120: 83 e0 01 and $0x1,%eax
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105123: 83 e2 03 and $0x3,%edx
f->readable = !(omode & O_WRONLY);
80105126: 88 47 08 mov %al,0x8(%edi)
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105129: 0f 95 47 09 setne 0x9(%edi)
return fd;
}
8010512d: 8d 65 f4 lea -0xc(%ebp),%esp
80105130: 89 d8 mov %ebx,%eax
80105132: 5b pop %ebx
80105133: 5e pop %esi
80105134: 5f pop %edi
80105135: 5d pop %ebp
80105136: c3 ret
80105137: 89 f6 mov %esi,%esi
80105139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
ip = create(path, T_FILE, 0, 0);
80105140: 83 ec 0c sub $0xc,%esp
80105143: 8b 45 e0 mov -0x20(%ebp),%eax
80105146: 31 c9 xor %ecx,%ecx
80105148: 6a 00 push $0x0
8010514a: ba 02 00 00 00 mov $0x2,%edx
8010514f: e8 ec f7 ff ff call 80104940 <create>
if(ip == 0){
80105154: 83 c4 10 add $0x10,%esp
80105157: 85 c0 test %eax,%eax
ip = create(path, T_FILE, 0, 0);
80105159: 89 c6 mov %eax,%esi
if(ip == 0){
8010515b: 0f 85 65 ff ff ff jne 801050c6 <sys_open+0x76>
end_op();
80105161: e8 aa da ff ff call 80102c10 <end_op>
return -1;
80105166: bb ff ff ff ff mov $0xffffffff,%ebx
8010516b: eb c0 jmp 8010512d <sys_open+0xdd>
8010516d: 8d 76 00 lea 0x0(%esi),%esi
if(ip->type == T_DIR && omode != O_RDONLY){
80105170: 8b 4d e4 mov -0x1c(%ebp),%ecx
80105173: 85 c9 test %ecx,%ecx
80105175: 0f 84 4b ff ff ff je 801050c6 <sys_open+0x76>
iunlockput(ip);
8010517b: 83 ec 0c sub $0xc,%esp
8010517e: 56 push %esi
8010517f: e8 8c c7 ff ff call 80101910 <iunlockput>
end_op();
80105184: e8 87 da ff ff call 80102c10 <end_op>
return -1;
80105189: 83 c4 10 add $0x10,%esp
8010518c: bb ff ff ff ff mov $0xffffffff,%ebx
80105191: eb 9a jmp 8010512d <sys_open+0xdd>
80105193: 90 nop
80105194: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
fileclose(f);
80105198: 83 ec 0c sub $0xc,%esp
8010519b: 57 push %edi
8010519c: e8 9f bc ff ff call 80100e40 <fileclose>
801051a1: 83 c4 10 add $0x10,%esp
801051a4: eb d5 jmp 8010517b <sys_open+0x12b>
801051a6: 8d 76 00 lea 0x0(%esi),%esi
801051a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801051b0 <sys_mkdir>:
int
sys_mkdir(void)
{
801051b0: 55 push %ebp
801051b1: 89 e5 mov %esp,%ebp
801051b3: 83 ec 18 sub $0x18,%esp
char *path;
struct inode *ip;
begin_op();
801051b6: e8 e5 d9 ff ff call 80102ba0 <begin_op>
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
801051bb: 8d 45 f4 lea -0xc(%ebp),%eax
801051be: 83 ec 08 sub $0x8,%esp
801051c1: 50 push %eax
801051c2: 6a 00 push $0x0
801051c4: e8 d7 f6 ff ff call 801048a0 <argstr>
801051c9: 83 c4 10 add $0x10,%esp
801051cc: 85 c0 test %eax,%eax
801051ce: 78 30 js 80105200 <sys_mkdir+0x50>
801051d0: 83 ec 0c sub $0xc,%esp
801051d3: 8b 45 f4 mov -0xc(%ebp),%eax
801051d6: 31 c9 xor %ecx,%ecx
801051d8: 6a 00 push $0x0
801051da: ba 01 00 00 00 mov $0x1,%edx
801051df: e8 5c f7 ff ff call 80104940 <create>
801051e4: 83 c4 10 add $0x10,%esp
801051e7: 85 c0 test %eax,%eax
801051e9: 74 15 je 80105200 <sys_mkdir+0x50>
end_op();
return -1;
}
iunlockput(ip);
801051eb: 83 ec 0c sub $0xc,%esp
801051ee: 50 push %eax
801051ef: e8 1c c7 ff ff call 80101910 <iunlockput>
end_op();
801051f4: e8 17 da ff ff call 80102c10 <end_op>
return 0;
801051f9: 83 c4 10 add $0x10,%esp
801051fc: 31 c0 xor %eax,%eax
}
801051fe: c9 leave
801051ff: c3 ret
end_op();
80105200: e8 0b da ff ff call 80102c10 <end_op>
return -1;
80105205: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010520a: c9 leave
8010520b: c3 ret
8010520c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105210 <sys_mknod>:
int
sys_mknod(void)
{
80105210: 55 push %ebp
80105211: 89 e5 mov %esp,%ebp
80105213: 83 ec 18 sub $0x18,%esp
struct inode *ip;
char *path;
int major, minor;
begin_op();
80105216: e8 85 d9 ff ff call 80102ba0 <begin_op>
if((argstr(0, &path)) < 0 ||
8010521b: 8d 45 ec lea -0x14(%ebp),%eax
8010521e: 83 ec 08 sub $0x8,%esp
80105221: 50 push %eax
80105222: 6a 00 push $0x0
80105224: e8 77 f6 ff ff call 801048a0 <argstr>
80105229: 83 c4 10 add $0x10,%esp
8010522c: 85 c0 test %eax,%eax
8010522e: 78 60 js 80105290 <sys_mknod+0x80>
argint(1, &major) < 0 ||
80105230: 8d 45 f0 lea -0x10(%ebp),%eax
80105233: 83 ec 08 sub $0x8,%esp
80105236: 50 push %eax
80105237: 6a 01 push $0x1
80105239: e8 b2 f5 ff ff call 801047f0 <argint>
if((argstr(0, &path)) < 0 ||
8010523e: 83 c4 10 add $0x10,%esp
80105241: 85 c0 test %eax,%eax
80105243: 78 4b js 80105290 <sys_mknod+0x80>
argint(2, &minor) < 0 ||
80105245: 8d 45 f4 lea -0xc(%ebp),%eax
80105248: 83 ec 08 sub $0x8,%esp
8010524b: 50 push %eax
8010524c: 6a 02 push $0x2
8010524e: e8 9d f5 ff ff call 801047f0 <argint>
argint(1, &major) < 0 ||
80105253: 83 c4 10 add $0x10,%esp
80105256: 85 c0 test %eax,%eax
80105258: 78 36 js 80105290 <sys_mknod+0x80>
(ip = create(path, T_DEV, major, minor)) == 0){
8010525a: 0f bf 45 f4 movswl -0xc(%ebp),%eax
argint(2, &minor) < 0 ||
8010525e: 83 ec 0c sub $0xc,%esp
(ip = create(path, T_DEV, major, minor)) == 0){
80105261: 0f bf 4d f0 movswl -0x10(%ebp),%ecx
argint(2, &minor) < 0 ||
80105265: ba 03 00 00 00 mov $0x3,%edx
8010526a: 50 push %eax
8010526b: 8b 45 ec mov -0x14(%ebp),%eax
8010526e: e8 cd f6 ff ff call 80104940 <create>
80105273: 83 c4 10 add $0x10,%esp
80105276: 85 c0 test %eax,%eax
80105278: 74 16 je 80105290 <sys_mknod+0x80>
end_op();
return -1;
}
iunlockput(ip);
8010527a: 83 ec 0c sub $0xc,%esp
8010527d: 50 push %eax
8010527e: e8 8d c6 ff ff call 80101910 <iunlockput>
end_op();
80105283: e8 88 d9 ff ff call 80102c10 <end_op>
return 0;
80105288: 83 c4 10 add $0x10,%esp
8010528b: 31 c0 xor %eax,%eax
}
8010528d: c9 leave
8010528e: c3 ret
8010528f: 90 nop
end_op();
80105290: e8 7b d9 ff ff call 80102c10 <end_op>
return -1;
80105295: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010529a: c9 leave
8010529b: c3 ret
8010529c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801052a0 <sys_chdir>:
int
sys_chdir(void)
{
801052a0: 55 push %ebp
801052a1: 89 e5 mov %esp,%ebp
801052a3: 56 push %esi
801052a4: 53 push %ebx
801052a5: 83 ec 10 sub $0x10,%esp
char *path;
struct inode *ip;
struct proc *curproc = myproc();
801052a8: e8 33 e5 ff ff call 801037e0 <myproc>
801052ad: 89 c6 mov %eax,%esi
begin_op();
801052af: e8 ec d8 ff ff call 80102ba0 <begin_op>
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
801052b4: 8d 45 f4 lea -0xc(%ebp),%eax
801052b7: 83 ec 08 sub $0x8,%esp
801052ba: 50 push %eax
801052bb: 6a 00 push $0x0
801052bd: e8 de f5 ff ff call 801048a0 <argstr>
801052c2: 83 c4 10 add $0x10,%esp
801052c5: 85 c0 test %eax,%eax
801052c7: 78 77 js 80105340 <sys_chdir+0xa0>
801052c9: 83 ec 0c sub $0xc,%esp
801052cc: ff 75 f4 pushl -0xc(%ebp)
801052cf: e8 0c cc ff ff call 80101ee0 <namei>
801052d4: 83 c4 10 add $0x10,%esp
801052d7: 85 c0 test %eax,%eax
801052d9: 89 c3 mov %eax,%ebx
801052db: 74 63 je 80105340 <sys_chdir+0xa0>
end_op();
return -1;
}
ilock(ip);
801052dd: 83 ec 0c sub $0xc,%esp
801052e0: 50 push %eax
801052e1: e8 9a c3 ff ff call 80101680 <ilock>
if(ip->type != T_DIR){
801052e6: 83 c4 10 add $0x10,%esp
801052e9: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
801052ee: 75 30 jne 80105320 <sys_chdir+0x80>
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
801052f0: 83 ec 0c sub $0xc,%esp
801052f3: 53 push %ebx
801052f4: e8 67 c4 ff ff call 80101760 <iunlock>
iput(curproc->cwd);
801052f9: 58 pop %eax
801052fa: ff 76 68 pushl 0x68(%esi)
801052fd: e8 ae c4 ff ff call 801017b0 <iput>
end_op();
80105302: e8 09 d9 ff ff call 80102c10 <end_op>
curproc->cwd = ip;
80105307: 89 5e 68 mov %ebx,0x68(%esi)
return 0;
8010530a: 83 c4 10 add $0x10,%esp
8010530d: 31 c0 xor %eax,%eax
}
8010530f: 8d 65 f8 lea -0x8(%ebp),%esp
80105312: 5b pop %ebx
80105313: 5e pop %esi
80105314: 5d pop %ebp
80105315: c3 ret
80105316: 8d 76 00 lea 0x0(%esi),%esi
80105319: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
iunlockput(ip);
80105320: 83 ec 0c sub $0xc,%esp
80105323: 53 push %ebx
80105324: e8 e7 c5 ff ff call 80101910 <iunlockput>
end_op();
80105329: e8 e2 d8 ff ff call 80102c10 <end_op>
return -1;
8010532e: 83 c4 10 add $0x10,%esp
80105331: b8 ff ff ff ff mov $0xffffffff,%eax
80105336: eb d7 jmp 8010530f <sys_chdir+0x6f>
80105338: 90 nop
80105339: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
end_op();
80105340: e8 cb d8 ff ff call 80102c10 <end_op>
return -1;
80105345: b8 ff ff ff ff mov $0xffffffff,%eax
8010534a: eb c3 jmp 8010530f <sys_chdir+0x6f>
8010534c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105350 <sys_exec>:
int
sys_exec(void)
{
80105350: 55 push %ebp
80105351: 89 e5 mov %esp,%ebp
80105353: 57 push %edi
80105354: 56 push %esi
80105355: 53 push %ebx
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
80105356: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax
{
8010535c: 81 ec a4 00 00 00 sub $0xa4,%esp
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
80105362: 50 push %eax
80105363: 6a 00 push $0x0
80105365: e8 36 f5 ff ff call 801048a0 <argstr>
8010536a: 83 c4 10 add $0x10,%esp
8010536d: 85 c0 test %eax,%eax
8010536f: 0f 88 87 00 00 00 js 801053fc <sys_exec+0xac>
80105375: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax
8010537b: 83 ec 08 sub $0x8,%esp
8010537e: 50 push %eax
8010537f: 6a 01 push $0x1
80105381: e8 6a f4 ff ff call 801047f0 <argint>
80105386: 83 c4 10 add $0x10,%esp
80105389: 85 c0 test %eax,%eax
8010538b: 78 6f js 801053fc <sys_exec+0xac>
return -1;
}
memset(argv, 0, sizeof(argv));
8010538d: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
80105393: 83 ec 04 sub $0x4,%esp
for(i=0;; i++){
80105396: 31 db xor %ebx,%ebx
memset(argv, 0, sizeof(argv));
80105398: 68 80 00 00 00 push $0x80
8010539d: 6a 00 push $0x0
8010539f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi
801053a5: 50 push %eax
801053a6: e8 45 f1 ff ff call 801044f0 <memset>
801053ab: 83 c4 10 add $0x10,%esp
801053ae: eb 2c jmp 801053dc <sys_exec+0x8c>
if(i >= NELEM(argv))
return -1;
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
return -1;
if(uarg == 0){
801053b0: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax
801053b6: 85 c0 test %eax,%eax
801053b8: 74 56 je 80105410 <sys_exec+0xc0>
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
801053ba: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx
801053c0: 83 ec 08 sub $0x8,%esp
801053c3: 8d 14 31 lea (%ecx,%esi,1),%edx
801053c6: 52 push %edx
801053c7: 50 push %eax
801053c8: e8 b3 f3 ff ff call 80104780 <fetchstr>
801053cd: 83 c4 10 add $0x10,%esp
801053d0: 85 c0 test %eax,%eax
801053d2: 78 28 js 801053fc <sys_exec+0xac>
for(i=0;; i++){
801053d4: 83 c3 01 add $0x1,%ebx
if(i >= NELEM(argv))
801053d7: 83 fb 20 cmp $0x20,%ebx
801053da: 74 20 je 801053fc <sys_exec+0xac>
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
801053dc: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax
801053e2: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi
801053e9: 83 ec 08 sub $0x8,%esp
801053ec: 57 push %edi
801053ed: 01 f0 add %esi,%eax
801053ef: 50 push %eax
801053f0: e8 4b f3 ff ff call 80104740 <fetchint>
801053f5: 83 c4 10 add $0x10,%esp
801053f8: 85 c0 test %eax,%eax
801053fa: 79 b4 jns 801053b0 <sys_exec+0x60>
return -1;
}
return exec(path, argv);
}
801053fc: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
801053ff: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105404: 5b pop %ebx
80105405: 5e pop %esi
80105406: 5f pop %edi
80105407: 5d pop %ebp
80105408: c3 ret
80105409: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return exec(path, argv);
80105410: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
80105416: 83 ec 08 sub $0x8,%esp
argv[i] = 0;
80105419: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4)
80105420: 00 00 00 00
return exec(path, argv);
80105424: 50 push %eax
80105425: ff b5 5c ff ff ff pushl -0xa4(%ebp)
8010542b: e8 e0 b5 ff ff call 80100a10 <exec>
80105430: 83 c4 10 add $0x10,%esp
}
80105433: 8d 65 f4 lea -0xc(%ebp),%esp
80105436: 5b pop %ebx
80105437: 5e pop %esi
80105438: 5f pop %edi
80105439: 5d pop %ebp
8010543a: c3 ret
8010543b: 90 nop
8010543c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105440 <sys_pipe>:
int
sys_pipe(void)
{
80105440: 55 push %ebp
80105441: 89 e5 mov %esp,%ebp
80105443: 57 push %edi
80105444: 56 push %esi
80105445: 53 push %ebx
int *fd;
struct file *rf, *wf;
int fd0, fd1;
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80105446: 8d 45 dc lea -0x24(%ebp),%eax
{
80105449: 83 ec 20 sub $0x20,%esp
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
8010544c: 6a 08 push $0x8
8010544e: 50 push %eax
8010544f: 6a 00 push $0x0
80105451: e8 ea f3 ff ff call 80104840 <argptr>
80105456: 83 c4 10 add $0x10,%esp
80105459: 85 c0 test %eax,%eax
8010545b: 0f 88 ae 00 00 00 js 8010550f <sys_pipe+0xcf>
return -1;
if(pipealloc(&rf, &wf) < 0)
80105461: 8d 45 e4 lea -0x1c(%ebp),%eax
80105464: 83 ec 08 sub $0x8,%esp
80105467: 50 push %eax
80105468: 8d 45 e0 lea -0x20(%ebp),%eax
8010546b: 50 push %eax
8010546c: e8 cf dd ff ff call 80103240 <pipealloc>
80105471: 83 c4 10 add $0x10,%esp
80105474: 85 c0 test %eax,%eax
80105476: 0f 88 93 00 00 00 js 8010550f <sys_pipe+0xcf>
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
8010547c: 8b 7d e0 mov -0x20(%ebp),%edi
for(fd = 0; fd < NOFILE; fd++){
8010547f: 31 db xor %ebx,%ebx
struct proc *curproc = myproc();
80105481: e8 5a e3 ff ff call 801037e0 <myproc>
80105486: eb 10 jmp 80105498 <sys_pipe+0x58>
80105488: 90 nop
80105489: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(fd = 0; fd < NOFILE; fd++){
80105490: 83 c3 01 add $0x1,%ebx
80105493: 83 fb 10 cmp $0x10,%ebx
80105496: 74 60 je 801054f8 <sys_pipe+0xb8>
if(curproc->ofile[fd] == 0){
80105498: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi
8010549c: 85 f6 test %esi,%esi
8010549e: 75 f0 jne 80105490 <sys_pipe+0x50>
curproc->ofile[fd] = f;
801054a0: 8d 73 08 lea 0x8(%ebx),%esi
801054a3: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4)
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
801054a7: 8b 7d e4 mov -0x1c(%ebp),%edi
struct proc *curproc = myproc();
801054aa: e8 31 e3 ff ff call 801037e0 <myproc>
for(fd = 0; fd < NOFILE; fd++){
801054af: 31 d2 xor %edx,%edx
801054b1: eb 0d jmp 801054c0 <sys_pipe+0x80>
801054b3: 90 nop
801054b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801054b8: 83 c2 01 add $0x1,%edx
801054bb: 83 fa 10 cmp $0x10,%edx
801054be: 74 28 je 801054e8 <sys_pipe+0xa8>
if(curproc->ofile[fd] == 0){
801054c0: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx
801054c4: 85 c9 test %ecx,%ecx
801054c6: 75 f0 jne 801054b8 <sys_pipe+0x78>
curproc->ofile[fd] = f;
801054c8: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4)
myproc()->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;
}
fd[0] = fd0;
801054cc: 8b 45 dc mov -0x24(%ebp),%eax
801054cf: 89 18 mov %ebx,(%eax)
fd[1] = fd1;
801054d1: 8b 45 dc mov -0x24(%ebp),%eax
801054d4: 89 50 04 mov %edx,0x4(%eax)
return 0;
801054d7: 31 c0 xor %eax,%eax
}
801054d9: 8d 65 f4 lea -0xc(%ebp),%esp
801054dc: 5b pop %ebx
801054dd: 5e pop %esi
801054de: 5f pop %edi
801054df: 5d pop %ebp
801054e0: c3 ret
801054e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
myproc()->ofile[fd0] = 0;
801054e8: e8 f3 e2 ff ff call 801037e0 <myproc>
801054ed: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4)
801054f4: 00
801054f5: 8d 76 00 lea 0x0(%esi),%esi
fileclose(rf);
801054f8: 83 ec 0c sub $0xc,%esp
801054fb: ff 75 e0 pushl -0x20(%ebp)
801054fe: e8 3d b9 ff ff call 80100e40 <fileclose>
fileclose(wf);
80105503: 58 pop %eax
80105504: ff 75 e4 pushl -0x1c(%ebp)
80105507: e8 34 b9 ff ff call 80100e40 <fileclose>
return -1;
8010550c: 83 c4 10 add $0x10,%esp
8010550f: b8 ff ff ff ff mov $0xffffffff,%eax
80105514: eb c3 jmp 801054d9 <sys_pipe+0x99>
80105516: 66 90 xchg %ax,%ax
80105518: 66 90 xchg %ax,%ax
8010551a: 66 90 xchg %ax,%ax
8010551c: 66 90 xchg %ax,%ax
8010551e: 66 90 xchg %ax,%ax
80105520 <sys_fork>:
#include "proc.h"
#include "condvar.h"
int
sys_fork(void)
{
80105520: 55 push %ebp
80105521: 89 e5 mov %esp,%ebp
return fork();
}
80105523: 5d pop %ebp
return fork();
80105524: e9 57 e4 ff ff jmp 80103980 <fork>
80105529: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105530 <sys_exit>:
int
sys_exit(void)
{
80105530: 55 push %ebp
80105531: 89 e5 mov %esp,%ebp
80105533: 83 ec 08 sub $0x8,%esp
exit();
80105536: e8 65 e7 ff ff call 80103ca0 <exit>
return 0; // not reached
}
8010553b: 31 c0 xor %eax,%eax
8010553d: c9 leave
8010553e: c3 ret
8010553f: 90 nop
80105540 <sys_wait>:
int
sys_wait(void)
{
80105540: 55 push %ebp
80105541: 89 e5 mov %esp,%ebp
return wait();
}
80105543: 5d pop %ebp
return wait();
80105544: e9 97 e9 ff ff jmp 80103ee0 <wait>
80105549: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105550 <sys_kill>:
int
sys_kill(void)
{
80105550: 55 push %ebp
80105551: 89 e5 mov %esp,%ebp
80105553: 83 ec 20 sub $0x20,%esp
int pid;
if(argint(0, &pid) < 0)
80105556: 8d 45 f4 lea -0xc(%ebp),%eax
80105559: 50 push %eax
8010555a: 6a 00 push $0x0
8010555c: e8 8f f2 ff ff call 801047f0 <argint>
80105561: 83 c4 10 add $0x10,%esp
80105564: 85 c0 test %eax,%eax
80105566: 78 18 js 80105580 <sys_kill+0x30>
return -1;
return kill(pid);
80105568: 83 ec 0c sub $0xc,%esp
8010556b: ff 75 f4 pushl -0xc(%ebp)
8010556e: e8 bd ea ff ff call 80104030 <kill>
80105573: 83 c4 10 add $0x10,%esp
}
80105576: c9 leave
80105577: c3 ret
80105578: 90 nop
80105579: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80105580: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105585: c9 leave
80105586: c3 ret
80105587: 89 f6 mov %esi,%esi
80105589: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105590 <sys_getpid>:
int
sys_getpid(void)
{
80105590: 55 push %ebp
80105591: 89 e5 mov %esp,%ebp
80105593: 83 ec 08 sub $0x8,%esp
return myproc()->pid;
80105596: e8 45 e2 ff ff call 801037e0 <myproc>
8010559b: 8b 40 10 mov 0x10(%eax),%eax
}
8010559e: c9 leave
8010559f: c3 ret
801055a0 <sys_sbrk>:
int
sys_sbrk(void)
{
801055a0: 55 push %ebp
801055a1: 89 e5 mov %esp,%ebp
801055a3: 53 push %ebx
int addr;
int n;
if(argint(0, &n) < 0)
801055a4: 8d 45 f4 lea -0xc(%ebp),%eax
{
801055a7: 83 ec 1c sub $0x1c,%esp
if(argint(0, &n) < 0)
801055aa: 50 push %eax
801055ab: 6a 00 push $0x0
801055ad: e8 3e f2 ff ff call 801047f0 <argint>
801055b2: 83 c4 10 add $0x10,%esp
801055b5: 85 c0 test %eax,%eax
801055b7: 78 1f js 801055d8 <sys_sbrk+0x38>
return -1;
addr = myproc()->sz;
801055b9: e8 22 e2 ff ff call 801037e0 <myproc>
801055be: 8b 18 mov (%eax),%ebx
myproc()->sz += n;
801055c0: e8 1b e2 ff ff call 801037e0 <myproc>
801055c5: 8b 55 f4 mov -0xc(%ebp),%edx
801055c8: 01 10 add %edx,(%eax)
//if(growproc(n) < 0)
//return -1;
return addr;
}
801055ca: 89 d8 mov %ebx,%eax
801055cc: 8b 5d fc mov -0x4(%ebp),%ebx
801055cf: c9 leave
801055d0: c3 ret
801055d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
801055d8: bb ff ff ff ff mov $0xffffffff,%ebx
801055dd: eb eb jmp 801055ca <sys_sbrk+0x2a>
801055df: 90 nop
801055e0 <sys_sleep>:
int
sys_sleep(void)
{
801055e0: 55 push %ebp
801055e1: 89 e5 mov %esp,%ebp
801055e3: 53 push %ebx
int n;
uint ticks0;
if(argint(0, &n) < 0)
801055e4: 8d 45 f4 lea -0xc(%ebp),%eax
{
801055e7: 83 ec 1c sub $0x1c,%esp
if(argint(0, &n) < 0)
801055ea: 50 push %eax
801055eb: 6a 00 push $0x0
801055ed: e8 fe f1 ff ff call 801047f0 <argint>
801055f2: 83 c4 10 add $0x10,%esp
801055f5: 85 c0 test %eax,%eax
801055f7: 0f 88 8a 00 00 00 js 80105687 <sys_sleep+0xa7>
return -1;
acquire(&tickslock);
801055fd: 83 ec 0c sub $0xc,%esp
80105600: 68 60 4c 11 80 push $0x80114c60
80105605: e8 d6 ed ff ff call 801043e0 <acquire>
ticks0 = ticks;
while(ticks - ticks0 < n){
8010560a: 8b 55 f4 mov -0xc(%ebp),%edx
8010560d: 83 c4 10 add $0x10,%esp
ticks0 = ticks;
80105610: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx
while(ticks - ticks0 < n){
80105616: 85 d2 test %edx,%edx
80105618: 75 27 jne 80105641 <sys_sleep+0x61>
8010561a: eb 54 jmp 80105670 <sys_sleep+0x90>
8010561c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(myproc()->killed){
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
80105620: 83 ec 08 sub $0x8,%esp
80105623: 68 60 4c 11 80 push $0x80114c60
80105628: 68 a0 54 11 80 push $0x801154a0
8010562d: e8 ee e7 ff ff call 80103e20 <sleep>
while(ticks - ticks0 < n){
80105632: a1 a0 54 11 80 mov 0x801154a0,%eax
80105637: 83 c4 10 add $0x10,%esp
8010563a: 29 d8 sub %ebx,%eax
8010563c: 3b 45 f4 cmp -0xc(%ebp),%eax
8010563f: 73 2f jae 80105670 <sys_sleep+0x90>
if(myproc()->killed){
80105641: e8 9a e1 ff ff call 801037e0 <myproc>
80105646: 8b 40 24 mov 0x24(%eax),%eax
80105649: 85 c0 test %eax,%eax
8010564b: 74 d3 je 80105620 <sys_sleep+0x40>
release(&tickslock);
8010564d: 83 ec 0c sub $0xc,%esp
80105650: 68 60 4c 11 80 push $0x80114c60
80105655: e8 46 ee ff ff call 801044a0 <release>
return -1;
8010565a: 83 c4 10 add $0x10,%esp
8010565d: b8 ff ff ff ff mov $0xffffffff,%eax
}
release(&tickslock);
return 0;
}
80105662: 8b 5d fc mov -0x4(%ebp),%ebx
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
release(&tickslock);
80105670: 83 ec 0c sub $0xc,%esp
80105673: 68 60 4c 11 80 push $0x80114c60
80105678: e8 23 ee ff ff call 801044a0 <release>
return 0;
8010567d: 83 c4 10 add $0x10,%esp
80105680: 31 c0 xor %eax,%eax
}
80105682: 8b 5d fc mov -0x4(%ebp),%ebx
80105685: c9 leave
80105686: c3 ret
return -1;
80105687: b8 ff ff ff ff mov $0xffffffff,%eax
8010568c: eb f4 jmp 80105682 <sys_sleep+0xa2>
8010568e: 66 90 xchg %ax,%ax
80105690 <sys_uptime>:
// return how many clock tick interrupts have occurred
// since start.
int
sys_uptime(void)
{
80105690: 55 push %ebp
80105691: 89 e5 mov %esp,%ebp
80105693: 53 push %ebx
80105694: 83 ec 10 sub $0x10,%esp
uint xticks;
acquire(&tickslock);
80105697: 68 60 4c 11 80 push $0x80114c60
8010569c: e8 3f ed ff ff call 801043e0 <acquire>
xticks = ticks;
801056a1: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx
release(&tickslock);
801056a7: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp)
801056ae: e8 ed ed ff ff call 801044a0 <release>
return xticks;
}
801056b3: 89 d8 mov %ebx,%eax
801056b5: 8b 5d fc mov -0x4(%ebp),%ebx
801056b8: c9 leave
801056b9: c3 ret
801056ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801056c0 <sys_cv_signal>:
int
sys_cv_signal(void)
{
801056c0: 55 push %ebp
801056c1: 89 e5 mov %esp,%ebp
801056c3: 83 ec 20 sub $0x20,%esp
int i;
struct condvar *cv;
argint(0, &i);
801056c6: 8d 45 f4 lea -0xc(%ebp),%eax
801056c9: 50 push %eax
801056ca: 6a 00 push $0x0
801056cc: e8 1f f1 ff ff call 801047f0 <argint>
cv = (struct condvar *) i;
wakeup(cv);
801056d1: 58 pop %eax
801056d2: ff 75 f4 pushl -0xc(%ebp)
801056d5: e8 f6 e8 ff ff call 80103fd0 <wakeup>
return 0;
}
801056da: 31 c0 xor %eax,%eax
801056dc: c9 leave
801056dd: c3 ret
801056de: 66 90 xchg %ax,%ax
801056e0 <sys_cv_wait>:
int
sys_cv_wait(void)
{
801056e0: 55 push %ebp
801056e1: 89 e5 mov %esp,%ebp
801056e3: 83 ec 20 sub $0x20,%esp
int i;
struct condvar *cv;
argint(0, &i);
801056e6: 8d 45 f4 lea -0xc(%ebp),%eax
801056e9: 50 push %eax
801056ea: 6a 00 push $0x0
801056ec: e8 ff f0 ff ff call 801047f0 <argint>
cv = (struct condvar *) i;
801056f1: 8b 45 f4 mov -0xc(%ebp),%eax
sleep1(cv, &(cv->lk));
801056f4: 5a pop %edx
801056f5: 59 pop %ecx
801056f6: 50 push %eax
801056f7: 50 push %eax
801056f8: e8 03 e5 ff ff call 80103c00 <sleep1>
return 0;
801056fd: 31 c0 xor %eax,%eax
801056ff: c9 leave
80105700: c3 ret
80105701 <alltraps>:
# vectors.S sends all traps here.
.globl alltraps
alltraps:
# Build trap frame.
pushl %ds
80105701: 1e push %ds
pushl %es
80105702: 06 push %es
pushl %fs
80105703: 0f a0 push %fs
pushl %gs
80105705: 0f a8 push %gs
pushal
80105707: 60 pusha
# Set up data segments.
movw $(SEG_KDATA<<3), %ax
80105708: 66 b8 10 00 mov $0x10,%ax
movw %ax, %ds
8010570c: 8e d8 mov %eax,%ds
movw %ax, %es
8010570e: 8e c0 mov %eax,%es
# Call trap(tf), where tf=%esp
pushl %esp
80105710: 54 push %esp
call trap
80105711: e8 ca 00 00 00 call 801057e0 <trap>
addl $4, %esp
80105716: 83 c4 04 add $0x4,%esp
80105719 <trapret>:
# Return falls through to trapret...
.globl trapret
trapret:
popal
80105719: 61 popa
popl %gs
8010571a: 0f a9 pop %gs
popl %fs
8010571c: 0f a1 pop %fs
popl %es
8010571e: 07 pop %es
popl %ds
8010571f: 1f pop %ds
addl $0x8, %esp # trapno and errcode
80105720: 83 c4 08 add $0x8,%esp
iret
80105723: cf iret
80105724: 66 90 xchg %ax,%ax
80105726: 66 90 xchg %ax,%ax
80105728: 66 90 xchg %ax,%ax
8010572a: 66 90 xchg %ax,%ax
8010572c: 66 90 xchg %ax,%ax
8010572e: 66 90 xchg %ax,%ax
80105730 <tvinit>:
extern int mappages (pde_t *pgdir, void *va, uint size, uint pa, int perm);
void
tvinit(void)
{
80105730: 55 push %ebp
int i;
for(i = 0; i < 256; i++)
80105731: 31 c0 xor %eax,%eax
{
80105733: 89 e5 mov %esp,%ebp
80105735: 83 ec 08 sub $0x8,%esp
80105738: 90 nop
80105739: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
80105740: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx
80105747: c7 04 c5 a2 4c 11 80 movl $0x8e000008,-0x7feeb35e(,%eax,8)
8010574e: 08 00 00 8e
80105752: 66 89 14 c5 a0 4c 11 mov %dx,-0x7feeb360(,%eax,8)
80105759: 80
8010575a: c1 ea 10 shr $0x10,%edx
8010575d: 66 89 14 c5 a6 4c 11 mov %dx,-0x7feeb35a(,%eax,8)
80105764: 80
for(i = 0; i < 256; i++)
80105765: 83 c0 01 add $0x1,%eax
80105768: 3d 00 01 00 00 cmp $0x100,%eax
8010576d: 75 d1 jne 80105740 <tvinit+0x10>
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
8010576f: a1 08 a1 10 80 mov 0x8010a108,%eax
initlock(&tickslock, "time");
80105774: 83 ec 08 sub $0x8,%esp
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105777: c7 05 a2 4e 11 80 08 movl $0xef000008,0x80114ea2
8010577e: 00 00 ef
initlock(&tickslock, "time");
80105781: 68 41 77 10 80 push $0x80107741
80105786: 68 60 4c 11 80 push $0x80114c60
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
8010578b: 66 a3 a0 4e 11 80 mov %ax,0x80114ea0
80105791: c1 e8 10 shr $0x10,%eax
80105794: 66 a3 a6 4e 11 80 mov %ax,0x80114ea6
initlock(&tickslock, "time");
8010579a: e8 01 eb ff ff call 801042a0 <initlock>
}
8010579f: 83 c4 10 add $0x10,%esp
801057a2: c9 leave
801057a3: c3 ret
801057a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801057aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801057b0 <idtinit>:
void
idtinit(void)
{
801057b0: 55 push %ebp
pd[0] = size-1;
801057b1: b8 ff 07 00 00 mov $0x7ff,%eax
801057b6: 89 e5 mov %esp,%ebp
801057b8: 83 ec 10 sub $0x10,%esp
801057bb: 66 89 45 fa mov %ax,-0x6(%ebp)
pd[1] = (uint)p;
801057bf: b8 a0 4c 11 80 mov $0x80114ca0,%eax
801057c4: 66 89 45 fc mov %ax,-0x4(%ebp)
pd[2] = (uint)p >> 16;
801057c8: c1 e8 10 shr $0x10,%eax
801057cb: 66 89 45 fe mov %ax,-0x2(%ebp)
asm volatile("lidt (%0)" : : "r" (pd));
801057cf: 8d 45 fa lea -0x6(%ebp),%eax
801057d2: 0f 01 18 lidtl (%eax)
lidt(idt, sizeof(idt));
}
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
801057e0 <trap>:
//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
801057e0: 55 push %ebp
801057e1: 89 e5 mov %esp,%ebp
801057e3: 57 push %edi
801057e4: 56 push %esi
801057e5: 53 push %ebx
801057e6: 83 ec 0c sub $0xc,%esp
801057e9: 8b 5d 08 mov 0x8(%ebp),%ebx
if(tf->trapno == T_SYSCALL){
801057ec: 8b 43 30 mov 0x30(%ebx),%eax
801057ef: 83 f8 40 cmp $0x40,%eax
801057f2: 0f 84 98 00 00 00 je 80105890 <trap+0xb0>
if(myproc()->killed)
exit();
return;
}
switch(tf->trapno){
801057f8: 83 e8 20 sub $0x20,%eax
801057fb: 83 f8 1f cmp $0x1f,%eax
801057fe: 0f 87 6c 01 00 00 ja 80105970 <trap+0x190>
80105804: ff 24 85 a4 77 10 80 jmp *-0x7fef885c(,%eax,4)
8010580b: 90 nop
8010580c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
case T_IRQ0 + IRQ_TIMER:
if(cpuid() == 0){
80105810: e8 ab df ff ff call 801037c0 <cpuid>
80105815: 85 c0 test %eax,%eax
80105817: 0f 84 e3 01 00 00 je 80105a00 <trap+0x220>
kbdintr();
lapiceoi();
break;
case T_IRQ0 + IRQ_COM1:
uartintr();
lapiceoi();
8010581d: e8 2e cf ff ff call 80102750 <lapiceoi>
}
// 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)
80105822: e8 b9 df ff ff call 801037e0 <myproc>
80105827: 85 c0 test %eax,%eax
80105829: 74 1d je 80105848 <trap+0x68>
8010582b: e8 b0 df ff ff call 801037e0 <myproc>
80105830: 8b 50 24 mov 0x24(%eax),%edx
80105833: 85 d2 test %edx,%edx
80105835: 74 11 je 80105848 <trap+0x68>
80105837: 0f b7 43 3c movzwl 0x3c(%ebx),%eax
8010583b: 83 e0 03 and $0x3,%eax
8010583e: 66 83 f8 03 cmp $0x3,%ax
80105842: 0f 84 a8 01 00 00 je 801059f0 <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 &&
80105848: e8 93 df ff ff call 801037e0 <myproc>
8010584d: 85 c0 test %eax,%eax
8010584f: 74 0b je 8010585c <trap+0x7c>
80105851: e8 8a df ff ff call 801037e0 <myproc>
80105856: 83 78 0c 04 cmpl $0x4,0xc(%eax)
8010585a: 74 6c je 801058c8 <trap+0xe8>
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)
8010585c: e8 7f df ff ff call 801037e0 <myproc>
80105861: 85 c0 test %eax,%eax
80105863: 74 19 je 8010587e <trap+0x9e>
80105865: e8 76 df ff ff call 801037e0 <myproc>
8010586a: 8b 40 24 mov 0x24(%eax),%eax
8010586d: 85 c0 test %eax,%eax
8010586f: 74 0d je 8010587e <trap+0x9e>
80105871: 0f b7 43 3c movzwl 0x3c(%ebx),%eax
80105875: 83 e0 03 and $0x3,%eax
80105878: 66 83 f8 03 cmp $0x3,%ax
8010587c: 74 3b je 801058b9 <trap+0xd9>
exit();
}
8010587e: 8d 65 f4 lea -0xc(%ebp),%esp
80105881: 5b pop %ebx
80105882: 5e pop %esi
80105883: 5f pop %edi
80105884: 5d pop %ebp
80105885: c3 ret
80105886: 8d 76 00 lea 0x0(%esi),%esi
80105889: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(myproc()->killed)
80105890: e8 4b df ff ff call 801037e0 <myproc>
80105895: 8b 70 24 mov 0x24(%eax),%esi
80105898: 85 f6 test %esi,%esi
8010589a: 0f 85 c0 00 00 00 jne 80105960 <trap+0x180>
myproc()->tf = tf;
801058a0: e8 3b df ff ff call 801037e0 <myproc>
801058a5: 89 58 18 mov %ebx,0x18(%eax)
syscall();
801058a8: e8 33 f0 ff ff call 801048e0 <syscall>
if(myproc()->killed)
801058ad: e8 2e df ff ff call 801037e0 <myproc>
801058b2: 8b 48 24 mov 0x24(%eax),%ecx
801058b5: 85 c9 test %ecx,%ecx
801058b7: 74 c5 je 8010587e <trap+0x9e>
}
801058b9: 8d 65 f4 lea -0xc(%ebp),%esp
801058bc: 5b pop %ebx
801058bd: 5e pop %esi
801058be: 5f pop %edi
801058bf: 5d pop %ebp
exit();
801058c0: e9 db e3 ff ff jmp 80103ca0 <exit>
801058c5: 8d 76 00 lea 0x0(%esi),%esi
if(myproc() && myproc()->state == RUNNING &&
801058c8: 83 7b 30 20 cmpl $0x20,0x30(%ebx)
801058cc: 75 8e jne 8010585c <trap+0x7c>
yield();
801058ce: e8 fd e4 ff ff call 80103dd0 <yield>
801058d3: eb 87 jmp 8010585c <trap+0x7c>
801058d5: 8d 76 00 lea 0x0(%esi),%esi
kbdintr();
801058d8: e8 33 cd ff ff call 80102610 <kbdintr>
lapiceoi();
801058dd: e8 6e ce ff ff call 80102750 <lapiceoi>
if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801058e2: e8 f9 de ff ff call 801037e0 <myproc>
801058e7: 85 c0 test %eax,%eax
801058e9: 0f 85 3c ff ff ff jne 8010582b <trap+0x4b>
801058ef: e9 54 ff ff ff jmp 80105848 <trap+0x68>
801058f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
uartintr();
801058f8: e8 d3 02 00 00 call 80105bd0 <uartintr>
801058fd: e9 1b ff ff ff jmp 8010581d <trap+0x3d>
80105902: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cprintf("cpu%d: spurious interrupt at %x:%x\n",
80105908: 0f b7 73 3c movzwl 0x3c(%ebx),%esi
8010590c: 8b 7b 38 mov 0x38(%ebx),%edi
8010590f: e8 ac de ff ff call 801037c0 <cpuid>
80105914: 57 push %edi
80105915: 56 push %esi
80105916: 50 push %eax
80105917: 68 4c 77 10 80 push $0x8010774c
8010591c: e8 3f ad ff ff call 80100660 <cprintf>
lapiceoi();
80105921: e8 2a ce ff ff call 80102750 <lapiceoi>
break;
80105926: 83 c4 10 add $0x10,%esp
if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
80105929: e8 b2 de ff ff call 801037e0 <myproc>
8010592e: 85 c0 test %eax,%eax
80105930: 0f 85 f5 fe ff ff jne 8010582b <trap+0x4b>
80105936: e9 0d ff ff ff jmp 80105848 <trap+0x68>
8010593b: 90 nop
8010593c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ideintr();
80105940: e8 3b c7 ff ff call 80102080 <ideintr>
lapiceoi();
80105945: e8 06 ce ff ff call 80102750 <lapiceoi>
if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
8010594a: e8 91 de ff ff call 801037e0 <myproc>
8010594f: 85 c0 test %eax,%eax
80105951: 0f 85 d4 fe ff ff jne 8010582b <trap+0x4b>
80105957: e9 ec fe ff ff jmp 80105848 <trap+0x68>
8010595c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
exit();
80105960: e8 3b e3 ff ff call 80103ca0 <exit>
80105965: e9 36 ff ff ff jmp 801058a0 <trap+0xc0>
8010596a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(myproc() == 0 || (tf->cs&3) == 0){
80105970: e8 6b de ff ff call 801037e0 <myproc>
80105975: 85 c0 test %eax,%eax
80105977: 0f 84 b7 00 00 00 je 80105a34 <trap+0x254>
8010597d: f6 43 3c 03 testb $0x3,0x3c(%ebx)
80105981: 0f 84 ad 00 00 00 je 80105a34 <trap+0x254>
static inline uint
rcr2(void)
{
uint val;
asm volatile("movl %%cr2,%0" : "=r" (val));
80105987: 0f 20 d6 mov %cr2,%esi
uint newsz = myproc()->sz;
8010598a: e8 51 de ff ff call 801037e0 <myproc>
8010598f: 8b 38 mov (%eax),%edi
a = PGROUNDDOWN(rcr2());
80105991: 81 e6 00 f0 ff ff and $0xfffff000,%esi
for (;a < newsz; a+= PGSIZE){
80105997: 39 fe cmp %edi,%esi
80105999: 0f 83 df fe ff ff jae 8010587e <trap+0x9e>
8010599f: 90 nop
mem = kalloc();
801059a0: e8 1b cb ff ff call 801024c0 <kalloc>
memset(mem,0,PGSIZE);
801059a5: 83 ec 04 sub $0x4,%esp
mem = kalloc();
801059a8: 89 c3 mov %eax,%ebx
memset(mem,0,PGSIZE);
801059aa: 68 00 10 00 00 push $0x1000
801059af: 6a 00 push $0x0
mappages(myproc()->pgdir,(char *)a, PGSIZE, V2P(mem), PTE_W|PTE_U);
801059b1: 81 c3 00 00 00 80 add $0x80000000,%ebx
memset(mem,0,PGSIZE);
801059b7: 50 push %eax
801059b8: e8 33 eb ff ff call 801044f0 <memset>
mappages(myproc()->pgdir,(char *)a, PGSIZE, V2P(mem), PTE_W|PTE_U);
801059bd: e8 1e de ff ff call 801037e0 <myproc>
801059c2: c7 04 24 06 00 00 00 movl $0x6,(%esp)
801059c9: 53 push %ebx
801059ca: 68 00 10 00 00 push $0x1000
801059cf: 56 push %esi
for (;a < newsz; a+= PGSIZE){
801059d0: 81 c6 00 10 00 00 add $0x1000,%esi
mappages(myproc()->pgdir,(char *)a, PGSIZE, V2P(mem), PTE_W|PTE_U);
801059d6: ff 70 04 pushl 0x4(%eax)
801059d9: e8 32 0e 00 00 call 80106810 <mappages>
for (;a < newsz; a+= PGSIZE){
801059de: 83 c4 20 add $0x20,%esp
801059e1: 39 f7 cmp %esi,%edi
801059e3: 77 bb ja 801059a0 <trap+0x1c0>
801059e5: e9 94 fe ff ff jmp 8010587e <trap+0x9e>
801059ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
exit();
801059f0: e8 ab e2 ff ff call 80103ca0 <exit>
801059f5: e9 4e fe ff ff jmp 80105848 <trap+0x68>
801059fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
acquire(&tickslock);
80105a00: 83 ec 0c sub $0xc,%esp
80105a03: 68 60 4c 11 80 push $0x80114c60
80105a08: e8 d3 e9 ff ff call 801043e0 <acquire>
wakeup(&ticks);
80105a0d: c7 04 24 a0 54 11 80 movl $0x801154a0,(%esp)
ticks++;
80105a14: 83 05 a0 54 11 80 01 addl $0x1,0x801154a0
wakeup(&ticks);
80105a1b: e8 b0 e5 ff ff call 80103fd0 <wakeup>
release(&tickslock);
80105a20: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp)
80105a27: e8 74 ea ff ff call 801044a0 <release>
80105a2c: 83 c4 10 add $0x10,%esp
80105a2f: e9 e9 fd ff ff jmp 8010581d <trap+0x3d>
80105a34: 0f 20 d7 mov %cr2,%edi
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
80105a37: 8b 73 38 mov 0x38(%ebx),%esi
80105a3a: e8 81 dd ff ff call 801037c0 <cpuid>
80105a3f: 83 ec 0c sub $0xc,%esp
80105a42: 57 push %edi
80105a43: 56 push %esi
80105a44: 50 push %eax
80105a45: ff 73 30 pushl 0x30(%ebx)
80105a48: 68 70 77 10 80 push $0x80107770
80105a4d: e8 0e ac ff ff call 80100660 <cprintf>
panic("trap");
80105a52: 83 c4 14 add $0x14,%esp
80105a55: 68 46 77 10 80 push $0x80107746
80105a5a: e8 31 a9 ff ff call 80100390 <panic>
80105a5f: 90 nop
80105a60 <uartgetc>:
}
static int
uartgetc(void)
{
if(!uart)
80105a60: a1 bc a5 10 80 mov 0x8010a5bc,%eax
{
80105a65: 55 push %ebp
80105a66: 89 e5 mov %esp,%ebp
if(!uart)
80105a68: 85 c0 test %eax,%eax
80105a6a: 74 1c je 80105a88 <uartgetc+0x28>
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80105a6c: ba fd 03 00 00 mov $0x3fd,%edx
80105a71: ec in (%dx),%al
return -1;
if(!(inb(COM1+5) & 0x01))
80105a72: a8 01 test $0x1,%al
80105a74: 74 12 je 80105a88 <uartgetc+0x28>
80105a76: ba f8 03 00 00 mov $0x3f8,%edx
80105a7b: ec in (%dx),%al
return -1;
return inb(COM1+0);
80105a7c: 0f b6 c0 movzbl %al,%eax
}
80105a7f: 5d pop %ebp
80105a80: c3 ret
80105a81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80105a88: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105a8d: 5d pop %ebp
80105a8e: c3 ret
80105a8f: 90 nop
80105a90 <uartputc.part.0>:
uartputc(int c)
80105a90: 55 push %ebp
80105a91: 89 e5 mov %esp,%ebp
80105a93: 57 push %edi
80105a94: 56 push %esi
80105a95: 53 push %ebx
80105a96: 89 c7 mov %eax,%edi
80105a98: bb 80 00 00 00 mov $0x80,%ebx
80105a9d: be fd 03 00 00 mov $0x3fd,%esi
80105aa2: 83 ec 0c sub $0xc,%esp
80105aa5: eb 1b jmp 80105ac2 <uartputc.part.0+0x32>
80105aa7: 89 f6 mov %esi,%esi
80105aa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
microdelay(10);
80105ab0: 83 ec 0c sub $0xc,%esp
80105ab3: 6a 0a push $0xa
80105ab5: e8 b6 cc ff ff call 80102770 <microdelay>
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
80105aba: 83 c4 10 add $0x10,%esp
80105abd: 83 eb 01 sub $0x1,%ebx
80105ac0: 74 07 je 80105ac9 <uartputc.part.0+0x39>
80105ac2: 89 f2 mov %esi,%edx
80105ac4: ec in (%dx),%al
80105ac5: a8 20 test $0x20,%al
80105ac7: 74 e7 je 80105ab0 <uartputc.part.0+0x20>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80105ac9: ba f8 03 00 00 mov $0x3f8,%edx
80105ace: 89 f8 mov %edi,%eax
80105ad0: ee out %al,(%dx)
}
80105ad1: 8d 65 f4 lea -0xc(%ebp),%esp
80105ad4: 5b pop %ebx
80105ad5: 5e pop %esi
80105ad6: 5f pop %edi
80105ad7: 5d pop %ebp
80105ad8: c3 ret
80105ad9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105ae0 <uartinit>:
{
80105ae0: 55 push %ebp
80105ae1: 31 c9 xor %ecx,%ecx
80105ae3: 89 c8 mov %ecx,%eax
80105ae5: 89 e5 mov %esp,%ebp
80105ae7: 57 push %edi
80105ae8: 56 push %esi
80105ae9: 53 push %ebx
80105aea: bb fa 03 00 00 mov $0x3fa,%ebx
80105aef: 89 da mov %ebx,%edx
80105af1: 83 ec 0c sub $0xc,%esp
80105af4: ee out %al,(%dx)
80105af5: bf fb 03 00 00 mov $0x3fb,%edi
80105afa: b8 80 ff ff ff mov $0xffffff80,%eax
80105aff: 89 fa mov %edi,%edx
80105b01: ee out %al,(%dx)
80105b02: b8 0c 00 00 00 mov $0xc,%eax
80105b07: ba f8 03 00 00 mov $0x3f8,%edx
80105b0c: ee out %al,(%dx)
80105b0d: be f9 03 00 00 mov $0x3f9,%esi
80105b12: 89 c8 mov %ecx,%eax
80105b14: 89 f2 mov %esi,%edx
80105b16: ee out %al,(%dx)
80105b17: b8 03 00 00 00 mov $0x3,%eax
80105b1c: 89 fa mov %edi,%edx
80105b1e: ee out %al,(%dx)
80105b1f: ba fc 03 00 00 mov $0x3fc,%edx
80105b24: 89 c8 mov %ecx,%eax
80105b26: ee out %al,(%dx)
80105b27: b8 01 00 00 00 mov $0x1,%eax
80105b2c: 89 f2 mov %esi,%edx
80105b2e: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80105b2f: ba fd 03 00 00 mov $0x3fd,%edx
80105b34: ec in (%dx),%al
if(inb(COM1+5) == 0xFF)
80105b35: 3c ff cmp $0xff,%al
80105b37: 74 5a je 80105b93 <uartinit+0xb3>
uart = 1;
80105b39: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc
80105b40: 00 00 00
80105b43: 89 da mov %ebx,%edx
80105b45: ec in (%dx),%al
80105b46: ba f8 03 00 00 mov $0x3f8,%edx
80105b4b: ec in (%dx),%al
ioapicenable(IRQ_COM1, 0);
80105b4c: 83 ec 08 sub $0x8,%esp
for(p="xv6...\n"; *p; p++)
80105b4f: bb 24 78 10 80 mov $0x80107824,%ebx
ioapicenable(IRQ_COM1, 0);
80105b54: 6a 00 push $0x0
80105b56: 6a 04 push $0x4
80105b58: e8 73 c7 ff ff call 801022d0 <ioapicenable>
80105b5d: 83 c4 10 add $0x10,%esp
for(p="xv6...\n"; *p; p++)
80105b60: b8 78 00 00 00 mov $0x78,%eax
80105b65: eb 13 jmp 80105b7a <uartinit+0x9a>
80105b67: 89 f6 mov %esi,%esi
80105b69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105b70: 83 c3 01 add $0x1,%ebx
80105b73: 0f be 03 movsbl (%ebx),%eax
80105b76: 84 c0 test %al,%al
80105b78: 74 19 je 80105b93 <uartinit+0xb3>
if(!uart)
80105b7a: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx
80105b80: 85 d2 test %edx,%edx
80105b82: 74 ec je 80105b70 <uartinit+0x90>
for(p="xv6...\n"; *p; p++)
80105b84: 83 c3 01 add $0x1,%ebx
80105b87: e8 04 ff ff ff call 80105a90 <uartputc.part.0>
80105b8c: 0f be 03 movsbl (%ebx),%eax
80105b8f: 84 c0 test %al,%al
80105b91: 75 e7 jne 80105b7a <uartinit+0x9a>
}
80105b93: 8d 65 f4 lea -0xc(%ebp),%esp
80105b96: 5b pop %ebx
80105b97: 5e pop %esi
80105b98: 5f pop %edi
80105b99: 5d pop %ebp
80105b9a: c3 ret
80105b9b: 90 nop
80105b9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105ba0 <uartputc>:
if(!uart)
80105ba0: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx
{
80105ba6: 55 push %ebp
80105ba7: 89 e5 mov %esp,%ebp
if(!uart)
80105ba9: 85 d2 test %edx,%edx
{
80105bab: 8b 45 08 mov 0x8(%ebp),%eax
if(!uart)
80105bae: 74 10 je 80105bc0 <uartputc+0x20>
}
80105bb0: 5d pop %ebp
80105bb1: e9 da fe ff ff jmp 80105a90 <uartputc.part.0>
80105bb6: 8d 76 00 lea 0x0(%esi),%esi
80105bb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105bc0: 5d pop %ebp
80105bc1: c3 ret
80105bc2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105bc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105bd0 <uartintr>:
void
uartintr(void)
{
80105bd0: 55 push %ebp
80105bd1: 89 e5 mov %esp,%ebp
80105bd3: 83 ec 14 sub $0x14,%esp
consoleintr(uartgetc);
80105bd6: 68 60 5a 10 80 push $0x80105a60
80105bdb: e8 30 ac ff ff call 80100810 <consoleintr>
}
80105be0: 83 c4 10 add $0x10,%esp
80105be3: c9 leave
80105be4: c3 ret
80105be5 <vector0>:
# generated by vectors.pl - do not edit
# handlers
.globl alltraps
.globl vector0
vector0:
pushl $0
80105be5: 6a 00 push $0x0
pushl $0
80105be7: 6a 00 push $0x0
jmp alltraps
80105be9: e9 13 fb ff ff jmp 80105701 <alltraps>
80105bee <vector1>:
.globl vector1
vector1:
pushl $0
80105bee: 6a 00 push $0x0
pushl $1
80105bf0: 6a 01 push $0x1
jmp alltraps
80105bf2: e9 0a fb ff ff jmp 80105701 <alltraps>
80105bf7 <vector2>:
.globl vector2
vector2:
pushl $0
80105bf7: 6a 00 push $0x0
pushl $2
80105bf9: 6a 02 push $0x2
jmp alltraps
80105bfb: e9 01 fb ff ff jmp 80105701 <alltraps>
80105c00 <vector3>:
.globl vector3
vector3:
pushl $0
80105c00: 6a 00 push $0x0
pushl $3
80105c02: 6a 03 push $0x3
jmp alltraps
80105c04: e9 f8 fa ff ff jmp 80105701 <alltraps>
80105c09 <vector4>:
.globl vector4
vector4:
pushl $0
80105c09: 6a 00 push $0x0
pushl $4
80105c0b: 6a 04 push $0x4
jmp alltraps
80105c0d: e9 ef fa ff ff jmp 80105701 <alltraps>
80105c12 <vector5>:
.globl vector5
vector5:
pushl $0
80105c12: 6a 00 push $0x0
pushl $5
80105c14: 6a 05 push $0x5
jmp alltraps
80105c16: e9 e6 fa ff ff jmp 80105701 <alltraps>
80105c1b <vector6>:
.globl vector6
vector6:
pushl $0
80105c1b: 6a 00 push $0x0
pushl $6
80105c1d: 6a 06 push $0x6
jmp alltraps
80105c1f: e9 dd fa ff ff jmp 80105701 <alltraps>
80105c24 <vector7>:
.globl vector7
vector7:
pushl $0
80105c24: 6a 00 push $0x0
pushl $7
80105c26: 6a 07 push $0x7
jmp alltraps
80105c28: e9 d4 fa ff ff jmp 80105701 <alltraps>
80105c2d <vector8>:
.globl vector8
vector8:
pushl $8
80105c2d: 6a 08 push $0x8
jmp alltraps
80105c2f: e9 cd fa ff ff jmp 80105701 <alltraps>
80105c34 <vector9>:
.globl vector9
vector9:
pushl $0
80105c34: 6a 00 push $0x0
pushl $9
80105c36: 6a 09 push $0x9
jmp alltraps
80105c38: e9 c4 fa ff ff jmp 80105701 <alltraps>
80105c3d <vector10>:
.globl vector10
vector10:
pushl $10
80105c3d: 6a 0a push $0xa
jmp alltraps
80105c3f: e9 bd fa ff ff jmp 80105701 <alltraps>
80105c44 <vector11>:
.globl vector11
vector11:
pushl $11
80105c44: 6a 0b push $0xb
jmp alltraps
80105c46: e9 b6 fa ff ff jmp 80105701 <alltraps>
80105c4b <vector12>:
.globl vector12
vector12:
pushl $12
80105c4b: 6a 0c push $0xc
jmp alltraps
80105c4d: e9 af fa ff ff jmp 80105701 <alltraps>
80105c52 <vector13>:
.globl vector13
vector13:
pushl $13
80105c52: 6a 0d push $0xd
jmp alltraps
80105c54: e9 a8 fa ff ff jmp 80105701 <alltraps>
80105c59 <vector14>:
.globl vector14
vector14:
pushl $14
80105c59: 6a 0e push $0xe
jmp alltraps
80105c5b: e9 a1 fa ff ff jmp 80105701 <alltraps>
80105c60 <vector15>:
.globl vector15
vector15:
pushl $0
80105c60: 6a 00 push $0x0
pushl $15
80105c62: 6a 0f push $0xf
jmp alltraps
80105c64: e9 98 fa ff ff jmp 80105701 <alltraps>
80105c69 <vector16>:
.globl vector16
vector16:
pushl $0
80105c69: 6a 00 push $0x0
pushl $16
80105c6b: 6a 10 push $0x10
jmp alltraps
80105c6d: e9 8f fa ff ff jmp 80105701 <alltraps>
80105c72 <vector17>:
.globl vector17
vector17:
pushl $17
80105c72: 6a 11 push $0x11
jmp alltraps
80105c74: e9 88 fa ff ff jmp 80105701 <alltraps>
80105c79 <vector18>:
.globl vector18
vector18:
pushl $0
80105c79: 6a 00 push $0x0
pushl $18
80105c7b: 6a 12 push $0x12
jmp alltraps
80105c7d: e9 7f fa ff ff jmp 80105701 <alltraps>
80105c82 <vector19>:
.globl vector19
vector19:
pushl $0
80105c82: 6a 00 push $0x0
pushl $19
80105c84: 6a 13 push $0x13
jmp alltraps
80105c86: e9 76 fa ff ff jmp 80105701 <alltraps>
80105c8b <vector20>:
.globl vector20
vector20:
pushl $0
80105c8b: 6a 00 push $0x0
pushl $20
80105c8d: 6a 14 push $0x14
jmp alltraps
80105c8f: e9 6d fa ff ff jmp 80105701 <alltraps>
80105c94 <vector21>:
.globl vector21
vector21:
pushl $0
80105c94: 6a 00 push $0x0
pushl $21
80105c96: 6a 15 push $0x15
jmp alltraps
80105c98: e9 64 fa ff ff jmp 80105701 <alltraps>
80105c9d <vector22>:
.globl vector22
vector22:
pushl $0
80105c9d: 6a 00 push $0x0
pushl $22
80105c9f: 6a 16 push $0x16
jmp alltraps
80105ca1: e9 5b fa ff ff jmp 80105701 <alltraps>
80105ca6 <vector23>:
.globl vector23
vector23:
pushl $0
80105ca6: 6a 00 push $0x0
pushl $23
80105ca8: 6a 17 push $0x17
jmp alltraps
80105caa: e9 52 fa ff ff jmp 80105701 <alltraps>
80105caf <vector24>:
.globl vector24
vector24:
pushl $0
80105caf: 6a 00 push $0x0
pushl $24
80105cb1: 6a 18 push $0x18
jmp alltraps
80105cb3: e9 49 fa ff ff jmp 80105701 <alltraps>
80105cb8 <vector25>:
.globl vector25
vector25:
pushl $0
80105cb8: 6a 00 push $0x0
pushl $25
80105cba: 6a 19 push $0x19
jmp alltraps
80105cbc: e9 40 fa ff ff jmp 80105701 <alltraps>
80105cc1 <vector26>:
.globl vector26
vector26:
pushl $0
80105cc1: 6a 00 push $0x0
pushl $26
80105cc3: 6a 1a push $0x1a
jmp alltraps
80105cc5: e9 37 fa ff ff jmp 80105701 <alltraps>
80105cca <vector27>:
.globl vector27
vector27:
pushl $0
80105cca: 6a 00 push $0x0
pushl $27
80105ccc: 6a 1b push $0x1b
jmp alltraps
80105cce: e9 2e fa ff ff jmp 80105701 <alltraps>
80105cd3 <vector28>:
.globl vector28
vector28:
pushl $0
80105cd3: 6a 00 push $0x0
pushl $28
80105cd5: 6a 1c push $0x1c
jmp alltraps
80105cd7: e9 25 fa ff ff jmp 80105701 <alltraps>
80105cdc <vector29>:
.globl vector29
vector29:
pushl $0
80105cdc: 6a 00 push $0x0
pushl $29
80105cde: 6a 1d push $0x1d
jmp alltraps
80105ce0: e9 1c fa ff ff jmp 80105701 <alltraps>
80105ce5 <vector30>:
.globl vector30
vector30:
pushl $0
80105ce5: 6a 00 push $0x0
pushl $30
80105ce7: 6a 1e push $0x1e
jmp alltraps
80105ce9: e9 13 fa ff ff jmp 80105701 <alltraps>
80105cee <vector31>:
.globl vector31
vector31:
pushl $0
80105cee: 6a 00 push $0x0
pushl $31
80105cf0: 6a 1f push $0x1f
jmp alltraps
80105cf2: e9 0a fa ff ff jmp 80105701 <alltraps>
80105cf7 <vector32>:
.globl vector32
vector32:
pushl $0
80105cf7: 6a 00 push $0x0
pushl $32
80105cf9: 6a 20 push $0x20
jmp alltraps
80105cfb: e9 01 fa ff ff jmp 80105701 <alltraps>
80105d00 <vector33>:
.globl vector33
vector33:
pushl $0
80105d00: 6a 00 push $0x0
pushl $33
80105d02: 6a 21 push $0x21
jmp alltraps
80105d04: e9 f8 f9 ff ff jmp 80105701 <alltraps>
80105d09 <vector34>:
.globl vector34
vector34:
pushl $0
80105d09: 6a 00 push $0x0
pushl $34
80105d0b: 6a 22 push $0x22
jmp alltraps
80105d0d: e9 ef f9 ff ff jmp 80105701 <alltraps>
80105d12 <vector35>:
.globl vector35
vector35:
pushl $0
80105d12: 6a 00 push $0x0
pushl $35
80105d14: 6a 23 push $0x23
jmp alltraps
80105d16: e9 e6 f9 ff ff jmp 80105701 <alltraps>
80105d1b <vector36>:
.globl vector36
vector36:
pushl $0
80105d1b: 6a 00 push $0x0
pushl $36
80105d1d: 6a 24 push $0x24
jmp alltraps
80105d1f: e9 dd f9 ff ff jmp 80105701 <alltraps>
80105d24 <vector37>:
.globl vector37
vector37:
pushl $0
80105d24: 6a 00 push $0x0
pushl $37
80105d26: 6a 25 push $0x25
jmp alltraps
80105d28: e9 d4 f9 ff ff jmp 80105701 <alltraps>
80105d2d <vector38>:
.globl vector38
vector38:
pushl $0
80105d2d: 6a 00 push $0x0
pushl $38
80105d2f: 6a 26 push $0x26
jmp alltraps
80105d31: e9 cb f9 ff ff jmp 80105701 <alltraps>
80105d36 <vector39>:
.globl vector39
vector39:
pushl $0
80105d36: 6a 00 push $0x0
pushl $39
80105d38: 6a 27 push $0x27
jmp alltraps
80105d3a: e9 c2 f9 ff ff jmp 80105701 <alltraps>
80105d3f <vector40>:
.globl vector40
vector40:
pushl $0
80105d3f: 6a 00 push $0x0
pushl $40
80105d41: 6a 28 push $0x28
jmp alltraps
80105d43: e9 b9 f9 ff ff jmp 80105701 <alltraps>
80105d48 <vector41>:
.globl vector41
vector41:
pushl $0
80105d48: 6a 00 push $0x0
pushl $41
80105d4a: 6a 29 push $0x29
jmp alltraps
80105d4c: e9 b0 f9 ff ff jmp 80105701 <alltraps>
80105d51 <vector42>:
.globl vector42
vector42:
pushl $0
80105d51: 6a 00 push $0x0
pushl $42
80105d53: 6a 2a push $0x2a
jmp alltraps
80105d55: e9 a7 f9 ff ff jmp 80105701 <alltraps>
80105d5a <vector43>:
.globl vector43
vector43:
pushl $0
80105d5a: 6a 00 push $0x0
pushl $43
80105d5c: 6a 2b push $0x2b
jmp alltraps
80105d5e: e9 9e f9 ff ff jmp 80105701 <alltraps>
80105d63 <vector44>:
.globl vector44
vector44:
pushl $0
80105d63: 6a 00 push $0x0
pushl $44
80105d65: 6a 2c push $0x2c
jmp alltraps
80105d67: e9 95 f9 ff ff jmp 80105701 <alltraps>
80105d6c <vector45>:
.globl vector45
vector45:
pushl $0
80105d6c: 6a 00 push $0x0
pushl $45
80105d6e: 6a 2d push $0x2d
jmp alltraps
80105d70: e9 8c f9 ff ff jmp 80105701 <alltraps>
80105d75 <vector46>:
.globl vector46
vector46:
pushl $0
80105d75: 6a 00 push $0x0
pushl $46
80105d77: 6a 2e push $0x2e
jmp alltraps
80105d79: e9 83 f9 ff ff jmp 80105701 <alltraps>
80105d7e <vector47>:
.globl vector47
vector47:
pushl $0
80105d7e: 6a 00 push $0x0
pushl $47
80105d80: 6a 2f push $0x2f
jmp alltraps
80105d82: e9 7a f9 ff ff jmp 80105701 <alltraps>
80105d87 <vector48>:
.globl vector48
vector48:
pushl $0
80105d87: 6a 00 push $0x0
pushl $48
80105d89: 6a 30 push $0x30
jmp alltraps
80105d8b: e9 71 f9 ff ff jmp 80105701 <alltraps>
80105d90 <vector49>:
.globl vector49
vector49:
pushl $0
80105d90: 6a 00 push $0x0
pushl $49
80105d92: 6a 31 push $0x31
jmp alltraps
80105d94: e9 68 f9 ff ff jmp 80105701 <alltraps>
80105d99 <vector50>:
.globl vector50
vector50:
pushl $0
80105d99: 6a 00 push $0x0
pushl $50
80105d9b: 6a 32 push $0x32
jmp alltraps
80105d9d: e9 5f f9 ff ff jmp 80105701 <alltraps>
80105da2 <vector51>:
.globl vector51
vector51:
pushl $0
80105da2: 6a 00 push $0x0
pushl $51
80105da4: 6a 33 push $0x33
jmp alltraps
80105da6: e9 56 f9 ff ff jmp 80105701 <alltraps>
80105dab <vector52>:
.globl vector52
vector52:
pushl $0
80105dab: 6a 00 push $0x0
pushl $52
80105dad: 6a 34 push $0x34
jmp alltraps
80105daf: e9 4d f9 ff ff jmp 80105701 <alltraps>
80105db4 <vector53>:
.globl vector53
vector53:
pushl $0
80105db4: 6a 00 push $0x0
pushl $53
80105db6: 6a 35 push $0x35
jmp alltraps
80105db8: e9 44 f9 ff ff jmp 80105701 <alltraps>
80105dbd <vector54>:
.globl vector54
vector54:
pushl $0
80105dbd: 6a 00 push $0x0
pushl $54
80105dbf: 6a 36 push $0x36
jmp alltraps
80105dc1: e9 3b f9 ff ff jmp 80105701 <alltraps>
80105dc6 <vector55>:
.globl vector55
vector55:
pushl $0
80105dc6: 6a 00 push $0x0
pushl $55
80105dc8: 6a 37 push $0x37
jmp alltraps
80105dca: e9 32 f9 ff ff jmp 80105701 <alltraps>
80105dcf <vector56>:
.globl vector56
vector56:
pushl $0
80105dcf: 6a 00 push $0x0
pushl $56
80105dd1: 6a 38 push $0x38
jmp alltraps
80105dd3: e9 29 f9 ff ff jmp 80105701 <alltraps>
80105dd8 <vector57>:
.globl vector57
vector57:
pushl $0
80105dd8: 6a 00 push $0x0
pushl $57
80105dda: 6a 39 push $0x39
jmp alltraps
80105ddc: e9 20 f9 ff ff jmp 80105701 <alltraps>
80105de1 <vector58>:
.globl vector58
vector58:
pushl $0
80105de1: 6a 00 push $0x0
pushl $58
80105de3: 6a 3a push $0x3a
jmp alltraps
80105de5: e9 17 f9 ff ff jmp 80105701 <alltraps>
80105dea <vector59>:
.globl vector59
vector59:
pushl $0
80105dea: 6a 00 push $0x0
pushl $59
80105dec: 6a 3b push $0x3b
jmp alltraps
80105dee: e9 0e f9 ff ff jmp 80105701 <alltraps>
80105df3 <vector60>:
.globl vector60
vector60:
pushl $0
80105df3: 6a 00 push $0x0
pushl $60
80105df5: 6a 3c push $0x3c
jmp alltraps
80105df7: e9 05 f9 ff ff jmp 80105701 <alltraps>
80105dfc <vector61>:
.globl vector61
vector61:
pushl $0
80105dfc: 6a 00 push $0x0
pushl $61
80105dfe: 6a 3d push $0x3d
jmp alltraps
80105e00: e9 fc f8 ff ff jmp 80105701 <alltraps>
80105e05 <vector62>:
.globl vector62
vector62:
pushl $0
80105e05: 6a 00 push $0x0
pushl $62
80105e07: 6a 3e push $0x3e
jmp alltraps
80105e09: e9 f3 f8 ff ff jmp 80105701 <alltraps>
80105e0e <vector63>:
.globl vector63
vector63:
pushl $0
80105e0e: 6a 00 push $0x0
pushl $63
80105e10: 6a 3f push $0x3f
jmp alltraps
80105e12: e9 ea f8 ff ff jmp 80105701 <alltraps>
80105e17 <vector64>:
.globl vector64
vector64:
pushl $0
80105e17: 6a 00 push $0x0
pushl $64
80105e19: 6a 40 push $0x40
jmp alltraps
80105e1b: e9 e1 f8 ff ff jmp 80105701 <alltraps>
80105e20 <vector65>:
.globl vector65
vector65:
pushl $0
80105e20: 6a 00 push $0x0
pushl $65
80105e22: 6a 41 push $0x41
jmp alltraps
80105e24: e9 d8 f8 ff ff jmp 80105701 <alltraps>
80105e29 <vector66>:
.globl vector66
vector66:
pushl $0
80105e29: 6a 00 push $0x0
pushl $66
80105e2b: 6a 42 push $0x42
jmp alltraps
80105e2d: e9 cf f8 ff ff jmp 80105701 <alltraps>
80105e32 <vector67>:
.globl vector67
vector67:
pushl $0
80105e32: 6a 00 push $0x0
pushl $67
80105e34: 6a 43 push $0x43
jmp alltraps
80105e36: e9 c6 f8 ff ff jmp 80105701 <alltraps>
80105e3b <vector68>:
.globl vector68
vector68:
pushl $0
80105e3b: 6a 00 push $0x0
pushl $68
80105e3d: 6a 44 push $0x44
jmp alltraps
80105e3f: e9 bd f8 ff ff jmp 80105701 <alltraps>
80105e44 <vector69>:
.globl vector69
vector69:
pushl $0
80105e44: 6a 00 push $0x0
pushl $69
80105e46: 6a 45 push $0x45
jmp alltraps
80105e48: e9 b4 f8 ff ff jmp 80105701 <alltraps>
80105e4d <vector70>:
.globl vector70
vector70:
pushl $0
80105e4d: 6a 00 push $0x0
pushl $70
80105e4f: 6a 46 push $0x46
jmp alltraps
80105e51: e9 ab f8 ff ff jmp 80105701 <alltraps>
80105e56 <vector71>:
.globl vector71
vector71:
pushl $0
80105e56: 6a 00 push $0x0
pushl $71
80105e58: 6a 47 push $0x47
jmp alltraps
80105e5a: e9 a2 f8 ff ff jmp 80105701 <alltraps>
80105e5f <vector72>:
.globl vector72
vector72:
pushl $0
80105e5f: 6a 00 push $0x0
pushl $72
80105e61: 6a 48 push $0x48
jmp alltraps
80105e63: e9 99 f8 ff ff jmp 80105701 <alltraps>
80105e68 <vector73>:
.globl vector73
vector73:
pushl $0
80105e68: 6a 00 push $0x0
pushl $73
80105e6a: 6a 49 push $0x49
jmp alltraps
80105e6c: e9 90 f8 ff ff jmp 80105701 <alltraps>
80105e71 <vector74>:
.globl vector74
vector74:
pushl $0
80105e71: 6a 00 push $0x0
pushl $74
80105e73: 6a 4a push $0x4a
jmp alltraps
80105e75: e9 87 f8 ff ff jmp 80105701 <alltraps>
80105e7a <vector75>:
.globl vector75
vector75:
pushl $0
80105e7a: 6a 00 push $0x0
pushl $75
80105e7c: 6a 4b push $0x4b
jmp alltraps
80105e7e: e9 7e f8 ff ff jmp 80105701 <alltraps>
80105e83 <vector76>:
.globl vector76
vector76:
pushl $0
80105e83: 6a 00 push $0x0
pushl $76
80105e85: 6a 4c push $0x4c
jmp alltraps
80105e87: e9 75 f8 ff ff jmp 80105701 <alltraps>
80105e8c <vector77>:
.globl vector77
vector77:
pushl $0
80105e8c: 6a 00 push $0x0
pushl $77
80105e8e: 6a 4d push $0x4d
jmp alltraps
80105e90: e9 6c f8 ff ff jmp 80105701 <alltraps>
80105e95 <vector78>:
.globl vector78
vector78:
pushl $0
80105e95: 6a 00 push $0x0
pushl $78
80105e97: 6a 4e push $0x4e
jmp alltraps
80105e99: e9 63 f8 ff ff jmp 80105701 <alltraps>
80105e9e <vector79>:
.globl vector79
vector79:
pushl $0
80105e9e: 6a 00 push $0x0
pushl $79
80105ea0: 6a 4f push $0x4f
jmp alltraps
80105ea2: e9 5a f8 ff ff jmp 80105701 <alltraps>
80105ea7 <vector80>:
.globl vector80
vector80:
pushl $0
80105ea7: 6a 00 push $0x0
pushl $80
80105ea9: 6a 50 push $0x50
jmp alltraps
80105eab: e9 51 f8 ff ff jmp 80105701 <alltraps>
80105eb0 <vector81>:
.globl vector81
vector81:
pushl $0
80105eb0: 6a 00 push $0x0
pushl $81
80105eb2: 6a 51 push $0x51
jmp alltraps
80105eb4: e9 48 f8 ff ff jmp 80105701 <alltraps>
80105eb9 <vector82>:
.globl vector82
vector82:
pushl $0
80105eb9: 6a 00 push $0x0
pushl $82
80105ebb: 6a 52 push $0x52
jmp alltraps
80105ebd: e9 3f f8 ff ff jmp 80105701 <alltraps>
80105ec2 <vector83>:
.globl vector83
vector83:
pushl $0
80105ec2: 6a 00 push $0x0
pushl $83
80105ec4: 6a 53 push $0x53
jmp alltraps
80105ec6: e9 36 f8 ff ff jmp 80105701 <alltraps>
80105ecb <vector84>:
.globl vector84
vector84:
pushl $0
80105ecb: 6a 00 push $0x0
pushl $84
80105ecd: 6a 54 push $0x54
jmp alltraps
80105ecf: e9 2d f8 ff ff jmp 80105701 <alltraps>
80105ed4 <vector85>:
.globl vector85
vector85:
pushl $0
80105ed4: 6a 00 push $0x0
pushl $85
80105ed6: 6a 55 push $0x55
jmp alltraps
80105ed8: e9 24 f8 ff ff jmp 80105701 <alltraps>
80105edd <vector86>:
.globl vector86
vector86:
pushl $0
80105edd: 6a 00 push $0x0
pushl $86
80105edf: 6a 56 push $0x56
jmp alltraps
80105ee1: e9 1b f8 ff ff jmp 80105701 <alltraps>
80105ee6 <vector87>:
.globl vector87
vector87:
pushl $0
80105ee6: 6a 00 push $0x0
pushl $87
80105ee8: 6a 57 push $0x57
jmp alltraps
80105eea: e9 12 f8 ff ff jmp 80105701 <alltraps>
80105eef <vector88>:
.globl vector88
vector88:
pushl $0
80105eef: 6a 00 push $0x0
pushl $88
80105ef1: 6a 58 push $0x58
jmp alltraps
80105ef3: e9 09 f8 ff ff jmp 80105701 <alltraps>
80105ef8 <vector89>:
.globl vector89
vector89:
pushl $0
80105ef8: 6a 00 push $0x0
pushl $89
80105efa: 6a 59 push $0x59
jmp alltraps
80105efc: e9 00 f8 ff ff jmp 80105701 <alltraps>
80105f01 <vector90>:
.globl vector90
vector90:
pushl $0
80105f01: 6a 00 push $0x0
pushl $90
80105f03: 6a 5a push $0x5a
jmp alltraps
80105f05: e9 f7 f7 ff ff jmp 80105701 <alltraps>
80105f0a <vector91>:
.globl vector91
vector91:
pushl $0
80105f0a: 6a 00 push $0x0
pushl $91
80105f0c: 6a 5b push $0x5b
jmp alltraps
80105f0e: e9 ee f7 ff ff jmp 80105701 <alltraps>
80105f13 <vector92>:
.globl vector92
vector92:
pushl $0
80105f13: 6a 00 push $0x0
pushl $92
80105f15: 6a 5c push $0x5c
jmp alltraps
80105f17: e9 e5 f7 ff ff jmp 80105701 <alltraps>
80105f1c <vector93>:
.globl vector93
vector93:
pushl $0
80105f1c: 6a 00 push $0x0
pushl $93
80105f1e: 6a 5d push $0x5d
jmp alltraps
80105f20: e9 dc f7 ff ff jmp 80105701 <alltraps>
80105f25 <vector94>:
.globl vector94
vector94:
pushl $0
80105f25: 6a 00 push $0x0
pushl $94
80105f27: 6a 5e push $0x5e
jmp alltraps
80105f29: e9 d3 f7 ff ff jmp 80105701 <alltraps>
80105f2e <vector95>:
.globl vector95
vector95:
pushl $0
80105f2e: 6a 00 push $0x0
pushl $95
80105f30: 6a 5f push $0x5f
jmp alltraps
80105f32: e9 ca f7 ff ff jmp 80105701 <alltraps>
80105f37 <vector96>:
.globl vector96
vector96:
pushl $0
80105f37: 6a 00 push $0x0
pushl $96
80105f39: 6a 60 push $0x60
jmp alltraps
80105f3b: e9 c1 f7 ff ff jmp 80105701 <alltraps>
80105f40 <vector97>:
.globl vector97
vector97:
pushl $0
80105f40: 6a 00 push $0x0
pushl $97
80105f42: 6a 61 push $0x61
jmp alltraps
80105f44: e9 b8 f7 ff ff jmp 80105701 <alltraps>
80105f49 <vector98>:
.globl vector98
vector98:
pushl $0
80105f49: 6a 00 push $0x0
pushl $98
80105f4b: 6a 62 push $0x62
jmp alltraps
80105f4d: e9 af f7 ff ff jmp 80105701 <alltraps>
80105f52 <vector99>:
.globl vector99
vector99:
pushl $0
80105f52: 6a 00 push $0x0
pushl $99
80105f54: 6a 63 push $0x63
jmp alltraps
80105f56: e9 a6 f7 ff ff jmp 80105701 <alltraps>
80105f5b <vector100>:
.globl vector100
vector100:
pushl $0
80105f5b: 6a 00 push $0x0
pushl $100
80105f5d: 6a 64 push $0x64
jmp alltraps
80105f5f: e9 9d f7 ff ff jmp 80105701 <alltraps>
80105f64 <vector101>:
.globl vector101
vector101:
pushl $0
80105f64: 6a 00 push $0x0
pushl $101
80105f66: 6a 65 push $0x65
jmp alltraps
80105f68: e9 94 f7 ff ff jmp 80105701 <alltraps>
80105f6d <vector102>:
.globl vector102
vector102:
pushl $0
80105f6d: 6a 00 push $0x0
pushl $102
80105f6f: 6a 66 push $0x66
jmp alltraps
80105f71: e9 8b f7 ff ff jmp 80105701 <alltraps>
80105f76 <vector103>:
.globl vector103
vector103:
pushl $0
80105f76: 6a 00 push $0x0
pushl $103
80105f78: 6a 67 push $0x67
jmp alltraps
80105f7a: e9 82 f7 ff ff jmp 80105701 <alltraps>
80105f7f <vector104>:
.globl vector104
vector104:
pushl $0
80105f7f: 6a 00 push $0x0
pushl $104
80105f81: 6a 68 push $0x68
jmp alltraps
80105f83: e9 79 f7 ff ff jmp 80105701 <alltraps>
80105f88 <vector105>:
.globl vector105
vector105:
pushl $0
80105f88: 6a 00 push $0x0
pushl $105
80105f8a: 6a 69 push $0x69
jmp alltraps
80105f8c: e9 70 f7 ff ff jmp 80105701 <alltraps>
80105f91 <vector106>:
.globl vector106
vector106:
pushl $0
80105f91: 6a 00 push $0x0
pushl $106
80105f93: 6a 6a push $0x6a
jmp alltraps
80105f95: e9 67 f7 ff ff jmp 80105701 <alltraps>
80105f9a <vector107>:
.globl vector107
vector107:
pushl $0
80105f9a: 6a 00 push $0x0
pushl $107
80105f9c: 6a 6b push $0x6b
jmp alltraps
80105f9e: e9 5e f7 ff ff jmp 80105701 <alltraps>
80105fa3 <vector108>:
.globl vector108
vector108:
pushl $0
80105fa3: 6a 00 push $0x0
pushl $108
80105fa5: 6a 6c push $0x6c
jmp alltraps
80105fa7: e9 55 f7 ff ff jmp 80105701 <alltraps>
80105fac <vector109>:
.globl vector109
vector109:
pushl $0
80105fac: 6a 00 push $0x0
pushl $109
80105fae: 6a 6d push $0x6d
jmp alltraps
80105fb0: e9 4c f7 ff ff jmp 80105701 <alltraps>
80105fb5 <vector110>:
.globl vector110
vector110:
pushl $0
80105fb5: 6a 00 push $0x0
pushl $110
80105fb7: 6a 6e push $0x6e
jmp alltraps
80105fb9: e9 43 f7 ff ff jmp 80105701 <alltraps>
80105fbe <vector111>:
.globl vector111
vector111:
pushl $0
80105fbe: 6a 00 push $0x0
pushl $111
80105fc0: 6a 6f push $0x6f
jmp alltraps
80105fc2: e9 3a f7 ff ff jmp 80105701 <alltraps>
80105fc7 <vector112>:
.globl vector112
vector112:
pushl $0
80105fc7: 6a 00 push $0x0
pushl $112
80105fc9: 6a 70 push $0x70
jmp alltraps
80105fcb: e9 31 f7 ff ff jmp 80105701 <alltraps>
80105fd0 <vector113>:
.globl vector113
vector113:
pushl $0
80105fd0: 6a 00 push $0x0
pushl $113
80105fd2: 6a 71 push $0x71
jmp alltraps
80105fd4: e9 28 f7 ff ff jmp 80105701 <alltraps>
80105fd9 <vector114>:
.globl vector114
vector114:
pushl $0
80105fd9: 6a 00 push $0x0
pushl $114
80105fdb: 6a 72 push $0x72
jmp alltraps
80105fdd: e9 1f f7 ff ff jmp 80105701 <alltraps>
80105fe2 <vector115>:
.globl vector115
vector115:
pushl $0
80105fe2: 6a 00 push $0x0
pushl $115
80105fe4: 6a 73 push $0x73
jmp alltraps
80105fe6: e9 16 f7 ff ff jmp 80105701 <alltraps>
80105feb <vector116>:
.globl vector116
vector116:
pushl $0
80105feb: 6a 00 push $0x0
pushl $116
80105fed: 6a 74 push $0x74
jmp alltraps
80105fef: e9 0d f7 ff ff jmp 80105701 <alltraps>
80105ff4 <vector117>:
.globl vector117
vector117:
pushl $0
80105ff4: 6a 00 push $0x0
pushl $117
80105ff6: 6a 75 push $0x75
jmp alltraps
80105ff8: e9 04 f7 ff ff jmp 80105701 <alltraps>
80105ffd <vector118>:
.globl vector118
vector118:
pushl $0
80105ffd: 6a 00 push $0x0
pushl $118
80105fff: 6a 76 push $0x76
jmp alltraps
80106001: e9 fb f6 ff ff jmp 80105701 <alltraps>
80106006 <vector119>:
.globl vector119
vector119:
pushl $0
80106006: 6a 00 push $0x0
pushl $119
80106008: 6a 77 push $0x77
jmp alltraps
8010600a: e9 f2 f6 ff ff jmp 80105701 <alltraps>
8010600f <vector120>:
.globl vector120
vector120:
pushl $0
8010600f: 6a 00 push $0x0
pushl $120
80106011: 6a 78 push $0x78
jmp alltraps
80106013: e9 e9 f6 ff ff jmp 80105701 <alltraps>
80106018 <vector121>:
.globl vector121
vector121:
pushl $0
80106018: 6a 00 push $0x0
pushl $121
8010601a: 6a 79 push $0x79
jmp alltraps
8010601c: e9 e0 f6 ff ff jmp 80105701 <alltraps>
80106021 <vector122>:
.globl vector122
vector122:
pushl $0
80106021: 6a 00 push $0x0
pushl $122
80106023: 6a 7a push $0x7a
jmp alltraps
80106025: e9 d7 f6 ff ff jmp 80105701 <alltraps>
8010602a <vector123>:
.globl vector123
vector123:
pushl $0
8010602a: 6a 00 push $0x0
pushl $123
8010602c: 6a 7b push $0x7b
jmp alltraps
8010602e: e9 ce f6 ff ff jmp 80105701 <alltraps>
80106033 <vector124>:
.globl vector124
vector124:
pushl $0
80106033: 6a 00 push $0x0
pushl $124
80106035: 6a 7c push $0x7c
jmp alltraps
80106037: e9 c5 f6 ff ff jmp 80105701 <alltraps>
8010603c <vector125>:
.globl vector125
vector125:
pushl $0
8010603c: 6a 00 push $0x0
pushl $125
8010603e: 6a 7d push $0x7d
jmp alltraps
80106040: e9 bc f6 ff ff jmp 80105701 <alltraps>
80106045 <vector126>:
.globl vector126
vector126:
pushl $0
80106045: 6a 00 push $0x0
pushl $126
80106047: 6a 7e push $0x7e
jmp alltraps
80106049: e9 b3 f6 ff ff jmp 80105701 <alltraps>
8010604e <vector127>:
.globl vector127
vector127:
pushl $0
8010604e: 6a 00 push $0x0
pushl $127
80106050: 6a 7f push $0x7f
jmp alltraps
80106052: e9 aa f6 ff ff jmp 80105701 <alltraps>
80106057 <vector128>:
.globl vector128
vector128:
pushl $0
80106057: 6a 00 push $0x0
pushl $128
80106059: 68 80 00 00 00 push $0x80
jmp alltraps
8010605e: e9 9e f6 ff ff jmp 80105701 <alltraps>
80106063 <vector129>:
.globl vector129
vector129:
pushl $0
80106063: 6a 00 push $0x0
pushl $129
80106065: 68 81 00 00 00 push $0x81
jmp alltraps
8010606a: e9 92 f6 ff ff jmp 80105701 <alltraps>
8010606f <vector130>:
.globl vector130
vector130:
pushl $0
8010606f: 6a 00 push $0x0
pushl $130
80106071: 68 82 00 00 00 push $0x82
jmp alltraps
80106076: e9 86 f6 ff ff jmp 80105701 <alltraps>
8010607b <vector131>:
.globl vector131
vector131:
pushl $0
8010607b: 6a 00 push $0x0
pushl $131
8010607d: 68 83 00 00 00 push $0x83
jmp alltraps
80106082: e9 7a f6 ff ff jmp 80105701 <alltraps>
80106087 <vector132>:
.globl vector132
vector132:
pushl $0
80106087: 6a 00 push $0x0
pushl $132
80106089: 68 84 00 00 00 push $0x84
jmp alltraps
8010608e: e9 6e f6 ff ff jmp 80105701 <alltraps>
80106093 <vector133>:
.globl vector133
vector133:
pushl $0
80106093: 6a 00 push $0x0
pushl $133
80106095: 68 85 00 00 00 push $0x85
jmp alltraps
8010609a: e9 62 f6 ff ff jmp 80105701 <alltraps>
8010609f <vector134>:
.globl vector134
vector134:
pushl $0
8010609f: 6a 00 push $0x0
pushl $134
801060a1: 68 86 00 00 00 push $0x86
jmp alltraps
801060a6: e9 56 f6 ff ff jmp 80105701 <alltraps>
801060ab <vector135>:
.globl vector135
vector135:
pushl $0
801060ab: 6a 00 push $0x0
pushl $135
801060ad: 68 87 00 00 00 push $0x87
jmp alltraps
801060b2: e9 4a f6 ff ff jmp 80105701 <alltraps>
801060b7 <vector136>:
.globl vector136
vector136:
pushl $0
801060b7: 6a 00 push $0x0
pushl $136
801060b9: 68 88 00 00 00 push $0x88
jmp alltraps
801060be: e9 3e f6 ff ff jmp 80105701 <alltraps>
801060c3 <vector137>:
.globl vector137
vector137:
pushl $0
801060c3: 6a 00 push $0x0
pushl $137
801060c5: 68 89 00 00 00 push $0x89
jmp alltraps
801060ca: e9 32 f6 ff ff jmp 80105701 <alltraps>
801060cf <vector138>:
.globl vector138
vector138:
pushl $0
801060cf: 6a 00 push $0x0
pushl $138
801060d1: 68 8a 00 00 00 push $0x8a
jmp alltraps
801060d6: e9 26 f6 ff ff jmp 80105701 <alltraps>
801060db <vector139>:
.globl vector139
vector139:
pushl $0
801060db: 6a 00 push $0x0
pushl $139
801060dd: 68 8b 00 00 00 push $0x8b
jmp alltraps
801060e2: e9 1a f6 ff ff jmp 80105701 <alltraps>
801060e7 <vector140>:
.globl vector140
vector140:
pushl $0
801060e7: 6a 00 push $0x0
pushl $140
801060e9: 68 8c 00 00 00 push $0x8c
jmp alltraps
801060ee: e9 0e f6 ff ff jmp 80105701 <alltraps>
801060f3 <vector141>:
.globl vector141
vector141:
pushl $0
801060f3: 6a 00 push $0x0
pushl $141
801060f5: 68 8d 00 00 00 push $0x8d
jmp alltraps
801060fa: e9 02 f6 ff ff jmp 80105701 <alltraps>
801060ff <vector142>:
.globl vector142
vector142:
pushl $0
801060ff: 6a 00 push $0x0
pushl $142
80106101: 68 8e 00 00 00 push $0x8e
jmp alltraps
80106106: e9 f6 f5 ff ff jmp 80105701 <alltraps>
8010610b <vector143>:
.globl vector143
vector143:
pushl $0
8010610b: 6a 00 push $0x0
pushl $143
8010610d: 68 8f 00 00 00 push $0x8f
jmp alltraps
80106112: e9 ea f5 ff ff jmp 80105701 <alltraps>
80106117 <vector144>:
.globl vector144
vector144:
pushl $0
80106117: 6a 00 push $0x0
pushl $144
80106119: 68 90 00 00 00 push $0x90
jmp alltraps
8010611e: e9 de f5 ff ff jmp 80105701 <alltraps>
80106123 <vector145>:
.globl vector145
vector145:
pushl $0
80106123: 6a 00 push $0x0
pushl $145
80106125: 68 91 00 00 00 push $0x91
jmp alltraps
8010612a: e9 d2 f5 ff ff jmp 80105701 <alltraps>
8010612f <vector146>:
.globl vector146
vector146:
pushl $0
8010612f: 6a 00 push $0x0
pushl $146
80106131: 68 92 00 00 00 push $0x92
jmp alltraps
80106136: e9 c6 f5 ff ff jmp 80105701 <alltraps>
8010613b <vector147>:
.globl vector147
vector147:
pushl $0
8010613b: 6a 00 push $0x0
pushl $147
8010613d: 68 93 00 00 00 push $0x93
jmp alltraps
80106142: e9 ba f5 ff ff jmp 80105701 <alltraps>
80106147 <vector148>:
.globl vector148
vector148:
pushl $0
80106147: 6a 00 push $0x0
pushl $148
80106149: 68 94 00 00 00 push $0x94
jmp alltraps
8010614e: e9 ae f5 ff ff jmp 80105701 <alltraps>
80106153 <vector149>:
.globl vector149
vector149:
pushl $0
80106153: 6a 00 push $0x0
pushl $149
80106155: 68 95 00 00 00 push $0x95
jmp alltraps
8010615a: e9 a2 f5 ff ff jmp 80105701 <alltraps>
8010615f <vector150>:
.globl vector150
vector150:
pushl $0
8010615f: 6a 00 push $0x0
pushl $150
80106161: 68 96 00 00 00 push $0x96
jmp alltraps
80106166: e9 96 f5 ff ff jmp 80105701 <alltraps>
8010616b <vector151>:
.globl vector151
vector151:
pushl $0
8010616b: 6a 00 push $0x0
pushl $151
8010616d: 68 97 00 00 00 push $0x97
jmp alltraps
80106172: e9 8a f5 ff ff jmp 80105701 <alltraps>
80106177 <vector152>:
.globl vector152
vector152:
pushl $0
80106177: 6a 00 push $0x0
pushl $152
80106179: 68 98 00 00 00 push $0x98
jmp alltraps
8010617e: e9 7e f5 ff ff jmp 80105701 <alltraps>
80106183 <vector153>:
.globl vector153
vector153:
pushl $0
80106183: 6a 00 push $0x0
pushl $153
80106185: 68 99 00 00 00 push $0x99
jmp alltraps
8010618a: e9 72 f5 ff ff jmp 80105701 <alltraps>
8010618f <vector154>:
.globl vector154
vector154:
pushl $0
8010618f: 6a 00 push $0x0
pushl $154
80106191: 68 9a 00 00 00 push $0x9a
jmp alltraps
80106196: e9 66 f5 ff ff jmp 80105701 <alltraps>
8010619b <vector155>:
.globl vector155
vector155:
pushl $0
8010619b: 6a 00 push $0x0
pushl $155
8010619d: 68 9b 00 00 00 push $0x9b
jmp alltraps
801061a2: e9 5a f5 ff ff jmp 80105701 <alltraps>
801061a7 <vector156>:
.globl vector156
vector156:
pushl $0
801061a7: 6a 00 push $0x0
pushl $156
801061a9: 68 9c 00 00 00 push $0x9c
jmp alltraps
801061ae: e9 4e f5 ff ff jmp 80105701 <alltraps>
801061b3 <vector157>:
.globl vector157
vector157:
pushl $0
801061b3: 6a 00 push $0x0
pushl $157
801061b5: 68 9d 00 00 00 push $0x9d
jmp alltraps
801061ba: e9 42 f5 ff ff jmp 80105701 <alltraps>
801061bf <vector158>:
.globl vector158
vector158:
pushl $0
801061bf: 6a 00 push $0x0
pushl $158
801061c1: 68 9e 00 00 00 push $0x9e
jmp alltraps
801061c6: e9 36 f5 ff ff jmp 80105701 <alltraps>
801061cb <vector159>:
.globl vector159
vector159:
pushl $0
801061cb: 6a 00 push $0x0
pushl $159
801061cd: 68 9f 00 00 00 push $0x9f
jmp alltraps
801061d2: e9 2a f5 ff ff jmp 80105701 <alltraps>
801061d7 <vector160>:
.globl vector160
vector160:
pushl $0
801061d7: 6a 00 push $0x0
pushl $160
801061d9: 68 a0 00 00 00 push $0xa0
jmp alltraps
801061de: e9 1e f5 ff ff jmp 80105701 <alltraps>
801061e3 <vector161>:
.globl vector161
vector161:
pushl $0
801061e3: 6a 00 push $0x0
pushl $161
801061e5: 68 a1 00 00 00 push $0xa1
jmp alltraps
801061ea: e9 12 f5 ff ff jmp 80105701 <alltraps>
801061ef <vector162>:
.globl vector162
vector162:
pushl $0
801061ef: 6a 00 push $0x0
pushl $162
801061f1: 68 a2 00 00 00 push $0xa2
jmp alltraps
801061f6: e9 06 f5 ff ff jmp 80105701 <alltraps>
801061fb <vector163>:
.globl vector163
vector163:
pushl $0
801061fb: 6a 00 push $0x0
pushl $163
801061fd: 68 a3 00 00 00 push $0xa3
jmp alltraps
80106202: e9 fa f4 ff ff jmp 80105701 <alltraps>
80106207 <vector164>:
.globl vector164
vector164:
pushl $0
80106207: 6a 00 push $0x0
pushl $164
80106209: 68 a4 00 00 00 push $0xa4
jmp alltraps
8010620e: e9 ee f4 ff ff jmp 80105701 <alltraps>
80106213 <vector165>:
.globl vector165
vector165:
pushl $0
80106213: 6a 00 push $0x0
pushl $165
80106215: 68 a5 00 00 00 push $0xa5
jmp alltraps
8010621a: e9 e2 f4 ff ff jmp 80105701 <alltraps>
8010621f <vector166>:
.globl vector166
vector166:
pushl $0
8010621f: 6a 00 push $0x0
pushl $166
80106221: 68 a6 00 00 00 push $0xa6
jmp alltraps
80106226: e9 d6 f4 ff ff jmp 80105701 <alltraps>
8010622b <vector167>:
.globl vector167
vector167:
pushl $0
8010622b: 6a 00 push $0x0
pushl $167
8010622d: 68 a7 00 00 00 push $0xa7
jmp alltraps
80106232: e9 ca f4 ff ff jmp 80105701 <alltraps>
80106237 <vector168>:
.globl vector168
vector168:
pushl $0
80106237: 6a 00 push $0x0
pushl $168
80106239: 68 a8 00 00 00 push $0xa8
jmp alltraps
8010623e: e9 be f4 ff ff jmp 80105701 <alltraps>
80106243 <vector169>:
.globl vector169
vector169:
pushl $0
80106243: 6a 00 push $0x0
pushl $169
80106245: 68 a9 00 00 00 push $0xa9
jmp alltraps
8010624a: e9 b2 f4 ff ff jmp 80105701 <alltraps>
8010624f <vector170>:
.globl vector170
vector170:
pushl $0
8010624f: 6a 00 push $0x0
pushl $170
80106251: 68 aa 00 00 00 push $0xaa
jmp alltraps
80106256: e9 a6 f4 ff ff jmp 80105701 <alltraps>
8010625b <vector171>:
.globl vector171
vector171:
pushl $0
8010625b: 6a 00 push $0x0
pushl $171
8010625d: 68 ab 00 00 00 push $0xab
jmp alltraps
80106262: e9 9a f4 ff ff jmp 80105701 <alltraps>
80106267 <vector172>:
.globl vector172
vector172:
pushl $0
80106267: 6a 00 push $0x0
pushl $172
80106269: 68 ac 00 00 00 push $0xac
jmp alltraps
8010626e: e9 8e f4 ff ff jmp 80105701 <alltraps>
80106273 <vector173>:
.globl vector173
vector173:
pushl $0
80106273: 6a 00 push $0x0
pushl $173
80106275: 68 ad 00 00 00 push $0xad
jmp alltraps
8010627a: e9 82 f4 ff ff jmp 80105701 <alltraps>
8010627f <vector174>:
.globl vector174
vector174:
pushl $0
8010627f: 6a 00 push $0x0
pushl $174
80106281: 68 ae 00 00 00 push $0xae
jmp alltraps
80106286: e9 76 f4 ff ff jmp 80105701 <alltraps>
8010628b <vector175>:
.globl vector175
vector175:
pushl $0
8010628b: 6a 00 push $0x0
pushl $175
8010628d: 68 af 00 00 00 push $0xaf
jmp alltraps
80106292: e9 6a f4 ff ff jmp 80105701 <alltraps>
80106297 <vector176>:
.globl vector176
vector176:
pushl $0
80106297: 6a 00 push $0x0
pushl $176
80106299: 68 b0 00 00 00 push $0xb0
jmp alltraps
8010629e: e9 5e f4 ff ff jmp 80105701 <alltraps>
801062a3 <vector177>:
.globl vector177
vector177:
pushl $0
801062a3: 6a 00 push $0x0
pushl $177
801062a5: 68 b1 00 00 00 push $0xb1
jmp alltraps
801062aa: e9 52 f4 ff ff jmp 80105701 <alltraps>
801062af <vector178>:
.globl vector178
vector178:
pushl $0
801062af: 6a 00 push $0x0
pushl $178
801062b1: 68 b2 00 00 00 push $0xb2
jmp alltraps
801062b6: e9 46 f4 ff ff jmp 80105701 <alltraps>
801062bb <vector179>:
.globl vector179
vector179:
pushl $0
801062bb: 6a 00 push $0x0
pushl $179
801062bd: 68 b3 00 00 00 push $0xb3
jmp alltraps
801062c2: e9 3a f4 ff ff jmp 80105701 <alltraps>
801062c7 <vector180>:
.globl vector180
vector180:
pushl $0
801062c7: 6a 00 push $0x0
pushl $180
801062c9: 68 b4 00 00 00 push $0xb4
jmp alltraps
801062ce: e9 2e f4 ff ff jmp 80105701 <alltraps>
801062d3 <vector181>:
.globl vector181
vector181:
pushl $0
801062d3: 6a 00 push $0x0
pushl $181
801062d5: 68 b5 00 00 00 push $0xb5
jmp alltraps
801062da: e9 22 f4 ff ff jmp 80105701 <alltraps>
801062df <vector182>:
.globl vector182
vector182:
pushl $0
801062df: 6a 00 push $0x0
pushl $182
801062e1: 68 b6 00 00 00 push $0xb6
jmp alltraps
801062e6: e9 16 f4 ff ff jmp 80105701 <alltraps>
801062eb <vector183>:
.globl vector183
vector183:
pushl $0
801062eb: 6a 00 push $0x0
pushl $183
801062ed: 68 b7 00 00 00 push $0xb7
jmp alltraps
801062f2: e9 0a f4 ff ff jmp 80105701 <alltraps>
801062f7 <vector184>:
.globl vector184
vector184:
pushl $0
801062f7: 6a 00 push $0x0
pushl $184
801062f9: 68 b8 00 00 00 push $0xb8
jmp alltraps
801062fe: e9 fe f3 ff ff jmp 80105701 <alltraps>
80106303 <vector185>:
.globl vector185
vector185:
pushl $0
80106303: 6a 00 push $0x0
pushl $185
80106305: 68 b9 00 00 00 push $0xb9
jmp alltraps
8010630a: e9 f2 f3 ff ff jmp 80105701 <alltraps>
8010630f <vector186>:
.globl vector186
vector186:
pushl $0
8010630f: 6a 00 push $0x0
pushl $186
80106311: 68 ba 00 00 00 push $0xba
jmp alltraps
80106316: e9 e6 f3 ff ff jmp 80105701 <alltraps>
8010631b <vector187>:
.globl vector187
vector187:
pushl $0
8010631b: 6a 00 push $0x0
pushl $187
8010631d: 68 bb 00 00 00 push $0xbb
jmp alltraps
80106322: e9 da f3 ff ff jmp 80105701 <alltraps>
80106327 <vector188>:
.globl vector188
vector188:
pushl $0
80106327: 6a 00 push $0x0
pushl $188
80106329: 68 bc 00 00 00 push $0xbc
jmp alltraps
8010632e: e9 ce f3 ff ff jmp 80105701 <alltraps>
80106333 <vector189>:
.globl vector189
vector189:
pushl $0
80106333: 6a 00 push $0x0
pushl $189
80106335: 68 bd 00 00 00 push $0xbd
jmp alltraps
8010633a: e9 c2 f3 ff ff jmp 80105701 <alltraps>
8010633f <vector190>:
.globl vector190
vector190:
pushl $0
8010633f: 6a 00 push $0x0
pushl $190
80106341: 68 be 00 00 00 push $0xbe
jmp alltraps
80106346: e9 b6 f3 ff ff jmp 80105701 <alltraps>
8010634b <vector191>:
.globl vector191
vector191:
pushl $0
8010634b: 6a 00 push $0x0
pushl $191
8010634d: 68 bf 00 00 00 push $0xbf
jmp alltraps
80106352: e9 aa f3 ff ff jmp 80105701 <alltraps>
80106357 <vector192>:
.globl vector192
vector192:
pushl $0
80106357: 6a 00 push $0x0
pushl $192
80106359: 68 c0 00 00 00 push $0xc0
jmp alltraps
8010635e: e9 9e f3 ff ff jmp 80105701 <alltraps>
80106363 <vector193>:
.globl vector193
vector193:
pushl $0
80106363: 6a 00 push $0x0
pushl $193
80106365: 68 c1 00 00 00 push $0xc1
jmp alltraps
8010636a: e9 92 f3 ff ff jmp 80105701 <alltraps>
8010636f <vector194>:
.globl vector194
vector194:
pushl $0
8010636f: 6a 00 push $0x0
pushl $194
80106371: 68 c2 00 00 00 push $0xc2
jmp alltraps
80106376: e9 86 f3 ff ff jmp 80105701 <alltraps>
8010637b <vector195>:
.globl vector195
vector195:
pushl $0
8010637b: 6a 00 push $0x0
pushl $195
8010637d: 68 c3 00 00 00 push $0xc3
jmp alltraps
80106382: e9 7a f3 ff ff jmp 80105701 <alltraps>
80106387 <vector196>:
.globl vector196
vector196:
pushl $0
80106387: 6a 00 push $0x0
pushl $196
80106389: 68 c4 00 00 00 push $0xc4
jmp alltraps
8010638e: e9 6e f3 ff ff jmp 80105701 <alltraps>
80106393 <vector197>:
.globl vector197
vector197:
pushl $0
80106393: 6a 00 push $0x0
pushl $197
80106395: 68 c5 00 00 00 push $0xc5
jmp alltraps
8010639a: e9 62 f3 ff ff jmp 80105701 <alltraps>
8010639f <vector198>:
.globl vector198
vector198:
pushl $0
8010639f: 6a 00 push $0x0
pushl $198
801063a1: 68 c6 00 00 00 push $0xc6
jmp alltraps
801063a6: e9 56 f3 ff ff jmp 80105701 <alltraps>
801063ab <vector199>:
.globl vector199
vector199:
pushl $0
801063ab: 6a 00 push $0x0
pushl $199
801063ad: 68 c7 00 00 00 push $0xc7
jmp alltraps
801063b2: e9 4a f3 ff ff jmp 80105701 <alltraps>
801063b7 <vector200>:
.globl vector200
vector200:
pushl $0
801063b7: 6a 00 push $0x0
pushl $200
801063b9: 68 c8 00 00 00 push $0xc8
jmp alltraps
801063be: e9 3e f3 ff ff jmp 80105701 <alltraps>
801063c3 <vector201>:
.globl vector201
vector201:
pushl $0
801063c3: 6a 00 push $0x0
pushl $201
801063c5: 68 c9 00 00 00 push $0xc9
jmp alltraps
801063ca: e9 32 f3 ff ff jmp 80105701 <alltraps>
801063cf <vector202>:
.globl vector202
vector202:
pushl $0
801063cf: 6a 00 push $0x0
pushl $202
801063d1: 68 ca 00 00 00 push $0xca
jmp alltraps
801063d6: e9 26 f3 ff ff jmp 80105701 <alltraps>
801063db <vector203>:
.globl vector203
vector203:
pushl $0
801063db: 6a 00 push $0x0
pushl $203
801063dd: 68 cb 00 00 00 push $0xcb
jmp alltraps
801063e2: e9 1a f3 ff ff jmp 80105701 <alltraps>
801063e7 <vector204>:
.globl vector204
vector204:
pushl $0
801063e7: 6a 00 push $0x0
pushl $204
801063e9: 68 cc 00 00 00 push $0xcc
jmp alltraps
801063ee: e9 0e f3 ff ff jmp 80105701 <alltraps>
801063f3 <vector205>:
.globl vector205
vector205:
pushl $0
801063f3: 6a 00 push $0x0
pushl $205
801063f5: 68 cd 00 00 00 push $0xcd
jmp alltraps
801063fa: e9 02 f3 ff ff jmp 80105701 <alltraps>
801063ff <vector206>:
.globl vector206
vector206:
pushl $0
801063ff: 6a 00 push $0x0
pushl $206
80106401: 68 ce 00 00 00 push $0xce
jmp alltraps
80106406: e9 f6 f2 ff ff jmp 80105701 <alltraps>
8010640b <vector207>:
.globl vector207
vector207:
pushl $0
8010640b: 6a 00 push $0x0
pushl $207
8010640d: 68 cf 00 00 00 push $0xcf
jmp alltraps
80106412: e9 ea f2 ff ff jmp 80105701 <alltraps>
80106417 <vector208>:
.globl vector208
vector208:
pushl $0
80106417: 6a 00 push $0x0
pushl $208
80106419: 68 d0 00 00 00 push $0xd0
jmp alltraps
8010641e: e9 de f2 ff ff jmp 80105701 <alltraps>
80106423 <vector209>:
.globl vector209
vector209:
pushl $0
80106423: 6a 00 push $0x0
pushl $209
80106425: 68 d1 00 00 00 push $0xd1
jmp alltraps
8010642a: e9 d2 f2 ff ff jmp 80105701 <alltraps>
8010642f <vector210>:
.globl vector210
vector210:
pushl $0
8010642f: 6a 00 push $0x0
pushl $210
80106431: 68 d2 00 00 00 push $0xd2
jmp alltraps
80106436: e9 c6 f2 ff ff jmp 80105701 <alltraps>
8010643b <vector211>:
.globl vector211
vector211:
pushl $0
8010643b: 6a 00 push $0x0
pushl $211
8010643d: 68 d3 00 00 00 push $0xd3
jmp alltraps
80106442: e9 ba f2 ff ff jmp 80105701 <alltraps>
80106447 <vector212>:
.globl vector212
vector212:
pushl $0
80106447: 6a 00 push $0x0
pushl $212
80106449: 68 d4 00 00 00 push $0xd4
jmp alltraps
8010644e: e9 ae f2 ff ff jmp 80105701 <alltraps>
80106453 <vector213>:
.globl vector213
vector213:
pushl $0
80106453: 6a 00 push $0x0
pushl $213
80106455: 68 d5 00 00 00 push $0xd5
jmp alltraps
8010645a: e9 a2 f2 ff ff jmp 80105701 <alltraps>
8010645f <vector214>:
.globl vector214
vector214:
pushl $0
8010645f: 6a 00 push $0x0
pushl $214
80106461: 68 d6 00 00 00 push $0xd6
jmp alltraps
80106466: e9 96 f2 ff ff jmp 80105701 <alltraps>
8010646b <vector215>:
.globl vector215
vector215:
pushl $0
8010646b: 6a 00 push $0x0
pushl $215
8010646d: 68 d7 00 00 00 push $0xd7
jmp alltraps
80106472: e9 8a f2 ff ff jmp 80105701 <alltraps>
80106477 <vector216>:
.globl vector216
vector216:
pushl $0
80106477: 6a 00 push $0x0
pushl $216
80106479: 68 d8 00 00 00 push $0xd8
jmp alltraps
8010647e: e9 7e f2 ff ff jmp 80105701 <alltraps>
80106483 <vector217>:
.globl vector217
vector217:
pushl $0
80106483: 6a 00 push $0x0
pushl $217
80106485: 68 d9 00 00 00 push $0xd9
jmp alltraps
8010648a: e9 72 f2 ff ff jmp 80105701 <alltraps>
8010648f <vector218>:
.globl vector218
vector218:
pushl $0
8010648f: 6a 00 push $0x0
pushl $218
80106491: 68 da 00 00 00 push $0xda
jmp alltraps
80106496: e9 66 f2 ff ff jmp 80105701 <alltraps>
8010649b <vector219>:
.globl vector219
vector219:
pushl $0
8010649b: 6a 00 push $0x0
pushl $219
8010649d: 68 db 00 00 00 push $0xdb
jmp alltraps
801064a2: e9 5a f2 ff ff jmp 80105701 <alltraps>
801064a7 <vector220>:
.globl vector220
vector220:
pushl $0
801064a7: 6a 00 push $0x0
pushl $220
801064a9: 68 dc 00 00 00 push $0xdc
jmp alltraps
801064ae: e9 4e f2 ff ff jmp 80105701 <alltraps>
801064b3 <vector221>:
.globl vector221
vector221:
pushl $0
801064b3: 6a 00 push $0x0
pushl $221
801064b5: 68 dd 00 00 00 push $0xdd
jmp alltraps
801064ba: e9 42 f2 ff ff jmp 80105701 <alltraps>
801064bf <vector222>:
.globl vector222
vector222:
pushl $0
801064bf: 6a 00 push $0x0
pushl $222
801064c1: 68 de 00 00 00 push $0xde
jmp alltraps
801064c6: e9 36 f2 ff ff jmp 80105701 <alltraps>
801064cb <vector223>:
.globl vector223
vector223:
pushl $0
801064cb: 6a 00 push $0x0
pushl $223
801064cd: 68 df 00 00 00 push $0xdf
jmp alltraps
801064d2: e9 2a f2 ff ff jmp 80105701 <alltraps>
801064d7 <vector224>:
.globl vector224
vector224:
pushl $0
801064d7: 6a 00 push $0x0
pushl $224
801064d9: 68 e0 00 00 00 push $0xe0
jmp alltraps
801064de: e9 1e f2 ff ff jmp 80105701 <alltraps>
801064e3 <vector225>:
.globl vector225
vector225:
pushl $0
801064e3: 6a 00 push $0x0
pushl $225
801064e5: 68 e1 00 00 00 push $0xe1
jmp alltraps
801064ea: e9 12 f2 ff ff jmp 80105701 <alltraps>
801064ef <vector226>:
.globl vector226
vector226:
pushl $0
801064ef: 6a 00 push $0x0
pushl $226
801064f1: 68 e2 00 00 00 push $0xe2
jmp alltraps
801064f6: e9 06 f2 ff ff jmp 80105701 <alltraps>
801064fb <vector227>:
.globl vector227
vector227:
pushl $0
801064fb: 6a 00 push $0x0
pushl $227
801064fd: 68 e3 00 00 00 push $0xe3
jmp alltraps
80106502: e9 fa f1 ff ff jmp 80105701 <alltraps>
80106507 <vector228>:
.globl vector228
vector228:
pushl $0
80106507: 6a 00 push $0x0
pushl $228
80106509: 68 e4 00 00 00 push $0xe4
jmp alltraps
8010650e: e9 ee f1 ff ff jmp 80105701 <alltraps>
80106513 <vector229>:
.globl vector229
vector229:
pushl $0
80106513: 6a 00 push $0x0
pushl $229
80106515: 68 e5 00 00 00 push $0xe5
jmp alltraps
8010651a: e9 e2 f1 ff ff jmp 80105701 <alltraps>
8010651f <vector230>:
.globl vector230
vector230:
pushl $0
8010651f: 6a 00 push $0x0
pushl $230
80106521: 68 e6 00 00 00 push $0xe6
jmp alltraps
80106526: e9 d6 f1 ff ff jmp 80105701 <alltraps>
8010652b <vector231>:
.globl vector231
vector231:
pushl $0
8010652b: 6a 00 push $0x0
pushl $231
8010652d: 68 e7 00 00 00 push $0xe7
jmp alltraps
80106532: e9 ca f1 ff ff jmp 80105701 <alltraps>
80106537 <vector232>:
.globl vector232
vector232:
pushl $0
80106537: 6a 00 push $0x0
pushl $232
80106539: 68 e8 00 00 00 push $0xe8
jmp alltraps
8010653e: e9 be f1 ff ff jmp 80105701 <alltraps>
80106543 <vector233>:
.globl vector233
vector233:
pushl $0
80106543: 6a 00 push $0x0
pushl $233
80106545: 68 e9 00 00 00 push $0xe9
jmp alltraps
8010654a: e9 b2 f1 ff ff jmp 80105701 <alltraps>
8010654f <vector234>:
.globl vector234
vector234:
pushl $0
8010654f: 6a 00 push $0x0
pushl $234
80106551: 68 ea 00 00 00 push $0xea
jmp alltraps
80106556: e9 a6 f1 ff ff jmp 80105701 <alltraps>
8010655b <vector235>:
.globl vector235
vector235:
pushl $0
8010655b: 6a 00 push $0x0
pushl $235
8010655d: 68 eb 00 00 00 push $0xeb
jmp alltraps
80106562: e9 9a f1 ff ff jmp 80105701 <alltraps>
80106567 <vector236>:
.globl vector236
vector236:
pushl $0
80106567: 6a 00 push $0x0
pushl $236
80106569: 68 ec 00 00 00 push $0xec
jmp alltraps
8010656e: e9 8e f1 ff ff jmp 80105701 <alltraps>
80106573 <vector237>:
.globl vector237
vector237:
pushl $0
80106573: 6a 00 push $0x0
pushl $237
80106575: 68 ed 00 00 00 push $0xed
jmp alltraps
8010657a: e9 82 f1 ff ff jmp 80105701 <alltraps>
8010657f <vector238>:
.globl vector238
vector238:
pushl $0
8010657f: 6a 00 push $0x0
pushl $238
80106581: 68 ee 00 00 00 push $0xee
jmp alltraps
80106586: e9 76 f1 ff ff jmp 80105701 <alltraps>
8010658b <vector239>:
.globl vector239
vector239:
pushl $0
8010658b: 6a 00 push $0x0
pushl $239
8010658d: 68 ef 00 00 00 push $0xef
jmp alltraps
80106592: e9 6a f1 ff ff jmp 80105701 <alltraps>
80106597 <vector240>:
.globl vector240
vector240:
pushl $0
80106597: 6a 00 push $0x0
pushl $240
80106599: 68 f0 00 00 00 push $0xf0
jmp alltraps
8010659e: e9 5e f1 ff ff jmp 80105701 <alltraps>
801065a3 <vector241>:
.globl vector241
vector241:
pushl $0
801065a3: 6a 00 push $0x0
pushl $241
801065a5: 68 f1 00 00 00 push $0xf1
jmp alltraps
801065aa: e9 52 f1 ff ff jmp 80105701 <alltraps>
801065af <vector242>:
.globl vector242
vector242:
pushl $0
801065af: 6a 00 push $0x0
pushl $242
801065b1: 68 f2 00 00 00 push $0xf2
jmp alltraps
801065b6: e9 46 f1 ff ff jmp 80105701 <alltraps>
801065bb <vector243>:
.globl vector243
vector243:
pushl $0
801065bb: 6a 00 push $0x0
pushl $243
801065bd: 68 f3 00 00 00 push $0xf3
jmp alltraps
801065c2: e9 3a f1 ff ff jmp 80105701 <alltraps>
801065c7 <vector244>:
.globl vector244
vector244:
pushl $0
801065c7: 6a 00 push $0x0
pushl $244
801065c9: 68 f4 00 00 00 push $0xf4
jmp alltraps
801065ce: e9 2e f1 ff ff jmp 80105701 <alltraps>
801065d3 <vector245>:
.globl vector245
vector245:
pushl $0
801065d3: 6a 00 push $0x0
pushl $245
801065d5: 68 f5 00 00 00 push $0xf5
jmp alltraps
801065da: e9 22 f1 ff ff jmp 80105701 <alltraps>
801065df <vector246>:
.globl vector246
vector246:
pushl $0
801065df: 6a 00 push $0x0
pushl $246
801065e1: 68 f6 00 00 00 push $0xf6
jmp alltraps
801065e6: e9 16 f1 ff ff jmp 80105701 <alltraps>
801065eb <vector247>:
.globl vector247
vector247:
pushl $0
801065eb: 6a 00 push $0x0
pushl $247
801065ed: 68 f7 00 00 00 push $0xf7
jmp alltraps
801065f2: e9 0a f1 ff ff jmp 80105701 <alltraps>
801065f7 <vector248>:
.globl vector248
vector248:
pushl $0
801065f7: 6a 00 push $0x0
pushl $248
801065f9: 68 f8 00 00 00 push $0xf8
jmp alltraps
801065fe: e9 fe f0 ff ff jmp 80105701 <alltraps>
80106603 <vector249>:
.globl vector249
vector249:
pushl $0
80106603: 6a 00 push $0x0
pushl $249
80106605: 68 f9 00 00 00 push $0xf9
jmp alltraps
8010660a: e9 f2 f0 ff ff jmp 80105701 <alltraps>
8010660f <vector250>:
.globl vector250
vector250:
pushl $0
8010660f: 6a 00 push $0x0
pushl $250
80106611: 68 fa 00 00 00 push $0xfa
jmp alltraps
80106616: e9 e6 f0 ff ff jmp 80105701 <alltraps>
8010661b <vector251>:
.globl vector251
vector251:
pushl $0
8010661b: 6a 00 push $0x0
pushl $251
8010661d: 68 fb 00 00 00 push $0xfb
jmp alltraps
80106622: e9 da f0 ff ff jmp 80105701 <alltraps>
80106627 <vector252>:
.globl vector252
vector252:
pushl $0
80106627: 6a 00 push $0x0
pushl $252
80106629: 68 fc 00 00 00 push $0xfc
jmp alltraps
8010662e: e9 ce f0 ff ff jmp 80105701 <alltraps>
80106633 <vector253>:
.globl vector253
vector253:
pushl $0
80106633: 6a 00 push $0x0
pushl $253
80106635: 68 fd 00 00 00 push $0xfd
jmp alltraps
8010663a: e9 c2 f0 ff ff jmp 80105701 <alltraps>
8010663f <vector254>:
.globl vector254
vector254:
pushl $0
8010663f: 6a 00 push $0x0
pushl $254
80106641: 68 fe 00 00 00 push $0xfe
jmp alltraps
80106646: e9 b6 f0 ff ff jmp 80105701 <alltraps>
8010664b <vector255>:
.globl vector255
vector255:
pushl $0
8010664b: 6a 00 push $0x0
pushl $255
8010664d: 68 ff 00 00 00 push $0xff
jmp alltraps
80106652: e9 aa f0 ff ff jmp 80105701 <alltraps>
80106657: 66 90 xchg %ax,%ax
80106659: 66 90 xchg %ax,%ax
8010665b: 66 90 xchg %ax,%ax
8010665d: 66 90 xchg %ax,%ax
8010665f: 90 nop
80106660 <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)
{
80106660: 55 push %ebp
80106661: 89 e5 mov %esp,%ebp
80106663: 57 push %edi
80106664: 56 push %esi
80106665: 53 push %ebx
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
80106666: 89 d3 mov %edx,%ebx
{
80106668: 89 d7 mov %edx,%edi
pde = &pgdir[PDX(va)];
8010666a: c1 eb 16 shr $0x16,%ebx
8010666d: 8d 34 98 lea (%eax,%ebx,4),%esi
{
80106670: 83 ec 0c sub $0xc,%esp
if(*pde & PTE_P){
80106673: 8b 06 mov (%esi),%eax
80106675: a8 01 test $0x1,%al
80106677: 74 27 je 801066a0 <walkpgdir+0x40>
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
80106679: 25 00 f0 ff ff and $0xfffff000,%eax
8010667e: 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)];
80106684: c1 ef 0a shr $0xa,%edi
}
80106687: 8d 65 f4 lea -0xc(%ebp),%esp
return &pgtab[PTX(va)];
8010668a: 89 fa mov %edi,%edx
8010668c: 81 e2 fc 0f 00 00 and $0xffc,%edx
80106692: 8d 04 13 lea (%ebx,%edx,1),%eax
}
80106695: 5b pop %ebx
80106696: 5e pop %esi
80106697: 5f pop %edi
80106698: 5d pop %ebp
80106699: c3 ret
8010669a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
801066a0: 85 c9 test %ecx,%ecx
801066a2: 74 2c je 801066d0 <walkpgdir+0x70>
801066a4: e8 17 be ff ff call 801024c0 <kalloc>
801066a9: 85 c0 test %eax,%eax
801066ab: 89 c3 mov %eax,%ebx
801066ad: 74 21 je 801066d0 <walkpgdir+0x70>
memset(pgtab, 0, PGSIZE);
801066af: 83 ec 04 sub $0x4,%esp
801066b2: 68 00 10 00 00 push $0x1000
801066b7: 6a 00 push $0x0
801066b9: 50 push %eax
801066ba: e8 31 de ff ff call 801044f0 <memset>
*pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
801066bf: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
801066c5: 83 c4 10 add $0x10,%esp
801066c8: 83 c8 07 or $0x7,%eax
801066cb: 89 06 mov %eax,(%esi)
801066cd: eb b5 jmp 80106684 <walkpgdir+0x24>
801066cf: 90 nop
}
801066d0: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
801066d3: 31 c0 xor %eax,%eax
}
801066d5: 5b pop %ebx
801066d6: 5e pop %esi
801066d7: 5f pop %edi
801066d8: 5d pop %ebp
801066d9: c3 ret
801066da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801066e0 <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)
801066e0: 55 push %ebp
801066e1: 89 e5 mov %esp,%ebp
801066e3: 57 push %edi
801066e4: 56 push %esi
801066e5: 53 push %ebx
uint a, pa;
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
801066e6: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
801066ec: 89 c7 mov %eax,%edi
a = PGROUNDUP(newsz);
801066ee: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
801066f4: 83 ec 1c sub $0x1c,%esp
801066f7: 89 4d e0 mov %ecx,-0x20(%ebp)
for(; a < oldsz; a += PGSIZE){
801066fa: 39 d3 cmp %edx,%ebx
801066fc: 73 66 jae 80106764 <deallocuvm.part.0+0x84>
801066fe: 89 d6 mov %edx,%esi
80106700: eb 3d jmp 8010673f <deallocuvm.part.0+0x5f>
80106702: 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){
80106708: 8b 10 mov (%eax),%edx
8010670a: f6 c2 01 test $0x1,%dl
8010670d: 74 26 je 80106735 <deallocuvm.part.0+0x55>
pa = PTE_ADDR(*pte);
if(pa == 0)
8010670f: 81 e2 00 f0 ff ff and $0xfffff000,%edx
80106715: 74 58 je 8010676f <deallocuvm.part.0+0x8f>
panic("kfree");
char *v = P2V(pa);
kfree(v);
80106717: 83 ec 0c sub $0xc,%esp
char *v = P2V(pa);
8010671a: 81 c2 00 00 00 80 add $0x80000000,%edx
80106720: 89 45 e4 mov %eax,-0x1c(%ebp)
kfree(v);
80106723: 52 push %edx
80106724: e8 e7 bb ff ff call 80102310 <kfree>
*pte = 0;
80106729: 8b 45 e4 mov -0x1c(%ebp),%eax
8010672c: 83 c4 10 add $0x10,%esp
8010672f: c7 00 00 00 00 00 movl $0x0,(%eax)
for(; a < oldsz; a += PGSIZE){
80106735: 81 c3 00 10 00 00 add $0x1000,%ebx
8010673b: 39 f3 cmp %esi,%ebx
8010673d: 73 25 jae 80106764 <deallocuvm.part.0+0x84>
pte = walkpgdir(pgdir, (char*)a, 0);
8010673f: 31 c9 xor %ecx,%ecx
80106741: 89 da mov %ebx,%edx
80106743: 89 f8 mov %edi,%eax
80106745: e8 16 ff ff ff call 80106660 <walkpgdir>
if(!pte)
8010674a: 85 c0 test %eax,%eax
8010674c: 75 ba jne 80106708 <deallocuvm.part.0+0x28>
a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
8010674e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx
80106754: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx
for(; a < oldsz; a += PGSIZE){
8010675a: 81 c3 00 10 00 00 add $0x1000,%ebx
80106760: 39 f3 cmp %esi,%ebx
80106762: 72 db jb 8010673f <deallocuvm.part.0+0x5f>
}
}
return newsz;
}
80106764: 8b 45 e0 mov -0x20(%ebp),%eax
80106767: 8d 65 f4 lea -0xc(%ebp),%esp
8010676a: 5b pop %ebx
8010676b: 5e pop %esi
8010676c: 5f pop %edi
8010676d: 5d pop %ebp
8010676e: c3 ret
panic("kfree");
8010676f: 83 ec 0c sub $0xc,%esp
80106772: 68 06 72 10 80 push $0x80107206
80106777: e8 14 9c ff ff call 80100390 <panic>
8010677c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106780 <seginit>:
{
80106780: 55 push %ebp
80106781: 89 e5 mov %esp,%ebp
80106783: 83 ec 18 sub $0x18,%esp
c = &cpus[cpuid()];
80106786: e8 35 d0 ff ff call 801037c0 <cpuid>
8010678b: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax
pd[0] = size-1;
80106791: ba 2f 00 00 00 mov $0x2f,%edx
80106796: 66 89 55 f2 mov %dx,-0xe(%ebp)
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
8010679a: c7 80 f8 27 11 80 ff movl $0xffff,-0x7feed808(%eax)
801067a1: ff 00 00
801067a4: c7 80 fc 27 11 80 00 movl $0xcf9a00,-0x7feed804(%eax)
801067ab: 9a cf 00
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
801067ae: c7 80 00 28 11 80 ff movl $0xffff,-0x7feed800(%eax)
801067b5: ff 00 00
801067b8: c7 80 04 28 11 80 00 movl $0xcf9200,-0x7feed7fc(%eax)
801067bf: 92 cf 00
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
801067c2: c7 80 08 28 11 80 ff movl $0xffff,-0x7feed7f8(%eax)
801067c9: ff 00 00
801067cc: c7 80 0c 28 11 80 00 movl $0xcffa00,-0x7feed7f4(%eax)
801067d3: fa cf 00
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
801067d6: c7 80 10 28 11 80 ff movl $0xffff,-0x7feed7f0(%eax)
801067dd: ff 00 00
801067e0: c7 80 14 28 11 80 00 movl $0xcff200,-0x7feed7ec(%eax)
801067e7: f2 cf 00
lgdt(c->gdt, sizeof(c->gdt));
801067ea: 05 f0 27 11 80 add $0x801127f0,%eax
pd[1] = (uint)p;
801067ef: 66 89 45 f4 mov %ax,-0xc(%ebp)
pd[2] = (uint)p >> 16;
801067f3: c1 e8 10 shr $0x10,%eax
801067f6: 66 89 45 f6 mov %ax,-0xa(%ebp)
asm volatile("lgdt (%0)" : : "r" (pd));
801067fa: 8d 45 f2 lea -0xe(%ebp),%eax
801067fd: 0f 01 10 lgdtl (%eax)
}
80106800: c9 leave
80106801: c3 ret
80106802: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106809: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106810 <mappages>:
{
80106810: 55 push %ebp
80106811: 89 e5 mov %esp,%ebp
80106813: 57 push %edi
80106814: 56 push %esi
80106815: 53 push %ebx
80106816: 83 ec 1c sub $0x1c,%esp
80106819: 8b 45 0c mov 0xc(%ebp),%eax
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
8010681c: 8b 55 10 mov 0x10(%ebp),%edx
8010681f: 8b 7d 14 mov 0x14(%ebp),%edi
a = (char*)PGROUNDDOWN((uint)va);
80106822: 89 c3 mov %eax,%ebx
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
80106824: 8d 44 10 ff lea -0x1(%eax,%edx,1),%eax
a = (char*)PGROUNDDOWN((uint)va);
80106828: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
8010682e: 25 00 f0 ff ff and $0xfffff000,%eax
80106833: 29 df sub %ebx,%edi
80106835: 89 45 e4 mov %eax,-0x1c(%ebp)
*pte = pa | perm | PTE_P;
80106838: 8b 45 18 mov 0x18(%ebp),%eax
8010683b: 83 c8 01 or $0x1,%eax
8010683e: 89 45 e0 mov %eax,-0x20(%ebp)
80106841: eb 1a jmp 8010685d <mappages+0x4d>
80106843: 90 nop
80106844: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(*pte & PTE_P)
80106848: f6 00 01 testb $0x1,(%eax)
8010684b: 75 3d jne 8010688a <mappages+0x7a>
*pte = pa | perm | PTE_P;
8010684d: 0b 75 e0 or -0x20(%ebp),%esi
if(a == last)
80106850: 3b 5d e4 cmp -0x1c(%ebp),%ebx
*pte = pa | perm | PTE_P;
80106853: 89 30 mov %esi,(%eax)
if(a == last)
80106855: 74 29 je 80106880 <mappages+0x70>
a += PGSIZE;
80106857: 81 c3 00 10 00 00 add $0x1000,%ebx
if((pte = walkpgdir(pgdir, a, 1)) == 0)
8010685d: 8b 45 08 mov 0x8(%ebp),%eax
80106860: b9 01 00 00 00 mov $0x1,%ecx
80106865: 89 da mov %ebx,%edx
80106867: 8d 34 3b lea (%ebx,%edi,1),%esi
8010686a: e8 f1 fd ff ff call 80106660 <walkpgdir>
8010686f: 85 c0 test %eax,%eax
80106871: 75 d5 jne 80106848 <mappages+0x38>
}
80106873: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
80106876: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010687b: 5b pop %ebx
8010687c: 5e pop %esi
8010687d: 5f pop %edi
8010687e: 5d pop %ebp
8010687f: c3 ret
80106880: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
80106883: 31 c0 xor %eax,%eax
}
80106885: 5b pop %ebx
80106886: 5e pop %esi
80106887: 5f pop %edi
80106888: 5d pop %ebp
80106889: c3 ret
panic("remap");
8010688a: 83 ec 0c sub $0xc,%esp
8010688d: 68 2c 78 10 80 push $0x8010782c
80106892: e8 f9 9a ff ff call 80100390 <panic>
80106897: 89 f6 mov %esi,%esi
80106899: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801068a0 <switchkvm>:
lcr3(V2P(kpgdir)); // switch to the kernel page table
801068a0: a1 a4 54 11 80 mov 0x801154a4,%eax
{
801068a5: 55 push %ebp
801068a6: 89 e5 mov %esp,%ebp
lcr3(V2P(kpgdir)); // switch to the kernel page table
801068a8: 05 00 00 00 80 add $0x80000000,%eax
}
static inline void
lcr3(uint val)
{
asm volatile("movl %0,%%cr3" : : "r" (val));
801068ad: 0f 22 d8 mov %eax,%cr3
}
801068b0: 5d pop %ebp
801068b1: c3 ret
801068b2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801068b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801068c0 <switchuvm>:
{
801068c0: 55 push %ebp
801068c1: 89 e5 mov %esp,%ebp
801068c3: 57 push %edi
801068c4: 56 push %esi
801068c5: 53 push %ebx
801068c6: 83 ec 1c sub $0x1c,%esp
801068c9: 8b 5d 08 mov 0x8(%ebp),%ebx
if(p == 0)
801068cc: 85 db test %ebx,%ebx
801068ce: 0f 84 cb 00 00 00 je 8010699f <switchuvm+0xdf>
if(p->kstack == 0)
801068d4: 8b 43 08 mov 0x8(%ebx),%eax
801068d7: 85 c0 test %eax,%eax
801068d9: 0f 84 da 00 00 00 je 801069b9 <switchuvm+0xf9>
if(p->pgdir == 0)
801068df: 8b 43 04 mov 0x4(%ebx),%eax
801068e2: 85 c0 test %eax,%eax
801068e4: 0f 84 c2 00 00 00 je 801069ac <switchuvm+0xec>
pushcli();
801068ea: e8 21 da ff ff call 80104310 <pushcli>
mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
801068ef: e8 4c ce ff ff call 80103740 <mycpu>
801068f4: 89 c6 mov %eax,%esi
801068f6: e8 45 ce ff ff call 80103740 <mycpu>
801068fb: 89 c7 mov %eax,%edi
801068fd: e8 3e ce ff ff call 80103740 <mycpu>
80106902: 89 45 e4 mov %eax,-0x1c(%ebp)
80106905: 83 c7 08 add $0x8,%edi
80106908: e8 33 ce ff ff call 80103740 <mycpu>
8010690d: 8b 4d e4 mov -0x1c(%ebp),%ecx
80106910: 83 c0 08 add $0x8,%eax
80106913: ba 67 00 00 00 mov $0x67,%edx
80106918: c1 e8 18 shr $0x18,%eax
8010691b: 66 89 96 98 00 00 00 mov %dx,0x98(%esi)
80106922: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi)
80106929: 88 86 9f 00 00 00 mov %al,0x9f(%esi)
mycpu()->ts.iomb = (ushort) 0xFFFF;
8010692f: bf ff ff ff ff mov $0xffffffff,%edi
mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
80106934: 83 c1 08 add $0x8,%ecx
80106937: c1 e9 10 shr $0x10,%ecx
8010693a: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi)
80106940: b9 99 40 00 00 mov $0x4099,%ecx
80106945: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi)
mycpu()->ts.ss0 = SEG_KDATA << 3;
8010694c: be 10 00 00 00 mov $0x10,%esi
mycpu()->gdt[SEG_TSS].s = 0;
80106951: e8 ea cd ff ff call 80103740 <mycpu>
80106956: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax)
mycpu()->ts.ss0 = SEG_KDATA << 3;
8010695d: e8 de cd ff ff call 80103740 <mycpu>
80106962: 66 89 70 10 mov %si,0x10(%eax)
mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE;
80106966: 8b 73 08 mov 0x8(%ebx),%esi
80106969: e8 d2 cd ff ff call 80103740 <mycpu>
8010696e: 81 c6 00 10 00 00 add $0x1000,%esi
80106974: 89 70 0c mov %esi,0xc(%eax)
mycpu()->ts.iomb = (ushort) 0xFFFF;
80106977: e8 c4 cd ff ff call 80103740 <mycpu>
8010697c: 66 89 78 6e mov %di,0x6e(%eax)
asm volatile("ltr %0" : : "r" (sel));
80106980: b8 28 00 00 00 mov $0x28,%eax
80106985: 0f 00 d8 ltr %ax
lcr3(V2P(p->pgdir)); // switch to process's address space
80106988: 8b 43 04 mov 0x4(%ebx),%eax
8010698b: 05 00 00 00 80 add $0x80000000,%eax
asm volatile("movl %0,%%cr3" : : "r" (val));
80106990: 0f 22 d8 mov %eax,%cr3
}
80106993: 8d 65 f4 lea -0xc(%ebp),%esp
80106996: 5b pop %ebx
80106997: 5e pop %esi
80106998: 5f pop %edi
80106999: 5d pop %ebp
popcli();
8010699a: e9 b1 d9 ff ff jmp 80104350 <popcli>
panic("switchuvm: no process");
8010699f: 83 ec 0c sub $0xc,%esp
801069a2: 68 32 78 10 80 push $0x80107832
801069a7: e8 e4 99 ff ff call 80100390 <panic>
panic("switchuvm: no pgdir");
801069ac: 83 ec 0c sub $0xc,%esp
801069af: 68 5d 78 10 80 push $0x8010785d
801069b4: e8 d7 99 ff ff call 80100390 <panic>
panic("switchuvm: no kstack");
801069b9: 83 ec 0c sub $0xc,%esp
801069bc: 68 48 78 10 80 push $0x80107848
801069c1: e8 ca 99 ff ff call 80100390 <panic>
801069c6: 8d 76 00 lea 0x0(%esi),%esi
801069c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801069d0 <inituvm>:
{
801069d0: 55 push %ebp
801069d1: 89 e5 mov %esp,%ebp
801069d3: 57 push %edi
801069d4: 56 push %esi
801069d5: 53 push %ebx
801069d6: 83 ec 1c sub $0x1c,%esp
801069d9: 8b 75 10 mov 0x10(%ebp),%esi
801069dc: 8b 55 08 mov 0x8(%ebp),%edx
801069df: 8b 7d 0c mov 0xc(%ebp),%edi
if(sz >= PGSIZE)
801069e2: 81 fe ff 0f 00 00 cmp $0xfff,%esi
801069e8: 77 50 ja 80106a3a <inituvm+0x6a>
801069ea: 89 55 e4 mov %edx,-0x1c(%ebp)
mem = kalloc();
801069ed: e8 ce ba ff ff call 801024c0 <kalloc>
memset(mem, 0, PGSIZE);
801069f2: 83 ec 04 sub $0x4,%esp
mem = kalloc();
801069f5: 89 c3 mov %eax,%ebx
memset(mem, 0, PGSIZE);
801069f7: 68 00 10 00 00 push $0x1000
801069fc: 6a 00 push $0x0
801069fe: 50 push %eax
801069ff: e8 ec da ff ff call 801044f0 <memset>
mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U);
80106a04: 8b 55 e4 mov -0x1c(%ebp),%edx
80106a07: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
80106a0d: c7 04 24 06 00 00 00 movl $0x6,(%esp)
80106a14: 50 push %eax
80106a15: 68 00 10 00 00 push $0x1000
80106a1a: 6a 00 push $0x0
80106a1c: 52 push %edx
80106a1d: e8 ee fd ff ff call 80106810 <mappages>
memmove(mem, init, sz);
80106a22: 89 75 10 mov %esi,0x10(%ebp)
80106a25: 89 7d 0c mov %edi,0xc(%ebp)
80106a28: 83 c4 20 add $0x20,%esp
80106a2b: 89 5d 08 mov %ebx,0x8(%ebp)
}
80106a2e: 8d 65 f4 lea -0xc(%ebp),%esp
80106a31: 5b pop %ebx
80106a32: 5e pop %esi
80106a33: 5f pop %edi
80106a34: 5d pop %ebp
memmove(mem, init, sz);
80106a35: e9 66 db ff ff jmp 801045a0 <memmove>
panic("inituvm: more than a page");
80106a3a: 83 ec 0c sub $0xc,%esp
80106a3d: 68 71 78 10 80 push $0x80107871
80106a42: e8 49 99 ff ff call 80100390 <panic>
80106a47: 89 f6 mov %esi,%esi
80106a49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106a50 <loaduvm>:
{
80106a50: 55 push %ebp
80106a51: 89 e5 mov %esp,%ebp
80106a53: 57 push %edi
80106a54: 56 push %esi
80106a55: 53 push %ebx
80106a56: 83 ec 0c sub $0xc,%esp
if((uint) addr % PGSIZE != 0)
80106a59: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp)
80106a60: 0f 85 91 00 00 00 jne 80106af7 <loaduvm+0xa7>
for(i = 0; i < sz; i += PGSIZE){
80106a66: 8b 75 18 mov 0x18(%ebp),%esi
80106a69: 31 db xor %ebx,%ebx
80106a6b: 85 f6 test %esi,%esi
80106a6d: 75 1a jne 80106a89 <loaduvm+0x39>
80106a6f: eb 6f jmp 80106ae0 <loaduvm+0x90>
80106a71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106a78: 81 c3 00 10 00 00 add $0x1000,%ebx
80106a7e: 81 ee 00 10 00 00 sub $0x1000,%esi
80106a84: 39 5d 18 cmp %ebx,0x18(%ebp)
80106a87: 76 57 jbe 80106ae0 <loaduvm+0x90>
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
80106a89: 8b 55 0c mov 0xc(%ebp),%edx
80106a8c: 8b 45 08 mov 0x8(%ebp),%eax
80106a8f: 31 c9 xor %ecx,%ecx
80106a91: 01 da add %ebx,%edx
80106a93: e8 c8 fb ff ff call 80106660 <walkpgdir>
80106a98: 85 c0 test %eax,%eax
80106a9a: 74 4e je 80106aea <loaduvm+0x9a>
pa = PTE_ADDR(*pte);
80106a9c: 8b 00 mov (%eax),%eax
if(readi(ip, P2V(pa), offset+i, n) != n)
80106a9e: 8b 4d 14 mov 0x14(%ebp),%ecx
if(sz - i < PGSIZE)
80106aa1: bf 00 10 00 00 mov $0x1000,%edi
pa = PTE_ADDR(*pte);
80106aa6: 25 00 f0 ff ff and $0xfffff000,%eax
if(sz - i < PGSIZE)
80106aab: 81 fe ff 0f 00 00 cmp $0xfff,%esi
80106ab1: 0f 46 fe cmovbe %esi,%edi
if(readi(ip, P2V(pa), offset+i, n) != n)
80106ab4: 01 d9 add %ebx,%ecx
80106ab6: 05 00 00 00 80 add $0x80000000,%eax
80106abb: 57 push %edi
80106abc: 51 push %ecx
80106abd: 50 push %eax
80106abe: ff 75 10 pushl 0x10(%ebp)
80106ac1: e8 9a ae ff ff call 80101960 <readi>
80106ac6: 83 c4 10 add $0x10,%esp
80106ac9: 39 f8 cmp %edi,%eax
80106acb: 74 ab je 80106a78 <loaduvm+0x28>
}
80106acd: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
80106ad0: b8 ff ff ff ff mov $0xffffffff,%eax
}
80106ad5: 5b pop %ebx
80106ad6: 5e pop %esi
80106ad7: 5f pop %edi
80106ad8: 5d pop %ebp
80106ad9: c3 ret
80106ada: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106ae0: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
80106ae3: 31 c0 xor %eax,%eax
}
80106ae5: 5b pop %ebx
80106ae6: 5e pop %esi
80106ae7: 5f pop %edi
80106ae8: 5d pop %ebp
80106ae9: c3 ret
panic("loaduvm: address should exist");
80106aea: 83 ec 0c sub $0xc,%esp
80106aed: 68 8b 78 10 80 push $0x8010788b
80106af2: e8 99 98 ff ff call 80100390 <panic>
panic("loaduvm: addr must be page aligned");
80106af7: 83 ec 0c sub $0xc,%esp
80106afa: 68 2c 79 10 80 push $0x8010792c
80106aff: e8 8c 98 ff ff call 80100390 <panic>
80106b04: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106b0a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80106b10 <allocuvm>:
{
80106b10: 55 push %ebp
80106b11: 89 e5 mov %esp,%ebp
80106b13: 57 push %edi
80106b14: 56 push %esi
80106b15: 53 push %ebx
80106b16: 83 ec 1c sub $0x1c,%esp
if(newsz >= KERNBASE)
80106b19: 8b 7d 10 mov 0x10(%ebp),%edi
80106b1c: 85 ff test %edi,%edi
80106b1e: 0f 88 8f 00 00 00 js 80106bb3 <allocuvm+0xa3>
if(newsz < oldsz)
80106b24: 3b 7d 0c cmp 0xc(%ebp),%edi
80106b27: 0f 82 93 00 00 00 jb 80106bc0 <allocuvm+0xb0>
a = PGROUNDUP(oldsz);
80106b2d: 8b 45 0c mov 0xc(%ebp),%eax
80106b30: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80106b36: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; a < newsz; a += PGSIZE){
80106b3c: 39 5d 10 cmp %ebx,0x10(%ebp)
80106b3f: 0f 86 7e 00 00 00 jbe 80106bc3 <allocuvm+0xb3>
80106b45: 89 7d e4 mov %edi,-0x1c(%ebp)
80106b48: 8b 75 08 mov 0x8(%ebp),%esi
80106b4b: eb 43 jmp 80106b90 <allocuvm+0x80>
80106b4d: 8d 76 00 lea 0x0(%esi),%esi
memset(mem, 0, PGSIZE);
80106b50: 83 ec 04 sub $0x4,%esp
80106b53: 68 00 10 00 00 push $0x1000
80106b58: 6a 00 push $0x0
80106b5a: 50 push %eax
80106b5b: e8 90 d9 ff ff call 801044f0 <memset>
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
80106b60: 8d 87 00 00 00 80 lea -0x80000000(%edi),%eax
80106b66: c7 04 24 06 00 00 00 movl $0x6,(%esp)
80106b6d: 50 push %eax
80106b6e: 68 00 10 00 00 push $0x1000
80106b73: 53 push %ebx
80106b74: 56 push %esi
80106b75: e8 96 fc ff ff call 80106810 <mappages>
80106b7a: 83 c4 20 add $0x20,%esp
80106b7d: 85 c0 test %eax,%eax
80106b7f: 78 4f js 80106bd0 <allocuvm+0xc0>
for(; a < newsz; a += PGSIZE){
80106b81: 81 c3 00 10 00 00 add $0x1000,%ebx
80106b87: 39 5d 10 cmp %ebx,0x10(%ebp)
80106b8a: 0f 86 80 00 00 00 jbe 80106c10 <allocuvm+0x100>
mem = kalloc();
80106b90: e8 2b b9 ff ff call 801024c0 <kalloc>
if(mem == 0){
80106b95: 85 c0 test %eax,%eax
mem = kalloc();
80106b97: 89 c7 mov %eax,%edi
if(mem == 0){
80106b99: 75 b5 jne 80106b50 <allocuvm+0x40>
cprintf("allocuvm out of memory\n");
80106b9b: 83 ec 0c sub $0xc,%esp
80106b9e: 68 a9 78 10 80 push $0x801078a9
80106ba3: e8 b8 9a ff ff call 80100660 <cprintf>
if(newsz >= oldsz)
80106ba8: 83 c4 10 add $0x10,%esp
80106bab: 8b 45 0c mov 0xc(%ebp),%eax
80106bae: 39 45 10 cmp %eax,0x10(%ebp)
80106bb1: 77 6d ja 80106c20 <allocuvm+0x110>
}
80106bb3: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
80106bb6: 31 ff xor %edi,%edi
}
80106bb8: 89 f8 mov %edi,%eax
80106bba: 5b pop %ebx
80106bbb: 5e pop %esi
80106bbc: 5f pop %edi
80106bbd: 5d pop %ebp
80106bbe: c3 ret
80106bbf: 90 nop
return oldsz;
80106bc0: 8b 7d 0c mov 0xc(%ebp),%edi
}
80106bc3: 8d 65 f4 lea -0xc(%ebp),%esp
80106bc6: 89 f8 mov %edi,%eax
80106bc8: 5b pop %ebx
80106bc9: 5e pop %esi
80106bca: 5f pop %edi
80106bcb: 5d pop %ebp
80106bcc: c3 ret
80106bcd: 8d 76 00 lea 0x0(%esi),%esi
cprintf("allocuvm out of memory (2)\n");
80106bd0: 83 ec 0c sub $0xc,%esp
80106bd3: 89 fe mov %edi,%esi
80106bd5: 68 c1 78 10 80 push $0x801078c1
80106bda: e8 81 9a ff ff call 80100660 <cprintf>
if(newsz >= oldsz)
80106bdf: 83 c4 10 add $0x10,%esp
80106be2: 8b 45 0c mov 0xc(%ebp),%eax
80106be5: 39 45 10 cmp %eax,0x10(%ebp)
80106be8: 76 0d jbe 80106bf7 <allocuvm+0xe7>
80106bea: 89 c1 mov %eax,%ecx
80106bec: 8b 55 10 mov 0x10(%ebp),%edx
80106bef: 8b 45 08 mov 0x8(%ebp),%eax
80106bf2: e8 e9 fa ff ff call 801066e0 <deallocuvm.part.0>
kfree(mem);
80106bf7: 83 ec 0c sub $0xc,%esp
return 0;
80106bfa: 31 ff xor %edi,%edi
kfree(mem);
80106bfc: 56 push %esi
80106bfd: e8 0e b7 ff ff call 80102310 <kfree>
return 0;
80106c02: 83 c4 10 add $0x10,%esp
}
80106c05: 8d 65 f4 lea -0xc(%ebp),%esp
80106c08: 89 f8 mov %edi,%eax
80106c0a: 5b pop %ebx
80106c0b: 5e pop %esi
80106c0c: 5f pop %edi
80106c0d: 5d pop %ebp
80106c0e: c3 ret
80106c0f: 90 nop
80106c10: 8b 7d e4 mov -0x1c(%ebp),%edi
80106c13: 8d 65 f4 lea -0xc(%ebp),%esp
80106c16: 5b pop %ebx
80106c17: 89 f8 mov %edi,%eax
80106c19: 5e pop %esi
80106c1a: 5f pop %edi
80106c1b: 5d pop %ebp
80106c1c: c3 ret
80106c1d: 8d 76 00 lea 0x0(%esi),%esi
80106c20: 89 c1 mov %eax,%ecx
80106c22: 8b 55 10 mov 0x10(%ebp),%edx
80106c25: 8b 45 08 mov 0x8(%ebp),%eax
80106c28: e8 b3 fa ff ff call 801066e0 <deallocuvm.part.0>
80106c2d: eb 94 jmp 80106bc3 <allocuvm+0xb3>
80106c2f: 90 nop
80106c30 <deallocuvm>:
{
80106c30: 55 push %ebp
80106c31: 89 e5 mov %esp,%ebp
80106c33: 8b 55 0c mov 0xc(%ebp),%edx
80106c36: 8b 4d 10 mov 0x10(%ebp),%ecx
80106c39: 8b 45 08 mov 0x8(%ebp),%eax
if(newsz >= oldsz)
80106c3c: 39 d1 cmp %edx,%ecx
80106c3e: 73 10 jae 80106c50 <deallocuvm+0x20>
}
80106c40: 5d pop %ebp
80106c41: e9 9a fa ff ff jmp 801066e0 <deallocuvm.part.0>
80106c46: 8d 76 00 lea 0x0(%esi),%esi
80106c49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106c50: 89 d0 mov %edx,%eax
80106c52: 5d pop %ebp
80106c53: c3 ret
80106c54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106c5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80106c60 <freevm>:
// Free a page table and all the physical memory pages
// in the user part.
void
freevm(pde_t *pgdir)
{
80106c60: 55 push %ebp
80106c61: 89 e5 mov %esp,%ebp
80106c63: 57 push %edi
80106c64: 56 push %esi
80106c65: 53 push %ebx
80106c66: 83 ec 0c sub $0xc,%esp
80106c69: 8b 75 08 mov 0x8(%ebp),%esi
uint i;
if(pgdir == 0)
80106c6c: 85 f6 test %esi,%esi
80106c6e: 74 59 je 80106cc9 <freevm+0x69>
80106c70: 31 c9 xor %ecx,%ecx
80106c72: ba 00 00 00 80 mov $0x80000000,%edx
80106c77: 89 f0 mov %esi,%eax
80106c79: e8 62 fa ff ff call 801066e0 <deallocuvm.part.0>
80106c7e: 89 f3 mov %esi,%ebx
80106c80: 8d be 00 10 00 00 lea 0x1000(%esi),%edi
80106c86: eb 0f jmp 80106c97 <freevm+0x37>
80106c88: 90 nop
80106c89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106c90: 83 c3 04 add $0x4,%ebx
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
80106c93: 39 fb cmp %edi,%ebx
80106c95: 74 23 je 80106cba <freevm+0x5a>
if(pgdir[i] & PTE_P){
80106c97: 8b 03 mov (%ebx),%eax
80106c99: a8 01 test $0x1,%al
80106c9b: 74 f3 je 80106c90 <freevm+0x30>
char * v = P2V(PTE_ADDR(pgdir[i]));
80106c9d: 25 00 f0 ff ff and $0xfffff000,%eax
kfree(v);
80106ca2: 83 ec 0c sub $0xc,%esp
80106ca5: 83 c3 04 add $0x4,%ebx
char * v = P2V(PTE_ADDR(pgdir[i]));
80106ca8: 05 00 00 00 80 add $0x80000000,%eax
kfree(v);
80106cad: 50 push %eax
80106cae: e8 5d b6 ff ff call 80102310 <kfree>
80106cb3: 83 c4 10 add $0x10,%esp
for(i = 0; i < NPDENTRIES; i++){
80106cb6: 39 fb cmp %edi,%ebx
80106cb8: 75 dd jne 80106c97 <freevm+0x37>
}
}
kfree((char*)pgdir);
80106cba: 89 75 08 mov %esi,0x8(%ebp)
}
80106cbd: 8d 65 f4 lea -0xc(%ebp),%esp
80106cc0: 5b pop %ebx
80106cc1: 5e pop %esi
80106cc2: 5f pop %edi
80106cc3: 5d pop %ebp
kfree((char*)pgdir);
80106cc4: e9 47 b6 ff ff jmp 80102310 <kfree>
panic("freevm: no pgdir");
80106cc9: 83 ec 0c sub $0xc,%esp
80106ccc: 68 dd 78 10 80 push $0x801078dd
80106cd1: e8 ba 96 ff ff call 80100390 <panic>
80106cd6: 8d 76 00 lea 0x0(%esi),%esi
80106cd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106ce0 <setupkvm>:
{
80106ce0: 55 push %ebp
80106ce1: 89 e5 mov %esp,%ebp
80106ce3: 56 push %esi
80106ce4: 53 push %ebx
if((pgdir = (pde_t*)kalloc()) == 0)
80106ce5: e8 d6 b7 ff ff call 801024c0 <kalloc>
80106cea: 85 c0 test %eax,%eax
80106cec: 89 c6 mov %eax,%esi
80106cee: 74 42 je 80106d32 <setupkvm+0x52>
memset(pgdir, 0, PGSIZE);
80106cf0: 83 ec 04 sub $0x4,%esp
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80106cf3: bb 20 a4 10 80 mov $0x8010a420,%ebx
memset(pgdir, 0, PGSIZE);
80106cf8: 68 00 10 00 00 push $0x1000
80106cfd: 6a 00 push $0x0
80106cff: 50 push %eax
80106d00: e8 eb d7 ff ff call 801044f0 <memset>
80106d05: 83 c4 10 add $0x10,%esp
(uint)k->phys_start, k->perm) < 0) {
80106d08: 8b 43 04 mov 0x4(%ebx),%eax
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
80106d0b: 8b 53 08 mov 0x8(%ebx),%edx
80106d0e: 83 ec 0c sub $0xc,%esp
80106d11: ff 73 0c pushl 0xc(%ebx)
80106d14: 29 c2 sub %eax,%edx
80106d16: 50 push %eax
80106d17: 52 push %edx
80106d18: ff 33 pushl (%ebx)
80106d1a: 56 push %esi
80106d1b: e8 f0 fa ff ff call 80106810 <mappages>
80106d20: 83 c4 20 add $0x20,%esp
80106d23: 85 c0 test %eax,%eax
80106d25: 78 19 js 80106d40 <setupkvm+0x60>
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80106d27: 83 c3 10 add $0x10,%ebx
80106d2a: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx
80106d30: 75 d6 jne 80106d08 <setupkvm+0x28>
}
80106d32: 8d 65 f8 lea -0x8(%ebp),%esp
80106d35: 89 f0 mov %esi,%eax
80106d37: 5b pop %ebx
80106d38: 5e pop %esi
80106d39: 5d pop %ebp
80106d3a: c3 ret
80106d3b: 90 nop
80106d3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
freevm(pgdir);
80106d40: 83 ec 0c sub $0xc,%esp
80106d43: 56 push %esi
return 0;
80106d44: 31 f6 xor %esi,%esi
freevm(pgdir);
80106d46: e8 15 ff ff ff call 80106c60 <freevm>
return 0;
80106d4b: 83 c4 10 add $0x10,%esp
}
80106d4e: 8d 65 f8 lea -0x8(%ebp),%esp
80106d51: 89 f0 mov %esi,%eax
80106d53: 5b pop %ebx
80106d54: 5e pop %esi
80106d55: 5d pop %ebp
80106d56: c3 ret
80106d57: 89 f6 mov %esi,%esi
80106d59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106d60 <kvmalloc>:
{
80106d60: 55 push %ebp
80106d61: 89 e5 mov %esp,%ebp
80106d63: 83 ec 08 sub $0x8,%esp
kpgdir = setupkvm();
80106d66: e8 75 ff ff ff call 80106ce0 <setupkvm>
80106d6b: a3 a4 54 11 80 mov %eax,0x801154a4
lcr3(V2P(kpgdir)); // switch to the kernel page table
80106d70: 05 00 00 00 80 add $0x80000000,%eax
80106d75: 0f 22 d8 mov %eax,%cr3
}
80106d78: c9 leave
80106d79: c3 ret
80106d7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106d80 <clearpteu>:
// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
80106d80: 55 push %ebp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80106d81: 31 c9 xor %ecx,%ecx
{
80106d83: 89 e5 mov %esp,%ebp
80106d85: 83 ec 08 sub $0x8,%esp
pte = walkpgdir(pgdir, uva, 0);
80106d88: 8b 55 0c mov 0xc(%ebp),%edx
80106d8b: 8b 45 08 mov 0x8(%ebp),%eax
80106d8e: e8 cd f8 ff ff call 80106660 <walkpgdir>
if(pte == 0)
80106d93: 85 c0 test %eax,%eax
80106d95: 74 05 je 80106d9c <clearpteu+0x1c>
panic("clearpteu");
*pte &= ~PTE_U;
80106d97: 83 20 fb andl $0xfffffffb,(%eax)
}
80106d9a: c9 leave
80106d9b: c3 ret
panic("clearpteu");
80106d9c: 83 ec 0c sub $0xc,%esp
80106d9f: 68 ee 78 10 80 push $0x801078ee
80106da4: e8 e7 95 ff ff call 80100390 <panic>
80106da9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106db0 <copyuvm>:
// Given a parent process's page table, create a copy
// of it for a child.
pde_t*
copyuvm(pde_t *pgdir, uint sz)
{
80106db0: 55 push %ebp
80106db1: 89 e5 mov %esp,%ebp
80106db3: 57 push %edi
80106db4: 56 push %esi
80106db5: 53 push %ebx
80106db6: 83 ec 1c sub $0x1c,%esp
pde_t *d;
pte_t *pte;
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
80106db9: e8 22 ff ff ff call 80106ce0 <setupkvm>
80106dbe: 85 c0 test %eax,%eax
80106dc0: 89 45 e0 mov %eax,-0x20(%ebp)
80106dc3: 0f 84 a2 00 00 00 je 80106e6b <copyuvm+0xbb>
return 0;
for(i = 0; i < sz; i += PGSIZE){
80106dc9: 8b 55 0c mov 0xc(%ebp),%edx
80106dcc: 85 d2 test %edx,%edx
80106dce: 0f 84 97 00 00 00 je 80106e6b <copyuvm+0xbb>
80106dd4: 31 f6 xor %esi,%esi
80106dd6: eb 48 jmp 80106e20 <copyuvm+0x70>
80106dd8: 90 nop
80106dd9: 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);
80106de0: 83 ec 04 sub $0x4,%esp
80106de3: 81 c3 00 00 00 80 add $0x80000000,%ebx
80106de9: 68 00 10 00 00 push $0x1000
80106dee: 53 push %ebx
80106def: 50 push %eax
80106df0: e8 ab d7 ff ff call 801045a0 <memmove>
if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) {
80106df5: 58 pop %eax
80106df6: 8d 87 00 00 00 80 lea -0x80000000(%edi),%eax
80106dfc: ff 75 e4 pushl -0x1c(%ebp)
80106dff: 50 push %eax
80106e00: 68 00 10 00 00 push $0x1000
80106e05: 56 push %esi
80106e06: ff 75 e0 pushl -0x20(%ebp)
80106e09: e8 02 fa ff ff call 80106810 <mappages>
80106e0e: 83 c4 20 add $0x20,%esp
80106e11: 85 c0 test %eax,%eax
80106e13: 78 6b js 80106e80 <copyuvm+0xd0>
for(i = 0; i < sz; i += PGSIZE){
80106e15: 81 c6 00 10 00 00 add $0x1000,%esi
80106e1b: 39 75 0c cmp %esi,0xc(%ebp)
80106e1e: 76 4b jbe 80106e6b <copyuvm+0xbb>
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
80106e20: 8b 45 08 mov 0x8(%ebp),%eax
80106e23: 31 c9 xor %ecx,%ecx
80106e25: 89 f2 mov %esi,%edx
80106e27: e8 34 f8 ff ff call 80106660 <walkpgdir>
80106e2c: 85 c0 test %eax,%eax
80106e2e: 74 6b je 80106e9b <copyuvm+0xeb>
if(!(*pte & PTE_P))
80106e30: 8b 38 mov (%eax),%edi
80106e32: f7 c7 01 00 00 00 test $0x1,%edi
80106e38: 74 54 je 80106e8e <copyuvm+0xde>
pa = PTE_ADDR(*pte);
80106e3a: 89 fb mov %edi,%ebx
flags = PTE_FLAGS(*pte);
80106e3c: 81 e7 ff 0f 00 00 and $0xfff,%edi
80106e42: 89 7d e4 mov %edi,-0x1c(%ebp)
pa = PTE_ADDR(*pte);
80106e45: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
if((mem = kalloc()) == 0)
80106e4b: e8 70 b6 ff ff call 801024c0 <kalloc>
80106e50: 85 c0 test %eax,%eax
80106e52: 89 c7 mov %eax,%edi
80106e54: 75 8a jne 80106de0 <copyuvm+0x30>
}
}
return d;
bad:
freevm(d);
80106e56: 83 ec 0c sub $0xc,%esp
80106e59: ff 75 e0 pushl -0x20(%ebp)
80106e5c: e8 ff fd ff ff call 80106c60 <freevm>
return 0;
80106e61: 83 c4 10 add $0x10,%esp
80106e64: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp)
}
80106e6b: 8b 45 e0 mov -0x20(%ebp),%eax
80106e6e: 8d 65 f4 lea -0xc(%ebp),%esp
80106e71: 5b pop %ebx
80106e72: 5e pop %esi
80106e73: 5f pop %edi
80106e74: 5d pop %ebp
80106e75: c3 ret
80106e76: 8d 76 00 lea 0x0(%esi),%esi
80106e79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
kfree(mem);
80106e80: 83 ec 0c sub $0xc,%esp
80106e83: 57 push %edi
80106e84: e8 87 b4 ff ff call 80102310 <kfree>
goto bad;
80106e89: 83 c4 10 add $0x10,%esp
80106e8c: eb c8 jmp 80106e56 <copyuvm+0xa6>
panic("copyuvm: page not present");
80106e8e: 83 ec 0c sub $0xc,%esp
80106e91: 68 12 79 10 80 push $0x80107912
80106e96: e8 f5 94 ff ff call 80100390 <panic>
panic("copyuvm: pte should exist");
80106e9b: 83 ec 0c sub $0xc,%esp
80106e9e: 68 f8 78 10 80 push $0x801078f8
80106ea3: e8 e8 94 ff ff call 80100390 <panic>
80106ea8: 90 nop
80106ea9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106eb0 <uva2ka>:
//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(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 9d f7 ff ff call 80106660 <walkpgdir>
if((*pte & PTE_P) == 0)
80106ec3: 8b 00 mov (%eax),%eax
return 0;
if((*pte & PTE_U) == 0)
return 0;
return (char*)P2V(PTE_ADDR(*pte));
}
80106ec5: c9 leave
if((*pte & PTE_U) == 0)
80106ec6: 89 c2 mov %eax,%edx
return (char*)P2V(PTE_ADDR(*pte));
80106ec8: 25 00 f0 ff ff and $0xfffff000,%eax
if((*pte & PTE_U) == 0)
80106ecd: 83 e2 05 and $0x5,%edx
return (char*)P2V(PTE_ADDR(*pte));
80106ed0: 05 00 00 00 80 add $0x80000000,%eax
80106ed5: 83 fa 05 cmp $0x5,%edx
80106ed8: ba 00 00 00 00 mov $0x0,%edx
80106edd: 0f 45 c2 cmovne %edx,%eax
}
80106ee0: c3 ret
80106ee1: eb 0d jmp 80106ef0 <copyout>
80106ee3: 90 nop
80106ee4: 90 nop
80106ee5: 90 nop
80106ee6: 90 nop
80106ee7: 90 nop
80106ee8: 90 nop
80106ee9: 90 nop
80106eea: 90 nop
80106eeb: 90 nop
80106eec: 90 nop
80106eed: 90 nop
80106eee: 90 nop
80106eef: 90 nop
80106ef0 <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)
{
80106ef0: 55 push %ebp
80106ef1: 89 e5 mov %esp,%ebp
80106ef3: 57 push %edi
80106ef4: 56 push %esi
80106ef5: 53 push %ebx
80106ef6: 83 ec 1c sub $0x1c,%esp
80106ef9: 8b 5d 14 mov 0x14(%ebp),%ebx
80106efc: 8b 55 0c mov 0xc(%ebp),%edx
80106eff: 8b 7d 10 mov 0x10(%ebp),%edi
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
80106f02: 85 db test %ebx,%ebx
80106f04: 75 40 jne 80106f46 <copyout+0x56>
80106f06: eb 70 jmp 80106f78 <copyout+0x88>
80106f08: 90 nop
80106f09: 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);
80106f10: 8b 55 e4 mov -0x1c(%ebp),%edx
80106f13: 89 f1 mov %esi,%ecx
80106f15: 29 d1 sub %edx,%ecx
80106f17: 81 c1 00 10 00 00 add $0x1000,%ecx
80106f1d: 39 d9 cmp %ebx,%ecx
80106f1f: 0f 47 cb cmova %ebx,%ecx
if(n > len)
n = len;
memmove(pa0 + (va - va0), buf, n);
80106f22: 29 f2 sub %esi,%edx
80106f24: 83 ec 04 sub $0x4,%esp
80106f27: 01 d0 add %edx,%eax
80106f29: 51 push %ecx
80106f2a: 57 push %edi
80106f2b: 50 push %eax
80106f2c: 89 4d e4 mov %ecx,-0x1c(%ebp)
80106f2f: e8 6c d6 ff ff call 801045a0 <memmove>
len -= n;
buf += n;
80106f34: 8b 4d e4 mov -0x1c(%ebp),%ecx
while(len > 0){
80106f37: 83 c4 10 add $0x10,%esp
va = va0 + PGSIZE;
80106f3a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx
buf += n;
80106f40: 01 cf add %ecx,%edi
while(len > 0){
80106f42: 29 cb sub %ecx,%ebx
80106f44: 74 32 je 80106f78 <copyout+0x88>
va0 = (uint)PGROUNDDOWN(va);
80106f46: 89 d6 mov %edx,%esi
pa0 = uva2ka(pgdir, (char*)va0);
80106f48: 83 ec 08 sub $0x8,%esp
va0 = (uint)PGROUNDDOWN(va);
80106f4b: 89 55 e4 mov %edx,-0x1c(%ebp)
80106f4e: 81 e6 00 f0 ff ff and $0xfffff000,%esi
pa0 = uva2ka(pgdir, (char*)va0);
80106f54: 56 push %esi
80106f55: ff 75 08 pushl 0x8(%ebp)
80106f58: e8 53 ff ff ff call 80106eb0 <uva2ka>
if(pa0 == 0)
80106f5d: 83 c4 10 add $0x10,%esp
80106f60: 85 c0 test %eax,%eax
80106f62: 75 ac jne 80106f10 <copyout+0x20>
}
return 0;
}
80106f64: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
80106f67: b8 ff ff ff ff mov $0xffffffff,%eax
}
80106f6c: 5b pop %ebx
80106f6d: 5e pop %esi
80106f6e: 5f pop %edi
80106f6f: 5d pop %ebp
80106f70: c3 ret
80106f71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106f78: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
80106f7b: 31 c0 xor %eax,%eax
}
80106f7d: 5b pop %ebx
80106f7e: 5e pop %esi
80106f7f: 5f pop %edi
80106f80: 5d pop %ebp
80106f81: c3 ret
|
programs/oeis/010/A010863.asm | neoneye/loda | 22 | 243800 | ; A010863: Constant sequence: a(n) = 24.
; 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24
mov $0,24
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-tasloc.ads | djamal2727/Main-Bearing-Analytical-Model | 0 | 26275 | <gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . T A S K _ L O C K --
-- --
-- S p e c --
-- --
-- Copyright (C) 1998-2020, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Simple task lock and unlock routines
-- A small package containing a task lock and unlock routines for creating
-- a critical region. The lock involved is a global lock, shared by all
-- tasks, and by all calls to these routines, so these routines should be
-- used with care to avoid unnecessary reduction of concurrency.
-- These routines may be used in a non-tasking program, and in that case
-- they have no effect (they do NOT cause the tasking runtime to be loaded).
-- Note: this package is in the System hierarchy so that it can be directly
-- be used by other predefined packages. User access to this package is via
-- a renaming of this package in GNAT.Task_Lock (file g-tasloc.ads).
package System.Task_Lock is
pragma Preelaborate;
procedure Lock;
pragma Inline (Lock);
-- Acquires the global lock, starts the execution of a critical region
-- which no other task can enter until the locking task calls Unlock
procedure Unlock;
pragma Inline (Unlock);
-- Releases the global lock, allowing another task to successfully
-- complete a Lock operation. Terminates the critical region.
--
-- The recommended protocol for using these two procedures is as
-- follows:
--
-- Locked_Processing : begin
-- Lock;
-- ...
-- TSL.Unlock;
--
-- exception
-- when others =>
-- Unlock;
-- raise;
-- end Locked_Processing;
--
-- This ensures that the lock is not left set if an exception is raised
-- explicitly or implicitly during the critical locked region.
--
-- Note on multiple calls to Lock: It is permissible to call Lock
-- more than once with no intervening Unlock from a single task,
-- and the lock will not be released until the corresponding number
-- of Unlock operations has been performed. For example:
--
-- System.Task_Lock.Lock; -- acquires lock
-- System.Task_Lock.Lock; -- no effect
-- System.Task_Lock.Lock; -- no effect
-- System.Task_Lock.Unlock; -- no effect
-- System.Task_Lock.Unlock; -- no effect
-- System.Task_Lock.Unlock; -- releases lock
--
-- However, as previously noted, the Task_Lock facility should only
-- be used for very local locks where the probability of conflict is
-- low, so usually this kind of nesting is not a good idea in any case.
-- In more complex locking situations, it is more appropriate to define
-- an appropriate protected type to provide the required locking.
--
-- It is an error to call Unlock when there has been no prior call to
-- Lock. The effect of such an erroneous call is undefined, and may
-- result in deadlock, or other malfunction of the run-time system.
end System.Task_Lock;
|
VineScript/Compiler/VineLexer.g4 | julsam/vinescript | 2 | 4426 | <reponame>julsam/vinescript<filename>VineScript/Compiler/VineLexer.g4
lexer grammar VineLexer;
@header {
using System;
}
@members{
//public override IToken Emit(){
// switch (_type) {
// case RESERVED_CHARS:
// //setType(RESERVED_CHARS);
// IToken result = base.Emit();
// // you'll need to define this method
// System.Console.WriteLine("Unterminated string literal");
// //reportError(result, "Unterminated string literal");
// return result;
// default:
// return base.Emit();
// }
//}
// Nested dictionary declaration, like { "a": true, "b": { "c": false }}
private static int nestedDictionaryDecl = 0;
// Pipe counter for Link Mode
private static int linkSeparatorsCount = 0;
// Called when an unescaped pipe '|' is found in Link Mode.
// On the second pipe found, it means that what follows is a link code
// and the mode should be pop back to normal mode.
public void IncLinkSeparators()
{
linkSeparatorsCount++;
if (linkSeparatorsCount >= 2) {
linkSeparatorsCount = 0;
PopMode();
}
}
// Reset link sep count when entering or exiting a link
public void ResetLinkSeparators()
{
linkSeparatorsCount = 0;
}
public static bool IsVerbatim(string str)
{
if (ToVerbatim(str) != null) {
return true;
} else {
return false;
}
}
public static string ToVerbatim(string str)
{
try {
while ( str.Length >= 3 && str.StartsWith("`") && str.EndsWith("`")
&& !Escape.IsCharAtEscaped(str, str.Length - 1)
) {
str = str.Remove(0, 1);
str = str.Remove(str.Length - 1, 1);
}
if ( str.Length > 0 && !str.StartsWith("`")
&& (!str.EndsWith("`") || Escape.IsCharAtEscaped(str, str.Length - 1))
) {
return str;
} else {
return null;
}
} catch (Exception) {
throw new Exception("Internal error VineLexer:ToVerbatim");
}
}
}
/*
* Lexer Rules
*/
// Default "mode" (text mode) : Everything that is outside of tags '{{ .. }}', '<< .. >>' or '/* .. */'
// Escape '\' or '`'. For every char added here, must think to add it to UnescapeVineSequence too
TXT_ESC
: ('\\\\' | '\\`') -> type(TXT)
;
// Escape everything between ` ` or `` `` or ``` ```, etc
VERBATIM
: ('`')+ ALL_BUT_RESERVED_CHARS*? ('`')+ {IsVerbatim(Text)}?
;
LOUTPUT: '{{' -> pushMode(VineCode) ;
LSTMT: '<<' -> pushMode(VineCode) ;
LLINK: '[[' { ResetLinkSeparators(); } -> pushMode(LinkMode) ;
BLOCK_COMMENT: '/*' .*? '*/' ;
LINE_COMMENT: '//' ~[\r\n]* ;
CLOSE_STMT
: '}}'
| '>>'
| '*/'
;
CLOSE_LINK
: ']]'
;
NL: '\r'? '\n' ;
LCOLLAPSE: '{' ;
RCOLLAPSE: '}' ;
// Reserved / illegal characters:
// * '\u000B': \v vertical tabulation, marks '\n' in strings returned by a function
// and then used by LinesFormatter to keep those '\n' in place
// * '\u001E': marks the start of the output of the display command
// * '\u001F': marks the end of the output of the display command
RESERVED_CHARS: [\u000B\u001E\u001F] ;
fragment
ALL_BUT_RESERVED_CHARS: ~[\u000B\u001E\u001F] ;
TXT_SPECIALS
: [`\\<>*\[\]/] -> type(TXT)
;
TXT : ~[`\\<>*\[\]{}/\r\n\u000B\u001E\u001F]+
;
ERROR_CHAR: . ;
// ----------------------------------------------------------
mode LinkMode;
LINK_ESC
: ( '\\\\' // [[my \\ title|mylink]]
| '\\]' // [[my [[own\]] title|mylink]]
| '\\|' // [[my \| title|mylink]]
)
-> type(LINK_TEXT)
;
RLINK: ']]' { ResetLinkSeparators(); } -> popMode ;
LINK_RESERVED_CHARS: RESERVED_CHARS -> type(RESERVED_CHARS) ;
LINK_PIPE: '|' { IncLinkSeparators(); } ;
LINK_TEXT_SPECIALS: [\\\]] -> type(LINK_TEXT) ;
LINK_TEXT: ~[\\|\]\r\n\u000B\u001E\u001F]+ ;
LinkMode_ERROR_CHAR: ERROR_CHAR -> type(ERROR_CHAR) ;
// ----------------------------------------------------------
mode VineCode;
ROUTPUT: '}}' { nestedDictionaryDecl == 0 }? -> popMode ;
RSTMT: '>>' -> popMode ;
// Parentheses, square brackets, curly braces
LPAREN: '(' ;
RPAREN: ')' ;
LBRACK: '[' ;
RBRACK: ']' ;
LBRACE: '{' { nestedDictionaryDecl++; } ;
RBRACE: '}' { nestedDictionaryDecl--; } ;
// Reserved keywords
IF: 'if' ;
ELIF: 'elif' ;
ELSE: 'else' ;
END: 'end' ;
FOR: 'for' ;
IN: 'in' ;
KW_AND: 'and' ;
KW_OR: 'or' ;
TO: 'to' ;
SET: 'set' ;
UNSET: 'unset' ;
// Separators
INTERVAL_SEP: '...' ;
DOT: '.' ;
COMMA: ',' ;
COLON: ':' ;
// Assign
ADDASSIGN: '+=' ;
SUBASSIGN: '-=' ;
MULASSIGN: '*=' ;
DIVASSIGN: '/=' ;
MODASSIGN: '%=' ;
ASSIGN: '=' ;
// Unary op
MINUS: '-' ;
NOT: '!' ;
POW: '^' ; // right assoc
// Arithmetic op
MUL: '*' ;
DIV: '/' ;
ADD: '+' ;
MOD: '%' ;
// Equality op
EQ: '==' ;
NEQ: '!=' ;
// Logical op
AND: '&&' ;
OR: '||' ;
// Comparison op
LT: '<' ;
GT: '>' ;
LTE: '<=' ;
GTE: '>=' ;
// TODO complete list. Commands are built-in functions
//COMMAND: 'array' | 'TODO' ;
// Atoms
TRUE: 'true' ;
FALSE: 'false' ;
NULL: 'null' ;
STRING: '"' (ESC | ALL_BUT_RESERVED_CHARS)*? '"' ;
// catches strings containing '\u000B' or '\u001E' or '\u001F':
ILLEGAL_STRING: '"' .*? '"' ;
//tokens { STRING }
//DOUBLE : '"' .*? '"' -> type(STRING) ;
//SINGLE : '\'' .*? '\'' -> type(STRING) ;
//STRING_SQUOTE: '\'' (ESC_SQUOTE|.)*? '\'' ;
//STRING_DQUOTE: '"' (ESC_DQUOTE|.)*? '"' ;
// Antlr defined unicode whitespace (only in Antlr >= 4.6 or 4.7)
// https://github.com/antlr/antlr4/blob/master/doc/lexer-rules.md
//UNICODE_WS : [\p{White_Space}] -> skip; // match all Unicode whitespace
WS: (WS_Restricted|WS_SpaceSeparator|WS_LineSeparator|WS_ParagraphSeparator)+ -> channel(HIDDEN) ;
// ** WHITE SPACE DEFINITIONS **
// http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
// https://msdn.microsoft.com/en-us/library/system.char.iswhitespace(v=vs.110).aspx
// https://en.wikipedia.org/wiki/Whitespace_character
//
// Contains SPACE (0020), CHARACTER TABULATION (0009), FORM FEED (U+000C),
// CARRIAGE RETURN (U+000D) and LINE FEED (000A)
// It's missing:
// * LINE TABULATION (U+000B aka \v), used as a reserved char
// * NEXT LINE (U+0085), which i'm not sure I should include
fragment WS_Restricted: [ \t\f\r\n] ;
// SpaceSeparator "Zs" from the unicode list:
// 0020;SPACE;Zs;0;WS;;;;;N;;;;;
// 00A0;NO-BREAK SPACE;Zs;0;CS;<noBreak> 0020;;;;N;NON-BREAKING SPACE;;;;
// 1680;OGHAM SPACE MARK;Zs;0;WS;;;;;N;;;;;
// 2000;EN QUAD;Zs;0;WS;2002;;;;N;;;;;
// 2001;EM QUAD;Zs;0;WS;2003;;;;N;;;;;
// 2002;EN SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 2003;EM SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 2004;THREE-PER-EM SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 2005;FOUR-PER-EM SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 2006;SIX-PER-EM SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 2007;FIGURE SPACE;Zs;0;WS;<noBreak> 0020;;;;N;;;;;
// 2008;PUNCTUATION SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 2009;THIN SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 200A;HAIR SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 202F;NARROW NO-BREAK SPACE;Zs;0;CS;<noBreak> 0020;;;;N;;;;;
// 205F;MEDIUM MATHEMATICAL SPACE;Zs;0;WS;<compat> 0020;;;;N;;;;;
// 3000;IDEOGRAPHIC SPACE;Zs;0;WS;<wide> 0020;;;;N;;;;;
// Does not include SPACE (it's in rule WS_Restricted)
// and OGHAM SPACE MARK (does not look like a space)
fragment WS_SpaceSeparator: [\u00A0\u2000-\u200A\u202F\u205F\u3000] ;
//LineSeparator "Zl" from the unicode list:
// 2028;LINE SEPARATOR;Zl;0;WS;;;;;N;;;;;
fragment WS_LineSeparator: '\u2028' ;
//ParagraphSeparator "Zp" from the unicode list:
// 2029;PARAGRAPH SEPARATOR;Zp;0;B;;;;;N;;;;;
fragment WS_ParagraphSeparator: '\u2029' ;
// ** IDENTIFIERS **
VAR_PREFIX: '$' ;
// Unicode ID https://github.com/antlr/antlr4/blob/master/doc/lexer-rules.md
// match full Unicode alphabetic ids (only in Antlr >= 4.6 or 4.7)
//UNICODE_ID : [\p{Alpha}\p{General_Category=Other_Letter}] [\p{Alnum}\p{General_Category=Other_Letter}]* ;
ID: ID_LETTER (ID_LETTER | DIGIT)* ;
INT: DIGIT+ ;
FLOAT: DIGIT+ '.' DIGIT+ ;
VineCode_ERROR_CHAR: ERROR_CHAR -> type(ERROR_CHAR) ;
// fragments
fragment ESC: '\\"' | '\\\\' ; // 2-char sequences \" and \\
//fragment ESC_SQUOTE: '\\\'' | '\\\\' ; // 2-char sequences \" and \\
//fragment ESC_DQUOTE: '\\"' | '\\\\' ; // 2-char sequences \" and \\
fragment DIGIT: [0-9] ;
// From Harlowe:
// https://bitbucket.org/_L_/harlowe/src/e6e8f2e0382f716c64a124db360f6095e230db9e/js/markup/patterns.js?at=v2.0.1&fileviewer=file-view-default#patterns.js-81
fragment ID_LETTER: [A-Za-z\u00C0-\u00DE\u00DF-\u00FF\u0150\u0170\u0151\u0171\uD800-\uDFFF_] ;
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_5_1305.asm | ljhsiun2/medusa | 9 | 16354 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0xaecb, %rsi
lea addresses_UC_ht+0x177cb, %rdi
clflush (%rdi)
nop
cmp $51053, %rax
mov $34, %rcx
rep movsw
nop
add $65420, %r13
lea addresses_normal_ht+0x5bf, %r8
cmp %r10, %r10
mov $0x6162636465666768, %rax
movq %rax, %xmm0
vmovups %ymm0, (%r8)
nop
nop
nop
nop
sub $53616, %rdi
lea addresses_D_ht+0x7dcb, %rax
nop
nop
and %r13, %r13
vmovups (%rax), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %r10
nop
nop
nop
nop
nop
dec %rcx
lea addresses_A_ht+0x17f21, %rsi
lea addresses_UC_ht+0x3407, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $14, %rcx
rep movsl
nop
nop
nop
nop
nop
and $8282, %r10
lea addresses_WT_ht+0xeb98, %rcx
nop
nop
and $3607, %r13
movw $0x6162, (%rcx)
nop
nop
nop
nop
nop
add %r13, %r13
lea addresses_A_ht+0x10c97, %rsi
nop
nop
nop
sub $16358, %rax
movb $0x61, (%rsi)
nop
cmp %r8, %r8
lea addresses_WC_ht+0x48cb, %r13
nop
nop
nop
xor %r10, %r10
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
movups %xmm0, (%r13)
nop
nop
nop
and $46758, %rdi
lea addresses_WC_ht+0x120bd, %rdi
nop
nop
nop
add $22186, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
vmovups %ymm6, (%rdi)
nop
nop
nop
nop
nop
cmp $6609, %rsi
lea addresses_D_ht+0x10ecb, %rsi
lea addresses_UC_ht+0xb6cb, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
inc %r13
mov $103, %rcx
rep movsw
nop
nop
and $23019, %rsi
lea addresses_D_ht+0xa4cb, %rax
nop
nop
nop
cmp $45730, %r13
movl $0x61626364, (%rax)
add $19726, %r10
lea addresses_UC_ht+0x13fe0, %rsi
nop
nop
nop
inc %rax
mov (%rsi), %edx
nop
nop
nop
add %r13, %r13
lea addresses_WC_ht+0xf2cb, %rsi
lea addresses_UC_ht+0x58fb, %rdi
clflush (%rsi)
nop
nop
and $16936, %r13
mov $4, %rcx
rep movsb
nop
nop
nop
nop
nop
xor $6321, %rdi
lea addresses_UC_ht+0x36cb, %r8
nop
dec %r13
mov $0x6162636465666768, %rdx
movq %rdx, %xmm6
vmovups %ymm6, (%r8)
nop
and $60112, %r10
lea addresses_normal_ht+0xdacb, %rsi
inc %rdi
mov $0x6162636465666768, %r10
movq %r10, %xmm7
vmovups %ymm7, (%rsi)
nop
nop
nop
nop
nop
add $48293, %r8
lea addresses_D_ht+0x1d7b7, %rsi
lea addresses_normal_ht+0x15033, %rdi
nop
nop
nop
nop
nop
xor $58182, %r10
mov $6, %rcx
rep movsw
nop
and %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rbp
push %rbx
push %rcx
push %rdx
// Store
lea addresses_normal+0x1dfe4, %r10
nop
cmp $59513, %r15
movl $0x51525354, (%r10)
nop
nop
nop
xor $14077, %r11
// Load
mov $0x4b, %rbx
cmp $58741, %rbp
vmovups (%rbx), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rdx
nop
nop
nop
nop
cmp %rbx, %rbx
// Faulty Load
lea addresses_RW+0x10ecb, %r11
nop
nop
nop
nop
and %rbx, %rbx
vmovups (%r11), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rdx
lea oracles, %r10
and $0xff, %rdx
shlq $12, %rdx
mov (%r10,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}}
{'32': 5}
32 32 32 32 32
*/
|
programs/oeis/037/A037665.asm | neoneye/loda | 22 | 26770 | ; A037665: Base 9 digits are, in order, the first n terms of the periodic sequence with initial period 3,1,0.
; 3,28,252,2271,20440,183960,1655643,14900788,134107092,1206963831,10862674480,97764070320,879876632883,7918889695948,71270007263532,641430065371791,5772870588346120,51955835295115080,467602517656035723,4208422658904321508
mul $0,2
add $0,5
mov $1,3
pow $1,$0
div $1,26
mul $1,2
sub $1,4
div $1,6
add $1,1
mov $0,$1
|
oeis/157/A157288.asm | neoneye/loda-programs | 11 | 241599 | ; A157288: a(n) = 10368*n^2 - 288*n + 1.
; 10081,40897,92449,164737,257761,371521,506017,661249,837217,1033921,1251361,1489537,1748449,2028097,2328481,2649601,2991457,3354049,3737377,4141441,4566241,5011777,5478049,5965057,6472801,7001281,7550497,8120449,8711137,9322561,9954721,10607617,11281249,11975617,12690721,13426561,14183137,14960449,15758497,16577281,17416801,18277057,19158049,20059777,20982241,21925441,22889377,23874049,24879457,25905601,26952481,28020097,29108449,30217537,31347361,32497921,33669217,34861249,36074017,37307521
add $0,1
mul $0,36
bin $0,2
sub $0,630
div $0,18
mul $0,288
add $0,10081
|
testsuite/ubivm/expected/method_5.asm | alexgarzao/UOP | 0 | 105276 | <filename>testsuite/ubivm/expected/method_5.asm<gh_stars>0
Entity start
No options
Constants
0 S start
1 I 1
2 S um
3 I 2
4 S dois
5 S x
6 S number1
7 S msg1
8 S number2
9 S msg2
10 S number1=
11 S msg1=
12 I 4
13 S io.writeln
14 S number2=
15 S msg2=
End
Valid context (always)
No properties
Def start
No parameters
No local variables
No results
ldconst 1 --> [1]
ldconst 2 --> [um]
ldconst 3 --> [2]
ldconst 4 --> [dois]
ldself
mcall 5 --> [x]
stop
End
Def x
Parameters
0 int number1
1 string msg1
2 int number2
3 string msg2
End
No local variables
No results
ldconst 10 --> [number1=]
ldpar 0 --> [number1]
ldconst 11 --> [ msg1=]
ldpar 1 --> [msg1]
ldconst 12 --> [4]
lcall 13 --> [io.writeln]
ldconst 14 --> [number2=]
ldpar 2 --> [number2]
ldconst 15 --> [ msg2=]
ldpar 3 --> [msg2]
ldconst 12 --> [4]
lcall 13 --> [io.writeln]
ret
End
End
|
Transynther/x86/_processed/NC/_ht_zr_un_/i3-7100_9_0xca_notsx.log_21829_13.asm | ljhsiun2/medusa | 9 | 100338 | <filename>Transynther/x86/_processed/NC/_ht_zr_un_/i3-7100_9_0xca_notsx.log_21829_13.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r14
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x40e, %r13
add $35756, %rdi
mov $0x6162636465666768, %r14
movq %r14, %xmm6
movups %xmm6, (%r13)
nop
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_A_ht+0x4c2e, %rsi
nop
nop
nop
and %r12, %r12
movb (%rsi), %r10b
xor $57000, %r13
lea addresses_A_ht+0xb68e, %r13
nop
and %rdi, %rdi
mov $0x6162636465666768, %r12
movq %r12, %xmm6
vmovups %ymm6, (%r13)
nop
nop
nop
nop
nop
add %r12, %r12
lea addresses_A_ht+0xc8de, %r10
nop
sub $46777, %rsi
vmovups (%r10), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %r14
nop
nop
nop
add %r13, %r13
lea addresses_normal_ht+0x1340e, %rsi
nop
nop
add %rdi, %rdi
movw $0x6162, (%rsi)
nop
nop
nop
nop
sub $27377, %r12
lea addresses_WT_ht+0x117d8, %rcx
nop
xor %rdi, %rdi
mov (%rcx), %r13w
nop
nop
nop
nop
nop
sub $7800, %r10
lea addresses_normal_ht+0x81ec, %rsi
add $36891, %r12
mov $0x6162636465666768, %rdi
movq %rdi, (%rsi)
nop
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x240e, %rsi
lea addresses_WC_ht+0xd40e, %rdi
clflush (%rsi)
nop
nop
nop
inc %r13
mov $113, %rcx
rep movsw
nop
nop
nop
nop
and $35173, %r14
lea addresses_UC_ht+0x1440e, %rsi
lea addresses_WC_ht+0xc3c, %rdi
nop
nop
and %r14, %r14
mov $58, %rcx
rep movsl
nop
inc %rcx
lea addresses_WC_ht+0x1070e, %rdi
clflush (%rdi)
add $49687, %r14
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
movups %xmm4, (%rdi)
nop
nop
nop
nop
nop
and $59469, %rdi
lea addresses_normal_ht+0xe40e, %r14
nop
nop
and $20830, %rdi
movb $0x61, (%r14)
nop
xor %rcx, %rcx
lea addresses_WT_ht+0xdfce, %rsi
clflush (%rsi)
and %rdi, %rdi
movups (%rsi), %xmm7
vpextrq $1, %xmm7, %r10
cmp $17194, %r14
pop %rsi
pop %rdi
pop %rcx
pop %r14
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %rax
push %rbp
push %rcx
push %rdx
push %rsi
// Store
lea addresses_UC+0x140e, %rcx
nop
nop
xor %r13, %r13
movw $0x5152, (%rcx)
nop
nop
nop
nop
xor %rbp, %rbp
// Store
mov $0x50e, %rbp
nop
nop
nop
nop
cmp %rax, %rax
movb $0x51, (%rbp)
nop
nop
nop
nop
nop
and $21535, %r15
// Load
lea addresses_D+0xa70e, %rbp
clflush (%rbp)
nop
inc %rdx
mov (%rbp), %ecx
nop
xor %rdx, %rdx
// Load
lea addresses_normal+0x1b20e, %r15
add $39748, %rsi
movb (%r15), %r13b
nop
nop
nop
inc %rax
// Store
lea addresses_WT+0x15c8, %r13
nop
nop
nop
xor $5482, %rax
movb $0x51, (%r13)
nop
nop
nop
nop
nop
cmp $1263, %rbp
// Faulty Load
mov $0x449412000000040e, %rsi
nop
nop
nop
nop
nop
xor %r15, %r15
vmovups (%rsi), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %r13
lea oracles, %rsi
and $0xff, %r13
shlq $12, %r13
mov (%rsi,%r13,1), %r13
pop %rsi
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_P', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT', 'size': 1, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'45': 11, '0a': 1, '00': 11904, '48': 9910, '46': 1, '2a': 1, 'df': 1}
00 48 00 48 00 00 48 00 48 48 48 48 48 48 48 00 48 48 00 48 00 48 48 48 00 00 00 00 48 00 00 48 00 00 48 00 00 48 48 00 00 00 48 00 00 00 48 00 48 48 00 48 00 00 48 00 48 48 48 48 48 00 00 48 00 48 00 00 00 48 48 48 00 00 48 48 00 48 48 00 00 00 00 48 00 48 48 2a 48 00 00 48 00 48 48 48 48 00 00 48 48 48 00 00 00 00 48 00 48 48 48 00 48 00 00 48 00 00 00 48 48 48 48 00 00 48 48 00 00 48 00 48 48 00 48 00 00 00 00 00 00 00 48 48 48 00 48 00 48 00 00 00 00 48 00 48 48 00 48 00 00 00 00 48 00 00 48 48 00 00 00 48 00 00 48 00 00 00 48 48 00 00 48 00 00 48 48 00 00 00 48 48 00 00 48 00 00 00 48 00 00 48 00 48 48 00 00 00 00 48 00 00 48 00 00 00 48 00 48 00 48 00 48 00 48 00 48 00 00 00 48 00 00 48 00 00 00 00 00 48 00 48 00 48 00 48 48 48 00 48 48 00 00 48 48 00 48 48 00 48 48 48 00 48 48 00 48 48 00 00 00 48 48 48 48 48 00 00 48 00 48 48 48 00 48 00 00 00 00 00 48 00 00 00 00 48 48 00 00 48 00 00 00 00 48 00 48 48 00 00 00 00 48 00 48 00 48 48 48 48 00 00 00 48 48 00 00 00 00 00 48 00 48 48 00 00 00 00 48 00 00 00 00 48 00 00 48 48 48 00 00 00 00 00 00 48 48 00 00 00 48 00 00 48 00 00 00 00 48 00 00 00 00 00 48 00 00 00 00 00 00 48 48 00 48 00 00 00 00 00 00 48 00 00 48 48 48 00 48 48 00 00 00 48 00 00 00 48 00 48 00 00 48 00 00 48 48 48 48 48 48 48 00 00 48 48 48 00 48 00 00 00 00 00 48 48 00 48 48 48 00 48 48 00 48 00 48 00 00 48 00 00 00 00 00 00 48 00 00 00 00 48 48 00 48 00 00 00 48 48 48 48 00 48 00 48 48 48 48 48 00 48 48 48 48 00 00 48 48 48 48 48 48 00 00 48 00 00 00 48 00 00 00 48 48 48 48 48 48 48 48 48 48 48 48 00 48 48 48 00 48 48 48 48 00 48 00 48 48 48 48 48 00 00 00 48 00 00 00 48 00 48 00 48 00 00 00 48 48 00 48 48 00 00 00 48 48 00 00 00 00 00 00 48 48 48 48 00 48 00 00 48 00 00 00 00 48 48 00 48 00 00 00 48 48 00 00 00 48 48 48 00 00 00 48 00 00 48 00 00 00 48 48 48 00 00 48 00 48 00 00 48 00 48 00 48 48 48 00 48 00 48 00 48 00 00 48 00 48 00 00 48 00 48 00 48 00 00 00 00 48 48 48 00 48 00 48 00 48 00 48 00 00 00 48 00 00 48 00 48 00 48 48 00 00 00 00 48 00 00 48 48 00 48 00 48 48 48 48 00 48 00 00 00 48 00 00 48 48 00 48 48 48 48 00 00 48 00 00 00 00 00 48 00 48 00 00 00 00 00 48 48 00 00 00 48 00 48 00 48 00 00 48 00 48 00 00 00 48 00 00 00 48 48 48 00 00 00 00 00 48 48 00 00 00 48 48 00 00 48 48 48 00 00 48 00 48 00 48 00 00 00 48 00 48 00 48 48 00 00 48 48 48 48 00 48 00 48 48 00 48 00 00 48 48 00 00 48 48 00 00 00 48 00 48 48 00 48 00 48 48 00 00 00 00 48 00 48 48 48 48 00 00 48 00 48 48 00 48 00 48 00 00 00 48 48 48 00 48 48 00 00 00 48 48 00 00 00 00 00 00 00 48 00 00 48 00 00 48 00 00 00 48 48 00 00 48 48 48 00 00 48 00 00 48 00 48 48 48 00 00 00 00 48 48 00 00 00 00 48 00 00 00 00 00 00 48 00 00 48 48 00 00 00 48 48 48 00 00 48 00 48 00 00 00 48 00 00 48 48 48 48 48 00 00 48 00 00 48 48 00 00 48 00 00 00 00 48 48 00 48 00 48 00 48 48 00 00 00 48 00 00 00 48 48 48 00 48 48 48 00 00 48 00 00 48 00 00 00 48 48 00 00 00 48 00 00 48 48 48 00 00 00 00 00 00 48 48 00 00 48 00 00 00 00 00 00 00 48 00 48 48 48 00 48 48 48 00 00 48
*/
|
src/title.asm | santiontanon/talesofpopolon-ext | 4 | 240484 | ;-----------------------------------------------
; Title screen loop
TitleScreen_Loop:
call StopPlayingMusic
call clearScreenLeftToRight
;; 16x16 sprites:
ld bc,#e201 ;; write #e2 in VDP register #01 (activate sprites, generate interrupts, 16x16 sprites with no magnification)
call WRTVDP
; render title:
ld a,1
ld (title_state),a
TitleScreen_Loop_loop1: ;; "TALES OF" coming in
ld hl,title_talesof_patterns
cp 9
jp p,TitleScreen_Loop_loop1_larger
TitleScreen_Loop_loop1_smaller:
ld b,0
ld c,a
neg
add a,9
ADD_HL_A
ld de,NAMTBL2+32*5
jr TitleScreen_Loop_loop1_draw
TitleScreen_Loop_loop1_larger:
sub 9
ld de,NAMTBL2+32*5
ADD_DE_A
ld bc,9
TitleScreen_Loop_loop1_draw:
call LDIRVM
call increaseTitleState_and_HaltTwice
cp 21
jr nz,TitleScreen_Loop_loop1
ld a,31
ld (title_state),a
TitleScreen_Loop_loop2: ;; "POPOLON" coming in
cp 31-14
jp m,TitleScreen_Loop_loop2_larger
TitleScreen_Loop_loop2_smaller:
neg
add a,32
ld b,0
ld c,a
jr TitleScreen_Loop_loop2_render
TitleScreen_Loop_loop2_larger:
ld bc,15
TitleScreen_Loop_loop2_render:
ld a,(title_state)
push af
push bc
; de = NAMTBL2+32*6 + a
ld de,NAMTBL2+32*6
ADD_DE_A
ld hl,title_popolon_line1_patterns
call LDIRVM
pop bc
pop af
ld de,NAMTBL2+32*7
ADD_DE_A
ld hl,title_popolon_line2_patterns
call LDIRVM
call decreaseTitleState_and_HaltTwice
cp 8
jr nz,TitleScreen_Loop_loop2
ld a,22
ld (title_state),a
TitleScreen_Loop_loop3: ;; "underline" coming in
; de = NAMTBL2 + a*32
call hl_equal_a_times_32
ld bc,NAMTBL2+7
add hl,bc
push hl
ex de,hl
ld hl,title_undertitle_patterns
ld bc,18
call LDIRVM
; clear the line underneath
pop hl
ld bc,32
add hl,bc
xor a
ld bc,18
call FILVRM
call decreaseTitleState_and_HaltTwice
cp 7
jr nz,TitleScreen_Loop_loop3
call TitleScreen_setupsprites
; display credits
ld hl,title_credits1
ld de,NAMTBL2+32*11+8
ld bc,16
call LDIRVM
ld hl,title_credits2
ld de,NAMTBL2+32*23+6
ld bc,20
call LDIRVM
; display m for password
ld hl,title_m_for_password
ld de,NAMTBL2+32*20+9
ld bc,title_m_for_password_end-title_m_for_password
call LDIRVM
xor a
ld (title_state),a
ld (previous_trigger1),a
TitleScreen_Loop_loop:
call TitleScreen_update_bg_sprites
; press space to play
ld a,(title_state)
push af
and #08
call TitleScreen_Loop_update_press_space
; animate warriors:
pop af
sra a
sra a
and #03
jr z,TitleScreen_render_warrior1
dec a
jr z,TitleScreen_render_warrior2
dec a
jr z,TitleScreen_render_warrior3
jr TitleScreen_render_warrior2
TitleScreen_render_warrior2:
ld hl,title_warrior_left_2
jr TitleScreen_render_warrior1_after
; call TitleScreen_render_warrior
; jp TitleScreen_Loop_loop_continue
TitleScreen_render_warrior3:
ld hl,title_warrior_left_3
jr TitleScreen_render_warrior1_after
; call TitleScreen_render_warrior
; jp TitleScreen_Loop_loop_continue
TitleScreen_render_warrior1:
ld hl,title_warrior_left_1
TitleScreen_render_warrior1_after:
call TitleScreen_render_warrior
; jr TitleScreen_Loop_loop_continue
TitleScreen_Loop_loop_continue:
call increaseTitleState_and_HaltTwice
or a
jp z,TitleScreen_Loop_go_to_story
;; if trigger 2 is pressed, enter password
push bc
call checkTrigger2
pop bc
jp nz,Password_loop
;; wait for space to be pressed:
push bc
call checkTrigger1updatingPrevious
pop bc
jr z,TitleScreen_Loop_loop
ld a,6
ld hl,ToPStartSongPletter
call PlayCompressedSong
;; transition animation before playing:
xor a
ld (title_state2),a
TitleScreen_Loop_pressed_space_loop:
call TitleScreen_update_bg_sprites
; press space to play flashing fast
ld a,(title_state2)
push af
and #02
call TitleScreen_Loop_update_press_space
; animate warriors:
pop af
and #08
jp z,TitleScreen_render_warrior4
call TitleScreen_render_warrior5
TitleScreen_Loop_pressed_space_loop_continue:
call increaseTitleState_and_HaltTwice
ld hl,title_state2
inc (hl)
ld a,(hl)
cp 64
jr nz,TitleScreen_Loop_pressed_space_loop
TitleScreen_Loop_play:
ld a,GAME_STATE_PLAYING
jp change_game_state
TitleScreen_Loop_go_to_story:
ld a,GAME_STATE_STORY
jp change_game_state
TitleScreen_setupsprites:
; decompress the title sprites
ld hl,title_bg_sprites_pletter
ld de,raycast_buffer
call pletter_unpack
; we zero out the copy that will be rendered, which will be modified later on:
xor a
ld hl,raycast_color_buffer
ld de,raycast_color_buffer+1
ld (hl),a
ld bc,32*12-1
ldir
ld hl,raycast_color_buffer
ld de,SPRTBL2
ld bc,32*12
call LDIRVM
ld hl,knight_sprite_attributes
ld e,16
xor a
TitleScreen_setupsprites_loop:
ld d,104
ld b,3
TitleScreen_setupsprites_loop2:
ld (hl),e
inc hl
ld (hl),d
inc hl
ld (hl),a
inc hl
ld (hl),4
inc hl
push af
ld a,d
add a,16
ld d,a
pop af
add a,4
djnz TitleScreen_setupsprites_loop2
push af
ld a,e
add a,16
ld e,a
pop af
cp 48
jr nz,TitleScreen_setupsprites_loop
ld hl,knight_sprite_attributes
ld de,SPRATR2
ld bc,48
jp LDIRVM
TitleScreen_Loop_update_press_space:
jr z,TitleScreen_Loop_update_press_space_draw
TitleScreen_Loop_update_press_space_clear:
xor a
ld hl,NAMTBL2+32*16+(32 - (title_press_space_end - title_press_space))/2
ld bc,title_press_space_end - title_press_space
jp FILVRM
TitleScreen_Loop_update_press_space_draw:
ld hl,title_press_space
ld de,NAMTBL2+32*16+(32 - (title_press_space_end - title_press_space))/2
ld bc,title_press_space_end - title_press_space
jp LDIRVM
decreaseTitleState_and_HaltTwice:
ld hl,title_state
dec (hl)
ld a,(hl)
; ld a,(title_state)
; dec a
; ld (title_state),a
halt
halt
ret
increaseTitleState_and_HaltTwice:
ld hl,title_state
inc (hl)
ld a,(hl)
; ld a,(title_state)
; inc a
; ld (title_state),a
halt
halt
ret
TitleScreen_update_bg_sprites:
ld a,(title_state)
push af
and #80
jr nz,TitleScreen_update_bg_sprites_second_sprite
ld hl,raycast_buffer
jr TitleScreen_update_bg_sprites_copy_sprite
TitleScreen_update_bg_sprites_second_sprite:
ld hl,raycast_buffer+12*32
TitleScreen_update_bg_sprites_copy_sprite:
ld de,raycast_color_buffer
ld bc,32*12
ldir
pop af
and #7f
cp 14
jp p,TitleScreen_update_bg_sprites_second_half
and #fe
jr TitleScreen_update_bg_sprites_apply_mask
TitleScreen_update_bg_sprites_second_half:
cp 114
jp m,TitleScreen_update_bg_sprites_mask_applied
neg
add a,127
and #fe
TitleScreen_update_bg_sprites_apply_mask:
add a,a
; apply a mask:
ld hl,title_bg_masks
ADD_HL_A
exx
ld bc,32*12
ld hl,raycast_color_buffer
TitleScreen_update_bg_sprites_loop:
ld e,3
TitleScreen_update_bg_sprites_loop_internal:
ld a,(hl)
exx
ld d,(hl)
inc hl
and d
exx
ld (hl),a
inc hl
dec bc
dec e
jr nz,TitleScreen_update_bg_sprites_loop_internal
ld a,(hl)
exx
ld d,(hl)
dec hl
dec hl
dec hl
and d
exx
ld (hl),a
inc hl
dec bc
ld a,c
or b
jr nz,TitleScreen_update_bg_sprites_loop
TitleScreen_update_bg_sprites_mask_applied:
ld hl,raycast_color_buffer
ld de,SPRTBL2
ld bc,32*12
jp LDIRVM
TitleScreen_render_warrior4:
ld hl,title_warrior_left_top_4
ld de,NAMTBL2+5*32+7
ld bc,2
push bc
call LDIRVM
ld hl,title_warrior_right_top_4
ld de,NAMTBL2+5*32+23
pop bc
call LDIRVM
ld hl,title_warrior_left_4
call TitleScreen_render_warrior
jp TitleScreen_Loop_pressed_space_loop_continue
TitleScreen_render_warrior5:
ld hl,title_warrior_left_top_5
ld de,NAMTBL2+5*32+7
ld bc,2
call LDIRVM
ld hl,title_warrior_right_top_5
ld de,NAMTBL2+5*32+23
ld bc,2
call LDIRVM
ld hl,title_warrior_left_5
; jr TitleScreen_render_warrior
; jp TitleScreen_Loop_pressed_space_loop_continue
TitleScreen_render_warrior:
push hl
ld de,NAMTBL2+6*32+7
ld bc,2
call LDIRVM
pop hl
inc hl
inc hl
push hl
ld de,NAMTBL2+7*32+7
ld bc,2
call LDIRVM
pop hl
inc hl
inc hl
push hl
ld de,NAMTBL2+6*32+23
ld bc,2
call LDIRVM
pop hl
inc hl
inc hl
ld de,NAMTBL2+7*32+23
ld bc,2
jp LDIRVM
title_talesof_patterns: ; length: 9
db " TALES OF"
title_popolon_line1_patterns: ; length 15
db 1,2,3,4,1,2,3,4, 9, 0,3,4,12,13,0
title_popolon_line2_patterns: ; length 15
db 5,6,7,8,5,6,7,8,10,11,7,8,14,15,0
title_undertitle_patterns: ; length 18
db 16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18
title_warrior_left_1:
db 19,20
db 21,22
title_warrior_right_1:
db 36,37
db 38,39
title_warrior_left_2:
db 23,24
db 25,26
title_warrior_right_2:
db 40,41
db 42,43
title_warrior_left_3:
db 27,24
db 25,26
title_warrior_right_3:
db 40,47
db 42,43
title_warrior_left_top_4:
db 28,0
title_warrior_right_top_4:
db 0,44
title_warrior_left_4:
db 29,30
db 21,22
title_warrior_right_4:
db 61,62
db 38,39
title_warrior_left_top_5:
db 31,98
title_warrior_right_top_5:
db 99,64
title_warrior_left_5:
db 95,96
db 97,35
title_warrior_right_5:
db 91,92
db 93,94
title_bg_masks:
db #08,#00,#80,#00
db #08,#80,#08,#80
db #88,#22,#08,#22
db #bb,#55,#bb,#55
db #77,#dd,#77,#dd
db #f7,#7f,#f7,#7f
db #f7,#ff,#7f,#ff
title_bg_sprites_pletter:
incbin "tocompress/title-sprites.plt"
|
Software/Relay-Timer/List/Timer Relay.asm | ekorudiawan/Relay-Timer | 0 | 96691 | <reponame>ekorudiawan/Relay-Timer
;CodeVisionAVR C Compiler V2.05.0 Professional
;(C) Copyright 1998-2010 <NAME>, HP InfoTech s.r.l.
;http://www.hpinfotech.com
;Chip type : ATmega8535
;Program type : Application
;Clock frequency : 16.000000 MHz
;Memory model : Small
;Optimize for : Size
;(s)printf features : int, width
;(s)scanf features : int, width
;External RAM size : 0
;Data Stack size : 128 byte(s)
;Heap size : 0 byte(s)
;Promote 'char' to 'int' : Yes
;'char' is unsigned : Yes
;8 bit enums : Yes
;global 'const' stored in FLASH: No
;Enhanced core instructions : On
;Smart register allocation : On
;Automatic register allocation : On
#pragma AVRPART ADMIN PART_NAME ATmega8535
#pragma AVRPART MEMORY PROG_FLASH 8192
#pragma AVRPART MEMORY EEPROM 512
#pragma AVRPART MEMORY INT_SRAM SIZE 607
#pragma AVRPART MEMORY INT_SRAM START_ADDR 0x60
.LISTMAC
.EQU UDRE=0x5
.EQU RXC=0x7
.EQU USR=0xB
.EQU UDR=0xC
.EQU SPSR=0xE
.EQU SPDR=0xF
.EQU EERE=0x0
.EQU EEWE=0x1
.EQU EEMWE=0x2
.EQU EECR=0x1C
.EQU EEDR=0x1D
.EQU EEARL=0x1E
.EQU EEARH=0x1F
.EQU WDTCR=0x21
.EQU MCUCR=0x35
.EQU GICR=0x3B
.EQU SPL=0x3D
.EQU SPH=0x3E
.EQU SREG=0x3F
.DEF R0X0=R0
.DEF R0X1=R1
.DEF R0X2=R2
.DEF R0X3=R3
.DEF R0X4=R4
.DEF R0X5=R5
.DEF R0X6=R6
.DEF R0X7=R7
.DEF R0X8=R8
.DEF R0X9=R9
.DEF R0XA=R10
.DEF R0XB=R11
.DEF R0XC=R12
.DEF R0XD=R13
.DEF R0XE=R14
.DEF R0XF=R15
.DEF R0X10=R16
.DEF R0X11=R17
.DEF R0X12=R18
.DEF R0X13=R19
.DEF R0X14=R20
.DEF R0X15=R21
.DEF R0X16=R22
.DEF R0X17=R23
.DEF R0X18=R24
.DEF R0X19=R25
.DEF R0X1A=R26
.DEF R0X1B=R27
.DEF R0X1C=R28
.DEF R0X1D=R29
.DEF R0X1E=R30
.DEF R0X1F=R31
.EQU __SRAM_START=0x0060
.EQU __SRAM_END=0x025F
.EQU __DSTACK_SIZE=0x0080
.EQU __HEAP_SIZE=0x0000
.EQU __CLEAR_SRAM_SIZE=__SRAM_END-__SRAM_START+1
.MACRO __CPD1N
CPI R30,LOW(@0)
LDI R26,HIGH(@0)
CPC R31,R26
LDI R26,BYTE3(@0)
CPC R22,R26
LDI R26,BYTE4(@0)
CPC R23,R26
.ENDM
.MACRO __CPD2N
CPI R26,LOW(@0)
LDI R30,HIGH(@0)
CPC R27,R30
LDI R30,BYTE3(@0)
CPC R24,R30
LDI R30,BYTE4(@0)
CPC R25,R30
.ENDM
.MACRO __CPWRR
CP R@0,R@2
CPC R@1,R@3
.ENDM
.MACRO __CPWRN
CPI R@0,LOW(@2)
LDI R30,HIGH(@2)
CPC R@1,R30
.ENDM
.MACRO __ADDB1MN
SUBI R30,LOW(-@0-(@1))
.ENDM
.MACRO __ADDB2MN
SUBI R26,LOW(-@0-(@1))
.ENDM
.MACRO __ADDW1MN
SUBI R30,LOW(-@0-(@1))
SBCI R31,HIGH(-@0-(@1))
.ENDM
.MACRO __ADDW2MN
SUBI R26,LOW(-@0-(@1))
SBCI R27,HIGH(-@0-(@1))
.ENDM
.MACRO __ADDW1FN
SUBI R30,LOW(-2*@0-(@1))
SBCI R31,HIGH(-2*@0-(@1))
.ENDM
.MACRO __ADDD1FN
SUBI R30,LOW(-2*@0-(@1))
SBCI R31,HIGH(-2*@0-(@1))
SBCI R22,BYTE3(-2*@0-(@1))
.ENDM
.MACRO __ADDD1N
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
SBCI R22,BYTE3(-@0)
SBCI R23,BYTE4(-@0)
.ENDM
.MACRO __ADDD2N
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
SBCI R24,BYTE3(-@0)
SBCI R25,BYTE4(-@0)
.ENDM
.MACRO __SUBD1N
SUBI R30,LOW(@0)
SBCI R31,HIGH(@0)
SBCI R22,BYTE3(@0)
SBCI R23,BYTE4(@0)
.ENDM
.MACRO __SUBD2N
SUBI R26,LOW(@0)
SBCI R27,HIGH(@0)
SBCI R24,BYTE3(@0)
SBCI R25,BYTE4(@0)
.ENDM
.MACRO __ANDBMNN
LDS R30,@0+(@1)
ANDI R30,LOW(@2)
STS @0+(@1),R30
.ENDM
.MACRO __ANDWMNN
LDS R30,@0+(@1)
ANDI R30,LOW(@2)
STS @0+(@1),R30
LDS R30,@0+(@1)+1
ANDI R30,HIGH(@2)
STS @0+(@1)+1,R30
.ENDM
.MACRO __ANDD1N
ANDI R30,LOW(@0)
ANDI R31,HIGH(@0)
ANDI R22,BYTE3(@0)
ANDI R23,BYTE4(@0)
.ENDM
.MACRO __ANDD2N
ANDI R26,LOW(@0)
ANDI R27,HIGH(@0)
ANDI R24,BYTE3(@0)
ANDI R25,BYTE4(@0)
.ENDM
.MACRO __ORBMNN
LDS R30,@0+(@1)
ORI R30,LOW(@2)
STS @0+(@1),R30
.ENDM
.MACRO __ORWMNN
LDS R30,@0+(@1)
ORI R30,LOW(@2)
STS @0+(@1),R30
LDS R30,@0+(@1)+1
ORI R30,HIGH(@2)
STS @0+(@1)+1,R30
.ENDM
.MACRO __ORD1N
ORI R30,LOW(@0)
ORI R31,HIGH(@0)
ORI R22,BYTE3(@0)
ORI R23,BYTE4(@0)
.ENDM
.MACRO __ORD2N
ORI R26,LOW(@0)
ORI R27,HIGH(@0)
ORI R24,BYTE3(@0)
ORI R25,BYTE4(@0)
.ENDM
.MACRO __DELAY_USB
LDI R24,LOW(@0)
__DELAY_USB_LOOP:
DEC R24
BRNE __DELAY_USB_LOOP
.ENDM
.MACRO __DELAY_USW
LDI R24,LOW(@0)
LDI R25,HIGH(@0)
__DELAY_USW_LOOP:
SBIW R24,1
BRNE __DELAY_USW_LOOP
.ENDM
.MACRO __GETD1S
LDD R30,Y+@0
LDD R31,Y+@0+1
LDD R22,Y+@0+2
LDD R23,Y+@0+3
.ENDM
.MACRO __GETD2S
LDD R26,Y+@0
LDD R27,Y+@0+1
LDD R24,Y+@0+2
LDD R25,Y+@0+3
.ENDM
.MACRO __PUTD1S
STD Y+@0,R30
STD Y+@0+1,R31
STD Y+@0+2,R22
STD Y+@0+3,R23
.ENDM
.MACRO __PUTD2S
STD Y+@0,R26
STD Y+@0+1,R27
STD Y+@0+2,R24
STD Y+@0+3,R25
.ENDM
.MACRO __PUTDZ2
STD Z+@0,R26
STD Z+@0+1,R27
STD Z+@0+2,R24
STD Z+@0+3,R25
.ENDM
.MACRO __CLRD1S
STD Y+@0,R30
STD Y+@0+1,R30
STD Y+@0+2,R30
STD Y+@0+3,R30
.ENDM
.MACRO __POINTB1MN
LDI R30,LOW(@0+(@1))
.ENDM
.MACRO __POINTW1MN
LDI R30,LOW(@0+(@1))
LDI R31,HIGH(@0+(@1))
.ENDM
.MACRO __POINTD1M
LDI R30,LOW(@0)
LDI R31,HIGH(@0)
LDI R22,BYTE3(@0)
LDI R23,BYTE4(@0)
.ENDM
.MACRO __POINTW1FN
LDI R30,LOW(2*@0+(@1))
LDI R31,HIGH(2*@0+(@1))
.ENDM
.MACRO __POINTD1FN
LDI R30,LOW(2*@0+(@1))
LDI R31,HIGH(2*@0+(@1))
LDI R22,BYTE3(2*@0+(@1))
LDI R23,BYTE4(2*@0+(@1))
.ENDM
.MACRO __POINTB2MN
LDI R26,LOW(@0+(@1))
.ENDM
.MACRO __POINTW2MN
LDI R26,LOW(@0+(@1))
LDI R27,HIGH(@0+(@1))
.ENDM
.MACRO __POINTBRM
LDI R@0,LOW(@1)
.ENDM
.MACRO __POINTWRM
LDI R@0,LOW(@2)
LDI R@1,HIGH(@2)
.ENDM
.MACRO __POINTBRMN
LDI R@0,LOW(@1+(@2))
.ENDM
.MACRO __POINTWRMN
LDI R@0,LOW(@2+(@3))
LDI R@1,HIGH(@2+(@3))
.ENDM
.MACRO __POINTWRFN
LDI R@0,LOW(@2*2+(@3))
LDI R@1,HIGH(@2*2+(@3))
.ENDM
.MACRO __GETD1N
LDI R30,LOW(@0)
LDI R31,HIGH(@0)
LDI R22,BYTE3(@0)
LDI R23,BYTE4(@0)
.ENDM
.MACRO __GETD2N
LDI R26,LOW(@0)
LDI R27,HIGH(@0)
LDI R24,BYTE3(@0)
LDI R25,BYTE4(@0)
.ENDM
.MACRO __GETB1MN
LDS R30,@0+(@1)
.ENDM
.MACRO __GETB1HMN
LDS R31,@0+(@1)
.ENDM
.MACRO __GETW1MN
LDS R30,@0+(@1)
LDS R31,@0+(@1)+1
.ENDM
.MACRO __GETD1MN
LDS R30,@0+(@1)
LDS R31,@0+(@1)+1
LDS R22,@0+(@1)+2
LDS R23,@0+(@1)+3
.ENDM
.MACRO __GETBRMN
LDS R@0,@1+(@2)
.ENDM
.MACRO __GETWRMN
LDS R@0,@2+(@3)
LDS R@1,@2+(@3)+1
.ENDM
.MACRO __GETWRZ
LDD R@0,Z+@2
LDD R@1,Z+@2+1
.ENDM
.MACRO __GETD2Z
LDD R26,Z+@0
LDD R27,Z+@0+1
LDD R24,Z+@0+2
LDD R25,Z+@0+3
.ENDM
.MACRO __GETB2MN
LDS R26,@0+(@1)
.ENDM
.MACRO __GETW2MN
LDS R26,@0+(@1)
LDS R27,@0+(@1)+1
.ENDM
.MACRO __GETD2MN
LDS R26,@0+(@1)
LDS R27,@0+(@1)+1
LDS R24,@0+(@1)+2
LDS R25,@0+(@1)+3
.ENDM
.MACRO __PUTB1MN
STS @0+(@1),R30
.ENDM
.MACRO __PUTW1MN
STS @0+(@1),R30
STS @0+(@1)+1,R31
.ENDM
.MACRO __PUTD1MN
STS @0+(@1),R30
STS @0+(@1)+1,R31
STS @0+(@1)+2,R22
STS @0+(@1)+3,R23
.ENDM
.MACRO __PUTB1EN
LDI R26,LOW(@0+(@1))
LDI R27,HIGH(@0+(@1))
RCALL __EEPROMWRB
.ENDM
.MACRO __PUTW1EN
LDI R26,LOW(@0+(@1))
LDI R27,HIGH(@0+(@1))
RCALL __EEPROMWRW
.ENDM
.MACRO __PUTD1EN
LDI R26,LOW(@0+(@1))
LDI R27,HIGH(@0+(@1))
RCALL __EEPROMWRD
.ENDM
.MACRO __PUTBR0MN
STS @0+(@1),R0
.ENDM
.MACRO __PUTBMRN
STS @0+(@1),R@2
.ENDM
.MACRO __PUTWMRN
STS @0+(@1),R@2
STS @0+(@1)+1,R@3
.ENDM
.MACRO __PUTBZR
STD Z+@1,R@0
.ENDM
.MACRO __PUTWZR
STD Z+@2,R@0
STD Z+@2+1,R@1
.ENDM
.MACRO __GETW1R
MOV R30,R@0
MOV R31,R@1
.ENDM
.MACRO __GETW2R
MOV R26,R@0
MOV R27,R@1
.ENDM
.MACRO __GETWRN
LDI R@0,LOW(@2)
LDI R@1,HIGH(@2)
.ENDM
.MACRO __PUTW1R
MOV R@0,R30
MOV R@1,R31
.ENDM
.MACRO __PUTW2R
MOV R@0,R26
MOV R@1,R27
.ENDM
.MACRO __ADDWRN
SUBI R@0,LOW(-@2)
SBCI R@1,HIGH(-@2)
.ENDM
.MACRO __ADDWRR
ADD R@0,R@2
ADC R@1,R@3
.ENDM
.MACRO __SUBWRN
SUBI R@0,LOW(@2)
SBCI R@1,HIGH(@2)
.ENDM
.MACRO __SUBWRR
SUB R@0,R@2
SBC R@1,R@3
.ENDM
.MACRO __ANDWRN
ANDI R@0,LOW(@2)
ANDI R@1,HIGH(@2)
.ENDM
.MACRO __ANDWRR
AND R@0,R@2
AND R@1,R@3
.ENDM
.MACRO __ORWRN
ORI R@0,LOW(@2)
ORI R@1,HIGH(@2)
.ENDM
.MACRO __ORWRR
OR R@0,R@2
OR R@1,R@3
.ENDM
.MACRO __EORWRR
EOR R@0,R@2
EOR R@1,R@3
.ENDM
.MACRO __GETWRS
LDD R@0,Y+@2
LDD R@1,Y+@2+1
.ENDM
.MACRO __PUTBSR
STD Y+@1,R@0
.ENDM
.MACRO __PUTWSR
STD Y+@2,R@0
STD Y+@2+1,R@1
.ENDM
.MACRO __MOVEWRR
MOV R@0,R@2
MOV R@1,R@3
.ENDM
.MACRO __INWR
IN R@0,@2
IN R@1,@2+1
.ENDM
.MACRO __OUTWR
OUT @2+1,R@1
OUT @2,R@0
.ENDM
.MACRO __CALL1MN
LDS R30,@0+(@1)
LDS R31,@0+(@1)+1
ICALL
.ENDM
.MACRO __CALL1FN
LDI R30,LOW(2*@0+(@1))
LDI R31,HIGH(2*@0+(@1))
RCALL __GETW1PF
ICALL
.ENDM
.MACRO __CALL2EN
LDI R26,LOW(@0+(@1))
LDI R27,HIGH(@0+(@1))
RCALL __EEPROMRDW
ICALL
.ENDM
.MACRO __GETW1STACK
IN R26,SPL
IN R27,SPH
ADIW R26,@0+1
LD R30,X+
LD R31,X
.ENDM
.MACRO __GETD1STACK
IN R26,SPL
IN R27,SPH
ADIW R26,@0+1
LD R30,X+
LD R31,X+
LD R22,X
.ENDM
.MACRO __NBST
BST R@0,@1
IN R30,SREG
LDI R31,0x40
EOR R30,R31
OUT SREG,R30
.ENDM
.MACRO __PUTB1SN
LDD R26,Y+@0
LDD R27,Y+@0+1
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X,R30
.ENDM
.MACRO __PUTW1SN
LDD R26,Y+@0
LDD R27,Y+@0+1
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1SN
LDD R26,Y+@0
LDD R27,Y+@0+1
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
RCALL __PUTDP1
.ENDM
.MACRO __PUTB1SNS
LDD R26,Y+@0
LDD R27,Y+@0+1
ADIW R26,@1
ST X,R30
.ENDM
.MACRO __PUTW1SNS
LDD R26,Y+@0
LDD R27,Y+@0+1
ADIW R26,@1
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1SNS
LDD R26,Y+@0
LDD R27,Y+@0+1
ADIW R26,@1
RCALL __PUTDP1
.ENDM
.MACRO __PUTB1PMN
LDS R26,@0
LDS R27,@0+1
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X,R30
.ENDM
.MACRO __PUTW1PMN
LDS R26,@0
LDS R27,@0+1
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1PMN
LDS R26,@0
LDS R27,@0+1
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
RCALL __PUTDP1
.ENDM
.MACRO __PUTB1PMNS
LDS R26,@0
LDS R27,@0+1
ADIW R26,@1
ST X,R30
.ENDM
.MACRO __PUTW1PMNS
LDS R26,@0
LDS R27,@0+1
ADIW R26,@1
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1PMNS
LDS R26,@0
LDS R27,@0+1
ADIW R26,@1
RCALL __PUTDP1
.ENDM
.MACRO __PUTB1RN
MOVW R26,R@0
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X,R30
.ENDM
.MACRO __PUTW1RN
MOVW R26,R@0
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1RN
MOVW R26,R@0
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
RCALL __PUTDP1
.ENDM
.MACRO __PUTB1RNS
MOVW R26,R@0
ADIW R26,@1
ST X,R30
.ENDM
.MACRO __PUTW1RNS
MOVW R26,R@0
ADIW R26,@1
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1RNS
MOVW R26,R@0
ADIW R26,@1
RCALL __PUTDP1
.ENDM
.MACRO __PUTB1RON
MOV R26,R@0
MOV R27,R@1
SUBI R26,LOW(-@2)
SBCI R27,HIGH(-@2)
ST X,R30
.ENDM
.MACRO __PUTW1RON
MOV R26,R@0
MOV R27,R@1
SUBI R26,LOW(-@2)
SBCI R27,HIGH(-@2)
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1RON
MOV R26,R@0
MOV R27,R@1
SUBI R26,LOW(-@2)
SBCI R27,HIGH(-@2)
RCALL __PUTDP1
.ENDM
.MACRO __PUTB1RONS
MOV R26,R@0
MOV R27,R@1
ADIW R26,@2
ST X,R30
.ENDM
.MACRO __PUTW1RONS
MOV R26,R@0
MOV R27,R@1
ADIW R26,@2
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1RONS
MOV R26,R@0
MOV R27,R@1
ADIW R26,@2
RCALL __PUTDP1
.ENDM
.MACRO __GETB1SX
MOVW R30,R28
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
LD R30,Z
.ENDM
.MACRO __GETB1HSX
MOVW R30,R28
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
LD R31,Z
.ENDM
.MACRO __GETW1SX
MOVW R30,R28
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
LD R0,Z+
LD R31,Z
MOV R30,R0
.ENDM
.MACRO __GETD1SX
MOVW R30,R28
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
LD R0,Z+
LD R1,Z+
LD R22,Z+
LD R23,Z
MOVW R30,R0
.ENDM
.MACRO __GETB2SX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
LD R26,X
.ENDM
.MACRO __GETW2SX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
LD R0,X+
LD R27,X
MOV R26,R0
.ENDM
.MACRO __GETD2SX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
LD R0,X+
LD R1,X+
LD R24,X+
LD R25,X
MOVW R26,R0
.ENDM
.MACRO __GETBRSX
MOVW R30,R28
SUBI R30,LOW(-@1)
SBCI R31,HIGH(-@1)
LD R@0,Z
.ENDM
.MACRO __GETWRSX
MOVW R30,R28
SUBI R30,LOW(-@2)
SBCI R31,HIGH(-@2)
LD R@0,Z+
LD R@1,Z
.ENDM
.MACRO __GETBRSX2
MOVW R26,R28
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
LD R@0,X
.ENDM
.MACRO __GETWRSX2
MOVW R26,R28
SUBI R26,LOW(-@2)
SBCI R27,HIGH(-@2)
LD R@0,X+
LD R@1,X
.ENDM
.MACRO __LSLW8SX
MOVW R30,R28
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
LD R31,Z
CLR R30
.ENDM
.MACRO __PUTB1SX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
ST X,R30
.ENDM
.MACRO __PUTW1SX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1SX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
ST X+,R30
ST X+,R31
ST X+,R22
ST X,R23
.ENDM
.MACRO __CLRW1SX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
ST X+,R30
ST X,R30
.ENDM
.MACRO __CLRD1SX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
ST X+,R30
ST X+,R30
ST X+,R30
ST X,R30
.ENDM
.MACRO __PUTB2SX
MOVW R30,R28
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
ST Z,R26
.ENDM
.MACRO __PUTW2SX
MOVW R30,R28
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
ST Z+,R26
ST Z,R27
.ENDM
.MACRO __PUTD2SX
MOVW R30,R28
SUBI R30,LOW(-@0)
SBCI R31,HIGH(-@0)
ST Z+,R26
ST Z+,R27
ST Z+,R24
ST Z,R25
.ENDM
.MACRO __PUTBSRX
MOVW R30,R28
SUBI R30,LOW(-@1)
SBCI R31,HIGH(-@1)
ST Z,R@0
.ENDM
.MACRO __PUTWSRX
MOVW R30,R28
SUBI R30,LOW(-@2)
SBCI R31,HIGH(-@2)
ST Z+,R@0
ST Z,R@1
.ENDM
.MACRO __PUTB1SNX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
LD R0,X+
LD R27,X
MOV R26,R0
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X,R30
.ENDM
.MACRO __PUTW1SNX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
LD R0,X+
LD R27,X
MOV R26,R0
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X+,R30
ST X,R31
.ENDM
.MACRO __PUTD1SNX
MOVW R26,R28
SUBI R26,LOW(-@0)
SBCI R27,HIGH(-@0)
LD R0,X+
LD R27,X
MOV R26,R0
SUBI R26,LOW(-@1)
SBCI R27,HIGH(-@1)
ST X+,R30
ST X+,R31
ST X+,R22
ST X,R23
.ENDM
.MACRO __MULBRR
MULS R@0,R@1
MOVW R30,R0
.ENDM
.MACRO __MULBRRU
MUL R@0,R@1
MOVW R30,R0
.ENDM
.MACRO __MULBRR0
MULS R@0,R@1
.ENDM
.MACRO __MULBRRU0
MUL R@0,R@1
.ENDM
.MACRO __MULBNWRU
LDI R26,@2
MUL R26,R@0
MOVW R30,R0
MUL R26,R@1
ADD R31,R0
.ENDM
;NAME DEFINITIONS FOR GLOBAL VARIABLES ALLOCATED TO REGISTERS
.DEF _jam=R5
.DEF _menit=R4
.DEF _detik=R7
.DEF _x=R6
.DEF _tanggal=R9
.DEF _bulan=R8
.DEF _tahun=R11
.DEF __lcd_x=R10
.DEF __lcd_y=R13
.DEF __lcd_maxx=R12
.CSEG
.ORG 0x00
;START OF CODE MARKER
__START_OF_CODE:
;INTERRUPT VECTORS
RJMP __RESET
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
RJMP 0x00
_tbl10_G100:
.DB 0x10,0x27,0xE8,0x3,0x64,0x0,0xA,0x0
.DB 0x1,0x0
_tbl16_G100:
.DB 0x0,0x10,0x0,0x1,0x10,0x0,0x1,0x0
_0x0:
.DB 0x53,0x65,0x74,0x20,0x54,0x69,0x6D,0x65
.DB 0x72,0x20,0x42,0x65,0x62,0x61,0x6E,0x31
.DB 0x0,0x53,0x65,0x74,0x20,0x54,0x69,0x6D
.DB 0x65,0x72,0x20,0x4F,0x6E,0x20,0x20,0x20
.DB 0x20,0x0,0x25,0x64,0x0,0x53,0x65,0x74
.DB 0x20,0x54,0x69,0x6D,0x65,0x72,0x20,0x4F
.DB 0x66,0x66,0x20,0x20,0x20,0x0,0x53,0x65
.DB 0x74,0x74,0x69,0x6E,0x67,0x20,0x46,0x69
.DB 0x6E,0x69,0x73,0x68,0x20,0x20,0x0,0x53
.DB 0x65,0x74,0x20,0x54,0x69,0x6D,0x65,0x72
.DB 0x20,0x42,0x65,0x62,0x61,0x6E,0x32,0x0
.DB 0x53,0x65,0x74,0x20,0x54,0x69,0x6D,0x65
.DB 0x72,0x20,0x42,0x65,0x62,0x61,0x6E,0x33
.DB 0x0,0x53,0x65,0x74,0x20,0x54,0x69,0x6D
.DB 0x65,0x72,0x20,0x42,0x65,0x62,0x61,0x6E
.DB 0x34,0x0,0x54,0x34,0x20,0x4F,0x6E,0x20
.DB 0x20,0x3E,0x20,0x25,0x32,0x64,0x3A,0x25
.DB 0x32,0x64,0x20,0x0,0x54,0x34,0x20,0x4F
.DB 0x66,0x66,0x20,0x3E,0x20,0x25,0x32,0x64
.DB 0x3A,0x25,0x32,0x64,0x20,0x0,0x54,0x33
.DB 0x20,0x4F,0x6E,0x20,0x20,0x3E,0x20,0x25
.DB 0x32,0x64,0x3A,0x25,0x32,0x64,0x20,0x0
.DB 0x54,0x33,0x20,0x4F,0x66,0x66,0x20,0x3E
.DB 0x20,0x25,0x32,0x64,0x3A,0x25,0x32,0x64
.DB 0x20,0x0,0x54,0x32,0x20,0x4F,0x6E,0x20
.DB 0x20,0x3E,0x20,0x25,0x32,0x64,0x3A,0x25
.DB 0x32,0x64,0x20,0x0,0x54,0x32,0x20,0x4F
.DB 0x66,0x66,0x20,0x3E,0x20,0x25,0x32,0x64
.DB 0x3A,0x25,0x32,0x64,0x20,0x0,0x54,0x31
.DB 0x20,0x4F,0x6E,0x20,0x20,0x3E,0x20,0x25
.DB 0x32,0x64,0x3A,0x25,0x32,0x64,0x20,0x0
.DB 0x54,0x31,0x20,0x4F,0x66,0x66,0x20,0x3E
.DB 0x20,0x25,0x32,0x64,0x3A,0x25,0x32,0x64
.DB 0x20,0x0,0x4A,0x61,0x6D,0x20,0x3D,0x3E
.DB 0x20,0x25,0x32,0x64,0x3A,0x25,0x32,0x64
.DB 0x3A,0x25,0x32,0x64,0x20,0x0,0x54,0x67
.DB 0x6C,0x20,0x3D,0x3E,0x20,0x25,0x32,0x64
.DB 0x2F,0x25,0x32,0x64,0x2F,0x25,0x32,0x64
.DB 0x20,0x0
_0x2040003:
.DB 0x80,0xC0
__GLOBAL_INI_TBL:
.DW 0x11
.DW _0x49
.DW _0x0*2
.DW 0x11
.DW _0x49+17
.DW _0x0*2+17
.DW 0x11
.DW _0x49+34
.DW _0x0*2+37
.DW 0x11
.DW _0x49+51
.DW _0x0*2+54
.DW 0x11
.DW _0x4D
.DW _0x0*2+71
.DW 0x11
.DW _0x4D+17
.DW _0x0*2+17
.DW 0x11
.DW _0x4D+34
.DW _0x0*2+37
.DW 0x11
.DW _0x4D+51
.DW _0x0*2+54
.DW 0x11
.DW _0x51
.DW _0x0*2+88
.DW 0x11
.DW _0x51+17
.DW _0x0*2+17
.DW 0x11
.DW _0x51+34
.DW _0x0*2+37
.DW 0x11
.DW _0x51+51
.DW _0x0*2+54
.DW 0x11
.DW _0x55
.DW _0x0*2+105
.DW 0x11
.DW _0x55+17
.DW _0x0*2+17
.DW 0x11
.DW _0x55+34
.DW _0x0*2+37
.DW 0x11
.DW _0x55+51
.DW _0x0*2+54
.DW 0x02
.DW __base_y_G102
.DW _0x2040003*2
_0xFFFFFFFF:
.DW 0
__RESET:
CLI
CLR R30
OUT EECR,R30
;INTERRUPT VECTORS ARE PLACED
;AT THE START OF FLASH
LDI R31,1
OUT GICR,R31
OUT GICR,R30
OUT MCUCR,R30
;DISABLE WATCHDOG
LDI R31,0x18
OUT WDTCR,R31
OUT WDTCR,R30
;CLEAR R2-R14
LDI R24,(14-2)+1
LDI R26,2
CLR R27
__CLEAR_REG:
ST X+,R30
DEC R24
BRNE __CLEAR_REG
;CLEAR SRAM
LDI R24,LOW(__CLEAR_SRAM_SIZE)
LDI R25,HIGH(__CLEAR_SRAM_SIZE)
LDI R26,__SRAM_START
__CLEAR_SRAM:
ST X+,R30
SBIW R24,1
BRNE __CLEAR_SRAM
;GLOBAL VARIABLES INITIALIZATION
LDI R30,LOW(__GLOBAL_INI_TBL*2)
LDI R31,HIGH(__GLOBAL_INI_TBL*2)
__GLOBAL_INI_NEXT:
LPM R24,Z+
LPM R25,Z+
SBIW R24,0
BREQ __GLOBAL_INI_END
LPM R26,Z+
LPM R27,Z+
LPM R0,Z+
LPM R1,Z+
MOVW R22,R30
MOVW R30,R0
__GLOBAL_INI_LOOP:
LPM R0,Z+
ST X+,R0
SBIW R24,1
BRNE __GLOBAL_INI_LOOP
MOVW R30,R22
RJMP __GLOBAL_INI_NEXT
__GLOBAL_INI_END:
;HARDWARE STACK POINTER INITIALIZATION
LDI R30,LOW(__SRAM_END-__HEAP_SIZE)
OUT SPL,R30
LDI R30,HIGH(__SRAM_END-__HEAP_SIZE)
OUT SPH,R30
;DATA STACK POINTER INITIALIZATION
LDI R28,LOW(__SRAM_START+__DSTACK_SIZE)
LDI R29,HIGH(__SRAM_START+__DSTACK_SIZE)
RJMP _main
.ESEG
.ORG 0
.DSEG
.ORG 0xE0
.CSEG
;/*****************************************************
;PROSEDUR PENGGUNAAN
;SECARA DEFAULT TAMPILAN LCD AKAN MENAMPILKAN JAM DAN TANGGAL
;UNTUK MELAKUKAN PENGATURAN WAKTU NYALA/MATI SETIAP BEBAN DAPAT MENEKAN TOMBOL PUSHBUTTON
;SETELAH TOMBOL DITEKAN ANDA AKAN DIMINTA UNTUK MEMASUKKAN WAKTU ON DAN WAKTU OFF MELALUI KEYPAD
;PADA SAAT DI LCD MUNCUL TULISAN TIMER ON KETIK JAM YANG AKAN DIMASUKKAN KE SETTINGAN
;FORMAT DATA YANG DIMASUKKAN ADALAH SEBAGAI BERIKUT
;CONTOH :
;08*15
;KEMUDIAN DIAKHIRI DENGAN MENEKAN #
;FORMAT JAM ADALAH 24 JAM
;SETINGAN JAM AKAN OTOMATIS DIMASUKKAN KE EEPROM
;ANDA BISA MELIHAT SETTINGAN NYALA/MATI SETIAP BEBAN DENGAN MENEKAN HURUF 'A' 'B' 'C' ATAU 'D' PADA KEYPAD, PADA SAAT LCD MENAMPILKAN JAM DAN TANGGAL
;*****************************************************/
;
;#include <mega8535.h>
#ifndef __SLEEP_DEFINED__
#define __SLEEP_DEFINED__
.EQU __se_bit=0x40
.EQU __sm_mask=0xB0
.EQU __sm_powerdown=0x20
.EQU __sm_powersave=0x30
.EQU __sm_standby=0xA0
.EQU __sm_ext_standby=0xB0
.EQU __sm_adc_noise_red=0x10
.SET power_ctrl_reg=mcucr
#endif
;#include <delay.h>
;#include <stdio.h>
;
;// I2C Bus functions
;#asm
.equ __i2c_port=0x15 ;PORTC
.equ __sda_bit=1
.equ __scl_bit=0
; 0000 0019 #endasm
;#include <i2c.h>
;
;// DS1307 Real Time Clock functions
;#include <ds1307.h>
;
;// Alphanumeric LCD Module functions
;#include <alcd.h>
;
;#define SW_BEBAN1 PINB.0
;#define SW_BEBAN2 PINB.1
;#define SW_BEBAN3 PINB.2
;#define SW_BEBAN4 PINB.3
;
;#define BEBAN1 PORTC.4
;#define BEBAN2 PORTC.5
;#define BEBAN3 PORTC.6
;#define BEBAN4 PORTC.7
;
;#define DDR_KEYPAD DDRD
;#define KEYPAD_OUT PORTD
;#define KEYPAD_IN PIND
;
;unsigned char jam, menit, detik;
;unsigned char x, tanggal, bulan, tahun;
;
;unsigned char jamTimerOn[4], menitTimerOn[4], jamTimerOff[4], menitTimerOff[4];
;eeprom unsigned char _jamTimerOn[4], _menitTimerOn[4], _jamTimerOff[4], _menitTimerOff[4];
;
;char dataKeypad[16];
;char bufferLcd1[16], bufferLcd2[16];
;
;void bacaRTC() {
; 0000 0039 void bacaRTC() {
.CSEG
_bacaRTC:
; 0000 003A rtc_get_time(&jam,&menit,&detik);
LDI R30,LOW(5)
LDI R31,HIGH(5)
RCALL SUBOPT_0x0
LDI R30,LOW(4)
LDI R31,HIGH(4)
RCALL SUBOPT_0x0
LDI R30,LOW(7)
LDI R31,HIGH(7)
RCALL SUBOPT_0x0
RCALL _rtc_get_time
; 0000 003B rtc_get_date(&x,&tanggal,&bulan,&tahun);
LDI R30,LOW(6)
LDI R31,HIGH(6)
RCALL SUBOPT_0x0
LDI R30,LOW(9)
LDI R31,HIGH(9)
RCALL SUBOPT_0x0
LDI R30,LOW(8)
LDI R31,HIGH(8)
RCALL SUBOPT_0x0
LDI R30,LOW(11)
LDI R31,HIGH(11)
RCALL SUBOPT_0x0
RCALL _rtc_get_date
; 0000 003C }
RET
;
;void clearDataKeypad() {
; 0000 003E void clearDataKeypad() {
_clearDataKeypad:
; 0000 003F int i;
; 0000 0040 for(i=0;i<16;i++) {
RCALL __SAVELOCR2
; i -> R16,R17
RCALL SUBOPT_0x1
_0x4:
__CPWRN 16,17,16
BRGE _0x5
; 0000 0041 dataKeypad[i]=0;
LDI R26,LOW(_dataKeypad)
LDI R27,HIGH(_dataKeypad)
RCALL SUBOPT_0x2
; 0000 0042 }
RCALL SUBOPT_0x3
RJMP _0x4
_0x5:
; 0000 0043 }
RCALL __LOADLOCR2P
RET
;
;void scanKeypad(char limiter, int display, unsigned char startX, unsigned char startY) {
; 0000 0045 void scanKeypad(char limiter, int display, unsigned char startX, unsigned char startY) {
_scanKeypad:
PUSH R15
; 0000 0046 unsigned char counter=0;
; 0000 0047 bit selesai = 0;
; 0000 0048 clearDataKeypad();
ST -Y,R17
; limiter -> Y+5
; display -> Y+3
; startX -> Y+2
; startY -> Y+1
; counter -> R17
; selesai -> R15.0
CLR R15
LDI R17,0
RCALL _clearDataKeypad
; 0000 0049 while(!selesai) {
_0x6:
SBRC R15,0
RJMP _0x8
; 0000 004A lcd_gotoxy(startX,startY);
RCALL SUBOPT_0x4
RCALL SUBOPT_0x4
RCALL _lcd_gotoxy
; 0000 004B KEYPAD_OUT=0b01111111;
LDI R30,LOW(127)
RCALL SUBOPT_0x5
; 0000 004C delay_ms(30);
; 0000 004D if(KEYPAD_IN.0==0) {
SBIC 0x10,0
RJMP _0x9
; 0000 004E if(limiter=='*') {
LDD R26,Y+5
CPI R26,LOW(0x2A)
BRNE _0xA
; 0000 004F selesai = 1;
RCALL SUBOPT_0x6
; 0000 0050 }
; 0000 0051 else {
RJMP _0xB
_0xA:
; 0000 0052 dataKeypad[counter]='*';
RCALL SUBOPT_0x7
LDI R26,LOW(42)
RCALL SUBOPT_0x8
; 0000 0053 if(display) {
BREQ _0xC
; 0000 0054 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 0055 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 0056 }
; 0000 0057 counter++;
_0xC:
SUBI R17,-1
; 0000 0058 }
_0xB:
; 0000 0059 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 005A }
; 0000 005B if(KEYPAD_IN.1==0) {
_0x9:
SBIC 0x10,1
RJMP _0xD
; 0000 005C if(limiter=='7') {
LDD R26,Y+5
CPI R26,LOW(0x37)
BRNE _0xE
; 0000 005D selesai = 1;
RCALL SUBOPT_0x6
; 0000 005E }
; 0000 005F else {
RJMP _0xF
_0xE:
; 0000 0060 dataKeypad[counter]='7';
RCALL SUBOPT_0x7
LDI R26,LOW(55)
RCALL SUBOPT_0x8
; 0000 0061 if(display) {
BREQ _0x10
; 0000 0062 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 0063 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 0064 }
; 0000 0065 counter++;
_0x10:
SUBI R17,-1
; 0000 0066 }
_0xF:
; 0000 0067 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 0068 }
; 0000 0069 if(KEYPAD_IN.2==0) {
_0xD:
SBIC 0x10,2
RJMP _0x11
; 0000 006A if(limiter=='4') {
LDD R26,Y+5
CPI R26,LOW(0x34)
BRNE _0x12
; 0000 006B selesai = 1;
RCALL SUBOPT_0x6
; 0000 006C }
; 0000 006D else {
RJMP _0x13
_0x12:
; 0000 006E dataKeypad[counter]='4';
RCALL SUBOPT_0x7
LDI R26,LOW(52)
RCALL SUBOPT_0x8
; 0000 006F if(display) {
BREQ _0x14
; 0000 0070 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 0071 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 0072 }
; 0000 0073 counter++;
_0x14:
SUBI R17,-1
; 0000 0074 }
_0x13:
; 0000 0075 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 0076 }
; 0000 0077 if(KEYPAD_IN.3==0) {
_0x11:
SBIC 0x10,3
RJMP _0x15
; 0000 0078 if(limiter=='1') {
LDD R26,Y+5
CPI R26,LOW(0x31)
BRNE _0x16
; 0000 0079 selesai = 1;
RCALL SUBOPT_0x6
; 0000 007A }
; 0000 007B else {
RJMP _0x17
_0x16:
; 0000 007C dataKeypad[counter]='1';
RCALL SUBOPT_0x7
LDI R26,LOW(49)
RCALL SUBOPT_0x8
; 0000 007D if(display) {
BREQ _0x18
; 0000 007E lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 007F lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 0080 }
; 0000 0081 counter++;
_0x18:
SUBI R17,-1
; 0000 0082 }
_0x17:
; 0000 0083 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 0084 }
; 0000 0085 KEYPAD_OUT=0b10111111;
_0x15:
LDI R30,LOW(191)
RCALL SUBOPT_0x5
; 0000 0086 delay_ms(30);
; 0000 0087 if(KEYPAD_IN.0==0) {
SBIC 0x10,0
RJMP _0x19
; 0000 0088 if(limiter=='0') {
LDD R26,Y+5
CPI R26,LOW(0x30)
BRNE _0x1A
; 0000 0089 selesai = 1;
RCALL SUBOPT_0x6
; 0000 008A }
; 0000 008B else {
RJMP _0x1B
_0x1A:
; 0000 008C dataKeypad[counter]='0';
RCALL SUBOPT_0x7
LDI R26,LOW(48)
RCALL SUBOPT_0x8
; 0000 008D if(display) {
BREQ _0x1C
; 0000 008E lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 008F lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 0090 }
; 0000 0091 counter++;
_0x1C:
SUBI R17,-1
; 0000 0092 }
_0x1B:
; 0000 0093 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 0094 }
; 0000 0095 if(KEYPAD_IN.1==0) {
_0x19:
SBIC 0x10,1
RJMP _0x1D
; 0000 0096 if(limiter=='8') {
LDD R26,Y+5
CPI R26,LOW(0x38)
BRNE _0x1E
; 0000 0097 selesai = 1;
RCALL SUBOPT_0x6
; 0000 0098 }
; 0000 0099 else {
RJMP _0x1F
_0x1E:
; 0000 009A dataKeypad[counter]='8';
RCALL SUBOPT_0x7
LDI R26,LOW(56)
RCALL SUBOPT_0x8
; 0000 009B if(display) {
BREQ _0x20
; 0000 009C lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 009D lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 009E }
; 0000 009F counter++;
_0x20:
SUBI R17,-1
; 0000 00A0 }
_0x1F:
; 0000 00A1 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 00A2 }
; 0000 00A3 if(KEYPAD_IN.2==0) {
_0x1D:
SBIC 0x10,2
RJMP _0x21
; 0000 00A4 if(limiter=='5') {
LDD R26,Y+5
CPI R26,LOW(0x35)
BRNE _0x22
; 0000 00A5 selesai = 1;
RCALL SUBOPT_0x6
; 0000 00A6 }
; 0000 00A7 else {
RJMP _0x23
_0x22:
; 0000 00A8 dataKeypad[counter]='5';
RCALL SUBOPT_0x7
LDI R26,LOW(53)
RCALL SUBOPT_0x8
; 0000 00A9 if(display) {
BREQ _0x24
; 0000 00AA lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 00AB lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 00AC }
; 0000 00AD counter++;
_0x24:
SUBI R17,-1
; 0000 00AE }
_0x23:
; 0000 00AF delay_ms(200);
RCALL SUBOPT_0xC
; 0000 00B0 }
; 0000 00B1 if(KEYPAD_IN.3==0) {
_0x21:
SBIC 0x10,3
RJMP _0x25
; 0000 00B2 if(limiter=='2') {
LDD R26,Y+5
CPI R26,LOW(0x32)
BRNE _0x26
; 0000 00B3 selesai = 1;
RCALL SUBOPT_0x6
; 0000 00B4 }
; 0000 00B5 else {
RJMP _0x27
_0x26:
; 0000 00B6 dataKeypad[counter]='2';
RCALL SUBOPT_0x7
LDI R26,LOW(50)
RCALL SUBOPT_0x8
; 0000 00B7 if(display) {
BREQ _0x28
; 0000 00B8 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 00B9 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 00BA }
; 0000 00BB counter++;
_0x28:
SUBI R17,-1
; 0000 00BC }
_0x27:
; 0000 00BD delay_ms(200);
RCALL SUBOPT_0xC
; 0000 00BE }
; 0000 00BF KEYPAD_OUT=0b11011111;
_0x25:
LDI R30,LOW(223)
RCALL SUBOPT_0x5
; 0000 00C0 delay_ms(30);
; 0000 00C1 if(KEYPAD_IN.0==0) {
SBIC 0x10,0
RJMP _0x29
; 0000 00C2 if(limiter=='#') {
LDD R26,Y+5
CPI R26,LOW(0x23)
BRNE _0x2A
; 0000 00C3 selesai = 1;
RCALL SUBOPT_0x6
; 0000 00C4 }
; 0000 00C5 else {
RJMP _0x2B
_0x2A:
; 0000 00C6 dataKeypad[counter]='#';
RCALL SUBOPT_0x7
LDI R26,LOW(35)
RCALL SUBOPT_0x8
; 0000 00C7 if(display) {
BREQ _0x2C
; 0000 00C8 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 00C9 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 00CA }
; 0000 00CB counter++;
_0x2C:
SUBI R17,-1
; 0000 00CC }
_0x2B:
; 0000 00CD delay_ms(200);
RCALL SUBOPT_0xC
; 0000 00CE }
; 0000 00CF if(KEYPAD_IN.1==0) {
_0x29:
SBIC 0x10,1
RJMP _0x2D
; 0000 00D0 if(limiter=='9') {
LDD R26,Y+5
CPI R26,LOW(0x39)
BRNE _0x2E
; 0000 00D1 selesai = 1;
RCALL SUBOPT_0x6
; 0000 00D2 }
; 0000 00D3 else {
RJMP _0x2F
_0x2E:
; 0000 00D4 dataKeypad[counter]='9';
RCALL SUBOPT_0x7
LDI R26,LOW(57)
RCALL SUBOPT_0x8
; 0000 00D5 if(display) {
BREQ _0x30
; 0000 00D6 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 00D7 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 00D8 }
; 0000 00D9 counter++;
_0x30:
SUBI R17,-1
; 0000 00DA }
_0x2F:
; 0000 00DB delay_ms(100);
LDI R30,LOW(100)
LDI R31,HIGH(100)
RCALL SUBOPT_0xD
; 0000 00DC }
; 0000 00DD if(KEYPAD_IN.2==0) {
_0x2D:
SBIC 0x10,2
RJMP _0x31
; 0000 00DE if(limiter=='6') {
LDD R26,Y+5
CPI R26,LOW(0x36)
BRNE _0x32
; 0000 00DF selesai = 1;
RCALL SUBOPT_0x6
; 0000 00E0 }
; 0000 00E1 else {
RJMP _0x33
_0x32:
; 0000 00E2 dataKeypad[counter]='6';
RCALL SUBOPT_0x7
LDI R26,LOW(54)
RCALL SUBOPT_0x8
; 0000 00E3 if(display) {
BREQ _0x34
; 0000 00E4 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 00E5 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 00E6 }
; 0000 00E7 counter++;
_0x34:
SUBI R17,-1
; 0000 00E8 }
_0x33:
; 0000 00E9 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 00EA }
; 0000 00EB if(KEYPAD_IN.3==0) {
_0x31:
SBIC 0x10,3
RJMP _0x35
; 0000 00EC if(limiter=='3') {
LDD R26,Y+5
CPI R26,LOW(0x33)
BRNE _0x36
; 0000 00ED selesai = 1;
RCALL SUBOPT_0x6
; 0000 00EE }
; 0000 00EF else {
RJMP _0x37
_0x36:
; 0000 00F0 dataKeypad[counter]='3';
RCALL SUBOPT_0x7
LDI R26,LOW(51)
RCALL SUBOPT_0x8
; 0000 00F1 if(display) {
BREQ _0x38
; 0000 00F2 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 00F3 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 00F4 }
; 0000 00F5 counter++;
_0x38:
SUBI R17,-1
; 0000 00F6 }
_0x37:
; 0000 00F7 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 00F8 }
; 0000 00F9 KEYPAD_OUT=0b11101111;
_0x35:
LDI R30,LOW(239)
RCALL SUBOPT_0x5
; 0000 00FA delay_ms(30);
; 0000 00FB if(KEYPAD_IN.0==0) {
SBIC 0x10,0
RJMP _0x39
; 0000 00FC if(limiter=='D') {
LDD R26,Y+5
CPI R26,LOW(0x44)
BRNE _0x3A
; 0000 00FD selesai = 1;
RCALL SUBOPT_0x6
; 0000 00FE }
; 0000 00FF else {
RJMP _0x3B
_0x3A:
; 0000 0100 dataKeypad[counter]='D';
RCALL SUBOPT_0x7
LDI R26,LOW(68)
RCALL SUBOPT_0x8
; 0000 0101 if(display) {
BREQ _0x3C
; 0000 0102 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 0103 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 0104 }
; 0000 0105 counter++;
_0x3C:
SUBI R17,-1
; 0000 0106 }
_0x3B:
; 0000 0107 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 0108 }
; 0000 0109 if(KEYPAD_IN.1==0) {
_0x39:
SBIC 0x10,1
RJMP _0x3D
; 0000 010A if(limiter=='C') {
LDD R26,Y+5
CPI R26,LOW(0x43)
BRNE _0x3E
; 0000 010B selesai = 1;
RCALL SUBOPT_0x6
; 0000 010C }
; 0000 010D else {
RJMP _0x3F
_0x3E:
; 0000 010E dataKeypad[counter]='C';
RCALL SUBOPT_0x7
LDI R26,LOW(67)
RCALL SUBOPT_0x8
; 0000 010F if(display) {
BREQ _0x40
; 0000 0110 lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 0111 lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 0112 }
; 0000 0113 counter++;
_0x40:
SUBI R17,-1
; 0000 0114 }
_0x3F:
; 0000 0115 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 0116 }
; 0000 0117 if(KEYPAD_IN.2==0) {
_0x3D:
SBIC 0x10,2
RJMP _0x41
; 0000 0118 if(limiter=='B') {
LDD R26,Y+5
CPI R26,LOW(0x42)
BRNE _0x42
; 0000 0119 selesai = 1;
RCALL SUBOPT_0x6
; 0000 011A }
; 0000 011B else {
RJMP _0x43
_0x42:
; 0000 011C dataKeypad[counter]='B';
RCALL SUBOPT_0x7
LDI R26,LOW(66)
RCALL SUBOPT_0x8
; 0000 011D if(display) {
BREQ _0x44
; 0000 011E lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 011F lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 0120 }
; 0000 0121 counter++;
_0x44:
SUBI R17,-1
; 0000 0122 }
_0x43:
; 0000 0123 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 0124 }
; 0000 0125 if(KEYPAD_IN.3==0) {
_0x41:
SBIC 0x10,3
RJMP _0x45
; 0000 0126 if(limiter=='A') {
LDD R26,Y+5
CPI R26,LOW(0x41)
BRNE _0x46
; 0000 0127 selesai = 1;
RCALL SUBOPT_0x6
; 0000 0128 }
; 0000 0129 else {
RJMP _0x47
_0x46:
; 0000 012A dataKeypad[counter]='A';
RCALL SUBOPT_0x7
LDI R26,LOW(65)
RCALL SUBOPT_0x8
; 0000 012B if(display) {
BREQ _0x48
; 0000 012C lcd_gotoxy(counter+startX,startY);
RCALL SUBOPT_0x9
RCALL SUBOPT_0xA
; 0000 012D lcd_putchar(dataKeypad[counter]);
RCALL SUBOPT_0xB
; 0000 012E }
; 0000 012F counter++;
_0x48:
SUBI R17,-1
; 0000 0130 }
_0x47:
; 0000 0131 delay_ms(200);
RCALL SUBOPT_0xC
; 0000 0132 }
; 0000 0133 }
_0x45:
RJMP _0x6
_0x8:
; 0000 0134 }
LDD R17,Y+0
ADIW R28,6
POP R15
RET
;
;void menuSetting1() {
; 0000 0136 void menuSetting1() {
_menuSetting1:
PUSH R15
; 0000 0137 char jOn[3], dOn[3], jOff[3], dOff[3];
; 0000 0138 bit inputSalah = 0;
; 0000 0139 int i;
; 0000 013A lcd_clear();
RCALL SUBOPT_0xE
; jOn -> Y+11
; dOn -> Y+8
; jOff -> Y+5
; dOff -> Y+2
; inputSalah -> R15.0
; i -> R16,R17
; 0000 013B lcd_gotoxy(0,0);
; 0000 013C lcd_puts("Set Timer Beban1");
__POINTW1MN _0x49,0
RCALL SUBOPT_0xF
; 0000 013D delay_ms(1000);
RCALL SUBOPT_0x10
; 0000 013E
; 0000 013F for(i=0;i<3;i++) {
RCALL SUBOPT_0x1
_0x4B:
RCALL SUBOPT_0x11
BRGE _0x4C
; 0000 0140 jOn[i]=0;
RCALL SUBOPT_0x12
; 0000 0141 dOn[i]=0;
RCALL SUBOPT_0x13
; 0000 0142 jOff[i]=0;
RCALL SUBOPT_0x14
; 0000 0143 dOff[i]=0;
RCALL SUBOPT_0x15
; 0000 0144 }
RCALL SUBOPT_0x3
RJMP _0x4B
_0x4C:
; 0000 0145
; 0000 0146 lcd_clear();
RCALL SUBOPT_0x16
; 0000 0147 lcd_gotoxy(0,0);
; 0000 0148 lcd_puts("Set Timer On ");
__POINTW1MN _0x49,17
RCALL SUBOPT_0xF
; 0000 0149 scanKeypad('#',1,0,1);
RCALL SUBOPT_0x17
; 0000 014A jOn[0]=dataKeypad[0];
RCALL SUBOPT_0x18
; 0000 014B jOn[1]=dataKeypad[1];
; 0000 014C dOn[0]=dataKeypad[3];
; 0000 014D dOn[1]=dataKeypad[4];
; 0000 014E sscanf(jOn,"%d",&jamTimerOn[0]);
LDI R30,LOW(_jamTimerOn)
LDI R31,HIGH(_jamTimerOn)
RCALL SUBOPT_0x19
; 0000 014F sscanf(dOn,"%d",&menitTimerOn[0]);
RCALL SUBOPT_0x1A
LDI R30,LOW(_menitTimerOn)
LDI R31,HIGH(_menitTimerOn)
RCALL SUBOPT_0x19
; 0000 0150 // SIMPAN KE EEPROM
; 0000 0151 _jamTimerOn[0] = jamTimerOn[0];
LDS R30,_jamTimerOn
RCALL SUBOPT_0x1B
RCALL __EEPROMWRB
; 0000 0152 _menitTimerOn[0] = menitTimerOn[0];
LDS R30,_menitTimerOn
RCALL SUBOPT_0x1C
RCALL SUBOPT_0x1D
; 0000 0153
; 0000 0154 lcd_clear();
; 0000 0155 lcd_gotoxy(0,0);
; 0000 0156 lcd_puts("Set Timer Off ");
__POINTW1MN _0x49,34
RCALL SUBOPT_0xF
; 0000 0157 scanKeypad('#',1,0,1);
RCALL SUBOPT_0x17
; 0000 0158
; 0000 0159 jOff[0]=dataKeypad[0];
RCALL SUBOPT_0x1E
; 0000 015A jOff[1]=dataKeypad[1];
; 0000 015B dOff[0]=dataKeypad[3];
; 0000 015C dOff[1]=dataKeypad[4];
; 0000 015D
; 0000 015E sscanf(jOff,"%d",&jamTimerOff[0]);
LDI R30,LOW(_jamTimerOff)
LDI R31,HIGH(_jamTimerOff)
RCALL SUBOPT_0x19
; 0000 015F sscanf(dOff,"%d",&menitTimerOff[0]);
RCALL SUBOPT_0x1F
LDI R30,LOW(_menitTimerOff)
LDI R31,HIGH(_menitTimerOff)
RCALL SUBOPT_0x19
; 0000 0160
; 0000 0161 // SIMPAN KE EEPROM
; 0000 0162 _jamTimerOff[0] = jamTimerOff[0];
LDS R30,_jamTimerOff
RCALL SUBOPT_0x20
RCALL __EEPROMWRB
; 0000 0163 _menitTimerOff[0] = menitTimerOff[0];
LDS R30,_menitTimerOff
RCALL SUBOPT_0x21
RCALL SUBOPT_0x1D
; 0000 0164
; 0000 0165 lcd_clear();
; 0000 0166 lcd_gotoxy(0,0);
; 0000 0167 lcd_puts("Setting Finish ");
__POINTW1MN _0x49,51
RJMP _0x20C0008
; 0000 0168 delay_ms(1000);
; 0000 0169 }
.DSEG
_0x49:
.BYTE 0x44
;
;void menuSetting2() {
; 0000 016B void menuSetting2() {
.CSEG
_menuSetting2:
PUSH R15
; 0000 016C char jOn[3], dOn[3], jOff[3], dOff[3];
; 0000 016D bit inputSalah = 0;
; 0000 016E int i;
; 0000 016F lcd_clear();
RCALL SUBOPT_0xE
; jOn -> Y+11
; dOn -> Y+8
; jOff -> Y+5
; dOff -> Y+2
; inputSalah -> R15.0
; i -> R16,R17
; 0000 0170 lcd_gotoxy(0,0);
; 0000 0171 lcd_puts("Set Timer Beban2");
__POINTW1MN _0x4D,0
RCALL SUBOPT_0xF
; 0000 0172 delay_ms(1000);
RCALL SUBOPT_0x10
; 0000 0173
; 0000 0174 for(i=0;i<3;i++) {
RCALL SUBOPT_0x1
_0x4F:
RCALL SUBOPT_0x11
BRGE _0x50
; 0000 0175 jOn[i]=0;
RCALL SUBOPT_0x12
; 0000 0176 dOn[i]=0;
RCALL SUBOPT_0x13
; 0000 0177 jOff[i]=0;
RCALL SUBOPT_0x14
; 0000 0178 dOff[i]=0;
RCALL SUBOPT_0x15
; 0000 0179 }
RCALL SUBOPT_0x3
RJMP _0x4F
_0x50:
; 0000 017A
; 0000 017B lcd_clear();
RCALL SUBOPT_0x16
; 0000 017C lcd_gotoxy(0,0);
; 0000 017D lcd_puts("Set Timer On ");
__POINTW1MN _0x4D,17
RCALL SUBOPT_0xF
; 0000 017E scanKeypad('#',1,0,1);
RCALL SUBOPT_0x17
; 0000 017F jOn[0]=dataKeypad[0];
RCALL SUBOPT_0x18
; 0000 0180 jOn[1]=dataKeypad[1];
; 0000 0181 dOn[0]=dataKeypad[3];
; 0000 0182 dOn[1]=dataKeypad[4];
; 0000 0183 sscanf(jOn,"%d",&jamTimerOn[1]);
__POINTW1MN _jamTimerOn,1
RCALL SUBOPT_0x19
; 0000 0184 sscanf(dOn,"%d",&menitTimerOn[1]);
RCALL SUBOPT_0x1A
__POINTW1MN _menitTimerOn,1
RCALL SUBOPT_0x19
; 0000 0185
; 0000 0186 // SIMPAN KE EEPROM
; 0000 0187 _jamTimerOn[1] = jamTimerOn[1];
RCALL SUBOPT_0x22
__GETB1MN _jamTimerOn,1
RCALL __EEPROMWRB
; 0000 0188 _menitTimerOn[1] = menitTimerOn[1];
RCALL SUBOPT_0x23
__GETB1MN _menitTimerOn,1
RCALL SUBOPT_0x1D
; 0000 0189
; 0000 018A lcd_clear();
; 0000 018B lcd_gotoxy(0,0);
; 0000 018C lcd_puts("Set Timer Off ");
__POINTW1MN _0x4D,34
RCALL SUBOPT_0xF
; 0000 018D scanKeypad('#',1,0,1);
RCALL SUBOPT_0x17
; 0000 018E
; 0000 018F jOff[0]=dataKeypad[0];
RCALL SUBOPT_0x1E
; 0000 0190 jOff[1]=dataKeypad[1];
; 0000 0191 dOff[0]=dataKeypad[3];
; 0000 0192 dOff[1]=dataKeypad[4];
; 0000 0193
; 0000 0194 sscanf(jOff,"%d",&jamTimerOff[1]);
__POINTW1MN _jamTimerOff,1
RCALL SUBOPT_0x19
; 0000 0195 sscanf(dOff,"%d",&menitTimerOff[1]);
RCALL SUBOPT_0x1F
__POINTW1MN _menitTimerOff,1
RCALL SUBOPT_0x19
; 0000 0196
; 0000 0197 // SIMPAN KE EEPROM
; 0000 0198 _jamTimerOff[1] = jamTimerOff[1];
RCALL SUBOPT_0x24
__GETB1MN _jamTimerOff,1
RCALL __EEPROMWRB
; 0000 0199 _menitTimerOff[1] = menitTimerOff[1];
RCALL SUBOPT_0x25
__GETB1MN _menitTimerOff,1
RCALL SUBOPT_0x1D
; 0000 019A
; 0000 019B lcd_clear();
; 0000 019C lcd_gotoxy(0,0);
; 0000 019D lcd_puts("Setting Finish ");
__POINTW1MN _0x4D,51
RJMP _0x20C0008
; 0000 019E delay_ms(1000);
; 0000 019F }
.DSEG
_0x4D:
.BYTE 0x44
;
;void menuSetting3() {
; 0000 01A1 void menuSetting3() {
.CSEG
_menuSetting3:
PUSH R15
; 0000 01A2 char jOn[3], dOn[3], jOff[3], dOff[3];
; 0000 01A3 bit inputSalah = 0;
; 0000 01A4 int i;
; 0000 01A5 lcd_clear();
RCALL SUBOPT_0xE
; jOn -> Y+11
; dOn -> Y+8
; jOff -> Y+5
; dOff -> Y+2
; inputSalah -> R15.0
; i -> R16,R17
; 0000 01A6 lcd_gotoxy(0,0);
; 0000 01A7 lcd_puts("Set Timer Beban3");
__POINTW1MN _0x51,0
RCALL SUBOPT_0xF
; 0000 01A8 delay_ms(1000);
RCALL SUBOPT_0x10
; 0000 01A9
; 0000 01AA for(i=0;i<3;i++) {
RCALL SUBOPT_0x1
_0x53:
RCALL SUBOPT_0x11
BRGE _0x54
; 0000 01AB jOn[i]=0;
RCALL SUBOPT_0x12
; 0000 01AC dOn[i]=0;
RCALL SUBOPT_0x13
; 0000 01AD jOff[i]=0;
RCALL SUBOPT_0x14
; 0000 01AE dOff[i]=0;
RCALL SUBOPT_0x15
; 0000 01AF }
RCALL SUBOPT_0x3
RJMP _0x53
_0x54:
; 0000 01B0
; 0000 01B1 lcd_clear();
RCALL SUBOPT_0x16
; 0000 01B2 lcd_gotoxy(0,0);
; 0000 01B3 lcd_puts("Set Timer On ");
__POINTW1MN _0x51,17
RCALL SUBOPT_0xF
; 0000 01B4 scanKeypad('#',1,0,1);
RCALL SUBOPT_0x17
; 0000 01B5 jOn[0]=dataKeypad[0];
RCALL SUBOPT_0x18
; 0000 01B6 jOn[1]=dataKeypad[1];
; 0000 01B7 dOn[0]=dataKeypad[3];
; 0000 01B8 dOn[1]=dataKeypad[4];
; 0000 01B9 sscanf(jOn,"%d",&jamTimerOn[2]);
__POINTW1MN _jamTimerOn,2
RCALL SUBOPT_0x19
; 0000 01BA sscanf(dOn,"%d",&menitTimerOn[2]);
RCALL SUBOPT_0x1A
__POINTW1MN _menitTimerOn,2
RCALL SUBOPT_0x19
; 0000 01BB
; 0000 01BC // SIMPAN KE EEPROM
; 0000 01BD _jamTimerOn[2] = jamTimerOn[2];
RCALL SUBOPT_0x26
__GETB1MN _jamTimerOn,2
RCALL __EEPROMWRB
; 0000 01BE _menitTimerOn[2] = menitTimerOn[2];
RCALL SUBOPT_0x27
__GETB1MN _menitTimerOn,2
RCALL SUBOPT_0x1D
; 0000 01BF lcd_clear();
; 0000 01C0 lcd_gotoxy(0,0);
; 0000 01C1 lcd_puts("Set Timer Off ");
__POINTW1MN _0x51,34
RCALL SUBOPT_0xF
; 0000 01C2 scanKeypad('#',1,0,1);
RCALL SUBOPT_0x17
; 0000 01C3
; 0000 01C4 jOff[0]=dataKeypad[0];
RCALL SUBOPT_0x1E
; 0000 01C5 jOff[1]=dataKeypad[1];
; 0000 01C6 dOff[0]=dataKeypad[3];
; 0000 01C7 dOff[1]=dataKeypad[4];
; 0000 01C8
; 0000 01C9 sscanf(jOff,"%d",&jamTimerOff[2]);
__POINTW1MN _jamTimerOff,2
RCALL SUBOPT_0x19
; 0000 01CA sscanf(dOff,"%d",&menitTimerOff[2]);
RCALL SUBOPT_0x1F
__POINTW1MN _menitTimerOff,2
RCALL SUBOPT_0x19
; 0000 01CB
; 0000 01CC // SIMPAN KE EEPROM
; 0000 01CD _jamTimerOff[2] = jamTimerOff[2];
RCALL SUBOPT_0x28
__GETB1MN _jamTimerOff,2
RCALL __EEPROMWRB
; 0000 01CE _menitTimerOff[2] = menitTimerOff[2];
RCALL SUBOPT_0x29
__GETB1MN _menitTimerOff,2
RCALL SUBOPT_0x1D
; 0000 01CF
; 0000 01D0 lcd_clear();
; 0000 01D1 lcd_gotoxy(0,0);
; 0000 01D2 lcd_puts("Setting Finish ");
__POINTW1MN _0x51,51
RJMP _0x20C0008
; 0000 01D3 delay_ms(1000);
; 0000 01D4 }
.DSEG
_0x51:
.BYTE 0x44
;
;void menuSetting4() {
; 0000 01D6 void menuSetting4() {
.CSEG
_menuSetting4:
PUSH R15
; 0000 01D7 char jOn[3], dOn[3], jOff[3], dOff[3];
; 0000 01D8 bit inputSalah = 0;
; 0000 01D9 int i;
; 0000 01DA lcd_clear();
RCALL SUBOPT_0xE
; jOn -> Y+11
; dOn -> Y+8
; jOff -> Y+5
; dOff -> Y+2
; inputSalah -> R15.0
; i -> R16,R17
; 0000 01DB lcd_gotoxy(0,0);
; 0000 01DC lcd_puts("Set Timer Beban4");
__POINTW1MN _0x55,0
RCALL SUBOPT_0xF
; 0000 01DD delay_ms(1000);
RCALL SUBOPT_0x10
; 0000 01DE
; 0000 01DF for(i=0;i<3;i++) {
RCALL SUBOPT_0x1
_0x57:
RCALL SUBOPT_0x11
BRGE _0x58
; 0000 01E0 jOn[i]=0;
RCALL SUBOPT_0x12
; 0000 01E1 dOn[i]=0;
RCALL SUBOPT_0x13
; 0000 01E2 jOff[i]=0;
RCALL SUBOPT_0x14
; 0000 01E3 dOff[i]=0;
RCALL SUBOPT_0x15
; 0000 01E4 }
RCALL SUBOPT_0x3
RJMP _0x57
_0x58:
; 0000 01E5
; 0000 01E6 lcd_clear();
RCALL SUBOPT_0x16
; 0000 01E7 lcd_gotoxy(0,0);
; 0000 01E8 lcd_puts("Set Timer On ");
__POINTW1MN _0x55,17
RCALL SUBOPT_0xF
; 0000 01E9 scanKeypad('#',1,0,1);
RCALL SUBOPT_0x17
; 0000 01EA jOn[0]=dataKeypad[0];
RCALL SUBOPT_0x18
; 0000 01EB jOn[1]=dataKeypad[1];
; 0000 01EC dOn[0]=dataKeypad[3];
; 0000 01ED dOn[1]=dataKeypad[4];
; 0000 01EE sscanf(jOn,"%d",&jamTimerOn[3]);
__POINTW1MN _jamTimerOn,3
RCALL SUBOPT_0x19
; 0000 01EF sscanf(dOn,"%d",&menitTimerOn[3]);
RCALL SUBOPT_0x1A
__POINTW1MN _menitTimerOn,3
RCALL SUBOPT_0x19
; 0000 01F0
; 0000 01F1 // SIMPAN KE EEPROM
; 0000 01F2 _jamTimerOn[3] = jamTimerOn[3];
RCALL SUBOPT_0x2A
__GETB1MN _jamTimerOn,3
RCALL __EEPROMWRB
; 0000 01F3 _menitTimerOn[3] = menitTimerOn[3];
RCALL SUBOPT_0x2B
__GETB1MN _menitTimerOn,3
RCALL SUBOPT_0x1D
; 0000 01F4
; 0000 01F5 lcd_clear();
; 0000 01F6 lcd_gotoxy(0,0);
; 0000 01F7 lcd_puts("Set Timer Off ");
__POINTW1MN _0x55,34
RCALL SUBOPT_0xF
; 0000 01F8 scanKeypad('#',1,0,1);
RCALL SUBOPT_0x17
; 0000 01F9
; 0000 01FA jOff[0]=dataKeypad[0];
RCALL SUBOPT_0x1E
; 0000 01FB jOff[1]=dataKeypad[1];
; 0000 01FC dOff[0]=dataKeypad[3];
; 0000 01FD dOff[1]=dataKeypad[4];
; 0000 01FE
; 0000 01FF sscanf(jOff,"%d",&jamTimerOff[3]);
__POINTW1MN _jamTimerOff,3
RCALL SUBOPT_0x19
; 0000 0200 sscanf(dOff,"%d",&menitTimerOff[3]);
RCALL SUBOPT_0x1F
__POINTW1MN _menitTimerOff,3
RCALL SUBOPT_0x19
; 0000 0201
; 0000 0202 // SIMPAN KE EEPROM
; 0000 0203 _jamTimerOff[3] = jamTimerOff[3];
RCALL SUBOPT_0x2C
__GETB1MN _jamTimerOff,3
RCALL __EEPROMWRB
; 0000 0204 _menitTimerOff[3] = menitTimerOff[3];
RCALL SUBOPT_0x2D
__GETB1MN _menitTimerOff,3
RCALL SUBOPT_0x1D
; 0000 0205
; 0000 0206 lcd_clear();
; 0000 0207 lcd_gotoxy(0,0);
; 0000 0208 lcd_puts("Setting Finish ");
__POINTW1MN _0x55,51
_0x20C0008:
ST -Y,R31
ST -Y,R30
RCALL _lcd_puts
; 0000 0209 delay_ms(1000);
RCALL SUBOPT_0x10
; 0000 020A }
RCALL __LOADLOCR2
ADIW R28,14
POP R15
RET
.DSEG
_0x55:
.BYTE 0x44
;
;void main(void)
; 0000 020D {
.CSEG
_main:
; 0000 020E // Declare your local variables here
; 0000 020F
; 0000 0210 // Input/Output Ports initialization
; 0000 0211 // Port A initialization
; 0000 0212 // Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
; 0000 0213 // State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
; 0000 0214 PORTA=0x00;
LDI R30,LOW(0)
OUT 0x1B,R30
; 0000 0215 DDRA=0x00;
OUT 0x1A,R30
; 0000 0216
; 0000 0217 // Port B initialization
; 0000 0218 // Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
; 0000 0219 // State7=T State6=T State5=T State4=T State3=P State2=P State1=P State0=P
; 0000 021A PORTB=0x0F;
LDI R30,LOW(15)
OUT 0x18,R30
; 0000 021B DDRB=0x00;
LDI R30,LOW(0)
OUT 0x17,R30
; 0000 021C
; 0000 021D // Port C initialization
; 0000 021E // Func7=Out Func6=Out Func5=Out Func4=Out Func3=In Func2=In Func1=In Func0=In
; 0000 021F // State7=1 State6=1 State5=1 State4=1 State3=T State2=T State1=T State0=T
; 0000 0220 PORTC=0xF0;
LDI R30,LOW(240)
OUT 0x15,R30
; 0000 0221 DDRC=0xF0;
OUT 0x14,R30
; 0000 0222
; 0000 0223 // Port D initialization
; 0000 0224 // Func7=In Func6=In Func5=In Func4=In Func3=Out Func2=Out Func1=Out Func0=Out
; 0000 0225 // State7=P State6=P State5=P State4=P State3=0 State2=0 State1=0 State0=0
; 0000 0226 PORTD=0xFF;
LDI R30,LOW(255)
OUT 0x12,R30
; 0000 0227 DDRD=0xF0;
LDI R30,LOW(240)
OUT 0x11,R30
; 0000 0228
; 0000 0229 // Timer/Counter 0 initialization
; 0000 022A // Clock source: System Clock
; 0000 022B // Clock value: Timer 0 Stopped
; 0000 022C // Mode: Normal top=0xFF
; 0000 022D // OC0 output: Disconnected
; 0000 022E TCCR0=0x00;
LDI R30,LOW(0)
OUT 0x33,R30
; 0000 022F TCNT0=0x00;
OUT 0x32,R30
; 0000 0230 OCR0=0x00;
OUT 0x3C,R30
; 0000 0231
; 0000 0232 // Timer/Counter 1 initialization
; 0000 0233 // Clock source: System Clock
; 0000 0234 // Clock value: Timer1 Stopped
; 0000 0235 // Mode: Normal top=0xFFFF
; 0000 0236 // OC1A output: Discon.
; 0000 0237 // OC1B output: Discon.
; 0000 0238 // Noise Canceler: Off
; 0000 0239 // Input Capture on Falling Edge
; 0000 023A // Timer1 Overflow Interrupt: Off
; 0000 023B // Input Capture Interrupt: Off
; 0000 023C // Compare A Match Interrupt: Off
; 0000 023D // Compare B Match Interrupt: Off
; 0000 023E TCCR1A=0x00;
OUT 0x2F,R30
; 0000 023F TCCR1B=0x00;
OUT 0x2E,R30
; 0000 0240 TCNT1H=0x00;
OUT 0x2D,R30
; 0000 0241 TCNT1L=0x00;
OUT 0x2C,R30
; 0000 0242 ICR1H=0x00;
OUT 0x27,R30
; 0000 0243 ICR1L=0x00;
OUT 0x26,R30
; 0000 0244 OCR1AH=0x00;
OUT 0x2B,R30
; 0000 0245 OCR1AL=0x00;
OUT 0x2A,R30
; 0000 0246 OCR1BH=0x00;
OUT 0x29,R30
; 0000 0247 OCR1BL=0x00;
OUT 0x28,R30
; 0000 0248
; 0000 0249 // Timer/Counter 2 initialization
; 0000 024A // Clock source: System Clock
; 0000 024B // Clock value: Timer2 Stopped
; 0000 024C // Mode: Normal top=0xFF
; 0000 024D // OC2 output: Disconnected
; 0000 024E ASSR=0x00;
OUT 0x22,R30
; 0000 024F TCCR2=0x00;
OUT 0x25,R30
; 0000 0250 TCNT2=0x00;
OUT 0x24,R30
; 0000 0251 OCR2=0x00;
OUT 0x23,R30
; 0000 0252
; 0000 0253 // External Interrupt(s) initialization
; 0000 0254 // INT0: Off
; 0000 0255 // INT1: Off
; 0000 0256 // INT2: Off
; 0000 0257 MCUCR=0x00;
OUT 0x35,R30
; 0000 0258 MCUCSR=0x00;
OUT 0x34,R30
; 0000 0259
; 0000 025A // Timer(s)/Counter(s) Interrupt(s) initialization
; 0000 025B TIMSK=0x00;
OUT 0x39,R30
; 0000 025C
; 0000 025D // USART initialization
; 0000 025E // USART disabled
; 0000 025F UCSRB=0x00;
OUT 0xA,R30
; 0000 0260
; 0000 0261 // Analog Comparator initialization
; 0000 0262 // Analog Comparator: Off
; 0000 0263 // Analog Comparator Input Capture by Timer/Counter 1: Off
; 0000 0264 ACSR=0x80;
LDI R30,LOW(128)
OUT 0x8,R30
; 0000 0265 SFIOR=0x00;
LDI R30,LOW(0)
OUT 0x30,R30
; 0000 0266
; 0000 0267 // ADC initialization
; 0000 0268 // ADC disabled
; 0000 0269 ADCSRA=0x00;
OUT 0x6,R30
; 0000 026A
; 0000 026B // SPI initialization
; 0000 026C // SPI disabled
; 0000 026D SPCR=0x00;
OUT 0xD,R30
; 0000 026E
; 0000 026F // TWI initialization
; 0000 0270 // TWI disabled
; 0000 0271 TWCR=0x00;
OUT 0x36,R30
; 0000 0272
; 0000 0273 // I2C Bus initialization
; 0000 0274 i2c_init();
RCALL _i2c_init
; 0000 0275
; 0000 0276 // DS1307 Real Time Clock initialization
; 0000 0277 // Square wave output on pin SQW/OUT: Off
; 0000 0278 // SQW/OUT pin state: 0
; 0000 0279 rtc_init(0,0,0);
RCALL SUBOPT_0x2E
RCALL SUBOPT_0x2E
RCALL SUBOPT_0x2E
RCALL _rtc_init
; 0000 027A
; 0000 027B // Alphanumeric LCD initialization
; 0000 027C // Connections specified in the
; 0000 027D // Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
; 0000 027E // RS - PORTA Bit 0
; 0000 027F // RD - PORTA Bit 1
; 0000 0280 // EN - PORTA Bit 2
; 0000 0281 // D4 - PORTA Bit 4
; 0000 0282 // D5 - PORTA Bit 5
; 0000 0283 // D6 - PORTA Bit 6
; 0000 0284 // D7 - PORTA Bit 7
; 0000 0285 // Characters/line: 16
; 0000 0286 lcd_init(16);
LDI R30,LOW(16)
ST -Y,R30
RCALL _lcd_init
; 0000 0287 lcd_clear();
RCALL SUBOPT_0x16
; 0000 0288 lcd_gotoxy(0,0);
; 0000 0289
; 0000 028A // UNCOMMENT BARIS INI JIKA INGIN SETTING RTC
; 0000 028B //rtc_set_time(21,27,0);
; 0000 028C //rtc_set_date(3,22,3,13);
; 0000 028D
; 0000 028E
; 0000 028F // MATIKAN SEMUA RELAY
; 0000 0290 BEBAN1=0;
CBI 0x15,4
; 0000 0291 BEBAN2=0;
CBI 0x15,5
; 0000 0292 BEBAN3=0;
CBI 0x15,6
; 0000 0293 BEBAN4=0;
CBI 0x15,7
; 0000 0294
; 0000 0295 // AMBIL DATA DARI EEPROM
; 0000 0296 jamTimerOn[0] = _jamTimerOn[0];
RCALL SUBOPT_0x2F
; 0000 0297 menitTimerOn[0] = _menitTimerOn[0];
; 0000 0298 jamTimerOff[0] = _jamTimerOff[0];
; 0000 0299 menitTimerOff[0] = _menitTimerOff[0];
; 0000 029A jamTimerOn[1] = _jamTimerOn[1];
RCALL SUBOPT_0x22
RCALL SUBOPT_0x30
; 0000 029B menitTimerOn[1] = _menitTimerOn[1];
RCALL SUBOPT_0x31
; 0000 029C jamTimerOff[1] = _jamTimerOff[1];
RCALL SUBOPT_0x32
; 0000 029D menitTimerOff[1] = _menitTimerOff[1];
RCALL SUBOPT_0x33
; 0000 029E jamTimerOn[2] = _jamTimerOn[2];
RCALL SUBOPT_0x26
RCALL SUBOPT_0x34
; 0000 029F menitTimerOn[2] = _menitTimerOn[2];
RCALL SUBOPT_0x35
; 0000 02A0 jamTimerOff[2] = _jamTimerOff[2];
RCALL SUBOPT_0x36
; 0000 02A1 menitTimerOff[2] = _menitTimerOff[2];
RCALL SUBOPT_0x37
; 0000 02A2 jamTimerOn[3] = _jamTimerOn[3];
RCALL SUBOPT_0x2A
RCALL SUBOPT_0x38
; 0000 02A3 menitTimerOn[3] = _menitTimerOn[3];
RCALL SUBOPT_0x39
; 0000 02A4 jamTimerOff[3] = _jamTimerOff[3];
RCALL SUBOPT_0x3A
; 0000 02A5 menitTimerOff[3] = _menitTimerOff[3];
RCALL SUBOPT_0x3B
; 0000 02A6
; 0000 02A7 while (1) {
_0x61:
; 0000 02A8 char key = 0;
; 0000 02A9 KEYPAD_OUT=0b11101111;
SBIW R28,1
LDI R30,LOW(0)
ST Y,R30
; key -> Y+0
LDI R30,LOW(239)
RCALL SUBOPT_0x5
; 0000 02AA delay_ms(30);
; 0000 02AB if(KEYPAD_IN.0==0) {
SBIC 0x10,0
RJMP _0x64
; 0000 02AC // AMBIL DATA DARI EEPROM
; 0000 02AD jamTimerOn[3] = _jamTimerOn[3];
RCALL SUBOPT_0x2A
RCALL SUBOPT_0x38
; 0000 02AE menitTimerOn[3] = _menitTimerOn[3];
RCALL SUBOPT_0x39
; 0000 02AF jamTimerOff[3] = _jamTimerOff[3];
RCALL SUBOPT_0x3A
; 0000 02B0 menitTimerOff[3] = _menitTimerOff[3];
RCALL SUBOPT_0x3B
; 0000 02B1 sprintf(bufferLcd1,"T4 On > %2d:%2d ",jamTimerOn[3],menitTimerOn[3]);
RCALL SUBOPT_0x3C
__POINTW1FN _0x0,122
RCALL SUBOPT_0x0
__GETB1MN _jamTimerOn,3
RCALL SUBOPT_0x3D
__GETB1MN _menitTimerOn,3
RCALL SUBOPT_0x3D
RCALL SUBOPT_0x3E
; 0000 02B2 sprintf(bufferLcd2,"T4 Off > %2d:%2d ",jamTimerOff[3],menitTimerOff[3]);
__POINTW1FN _0x0,140
RCALL SUBOPT_0x0
__GETB1MN _jamTimerOff,3
RCALL SUBOPT_0x3D
__GETB1MN _menitTimerOff,3
RJMP _0xA0
; 0000 02B3 lcd_clear();
; 0000 02B4 lcd_gotoxy(0,0);
; 0000 02B5 lcd_puts(bufferLcd1);
; 0000 02B6 lcd_gotoxy(0,1);
; 0000 02B7 lcd_puts(bufferLcd2);
; 0000 02B8 delay_ms(2000);
; 0000 02B9 }
; 0000 02BA else if(KEYPAD_IN.1==0) {
_0x64:
SBIC 0x10,1
RJMP _0x66
; 0000 02BB // AMBIL DATA DARI EEPROM
; 0000 02BC jamTimerOn[2] = _jamTimerOn[2];
RCALL SUBOPT_0x26
RCALL SUBOPT_0x34
; 0000 02BD menitTimerOn[2] = _menitTimerOn[2];
RCALL SUBOPT_0x35
; 0000 02BE jamTimerOff[2] = _jamTimerOff[2];
RCALL SUBOPT_0x36
; 0000 02BF menitTimerOff[2] = _menitTimerOff[2];
RCALL SUBOPT_0x37
; 0000 02C0 sprintf(bufferLcd1,"T3 On > %2d:%2d ",jamTimerOn[2],menitTimerOn[2]);
RCALL SUBOPT_0x3C
__POINTW1FN _0x0,158
RCALL SUBOPT_0x0
__GETB1MN _jamTimerOn,2
RCALL SUBOPT_0x3D
__GETB1MN _menitTimerOn,2
RCALL SUBOPT_0x3D
RCALL SUBOPT_0x3E
; 0000 02C1 sprintf(bufferLcd2,"T3 Off > %2d:%2d ",jamTimerOff[2],menitTimerOff[2]);
__POINTW1FN _0x0,176
RCALL SUBOPT_0x0
__GETB1MN _jamTimerOff,2
RCALL SUBOPT_0x3D
__GETB1MN _menitTimerOff,2
RJMP _0xA0
; 0000 02C2 lcd_clear();
; 0000 02C3 lcd_gotoxy(0,0);
; 0000 02C4 lcd_puts(bufferLcd1);
; 0000 02C5 lcd_gotoxy(0,1);
; 0000 02C6 lcd_puts(bufferLcd2);
; 0000 02C7 delay_ms(2000);
; 0000 02C8 }
; 0000 02C9 else if(KEYPAD_IN.2==0) {
_0x66:
SBIC 0x10,2
RJMP _0x68
; 0000 02CA // AMBIL DATA DARI EEPROM
; 0000 02CB jamTimerOn[1] = _jamTimerOn[1];
RCALL SUBOPT_0x22
RCALL SUBOPT_0x30
; 0000 02CC menitTimerOn[1] = _menitTimerOn[1];
RCALL SUBOPT_0x31
; 0000 02CD jamTimerOff[1] = _jamTimerOff[1];
RCALL SUBOPT_0x32
; 0000 02CE menitTimerOff[1] = _menitTimerOff[1];
RCALL SUBOPT_0x33
; 0000 02CF sprintf(bufferLcd1,"T2 On > %2d:%2d ",jamTimerOn[1],menitTimerOn[1]);
RCALL SUBOPT_0x3C
__POINTW1FN _0x0,194
RCALL SUBOPT_0x0
__GETB1MN _jamTimerOn,1
RCALL SUBOPT_0x3D
__GETB1MN _menitTimerOn,1
RCALL SUBOPT_0x3D
RCALL SUBOPT_0x3E
; 0000 02D0 sprintf(bufferLcd2,"T2 Off > %2d:%2d ",jamTimerOff[1],menitTimerOff[1]);
__POINTW1FN _0x0,212
RCALL SUBOPT_0x0
__GETB1MN _jamTimerOff,1
RCALL SUBOPT_0x3D
__GETB1MN _menitTimerOff,1
RJMP _0xA0
; 0000 02D1 lcd_clear();
; 0000 02D2 lcd_gotoxy(0,0);
; 0000 02D3 lcd_puts(bufferLcd1);
; 0000 02D4 lcd_gotoxy(0,1);
; 0000 02D5 lcd_puts(bufferLcd2);
; 0000 02D6 delay_ms(2000);
; 0000 02D7 }
; 0000 02D8 else if(KEYPAD_IN.3==0) {
_0x68:
SBIC 0x10,3
RJMP _0x6A
; 0000 02D9 // AMBIL DATA DARI EEPROM
; 0000 02DA jamTimerOn[0] = _jamTimerOn[0];
RCALL SUBOPT_0x2F
; 0000 02DB menitTimerOn[0] = _menitTimerOn[0];
; 0000 02DC jamTimerOff[0] = _jamTimerOff[0];
; 0000 02DD menitTimerOff[0] = _menitTimerOff[0];
; 0000 02DE sprintf(bufferLcd1,"T1 On > %2d:%2d ",jamTimerOn[0],menitTimerOn[0]);
RCALL SUBOPT_0x3C
__POINTW1FN _0x0,230
RCALL SUBOPT_0x0
LDS R30,_jamTimerOn
RCALL SUBOPT_0x3D
LDS R30,_menitTimerOn
RCALL SUBOPT_0x3D
RCALL SUBOPT_0x3E
; 0000 02DF sprintf(bufferLcd2,"T1 Off > %2d:%2d ",jamTimerOff[0],menitTimerOff[0]);
__POINTW1FN _0x0,248
RCALL SUBOPT_0x0
LDS R30,_jamTimerOff
RCALL SUBOPT_0x3D
LDS R30,_menitTimerOff
_0xA0:
CLR R31
CLR R22
CLR R23
RCALL __PUTPARD1
LDI R24,8
RCALL _sprintf
ADIW R28,12
; 0000 02E0 lcd_clear();
RCALL SUBOPT_0x16
; 0000 02E1 lcd_gotoxy(0,0);
; 0000 02E2 lcd_puts(bufferLcd1);
LDI R30,LOW(_bufferLcd1)
LDI R31,HIGH(_bufferLcd1)
RCALL SUBOPT_0xF
; 0000 02E3 lcd_gotoxy(0,1);
RCALL SUBOPT_0x2E
RCALL SUBOPT_0x3F
; 0000 02E4 lcd_puts(bufferLcd2);
; 0000 02E5 delay_ms(2000);
LDI R30,LOW(2000)
LDI R31,HIGH(2000)
RCALL SUBOPT_0xD
; 0000 02E6 }
; 0000 02E7 if(!SW_BEBAN1) {
_0x6A:
SBIC 0x16,0
RJMP _0x6B
; 0000 02E8 menuSetting1();
RCALL _menuSetting1
; 0000 02E9 }
; 0000 02EA else if(!SW_BEBAN2) {
RJMP _0x6C
_0x6B:
SBIC 0x16,1
RJMP _0x6D
; 0000 02EB menuSetting2();
RCALL _menuSetting2
; 0000 02EC }
; 0000 02ED else if(!SW_BEBAN3) {
RJMP _0x6E
_0x6D:
SBIC 0x16,2
RJMP _0x6F
; 0000 02EE menuSetting3();
RCALL _menuSetting3
; 0000 02EF }
; 0000 02F0 else if(!SW_BEBAN4) {
RJMP _0x70
_0x6F:
SBIC 0x16,3
RJMP _0x71
; 0000 02F1 menuSetting4();
RCALL _menuSetting4
; 0000 02F2 }
; 0000 02F3 else{
RJMP _0x72
_0x71:
; 0000 02F4 lcd_clear();
RCALL _lcd_clear
; 0000 02F5 bacaRTC();
RCALL _bacaRTC
; 0000 02F6 sprintf(bufferLcd1,"Jam => %2d:%2d:%2d ",jam,menit,detik);
RCALL SUBOPT_0x3C
__POINTW1FN _0x0,266
RCALL SUBOPT_0x0
MOV R30,R5
RCALL SUBOPT_0x3D
MOV R30,R4
RCALL SUBOPT_0x3D
MOV R30,R7
RCALL SUBOPT_0x3D
RCALL SUBOPT_0x40
; 0000 02F7 lcd_gotoxy(0,0);
RCALL SUBOPT_0x2E
RCALL _lcd_gotoxy
; 0000 02F8 lcd_puts(bufferLcd1);
LDI R30,LOW(_bufferLcd1)
LDI R31,HIGH(_bufferLcd1)
RCALL SUBOPT_0xF
; 0000 02F9 sprintf(bufferLcd2,"Tgl => %2d/%2d/%2d ",tanggal,bulan,tahun);
LDI R30,LOW(_bufferLcd2)
LDI R31,HIGH(_bufferLcd2)
RCALL SUBOPT_0x0
__POINTW1FN _0x0,286
RCALL SUBOPT_0x0
MOV R30,R9
RCALL SUBOPT_0x3D
MOV R30,R8
RCALL SUBOPT_0x3D
MOV R30,R11
RCALL SUBOPT_0x3D
RCALL SUBOPT_0x40
; 0000 02FA lcd_gotoxy(0,1);
RCALL SUBOPT_0x3F
; 0000 02FB lcd_puts(bufferLcd2);
; 0000 02FC
; 0000 02FD // AMBIL DATA DARI EEPROM
; 0000 02FE jamTimerOn[0] = _jamTimerOn[0];
RCALL SUBOPT_0x2F
; 0000 02FF menitTimerOn[0] = _menitTimerOn[0];
; 0000 0300 jamTimerOff[0] = _jamTimerOff[0];
; 0000 0301 menitTimerOff[0] = _menitTimerOff[0];
; 0000 0302
; 0000 0303 if(jam==jamTimerOn[0]&&menit==menitTimerOn[0]) {
LDS R30,_jamTimerOn
CP R30,R5
BRNE _0x74
LDS R30,_menitTimerOn
CP R30,R4
BREQ _0x75
_0x74:
RJMP _0x73
_0x75:
; 0000 0304 BEBAN1 = 1;
SBI 0x15,4
; 0000 0305 }
; 0000 0306 else if(jam==jamTimerOff[0]&&menit==menitTimerOff[0]) {
RJMP _0x78
_0x73:
LDS R30,_jamTimerOff
CP R30,R5
BRNE _0x7A
LDS R30,_menitTimerOff
CP R30,R4
BREQ _0x7B
_0x7A:
RJMP _0x79
_0x7B:
; 0000 0307 BEBAN1 = 0;
CBI 0x15,4
; 0000 0308 }
; 0000 0309
; 0000 030A // AMBIL DATA DARI EEPROM
; 0000 030B jamTimerOn[1] = _jamTimerOn[1];
_0x79:
_0x78:
RCALL SUBOPT_0x22
RCALL SUBOPT_0x30
; 0000 030C menitTimerOn[1] = _menitTimerOn[1];
RCALL SUBOPT_0x31
; 0000 030D jamTimerOff[1] = _jamTimerOff[1];
RCALL SUBOPT_0x32
; 0000 030E menitTimerOff[1] = _menitTimerOff[1];
RCALL SUBOPT_0x33
; 0000 030F
; 0000 0310 if(jam==jamTimerOn[1]&&menit==menitTimerOn[1]) {
__GETB1MN _jamTimerOn,1
CP R30,R5
BRNE _0x7F
__GETB1MN _menitTimerOn,1
CP R30,R4
BREQ _0x80
_0x7F:
RJMP _0x7E
_0x80:
; 0000 0311 BEBAN2 = 1;
SBI 0x15,5
; 0000 0312 }
; 0000 0313 else if(jam==jamTimerOff[1]&&menit==menitTimerOff[1]){
RJMP _0x83
_0x7E:
__GETB1MN _jamTimerOff,1
CP R30,R5
BRNE _0x85
__GETB1MN _menitTimerOff,1
CP R30,R4
BREQ _0x86
_0x85:
RJMP _0x84
_0x86:
; 0000 0314 BEBAN2 = 0;
CBI 0x15,5
; 0000 0315 }
; 0000 0316
; 0000 0317 // AMBIL DATA DARI EEPROM
; 0000 0318 jamTimerOn[2] = _jamTimerOn[2];
_0x84:
_0x83:
RCALL SUBOPT_0x26
RCALL SUBOPT_0x34
; 0000 0319 menitTimerOn[2] = _menitTimerOn[2];
RCALL SUBOPT_0x35
; 0000 031A jamTimerOff[2] = _jamTimerOff[2];
RCALL SUBOPT_0x36
; 0000 031B menitTimerOff[2] = _menitTimerOff[2];
RCALL SUBOPT_0x37
; 0000 031C if(jam==jamTimerOn[2]&&menit==_menitTimerOn[2]) {
__GETB1MN _jamTimerOn,2
CP R30,R5
BRNE _0x8A
RCALL SUBOPT_0x27
RCALL __EEPROMRDB
CP R30,R4
BREQ _0x8B
_0x8A:
RJMP _0x89
_0x8B:
; 0000 031D BEBAN3 = 1;
SBI 0x15,6
; 0000 031E }
; 0000 031F else if(jam==jamTimerOff[2]&&menit==_menitTimerOff[2]){
RJMP _0x8E
_0x89:
__GETB1MN _jamTimerOff,2
CP R30,R5
BRNE _0x90
RCALL SUBOPT_0x29
RCALL __EEPROMRDB
CP R30,R4
BREQ _0x91
_0x90:
RJMP _0x8F
_0x91:
; 0000 0320 BEBAN3 = 0;
CBI 0x15,6
; 0000 0321 }
; 0000 0322
; 0000 0323 // AMBIL DATA DARI EEPROM
; 0000 0324 jamTimerOn[3] = _jamTimerOn[3];
_0x8F:
_0x8E:
RCALL SUBOPT_0x2A
RCALL SUBOPT_0x38
; 0000 0325 menitTimerOn[3] = _menitTimerOn[3];
RCALL SUBOPT_0x39
; 0000 0326 jamTimerOff[3] = _jamTimerOff[3];
RCALL SUBOPT_0x3A
; 0000 0327 menitTimerOff[3] = _menitTimerOff[3];
RCALL SUBOPT_0x3B
; 0000 0328
; 0000 0329 if(jam==jamTimerOn[3]&&menit==menitTimerOn[3]) {
__GETB1MN _jamTimerOn,3
CP R30,R5
BRNE _0x95
__GETB1MN _menitTimerOn,3
CP R30,R4
BREQ _0x96
_0x95:
RJMP _0x94
_0x96:
; 0000 032A BEBAN4 = 1;
SBI 0x15,7
; 0000 032B }
; 0000 032C else if(jam==jamTimerOff[3]&&menit==menitTimerOff[3]) {
RJMP _0x99
_0x94:
__GETB1MN _jamTimerOff,3
CP R30,R5
BRNE _0x9B
__GETB1MN _menitTimerOff,3
CP R30,R4
BREQ _0x9C
_0x9B:
RJMP _0x9A
_0x9C:
; 0000 032D BEBAN4 = 0;
CBI 0x15,7
; 0000 032E }
; 0000 032F }
_0x9A:
_0x99:
_0x72:
_0x70:
_0x6E:
_0x6C:
; 0000 0330 delay_ms(500);
LDI R30,LOW(500)
LDI R31,HIGH(500)
RCALL SUBOPT_0xD
; 0000 0331 }
ADIW R28,1
RJMP _0x61
; 0000 0332 }
_0x9F:
RJMP _0x9F
#ifndef __SLEEP_DEFINED__
#define __SLEEP_DEFINED__
.EQU __se_bit=0x40
.EQU __sm_mask=0xB0
.EQU __sm_powerdown=0x20
.EQU __sm_powersave=0x30
.EQU __sm_standby=0xA0
.EQU __sm_ext_standby=0xB0
.EQU __sm_adc_noise_red=0x10
.SET power_ctrl_reg=mcucr
#endif
.CSEG
_put_buff_G100:
RCALL __SAVELOCR2
RCALL SUBOPT_0x41
ADIW R26,2
RCALL SUBOPT_0x42
BREQ _0x2000010
RCALL SUBOPT_0x41
RCALL SUBOPT_0x43
MOVW R16,R30
SBIW R30,0
BREQ _0x2000012
__CPWRN 16,17,2
BRLO _0x2000013
MOVW R30,R16
SBIW R30,1
MOVW R16,R30
__PUTW1SNS 2,4
_0x2000012:
RCALL SUBOPT_0x41
ADIW R26,2
RCALL SUBOPT_0x44
SBIW R30,1
LDD R26,Y+4
STD Z+0,R26
RCALL SUBOPT_0x41
RCALL __GETW1P
TST R31
BRMI _0x2000014
RCALL SUBOPT_0x41
RCALL SUBOPT_0x44
_0x2000014:
_0x2000013:
RJMP _0x2000015
_0x2000010:
RCALL SUBOPT_0x41
RCALL SUBOPT_0x45
ST X+,R30
ST X,R31
_0x2000015:
RCALL __LOADLOCR2
RJMP _0x20C0006
__print_G100:
SBIW R28,6
RCALL __SAVELOCR6
LDI R17,0
LDD R26,Y+12
LDD R27,Y+12+1
LDI R30,LOW(0)
LDI R31,HIGH(0)
ST X+,R30
ST X,R31
_0x2000016:
LDD R30,Y+18
LDD R31,Y+18+1
ADIW R30,1
STD Y+18,R30
STD Y+18+1,R31
SBIW R30,1
LPM R30,Z
MOV R18,R30
CPI R30,0
BRNE PC+2
RJMP _0x2000018
MOV R30,R17
CPI R30,0
BRNE _0x200001C
CPI R18,37
BRNE _0x200001D
LDI R17,LOW(1)
RJMP _0x200001E
_0x200001D:
RCALL SUBOPT_0x46
_0x200001E:
RJMP _0x200001B
_0x200001C:
CPI R30,LOW(0x1)
BRNE _0x200001F
CPI R18,37
BRNE _0x2000020
RCALL SUBOPT_0x46
RJMP _0x20000C9
_0x2000020:
LDI R17,LOW(2)
LDI R20,LOW(0)
LDI R16,LOW(0)
CPI R18,45
BRNE _0x2000021
LDI R16,LOW(1)
RJMP _0x200001B
_0x2000021:
CPI R18,43
BRNE _0x2000022
LDI R20,LOW(43)
RJMP _0x200001B
_0x2000022:
CPI R18,32
BRNE _0x2000023
LDI R20,LOW(32)
RJMP _0x200001B
_0x2000023:
RJMP _0x2000024
_0x200001F:
CPI R30,LOW(0x2)
BRNE _0x2000025
_0x2000024:
LDI R21,LOW(0)
LDI R17,LOW(3)
CPI R18,48
BRNE _0x2000026
ORI R16,LOW(128)
RJMP _0x200001B
_0x2000026:
RJMP _0x2000027
_0x2000025:
CPI R30,LOW(0x3)
BREQ PC+2
RJMP _0x200001B
_0x2000027:
CPI R18,48
BRLO _0x200002A
CPI R18,58
BRLO _0x200002B
_0x200002A:
RJMP _0x2000029
_0x200002B:
LDI R26,LOW(10)
MUL R21,R26
MOV R21,R0
MOV R30,R18
SUBI R30,LOW(48)
ADD R21,R30
RJMP _0x200001B
_0x2000029:
MOV R30,R18
CPI R30,LOW(0x63)
BRNE _0x200002F
RCALL SUBOPT_0x47
RCALL SUBOPT_0x48
RCALL SUBOPT_0x47
LDD R26,Z+4
ST -Y,R26
RCALL SUBOPT_0x49
RJMP _0x2000030
_0x200002F:
CPI R30,LOW(0x73)
BRNE _0x2000032
RCALL SUBOPT_0x4A
RCALL SUBOPT_0x4B
RCALL SUBOPT_0x4C
RCALL _strlen
MOV R17,R30
RJMP _0x2000033
_0x2000032:
CPI R30,LOW(0x70)
BRNE _0x2000035
RCALL SUBOPT_0x4A
RCALL SUBOPT_0x4B
RCALL SUBOPT_0x4C
RCALL _strlenf
MOV R17,R30
ORI R16,LOW(8)
_0x2000033:
ORI R16,LOW(2)
ANDI R16,LOW(127)
LDI R19,LOW(0)
RJMP _0x2000036
_0x2000035:
CPI R30,LOW(0x64)
BREQ _0x2000039
CPI R30,LOW(0x69)
BRNE _0x200003A
_0x2000039:
ORI R16,LOW(4)
RJMP _0x200003B
_0x200003A:
CPI R30,LOW(0x75)
BRNE _0x200003C
_0x200003B:
LDI R30,LOW(_tbl10_G100*2)
LDI R31,HIGH(_tbl10_G100*2)
RCALL SUBOPT_0x4D
LDI R17,LOW(5)
RJMP _0x200003D
_0x200003C:
CPI R30,LOW(0x58)
BRNE _0x200003F
ORI R16,LOW(8)
RJMP _0x2000040
_0x200003F:
CPI R30,LOW(0x78)
BREQ PC+2
RJMP _0x2000071
_0x2000040:
LDI R30,LOW(_tbl16_G100*2)
LDI R31,HIGH(_tbl16_G100*2)
RCALL SUBOPT_0x4D
LDI R17,LOW(4)
_0x200003D:
SBRS R16,2
RJMP _0x2000042
RCALL SUBOPT_0x4A
RCALL SUBOPT_0x4B
RCALL SUBOPT_0x4E
LDD R26,Y+11
TST R26
BRPL _0x2000043
LDD R30,Y+10
LDD R31,Y+10+1
RCALL __ANEGW1
RCALL SUBOPT_0x4E
LDI R20,LOW(45)
_0x2000043:
CPI R20,0
BREQ _0x2000044
SUBI R17,-LOW(1)
RJMP _0x2000045
_0x2000044:
ANDI R16,LOW(251)
_0x2000045:
RJMP _0x2000046
_0x2000042:
RCALL SUBOPT_0x4A
RCALL SUBOPT_0x4B
RCALL SUBOPT_0x4E
_0x2000046:
_0x2000036:
SBRC R16,0
RJMP _0x2000047
_0x2000048:
CP R17,R21
BRSH _0x200004A
SBRS R16,7
RJMP _0x200004B
SBRS R16,2
RJMP _0x200004C
ANDI R16,LOW(251)
MOV R18,R20
SUBI R17,LOW(1)
RJMP _0x200004D
_0x200004C:
LDI R18,LOW(48)
_0x200004D:
RJMP _0x200004E
_0x200004B:
LDI R18,LOW(32)
_0x200004E:
RCALL SUBOPT_0x46
SUBI R21,LOW(1)
RJMP _0x2000048
_0x200004A:
_0x2000047:
MOV R19,R17
SBRS R16,1
RJMP _0x200004F
_0x2000050:
CPI R19,0
BREQ _0x2000052
SBRS R16,3
RJMP _0x2000053
LDD R30,Y+6
LDD R31,Y+6+1
LPM R18,Z+
RCALL SUBOPT_0x4D
RJMP _0x2000054
_0x2000053:
RCALL SUBOPT_0x4F
LD R18,X+
STD Y+6,R26
STD Y+6+1,R27
_0x2000054:
RCALL SUBOPT_0x46
CPI R21,0
BREQ _0x2000055
SUBI R21,LOW(1)
_0x2000055:
SUBI R19,LOW(1)
RJMP _0x2000050
_0x2000052:
RJMP _0x2000056
_0x200004F:
_0x2000058:
LDI R18,LOW(48)
LDD R30,Y+6
LDD R31,Y+6+1
RCALL __GETW1PF
STD Y+8,R30
STD Y+8+1,R31
LDD R30,Y+6
LDD R31,Y+6+1
ADIW R30,2
RCALL SUBOPT_0x4D
_0x200005A:
LDD R30,Y+8
LDD R31,Y+8+1
LDD R26,Y+10
LDD R27,Y+10+1
CP R26,R30
CPC R27,R31
BRLO _0x200005C
SUBI R18,-LOW(1)
LDD R26,Y+8
LDD R27,Y+8+1
LDD R30,Y+10
LDD R31,Y+10+1
SUB R30,R26
SBC R31,R27
RCALL SUBOPT_0x4E
RJMP _0x200005A
_0x200005C:
CPI R18,58
BRLO _0x200005D
SBRS R16,3
RJMP _0x200005E
SUBI R18,-LOW(7)
RJMP _0x200005F
_0x200005E:
SUBI R18,-LOW(39)
_0x200005F:
_0x200005D:
SBRC R16,4
RJMP _0x2000061
CPI R18,49
BRSH _0x2000063
LDD R26,Y+8
LDD R27,Y+8+1
SBIW R26,1
BRNE _0x2000062
_0x2000063:
RJMP _0x20000CA
_0x2000062:
CP R21,R19
BRLO _0x2000067
SBRS R16,0
RJMP _0x2000068
_0x2000067:
RJMP _0x2000066
_0x2000068:
LDI R18,LOW(32)
SBRS R16,7
RJMP _0x2000069
LDI R18,LOW(48)
_0x20000CA:
ORI R16,LOW(16)
SBRS R16,2
RJMP _0x200006A
ANDI R16,LOW(251)
ST -Y,R20
RCALL SUBOPT_0x49
CPI R21,0
BREQ _0x200006B
SUBI R21,LOW(1)
_0x200006B:
_0x200006A:
_0x2000069:
_0x2000061:
RCALL SUBOPT_0x46
CPI R21,0
BREQ _0x200006C
SUBI R21,LOW(1)
_0x200006C:
_0x2000066:
SUBI R19,LOW(1)
LDD R26,Y+8
LDD R27,Y+8+1
SBIW R26,2
BRLO _0x2000059
RJMP _0x2000058
_0x2000059:
_0x2000056:
SBRS R16,0
RJMP _0x200006D
_0x200006E:
CPI R21,0
BREQ _0x2000070
SUBI R21,LOW(1)
LDI R30,LOW(32)
ST -Y,R30
RCALL SUBOPT_0x49
RJMP _0x200006E
_0x2000070:
_0x200006D:
_0x2000071:
_0x2000030:
_0x20000C9:
LDI R17,LOW(0)
_0x200001B:
RJMP _0x2000016
_0x2000018:
LDD R26,Y+12
LDD R27,Y+12+1
RCALL __GETW1P
RCALL __LOADLOCR6
ADIW R28,20
RET
_sprintf:
PUSH R15
MOV R15,R24
SBIW R28,6
RCALL __SAVELOCR4
MOVW R26,R28
ADIW R26,12
RCALL __ADDW2R15
RCALL SUBOPT_0x42
BRNE _0x2000072
RCALL SUBOPT_0x45
RJMP _0x20C0007
_0x2000072:
MOVW R26,R28
ADIW R26,6
RCALL __ADDW2R15
MOVW R16,R26
MOVW R26,R28
ADIW R26,12
RCALL SUBOPT_0x50
RCALL SUBOPT_0x4D
LDI R30,LOW(0)
STD Y+8,R30
STD Y+8+1,R30
MOVW R26,R28
ADIW R26,10
RCALL SUBOPT_0x50
RCALL SUBOPT_0x0
ST -Y,R17
ST -Y,R16
LDI R30,LOW(_put_buff_G100)
LDI R31,HIGH(_put_buff_G100)
RCALL SUBOPT_0x0
MOVW R30,R28
ADIW R30,10
RCALL SUBOPT_0x0
RCALL __print_G100
MOVW R18,R30
RCALL SUBOPT_0x4F
RCALL SUBOPT_0x51
MOVW R30,R18
_0x20C0007:
RCALL __LOADLOCR4
ADIW R28,10
POP R15
RET
_get_buff_G100:
ST -Y,R17
RCALL SUBOPT_0x52
RCALL SUBOPT_0x51
LDD R26,Y+3
LDD R27,Y+3+1
LD R30,X
MOV R17,R30
CPI R30,0
BREQ _0x200007A
RCALL SUBOPT_0x51
RJMP _0x200007B
_0x200007A:
RCALL SUBOPT_0x52
ADIW R26,1
RCALL SUBOPT_0x42
BREQ _0x200007C
LDD R30,Y+1
LDD R31,Y+1+1
LDD R26,Z+1
LDD R27,Z+2
LD R30,X
MOV R17,R30
CPI R30,0
BREQ _0x200007D
RCALL SUBOPT_0x52
ADIW R26,1
RCALL SUBOPT_0x44
_0x200007D:
RJMP _0x200007E
_0x200007C:
LDI R17,LOW(0)
_0x200007E:
_0x200007B:
MOV R30,R17
LDD R17,Y+0
_0x20C0006:
ADIW R28,5
RET
__scanf_G100:
SBIW R28,5
RCALL __SAVELOCR6
LDI R30,LOW(0)
LDI R31,HIGH(0)
STD Y+8,R30
STD Y+8+1,R31
MOV R20,R30
_0x200007F:
LDD R30,Y+17
LDD R31,Y+17+1
ADIW R30,1
STD Y+17,R30
STD Y+17+1,R31
SBIW R30,1
LPM R30,Z
MOV R19,R30
CPI R30,0
BRNE PC+2
RJMP _0x2000081
RCALL SUBOPT_0x53
BREQ _0x2000082
_0x2000083:
IN R30,SPL
IN R31,SPH
RCALL SUBOPT_0x0
PUSH R20
RCALL SUBOPT_0x49
POP R20
MOV R19,R30
CPI R30,0
BREQ _0x2000086
RCALL SUBOPT_0x53
BRNE _0x2000087
_0x2000086:
RJMP _0x2000085
_0x2000087:
RCALL SUBOPT_0x54
BRGE _0x2000088
RCALL SUBOPT_0x45
RJMP _0x20C0004
_0x2000088:
RJMP _0x2000083
_0x2000085:
MOV R20,R19
RJMP _0x2000089
_0x2000082:
CPI R19,37
BREQ PC+2
RJMP _0x200008A
LDI R21,LOW(0)
_0x200008B:
LDD R30,Y+17
LDD R31,Y+17+1
LPM R19,Z+
STD Y+17,R30
STD Y+17+1,R31
CPI R19,48
BRLO _0x200008F
CPI R19,58
BRLO _0x200008E
_0x200008F:
RJMP _0x200008D
_0x200008E:
LDI R26,LOW(10)
MUL R21,R26
MOV R21,R0
MOV R30,R19
SUBI R30,LOW(48)
ADD R21,R30
RJMP _0x200008B
_0x200008D:
CPI R19,0
BRNE _0x2000091
RJMP _0x2000081
_0x2000091:
_0x2000092:
IN R30,SPL
IN R31,SPH
RCALL SUBOPT_0x0
PUSH R20
RCALL SUBOPT_0x49
POP R20
MOV R18,R30
ST -Y,R30
RCALL _isspace
CPI R30,0
BREQ _0x2000094
RCALL SUBOPT_0x54
BRGE _0x2000095
RCALL SUBOPT_0x45
RJMP _0x20C0004
_0x2000095:
RJMP _0x2000092
_0x2000094:
CPI R18,0
BRNE _0x2000096
RJMP _0x2000097
_0x2000096:
MOV R20,R18
CPI R21,0
BRNE _0x2000098
LDI R21,LOW(255)
_0x2000098:
MOV R30,R19
CPI R30,LOW(0x63)
BRNE _0x200009C
RCALL SUBOPT_0x55
IN R30,SPL
IN R31,SPH
RCALL SUBOPT_0x0
PUSH R20
RCALL SUBOPT_0x49
POP R20
MOVW R26,R16
ST X,R30
RCALL SUBOPT_0x54
BRGE _0x200009D
RCALL SUBOPT_0x45
RJMP _0x20C0004
_0x200009D:
RJMP _0x200009B
_0x200009C:
CPI R30,LOW(0x73)
BRNE _0x20000A6
RCALL SUBOPT_0x55
_0x200009F:
MOV R30,R21
SUBI R21,1
CPI R30,0
BREQ _0x20000A1
IN R30,SPL
IN R31,SPH
RCALL SUBOPT_0x0
PUSH R20
RCALL SUBOPT_0x49
POP R20
MOV R19,R30
CPI R30,0
BREQ _0x20000A3
RCALL SUBOPT_0x53
BREQ _0x20000A2
_0x20000A3:
RCALL SUBOPT_0x54
BRGE _0x20000A5
RCALL SUBOPT_0x45
RJMP _0x20C0004
_0x20000A5:
RJMP _0x20000A1
_0x20000A2:
PUSH R17
PUSH R16
RCALL SUBOPT_0x3
MOV R30,R19
POP R26
POP R27
ST X,R30
RJMP _0x200009F
_0x20000A1:
MOVW R26,R16
RCALL SUBOPT_0x51
RJMP _0x200009B
_0x20000A6:
LDI R30,LOW(1)
STD Y+10,R30
MOV R30,R19
CPI R30,LOW(0x64)
BREQ _0x20000AB
CPI R30,LOW(0x69)
BRNE _0x20000AC
_0x20000AB:
LDI R30,LOW(0)
STD Y+10,R30
RJMP _0x20000AD
_0x20000AC:
CPI R30,LOW(0x75)
BRNE _0x20000AE
_0x20000AD:
LDI R18,LOW(10)
RJMP _0x20000A9
_0x20000AE:
CPI R30,LOW(0x78)
BRNE _0x20000AF
LDI R18,LOW(16)
RJMP _0x20000A9
_0x20000AF:
CPI R30,LOW(0x25)
BRNE _0x20000B2
RJMP _0x20000B1
_0x20000B2:
RJMP _0x20C0005
_0x20000A9:
LDI R30,LOW(0)
STD Y+6,R30
STD Y+6+1,R30
_0x20000B3:
MOV R30,R21
SUBI R21,1
CPI R30,0
BREQ _0x20000B5
IN R30,SPL
IN R31,SPH
RCALL SUBOPT_0x0
PUSH R20
RCALL SUBOPT_0x49
POP R20
MOV R19,R30
CPI R30,LOW(0x21)
BRSH _0x20000B6
RCALL SUBOPT_0x54
BRGE _0x20000B7
RCALL SUBOPT_0x45
RJMP _0x20C0004
_0x20000B7:
RJMP _0x20000B8
_0x20000B6:
LDD R30,Y+10
CPI R30,0
BRNE _0x20000B9
CPI R19,45
BRNE _0x20000BA
LDI R30,LOW(255)
STD Y+10,R30
RJMP _0x20000B3
_0x20000BA:
LDI R30,LOW(1)
STD Y+10,R30
_0x20000B9:
CPI R18,16
BRNE _0x20000BC
ST -Y,R19
RCALL _isxdigit
CPI R30,0
BREQ _0x20000B8
RJMP _0x20000BE
_0x20000BC:
ST -Y,R19
RCALL _isdigit
CPI R30,0
BRNE _0x20000BF
_0x20000B8:
MOV R20,R19
RJMP _0x20000B5
_0x20000BF:
_0x20000BE:
CPI R19,97
BRLO _0x20000C0
SUBI R19,LOW(87)
RJMP _0x20000C1
_0x20000C0:
CPI R19,65
BRLO _0x20000C2
SUBI R19,LOW(55)
RJMP _0x20000C3
_0x20000C2:
SUBI R19,LOW(48)
_0x20000C3:
_0x20000C1:
MOV R30,R18
RCALL SUBOPT_0x4F
RCALL SUBOPT_0x56
RCALL __MULW12U
MOVW R26,R30
MOV R30,R19
RCALL SUBOPT_0x56
ADD R30,R26
ADC R31,R27
RCALL SUBOPT_0x4D
RJMP _0x20000B3
_0x20000B5:
RCALL SUBOPT_0x55
LDD R30,Y+10
RCALL SUBOPT_0x4F
LDI R31,0
SBRC R30,7
SER R31
RCALL __MULW12U
MOVW R26,R16
ST X+,R30
ST X,R31
_0x200009B:
LDD R30,Y+8
LDD R31,Y+8+1
ADIW R30,1
STD Y+8,R30
STD Y+8+1,R31
RJMP _0x20000C4
_0x200008A:
_0x20000B1:
IN R30,SPL
IN R31,SPH
RCALL SUBOPT_0x0
PUSH R20
RCALL SUBOPT_0x49
POP R20
CP R30,R19
BREQ _0x20000C5
RCALL SUBOPT_0x54
BRGE _0x20000C6
RCALL SUBOPT_0x45
RJMP _0x20C0004
_0x20000C6:
_0x2000097:
LDD R30,Y+8
LDD R31,Y+8+1
SBIW R30,0
BRNE _0x20000C7
RCALL SUBOPT_0x45
RJMP _0x20C0004
_0x20000C7:
RJMP _0x2000081
_0x20000C5:
_0x20000C4:
_0x2000089:
RJMP _0x200007F
_0x2000081:
_0x20C0005:
LDD R30,Y+8
LDD R31,Y+8+1
_0x20C0004:
RCALL __LOADLOCR6
ADIW R28,19
RET
_sscanf:
PUSH R15
MOV R15,R24
SBIW R28,3
RCALL __SAVELOCR2
MOVW R26,R28
ADIW R26,7
RCALL __ADDW2R15
RCALL SUBOPT_0x42
BRNE _0x20000C8
RCALL SUBOPT_0x45
RJMP _0x20C0003
_0x20000C8:
MOVW R26,R28
ADIW R26,1
RCALL __ADDW2R15
MOVW R16,R26
MOVW R26,R28
ADIW R26,7
RCALL SUBOPT_0x50
STD Y+3,R30
STD Y+3+1,R31
MOVW R26,R28
ADIW R26,5
RCALL SUBOPT_0x50
RCALL SUBOPT_0x0
ST -Y,R17
ST -Y,R16
LDI R30,LOW(_get_buff_G100)
LDI R31,HIGH(_get_buff_G100)
RCALL SUBOPT_0x0
MOVW R30,R28
ADIW R30,8
RCALL SUBOPT_0x0
RCALL __scanf_G100
_0x20C0003:
RCALL __LOADLOCR2
ADIW R28,5
POP R15
RET
.CSEG
_rtc_init:
LDD R30,Y+2
ANDI R30,LOW(0x3)
STD Y+2,R30
LDD R30,Y+1
CPI R30,0
BREQ _0x2020003
LDD R30,Y+2
ORI R30,0x10
STD Y+2,R30
_0x2020003:
LD R30,Y
CPI R30,0
BREQ _0x2020004
LDD R30,Y+2
ORI R30,0x80
STD Y+2,R30
_0x2020004:
RCALL SUBOPT_0x57
LDI R30,LOW(7)
RCALL SUBOPT_0x58
RCALL SUBOPT_0x4
RCALL _i2c_write
RCALL _i2c_stop
RJMP _0x20C0002
_rtc_get_time:
RCALL SUBOPT_0x57
RCALL SUBOPT_0x2E
RCALL _i2c_write
RCALL SUBOPT_0x59
RCALL SUBOPT_0x5A
LD R26,Y
LDD R27,Y+1
ST X,R30
RCALL SUBOPT_0x5A
RCALL SUBOPT_0x41
ST X,R30
RCALL SUBOPT_0x2E
RCALL _i2c_read
ST -Y,R30
RCALL _bcd2bin
LDD R26,Y+4
LDD R27,Y+4+1
ST X,R30
RCALL _i2c_stop
ADIW R28,6
RET
_rtc_get_date:
RCALL SUBOPT_0x57
LDI R30,LOW(3)
RCALL SUBOPT_0x58
RCALL SUBOPT_0x59
LDI R30,LOW(1)
ST -Y,R30
RCALL _i2c_read
RCALL SUBOPT_0x4F
ST X,R30
RCALL SUBOPT_0x5A
LDD R26,Y+4
LDD R27,Y+4+1
ST X,R30
RCALL SUBOPT_0x5A
RCALL SUBOPT_0x41
ST X,R30
RCALL SUBOPT_0x2E
RCALL _i2c_read
ST -Y,R30
RCALL _bcd2bin
LD R26,Y
LDD R27,Y+1
ST X,R30
RCALL _i2c_stop
ADIW R28,8
RET
#ifndef __SLEEP_DEFINED__
#define __SLEEP_DEFINED__
.EQU __se_bit=0x40
.EQU __sm_mask=0xB0
.EQU __sm_powerdown=0x20
.EQU __sm_powersave=0x30
.EQU __sm_standby=0xA0
.EQU __sm_ext_standby=0xB0
.EQU __sm_adc_noise_red=0x10
.SET power_ctrl_reg=mcucr
#endif
.DSEG
.CSEG
__lcd_write_nibble_G102:
LD R30,Y
ANDI R30,LOW(0x10)
BREQ _0x2040004
SBI 0x1B,4
RJMP _0x2040005
_0x2040004:
CBI 0x1B,4
_0x2040005:
LD R30,Y
ANDI R30,LOW(0x20)
BREQ _0x2040006
SBI 0x1B,5
RJMP _0x2040007
_0x2040006:
CBI 0x1B,5
_0x2040007:
LD R30,Y
ANDI R30,LOW(0x40)
BREQ _0x2040008
SBI 0x1B,6
RJMP _0x2040009
_0x2040008:
CBI 0x1B,6
_0x2040009:
LD R30,Y
ANDI R30,LOW(0x80)
BREQ _0x204000A
SBI 0x1B,7
RJMP _0x204000B
_0x204000A:
CBI 0x1B,7
_0x204000B:
__DELAY_USB 11
SBI 0x1B,2
__DELAY_USB 27
CBI 0x1B,2
__DELAY_USB 27
RJMP _0x20C0001
__lcd_write_data:
LD R30,Y
RCALL SUBOPT_0x5B
ld r30,y
swap r30
st y,r30
LD R30,Y
RCALL SUBOPT_0x5B
__DELAY_USW 200
RJMP _0x20C0001
_lcd_gotoxy:
LD R30,Y
RCALL SUBOPT_0x56
SUBI R30,LOW(-__base_y_G102)
SBCI R31,HIGH(-__base_y_G102)
LD R30,Z
LDD R26,Y+1
ADD R30,R26
RCALL SUBOPT_0x5C
LDD R10,Y+1
LDD R13,Y+0
ADIW R28,2
RET
_lcd_clear:
LDI R30,LOW(2)
RCALL SUBOPT_0x5C
LDI R30,LOW(3)
LDI R31,HIGH(3)
RCALL SUBOPT_0xD
LDI R30,LOW(12)
RCALL SUBOPT_0x5C
LDI R30,LOW(1)
RCALL SUBOPT_0x5C
LDI R30,LOW(3)
LDI R31,HIGH(3)
RCALL SUBOPT_0xD
LDI R30,LOW(0)
MOV R13,R30
MOV R10,R30
RET
_lcd_putchar:
LD R26,Y
CPI R26,LOW(0xA)
BREQ _0x2040011
CP R10,R12
BRLO _0x2040010
_0x2040011:
RCALL SUBOPT_0x2E
INC R13
ST -Y,R13
RCALL _lcd_gotoxy
LD R26,Y
CPI R26,LOW(0xA)
BREQ _0x20C0001
_0x2040010:
INC R10
SBI 0x1B,0
LD R30,Y
RCALL SUBOPT_0x5C
CBI 0x1B,0
RJMP _0x20C0001
_lcd_puts:
ST -Y,R17
_0x2040014:
RCALL SUBOPT_0x52
LD R30,X+
STD Y+1,R26
STD Y+1+1,R27
MOV R17,R30
CPI R30,0
BREQ _0x2040016
ST -Y,R17
RCALL _lcd_putchar
RJMP _0x2040014
_0x2040016:
LDD R17,Y+0
_0x20C0002:
ADIW R28,3
RET
_lcd_init:
SBI 0x1A,4
SBI 0x1A,5
SBI 0x1A,6
SBI 0x1A,7
SBI 0x1A,2
SBI 0x1A,0
SBI 0x1A,1
CBI 0x1B,2
CBI 0x1B,0
CBI 0x1B,1
LDD R12,Y+0
LD R30,Y
SUBI R30,-LOW(128)
__PUTB1MN __base_y_G102,2
LD R30,Y
SUBI R30,-LOW(192)
__PUTB1MN __base_y_G102,3
LDI R30,LOW(20)
LDI R31,HIGH(20)
RCALL SUBOPT_0xD
LDI R30,LOW(48)
RCALL SUBOPT_0x5B
RCALL SUBOPT_0x5D
RCALL SUBOPT_0x5D
RCALL SUBOPT_0x5E
LDI R30,LOW(32)
RCALL SUBOPT_0x5B
RCALL SUBOPT_0x5E
LDI R30,LOW(40)
RCALL SUBOPT_0x5C
LDI R30,LOW(4)
RCALL SUBOPT_0x5C
LDI R30,LOW(133)
RCALL SUBOPT_0x5C
LDI R30,LOW(6)
RCALL SUBOPT_0x5C
RCALL _lcd_clear
_0x20C0001:
ADIW R28,1
RET
.CSEG
_isdigit:
ldi r30,1
ld r31,y+
cpi r31,'0'
brlo isdigit0
cpi r31,'9'+1
brlo isdigit1
isdigit0:
clr r30
isdigit1:
ret
_isspace:
ldi r30,1
ld r31,y+
cpi r31,' '
breq isspace1
cpi r31,9
brlo isspace0
cpi r31,13+1
brlo isspace1
isspace0:
clr r30
isspace1:
ret
_isxdigit:
ldi r30,1
ld r31,y+
subi r31,0x30
brcs isxdigit0
cpi r31,10
brcs isxdigit1
andi r31,0x5f
subi r31,7
cpi r31,10
brcs isxdigit0
cpi r31,16
brcs isxdigit1
isxdigit0:
clr r30
isxdigit1:
ret
.CSEG
_strlen:
ld r26,y+
ld r27,y+
clr r30
clr r31
strlen0:
ld r22,x+
tst r22
breq strlen1
adiw r30,1
rjmp strlen0
strlen1:
ret
_strlenf:
clr r26
clr r27
ld r30,y+
ld r31,y+
strlenf0:
lpm r0,z+
tst r0
breq strlenf1
adiw r26,1
rjmp strlenf0
strlenf1:
movw r30,r26
ret
.CSEG
_bcd2bin:
ld r30,y
swap r30
andi r30,0xf
mov r26,r30
lsl r26
lsl r26
add r30,r26
lsl r30
ld r26,y+
andi r26,0xf
add r30,r26
ret
.DSEG
_jamTimerOn:
.BYTE 0x4
_menitTimerOn:
.BYTE 0x4
_jamTimerOff:
.BYTE 0x4
_menitTimerOff:
.BYTE 0x4
.ESEG
__jamTimerOn:
.BYTE 0x4
__menitTimerOn:
.BYTE 0x4
__jamTimerOff:
.BYTE 0x4
__menitTimerOff:
.BYTE 0x4
.DSEG
_dataKeypad:
.BYTE 0x10
_bufferLcd1:
.BYTE 0x10
_bufferLcd2:
.BYTE 0x10
__base_y_G102:
.BYTE 0x4
.CSEG
;OPTIMIZER ADDED SUBROUTINE, CALLED 142 TIMES, CODE SIZE REDUCTION:139 WORDS
SUBOPT_0x0:
ST -Y,R31
ST -Y,R30
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x1:
__GETWRN 16,17,0
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 17 TIMES, CODE SIZE REDUCTION:46 WORDS
SUBOPT_0x2:
ADD R26,R16
ADC R27,R17
LDI R30,LOW(0)
ST X,R30
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 6 TIMES, CODE SIZE REDUCTION:3 WORDS
SUBOPT_0x3:
__ADDWRN 16,17,1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 19 TIMES, CODE SIZE REDUCTION:16 WORDS
SUBOPT_0x4:
LDD R30,Y+2
ST -Y,R30
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:14 WORDS
SUBOPT_0x5:
OUT 0x12,R30
LDI R30,LOW(30)
LDI R31,HIGH(30)
RCALL SUBOPT_0x0
RJMP _delay_ms
;OPTIMIZER ADDED SUBROUTINE, CALLED 16 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0x6:
SET
BLD R15,0
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 32 TIMES, CODE SIZE REDUCTION:153 WORDS
SUBOPT_0x7:
MOV R30,R17
LDI R31,0
SUBI R30,LOW(-_dataKeypad)
SBCI R31,HIGH(-_dataKeypad)
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 16 TIMES, CODE SIZE REDUCTION:43 WORDS
SUBOPT_0x8:
STD Z+0,R26
LDD R30,Y+3
LDD R31,Y+3+1
SBIW R30,0
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 16 TIMES, CODE SIZE REDUCTION:43 WORDS
SUBOPT_0x9:
LDD R30,Y+2
ADD R30,R17
ST -Y,R30
RJMP SUBOPT_0x4
;OPTIMIZER ADDED SUBROUTINE, CALLED 16 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0xA:
RCALL _lcd_gotoxy
RJMP SUBOPT_0x7
;OPTIMIZER ADDED SUBROUTINE, CALLED 16 TIMES, CODE SIZE REDUCTION:28 WORDS
SUBOPT_0xB:
LD R30,Z
ST -Y,R30
RJMP _lcd_putchar
;OPTIMIZER ADDED SUBROUTINE, CALLED 15 TIMES, CODE SIZE REDUCTION:40 WORDS
SUBOPT_0xC:
LDI R30,LOW(200)
LDI R31,HIGH(200)
RCALL SUBOPT_0x0
RJMP _delay_ms
;OPTIMIZER ADDED SUBROUTINE, CALLED 11 TIMES, CODE SIZE REDUCTION:8 WORDS
SUBOPT_0xD:
RCALL SUBOPT_0x0
RJMP _delay_ms
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:22 WORDS
SUBOPT_0xE:
SBIW R28,12
RCALL __SAVELOCR2
CLR R15
RCALL _lcd_clear
LDI R30,LOW(0)
ST -Y,R30
ST -Y,R30
RJMP _lcd_gotoxy
;OPTIMIZER ADDED SUBROUTINE, CALLED 16 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0xF:
RCALL SUBOPT_0x0
RJMP _lcd_puts
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:6 WORDS
SUBOPT_0x10:
LDI R30,LOW(1000)
LDI R31,HIGH(1000)
RJMP SUBOPT_0xD
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x11:
__CPWRN 16,17,3
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x12:
MOVW R26,R28
ADIW R26,11
RJMP SUBOPT_0x2
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x13:
MOVW R26,R28
ADIW R26,8
RJMP SUBOPT_0x2
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x14:
MOVW R26,R28
ADIW R26,5
RJMP SUBOPT_0x2
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x15:
MOVW R26,R28
ADIW R26,2
RJMP SUBOPT_0x2
;OPTIMIZER ADDED SUBROUTINE, CALLED 14 TIMES, CODE SIZE REDUCTION:63 WORDS
SUBOPT_0x16:
RCALL _lcd_clear
LDI R30,LOW(0)
ST -Y,R30
ST -Y,R30
RJMP _lcd_gotoxy
;OPTIMIZER ADDED SUBROUTINE, CALLED 8 TIMES, CODE SIZE REDUCTION:75 WORDS
SUBOPT_0x17:
LDI R30,LOW(35)
ST -Y,R30
LDI R30,LOW(1)
LDI R31,HIGH(1)
RCALL SUBOPT_0x0
LDI R30,LOW(0)
ST -Y,R30
LDI R30,LOW(1)
ST -Y,R30
RCALL _scanKeypad
LDS R30,_dataKeypad
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:43 WORDS
SUBOPT_0x18:
STD Y+11,R30
__GETB1MN _dataKeypad,1
STD Y+12,R30
__GETB1MN _dataKeypad,3
STD Y+8,R30
__GETB1MN _dataKeypad,4
STD Y+9,R30
MOVW R30,R28
ADIW R30,11
RCALL SUBOPT_0x0
__POINTW1FN _0x0,34
RJMP SUBOPT_0x0
;OPTIMIZER ADDED SUBROUTINE, CALLED 16 TIMES, CODE SIZE REDUCTION:73 WORDS
SUBOPT_0x19:
CLR R22
CLR R23
RCALL __PUTPARD1
LDI R24,4
RCALL _sscanf
ADIW R28,8
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0x1A:
MOVW R30,R28
ADIW R30,8
RCALL SUBOPT_0x0
__POINTW1FN _0x0,34
RJMP SUBOPT_0x0
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x1B:
LDI R26,LOW(__jamTimerOn)
LDI R27,HIGH(__jamTimerOn)
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x1C:
LDI R26,LOW(__menitTimerOn)
LDI R27,HIGH(__menitTimerOn)
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 8 TIMES, CODE SIZE REDUCTION:5 WORDS
SUBOPT_0x1D:
RCALL __EEPROMWRB
RJMP SUBOPT_0x16
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:43 WORDS
SUBOPT_0x1E:
STD Y+5,R30
__GETB1MN _dataKeypad,1
STD Y+6,R30
__GETB1MN _dataKeypad,3
STD Y+2,R30
__GETB1MN _dataKeypad,4
STD Y+3,R30
MOVW R30,R28
ADIW R30,5
RCALL SUBOPT_0x0
__POINTW1FN _0x0,34
RJMP SUBOPT_0x0
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0x1F:
MOVW R30,R28
ADIW R30,2
RCALL SUBOPT_0x0
__POINTW1FN _0x0,34
RJMP SUBOPT_0x0
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x20:
LDI R26,LOW(__jamTimerOff)
LDI R27,HIGH(__jamTimerOff)
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x21:
LDI R26,LOW(__menitTimerOff)
LDI R27,HIGH(__menitTimerOff)
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x22:
__POINTW2MN __jamTimerOn,1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x23:
__POINTW2MN __menitTimerOn,1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x24:
__POINTW2MN __jamTimerOff,1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x25:
__POINTW2MN __menitTimerOff,1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x26:
__POINTW2MN __jamTimerOn,2
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x27:
__POINTW2MN __menitTimerOn,2
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x28:
__POINTW2MN __jamTimerOff,2
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x29:
__POINTW2MN __menitTimerOff,2
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x2A:
__POINTW2MN __jamTimerOn,3
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x2B:
__POINTW2MN __menitTimerOn,3
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x2C:
__POINTW2MN __jamTimerOff,3
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x2D:
__POINTW2MN __menitTimerOff,3
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 11 TIMES, CODE SIZE REDUCTION:8 WORDS
SUBOPT_0x2E:
LDI R30,LOW(0)
ST -Y,R30
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:28 WORDS
SUBOPT_0x2F:
RCALL SUBOPT_0x1B
RCALL __EEPROMRDB
STS _jamTimerOn,R30
RCALL SUBOPT_0x1C
RCALL __EEPROMRDB
STS _menitTimerOn,R30
RCALL SUBOPT_0x20
RCALL __EEPROMRDB
STS _jamTimerOff,R30
RCALL SUBOPT_0x21
RCALL __EEPROMRDB
STS _menitTimerOff,R30
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x30:
RCALL __EEPROMRDB
__PUTB1MN _jamTimerOn,1
RJMP SUBOPT_0x23
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x31:
RCALL __EEPROMRDB
__PUTB1MN _menitTimerOn,1
RJMP SUBOPT_0x24
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x32:
RCALL __EEPROMRDB
__PUTB1MN _jamTimerOff,1
RJMP SUBOPT_0x25
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x33:
RCALL __EEPROMRDB
__PUTB1MN _menitTimerOff,1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x34:
RCALL __EEPROMRDB
__PUTB1MN _jamTimerOn,2
RJMP SUBOPT_0x27
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x35:
RCALL __EEPROMRDB
__PUTB1MN _menitTimerOn,2
RJMP SUBOPT_0x28
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x36:
RCALL __EEPROMRDB
__PUTB1MN _jamTimerOff,2
RJMP SUBOPT_0x29
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x37:
RCALL __EEPROMRDB
__PUTB1MN _menitTimerOff,2
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x38:
RCALL __EEPROMRDB
__PUTB1MN _jamTimerOn,3
RJMP SUBOPT_0x2B
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x39:
RCALL __EEPROMRDB
__PUTB1MN _menitTimerOn,3
RJMP SUBOPT_0x2C
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x3A:
RCALL __EEPROMRDB
__PUTB1MN _jamTimerOff,3
RJMP SUBOPT_0x2D
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x3B:
RCALL __EEPROMRDB
__PUTB1MN _menitTimerOff,3
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:6 WORDS
SUBOPT_0x3C:
LDI R30,LOW(_bufferLcd1)
LDI R31,HIGH(_bufferLcd1)
RJMP SUBOPT_0x0
;OPTIMIZER ADDED SUBROUTINE, CALLED 18 TIMES, CODE SIZE REDUCTION:49 WORDS
SUBOPT_0x3D:
CLR R31
CLR R22
CLR R23
RCALL __PUTPARD1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0x3E:
LDI R24,8
RCALL _sprintf
ADIW R28,12
LDI R30,LOW(_bufferLcd2)
LDI R31,HIGH(_bufferLcd2)
RJMP SUBOPT_0x0
;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:3 WORDS
SUBOPT_0x3F:
LDI R30,LOW(1)
ST -Y,R30
RCALL _lcd_gotoxy
LDI R30,LOW(_bufferLcd2)
LDI R31,HIGH(_bufferLcd2)
RJMP SUBOPT_0xF
;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x40:
LDI R24,12
RCALL _sprintf
ADIW R28,16
RJMP SUBOPT_0x2E
;OPTIMIZER ADDED SUBROUTINE, CALLED 8 TIMES, CODE SIZE REDUCTION:5 WORDS
SUBOPT_0x41:
LDD R26,Y+2
LDD R27,Y+2+1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x42:
RCALL __GETW1P
SBIW R30,0
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x43:
ADIW R26,4
RCALL __GETW1P
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:6 WORDS
SUBOPT_0x44:
LD R30,X+
LD R31,X+
ADIW R30,1
ST -X,R31
ST -X,R30
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 10 TIMES, CODE SIZE REDUCTION:7 WORDS
SUBOPT_0x45:
LDI R30,LOW(65535)
LDI R31,HIGH(65535)
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:22 WORDS
SUBOPT_0x46:
ST -Y,R18
LDD R30,Y+13
LDD R31,Y+13+1
RCALL SUBOPT_0x0
LDD R30,Y+17
LDD R31,Y+17+1
ICALL
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 6 TIMES, CODE SIZE REDUCTION:3 WORDS
SUBOPT_0x47:
LDD R30,Y+16
LDD R31,Y+16+1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:6 WORDS
SUBOPT_0x48:
SBIW R30,4
STD Y+16,R30
STD Y+16+1,R31
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 9 TIMES, CODE SIZE REDUCTION:38 WORDS
SUBOPT_0x49:
LDD R30,Y+13
LDD R31,Y+13+1
RCALL SUBOPT_0x0
LDD R30,Y+17
LDD R31,Y+17+1
ICALL
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x4A:
RCALL SUBOPT_0x47
RJMP SUBOPT_0x48
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x4B:
LDD R26,Y+16
LDD R27,Y+16+1
RJMP SUBOPT_0x43
;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x4C:
STD Y+6,R30
STD Y+6+1,R31
RJMP SUBOPT_0x0
;OPTIMIZER ADDED SUBROUTINE, CALLED 6 TIMES, CODE SIZE REDUCTION:3 WORDS
SUBOPT_0x4D:
STD Y+6,R30
STD Y+6+1,R31
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x4E:
STD Y+10,R30
STD Y+10+1,R31
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x4F:
LDD R26,Y+6
LDD R27,Y+6+1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x50:
RCALL __ADDW2R15
RCALL __GETW1P
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x51:
LDI R30,LOW(0)
ST X,R30
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x52:
LDD R26,Y+1
LDD R27,Y+1+1
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x53:
ST -Y,R19
RCALL _isspace
CPI R30,0
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 6 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0x54:
LDD R26,Y+11
LDD R27,Y+11+1
LD R26,X
CPI R26,0
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:16 WORDS
SUBOPT_0x55:
LDD R30,Y+15
LDD R31,Y+15+1
SBIW R30,4
STD Y+15,R30
STD Y+15+1,R31
LDD R26,Y+15
LDD R27,Y+15+1
ADIW R26,4
LD R16,X+
LD R17,X
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x56:
LDI R31,0
RET
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x57:
RCALL _i2c_start
LDI R30,LOW(208)
ST -Y,R30
RJMP _i2c_write
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x58:
ST -Y,R30
RJMP _i2c_write
;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x59:
RCALL _i2c_stop
RCALL _i2c_start
LDI R30,LOW(209)
RJMP SUBOPT_0x58
;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:10 WORDS
SUBOPT_0x5A:
LDI R30,LOW(1)
ST -Y,R30
RCALL _i2c_read
ST -Y,R30
RJMP _bcd2bin
;OPTIMIZER ADDED SUBROUTINE, CALLED 6 TIMES, CODE SIZE REDUCTION:3 WORDS
SUBOPT_0x5B:
ST -Y,R30
RJMP __lcd_write_nibble_G102
;OPTIMIZER ADDED SUBROUTINE, CALLED 9 TIMES, CODE SIZE REDUCTION:6 WORDS
SUBOPT_0x5C:
ST -Y,R30
RJMP __lcd_write_data
;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:3 WORDS
SUBOPT_0x5D:
__DELAY_USW 400
LDI R30,LOW(48)
RJMP SUBOPT_0x5B
;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x5E:
__DELAY_USW 400
RET
.CSEG
.equ __i2c_dir=__i2c_port-1
.equ __i2c_pin=__i2c_port-2
_i2c_init:
cbi __i2c_port,__scl_bit
cbi __i2c_port,__sda_bit
sbi __i2c_dir,__scl_bit
cbi __i2c_dir,__sda_bit
rjmp __i2c_delay2
_i2c_start:
cbi __i2c_dir,__sda_bit
cbi __i2c_dir,__scl_bit
clr r30
nop
sbis __i2c_pin,__sda_bit
ret
sbis __i2c_pin,__scl_bit
ret
rcall __i2c_delay1
sbi __i2c_dir,__sda_bit
rcall __i2c_delay1
sbi __i2c_dir,__scl_bit
ldi r30,1
__i2c_delay1:
ldi r22,27
rjmp __i2c_delay2l
_i2c_stop:
sbi __i2c_dir,__sda_bit
sbi __i2c_dir,__scl_bit
rcall __i2c_delay2
cbi __i2c_dir,__scl_bit
rcall __i2c_delay1
cbi __i2c_dir,__sda_bit
__i2c_delay2:
ldi r22,53
__i2c_delay2l:
dec r22
brne __i2c_delay2l
ret
_i2c_read:
ldi r23,8
__i2c_read0:
cbi __i2c_dir,__scl_bit
rcall __i2c_delay1
__i2c_read3:
sbis __i2c_pin,__scl_bit
rjmp __i2c_read3
rcall __i2c_delay1
clc
sbic __i2c_pin,__sda_bit
sec
sbi __i2c_dir,__scl_bit
rcall __i2c_delay2
rol r30
dec r23
brne __i2c_read0
ld r23,y+
tst r23
brne __i2c_read1
cbi __i2c_dir,__sda_bit
rjmp __i2c_read2
__i2c_read1:
sbi __i2c_dir,__sda_bit
__i2c_read2:
rcall __i2c_delay1
cbi __i2c_dir,__scl_bit
rcall __i2c_delay2
sbi __i2c_dir,__scl_bit
rcall __i2c_delay1
cbi __i2c_dir,__sda_bit
rjmp __i2c_delay1
_i2c_write:
ld r30,y+
ldi r23,8
__i2c_write0:
lsl r30
brcc __i2c_write1
cbi __i2c_dir,__sda_bit
rjmp __i2c_write2
__i2c_write1:
sbi __i2c_dir,__sda_bit
__i2c_write2:
rcall __i2c_delay2
cbi __i2c_dir,__scl_bit
rcall __i2c_delay1
__i2c_write3:
sbis __i2c_pin,__scl_bit
rjmp __i2c_write3
rcall __i2c_delay1
sbi __i2c_dir,__scl_bit
dec r23
brne __i2c_write0
cbi __i2c_dir,__sda_bit
rcall __i2c_delay1
cbi __i2c_dir,__scl_bit
rcall __i2c_delay2
ldi r30,1
sbic __i2c_pin,__sda_bit
clr r30
sbi __i2c_dir,__scl_bit
rjmp __i2c_delay1
_delay_ms:
ld r30,y+
ld r31,y+
adiw r30,0
breq __delay_ms1
__delay_ms0:
__DELAY_USW 0xFA0
wdr
sbiw r30,1
brne __delay_ms0
__delay_ms1:
ret
__ADDW2R15:
CLR R0
ADD R26,R15
ADC R27,R0
RET
__ANEGW1:
NEG R31
NEG R30
SBCI R31,0
RET
__MULW12U:
MUL R31,R26
MOV R31,R0
MUL R30,R27
ADD R31,R0
MUL R30,R26
MOV R30,R0
ADD R31,R1
RET
__GETW1P:
LD R30,X+
LD R31,X
SBIW R26,1
RET
__GETW1PF:
LPM R0,Z+
LPM R31,Z
MOV R30,R0
RET
__PUTPARD1:
ST -Y,R23
ST -Y,R22
ST -Y,R31
ST -Y,R30
RET
__EEPROMRDB:
SBIC EECR,EEWE
RJMP __EEPROMRDB
PUSH R31
IN R31,SREG
CLI
OUT EEARL,R26
OUT EEARH,R27
SBI EECR,EERE
IN R30,EEDR
OUT SREG,R31
POP R31
RET
__EEPROMWRB:
SBIS EECR,EEWE
RJMP __EEPROMWRB1
WDR
RJMP __EEPROMWRB
__EEPROMWRB1:
IN R25,SREG
CLI
OUT EEARL,R26
OUT EEARH,R27
SBI EECR,EERE
IN R24,EEDR
CP R30,R24
BREQ __EEPROMWRB0
OUT EEDR,R30
SBI EECR,EEMWE
SBI EECR,EEWE
__EEPROMWRB0:
OUT SREG,R25
RET
__SAVELOCR6:
ST -Y,R21
__SAVELOCR5:
ST -Y,R20
__SAVELOCR4:
ST -Y,R19
__SAVELOCR3:
ST -Y,R18
__SAVELOCR2:
ST -Y,R17
ST -Y,R16
RET
__LOADLOCR6:
LDD R21,Y+5
__LOADLOCR5:
LDD R20,Y+4
__LOADLOCR4:
LDD R19,Y+3
__LOADLOCR3:
LDD R18,Y+2
__LOADLOCR2:
LDD R17,Y+1
LD R16,Y
RET
__LOADLOCR2P:
LD R16,Y+
LD R17,Y+
RET
;END OF CODE MARKER
__END_OF_CODE:
|
theorems/cw/Degree.agda | cmknapp/HoTT-Agda | 0 | 8909 | <reponame>cmknapp/HoTT-Agda<filename>theorems/cw/Degree.agda
{-# OPTIONS --without-K #-}
open import HoTT
open import cw.CW
open import homotopy.PinSn
module cw.Degree
{i} {n : ℕ} (skel : Skeleton {i} (S (S n)))
(skel-has-dec-cells : has-dec-cells skel)
(skel-is-aligned : is-aligned skel)
-- the cells at the upper and lower dimensions
(upper : cells-last skel)
(lower : cells-nth (inr ltS) skel)
where
private
lower-skel = cw-take (inr ltS) skel
lower-cells = cells-last lower-skel
lower-cells-has-dec-eq = snd (fst skel-has-dec-cells)
-- squash the lower CW complex except one of its cells [lower]
cw-squash-lower-to-Sphere : ⟦ lower-skel ⟧ → Sphere (S n)
cw-squash-lower-to-Sphere = Attached-rec (λ _ → north) squash-hubs squash-spokes where
-- squash cells except [lower]
squash-hubs : lower-cells → Sphere (S n)
squash-hubs c with lower-cells-has-dec-eq c lower
... | (inl _) = south
... | (inr _) = north
-- squash cells except [lower]
squash-spokes : (c : lower-cells) → Sphere n
→ north == squash-hubs c
squash-spokes c s with lower-cells-has-dec-eq c lower
... | (inl _) = merid s
... | (inr _) = idp
degree-map : Sphere (S n) → Sphere (S n)
degree-map = cw-squash-lower-to-Sphere ∘ attaching-last skel upper
degree-⊙map : fst (⊙Sphere (S n) ⊙→ ⊙Sphere (S n))
degree-⊙map = degree-map , ap cw-squash-lower-to-Sphere (! (snd (snd skel-is-aligned upper)))
degree' : ℤ → ℤ
degree' = transport Group.El (πₙ₊₁Sⁿ⁺¹ n)
∘ GroupHom.f (πS-fmap n degree-⊙map)
∘ transport! Group.El (πₙ₊₁Sⁿ⁺¹ n)
degree : ℤ
degree = degree' 1
|
modules/clearDisplay.asm | antuniooh/assembly-calculator | 2 | 179867 | clearDisplay:
CLR RS
CLR P1.7
CLR P1.6
CLR P1.5
CLR P1.4
SETB EN
CLR EN
CLR P1.7
CLR P1.6
CLR P1.5
SETB P1.4
SETB EN
CLR EN
CALL delay
RET
|
src/dump.asm | merlin1337/reg-dump | 0 | 102927 | CPU 386
BITS 16
ORG 0x7C00
;-----------------------------------
; CODE
;-----------------------------------
; Multipush
%imacro push 1-*
%rep %0
push %1
%rotate 1
%endrep
%endmacro
; Printf helper
%imacro printf 1-*
%if %0 > 1
push %{-1:2}
%endif
push %1
call _printf
%if %0 > 1
add sp, (%0 - 1) * 2
%endif
%endmacro
start:
; Save registers
mov [_AX], ax
mov [_SS], ss
mov [_SP], sp
; Setup 1kB Stack
cli
xor ax, ax
mov ss, ax
mov sp, 0x7C00 + 512 + 1024
sti
; Calculate the address of our entry point (Instruction Pointer)
call getIP
sub ax, $ - start
mov [_IP], ax
; Push flags manually, because we don't have a symbol/register for EFLAGS that is compatible with normal push syntax
pushf
printf _SZ_FORMAT, cs, word [_IP], word [_SS], word [_SP], bp, word [_AX], cx, dx, bx, si, di, ds, es, fs, gs
popf
suspend:
hlt
jmp suspend
;-----------------------------------
; DATA
;-----------------------------------
%imacro line 0-*
%if %0 >= 1
db %1
%endif
%if %0 >= 2
db %{2:-1}
%else
db 13, 10
%endif
%endmacro
_SZ_FORMAT:
line " CS:IP = %x:%x"
line
line " SS:SP = %x:%x"
line " BP = %x"
line
line " AX = %x"
line " CX = %x"
line " DX = %x"
line " BX = %x"
line " SI = %x"
line " DI = %x"
line
line " DS = %x"
line " ES = %x"
line " FS = %x"
line " GS = %x"
line
line " FLAGS = %b", 0
_AX: dw 0
_SS: dw 0
_SP: dw 0
_IP: dw 0
;-----------------------------------
; FUNCTIONS
;-----------------------------------
; Copies the return address of this function into AX
getIP:
push bp
mov bp, sp
mov ax, [bp+2]
pop bp
ret
; Print string
; Args:
; Stack = string pointer
_print:
pusha
mov bp, sp
mov si, [bp+18]
mov ah, 0xE
.next:
lodsb
and al, al
jz .done
int 0x10
jmp .next
.done:
popa
ret 2
; Print 16-bit integer (word). Supports base 1-16
; Args:
; Stack = number, base
_printw:
pusha
mov bp, sp
mov ax, [bp+18]
xor dx, dx
div word [bp+20]
test ax, ax
jz .digit
push word [bp+20]
push ax
call _printw
.digit:
mov bx, dx
mov ax, [_SZ_HEX+bx]
mov ah, 0xE
int 0x10
popa
ret 4
_SZ_HEX: db "0123456789ABCDEF"
; A simple and naive C-style printf function.
; Specifiers:
; %s = string | %d = decimal int16 | %x = hex int16 | %b = binary int16
; %% = % | any other specifier = char
; Args:
; Stack = format, args...
_printf:
pusha
mov bp, sp
; Get pointer to format string
mov si, [bp+18]
; Get pointer to stack arguments
lea di, [bp+18]
add di, 2
; Loop over format string
.loop:
mov al, [si]
test al, al
jz .end
push 0 ; possible argument 2
cmp al, '%'
jne .noFormat
push word [di] ; argument 1
add di, 2
inc si
; Check format
mov bl, byte [si]
cmp bl, '%'
je .noFormat
.checkS:
cmp bl, 's'
je .string
.checkD:
cmp bl, 'd'
jne .checkX
mov word [bp-2], 10
jmp .word
.checkX:
cmp bl, 'x'
jne .checkB
mov word [bp-2], 16
jmp .word
.checkB:
cmp bl, 'b'
jne .char
mov word [bp-2], 2
.word:
call _printw
jmp .loopContinue
.string:
call _print
jmp .loopContinue_1UnusedArgs
.char:
pop ax
.noFormat:
mov ah, 0xE
int 0x10
.loopContinue_1UnusedArgs:
pop ax
.loopContinue:
inc si
jmp .loop
.end:
popa
ret 2
;-----------------------------------
; Master Boot Record (MBR)
;-----------------------------------
times 446-($-$$) db 0 ; max 446 bytes of code
;--------------------------------
; Partition entry #1
;--------------------------------
db 0x80 ; bootable
db 0, 0, 0 ; start CHS
db 4 ; type
db 0, 0, 0 ; end CHS
dd 0 ; start LBA
dd 1 ; sector count
;--------------------------------
; 3 empty entries
;--------------------------------
times 16 * 3 db 0
db 0x55, 0xAA ; Magic number |
.emacs.d/elpa/ada-mode-5.3.1/gps_source/config.ads | caqg/linux-home | 0 | 19236 | -----------------------------------------------------------------------
-- G P S --
-- --
-- Copyright (C) 2001-2010, AdaCore --
-- --
-- GPS 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. --
-- --
-- This program is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. You should have received --
-- a copy of the GNU General Public License along with this library; --
-- if not, write to the Free Software Foundation, Inc., 59 Temple --
-- Place - Suite 330, Boston, MA 02111-1307, USA. --
-----------------------------------------------------------------------
-- This package contains target specific parameters that are set at configure
-- time.
package Config is
pragma Pure;
pragma Style_Checks (Off);
Default_Charset : constant String := "ISO-8859-1";
-- Default charset for the host, used throughout GPS to convert strings
-- from outside GPS (e.g. pathnames, compiler output, file contents, ...)
-- to UTF-8 internally.
end Config;
|
agda/SList.agda | bgbianchi/sorting | 6 | 5897 | <reponame>bgbianchi/sorting
{-# OPTIONS --sized-types #-}
module SList (A : Set) where
open import Data.List
open import Data.Product
open import Size
data SList : {ι : Size} → Set where
snil : {ι : Size}
→ SList {↑ ι}
_∙_ : {ι : Size}(x : A)
→ SList {ι}
→ SList {↑ ι}
size : List A → SList
size [] = snil
size (x ∷ xs) = x ∙ (size xs)
unsize : {ι : Size} → SList {ι} → List A
unsize snil = []
unsize (x ∙ xs) = x ∷ unsize xs
unsize× : {ι : Size} → SList {ι} × SList {ι} → List A × List A
unsize× (xs , ys) = unsize xs , unsize ys
_⊕_ : SList → SList → SList
snil ⊕ ys = ys
(x ∙ xs) ⊕ ys = x ∙ (xs ⊕ ys)
|
alloy4fun_models/trashltl/models/9/P4mbELqFA6Q7YbQbG.als | Kaixi26/org.alloytools.alloy | 0 | 3970 | open main
pred idP4mbELqFA6Q7YbQbG_prop10 {
always (all f:Protected | always f in Protected)
}
pred __repair { idP4mbELqFA6Q7YbQbG_prop10 }
check __repair { idP4mbELqFA6Q7YbQbG_prop10 <=> prop10o } |
oeis/004/A004516.asm | neoneye/loda-programs | 11 | 82882 | ; A004516: Generalized nim sum n + n in base 6.
; Submitted by <NAME>(w1)
; 0,2,4,0,2,4,12,14,16,12,14,16,24,26,28,24,26,28,0,2,4,0,2,4,12,14,16,12,14,16,24,26,28,24,26,28,72,74,76,72,74,76,84,86,88,84,86,88,96,98,100,96,98,100,72,74,76,72
mov $3,1
lpb $0
mov $2,$0
div $0,6
mod $2,3
mul $2,$3
add $1,$2
mul $3,6
lpe
mov $0,$1
mul $0,2
|
programs/oeis/313/A313510.asm | jmorken/loda | 1 | 243255 | <gh_stars>1-10
; A313510: Coordination sequence Gal.3.13.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,10,14,18,23,28,33,38,42,46,51,56,61,66,70,74,79,84,89,94,98,102,107,112,117,122,126,130,135,140,145,150,154,158,163,168,173,178,182,186,191,196,201,206,210,214,219,224,229
mov $3,$0
lpb $0
sub $0,1
add $1,2
sub $0,$1
trn $0,1
add $0,$1
mov $2,$1
mov $1,2
add $1,$2
lpe
mov $1,$0
trn $1,1
lpb $3
add $1,4
sub $3,1
lpe
add $1,1
|
maps/EcruteakTinTowerEntrance.asm | Dev727/ancientplatinum | 28 | 102374 | object_const_def ; object_event constants
const ECRUTEAKTINTOWERENTRANCE_SAGE1
const ECRUTEAKTINTOWERENTRANCE_SAGE2
const ECRUTEAKTINTOWERENTRANCE_SAGE3
const ECRUTEAKTINTOWERENTRANCE_GRAMPS
EcruteakTinTowerEntrance_MapScripts:
db 2 ; scene scripts
scene_script .DummyScene0 ; SCENE_DEFAULT
scene_script .DummyScene1 ; SCENE_FINISHED
db 1 ; callbacks
callback MAPCALLBACK_OBJECTS, .InitializeSages
.DummyScene0:
end
.DummyScene1:
end
.InitializeSages:
checkevent EVENT_FOUGHT_SUICUNE
iftrue .DontBlockTower
checkevent EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER
iftrue .DontBlockTower
checkevent EVENT_CLEARED_RADIO_TOWER
iftrue .BlockTower
return
.BlockTower:
clearevent EVENT_RANG_CLEAR_BELL_1
setevent EVENT_RANG_CLEAR_BELL_2
setevent EVENT_ECRUTEAK_TIN_TOWER_ENTRANCE_WANDERING_SAGE
checkitem CLEAR_BELL
iftrue .NoClearBell
setscene SCENE_DEFAULT
.NoClearBell:
return
.DontBlockTower:
clearevent EVENT_ECRUTEAK_TIN_TOWER_ENTRANCE_WANDERING_SAGE
return
EcruteakTinTowerEntrance_CoordEvent1:
checkevent EVENT_RANG_CLEAR_BELL_2
iftrue EcruteakTinTowerEntrance_CoordEvent_DontMove
applymovement ECRUTEAKTINTOWERENTRANCE_SAGE2, MovementData_0x980c7
moveobject ECRUTEAKTINTOWERENTRANCE_SAGE1, 4, 6
appear ECRUTEAKTINTOWERENTRANCE_SAGE1
pause 5
disappear ECRUTEAKTINTOWERENTRANCE_SAGE2
end
EcruteakTinTowerEntrance_CoordEvent2:
checkevent EVENT_RANG_CLEAR_BELL_1
iftrue EcruteakTinTowerEntrance_CoordEvent_DontMove
applymovement ECRUTEAKTINTOWERENTRANCE_SAGE1, MovementData_0x980cc
moveobject ECRUTEAKTINTOWERENTRANCE_SAGE2, 5, 6
appear ECRUTEAKTINTOWERENTRANCE_SAGE2
pause 5
disappear ECRUTEAKTINTOWERENTRANCE_SAGE1
end
EcruteakTinTowerEntrance_CoordEvent_DontMove:
end
EcruteakTinTowerEntranceSageScript:
faceplayer
opentext
checkevent EVENT_CLEARED_RADIO_TOWER
iftrue .CheckForClearBell
checkflag ENGINE_FOGBADGE
iftrue .BlockPassage_GotFogBadge
writetext EcruteakTinTowerEntranceSageText
waitbutton
closetext
end
.BlockPassage_GotFogBadge:
writetext EcruteakTinTowerEntranceSageText_GotFogBadge
waitbutton
closetext
end
.CheckForClearBell:
checkevent EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER
iftrue .AllowedThrough
checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1
iftrue .RangClearBell
checkitem CLEAR_BELL
iftrue .GotClearBell
writetext EcruteakTinTowerEntranceSageText_NoClearBell
waitbutton
closetext
end
.GotClearBell:
writetext EcruteakTinTowerEntranceSageText_HearsClearBell
waitbutton
closetext
setscene SCENE_FINISHED
setevent EVENT_RANG_CLEAR_BELL_2
clearevent EVENT_RANG_CLEAR_BELL_1
setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1
end
.AllowedThrough:
writetext EcruteakTinTowerEntranceSageText_PleaseDoGoOn
waitbutton
closetext
end
.RangClearBell:
writetext EcruteakTinTowerEntranceSageText_HeardClearBell
waitbutton
closetext
end
EcruteakTinTowerEntranceWanderingSageScript:
faceplayer
opentext
checkevent EVENT_GOT_CLEAR_BELL
iftrue .GotClearBell
writetext EcruteakTinTowerEntranceWanderingSageText
waitbutton
closetext
end
.GotClearBell:
writetext EcruteakTinTowerEntranceWanderingSageText_GotClearBell
waitbutton
closetext
end
EcruteakTinTowerEntranceGrampsScript:
jumptextfaceplayer EcruteakTinTowerEntranceGrampsText
MovementData_0x980c7:
fix_facing
big_step LEFT
remove_fixed_facing
turn_head DOWN
step_end
MovementData_0x980cc:
fix_facing
big_step RIGHT
remove_fixed_facing
turn_head DOWN
step_end
EcruteakTinTowerEntranceSageText:
text "TIN TOWER is off"
line "limits to anyone"
para "without ECRUTEAK"
line "GYM's BADGE."
para "Sorry, but you'll"
line "have to leave."
done
EcruteakTinTowerEntranceSageText_GotFogBadge:
text "TIN TOWER is off"
line "limits to anyone"
para "without ECRUTEAK"
line "GYM's BADGE."
para "Ah!"
para "ECRUTEAK's GYM"
line "BADGE! Please, go"
cont "right through."
done
EcruteakTinTowerEntranceSageText_NoClearBell:
text "A momentous event"
line "has occurred."
para "I beg your pardon,"
line "but I must ask you"
cont "to leave."
para "…What soothes the"
line "soul…"
para "The WISE TRIO say"
line "things that are so"
para "very difficult to"
line "understand…"
done
EcruteakTinTowerEntranceSageText_HearsClearBell:
text "A momentous event"
line "has occurred."
para "I beg your pardon,"
line "but I must ask you"
cont "to leave."
para "<……><……><……>"
para "Ah!"
para "The sound of that"
line "CLEAR BELL!"
para "It… It's sublime!"
para "I've never heard"
line "so beautiful a"
cont "sound before!"
para "That bell's chime"
line "is indicative of"
cont "the bearer's soul."
para "You…"
para "You may be able to"
line "make it through"
cont "TIN TOWER."
para "Please, do go on."
done
EcruteakTinTowerEntranceSageText_PleaseDoGoOn:
text "Please, do go on."
done
EcruteakTinTowerEntranceSageText_HeardClearBell:
text "That bell's chime"
line "is indicative of"
cont "the bearer's soul."
para "You…"
para "You may be able to"
line "make it through"
cont "TIN TOWER."
para "Please, do go on."
done
EcruteakTinTowerEntranceWanderingSageText:
text "The TIN TOWER"
line "ahead is a nine-"
para "tier tower of"
line "divine beauty."
para "It soothes the"
line "soul of all who"
cont "see it."
done
EcruteakTinTowerEntranceWanderingSageText_GotClearBell:
text "The TIN TOWER"
line "shook! A #MON"
para "must have returned"
line "to the top!"
done
EcruteakTinTowerEntranceGrampsText:
text "Two towers…"
line "Two #MON…"
para "But when one"
line "burned down, both"
para "#MON flew away,"
line "never to return."
done
EcruteakTinTowerEntrance_MapEvents:
db 0, 0 ; filler
db 5 ; warp events
warp_event 4, 17, ECRUTEAK_CITY, 3
warp_event 5, 17, ECRUTEAK_CITY, 3
warp_event 5, 3, ECRUTEAK_TIN_TOWER_ENTRANCE, 4
warp_event 17, 15, ECRUTEAK_TIN_TOWER_ENTRANCE, 3
warp_event 17, 3, WISE_TRIOS_ROOM, 3
db 2 ; coord events
coord_event 4, 7, SCENE_DEFAULT, EcruteakTinTowerEntrance_CoordEvent1
coord_event 5, 7, SCENE_DEFAULT, EcruteakTinTowerEntrance_CoordEvent2
db 0 ; bg events
db 4 ; object events
object_event 4, 6, SPRITE_SAGE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, EcruteakTinTowerEntranceSageScript, EVENT_RANG_CLEAR_BELL_1
object_event 5, 6, SPRITE_SAGE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, EcruteakTinTowerEntranceSageScript, EVENT_RANG_CLEAR_BELL_2
object_event 6, 9, SPRITE_SAGE, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, EcruteakTinTowerEntranceWanderingSageScript, EVENT_ECRUTEAK_TIN_TOWER_ENTRANCE_WANDERING_SAGE
object_event 3, 11, SPRITE_GRAMPS, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, EcruteakTinTowerEntranceGrampsScript, EVENT_ECRUTEAK_TIN_TOWER_ENTRANCE_WANDERING_SAGE
|
src/vulkan-math/gentype/vulkan-math-gentype.adb | zrmyers/VulkanAda | 1 | 26542 | <gh_stars>1-10
--------------------------------------------------------------------------------
-- MIT License
--
-- Copyright (c) 2020 <NAME>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
--------------------------------------------------------------------------------
-- This package describes a generic Vulkan Math type.
--------------------------------------------------------------------------------
package body Vulkan.Math.GenType is
----------------------------------------------------------------------------
-- Operations on Vkm_GenType
----------------------------------------------------------------------------
function Image (Instance : in Vkm_GenType) return String is
begin
case Instance.Length is
when 4 =>
return "[ " & Image(Instance.data(0)) &
", " & Image(Instance.data(1)) &
", " & Image(Instance.data(2)) &
", " & Image(Instance.data(3)) & " ]";
when 3 =>
return "[ " & Image(Instance.data(0)) &
", " & Image(Instance.data(1)) &
", " & Image(Instance.data(2)) & " ]";
when 2 =>
return "[ " & Image(Instance.data(0)) &
", " & Image(Instance.data(1)) & " ]";
when 1 =>
return "[ " & Image(Instance.data(0)) & " ]";
end case;
end Image;
----------------------------------------------------------------------------
function Make_GenType (Last_Index : in Vkm_Indices;
value : in Base_Type) return Vkm_GenType is
Instance : Vkm_GenType(Last_Index => Last_Index);
begin
for I in Vkm_Indices'First .. Instance.Last_Index loop
Instance.data(I) := value;
end loop;
return Instance;
end Make_GenType;
----------------------------------------------------------------------------
function Make_GenType (value1 : in Base_Type) return Vkm_GenType is
Instance : Vkm_GenType(Last_Index => 0);
begin
Instance.data(0) := value1;
return Instance;
end Make_GenType;
----------------------------------------------------------------------------
function Make_GenType (value1, value2 : in Base_Type) return Vkm_GenType is
Instance : Vkm_GenType(Last_Index => 1);
begin
Instance.data(0) := value1;
Instance.data(1) := Value2;
return Instance;
end Make_GenType;
----------------------------------------------------------------------------
function Make_GenType (value1, value2, value3 : in Base_Type) return Vkm_GenType is
Instance : Vkm_GenType(Last_Index => 2);
begin
Instance.data(0) := value1;
Instance.data(1) := value2;
Instance.data(2) := value3;
return Instance;
end Make_GenType;
----------------------------------------------------------------------------
function Make_GenType (value1, value2, value3, value4 : in Base_Type) return Vkm_GenType is
Instance : Vkm_GenType(Last_Index => 3);
begin
Instance.data(0) := value1;
Instance.data(1) := value2;
Instance.data(2) := value3;
Instance.data(3) := value4;
return Instance;
end Make_GenType;
----------------------------------------------------------------------------
function Make_GenType (value : in Vkm_GenType) return Vkm_GenType is
Instance : Vkm_GenType(Last_Index => value.Last_Index);
begin
for I in Instance.data'Range loop
Instance.data(I) := value.data(I);
end loop;
return Instance;
end Make_GenType;
----------------------------------------------------------------------------
procedure Copy (Destination : in out Vkm_GenType;
Source : in Vkm_GenType;
Num_Copy : in Vkm_Length;
Offset : in Vkm_Indices) is
begin
for Data_Index in 0 .. To_Vkm_Indices(Num_Copy) loop
Destination.data(Offset + Data_Index) := Source.data(Data_Index);
end loop;
end Copy;
----------------------------------------------------------------------------
function Component (vec : in Vkm_GenType;
index : in Vkm_Indices) return Base_Type is
value : Base_Type := Default_Value;
begin
if index <= vec.Last_Index then
value := vec.data(index);
end if;
return value;
end Component;
----------------------------------------------------------------------------
procedure Component (vec : in out Vkm_GenType;
index : in Vkm_Indices;
value : in Base_Type) is
begin
vec.data (index) := value;
end Component;
----------------------------------------------------------------
function x (vec1 : in out Vkm_GenType;
value : in Base_Type ) return Vkm_GenType_Reference is
vec1_access : constant Vkm_GenType_Reference := (Vector => vec1'Unrestricted_Access);
begin
x(vec1,value);
return vec1_access;
end x;
procedure x (vec1 : in out Vkm_GenType;
value : in Base_Type ) is
begin
case vec1.Last_Index is
when 3 => vec1.data(0) := value;
when 2 => vec1.data(0) := value;
when 1 => vec1.data(0) := value;
when 0 => vec1.data(0) := value;
end case;
end x;
----------------------------------------------------------------
function y (vec1 : in out Vkm_GenType;
value : in Base_Type ) return Vkm_GenType_Reference is
vec1_access : constant Vkm_GenType_Reference := (Vector => vec1'Unrestricted_Access);
begin
y(vec1, value);
return vec1_access;
end y;
----------------------------------------------------------------
procedure y (vec1 : in out Vkm_GenType;
value : in Base_Type ) is
begin
case vec1.Last_Index is
when 3 => vec1.data(1) := value;
when 2 => vec1.data(1) := value;
when 1 => vec1.data(1) := value;
when 0 => null;
end case;
end y;
function z (vec1 : in out Vkm_GenType;
value : in Base_Type ) return Vkm_GenType_Reference is
vec1_access : constant Vkm_GenType_Reference := (Vector => vec1'Unrestricted_Access);
begin
z(vec1, value);
return vec1_access;
end z;
----------------------------------------------------------------
procedure z (vec1 : in out Vkm_GenType;
value : in Base_Type ) is
begin
case vec1.Last_Index is
when 3 => vec1.data(2) := value;
when 2 => vec1.data(2) := value;
when 1 => null;
when 0 => null;
end case;
end z;
function w (vec1 : in out Vkm_GenType;
value : in Base_Type ) return Vkm_GenType_Reference is
vec1_access : constant Vkm_GenType_Reference := (Vector => vec1'Unrestricted_Access);
begin
w(vec1, value);
return vec1_access;
end w;
----------------------------------------------------------------
procedure w (vec1 : in out Vkm_GenType;
value : in Base_Type ) is
begin
case vec1.Last_Index is
when 3 => vec1.data(3) := value;
when 2 => null;
when 1 => null;
when 0 => null;
end case;
end w;
----------------------------------------------------------------
procedure xy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).y(vec2.y);
end xy;
----------------------------------------------------------------
procedure xz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).z(vec2.y);
end xz;
----------------------------------------------------------------
procedure xw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).w(vec2.y);
end xw;
----------------------------------------------------------------
procedure yx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).x(vec2.y);
end yx;
----------------------------------------------------------------
procedure yz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).z(vec2.y);
end yz;
----------------------------------------------------------------
procedure yw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).w(vec2.y);
end yw;
----------------------------------------------------------------
procedure zx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).x(vec2.y);
end zx;
----------------------------------------------------------------
procedure zy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).y(vec2.y);
end zy;
----------------------------------------------------------------
procedure zw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).w(vec2.y);
end zw;
----------------------------------------------------------------
procedure wx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).x(vec2.y);
end wx;
----------------------------------------------------------------
procedure wy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).y(vec2.y);
end wy;
----------------------------------------------------------------
procedure wz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).z(vec2.y);
end wz;
----------------------------------------------------------------
procedure xyz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x)
.y(vec2.y)
.z(vec2.z);
end xyz;
----------------------------------------------------------------
procedure xyw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x)
.y(vec2.y)
.w(vec2.z);
end xyw;
----------------------------------------------------------------
procedure xzy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x)
.z(vec2.y)
.y(vec2.z);
end xzy;
----------------------------------------------------------------
procedure xzw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x)
.z(vec2.y)
.w(vec2.z);
end xzw;
----------------------------------------------------------------
procedure xwy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x)
.w(vec2.y)
.y(vec2.z);
end xwy;
----------------------------------------------------------------
procedure xwz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x)
.w(vec2.y)
.z(vec2.z);
end xwz;
----------------------------------------------------------------
procedure yxz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x)
.x(vec2.y)
.z(vec2.z);
end yxz;
----------------------------------------------------------------
procedure yxw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x)
.x(vec2.y)
.w(vec2.z);
end yxw;
----------------------------------------------------------------
procedure yzx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x)
.z(vec2.y)
.x(vec2.z);
end yzx;
----------------------------------------------------------------
procedure yzw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x)
.z(vec2.y)
.w(vec2.z);
end yzw;
----------------------------------------------------------------
procedure ywx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x)
.w(vec2.y)
.x(vec2.z);
end ywx;
----------------------------------------------------------------
procedure ywz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x)
.w(vec2.y)
.z(vec2.z);
end ywz;
----------------------------------------------------------------
procedure zxy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x)
.x(vec2.y)
.y(vec2.z);
end zxy;
----------------------------------------------------------------
procedure zxw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x)
.x(vec2.y)
.w(vec2.z);
end zxw;
----------------------------------------------------------------
procedure zyx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x)
.y(vec2.y)
.x(vec2.z);
end zyx;
----------------------------------------------------------------
procedure zyw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x)
.y(vec2.y)
.w(vec2.z);
end zyw;
----------------------------------------------------------------
procedure zwx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x)
.w(vec2.y)
.x(vec2.z);
end zwx;
----------------------------------------------------------------
procedure zwy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x)
.w(vec2.y)
.y(vec2.z);
end zwy;
----------------------------------------------------------------
procedure wxy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x)
.x(vec2.y)
.y(vec2.z);
end wxy;
----------------------------------------------------------------
procedure wxz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x)
.x(vec2.y)
.z(vec2.z);
end wxz;
----------------------------------------------------------------
procedure wyx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x)
.y(vec2.y)
.x(vec2.z);
end wyx;
----------------------------------------------------------------
procedure wyz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x)
.y(vec2.y)
.z(vec2.z);
end wyz;
----------------------------------------------------------------
procedure wzx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x)
.z(vec2.y)
.x(vec2.z);
end wzx;
----------------------------------------------------------------
procedure wzy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x)
.z(vec2.y)
.y(vec2.z);
end wzy;
----------------------------------------------------------------------------
procedure xyzw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).y(vec2.y).z(vec2.z).w(vec2.w);
end xyzw;
----------------------------------------------------------------
procedure xywz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).y(vec2.y).w(vec2.z).z(vec2.w);
end xywz;
----------------------------------------------------------------
procedure xzyw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).z(vec2.y).y(vec2.z).w(vec2.w);
end xzyw;
----------------------------------------------------------------
procedure xzwy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).z(vec2.y).w(vec2.z).y(vec2.w);
end xzwy;
----------------------------------------------------------------
procedure xwyz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).w(vec2.y).y(vec2.z).z(vec2.w);
end xwyz;
----------------------------------------------------------------
procedure xwzy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.x(vec2.x).w(vec2.y).z(vec2.z).y(vec2.w);
end xwzy;
----------------------------------------------------------------
procedure yxzw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).x(vec2.y).z(vec2.z).w(vec2.w);
end yxzw;
----------------------------------------------------------------
procedure yxwz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).x(vec2.y).w(vec2.z).z(vec2.w);
end yxwz;
----------------------------------------------------------------
procedure yzxw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).z(vec2.y).x(vec2.z).w(vec2.w);
end yzxw;
----------------------------------------------------------------
procedure yzwx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).z(vec2.y).w(vec2.z).x(vec2.w);
end yzwx;
----------------------------------------------------------------
procedure ywxz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).w(vec2.y).x(vec2.z).z(vec2.w);
end ywxz;
----------------------------------------------------------------
procedure ywzx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.y(vec2.x).w(vec2.y).z(vec2.z).x(vec2.w);
end ywzx;
----------------------------------------------------------------
procedure zxyw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).x(vec2.y).y(vec2.z).w(vec2.w);
end zxyw;
----------------------------------------------------------------
procedure zxwy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).x(vec2.y).w(vec2.z).y(vec2.w);
end zxwy;
----------------------------------------------------------------
procedure zyxw (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).y(vec2.y).x(vec2.z).w(vec2.w);
end zyxw;
----------------------------------------------------------------
procedure zywx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).y(vec2.y).w(vec2.z).x(vec2.w);
end zywx;
----------------------------------------------------------------
procedure zwxy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).w(vec2.y).x(vec2.z).y(vec2.w);
end zwxy;
----------------------------------------------------------------
procedure zwyx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.z(vec2.x).w(vec2.y).y(vec2.z).x(vec2.w);
end zwyx;
----------------------------------------------------------------
procedure wxyz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).x(vec2.y).y(vec2.z).z(vec2.w);
end wxyz;
----------------------------------------------------------------
procedure wxzy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).x(vec2.y).z(vec2.z).y(vec2.w);
end wxzy;
----------------------------------------------------------------
procedure wyxz (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).y(vec2.y).x(vec2.z).z(vec2.w);
end wyxz;
----------------------------------------------------------------
procedure wyzx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).y(vec2.y).z(vec2.z).x(vec2.w);
end wyzx;
----------------------------------------------------------------
procedure wzxy (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).z(vec2.y).x(vec2.z).y(vec2.w);
end wzxy;
----------------------------------------------------------------
procedure wzyx (vec1 : in out Vkm_GenType;
vec2 : in Vkm_GenType) is
begin
vec1.w(vec2.x).z(vec2.y).y(vec2.z).x(vec2.w);
end wzyx;
----------------------------------------------------------------------------
function Concatenate (Left, Right : in Vkm_GenType) return Vkm_GenType is
Result : Vkm_GenType(Left.Last_Index + Right.Last_Index + 1);
begin
Result.Copy(Left,Left.Length,0);
Result.Copy(Right,Right.Length,To_Vkm_Indices(Left.Length + 1));
return Result;
end Concatenate;
----------------------------------------------------------------------------
function Equals(left, right : in Vkm_GenType) return Vkm_Bool is
are_equal : Vkm_Bool := True;
begin
for index in Vkm_Indices'First .. left.last_index loop
if not (left.data(index) = right.data(index)) then
are_equal := False;
end if;
end loop;
return are_equal;
end Equals;
----------------------------------------------------------------------------
function Unary_Minus(instance : in Vkm_GenType) return Vkm_GenType is
result : Vkm_GenType(Last_Index => instance.last_index);
begin
for index in Vkm_Indices'First .. instance.last_index loop
result.data(index) := Unary_Minus(instance.data(index));
end loop;
return result;
end Unary_Minus;
----------------------------------------------------------------------------
function Componentwise_Multiply(left, right : in Vkm_GenType) return Vkm_GenType is
result : Vkm_GenType(last_index => left.last_index);
begin
for index in Vkm_Indices'First .. left.last_index loop
result.data(index) := Multiply(left.data(index), right.data(index));
end loop;
return result;
end Componentwise_Multiply;
--------------------------------------------------------------------------------
function Vector_By_Scalar_Multiply(left : in Vkm_GenType;
right : in Base_Type) return Vkm_GenType is
result : Vkm_GenType(last_index => left.last_index);
begin
for index in Vkm_Indices'First .. left.last_index loop
result.data(index) := Multiply(left.data(index), right);
end loop;
return result;
end Vector_By_Scalar_Multiply;
----------------------------------------------------------------------------
function Apply_Func_IV_IV_RV(Left, Right : in Vkm_GenType) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(Left.Length));
begin
for I in Vkm_Indices'First .. To_Vkm_Indices(Left.Length) loop
Result.data(I) := Func(Left.data(I), Right.data(I));
end loop;
return Result;
end Apply_Func_IV_IV_RV;
----------------------------------------------------------------------------
function Apply_Func_IS_IV_RV(Left : in Base_Type;
Right : in Vkm_GenType) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(Right.Length));
begin
for I in Vkm_Indices'First .. To_Vkm_Indices(Right.Length) loop
Result.data(I) := Func(Left, Right.data(I));
end loop;
return Result;
end Apply_Func_IS_IV_RV;
----------------------------------------------------------------------------
function Apply_Func_IV_IS_RV(Left : in Vkm_GenType;
Right : in Base_Type ) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(Left.Length));
begin
for I in Vkm_Indices'First .. To_Vkm_Indices(Left.Length) loop
Result.data(I) := Func(Left.data(I), Right);
end loop;
return Result;
end Apply_Func_IV_IS_RV;
----------------------------------------------------------------------------
function Apply_Func_IV_RV(A : in Vkm_GenType) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(A.Length));
begin
for I in Vkm_Indices'First .. To_Vkm_Indices(A.Length) loop
Result.data(I) := Func(A.data(I));
end loop;
return Result;
end Apply_Func_IV_RV;
function Apply_Func_IV_OV_RV(IV1 : in Vkm_GenType;
OV1 : out Vkm_GenType) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(IV1.Length));
begin
for I in Vkm_Indices'First .. To_Vkm_Indices(IV1.Length) loop
Result.data(I) := Func(IV1.data(I), OV1.data(I));
end loop;
return Result;
end Apply_Func_IV_OV_RV;
----------------------------------------------------------------------------
function Apply_Func_IV_IV_IV_RV(IV1, IV2, IV3 : in Vkm_GenType) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(IV1.Length));
begin
for I in Vkm_Indices'First .. To_Vkm_Indices(IV1.Length) loop
Result.data(I) := Func(IV1.data(I),IV2.data(I),IV3.data(I));
end loop;
return Result;
end Apply_Func_IV_IV_IV_RV;
----------------------------------------------------------------------------
function Apply_Func_IV_IV_IS_RV(IV1, IV2 : in Vkm_GenType;
IS1 : in Base_Type) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(IV1.Length));
begin
for I in Vkm_Indices'First .. To_Vkm_Indices(IV1.Length) loop
Result.data(I) := Func(IV1.data(I),IV2.data(I),IS1);
end loop;
return Result;
end Apply_Func_IV_IV_IS_RV;
----------------------------------------------------------------------------
function Apply_Func_IV_IS_IS_RV(IV1 : in Vkm_GenType;
IS1, IS2 : in Base_Type) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(IV1.Length));
begin
for I in Vkm_Indices'First .. To_Vkm_Indices(IV1.Length) loop
Result.data(I) := Func(IV1.data(I),IS1,IS2);
end loop;
return Result;
end Apply_Func_IV_IS_IS_RV;
----------------------------------------------------------------------------
function Apply_Func_IS_IS_IV_RV(IS1, IS2 : in Base_Type;
IV1 : in Vkm_GenType) return Vkm_GenType is
Result : Vkm_GenType(Last_Index => To_Vkm_Indices(IV1.Length));
begin
for I in Result.data'Range loop
Result.data(I) := Func(IS1,IS2,IV1.data(I));
end loop;
return Result;
end Apply_Func_IS_IS_IV_RV;
----------------------------------------------------------------------------
function Apply_Func_IV_IV_OV_RV(IV1, IV2 : in Vkm_GenType;
OV1 : out Vkm_GenType) return Vkm_GenType is
result : Vkm_GenType(last_index => IV1.last_index);
begin
for index in result.data'Range loop
result.data(index) := Func(IV1.data(index), IV2.data(index), OV1.data(index));
end loop;
return result;
end Apply_Func_IV_IV_OV_RV;
----------------------------------------------------------------------------
procedure Apply_Func_IV_IV_OV_OV(IV1, IV2 : in Vkm_GenType;
OV1, OV2 : out Vkm_GenType) is
begin
for index in IV1.data'Range loop
Func(IV1.data(index), IV2.data(index),
OV1.data(index), OV2.data(index));
end loop;
end Apply_Func_IV_IV_OV_OV;
----------------------------------------------------------------------------
function Apply_Func_IV_IV_IS_IS_RV(
IV1, IV2 : in Vkm_GenType;
IS1, IS2 : in Base_Type ) return Vkm_GenType is
result : Vkm_GenType(last_index => IV1.last_index);
begin
for index in IV1.data'Range loop
result.data(index) := Func(IV1.data(index),
IV2.data(index),
IS1,
IS2);
end loop;
return result;
end Apply_Func_IV_IV_IS_IS_RV;
end Vulkan.Math.GenType;
|
oeis/158/A158627.asm | neoneye/loda-programs | 11 | 162330 | <filename>oeis/158/A158627.asm
; A158627: a(n) = 484*n^2-22.
; Submitted by <NAME>
; 462,1914,4334,7722,12078,17402,23694,30954,39182,48378,58542,69674,81774,94842,108878,123882,139854,156794,174702,193578,213422,234234,256014,278762,302478,327162,352814,379434,407022,435578,465102,495594,527054,559482,592878,627242,662574,698874,736142,774378,813582,853754,894894,937002,980078,1024122,1069134,1115114,1162062,1209978,1258862,1308714,1359534,1411322,1464078,1517802,1572494,1628154,1684782,1742378,1800942,1860474,1920974,1982442,2044878,2108282,2172654,2237994,2304302,2371578
add $0,1
pow $0,2
mul $0,22
sub $0,1
mul $0,22
|
tier-1/fann/source/thin/fann_c-pointers.ads | charlie5/cBound | 2 | 25542 | -- This file is generated by SWIG. Please do *not* modify by hand.
--
with interfaces.C;
package fann_c.Pointers is
-- FILE_Pointer
--
type FILE_Pointer is access all fann_c.FILE;
-- FILE_Pointers
--
type FILE_Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.Pointers.FILE_Pointer;
-- fann_type_Pointer
--
type fann_type_Pointer is access all fann_c.fann_type;
-- fann_type_Pointers
--
type fann_type_Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.Pointers.fann_type_Pointer;
-- fann_errno_enum_Pointer
--
type fann_errno_enum_Pointer is access all fann_c.fann_errno_enum;
-- fann_errno_enum_Pointers
--
type fann_errno_enum_Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.Pointers.fann_errno_enum_Pointer;
-- fann_train_enum_Pointer
--
type fann_train_enum_Pointer is access all fann_c.fann_train_enum;
-- fann_train_enum_Pointers
--
type fann_train_enum_Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.Pointers.fann_train_enum_Pointer;
-- fann_activationfunc_enum_Pointer
--
type fann_activationfunc_enum_Pointer is access all fann_c.fann_activationfunc_enum;
-- fann_activationfunc_enum_Pointers
--
type fann_activationfunc_enum_Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.Pointers.fann_activationfunc_enum_Pointer;
-- fann_errorfunc_enum_Pointer
--
type fann_errorfunc_enum_Pointer is access all fann_c.fann_errorfunc_enum;
-- fann_errorfunc_enum_Pointers
--
type fann_errorfunc_enum_Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.Pointers.fann_errorfunc_enum_Pointer;
-- fann_stopfunc_enum_Pointer
--
type fann_stopfunc_enum_Pointer is access all fann_c.fann_stopfunc_enum;
-- fann_stopfunc_enum_Pointers
--
type fann_stopfunc_enum_Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.Pointers.fann_stopfunc_enum_Pointer;
-- fann_nettype_enum_Pointer
--
type fann_nettype_enum_Pointer is access all fann_c.fann_nettype_enum;
-- fann_nettype_enum_Pointers
--
type fann_nettype_enum_Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.Pointers.fann_nettype_enum_Pointer;
end fann_c.Pointers;
|
Cubical/Algebra/RingSolver/AlmostRing.agda | dan-iel-lee/cubical | 0 | 5255 | <reponame>dan-iel-lee/cubical
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.RingSolver.AlmostRing where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Sigma
open import Cubical.Data.Nat using (ℕ)
open import Cubical.Algebra.Semigroup
open import Cubical.Algebra.Monoid
open import Cubical.Algebra.AbGroup
private
variable
ℓ : Level
record IsAlmostRing {R : Type ℓ}
(0r 1r : R) (_+_ _·_ : R → R → R) (-_ : R → R) : Type ℓ where
constructor isalmostring
field
+IsMonoid : IsMonoid 0r _+_
·IsMonoid : IsMonoid 1r _·_
+Comm : (x y : R) → x + y ≡ y + x
·Comm : (x y : R) → x · y ≡ y · x
·DistR+ : (x y z : R) → x · (y + z) ≡ (x · y) + (x · z)
·DistL+ : (x y z : R) → (x + y) · z ≡ (x · z) + (y · z)
-Comm· : (x y : R) → - (x · y) ≡ (- x) · y
-Dist+ : (x y : R) → - (x + y) ≡ (- x) + (- y)
0LeftAnnihilates : (x : R) → 0r · x ≡ 0r
0RightAnnihilates : (x : R) → x · 0r ≡ 0r
open IsMonoid +IsMonoid public
renaming
( assoc to +Assoc
; identity to +Identity
; lid to +Lid
; rid to +Rid
; isSemigroup to +IsSemigroup)
open IsMonoid ·IsMonoid public
renaming
( assoc to ·Assoc
; identity to ·Identity
; lid to ·Lid
; rid to ·Rid
; isSemigroup to ·IsSemigroup )
hiding
( is-set ) -- We only want to export one proof of this
record AlmostRing : Type (ℓ-suc ℓ) where
constructor almostring
field
Carrier : Type ℓ
0r : Carrier
1r : Carrier
_+_ : Carrier → Carrier → Carrier
_·_ : Carrier → Carrier → Carrier
-_ : Carrier → Carrier
isAlmostRing : IsAlmostRing 0r 1r _+_ _·_ -_
infixl 9 _^_
infixl 8 _·_
infixl 7 -_
infixl 6 _+_
infixl 6 _-_
open IsAlmostRing isAlmostRing public
_^_ : Carrier → ℕ → Carrier
x ^ 0 = 1r
x ^ ℕ.suc k = x · (x ^ k)
_-_ : Carrier → Carrier → Carrier
x - y = x + (- y)
-- Extractor for the carrier type
⟨_⟩ : AlmostRing → Type ℓ
⟨_⟩ = AlmostRing.Carrier
isSetAlmostRing : (R : AlmostRing {ℓ}) → isSet ⟨ R ⟩
isSetAlmostRing R = R .AlmostRing.isAlmostRing .IsAlmostRing.·IsMonoid .IsMonoid.isSemigroup .IsSemigroup.is-set
module Theory (R : AlmostRing {ℓ}) where
open AlmostRing R
0IsSelfinverse : - 0r ≡ 0r
0IsSelfinverse = - 0r ≡⟨ cong -_ (sym (·Lid 0r)) ⟩
- (1r · 0r) ≡⟨ -Comm· 1r 0r ⟩
(- 1r) · 0r ≡⟨ 0RightAnnihilates (- 1r) ⟩
0r ∎
·CommRight : (x y z : ⟨ R ⟩)
→ x · y · z ≡ x · z · y
·CommRight x y z = x · y · z ≡⟨ sym (·Assoc _ _ _) ⟩
x · (y · z) ≡⟨ cong (λ u → x · u) (·Comm _ _) ⟩
x · (z · y) ≡⟨ ·Assoc _ _ _ ⟩
x · z · y ∎
+ShufflePairs : (a b c d : ⟨ R ⟩)
→ (a + b) + (c + d) ≡ (a + c) + (b + d)
+ShufflePairs a b c d =
(a + b) + (c + d) ≡⟨ +Assoc _ _ _ ⟩
((a + b) + c) + d ≡⟨ cong (λ u → u + d) (sym (+Assoc _ _ _)) ⟩
(a + (b + c)) + d ≡⟨ cong (λ u → (a + u) + d) (+Comm _ _) ⟩
(a + (c + b)) + d ≡⟨ cong (λ u → u + d) (+Assoc _ _ _) ⟩
((a + c) + b) + d ≡⟨ sym (+Assoc _ _ _) ⟩
(a + c) + (b + d) ∎
|
Testing Scripts/Trackpad Test/Source/Trackpad Test.applescript | freegeek-pdx/macOS-Testing-and-Deployment-Scripts | 0 | 4443 | <reponame>freegeek-pdx/macOS-Testing-and-Deployment-Scripts<filename>Testing Scripts/Trackpad Test/Source/Trackpad Test.applescript
-- By: <NAME>
-- For: MacLand @ Free Geek
--
-- MIT License
--
-- Copyright (c) 2021 Free Geek
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--
-- Version: 2022.2.22-1
-- App Icon is “Victory Hand” from Twemoji (https://twemoji.twitter.com/) by Twitter (https://twitter.com)
-- Licensed under CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
use AppleScript version "2.7"
use scripting additions
repeat -- dialogs timeout when screen is asleep or locked (just in case)
set isAwake to true
try
set isAwake to ((do shell script ("bash -c " & (quoted form of "/usr/libexec/PlistBuddy -c 'Print :0:IOPowerManagement:CurrentPowerState' /dev/stdin <<< \"$(ioreg -arc IODisplayWrangler -k IOPowerManagement -d 1)\""))) is equal to "4")
end try
set isUnlocked to true
try
set isUnlocked to ((do shell script ("bash -c " & (quoted form of "/usr/libexec/PlistBuddy -c 'Print :IOConsoleUsers:0:CGSSessionScreenIsLocked' /dev/stdin <<< \"$(ioreg -ac IORegistryEntry -k IOConsoleUsers -d 1)\""))) is not equal to "true")
end try
if (isAwake and isUnlocked) then
exit repeat
else
delay 1
end if
end repeat
try
set infoPlistPath to ((POSIX path of (path to me)) & "Contents/Info.plist")
((infoPlistPath as POSIX file) as alias)
set intendedAppName to "Trackpad Test" -- Hardcode intended App name because Name or Bundle Identifier changes should not be done lightly or accidentally.
try
do shell script ("/usr/libexec/PlistBuddy -c 'Print :FGBuiltByMacLandScriptBuilder' " & (quoted form of infoPlistPath))
((((POSIX path of (path to me)) & "Contents/MacOS/" & intendedAppName) as POSIX file) as alias)
on error
try
activate
end try
display alert "
“" & (name of me) & "” must be built by the “MacLand Script Builder” script." buttons {"Quit"} default button 1 as critical
quit
delay 10
end try
set AppleScript's text item delimiters to "-"
set intendedBundleIdentifier to ("org.freegeek." & ((words of intendedAppName) as string))
set currentBundleIdentifier to ((do shell script ("/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' " & (quoted form of infoPlistPath))) as string)
if (currentBundleIdentifier is not equal to intendedBundleIdentifier) then error "“" & (name of me) & "” does not have the correct Bundle Identifier.
Current Bundle Identifier:
" & currentBundleIdentifier & "
Intended Bundle Identifier:
" & intendedBundleIdentifier
on error checkInfoPlistError
if (checkInfoPlistError does not start with "Can’t make file") then
try
activate
end try
display alert checkInfoPlistError buttons {"Quit"} default button 1 as critical
quit
delay 10
end if
end try
try
set mainScptPath to ((POSIX path of (path to me)) & "Contents/Resources/Scripts/main.scpt")
((mainScptPath as POSIX file) as alias)
do shell script "osadecompile " & (quoted form of mainScptPath)
error "
“" & (name of me) & "” must be exported as a Run-Only Script."
on error checkReadOnlyErrorMessage
if ((checkReadOnlyErrorMessage does not contain "errOSASourceNotAvailable") and (checkReadOnlyErrorMessage does not start with "Can’t make file")) then
activate
display alert checkReadOnlyErrorMessage buttons {"Quit"} default button 1 as critical
quit
delay 10
end if
end try
try
(("/Applications/FingerMgmt.app" as POSIX file) as alias)
on error
try
activate
end try
display alert "“Trackpad Test” requires “FingerMgmt”" message "“FingerMgmt” must be installed in the “Applications” folder." buttons {"Quit", "Download “FingerMgmt”"} cancel button 1 default button 2 as critical
do shell script "open 'https://github.com/jnordberg/FingerMgmt/releases'"
quit
delay 10
end try
set dialogIconName to "applet"
try
((((POSIX path of (path to me)) & "Contents/Resources/" & (name of me) & ".icns") as POSIX file) as alias)
set dialogIconName to (name of me)
end try
set systemVersion to (system version of (system info))
considering numeric strings
set isMojaveOrNewer to (systemVersion ≥ "10.14")
set isCatalinaOrNewer to (systemVersion ≥ "10.15")
end considering
if (isMojaveOrNewer) then
try
tell application "System Events" to every window -- To prompt for Automation access on Mojave
on error automationAccessErrorMessage number automationAccessErrorNumber
if (automationAccessErrorNumber is equal to -1743) then
try
tell application "System Preferences"
try
activate
end try
reveal ((anchor "Privacy") of (pane id "com.apple.preference.security"))
end tell
end try
try
activate
end try
try
display dialog "“" & (name of me) & "” must be allowed to control and perform actions in “System Events” to be able to function.
USE THE FOLLOWING STEPS TO FIX THIS ISSUE:
• Open the “System Preferences” application.
• Click the “Security & Privacy” preference pane.
• Select the “Privacy” tab.
• Select “Automation” in the source list on the left.
• Find “" & (name of me) & "” in the list on the right and turn on the “System Events” checkbox underneath it.
• Relaunch “" & (name of me) & "” (using the button below)." buttons {"Quit", "Relaunch “" & (name of me) & "”"} cancel button 1 default button 2 with title (name of me) with icon dialogIconName
try
do shell script "osascript -e 'delay 0.5' -e 'repeat while (application \"" & (POSIX path of (path to me)) & "\" is running)' -e 'delay 0.5' -e 'end repeat' -e 'do shell script \"open -n -a \\\"" & (POSIX path of (path to me)) & "\\\"\"' > /dev/null 2>&1 &"
end try
end try
quit
delay 10
end if
end try
end if
try
tell application "System Events" to tell application process "Finder" to (get windows)
on error (assistiveAccessTestErrorMessage)
if ((offset of "not allowed assistive" in assistiveAccessTestErrorMessage) > 0) then
if (isMojaveOrNewer) then
try
tell application ("Finger" & "Mgmt") to every window -- To prompt for Automation access on Mojave
on error automationAccessErrorMessage number automationAccessErrorNumber
if (automationAccessErrorNumber is equal to -1743) then
try
tell application "System Preferences"
try
activate
end try
reveal ((anchor "Privacy") of (pane id "com.apple.preference.security"))
end tell
end try
try
activate
end try
try
display dialog "“" & (name of me) & "” must be allowed to control and perform actions in “FingerMgmt” to be able to function.
USE THE FOLLOWING STEPS TO FIX THIS ISSUE:
• Open the “System Preferences” application.
• Click the “Security & Privacy” preference pane.
• Select the “Privacy” tab.
• Select “Automation” in the source list on the left.
• Find “" & (name of me) & "” in the list on the right and turn on the “FingerMgmt” checkbox underneath it.
• Relaunch “" & (name of me) & "” (using the button below)." buttons {"Quit", "Relaunch “" & (name of me) & "”"} cancel button 1 default button 2 with title (name of me) with icon dialogIconName
try
do shell script "osascript -e 'delay 0.5' -e 'repeat while (application \"" & (POSIX path of (path to me)) & "\" is running)' -e 'delay 0.5' -e 'end repeat' -e 'do shell script \"open -n -a \\\"" & (POSIX path of (path to me)) & "\\\"\"' > /dev/null 2>&1 &"
end try
end try
quit
delay 10
end if
end try
try
with timeout of 1 second
tell application ("Finger" & "Mgmt") to quit
end timeout
end try
end if
try
tell application "Finder" to reveal (path to me)
end try
try
tell application "System Preferences"
try
activate
end try
reveal ((anchor "Privacy_Accessibility") of (pane id "com.apple.preference.security"))
end tell
end try
try
activate
end try
try
display dialog "“" & (name of me) & "” must be allowed to control this computer using Accessibility Features to be able to function.
USE THE FOLLOWING STEPS TO FIX THIS ISSUE:
• Open the “System Preferences” application.
• Click the “Security & Privacy” preference pane.
• Select the “Privacy” tab.
• Select “Accessibility” in the source list on the left.
• Click the Lock icon at the bottom left of the window, enter the administrator username and password, and then click Unlock.
• Find “" & (name of me) & "” in the list on the right and turn on the checkbox next to it. If “" & (name of me) & "” IS NOT in the list, drag-and-drop the app icon from Finder into the list.
• Relaunch “" & (name of me) & "” (using the button below)." buttons {"Quit", "Relaunch “" & (name of me) & "”"} cancel button 1 default button 2 with title (name of me) with icon dialogIconName
try
do shell script "osascript -e 'delay 0.5' -e 'repeat while (application \"" & (POSIX path of (path to me)) & "\" is running)' -e 'delay 0.5' -e 'end repeat' -e 'do shell script \"open -n -a \\\"" & (POSIX path of (path to me)) & "\\\"\"' > /dev/null 2>&1 &"
end try
end try
quit
delay 10
end if
end try
set adminUsername to "Staff"
if (isCatalinaOrNewer) then set adminUsername to "staff"
set adminPassword to "[MACLAND SCRIPT BUILDER WILL REPLACE THIS PLACEHOLDER WITH OBFUSCATED ADMIN PASSWORD]"
set buildInfoPath to ((POSIX path of (path to shared documents folder)) & "Build Info/")
try
(((buildInfoPath & ".fgSetupSkipped") as POSIX file) as alias)
try
do shell script ("mkdir " & (quoted form of buildInfoPath))
end try
try
set AppleScript's text item delimiters to "-"
do shell script ("touch " & (quoted form of (buildInfoPath & ".fgLaunchAfterSetup-org.freegeek." & ((words of (name of me)) as string)))) user name adminUsername password <PASSWORD> with administrator privileges
end try
try
-- For some reason, on Big Sur, apps are not opening unless we specify "-n" to "Open a new instance of the application(s) even if one is already running." All scripts have LSMultipleInstancesProhibited to this will not actually ever open a new instance.
do shell script "open -n -a '/Applications/Test Boot Setup.app'"
end try
quit
delay 10
end try
try
activate
end try
display dialog " 👉 Trackpad Test will guide you through a
series of 6 Click Tests and 6 Touch Tests.
☝️ First, you will be presented with 6 Click Tests
to make sure that the trackpad clicks properly
in a variety of commonly used trackpad zones.
⚠️ These click tests WILL NOT detect whether you
actually clicked within the correct zone of the
trackpad, it is just a guide for you to test with.
🚫 If the trackpad doesn't click properly, doesn't
respond instantly, or feels stiff, sticky, or funky
in a certain zone, CONSULT AN INSTRUCTOR
before continuing on with the next tests.
✌️ After the 6 Click Tests are complete, you'll be
guided through the 6 Touch Tests.
‼️ DO NOT USE A MOUSE FOR THESE TESTS ‼️" buttons {"Quit", "Continue to Click Tests"} cancel button 1 default button 2 with title "Trackpad Test"
repeat
try
activate
end try
display dialog " Trackpad Click Test 1 of 6:
⬅️ Click Button with Finger in The Middle of Left Edge ⬅️" buttons {"Click Me with Finger in MIDDLE OF LEFT EDGE of Trackpad"} with title "Trackpad Test"
try
activate
end try
display dialog " Trackpad Click Test 2 of 6:
⏺ Click Button with Finger in The Center ⏺" buttons {"Click Me with Finger in THE CENTER of Trackpad"} with title "Trackpad Test"
try
activate
end try
display dialog " Trackpad Click Test 3 of 6:
➡️ Click Button with Finger in The Middle of Right Edge ➡️" buttons {"Click Me with Finger in MIDDLE OF RIGHT EDGE of Trackpad"} with title "Trackpad Test"
try
activate
end try
display dialog " Trackpad Click Test 4 of 6:
↘️ Click Button with Finger in The Bottom Right Corner ↘️" buttons {"Click Me with Finger in BOTTOM RIGHT CORNER of Trackpad"} with title "Trackpad Test"
try
activate
end try
display dialog " Trackpad Click Test 5 of 6:
⬇️ Click Button with Finger in The Center of Bottom Edge ⬇️" buttons {"Click Me with Finger in CENTER OF BOTTOM EDGE of Trackpad"} with title "Trackpad Test"
try
activate
end try
display dialog " Trackpad Click Test 6 of 6:
↙️ Click Button with Finger in The Bottom Left Corner ↙️" buttons {"Click Me with Finger in BOTTOM LEFT CORNER of Trackpad"} with title "Trackpad Test"
try
activate
end try
display dialog " FINISHED Trackpad Click Tests
✅ CLICK TESTS PASSED IF:
⁃ The click action responded instantly in each zone.
⁃ The click action never felt stiff, sticky, or funky.
❌ CLICK TESTS FAILED IF:
⁃ The trackpad didn't click properly.
⁃ The click action didn't respond instantly.
⁃ The click action felt stiff, sticky, or funky in any zone.
‼️ CONSULT AN INSTRUCTOR IF THERE WERE ANY ISSUES ‼️
👉 When you're ready, continue to Touch Tests to open
an app called “FingerMgmt” which will allow you
to see where the trackpad has detected fingers.
✌️ Then, you will be guided through 6 Touch Tests to
perform while watching what “FingerMgmt” detects.
‼️ DO NOT USE A MOUSE FOR THESE TESTS ‼️" buttons {"Redo Click Tests", "Quit", "Continue to Touch Tests"} cancel button 2 default button 3 with title "Trackpad Test"
if (button returned of result) is "Continue to Touch Tests" then exit repeat
end repeat
repeat
repeat
if (application ("Finger" & "Mgmt") is running) then
try
with timeout of 1 second
tell application ("Finger" & "Mgmt") to quit
end timeout
end try
delay 1
else
exit repeat
end if
end repeat
try
tell application ("Finger" & "Mgmt") to activate
end try
tell application "System Events" to tell application process ("Finger" & "Mgmt")
repeat
if ((count of windows) = 1) then exit repeat
delay 1
end repeat
tell (first window whose subrole is "AXStandardWindow")
perform action "AXZoomWindow" of (first button whose subrole is "AXFullScreenButton")
perform action "AXRaise"
end tell
end tell
--repeat
-- if (application ("Finger" & "Mgmt") is not running) then exit repeat
-- tell application "System Events" to tell application process ("Finger" & "Mgmt")
-- if (((count of windows) = 0)) then
-- try
-- with timeout of 1 second
-- tell application ("Finger" & "Mgmt") to quit
-- end timeout
-- end try
-- exit repeat
-- end if
-- end tell
-- delay 1
--end repeat
tell application ("Finger" & "Mgmt")
repeat
try
try
activate
end try
display dialog " Trackpad Touch Test 1 of 6:
Move ONE FINGER along ALL FOUR EDGES of the trackpad.
✅ Continue if where you touch the trackpad is
exactly what you see in “FingerMgmt”.
🚫 STOP AND CONSULT INSTRUCTOR IF ANY ISSUES" buttons {"Hide This Window for 5 Seconds", "Continue to Next Test"} cancel button 1 default button 2 with title "Trackpad Test"
exit repeat
on error
delay 5
end try
end repeat
repeat
try
try
activate
end try
display dialog " Trackpad Touch Test 2 of 6:
Move ONE FINGER around the ENTIRE SURFACE of the trackpad.
✅ Continue if where you touch the trackpad is
exactly what you see in “FingerMgmt”.
🚫 STOP AND CONSULT INSTRUCTOR IF ANY ISSUES" buttons {"Hide This Window for 5 Seconds", "Continue to Next Test"} cancel button 1 default button 2 with title "Trackpad Test"
exit repeat
on error
delay 5
end try
end repeat
repeat
try
try
activate
end try
display dialog " Trackpad Touch Test 3 of 6:
Place TWO FINGERS on the trackpad and
move them up and down and left and right.
✅ Continue if where you touch the trackpad is
exactly what you see in “FingerMgmt”.
🚫 STOP AND CONSULT INSTRUCTOR IF ANY ISSUES" buttons {"Hide This Window for 5 Seconds", "Continue to Next Test"} cancel button 1 default button 2 with title "Trackpad Test"
exit repeat
on error
delay 5
end try
end repeat
repeat
try
try
activate
end try
display dialog " Trackpad Touch Test 4 of 6:
Place THREE FINGERS on the trackpad and
move them up and down and left and right.
✅ Continue if where you touch the trackpad is
exactly what you see in “FingerMgmt”.
🚫 STOP AND CONSULT INSTRUCTOR IF ANY ISSUES" buttons {"Hide This Window for 5 Seconds", "Continue to Next Test"} cancel button 1 default button 2 with title "Trackpad Test"
exit repeat
on error
delay 5
end try
end repeat
repeat
try
try
activate
end try
display dialog " Trackpad Touch Test 5 of 6:
Place FOUR FINGERS on the trackpad and
move them up and down and left and right.
✅ Continue if where you touch the trackpad is
exactly what you see in “FingerMgmt”.
🚫 STOP AND CONSULT INSTRUCTOR IF ANY ISSUES" buttons {"Hide This Window for 5 Seconds", "Continue to Next Test"} cancel button 1 default button 2 with title "Trackpad Test"
exit repeat
on error
delay 5
end try
end repeat
repeat
try
try
activate
end try
display dialog " Trackpad Touch Test 6 of 6:
Place FIVE FINGERS on the trackpad and
move them up and down and left and right.
✅ Finish if where you touch the trackpad is
exactly what you see in “FingerMgmt”.
🚫 STOP AND CONSULT INSTRUCTOR IF ANY ISSUES" buttons {"Hide This Window for 5 Seconds", "Finish Touch Tests"} cancel button 1 default button 2 with title "Trackpad Test"
exit repeat
on error
delay 5
end try
end repeat
quit
end tell
try
activate
end try
try
display dialog " FINISHED Trackpad Touch Tests
✅ TOUCH TESTS PASSED IF:
⁃ The trackpad always responded instantly.
⁃ The trackpad had no dead or rough zones.
⁃ Exactly where you touched the trackpad
was exactly what you saw in “FingerMgmt”.
❌ TOUCH TESTS FAILED IF:
⁃ The trackpad is physically damaged in any way.
⁃ The trackpad didn't respond instantly.
⁃ The trackpad had any dead zones.
⁃ Exactly where you touched the trackpad
WAS NOT exactly what you saw in “FingerMgmt”.
👍 TRACKPAD TEST PASSED IF EVERY SINGLE
CLICK TEST AND TOUCH TEST PASSED!
‼️ CONSULT INSTRUCTOR IF THERE WERE ANY ISSUES ‼️" buttons {"Redo Touch Tests", "Done"} cancel button 1 default button 2 with title "Trackpad Test"
exit repeat
end try
end repeat
try
(("/Applications/Keyboard Test.app" as POSIX file) as alias)
if (application ("Keyboard" & " Test") is not running) then
try
activate
end try
display alert "
Would you like to launch “Keyboard Test”?" buttons {"No", "Yes"} cancel button 1 default button 2 giving up after 15
do shell script "open -n -a '/Applications/Keyboard Test.app'"
end if
end try
|
include/sf-audio-soundbuffer.adb | Fabien-Chouteau/ASFML | 0 | 3857 | with Interfaces.C.Strings;
package body Sf.Audio.SoundBuffer is
use Interfaces.C.Strings;
--//////////////////////////////////////////////////////////
--/ Create a new sound buffer and load it from a file
--/
--/ @param Filename Path of the music file to open
--/
--/ @return A new sfSoundBuffer object (NULL if failed)
--/
--//////////////////////////////////////////////////////////
function CreateFromFile (Filename : String) return sfSoundBuffer_Ptr is
function Internal (Filename : chars_ptr) return sfSoundBuffer_Ptr;
pragma Import (C, Internal, "sfSoundBuffer_createFromFile");
Temp : chars_ptr := New_String (Filename);
R : sfSoundBuffer_Ptr := Internal (Temp);
begin
Free (Temp);
return R;
end CreateFromFile;
--//////////////////////////////////////////////////////////
--/ Save a sound buffer to a file
--/
--/ @param SoundBuffer Sound buffer to save
--/ @param Filename Path of the sound file to write
--/
--/ @return sfTrue if saving has been successful
--/
--//////////////////////////////////////////////////////////
function SaveToFile (SoundBuffer : sfSoundBuffer_Ptr; Filename : String) return sfBool is
function Internal (SoundBuffer : sfSoundBuffer_Ptr; Filename : chars_ptr) return sfBool;
pragma Import (C, Internal, "sfSoundBuffer_saveToFile");
Temp : chars_ptr := New_String (Filename);
R : sfBool := Internal (SoundBuffer, Temp);
begin
Free (Temp);
return R;
end SaveToFile;
end Sf.Audio.SoundBuffer;
|
3/HelloWorld.asm | 91fc7b/SLAE64 | 0 | 25945 | <reponame>91fc7b/SLAE64
global _start
section .text
_start:
xor rax, rax
add rax, 1
mov rdi, rax
push 0x0a646c72
mov rbx, 0x6f57206f6c6c6548
push rbx
mov rsi, rsp
xor rdx, rdx
add rdx, 12
syscall
xor rax, rax
add rax, 60
xor rdi, rdi
syscall
|
source/phase_vertex_cc.asm | stanford-mast/Grazelle-PPoPP18 | 19 | 15774 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Grazelle
; High performance, hardware-optimized graph processing engine.
; Targets a single machine with one or more x86-based sockets.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Authored by <NAME>
; Department of Electrical Engineering, Stanford University
; (c) 2015-2018
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; phase_vertex_cc.asm
; Implementation of the Vertex phase for Connected Components.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
INCLUDE constants.inc
INCLUDE graphdata.inc
INCLUDE phasehelpers.inc
INCLUDE registers.inc
INCLUDE threadhelpers.inc
_TEXT SEGMENT
; --------- MACROS ------------------------------------------------------------
; Initializes required state for the Vertex phase.
vertex_op_initialize MACRO
; perform common initialization tasks
phase_helper_set_base_addrs
; compensate for the first vertex assigned to be processed (assignment passed as a parameter in rcx)
shr rcx, 3
add r_vaccum, rcx
ENDM
; Performs an iteration of the Vertex phase at the specified index.
vertex_op_iteration_at_index MACRO
; calculate the base index for write, which is just (index << 3)
; to get a byte offset, just multiply by 8 (another << 3)
mov r_woffset, rcx
shl r_woffset, 6
; zero out the assigned vertices in the accumulators
vmovntpd YMMWORD PTR [r_vaccum+r_woffset+0], ymm_caccum1
vmovntpd YMMWORD PTR [r_vaccum+r_woffset+32], ymm_caccum2
ENDM
; Performs an iteration of the Vertex phase at the specified index.
; This is the non-vectorized version.
vertex_op_iteration_at_index_novec MACRO
; calculate the base index for write, which is just (index << 0)
; to get a byte offset, just multiply by 8 (another << 3)
mov r_woffset, rcx
shl r_woffset, 3
; zero out the assigned vertex in the accumulator
movnti QWORD PTR [r_vaccum+r_woffset], r10
ENDM
; --------- PHASE CONTROL FUNCTION --------------------------------------------
; See "phases.h" for documentation.
perform_vertex_phase_cc PROC PUBLIC
; save non-volatile registers used throughout this phase
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
; initialize
vertex_op_initialize
IFDEF EXPERIMENT_WITHOUT_VECTORS
; the job of this phase is to zero out the accumulator, so create a zero-valued register for that purpose
xor r10, r10
ELSE
; the job of this phase is to zero out the accumulator, so initialize some AVX registers for that purpose
vxorpd ymm_caccum1, ymm_caccum1, ymm_caccum1
vxorpd ymm_caccum2, ymm_caccum2, ymm_caccum2
ENDIF
; calculate the number of total iterations across all threads based on the number of vertices
; by the time this is done, rdx stores the number of iterations
IFDEF EXPERIMENT_WITHOUT_VECTORS
; where V is the number of vertices, number of iterations is equal to (V/64) + (V%64 ? 1 : 0)
; number of vertices is passed in rdx
mov rcx, rdx
shr rdx, 6
and rcx, 63
ELSE
; where V is the number of vertices, number of iterations is equal to (V/512) + (V%512 ? 1 : 0)
; number of vertices is passed in rdx
mov rcx, rdx
shr rdx, 9
and rcx, 511
ENDIF
je skip_add_extra_iteration
inc rdx
skip_add_extra_iteration:
; extract thread information useful as loop controls, assigning chunks to each thread round-robin
; formulas:
; assignment = #iterations / #total_threads
; addon = #iterations % #total_threads < global_thread_id ? 1 : 0
; prev_addons = min(#iterations % #total_threads, global_thread_id)
;
; base (rsi) = (assignment * global_thread_id) + prev_addons
; inc = 1
; max (rdi) = base + assignment + addon - 1
; first, perform the unsigned division by setting rdx:rax = #iterations and dividing by #total_threads
; afterwards, rax contains the quotient ("assignment" in the formulas above) and rdx contains the remainder
mov rax, rdx
xor rdx, rdx
xor rcx, rcx
threads_helper_get_threads_per_group ecx
div rcx
; to calculate other values using total_threads, extract it to rcx
; can be used directly to obtain "addon" (rbx) and "prev_addons" (rsi)
threads_helper_get_local_thread_id ecx
xor rbx, rbx
mov rsi, rdx
mov rdi, 0000000000000001h
cmp rcx, rdx
cmovl rbx, rdi
cmovl rsi, rcx
; create some partial values using the calculated quantities
; rsi (base) = prev_addons - this was done above, rdi (max) = assignment + addon - 1
; note that because we are using "jge" below and not "jg", we skip the -1, since "jge" requires that rdi be (last index to process + 1)
mov rdi, rax
add rdi, rbx
; perform multiplication of assignment * total_threads, result in rax
; use the result to add to rsi and figure out "base", then add to rdi to get "max"
mul rcx
add rsi, rax
add rdi, rsi
; main Vertex phase loop
vertex_phase_loop:
cmp rsi, rdi
jge done_vertex_loop
mov rcx, rsi
IFDEF EXPERIMENT_WITHOUT_VECTORS
vertex_op_iteration_at_index_novec
ELSE
vertex_op_iteration_at_index
ENDIF
inc rsi
jmp vertex_phase_loop
done_vertex_loop:
; restore non-volatile registers and return
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
perform_vertex_phase_cc ENDP
_TEXT ENDS
END
|
examples/hash_single/demo_ada.adb | jrmarino/libsodium-ada | 10 | 7081 | <reponame>jrmarino/libsodium-ada<filename>examples/hash_single/demo_ada.adb
with Sodium.Functions; use Sodium.Functions;
with Ada.Text_IO; use Ada.Text_IO;
procedure Demo_Ada
is
message : constant String := "Arbitrary text to hash";
key : constant String := "123456789 123456789 123456789 12";
begin
if not initialize_sodium_library then
Put_Line ("Initialization failed");
return;
end if;
declare
hash : constant String := Keyless_Hash (message);
minhash : constant String := Keyless_Hash (message, Hash_Size_Range'First);
maxhash : constant String := Keyless_Hash (message, Hash_Size_Range'Last);
keyhash : constant String := Keyed_Hash (message, key);
keyhmin : constant String := Keyed_Hash (message, key, Hash_Size_Range'First);
keyhmax : constant String := Keyed_Hash (message, key, Hash_Size_Range'Last);
begin
Put_Line ("text: " & message);
Put_Line ("min hash: " & As_Hexidecimal (minhash));
Put_Line ("hash length is" & minhash'Length'Img);
Put_Line ("");
Put_Line ("std hash: " & As_Hexidecimal (hash));
Put_Line ("hash length is" & hash'Length'Img);
Put_Line ("");
Put_Line ("max hash: " & As_Hexidecimal (maxhash));
Put_Line ("hash length is" & maxhash'Length'Img);
Put_Line ("");
Put_Line ("keyed min hash: " & As_Hexidecimal (keyhmin));
Put_Line ("keyed std hash: " & As_Hexidecimal (keyhash));
Put_Line ("keyed max hash: " & As_Hexidecimal (keyhmax));
end;
end Demo_Ada;
|
src/dnsc/dnsc.adb | DNSCatcher/DNSCatcher | 4 | 13396 | <filename>src/dnsc/dnsc.adb
-- Copyright 2019 <NAME> <<EMAIL>>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to
-- deal in the Software without restriction, including without limitation the
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-- sell copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Exceptions; use Ada.Exceptions;
with GNAT.Sockets; use GNAT.Sockets;
with DNSCatcher.DNS; use DNSCatcher.DNS;
with DNSCatcher.DNS.Client;
with DNSCatcher.Config;
with DNSCatcher.Utils.Logger; use DNSCatcher.Utils.Logger;
with DNSCatcher.DNS.Transaction_Manager;
use DNSCatcher.DNS.Transaction_Manager;
with DNSCatcher.Network.UDP.Sender;
with DNSCatcher.Network.UDP.Receiver;
with DNSCatcher.Types; use DNSCatcher.Types;
procedure DNSC is
DClient : DNSCatcher.DNS.Client.Client;
Capture_Config : DNSCatcher.Config.Configuration;
Logger_Task : DNSCatcher.Utils.Logger.Logger;
Transaction_Manager_Ptr : DNS_Transaction_Manager_Task_Ptr;
Sender_Interface : DNSCatcher.Network.UDP.Sender.UDP_Sender_Interface;
Receiver_Interface : DNSCatcher.Network.UDP.Receiver.UDP_Receiver_Interface;
Outbound_Packet : Raw_Packet_Record_Ptr;
Logger_Packet : DNSCatcher.Utils.Logger.Logger_Message_Packet_Ptr;
Socket : Socket_Type;
begin
Capture_Config.Local_Listen_Port := 41231;
Capture_Config.Upstream_DNS_Server := To_Unbounded_String ("172.16.17.32");
Capture_Config.Upstream_DNS_Server_Port := 53;
-- Configure the logger
Capture_Config.Logger_Config.Log_Level := DEBUG;
Capture_Config.Logger_Config.Use_Color := True;
Logger_Task.Initialize (Capture_Config.Logger_Config);
Logger_Task.Start;
Logger_Packet := new Logger_Message_Packet;
Transaction_Manager_Ptr := new DNS_Transaction_Manager_Task;
-- Socket has to be shared between receiver and sender. This likely needs to
-- move to to a higher level class
begin
Create_Socket
(Socket => Socket,
Mode => Socket_Datagram);
Set_Socket_Option
(Socket => Socket,
Level => IP_Protocol_For_IP_Level,
Option => (GNAT.Sockets.Receive_Timeout, Timeout => 1.0));
Bind_Socket
(Socket => Socket,
Address =>
(Family => Family_Inet, Addr => Any_Inet_Addr,
Port => Capture_Config.Local_Listen_Port));
exception
when Exp_Error : GNAT.Sockets.Socket_Error =>
begin
Logger_Packet := new DNSCatcher.Utils.Logger.Logger_Message_Packet;
Logger_Packet.Log_Message
(ERROR, "Socket error: " & Exception_Information (Exp_Error));
Logger_Packet.Log_Message (ERROR, "Refusing to start!");
Logger_Queue.Add_Packet (Logger_Packet);
goto Shutdown_Procedure;
end;
end;
-- Start up all tasks
Sender_Interface.Initialize (Socket => Socket);
Sender_Interface.Start;
Receiver_Interface.Initialize
(Capture_Config, Transaction_Manager_Ptr, Socket);
Receiver_Interface.Start;
Transaction_Manager_Ptr.Set_Packet_Queue
(Sender_Interface.Get_Packet_Queue_Ptr);
Transaction_Manager_Ptr.Start;
-- Generate our packet
DClient.Create_Header;
DClient.Add_Query (To_Unbounded_String ("casadevall.pro"), A, INternet);
Outbound_Packet := DClient.Create_Packet (Capture_Config);
Transaction_Manager_Ptr.From_Client_Resolver_Packet
(Packet => Outbound_Packet,
Local => True);
Logger_Queue.Add_Packet (Logger_Packet);
delay 2.0;
-- And tear it all down
<<Shutdown_Procedure>>
Sender_Interface.Shutdown;
Transaction_Manager_Ptr.Stop;
Receiver_Interface.Shutdown;
Logger_Task.Stop;
exception
when Error : others =>
begin
Put (Standard_Error, "Unknown error: ");
Put_Line (Standard_Error, Exception_Information (Error));
Logger_Task.Stop;
end;
end DNSC;
|
awa/plugins/awa-tags/src/model/awa-tags-models.ads | My-Colaborations/ada-awa | 81 | 18663 | -----------------------------------------------------------------------
-- AWA.Tags.Models -- AWA.Tags.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-spec.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2020 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
pragma Warnings (Off);
with ADO.Sessions;
with ADO.Objects;
with ADO.Statements;
with ADO.SQL;
with ADO.Schemas;
with ADO.Queries;
with ADO.Queries.Loaders;
with Ada.Containers.Vectors;
with Ada.Strings.Unbounded;
with Util.Beans.Objects;
with Util.Beans.Basic.Lists;
pragma Warnings (On);
package AWA.Tags.Models is
pragma Style_Checks ("-mr");
type Tag_Ref is new ADO.Objects.Object_Ref with null record;
type Tagged_Entity_Ref is new ADO.Objects.Object_Ref with null record;
-- --------------------
-- The tag definition.
-- --------------------
-- Create an object key for Tag.
function Tag_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key;
-- Create an object key for Tag from a string.
-- Raises Constraint_Error if the string cannot be converted into the object key.
function Tag_Key (Id : in String) return ADO.Objects.Object_Key;
Null_Tag : constant Tag_Ref;
function "=" (Left, Right : Tag_Ref'Class) return Boolean;
-- Set the tag identifier
procedure Set_Id (Object : in out Tag_Ref;
Value : in ADO.Identifier);
-- Get the tag identifier
function Get_Id (Object : in Tag_Ref)
return ADO.Identifier;
-- Set the tag name
procedure Set_Name (Object : in out Tag_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String);
procedure Set_Name (Object : in out Tag_Ref;
Value : in String);
-- Get the tag name
function Get_Name (Object : in Tag_Ref)
return Ada.Strings.Unbounded.Unbounded_String;
function Get_Name (Object : in Tag_Ref)
return String;
-- Load the entity identified by 'Id'.
-- Raises the NOT_FOUND exception if it does not exist.
procedure Load (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier);
-- Load the entity identified by 'Id'.
-- Returns True in <b>Found</b> if the object was found and False if it does not exist.
procedure Load (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean);
-- Find and load the entity.
overriding
procedure Find (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
-- Save the entity. If the entity does not have an identifier, an identifier is allocated
-- and it is inserted in the table. Otherwise, only data fields which have been changed
-- are updated.
overriding
procedure Save (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
-- Delete the entity.
overriding
procedure Delete (Object : in out Tag_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
function Get_Value (From : in Tag_Ref;
Name : in String) return Util.Beans.Objects.Object;
-- Table definition
TAG_TABLE : constant ADO.Schemas.Class_Mapping_Access;
-- Internal method to allocate the Object_Record instance
overriding
procedure Allocate (Object : in out Tag_Ref);
-- Copy of the object.
procedure Copy (Object : in Tag_Ref;
Into : in out Tag_Ref);
package Tag_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Tag_Ref,
"=" => "=");
subtype Tag_Vector is Tag_Vectors.Vector;
procedure List (Object : in out Tag_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class);
-- Create an object key for Tagged_Entity.
function Tagged_Entity_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key;
-- Create an object key for Tagged_Entity from a string.
-- Raises Constraint_Error if the string cannot be converted into the object key.
function Tagged_Entity_Key (Id : in String) return ADO.Objects.Object_Key;
Null_Tagged_Entity : constant Tagged_Entity_Ref;
function "=" (Left, Right : Tagged_Entity_Ref'Class) return Boolean;
-- Set the tag entity identifier
procedure Set_Id (Object : in out Tagged_Entity_Ref;
Value : in ADO.Identifier);
-- Get the tag entity identifier
function Get_Id (Object : in Tagged_Entity_Ref)
return ADO.Identifier;
-- Set Title: Tag model
-- Date: 2013-02-23the database entity to which the tag is associated
procedure Set_For_Entity_Id (Object : in out Tagged_Entity_Ref;
Value : in ADO.Identifier);
-- Get Title: Tag model
-- Date: 2013-02-23the database entity to which the tag is associated
function Get_For_Entity_Id (Object : in Tagged_Entity_Ref)
return ADO.Identifier;
-- Set the entity type
procedure Set_Entity_Type (Object : in out Tagged_Entity_Ref;
Value : in ADO.Entity_Type);
-- Get the entity type
function Get_Entity_Type (Object : in Tagged_Entity_Ref)
return ADO.Entity_Type;
--
procedure Set_Tag (Object : in out Tagged_Entity_Ref;
Value : in AWA.Tags.Models.Tag_Ref'Class);
--
function Get_Tag (Object : in Tagged_Entity_Ref)
return AWA.Tags.Models.Tag_Ref'Class;
-- Load the entity identified by 'Id'.
-- Raises the NOT_FOUND exception if it does not exist.
procedure Load (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier);
-- Load the entity identified by 'Id'.
-- Returns True in <b>Found</b> if the object was found and False if it does not exist.
procedure Load (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean);
-- Find and load the entity.
overriding
procedure Find (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
-- Save the entity. If the entity does not have an identifier, an identifier is allocated
-- and it is inserted in the table. Otherwise, only data fields which have been changed
-- are updated.
overriding
procedure Save (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
-- Delete the entity.
overriding
procedure Delete (Object : in out Tagged_Entity_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
function Get_Value (From : in Tagged_Entity_Ref;
Name : in String) return Util.Beans.Objects.Object;
-- Table definition
TAGGED_ENTITY_TABLE : constant ADO.Schemas.Class_Mapping_Access;
-- Internal method to allocate the Object_Record instance
overriding
procedure Allocate (Object : in out Tagged_Entity_Ref);
-- Copy of the object.
procedure Copy (Object : in Tagged_Entity_Ref;
Into : in out Tagged_Entity_Ref);
package Tagged_Entity_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Tagged_Entity_Ref,
"=" => "=");
subtype Tagged_Entity_Vector is Tagged_Entity_Vectors.Vector;
procedure List (Object : in out Tagged_Entity_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class);
-- --------------------
-- The tag information.
-- --------------------
type Tag_Info is
new Util.Beans.Basic.Bean with record
-- the tag name.
Tag : Ada.Strings.Unbounded.Unbounded_String;
-- the number of references for the tag.
Count : Natural;
end record;
-- Get the bean attribute identified by the name.
overriding
function Get_Value (From : in Tag_Info;
Name : in String) return Util.Beans.Objects.Object;
-- Set the bean attribute identified by the name.
overriding
procedure Set_Value (Item : in out Tag_Info;
Name : in String;
Value : in Util.Beans.Objects.Object);
package Tag_Info_Beans is
new Util.Beans.Basic.Lists (Element_Type => Tag_Info);
package Tag_Info_Vectors renames Tag_Info_Beans.Vectors;
subtype Tag_Info_List_Bean is Tag_Info_Beans.List_Bean;
type Tag_Info_List_Bean_Access is access all Tag_Info_List_Bean;
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
procedure List (Object : in out Tag_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class);
subtype Tag_Info_Vector is Tag_Info_Vectors.Vector;
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
procedure List (Object : in out Tag_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class);
Query_Check_Tag : constant ADO.Queries.Query_Definition_Access;
Query_Tag_List : constant ADO.Queries.Query_Definition_Access;
Query_Tag_Search : constant ADO.Queries.Query_Definition_Access;
Query_Tag_List_All : constant ADO.Queries.Query_Definition_Access;
Query_Tag_List_For_Entities : constant ADO.Queries.Query_Definition_Access;
private
TAG_NAME : aliased constant String := "awa_tag";
COL_0_1_NAME : aliased constant String := "id";
COL_1_1_NAME : aliased constant String := "name";
TAG_DEF : aliased constant ADO.Schemas.Class_Mapping :=
(Count => 2,
Table => TAG_NAME'Access,
Members => (
1 => COL_0_1_NAME'Access,
2 => COL_1_1_NAME'Access)
);
TAG_TABLE : constant ADO.Schemas.Class_Mapping_Access
:= TAG_DEF'Access;
Null_Tag : constant Tag_Ref
:= Tag_Ref'(ADO.Objects.Object_Ref with null record);
type Tag_Impl is
new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER,
Of_Class => TAG_DEF'Access)
with record
Name : Ada.Strings.Unbounded.Unbounded_String;
end record;
type Tag_Access is access all Tag_Impl;
overriding
procedure Destroy (Object : access Tag_Impl);
overriding
procedure Find (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
overriding
procedure Load (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Session'Class);
procedure Load (Object : in out Tag_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class);
overriding
procedure Save (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Create (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
procedure Delete (Object : in out Tag_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Set_Field (Object : in out Tag_Ref'Class;
Impl : out Tag_Access);
TAGGED_ENTITY_NAME : aliased constant String := "awa_tagged_entity";
COL_0_2_NAME : aliased constant String := "id";
COL_1_2_NAME : aliased constant String := "for_entity_id";
COL_2_2_NAME : aliased constant String := "entity_type";
COL_3_2_NAME : aliased constant String := "tag_id";
TAGGED_ENTITY_DEF : aliased constant ADO.Schemas.Class_Mapping :=
(Count => 4,
Table => TAGGED_ENTITY_NAME'Access,
Members => (
1 => COL_0_2_NAME'Access,
2 => COL_1_2_NAME'Access,
3 => COL_2_2_NAME'Access,
4 => COL_3_2_NAME'Access)
);
TAGGED_ENTITY_TABLE : constant ADO.Schemas.Class_Mapping_Access
:= TAGGED_ENTITY_DEF'Access;
Null_Tagged_Entity : constant Tagged_Entity_Ref
:= Tagged_Entity_Ref'(ADO.Objects.Object_Ref with null record);
type Tagged_Entity_Impl is
new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER,
Of_Class => TAGGED_ENTITY_DEF'Access)
with record
For_Entity_Id : ADO.Identifier;
Entity_Type : ADO.Entity_Type;
Tag : AWA.Tags.Models.Tag_Ref;
end record;
type Tagged_Entity_Access is access all Tagged_Entity_Impl;
overriding
procedure Destroy (Object : access Tagged_Entity_Impl);
overriding
procedure Find (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
overriding
procedure Load (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Session'Class);
procedure Load (Object : in out Tagged_Entity_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class);
overriding
procedure Save (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Create (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
procedure Delete (Object : in out Tagged_Entity_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Set_Field (Object : in out Tagged_Entity_Ref'Class;
Impl : out Tagged_Entity_Access);
package File_1 is
new ADO.Queries.Loaders.File (Path => "tag-queries.xml",
Sha1 => "BFA439EF20901C425F86DB33AD8870BADB46FBEB");
package Def_Taginfo_Check_Tag is
new ADO.Queries.Loaders.Query (Name => "check-tag",
File => File_1.File'Access);
Query_Check_Tag : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Check_Tag.Query'Access;
package Def_Taginfo_Tag_List is
new ADO.Queries.Loaders.Query (Name => "tag-list",
File => File_1.File'Access);
Query_Tag_List : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Tag_List.Query'Access;
package Def_Taginfo_Tag_Search is
new ADO.Queries.Loaders.Query (Name => "tag-search",
File => File_1.File'Access);
Query_Tag_Search : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Tag_Search.Query'Access;
package Def_Taginfo_Tag_List_All is
new ADO.Queries.Loaders.Query (Name => "tag-list-all",
File => File_1.File'Access);
Query_Tag_List_All : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Tag_List_All.Query'Access;
package Def_Taginfo_Tag_List_For_Entities is
new ADO.Queries.Loaders.Query (Name => "tag-list-for-entities",
File => File_1.File'Access);
Query_Tag_List_For_Entities : constant ADO.Queries.Query_Definition_Access
:= Def_Taginfo_Tag_List_For_Entities.Query'Access;
end AWA.Tags.Models;
|
oeis/236/A236218.asm | neoneye/loda-programs | 11 | 87287 | ; A236218: Sum of the twelfth powers of the first n primes.
; Submitted by <NAME>(s4)
; 4096,535537,244676162,14085963363,3152514340084,26450599462565,609072836692326,2822387755758487,24737012187778808,378551795393247849,1166214579181797610,7749166585021832891,30312656885388018972,70272287682650595373,186463770791599173614,677722675048325328255,2456920093287858045136,5111269067585444203457,13293987972218301348018,29703670712859112482259,52605718759349371193780,111697229791023524575221,218587237529684648985382,465577641094946789288903,1159420002090384789583944
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,40 ; The prime numbers.
pow $0,12
add $1,$0
lpe
mov $0,$1
add $0,4096
|
Sources/Student_Packages/vehicle_task_type.ads | ForYouEyesOnly/Space-Convoy | 1 | 21000 | <filename>Sources/Student_Packages/vehicle_task_type.ads
with Ada.Task_Identification; use Ada.Task_Identification;
with Ada.Containers.Hashed_Sets; use Ada.Containers;
-- Author : <NAME>
-- u_id : u6251843
package Vehicle_Task_Type is
task type Vehicle_Task is
entry Identify (Set_Vehicle_No : Positive; Local_Task_Id : out Task_Id);
end Vehicle_Task;
-- Hash function used for the following HashSet and HashMap in veicle_task_type.adb file.
function ID_Hashed (id : Positive) return Hash_Type is (Hash_Type (id));
-- Define a HashSet to store the live and dead vehicles' number for every drone.
package My_Set is new Ada.Containers.Hashed_Sets (Element_Type => Positive,
Hash => ID_Hashed,
Equivalent_Elements => "=");
use My_Set;
-- Discuss the use of subtype with Yiluo Wei (u6227375)
-- Define a subtype of My_Set, the type of live and dead vehicles' number set (Two sets).
subtype No_Set is My_Set.Set;
end Vehicle_Task_Type;
|
zombie.asm | jhyunleehi/xv6-public | 0 | 241167 | <reponame>jhyunleehi/xv6-public
_zombie: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(void)
{
0: f3 0f 1e fb endbr32
4: 8d 4c 24 04 lea 0x4(%esp),%ecx
8: 83 e4 f0 and $0xfffffff0,%esp
b: ff 71 fc pushl -0x4(%ecx)
e: 55 push %ebp
f: 89 e5 mov %esp,%ebp
11: 51 push %ecx
12: 83 ec 04 sub $0x4,%esp
if(fork() > 0)
15: e8 89 02 00 00 call 2a3 <fork>
1a: 85 c0 test %eax,%eax
1c: 7e 0d jle 2b <main+0x2b>
sleep(5); // Let child exit before parent.
1e: 83 ec 0c sub $0xc,%esp
21: 6a 05 push $0x5
23: e8 13 03 00 00 call 33b <sleep>
28: 83 c4 10 add $0x10,%esp
exit();
2b: e8 7b 02 00 00 call 2ab <exit>
00000030 <stosb>:
: "cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
30: 55 push %ebp
31: 89 e5 mov %esp,%ebp
33: 57 push %edi
34: 53 push %ebx
asm volatile("cld; rep stosb"
35: 8b 4d 08 mov 0x8(%ebp),%ecx
38: 8b 55 10 mov 0x10(%ebp),%edx
3b: 8b 45 0c mov 0xc(%ebp),%eax
3e: 89 cb mov %ecx,%ebx
40: 89 df mov %ebx,%edi
42: 89 d1 mov %edx,%ecx
44: fc cld
45: f3 aa rep stos %al,%es:(%edi)
47: 89 ca mov %ecx,%edx
49: 89 fb mov %edi,%ebx
4b: 89 5d 08 mov %ebx,0x8(%ebp)
4e: 89 55 10 mov %edx,0x10(%ebp)
: "=D"(addr), "=c"(cnt)
: "0"(addr), "1"(cnt), "a"(data)
: "memory", "cc");
}
51: 90 nop
52: 5b pop %ebx
53: 5f pop %edi
54: 5d pop %ebp
55: c3 ret
00000056 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
56: f3 0f 1e fb endbr32
5a: 55 push %ebp
5b: 89 e5 mov %esp,%ebp
5d: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
60: 8b 45 08 mov 0x8(%ebp),%eax
63: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
66: 90 nop
67: 8b 55 0c mov 0xc(%ebp),%edx
6a: 8d 42 01 lea 0x1(%edx),%eax
6d: 89 45 0c mov %eax,0xc(%ebp)
70: 8b 45 08 mov 0x8(%ebp),%eax
73: 8d 48 01 lea 0x1(%eax),%ecx
76: 89 4d 08 mov %ecx,0x8(%ebp)
79: 0f b6 12 movzbl (%edx),%edx
7c: 88 10 mov %dl,(%eax)
7e: 0f b6 00 movzbl (%eax),%eax
81: 84 c0 test %al,%al
83: 75 e2 jne 67 <strcpy+0x11>
;
return os;
85: 8b 45 fc mov -0x4(%ebp),%eax
}
88: c9 leave
89: c3 ret
0000008a <strcmp>:
int
strcmp(const char *p, const char *q)
{
8a: f3 0f 1e fb endbr32
8e: 55 push %ebp
8f: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
91: eb 08 jmp 9b <strcmp+0x11>
p++, q++;
93: 83 45 08 01 addl $0x1,0x8(%ebp)
97: 83 45 0c 01 addl $0x1,0xc(%ebp)
while(*p && *p == *q)
9b: 8b 45 08 mov 0x8(%ebp),%eax
9e: 0f b6 00 movzbl (%eax),%eax
a1: 84 c0 test %al,%al
a3: 74 10 je b5 <strcmp+0x2b>
a5: 8b 45 08 mov 0x8(%ebp),%eax
a8: 0f b6 10 movzbl (%eax),%edx
ab: 8b 45 0c mov 0xc(%ebp),%eax
ae: 0f b6 00 movzbl (%eax),%eax
b1: 38 c2 cmp %al,%dl
b3: 74 de je 93 <strcmp+0x9>
return (uchar)*p - (uchar)*q;
b5: 8b 45 08 mov 0x8(%ebp),%eax
b8: 0f b6 00 movzbl (%eax),%eax
bb: 0f b6 d0 movzbl %al,%edx
be: 8b 45 0c mov 0xc(%ebp),%eax
c1: 0f b6 00 movzbl (%eax),%eax
c4: 0f b6 c0 movzbl %al,%eax
c7: 29 c2 sub %eax,%edx
c9: 89 d0 mov %edx,%eax
}
cb: 5d pop %ebp
cc: c3 ret
000000cd <strlen>:
uint
strlen(const char *s)
{
cd: f3 0f 1e fb endbr32
d1: 55 push %ebp
d2: 89 e5 mov %esp,%ebp
d4: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
d7: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
de: eb 04 jmp e4 <strlen+0x17>
e0: 83 45 fc 01 addl $0x1,-0x4(%ebp)
e4: 8b 55 fc mov -0x4(%ebp),%edx
e7: 8b 45 08 mov 0x8(%ebp),%eax
ea: 01 d0 add %edx,%eax
ec: 0f b6 00 movzbl (%eax),%eax
ef: 84 c0 test %al,%al
f1: 75 ed jne e0 <strlen+0x13>
;
return n;
f3: 8b 45 fc mov -0x4(%ebp),%eax
}
f6: c9 leave
f7: c3 ret
000000f8 <memset>:
void*
memset(void *dst, int c, uint n)
{
f8: f3 0f 1e fb endbr32
fc: 55 push %ebp
fd: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
ff: 8b 45 10 mov 0x10(%ebp),%eax
102: 50 push %eax
103: ff 75 0c pushl 0xc(%ebp)
106: ff 75 08 pushl 0x8(%ebp)
109: e8 22 ff ff ff call 30 <stosb>
10e: 83 c4 0c add $0xc,%esp
return dst;
111: 8b 45 08 mov 0x8(%ebp),%eax
}
114: c9 leave
115: c3 ret
00000116 <strchr>:
char*
strchr(const char *s, char c)
{
116: f3 0f 1e fb endbr32
11a: 55 push %ebp
11b: 89 e5 mov %esp,%ebp
11d: 83 ec 04 sub $0x4,%esp
120: 8b 45 0c mov 0xc(%ebp),%eax
123: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
126: eb 14 jmp 13c <strchr+0x26>
if(*s == c)
128: 8b 45 08 mov 0x8(%ebp),%eax
12b: 0f b6 00 movzbl (%eax),%eax
12e: 38 45 fc cmp %al,-0x4(%ebp)
131: 75 05 jne 138 <strchr+0x22>
return (char*)s;
133: 8b 45 08 mov 0x8(%ebp),%eax
136: eb 13 jmp 14b <strchr+0x35>
for(; *s; s++)
138: 83 45 08 01 addl $0x1,0x8(%ebp)
13c: 8b 45 08 mov 0x8(%ebp),%eax
13f: 0f b6 00 movzbl (%eax),%eax
142: 84 c0 test %al,%al
144: 75 e2 jne 128 <strchr+0x12>
return 0;
146: b8 00 00 00 00 mov $0x0,%eax
}
14b: c9 leave
14c: c3 ret
0000014d <gets>:
char*
gets(char *buf, int max)
{
14d: f3 0f 1e fb endbr32
151: 55 push %ebp
152: 89 e5 mov %esp,%ebp
154: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
157: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
15e: eb 42 jmp 1a2 <gets+0x55>
cc = read(0, &c, 1);
160: 83 ec 04 sub $0x4,%esp
163: 6a 01 push $0x1
165: 8d 45 ef lea -0x11(%ebp),%eax
168: 50 push %eax
169: 6a 00 push $0x0
16b: e8 53 01 00 00 call 2c3 <read>
170: 83 c4 10 add $0x10,%esp
173: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
176: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
17a: 7e 33 jle 1af <gets+0x62>
break;
buf[i++] = c;
17c: 8b 45 f4 mov -0xc(%ebp),%eax
17f: 8d 50 01 lea 0x1(%eax),%edx
182: 89 55 f4 mov %edx,-0xc(%ebp)
185: 89 c2 mov %eax,%edx
187: 8b 45 08 mov 0x8(%ebp),%eax
18a: 01 c2 add %eax,%edx
18c: 0f b6 45 ef movzbl -0x11(%ebp),%eax
190: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
192: 0f b6 45 ef movzbl -0x11(%ebp),%eax
196: 3c 0a cmp $0xa,%al
198: 74 16 je 1b0 <gets+0x63>
19a: 0f b6 45 ef movzbl -0x11(%ebp),%eax
19e: 3c 0d cmp $0xd,%al
1a0: 74 0e je 1b0 <gets+0x63>
for(i=0; i+1 < max; ){
1a2: 8b 45 f4 mov -0xc(%ebp),%eax
1a5: 83 c0 01 add $0x1,%eax
1a8: 39 45 0c cmp %eax,0xc(%ebp)
1ab: 7f b3 jg 160 <gets+0x13>
1ad: eb 01 jmp 1b0 <gets+0x63>
break;
1af: 90 nop
break;
}
buf[i] = '\0';
1b0: 8b 55 f4 mov -0xc(%ebp),%edx
1b3: 8b 45 08 mov 0x8(%ebp),%eax
1b6: 01 d0 add %edx,%eax
1b8: c6 00 00 movb $0x0,(%eax)
return buf;
1bb: 8b 45 08 mov 0x8(%ebp),%eax
}
1be: c9 leave
1bf: c3 ret
000001c0 <stat>:
int
stat(const char *n, struct stat *st)
{
1c0: f3 0f 1e fb endbr32
1c4: 55 push %ebp
1c5: 89 e5 mov %esp,%ebp
1c7: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
1ca: 83 ec 08 sub $0x8,%esp
1cd: 6a 00 push $0x0
1cf: ff 75 08 pushl 0x8(%ebp)
1d2: e8 14 01 00 00 call 2eb <open>
1d7: 83 c4 10 add $0x10,%esp
1da: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
1dd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1e1: 79 07 jns 1ea <stat+0x2a>
return -1;
1e3: b8 ff ff ff ff mov $0xffffffff,%eax
1e8: eb 25 jmp 20f <stat+0x4f>
r = fstat(fd, st);
1ea: 83 ec 08 sub $0x8,%esp
1ed: ff 75 0c pushl 0xc(%ebp)
1f0: ff 75 f4 pushl -0xc(%ebp)
1f3: e8 0b 01 00 00 call 303 <fstat>
1f8: 83 c4 10 add $0x10,%esp
1fb: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
1fe: 83 ec 0c sub $0xc,%esp
201: ff 75 f4 pushl -0xc(%ebp)
204: e8 ca 00 00 00 call 2d3 <close>
209: 83 c4 10 add $0x10,%esp
return r;
20c: 8b 45 f0 mov -0x10(%ebp),%eax
}
20f: c9 leave
210: c3 ret
00000211 <atoi>:
int
atoi(const char *s)
{
211: f3 0f 1e fb endbr32
215: 55 push %ebp
216: 89 e5 mov %esp,%ebp
218: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
21b: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
222: eb 25 jmp 249 <atoi+0x38>
n = n*10 + *s++ - '0';
224: 8b 55 fc mov -0x4(%ebp),%edx
227: 89 d0 mov %edx,%eax
229: c1 e0 02 shl $0x2,%eax
22c: 01 d0 add %edx,%eax
22e: 01 c0 add %eax,%eax
230: 89 c1 mov %eax,%ecx
232: 8b 45 08 mov 0x8(%ebp),%eax
235: 8d 50 01 lea 0x1(%eax),%edx
238: 89 55 08 mov %edx,0x8(%ebp)
23b: 0f b6 00 movzbl (%eax),%eax
23e: 0f be c0 movsbl %al,%eax
241: 01 c8 add %ecx,%eax
243: 83 e8 30 sub $0x30,%eax
246: 89 45 fc mov %eax,-0x4(%ebp)
while('0' <= *s && *s <= '9')
249: 8b 45 08 mov 0x8(%ebp),%eax
24c: 0f b6 00 movzbl (%eax),%eax
24f: 3c 2f cmp $0x2f,%al
251: 7e 0a jle 25d <atoi+0x4c>
253: 8b 45 08 mov 0x8(%ebp),%eax
256: 0f b6 00 movzbl (%eax),%eax
259: 3c 39 cmp $0x39,%al
25b: 7e c7 jle 224 <atoi+0x13>
return n;
25d: 8b 45 fc mov -0x4(%ebp),%eax
}
260: c9 leave
261: c3 ret
00000262 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
262: f3 0f 1e fb endbr32
266: 55 push %ebp
267: 89 e5 mov %esp,%ebp
269: 83 ec 10 sub $0x10,%esp
char *dst;
const char *src;
dst = vdst;
26c: 8b 45 08 mov 0x8(%ebp),%eax
26f: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
272: 8b 45 0c mov 0xc(%ebp),%eax
275: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
278: eb 17 jmp 291 <memmove+0x2f>
*dst++ = *src++;
27a: 8b 55 f8 mov -0x8(%ebp),%edx
27d: 8d 42 01 lea 0x1(%edx),%eax
280: 89 45 f8 mov %eax,-0x8(%ebp)
283: 8b 45 fc mov -0x4(%ebp),%eax
286: 8d 48 01 lea 0x1(%eax),%ecx
289: 89 4d fc mov %ecx,-0x4(%ebp)
28c: 0f b6 12 movzbl (%edx),%edx
28f: 88 10 mov %dl,(%eax)
while(n-- > 0)
291: 8b 45 10 mov 0x10(%ebp),%eax
294: 8d 50 ff lea -0x1(%eax),%edx
297: 89 55 10 mov %edx,0x10(%ebp)
29a: 85 c0 test %eax,%eax
29c: 7f dc jg 27a <memmove+0x18>
return vdst;
29e: 8b 45 08 mov 0x8(%ebp),%eax
}
2a1: c9 leave
2a2: c3 ret
000002a3 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
2a3: b8 01 00 00 00 mov $0x1,%eax
2a8: cd 40 int $0x40
2aa: c3 ret
000002ab <exit>:
SYSCALL(exit)
2ab: b8 02 00 00 00 mov $0x2,%eax
2b0: cd 40 int $0x40
2b2: c3 ret
000002b3 <wait>:
SYSCALL(wait)
2b3: b8 03 00 00 00 mov $0x3,%eax
2b8: cd 40 int $0x40
2ba: c3 ret
000002bb <pipe>:
SYSCALL(pipe)
2bb: b8 04 00 00 00 mov $0x4,%eax
2c0: cd 40 int $0x40
2c2: c3 ret
000002c3 <read>:
SYSCALL(read)
2c3: b8 05 00 00 00 mov $0x5,%eax
2c8: cd 40 int $0x40
2ca: c3 ret
000002cb <write>:
SYSCALL(write)
2cb: b8 10 00 00 00 mov $0x10,%eax
2d0: cd 40 int $0x40
2d2: c3 ret
000002d3 <close>:
SYSCALL(close)
2d3: b8 15 00 00 00 mov $0x15,%eax
2d8: cd 40 int $0x40
2da: c3 ret
000002db <kill>:
SYSCALL(kill)
2db: b8 06 00 00 00 mov $0x6,%eax
2e0: cd 40 int $0x40
2e2: c3 ret
000002e3 <exec>:
SYSCALL(exec)
2e3: b8 07 00 00 00 mov $0x7,%eax
2e8: cd 40 int $0x40
2ea: c3 ret
000002eb <open>:
SYSCALL(open)
2eb: b8 0f 00 00 00 mov $0xf,%eax
2f0: cd 40 int $0x40
2f2: c3 ret
000002f3 <mknod>:
SYSCALL(mknod)
2f3: b8 11 00 00 00 mov $0x11,%eax
2f8: cd 40 int $0x40
2fa: c3 ret
000002fb <unlink>:
SYSCALL(unlink)
2fb: b8 12 00 00 00 mov $0x12,%eax
300: cd 40 int $0x40
302: c3 ret
00000303 <fstat>:
SYSCALL(fstat)
303: b8 08 00 00 00 mov $0x8,%eax
308: cd 40 int $0x40
30a: c3 ret
0000030b <link>:
SYSCALL(link)
30b: b8 13 00 00 00 mov $0x13,%eax
310: cd 40 int $0x40
312: c3 ret
00000313 <mkdir>:
SYSCALL(mkdir)
313: b8 14 00 00 00 mov $0x14,%eax
318: cd 40 int $0x40
31a: c3 ret
0000031b <chdir>:
SYSCALL(chdir)
31b: b8 09 00 00 00 mov $0x9,%eax
320: cd 40 int $0x40
322: c3 ret
00000323 <dup>:
SYSCALL(dup)
323: b8 0a 00 00 00 mov $0xa,%eax
328: cd 40 int $0x40
32a: c3 ret
0000032b <getpid>:
SYSCALL(getpid)
32b: b8 0b 00 00 00 mov $0xb,%eax
330: cd 40 int $0x40
332: c3 ret
00000333 <sbrk>:
SYSCALL(sbrk)
333: b8 0c 00 00 00 mov $0xc,%eax
338: cd 40 int $0x40
33a: c3 ret
0000033b <sleep>:
SYSCALL(sleep)
33b: b8 0d 00 00 00 mov $0xd,%eax
340: cd 40 int $0x40
342: c3 ret
00000343 <uptime>:
SYSCALL(uptime)
343: b8 0e 00 00 00 mov $0xe,%eax
348: cd 40 int $0x40
34a: c3 ret
0000034b <cps>:
SYSCALL(cps)
34b: b8 16 00 00 00 mov $0x16,%eax
350: cd 40 int $0x40
352: c3 ret
00000353 <cdate>:
353: b8 17 00 00 00 mov $0x17,%eax
358: cd 40 int $0x40
35a: c3 ret
0000035b <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
35b: f3 0f 1e fb endbr32
35f: 55 push %ebp
360: 89 e5 mov %esp,%ebp
362: 83 ec 18 sub $0x18,%esp
365: 8b 45 0c mov 0xc(%ebp),%eax
368: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
36b: 83 ec 04 sub $0x4,%esp
36e: 6a 01 push $0x1
370: 8d 45 f4 lea -0xc(%ebp),%eax
373: 50 push %eax
374: ff 75 08 pushl 0x8(%ebp)
377: e8 4f ff ff ff call 2cb <write>
37c: 83 c4 10 add $0x10,%esp
}
37f: 90 nop
380: c9 leave
381: c3 ret
00000382 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
382: f3 0f 1e fb endbr32
386: 55 push %ebp
387: 89 e5 mov %esp,%ebp
389: 83 ec 28 sub $0x28,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
38c: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
393: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
397: 74 17 je 3b0 <printint+0x2e>
399: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
39d: 79 11 jns 3b0 <printint+0x2e>
neg = 1;
39f: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
3a6: 8b 45 0c mov 0xc(%ebp),%eax
3a9: f7 d8 neg %eax
3ab: 89 45 ec mov %eax,-0x14(%ebp)
3ae: eb 06 jmp 3b6 <printint+0x34>
} else {
x = xx;
3b0: 8b 45 0c mov 0xc(%ebp),%eax
3b3: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
3b6: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
3bd: 8b 4d 10 mov 0x10(%ebp),%ecx
3c0: 8b 45 ec mov -0x14(%ebp),%eax
3c3: ba 00 00 00 00 mov $0x0,%edx
3c8: f7 f1 div %ecx
3ca: 89 d1 mov %edx,%ecx
3cc: 8b 45 f4 mov -0xc(%ebp),%eax
3cf: 8d 50 01 lea 0x1(%eax),%edx
3d2: 89 55 f4 mov %edx,-0xc(%ebp)
3d5: 0f b6 91 4c 0a 00 00 movzbl 0xa4c(%ecx),%edx
3dc: 88 54 05 dc mov %dl,-0x24(%ebp,%eax,1)
}while((x /= base) != 0);
3e0: 8b 4d 10 mov 0x10(%ebp),%ecx
3e3: 8b 45 ec mov -0x14(%ebp),%eax
3e6: ba 00 00 00 00 mov $0x0,%edx
3eb: f7 f1 div %ecx
3ed: 89 45 ec mov %eax,-0x14(%ebp)
3f0: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
3f4: 75 c7 jne 3bd <printint+0x3b>
if(neg)
3f6: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
3fa: 74 2d je 429 <printint+0xa7>
buf[i++] = '-';
3fc: 8b 45 f4 mov -0xc(%ebp),%eax
3ff: 8d 50 01 lea 0x1(%eax),%edx
402: 89 55 f4 mov %edx,-0xc(%ebp)
405: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
40a: eb 1d jmp 429 <printint+0xa7>
putc(fd, buf[i]);
40c: 8d 55 dc lea -0x24(%ebp),%edx
40f: 8b 45 f4 mov -0xc(%ebp),%eax
412: 01 d0 add %edx,%eax
414: 0f b6 00 movzbl (%eax),%eax
417: 0f be c0 movsbl %al,%eax
41a: 83 ec 08 sub $0x8,%esp
41d: 50 push %eax
41e: ff 75 08 pushl 0x8(%ebp)
421: e8 35 ff ff ff call 35b <putc>
426: 83 c4 10 add $0x10,%esp
while(--i >= 0)
429: 83 6d f4 01 subl $0x1,-0xc(%ebp)
42d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
431: 79 d9 jns 40c <printint+0x8a>
}
433: 90 nop
434: 90 nop
435: c9 leave
436: c3 ret
00000437 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
437: f3 0f 1e fb endbr32
43b: 55 push %ebp
43c: 89 e5 mov %esp,%ebp
43e: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
441: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
448: 8d 45 0c lea 0xc(%ebp),%eax
44b: 83 c0 04 add $0x4,%eax
44e: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
451: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
458: e9 59 01 00 00 jmp 5b6 <printf+0x17f>
c = fmt[i] & 0xff;
45d: 8b 55 0c mov 0xc(%ebp),%edx
460: 8b 45 f0 mov -0x10(%ebp),%eax
463: 01 d0 add %edx,%eax
465: 0f b6 00 movzbl (%eax),%eax
468: 0f be c0 movsbl %al,%eax
46b: 25 ff 00 00 00 and $0xff,%eax
470: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
473: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
477: 75 2c jne 4a5 <printf+0x6e>
if(c == '%'){
479: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
47d: 75 0c jne 48b <printf+0x54>
state = '%';
47f: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
486: e9 27 01 00 00 jmp 5b2 <printf+0x17b>
} else {
putc(fd, c);
48b: 8b 45 e4 mov -0x1c(%ebp),%eax
48e: 0f be c0 movsbl %al,%eax
491: 83 ec 08 sub $0x8,%esp
494: 50 push %eax
495: ff 75 08 pushl 0x8(%ebp)
498: e8 be fe ff ff call 35b <putc>
49d: 83 c4 10 add $0x10,%esp
4a0: e9 0d 01 00 00 jmp 5b2 <printf+0x17b>
}
} else if(state == '%'){
4a5: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
4a9: 0f 85 03 01 00 00 jne 5b2 <printf+0x17b>
if(c == 'd'){
4af: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
4b3: 75 1e jne 4d3 <printf+0x9c>
printint(fd, *ap, 10, 1);
4b5: 8b 45 e8 mov -0x18(%ebp),%eax
4b8: 8b 00 mov (%eax),%eax
4ba: 6a 01 push $0x1
4bc: 6a 0a push $0xa
4be: 50 push %eax
4bf: ff 75 08 pushl 0x8(%ebp)
4c2: e8 bb fe ff ff call 382 <printint>
4c7: 83 c4 10 add $0x10,%esp
ap++;
4ca: 83 45 e8 04 addl $0x4,-0x18(%ebp)
4ce: e9 d8 00 00 00 jmp 5ab <printf+0x174>
} else if(c == 'x' || c == 'p'){
4d3: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
4d7: 74 06 je 4df <printf+0xa8>
4d9: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
4dd: 75 1e jne 4fd <printf+0xc6>
printint(fd, *ap, 16, 0);
4df: 8b 45 e8 mov -0x18(%ebp),%eax
4e2: 8b 00 mov (%eax),%eax
4e4: 6a 00 push $0x0
4e6: 6a 10 push $0x10
4e8: 50 push %eax
4e9: ff 75 08 pushl 0x8(%ebp)
4ec: e8 91 fe ff ff call 382 <printint>
4f1: 83 c4 10 add $0x10,%esp
ap++;
4f4: 83 45 e8 04 addl $0x4,-0x18(%ebp)
4f8: e9 ae 00 00 00 jmp 5ab <printf+0x174>
} else if(c == 's'){
4fd: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
501: 75 43 jne 546 <printf+0x10f>
s = (char*)*ap;
503: 8b 45 e8 mov -0x18(%ebp),%eax
506: 8b 00 mov (%eax),%eax
508: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
50b: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
50f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
513: 75 25 jne 53a <printf+0x103>
s = "(null)";
515: c7 45 f4 fe 07 00 00 movl $0x7fe,-0xc(%ebp)
while(*s != 0){
51c: eb 1c jmp 53a <printf+0x103>
putc(fd, *s);
51e: 8b 45 f4 mov -0xc(%ebp),%eax
521: 0f b6 00 movzbl (%eax),%eax
524: 0f be c0 movsbl %al,%eax
527: 83 ec 08 sub $0x8,%esp
52a: 50 push %eax
52b: ff 75 08 pushl 0x8(%ebp)
52e: e8 28 fe ff ff call 35b <putc>
533: 83 c4 10 add $0x10,%esp
s++;
536: 83 45 f4 01 addl $0x1,-0xc(%ebp)
while(*s != 0){
53a: 8b 45 f4 mov -0xc(%ebp),%eax
53d: 0f b6 00 movzbl (%eax),%eax
540: 84 c0 test %al,%al
542: 75 da jne 51e <printf+0xe7>
544: eb 65 jmp 5ab <printf+0x174>
}
} else if(c == 'c'){
546: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
54a: 75 1d jne 569 <printf+0x132>
putc(fd, *ap);
54c: 8b 45 e8 mov -0x18(%ebp),%eax
54f: 8b 00 mov (%eax),%eax
551: 0f be c0 movsbl %al,%eax
554: 83 ec 08 sub $0x8,%esp
557: 50 push %eax
558: ff 75 08 pushl 0x8(%ebp)
55b: e8 fb fd ff ff call 35b <putc>
560: 83 c4 10 add $0x10,%esp
ap++;
563: 83 45 e8 04 addl $0x4,-0x18(%ebp)
567: eb 42 jmp 5ab <printf+0x174>
} else if(c == '%'){
569: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
56d: 75 17 jne 586 <printf+0x14f>
putc(fd, c);
56f: 8b 45 e4 mov -0x1c(%ebp),%eax
572: 0f be c0 movsbl %al,%eax
575: 83 ec 08 sub $0x8,%esp
578: 50 push %eax
579: ff 75 08 pushl 0x8(%ebp)
57c: e8 da fd ff ff call 35b <putc>
581: 83 c4 10 add $0x10,%esp
584: eb 25 jmp 5ab <printf+0x174>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
586: 83 ec 08 sub $0x8,%esp
589: 6a 25 push $0x25
58b: ff 75 08 pushl 0x8(%ebp)
58e: e8 c8 fd ff ff call 35b <putc>
593: 83 c4 10 add $0x10,%esp
putc(fd, c);
596: 8b 45 e4 mov -0x1c(%ebp),%eax
599: 0f be c0 movsbl %al,%eax
59c: 83 ec 08 sub $0x8,%esp
59f: 50 push %eax
5a0: ff 75 08 pushl 0x8(%ebp)
5a3: e8 b3 fd ff ff call 35b <putc>
5a8: 83 c4 10 add $0x10,%esp
}
state = 0;
5ab: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
for(i = 0; fmt[i]; i++){
5b2: 83 45 f0 01 addl $0x1,-0x10(%ebp)
5b6: 8b 55 0c mov 0xc(%ebp),%edx
5b9: 8b 45 f0 mov -0x10(%ebp),%eax
5bc: 01 d0 add %edx,%eax
5be: 0f b6 00 movzbl (%eax),%eax
5c1: 84 c0 test %al,%al
5c3: 0f 85 94 fe ff ff jne 45d <printf+0x26>
}
}
}
5c9: 90 nop
5ca: 90 nop
5cb: c9 leave
5cc: c3 ret
000005cd <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
5cd: f3 0f 1e fb endbr32
5d1: 55 push %ebp
5d2: 89 e5 mov %esp,%ebp
5d4: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
5d7: 8b 45 08 mov 0x8(%ebp),%eax
5da: 83 e8 08 sub $0x8,%eax
5dd: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5e0: a1 68 0a 00 00 mov 0xa68,%eax
5e5: 89 45 fc mov %eax,-0x4(%ebp)
5e8: eb 24 jmp 60e <free+0x41>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5ea: 8b 45 fc mov -0x4(%ebp),%eax
5ed: 8b 00 mov (%eax),%eax
5ef: 39 45 fc cmp %eax,-0x4(%ebp)
5f2: 72 12 jb 606 <free+0x39>
5f4: 8b 45 f8 mov -0x8(%ebp),%eax
5f7: 3b 45 fc cmp -0x4(%ebp),%eax
5fa: 77 24 ja 620 <free+0x53>
5fc: 8b 45 fc mov -0x4(%ebp),%eax
5ff: 8b 00 mov (%eax),%eax
601: 39 45 f8 cmp %eax,-0x8(%ebp)
604: 72 1a jb 620 <free+0x53>
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
606: 8b 45 fc mov -0x4(%ebp),%eax
609: 8b 00 mov (%eax),%eax
60b: 89 45 fc mov %eax,-0x4(%ebp)
60e: 8b 45 f8 mov -0x8(%ebp),%eax
611: 3b 45 fc cmp -0x4(%ebp),%eax
614: 76 d4 jbe 5ea <free+0x1d>
616: 8b 45 fc mov -0x4(%ebp),%eax
619: 8b 00 mov (%eax),%eax
61b: 39 45 f8 cmp %eax,-0x8(%ebp)
61e: 73 ca jae 5ea <free+0x1d>
break;
if(bp + bp->s.size == p->s.ptr){
620: 8b 45 f8 mov -0x8(%ebp),%eax
623: 8b 40 04 mov 0x4(%eax),%eax
626: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
62d: 8b 45 f8 mov -0x8(%ebp),%eax
630: 01 c2 add %eax,%edx
632: 8b 45 fc mov -0x4(%ebp),%eax
635: 8b 00 mov (%eax),%eax
637: 39 c2 cmp %eax,%edx
639: 75 24 jne 65f <free+0x92>
bp->s.size += p->s.ptr->s.size;
63b: 8b 45 f8 mov -0x8(%ebp),%eax
63e: 8b 50 04 mov 0x4(%eax),%edx
641: 8b 45 fc mov -0x4(%ebp),%eax
644: 8b 00 mov (%eax),%eax
646: 8b 40 04 mov 0x4(%eax),%eax
649: 01 c2 add %eax,%edx
64b: 8b 45 f8 mov -0x8(%ebp),%eax
64e: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
651: 8b 45 fc mov -0x4(%ebp),%eax
654: 8b 00 mov (%eax),%eax
656: 8b 10 mov (%eax),%edx
658: 8b 45 f8 mov -0x8(%ebp),%eax
65b: 89 10 mov %edx,(%eax)
65d: eb 0a jmp 669 <free+0x9c>
} else
bp->s.ptr = p->s.ptr;
65f: 8b 45 fc mov -0x4(%ebp),%eax
662: 8b 10 mov (%eax),%edx
664: 8b 45 f8 mov -0x8(%ebp),%eax
667: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
669: 8b 45 fc mov -0x4(%ebp),%eax
66c: 8b 40 04 mov 0x4(%eax),%eax
66f: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
676: 8b 45 fc mov -0x4(%ebp),%eax
679: 01 d0 add %edx,%eax
67b: 39 45 f8 cmp %eax,-0x8(%ebp)
67e: 75 20 jne 6a0 <free+0xd3>
p->s.size += bp->s.size;
680: 8b 45 fc mov -0x4(%ebp),%eax
683: 8b 50 04 mov 0x4(%eax),%edx
686: 8b 45 f8 mov -0x8(%ebp),%eax
689: 8b 40 04 mov 0x4(%eax),%eax
68c: 01 c2 add %eax,%edx
68e: 8b 45 fc mov -0x4(%ebp),%eax
691: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
694: 8b 45 f8 mov -0x8(%ebp),%eax
697: 8b 10 mov (%eax),%edx
699: 8b 45 fc mov -0x4(%ebp),%eax
69c: 89 10 mov %edx,(%eax)
69e: eb 08 jmp 6a8 <free+0xdb>
} else
p->s.ptr = bp;
6a0: 8b 45 fc mov -0x4(%ebp),%eax
6a3: 8b 55 f8 mov -0x8(%ebp),%edx
6a6: 89 10 mov %edx,(%eax)
freep = p;
6a8: 8b 45 fc mov -0x4(%ebp),%eax
6ab: a3 68 0a 00 00 mov %eax,0xa68
}
6b0: 90 nop
6b1: c9 leave
6b2: c3 ret
000006b3 <morecore>:
static Header*
morecore(uint nu)
{
6b3: f3 0f 1e fb endbr32
6b7: 55 push %ebp
6b8: 89 e5 mov %esp,%ebp
6ba: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
6bd: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
6c4: 77 07 ja 6cd <morecore+0x1a>
nu = 4096;
6c6: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
6cd: 8b 45 08 mov 0x8(%ebp),%eax
6d0: c1 e0 03 shl $0x3,%eax
6d3: 83 ec 0c sub $0xc,%esp
6d6: 50 push %eax
6d7: e8 57 fc ff ff call 333 <sbrk>
6dc: 83 c4 10 add $0x10,%esp
6df: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
6e2: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
6e6: 75 07 jne 6ef <morecore+0x3c>
return 0;
6e8: b8 00 00 00 00 mov $0x0,%eax
6ed: eb 26 jmp 715 <morecore+0x62>
hp = (Header*)p;
6ef: 8b 45 f4 mov -0xc(%ebp),%eax
6f2: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
6f5: 8b 45 f0 mov -0x10(%ebp),%eax
6f8: 8b 55 08 mov 0x8(%ebp),%edx
6fb: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
6fe: 8b 45 f0 mov -0x10(%ebp),%eax
701: 83 c0 08 add $0x8,%eax
704: 83 ec 0c sub $0xc,%esp
707: 50 push %eax
708: e8 c0 fe ff ff call 5cd <free>
70d: 83 c4 10 add $0x10,%esp
return freep;
710: a1 68 0a 00 00 mov 0xa68,%eax
}
715: c9 leave
716: c3 ret
00000717 <malloc>:
void*
malloc(uint nbytes)
{
717: f3 0f 1e fb endbr32
71b: 55 push %ebp
71c: 89 e5 mov %esp,%ebp
71e: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
721: 8b 45 08 mov 0x8(%ebp),%eax
724: 83 c0 07 add $0x7,%eax
727: c1 e8 03 shr $0x3,%eax
72a: 83 c0 01 add $0x1,%eax
72d: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
730: a1 68 0a 00 00 mov 0xa68,%eax
735: 89 45 f0 mov %eax,-0x10(%ebp)
738: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
73c: 75 23 jne 761 <malloc+0x4a>
base.s.ptr = freep = prevp = &base;
73e: c7 45 f0 60 0a 00 00 movl $0xa60,-0x10(%ebp)
745: 8b 45 f0 mov -0x10(%ebp),%eax
748: a3 68 0a 00 00 mov %eax,0xa68
74d: a1 68 0a 00 00 mov 0xa68,%eax
752: a3 60 0a 00 00 mov %eax,0xa60
base.s.size = 0;
757: c7 05 64 0a 00 00 00 movl $0x0,0xa64
75e: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
761: 8b 45 f0 mov -0x10(%ebp),%eax
764: 8b 00 mov (%eax),%eax
766: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
769: 8b 45 f4 mov -0xc(%ebp),%eax
76c: 8b 40 04 mov 0x4(%eax),%eax
76f: 39 45 ec cmp %eax,-0x14(%ebp)
772: 77 4d ja 7c1 <malloc+0xaa>
if(p->s.size == nunits)
774: 8b 45 f4 mov -0xc(%ebp),%eax
777: 8b 40 04 mov 0x4(%eax),%eax
77a: 39 45 ec cmp %eax,-0x14(%ebp)
77d: 75 0c jne 78b <malloc+0x74>
prevp->s.ptr = p->s.ptr;
77f: 8b 45 f4 mov -0xc(%ebp),%eax
782: 8b 10 mov (%eax),%edx
784: 8b 45 f0 mov -0x10(%ebp),%eax
787: 89 10 mov %edx,(%eax)
789: eb 26 jmp 7b1 <malloc+0x9a>
else {
p->s.size -= nunits;
78b: 8b 45 f4 mov -0xc(%ebp),%eax
78e: 8b 40 04 mov 0x4(%eax),%eax
791: 2b 45 ec sub -0x14(%ebp),%eax
794: 89 c2 mov %eax,%edx
796: 8b 45 f4 mov -0xc(%ebp),%eax
799: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
79c: 8b 45 f4 mov -0xc(%ebp),%eax
79f: 8b 40 04 mov 0x4(%eax),%eax
7a2: c1 e0 03 shl $0x3,%eax
7a5: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
7a8: 8b 45 f4 mov -0xc(%ebp),%eax
7ab: 8b 55 ec mov -0x14(%ebp),%edx
7ae: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
7b1: 8b 45 f0 mov -0x10(%ebp),%eax
7b4: a3 68 0a 00 00 mov %eax,0xa68
return (void*)(p + 1);
7b9: 8b 45 f4 mov -0xc(%ebp),%eax
7bc: 83 c0 08 add $0x8,%eax
7bf: eb 3b jmp 7fc <malloc+0xe5>
}
if(p == freep)
7c1: a1 68 0a 00 00 mov 0xa68,%eax
7c6: 39 45 f4 cmp %eax,-0xc(%ebp)
7c9: 75 1e jne 7e9 <malloc+0xd2>
if((p = morecore(nunits)) == 0)
7cb: 83 ec 0c sub $0xc,%esp
7ce: ff 75 ec pushl -0x14(%ebp)
7d1: e8 dd fe ff ff call 6b3 <morecore>
7d6: 83 c4 10 add $0x10,%esp
7d9: 89 45 f4 mov %eax,-0xc(%ebp)
7dc: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
7e0: 75 07 jne 7e9 <malloc+0xd2>
return 0;
7e2: b8 00 00 00 00 mov $0x0,%eax
7e7: eb 13 jmp 7fc <malloc+0xe5>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7e9: 8b 45 f4 mov -0xc(%ebp),%eax
7ec: 89 45 f0 mov %eax,-0x10(%ebp)
7ef: 8b 45 f4 mov -0xc(%ebp),%eax
7f2: 8b 00 mov (%eax),%eax
7f4: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
7f7: e9 6d ff ff ff jmp 769 <malloc+0x52>
}
}
7fc: c9 leave
7fd: c3 ret
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-ssvety.ads | djamal2727/Main-Bearing-Analytical-Model | 0 | 1124 | <filename>Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-ssvety.ads<gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . S S E . V E C T O R _ T Y P E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This unit exposes the Ada __m128 like data types to represent the contents
-- of SSE registers, for use by bindings to the SSE intrinsic operations.
-- See GNAT.SSE for the list of targets where this facility is supported
package GNAT.SSE.Vector_Types is
-- The reference guide states a few usage guidelines for the C types:
-- Since these new data types are not basic ANSI C data types, you
-- must observe the following usage restrictions:
--
-- * Use new data types only on either side of an assignment, as a
-- return value, or as a parameter. You cannot use it with other
-- arithmetic expressions ("+", "-", and so on).
--
-- * Use new data types as objects in aggregates, such as unions to
-- access the byte elements and structures.
--
-- * Use new data types only with the respective intrinsics described
-- in this documentation.
type m128 is private; -- SSE >= 1
type m128d is private; -- SSE >= 2
type m128i is private; -- SSE >= 2
private
-- Each of the m128 types maps to a specific vector_type with an extra
-- "may_alias" attribute as in GCC's definitions for C, for instance in
-- xmmintrin.h:
-- /* The Intel API is flexible enough that we must allow aliasing
-- with other vector types, and their scalar components. */
-- typedef float __m128
-- __attribute__ ((__vector_size__ (16), __may_alias__));
-- /* Internal data types for implementing the intrinsics. */
-- typedef float __v4sf __attribute__ ((__vector_size__ (16)));
------------
-- m128 --
------------
-- The __m128 data type can hold four 32-bit floating-point values
type m128 is array (1 .. 4) of Float32;
for m128'Alignment use VECTOR_ALIGN;
pragma Machine_Attribute (m128, "vector_type");
pragma Machine_Attribute (m128, "may_alias");
-------------
-- m128d --
-------------
-- The __m128d data type can hold two 64-bit floating-point values
type m128d is array (1 .. 2) of Float64;
for m128d'Alignment use VECTOR_ALIGN;
pragma Machine_Attribute (m128d, "vector_type");
pragma Machine_Attribute (m128d, "may_alias");
-------------
-- m128i --
-------------
-- The __m128i data type can hold sixteen 8-bit, eight 16-bit, four 32-bit,
-- or two 64-bit integer values.
type m128i is array (1 .. 2) of Integer64;
for m128i'Alignment use VECTOR_ALIGN;
pragma Machine_Attribute (m128i, "vector_type");
pragma Machine_Attribute (m128i, "may_alias");
end GNAT.SSE.Vector_Types;
|
src/asm/general.asm | Threetwosevensixseven/espupdate | 8 | 8558 | <filename>src/asm/general.asm
; general.asm
; Copyright 2020 <NAME>
;
; 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.
InstallErrorHandler proc ; Our error handler gets called by the OS if SCROLL? N happens
ld hl, ErrorHandler ; during printing, or any other ROM errors get thrown. We trap
Rst8(esxDOS.M_ERRH) ; the error in our ErrorHandler routine to give us a chance to
ret ; clean up the dot cmd before exiting to BASIC.
pend
ErrorHandler proc ; If we trap any errors thrown by the ROM, we currently just
ld hl, Err.Break ; exit the dot cmd with a "D BREAK - CONT repeats" custom
jp Return.WithCustomError ; error.
pend
ErrorProc proc
if enabled ErrDebug
ld a, (CRbeforeErr) ; For debugging convenience, if the "Debug" UI checkbox is
or a ; ticked in Zeus, We will print the custom error message in
jr z, NoCR ; the top half of the screen, and stop dead with a red border.
push hl ; This really helps see the error when debugging with the dot
ld a, CR ; cmd invoked from autoexec.bas, as the main menu obscures any
call Rst16 ; error messages during autoexec.bas execution.
pop hl
NoCR: call PrintRst16Error
Stop: Border(2)
jr Stop
else ; The normal (non-debug) error routine shows the error in both
ld a, (CRbeforeErr) ; parts of the screen, and exits to BASIC.
or a ; Special CR routine, to handle the case when we print
jr z, NoCR ; backspaces with no CR during the flash progress loop.
push hl
ld a, CR
call Rst16
pop hl
NoCR: push hl ; If we want to print the error at the top of the screen,
call PrintRst16Error ; as well as letting BASIC print it in the lower screen,
pop hl ; then uncomment this code.
jp Return.WithCustomError ; Straight to the error handing exit routine
endif
pend
RestoreF8 proc
Saved equ $+1: ld a, SMC ; This was saved here when we entered the dot command
and %1000 0000 ; Mask out everything but the F8 enable bit
ld d, a
NextRegRead(Reg.Peripheral2) ; Read the current value of Peripheral 2 register
and %0111 1111 ; Clear the F8 enable bit
or d ; Mask back in the saved bit
nextreg Reg.Peripheral2, a ; Save back to Peripheral 2 register
ret
pend
DeallocateBanks proc
Bank1 equ $+1: ld a, $FF ; Default value of $FF means not yet allocated
call Deallocate8KBank ; Ignore any error because we are doing best efforts to exit
Bank2 equ $+1: ld a, $FF ; Default value of $FF means not yet allocated
call Deallocate8KBank ; Ignore any error because we are doing best efforts to exit
Bank3 equ $+1: ld a, $FF ; Default value of $FF means not yet allocated
call Deallocate8KBank ; Ignore any error because we are doing best efforts to exit
Bank4 equ $+1: ld a, $FF ; Default value of $FF means not yet allocated
call Deallocate8KBank ; Ignore any error because we are doing best efforts to exit
; In more robust library code we might want to set these
; locations back to $FF before exiting, but here we are
; definitely exiting the dot command imminently.
nextreg $54, 4 ; Restore what BASIC is expecting to find at $8000 (16K bank 2)
nextreg $55, 5 ; Restore what BASIC is expecting to find at $A000 (16K bank 2)
nextreg $56, 0 ; Restore what BASIC is expecting to find at $C000 (16K bank 0)
nextreg $57, 1 ; Restore what BASIC is expecting to find at $C000 (16K bank 0)
ret
pend
RestoreSpeed proc
Saved equ $+3: nextreg Reg.CPUSpeed, SMC ; Restore speed to what it originally was at dot cmd entry
ret
pend
Return proc ; This routine restores everything preserved at the start of
ToBasic: ; the dot cmd, for success and errors, then returns to BASIC.
call DeallocateBanks ; Return allocated 8K banks and restore upper 48K banking
call RestoreSpeed ; Restore original CPU speed
call RestoreF8 ; Restore original F8 enable/disable state
Stack ld sp, SMC ; Unwind stack to original point
Stack1 equ Stack+1
IY1 equ $+1: ld iy, SMC ; Restore IY
ld a, 0
ei
ret ; Return to BASIC
WithCustomError:
push hl
call DeallocateBanks ; Return allocated 8K banks and restore upper 48K banking
call RestoreSpeed ; Restore original CPU speed
call RestoreF8 ; Restore original F8 enable/disable state
xor a
scf ; Signal error, hl = custom error message
pop hl
jp Stack ; (NextZXOS is not currently displaying standard error messages,
pend ; with a>0 and carry cleared, so we use a custom message.)
Allocate8KBank proc
ld hl, $0001 ; H = $00: rc_banktype_zx, L = $01: rc_bank_alloc
Internal: exx
ld c, 7 ; 16K Bank 7 required for most NextZXOS API calls
ld de, IDE_BANK ; M_P3DOS takes care of stack safety stack for us
Rst8(esxDOS.M_P3DOS) ; Make NextZXOS API call through esxDOS API with M_P3DOS
ErrorIfNoCarry(Err.NoMem) ; Fatal error, exits dot command
ld a, e ; Return in a more conveniently saveable register (A not E)
ret
pend
Deallocate8KBank proc ; Takes bank to deallocate in A (not E) for convenience
cp $FF ; If value is $FF it means we never allocated the bank,
ret z ; so return with carry clear (error) if that is the case
ld e, a ; Now move bank to deallocate into E for the API call
ld hl, $0003 ; H = $00: rc_banktype_zx, L = $03: rc_bank_free
jr Allocate8KBank.Internal ; Rest of deallocate is the same as the allocate routine
pend
Wait5Frames proc ; Convenience routines for different lengths of wait.
WaitFrames(5) ; Each frame is 1/50th of a second.
ret
pend
Wait30Frames proc ; Convenience routines for different lengths of wait.
WaitFrames(30) ; Each frame is 1/50th of a second.
ret
pend
Wait80Frames proc ; Convenience routines for different lengths of wait.
WaitFrames(80) ; Each frame is 1/50th of a second.
ret
pend
Wait100Frames proc ; Convenience routines for different lengths of wait.
WaitFrames(100) ; Each frame is 1/50th of a second.
ret
pend
WaitFramesProc proc
di
ld (SavedStack), sp ; Save stack
ld sp, $8000 ; Put stack in upper 48K so FRAMES gets updated (this is a
ei ; peculiarity of mode 1 interrupts inside dot commands).
Loop: halt ; Note that we already have a bank allocated by IDE_BANK
dec bc ; at $8000, so we're not corrupting BASIC by doing this.
ld a, b
or c
jr nz, Loop ; Wait for BC frames
di ; In this dot cmd interrupts are off unless waiting or printing
SavedStack equ $+1: ld sp, SMC ; Restore stack
ret
pend
SaveReadTimeoutProc proc ; hl = FramesToWait. Since we only really need to call
push hl ; ESPReadIntoBuffer with longer timeouts once, it's easier
ld hl, (ESPReadIntoBuffer.WaitNFrames) ; to self-modify the timeout routine when needed,
ld (TimeoutBackup), hl ; rather than have it always take a timeout parameter.
pop hl
Set: ld (ESPReadIntoBuffer.WaitNFrames), hl
ret
pend
RestoreReadTimeoutProc proc ; Counterpart to SaveReadTimeoutProc, restores the
ld hl, (TimeoutBackup) ; original timeout.
jr SaveReadTimeoutProc.Set
pend
WaitKey proc ; Just a debugging routine that allows me to clear
Border(6) ; my serial logs at a certain point, before logging
ei ; the traffic I'm interested in debugging.
Loop1: xor a
in a, ($FE)
cpl
and 15
halt
jr nz, Loop1
Loop2: xor a
in a, ($FE)
cpl
and 15
halt
jr z, Loop2
Border(7)
di
ret
pend
WaitKeyYN proc ; Returns carry set if no, carry clear if yes
ei ; Also prints Y or N followed by CR
Loop1: xor a
in a, ($FE)
cpl
and 15
halt
jr nz, Loop1
Loop2: ld bc, zeuskeyaddr("Y")
in a, (c)
and zeuskeymask("Y")
jr z, Yes
ld b, high zeuskeyaddr("N")
in a, (c)
and zeuskeymask("N")
jr nz, Loop2
No: scf
push af
ld a, 'N'
jr Print
Yes: xor a
push af
ld a, 'Y'
Print: call Rst16
ld a, CR
call Rst16
pop af
di
ret
pend
; ***************************************************************************
; * Parse an argument from the command tail *
; ***************************************************************************
; Entry: HL=command tail
; DE=destination for argument
; Exit: Fc=0 if no argument
; Fc=1: parsed argument has been copied to DE and null-terminated
; HL=command tail after this argument
; BC=length of argument
; NOTE: BC is validated to be 1..255; if not, it does not return but instead
; exits via show_usage.
;
; Routine provided by <NAME>, with thanks :) Original is here:
; https://gitlab.com/thesmog358/tbblue/blob/master/src/asm/dot_commands/defrag.asm#L599
GetSizedArgProc proc
ld a, h
or l
ret z ; exit with Fc=0 if hl is $0000 (no args)
ld bc, 0 ; initialise size to zero
Loop: ld a, (hl)
inc hl
and a
ret z ; exit with Fc=0 if $00
cp CR
ret z ; or if CR
cp ':'
ret z ; or if ':'
cp ' '
jr z, Loop ; skip any spaces
cp '"'
jr z, Quoted ; on for a quoted arg
Unquoted: ld (de), a ; store next char into dest
inc de
inc c ; increment length
jr z, BadSize ; don't allow >255
ld a, (hl)
and a
jr z, Complete ; finished if found $00
cp CR
jr z, Complete ; or CR
cp ':'
jr z, Complete ; or ':'
cp '"'
jr z, Complete ; or '"' indicating start of next arg
inc hl
cp ' '
jr nz, Unquoted ; continue until space
Complete: xor a
ld (de), a ; terminate argument with NULL
ld a, b
or c
jr z, BadSize ; don't allow zero-length args
scf ; Fc=1, argument found
ret
Quoted: ld a, (hl)
and a
jr z, Complete ; finished if found $00
cp CR
jr z, Complete ; or CR
inc hl
cp '"'
jr z, Complete ; finished when next quote consumed
ld (de), a ; store next char into dest
inc de
inc c ; increment length
jr z, BadSize ; don't allow >255
jr Quoted
BadSize: pop af ; discard return address
ErrorAlways(Err.ArgsBad)
pend
ParseHelp proc
ld a, b
or c
cp 2
ret nz
push hl
ld hl, ArgBuffer
ld a, (hl)
cp '-'
jr nz, Return
inc hl
ld a, (hl)
cp 'h'
jr nz, Return
ld a, 1
ld (WantsHelp), a
Return: pop hl
ret
pend
ParseForce proc
ld a, b
or c
cp 2
ret nz
push hl
ld hl, ArgBuffer
ld a, (hl)
cp '-'
jr nz, Return
inc hl
ld a, (hl)
cp 'y'
jr nz, Return
ld a, 1
ld (Force), a
Return: pop hl
ret
pend
|
programs/oeis/224/A224923.asm | karttu/loda | 0 | 160722 | ; A224923: Sum_{i=0..n} Sum_{j=0..n} (i XOR j), where XOR is the binary logical exclusive-or operator.
; 0,2,12,24,68,114,168,224,408,594,788,984,1212,1442,1680,1920,2672,3426,4188,4952,5748,6546,7352,8160,9096,10034,10980,11928,12908,13890,14880,15872,18912,21954,25004,28056,31140,34226,37320,40416,43640,46866,50100,53336,56604,59874,63152,66432,70224,74018,77820,81624,85460,89298,93144,96992,100968,104946,108932,112920,116940,120962,124992,129024,141248,153474,165708,177944,190212,202482,214760,227040,239448,251858,264276,276696,289148,301602,314064,326528,339504,352482,365468,378456,391476,404498,417528,430560,443720,456882,470052,483224,496428,509634,522848,536064,551328,566594,581868,597144,612452,627762,643080,658400,673848,689298,704756,720216,735708,751202,766704,782208,798224,814242,830268,846296,862356,878418,894488,910560,926760,942962,959172,975384,991628,1007874,1024128,1040384,1089408,1138434,1187468,1236504,1285572,1334642,1383720,1432800,1482008,1531218,1580436,1629656,1678908,1728162,1777424,1826688,1876464,1926242,1976028,2025816,2075636,2125458,2175288,2225120,2275080,2325042,2375012,2424984,2474988,2524994,2575008,2625024,2677088,2729154,2781228,2833304,2885412,2937522,2989640,3041760,3094008,3146258,3198516,3250776,3303068,3355362,3407664,3459968,3512784,3565602,3618428,3671256,3724116,3776978,3829848,3882720,3935720,3988722,4041732,4094744,4147788,4200834,4253888,4306944,4368192,4429442,4490700,4551960,4613252,4674546,4735848,4797152,4858584,4920018,4981460,5042904,5104380,5165858,5227344,5288832,5350832,5412834,5474844,5536856,5598900,5660946,5723000,5785056,5847240,5909426,5971620,6033816,6096044,6158274,6220512,6282752,6347040,6411330,6475628,6539928,6604260,6668594,6732936,6797280,6861752,6926226,6990708,7055192,7119708,7184226,7248752,7313280,7378320,7443362,7508412,7573464,7638548,7703634,7768728,7833824,7899048,7964274
mov $12,$0
mov $14,$0
lpb $14,1
clr $0,12
mov $0,$12
sub $14,1
sub $0,$14
mov $9,$0
mov $11,$0
lpb $11,1
mov $0,$9
sub $11,1
sub $0,$11
lpb $0,1
gcd $0,262144
mov $1,$0
pow $0,$3
sub $0,1
pow $1,2
mul $1,21
lpe
div $1,21
mul $1,2
add $10,$1
lpe
add $13,$10
lpe
mov $1,$13
|
Microsoft Word for Windows Version 1.1a/Word 1.1a CHM Distribution/Opus/asm/fetch2n.asm | lborgav/Historical-Source-Codes | 7 | 169499 | include w2.inc
include noxport.inc
include consts.inc
include structs.inc
createSeg fetch2_PCODE,fetch2,byte,public,CODE
; DEBUGGING DECLARATIONS
ifdef DEBUG
midFetch2n equ 24 ; module ID, for native asserts
endif
; EXTERNAL FUNCTIONS
ifdef DEBUG
externFP <ScrollDCFP>
else ;!DEBUG
ifdef HYBRID
externFP <ScrollDCPR>
else ;!HYBRID
externFP <ScrollDC>
endif ;!HYBRID
endif ;!DEBUG
externFP <PatBltRc>
externFP <N_CachePara>
externFP <FMsgPresent>
externFP <FSectRc>
externFP <CpFirstTap1>
externFP <FSetRgchDiff>
ifdef DEBUG
externFP <AssertProcForNative>
externFP <S_CachePara>
endif
sBegin data
;
; /* E X T E R N A L S */
;
externW hwwdCur ; extern struct WWD **hwwdCur;
externW mpwwhwwd ; extern struct WWD **mpwwhwwd[];
externW vpapFetch ; extern struct PAP vpapFetch;
externW caPara ; extern struct CA caPara;
externW selCur ; extern struct SEL selCur;
externW vchpGraySelCur ; extern struct CHP vchpGraySelCur;
externW vpapSelCur ; extern struct PAP vpapSelCur;
externW vpapGraySelCur ; extern struct PAP vpapGraySelCur;
externW vsci ; extern struct SCI vsci;
externW vmpitccp ; extern CP vmpitccp[];
externW caTap ; extern struct CA caTap;
externW vtapFetch ; extern struct TAP vtapFetch;
; #ifdef DEBUG
ifdef DEBUG
; extern int cHpFreeze;
externW vdbs ; extern struct DBS vdbs;
externW vcaLHRUpd ; extern struct CA vcaLHRUpd;
externW vwwLHRUpd ; extern int vwwLHRUpd;
; #endif /* DEBUG */
endif
sEnd data
; CODE SEGMENT _fetch2
sBegin fetch2
assumes cs,fetch2
assumes ds,dgroup
assumes ss,dgroup
;-------------------------------------------------------------------------
; FGetParaState(fAll, fAbortOk)
;-------------------------------------------------------------------------
; %%Function:N_FGetParaState %%Owner:BRADV
cProc N_FGetParaState,<PUBLIC,FAR>,<si,di>
ParmW fAll
ParmW fAbortOK
; /* ****
; * Description: Return properties for the paragraph menu.
; * The current selection nongray para props are left in vpapSelCur and the
; * paragraph attributes in vpapGraySelCur are set to non-zero if that attribute
; * differs from that in the previous paragraph. Up to cparaMax paragraphs
; * will be checked
; *
; * returns fFalse if interrupted, fTrue if complete. If interrupted,
; * selCur paps remain unchanged.
; ** **** */
;
; native FGetParaState(fAll, fAbortOk)
; BOOL fAll;
; BOOL fAbortOk; /* if true, this routine is interruptible */
; {
; /* REVIEW do we want to use fALL ?
; */
;
; /* max number of calls to CachePara */
; #define cparaMax 50
cparaMax equ 50
;
; int cpara = 0;
; struct PAP pap, papGray;
; CP cpNext;
localD cpNext
localW cPara
localW skVar ;fPapInitted in high byte
localV pap,cbPap
localV papGray,cbPap
cBegin
;Assert (fAll == 0 || fAll == 1);
ifdef DEBUG
test [fAll],0FFFEh
jz FGPS01
push ax
push bx
push cx
push dx
mov ax,midFetch2n
mov bx,1004
cCall AssertProcForNative,<ax, bx>
pop dx
pop cx
pop bx
pop ax
FGPS01:
endif ;DEBUG
;Assembler note: we keep !fAll in the high byte of cpara so
;that (fAll || (cpara <= cparaMax)) is really performed as
;!(((!fAll << 8) + cpara) > (fTrue << 8) + cparaMax).
errnz <(cparaMax+1) AND 0FF00h>
mov ax,00100h
xor ah,bptr ([fAll])
mov [cpara],ax
; /* we do some word operations, so be sure sizes are good */
; Assert (!(cbPAPBase % sizeof(int)));
; Assert (!(cbPAP % sizeof(int)));
errnz <cbPAPBase AND 1>
errnz <cbPAPMin AND 1>
; /* gray out everything if no child window up */
push ds
pop es
; if (hwwdCur == hNil)
; {
errnz <hNil>
xor ax,ax
cmp [hwwdCur],ax
jne FGPS02
; /* init gray pap to all gray */
; SetWords(&vpapGraySelCur, 0xFFFF, cwPAP);
mov di,dataoffset [vpapGraySelCur]
dec ax
errnz <cbPAPMin AND 1>
mov cx,cbPAPMin SHR 1
rep stosw
; return (fTrue); /* leave fUpdate bit on */
jmp FGPS14
; }
FGPS02:
; /* init entire local gray pap to all non gray */
; SetWords(&papGray, 0, cwPAP);
lea di,[papGray]
errnz <cbPAPMin AND 1>
mov cx,cbPAPMin SHR 1
rep stosw
; fCol = (selCur.sk == skColumn);
mov al,[selCur.skSel]
and al,maskSkSel
mov [skVar],ax ;also resets fPapInitted in high byte
;#ifdef DEBUG
; if (fCol)
; Assert (selCur.itcFirst >= 0 && selCur.itcLim >= 0);
;#endif /* DEBUG */
ifdef DEBUG
cmp al,skColumn SHL ibitSkSel
jne FGPS04
cmp [selCur.itcFirstSel],0
jl FGPS03
cmp [selCur.itcLimSel],0
jge FGPS04
FGPS03:
push ax
push bx
push cx
push dx
mov ax,midFetch2n
mov bx,1005
cCall AssertProcForNative,<ax, bx>
pop dx
pop cx
pop bx
pop ax
FGPS04:
endif ;DEBUG
; cpNext = selCur.cpFirst;
mov ax,[selCur.LO_cpFirstSel]
mov dx,[selCur.HI_cpFirstSel]
mov [OFF_cpNext],ax
mov [SEG_cpNext],dx
; /* Need to initialize pap for insertion points and one line block
; selections because they don't get inside the following while loop. */
; CachePara (selCur.doc, cpNext);
push [selCur.docSel]
push dx
push ax
ifdef DEBUG
cCall S_CachePara,<>
else ;not DEBUG
cCall N_CachePara,<>
endif ;DEBUG
; blt( &vpapFetch, &pap, cwPAP );
push ds
pop es
mov si,dataoffset [vpapFetch]
lea di,[pap]
errnz <cbPAPMin AND 1>
mov cx,cbPAPMin SHR 1
rep movsw
; while (cpNext < selCur.cpLim &&
; (fAll || (cpara <= cparaMax)))
; {
FGPS06:
mov ax,[OFF_cpNext]
mov dx,[SEG_cpNext]
sub ax,[selCur.LO_cpLimSel]
sbb dx,[selCur.HI_cpLimSel]
jge Ltemp001
;Assembler note: we keep !fAll in the high byte of cpara so
;that (fAll || (cpara <= cparaMax)) is really performed as
;!(((!fAll << 8) + cpara) > (fTrue << 8) + cparaMax).
errnz <(cparaMax+1) AND 0FF00h>
cmp [cpara],(fTrue SHL 8) + cparaMax
ja Ltemp001
; /* interrupted? */
; if ( fAbortOk &&
; /* take heed: FMsgPresent can call CachePara, move the heap, etc */
; FMsgPresent(mtyIdle) )
; {
cmp [fAbortOk],fFalse
je FGPS07
mov ax,mtyIdle
cCall FMsgPresent,<ax>
or ax,ax
jz FGPS07
; return (fFalse);
; }
jmp FGPS15
Ltemp001:
jmp FGPS12
FGPS07:
; if (fCol)
; CpFirstTap(selCur.doc, cpNext);
; cpT = (!fCol) ? cpNext : vmpitccp[selCur.itcFirst];
; /* will make non col case go only once */
; cpLimT = (!fCol) ? cpNext + 1 : vmpitccp[selCur.itcLim];
mov bx,[OFF_cpNext]
mov cx,[SEG_cpNext]
mov ax,1
cwd
add ax,bx
adc dx,cx
cmp bptr ([skVar]),skColumn SHL ibitSkSel
jne FGPS08
;***Begin in line CpFirstTap
; return CpFirstTap1(doc,cpFirst,caTap.doc==doc?vtapFetch.fOutline:fFalse);
mov dx,[selCur.docSel]
cmp dx,[caTap.docCa]
mov al,[vtapFetch.fOutlineTap]
je FGPS073
mov al,fFalse
FGPS073:
and ax,maskFOutlineTap
cCall CpFirstTap1,<dx, cx, bx, ax>
;***End in line CpFirstTap
mov ax,[selCur.itcFirstSel]
shl ax,1
shl ax,1
add ax,dataoffset [vmpitccp]
xchg ax,si
lodsw
xchg ax,bx
lodsw
xchg ax,cx
mov ax,[selCur.itcLimSel]
shl ax,1
shl ax,1
add ax,dataoffset [vmpitccp]
xchg ax,si
lodsw
xchg ax,dx
lodsw
xchg ax,dx
FGPS08:
; while (cpT < cpLimT)
; {
cmp bx,ax
mov si,cx
sbb si,dx
jge FGPS095
push dx
push ax ;save cpLimT
; /* If any props are different, set appropriate flags */
; CachePara (selCur.doc, cpT);
push [selCur.docSel]
push cx
push bx
ifdef DEBUG
cCall S_CachePara,<>
else ;not DEBUG
cCall N_CachePara,<>
endif ;DEBUG
; cpT = caPara.cpLim;
push [caPara.HI_cpLimCa]
push [caPara.LO_cpLimCa]
; if (++cpara == 1)
; blt( &vpapFetch, &pap, cwPAP ); /* save 1st paragraph for compares */
inc bptr ([cpara])
push ds
pop es
mov al,fTrue
xchg al,bptr ([skVar+1])
or al,al ;fPapInitted
jne FGPS09
mov si,dataoffset [vpapFetch]
lea di,[pap]
errnz <cbPAPMin AND 1>
mov cx,cbPapMin SHR 1
rep movsw
;Assembler note: just fall through and perform harmless operations.
;This case only occurs once per call to FGetParaState
FGPS09:
; else if (!vpapFetch.fTtp)
; {
cmp bptr [vpapFetch.fTtpPap],fFalse
jne FGPS093
; /* get base of pap */
; FSetRgwDiff (&pap, &vpapFetch, &papGray,
; cbPAPBase / sizeof (int));
;LN_FSetPapDiff takes an offset in di, cb in cx and performs
;FSetRgchDiff(pap+di, vpapFetch+di, papGray+di, cx);
;ax, bx, cx, dx, si, di are altered.
xor di,di
mov cx,cbPAPBase
call LN_FSetPapDiff
; /* also check in tab tables */
; FSetRgwDiff (pap.rgdxaTab, vpapFetch.rgdxaTab,
; papGray.rgdxaTab, pap.itbdMac);
; /* note chars, not words here */
;LN_FSetPapDiff takes an offset in di, cb in cx and performs
;FSetRgchDiff(pap+di, vpapFetch+di, papGray+di, cx);
;ax, bx, cx, dx, si, di are altered.
mov di,(rgdxaTabPap)
mov cx,[pap.itbdMacPap]
shl cx,1
call LN_FSetPapDiff
; FSetRgchDiff (pap.rgtbd, vpapFetch.rgtbd,
; papGray.rgtbd, pap.itbdMac);
;LN_FSetPapDiff takes an offset in di, cb in cx and performs
;FSetRgchDiff(pap+di, vpapFetch+di, papGray+di, cx);
;ax, bx, cx, dx, si, di are altered.
mov di,(rgtbdPap)
mov cx,[pap.itbdMacPap]
call LN_FSetPapDiff
FGPS093:
pop bx
pop cx ;restore cpT
pop ax
pop dx ;restore cpLimT
; }
; }
jmp FGPS08
FGPS095:
; cpNext = (!fCol) ? caPara.cpLim : caTap.cpLim;
mov si,dataoffset [caPara.LO_cpLimCa]
cmp bptr ([skVar]),skColumn SHL ibitSkSel
jne FGPS10
mov si,dataoffset [caTap.LO_cpLimCa]
FGPS10:
push ds
pop es
lea di,[cpNext]
movsw
movsw
; }
jmp FGPS06
FGPS12:
; /* if we ran out, say everything is gray */
; if (!fAll && cpara > cparaMax)
;Assembler note: we keep !fAll in the high byte of cpara so
;that (fAll || (cpara <= cparaMax)) is really performed as
;!(((!fAll << 8) + cpara) > (fTrue << 8) + cparaMax).
push ds
pop es
mov di,dataoffset [vpapGraySelCur]
mov cx,cbPapMin SHR 1
lea si,[papGray]
errnz <(cparaMax+1) AND 0FF00h>
cmp [cpara],(fTrue SHL 8) + cparaMax
jbe FGPS13
; SetWords(&vpapGraySelCur, 0xFFFF, cwPAP);
mov ax,0ffffh
rep stosw
db 03Dh ;turns next "rep movsw" into "cmp ax,immediate"
FGPS13:
; else /* normal finish */
; blt(&papGray, &vpapGraySelCur, cwPAP);
rep movsw
; blt(&pap, &vpapSelCur, cwPAP);
lea si,[pap]
mov di,dataoffset [vpapSelCur]
mov cx,cbPapMin SHR 1
rep movsw
;
; selCur.fUpdatePap = fFalse;
and [selCur.fUpdatePapSel],NOT maskfUpdatePapSel
; /* if someone besides the ruler called me, set this to
; ensure ruler update at idle */
; selCur.fUpdateRuler = fTrue;
or [selCur.fUpdateRulerSel],maskfUpdateRulerSel
; #ifdef DEBUG /* save selection range and ww for CkLHRUpd debug test */
ifdef DEBUG
; {
; extern struct CA vcaLHRUpd;
; extern int vwwLHRUpd; /* window where selection is shown */
;
; vcaLHRUpd = selCur.ca;
mov si,dataoffset [selCur.caSel]
mov di,dataoffset [vcaLHRUpd]
mov cx,cbCaMin SHR 1
rep movsw
; vwwLHRUpd = selCur.ww;
mov ax,[selCur.wwSel]
mov [vwwLHRUpd],ax
; }
; #endif
endif
; return (fTrue);
FGPS14:
db 0B8h ;turns next "xor ax,ax" into "mov ax,immediate"
FGPS15:
errnz <fFalse>
xor ax,ax
; }
cEnd
;LN_FSetPapDiff takes an offset in di, cb in cx and performs
;FSetRgchDiff(pap+di, vpapFetch+di, papGray+di, cx);
;ax, bx, cx, dx, si, di are altered.
LN_FSetPapDiff:
lea si,[pap+di]
lea bx,[papGray+di]
add di,dataoffset [vpapFetch]
cCall FSetRgchDiff,<si, di, bx, cx>
ret
sEnd fetch2
end
|
nasm assembly/library/read_array.asm | AI-Factor-y/NASM-library | 0 | 23060 | <reponame>AI-Factor-y/NASM-library<filename>nasm assembly/library/read_array.asm
read_array:
; usage
;-------
; 1: base address of array in ebx mov ebx, array
; 2: size of array in n
push rax ; push all
push rbx
push rcx
mov eax ,0
read_loop:
cmp eax,dword[n]
je end_read_1
push rax
push rbx
call read_num
pop rbx
pop rax
;;read num stores the input in ’num’
mov cx,word[num]
mov word[ebx+2*eax],cx
inc eax
;;Here, each word consists of two bytes, so the counter should be
; incremented by multiples of two. If the array is declared in bytes do mov word[ebx+eax],cx
jmp read_loop
end_read_1:
pop rcx
pop rbx
pop rax ; pop all
ret
|
programs/oeis/265/A265127.asm | neoneye/loda | 22 | 7556 | ; A265127: a(n) = prime(n) * 2^n.
; 4,12,40,112,352,832,2176,4864,11776,29696,63488,151552,335872,704512,1540096,3473408,7733248,15990784,35127296,74448896,153092096,331350016,696254464,1493172224,3254779904,6777995264,13824425984,28722593792,58518929408,121332826112
seq $0,110295 ; a(n) = prime(n)*2^(n-1).
mul $0,2
|
source/strings/a-suegst.adb | ytomino/drake | 33 | 26676 | <reponame>ytomino/drake<filename>source/strings/a-suegst.adb
with Ada.Exception_Identification.From_Here;
with Ada.Strings.UTF_Encoding.Conversions;
with System.UTF_Conversions;
package body Ada.Strings.UTF_Encoding.Generic_Strings is
use Exception_Identification.From_Here;
generic
type UTF_Character_Type is (<>);
type UTF_String_Type is array (Positive range <>) of UTF_Character_Type;
BOM : UTF_String_Type;
with procedure To_UTF (
Code : System.UTF_Conversions.UCS_4;
Result : out UTF_String_Type;
Last : out Natural;
Status : out System.UTF_Conversions.To_Status_Type);
function Generic_Encode (
Item : String_Type;
Output_BOM : Boolean := False)
return UTF_String_Type;
function Generic_Encode (
Item : String_Type;
Output_BOM : Boolean := False)
return UTF_String_Type
is
-- Expanding_From_N is not static because formal object of generic
pragma Compile_Time_Error (
UTF_Character_Type'Size /= 8
and then UTF_Character_Type'Size /= 16
and then UTF_Character_Type'Size /= 32,
"bad UTF_Character_Type'Size");
Expanding : Positive;
begin
if UTF_Character_Type'Size = 8 then
Expanding := Expanding_To_8;
elsif UTF_Character_Type'Size = 16 then
Expanding := Expanding_To_16;
else
Expanding := Expanding_To_32;
end if;
declare
Item_Last : Natural := Item'First - 1;
Result : UTF_String_Type (1 .. BOM'Length + Item'Length * Expanding);
Result_Last : Natural := Result'First - 1;
begin
if Output_BOM then
Result (Result_Last + 1 .. Result_Last + BOM'Length) := BOM;
Result_Last := Result_Last + BOM'Length;
end if;
while Item_Last < Item'Last loop
declare
Code : Wide_Wide_Character;
Is_Illegal_Sequence : Boolean;
To_Status : System.UTF_Conversions.To_Status_Type; -- ignore
begin
Get (
Item (Item_Last + 1 .. Item'Last),
Item_Last,
Code,
Is_Illegal_Sequence);
if Is_Illegal_Sequence then
Raise_Exception (Encoding_Error'Identity);
end if;
To_UTF (
Wide_Wide_Character'Pos (Code),
Result (Result_Last + 1 .. Result'Last),
Result_Last,
To_Status);
end;
end loop;
return Result (1 .. Result_Last);
end;
end Generic_Encode;
generic
type UTF_Character_Type is (<>);
type UTF_String_Type is array (Positive range <>) of UTF_Character_Type;
BOM : UTF_String_Type;
with procedure From_UTF (
Data : UTF_String_Type;
Last : out Natural;
Result : out System.UTF_Conversions.UCS_4;
Status : out System.UTF_Conversions.From_Status_Type);
function Generic_Decode (Item : UTF_String_Type) return String_Type;
function Generic_Decode (Item : UTF_String_Type) return String_Type is
-- Expanding_To_N is not static because formal object of generic
pragma Compile_Time_Error (
UTF_Character_Type'Size /= 8
and then UTF_Character_Type'Size /= 16
and then UTF_Character_Type'Size /= 32,
"bad UTF_Character_Type'Size");
Expanding : Positive;
begin
if UTF_Character_Type'Size = 8 then
Expanding := Expanding_From_8;
elsif UTF_Character_Type'Size = 16 then
Expanding := Expanding_From_16;
else
Expanding := Expanding_From_32;
end if;
declare
Item_Last : Natural := Item'First - 1;
Result : String_Type (1 .. Item'Length * Expanding);
Result_Last : Natural := Result'First - 1;
begin
declare
L : constant Natural := Item_Last + BOM'Length;
begin
if L <= Item'Last and then Item (Item_Last + 1 .. L) = BOM then
Item_Last := L;
end if;
end;
while Item_Last < Item'Last loop
declare
Code : System.UTF_Conversions.UCS_4;
From_Status : System.UTF_Conversions.From_Status_Type;
begin
From_UTF (
Item (Item_Last + 1 .. Item'Last),
Item_Last,
Code,
From_Status);
case From_Status is
when System.UTF_Conversions.Success
| System.UTF_Conversions.Non_Shortest =>
-- AARM A.4.11(54.a/4)
null;
when System.UTF_Conversions.Illegal_Sequence
| System.UTF_Conversions.Truncated =>
Raise_Exception (Encoding_Error'Identity);
end case;
Put (
Wide_Wide_Character'Val (Code),
Result (Result_Last + 1 .. Result'Last),
Result_Last);
end;
end loop;
return Result (1 .. Result_Last);
end;
end Generic_Decode;
-- implementation
function Encode (
Item : String_Type;
Output_Scheme : Encoding_Scheme;
Output_BOM : Boolean := False)
return UTF_String is
begin
return Conversions.Convert (
UTF_32_Wide_Wide_String'(Encode (Item, Output_BOM => False)),
Output_Scheme,
Output_BOM);
end Encode;
function Encode (Item : String_Type; Output_BOM : Boolean := False)
return UTF_8_String
is
function Encode_To_8 is
new Generic_Encode (
Character,
UTF_8_String,
BOM_8,
System.UTF_Conversions.To_UTF_8);
begin
return Encode_To_8 (Item, Output_BOM);
end Encode;
function Encode (Item : String_Type; Output_BOM : Boolean := False)
return UTF_16_Wide_String
is
function Encode_To_16 is
new Generic_Encode (
Wide_Character,
UTF_16_Wide_String,
BOM_16,
System.UTF_Conversions.To_UTF_16);
begin
return Encode_To_16 (Item, Output_BOM);
end Encode;
function Encode (Item : String_Type; Output_BOM : Boolean := False)
return UTF_32_Wide_Wide_String
is
function Encode_To_32 is
new Generic_Encode (
Wide_Wide_Character,
UTF_32_Wide_Wide_String,
BOM_32,
System.UTF_Conversions.To_UTF_32);
begin
return Encode_To_32 (Item, Output_BOM);
end Encode;
function Decode (Item : UTF_String; Input_Scheme : Encoding_Scheme)
return String_Type is
begin
return Decode (
UTF_32_Wide_Wide_String'(
Conversions.Convert (Item, Input_Scheme, Output_BOM => False)));
end Decode;
function Decode (Item : UTF_8_String) return String_Type is
function Decode_From_8 is
new Generic_Decode (
Character,
UTF_8_String,
BOM_8,
System.UTF_Conversions.From_UTF_8);
begin
return Decode_From_8 (Item);
end Decode;
function Decode (Item : UTF_16_Wide_String) return String_Type is
function Decode_From_16 is
new Generic_Decode (
Wide_Character,
UTF_16_Wide_String,
BOM_16,
System.UTF_Conversions.From_UTF_16);
begin
return Decode_From_16 (Item);
end Decode;
function Decode (Item : UTF_32_Wide_Wide_String) return String_Type is
function Decode_From_32 is
new Generic_Decode (
Wide_Wide_Character,
UTF_32_Wide_Wide_String,
BOM_32,
System.UTF_Conversions.From_UTF_32);
begin
return Decode_From_32 (Item);
end Decode;
end Ada.Strings.UTF_Encoding.Generic_Strings;
|
programs/oeis/008/A008728.asm | neoneye/loda | 22 | 82691 | <filename>programs/oeis/008/A008728.asm
; A008728: Molien series for 3-dimensional group [2,n ] = *22n.
; 1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,22,24,26,28,30,33,36,39,42,45,48,51,54,57,60,64,68,72,76,80,84,88,92,96,100,105,110,115,120,125,130,135,140,145,150,156,162,168,174,180,186,192,198,204,210,217,224,231,238,245,252,259,266,273,280,288,296,304,312,320,328,336,344,352,360,369,378,387,396,405,414,423,432,441,450,460,470,480,490,500,510,520,530,540,550
add $0,1
lpb $0
add $1,$0
trn $0,10
lpe
mov $0,$1
|
SOURCE ASM FILES/FPSHack_TEST_SlowHookShotIn.asm | Meowmaritus/Wind-Waker-60FPS-Hack | 14 | 5935 | #To be inserted at 800f2620
###############################
##FPSHack_TEST_SlowHookShotIn##
###############################
lis r17, 0x817F
lfs f17, 0x0004 (r17) #Load FloatSlowdown
lfs f0, -0x5EE8 (rtoc) #Vanilla
fmuls f0, f0, f17 |
programs/clock.asm | informer2016/MichalOS | 0 | 23671 | <filename>programs/clock.asm<gh_stars>0
; ------------------------------------------------------------------
; MichalOS Clock
; ------------------------------------------------------------------
BITS 16
%INCLUDE "michalos.inc"
ORG 100h
start:
call .draw_background
call os_hide_cursor
.timeloop:
clc
mov ah, 02h ; Get the time
int 1Ah
mov [.seconds], dh
mov [.minutes], cl
mov [.hours], ch
mov al, [.hours] ; Draw the hours value
mov dh, 9
mov dl, 1
rol al, 4
call .draw_numbers
add dl, 12
rol al, 4
call .draw_numbers
add dl, 12
call .draw_colon
add dl, 4
mov al, [.minutes] ; Draw the minutes value
mov dh, 9
rol al, 4
call .draw_numbers
add dl, 12
rol al, 4
call .draw_numbers
add dl, 12
call .draw_colon
add dl, 4
mov al, [.seconds] ; Draw the seconds value
mov dh, 9
rol al, 4
call .draw_numbers
add dl, 12
rol al, 4
call .draw_numbers
add dl, 12
mov ah, 04h ; Get the date
int 1Ah
mov [.day], dl
mov [.month], dh
mov [.year], cl
mov [.century], ch
mov dh, 17
mov dl, 1
call os_move_cursor
mov al, [.day]
call os_bcd_to_int
mov ah, 0
call os_int_to_string
mov si, ax
call os_print_string
mov al, [.month]
call os_bcd_to_int
dec al
mov ah, 0
mov bx, 10
push dx
mul bx
pop dx
add ax, .m1
mov si, ax
call os_print_string
call os_print_space
mov al, [.day]
call os_bcd_to_int
mov ah, 0
call os_int_to_string
mov si, ax
call os_print_string
mov si, .spacer2
call os_print_string
mov al, [.century]
call os_bcd_to_int
mov ah, 0
call os_int_to_string
mov si, ax
call os_print_string
mov al, [.year]
call os_bcd_to_int
mov ah, 0
call os_int_to_string
mov si, ax
call os_print_string
mov si, .spacer
call os_print_string
hlt
call os_check_for_key
cmp al, 27
je near .exit
jmp .timeloop
.draw_numbers: ; IN: low 4 bits of AL; DH/DL = cursor position
pusha
and al, 0Fh
mov bl, al
mov ax, 77
mul bl
add ax, .n00
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 11
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 11
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 11
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 11
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 11
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 11
call os_move_cursor
mov si, ax
call os_print_string
popa
ret
.draw_colon: ; IN: DH/DL = cursor position
pusha
mov ax, .na0
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 3
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 3
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 3
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 3
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 3
call os_move_cursor
mov si, ax
call os_print_string
inc dh
add ax, 3
call os_move_cursor
mov si, ax
call os_print_string
popa
ret
.draw_background:
mov ax, .title_msg
mov bx, .footer_msg
mov cx, [57000]
call os_draw_background
ret
.exit:
call os_show_cursor
ret
.spacer db ' ', 0
.spacer2 db ', ', 0
.title_msg db 'MichalOS Clock', 0
.footer_msg db 0
.hours db 0
.minutes db 0
.seconds db 0
.day db 0
.month db 0
.year db 0
.century db 0
.n00 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n01 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n02 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n03 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n04 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n05 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n06 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n10 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n11 db 32, 32, 219, 219, 219, 219, 32, 32, 32, 32, 0
.n12 db 219, 219, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n13 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n14 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n15 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n16 db 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 0
.n20 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n21 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n22 db 32, 32, 32, 32, 32, 32, 219, 219, 32, 32, 0
.n23 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n24 db 32, 32, 219, 219, 32, 32, 32, 32, 32, 32, 0
.n25 db 219, 219, 32, 32, 32, 32, 32, 32, 32, 32, 0
.n26 db 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 0
.n30 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n31 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n32 db 32, 32, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n33 db 32, 32, 32, 32, 219, 219, 219, 219, 32, 32, 0
.n34 db 32, 32, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n35 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n36 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n40 db 219, 219, 32, 32, 32, 32, 32, 32, 32, 32, 0
.n41 db 219, 219, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n42 db 219, 219, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n43 db 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 0
.n44 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n45 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n46 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n50 db 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 0
.n51 db 219, 219, 32, 32, 32, 32, 32, 32, 32, 32, 0
.n52 db 219, 219, 32, 32, 32, 32, 32, 32, 32, 32, 0
.n53 db 219, 219, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n54 db 32, 32, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n55 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n56 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n60 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n61 db 219, 219, 32, 32, 32, 32, 32, 32, 32, 32, 0
.n62 db 219, 219, 32, 32, 32, 32, 32, 32, 32, 32, 0
.n63 db 219, 219, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n64 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n65 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n66 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n70 db 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 0
.n71 db 32, 32, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n72 db 32, 32, 32, 32, 32, 32, 219, 219, 32, 32, 0
.n73 db 32, 32, 32, 32, 219, 219, 32, 32, 32, 32, 0
.n74 db 32, 32, 219, 219, 32, 32, 32, 32, 32, 32, 0
.n75 db 219, 219, 32, 32, 32, 32, 32, 32, 32, 32, 0
.n76 db 219, 219, 32, 32, 32, 32, 32, 32, 32, 32, 0
.n80 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n81 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n82 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n83 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n84 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n85 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n86 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n90 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.n91 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n92 db 219, 219, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n93 db 32, 32, 219, 219, 219, 219, 219, 219, 219, 219, 0
.n94 db 32, 32, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n95 db 32, 32, 32, 32, 32, 32, 32, 32, 219, 219, 0
.n96 db 32, 32, 219, 219, 219, 219, 219, 219, 32, 32, 0
.na0 db 32, 32, 0
.na1 db 219, 219, 0
.na2 db 32, 32, 0
.na3 db 32, 32, 0
.na4 db 32, 32, 0
.na5 db 219, 219, 0
.na6 db 32, 32, 0
.m1 db 'January', 0, 0, 0
.m2 db 'February', 0, 0
.m3 db 'March', 0, 0, 0, 0, 0
.m4 db 'April', 0, 0, 0, 0, 0
.m5 db 'May', 0, 0, 0, 0, 0, 0, 0
.m6 db 'June', 0, 0, 0, 0, 0, 0
.m7 db 'July', 0, 0, 0, 0, 0, 0
.m8 db 'August', 0, 0, 0, 0
.m9 db 'September', 0
.m10 db 'October', 0, 0, 0
.m11 db 'November', 0, 0
.m12 db 'December', 0, 0
; ------------------------------------------------------------------
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.