hexsha
stringlengths
40
40
size
int64
6
1.05M
ext
stringclasses
3 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
232
max_stars_repo_name
stringlengths
7
106
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
7
max_stars_count
int64
1
33.5k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
232
max_issues_repo_name
stringlengths
7
106
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
7
max_issues_count
int64
1
37.5k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
232
max_forks_repo_name
stringlengths
7
106
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
7
max_forks_count
int64
1
12.6k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
6
1.05M
avg_line_length
float64
1.16
19.7k
max_line_length
int64
2
938k
alphanum_fraction
float64
0
1
6076d73cbbf41811fb2e7b5d79b63016c883c039
220
asm
Assembly
libsrc/_DEVELOPMENT/arch/zx/esxdos/c/sdcc_iy/esxdos_f_sync_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zx/esxdos/c/sdcc_iy/esxdos_f_sync_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zx/esxdos/c/sdcc_iy/esxdos_f_sync_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; int esxdos_f_sync(uchar handle) SECTION code_clib SECTION code_esxdos PUBLIC _esxdos_f_sync_fastcall EXTERN asm_esxdos_f_sync _esxdos_f_sync_fastcall: push iy call asm_esxdos_f_sync pop iy ret
12.222222
33
0.777273
12f347bbac420b9136f75aeefea62d7c9802b4c1
836
asm
Assembly
programs/oeis/141/A141962.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/141/A141962.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/141/A141962.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A141962: Primes congruent to 22 mod 27. ; 103,157,211,373,643,751,859,967,1021,1129,1237,1291,1399,1453,1669,1723,1777,1831,1993,2371,2749,2803,2857,3019,3181,3343,3559,3613,4099,4153,4261,4423,4639,4801,4909,5179,5233,5449,5503,5557,5827,5881,6043,6151,6367,6421,6529,6637,6691,6907,6961,7069,7177,7393,7717,7879,7933,8311,8419,8527,8581,8689,9013,9067,9283,9337,9391,9661,9769,9931,10039,10093,10687,10903,10957,11119,11173,11443,11497,11551,11821,12037,12253,12577,12739,13009,13063,13171,13441,13711,13873,14143,14197,14251,14629,14683,14737,15061,15277,15331 mov $2,$0 add $2,2 pow $2,2 lpb $2 add $1,21 sub $2,1 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,6 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe div $1,2 sub $1,22 mul $1,2 add $1,39 mov $0,$1
34.833333
523
0.721292
270da5c0f626d5ab79f4bdb56d1a0aeb7d6b2a99
26,525
asm
Assembly
Library/Math/Float/floatGlobal.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Math/Float/floatGlobal.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Math/Float/floatGlobal.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @----------------------------------------------------------------------- Copyright (c) Geoworks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: floatGlobal.asm AUTHOR: Cheng, 1/91 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial revision DESCRIPTION: Global routines which may go through a dispatch routine. $Id: floatGlobal.asm,v 1.1 97/04/05 01:23:01 newdeal Exp $ -------------------------------------------------------------------------------@ COMMENT @----------------------------------------------------------------------- FUNCTION: floating point routines. DESCRIPTION: CALLED BY: GLOBAL () PASS: RETURN: carry set on error al - FloatErrorType DESTROYED: ax REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: Many of the common float routines have been written such that: * arguments are never passed in bp * they expect ds to contain the floating point stack segment * they are not allowed to destroy registers except for ax and dx Since the requirements are similar, it makes sense to have a common dispatch routine. To make a routine that complies with these conditions global, 1. assign a constant for the routine in the FloatGlobals list 2. place an entry in the CORRESPONDING position in tableGlobals 3. write an entry routine of the form RoutineName proc far push bp mov bp, ROUTINE_NAME_CONSTANT GOTO FloatDispatch, bp RoutineName endp 4. add entries to float.gp, floatManager.asm and Include/math.def To find out more about the routines, please look up the routine headers of the near routines. I originally thought that it might be a good idea to break up the library into 2 code resources, one for the common routines and the other for the transcendental routines. The cost involved (all common routines made far, and proc calls from the transcendental resource) seems too great though, so it's shelved for now. KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: The routines that take no arguments and either have no return values or return a byte or word in ax are handled specially so that CStubs those routines do not have to be written, they are defined in all CAPS REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ FLOATMINUS1 proc far push bp mov bp, FLOAT_MINUS1 GOTO FloatDispatch, bp FLOATMINUS1 endp FLOATMINUSPOINT5 proc far push bp mov bp, FLOAT_MINUS_POINT5 GOTO FloatDispatch, bp FLOATMINUSPOINT5 endp FLOAT0 proc far push bp mov bp, FLOAT_0 GOTO FloatDispatch, bp FLOAT0 endp FLOATPOINT5 proc far push bp mov bp, FLOAT_POINT5 GOTO FloatDispatch, bp FLOATPOINT5 endp FLOAT1 proc far push bp mov bp, FLOAT_1 GOTO FloatDispatch, bp FLOAT1 endp FLOAT2 proc far push bp mov bp, FLOAT_2 GOTO FloatDispatch, bp FLOAT2 endp FLOAT5 proc far push bp mov bp, FLOAT_5 GOTO FloatDispatch, bp FLOAT5 endp FLOAT10 proc far push bp mov bp, FLOAT_10 GOTO FloatDispatch, bp FLOAT10 endp FLOAT3600 proc far push bp mov bp, FLOAT_3600 GOTO FloatDispatch, bp FLOAT3600 endp FLOAT16384 proc far push bp mov bp, FLOAT_16384 GOTO FloatDispatch, bp FLOAT16384 endp FLOAT86400 proc far push bp mov bp, FLOAT_86400 GOTO FloatDispatch, bp FLOAT86400 endp FLOATADD proc far push bp mov bp, FLOAT_ADD GOTO FloatDispatch, bp FLOATADD endp FLOATDIV proc far push bp mov bp, FLOAT_DIV GOTO FloatDispatch, bp FLOATDIV endp FLOATDIVIDE proc far push bp mov bp, FLOAT_DIVIDE GOTO FloatDispatch, bp FLOATDIVIDE endp FLOATDIVIDE2 proc far push bp mov bp, FLOAT_DIVIDE2 GOTO FloatDispatch, bp FLOATDIVIDE2 endp FLOATDIVIDE10 proc far push bp mov bp, FLOAT_DIVIDE10 GOTO FloatDispatch, bp FLOATDIVIDE10 endp FloatDwordToFloatFar proc far push bp mov bp, FLOAT_DWORD_INT_TO_FLOAT GOTO FloatDispatch, bp FloatDwordToFloatFar endp FLOATEPSILON proc far push bp mov bp, FLOAT_EPSILON GOTO FloatDispatch, bp FLOATEPSILON endp FLOATFACTORIAL proc far push bp mov bp, FLOAT_FACTORIAL GOTO FloatDispatch, bp FLOATFACTORIAL endp FLOATFRAC proc far push bp mov bp, FLOAT_FRAC GOTO FloatDispatch, bp FLOATFRAC endp FLOATINT proc far push bp mov bp, FLOAT_INT GOTO FloatDispatch, bp FLOATINT endp FLOATINTFRAC proc far push bp mov bp, FLOAT_INT_FRAC GOTO FloatDispatch, bp FLOATINTFRAC endp FLOATINVERSE proc far push bp mov bp, FLOAT_INVERSE GOTO FloatDispatch, bp FLOATINVERSE endp FLOATMAX proc far push bp mov bp, FLOAT_MAX GOTO FloatDispatch, bp FLOATMAX endp FLOATMIN proc far push bp mov bp, FLOAT_MIN GOTO FloatDispatch, bp FLOATMIN endp FLOATMOD proc far push bp mov bp, FLOAT_MOD GOTO FloatDispatch, bp FLOATMOD endp FLOATMULTIPLY proc far push bp mov bp, FLOAT_MULTIPLY GOTO FloatDispatch, bp FLOATMULTIPLY endp FLOATMULTIPLY2 proc far push bp mov bp, FLOAT_MULTIPLY2 GOTO FloatDispatch, bp FLOATMULTIPLY2 endp FLOATMULTIPLY10 proc far push bp mov bp, FLOAT_MULTIPLY10 GOTO FloatDispatch, bp FLOATMULTIPLY10 endp FLOATNEGATE proc far push bp mov bp, FLOAT_NEGATE GOTO FloatDispatch, bp FLOATNEGATE endp FLOATOVER proc far push bp mov bp, FLOAT_OVER GOTO FloatDispatch, bp FLOATOVER endp FLOATRANDOM proc far push bp mov bp, FLOAT_RANDOM GOTO FloatDispatch, bp FLOATRANDOM endp FLOATRANDOMN proc far push bp mov bp, FLOAT_RANDOM_N GOTO FloatDispatch, bp FLOATRANDOMN endp FloatRollFar proc far push bp mov bp, FLOAT_ROLL GOTO FloatDispatch, bp FloatRollFar endp FloatRollDownFar proc far push bp mov bp, FLOAT_ROLL_DOWN GOTO FloatDispatch, bp FloatRollDownFar endp FLOATROT proc far push bp mov bp, FLOAT_ROT GOTO FloatDispatch, bp FLOATROT endp FloatRoundFar proc far push bp mov bp, FLOAT_ROUND GOTO FloatDispatch, bp FloatRoundFar endp FLOATSUB proc far push bp mov bp, FLOAT_SUB GOTO FloatDispatch, bp FLOATSUB endp FLOATSWAP proc far push bp mov bp, FLOAT_SWAP GOTO FloatDispatch, bp FLOATSWAP endp FLOAT10TOTHEX proc far push bp mov bp, FLOAT_10_TO_THE_X GOTO FloatDispatch, bp FLOAT10TOTHEX endp FLOATTRUNC proc far push bp mov bp, FLOAT_TRUNC GOTO FloatDispatch, bp FLOATTRUNC endp FloatWordToFloatFar proc far push bp mov bp, FLOAT_WORD_INT_TO_FLOAT GOTO FloatDispatch, bp FloatWordToFloatFar endp ; ; transcendental routines follow ; FLOATARCCOS proc far push bp mov bp, FLOAT_ARC_COS GOTO FloatDispatch, bp FLOATARCCOS endp FLOATARCCOSH proc far push bp mov bp, FLOAT_ARC_COSH GOTO FloatDispatch, bp FLOATARCCOSH endp FLOATARCSIN proc far push bp mov bp, FLOAT_ARC_SIN GOTO FloatDispatch, bp FLOATARCSIN endp FLOATARCSINH proc far push bp mov bp, FLOAT_ARC_SINH GOTO FloatDispatch, bp FLOATARCSINH endp FLOATARCTAN proc far push bp mov bp, FLOAT_ARC_TAN GOTO FloatDispatch, bp FLOATARCTAN endp FLOATARCTAN2 proc far push bp mov bp, FLOAT_ARC_TAN2 GOTO FloatDispatch, bp FLOATARCTAN2 endp FLOATARCTANH proc far push bp mov bp, FLOAT_ARC_TANH GOTO FloatDispatch, bp FLOATARCTANH endp FLOATCOS proc far push bp mov bp, FLOAT_COS GOTO FloatDispatch, bp FLOATCOS endp FLOATCOSH proc far push bp mov bp, FLOAT_COSH GOTO FloatDispatch, bp FLOATCOSH endp FLOATEXP proc far push bp mov bp, FLOAT_EXP GOTO FloatDispatch, bp FLOATEXP endp FLOATEXPONENTIAL proc far push bp mov bp, FLOAT_EXPONENTIAL GOTO FloatDispatch, bp FLOATEXPONENTIAL endp FLOATLG proc far push bp mov bp, FLOAT_LG GOTO FloatDispatch, bp FLOATLG endp FLOATLG10 proc far push bp mov bp, FLOAT_LG10 GOTO FloatDispatch, bp FLOATLG10 endp FLOATLN proc far push bp mov bp, FLOAT_LN GOTO FloatDispatch, bp FLOATLN endp FLOATLN1PLUSX proc far push bp mov bp, FLOAT_LN1PLUSX GOTO FloatDispatch, bp FLOATLN1PLUSX endp FLOATLN2 proc far push bp mov bp, FLOAT_LN2 GOTO FloatDispatch, bp FLOATLN2 endp FLOATLN10 proc far push bp mov bp, FLOAT_LN10 GOTO FloatDispatch, bp FLOATLN10 endp FLOATLOG proc far push bp mov bp, FLOAT_LOG GOTO FloatDispatch, bp FLOATLOG endp FLOATPI proc far push bp mov bp, FLOAT_PI GOTO FloatDispatch, bp FLOATPI endp FLOATPIDIV2 proc far push bp mov bp, FLOAT_PI_DIV_2 GOTO FloatDispatch, bp FLOATPIDIV2 endp FLOATSIN proc far push bp mov bp, FLOAT_SIN GOTO FloatDispatch, bp FLOATSIN endp FLOATSINH proc far push bp mov bp, FLOAT_SINH GOTO FloatDispatch, bp FLOATSINH endp FLOATSQR proc far push bp mov bp, FLOAT_SQR GOTO FloatDispatch, bp FLOATSQR endp FLOATSQRT proc far push bp mov bp, FLOAT_SQRT GOTO FloatDispatch, bp FLOATSQRT endp FLOATSQRT2 proc far push bp mov bp, FLOAT_SQRT2 GOTO FloatDispatch, bp FLOATSQRT2 endp FLOATTAN proc far push bp mov bp, FLOAT_TAN GOTO FloatDispatch, bp FLOATTAN endp FLOATTANH proc far push bp mov bp, FLOAT_TANH GOTO FloatDispatch, bp FLOATTANH endp ; ; mr. dispatch routine ; FloatDispatch proc far push dx,ds ; save registers that routines can destroy mov bp, cs:tableGlobals[bp] ; get addr of routine call FloatEnter ; ds <- fp stack seg call bp ; call routine call FloatIsNoNAN1 ; is the result an error code? cmc ; carry is a boolean, so flip bit jnc done call FloatIsInfinity ; al <- error code stc ; FloatIsInfinity clears carry if non-inf done: call FloatOpDone ; unlock the fp stack pop dx,ds ; restore registers FALL_THRU_POP bp ret FloatDispatch endp FloatGlobals etype byte, 0, 2 FLOAT_MINUS1 enum FloatGlobals FLOAT_MINUS_POINT5 enum FloatGlobals FLOAT_0 enum FloatGlobals FLOAT_POINT5 enum FloatGlobals FLOAT_1 enum FloatGlobals FLOAT_2 enum FloatGlobals FLOAT_5 enum FloatGlobals FLOAT_10 enum FloatGlobals FLOAT_3600 enum FloatGlobals FLOAT_16384 enum FloatGlobals FLOAT_86400 enum FloatGlobals FLOAT_ADD enum FloatGlobals FLOAT_DIV enum FloatGlobals FLOAT_DIVIDE enum FloatGlobals FLOAT_DIVIDE2 enum FloatGlobals FLOAT_DIVIDE10 enum FloatGlobals FLOAT_DWORD_INT_TO_FLOAT enum FloatGlobals FLOAT_EPSILON enum FloatGlobals FLOAT_FACTORIAL enum FloatGlobals FLOAT_FRAC enum FloatGlobals FLOAT_INT enum FloatGlobals FLOAT_INT_FRAC enum FloatGlobals FLOAT_INVERSE enum FloatGlobals FLOAT_MAX enum FloatGlobals FLOAT_MIN enum FloatGlobals FLOAT_MOD enum FloatGlobals FLOAT_MULTIPLY enum FloatGlobals FLOAT_MULTIPLY2 enum FloatGlobals FLOAT_MULTIPLY10 enum FloatGlobals FLOAT_NEGATE enum FloatGlobals FLOAT_OVER enum FloatGlobals FLOAT_RANDOM enum FloatGlobals FLOAT_RANDOM_N enum FloatGlobals FLOAT_ROLL enum FloatGlobals FLOAT_ROLL_DOWN enum FloatGlobals FLOAT_ROT enum FloatGlobals FLOAT_ROUND enum FloatGlobals FLOAT_SUB enum FloatGlobals FLOAT_SWAP enum FloatGlobals FLOAT_10_TO_THE_X enum FloatGlobals FLOAT_TRUNC enum FloatGlobals FLOAT_WORD_INT_TO_FLOAT enum FloatGlobals ; ; transcendental routines follow ; FLOAT_ARC_COS enum FloatGlobals FLOAT_ARC_COSH enum FloatGlobals FLOAT_ARC_SIN enum FloatGlobals FLOAT_ARC_SINH enum FloatGlobals FLOAT_ARC_TAN enum FloatGlobals FLOAT_ARC_TAN2 enum FloatGlobals FLOAT_ARC_TANH enum FloatGlobals FLOAT_COS enum FloatGlobals FLOAT_COSH enum FloatGlobals FLOAT_EXP enum FloatGlobals FLOAT_EXPONENTIAL enum FloatGlobals FLOAT_LG enum FloatGlobals FLOAT_LG10 enum FloatGlobals FLOAT_LN enum FloatGlobals FLOAT_LN1PLUSX enum FloatGlobals FLOAT_LN2 enum FloatGlobals FLOAT_LN10 enum FloatGlobals FLOAT_LOG enum FloatGlobals FLOAT_PI enum FloatGlobals FLOAT_PI_DIV_2 enum FloatGlobals FLOAT_SIN enum FloatGlobals FLOAT_SINH enum FloatGlobals FLOAT_SQR enum FloatGlobals FLOAT_SQRT enum FloatGlobals FLOAT_SQRT2 enum FloatGlobals FLOAT_TAN enum FloatGlobals FLOAT_TANH enum FloatGlobals tableGlobals label word word offset FloatMinus1 word offset FloatMinusPoint5 word offset Float0 word offset FloatPoint5 word offset Float1 word offset Float2 word offset Float5 word offset Float10 word offset Float3600 word offset Float16384 word offset Float86400 word offset FloatAdd word offset FloatDIV word offset FloatDivide word offset FloatDivide2 word offset FloatDivide10 word offset FloatDwordToFloat word offset FloatEpsilon word offset FloatFactorial word offset FloatFrac word offset FloatInt word offset FloatIntFrac word offset FloatInverse word offset FloatMax word offset FloatMin word offset FloatMod word offset FloatMultiply word offset FloatMultiply2 word offset FloatMultiply10 word offset FloatNegate word offset FloatOver word offset FloatRandom word offset FloatRandomN word offset FloatRoll word offset FloatRollDown word offset FloatRot word offset FloatRound word offset FloatSub word offset FloatSwap word offset Float10ToTheX word offset FloatTrunc word offset FloatWordToFloat ; ; transcendental routines follow ; word offset FloatArcCos word offset FloatArcCosh word offset FloatArcSin word offset FloatArcSinh word offset FloatArcTan word offset FloatArcTan2 word offset FloatArcTanh word offset FloatCos word offset FloatCosh word offset FloatExp word offset FloatExponential word offset FloatLg word offset FloatLg10 word offset FloatLn word offset FloatLn1plusX word offset FloatLn2 word offset FloatLn10 word offset FloatLog word offset FloatPi word offset FloatPiDiv2 word offset FloatSin word offset FloatSinh word offset FloatSqr word offset FloatSqrt word offset FloatSqrt2 word offset FloatTan word offset FloatTanh COMMENT @----------------------------------------------------------------------- FUNCTION: FloatDepthFar DESCRIPTION: CALLED BY: GLOBAL () PASS: nothing RETURN: ax - depth DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 3/91 Initial version -------------------------------------------------------------------------------@ FLOATDEPTH proc far uses bx,ds .enter call FloatEnter mov ax, ds:FSV_bottomPtr sub ax, ds:FSV_topPtr mov bl, FPSIZE div bl call FloatOpDone .leave ret FLOATDEPTH endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatEnterFar DESCRIPTION: Lock the fp stack prior to access. CALLED BY: INTERNAL () PASS: nothing RETURN: ds - fp stack seg DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 3/91 Initial version -------------------------------------------------------------------------------@ FloatEnterFar proc far call FloatEnter ret FloatEnterFar endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatFloatToDwordFar DESCRIPTION: CALLED BY: GLOBAL () PASS: nothing RETURN: carry clear if successful dx:ax - dword set otherwise al - error code DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: Can't use the dispatch routine because a result is returned in dx:ax. Also, don't want FloatDispatch to call FloatIsNoNAN1 on what remains. KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 3/91 Initial version -------------------------------------------------------------------------------@ FLOATFLOATTODWORD proc far uses ds .enter call FloatEnter call FloatFloatToDword ; dx:ax <- dword jnc done mov al, FLOAT_GEN_ERR done: call FloatOpDone .leave ret FLOATFLOATTODWORD endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatOpDoneFar DESCRIPTION: This routine unlocks the fp stack. Called by the global routines when they are done accessing the fp stack. CALLED BY: INTERNAL () PASS: ds - fp stack seg RETURN: nothing DESTROYED: nothing, flags are preserved REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 3/91 Initial version -------------------------------------------------------------------------------@ FloatOpDoneFar proc far call FloatOpDone ret FloatOpDoneFar endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatSetStackPointer DESCRIPTION: Primarily for use by applications for error recovery. Applications can bail out of involved operations by saving the stack pointer prior to commencing operations and restoring the stack pointer in the event of an error. NOTE: ----- If you set the stack pointer, the current stack pointer must be less than or equal to the value you pass. Ie. you must be throwing something (or nothing) away. CALLED BY: GLOBAL () PASS: ax - desired value of the stack pointer RETURN: carry clear if successful, set otherwise (dies in EC code if unsuccessful) DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: the only reason we bother to divide out and the multiply FPSIZE back in is so that the value that gets returned by GetStackPointer will then be the same as in the coprocesor case REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 3/91 Initial version -------------------------------------------------------------------------------@ FloatSetStackPointer proc far uses ds, bx, dx .enter call FloatEnter ; ax = bottom-top/FPSZIE mov bx, FPSIZE mul bx ; ax = bottom-top ; EC < tst dx > EC < ERROR_NZ FLOAT_BAD_STACK_POINTER > sub ax, ds:FSV_bottomPtr ; ax = (bottom-top)-bottom = -top neg ax ; ax = top cmp ax, ds:FSV_topPtr ; see that ax >= stkTop jb err cmp ax, ds:FSV_bottomPtr ; see that ax <= stkBot ja err mov ds:FSV_topPtr, ax ; stuff it EC< call FloatCheckStack > clc jmp short done err: stc EC< ERROR FLOAT_BAD_STACK_POINTER > done: call FloatOpDone .leave ret FloatSetStackPointer endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatLt0Far, FloatEq0Far, FloatGt0Far DESCRIPTION: ( FP: X --- ) CALLED BY: GLOBAL () PASS: X on fp stack RETURN: carry - set if TRUE clear otherwise X is popped off DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ FloatLt0Far proc far uses ds .enter call FloatEnter call FloatLt0 call FloatOpDone .leave ret FloatLt0Far endp FloatEq0Far proc far uses ds .enter call FloatEnter call FloatEq0 call FloatOpDone .leave ret FloatEq0Far endp FloatGt0Far proc far uses ds .enter call FloatEnter call FloatGt0 call FloatOpDone .leave ret FloatGt0Far endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatRandomizeFar DESCRIPTION: Force the use of the given seed for random number generation. If the seed is small ( << 2^32 ), prime the random number generator before use by calling FloatRandom 3 or 4 times and discarding the results. CALLED BY: GLOBAL () PASS: al - RandomGenInitFlags RGIF_USE_SEED RGIF_GENERATE_SEED cx:dx - seed if RGIF_USE_SEED RETURN: nothing DESTROYED: ax REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 3/91 Initial version -------------------------------------------------------------------------------@ FloatRandomizeFar proc far uses dx,ds .enter call FloatEnter call FloatRandomize call FloatOpDone .leave ret FloatRandomizeFar endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatIEEE64ToGeos80Far DESCRIPTION: Convert a floating point number in IEEE 64 bit format into an fp number in Geos 80 bit format and push it onto the fp stack. Geos 80 bit format is almost the same as the IEEE 80 bit format except that we do not have an implied msb 1. A 64 bit number has a 52 bit mantissa and a 12 bit exponent. An 80 bit number has a 64 bit mantissa and a 16 bit exponent. CALLED BY: GLOBAL () PASS: ds:si - IEEE 64 bit number RETURN: float number on the fp stack DESTROYED: ax REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 10/91 Initial version -------------------------------------------------------------------------------@ FloatIEEE64ToGeos80Far proc far uses es .enter call FloatEnter_ES ; es <- fp stack seg call FloatIEEE64ToGeos80 call FloatOpDone_ES ; unlock the fp stack .leave ret FloatIEEE64ToGeos80Far endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatGeos80ToIEEE64Far DESCRIPTION: Convert a floating point number in Geos 80 bit format into an fp number in IEEE 64 bit format and push it onto the fp stack. Geos 80 bit format is almost the same as the IEEE 80 bit format except that we do not have an implied msb 1. An 80 bit number has a 64 bit mantissa and a 16 bit exponent. A 64 bit number has a 52 bit mantissa and a 12 bit exponent. CALLED BY: INTERNAL () PASS: es:di - location to store the IEEE 64 bit number RETURN: carry clear if successful carry set otherwise float number popped off stack in either case DESTROYED: ax REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 10/91 Initial version -------------------------------------------------------------------------------@ FloatGeos80ToIEEE64Far proc far uses ds .enter call FloatEnter ; ds <- fp stack seg call FloatGeos80ToIEEE64 call FloatOpDone ; unlock the fp stack .leave ret FloatGeos80ToIEEE64Far endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatIEEE32ToGeos80Far DESCRIPTION: Convert a floating point number in IEEE 32 bit format into an fp number in Geos 80 bit format and push it onto the fp stack. Geos 80 bit format is almost the same as the IEEE 80 bit format except that we do not have an implied msb 1. A 32 bit number has a 23 bit mantissa and a 8 bit exponent. and a sign bit An 80 bit number has a 64 bit mantissa and a 16 bit exponent. CALLED BY: GLOBAL () PASS: dx:ax = 32 bit number RETURN: float number on the fp stack DESTROYED: ax REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 10/91 Initial version -------------------------------------------------------------------------------@ FloatIEEE32ToGeos80Far proc far uses es .enter call FloatEnter_ES ; es <- fp stack seg call FloatIEEE32ToGeos80 call FloatOpDone_ES ; unlock the fp stack .leave ret FloatIEEE32ToGeos80Far endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatGeos80ToIEEE32Far DESCRIPTION: Convert a floating point number in Geos 80 bit format into an fp number in IEEE 32 bit format and push it onto the fp stack. Geos 80 bit format is almost the same as the IEEE 80 bit format except that we do not have an implied msb 1. An 80 bit number has a 64 bit mantissa and a 16 bit exponent. A 32 bit number has a 23 bit mantissa and a 8 bit exponent and a sign bit. CALLED BY: INTERNAL () PASS: nothing RETURN: dx:ax = number popped off from stack into 32bit format DESTROYED: ax REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 10/91 Initial version -------------------------------------------------------------------------------@ FloatGeos80ToIEEE32Far proc far uses ds .enter call FloatEnter ; ds <- fp stack seg call FloatGeos80ToIEEE32 call FloatOpDone ; unlock the fp stack .leave ret FloatGeos80ToIEEE32Far endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatGetNumDigitsInIntegerPart DESCRIPTION: As routine says, eg. with 5678.956, routine returns 4. CALLED BY: INTERNAL () PASS: X on the fp stack RETURN: ax - number of digits in the integer part X is popped off the stack DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 10/91 Initial version -------------------------------------------------------------------------------@ FLOATGETNUMDIGITSININTEGERPART proc far uses dx,ds .enter call FloatEnter ; ds <- fp stack seg call FloatGetNumDigitsInIntegerPart call FloatOpDone ; unlock the fp stack .leave ret FLOATGETNUMDIGITSININTEGERPART endp
21.460356
81
0.665335
eaf1b5e034d03446e0a36c240d514543fd8bedb3
1,713
asm
Assembly
programs/oeis/180/A180919.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/180/A180919.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/180/A180919.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A180919: a(n) = n^2 + 731*n + 1. ; 1,733,1467,2203,2941,3681,4423,5167,5913,6661,7411,8163,8917,9673,10431,11191,11953,12717,13483,14251,15021,15793,16567,17343,18121,18901,19683,20467,21253,22041,22831,23623,24417,25213,26011,26811,27613,28417,29223,30031,30841,31653,32467,33283,34101,34921,35743,36567,37393,38221,39051,39883,40717,41553,42391,43231,44073,44917,45763,46611,47461,48313,49167,50023,50881,51741,52603,53467,54333,55201,56071,56943,57817,58693,59571,60451,61333,62217,63103,63991,64881,65773,66667,67563,68461,69361,70263,71167,72073,72981,73891,74803,75717,76633,77551,78471,79393,80317,81243,82171,83101,84033,84967,85903,86841,87781,88723,89667,90613,91561,92511,93463,94417,95373,96331,97291,98253,99217,100183,101151,102121,103093,104067,105043,106021,107001,107983,108967,109953,110941,111931,112923,113917,114913,115911,116911,117913,118917,119923,120931,121941,122953,123967,124983,126001,127021,128043,129067,130093,131121,132151,133183,134217,135253,136291,137331,138373,139417,140463,141511,142561,143613,144667,145723,146781,147841,148903,149967,151033,152101,153171,154243,155317,156393,157471,158551,159633,160717,161803,162891,163981,165073,166167,167263,168361,169461,170563,171667,172773,173881,174991,176103,177217,178333,179451,180571,181693,182817,183943,185071,186201,187333,188467,189603,190741,191881,193023,194167,195313,196461,197611,198763,199917,201073,202231,203391,204553,205717,206883,208051,209221,210393,211567,212743,213921,215101,216283,217467,218653,219841,221031,222223,223417,224613,225811,227011,228213,229417,230623,231831,233041,234253,235467,236683,237901,239121,240343,241567,242793,244021 add $0,366 bin $0,2 mov $1,$0 sub $1,66795 mul $1,2 add $1,1
171.3
1,615
0.82662
eb13e4db3ec7844781a974b40f6b7569bbfb2ac7
202
asm
Assembly
libsrc/_DEVELOPMENT/string/c/sdcc_iy/memset_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/string/c/sdcc_iy/memset_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/string/c/sdcc_iy/memset_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; void *memset_callee(void *s, int c, size_t n) SECTION code_string PUBLIC _memset_callee EXTERN asm_memset _memset_callee: pop af pop hl pop de pop bc push af jp asm_memset
10.631579
47
0.688119
10e3831aeb72d225c971b5518cf71d4e9dc6e574
349
asm
Assembly
programs/oeis/136/A136396.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/136/A136396.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/136/A136396.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A136396: 1+n*(n+1)*(n^2-n+12)/12. ; 1,3,8,19,41,81,148,253,409,631,936,1343,1873,2549,3396,4441,5713,7243,9064,11211,13721,16633,19988,23829,28201,33151,38728,44983,51969,59741,68356,77873,88353,99859,112456,126211,141193,157473,175124,194221,214841,237063,260968,286639 mov $1,$0 bin $0,2 add $1,$0 add $0,6 mul $1,2 mul $1,$0 div $1,6 add $1,1
29.083333
236
0.713467
0d858e3ea3a6f737f809fac8f2cdac1424ab603b
1,648
asm
Assembly
programs/oeis/014/A014635.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/014/A014635.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/014/A014635.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A014635: a(n) = 2*n*(4*n - 1). ; 0,6,28,66,120,190,276,378,496,630,780,946,1128,1326,1540,1770,2016,2278,2556,2850,3160,3486,3828,4186,4560,4950,5356,5778,6216,6670,7140,7626,8128,8646,9180,9730,10296,10878,11476,12090,12720,13366,14028,14706,15400,16110,16836,17578,18336,19110,19900,20706,21528,22366,23220,24090,24976,25878,26796,27730,28680,29646,30628,31626,32640,33670,34716,35778,36856,37950,39060,40186,41328,42486,43660,44850,46056,47278,48516,49770,51040,52326,53628,54946,56280,57630,58996,60378,61776,63190,64620,66066,67528,69006,70500,72010,73536,75078,76636,78210,79800,81406,83028,84666,86320,87990,89676,91378,93096,94830,96580,98346,100128,101926,103740,105570,107416,109278,111156,113050,114960,116886,118828,120786,122760,124750,126756,128778,130816,132870,134940,137026,139128,141246,143380,145530,147696,149878,152076,154290,156520,158766,161028,163306,165600,167910,170236,172578,174936,177310,179700,182106,184528,186966,189420,191890,194376,196878,199396,201930,204480,207046,209628,212226,214840,217470,220116,222778,225456,228150,230860,233586,236328,239086,241860,244650,247456,250278,253116,255970,258840,261726,264628,267546,270480,273430,276396,279378,282376,285390,288420,291466,294528,297606,300700,303810,306936,310078,313236,316410,319600,322806,326028,329266,332520,335790,339076,342378,345696,349030,352380,355746,359128,362526,365940,369370,372816,376278,379756,383250,386760,390286,393828,397386,400960,404550,408156,411778,415416,419070,422740,426426,430128,433846,437580,441330,445096,448878,452676,456490,460320,464166,468028,471906,475800,479710,483636,487578,491536,495510 mov $1,$0 mul $1,4 bin $1,2
235.428571
1,585
0.827063
4c7024d04bdf6f928ec8335d875cbaeb16cb3b6f
392
asm
Assembly
test_cases/push-pop/test.asm
lorainemg/s-mipsv2-processor
8988a5ef730aaa7918bd50539f35f5247bd3c0f7
[ "MIT" ]
null
null
null
test_cases/push-pop/test.asm
lorainemg/s-mipsv2-processor
8988a5ef730aaa7918bd50539f35f5247bd3c0f7
[ "MIT" ]
null
null
null
test_cases/push-pop/test.asm
lorainemg/s-mipsv2-processor
8988a5ef730aaa7918bd50539f35f5247bd3c0f7
[ "MIT" ]
null
null
null
addi r1 r0 32 addi r2 r0 1 addi r3 r0 0 addi r4 r0 20 addi r5 r0 10 addi r8 r0 2 ciclo: add r7 r2 r0 addi r9 r0 0 imprime: divu r2 r5 mfhi r6 push r6 addi r9 r9 1 mflo r2 bne r2 r0 imprime imprime2: pop r6 addi r6 r6 48 tty r6 addi r9 r9 -1 bne r9 r0 imprime2 tty r1 add r2 r7 r0 mulu r2 r8 mflo r2 addi r3 r3 1 bne r3 r4 ciclo halt # Deberia escribir todas las potencias de 2 del 0 al 19
11.529412
55
0.72449
326b4a2e9d762837e8530dd75002a4cb3462c02e
664
asm
Assembly
src/main/resources/Examples/Directives/Data Directives.asm
jimw278/MIPS
13d666f46ad945f038514768d975150d89cd612b
[ "Apache-2.0" ]
3
2020-11-04T00:03:41.000Z
2020-11-30T00:35:39.000Z
src/main/resources/Examples/Directives/Data Directives.asm
jimw278/MIPS
13d666f46ad945f038514768d975150d89cd612b
[ "Apache-2.0" ]
27
2020-09-01T00:44:10.000Z
2021-05-10T15:59:46.000Z
src/main/resources/Examples/Directives/Data Directives.asm
jimw278/MIPS
13d666f46ad945f038514768d975150d89cd612b
[ "Apache-2.0" ]
1
2020-12-05T00:14:11.000Z
2020-12-05T00:14:11.000Z
;these directives store some sort of data or leave space for it word: .word 1352255 ;creates a 32 bit integer in memory wordList: .word 1,0x2,3,0b100,5 ;creates a list of 32 bit integers in memory hword: .hword 0xFF ;creates a 16 bit integer in memory hwordList: .hword 4,3,2,1 ;creates a list of 16 bit integers in memory byte: .byte 0b10100110 ; creates a 8 bit integer in memory byteList: .byte 255,254,2,1 ;creates a list of 8 bit integers in memory space: .space 16 ;allocates N bytes of space in memory string .ascii "Hello World!" ;places the string Hello World! into memory as an array of chars(bytes) .byte 0 ;normally used to terminate a string
25.538462
93
0.753012
f61a641e66bdd37de0642f97e272f685531c4e02
681
asm
Assembly
base/common/integer.asm
zbyti/Mad-Pascal
546cae9724828f93047080109488be7d0d07d47e
[ "MIT" ]
7
2020-05-02T15:37:57.000Z
2021-02-17T01:59:41.000Z
base/common/integer.asm
michalkolodziejski/Mad-Pascal
0a7a1e2f379e50b0a23878b0d881ff3407269ed6
[ "MIT" ]
14
2020-05-03T02:02:35.000Z
2020-08-10T08:41:19.000Z
base/common/integer.asm
michalkolodziejski/Mad-Pascal
0a7a1e2f379e50b0a23878b0d881ff3407269ed6
[ "MIT" ]
5
2020-06-02T18:34:14.000Z
2020-07-09T18:13:44.000Z
/* mulINTEGER divmulINT */ .proc mulINTEGER jsr imulCARD jmp movaBX_EAX .endp .proc divmulINT REAL ldy <divREAL lda >divREAL bne skp MOD mva #{jsr} _mod lda :STACKORIGIN+STACKWIDTH*3,x ; divisor sign spl jsr negCARD DIV ldy <idivCARD lda >idivCARD skp sty addr sta addr+1 ldy #0 lda :STACKORIGIN-1+STACKWIDTH*3,x ; dividend sign bpl @+ jsr negCARD1 iny @ lda :STACKORIGIN+STACKWIDTH*3,x ; divisor sign bpl @+ jsr negCARD iny @ tya and #1 pha jsr $ffff ; idiv ecx addr equ *-2 jsr movaBX_EAX _mod bit movZTMP_aBX ; mod mva #{bit} _mod pla seq jmp negCARD1 rts .endp
10.983871
51
0.621145
1363c4e51704ccde6d1341bdad3af99881f48d73
486
asm
Assembly
programs/oeis/327/A327666.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/327/A327666.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/327/A327666.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A327666: a(n) = Sum_{k = 1..n} (-1)^(Omega(k) - omega(k)), where Omega(k) counts prime factors of k with multiplicity and omega(k) counts distinct prime factors. ; 1,2,3,2,3,4,5,6,5,6,7,6,7,8,9,8,9,8,9,8,9,10,11,12,11,12,13,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,26,25,26,27,26,25,24,25,24,25,26,27,28,29,30,31,30,31,32,31,30,31,32,33,32,33,34 lpb $0 mov $2,$0 sub $0,1 seq $2,162511 ; Multiplicative function with a(p^e)=(-1)^(e-1) add $1,$2 lpe add $1,1 mov $0,$1
40.5
190
0.627572
ea4eec7b9da7c77edb9bf6e22f12fe9b7cc7e7e8
54,295
asm
Assembly
grep.asm
Vignesh-Nadar/xv6
601dda244865540bb0ace21a2ff5ae7e6cf181f9
[ "MIT-0" ]
null
null
null
grep.asm
Vignesh-Nadar/xv6
601dda244865540bb0ace21a2ff5ae7e6cf181f9
[ "MIT-0" ]
null
null
null
grep.asm
Vignesh-Nadar/xv6
601dda244865540bb0ace21a2ff5ae7e6cf181f9
[ "MIT-0" ]
null
null
null
_grep: file format elf32-i386 Disassembly of section .text: 00000000 <grep>: char buf[1024]; int match(char*, char*); void grep(char *pattern, int fd) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 28 sub $0x28,%esp int n, m; char *p, *q; m = 0; 6: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ d: e9 c6 00 00 00 jmp d8 <grep+0xd8> m += n; 12: 8b 45 ec mov -0x14(%ebp),%eax 15: 01 45 f4 add %eax,-0xc(%ebp) buf[m] = '\0'; 18: 8b 45 f4 mov -0xc(%ebp),%eax 1b: 05 80 0e 00 00 add $0xe80,%eax 20: c6 00 00 movb $0x0,(%eax) p = buf; 23: c7 45 f0 80 0e 00 00 movl $0xe80,-0x10(%ebp) while((q = strchr(p, '\n')) != 0){ 2a: eb 51 jmp 7d <grep+0x7d> *q = 0; 2c: 8b 45 e8 mov -0x18(%ebp),%eax 2f: c6 00 00 movb $0x0,(%eax) if(match(pattern, p)){ 32: 8b 45 f0 mov -0x10(%ebp),%eax 35: 89 44 24 04 mov %eax,0x4(%esp) 39: 8b 45 08 mov 0x8(%ebp),%eax 3c: 89 04 24 mov %eax,(%esp) 3f: e8 bc 01 00 00 call 200 <match> 44: 85 c0 test %eax,%eax 46: 74 2c je 74 <grep+0x74> *q = '\n'; 48: 8b 45 e8 mov -0x18(%ebp),%eax 4b: c6 00 0a movb $0xa,(%eax) write(1, p, q+1 - p); 4e: 8b 45 e8 mov -0x18(%ebp),%eax 51: 83 c0 01 add $0x1,%eax 54: 89 c2 mov %eax,%edx 56: 8b 45 f0 mov -0x10(%ebp),%eax 59: 29 c2 sub %eax,%edx 5b: 89 d0 mov %edx,%eax 5d: 89 44 24 08 mov %eax,0x8(%esp) 61: 8b 45 f0 mov -0x10(%ebp),%eax 64: 89 44 24 04 mov %eax,0x4(%esp) 68: c7 04 24 01 00 00 00 movl $0x1,(%esp) 6f: e8 74 05 00 00 call 5e8 <write> } p = q+1; 74: 8b 45 e8 mov -0x18(%ebp),%eax 77: 83 c0 01 add $0x1,%eax 7a: 89 45 f0 mov %eax,-0x10(%ebp) m = 0; while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ m += n; buf[m] = '\0'; p = buf; while((q = strchr(p, '\n')) != 0){ 7d: c7 44 24 04 0a 00 00 movl $0xa,0x4(%esp) 84: 00 85: 8b 45 f0 mov -0x10(%ebp),%eax 88: 89 04 24 mov %eax,(%esp) 8b: e8 af 03 00 00 call 43f <strchr> 90: 89 45 e8 mov %eax,-0x18(%ebp) 93: 83 7d e8 00 cmpl $0x0,-0x18(%ebp) 97: 75 93 jne 2c <grep+0x2c> *q = '\n'; write(1, p, q+1 - p); } p = q+1; } if(p == buf) 99: 81 7d f0 80 0e 00 00 cmpl $0xe80,-0x10(%ebp) a0: 75 07 jne a9 <grep+0xa9> m = 0; a2: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) if(m > 0){ a9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) ad: 7e 29 jle d8 <grep+0xd8> m -= p - buf; af: ba 80 0e 00 00 mov $0xe80,%edx b4: 8b 45 f0 mov -0x10(%ebp),%eax b7: 29 c2 sub %eax,%edx b9: 89 d0 mov %edx,%eax bb: 01 45 f4 add %eax,-0xc(%ebp) memmove(buf, p, m); be: 8b 45 f4 mov -0xc(%ebp),%eax c1: 89 44 24 08 mov %eax,0x8(%esp) c5: 8b 45 f0 mov -0x10(%ebp),%eax c8: 89 44 24 04 mov %eax,0x4(%esp) cc: c7 04 24 80 0e 00 00 movl $0xe80,(%esp) d3: e8 ab 04 00 00 call 583 <memmove> { int n, m; char *p, *q; m = 0; while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ d8: 8b 45 f4 mov -0xc(%ebp),%eax db: ba ff 03 00 00 mov $0x3ff,%edx e0: 29 c2 sub %eax,%edx e2: 89 d0 mov %edx,%eax e4: 8b 55 f4 mov -0xc(%ebp),%edx e7: 81 c2 80 0e 00 00 add $0xe80,%edx ed: 89 44 24 08 mov %eax,0x8(%esp) f1: 89 54 24 04 mov %edx,0x4(%esp) f5: 8b 45 0c mov 0xc(%ebp),%eax f8: 89 04 24 mov %eax,(%esp) fb: e8 e0 04 00 00 call 5e0 <read> 100: 89 45 ec mov %eax,-0x14(%ebp) 103: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 107: 0f 8f 05 ff ff ff jg 12 <grep+0x12> if(m > 0){ m -= p - buf; memmove(buf, p, m); } } } 10d: c9 leave 10e: c3 ret 0000010f <main>: int main(int argc, char *argv[]) { 10f: 55 push %ebp 110: 89 e5 mov %esp,%ebp 112: 83 e4 f0 and $0xfffffff0,%esp 115: 83 ec 20 sub $0x20,%esp int fd, i; char *pattern; if(argc <= 1){ 118: 83 7d 08 01 cmpl $0x1,0x8(%ebp) 11c: 7f 19 jg 137 <main+0x28> printf(2, "usage: grep pattern [file ...]\n"); 11e: c7 44 24 04 34 0b 00 movl $0xb34,0x4(%esp) 125: 00 126: c7 04 24 02 00 00 00 movl $0x2,(%esp) 12d: e8 36 06 00 00 call 768 <printf> exit(); 132: e8 91 04 00 00 call 5c8 <exit> } pattern = argv[1]; 137: 8b 45 0c mov 0xc(%ebp),%eax 13a: 8b 40 04 mov 0x4(%eax),%eax 13d: 89 44 24 18 mov %eax,0x18(%esp) if(argc <= 2){ 141: 83 7d 08 02 cmpl $0x2,0x8(%ebp) 145: 7f 19 jg 160 <main+0x51> grep(pattern, 0); 147: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 14e: 00 14f: 8b 44 24 18 mov 0x18(%esp),%eax 153: 89 04 24 mov %eax,(%esp) 156: e8 a5 fe ff ff call 0 <grep> exit(); 15b: e8 68 04 00 00 call 5c8 <exit> } for(i = 2; i < argc; i++){ 160: c7 44 24 1c 02 00 00 movl $0x2,0x1c(%esp) 167: 00 168: e9 81 00 00 00 jmp 1ee <main+0xdf> if((fd = open(argv[i], 0)) < 0){ 16d: 8b 44 24 1c mov 0x1c(%esp),%eax 171: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 178: 8b 45 0c mov 0xc(%ebp),%eax 17b: 01 d0 add %edx,%eax 17d: 8b 00 mov (%eax),%eax 17f: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 186: 00 187: 89 04 24 mov %eax,(%esp) 18a: e8 79 04 00 00 call 608 <open> 18f: 89 44 24 14 mov %eax,0x14(%esp) 193: 83 7c 24 14 00 cmpl $0x0,0x14(%esp) 198: 79 2f jns 1c9 <main+0xba> printf(1, "grep: cannot open %s\n", argv[i]); 19a: 8b 44 24 1c mov 0x1c(%esp),%eax 19e: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 1a5: 8b 45 0c mov 0xc(%ebp),%eax 1a8: 01 d0 add %edx,%eax 1aa: 8b 00 mov (%eax),%eax 1ac: 89 44 24 08 mov %eax,0x8(%esp) 1b0: c7 44 24 04 54 0b 00 movl $0xb54,0x4(%esp) 1b7: 00 1b8: c7 04 24 01 00 00 00 movl $0x1,(%esp) 1bf: e8 a4 05 00 00 call 768 <printf> exit(); 1c4: e8 ff 03 00 00 call 5c8 <exit> } grep(pattern, fd); 1c9: 8b 44 24 14 mov 0x14(%esp),%eax 1cd: 89 44 24 04 mov %eax,0x4(%esp) 1d1: 8b 44 24 18 mov 0x18(%esp),%eax 1d5: 89 04 24 mov %eax,(%esp) 1d8: e8 23 fe ff ff call 0 <grep> close(fd); 1dd: 8b 44 24 14 mov 0x14(%esp),%eax 1e1: 89 04 24 mov %eax,(%esp) 1e4: e8 07 04 00 00 call 5f0 <close> if(argc <= 2){ grep(pattern, 0); exit(); } for(i = 2; i < argc; i++){ 1e9: 83 44 24 1c 01 addl $0x1,0x1c(%esp) 1ee: 8b 44 24 1c mov 0x1c(%esp),%eax 1f2: 3b 45 08 cmp 0x8(%ebp),%eax 1f5: 0f 8c 72 ff ff ff jl 16d <main+0x5e> exit(); } grep(pattern, fd); close(fd); } exit(); 1fb: e8 c8 03 00 00 call 5c8 <exit> 00000200 <match>: int matchhere(char*, char*); int matchstar(int, char*, char*); int match(char *re, char *text) { 200: 55 push %ebp 201: 89 e5 mov %esp,%ebp 203: 83 ec 18 sub $0x18,%esp if(re[0] == '^') 206: 8b 45 08 mov 0x8(%ebp),%eax 209: 0f b6 00 movzbl (%eax),%eax 20c: 3c 5e cmp $0x5e,%al 20e: 75 17 jne 227 <match+0x27> return matchhere(re+1, text); 210: 8b 45 08 mov 0x8(%ebp),%eax 213: 8d 50 01 lea 0x1(%eax),%edx 216: 8b 45 0c mov 0xc(%ebp),%eax 219: 89 44 24 04 mov %eax,0x4(%esp) 21d: 89 14 24 mov %edx,(%esp) 220: e8 36 00 00 00 call 25b <matchhere> 225: eb 32 jmp 259 <match+0x59> do{ // must look at empty string if(matchhere(re, text)) 227: 8b 45 0c mov 0xc(%ebp),%eax 22a: 89 44 24 04 mov %eax,0x4(%esp) 22e: 8b 45 08 mov 0x8(%ebp),%eax 231: 89 04 24 mov %eax,(%esp) 234: e8 22 00 00 00 call 25b <matchhere> 239: 85 c0 test %eax,%eax 23b: 74 07 je 244 <match+0x44> return 1; 23d: b8 01 00 00 00 mov $0x1,%eax 242: eb 15 jmp 259 <match+0x59> }while(*text++ != '\0'); 244: 8b 45 0c mov 0xc(%ebp),%eax 247: 8d 50 01 lea 0x1(%eax),%edx 24a: 89 55 0c mov %edx,0xc(%ebp) 24d: 0f b6 00 movzbl (%eax),%eax 250: 84 c0 test %al,%al 252: 75 d3 jne 227 <match+0x27> return 0; 254: b8 00 00 00 00 mov $0x0,%eax } 259: c9 leave 25a: c3 ret 0000025b <matchhere>: // matchhere: search for re at beginning of text int matchhere(char *re, char *text) { 25b: 55 push %ebp 25c: 89 e5 mov %esp,%ebp 25e: 83 ec 18 sub $0x18,%esp if(re[0] == '\0') 261: 8b 45 08 mov 0x8(%ebp),%eax 264: 0f b6 00 movzbl (%eax),%eax 267: 84 c0 test %al,%al 269: 75 0a jne 275 <matchhere+0x1a> return 1; 26b: b8 01 00 00 00 mov $0x1,%eax 270: e9 9b 00 00 00 jmp 310 <matchhere+0xb5> if(re[1] == '*') 275: 8b 45 08 mov 0x8(%ebp),%eax 278: 83 c0 01 add $0x1,%eax 27b: 0f b6 00 movzbl (%eax),%eax 27e: 3c 2a cmp $0x2a,%al 280: 75 24 jne 2a6 <matchhere+0x4b> return matchstar(re[0], re+2, text); 282: 8b 45 08 mov 0x8(%ebp),%eax 285: 8d 48 02 lea 0x2(%eax),%ecx 288: 8b 45 08 mov 0x8(%ebp),%eax 28b: 0f b6 00 movzbl (%eax),%eax 28e: 0f be c0 movsbl %al,%eax 291: 8b 55 0c mov 0xc(%ebp),%edx 294: 89 54 24 08 mov %edx,0x8(%esp) 298: 89 4c 24 04 mov %ecx,0x4(%esp) 29c: 89 04 24 mov %eax,(%esp) 29f: e8 6e 00 00 00 call 312 <matchstar> 2a4: eb 6a jmp 310 <matchhere+0xb5> if(re[0] == '$' && re[1] == '\0') 2a6: 8b 45 08 mov 0x8(%ebp),%eax 2a9: 0f b6 00 movzbl (%eax),%eax 2ac: 3c 24 cmp $0x24,%al 2ae: 75 1d jne 2cd <matchhere+0x72> 2b0: 8b 45 08 mov 0x8(%ebp),%eax 2b3: 83 c0 01 add $0x1,%eax 2b6: 0f b6 00 movzbl (%eax),%eax 2b9: 84 c0 test %al,%al 2bb: 75 10 jne 2cd <matchhere+0x72> return *text == '\0'; 2bd: 8b 45 0c mov 0xc(%ebp),%eax 2c0: 0f b6 00 movzbl (%eax),%eax 2c3: 84 c0 test %al,%al 2c5: 0f 94 c0 sete %al 2c8: 0f b6 c0 movzbl %al,%eax 2cb: eb 43 jmp 310 <matchhere+0xb5> if(*text!='\0' && (re[0]=='.' || re[0]==*text)) 2cd: 8b 45 0c mov 0xc(%ebp),%eax 2d0: 0f b6 00 movzbl (%eax),%eax 2d3: 84 c0 test %al,%al 2d5: 74 34 je 30b <matchhere+0xb0> 2d7: 8b 45 08 mov 0x8(%ebp),%eax 2da: 0f b6 00 movzbl (%eax),%eax 2dd: 3c 2e cmp $0x2e,%al 2df: 74 10 je 2f1 <matchhere+0x96> 2e1: 8b 45 08 mov 0x8(%ebp),%eax 2e4: 0f b6 10 movzbl (%eax),%edx 2e7: 8b 45 0c mov 0xc(%ebp),%eax 2ea: 0f b6 00 movzbl (%eax),%eax 2ed: 38 c2 cmp %al,%dl 2ef: 75 1a jne 30b <matchhere+0xb0> return matchhere(re+1, text+1); 2f1: 8b 45 0c mov 0xc(%ebp),%eax 2f4: 8d 50 01 lea 0x1(%eax),%edx 2f7: 8b 45 08 mov 0x8(%ebp),%eax 2fa: 83 c0 01 add $0x1,%eax 2fd: 89 54 24 04 mov %edx,0x4(%esp) 301: 89 04 24 mov %eax,(%esp) 304: e8 52 ff ff ff call 25b <matchhere> 309: eb 05 jmp 310 <matchhere+0xb5> return 0; 30b: b8 00 00 00 00 mov $0x0,%eax } 310: c9 leave 311: c3 ret 00000312 <matchstar>: // matchstar: search for c*re at beginning of text int matchstar(int c, char *re, char *text) { 312: 55 push %ebp 313: 89 e5 mov %esp,%ebp 315: 83 ec 18 sub $0x18,%esp do{ // a * matches zero or more instances if(matchhere(re, text)) 318: 8b 45 10 mov 0x10(%ebp),%eax 31b: 89 44 24 04 mov %eax,0x4(%esp) 31f: 8b 45 0c mov 0xc(%ebp),%eax 322: 89 04 24 mov %eax,(%esp) 325: e8 31 ff ff ff call 25b <matchhere> 32a: 85 c0 test %eax,%eax 32c: 74 07 je 335 <matchstar+0x23> return 1; 32e: b8 01 00 00 00 mov $0x1,%eax 333: eb 29 jmp 35e <matchstar+0x4c> }while(*text!='\0' && (*text++==c || c=='.')); 335: 8b 45 10 mov 0x10(%ebp),%eax 338: 0f b6 00 movzbl (%eax),%eax 33b: 84 c0 test %al,%al 33d: 74 1a je 359 <matchstar+0x47> 33f: 8b 45 10 mov 0x10(%ebp),%eax 342: 8d 50 01 lea 0x1(%eax),%edx 345: 89 55 10 mov %edx,0x10(%ebp) 348: 0f b6 00 movzbl (%eax),%eax 34b: 0f be c0 movsbl %al,%eax 34e: 3b 45 08 cmp 0x8(%ebp),%eax 351: 74 c5 je 318 <matchstar+0x6> 353: 83 7d 08 2e cmpl $0x2e,0x8(%ebp) 357: 74 bf je 318 <matchstar+0x6> return 0; 359: b8 00 00 00 00 mov $0x0,%eax } 35e: c9 leave 35f: c3 ret 00000360 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 360: 55 push %ebp 361: 89 e5 mov %esp,%ebp 363: 57 push %edi 364: 53 push %ebx asm volatile("cld; rep stosb" : 365: 8b 4d 08 mov 0x8(%ebp),%ecx 368: 8b 55 10 mov 0x10(%ebp),%edx 36b: 8b 45 0c mov 0xc(%ebp),%eax 36e: 89 cb mov %ecx,%ebx 370: 89 df mov %ebx,%edi 372: 89 d1 mov %edx,%ecx 374: fc cld 375: f3 aa rep stos %al,%es:(%edi) 377: 89 ca mov %ecx,%edx 379: 89 fb mov %edi,%ebx 37b: 89 5d 08 mov %ebx,0x8(%ebp) 37e: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 381: 5b pop %ebx 382: 5f pop %edi 383: 5d pop %ebp 384: c3 ret 00000385 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 385: 55 push %ebp 386: 89 e5 mov %esp,%ebp 388: 83 ec 10 sub $0x10,%esp char *os; os = s; 38b: 8b 45 08 mov 0x8(%ebp),%eax 38e: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 391: 90 nop 392: 8b 45 08 mov 0x8(%ebp),%eax 395: 8d 50 01 lea 0x1(%eax),%edx 398: 89 55 08 mov %edx,0x8(%ebp) 39b: 8b 55 0c mov 0xc(%ebp),%edx 39e: 8d 4a 01 lea 0x1(%edx),%ecx 3a1: 89 4d 0c mov %ecx,0xc(%ebp) 3a4: 0f b6 12 movzbl (%edx),%edx 3a7: 88 10 mov %dl,(%eax) 3a9: 0f b6 00 movzbl (%eax),%eax 3ac: 84 c0 test %al,%al 3ae: 75 e2 jne 392 <strcpy+0xd> ; return os; 3b0: 8b 45 fc mov -0x4(%ebp),%eax } 3b3: c9 leave 3b4: c3 ret 000003b5 <strcmp>: int strcmp(const char *p, const char *q) { 3b5: 55 push %ebp 3b6: 89 e5 mov %esp,%ebp while(*p && *p == *q) 3b8: eb 08 jmp 3c2 <strcmp+0xd> p++, q++; 3ba: 83 45 08 01 addl $0x1,0x8(%ebp) 3be: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 3c2: 8b 45 08 mov 0x8(%ebp),%eax 3c5: 0f b6 00 movzbl (%eax),%eax 3c8: 84 c0 test %al,%al 3ca: 74 10 je 3dc <strcmp+0x27> 3cc: 8b 45 08 mov 0x8(%ebp),%eax 3cf: 0f b6 10 movzbl (%eax),%edx 3d2: 8b 45 0c mov 0xc(%ebp),%eax 3d5: 0f b6 00 movzbl (%eax),%eax 3d8: 38 c2 cmp %al,%dl 3da: 74 de je 3ba <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 3dc: 8b 45 08 mov 0x8(%ebp),%eax 3df: 0f b6 00 movzbl (%eax),%eax 3e2: 0f b6 d0 movzbl %al,%edx 3e5: 8b 45 0c mov 0xc(%ebp),%eax 3e8: 0f b6 00 movzbl (%eax),%eax 3eb: 0f b6 c0 movzbl %al,%eax 3ee: 29 c2 sub %eax,%edx 3f0: 89 d0 mov %edx,%eax } 3f2: 5d pop %ebp 3f3: c3 ret 000003f4 <strlen>: uint strlen(char *s) { 3f4: 55 push %ebp 3f5: 89 e5 mov %esp,%ebp 3f7: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 3fa: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 401: eb 04 jmp 407 <strlen+0x13> 403: 83 45 fc 01 addl $0x1,-0x4(%ebp) 407: 8b 55 fc mov -0x4(%ebp),%edx 40a: 8b 45 08 mov 0x8(%ebp),%eax 40d: 01 d0 add %edx,%eax 40f: 0f b6 00 movzbl (%eax),%eax 412: 84 c0 test %al,%al 414: 75 ed jne 403 <strlen+0xf> ; return n; 416: 8b 45 fc mov -0x4(%ebp),%eax } 419: c9 leave 41a: c3 ret 0000041b <memset>: void* memset(void *dst, int c, uint n) { 41b: 55 push %ebp 41c: 89 e5 mov %esp,%ebp 41e: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 421: 8b 45 10 mov 0x10(%ebp),%eax 424: 89 44 24 08 mov %eax,0x8(%esp) 428: 8b 45 0c mov 0xc(%ebp),%eax 42b: 89 44 24 04 mov %eax,0x4(%esp) 42f: 8b 45 08 mov 0x8(%ebp),%eax 432: 89 04 24 mov %eax,(%esp) 435: e8 26 ff ff ff call 360 <stosb> return dst; 43a: 8b 45 08 mov 0x8(%ebp),%eax } 43d: c9 leave 43e: c3 ret 0000043f <strchr>: char* strchr(const char *s, char c) { 43f: 55 push %ebp 440: 89 e5 mov %esp,%ebp 442: 83 ec 04 sub $0x4,%esp 445: 8b 45 0c mov 0xc(%ebp),%eax 448: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 44b: eb 14 jmp 461 <strchr+0x22> if(*s == c) 44d: 8b 45 08 mov 0x8(%ebp),%eax 450: 0f b6 00 movzbl (%eax),%eax 453: 3a 45 fc cmp -0x4(%ebp),%al 456: 75 05 jne 45d <strchr+0x1e> return (char*)s; 458: 8b 45 08 mov 0x8(%ebp),%eax 45b: eb 13 jmp 470 <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 45d: 83 45 08 01 addl $0x1,0x8(%ebp) 461: 8b 45 08 mov 0x8(%ebp),%eax 464: 0f b6 00 movzbl (%eax),%eax 467: 84 c0 test %al,%al 469: 75 e2 jne 44d <strchr+0xe> if(*s == c) return (char*)s; return 0; 46b: b8 00 00 00 00 mov $0x0,%eax } 470: c9 leave 471: c3 ret 00000472 <gets>: char* gets(char *buf, int max) { 472: 55 push %ebp 473: 89 e5 mov %esp,%ebp 475: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 478: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 47f: eb 4c jmp 4cd <gets+0x5b> cc = read(0, &c, 1); 481: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 488: 00 489: 8d 45 ef lea -0x11(%ebp),%eax 48c: 89 44 24 04 mov %eax,0x4(%esp) 490: c7 04 24 00 00 00 00 movl $0x0,(%esp) 497: e8 44 01 00 00 call 5e0 <read> 49c: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 49f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 4a3: 7f 02 jg 4a7 <gets+0x35> break; 4a5: eb 31 jmp 4d8 <gets+0x66> buf[i++] = c; 4a7: 8b 45 f4 mov -0xc(%ebp),%eax 4aa: 8d 50 01 lea 0x1(%eax),%edx 4ad: 89 55 f4 mov %edx,-0xc(%ebp) 4b0: 89 c2 mov %eax,%edx 4b2: 8b 45 08 mov 0x8(%ebp),%eax 4b5: 01 c2 add %eax,%edx 4b7: 0f b6 45 ef movzbl -0x11(%ebp),%eax 4bb: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 4bd: 0f b6 45 ef movzbl -0x11(%ebp),%eax 4c1: 3c 0a cmp $0xa,%al 4c3: 74 13 je 4d8 <gets+0x66> 4c5: 0f b6 45 ef movzbl -0x11(%ebp),%eax 4c9: 3c 0d cmp $0xd,%al 4cb: 74 0b je 4d8 <gets+0x66> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 4cd: 8b 45 f4 mov -0xc(%ebp),%eax 4d0: 83 c0 01 add $0x1,%eax 4d3: 3b 45 0c cmp 0xc(%ebp),%eax 4d6: 7c a9 jl 481 <gets+0xf> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 4d8: 8b 55 f4 mov -0xc(%ebp),%edx 4db: 8b 45 08 mov 0x8(%ebp),%eax 4de: 01 d0 add %edx,%eax 4e0: c6 00 00 movb $0x0,(%eax) return buf; 4e3: 8b 45 08 mov 0x8(%ebp),%eax } 4e6: c9 leave 4e7: c3 ret 000004e8 <stat>: int stat(char *n, struct stat *st) { 4e8: 55 push %ebp 4e9: 89 e5 mov %esp,%ebp 4eb: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 4ee: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 4f5: 00 4f6: 8b 45 08 mov 0x8(%ebp),%eax 4f9: 89 04 24 mov %eax,(%esp) 4fc: e8 07 01 00 00 call 608 <open> 501: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 504: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 508: 79 07 jns 511 <stat+0x29> return -1; 50a: b8 ff ff ff ff mov $0xffffffff,%eax 50f: eb 23 jmp 534 <stat+0x4c> r = fstat(fd, st); 511: 8b 45 0c mov 0xc(%ebp),%eax 514: 89 44 24 04 mov %eax,0x4(%esp) 518: 8b 45 f4 mov -0xc(%ebp),%eax 51b: 89 04 24 mov %eax,(%esp) 51e: e8 fd 00 00 00 call 620 <fstat> 523: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 526: 8b 45 f4 mov -0xc(%ebp),%eax 529: 89 04 24 mov %eax,(%esp) 52c: e8 bf 00 00 00 call 5f0 <close> return r; 531: 8b 45 f0 mov -0x10(%ebp),%eax } 534: c9 leave 535: c3 ret 00000536 <atoi>: int atoi(const char *s) { 536: 55 push %ebp 537: 89 e5 mov %esp,%ebp 539: 83 ec 10 sub $0x10,%esp int n; n = 0; 53c: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 543: eb 25 jmp 56a <atoi+0x34> n = n*10 + *s++ - '0'; 545: 8b 55 fc mov -0x4(%ebp),%edx 548: 89 d0 mov %edx,%eax 54a: c1 e0 02 shl $0x2,%eax 54d: 01 d0 add %edx,%eax 54f: 01 c0 add %eax,%eax 551: 89 c1 mov %eax,%ecx 553: 8b 45 08 mov 0x8(%ebp),%eax 556: 8d 50 01 lea 0x1(%eax),%edx 559: 89 55 08 mov %edx,0x8(%ebp) 55c: 0f b6 00 movzbl (%eax),%eax 55f: 0f be c0 movsbl %al,%eax 562: 01 c8 add %ecx,%eax 564: 83 e8 30 sub $0x30,%eax 567: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 56a: 8b 45 08 mov 0x8(%ebp),%eax 56d: 0f b6 00 movzbl (%eax),%eax 570: 3c 2f cmp $0x2f,%al 572: 7e 0a jle 57e <atoi+0x48> 574: 8b 45 08 mov 0x8(%ebp),%eax 577: 0f b6 00 movzbl (%eax),%eax 57a: 3c 39 cmp $0x39,%al 57c: 7e c7 jle 545 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 57e: 8b 45 fc mov -0x4(%ebp),%eax } 581: c9 leave 582: c3 ret 00000583 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 583: 55 push %ebp 584: 89 e5 mov %esp,%ebp 586: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 589: 8b 45 08 mov 0x8(%ebp),%eax 58c: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 58f: 8b 45 0c mov 0xc(%ebp),%eax 592: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 595: eb 17 jmp 5ae <memmove+0x2b> *dst++ = *src++; 597: 8b 45 fc mov -0x4(%ebp),%eax 59a: 8d 50 01 lea 0x1(%eax),%edx 59d: 89 55 fc mov %edx,-0x4(%ebp) 5a0: 8b 55 f8 mov -0x8(%ebp),%edx 5a3: 8d 4a 01 lea 0x1(%edx),%ecx 5a6: 89 4d f8 mov %ecx,-0x8(%ebp) 5a9: 0f b6 12 movzbl (%edx),%edx 5ac: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 5ae: 8b 45 10 mov 0x10(%ebp),%eax 5b1: 8d 50 ff lea -0x1(%eax),%edx 5b4: 89 55 10 mov %edx,0x10(%ebp) 5b7: 85 c0 test %eax,%eax 5b9: 7f dc jg 597 <memmove+0x14> *dst++ = *src++; return vdst; 5bb: 8b 45 08 mov 0x8(%ebp),%eax } 5be: c9 leave 5bf: c3 ret 000005c0 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 5c0: b8 01 00 00 00 mov $0x1,%eax 5c5: cd 40 int $0x40 5c7: c3 ret 000005c8 <exit>: SYSCALL(exit) 5c8: b8 02 00 00 00 mov $0x2,%eax 5cd: cd 40 int $0x40 5cf: c3 ret 000005d0 <wait>: SYSCALL(wait) 5d0: b8 03 00 00 00 mov $0x3,%eax 5d5: cd 40 int $0x40 5d7: c3 ret 000005d8 <pipe>: SYSCALL(pipe) 5d8: b8 04 00 00 00 mov $0x4,%eax 5dd: cd 40 int $0x40 5df: c3 ret 000005e0 <read>: SYSCALL(read) 5e0: b8 05 00 00 00 mov $0x5,%eax 5e5: cd 40 int $0x40 5e7: c3 ret 000005e8 <write>: SYSCALL(write) 5e8: b8 10 00 00 00 mov $0x10,%eax 5ed: cd 40 int $0x40 5ef: c3 ret 000005f0 <close>: SYSCALL(close) 5f0: b8 15 00 00 00 mov $0x15,%eax 5f5: cd 40 int $0x40 5f7: c3 ret 000005f8 <kill>: SYSCALL(kill) 5f8: b8 06 00 00 00 mov $0x6,%eax 5fd: cd 40 int $0x40 5ff: c3 ret 00000600 <exec>: SYSCALL(exec) 600: b8 07 00 00 00 mov $0x7,%eax 605: cd 40 int $0x40 607: c3 ret 00000608 <open>: SYSCALL(open) 608: b8 0f 00 00 00 mov $0xf,%eax 60d: cd 40 int $0x40 60f: c3 ret 00000610 <mknod>: SYSCALL(mknod) 610: b8 11 00 00 00 mov $0x11,%eax 615: cd 40 int $0x40 617: c3 ret 00000618 <unlink>: SYSCALL(unlink) 618: b8 12 00 00 00 mov $0x12,%eax 61d: cd 40 int $0x40 61f: c3 ret 00000620 <fstat>: SYSCALL(fstat) 620: b8 08 00 00 00 mov $0x8,%eax 625: cd 40 int $0x40 627: c3 ret 00000628 <link>: SYSCALL(link) 628: b8 13 00 00 00 mov $0x13,%eax 62d: cd 40 int $0x40 62f: c3 ret 00000630 <mkdir>: SYSCALL(mkdir) 630: b8 14 00 00 00 mov $0x14,%eax 635: cd 40 int $0x40 637: c3 ret 00000638 <chdir>: SYSCALL(chdir) 638: b8 09 00 00 00 mov $0x9,%eax 63d: cd 40 int $0x40 63f: c3 ret 00000640 <dup>: SYSCALL(dup) 640: b8 0a 00 00 00 mov $0xa,%eax 645: cd 40 int $0x40 647: c3 ret 00000648 <getpid>: SYSCALL(getpid) 648: b8 0b 00 00 00 mov $0xb,%eax 64d: cd 40 int $0x40 64f: c3 ret 00000650 <sbrk>: SYSCALL(sbrk) 650: b8 0c 00 00 00 mov $0xc,%eax 655: cd 40 int $0x40 657: c3 ret 00000658 <sleep>: SYSCALL(sleep) 658: b8 0d 00 00 00 mov $0xd,%eax 65d: cd 40 int $0x40 65f: c3 ret 00000660 <uptime>: SYSCALL(uptime) 660: b8 0e 00 00 00 mov $0xe,%eax 665: cd 40 int $0x40 667: c3 ret 00000668 <changepriority>: SYSCALL(changepriority) 668: b8 16 00 00 00 mov $0x16,%eax 66d: cd 40 int $0x40 66f: c3 ret 00000670 <processstatus>: SYSCALL(processstatus) 670: b8 17 00 00 00 mov $0x17,%eax 675: cd 40 int $0x40 677: c3 ret 00000678 <randomgen>: SYSCALL(randomgen) 678: b8 18 00 00 00 mov $0x18,%eax 67d: cd 40 int $0x40 67f: c3 ret 00000680 <randomgenrange>: SYSCALL(randomgenrange) 680: b8 19 00 00 00 mov $0x19,%eax 685: cd 40 int $0x40 687: c3 ret 00000688 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 688: 55 push %ebp 689: 89 e5 mov %esp,%ebp 68b: 83 ec 18 sub $0x18,%esp 68e: 8b 45 0c mov 0xc(%ebp),%eax 691: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 694: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 69b: 00 69c: 8d 45 f4 lea -0xc(%ebp),%eax 69f: 89 44 24 04 mov %eax,0x4(%esp) 6a3: 8b 45 08 mov 0x8(%ebp),%eax 6a6: 89 04 24 mov %eax,(%esp) 6a9: e8 3a ff ff ff call 5e8 <write> } 6ae: c9 leave 6af: c3 ret 000006b0 <printint>: static void printint(int fd, int xx, int base, int sgn) { 6b0: 55 push %ebp 6b1: 89 e5 mov %esp,%ebp 6b3: 56 push %esi 6b4: 53 push %ebx 6b5: 83 ec 30 sub $0x30,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 6b8: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 6bf: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 6c3: 74 17 je 6dc <printint+0x2c> 6c5: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 6c9: 79 11 jns 6dc <printint+0x2c> neg = 1; 6cb: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 6d2: 8b 45 0c mov 0xc(%ebp),%eax 6d5: f7 d8 neg %eax 6d7: 89 45 ec mov %eax,-0x14(%ebp) 6da: eb 06 jmp 6e2 <printint+0x32> } else { x = xx; 6dc: 8b 45 0c mov 0xc(%ebp),%eax 6df: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 6e2: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 6e9: 8b 4d f4 mov -0xc(%ebp),%ecx 6ec: 8d 41 01 lea 0x1(%ecx),%eax 6ef: 89 45 f4 mov %eax,-0xc(%ebp) 6f2: 8b 5d 10 mov 0x10(%ebp),%ebx 6f5: 8b 45 ec mov -0x14(%ebp),%eax 6f8: ba 00 00 00 00 mov $0x0,%edx 6fd: f7 f3 div %ebx 6ff: 89 d0 mov %edx,%eax 701: 0f b6 80 38 0e 00 00 movzbl 0xe38(%eax),%eax 708: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 70c: 8b 75 10 mov 0x10(%ebp),%esi 70f: 8b 45 ec mov -0x14(%ebp),%eax 712: ba 00 00 00 00 mov $0x0,%edx 717: f7 f6 div %esi 719: 89 45 ec mov %eax,-0x14(%ebp) 71c: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 720: 75 c7 jne 6e9 <printint+0x39> if(neg) 722: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 726: 74 10 je 738 <printint+0x88> buf[i++] = '-'; 728: 8b 45 f4 mov -0xc(%ebp),%eax 72b: 8d 50 01 lea 0x1(%eax),%edx 72e: 89 55 f4 mov %edx,-0xc(%ebp) 731: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 736: eb 1f jmp 757 <printint+0xa7> 738: eb 1d jmp 757 <printint+0xa7> putc(fd, buf[i]); 73a: 8d 55 dc lea -0x24(%ebp),%edx 73d: 8b 45 f4 mov -0xc(%ebp),%eax 740: 01 d0 add %edx,%eax 742: 0f b6 00 movzbl (%eax),%eax 745: 0f be c0 movsbl %al,%eax 748: 89 44 24 04 mov %eax,0x4(%esp) 74c: 8b 45 08 mov 0x8(%ebp),%eax 74f: 89 04 24 mov %eax,(%esp) 752: e8 31 ff ff ff call 688 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 757: 83 6d f4 01 subl $0x1,-0xc(%ebp) 75b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 75f: 79 d9 jns 73a <printint+0x8a> putc(fd, buf[i]); } 761: 83 c4 30 add $0x30,%esp 764: 5b pop %ebx 765: 5e pop %esi 766: 5d pop %ebp 767: c3 ret 00000768 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 768: 55 push %ebp 769: 89 e5 mov %esp,%ebp 76b: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 76e: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 775: 8d 45 0c lea 0xc(%ebp),%eax 778: 83 c0 04 add $0x4,%eax 77b: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 77e: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 785: e9 7c 01 00 00 jmp 906 <printf+0x19e> c = fmt[i] & 0xff; 78a: 8b 55 0c mov 0xc(%ebp),%edx 78d: 8b 45 f0 mov -0x10(%ebp),%eax 790: 01 d0 add %edx,%eax 792: 0f b6 00 movzbl (%eax),%eax 795: 0f be c0 movsbl %al,%eax 798: 25 ff 00 00 00 and $0xff,%eax 79d: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 7a0: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 7a4: 75 2c jne 7d2 <printf+0x6a> if(c == '%'){ 7a6: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 7aa: 75 0c jne 7b8 <printf+0x50> state = '%'; 7ac: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 7b3: e9 4a 01 00 00 jmp 902 <printf+0x19a> } else { putc(fd, c); 7b8: 8b 45 e4 mov -0x1c(%ebp),%eax 7bb: 0f be c0 movsbl %al,%eax 7be: 89 44 24 04 mov %eax,0x4(%esp) 7c2: 8b 45 08 mov 0x8(%ebp),%eax 7c5: 89 04 24 mov %eax,(%esp) 7c8: e8 bb fe ff ff call 688 <putc> 7cd: e9 30 01 00 00 jmp 902 <printf+0x19a> } } else if(state == '%'){ 7d2: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 7d6: 0f 85 26 01 00 00 jne 902 <printf+0x19a> if(c == 'd'){ 7dc: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 7e0: 75 2d jne 80f <printf+0xa7> printint(fd, *ap, 10, 1); 7e2: 8b 45 e8 mov -0x18(%ebp),%eax 7e5: 8b 00 mov (%eax),%eax 7e7: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 7ee: 00 7ef: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 7f6: 00 7f7: 89 44 24 04 mov %eax,0x4(%esp) 7fb: 8b 45 08 mov 0x8(%ebp),%eax 7fe: 89 04 24 mov %eax,(%esp) 801: e8 aa fe ff ff call 6b0 <printint> ap++; 806: 83 45 e8 04 addl $0x4,-0x18(%ebp) 80a: e9 ec 00 00 00 jmp 8fb <printf+0x193> } else if(c == 'x' || c == 'p'){ 80f: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 813: 74 06 je 81b <printf+0xb3> 815: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 819: 75 2d jne 848 <printf+0xe0> printint(fd, *ap, 16, 0); 81b: 8b 45 e8 mov -0x18(%ebp),%eax 81e: 8b 00 mov (%eax),%eax 820: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 827: 00 828: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 82f: 00 830: 89 44 24 04 mov %eax,0x4(%esp) 834: 8b 45 08 mov 0x8(%ebp),%eax 837: 89 04 24 mov %eax,(%esp) 83a: e8 71 fe ff ff call 6b0 <printint> ap++; 83f: 83 45 e8 04 addl $0x4,-0x18(%ebp) 843: e9 b3 00 00 00 jmp 8fb <printf+0x193> } else if(c == 's'){ 848: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 84c: 75 45 jne 893 <printf+0x12b> s = (char*)*ap; 84e: 8b 45 e8 mov -0x18(%ebp),%eax 851: 8b 00 mov (%eax),%eax 853: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 856: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 85a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 85e: 75 09 jne 869 <printf+0x101> s = "(null)"; 860: c7 45 f4 6a 0b 00 00 movl $0xb6a,-0xc(%ebp) while(*s != 0){ 867: eb 1e jmp 887 <printf+0x11f> 869: eb 1c jmp 887 <printf+0x11f> putc(fd, *s); 86b: 8b 45 f4 mov -0xc(%ebp),%eax 86e: 0f b6 00 movzbl (%eax),%eax 871: 0f be c0 movsbl %al,%eax 874: 89 44 24 04 mov %eax,0x4(%esp) 878: 8b 45 08 mov 0x8(%ebp),%eax 87b: 89 04 24 mov %eax,(%esp) 87e: e8 05 fe ff ff call 688 <putc> s++; 883: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 887: 8b 45 f4 mov -0xc(%ebp),%eax 88a: 0f b6 00 movzbl (%eax),%eax 88d: 84 c0 test %al,%al 88f: 75 da jne 86b <printf+0x103> 891: eb 68 jmp 8fb <printf+0x193> putc(fd, *s); s++; } } else if(c == 'c'){ 893: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 897: 75 1d jne 8b6 <printf+0x14e> putc(fd, *ap); 899: 8b 45 e8 mov -0x18(%ebp),%eax 89c: 8b 00 mov (%eax),%eax 89e: 0f be c0 movsbl %al,%eax 8a1: 89 44 24 04 mov %eax,0x4(%esp) 8a5: 8b 45 08 mov 0x8(%ebp),%eax 8a8: 89 04 24 mov %eax,(%esp) 8ab: e8 d8 fd ff ff call 688 <putc> ap++; 8b0: 83 45 e8 04 addl $0x4,-0x18(%ebp) 8b4: eb 45 jmp 8fb <printf+0x193> } else if(c == '%'){ 8b6: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 8ba: 75 17 jne 8d3 <printf+0x16b> putc(fd, c); 8bc: 8b 45 e4 mov -0x1c(%ebp),%eax 8bf: 0f be c0 movsbl %al,%eax 8c2: 89 44 24 04 mov %eax,0x4(%esp) 8c6: 8b 45 08 mov 0x8(%ebp),%eax 8c9: 89 04 24 mov %eax,(%esp) 8cc: e8 b7 fd ff ff call 688 <putc> 8d1: eb 28 jmp 8fb <printf+0x193> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 8d3: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 8da: 00 8db: 8b 45 08 mov 0x8(%ebp),%eax 8de: 89 04 24 mov %eax,(%esp) 8e1: e8 a2 fd ff ff call 688 <putc> putc(fd, c); 8e6: 8b 45 e4 mov -0x1c(%ebp),%eax 8e9: 0f be c0 movsbl %al,%eax 8ec: 89 44 24 04 mov %eax,0x4(%esp) 8f0: 8b 45 08 mov 0x8(%ebp),%eax 8f3: 89 04 24 mov %eax,(%esp) 8f6: e8 8d fd ff ff call 688 <putc> } state = 0; 8fb: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 902: 83 45 f0 01 addl $0x1,-0x10(%ebp) 906: 8b 55 0c mov 0xc(%ebp),%edx 909: 8b 45 f0 mov -0x10(%ebp),%eax 90c: 01 d0 add %edx,%eax 90e: 0f b6 00 movzbl (%eax),%eax 911: 84 c0 test %al,%al 913: 0f 85 71 fe ff ff jne 78a <printf+0x22> putc(fd, c); } state = 0; } } } 919: c9 leave 91a: c3 ret 0000091b <free>: static Header base; static Header *freep; void free(void *ap) { 91b: 55 push %ebp 91c: 89 e5 mov %esp,%ebp 91e: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 921: 8b 45 08 mov 0x8(%ebp),%eax 924: 83 e8 08 sub $0x8,%eax 927: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 92a: a1 68 0e 00 00 mov 0xe68,%eax 92f: 89 45 fc mov %eax,-0x4(%ebp) 932: eb 24 jmp 958 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 934: 8b 45 fc mov -0x4(%ebp),%eax 937: 8b 00 mov (%eax),%eax 939: 3b 45 fc cmp -0x4(%ebp),%eax 93c: 77 12 ja 950 <free+0x35> 93e: 8b 45 f8 mov -0x8(%ebp),%eax 941: 3b 45 fc cmp -0x4(%ebp),%eax 944: 77 24 ja 96a <free+0x4f> 946: 8b 45 fc mov -0x4(%ebp),%eax 949: 8b 00 mov (%eax),%eax 94b: 3b 45 f8 cmp -0x8(%ebp),%eax 94e: 77 1a ja 96a <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 950: 8b 45 fc mov -0x4(%ebp),%eax 953: 8b 00 mov (%eax),%eax 955: 89 45 fc mov %eax,-0x4(%ebp) 958: 8b 45 f8 mov -0x8(%ebp),%eax 95b: 3b 45 fc cmp -0x4(%ebp),%eax 95e: 76 d4 jbe 934 <free+0x19> 960: 8b 45 fc mov -0x4(%ebp),%eax 963: 8b 00 mov (%eax),%eax 965: 3b 45 f8 cmp -0x8(%ebp),%eax 968: 76 ca jbe 934 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 96a: 8b 45 f8 mov -0x8(%ebp),%eax 96d: 8b 40 04 mov 0x4(%eax),%eax 970: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 977: 8b 45 f8 mov -0x8(%ebp),%eax 97a: 01 c2 add %eax,%edx 97c: 8b 45 fc mov -0x4(%ebp),%eax 97f: 8b 00 mov (%eax),%eax 981: 39 c2 cmp %eax,%edx 983: 75 24 jne 9a9 <free+0x8e> bp->s.size += p->s.ptr->s.size; 985: 8b 45 f8 mov -0x8(%ebp),%eax 988: 8b 50 04 mov 0x4(%eax),%edx 98b: 8b 45 fc mov -0x4(%ebp),%eax 98e: 8b 00 mov (%eax),%eax 990: 8b 40 04 mov 0x4(%eax),%eax 993: 01 c2 add %eax,%edx 995: 8b 45 f8 mov -0x8(%ebp),%eax 998: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 99b: 8b 45 fc mov -0x4(%ebp),%eax 99e: 8b 00 mov (%eax),%eax 9a0: 8b 10 mov (%eax),%edx 9a2: 8b 45 f8 mov -0x8(%ebp),%eax 9a5: 89 10 mov %edx,(%eax) 9a7: eb 0a jmp 9b3 <free+0x98> } else bp->s.ptr = p->s.ptr; 9a9: 8b 45 fc mov -0x4(%ebp),%eax 9ac: 8b 10 mov (%eax),%edx 9ae: 8b 45 f8 mov -0x8(%ebp),%eax 9b1: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 9b3: 8b 45 fc mov -0x4(%ebp),%eax 9b6: 8b 40 04 mov 0x4(%eax),%eax 9b9: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 9c0: 8b 45 fc mov -0x4(%ebp),%eax 9c3: 01 d0 add %edx,%eax 9c5: 3b 45 f8 cmp -0x8(%ebp),%eax 9c8: 75 20 jne 9ea <free+0xcf> p->s.size += bp->s.size; 9ca: 8b 45 fc mov -0x4(%ebp),%eax 9cd: 8b 50 04 mov 0x4(%eax),%edx 9d0: 8b 45 f8 mov -0x8(%ebp),%eax 9d3: 8b 40 04 mov 0x4(%eax),%eax 9d6: 01 c2 add %eax,%edx 9d8: 8b 45 fc mov -0x4(%ebp),%eax 9db: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 9de: 8b 45 f8 mov -0x8(%ebp),%eax 9e1: 8b 10 mov (%eax),%edx 9e3: 8b 45 fc mov -0x4(%ebp),%eax 9e6: 89 10 mov %edx,(%eax) 9e8: eb 08 jmp 9f2 <free+0xd7> } else p->s.ptr = bp; 9ea: 8b 45 fc mov -0x4(%ebp),%eax 9ed: 8b 55 f8 mov -0x8(%ebp),%edx 9f0: 89 10 mov %edx,(%eax) freep = p; 9f2: 8b 45 fc mov -0x4(%ebp),%eax 9f5: a3 68 0e 00 00 mov %eax,0xe68 } 9fa: c9 leave 9fb: c3 ret 000009fc <morecore>: static Header* morecore(uint nu) { 9fc: 55 push %ebp 9fd: 89 e5 mov %esp,%ebp 9ff: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) a02: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) a09: 77 07 ja a12 <morecore+0x16> nu = 4096; a0b: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); a12: 8b 45 08 mov 0x8(%ebp),%eax a15: c1 e0 03 shl $0x3,%eax a18: 89 04 24 mov %eax,(%esp) a1b: e8 30 fc ff ff call 650 <sbrk> a20: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) a23: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) a27: 75 07 jne a30 <morecore+0x34> return 0; a29: b8 00 00 00 00 mov $0x0,%eax a2e: eb 22 jmp a52 <morecore+0x56> hp = (Header*)p; a30: 8b 45 f4 mov -0xc(%ebp),%eax a33: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; a36: 8b 45 f0 mov -0x10(%ebp),%eax a39: 8b 55 08 mov 0x8(%ebp),%edx a3c: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); a3f: 8b 45 f0 mov -0x10(%ebp),%eax a42: 83 c0 08 add $0x8,%eax a45: 89 04 24 mov %eax,(%esp) a48: e8 ce fe ff ff call 91b <free> return freep; a4d: a1 68 0e 00 00 mov 0xe68,%eax } a52: c9 leave a53: c3 ret 00000a54 <malloc>: void* malloc(uint nbytes) { a54: 55 push %ebp a55: 89 e5 mov %esp,%ebp a57: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; a5a: 8b 45 08 mov 0x8(%ebp),%eax a5d: 83 c0 07 add $0x7,%eax a60: c1 e8 03 shr $0x3,%eax a63: 83 c0 01 add $0x1,%eax a66: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ a69: a1 68 0e 00 00 mov 0xe68,%eax a6e: 89 45 f0 mov %eax,-0x10(%ebp) a71: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) a75: 75 23 jne a9a <malloc+0x46> base.s.ptr = freep = prevp = &base; a77: c7 45 f0 60 0e 00 00 movl $0xe60,-0x10(%ebp) a7e: 8b 45 f0 mov -0x10(%ebp),%eax a81: a3 68 0e 00 00 mov %eax,0xe68 a86: a1 68 0e 00 00 mov 0xe68,%eax a8b: a3 60 0e 00 00 mov %eax,0xe60 base.s.size = 0; a90: c7 05 64 0e 00 00 00 movl $0x0,0xe64 a97: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ a9a: 8b 45 f0 mov -0x10(%ebp),%eax a9d: 8b 00 mov (%eax),%eax a9f: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ aa2: 8b 45 f4 mov -0xc(%ebp),%eax aa5: 8b 40 04 mov 0x4(%eax),%eax aa8: 3b 45 ec cmp -0x14(%ebp),%eax aab: 72 4d jb afa <malloc+0xa6> if(p->s.size == nunits) aad: 8b 45 f4 mov -0xc(%ebp),%eax ab0: 8b 40 04 mov 0x4(%eax),%eax ab3: 3b 45 ec cmp -0x14(%ebp),%eax ab6: 75 0c jne ac4 <malloc+0x70> prevp->s.ptr = p->s.ptr; ab8: 8b 45 f4 mov -0xc(%ebp),%eax abb: 8b 10 mov (%eax),%edx abd: 8b 45 f0 mov -0x10(%ebp),%eax ac0: 89 10 mov %edx,(%eax) ac2: eb 26 jmp aea <malloc+0x96> else { p->s.size -= nunits; ac4: 8b 45 f4 mov -0xc(%ebp),%eax ac7: 8b 40 04 mov 0x4(%eax),%eax aca: 2b 45 ec sub -0x14(%ebp),%eax acd: 89 c2 mov %eax,%edx acf: 8b 45 f4 mov -0xc(%ebp),%eax ad2: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; ad5: 8b 45 f4 mov -0xc(%ebp),%eax ad8: 8b 40 04 mov 0x4(%eax),%eax adb: c1 e0 03 shl $0x3,%eax ade: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; ae1: 8b 45 f4 mov -0xc(%ebp),%eax ae4: 8b 55 ec mov -0x14(%ebp),%edx ae7: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; aea: 8b 45 f0 mov -0x10(%ebp),%eax aed: a3 68 0e 00 00 mov %eax,0xe68 return (void*)(p + 1); af2: 8b 45 f4 mov -0xc(%ebp),%eax af5: 83 c0 08 add $0x8,%eax af8: eb 38 jmp b32 <malloc+0xde> } if(p == freep) afa: a1 68 0e 00 00 mov 0xe68,%eax aff: 39 45 f4 cmp %eax,-0xc(%ebp) b02: 75 1b jne b1f <malloc+0xcb> if((p = morecore(nunits)) == 0) b04: 8b 45 ec mov -0x14(%ebp),%eax b07: 89 04 24 mov %eax,(%esp) b0a: e8 ed fe ff ff call 9fc <morecore> b0f: 89 45 f4 mov %eax,-0xc(%ebp) b12: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) b16: 75 07 jne b1f <malloc+0xcb> return 0; b18: b8 00 00 00 00 mov $0x0,%eax b1d: eb 13 jmp b32 <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ b1f: 8b 45 f4 mov -0xc(%ebp),%eax b22: 89 45 f0 mov %eax,-0x10(%ebp) b25: 8b 45 f4 mov -0xc(%ebp),%eax b28: 8b 00 mov (%eax),%eax b2a: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } b2d: e9 70 ff ff ff jmp aa2 <malloc+0x4e> } b32: c9 leave b33: c3 ret
35.006447
60
0.431458
b338d0fa4d8a49ad052d49290cd52ee8a9264126
6,817
asm
Assembly
Transynther/x86/_processed/NC/_ht_zr_/i9-9900K_12_0xca_notsx.log_4831_138.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_ht_zr_/i9-9900K_12_0xca_notsx.log_4831_138.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_ht_zr_/i9-9900K_12_0xca_notsx.log_4831_138.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r14 push %r15 push %r8 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x5718, %r14 and %rdi, %rdi mov $0x6162636465666768, %r15 movq %r15, %xmm4 vmovups %ymm4, (%r14) nop nop nop inc %r8 lea addresses_UC_ht+0x8e18, %rax nop nop nop nop nop sub %rcx, %rcx vmovups (%rax), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %rdx nop xor %rcx, %rcx lea addresses_UC_ht+0x5618, %rsi lea addresses_D_ht+0x18298, %rdi nop nop lfence mov $76, %rcx rep movsl nop nop nop nop nop inc %rcx lea addresses_D_ht+0x1b7bc, %rdi nop nop nop sub $48695, %r15 movb $0x61, (%rdi) nop nop xor $16591, %rsi lea addresses_A_ht+0x1db50, %rsi nop inc %rdx movups (%rsi), %xmm1 vpextrq $0, %xmm1, %r14 dec %rax lea addresses_A_ht+0x6d18, %rsi lea addresses_A_ht+0x16bf4, %rdi nop inc %r14 mov $62, %rcx rep movsw nop nop nop nop nop dec %rdi lea addresses_A_ht+0x14418, %r14 nop nop nop sub %rcx, %rcx mov $0x6162636465666768, %rax movq %rax, %xmm7 and $0xffffffffffffffc0, %r14 vmovntdq %ymm7, (%r14) nop nop nop sub %r15, %r15 lea addresses_WC_ht+0x18398, %rsi nop nop nop add %rdi, %rdi mov $0x6162636465666768, %r14 movq %r14, (%rsi) xor $35282, %rax lea addresses_UC_ht+0x1d258, %rsi lea addresses_UC_ht+0x8d18, %rdi nop nop nop nop add %r14, %r14 mov $58, %rcx rep movsb nop add %rdi, %rdi lea addresses_WC_ht+0xbae0, %r14 nop nop nop nop sub %rdx, %rdx mov $0x6162636465666768, %rdi movq %rdi, (%r14) cmp %rcx, %rcx lea addresses_normal_ht+0x1c118, %r8 nop nop add %rsi, %rsi movups (%r8), %xmm7 vpextrq $1, %xmm7, %rdi nop and %rdi, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r8 pop %r15 pop %r14 ret .global s_faulty_load s_faulty_load: push %r10 push %r9 push %rax push %rcx push %rdi // Faulty Load mov $0x4d21a70000000218, %rax nop nop dec %rdi vmovups (%rax), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %rcx lea oracles, %r10 and $0xff, %rcx shlq $12, %rcx mov (%r10,%rcx,1), %rcx pop %rdi pop %rcx pop %rax pop %r9 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'dst': {'same': True, 'congruent': 7, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 4}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': True, 'size': 8, 'congruent': 2}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6}} {'00': 3588, '45': 482, '47': 761} 00 45 45 45 45 00 00 00 47 00 47 00 00 00 45 45 47 00 47 47 00 47 00 00 00 47 47 00 00 00 45 45 45 45 00 00 00 45 47 00 47 00 00 00 00 00 47 47 00 00 00 00 00 00 00 00 00 00 47 00 47 00 47 47 00 00 00 45 00 00 00 45 00 00 00 00 47 00 00 45 47 00 45 47 00 00 00 47 00 00 45 00 00 00 47 00 00 00 00 00 47 00 47 00 00 47 00 00 00 47 00 00 45 45 00 45 47 00 00 47 00 47 00 45 00 00 45 45 47 00 45 00 00 00 00 00 00 00 45 00 45 00 00 00 47 00 00 00 00 00 45 47 47 47 00 00 00 00 00 00 00 00 00 00 47 00 00 45 00 00 00 00 00 00 45 00 00 00 00 00 47 00 00 00 47 00 00 47 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 47 00 00 00 00 47 00 00 00 00 00 00 00 00 47 00 00 00 47 00 00 00 47 45 45 45 47 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 00 00 00 47 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 45 47 47 47 00 45 00 00 47 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 47 00 00 47 45 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 47 00 00 47 00 00 45 00 00 00 00 00 00 00 45 00 47 00 00 45 00 00 45 45 00 47 47 00 00 45 00 45 00 00 45 00 00 00 00 00 00 00 47 00 00 00 47 00 45 45 45 00 00 00 00 47 00 00 00 00 47 00 47 47 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 45 45 45 45 45 00 00 00 00 47 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 47 47 00 00 47 00 45 00 47 45 00 00 47 00 00 47 00 00 00 00 00 00 45 45 00 00 00 00 00 47 00 47 00 45 47 00 00 00 47 00 47 00 47 47 00 47 00 00 00 45 00 00 47 47 00 00 00 00 45 00 00 00 47 00 45 00 00 00 47 00 45 47 00 00 00 00 00 00 00 47 00 00 47 00 45 45 45 45 45 45 45 45 45 00 00 00 00 00 00 47 47 00 00 00 47 47 00 00 00 00 00 47 00 45 45 45 47 00 00 00 00 00 00 00 00 47 00 00 45 00 00 00 00 47 00 00 00 00 00 00 00 45 00 00 47 00 47 00 00 47 47 00 00 00 00 47 00 00 45 00 00 00 00 47 00 00 47 00 47 00 00 00 00 00 00 00 00 47 00 47 00 00 00 00 00 00 00 00 47 00 00 00 47 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 47 00 45 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 47 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 47 00 00 47 00 00 00 00 00 45 00 47 00 47 00 47 00 00 00 00 00 00 47 00 00 00 00 00 00 45 00 00 00 00 47 47 00 00 00 00 47 00 00 00 00 00 47 00 47 00 00 00 00 47 00 00 00 00 00 45 00 00 47 00 00 00 45 00 00 00 00 45 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 45 47 00 47 00 00 00 45 45 00 00 00 00 00 47 00 00 00 00 00 00 47 00 00 00 00 00 00 47 00 00 00 00 47 00 00 00 00 47 00 00 00 00 47 00 00 47 00 45 00 47 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 47 00 47 00 47 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 45 00 45 00 00 00 45 45 00 00 47 00 00 00 00 45 00 00 00 45 45 45 00 00 45 00 47 45 00 00 00 45 47 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 47 45 00 47 00 45 45 00 00 00 00 47 47 00 00 00 00 00 00 45 45 45 00 00 00 47 00 00 00 47 00 47 47 47 00 00 45 00 00 00 00 00 00 47 00 00 00 00 00 00 47 47 45 45 45 45 45 47 00 00 00 00 */
38.083799
2,999
0.658794
c9516cda06501429f2773991bf61b0160441f320
442
asm
Assembly
libsrc/video/tms9918/stdio/generic_console/bordercolour.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/video/tms9918/stdio/generic_console/bordercolour.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/video/tms9918/stdio/generic_console/bordercolour.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void bordercolor(int c) __z88dk_fastcall; ; ; SECTION code_clib PUBLIC __tms9918_bordercolor EXTERN __tms9918_map_colour EXTERN msx_set_border INCLUDE "video/tms9918/vdp.inc" IF VDP_EXPORT_DIRECT = 1 PUBLIC bordercolor PUBLIC _bordercolor defc bordercolor = __tms9918_bordercolor defc _bordercolor = __tms9918_bordercolor ENDIF __tms9918_bordercolor: ld a,l call __tms9918_map_colour ld l,a jp msx_set_border
17.68
43
0.794118
c11f16fd6027a7c3b7a44a61b56ca5295415e249
677
asm
Assembly
7_kyu/Move_10.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
7_kyu/Move_10.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
7_kyu/Move_10.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
section .text global moveTen ; void moveTen(char *str) ; WARNING: str must contain only lower case letters! ; no upper case, no digits, etc moveTen: mov cl,10 ; offset to add mov ch,'z' ; last valid letter mov dl,'z'-'a'+1 ; correction after overflow cld ; go upwards through the string jmp .start .loop add al,cl ; add offset cmp al,ch ; check overflow jbe .inrange sub al,dl ; correct overflow .inrange: stosb ; replace in place .start: mov al,[rdi] test al,al ; 0 terminates the string jnz .loop ret
27.08
56
0.542097
db8149b72c4bed71034a1c53be5609e36ff3c331
14
asm
Assembly
8085_programming/8085 Programs/test12.asm
SayanGhoshBDA/code-backup
8b6135facc0e598e9686b2e8eb2d69dd68198b80
[ "MIT" ]
16
2018-11-26T08:39:42.000Z
2019-05-08T10:09:52.000Z
8085_programming/8085 Programs/test12.asm
SayanGhoshBDA/code-backup
8b6135facc0e598e9686b2e8eb2d69dd68198b80
[ "MIT" ]
8
2020-05-04T06:29:26.000Z
2022-02-12T05:33:16.000Z
8085_programming/8085 Programs/test12.asm
SayanGhoshBDA/code-backup
8b6135facc0e598e9686b2e8eb2d69dd68198b80
[ "MIT" ]
5
2020-02-11T16:02:21.000Z
2021-02-05T07:48:30.000Z
DAD B HLT
2.8
6
0.5
3e03a29d54d72d15556c784d5f59cf51c1abf7d9
330
asm
Assembly
Assembler/cputest.asm
thomasmalloch/NovaBoySharp
25dbe475b27f44c35ad86b101479391808d08bec
[ "MIT" ]
null
null
null
Assembler/cputest.asm
thomasmalloch/NovaBoySharp
25dbe475b27f44c35ad86b101479391808d08bec
[ "MIT" ]
null
null
null
Assembler/cputest.asm
thomasmalloch/NovaBoySharp
25dbe475b27f44c35ad86b101479391808d08bec
[ "MIT" ]
null
null
null
SECTION "Header", ROM0[$100] SECTION "Game code", ROM0 Start: ld sp,$1000 ; setup stack pointer ld a,10 ; load 10 into a ld b,3 ; load 3 into b loop: dec b ; decrement b jp z, end ; if b is 0, jump to the end add a ; add a to itself jp loop ; jump to the top of the multiply loop end: halt ; end
27.5
51
0.612121
47e68fb1617c7820d88277f6d715071a17d0edb1
463
asm
Assembly
oeis/183/A183856.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/183/A183856.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/183/A183856.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A183856: n+floor(sqrt(3n-2)); complement of A143975. ; 2,4,5,7,8,10,11,12,14,15,16,17,19,20,21,22,24,25,26,27,28,30,31,32,33,34,35,37,38,39,40,41,42,44,45,46,47,48,49,50,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,114,115,116,117 mov $2,$0 mul $2,6 add $2,3 lpb $2 add $0,1 add $2,$3 sub $3,2 add $2,$3 lpe add $0,1
33.071429
312
0.641469
48a641c88cb7ca16c27dafb8a312d000c965e57d
371
asm
Assembly
Working Disassembly/Levels/LRZ/Misc Object Data/Map - Act 3 Platform Debris.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
5
2021-07-09T08:17:56.000Z
2022-02-27T19:57:47.000Z
Working Disassembly/Levels/LRZ/Misc Object Data/Map - Act 3 Platform Debris.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Working Disassembly/Levels/LRZ/Misc Object Data/Map - Act 3 Platform Debris.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Map_187860: dc.w word_187868-Map_187860 dc.w word_187870-Map_187860 dc.w word_187878-Map_187860 dc.w word_187880-Map_187860 word_187868: dc.w 1 dc.b $F4, $A, 0, 0, $FF, $F4 word_187870: dc.w 1 dc.b $F8, 5, 0, 9, $FF, $F8 word_187878: dc.w 1 dc.b $FC, 0, 0, 0, $FF, $FC word_187880: dc.w 1 dc.b $FC, 0, 0, $C, $FF, $FC
28.538462
40
0.576819
7b9aac548b81fe322ddab10a4e662dfba5ed5f86
285
asm
Assembly
programs/oeis/186/A186295.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/186/A186295.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/186/A186295.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A186295: A007519(n)-2. ; 15,39,71,87,95,111,135,191,231,239,255,279,311,335,351,399,407,431,447,455,519,567,575,591,599,615,639,671,759,767,807,855,879,927,935,951,975,1007,1031,1047,1095,1127,1151,1191,1199,1215 seq $0,5123 ; Numbers n such that 8n + 1 is prime. mul $0,8 sub $0,1
40.714286
189
0.708772
760c061804c0ec45ca75f6110bd28da3fa892758
7,020
asm
Assembly
8086_Reading_Count_Crypt.asm
SDibla/8086-Reading_Text_Count_Occurrences_Apply_Cryptographic
68cc401569c2c64f158322c919e42ab9392f96e1
[ "MIT" ]
4
2020-07-07T09:29:38.000Z
2021-09-30T05:37:34.000Z
8086_Reading_Count_Crypt.asm
SDibla/8086-Reading_Text_Count_Occurrences_Apply_Cryptographic
68cc401569c2c64f158322c919e42ab9392f96e1
[ "MIT" ]
null
null
null
8086_Reading_Count_Crypt.asm
SDibla/8086-Reading_Text_Count_Occurrences_Apply_Cryptographic
68cc401569c2c64f158322c919e42ab9392f96e1
[ "MIT" ]
1
2021-03-10T04:02:51.000Z
2021-03-10T04:02:51.000Z
.MODEL small .STACK .DATA first_line DB 50 DUP(?) second_line DB 50 DUP(?) third_line DB 50 DUP(?) fourth_line DB 50 DUP(?) occurence_first DB 52 DUP (?) occurence_second DB 52 DUP (?) occurence_third DB 52 DUP (?) occurence_fourth DB 52 DUP (?) max_msg DB "Max character: A (01)",13,10,"Max/2 characters: $" max_half_msg DB "A (01) $" caesar_msg DB "Caesar cryptography: $" .CODE .STARTUP MOV AH,1 ;set the int 21h to read inputs MOV DI,0 ;set the index of the memory to the first address MOV CX,4 reading: PUSH CX MOV CX,20 reading_1_20: INT 21h ;reads the first 20 characters without interrupting MOV first_line(DI),AL INC DI LOOP reading_1_20 MOV CX,30 reading_21_50: INT 21h ;reads the remaining 30 characters checking for enter CMP AL,13 JNE no_enter MOV AH,2 MOV DL,10 INT 21h MOV AH,1 ADD DI,CX ;SUB DI,1 ;readjusting the pointer when an enter is detected MOV CX,1 ;set to 1 so that the loop will exit JMP next_reading no_enter: MOV first_line(DI),AL INC DI next_reading:LOOP reading_21_50 POP CX LOOP reading MOV AH,2 ;prints in the console a new line MOV DL,10 INT 21h MOV AH,2 MOV DL,13 INT 21h MOV CX,4 MOV DI,0 MOV DX,0 counting:PUSH CX MOV CX,50 line_counting:MOV AL,first_line(DI) INC DI SUB AL,'A' JC skip_char ;jumps if the ascii is lower than 'A' CMP AL,'Z'-'A' JA lower_case MOV BX,DX ;| ADD BL,AL ;adjust the buffer of the line INC occurence_first(BX) JMP skip_char lower_case:SUB AL,6 CMP AL,25 JB skip_char CMP AL,51 JA skip_char MOV BX,DX ADD BL,AL INC occurence_first(BX) skip_char:LOOP line_counting ADD DX,52 ;used to move to the next line occurences buffer POP CX LOOP counting MOV DI,0 MOV CX,4 max_loop:PUSH CX MOV BX,0 MOV CX,52 max_check:MOV BH,occurence_first(DI) CMP BL,BH JA next_max MOV BL,BH POP DX ;algorithm to subtract the current line PUSH DX ;value to save in the array MOV AX,4 SUB AX,DX MOV DH,52 MUL DH MOV DX,DI SUB DX,AX next_max: INC DI LOOP max_check MOV BH,DL CMP BH,26 JB upper_case_max ;transform the value from the array (0 to 52) to ascii ADD BH,6 upper_case_max:ADD BH,'A' MOV BYTE PTR[max_msg+15],BH ;writes in the msg in memory MOV AL,BL ;transform the occurences number into two ascii tens and unity MOV AH,0 MOV BH,10 DIV BH ADD AH,48 ADD AL,48 MOV BYTE PTR[max_msg+18],AL ;writes the converted number in the msg MOV BYTE PTR[max_msg+19],AH LEA DX,max_msg MOV AH,9 ;write to the console INT 21h MOV BH,0 ;divide by two and add the carry out to take SHR BX,1 ;only the top half with odd number ADC BX,0 MOV CX,52 POP AX ;calculate the correct DI for the current line PUSH AX MOV AH,4 SUB AH,AL MOV AL,AH MOV AH,0 MUL CX MOV DI,AX max_half: MOV AH,0 MOV AL,occurence_first(DI) CMP AX,BX JB next_half POP DX ;algorithm to subtract the current PUSH DX ;line value to save in the array MOV AX,4 SUB AX,DX MOV DH,52 MUL DH MOV DX,DI SUB DX,AX CMP DL,26 ;array to ascii conversion JB upper_case_half ADD DL,6 upper_case_half:ADD DL,'A' MOV BYTE PTR[max_half_msg],DL ;write in the msg MOV AL,occurence_first(DI) ;convert number to ascii (tens and unity) MOV DL,10 DIV DL ADD AH,48 ADD AL,48 MOV BYTE PTR[max_half_msg+3],AL MOV BYTE PTR[max_half_msg+4],AH LEA DX,max_half_msg MOV AH,9 INT 21h next_half:INC DI LOOP max_half MOV AH,2 ;prints in the console a new line MOV DL,10 INT 21h MOV AH,2 MOV DL,13 INT 21h MOV AH,9 LEA DX,caesar_msg INT 21h POP CX ;calculate the correct DI for the current line PUSH CX ;and retreive the caesar 'k' MOV BX,5 MOV AX,4 SUB AX,CX SUB BX,CX MOV CX,50 MUL CX MOV DI,AX caesar_loop: MOV AL,first_line(DI) CMP AL,0 ;exit the cycle if NULL char JE next_caesar CMP AL,'A' ;do not modify chars under 'A' JB print_char CMP AL,'z' ;do not modify chars above 'z' JA print_char ADD AL,BL MOV DL,26 SUB AL,'A' CMP AL,26 ;checks if the char is over 'Z' JA caesar_lower DIV DL MOV AL,AH ADD AL,'A' JMP print_char caesar_lower:SUB AL,26 CMP AL,6 ;checks if the char is lower than 'a' JB in_between_char SUB AL,6 DIV DL MOV AL,AH ADD AL,'a' JMP print_char in_between_char: ADD AL,'Z' print_char: MOV DL,AL MOV AH,2 INT 21h next_caesar:INC DI MOV AH,0 LOOP caesar_loop MOV AH,2 ;prints in the console a new line MOV DL,10 INT 21h MOV AH,2 MOV DL,13 INT 21h MOV AH,2 ;prints in the console a new line MOV DL,10 INT 21h MOV AH,2 MOV DL,13 INT 21h POP CX LOOP max_loop .EXIT END
23.959044
89
0.45698
b3c965dc3d2c18dad10b03f235b37b1d813cf88e
29,994
asm
Assembly
Library/User/UI/uiEdit.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/User/UI/uiEdit.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/User/UI/uiEdit.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @----------------------------------------------------------------------- Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: Text Library FILE: uiEdit.asm ROUTINES: Name Description ---- ----------- GLB GenEditControlClass Style menu object REVISION HISTORY: Name Date Description ---- ---- ----------- Doug 7/91 Initial version DESCRIPTION: This file contains routines to implement GenEditControlClass $Id: uiEdit.asm,v 1.3 98/05/08 09:48:04 gene Exp $ -------------------------------------------------------------------------------@ ;--------------------------------------------------- UserClassStructures segment resource GenEditControlClass ;declare the class record UserClassStructures ends ;--------------------------------------------------- if not NO_CONTROLLERS ;++++++++++++++++++++++++++++++++++++++++++++++++++++ ControlCommon segment resource COMMENT @---------------------------------------------------------------------- MESSAGE: GenEditControlGetInfo -- MSG_GEN_CONTROL_GET_INFO for GenEditControlClass DESCRIPTION: Return group PASS: *ds:si - instance data es - segment of GenEditControlClass ax - The message cx:dx - GenControlBuildInfo structure to fill in RETURN: none DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 10/31/91 Initial version ------------------------------------------------------------------------------@ GenEditControlGetInfo method dynamic GenEditControlClass, MSG_GEN_CONTROL_GET_INFO mov si, offset GEC_dupInfo FALL_THRU CopyDupInfoCommon GenEditControlGetInfo endm ; Do *NOT* call this routine from another code resource, ; as you will not be happy with the results! ; CopyDupInfoCommon proc far mov es, cx mov di, dx ;es:di = dest segmov ds, cs CheckHack <(((size GenControlBuildInfo)/2)*2) eq (size GenControlBuildInfo)> mov cx, (size GenControlBuildInfo) / 2 rep movsw ret CopyDupInfoCommon endp GEC_dupInfo GenControlBuildInfo < ; GCBI_flags mask GCBF_ALWAYS_UPDATE or mask GCBF_CUSTOM_ENABLE_DISABLE, GEC_IniFileKey, ; GCBI_initFileKey GEC_gcnList, ; GCBI_gcnList length GEC_gcnList, ; GCBI_gcnCount GEC_notifyTypeList, ; GCBI_notificationList length GEC_notifyTypeList, ; GCBI_notificationCount GECName, ; GCBI_controllerName handle GenEditControlUI, ; GCBI_dupBlock GEC_childList, ; GCBI_childList length GEC_childList, ; GCBI_childCount GEC_featuresList, ; GCBI_featuresList length GEC_featuresList, ; GCBI_featuresCount GEC_DEFAULT_FEATURES, ; GCBI_features handle GenEditControlToolboxUI, ; GCBI_toolBlock GEC_toolList, ; GCBI_toolList length GEC_toolList, ; GCBI_toolCount GEC_toolFeaturesList, ; GCBI_toolFeaturesList length GEC_toolFeaturesList, ; GCBI_toolFeaturesCount GEC_DEFAULT_TOOLBOX_FEATURES> ; GCBI_toolFeatures if FULL_EXECUTE_IN_PLACE UIControlInfoXIP segment resource endif GEC_IniFileKey char "editControl", 0 GEC_gcnList GCNListType \ <MANUFACTURER_ID_GEOWORKS, GAGCNLT_APP_TARGET_NOTIFY_SELECT_STATE_CHANGE>, \ <MANUFACTURER_ID_GEOWORKS, GAGCNLT_EDIT_CONTROL_NOTIFY_UNDO_STATE_CHANGE> GEC_notifyTypeList NotificationType \ <MANUFACTURER_ID_GEOWORKS, GWNT_SELECT_STATE_CHANGE>, \ <MANUFACTURER_ID_GEOWORKS, GWNT_UNDO_STATE_CHANGE> ;--- GEC_childList GenControlChildInfo \ <offset FirstEditGroup, mask GECF_UNDO or \ mask GECF_CUT or \ mask GECF_COPY or \ mask GECF_PASTE or \ mask GECF_DELETE, 0>, <offset SelectAllGroup, mask GECF_SELECT_ALL, mask GCCF_IS_DIRECTLY_A_FEATURE>, <offset CharMapGroup, mask GECF_CHAR_MAP, mask GCCF_IS_DIRECTLY_A_FEATURE>, <offset ClipArtGroup, mask GECF_CLIP_ART, mask GCCF_IS_DIRECTLY_A_FEATURE> ; Careful, this table is in the *opposite* order as the record which ; it corresponds to. GEC_featuresList GenControlFeaturesInfo \ <offset DeleteTrigger, DeleteName>, <offset SelectAllGroup, SelectAllName>, <offset PasteTrigger, PasteName>, <offset CopyTrigger, CopyName>, <offset CutTrigger, CutName>, <offset UndoTrigger, UndoName>, <offset CharMapTrigger, CharMapName>, <offset ClipArtTrigger, ClipArtName> ;--- GEC_toolList GenControlChildInfo \ <offset UndoToolTrigger, mask GECTF_UNDO, mask GCCF_IS_DIRECTLY_A_FEATURE>, <offset CutToolTrigger, mask GECTF_CUT, mask GCCF_IS_DIRECTLY_A_FEATURE>, <offset CopyToolTrigger, mask GECTF_COPY, mask GCCF_IS_DIRECTLY_A_FEATURE>, <offset PasteToolTrigger, mask GECTF_PASTE, mask GCCF_IS_DIRECTLY_A_FEATURE>, <offset SelectAllToolTrigger, mask GECTF_SELECT_ALL, mask GCCF_IS_DIRECTLY_A_FEATURE>, <offset DeleteToolTrigger, mask GECTF_DELETE, mask GCCF_IS_DIRECTLY_A_FEATURE> ; Careful, this table is in the *opposite* order as the record which ; it corresponds to. GEC_toolFeaturesList GenControlFeaturesInfo \ <offset DeleteToolTrigger, DeleteName>, <offset SelectAllToolTrigger, SelectAllName>, <offset PasteToolTrigger, PasteName>, <offset CopyToolTrigger, CopyName>, <offset CutToolTrigger, CutName>, <offset UndoToolTrigger, UndoName> if FULL_EXECUTE_IN_PLACE UIControlInfoXIP ends endif COMMENT @---------------------------------------------------------------------- MESSAGE: GenEditControlGenerateUI -- MSG_GEN_CONTROL_GENERATE_UI for GenEditControlClass DESCRIPTION: Before building our UI, add ourselves to clipboard notification list so that we'll be able to set the state of that UI correctly. PASS: *ds:si - instance data es - segment of GenEditControlClass ax - The message cx - ? dx - ? bp - ? RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 7/15/92 Initial version ------------------------------------------------------------------------------@ GenEditControlGenerateUI method dynamic GenEditControlClass, MSG_GEN_CONTROL_GENERATE_UI, MSG_GEN_CONTROL_GENERATE_TOOLBOX_UI push ax, cx, dx, bp mov ax, TEMP_CLIPBOARD_NOTIFICATION_LIST_COUNT call ObjVarFindData jc found mov cx, size word call ObjVarAddData mov {word} ds:[bx], 0 found: inc {word} ds:[bx] cmp {word} ds:[bx], 1 jne noAdd ; Add the item to the notification list if the ref count is 1 mov cx, ds:[LMBH_handle] mov dx, si call ClipboardAddToNotificationList ; ; if we add ourselves to the clipboard notification list, make sure ; that we are on the active list, as that is the only way that we'll ; get removed from the clipboard notification list. ; sub sp, size GCNListParams mov bp, sp movdw ss:[bp].GCNLP_optr, cxdx mov ss:[bp].GCNLP_ID.GCNLT_manuf, MANUFACTURER_ID_GEOWORKS mov ss:[bp].GCNLP_ID.GCNLT_type, MGCNLT_ACTIVE_LIST or \ mask GCNLTF_SAVE_TO_STATE mov dx, size GCNListParams mov ax, MSG_META_GCN_LIST_ADD call GenCallApplication add sp, size GCNListParams noAdd: pop ax, cx, dx, bp ; ; do the superclass thing ; mov di, offset GenEditControlClass call ObjCallSuperNoLock ; ; if desired, set up the alternate shortcuts ; call SetupAlternateShortcuts ret GenEditControlGenerateUI endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetupAlternateShortcuts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: set up the alternate keyboard shortcuts if desired CALLED BY: GenEditControlGenerateUI() PASS: *ds:si - GenEditControl object RETURN: none DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 5/1/98 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ objList lptr \ UndoTrigger, CutTrigger, CopyTrigger, PasteTrigger, SelectAllTrigger idata segment ;p a c s s c ;h l t h e h ;y t r f t a ;s l t r mainShortcutList KeyboardShortcut \ <0, 0, 1, 0, 0, C_SMALL_Z>, ;<z> = undo <0, 0, 1, 0, 0, C_SMALL_X>, ;<x> = cut <0, 0, 1, 0, 0, C_SMALL_C>, ;<c> = copy <0, 0, 1, 0, 0, C_SMALL_V>, ;<p> = paste <0, 0, 1, 0, 0, C_SMALL_A> ;<a> = select all idata ends idata segment altShortcutList KeyboardShortcut \ <1, 1, 0, 0, CS_CONTROL and 0xf, VC_BACKSPACE>, ;<alt><bkspace> = undo <1, 0, 0, 1, CS_CONTROL and 0xf, VC_DEL>, ;<shift><delete> = cut <1, 0, 1, 0, CS_CONTROL and 0xf, VC_INS>, ;<ctrl><insert> = copy <1, 0, 0, 1, CS_CONTROL and 0xf, VC_INS>, ;<shift><insert> =paste <0, 0, 1, 0, 0, C_SLASH> ;<ctrl>-/ = select all idata ends featureList word \ mask GECF_UNDO, mask GECF_CUT, mask GECF_COPY, mask GECF_PASTE, mask GECF_SELECT_ALL CheckHack <length mainShortcutList eq length objList> CheckHack <length altShortcutList eq length objList> CheckHack <length featureList eq length objList> uiFeaturesCat char "uiFeatures",0 useAltEditKeys char "altEditKeys",0 SetupAlternateShortcuts proc near uses ax, bx, cx, dx, si, di, bp, es .enter segmov es, dgroup ; ; See if we want the alternates ; push ds, si segmov ds, cs, cx mov si, offset uiFeaturesCat mov dx, offset useAltEditKeys call InitFileReadBoolean pop ds, si jc noAlt ;branch if not there tst ax jz noAlt ;branch if false ; ; ; Loop through the list and change the shortcuts ; mov ax, TEMP_GEN_CONTROL_INSTANCE call ObjVarDerefData mov ax, ds:[bx].TGCI_features ;ax <- features mov bx, ds:[bx].TGCI_childBlock ;bx <- child block mov cx, length mainShortcutList ;cx <- # shortcuts clr di ;di <- table index childLoop: test ax, cs:featureList[di] ;feature exists? jz skipObj ;branch if no feature push ax, cx, di mov si, cs:objList[di] ;^bx:si <- OD mov cx, es:mainShortcutList[di] ;cx <- new shortcut push es:altShortcutList[di] mov di, mask MF_FIXUP_DS mov dl, VUM_DELAYED_VIA_APP_QUEUE mov ax, MSG_GEN_SET_KBD_ACCELERATOR call ObjMessage pop dx tst dx jz noExtra call ObjSwapLock push bx mov ax, ATTR_GEN_EXTRA_KBD_ACCELERATORS mov cx, size KeyboardShortcut call ObjVarAddData mov ds:[bx], dx pop bx call ObjSwapUnlock noExtra: pop ax, cx, di skipObj: add di, (size lptr) loop childLoop noAlt: .leave ret SetupAlternateShortcuts endp COMMENT @---------------------------------------------------------------------- MESSAGE: GenEditControlAddAppUI -- MSG_GEN_CONTROL_ADD_APP_UI for GenEditControlClass DESCRIPTION: Add application UI PASS: *ds:si - instance data es - segment of GenEditControlClass ax - The message cx:dx - object RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 11/24/92 Initial version ------------------------------------------------------------------------------@ GenEditControlAddAppUI method dynamic GenEditControlClass, MSG_GEN_CONTROL_ADD_APP_UI mov bp, 1 mov ax, MSG_GEN_ADD_CHILD GOTO ObjCallInstanceNoLock GenEditControlAddAppUI endm COMMENT @---------------------------------------------------------------------- MESSAGE: GenEditControlNotifyNormalTransferItemChanged -- MSG_META_CLIPBOARD_NOTIFY_NORMAL_TRANSFER_ITEM_CHANGED for GenEditControlClass DESCRIPTION: Cause target to update transfer stuff PASS: *ds:si - instance data es - segment of GenEditControlClass ax - The message RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 12/10/91 Initial version ------------------------------------------------------------------------------@ GenEditControlNotifyNormalTransferItemChanged method dynamic \ GenEditControlClass, MSG_META_CLIPBOARD_NOTIFY_NORMAL_TRANSFER_ITEM_CHANGED mov ax, MSG_META_UI_FORCE_CONTROLLER_UPDATE mov cx, MANUFACTURER_ID_GEOWORKS mov dx, GWNT_SELECT_STATE_CHANGE GOTO OutputNoClass GenEditControlNotifyNormalTransferItemChanged endm COMMENT @---------------------------------------------------------------------- MESSAGE: GenEditControlUpdateUI -- MSG_GEN_CONTROL_UPDATE_UI for GenEditControlClass DESCRIPTION: Handle notification of attributes change PASS: *ds:si - instance data es - segment of GenEditControlClass ax - The message ss:bp - GenControlUpdateUIParams RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 11/12/91 Initial version ------------------------------------------------------------------------------@ GenEditControlUpdateUI method dynamic GenEditControlClass, MSG_GEN_CONTROL_UPDATE_UI ; get notification data mov bx, ss:[bp].GCUUIP_dataBlock tst bx jnz lockDataBlock segmov es, cs mov bx, offset nullNotification jmp noLock lockDataBlock: call MemLock mov es, ax clr bx noLock: cmp ss:[bp].GCUUIP_changeType, GWNT_UNDO_STATE_CHANGE jz doUndoChange ; update the copy trigger EC < cmp es:[bx].NSSC_selectionType, SelectionDataType > EC < ERROR_AE BAD_SELECTION_TYPE > mov ax, mask GECF_COPY mov dx, mask GECTF_COPY mov cl, es:[bx].NSSC_clipboardableSelection mov ch, VUM_NOW mov si, offset CopyTrigger mov di, offset CopyToolTrigger call GEC_EnableOrDisable ; update the cut trigger mov ax, mask GECF_CUT mov dx, mask GECTF_CUT and cl, es:[bx].NSSC_deleteableSelection mov si, offset CutTrigger mov di, offset CutToolTrigger call GEC_EnableOrDisable ; update the paste trigger mov ax, mask GECF_PASTE mov dx, mask GECTF_PASTE mov cl, es:[bx].NSSC_pasteable mov si, offset PasteTrigger mov di, offset PasteToolTrigger call GEC_EnableOrDisable ; update the delete trigger mov ax, mask GECF_DELETE mov dx, mask GECTF_DELETE mov cl, es:[bx].NSSC_deleteableSelection mov si, offset DeleteTrigger mov di, offset DeleteToolTrigger call GEC_EnableOrDisable ; update the select all trigger mov ax, mask GECF_SELECT_ALL mov dx, mask GECTF_SELECT_ALL mov cl, es:[bx].NSSC_selectAllAvailable mov si, offset SelectAllTrigger mov di, offset SelectAllToolTrigger call GEC_EnableOrDisable exit: mov bx, ss:[bp].GCUUIP_dataBlock tst bx jz noUnlock call MemUnlock noUnlock: ret doUndoChange: ; update the undo trigger push si mov ax, mask GECF_UNDO mov dx, mask GECTF_UNDO mov cx, es:[bx].NUSC_undoTitle.handle or cl, ch mov ch, VUM_DELAYED_VIA_UI_QUEUE mov si, offset UndoTrigger mov di, offset UndoToolTrigger call GEC_EnableOrDisable pop si ; update the moniker for the undo trigger (if needed) test ss:[bp].GCUUIP_features, mask GECF_UNDO jz exit mov di, bx ;ES:DI <- NotifyUndoStateChange mov ax, TEMP_UNDO_DESCRIPTION ;If there was already a call ObjVarFindData ; description, branch. jc descFound ; set undo trigger to passed string mov ax, TEMP_UNDO_DESCRIPTION mov cx, size NotifyUndoStateChange call ObjVarAddData ;ds:bx = data setDesc: movdw ds:[bx].NUSC_undoTitle, es:[di].NUSC_undoTitle, ax mov al, es:[di].NUSC_undoType mov ds:[bx].NUSC_undoType, al ; set the moniker mov bx, ss:[bp].GCUUIP_childBlock mov si, offset UndoTrigger call GEC_SetUndoMoniker jmp exit ; found previous string -- compare them descFound: ; If this is now a redo, branch mov al, es:[di].NUSC_undoType cmp al, ds:[bx].NUSC_undoType jnz setDesc cmpdw es:[di].NUSC_undoTitle, ds:[bx].NUSC_undoTitle, ax jz exit tst es:[di].NUSC_undoTitle.handle ;New moniker is null, but old jz setDesc ; is non-null, branch. tst ds:[bx].NUSC_undoTitle.handle ;If old moniker is null, but new is jz setDesc ; non-null, branch to set the ; moniker ; We have two non-null undo monikers - compare them. call CompareUndoStrings ;If setting it to the same string, jnz setDesc ; branch to exit. jmp exit GenEditControlUpdateUI endm nullNotification NotifySelectStateChange <0,0,0,0,0> .assert size NotifyUndoStateChange le size NotifySelectStateChange ;--- ; ax = bit to test to normal ; dx = bit to test for tool ; cl = non-zero to enable, 0 to disable ; ch = VisUpdateMode ; si = offset for normal obj ; di = offset for tool obj ; ss:bp = GenControlUpdateUIParams GEC_EnableOrDisable proc near uses bx, cx .enter test ax, ss:[bp].GCUUIP_features jz noNormal mov bx, ss:[bp].GCUUIP_childBlock call GEC_EnableOrDisableLow noNormal: test dx, ss:[bp].GCUUIP_toolboxFeatures jz noToolBox mov bx, ss:[bp].GCUUIP_toolBlock mov si, di call GEC_EnableOrDisableLow noToolBox: .leave ret GEC_EnableOrDisable endp ;--- ;bx:si - obj ;cl - state ;ch - VisUpdateMode GEC_EnableOrDisableLow proc near uses dx, di .enter mov ax, MSG_GEN_SET_ENABLED mov dl, ch tst cl jnz pasteCommon mov ax, MSG_GEN_SET_NOT_ENABLED pasteCommon: mov di, mask MF_FIXUP_DS call ObjMessage .leave ret GEC_EnableOrDisableLow endp ;--- OutputNoClass proc far clr bx ;any class -- this is a meta message clr di call GenControlOutputActionRegs ret OutputNoClass endp ControlCommon ends ;--- ControlCode segment resource COMMENT @---------------------------------------------------------------------- MESSAGE: GenEditControlDestroyUI -- MSG_GEN_CONTROL_DESTROY_UI for GenEditControlClass DESCRIPTION: Remove ourselves from clipboard notification list PASS: *ds:si - instance data es - segment of GenEditControlClass ax - The message RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 7/15/92 Initial version ------------------------------------------------------------------------------@ GenEditControlDestroyUI method dynamic GenEditControlClass, MSG_GEN_CONTROL_DESTROY_UI, MSG_GEN_CONTROL_DESTROY_TOOLBOX_UI, MSG_META_DETACH push ax mov di, offset GenEditControlClass call ObjCallSuperNoLock pop ax cmp ax, MSG_META_DETACH jz forceRemove ; Only remove the object from the notification list when the ref count ; is zero mov ax, TEMP_CLIPBOARD_NOTIFICATION_LIST_COUNT call ObjVarFindData EC < ERROR_NC GEN_CONTROL_INTERNAL_ERROR > dec {word} ds:[bx] EC < ERROR_S GEN_CONTROL_INTERNAL_ERROR > jnz noRemove forceRemove: mov cx, ds:[LMBH_handle] mov dx, si call ClipboardRemoveFromNotificationList noRemove: ret GenEditControlDestroyUI endm COMMENT @---------------------------------------------------------------------- MESSAGE: GenEditControlClipboardUndo -- MSG_UNDO for GenEditControlClass DESCRIPTION: Handle "undo" (and others) PASS: *ds:si - instance data es - segment of GenEditControlClass ax - The message RETURN: DESTROYED: bx, si, di, ds, es (message handler) REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 10/31/91 Initial version ------------------------------------------------------------------------------@ GenEditControlClipboardUndo method GenEditControlClass, MSG_META_UNDO mov ax, MSG_GEN_PROCESS_UNDO_PLAYBACK_CHAIN call GeodeGetProcessHandle mov di, mask MF_FIXUP_DS GOTO ObjMessage GenEditControlClipboardUndo endm ;--- GenEditControlClipboardCut method GenEditControlClass, MSG_META_CLIPBOARD_CUT, MSG_META_CLIPBOARD_COPY, MSG_META_CLIPBOARD_PASTE EC < mov cx, 0xcccc > EC < mov dx, 0xcccc > EC < mov bp, 0xcccc > push ax mov ax, MSG_GEN_APPLICATION_MARK_BUSY call GenCallApplication pop ax call OutputNoClass push si mov ax, MSG_GEN_APPLICATION_MARK_NOT_BUSY clr bx call GeodeGetAppObject mov di, mask MF_RECORD call ObjMessage mov cx, di pop si clr dx mov ax, MSG_META_DISPATCH_EVENT call OutputNoClass ret GenEditControlClipboardCut endm ;--- GenEditControlClipboardSelectAll method GenEditControlClass, MSG_META_SELECT_ALL, MSG_META_DELETE EC < mov cx, 0xcccc > EC < mov dx, 0xcccc > EC < mov bp, 0xcccc > call OutputNoClass ret GenEditControlClipboardSelectAll endm ;--- serverAppToken GeodeToken <"Scrp",MANUFACTURER_ID_GEOWORKS> GenEditControlClipArt method GenEditControlClass, MSG_GEC_LAUNCH_CLIP_ART uses ax,bx,cx,dx,si,di,bp .enter EC < mov cx, 0xcccc > EC < mov dx, 0xcccc > EC < mov bp, 0xcccc > ; ; Create a launch block to pass to IACPConnect ; mov dx, MSG_GEN_PROCESS_OPEN_APPLICATION call IACPCreateDefaultLaunchBlock ; dx = handle to AppLaunchBlock ; ; Clear launch flags ; mov bx, dx ; bx <- handle of AppLaunchBlock call MemLock ; ax = AppLaunchBlock segment mov es, ax mov es:[ALB_launchFlags], mask ALF_OVERRIDE_MULTIPLE_INSTANCE push bx lea di, es:[ALB_dataFile] mov {byte}es:[di], 0 ; leave the first byte empty inc di mov ax, GGIT_PERM_NAME_AND_EXT clr bx call GeodeGetInfo ; es:di = GeodeToken pop bx call MemUnlock ; ; Connect to the desired server ; mov di, offset cs:[serverAppToken] segmov es, cs, dx ; es:di points to GeodeToken mov ax, mask IACPCF_FIRST_ONLY ; ax <- connect flag call IACPConnect ; bp = IACPConnection jc done ; ; Shut down connection ; clr cx, dx call IACPShutdown done: .leave ret GenEditControlClipArt endm ;--- server2AppToken GeodeToken <"CHRm",16426> ; BREAK_BOX_MANUFACTURE_ID GenEditControlCharMap method GenEditControlClass, MSG_GEC_LAUNCH_CHAR_MAP uses ax,bx,cx,dx,si,di,bp .enter EC < mov cx, 0xcccc > EC < mov dx, 0xcccc > EC < mov bp, 0xcccc > ; ; Create a launch block to pass to IACPConnect ; mov dx, MSG_GEN_PROCESS_OPEN_APPLICATION call IACPCreateDefaultLaunchBlock ; dx = handle to AppLaunchBlock ; ; Clear launch flags ; mov bx, dx ; bx <- handle of AppLaunchBlock call MemLock ; ax = AppLaunchBlock segment mov es, ax mov es:[ALB_launchFlags], mask ALF_OVERRIDE_MULTIPLE_INSTANCE push bx lea di, es:[ALB_dataFile] mov {byte}es:[di], 0 ; leave the first byte empty inc di mov ax, GGIT_PERM_NAME_AND_EXT clr bx call GeodeGetInfo ; es:di = GeodeToken pop bx call MemUnlock ; ; Connect to the desired server ; mov di, offset cs:[server2AppToken] segmov es, cs, dx ; es:di points to GeodeToken mov ax, mask IACPCF_FIRST_ONLY ; ax <- connect flag call IACPConnect ; bp = IACPConnection jc done ; ; Shut down connection ; clr cx, dx call IACPShutdown done: .leave ret GenEditControlCharMap endm ;--- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CompareUndoStrings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compares the passed undo strings CALLED BY: GLOBAL PASS: es:di - ptr to optr of one null terminated string ds:bx - ptr to optr of the other null terminated string (es:di and ds:bx *cannot* be pointing into the movable XIP code resource.) RETURN: zero flag set if match (jz if match) DESTROYED: ax, cx, dx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 6/ 4/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CompareUndoStrings proc far uses es, ds, di, si, bx, bp destHan local hptr \ push ds:[bx].handle sourceHan local hptr .enter if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < pushdw bxsi > EC < mov si, bx > EC < mov bx, ds > EC < call ECAssertValidFarPointerXIP > EC < movdw bxsi, esdi > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > endif mov si, ds:[bx].chunk mov bx, es:[di].NUSC_undoTitle.handle mov sourceHan, bx mov di, es:[di].NUSC_undoTitle.chunk call MemLock mov es, ax mov di, es:[di] mov bx, destHan call MemLock mov ds, ax mov si, ds:[si] ChunkSizePtr es, di, cx ;CX <- size of source ; chunk ChunkSizePtr ds, si, ax ;AX <- size of dest cmp ax, cx ;If size are not equal, jnz doUnlock ; exit repe cmpsb ;Compare the strings doUnlock: mov bx, sourceHan call MemUnlock mov bx, destHan call MemUnlock .leave ret CompareUndoStrings endp ;--- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CopyUndoMonikerString %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Creates an undo moniker string by prepending a prefix string to the passed app-supplied string, then appends a suffix. CALLED BY: GLOBAL PASS: ^lcx:dx - optr of app-supplied title string al - undo type es:di - place to store string RETURN: es:di - end of string (points at null terminator) DESTROYED: ax, cx, dx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 6/ 8/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CopyUndoMonikerString proc uses bx, si .enter push ax pushdw cxdx mov si, offset UndoTriggerMonikerPrefix tst al jz undoPrefix mov si, offset RedoTriggerMonikerPrefix undoPrefix: call GEC_CopyFromControlStrings ; Copy app-supplied string popdw bxsi call GEC_CopyFromChunk pop ax mov si, offset UndoTriggerMonikerSuffix tst al jz undoSuffix mov si, offset RedoTriggerMonikerSuffix undoSuffix: call GEC_CopyFromControlStrings SBCS < mov {char} es:[di], 0 > DBCS < mov {wchar} es:[di], 0 > .leave ret CopyUndoMonikerString endp ; es:[di].NUSC_undoTitle = optr of name ; bx:si = undo trigger SBCS <MAX_UNDO_MONIKER_LENGTH = 128 > DBCS <MAX_UNDO_MONIKER_LENGTH = 256 > GEC_SetUndoMoniker proc far uses bp .enter if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < pushdw bxsi > EC < movdw bxsi, esdi > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > endif mov_tr ax, di mov di, 600 call ThreadBorrowStackSpace push di mov_tr di, ax movdw cxdx, es:[di].NUSC_undoTitle mov al, es:[di].NUSC_undoType cmp al, UD_NOT_UNDOABLE jz setCannotUndoMoniker tst cx ;Can't do jcxz - it's too far. jz setNullMoniker sub sp, MAX_UNDO_MONIKER_LENGTH + size VisMoniker + size VisMonikerText mov di, sp segmov es, ss ;ES:DI <- dest for ; moniker mov es:[di].VM_type, DAR_NORMAL shl offset VMT_GS_ASPECT_RATIO or DC_TEXT shl offset VMT_GS_COLOR clr es:[di].VM_width clr es:[di].VM_data.VMT_mnemonicOffset add di, offset VM_data.VMT_text ; ; Create the moniker string for the undo/redo trigger ; ; ^lcx:dx - title string for current undo chain ; al - non-zero if we are doing a redo, else an undo ; ^lbx:si - undo trigger ; ES:DI <- ptr to store the undo moniker string ; call CopyUndoMonikerString mov cx, di inc cx ;+1 for NULL DBCS < inc cx > sub cx, sp ;CX <- # bytes mov di, sp ; Set the vis moniker for the undo trigger mov dx, size ReplaceVisMonikerFrame sub sp, dx mov bp, sp movdw ss:[bp].RVMF_source, esdi mov ss:[bp].RVMF_sourceType, VMST_FPTR mov ss:[bp].RVMF_dataType, VMDT_VIS_MONIKER mov ss:[bp].RVMF_length, cx clr ss:[bp].RVMF_width clr ss:[bp].RVMF_height mov ss:[bp].RVMF_updateMode, VUM_DELAYED_VIA_UI_QUEUE mov ax, MSG_GEN_REPLACE_VIS_MONIKER mov di, mask MF_FIXUP_DS call ObjMessage add sp, size ReplaceVisMonikerFrame + MAX_UNDO_MONIKER_LENGTH + size VisMoniker + size VisMonikerText exit: mov_tr ax, di pop di call ThreadReturnStackSpace mov_tr di, ax .leave ret setCannotUndoMoniker: EC < tst cx > EC < ERROR_NZ NON_ZERO_TITLE_PASSED_WITH_UD_NOT_UNDOABLE > mov dx, offset CannotUndoMoniker jmp setMonikerCommon setNullMoniker: mov dx, offset NoUndoMoniker setMonikerCommon: mov ax, MSG_GEN_REPLACE_VIS_MONIKER_OPTR mov cx, handle ControlStrings mov bp, VUM_DELAYED_VIA_UI_QUEUE mov di, mask MF_FIXUP_DS call ObjMessage jmp exit GEC_SetUndoMoniker endp ;--- ; ^lbx:si = source ; ss:di = dest GEC_CopyFromControlStrings proc near mov bx, handle ControlStrings FALL_THRU GEC_CopyFromChunk GEC_CopyFromControlStrings endp ;- GEC_CopyFromChunk proc near uses ds, es .enter call MemLock mov ds, ax mov si, ds:[si] ;ds:si = source ChunkSizePtr ds, si, cx ;cx = length DBCS < shr cx, 1 > dec cx ;Don't copy the null segmov es, ss ;es:di = dest SBCS < rep movsb > DBCS < rep movsw > call MemUnlock .leave ret GEC_CopyFromChunk endp ControlCode ends endif ; NO_CONTROLLERS ++++++++++++++++++++++++++++++++++++
23.767036
103
0.660665
16a8276b00698615c440d6fde3a58024230eaab3
1,258
asm
Assembly
app/src/modules/Folder/post.asm
whxru/Mini-C
aa9a7dade19bdf74377f7948da1d02f183e13849
[ "MIT" ]
null
null
null
app/src/modules/Folder/post.asm
whxru/Mini-C
aa9a7dade19bdf74377f7948da1d02f183e13849
[ "MIT" ]
null
null
null
app/src/modules/Folder/post.asm
whxru/Mini-C
aa9a7dade19bdf74377f7948da1d02f183e13849
[ "MIT" ]
null
null
null
.DATA .TEXT 0x0000 start: nop addi $30,$0,0xbffc sll $30,$30,16 srl $30,$30,16 addi $t0,$0,0 addi $t1,$0,0xfffc sll $t1,$t1,16 srl $t1,$t1,16 addi $t2,$0,0x55aa addi $t3,$0,0xaa55 addi $s1,$0,0x0300 addi $t8,$0,1 sw $t8,0xfc60($0) sll $t8,$t8,1 chkram: addi $s0,$0,0xe1 lw $t7,0($t0) sw $t2,0($t0) lw $t4,0($t0) bne $t4,$t2,error sw $t3,0($t0) lw $t4,0($t0) bne $t4,$t3,error sw $t7,0($t0) beq $t0,$t1,chkkey addi $t0,$t0,4 sw $t0,0xfc50($0) j chkram chkkey: sw $t8,0xfc60($0) sll $t8,$t8,1 addi $s0,$0,0xe2 lw $t0,0xfc12($0) andi $t0,$t0,1 bne $t0,$0,error chkdisp: sw $t8,0xfc60($0) sll $t8,$t8,1 addi $s1,$0,0xffff andi $t0,$0,0 addi $t1,$0,16 addi $t5,$0,0 disp: addi $t2,$0,0xffff srl $t2,$t2,11 sw $t0,0xfc00($0) sw $t0,0xfc02($0) sw $s1,0xfc04($0) lop: addi $t2,$t2,-1 sw $t0,0xfc50($0) bne $t2,$0,lop sw $t8,0xfc60($0) sll $t8,$t8,1 addi $t0,$t0,0x1111 addi $t5,$t5,1 bne $t5,$t1,disp lw $t1,0xfc70($0) sw $t1,0xfc60($0) sw $0,0xfc00($0) sw $0,0xfc02($0) sw $0,0xfc04($0) j 0x8000 error: sw $s0,0xfc00($0) sw $s1,0xfc04($0) addi $t5,$0,0xffff sw $t5,0xfc60($0) loop: sw $t0,0xfc50($0) j loop
18.776119
26
0.54531
a4eec35667bb2f0aa5c047920d20f50c593b65d2
7,501
asm
Assembly
asm/memcpy.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
asm/memcpy.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
asm/memcpy.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
; Performance for copying a 100000 bytes buffer for all the versions (lower is better) : ; 386 : 32210/10185 = 3.16 ; SSE : 11108/10042 = 1.11 ; std version : 10086/10036 = 1.00 ; SSE2 : 10380/10607 = 0.98 ; AVX : 7632/9294 = 0.82 ; Calculated by using the clocks taken by the algorithm divided by the clocks taken by the std version global @ASM_memcpy@12 extern _getInstructionSet segment .data align=16 actualASM_memcpyPtr dd actualASM_memcpyGetPtr segment .text align=16 %define destination ecx %define source edx %define result eax %define length 4 %define regLength ecx actualASM_memcpy386: push ebp mov result, destination push edi push esi push ebx sub esp, 4 mov regLength, dword [esp + 20 + length] test regLength, regLength je .return mov esi, source mov edx, result or edx, esi and edx, 3 jne .doMovsb lea ebp, [regLength - 1] cmp ebp, 3 jbe .doMovsb mov edx, regLength mov ebx, esi mov edi, result mov dword [esp], result and edx, -4 add edx, esi .dwordLoop: mov eax, dword [ebx] add ebx, 4 add edi, 4 mov dword [edi - 4], eax cmp ebx, edx jne .dwordLoop mov eax, dword [esp] mov ebx, ecx and ebx, -4 add esi, ebx sub ebp, ebx lea edi, [eax + ebx] cmp ecx, ebx je .return movzx ecx, byte [esi] mov byte [edi], cl test ebp, ebp je .return movzx edx, byte [esi + 1] mov byte [edi + 1], dl cmp ebp, 1 je .return movzx ebx, byte [esi + 2] mov byte [edi + 2], bl .return: add esp, 4 pop ebx pop esi pop edi pop ebp ret 4 .doMovsb: add ecx, result mov edi, result .movsbLoop: movsb cmp edi, ecx jne .movsbLoop add esp, 4 pop ebx pop esi pop edi pop ebp ret 4 align 16 %define regLength ecx actualASM_memcpySSE: push ebp mov result, destination push edi push esi push ebx mov regLength, dword [esp + 16 + length] test regLength, regLength je .return mov esi, source mov edx, result or edx, esi and edx, 15 jne .doMovsb lea ebx, [regLength - 1] cmp ebx, 14 jbe .doMovsb mov ebp, regLength mov edx, esi mov edi, result and ebp, -16 add ebp, esi .xmmLoop: movaps xmm0, oword [edx] add edx, 16 add edi, 16 movaps oword [edi - 16], xmm0 cmp edx, ebp jne .xmmLoop mov ebp, regLength and ebp, -16 lea edi, [eax + ebp] sub edx, ebp lea esi, [esi + ebp] cmp ecx, ebp je .return movzx ecx, byte [esi] mov byte [edi], cl test ebx, ebx je .return %macro doTrailingByteSSEedx 1 movzx edx, byte [esi + %1] mov byte [edi + %1], dl cmp ecx, %1 je .return %endmacro %macro doTrailingByteSSEecx 1 movzx ecx, byte [esi + %1] mov byte [edi + %1], cl cmp ecx, %1 je .return %endmacro doTrailingByteSSEedx 1 doTrailingByteSSEecx 2 doTrailingByteSSEedx 3 doTrailingByteSSEecx 4 doTrailingByteSSEedx 5 doTrailingByteSSEecx 6 doTrailingByteSSEedx 7 doTrailingByteSSEecx 8 doTrailingByteSSEedx 9 doTrailingByteSSEecx 10 doTrailingByteSSEedx 11 doTrailingByteSSEecx 12 doTrailingByteSSEedx 13 movzx ebx, byte [esi + 14] mov byte [edi + 14], bl .return: pop ebx pop esi pop edi pop ebp ret 4 .doMovsb: add ecx, result mov edi, result .movsbLoop: movsb cmp edi, ecx jne .movsbLoop pop ebx pop esi pop edi pop ebp ret 4 align 16 %define regLength edi actualASM_memcpySSE2: push ebp mov result, destination push edi push esi push ebx mov regLength, dword [esp + 16 + length] test regLength, regLength je .return lea ebx, [regLength - 1] cmp ebx, 14 jbe .noXmm mov ebp, edi mov ecx, edx mov esi, eax and ebp, -16 add ebp, edx .xmmLoop: movdqu xmm0, oword [ecx] add ecx, 16 add esi, 16 movups oword [esi - 16], xmm0 cmp ecx, ebp jne .xmmLoop mov ecx, edi and ecx, -16 lea esi, [result + ecx] add edx, ecx sub edx, ecx cmp edi, ecx je .return .doTrailingBytes: movzx ecx, byte [edx] mov byte [esi], cl test ebx, ebx je .return %macro doTrailingByteSSE2 1 movzx ecx, byte [edx + %1] mov byte [esi + %1], cl cmp ebx, %1 je .return %endmacro doTrailingByteSSE2 1 doTrailingByteSSE2 2 doTrailingByteSSE2 3 doTrailingByteSSE2 4 doTrailingByteSSE2 5 doTrailingByteSSE2 6 doTrailingByteSSE2 7 doTrailingByteSSE2 8 doTrailingByteSSE2 9 doTrailingByteSSE2 10 doTrailingByteSSE2 11 doTrailingByteSSE2 12 doTrailingByteSSE2 13 movzx edx, byte [edx + 14] mov byte [esi + 14], dl .return: pop ebx pop esi pop edi pop ebp ret 4 .noXmm: mov esi, destination jmp .doTrailingBytes align 16 %define regLength edi actualASM_memcpyAVX: push ebp mov ebp, esp push edi push esi push ebx and esp, -32 sub esp, 32 mov result, destination mov regLength, dword [ebp + 4 + length] lea ebx, [regLength - 1] mov dword [esp + 28], ebx test regLength, regLength je .return mov esi, source cmp ebx, 30 jbe .lessThan32 and regLength, -32 add regLength, source .avxLoop: vmovdqu ymm0, yword [source] vmovdqu yword [destination], ymm0 add source, 32 add destination, 32 cmp source, regLength jne .avxLoop mov ebx, dword [ebp + 4 + length] and ebx, -32 lea edi, [result + ebx] add esi, ebx sub dword [esp + 28], ebx vzeroupper cmp dword [ebp + 4 + length], ebx je .return .doMovsb: mov edx, dword [esp + 28] lea ecx, [esi + edx + 1] .movsbLoop: movsb cmp esi, ecx jne .movsbLoop .return: lea esp, [ebp - 12] pop ebx pop esi pop edi pop ebp ret 4 .lessThan32: mov edi, destination jmp .doMovsb align 16 %define SSESupported 3 %define SSE2Supported 4 %define AVXSupported 11 @ASM_memcpy@12: jmp dword [actualASM_memcpyPtr] align 16 actualASM_memcpyGetPtr: push ebx sub esp, 24 mov dword [esp + 12], destination mov dword [esp + 8], source mov ebx, dword [esp + 28 + length] call _getInstructionSet cmp eax, SSESupported - 1 mov source, dword [esp + 8] mov destination, dword [esp + 12] jg .not386 mov dword [actualASM_memcpyPtr], actualASM_memcpy386 jmp .doJmp .not386: cmp eax, SSE2Supported - 1 jne .notSSE mov dword [actualASM_memcpyPtr], actualASM_memcpySSE jmp .doJmp .notSSE: cmp eax, AVXSupported - 1 jg .notSSE2 mov dword [actualASM_memcpyPtr], actualASM_memcpySSE2 jmp .doJmp .notSSE2: mov dword [actualASM_memcpyPtr], actualASM_memcpyAVX .doJmp: mov dword [esp + 28 + length], ebx add esp, 24 pop ebx jmp dword [actualASM_memcpyPtr]
17.566745
103
0.583389
e5421e06b2fe68ccbc0f1f45e5257da9b3069763
586
asm
Assembly
programs/oeis/066/A066211.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/066/A066211.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/066/A066211.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A066211: a(n) = Sum_{j=0..n} (2*n)!/(2*n-j)!. ; 1,3,17,157,2081,36101,773665,19726085,582913217,19582414021,736891600001,30699450566885,1402556105125345,69719685409234277,3745929254826233441,216310377722912693701,13359435408855851031425,878701820865582786218885,61320957119042580664595137,4525280594748425506670362661,352095792080402162190469751201,28806813296345629102651925968165,2472297892863347223825749800568225,222088491494731167434265412104225797 add $0,1 mov $2,$0 lpb $0 sub $0,1 add $1,1 mul $1,$2 add $2,1 mov $3,$0 cmp $3,0 add $0,$3 lpe add $1,1 mov $0,$1
34.470588
407
0.793515
e804aeee9d03ed793004f6c6538259ea27c9bd87
147
asm
Assembly
libsrc/_DEVELOPMENT/font/fzx/fonts/kk/_ff_kk_MischkeBLatin1.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/font/fzx/fonts/kk/_ff_kk_MischkeBLatin1.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/font/fzx/fonts/kk/_ff_kk_MischkeBLatin1.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION rodata_font SECTION rodata_font_fzx PUBLIC _ff_kk_MischkeBLatin1 _ff_kk_MischkeBLatin1: BINARY "font/fzx/fonts/kk/MischkeB_Latin1.fzx"
14.7
46
0.857143
a4d2295ed727da7369d935af2126985a20ec9221
504
asm
Assembly
oeis/319/A319200.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/319/A319200.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/319/A319200.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A319200: a(n) = -(A(n) - A(n-1)) where A(n) = A057597(n+1), for n >= 0. ; Submitted by Simon Strandgaard ; 0,-1,2,-1,-2,5,-4,-3,12,-13,-2,27,-38,9,56,-103,56,103,-262,215,150,-627,692,85,-1404,2011,-522,-2893,5426,-3055,-5264,13745,-11536,-7473,32754,-36817,-3410,72981,-106388,29997,149372,-285757,166382,268747,-720886,618521,371112,-1710519,1957928,123703,-3792150 mov $3,1 lpb $0 sub $0,1 add $1,$3 sub $3,$1 add $1,$3 add $1,$2 sub $2,$1 add $3,$2 lpe add $0,$1 sub $4,$0 mov $0,$4
28
262
0.613095
f9c5553fcecc1b01b12e2301bd7ba70689bdee6b
560
asm
Assembly
oeis/017/A017486.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/017/A017486.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/017/A017486.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A017486: a(n) = (11*n + 8)^2. ; 64,361,900,1681,2704,3969,5476,7225,9216,11449,13924,16641,19600,22801,26244,29929,33856,38025,42436,47089,51984,57121,62500,68121,73984,80089,86436,93025,99856,106929,114244,121801,129600,137641,145924,154449,163216,172225,181476,190969,200704,210681,220900,231361,242064,253009,264196,275625,287296,299209,311364,323761,336400,349281,362404,375769,389376,403225,417316,431649,446224,461041,476100,491401,506944,522729,538756,555025,571536,588289,605284,622521,640000,657721,675684,693889,712336 mul $0,11 add $0,8 pow $0,2
80
498
0.803571
9a8a76fba5b081b0cbe1ca6b9f8d385d49e48494
296
asm
Assembly
programs/oeis/032/A032793.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/032/A032793.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/032/A032793.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A032793: Numbers that are congruent to {1, 2, 4} mod 5. ; 1,2,4,6,7,9,11,12,14,16,17,19,21,22,24,26,27,29,31,32,34,36,37,39,41,42,44,46,47,49,51,52,54,56,57,59,61,62,64,66,67,69,71,72,74,76,77,79,81,82,84,86,87,89,91,92,94,96,97,99,101,102,104,106,107,109 mul $0,5 mov $1,$0 div $1,3 add $1,1
37
199
0.64527
76295f94a2b27398b2fa9e9551d563b68396e9aa
18,399
asm
Assembly
U9200/Tests/CpuTest.asm
sboydlns/univacemulators
c630b2497bee9cb9a18b4fa05be9157d7161bca3
[ "MIT" ]
2
2021-02-09T21:54:54.000Z
2021-09-04T03:30:50.000Z
U9200/Tests/CpuTest.asm
sboydlns/univacemulators
c630b2497bee9cb9a18b4fa05be9157d7161bca3
[ "MIT" ]
null
null
null
U9200/Tests/CpuTest.asm
sboydlns/univacemulators
c630b2497bee9cb9a18b4fa05be9157d7161bca3
[ "MIT" ]
null
null
null
START DS CL5 * * TEST1 - load, store and add half word * TEST2 - subtract half word * TEST3 - compare half word * TEST4 - logical instructions TM, NI, OI * TEST5 - logical instructions CLI, MVI, AI * TEST6 - character instructions MVC, CLC, TR, MVN * TEST7 - character instructins NC, OC * TEST8 - decimal instructions PACK, UNPK * TEST9 - decimal instructions CP, AP * TEST10 - decimal instructions SP * TEST11 - decimal instructions MP, DP, ZAP * TEST12 - decimal instructions MVO, ED * TEST13 - branch and link BAL * TEST255 - execute all tests * TEST DS XL1 DS CL12 * * Address of first instruction executed after load (STRT) * DC XL2'0080' DS XL2 * * Instruction executed after Clear - Start * B RSET * DS CL102 * * Halt and wait for operator to enter test # at address 5 * STRT HPR X'0001' MVI ALLT,0 LOOP CLI TEST,1 BEQ TST1 CLI TEST,2 BEQ TST2 CLI TEST,3 BEQ TST3 CLI TEST,4 BEQ TST4 CLI TEST,5 BEQ TST5 CLI TEST,6 BEQ TST6 CLI TEST,7 BEQ TST7 CLI TEST,8 BEQ TST8 CLI TEST,9 BEQ TST9 CLI TEST,10 BEQ TSTA CLI TEST,11 BEQ TSTB CLI TEST,12 BEQ TSTC CLI TEST,13 BEQ TSTD CLI TEST,255 BEQ ALL * Invalid test # B STRT * * Do all tests * ALL MVI ALLT,1 MVI TEST,1 B LOOP * * TEST 1 - Test all half word instructions for basic functionality * * Load a value and make sure it loaded properly TST1 LH 8,ONE CH 8,ONE BEQ T11 HPR X'0101' R8 <> X'0001' - FAIL B STRT * Store a value and make sure it stored properly T11 STH 8,TMP1 LH 9,TMP1 CH 9,ONE BEQ T12 HPR X'0102' R9 <> X'0001' - FAIL B STRT * Add two numbers checking all possible condition codes T12 LH 8,ONE AH 8,TWO BP T13 HPR X'0103' R8 NOT POSITIVE - FAIL B STRT T13 CH 8,THRE BEQ T14 HPR X'0104' R8 <> X'0003' - FAIL B STRT T14 LH 8,ONE AH 8,NEG1 BZ T15 HPR X'0105' R8 <> X'0000' - FAIL B STRT T15 LH 8,ZERO AH 8,NEG1 BM T16 HPR X'0106' R8 NOT NEGATIVE - FAIL B STRT T16 CH 8,NEG1 BEQ T17 HPR X'0107' R8 <> X'FFFF' - FAIL B STRT T17 LH 8,MAXH AH 8,ONE BOV T18 HPR X'0108' NO OVERFLOW - FAIL B STRT T18 CH 8,MINH BEQ T19 HPR X'0109' R8 <> X'8000' - FAIL B STRT T19 LH 8,MINH AH 8,NEG1 BOV T1A HPR X'010A' NO OVERFLOW - FAIL B STRT T1A CH 8,MAXH BEQ T1B HPR X'010B' R8 <> X'07FFF' - FAIL B STRT T1B B DONE * * TEST 2 - Subtract two numbers checking all possible condition codes * TST2 LH 8,TWO SH 8,ONE BP T21 HPR X'0201' NOT POSITIVE - FAIL B STRT T21 CH 8,ONE BEQ T22 HPR X'0202' NOT = X'0001' - FAIL B STRT T22 LH 8,ONE SH 8,ONE BZ T23 HPR X'0203' NOT = ZERO - FAIL B STRT T23 LH 8,ZERO SH 8,ONE BM T24 HPR X'0204' NOT NEGATIVE - FAIL T24 CH 8,NEG1 BEQ T25 HPR X'0205' NOT = X'FFFF' - FAIL B STRT T25 LH 8,MAXH SH 8,NEG1 BOV T26 HPR X'0206' NOT OVERFLOW - FAIL B STRT T26 CH 8,MINH BEQ T27 HPR X'0207' NOT = X'8000' - FAIL B STRT T27 LH 8,MINH SH 8,ONE BOV T28 HPR X'0208' NOT OVERFLOW - FAIL T28 CH 8,MAXH BEQ T29 HPR X'0209 NOT = X'07FFF' - FAIL B STRT T29 LH 8,NEG8 SH 8,NEG9 BC 14,T2A HPR X'0209' OVERFLOW FAIL T2A B DONE * * TEST 3 - Check all combinations of compare half word * TST3 LH 8,ONE CH 8,TWO BLT T31 HPR X'0301' NOT < - FAIL B STRT T31 LH 8,TWO CH 8,ONE BGT T32 HPR X'0302' NOT > - FAIL B STRT T32 LH 8,ONE CH 8,ONE BEQ T33 NOT = - FAIL HPR X'0303' B STRT T33 B DONE * * TEST 4 - Check logical instructions TM, NI, OI * TST4 TM XFF,X'55' BC 1,T41 HPR X'0401' TEST FOR ALL ONES MATCH FAILED B STRT T41 TM ZERO,X'55' BC 8,T42 HPR X'0402' TEST FOR NO ONES MATCH FAILED B STRT T42 TM X50,X'55' BC 4,T43 HPR X'0403' TEST FOR SOME ONES MATCH FAILED B STRT T43 LH 8,NEG1 STH 8,TMP1 NI TMP1,X'55' BC 4,T44 HPR X'0404' NOT SOME ONES - FAILED B STRT T44 CLI TMP1,X'55' BEQ T45 HPR X'0405' NOT X'55' - FAILED B STRT T45 NI TMP1,X'AA' BC 8,T46 HPR X'0406' NOT ALL ZEROS - FAILED B STRT T46 CLI TMP1,X'00' BEQ T47 HPR X'0407' NOT = ZERO - FAILED B STRT T47 LH 8,ZERO STH 8,TMP1 OI TMP1,X'00' BC 8,T48 HPR X'0408' NOT ALL ZERO - FAILED B STRT T48 CLI TMP1,X'00' BEQ T49 HPR X'0409' NOT = ZERO - FAILED B STRT T49 OI TMP1,X'55' BC 4,T4A HPR X'040A' NOT SOME ONES - FAILED B STRT T4A CLI TMP1,X'55' BEQ T4B HPR X'040B' NOT = X'55' - FAILED B STRT T4B B DONE * * TEST 5 - CLI, MVI, AI * TST5 MVI TMP1,X'80' CLI TMP1,X'80' BEQ T51 HPR X'0501' NOT = X'80' FAIL B STRT T51 CLI TMP1,X'7F' BGT T52 HPR 'X0502' NOT > - FAIL B STRT T52 CLI TMP1,X'81' BLT T53 HPR X'0503' NOT < - FAIL B STRT T53 LH 8,ZERO STH 8,TMP1 AI TMP1,X'01' BP T54 HPR X'0504' NOT POSITIVE - FAIL B STRT T54 LH 8,TMP1 CH 8,ONE BEQ T55 HPR X'0505' NOT = ONE - FAIL B STRT T55 AI TMP1,X'FF' BZ T56 HPR X'0506' NOT ZERO - FAIL B STRT T56 LH 8,TMP1 CH 8,ZERO BEQ T57 HPR X'0507' NOT = ZERO - FAIL B STRT T57 AI TMP1,X'FF' BM T58 HPR X'0508' NOT NEGATIVE - FAIL B STRT T58 LH 8,TMP1 CH 8,NEG1 BEQ T59 HPR X'0509' B STRT T59 B DONE * * TEST 6 - MVC, CLC, TR, MVN * TST6 MVC TMP2,ABC CLC TMP2,ABC BEQ T61 HPR X'0601' NOT = - FAIL B STRT T61 CLC TMP2,BCD BLT T62 HPR X'0602' NOT < - FAIL B STRT T62 CLC BCD,TMP2 BGT T63 HPR X'0603' NOT > - FAIL B STRT T63 MVC TMP2,XLT TR TMP2,ABC CLC TMP2,ABC BEQ T64 HPR X'0604' NOT = - FAIL B STRT T64 MVC TMP2(5),MVN1 MVN TMP2(5),MVN2 CLC TMP2(5),MVN2 BEQ T65 HPR X'0605' B STRT T65 B DONE * * TEST7 - character instruction NC, OC * TST7 MVC TMP1,ZERO NC TMP1,ONE BC 8,T71 HPR X'0701' NOT ALL ZERO - FAIL B STRT T71 CLC TMP1,ZERO BEQ T72 HPR X'0702' NOT = ZERO - FAIL B STRT T72 MVC TMP1,ONE NC TMP1,THRE BC 4,T73 HPR X'0703' NOT SOME ONES - FAIL B STRT T73 CLC TMP1,ONE BEQ T74 HPR X'0704' NOT = 1 - FAIL B STRT T74 MVC TMP1,ZERO OC TMP1,ZERO BC 8,T75 HPR X'0705' NOT ALL ZERO - FAIL B STRT T75 CLC TMP1,ZERO BEQ T76 HPR X'0706' NOT = ZERO - FAIL B STRT T76 MVC TMP1,ZERO OC TMP1,ONE BC 4,T77 HPR X'0707' NOT SOME ONES - FAIL T77 CLC TMP1,ONE BEQ T78 HPR X'0708' NOT = 1 - FAIL B STRT T78 B DONE * * TEST8 - decimal instructions PACK, UNPK * TST8 PACK TMP3,ZONE CLC TMP3,P3 BEQ T81 HPR X'0801' B STRT T81 PACK TMP4,ZONE CLC TMP4,P4 BEQ T82 HPR X'0802' B STRT T82 PACK TMP5,ZONE CLC TMP5,P5 BEQ T83 HPR X'0803' B STRT T83 UNPK TMP5,P4 CLC TMP5,Z5 BEQ T84 HPR X'0804' B STRT T84 UNPK TMP6,P4 CLC TMP6,Z6 BEQ T85 HPR X'0805' B STRT T85 UNPK TMP7,P4 CLC TMP7,Z7 BEQ T86 HPR X'0806' B STRT T86 B DONE * * TEST9 - decimal instructions CP, AP * TST9 CP P3,P3 BEQ T91 HPR X'0901' NOT = - FAIL B STRT T91 CP P3H,P3 BGT T92 HPR X'0902' NOT > - FAIL B STRT T92 CP P3L,P3 BLT T93 HPR X'0903' NOT < - FAIL B STRT T93 MVC TMP3,PONE AP TMP3,PTWO BP T94 HPR X'0904' NOT POSITIVE - FAIL B STRT T94 CP TMP3,PTHR BEQ T95 HPR X'0905' NOT = 3 - FAIL B STRT T95 MVC TMP3,PONE AP TMP3,PNG1 BZ T96 HPR X'0906' NOT ZERO - FAIL B START T96 MVC TMP3,PZRO AP TMP3,PNG1 BM T97 HPR X'0907' NOT NEGATIVE - FAIL B STRT T97 CP TMP3,PNG1 BEQ T98 HPR X'0908' NOT = -1 - FAIL B STRT T98 MVC TMP3,PMAX AP TMP3,PONE BOV T99 HPR X'0909' NOT OVERFLOW - FAIL B STRT T99 CP TMP3,PZRO BEQ T9A HPR X'090A' NOT = ZERO - FAIL B STRT T9A MVC TMP3,PMIN AP TMP3,PNG1 BOV T9B HPR X'090B' NOT OVERFLOW - FAIL B STRT T9B CP TMP3,PZRO BEQ T9C HPR X'090C' NOT = ZERO - FAIL B STRT T9C B DONE * * TEST10 - decimal instructions SP * TSTA MVC TMP3,PTWO SP TMP3,PONE BP TA1 HPR X'0A01' NOT POSITIVE - FAIL B STRT TA1 CP TMP3,PONE BEQ TA2 HPR X'0A02' NOT = 1 - FAIL B STRT TA2 MVC TMP3,PONE SP TMP3,PONE BZ TA3 HPR X'0A03' NOT ZERO - FAIL B STRT TA3 MVC TMP3,PZRO SP TMP3,PONE BM TA4 HPR X'0A04' NOT NEGATIVE - FAIL B STRT TA4 CP TMP3,PNG1 BEQ TA5 HPR X'0A05' NOT = -1 - FAIL B STRT TA5 MVC TMP3,PMAX SP TMP3,PNG1 BOV TA6 HPR X'0A06' NOT OVERFLOW - FAIL B STRT TA6 CP TMP3,PZRO BEQ TA7 HPR X'0A07' NOT = ZERO - FAIL B STRT TA7 MVC TMP3,PMIN SP TMP3,PONE BOV TA8 HPR X'0A08' NOT OVERFLOW - FAIL B STRT TA8 CP TMP3,PZRO BEQ TA9 HPR X'0A08' NOT = ZERO - FAIL B STRT TA9 B DONE * * TEST11 - decimal instructions MP, DP, ZAP * TSTB ZAP TMP5,PTWO MP TMP5,PTWO CP TMP5,PFOR BEQ TB1 HPR X'0B01' NOT = 4 - FAIL B STRT TB1 ZAP TMP5,PTWO MP TMP5,PNG1 CP TMP5,PNG2 BEQ TB2 HPR X'0B02' NOT = -2 - FAIL B STRT TB2 ZAP TMP5,PFOR DP TMP5,PTWO CP TMP5(2),PTWO BEQ TB3 HPR X'0B03' NOT = 2 - FAIL B STRT TB3 CP TMP5+2(2),PZRO BEQ TB4 HPR X'0B04' NOT = ZERO - FAIL B STRT TB4 ZAP TMP5,PFOR DP TMP5,PNG2+2(2) CP TMP5(2),PNG2+2(2) BEQ TB5 HPR X'0B05' NOT = -2 - FAIL B STRT TB5 CP TMP5+2(2),PZRO BEQ TB6 HPR X'0B06' NOT = ZERO - FAIL B STRT TB6 B DONE * * TEST12 - decimal instructions MVO, ED * TSTC ZAP TMP5,PZRO MVO TMP5,PONE NC TMP5+3(1),X0F CP TMP5,PTEN BEQ TC1 HPR X'0C01' NOT = - FAIL B STRT TC1 MVC TMP8,ED1 ED TMP8,P4 BP TC2 HPR X'0C02' NOT POSITIVE - FAIL B STRT TC2 CLC TMP8,ERS1 BEQ TC3 INCORRECT RESULT - FAIL HPR X'0C03' B STRT TC3 MVC TMP8,ED1 ED TMP8,P4NG BM TC4 HPR X'0C04' NOT NEGATIVE - FAIL B STRT TC4 CLC TMP8,ERS2 BEQ TC5 HPR X'0C05' INCORRECT RESULT - FAIL B STRT TC5 MVC TMP8,ED1 ED TMP8,PZR3 BZ TC6 HPR X'0C06' NOT ZERO - FAIL B STRT TC6 CLC TMP8,ERS3 BEQ TC7 HPR X'0C07' INCORRECT RESULT - FAIL B STRT TC7 MVO P4,P4 TEST OVERLAPPING FIELDS CLC P4,P4O BEQ TC8 HPR X'0C07' B STRT TC8 B DONE * * TEST13 - brank and link BAL * TSTD BAL 8,BAL1 CLI TMP1,X'55' BEQ TD1 HPR X'0D01' B STRT TD1 B DONE BAL1 MVI TMP1,X'55' B 0(,8) * Test successful, notify operator DONE CLI ALLT,1 BNE STOP AI TEST-1,1 B LOOP STOP HPR X'0002' TEST SUCCESSFUL B STRT * * Test Clear - Start (reset) functionality * RSET HPR X'7FFF' B STRT ZERO DC XL2'0' ONE DC XL2'1' TWO DC XL2'2' THRE DC XL2'3' NEG1 DC XL2'FFFF' MAXH DC XL2'7FFF' MINH DC XL2'8000' TMP1 DS XL2 X50 DC XL1'50' XFF DC XL1'FF' ABC DC CL16'ABCDEF0123456789' BCD DC CL16'BCDEF01234567899' XLT DC XL16'000102030405060708090A0B0C0D0E0F' MVN1 DC CL5'ABCDE' MVN2 DC CL5'EDCBA' TMP2 DS CL16 ZONE DC CL5'12345' TMP3 DS XL2 TMP4 DS XL3 TMP5 DS XL4 TMP6 DS XL5 TMP7 DS XL6 TMP8 DS CL8 P3 DC XL2'345F' P3H DC XL2'456F' P3L DC XL2'234F' P4 DC XL3'12345F' P4O DC XL3'2345FF' P4NG DC XL3'12345D' P5 DC XL4'0012345F' Z5 DC CL4'2345' Z6 DC CL5'12345' Z7 DC CL6'012345' PONE DC XL2'001C' PTWO DC XL2'002C' PTHR DC XL2'003C' PFOR DC XL4'0000004C' PTEN DC XL4'0000010C' PZRO DC XL2'000C' PZR3 DC XL3'00000C' PNG1 DC XL2'001D' PNG2 DC XL4'0000002D' PMAX DC XL2'999C' PMIN DC XL2'999D' X0F DC XL1'0F' ED1 DC CL1' ' DC XL2'2020' DC CL1',' DC XL3'202120' DC CL1'-' ERS1 DC CL8' 12,345 ' ERS2 DC CL8' 12,345-' ERS3 DC CL8' 0 ' ALLT DC XL1'0' NEG8 DC XL2'8002' NEG9 DC XL2'8000' END STRT
27.793051
81
0.387847
f12b1e0c7a68d3a0ef88c0e46a6691f29e28d9c6
37,869
asm
Assembly
data/pokemon/evos_attacks_sinnoh.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/pokemon/evos_attacks_sinnoh.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/pokemon/evos_attacks_sinnoh.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
SECTION "Evolutions and Attacks 4", ROMX EvosAttacksPointers4:: dw TurtwigEvosAttacks dw GrotleEvosAttacks dw TorterraEvosAttacks dw ChimcharEvosAttacks dw MonfernoEvosAttacks dw InfernapeEvosAttacks dw PiplupEvosAttacks dw PrinplupEvosAttacks dw EmpoleonEvosAttacks dw StarlyEvosAttacks dw StaraviaEvosAttacks dw StaraptorEvosAttacks dw BidoofEvosAttacks dw BibarelEvosAttacks dw KricketotEvosAttacks dw KricketuneEvosAttacks dw ShinxEvosAttacks dw LuxioEvosAttacks dw LuxrayEvosAttacks dw BudewEvosAttacks dw RoseradeEvosAttacks dw CranidosEvosAttacks dw RampardosEvosAttacks dw ShieldonEvosAttacks dw BastiodonEvosAttacks dw BurmyEvosAttacks dw WormadamEvosAttacks dw MothimEvosAttacks dw CombeeEvosAttacks dw VespiquenEvosAttacks dw PachirisuEvosAttacks dw BuizelEvosAttacks dw FloatzelEvosAttacks dw CherubiEvosAttacks dw CherrimEvosAttacks dw ShellosEvosAttacks dw GastrodonEvosAttacks dw AmbipomEvosAttacks dw DrifloonEvosAttacks dw DrifblimEvosAttacks dw BunearyEvosAttacks dw LopunnyEvosAttacks dw MismagiusEvosAttacks dw HonchkrowEvosAttacks dw GlameowEvosAttacks dw PuruglyEvosAttacks dw ChinglingEvosAttacks dw StunkyEvosAttacks dw SkuntankEvosAttacks dw BronzorEvosAttacks dw BronzongEvosAttacks dw BonslyEvosAttacks dw MimeJrEvosAttacks dw HappinyEvosAttacks dw ChatotEvosAttacks dw SpiritombEvosAttacks dw GibleEvosAttacks dw GabiteEvosAttacks dw GarchompEvosAttacks dw MunchlaxEvosAttacks dw RioluEvosAttacks dw LucarioEvosAttacks dw HippopotasEvosAttacks dw HippowdonEvosAttacks dw SkorupiEvosAttacks dw DrapionEvosAttacks dw CroagunkEvosAttacks dw ToxicroakEvosAttacks dw CarnivineEvosAttacks dw FinneonEvosAttacks dw LumineonEvosAttacks dw MantykeEvosAttacks dw SnoverEvosAttacks dw AbomasnowEvosAttacks dw WeavileEvosAttacks dw MagnezoneEvosAttacks dw LickilickyEvosAttacks dw RhyperiorEvosAttacks dw TangrowthEvosAttacks dw ElectivireEvosAttacks dw MagmortarEvosAttacks dw TogekissEvosAttacks dw YanmegaEvosAttacks dw LeafeonEvosAttacks dw GlaceonEvosAttacks dw GliscorEvosAttacks dw MamoswineEvosAttacks dw PorygonZEvosAttacks dw GalladeEvosAttacks dw ProbopassEvosAttacks dw DusknoirEvosAttacks dw FroslassEvosAttacks dw RotomEvosAttacks dw UxieEvosAttacks dw MespritEvosAttacks dw AzelfEvosAttacks dw DialgaEvosAttacks dw PalkiaEvosAttacks dw HeatranEvosAttacks dw RegigigasEvosAttacks dw GiratinaEvosAttacks dw CresseliaEvosAttacks dw PhioneEvosAttacks dw ManaphyEvosAttacks dw DarkraiEvosAttacks dw ShayminEvosAttacks dw ArceusEvosAttacks TurtwigEvosAttacks: dbbw EVOLVE_LEVEL, 18, GROTLE db 0 ; no more evolutions dbw 1, TACKLE dbw 5, WITHDRAW dbw 9, ABSORB dbw 13, RAZOR_LEAF dbw 17, CURSE dbw 21, BITE dbw 25, MEGA_DRAIN dbw 29, LEECH_SEED dbw 33, SYNTHESIS dbw 37, CRUNCH dbw 41, GIGA_DRAIN dbw 45, LEAF_STORM db 0 ; no more level-up moves GrotleEvosAttacks: dbbw EVOLVE_LEVEL, 32, TORTERRA db 0 ; no more evolutions dbw 1, TACKLE dbw 1, WITHDRAW dbw 5, WITHDRAW dbw 9, ABSORB dbw 13, RAZOR_LEAF dbw 17, CURSE dbw 22, BITE dbw 27, MEGA_DRAIN dbw 32, LEECH_SEED dbw 37, SYNTHESIS dbw 42, CRUNCH dbw 47, GIGA_DRAIN dbw 52, LEAF_STORM db 0 ; no more level-up moves TorterraEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, ABSORB dbw 1, RAZOR_LEAF dbw 1, WITHDRAW dbw 1, WOOD_HAMMER dbw 5, WITHDRAW dbw 9, ABSORB dbw 13, RAZOR_LEAF dbw 17, CURSE dbw 22, BITE dbw 27, MEGA_DRAIN dbw 32, EARTHQUAKE dbw 33, LEECH_SEED dbw 39, SYNTHESIS dbw 45, CRUNCH dbw 51, GIGA_DRAIN dbw 57, LEAF_STORM db 0 ; no more level-up moves ChimcharEvosAttacks: dbbw EVOLVE_LEVEL, 14, MONFERNO db 0 ; no more evolutions dbw 1, SCRATCH dbw 1, LEER dbw 7, EMBER dbw 9, TAUNT dbw 15, FURY_SWIPES dbw 17, FLAME_WHEEL dbw 23, NASTY_PLOT dbw 25, TORMENT dbw 31, FACADE dbw 33, FIRE_SPIN dbw 39, SLACK_OFF dbw 41, FLAMETHROWER db 0 ; no more level-up moves MonfernoEvosAttacks: dbbw EVOLVE_LEVEL, 36, INFERNAPE db 0 ; no more evolutions dbw 1, SCRATCH dbw 1, LEER dbw 1, EMBER dbw 7, EMBER dbw 9, TAUNT dbw 14, MACH_PUNCH dbw 16, FURY_SWIPES dbw 19, FLAME_WHEEL dbw 26, FEINT dbw 29, TORMENT dbw 36, CLOSE_COMBAT dbw 39, FIRE_SPIN dbw 46, SLACK_OFF dbw 49, FLARE_BLITZ db 0 ; no more level-up moves InfernapeEvosAttacks: db 0 ; no more evolutions dbw 1, SCRATCH dbw 1, LEER dbw 1, EMBER dbw 1, TAUNT dbw 7, EMBER dbw 9, TAUNT dbw 14, MACH_PUNCH dbw 17, FURY_SWIPES dbw 21, FLAME_WHEEL dbw 29, FEINT dbw 33, PUNISHMENT dbw 41, CLOSE_COMBAT dbw 45, FIRE_SPIN dbw 53, CALM_MIND dbw 57, FLARE_BLITZ db 0 ; no more level-up moves PiplupEvosAttacks: dbbw EVOLVE_LEVEL, 16, PRINPLUP db 0 ; no more evolutions dbw 1, POUND dbw 4, GROWL dbw 8, BUBBLE dbw 11, WATER_SPORT dbw 15, PECK dbw 18, BUBBLEBEAM dbw 22, BIDE dbw 25, FURY_ATTACK dbw 29, BRINE dbw 32, WHIRLPOOL dbw 36, MIST dbw 39, DRILL_PECK dbw 43, HYDRO_PUMP db 0 ; no more level-up moves PrinplupEvosAttacks: dbbw EVOLVE_LEVEL, 36, EMPOLEON db 0 ; no more evolutions dbw 1, TACKLE dbw 1, GROWL dbw 4, GROWL dbw 8, BUBBLE dbw 11, WATER_SPORT dbw 15, PECK dbw 16, METAL_CLAW dbw 19, BUBBLEBEAM dbw 24, BIDE dbw 28, FURY_ATTACK dbw 33, BRINE dbw 37, WHIRLPOOL dbw 42, MIST dbw 46, DRILL_PECK dbw 51, HYDRO_PUMP db 0 ; no more level-up moves EmpoleonEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, GROWL dbw 1, BUBBLE dbw 4, GROWL dbw 8, BUBBLE dbw 11, SWORDS_DANCE dbw 15, PECK dbw 16, METAL_CLAW dbw 19, BUBBLEBEAM dbw 24, SWAGGER dbw 28, FURY_ATTACK dbw 33, BRINE dbw 36, AQUA_JET dbw 39, WHIRLPOOL dbw 46, MIST dbw 52, DRILL_PECK dbw 59, HYDRO_PUMP db 0 ; no more level-up moves StarlyEvosAttacks: dbbw EVOLVE_LEVEL, 34, STARAVIA db 0 ; no more evolutions dbw 1, TACKLE dbw 1, GROWL dbw 5, QUICK_ATTACK dbw 9, WING_ATTACK dbw 13, DOUBLE_TEAM dbw 17, ENDEAVOR dbw 21, WHIRLWIND dbw 25, AERIAL_ACE dbw 29, TAKE_DOWN dbw 33, AGILITY dbw 37, BRAVE_BIRD db 0 ; no more level-up moves StaraviaEvosAttacks: dbbw EVOLVE_LEVEL, 34, STARAPTOR db 0 ; no more evolutions dbw 1, TACKLE dbw 1, GROWL dbw 1, QUICK_ATTACK dbw 5, QUICK_ATTACK dbw 9, WING_ATTACK dbw 13, DOUBLE_TEAM dbw 18, ENDEAVOR dbw 23, WHIRLWIND dbw 28, AERIAL_ACE dbw 33, TAKE_DOWN dbw 38, AGILITY dbw 43, BRAVE_BIRD db 0 ; no more level-up moves StaraptorEvosAttacks: db 0 ; no more evolutions dbw 1, WING_ATTACK dbw 1, TACKLE dbw 1, GROWL dbw 1, QUICK_ATTACK dbw 5, QUICK_ATTACK dbw 9, WING_ATTACK dbw 13, DOUBLE_TEAM dbw 18, ENDEAVOR dbw 23, WHIRLWIND dbw 28, AERIAL_ACE dbw 33, TAKE_DOWN dbw 34, CLOSE_COMBAT dbw 41, AGILITY dbw 49, BRAVE_BIRD db 0 ; no more level-up moves BidoofEvosAttacks: dbbw EVOLVE_LEVEL, 15, BIBAREL db 0 ; no more evolutions dbw 1, TACKLE dbw 5, GROWL dbw 9, DEFENSE_CURL dbw 13, ROLLOUT dbw 17, HEADBUTT dbw 21, HYPER_FANG dbw 25, YAWN dbw 29, AMNESIA dbw 33, TAKE_DOWN dbw 37, SUPER_FANG dbw 41, SUPERPOWER dbw 45, CURSE db 0 ; no more level-up moves BibarelEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, GROWL dbw 5, GROWL dbw 9, DEFENSE_CURL dbw 13, ROLLOUT dbw 15, WATER_GUN dbw 18, HEADBUTT dbw 23, HYPER_FANG dbw 28, YAWN dbw 33, AMNESIA dbw 38, TAKE_DOWN dbw 43, SUPER_FANG dbw 48, SUPERPOWER dbw 53, CURSE db 0 ; no more level-up moves KricketotEvosAttacks: dbbw EVOLVE_LEVEL, 10, KRICKETUNE db 0 ; no more evolutions dbw 1, GROWL dbw 1, BIDE dbw 16, BUG_BITE db 0 ; no more level-up moves KricketuneEvosAttacks: db 0 ; no more evolutions dbw 1, GROWL dbw 1, BIDE dbw 10, FURY_CUTTER dbw 14, LEECH_LIFE dbw 18, SING dbw 22, FOCUS_ENERGY dbw 26, SLASH dbw 30, X_SCISSOR dbw 34, SCREECH dbw 38, TAUNT dbw 42, NIGHT_SLASH dbw 46, BUG_BUZZ dbw 50, PERISH_SONG db 0 ; no more level-up moves ShinxEvosAttacks: dbbw EVOLVE_LEVEL, 15, LUXIO db 0 ; no more evolutions dbw 1, TACKLE dbw 5, LEER dbw 9, CHARGE dbw 13, SPARK dbw 17, BITE dbw 21, ROAR dbw 25, SWAGGER dbw 29, THUNDER_FANG dbw 33, CRUNCH dbw 37, SCARY_FACE dbw 41, DISCHARGE db 0 ; no more level-up moves LuxioEvosAttacks: dbbw EVOLVE_LEVEL, 30, LUXRAY db 0 ; no more evolutions dbw 1, TACKLE dbw 1, LEER dbw 5, LEER dbw 9, CHARGE dbw 13, SPARK dbw 18, BITE dbw 23, ROAR dbw 28, SWAGGER dbw 33, THUNDER_FANG dbw 38, CRUNCH dbw 43, SCARY_FACE dbw 48, DISCHARGE db 0 ; no more level-up moves LuxrayEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, LEER dbw 1, CHARGE dbw 5, LEER dbw 9, CHARGE dbw 13, SPARK dbw 18, BITE dbw 23, ROAR dbw 28, SWAGGER dbw 35, THUNDER_FANG dbw 42, CRUNCH dbw 49, SCARY_FACE dbw 56, DISCHARGE db 0 ; no more level-up moves BudewEvosAttacks: dbbw EVOLVE_HAPPINESS, TR_MORNDAY, ROSELIA db 0 ; no more evolutions dbw 1, ABSORB dbw 4, GROWTH dbw 7, WATER_SPORT dbw 10, STUN_SPORE dbw 13, MEGA_DRAIN dbw 16, WORRY_SEED db 0 ; no more level-up moves RoseradeEvosAttacks: db 0 ; no more evolutions dbw 1, POISON_STING dbw 1, MEGA_DRAIN dbw 1, SWEET_SCENT dbw 1, WEATHER_BALL dbw 1, MAGICAL_LEAF db 0 ; no more level-up moves CranidosEvosAttacks: dbbw EVOLVE_LEVEL, 30, RAMPARDOS db 0 ; no more evolutions dbw 1, HEADBUTT dbw 1, LEER dbw 6, FOCUS_ENERGY dbw 10, PURSUIT dbw 15, TAKE_DOWN dbw 19, SCARY_FACE dbw 24, ASSURANCE dbw 28, ANCIENTPOWER dbw 33, ZEN_HEADBUTT dbw 37, SCREECH dbw 43, HEAD_SMASH db 0 ; no more level-up moves RampardosEvosAttacks: db 0 ; no more evolutions dbw 1, HEADBUTT dbw 1, LEER dbw 6, FOCUS_ENERGY dbw 10, PURSUIT dbw 15, TAKE_DOWN dbw 19, SCARY_FACE dbw 24, ASSURANCE dbw 28, ANCIENTPOWER dbw 30, ENDEAVOR dbw 36, ZEN_HEADBUTT dbw 43, SCREECH dbw 52, HEAD_SMASH db 0 ; no more level-up moves ShieldonEvosAttacks: dbbw EVOLVE_LEVEL, 30, BASTIODON db 0 ; no more evolutions dbw 1, TACKLE dbw 1, PROTECT dbw 6, TAUNT dbw 10, METAL_SOUND dbw 15, TAKE_DOWN dbw 19, IRON_DEFENSE dbw 24, SWAGGER dbw 28, ANCIENTPOWER dbw 33, ENDURE dbw 37, METAL_BURST dbw 43, IRON_HEAD db 0 ; no more level-up moves BastiodonEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, PROTECT dbw 1, TAUNT dbw 1, METAL_SOUND dbw 6, TAUNT dbw 10, METAL_SOUND dbw 15, TAKE_DOWN dbw 19, IRON_DEFENSE dbw 24, SWAGGER dbw 28, ANCIENTPOWER dbw 30, BLOCK dbw 36, ENDURE dbw 43, METAL_BURST dbw 52, IRON_HEAD db 0 ; no more level-up moves BurmyEvosAttacks: dbbw EVOLVE_LEVEL_AND_FEMALE, 20, WORMADAM dbbw EVOLVE_LEVEL_AND_MALE, 20, MOTHIM db 0 ; no more evolutions dbw 1, PROTECT dbw 10, TACKLE dbw 15, BUG_BITE dbw 20, HIDDEN_POWER db 0 ; no more level-up moves WormadamEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 10, PROTECT dbw 15, BUG_BITE dbw 20, HIDDEN_POWER dbw 23, CONFUSION dbw 26, RAZOR_LEAF dbw 29, GROWTH dbw 32, PSYBEAM dbw 35, CAPTIVATE dbw 38, FLAIL dbw 41, ATTRACT dbw 44, PSYCHIC_M dbw 47, LEAF_STORM db 0 ; no more level-up moves MothimEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 10, PROTECT dbw 15, BUG_BITE dbw 20, HIDDEN_POWER dbw 23, CONFUSION dbw 26, GUST dbw 29, POISONPOWDER dbw 32, PSYBEAM dbw 35, CAMOUFLAGE dbw 38, SILVER_WIND dbw 41, AIR_SLASH dbw 44, PSYCHIC_M dbw 47, BUG_BUZZ db 0 ; no more level-up moves CombeeEvosAttacks: dbbw EVOLVE_LEVEL_AND_FEMALE, 21, VESPIQUEN db 0 ; no more evolutions dbw 1, GUST dbw 1, SWEET_SCENT dbw 13, BUG_BITE db 0 ; no more level-up moves VespiquenEvosAttacks: db 0 ; no more evolutions dbw 1, GUST dbw 1, SWEET_SCENT dbw 3, POISON_STING dbw 7, CONFUSE_RAY dbw 9, FURY_CUTTER dbw 13, DEFEND_ORDER dbw 15, PURSUIT dbw 19, FURY_SWIPES dbw 21, POWER_GEM dbw 25, HEAL_ORDER dbw 27, TOXIC dbw 31, SLASH dbw 33, CAPTIVATE dbw 37, ATTACK_ORDER dbw 39, SWAGGER dbw 43, DESTINY_BOND db 0 ; no more level-up moves PachirisuEvosAttacks: db 0 ; no more evolutions dbw 1, GROWL dbw 1, BIDE dbw 5, QUICK_ATTACK dbw 9, CHARM dbw 13, SPARK dbw 17, ENDURE dbw 21, SWIFT dbw 25, SWEET_KISS dbw 29, DISCHARGE dbw 33, SUPER_FANG dbw 37, LAST_RESORT db 0 ; no more level-up moves BuizelEvosAttacks: dbbw EVOLVE_LEVEL, 26, FLOATZEL db 0 ; no more evolutions dbw 1, GROWL dbw 1, SONICBOOM dbw 1, WATER_SPORT dbw 3, QUICK_ATTACK dbw 6, WATER_GUN dbw 10, PURSUIT dbw 15, SWIFT dbw 21, AQUA_JET dbw 28, AGILITY dbw 36, WHIRLPOOL dbw 45, RAZOR_WIND db 0 ; no more level-up moves FloatzelEvosAttacks: db 0 ; no more evolutions dbw 1, GROWL dbw 1, SONICBOOM dbw 1, QUICK_ATTACK dbw 1, WATER_SPORT dbw 1, ICE_FANG dbw 3, QUICK_ATTACK dbw 6, WATER_GUN dbw 10, PURSUIT dbw 15, SWIFT dbw 21, AQUA_JET dbw 26, CRUNCH dbw 29, AGILITY dbw 39, WHIRLPOOL dbw 50, RAZOR_WIND db 0 ; no more level-up moves CherubiEvosAttacks: dbbw EVOLVE_LEVEL, 25, CHERUBI db 0 ; no more evolutions dbw 1, TACKLE dbw 7, GROWTH dbw 10, LEECH_SEED dbw 13, HELPING_HAND dbw 19, MAGICAL_LEAF dbw 22, SUNNY_DAY dbw 28, WORRY_SEED dbw 31, TAKE_DOWN dbw 37, SOLARBEAM dbw 40, LUCKY_CHANT db 0 ; no more level-up moves CherrimEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, GROWTH dbw 7, GROWTH dbw 10, LEECH_SEED dbw 13, HELPING_HAND dbw 19, MAGICAL_LEAF dbw 22, SUNNY_DAY dbw 25, PETAL_DANCE dbw 30, WORRY_SEED dbw 35, TAKE_DOWN dbw 43, SOLARBEAM dbw 48, LUCKY_CHANT db 0 ; no more level-up moves ShellosEvosAttacks: dbbw EVOLVE_LEVEL, 30, GASTRODON db 0 ; no more evolutions dbw 1, MUD_SLAP dbw 2, MUD_SPORT dbw 4, HARDEN dbw 7, WATER_PULSE dbw 11, MUD_BOMB dbw 16, HIDDEN_POWER dbw 22, RAIN_DANCE dbw 29, BODY_SLAM dbw 37, MUDDY_WATER dbw 46, RECOVER db 0 ; no more level-up moves GastrodonEvosAttacks: db 0 ; no more evolutions dbw 1, HARDEN dbw 1, MUD_SLAP dbw 1, MUD_SPORT dbw 1, WATER_PULSE dbw 2, MUD_SPORT dbw 4, HARDEN dbw 7, WATER_PULSE dbw 11, MUD_BOMB dbw 16, HIDDEN_POWER dbw 22, RAIN_DANCE dbw 29, BODY_SLAM dbw 41, MUDDY_WATER dbw 54, RECOVER db 0 ; no more level-up moves AmbipomEvosAttacks: db 0 ; no more evolutions dbw 1, SCRATCH dbw 1, SAND_ATTACK dbw 1, TAIL_WHIP dbw 1, ASTONISH dbw 4, SAND_ATTACK dbw 8, ASTONISH dbw 11, BATON_PASS dbw 15, TICKLE dbw 18, FURY_SWIPES dbw 22, SWIFT dbw 25, SCREECH dbw 29, AGILITY dbw 32, DOUBLE_HIT dbw 36, FLING dbw 39, NASTY_PLOT dbw 43, LAST_RESORT db 0 ; no more level-up moves DrifloonEvosAttacks: dbbw EVOLVE_LEVEL, 28, DRIFBLIM db 0 ; no more evolutions dbw 1, MINIMIZE dbw 1, CONSTRICT dbw 6, ASTONISH dbw 11, GUST dbw 14, FOCUS_ENERGY dbw 17, PAYBACK dbw 22, STOCKPILE dbw 27, SPIT_UP dbw 27, SWALLOW dbw 30, OMINOUS_WIND dbw 33, BATON_PASS dbw 38, SHADOW_BALL dbw 43, EXPLOSION db 0 ; no more level-up moves DrifblimEvosAttacks: db 0 ; no more evolutions dbw 1, GUST dbw 1, MINIMIZE dbw 1, CONSTRICT dbw 1, ASTONISH dbw 6, ASTONISH dbw 11, GUST dbw 14, FOCUS_ENERGY dbw 17, PAYBACK dbw 22, STOCKPILE dbw 27, SPIT_UP dbw 27, SWALLOW dbw 32, OMINOUS_WIND dbw 37, BATON_PASS dbw 44, SHADOW_BALL dbw 51, EXPLOSION db 0 ; no more level-up moves BunearyEvosAttacks: dbbw EVOLVE_HAPPINESS, TR_ANYTIME, LOPUNNY db 0 ; no more evolutions dbw 1, POUND dbw 1, DEFENSE_CURL dbw 1, SPLASH dbw 1, FORESIGHT dbw 6, ENDURE dbw 13, FRUSTRATION dbw 16, QUICK_ATTACK dbw 23, JUMP_KICK dbw 26, BATON_PASS dbw 33, AGILITY dbw 36, DIZZY_PUNCH dbw 43, CHARM dbw 46, BOUNCE dbw 53, HEALING_WISH db 0 ; no more level-up moves LopunnyEvosAttacks: db 0 ; no more evolutions dbw 1, POUND dbw 1, DEFENSE_CURL dbw 1, SPLASH dbw 1, FORESIGHT dbw 1, MIRROR_COAT dbw 1, MAGIC_COAT dbw 6, ENDURE dbw 13, RETURN dbw 16, QUICK_ATTACK dbw 23, JUMP_KICK dbw 26, BATON_PASS dbw 33, AGILITY dbw 36, DIZZY_PUNCH dbw 43, CHARM dbw 46, BOUNCE dbw 53, HEALING_WISH db 0 ; no more level-up moves MismagiusEvosAttacks: db 0 ; no more evolutions dbw 1, GROWL dbw 1, PSYWAVE dbw 1, SPITE dbw 1, ASTONISH dbw 1, MAGICAL_LEAF dbw 1, LUCKY_CHANT db 0 ; no more level-up moves HonchkrowEvosAttacks: db 0 ; no more evolutions dbw 1, WING_ATTACK dbw 1, HAZE dbw 1, PURSUIT dbw 1, ASTONISH dbw 25, SWAGGER dbw 35, NASTY_PLOT dbw 45, NIGHT_SLASH dbw 55, DARK_PULSE db 0 ; no more level-up moves GlameowEvosAttacks: dbbw EVOLVE_LEVEL, 38, PURUGLY db 0 ; no more evolutions dbw 1, FAKE_OUT dbw 5, SCRATCH dbw 8, GROWL dbw 13, HYPNOSIS dbw 17, FAINT_ATTACK dbw 20, FURY_SWIPES dbw 25, CHARM dbw 29, ASSIST dbw 32, CAPTIVATE dbw 37, SLASH dbw 41, SUCKER_PUNCH dbw 45, ATTRACT db 0 ; no more level-up moves PuruglyEvosAttacks: db 0 ; no more evolutions dbw 1, SCRATCH dbw 1, GROWL dbw 1, FAKE_OUT dbw 5, SCRATCH dbw 8, GROWL dbw 13, HYPNOSIS dbw 17, FAINT_ATTACK dbw 20, FURY_SWIPES dbw 25, CHARM dbw 29, ASSIST dbw 32, CAPTIVATE dbw 37, SLASH dbw 38, SWAGGER dbw 45, BODY_SLAM dbw 53, ATTRACT db 0 ; no more level-up moves ChinglingEvosAttacks: dbbw EVOLVE_HAPPINESS, TR_NITE, CHIMECHO db 0 ; no more evolutions dbw 1, WRAP dbw 6, GROWL dbw 9, ASTONISH dbw 14, CONFUSION dbw 17, UPROAR dbw 22, LAST_RESORT db 0 ; no more level-up moves StunkyEvosAttacks: dbbw EVOLVE_LEVEL, 34, SKUNTANK db 0 ; no more evolutions dbw 1, SCRATCH dbw 1, FOCUS_ENERGY dbw 4, POISON_GAS dbw 7, SCREECH dbw 10, FURY_SWIPES dbw 14, SMOKESCREEN dbw 18, FEINT dbw 22, SLASH dbw 27, TOXIC dbw 32, NIGHT_SLASH dbw 38, MEMENTO dbw 44, EXPLOSION db 0 ; no more level-up moves SkuntankEvosAttacks: db 0 ; no more evolutions dbw 1, SCRATCH dbw 1, FOCUS_ENERGY dbw 1, POISON_GAS dbw 4, POISON_GAS dbw 7, SCREECH dbw 10, FURY_SWIPES dbw 14, SMOKESCREEN dbw 18, FEINT dbw 22, SLASH dbw 27, TOXIC dbw 32, NIGHT_SLASH dbw 34, FLAMETHROWER dbw 42, MEMENTO dbw 52, EXPLOSION db 0 ; no more level-up moves BronzorEvosAttacks: dbbw EVOLVE_LEVEL, 33, BRONZONG db 0 ; no more evolutions dbw 1, TACKLE dbw 1, CONFUSION dbw 7, HYPNOSIS dbw 12, IMPRISON dbw 14, CONFUSE_RAY dbw 19, EXTRASENSORY dbw 26, IRON_DEFENSE dbw 30, SAFEGUARD dbw 35, GYRO_BALL dbw 37, FUTURE_SIGHT dbw 41, FAINT_ATTACK dbw 49, PAYBACK dbw 52, HEAL_BLOCK db 0 ; no more level-up moves BronzongEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, CONFUSION dbw 1, HYPNOSIS dbw 1, RAIN_DANCE dbw 1, SUNNY_DAY dbw 1, IMPRISON dbw 7, HYPNOSIS dbw 12, IMPRISON dbw 14, CONFUSE_RAY dbw 19, EXTRASENSORY dbw 26, IRON_DEFENSE dbw 30, SAFEGUARD dbw 33, BLOCK dbw 38, GYRO_BALL dbw 43, FUTURE_SIGHT dbw 50, FAINT_ATTACK dbw 61, PAYBACK dbw 67, HEAL_BLOCK db 0 ; no more level-up moves BonslyEvosAttacks: dbbww EVOLVE_LEVEL_WITH_MOVE, 1, MIMIC, SUDOWOODO db 0 ; no more evolutions dbw 1, FAKE_TEARS dbw 1, COPYCAT dbw 6, FLAIL dbw 9, LOW_KICK dbw 14, ROCK_THROW dbw 17, MIMIC dbw 22, BLOCK dbw 25, FAINT_ATTACK dbw 30, ROCK_TOMB dbw 33, ROCK_SLIDE dbw 38, SLAM dbw 41, SUCKER_PUNCH dbw 46, DOUBLE_EDGE db 0 ; no more level-up moves MimeJrEvosAttacks: dbbww EVOLVE_LEVEL_WITH_MOVE, 1, MIMIC, MR__MIME db 0 ; no more evolutions dbw 1, CONFUSION dbw 1, BARRIER dbw 1, TICKLE dbw 4, COPYCAT dbw 8, MEDITATE dbw 11, ENCORE dbw 15, DOUBLESLAP dbw 18, MIMIC dbw 22, LIGHT_SCREEN dbw 22, REFLECT dbw 25, PSYBEAM dbw 29, SUBSTITUTE dbw 32, RECYCLE dbw 36, TRICK dbw 39, PSYCHIC_M dbw 43, ROLE_PLAY dbw 46, BATON_PASS dbw 50, SAFEGUARD db 0 ; no more level-up moves HappinyEvosAttacks: dbbbw EVOLVE_LEVEL_WITH_ITEM_DAY, 1, OVAL_STONE, CHANSEY db 0 ; no more evolutions dbw 1, POUND dbw 1, CHARM dbw 5, COPYCAT dbw 9, REFRESH dbw 12, SWEET_KISS db 0 ; no more level-up moves ChatotEvosAttacks: db 0 ; no more evolutions dbw 1, PECK dbw 5, GROWL dbw 9, MIRROR_MOVE dbw 13, SING dbw 17, FURY_ATTACK dbw 21, CHATTER dbw 25, TAUNT dbw 29, MIMIC dbw 33, ROOST dbw 37, UPROAR dbw 41, FEATHERDANCE dbw 45, HYPER_VOICE db 0 ; no more level-up moves SpiritombEvosAttacks: db 0 ; no more evolutions dbw 1, CONFUSE_RAY dbw 1, CURSE dbw 1, SPITE dbw 1, PURSUIT dbw 1, SHADOW_SNEAK dbw 7, FAINT_ATTACK dbw 13, HYPNOSIS dbw 19, DREAM_EATER dbw 25, OMINOUS_WIND dbw 31, SUCKER_PUNCH dbw 37, NASTY_PLOT dbw 43, MEMENTO dbw 49, DARK_PULSE db 0 ; no more level-up moves GibleEvosAttacks: dbbw EVOLVE_LEVEL, 24, GABITE db 0 ; no more evolutions dbw 1, TACKLE dbw 3, SAND_ATTACK dbw 7, DRAGON_RAGE dbw 13, SANDSTORM dbw 15, TAKE_DOWN dbw 19, SAND_TOMB dbw 25, SLASH dbw 27, DRAGON_CLAW dbw 31, DIG dbw 37, DRAGON_RUSH db 0 ; no more level-up moves GabiteEvosAttacks: dbbw EVOLVE_LEVEL, 48, GARCHOMP db 0 ; no more evolutions dbw 1, SAND_ATTACK dbw 1, TACKLE dbw 3, SAND_ATTACK dbw 7, DRAGON_RAGE dbw 13, SANDSTORM dbw 15, TAKE_DOWN dbw 19, SAND_TOMB dbw 28, SLASH dbw 33, DRAGON_CLAW dbw 40, DIG dbw 49, DRAGON_RUSH db 0 ; no more level-up moves GarchompEvosAttacks: db 0 ; no more evolutions dbw 1, SAND_ATTACK dbw 1, TACKLE dbw 1, DRAGON_RAGE dbw 1, SANDSTORM dbw 1, FIRE_FANG dbw 3, SAND_ATTACK dbw 7, DRAGON_RAGE dbw 13, SANDSTORM dbw 15, TAKE_DOWN dbw 19, SAND_TOMB dbw 28, SLASH dbw 33, DRAGON_CLAW dbw 40, DIG dbw 48, CRUNCH dbw 55, DRAGON_RUSH db 0 ; no more level-up moves MunchlaxEvosAttacks: dbbw EVOLVE_HAPPINESS, TR_ANYTIME, SNORLAX db 0 ; no more evolutions dbw 1, TACKLE dbw 1, METRONOME dbw 1, ODOR_SLEUTH dbw 4, DEFENSE_CURL dbw 9, AMNESIA dbw 12, LICK dbw 17, RECYCLE dbw 20, SCREECH dbw 25, STOCKPILE dbw 28, SWALLOW dbw 33, BODY_SLAM dbw 36, FLING dbw 41, ROLLOUT dbw 44, NATURAL_GIFT dbw 49, LAST_RESORT db 0 ; no more level-up moves RioluEvosAttacks: dbbw EVOLVE_HAPPINESS, TR_MORNDAY, LUCARIO db 0 ; no more evolutions dbw 1, QUICK_ATTACK dbw 1, FORESIGHT dbw 1, ENDURE dbw 6, COUNTER dbw 11, FORCE_PALM dbw 15, FEINT dbw 19, REVERSAL dbw 24, SCREECH dbw 29, COPYCAT db 0 ; no more level-up moves LucarioEvosAttacks: db 0 ; no more evolutions dbw 1, QUICK_ATTACK dbw 1, FORESIGHT dbw 1, DETECT dbw 1, METAL_CLAW dbw 1, DARK_PULSE dbw 6, COUNTER dbw 11, FORCE_PALM dbw 15, FEINT dbw 19, BONE_RUSH dbw 24, METAL_SOUND dbw 29, ME_FIRST dbw 33, SWORDS_DANCE dbw 37, AURA_SPHERE dbw 42, CLOSE_COMBAT dbw 47, DRAGON_PULSE dbw 51, EXTREMESPEED db 0 ; no more level-up moves HippopotasEvosAttacks: dbbw EVOLVE_LEVEL, 34, HIPPOWDON db 0 ; no more evolutions dbw 1, SAND_ATTACK dbw 1, TACKLE dbw 7, BITE dbw 13, YAWN dbw 19, TAKE_DOWN dbw 25, SAND_TOMB dbw 31, CRUNCH dbw 37, EARTHQUAKE dbw 44, DOUBLE_EDGE dbw 50, FISSURE db 0 ; no more level-up moves HippowdonEvosAttacks: db 0 ; no more evolutions dbw 1, SAND_ATTACK dbw 1, TACKLE dbw 1, BITE dbw 1, YAWN dbw 1, THUNDER_FANG dbw 1, ICE_FANG dbw 1, FIRE_FANG dbw 7, BITE dbw 13, YAWN dbw 19, TAKE_DOWN dbw 25, SAND_TOMB dbw 31, CRUNCH dbw 40, EARTHQUAKE dbw 50, DOUBLE_EDGE dbw 60, FISSURE db 0 ; no more level-up moves SkorupiEvosAttacks: dbbw EVOLVE_LEVEL, 40, DRAPION db 0 ; no more evolutions dbw 1, POISON_STING dbw 1, LEER dbw 1, BITE dbw 6, KNOCK_OFF dbw 12, PIN_MISSILE dbw 17, ACUPRESSURE dbw 23, SCARY_FACE dbw 28, TOXIC_SPIKES dbw 34, BUG_BITE dbw 39, POISON_FANG dbw 45, CRUNCH dbw 50, CROSS_POISON db 0 ; no more level-up moves DrapionEvosAttacks: db 0 ; no more evolutions dbw 1, POISON_STING dbw 1, LEER dbw 1, BITE dbw 1, KNOCK_OFF dbw 1, THUNDER_FANG dbw 1, ICE_FANG dbw 1, FIRE_FANG dbw 6, KNOCK_OFF dbw 12, PIN_MISSILE dbw 17, ACUPRESSURE dbw 23, SCARY_FACE dbw 28, TOXIC_SPIKES dbw 34, BUG_BITE dbw 39, POISON_FANG dbw 49, CRUNCH dbw 58, CROSS_POISON db 0 ; no more level-up moves CroagunkEvosAttacks: dbbw EVOLVE_LEVEL, 37, TOXICROAK db 0 ; no more evolutions dbw 1, ASTONISH dbw 3, MUD_SLAP dbw 8, POISON_STING dbw 10, TAUNT dbw 15, PURSUIT dbw 17, FAINT_ATTACK dbw 22, REVENGE dbw 24, SWAGGER dbw 29, MUD_BOMB dbw 31, SUCKER_PUNCH dbw 36, NASTY_PLOT dbw 38, POISON_JAB dbw 43, SLUDGE_BOMB dbw 45, FLATTER db 0 ; no more level-up moves ToxicroakEvosAttacks: db 0 ; no more evolutions dbw 1, POISON_STING dbw 1, MUD_SLAP dbw 1, ASTONISH dbw 3, MUD_SLAP dbw 8, POISON_STING dbw 10, TAUNT dbw 15, PURSUIT dbw 17, FAINT_ATTACK dbw 22, REVENGE dbw 24, SWAGGER dbw 29, MUD_BOMB dbw 31, SUCKER_PUNCH dbw 36, NASTY_PLOT dbw 41, POISON_JAB dbw 49, SLUDGE_BOMB dbw 54, FLATTER db 0 ; no more level-up moves CarnivineEvosAttacks: db 0 ; no more evolutions dbw 1, BIND dbw 1, GROWTH dbw 7, BITE dbw 11, VINE_WHIP dbw 17, SWEET_SCENT dbw 21, INGRAIN dbw 27, FAINT_ATTACK dbw 31, STOCKPILE dbw 31, SPIT_UP dbw 31, SWALLOW dbw 37, CRUNCH dbw 41, WRING_OUT dbw 47, POWER_WHIP db 0 ; no more level-up moves FinneonEvosAttacks: dbbw EVOLVE_LEVEL, 31, LUMINEON db 0 ; no more evolutions dbw 1, POUND dbw 6, WATER_GUN dbw 10, ATTRACT dbw 13, RAIN_DANCE dbw 17, GUST dbw 22, WATER_PULSE dbw 26, CAPTIVATE dbw 29, SAFEGUARD dbw 33, AQUA_RING dbw 38, WHIRLPOOL dbw 42, U_TURN dbw 45, BOUNCE dbw 49, SILVER_WIND db 0 ; no more level-up moves LumineonEvosAttacks: db 0 ; no more evolutions dbw 1, POUND dbw 1, WATER_GUN dbw 1, ATTRACT dbw 6, WATER_GUN dbw 10, ATTRACT dbw 13, RAIN_DANCE dbw 17, GUST dbw 22, WATER_PULSE dbw 26, CAPTIVATE dbw 29, SAFEGUARD dbw 35, AQUA_RING dbw 42, WHIRLPOOL dbw 48, U_TURN dbw 53, BOUNCE dbw 59, SILVER_WIND db 0 ; no more level-up moves MantykeEvosAttacks: dbbww EVOLVE_LEVEL_PARTY_MON, 1, REMORAID, MANTINE db 0 ; no more evolutions dbw 1, TACKLE dbw 1, BUBBLE dbw 4, SUPERSONIC dbw 10, BUBBLEBEAM dbw 13, HEADBUTT dbw 19, AGILITY dbw 22, WING_ATTACK dbw 28, WATER_PULSE dbw 31, TAKE_DOWN dbw 37, CONFUSE_RAY dbw 40, BOUNCE dbw 46, AQUA_RING dbw 49, HYDRO_PUMP db 0 ; no more level-up moves SnoverEvosAttacks: dbbw EVOLVE_LEVEL, 40, ABOMASNOW db 0 ; no more evolutions dbw 1, LEER dbw 1, POWDER_SNOW dbw 5, RAZOR_LEAF dbw 9, ICY_WIND dbw 13, GRASSWHISTLE dbw 17, SWAGGER dbw 21, MIST dbw 26, ICE_SHARD dbw 31, INGRAIN dbw 36, WOOD_HAMMER dbw 41, BLIZZARD dbw 46, SHEER_COLD db 0 ; no more level-up moves AbomasnowEvosAttacks: db 0 ; no more evolutions dbw 1, ICE_PUNCH dbw 1, LEER dbw 1, RAZOR_LEAF dbw 1, POWDER_SNOW dbw 1, ICY_WIND dbw 5, RAZOR_LEAF dbw 9, ICY_WIND dbw 13, GRASSWHISTLE dbw 17, SWAGGER dbw 21, MIST dbw 26, ICE_SHARD dbw 31, INGRAIN dbw 36, WOOD_HAMMER dbw 47, BLIZZARD dbw 58, SHEER_COLD db 0 ; no more level-up moves WeavileEvosAttacks: db 0 ; no more evolutions dbw 1, SCRATCH dbw 1, LEER dbw 1, QUICK_ATTACK dbw 1, TAUNT dbw 1, REVENGE dbw 1, ASSURANCE dbw 1, EMBARGO dbw 8, QUICK_ATTACK dbw 10, SCREECH dbw 14, FAINT_ATTACK dbw 21, FURY_SWIPES dbw 24, NASTY_PLOT dbw 28, ICY_WIND dbw 35, NIGHT_SLASH dbw 38, FLING dbw 42, METAL_CLAW dbw 49, DARK_PULSE db 0 ; no more level-up moves MagnezoneEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, SUPERSONIC dbw 1, THUNDERSHOCK dbw 1, BARRIER dbw 1, MIRROR_COAT dbw 1, METAL_SOUND dbw 6, THUNDERSHOCK dbw 11, SUPERSONIC dbw 14, SONICBOOM dbw 17, THUNDER_WAVE dbw 22, SPARK dbw 27, LOCK_ON dbw 30, MAGNET_BOMB dbw 34, SCREECH dbw 40, DISCHARGE dbw 46, MIRROR_SHOT dbw 50, MAGNET_RISE dbw 54, GYRO_BALL dbw 60, ZAP_CANNON db 0 ; no more level-up moves LickilickyEvosAttacks: db 0 ; no more evolutions dbw 1, LICK dbw 5, SUPERSONIC dbw 9, DEFENSE_CURL dbw 13, KNOCK_OFF dbw 17, WRAP dbw 21, STOMP dbw 25, DISABLE dbw 29, SLAM dbw 33, ROLLOUT dbw 37, ME_FIRST dbw 41, REFRESH dbw 45, SCREECH dbw 49, POWER_WHIP dbw 53, WRING_OUT dbw 57, GYRO_BALL db 0 ; no more level-up moves RhyperiorEvosAttacks: db 0 ; no more evolutions dbw 1, STOMP dbw 1, HORN_ATTACK dbw 1, FURY_ATTACK dbw 1, TAIL_WHIP dbw 1, POISON_JAB dbw 9, STOMP dbw 13, FURY_ATTACK dbw 21, SCARY_FACE dbw 25, ROCK_BLAST dbw 33, TAKE_DOWN dbw 37, HORN_DRILL dbw 42, HAMMER_ARM dbw 45, STONE_EDGE dbw 49, EARTHQUAKE dbw 57, MEGAHORN dbw 61, ROCK_WRECKER db 0 ; no more level-up moves TangrowthEvosAttacks: db 0 ; no more evolutions dbw 1, CONSTRICT dbw 1, INGRAIN dbw 5, SLEEP_POWDER dbw 8, ABSORB dbw 12, GROWTH dbw 15, POISONPOWDER dbw 19, VINE_WHIP dbw 22, BIND dbw 26, MEGA_DRAIN dbw 29, STUN_SPORE dbw 33, ANCIENTPOWER dbw 36, KNOCK_OFF dbw 40, NATURAL_GIFT dbw 43, SLAM dbw 47, TICKLE dbw 50, WRING_OUT dbw 54, POWER_WHIP dbw 57, BLOCK db 0 ; no more level-up moves ElectivireEvosAttacks: db 0 ; no more evolutions dbw 1, FIRE_PUNCH dbw 1, LEER dbw 1, LOW_KICK dbw 1, THUNDERSHOCK dbw 1, QUICK_ATTACK dbw 7, THUNDERSHOCK dbw 10, LOW_KICK dbw 16, SWIFT dbw 19, SHOCK_WAVE dbw 25, LIGHT_SCREEN dbw 28, THUNDERPUNCH dbw 37, DISCHARGE dbw 43, THUNDERBOLT dbw 52, SCREECH dbw 58, THUNDER dbw 67, GIGA_IMPACT db 0 ; no more level-up moves MagmortarEvosAttacks: db 0 ; no more evolutions dbw 1, THUNDERPUNCH dbw 1, LEER dbw 1, EMBER dbw 1, SMOKESCREEN dbw 1, SMOG dbw 7, EMBER dbw 10, SMOKESCREEN dbw 16, FAINT_ATTACK dbw 19, FIRE_SPIN dbw 25, CONFUSE_RAY dbw 28, FIRE_PUNCH dbw 37, LAVA_PLUME dbw 43, FLAMETHROWER dbw 52, SUNNY_DAY dbw 58, FIRE_BLAST dbw 67, HYPER_BEAM db 0 ; no more level-up moves TogekissEvosAttacks: db 0 ; no more evolutions dbw 1, SKY_ATTACK dbw 1, EXTREMESPEED dbw 1, AURA_SPHERE dbw 1, AIR_SLASH db 0 ; no more level-up moves YanmegaEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, QUICK_ATTACK dbw 1, DOUBLE_TEAM dbw 1, FORESIGHT dbw 1, NIGHT_SLASH dbw 1, BUG_BITE dbw 6, QUICK_ATTACK dbw 11, DOUBLE_TEAM dbw 14, SONICBOOM dbw 17, DETECT dbw 22, SUPERSONIC dbw 27, UPROAR dbw 30, PURSUIT dbw 33, ANCIENTPOWER dbw 38, FEINT dbw 43, SLASH dbw 46, SCREECH dbw 49, U_TURN dbw 54, AIR_SLASH dbw 57, BUG_BUZZ db 0 ; no more level-up moves LeafeonEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, TAIL_WHIP dbw 1, HELPING_HAND dbw 8, SAND_ATTACK dbw 15, RAZOR_LEAF dbw 22, QUICK_ATTACK dbw 29, SYNTHESIS dbw 36, MAGICAL_LEAF dbw 43, GIGA_DRAIN dbw 50, LAST_RESORT dbw 57, GRASSWHISTLE dbw 64, SUNNY_DAY dbw 71, LEAF_BLADE dbw 78, SWORDS_DANCE db 0 ; no more level-up moves GlaceonEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, TAIL_WHIP dbw 1, HELPING_HAND dbw 8, SAND_ATTACK dbw 15, ICY_WIND dbw 22, QUICK_ATTACK dbw 29, BITE dbw 36, ICE_SHARD dbw 43, ICE_FANG dbw 50, LAST_RESORT dbw 57, MIRROR_COAT dbw 64, HAIL dbw 71, BLIZZARD dbw 78, BARRIER db 0 ; no more level-up moves GliscorEvosAttacks: db 0 ; no more evolutions dbw 1, SAND_ATTACK dbw 1, HARDEN dbw 1, KNOCK_OFF dbw 1, POISON_JAB dbw 1, THUNDER_FANG dbw 1, ICE_FANG dbw 1, FIRE_FANG dbw 5, SAND_ATTACK dbw 9, HARDEN dbw 12, KNOCK_OFF dbw 16, QUICK_ATTACK dbw 20, FURY_CUTTER dbw 23, FAINT_ATTACK dbw 27, SCREECH dbw 31, NIGHT_SLASH dbw 34, SWORDS_DANCE dbw 38, U_TURN dbw 42, X_SCISSOR dbw 45, GUILLOTINE db 0 ; no more level-up moves MamoswineEvosAttacks: db 0 ; no more evolutions dbw 1, PECK dbw 1, POWDER_SNOW dbw 1, ANCIENTPOWER dbw 1, MUD_SPORT dbw 1, ODOR_SLEUTH dbw 4, MUD_SPORT dbw 8, POWDER_SNOW dbw 13, MUD_SLAP dbw 16, ENDURE dbw 20, MUD_BOMB dbw 25, HAIL dbw 28, ICE_FANG dbw 32, TAKE_DOWN dbw 33, DOUBLE_HIT dbw 40, EARTHQUAKE dbw 48, MIST dbw 56, BLIZZARD dbw 65, SCARY_FACE db 0 ; no more level-up moves PorygonZEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, CONVERSION dbw 1, CONVERSION2 dbw 1, NASTY_PLOT dbw 1, TRICK_ROOM dbw 7, PSYBEAM dbw 12, AGILITY dbw 18, RECOVER dbw 23, MAGNET_RISE dbw 29, SIGNAL_BEAM dbw 34, EMBARGO dbw 40, DISCHARGE dbw 45, LOCK_ON dbw 51, TRI_ATTACK dbw 56, MAGIC_COAT dbw 62, ZAP_CANNON dbw 67, HYPER_BEAM db 0 ; no more level-up moves GalladeEvosAttacks: db 0 ; no more evolutions dbw 1, LEER dbw 1, CONFUSION dbw 1, TELEPORT dbw 1, DOUBLE_TEAM dbw 1, LEAF_BLADE dbw 1, NIGHT_SLASH dbw 6, CONFUSION dbw 10, DOUBLE_TEAM dbw 12, TELEPORT dbw 17, FURY_CUTTER dbw 22, SLASH dbw 25, SWORDS_DANCE dbw 31, PSYCHO_CUT dbw 36, HELPING_HAND dbw 39, FEINT dbw 45, FALSE_SWIPE dbw 50, PROTECT dbw 53, CLOSE_COMBAT db 0 ; no more level-up moves ProbopassEvosAttacks: db 0 ; no more evolutions dbw 1, TACKLE dbw 1, IRON_DEFENSE dbw 1, BLOCK dbw 1, GRAVITY dbw 1, MAGNET_RISE dbw 1, MAGNET_BOMB dbw 7, IRON_DEFENSE dbw 13, MAGNET_BOMB dbw 19, BLOCK dbw 25, THUNDER_WAVE dbw 31, ROCK_SLIDE dbw 37, SANDSTORM dbw 43, REST dbw 49, POWER_GEM dbw 55, DISCHARGE dbw 61, STONE_EDGE dbw 67, ZAP_CANNON dbw 73, LOCK_ON dbw 79, EARTH_POWER db 0 ; no more level-up moves DusknoirEvosAttacks: db 0 ; no more evolutions dbw 1, FIRE_PUNCH dbw 1, ICE_PUNCH dbw 1, THUNDERPUNCH dbw 1, BIND dbw 1, LEER dbw 1, DISABLE dbw 1, NIGHT_SHADE dbw 1, GRAVITY dbw 6, DISABLE dbw 9, FORESIGHT dbw 14, ASTONISH dbw 17, CONFUSE_RAY dbw 22, SHADOW_SNEAK dbw 25, PURSUIT dbw 30, CURSE dbw 33, WILL_O_WISP dbw 37, SHADOW_PUNCH dbw 43, MEAN_LOOK dbw 51, PAYBACK dbw 61, FUTURE_SIGHT db 0 ; no more level-up moves FroslassEvosAttacks: db 0 ; no more evolutions dbw 1, LEER dbw 1, DOUBLE_TEAM dbw 1, POWDER_SNOW dbw 1, ASTONISH dbw 4, DOUBLE_TEAM dbw 10, ASTONISH dbw 13, ICY_WIND dbw 19, CONFUSE_RAY dbw 22, OMINOUS_WIND dbw 28, WAKE_UP_SLAP dbw 31, CAPTIVATE dbw 37, ICE_SHARD dbw 40, HAIL dbw 51, BLIZZARD dbw 59, DESTINY_BOND db 0 ; no more level-up moves RotomEvosAttacks: db 0 ; no more evolutions dbw 1, THUNDERSHOCK dbw 1, THUNDER_WAVE dbw 1, CONFUSE_RAY dbw 1, TRICK dbw 1, ASTONISH dbw 8, UPROAR dbw 15, DOUBLE_TEAM dbw 22, SHOCK_WAVE dbw 29, OMINOUS_WIND dbw 36, SUBSTITUTE dbw 43, CHARGE dbw 50, DISCHARGE db 0 ; no more level-up moves UxieEvosAttacks: db 0 ; no more evolutions dbw 1, CONFUSION dbw 1, REST dbw 6, IMPRISON dbw 16, ENDURE dbw 21, SWIFT dbw 31, YAWN dbw 36, FUTURE_SIGHT dbw 46, AMNESIA dbw 51, EXTRASENSORY dbw 61, FLAIL dbw 66, NATURAL_GIFT dbw 76, MEMENTO db 0 ; no more level-up moves MespritEvosAttacks: db 0 ; no more evolutions dbw 1, CONFUSION dbw 1, REST dbw 6, IMPRISON dbw 16, PROTECT dbw 21, SWIFT dbw 31, LUCKY_CHANT dbw 36, FUTURE_SIGHT dbw 46, CHARM dbw 51, EXTRASENSORY dbw 61, COPYCAT dbw 66, NATURAL_GIFT dbw 76, HEALING_WISH db 0 ; no more level-up moves AzelfEvosAttacks: db 0 ; no more evolutions dbw 1, CONFUSION dbw 1, REST dbw 6, IMPRISON dbw 16, DETECT dbw 21, SWIFT dbw 31, UPROAR dbw 36, FUTURE_SIGHT dbw 46, NASTY_PLOT dbw 51, EXTRASENSORY dbw 61, LAST_RESORT dbw 66, NATURAL_GIFT dbw 76, EXPLOSION db 0 ; no more level-up moves DialgaEvosAttacks: db 0 ; no more evolutions dbw 1, SCARY_FACE dbw 1, DRAGONBREATH dbw 10, METAL_CLAW dbw 20, ANCIENTPOWER dbw 30, DRAGON_CLAW dbw 40, ROAR_OF_TIME dbw 50, HEAL_BLOCK dbw 60, EARTH_POWER dbw 70, SLASH dbw 80, FLASH_CANNON dbw 90, AURA_SPHERE db 0 ; no more level-up moves PalkiaEvosAttacks: db 0 ; no more evolutions dbw 1, SCARY_FACE dbw 1, DRAGONBREATH dbw 10, WATER_PULSE dbw 20, ANCIENTPOWER dbw 30, DRAGON_CLAW dbw 40, SPACIAL_REND dbw 50, HEAL_BLOCK dbw 60, EARTH_POWER dbw 70, SLASH dbw 80, AQUA_TAIL dbw 90, AURA_SPHERE db 0 ; no more level-up moves HeatranEvosAttacks: db 0 ; no more evolutions dbw 1, ANCIENTPOWER dbw 9, LEER dbw 17, FIRE_FANG dbw 25, METAL_SOUND dbw 33, CRUNCH dbw 41, SCARY_FACE dbw 49, LAVA_PLUME dbw 57, FIRE_SPIN dbw 65, IRON_HEAD dbw 73, EARTH_POWER dbw 81, HEAT_WAVE dbw 88, STONE_EDGE dbw 96, MAGMA_STORM db 0 ; no more level-up moves RegigigasEvosAttacks: db 0 ; no more evolutions dbw 1, FIRE_PUNCH dbw 1, ICE_PUNCH dbw 1, THUNDERPUNCH dbw 1, CONFUSE_RAY dbw 1, DIZZY_PUNCH dbw 1, FORESIGHT dbw 1, KNOCK_OFF dbw 25, REVENGE dbw 50, ZEN_HEADBUTT dbw 75, CRUSH_GRIP dbw 100, GIGA_IMPACT db 0 ; no more level-up moves GiratinaEvosAttacks: db 0 ; no more evolutions dbw 1, SCARY_FACE dbw 1, DRAGONBREATH dbw 10, OMINOUS_WIND dbw 20, ANCIENTPOWER dbw 30, DRAGON_CLAW dbw 40, SHADOW_FORCE dbw 50, HEAL_BLOCK dbw 60, EARTH_POWER dbw 70, SLASH dbw 80, SHADOW_CLAW dbw 90, AURA_SPHERE db 0 ; no more level-up moves CresseliaEvosAttacks: db 0 ; no more evolutions dbw 1, CONFUSION dbw 1, DOUBLE_TEAM dbw 11, SAFEGUARD dbw 20, MIST dbw 29, AURORA_BEAM dbw 38, FUTURE_SIGHT dbw 47, SLASH dbw 57, MOONLIGHT dbw 66, PSYCHO_CUT dbw 75, PSYCHO_SHIFT dbw 84, LUNAR_DANCE dbw 93, PSYCHIC_M db 0 ; no more level-up moves PhioneEvosAttacks: db 0 ; no more evolutions dbw 1, BUBBLE dbw 1, WATER_SPORT dbw 9, CHARM dbw 16, SUPERSONIC dbw 24, BUBBLEBEAM dbw 31, ACID_ARMOR dbw 39, WHIRLPOOL dbw 46, WATER_PULSE dbw 54, AQUA_RING dbw 61, DIVE dbw 69, RAIN_DANCE db 0 ; no more level-up moves ManaphyEvosAttacks: db 0 ; no more evolutions dbw 1, BUBBLE dbw 1, TAIL_GLOW dbw 1, WATER_SPORT dbw 9, CHARM dbw 16, SUPERSONIC dbw 24, BUBBLEBEAM dbw 31, ACID_ARMOR dbw 39, WHIRLPOOL dbw 46, WATER_PULSE dbw 54, AQUA_RING dbw 61, DIVE dbw 69, RAIN_DANCE dbw 76, HEART_SWAP db 0 ; no more level-up moves DarkraiEvosAttacks: db 0 ; no more evolutions dbw 1, DISABLE dbw 1, OMINOUS_WIND dbw 11, QUICK_ATTACK dbw 20, HYPNOSIS dbw 29, FAINT_ATTACK dbw 38, NIGHTMARE dbw 47, DOUBLE_TEAM dbw 57, HAZE dbw 66, DARK_VOID dbw 75, NASTY_PLOT dbw 84, DREAM_EATER dbw 93, DARK_PULSE db 0 ; no more level-up moves ShayminEvosAttacks: db 0 ; no more evolutions dbw 1, GROWTH dbw 10, MAGICAL_LEAF dbw 19, LEECH_SEED dbw 28, SYNTHESIS dbw 37, SWEET_SCENT dbw 46, NATURAL_GIFT dbw 55, WORRY_SEED dbw 64, AROMATHERAPY dbw 73, ENERGY_BALL dbw 82, SWEET_KISS dbw 91, HEALING_WISH dbw 100, SEED_FLARE db 0 ; no more level-up moves ArceusEvosAttacks: db 0 ; no more evolutions dbw 1, SEISMIC_TOSS dbw 1, COSMIC_POWER dbw 1, NATURAL_GIFT dbw 1, PUNISHMENT dbw 10, GRAVITY dbw 20, EARTH_POWER dbw 30, HYPER_VOICE dbw 40, EXTREMESPEED dbw 50, REFRESH dbw 60, FUTURE_SIGHT dbw 70, RECOVER dbw 80, HYPER_BEAM dbw 90, PERISH_SONG dbw 100, JUDGMENT db 0 ; no more level-up moves
19.281568
57
0.741372
143b484b72168298ab0e529836bad2037490b2bc
4,862
asm
Assembly
Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xa0_notsx.log_5242_868.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xa0_notsx.log_5242_868.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xa0_notsx.log_5242_868.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r15 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0xe182, %rsi lea addresses_UC_ht+0x1ebe2, %rdi nop nop nop sub $7211, %r10 mov $20, %rcx rep movsq nop nop mfence lea addresses_A_ht+0xec62, %r15 nop nop nop and $54248, %r9 mov (%r15), %r13d nop and $39313, %rsi lea addresses_WC_ht+0xb7e2, %rsi lea addresses_WT_ht+0x14c22, %rdi nop nop inc %rbx mov $90, %rcx rep movsw nop add %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r9 push %rcx push %rdx push %rsi // Load lea addresses_D+0x1ed62, %rsi nop nop nop nop nop and %r9, %r9 movb (%rsi), %cl nop nop nop nop nop cmp %r14, %r14 // Faulty Load mov $0xbe2, %rdx nop nop nop nop nop sub $26751, %r11 mov (%rdx), %rsi lea oracles, %rdx and $0xff, %rsi shlq $12, %rsi mov (%rdx,%rsi,1), %rsi pop %rsi pop %rdx pop %rcx pop %r9 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_P', 'AVXalign': True, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_P', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}} {'00': 5242} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
44.605505
2,999
0.659399
59f7a8ae2b1ad85319a387693caee66333ee6f3b
451
asm
Assembly
programs/oeis/221/A221366.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/221/A221366.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/221/A221366.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A221366: The simple continued fraction expansion of F(x) := product {n = 0..inf} (1 - x^(4*n+3))/(1 - x^(4*n+1)) when x = 1/2*(7 - 3*sqrt(5)). ; 1,5,1,45,1,320,1,2205,1,15125,1,103680,1,710645,1,4870845,1,33385280,1,228826125,1,1568397605,1,10749957120,1,73681302245,1,505019158605,1,3461452808000,1,23725150497405,1 lpb $0 div $0,2 mov $1,$0 mul $0,2 seq $1,81078 ; a(n) = Lucas(4n) - 3, or Lucas(2n-1)*Lucas(2n+1). lpe add $1,1 mov $0,$1
37.583333
173
0.643016
2dfb0628ef4fc8ac41d3c5b1be53405fb1afd0f1
477
asm
Assembly
oeis/162/A162910.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/162/A162910.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/162/A162910.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A162910: Denominators of Bird tree fractions. ; Submitted by Christian Krause ; 1,2,1,3,3,1,2,5,4,4,5,2,1,3,3,8,7,5,7,7,5,7,8,3,3,1,2,5,4,4,5,13,11,9,12,9,6,10,11,11,10,6,9,12,9,11,13,5,4,4,5,2,1,3,3,8,7,5,7,7,5,7,8,21,18,14,19,16,11,17,19,14,13,7,11,17,13,15,18,18,15,13,17,11,7,13,14,19 mul $0,2 mov $1,1 mov $2,2 lpb $0 div $0,2 sub $0,1 mov $3,1 add $3,$0 div $3,2 mod $3,2 mov $4,$2 add $2,$1 sub $4,$1 mul $3,$4 add $1,$3 lpe sub $2,$1 mov $0,$2
20.73913
210
0.570231
93b474fa9314f989a85f90b49f080dfdff29d4e6
3,800
asm
Assembly
pkgs/tools/yasm/src/modules/arch/x86/tests/sse5-err.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
64
2015-03-06T00:30:56.000Z
2022-03-24T13:26:53.000Z
pkgs/tools/yasm/src/modules/arch/x86/tests/sse5-err.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
12
2020-12-15T08:30:19.000Z
2022-03-13T03:54:24.000Z
pkgs/tools/yasm/src/modules/arch/x86/tests/sse5-err.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
40
2015-02-26T15:31:16.000Z
2022-03-03T23:23:37.000Z
fmaddpd xmm1, xmm2, xmm1, xmm3 ; illegal fmaddpd xmm1, xmm2, xmm3, xmm3 ; illegal fmaddpd xmm1, xmm2, xmm2, xmm3 ; illegal fmaddps xmm1, xmm2, xmm1, xmm3 ; illegal fmaddps xmm1, xmm2, xmm3, xmm3 ; illegal fmaddps xmm1, xmm2, xmm2, xmm3 ; illegal fmaddsd xmm1, xmm2, xmm1, xmm3 ; illegal fmaddsd xmm1, xmm2, xmm3, xmm3 ; illegal fmaddsd xmm1, xmm2, xmm2, xmm3 ; illegal fmaddss xmm1, xmm2, xmm1, xmm3 ; illegal fmaddss xmm1, xmm2, xmm3, xmm3 ; illegal fmaddss xmm1, xmm2, xmm2, xmm3 ; illegal fmsubpd xmm1, xmm2, xmm1, xmm3 ; illegal fmsubpd xmm1, xmm2, xmm3, xmm3 ; illegal fmsubpd xmm1, xmm2, xmm2, xmm3 ; illegal fmsubps xmm1, xmm2, xmm1, xmm3 ; illegal fmsubps xmm1, xmm2, xmm3, xmm3 ; illegal fmsubps xmm1, xmm2, xmm2, xmm3 ; illegal fmsubsd xmm1, xmm2, xmm1, xmm3 ; illegal fmsubsd xmm1, xmm2, xmm3, xmm3 ; illegal fmsubsd xmm1, xmm2, xmm2, xmm3 ; illegal fmsubss xmm1, xmm2, xmm1, xmm3 ; illegal fmsubss xmm1, xmm2, xmm3, xmm3 ; illegal fmsubss xmm1, xmm2, xmm2, xmm3 ; illegal fnmaddpd xmm1, xmm2, xmm1, xmm3 ; illegal fnmaddpd xmm1, xmm2, xmm3, xmm3 ; illegal fnmaddpd xmm1, xmm2, xmm2, xmm3 ; illegal fnmaddps xmm1, xmm2, xmm1, xmm3 ; illegal fnmaddps xmm1, xmm2, xmm3, xmm3 ; illegal fnmaddps xmm1, xmm2, xmm2, xmm3 ; illegal fnmaddsd xmm1, xmm2, xmm1, xmm3 ; illegal fnmaddsd xmm1, xmm2, xmm3, xmm3 ; illegal fnmaddsd xmm1, xmm2, xmm2, xmm3 ; illegal fnmaddss xmm1, xmm2, xmm1, xmm3 ; illegal fnmaddss xmm1, xmm2, xmm3, xmm3 ; illegal fnmaddss xmm1, xmm2, xmm2, xmm3 ; illegal fnmsubpd xmm1, xmm2, xmm1, xmm3 ; illegal fnmsubpd xmm1, xmm2, xmm3, xmm3 ; illegal fnmsubpd xmm1, xmm2, xmm2, xmm3 ; illegal fnmsubps xmm1, xmm2, xmm1, xmm3 ; illegal fnmsubps xmm1, xmm2, xmm3, xmm3 ; illegal fnmsubps xmm1, xmm2, xmm2, xmm3 ; illegal fnmsubsd xmm1, xmm2, xmm1, xmm3 ; illegal fnmsubsd xmm1, xmm2, xmm3, xmm3 ; illegal fnmsubsd xmm1, xmm2, xmm2, xmm3 ; illegal fnmsubss xmm1, xmm2, xmm1, xmm3 ; illegal fnmsubss xmm1, xmm2, xmm3, xmm3 ; illegal fnmsubss xmm1, xmm2, xmm2, xmm3 ; illegal pcmov xmm1, xmm2, xmm1, xmm3 ; illegal pcmov xmm1, xmm2, xmm3, xmm3 ; illegal pcmov xmm1, xmm2, xmm2, xmm3 ; illegal permpd xmm1, xmm2, xmm1, xmm3 ; illegal permpd xmm1, xmm2, xmm3, xmm3 ; illegal permpd xmm1, xmm2, xmm2, xmm3 ; illegal permps xmm1, xmm2, xmm1, xmm3 ; illegal permps xmm1, xmm2, xmm3, xmm3 ; illegal permps xmm1, xmm2, xmm2, xmm3 ; illegal pmacsdd xmm1, xmm2, xmm1, xmm3 ; illegal pmacsdd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacsdqh xmm1, xmm2, xmm1, xmm3 ; illegal pmacsdqh xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacsdql xmm1, xmm2, xmm1, xmm3 ; illegal pmacsdql xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacssdd xmm1, xmm2, xmm1, xmm3 ; illegal pmacssdd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacssdqh xmm1, xmm2, xmm1, xmm3 ; illegal pmacssdqh xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacssdql xmm1, xmm2, xmm1, xmm3 ; illegal pmacssdql xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacsswd xmm1, xmm2, xmm1, xmm3 ; illegal pmacsswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacssww xmm1, xmm2, xmm1, xmm3 ; illegal pmacssww xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacswd xmm1, xmm2, xmm1, xmm3 ; illegal pmacswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacsww xmm1, xmm2, xmm1, xmm3 ; illegal pmacsww xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmadcsswd xmm1, xmm2, xmm1, xmm3 ; illegal pmadcsswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmadcswd xmm1, xmm2, xmm1, xmm3 ; illegal pmadcswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pperm xmm1, xmm2, xmm1, xmm3 ; illegal pperm xmm1, xmm2, xmm3, xmm3 ; illegal pperm xmm1, xmm2, xmm2, xmm3 ; illegal
32.478632
60
0.712105
4821c8c2da9ac909d9b53820866b13917c1fa374
103,348
asm
Assembly
ls.asm
hprem991/System-Call
314a0ee2825ef7627ede64bed85ebb616f6d30f0
[ "MIT-0" ]
1
2017-05-20T02:46:40.000Z
2017-05-20T02:46:40.000Z
ls.asm
hprem991/System-Call
314a0ee2825ef7627ede64bed85ebb616f6d30f0
[ "MIT-0" ]
null
null
null
ls.asm
hprem991/System-Call
314a0ee2825ef7627ede64bed85ebb616f6d30f0
[ "MIT-0" ]
null
null
null
_ls: file format elf32-i386 Disassembly of section .text: 00000000 <fmtname>: #include "user.h" #include "fs.h" char* fmtname(char *path) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 53 push %ebx 4: 83 ec 14 sub $0x14,%esp static char buf[DIRSIZ+1]; char *p; // Find first character after last slash. for(p=path+strlen(path); p >= path && *p != '/'; p--) 7: 83 ec 0c sub $0xc,%esp a: ff 75 08 pushl 0x8(%ebp) d: e8 c9 03 00 00 call 3db <strlen> 12: 83 c4 10 add $0x10,%esp 15: 89 c2 mov %eax,%edx 17: 8b 45 08 mov 0x8(%ebp),%eax 1a: 01 d0 add %edx,%eax 1c: 89 45 f4 mov %eax,-0xc(%ebp) 1f: eb 04 jmp 25 <fmtname+0x25> 21: 83 6d f4 01 subl $0x1,-0xc(%ebp) 25: 8b 45 f4 mov -0xc(%ebp),%eax 28: 3b 45 08 cmp 0x8(%ebp),%eax 2b: 72 0a jb 37 <fmtname+0x37> 2d: 8b 45 f4 mov -0xc(%ebp),%eax 30: 0f b6 00 movzbl (%eax),%eax 33: 3c 2f cmp $0x2f,%al 35: 75 ea jne 21 <fmtname+0x21> ; p++; 37: 83 45 f4 01 addl $0x1,-0xc(%ebp) // Return blank-padded name. if(strlen(p) >= DIRSIZ) 3b: 83 ec 0c sub $0xc,%esp 3e: ff 75 f4 pushl -0xc(%ebp) 41: e8 95 03 00 00 call 3db <strlen> 46: 83 c4 10 add $0x10,%esp 49: 83 f8 0d cmp $0xd,%eax 4c: 76 05 jbe 53 <fmtname+0x53> return p; 4e: 8b 45 f4 mov -0xc(%ebp),%eax 51: eb 60 jmp b3 <fmtname+0xb3> memmove(buf, p, strlen(p)); 53: 83 ec 0c sub $0xc,%esp 56: ff 75 f4 pushl -0xc(%ebp) 59: e8 7d 03 00 00 call 3db <strlen> 5e: 83 c4 10 add $0x10,%esp 61: 83 ec 04 sub $0x4,%esp 64: 50 push %eax 65: ff 75 f4 pushl -0xc(%ebp) 68: 68 d0 14 00 00 push $0x14d0 6d: e8 e6 04 00 00 call 558 <memmove> 72: 83 c4 10 add $0x10,%esp memset(buf+strlen(p), ' ', DIRSIZ-strlen(p)); 75: 83 ec 0c sub $0xc,%esp 78: ff 75 f4 pushl -0xc(%ebp) 7b: e8 5b 03 00 00 call 3db <strlen> 80: 83 c4 10 add $0x10,%esp 83: ba 0e 00 00 00 mov $0xe,%edx 88: 89 d3 mov %edx,%ebx 8a: 29 c3 sub %eax,%ebx 8c: 83 ec 0c sub $0xc,%esp 8f: ff 75 f4 pushl -0xc(%ebp) 92: e8 44 03 00 00 call 3db <strlen> 97: 83 c4 10 add $0x10,%esp 9a: 05 d0 14 00 00 add $0x14d0,%eax 9f: 83 ec 04 sub $0x4,%esp a2: 53 push %ebx a3: 6a 20 push $0x20 a5: 50 push %eax a6: e8 57 03 00 00 call 402 <memset> ab: 83 c4 10 add $0x10,%esp return buf; ae: b8 d0 14 00 00 mov $0x14d0,%eax } b3: 8b 5d fc mov -0x4(%ebp),%ebx b6: c9 leave b7: c3 ret 000000b8 <ls>: void ls(char *path) { b8: 55 push %ebp b9: 89 e5 mov %esp,%ebp bb: 57 push %edi bc: 56 push %esi bd: 53 push %ebx be: 81 ec 3c 02 00 00 sub $0x23c,%esp char buf[512], *p; int fd; struct dirent de; struct stat st; if((fd = open(path, 0)) < 0){ c4: 83 ec 08 sub $0x8,%esp c7: 6a 00 push $0x0 c9: ff 75 08 pushl 0x8(%ebp) cc: e8 0c 05 00 00 call 5dd <open> d1: 83 c4 10 add $0x10,%esp d4: 89 45 e4 mov %eax,-0x1c(%ebp) d7: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) db: 79 1a jns f7 <ls+0x3f> printf(2, "ls: cannot open %s\n", path); dd: 83 ec 04 sub $0x4,%esp e0: ff 75 08 pushl 0x8(%ebp) e3: 68 c8 11 00 00 push $0x11c8 e8: 6a 02 push $0x2 ea: e8 23 0d 00 00 call e12 <printf> ef: 83 c4 10 add $0x10,%esp return; f2: e9 e3 01 00 00 jmp 2da <ls+0x222> } if(fstat(fd, &st) < 0){ f7: 83 ec 08 sub $0x8,%esp fa: 8d 85 bc fd ff ff lea -0x244(%ebp),%eax 100: 50 push %eax 101: ff 75 e4 pushl -0x1c(%ebp) 104: e8 ec 04 00 00 call 5f5 <fstat> 109: 83 c4 10 add $0x10,%esp 10c: 85 c0 test %eax,%eax 10e: 79 28 jns 138 <ls+0x80> printf(2, "ls: cannot stat %s\n", path); 110: 83 ec 04 sub $0x4,%esp 113: ff 75 08 pushl 0x8(%ebp) 116: 68 dc 11 00 00 push $0x11dc 11b: 6a 02 push $0x2 11d: e8 f0 0c 00 00 call e12 <printf> 122: 83 c4 10 add $0x10,%esp close(fd); 125: 83 ec 0c sub $0xc,%esp 128: ff 75 e4 pushl -0x1c(%ebp) 12b: e8 95 04 00 00 call 5c5 <close> 130: 83 c4 10 add $0x10,%esp return; 133: e9 a2 01 00 00 jmp 2da <ls+0x222> } switch(st.type){ 138: 0f b7 85 bc fd ff ff movzwl -0x244(%ebp),%eax 13f: 98 cwtl 140: 83 f8 01 cmp $0x1,%eax 143: 74 48 je 18d <ls+0xd5> 145: 83 f8 02 cmp $0x2,%eax 148: 0f 85 7e 01 00 00 jne 2cc <ls+0x214> case T_FILE: printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size); 14e: 8b bd cc fd ff ff mov -0x234(%ebp),%edi 154: 8b b5 c4 fd ff ff mov -0x23c(%ebp),%esi 15a: 0f b7 85 bc fd ff ff movzwl -0x244(%ebp),%eax 161: 0f bf d8 movswl %ax,%ebx 164: 83 ec 0c sub $0xc,%esp 167: ff 75 08 pushl 0x8(%ebp) 16a: e8 91 fe ff ff call 0 <fmtname> 16f: 83 c4 10 add $0x10,%esp 172: 83 ec 08 sub $0x8,%esp 175: 57 push %edi 176: 56 push %esi 177: 53 push %ebx 178: 50 push %eax 179: 68 f0 11 00 00 push $0x11f0 17e: 6a 01 push $0x1 180: e8 8d 0c 00 00 call e12 <printf> 185: 83 c4 20 add $0x20,%esp break; 188: e9 3f 01 00 00 jmp 2cc <ls+0x214> case T_DIR: if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){ 18d: 83 ec 0c sub $0xc,%esp 190: ff 75 08 pushl 0x8(%ebp) 193: e8 43 02 00 00 call 3db <strlen> 198: 83 c4 10 add $0x10,%esp 19b: 83 c0 10 add $0x10,%eax 19e: 3d 00 02 00 00 cmp $0x200,%eax 1a3: 76 17 jbe 1bc <ls+0x104> printf(1, "ls: path too long\n"); 1a5: 83 ec 08 sub $0x8,%esp 1a8: 68 fd 11 00 00 push $0x11fd 1ad: 6a 01 push $0x1 1af: e8 5e 0c 00 00 call e12 <printf> 1b4: 83 c4 10 add $0x10,%esp break; 1b7: e9 10 01 00 00 jmp 2cc <ls+0x214> } strcpy(buf, path); 1bc: 83 ec 08 sub $0x8,%esp 1bf: ff 75 08 pushl 0x8(%ebp) 1c2: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 1c8: 50 push %eax 1c9: e8 9e 01 00 00 call 36c <strcpy> 1ce: 83 c4 10 add $0x10,%esp p = buf+strlen(buf); 1d1: 83 ec 0c sub $0xc,%esp 1d4: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 1da: 50 push %eax 1db: e8 fb 01 00 00 call 3db <strlen> 1e0: 83 c4 10 add $0x10,%esp 1e3: 89 c2 mov %eax,%edx 1e5: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 1eb: 01 d0 add %edx,%eax 1ed: 89 45 e0 mov %eax,-0x20(%ebp) *p++ = '/'; 1f0: 8b 45 e0 mov -0x20(%ebp),%eax 1f3: 8d 50 01 lea 0x1(%eax),%edx 1f6: 89 55 e0 mov %edx,-0x20(%ebp) 1f9: c6 00 2f movb $0x2f,(%eax) while(read(fd, &de, sizeof(de)) == sizeof(de)){ 1fc: e9 aa 00 00 00 jmp 2ab <ls+0x1f3> if(de.inum == 0) 201: 0f b7 85 d0 fd ff ff movzwl -0x230(%ebp),%eax 208: 66 85 c0 test %ax,%ax 20b: 75 05 jne 212 <ls+0x15a> continue; 20d: e9 99 00 00 00 jmp 2ab <ls+0x1f3> memmove(p, de.name, DIRSIZ); 212: 83 ec 04 sub $0x4,%esp 215: 6a 0e push $0xe 217: 8d 85 d0 fd ff ff lea -0x230(%ebp),%eax 21d: 83 c0 02 add $0x2,%eax 220: 50 push %eax 221: ff 75 e0 pushl -0x20(%ebp) 224: e8 2f 03 00 00 call 558 <memmove> 229: 83 c4 10 add $0x10,%esp p[DIRSIZ] = 0; 22c: 8b 45 e0 mov -0x20(%ebp),%eax 22f: 83 c0 0e add $0xe,%eax 232: c6 00 00 movb $0x0,(%eax) if(stat(buf, &st) < 0){ 235: 83 ec 08 sub $0x8,%esp 238: 8d 85 bc fd ff ff lea -0x244(%ebp),%eax 23e: 50 push %eax 23f: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 245: 50 push %eax 246: e8 73 02 00 00 call 4be <stat> 24b: 83 c4 10 add $0x10,%esp 24e: 85 c0 test %eax,%eax 250: 79 1b jns 26d <ls+0x1b5> printf(1, "ls: cannot stat %s\n", buf); 252: 83 ec 04 sub $0x4,%esp 255: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 25b: 50 push %eax 25c: 68 dc 11 00 00 push $0x11dc 261: 6a 01 push $0x1 263: e8 aa 0b 00 00 call e12 <printf> 268: 83 c4 10 add $0x10,%esp continue; 26b: eb 3e jmp 2ab <ls+0x1f3> } printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size); 26d: 8b bd cc fd ff ff mov -0x234(%ebp),%edi 273: 8b b5 c4 fd ff ff mov -0x23c(%ebp),%esi 279: 0f b7 85 bc fd ff ff movzwl -0x244(%ebp),%eax 280: 0f bf d8 movswl %ax,%ebx 283: 83 ec 0c sub $0xc,%esp 286: 8d 85 e0 fd ff ff lea -0x220(%ebp),%eax 28c: 50 push %eax 28d: e8 6e fd ff ff call 0 <fmtname> 292: 83 c4 10 add $0x10,%esp 295: 83 ec 08 sub $0x8,%esp 298: 57 push %edi 299: 56 push %esi 29a: 53 push %ebx 29b: 50 push %eax 29c: 68 f0 11 00 00 push $0x11f0 2a1: 6a 01 push $0x1 2a3: e8 6a 0b 00 00 call e12 <printf> 2a8: 83 c4 20 add $0x20,%esp break; } strcpy(buf, path); p = buf+strlen(buf); *p++ = '/'; while(read(fd, &de, sizeof(de)) == sizeof(de)){ 2ab: 83 ec 04 sub $0x4,%esp 2ae: 6a 10 push $0x10 2b0: 8d 85 d0 fd ff ff lea -0x230(%ebp),%eax 2b6: 50 push %eax 2b7: ff 75 e4 pushl -0x1c(%ebp) 2ba: e8 f6 02 00 00 call 5b5 <read> 2bf: 83 c4 10 add $0x10,%esp 2c2: 83 f8 10 cmp $0x10,%eax 2c5: 0f 84 36 ff ff ff je 201 <ls+0x149> printf(1, "ls: cannot stat %s\n", buf); continue; } printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size); } break; 2cb: 90 nop } close(fd); 2cc: 83 ec 0c sub $0xc,%esp 2cf: ff 75 e4 pushl -0x1c(%ebp) 2d2: e8 ee 02 00 00 call 5c5 <close> 2d7: 83 c4 10 add $0x10,%esp } 2da: 8d 65 f4 lea -0xc(%ebp),%esp 2dd: 5b pop %ebx 2de: 5e pop %esi 2df: 5f pop %edi 2e0: 5d pop %ebp 2e1: c3 ret 000002e2 <main>: int main(int argc, char *argv[]) { 2e2: 8d 4c 24 04 lea 0x4(%esp),%ecx 2e6: 83 e4 f0 and $0xfffffff0,%esp 2e9: ff 71 fc pushl -0x4(%ecx) 2ec: 55 push %ebp 2ed: 89 e5 mov %esp,%ebp 2ef: 53 push %ebx 2f0: 51 push %ecx 2f1: 83 ec 10 sub $0x10,%esp 2f4: 89 cb mov %ecx,%ebx int i; if(argc < 2){ 2f6: 83 3b 01 cmpl $0x1,(%ebx) 2f9: 7f 15 jg 310 <main+0x2e> ls("."); 2fb: 83 ec 0c sub $0xc,%esp 2fe: 68 10 12 00 00 push $0x1210 303: e8 b0 fd ff ff call b8 <ls> 308: 83 c4 10 add $0x10,%esp exit(); 30b: e8 8d 02 00 00 call 59d <exit> } for(i=1; i<argc; i++) 310: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp) 317: eb 21 jmp 33a <main+0x58> ls(argv[i]); 319: 8b 45 f4 mov -0xc(%ebp),%eax 31c: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx 323: 8b 43 04 mov 0x4(%ebx),%eax 326: 01 d0 add %edx,%eax 328: 8b 00 mov (%eax),%eax 32a: 83 ec 0c sub $0xc,%esp 32d: 50 push %eax 32e: e8 85 fd ff ff call b8 <ls> 333: 83 c4 10 add $0x10,%esp if(argc < 2){ ls("."); exit(); } for(i=1; i<argc; i++) 336: 83 45 f4 01 addl $0x1,-0xc(%ebp) 33a: 8b 45 f4 mov -0xc(%ebp),%eax 33d: 3b 03 cmp (%ebx),%eax 33f: 7c d8 jl 319 <main+0x37> ls(argv[i]); exit(); 341: e8 57 02 00 00 call 59d <exit> 00000346 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 346: 55 push %ebp 347: 89 e5 mov %esp,%ebp 349: 57 push %edi 34a: 53 push %ebx asm volatile("cld; rep stosb" : 34b: 8b 4d 08 mov 0x8(%ebp),%ecx 34e: 8b 55 10 mov 0x10(%ebp),%edx 351: 8b 45 0c mov 0xc(%ebp),%eax 354: 89 cb mov %ecx,%ebx 356: 89 df mov %ebx,%edi 358: 89 d1 mov %edx,%ecx 35a: fc cld 35b: f3 aa rep stos %al,%es:(%edi) 35d: 89 ca mov %ecx,%edx 35f: 89 fb mov %edi,%ebx 361: 89 5d 08 mov %ebx,0x8(%ebp) 364: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 367: 90 nop 368: 5b pop %ebx 369: 5f pop %edi 36a: 5d pop %ebp 36b: c3 ret 0000036c <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 36c: 55 push %ebp 36d: 89 e5 mov %esp,%ebp 36f: 83 ec 10 sub $0x10,%esp char *os; os = s; 372: 8b 45 08 mov 0x8(%ebp),%eax 375: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 378: 90 nop 379: 8b 45 08 mov 0x8(%ebp),%eax 37c: 8d 50 01 lea 0x1(%eax),%edx 37f: 89 55 08 mov %edx,0x8(%ebp) 382: 8b 55 0c mov 0xc(%ebp),%edx 385: 8d 4a 01 lea 0x1(%edx),%ecx 388: 89 4d 0c mov %ecx,0xc(%ebp) 38b: 0f b6 12 movzbl (%edx),%edx 38e: 88 10 mov %dl,(%eax) 390: 0f b6 00 movzbl (%eax),%eax 393: 84 c0 test %al,%al 395: 75 e2 jne 379 <strcpy+0xd> ; return os; 397: 8b 45 fc mov -0x4(%ebp),%eax } 39a: c9 leave 39b: c3 ret 0000039c <strcmp>: int strcmp(const char *p, const char *q) { 39c: 55 push %ebp 39d: 89 e5 mov %esp,%ebp while(*p && *p == *q) 39f: eb 08 jmp 3a9 <strcmp+0xd> p++, q++; 3a1: 83 45 08 01 addl $0x1,0x8(%ebp) 3a5: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 3a9: 8b 45 08 mov 0x8(%ebp),%eax 3ac: 0f b6 00 movzbl (%eax),%eax 3af: 84 c0 test %al,%al 3b1: 74 10 je 3c3 <strcmp+0x27> 3b3: 8b 45 08 mov 0x8(%ebp),%eax 3b6: 0f b6 10 movzbl (%eax),%edx 3b9: 8b 45 0c mov 0xc(%ebp),%eax 3bc: 0f b6 00 movzbl (%eax),%eax 3bf: 38 c2 cmp %al,%dl 3c1: 74 de je 3a1 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 3c3: 8b 45 08 mov 0x8(%ebp),%eax 3c6: 0f b6 00 movzbl (%eax),%eax 3c9: 0f b6 d0 movzbl %al,%edx 3cc: 8b 45 0c mov 0xc(%ebp),%eax 3cf: 0f b6 00 movzbl (%eax),%eax 3d2: 0f b6 c0 movzbl %al,%eax 3d5: 29 c2 sub %eax,%edx 3d7: 89 d0 mov %edx,%eax } 3d9: 5d pop %ebp 3da: c3 ret 000003db <strlen>: uint strlen(char *s) { 3db: 55 push %ebp 3dc: 89 e5 mov %esp,%ebp 3de: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 3e1: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 3e8: eb 04 jmp 3ee <strlen+0x13> 3ea: 83 45 fc 01 addl $0x1,-0x4(%ebp) 3ee: 8b 55 fc mov -0x4(%ebp),%edx 3f1: 8b 45 08 mov 0x8(%ebp),%eax 3f4: 01 d0 add %edx,%eax 3f6: 0f b6 00 movzbl (%eax),%eax 3f9: 84 c0 test %al,%al 3fb: 75 ed jne 3ea <strlen+0xf> ; return n; 3fd: 8b 45 fc mov -0x4(%ebp),%eax } 400: c9 leave 401: c3 ret 00000402 <memset>: void* memset(void *dst, int c, uint n) { 402: 55 push %ebp 403: 89 e5 mov %esp,%ebp stosb(dst, c, n); 405: 8b 45 10 mov 0x10(%ebp),%eax 408: 50 push %eax 409: ff 75 0c pushl 0xc(%ebp) 40c: ff 75 08 pushl 0x8(%ebp) 40f: e8 32 ff ff ff call 346 <stosb> 414: 83 c4 0c add $0xc,%esp return dst; 417: 8b 45 08 mov 0x8(%ebp),%eax } 41a: c9 leave 41b: c3 ret 0000041c <strchr>: char* strchr(const char *s, char c) { 41c: 55 push %ebp 41d: 89 e5 mov %esp,%ebp 41f: 83 ec 04 sub $0x4,%esp 422: 8b 45 0c mov 0xc(%ebp),%eax 425: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 428: eb 14 jmp 43e <strchr+0x22> if(*s == c) 42a: 8b 45 08 mov 0x8(%ebp),%eax 42d: 0f b6 00 movzbl (%eax),%eax 430: 3a 45 fc cmp -0x4(%ebp),%al 433: 75 05 jne 43a <strchr+0x1e> return (char*)s; 435: 8b 45 08 mov 0x8(%ebp),%eax 438: eb 13 jmp 44d <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 43a: 83 45 08 01 addl $0x1,0x8(%ebp) 43e: 8b 45 08 mov 0x8(%ebp),%eax 441: 0f b6 00 movzbl (%eax),%eax 444: 84 c0 test %al,%al 446: 75 e2 jne 42a <strchr+0xe> if(*s == c) return (char*)s; return 0; 448: b8 00 00 00 00 mov $0x0,%eax } 44d: c9 leave 44e: c3 ret 0000044f <gets>: char* gets(char *buf, int max) { 44f: 55 push %ebp 450: 89 e5 mov %esp,%ebp 452: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 455: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 45c: eb 42 jmp 4a0 <gets+0x51> cc = read(0, &c, 1); 45e: 83 ec 04 sub $0x4,%esp 461: 6a 01 push $0x1 463: 8d 45 ef lea -0x11(%ebp),%eax 466: 50 push %eax 467: 6a 00 push $0x0 469: e8 47 01 00 00 call 5b5 <read> 46e: 83 c4 10 add $0x10,%esp 471: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 474: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 478: 7e 33 jle 4ad <gets+0x5e> break; buf[i++] = c; 47a: 8b 45 f4 mov -0xc(%ebp),%eax 47d: 8d 50 01 lea 0x1(%eax),%edx 480: 89 55 f4 mov %edx,-0xc(%ebp) 483: 89 c2 mov %eax,%edx 485: 8b 45 08 mov 0x8(%ebp),%eax 488: 01 c2 add %eax,%edx 48a: 0f b6 45 ef movzbl -0x11(%ebp),%eax 48e: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 490: 0f b6 45 ef movzbl -0x11(%ebp),%eax 494: 3c 0a cmp $0xa,%al 496: 74 16 je 4ae <gets+0x5f> 498: 0f b6 45 ef movzbl -0x11(%ebp),%eax 49c: 3c 0d cmp $0xd,%al 49e: 74 0e je 4ae <gets+0x5f> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 4a0: 8b 45 f4 mov -0xc(%ebp),%eax 4a3: 83 c0 01 add $0x1,%eax 4a6: 3b 45 0c cmp 0xc(%ebp),%eax 4a9: 7c b3 jl 45e <gets+0xf> 4ab: eb 01 jmp 4ae <gets+0x5f> cc = read(0, &c, 1); if(cc < 1) break; 4ad: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 4ae: 8b 55 f4 mov -0xc(%ebp),%edx 4b1: 8b 45 08 mov 0x8(%ebp),%eax 4b4: 01 d0 add %edx,%eax 4b6: c6 00 00 movb $0x0,(%eax) return buf; 4b9: 8b 45 08 mov 0x8(%ebp),%eax } 4bc: c9 leave 4bd: c3 ret 000004be <stat>: int stat(char *n, struct stat *st) { 4be: 55 push %ebp 4bf: 89 e5 mov %esp,%ebp 4c1: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 4c4: 83 ec 08 sub $0x8,%esp 4c7: 6a 00 push $0x0 4c9: ff 75 08 pushl 0x8(%ebp) 4cc: e8 0c 01 00 00 call 5dd <open> 4d1: 83 c4 10 add $0x10,%esp 4d4: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 4d7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 4db: 79 07 jns 4e4 <stat+0x26> return -1; 4dd: b8 ff ff ff ff mov $0xffffffff,%eax 4e2: eb 25 jmp 509 <stat+0x4b> r = fstat(fd, st); 4e4: 83 ec 08 sub $0x8,%esp 4e7: ff 75 0c pushl 0xc(%ebp) 4ea: ff 75 f4 pushl -0xc(%ebp) 4ed: e8 03 01 00 00 call 5f5 <fstat> 4f2: 83 c4 10 add $0x10,%esp 4f5: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 4f8: 83 ec 0c sub $0xc,%esp 4fb: ff 75 f4 pushl -0xc(%ebp) 4fe: e8 c2 00 00 00 call 5c5 <close> 503: 83 c4 10 add $0x10,%esp return r; 506: 8b 45 f0 mov -0x10(%ebp),%eax } 509: c9 leave 50a: c3 ret 0000050b <atoi>: int atoi(const char *s) { 50b: 55 push %ebp 50c: 89 e5 mov %esp,%ebp 50e: 83 ec 10 sub $0x10,%esp int n; n = 0; 511: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 518: eb 25 jmp 53f <atoi+0x34> n = n*10 + *s++ - '0'; 51a: 8b 55 fc mov -0x4(%ebp),%edx 51d: 89 d0 mov %edx,%eax 51f: c1 e0 02 shl $0x2,%eax 522: 01 d0 add %edx,%eax 524: 01 c0 add %eax,%eax 526: 89 c1 mov %eax,%ecx 528: 8b 45 08 mov 0x8(%ebp),%eax 52b: 8d 50 01 lea 0x1(%eax),%edx 52e: 89 55 08 mov %edx,0x8(%ebp) 531: 0f b6 00 movzbl (%eax),%eax 534: 0f be c0 movsbl %al,%eax 537: 01 c8 add %ecx,%eax 539: 83 e8 30 sub $0x30,%eax 53c: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 53f: 8b 45 08 mov 0x8(%ebp),%eax 542: 0f b6 00 movzbl (%eax),%eax 545: 3c 2f cmp $0x2f,%al 547: 7e 0a jle 553 <atoi+0x48> 549: 8b 45 08 mov 0x8(%ebp),%eax 54c: 0f b6 00 movzbl (%eax),%eax 54f: 3c 39 cmp $0x39,%al 551: 7e c7 jle 51a <atoi+0xf> n = n*10 + *s++ - '0'; return n; 553: 8b 45 fc mov -0x4(%ebp),%eax } 556: c9 leave 557: c3 ret 00000558 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 558: 55 push %ebp 559: 89 e5 mov %esp,%ebp 55b: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 55e: 8b 45 08 mov 0x8(%ebp),%eax 561: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 564: 8b 45 0c mov 0xc(%ebp),%eax 567: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 56a: eb 17 jmp 583 <memmove+0x2b> *dst++ = *src++; 56c: 8b 45 fc mov -0x4(%ebp),%eax 56f: 8d 50 01 lea 0x1(%eax),%edx 572: 89 55 fc mov %edx,-0x4(%ebp) 575: 8b 55 f8 mov -0x8(%ebp),%edx 578: 8d 4a 01 lea 0x1(%edx),%ecx 57b: 89 4d f8 mov %ecx,-0x8(%ebp) 57e: 0f b6 12 movzbl (%edx),%edx 581: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 583: 8b 45 10 mov 0x10(%ebp),%eax 586: 8d 50 ff lea -0x1(%eax),%edx 589: 89 55 10 mov %edx,0x10(%ebp) 58c: 85 c0 test %eax,%eax 58e: 7f dc jg 56c <memmove+0x14> *dst++ = *src++; return vdst; 590: 8b 45 08 mov 0x8(%ebp),%eax } 593: c9 leave 594: c3 ret 00000595 <fork>: name : movl $str_ ## name, %eax; \ int $T_CS550HTSYSCALL; \ ret SYSCALL(fork) 595: b8 01 00 00 00 mov $0x1,%eax 59a: cd 40 int $0x40 59c: c3 ret 0000059d <exit>: SYSCALL(exit) 59d: b8 02 00 00 00 mov $0x2,%eax 5a2: cd 40 int $0x40 5a4: c3 ret 000005a5 <wait>: SYSCALL(wait) 5a5: b8 03 00 00 00 mov $0x3,%eax 5aa: cd 40 int $0x40 5ac: c3 ret 000005ad <pipe>: SYSCALL(pipe) 5ad: b8 04 00 00 00 mov $0x4,%eax 5b2: cd 40 int $0x40 5b4: c3 ret 000005b5 <read>: SYSCALL(read) 5b5: b8 05 00 00 00 mov $0x5,%eax 5ba: cd 40 int $0x40 5bc: c3 ret 000005bd <write>: SYSCALL(write) 5bd: b8 10 00 00 00 mov $0x10,%eax 5c2: cd 40 int $0x40 5c4: c3 ret 000005c5 <close>: SYSCALL(close) 5c5: b8 15 00 00 00 mov $0x15,%eax 5ca: cd 40 int $0x40 5cc: c3 ret 000005cd <kill>: SYSCALL(kill) 5cd: b8 06 00 00 00 mov $0x6,%eax 5d2: cd 40 int $0x40 5d4: c3 ret 000005d5 <exec>: SYSCALL(exec) 5d5: b8 07 00 00 00 mov $0x7,%eax 5da: cd 40 int $0x40 5dc: c3 ret 000005dd <open>: SYSCALL(open) 5dd: b8 0f 00 00 00 mov $0xf,%eax 5e2: cd 40 int $0x40 5e4: c3 ret 000005e5 <mknod>: SYSCALL(mknod) 5e5: b8 11 00 00 00 mov $0x11,%eax 5ea: cd 40 int $0x40 5ec: c3 ret 000005ed <unlink>: SYSCALL(unlink) 5ed: b8 12 00 00 00 mov $0x12,%eax 5f2: cd 40 int $0x40 5f4: c3 ret 000005f5 <fstat>: SYSCALL(fstat) 5f5: b8 08 00 00 00 mov $0x8,%eax 5fa: cd 40 int $0x40 5fc: c3 ret 000005fd <link>: SYSCALL(link) 5fd: b8 13 00 00 00 mov $0x13,%eax 602: cd 40 int $0x40 604: c3 ret 00000605 <mkdir>: SYSCALL(mkdir) 605: b8 14 00 00 00 mov $0x14,%eax 60a: cd 40 int $0x40 60c: c3 ret 0000060d <chdir>: SYSCALL(chdir) 60d: b8 09 00 00 00 mov $0x9,%eax 612: cd 40 int $0x40 614: c3 ret 00000615 <dup>: SYSCALL(dup) 615: b8 0a 00 00 00 mov $0xa,%eax 61a: cd 40 int $0x40 61c: c3 ret 0000061d <getpid>: SYSCALL(getpid) 61d: b8 0b 00 00 00 mov $0xb,%eax 622: cd 40 int $0x40 624: c3 ret 00000625 <sbrk>: SYSCALL(sbrk) 625: b8 0c 00 00 00 mov $0xc,%eax 62a: cd 40 int $0x40 62c: c3 ret 0000062d <sleep>: SYSCALL(sleep) 62d: b8 0d 00 00 00 mov $0xd,%eax 632: cd 40 int $0x40 634: c3 ret 00000635 <uptime>: SYSCALL(uptime) 635: b8 0e 00 00 00 mov $0xe,%eax 63a: cd 40 int $0x40 63c: c3 ret 0000063d <date>: // Assignment starts here SYSCALL(date) 63d: b8 16 00 00 00 mov $0x16,%eax 642: cd 40 int $0x40 644: c3 ret 00000645 <str_ls_call1>: 645: 6c insb (%dx),%es:(%edi) 646: 73 5f jae 6a7 <ls_call6+0x4> 648: 63 61 6c arpl %sp,0x6c(%ecx) 64b: 6c insb (%dx),%es:(%edi) 64c: 31 00 xor %eax,(%eax) 0000064e <ls_call1>: // ls call CS550LSSYSCALL(ls_call1) 64e: b8 45 06 00 00 mov $0x645,%eax 653: cd 41 int $0x41 655: c3 ret 00000656 <str_ls_call2>: 656: 6c insb (%dx),%es:(%edi) 657: 73 5f jae 6b8 <ls_call7+0x4> 659: 63 61 6c arpl %sp,0x6c(%ecx) 65c: 6c insb (%dx),%es:(%edi) 65d: 32 00 xor (%eax),%al 0000065f <ls_call2>: CS550LSSYSCALL(ls_call2) 65f: b8 56 06 00 00 mov $0x656,%eax 664: cd 41 int $0x41 666: c3 ret 00000667 <str_ls_call3>: 667: 6c insb (%dx),%es:(%edi) 668: 73 5f jae 6c9 <ls_call8+0x4> 66a: 63 61 6c arpl %sp,0x6c(%ecx) 66d: 6c insb (%dx),%es:(%edi) 66e: 33 00 xor (%eax),%eax 00000670 <ls_call3>: CS550LSSYSCALL(ls_call3) 670: b8 67 06 00 00 mov $0x667,%eax 675: cd 41 int $0x41 677: c3 ret 00000678 <str_ls_call4>: 678: 6c insb (%dx),%es:(%edi) 679: 73 5f jae 6da <ls_call9+0x4> 67b: 63 61 6c arpl %sp,0x6c(%ecx) 67e: 6c insb (%dx),%es:(%edi) 67f: 34 00 xor $0x0,%al 00000681 <ls_call4>: CS550LSSYSCALL(ls_call4) 681: b8 78 06 00 00 mov $0x678,%eax 686: cd 41 int $0x41 688: c3 ret 00000689 <str_ls_call5>: 689: 6c insb (%dx),%es:(%edi) 68a: 73 5f jae 6eb <ls_call10+0x3> 68c: 63 61 6c arpl %sp,0x6c(%ecx) 68f: 6c insb (%dx),%es:(%edi) 690: 35 .byte 0x35 ... 00000692 <ls_call5>: CS550LSSYSCALL(ls_call5) 692: b8 89 06 00 00 mov $0x689,%eax 697: cd 41 int $0x41 699: c3 ret 0000069a <str_ls_call6>: 69a: 6c insb (%dx),%es:(%edi) 69b: 73 5f jae 6fc <ls_call11+0x2> 69d: 63 61 6c arpl %sp,0x6c(%ecx) 6a0: 6c insb (%dx),%es:(%edi) 6a1: 36 ss ... 000006a3 <ls_call6>: CS550LSSYSCALL(ls_call6) 6a3: b8 9a 06 00 00 mov $0x69a,%eax 6a8: cd 41 int $0x41 6aa: c3 ret 000006ab <str_ls_call7>: 6ab: 6c insb (%dx),%es:(%edi) 6ac: 73 5f jae 70d <ls_call12+0x1> 6ae: 63 61 6c arpl %sp,0x6c(%ecx) 6b1: 6c insb (%dx),%es:(%edi) 6b2: 37 aaa ... 000006b4 <ls_call7>: CS550LSSYSCALL(ls_call7) 6b4: b8 ab 06 00 00 mov $0x6ab,%eax 6b9: cd 41 int $0x41 6bb: c3 ret 000006bc <str_ls_call8>: 6bc: 6c insb (%dx),%es:(%edi) 6bd: 73 5f jae 71e <ls_call13> 6bf: 63 61 6c arpl %sp,0x6c(%ecx) 6c2: 6c insb (%dx),%es:(%edi) 6c3: 38 00 cmp %al,(%eax) 000006c5 <ls_call8>: CS550LSSYSCALL(ls_call8) 6c5: b8 bc 06 00 00 mov $0x6bc,%eax 6ca: cd 41 int $0x41 6cc: c3 ret 000006cd <str_ls_call9>: 6cd: 6c insb (%dx),%es:(%edi) 6ce: 73 5f jae 72f <str_ls_call14+0x9> 6d0: 63 61 6c arpl %sp,0x6c(%ecx) 6d3: 6c insb (%dx),%es:(%edi) 6d4: 39 00 cmp %eax,(%eax) 000006d6 <ls_call9>: CS550LSSYSCALL(ls_call9) 6d6: b8 cd 06 00 00 mov $0x6cd,%eax 6db: cd 41 int $0x41 6dd: c3 ret 000006de <str_ls_call10>: 6de: 6c insb (%dx),%es:(%edi) 6df: 73 5f jae 740 <str_ls_call15+0x8> 6e1: 63 61 6c arpl %sp,0x6c(%ecx) 6e4: 6c insb (%dx),%es:(%edi) 6e5: 31 30 xor %esi,(%eax) ... 000006e8 <ls_call10>: CS550LSSYSCALL(ls_call10) 6e8: b8 de 06 00 00 mov $0x6de,%eax 6ed: cd 41 int $0x41 6ef: c3 ret 000006f0 <str_ls_call11>: 6f0: 6c insb (%dx),%es:(%edi) 6f1: 73 5f jae 752 <str_ls_call16+0x8> 6f3: 63 61 6c arpl %sp,0x6c(%ecx) 6f6: 6c insb (%dx),%es:(%edi) 6f7: 31 31 xor %esi,(%ecx) ... 000006fa <ls_call11>: CS550LSSYSCALL(ls_call11) 6fa: b8 f0 06 00 00 mov $0x6f0,%eax 6ff: cd 41 int $0x41 701: c3 ret 00000702 <str_ls_call12>: 702: 6c insb (%dx),%es:(%edi) 703: 73 5f jae 764 <str_ls_call17+0x8> 705: 63 61 6c arpl %sp,0x6c(%ecx) 708: 6c insb (%dx),%es:(%edi) 709: 31 32 xor %esi,(%edx) ... 0000070c <ls_call12>: CS550LSSYSCALL(ls_call12) 70c: b8 02 07 00 00 mov $0x702,%eax 711: cd 41 int $0x41 713: c3 ret 00000714 <str_ls_call13>: 714: 6c insb (%dx),%es:(%edi) 715: 73 5f jae 776 <str_ls_call18+0x8> 717: 63 61 6c arpl %sp,0x6c(%ecx) 71a: 6c insb (%dx),%es:(%edi) 71b: 31 33 xor %esi,(%ebx) ... 0000071e <ls_call13>: CS550LSSYSCALL(ls_call13) 71e: b8 14 07 00 00 mov $0x714,%eax 723: cd 41 int $0x41 725: c3 ret 00000726 <str_ls_call14>: 726: 6c insb (%dx),%es:(%edi) 727: 73 5f jae 788 <str_ls_call19+0x8> 729: 63 61 6c arpl %sp,0x6c(%ecx) 72c: 6c insb (%dx),%es:(%edi) 72d: 31 34 00 xor %esi,(%eax,%eax,1) 00000730 <ls_call14>: CS550LSSYSCALL(ls_call14) 730: b8 26 07 00 00 mov $0x726,%eax 735: cd 41 int $0x41 737: c3 ret 00000738 <str_ls_call15>: 738: 6c insb (%dx),%es:(%edi) 739: 73 5f jae 79a <str_ls_call20+0x8> 73b: 63 61 6c arpl %sp,0x6c(%ecx) 73e: 6c insb (%dx),%es:(%edi) 73f: 31 .byte 0x31 740: 35 .byte 0x35 ... 00000742 <ls_call15>: CS550LSSYSCALL(ls_call15) 742: b8 38 07 00 00 mov $0x738,%eax 747: cd 41 int $0x41 749: c3 ret 0000074a <str_ls_call16>: 74a: 6c insb (%dx),%es:(%edi) 74b: 73 5f jae 7ac <str_ls_call21+0x8> 74d: 63 61 6c arpl %sp,0x6c(%ecx) 750: 6c insb (%dx),%es:(%edi) 751: 31 36 xor %esi,(%esi) ... 00000754 <ls_call16>: CS550LSSYSCALL(ls_call16) 754: b8 4a 07 00 00 mov $0x74a,%eax 759: cd 41 int $0x41 75b: c3 ret 0000075c <str_ls_call17>: 75c: 6c insb (%dx),%es:(%edi) 75d: 73 5f jae 7be <str_ls_call22+0x8> 75f: 63 61 6c arpl %sp,0x6c(%ecx) 762: 6c insb (%dx),%es:(%edi) 763: 31 37 xor %esi,(%edi) ... 00000766 <ls_call17>: CS550LSSYSCALL(ls_call17) 766: b8 5c 07 00 00 mov $0x75c,%eax 76b: cd 41 int $0x41 76d: c3 ret 0000076e <str_ls_call18>: 76e: 6c insb (%dx),%es:(%edi) 76f: 73 5f jae 7d0 <str_ls_call23+0x8> 771: 63 61 6c arpl %sp,0x6c(%ecx) 774: 6c insb (%dx),%es:(%edi) 775: 31 38 xor %edi,(%eax) ... 00000778 <ls_call18>: CS550LSSYSCALL(ls_call18) 778: b8 6e 07 00 00 mov $0x76e,%eax 77d: cd 41 int $0x41 77f: c3 ret 00000780 <str_ls_call19>: 780: 6c insb (%dx),%es:(%edi) 781: 73 5f jae 7e2 <str_ls_call24+0x8> 783: 63 61 6c arpl %sp,0x6c(%ecx) 786: 6c insb (%dx),%es:(%edi) 787: 31 39 xor %edi,(%ecx) ... 0000078a <ls_call19>: CS550LSSYSCALL(ls_call19) 78a: b8 80 07 00 00 mov $0x780,%eax 78f: cd 41 int $0x41 791: c3 ret 00000792 <str_ls_call20>: 792: 6c insb (%dx),%es:(%edi) 793: 73 5f jae 7f4 <str_ls_call25+0x8> 795: 63 61 6c arpl %sp,0x6c(%ecx) 798: 6c insb (%dx),%es:(%edi) 799: 32 30 xor (%eax),%dh ... 0000079c <ls_call20>: CS550LSSYSCALL(ls_call20) 79c: b8 92 07 00 00 mov $0x792,%eax 7a1: cd 41 int $0x41 7a3: c3 ret 000007a4 <str_ls_call21>: 7a4: 6c insb (%dx),%es:(%edi) 7a5: 73 5f jae 806 <str_ls_call26+0x8> 7a7: 63 61 6c arpl %sp,0x6c(%ecx) 7aa: 6c insb (%dx),%es:(%edi) 7ab: 32 31 xor (%ecx),%dh ... 000007ae <ls_call21>: CS550LSSYSCALL(ls_call21) 7ae: b8 a4 07 00 00 mov $0x7a4,%eax 7b3: cd 41 int $0x41 7b5: c3 ret 000007b6 <str_ls_call22>: 7b6: 6c insb (%dx),%es:(%edi) 7b7: 73 5f jae 818 <str_ls_call27+0x8> 7b9: 63 61 6c arpl %sp,0x6c(%ecx) 7bc: 6c insb (%dx),%es:(%edi) 7bd: 32 32 xor (%edx),%dh ... 000007c0 <ls_call22>: CS550LSSYSCALL(ls_call22) 7c0: b8 b6 07 00 00 mov $0x7b6,%eax 7c5: cd 41 int $0x41 7c7: c3 ret 000007c8 <str_ls_call23>: 7c8: 6c insb (%dx),%es:(%edi) 7c9: 73 5f jae 82a <str_ls_call28+0x8> 7cb: 63 61 6c arpl %sp,0x6c(%ecx) 7ce: 6c insb (%dx),%es:(%edi) 7cf: 32 33 xor (%ebx),%dh ... 000007d2 <ls_call23>: CS550LSSYSCALL(ls_call23) 7d2: b8 c8 07 00 00 mov $0x7c8,%eax 7d7: cd 41 int $0x41 7d9: c3 ret 000007da <str_ls_call24>: 7da: 6c insb (%dx),%es:(%edi) 7db: 73 5f jae 83c <str_ls_call29+0x8> 7dd: 63 61 6c arpl %sp,0x6c(%ecx) 7e0: 6c insb (%dx),%es:(%edi) 7e1: 32 34 00 xor (%eax,%eax,1),%dh 000007e4 <ls_call24>: CS550LSSYSCALL(ls_call24) 7e4: b8 da 07 00 00 mov $0x7da,%eax 7e9: cd 41 int $0x41 7eb: c3 ret 000007ec <str_ls_call25>: 7ec: 6c insb (%dx),%es:(%edi) 7ed: 73 5f jae 84e <str_ls_call30+0x8> 7ef: 63 61 6c arpl %sp,0x6c(%ecx) 7f2: 6c insb (%dx),%es:(%edi) 7f3: 32 .byte 0x32 7f4: 35 .byte 0x35 ... 000007f6 <ls_call25>: CS550LSSYSCALL(ls_call25) 7f6: b8 ec 07 00 00 mov $0x7ec,%eax 7fb: cd 41 int $0x41 7fd: c3 ret 000007fe <str_ls_call26>: 7fe: 6c insb (%dx),%es:(%edi) 7ff: 73 5f jae 860 <str_ls_call31+0x8> 801: 63 61 6c arpl %sp,0x6c(%ecx) 804: 6c insb (%dx),%es:(%edi) 805: 32 36 xor (%esi),%dh ... 00000808 <ls_call26>: CS550LSSYSCALL(ls_call26) 808: b8 fe 07 00 00 mov $0x7fe,%eax 80d: cd 41 int $0x41 80f: c3 ret 00000810 <str_ls_call27>: 810: 6c insb (%dx),%es:(%edi) 811: 73 5f jae 872 <str_ls_call32+0x8> 813: 63 61 6c arpl %sp,0x6c(%ecx) 816: 6c insb (%dx),%es:(%edi) 817: 32 37 xor (%edi),%dh ... 0000081a <ls_call27>: CS550LSSYSCALL(ls_call27) 81a: b8 10 08 00 00 mov $0x810,%eax 81f: cd 41 int $0x41 821: c3 ret 00000822 <str_ls_call28>: 822: 6c insb (%dx),%es:(%edi) 823: 73 5f jae 884 <str_ls_call33+0x8> 825: 63 61 6c arpl %sp,0x6c(%ecx) 828: 6c insb (%dx),%es:(%edi) 829: 32 38 xor (%eax),%bh ... 0000082c <ls_call28>: CS550LSSYSCALL(ls_call28) 82c: b8 22 08 00 00 mov $0x822,%eax 831: cd 41 int $0x41 833: c3 ret 00000834 <str_ls_call29>: 834: 6c insb (%dx),%es:(%edi) 835: 73 5f jae 896 <str_ls_call34+0x8> 837: 63 61 6c arpl %sp,0x6c(%ecx) 83a: 6c insb (%dx),%es:(%edi) 83b: 32 39 xor (%ecx),%bh ... 0000083e <ls_call29>: CS550LSSYSCALL(ls_call29) 83e: b8 34 08 00 00 mov $0x834,%eax 843: cd 41 int $0x41 845: c3 ret 00000846 <str_ls_call30>: 846: 6c insb (%dx),%es:(%edi) 847: 73 5f jae 8a8 <str_ls_call35+0x8> 849: 63 61 6c arpl %sp,0x6c(%ecx) 84c: 6c insb (%dx),%es:(%edi) 84d: 33 30 xor (%eax),%esi ... 00000850 <ls_call30>: CS550LSSYSCALL(ls_call30) 850: b8 46 08 00 00 mov $0x846,%eax 855: cd 41 int $0x41 857: c3 ret 00000858 <str_ls_call31>: 858: 6c insb (%dx),%es:(%edi) 859: 73 5f jae 8ba <str_ls_call36+0x8> 85b: 63 61 6c arpl %sp,0x6c(%ecx) 85e: 6c insb (%dx),%es:(%edi) 85f: 33 31 xor (%ecx),%esi ... 00000862 <ls_call31>: CS550LSSYSCALL(ls_call31) 862: b8 58 08 00 00 mov $0x858,%eax 867: cd 41 int $0x41 869: c3 ret 0000086a <str_ls_call32>: 86a: 6c insb (%dx),%es:(%edi) 86b: 73 5f jae 8cc <str_ls_call37+0x8> 86d: 63 61 6c arpl %sp,0x6c(%ecx) 870: 6c insb (%dx),%es:(%edi) 871: 33 32 xor (%edx),%esi ... 00000874 <ls_call32>: CS550LSSYSCALL(ls_call32) 874: b8 6a 08 00 00 mov $0x86a,%eax 879: cd 41 int $0x41 87b: c3 ret 0000087c <str_ls_call33>: 87c: 6c insb (%dx),%es:(%edi) 87d: 73 5f jae 8de <str_ls_call38+0x8> 87f: 63 61 6c arpl %sp,0x6c(%ecx) 882: 6c insb (%dx),%es:(%edi) 883: 33 33 xor (%ebx),%esi ... 00000886 <ls_call33>: CS550LSSYSCALL(ls_call33) 886: b8 7c 08 00 00 mov $0x87c,%eax 88b: cd 41 int $0x41 88d: c3 ret 0000088e <str_ls_call34>: 88e: 6c insb (%dx),%es:(%edi) 88f: 73 5f jae 8f0 <str_ls_call39+0x8> 891: 63 61 6c arpl %sp,0x6c(%ecx) 894: 6c insb (%dx),%es:(%edi) 895: 33 34 00 xor (%eax,%eax,1),%esi 00000898 <ls_call34>: CS550LSSYSCALL(ls_call34) 898: b8 8e 08 00 00 mov $0x88e,%eax 89d: cd 41 int $0x41 89f: c3 ret 000008a0 <str_ls_call35>: 8a0: 6c insb (%dx),%es:(%edi) 8a1: 73 5f jae 902 <str_ls_call40+0x8> 8a3: 63 61 6c arpl %sp,0x6c(%ecx) 8a6: 6c insb (%dx),%es:(%edi) 8a7: 33 .byte 0x33 8a8: 35 .byte 0x35 ... 000008aa <ls_call35>: CS550LSSYSCALL(ls_call35) 8aa: b8 a0 08 00 00 mov $0x8a0,%eax 8af: cd 41 int $0x41 8b1: c3 ret 000008b2 <str_ls_call36>: 8b2: 6c insb (%dx),%es:(%edi) 8b3: 73 5f jae 914 <str_ls_call41+0x8> 8b5: 63 61 6c arpl %sp,0x6c(%ecx) 8b8: 6c insb (%dx),%es:(%edi) 8b9: 33 36 xor (%esi),%esi ... 000008bc <ls_call36>: CS550LSSYSCALL(ls_call36) 8bc: b8 b2 08 00 00 mov $0x8b2,%eax 8c1: cd 41 int $0x41 8c3: c3 ret 000008c4 <str_ls_call37>: 8c4: 6c insb (%dx),%es:(%edi) 8c5: 73 5f jae 926 <str_ls_call42+0x8> 8c7: 63 61 6c arpl %sp,0x6c(%ecx) 8ca: 6c insb (%dx),%es:(%edi) 8cb: 33 37 xor (%edi),%esi ... 000008ce <ls_call37>: CS550LSSYSCALL(ls_call37) 8ce: b8 c4 08 00 00 mov $0x8c4,%eax 8d3: cd 41 int $0x41 8d5: c3 ret 000008d6 <str_ls_call38>: 8d6: 6c insb (%dx),%es:(%edi) 8d7: 73 5f jae 938 <str_ls_call43+0x8> 8d9: 63 61 6c arpl %sp,0x6c(%ecx) 8dc: 6c insb (%dx),%es:(%edi) 8dd: 33 38 xor (%eax),%edi ... 000008e0 <ls_call38>: CS550LSSYSCALL(ls_call38) 8e0: b8 d6 08 00 00 mov $0x8d6,%eax 8e5: cd 41 int $0x41 8e7: c3 ret 000008e8 <str_ls_call39>: 8e8: 6c insb (%dx),%es:(%edi) 8e9: 73 5f jae 94a <str_ls_call44+0x8> 8eb: 63 61 6c arpl %sp,0x6c(%ecx) 8ee: 6c insb (%dx),%es:(%edi) 8ef: 33 39 xor (%ecx),%edi ... 000008f2 <ls_call39>: CS550LSSYSCALL(ls_call39) 8f2: b8 e8 08 00 00 mov $0x8e8,%eax 8f7: cd 41 int $0x41 8f9: c3 ret 000008fa <str_ls_call40>: 8fa: 6c insb (%dx),%es:(%edi) 8fb: 73 5f jae 95c <str_ls_call45+0x8> 8fd: 63 61 6c arpl %sp,0x6c(%ecx) 900: 6c insb (%dx),%es:(%edi) 901: 34 30 xor $0x30,%al ... 00000904 <ls_call40>: CS550LSSYSCALL(ls_call40) 904: b8 fa 08 00 00 mov $0x8fa,%eax 909: cd 41 int $0x41 90b: c3 ret 0000090c <str_ls_call41>: 90c: 6c insb (%dx),%es:(%edi) 90d: 73 5f jae 96e <str_ls_call46+0x8> 90f: 63 61 6c arpl %sp,0x6c(%ecx) 912: 6c insb (%dx),%es:(%edi) 913: 34 31 xor $0x31,%al ... 00000916 <ls_call41>: CS550LSSYSCALL(ls_call41) 916: b8 0c 09 00 00 mov $0x90c,%eax 91b: cd 41 int $0x41 91d: c3 ret 0000091e <str_ls_call42>: 91e: 6c insb (%dx),%es:(%edi) 91f: 73 5f jae 980 <str_ls_call47+0x8> 921: 63 61 6c arpl %sp,0x6c(%ecx) 924: 6c insb (%dx),%es:(%edi) 925: 34 32 xor $0x32,%al ... 00000928 <ls_call42>: CS550LSSYSCALL(ls_call42) 928: b8 1e 09 00 00 mov $0x91e,%eax 92d: cd 41 int $0x41 92f: c3 ret 00000930 <str_ls_call43>: 930: 6c insb (%dx),%es:(%edi) 931: 73 5f jae 992 <str_ls_call48+0x8> 933: 63 61 6c arpl %sp,0x6c(%ecx) 936: 6c insb (%dx),%es:(%edi) 937: 34 33 xor $0x33,%al ... 0000093a <ls_call43>: CS550LSSYSCALL(ls_call43) 93a: b8 30 09 00 00 mov $0x930,%eax 93f: cd 41 int $0x41 941: c3 ret 00000942 <str_ls_call44>: 942: 6c insb (%dx),%es:(%edi) 943: 73 5f jae 9a4 <str_ls_call49+0x8> 945: 63 61 6c arpl %sp,0x6c(%ecx) 948: 6c insb (%dx),%es:(%edi) 949: 34 34 xor $0x34,%al ... 0000094c <ls_call44>: CS550LSSYSCALL(ls_call44) 94c: b8 42 09 00 00 mov $0x942,%eax 951: cd 41 int $0x41 953: c3 ret 00000954 <str_ls_call45>: 954: 6c insb (%dx),%es:(%edi) 955: 73 5f jae 9b6 <str_ls_call50+0x8> 957: 63 61 6c arpl %sp,0x6c(%ecx) 95a: 6c insb (%dx),%es:(%edi) 95b: 34 35 xor $0x35,%al ... 0000095e <ls_call45>: CS550LSSYSCALL(ls_call45) 95e: b8 54 09 00 00 mov $0x954,%eax 963: cd 41 int $0x41 965: c3 ret 00000966 <str_ls_call46>: 966: 6c insb (%dx),%es:(%edi) 967: 73 5f jae 9c8 <str_ht_call1+0x8> 969: 63 61 6c arpl %sp,0x6c(%ecx) 96c: 6c insb (%dx),%es:(%edi) 96d: 34 36 xor $0x36,%al ... 00000970 <ls_call46>: CS550LSSYSCALL(ls_call46) 970: b8 66 09 00 00 mov $0x966,%eax 975: cd 41 int $0x41 977: c3 ret 00000978 <str_ls_call47>: 978: 6c insb (%dx),%es:(%edi) 979: 73 5f jae 9da <ht_call2> 97b: 63 61 6c arpl %sp,0x6c(%ecx) 97e: 6c insb (%dx),%es:(%edi) 97f: 34 37 xor $0x37,%al ... 00000982 <ls_call47>: CS550LSSYSCALL(ls_call47) 982: b8 78 09 00 00 mov $0x978,%eax 987: cd 41 int $0x41 989: c3 ret 0000098a <str_ls_call48>: 98a: 6c insb (%dx),%es:(%edi) 98b: 73 5f jae 9ec <ht_call3+0x1> 98d: 63 61 6c arpl %sp,0x6c(%ecx) 990: 6c insb (%dx),%es:(%edi) 991: 34 38 xor $0x38,%al ... 00000994 <ls_call48>: CS550LSSYSCALL(ls_call48) 994: b8 8a 09 00 00 mov $0x98a,%eax 999: cd 41 int $0x41 99b: c3 ret 0000099c <str_ls_call49>: 99c: 6c insb (%dx),%es:(%edi) 99d: 73 5f jae 9fe <ht_call4+0x2> 99f: 63 61 6c arpl %sp,0x6c(%ecx) 9a2: 6c insb (%dx),%es:(%edi) 9a3: 34 39 xor $0x39,%al ... 000009a6 <ls_call49>: CS550LSSYSCALL(ls_call49) 9a6: b8 9c 09 00 00 mov $0x99c,%eax 9ab: cd 41 int $0x41 9ad: c3 ret 000009ae <str_ls_call50>: 9ae: 6c insb (%dx),%es:(%edi) 9af: 73 5f jae a10 <ht_call5+0x3> 9b1: 63 61 6c arpl %sp,0x6c(%ecx) 9b4: 6c insb (%dx),%es:(%edi) 9b5: 35 .byte 0x35 9b6: 30 00 xor %al,(%eax) 000009b8 <ls_call50>: CS550LSSYSCALL(ls_call50) 9b8: b8 ae 09 00 00 mov $0x9ae,%eax 9bd: cd 41 int $0x41 9bf: c3 ret 000009c0 <str_ht_call1>: 9c0: 68 74 5f 63 61 push $0x61635f74 9c5: 6c insb (%dx),%es:(%edi) 9c6: 6c insb (%dx),%es:(%edi) 9c7: 31 00 xor %eax,(%eax) 000009c9 <ht_call1>: // ht calls CS550HTSYSCALL(ht_call1) 9c9: b8 c0 09 00 00 mov $0x9c0,%eax 9ce: cd 42 int $0x42 9d0: c3 ret 000009d1 <str_ht_call2>: 9d1: 68 74 5f 63 61 push $0x61635f74 9d6: 6c insb (%dx),%es:(%edi) 9d7: 6c insb (%dx),%es:(%edi) 9d8: 32 00 xor (%eax),%al 000009da <ht_call2>: CS550HTSYSCALL(ht_call2) 9da: b8 d1 09 00 00 mov $0x9d1,%eax 9df: cd 42 int $0x42 9e1: c3 ret 000009e2 <str_ht_call3>: 9e2: 68 74 5f 63 61 push $0x61635f74 9e7: 6c insb (%dx),%es:(%edi) 9e8: 6c insb (%dx),%es:(%edi) 9e9: 33 00 xor (%eax),%eax 000009eb <ht_call3>: CS550HTSYSCALL(ht_call3) 9eb: b8 e2 09 00 00 mov $0x9e2,%eax 9f0: cd 42 int $0x42 9f2: c3 ret 000009f3 <str_ht_call4>: 9f3: 68 74 5f 63 61 push $0x61635f74 9f8: 6c insb (%dx),%es:(%edi) 9f9: 6c insb (%dx),%es:(%edi) 9fa: 34 00 xor $0x0,%al 000009fc <ht_call4>: CS550HTSYSCALL(ht_call4) 9fc: b8 f3 09 00 00 mov $0x9f3,%eax a01: cd 42 int $0x42 a03: c3 ret 00000a04 <str_ht_call5>: a04: 68 74 5f 63 61 push $0x61635f74 a09: 6c insb (%dx),%es:(%edi) a0a: 6c insb (%dx),%es:(%edi) a0b: 35 .byte 0x35 ... 00000a0d <ht_call5>: CS550HTSYSCALL(ht_call5) a0d: b8 04 0a 00 00 mov $0xa04,%eax a12: cd 42 int $0x42 a14: c3 ret 00000a15 <str_ht_call6>: a15: 68 74 5f 63 61 push $0x61635f74 a1a: 6c insb (%dx),%es:(%edi) a1b: 6c insb (%dx),%es:(%edi) a1c: 36 ss ... 00000a1e <ht_call6>: CS550HTSYSCALL(ht_call6) a1e: b8 15 0a 00 00 mov $0xa15,%eax a23: cd 42 int $0x42 a25: c3 ret 00000a26 <str_ht_call7>: a26: 68 74 5f 63 61 push $0x61635f74 a2b: 6c insb (%dx),%es:(%edi) a2c: 6c insb (%dx),%es:(%edi) a2d: 37 aaa ... 00000a2f <ht_call7>: CS550HTSYSCALL(ht_call7) a2f: b8 26 0a 00 00 mov $0xa26,%eax a34: cd 42 int $0x42 a36: c3 ret 00000a37 <str_ht_call8>: a37: 68 74 5f 63 61 push $0x61635f74 a3c: 6c insb (%dx),%es:(%edi) a3d: 6c insb (%dx),%es:(%edi) a3e: 38 00 cmp %al,(%eax) 00000a40 <ht_call8>: CS550HTSYSCALL(ht_call8) a40: b8 37 0a 00 00 mov $0xa37,%eax a45: cd 42 int $0x42 a47: c3 ret 00000a48 <str_ht_call9>: a48: 68 74 5f 63 61 push $0x61635f74 a4d: 6c insb (%dx),%es:(%edi) a4e: 6c insb (%dx),%es:(%edi) a4f: 39 00 cmp %eax,(%eax) 00000a51 <ht_call9>: CS550HTSYSCALL(ht_call9) a51: b8 48 0a 00 00 mov $0xa48,%eax a56: cd 42 int $0x42 a58: c3 ret 00000a59 <str_ht_call10>: a59: 68 74 5f 63 61 push $0x61635f74 a5e: 6c insb (%dx),%es:(%edi) a5f: 6c insb (%dx),%es:(%edi) a60: 31 30 xor %esi,(%eax) ... 00000a63 <ht_call10>: CS550HTSYSCALL(ht_call10) a63: b8 59 0a 00 00 mov $0xa59,%eax a68: cd 42 int $0x42 a6a: c3 ret 00000a6b <str_ht_call11>: a6b: 68 74 5f 63 61 push $0x61635f74 a70: 6c insb (%dx),%es:(%edi) a71: 6c insb (%dx),%es:(%edi) a72: 31 31 xor %esi,(%ecx) ... 00000a75 <ht_call11>: CS550HTSYSCALL(ht_call11) a75: b8 6b 0a 00 00 mov $0xa6b,%eax a7a: cd 42 int $0x42 a7c: c3 ret 00000a7d <str_ht_call12>: a7d: 68 74 5f 63 61 push $0x61635f74 a82: 6c insb (%dx),%es:(%edi) a83: 6c insb (%dx),%es:(%edi) a84: 31 32 xor %esi,(%edx) ... 00000a87 <ht_call12>: CS550HTSYSCALL(ht_call12) a87: b8 7d 0a 00 00 mov $0xa7d,%eax a8c: cd 42 int $0x42 a8e: c3 ret 00000a8f <str_ht_call13>: a8f: 68 74 5f 63 61 push $0x61635f74 a94: 6c insb (%dx),%es:(%edi) a95: 6c insb (%dx),%es:(%edi) a96: 31 33 xor %esi,(%ebx) ... 00000a99 <ht_call13>: CS550HTSYSCALL(ht_call13) a99: b8 8f 0a 00 00 mov $0xa8f,%eax a9e: cd 42 int $0x42 aa0: c3 ret 00000aa1 <str_ht_call14>: aa1: 68 74 5f 63 61 push $0x61635f74 aa6: 6c insb (%dx),%es:(%edi) aa7: 6c insb (%dx),%es:(%edi) aa8: 31 34 00 xor %esi,(%eax,%eax,1) 00000aab <ht_call14>: CS550HTSYSCALL(ht_call14) aab: b8 a1 0a 00 00 mov $0xaa1,%eax ab0: cd 42 int $0x42 ab2: c3 ret 00000ab3 <str_ht_call15>: ab3: 68 74 5f 63 61 push $0x61635f74 ab8: 6c insb (%dx),%es:(%edi) ab9: 6c insb (%dx),%es:(%edi) aba: 31 .byte 0x31 abb: 35 .byte 0x35 ... 00000abd <ht_call15>: CS550HTSYSCALL(ht_call15) abd: b8 b3 0a 00 00 mov $0xab3,%eax ac2: cd 42 int $0x42 ac4: c3 ret 00000ac5 <str_ht_call16>: ac5: 68 74 5f 63 61 push $0x61635f74 aca: 6c insb (%dx),%es:(%edi) acb: 6c insb (%dx),%es:(%edi) acc: 31 36 xor %esi,(%esi) ... 00000acf <ht_call16>: CS550HTSYSCALL(ht_call16) acf: b8 c5 0a 00 00 mov $0xac5,%eax ad4: cd 42 int $0x42 ad6: c3 ret 00000ad7 <str_ht_call17>: ad7: 68 74 5f 63 61 push $0x61635f74 adc: 6c insb (%dx),%es:(%edi) add: 6c insb (%dx),%es:(%edi) ade: 31 37 xor %esi,(%edi) ... 00000ae1 <ht_call17>: CS550HTSYSCALL(ht_call17) ae1: b8 d7 0a 00 00 mov $0xad7,%eax ae6: cd 42 int $0x42 ae8: c3 ret 00000ae9 <str_ht_call18>: ae9: 68 74 5f 63 61 push $0x61635f74 aee: 6c insb (%dx),%es:(%edi) aef: 6c insb (%dx),%es:(%edi) af0: 31 38 xor %edi,(%eax) ... 00000af3 <ht_call18>: CS550HTSYSCALL(ht_call18) af3: b8 e9 0a 00 00 mov $0xae9,%eax af8: cd 42 int $0x42 afa: c3 ret 00000afb <str_ht_call19>: afb: 68 74 5f 63 61 push $0x61635f74 b00: 6c insb (%dx),%es:(%edi) b01: 6c insb (%dx),%es:(%edi) b02: 31 39 xor %edi,(%ecx) ... 00000b05 <ht_call19>: CS550HTSYSCALL(ht_call19) b05: b8 fb 0a 00 00 mov $0xafb,%eax b0a: cd 42 int $0x42 b0c: c3 ret 00000b0d <str_ht_call20>: b0d: 68 74 5f 63 61 push $0x61635f74 b12: 6c insb (%dx),%es:(%edi) b13: 6c insb (%dx),%es:(%edi) b14: 32 30 xor (%eax),%dh ... 00000b17 <ht_call20>: CS550HTSYSCALL(ht_call20) b17: b8 0d 0b 00 00 mov $0xb0d,%eax b1c: cd 42 int $0x42 b1e: c3 ret 00000b1f <str_ht_call21>: b1f: 68 74 5f 63 61 push $0x61635f74 b24: 6c insb (%dx),%es:(%edi) b25: 6c insb (%dx),%es:(%edi) b26: 32 31 xor (%ecx),%dh ... 00000b29 <ht_call21>: CS550HTSYSCALL(ht_call21) b29: b8 1f 0b 00 00 mov $0xb1f,%eax b2e: cd 42 int $0x42 b30: c3 ret 00000b31 <str_ht_call22>: b31: 68 74 5f 63 61 push $0x61635f74 b36: 6c insb (%dx),%es:(%edi) b37: 6c insb (%dx),%es:(%edi) b38: 32 32 xor (%edx),%dh ... 00000b3b <ht_call22>: CS550HTSYSCALL(ht_call22) b3b: b8 31 0b 00 00 mov $0xb31,%eax b40: cd 42 int $0x42 b42: c3 ret 00000b43 <str_ht_call23>: b43: 68 74 5f 63 61 push $0x61635f74 b48: 6c insb (%dx),%es:(%edi) b49: 6c insb (%dx),%es:(%edi) b4a: 32 33 xor (%ebx),%dh ... 00000b4d <ht_call23>: CS550HTSYSCALL(ht_call23) b4d: b8 43 0b 00 00 mov $0xb43,%eax b52: cd 42 int $0x42 b54: c3 ret 00000b55 <str_ht_call24>: b55: 68 74 5f 63 61 push $0x61635f74 b5a: 6c insb (%dx),%es:(%edi) b5b: 6c insb (%dx),%es:(%edi) b5c: 32 34 00 xor (%eax,%eax,1),%dh 00000b5f <ht_call24>: CS550HTSYSCALL(ht_call24) b5f: b8 55 0b 00 00 mov $0xb55,%eax b64: cd 42 int $0x42 b66: c3 ret 00000b67 <str_ht_call25>: b67: 68 74 5f 63 61 push $0x61635f74 b6c: 6c insb (%dx),%es:(%edi) b6d: 6c insb (%dx),%es:(%edi) b6e: 32 .byte 0x32 b6f: 35 .byte 0x35 ... 00000b71 <ht_call25>: CS550HTSYSCALL(ht_call25) b71: b8 67 0b 00 00 mov $0xb67,%eax b76: cd 42 int $0x42 b78: c3 ret 00000b79 <str_ht_call26>: b79: 68 74 5f 63 61 push $0x61635f74 b7e: 6c insb (%dx),%es:(%edi) b7f: 6c insb (%dx),%es:(%edi) b80: 32 36 xor (%esi),%dh ... 00000b83 <ht_call26>: CS550HTSYSCALL(ht_call26) b83: b8 79 0b 00 00 mov $0xb79,%eax b88: cd 42 int $0x42 b8a: c3 ret 00000b8b <str_ht_call27>: b8b: 68 74 5f 63 61 push $0x61635f74 b90: 6c insb (%dx),%es:(%edi) b91: 6c insb (%dx),%es:(%edi) b92: 32 37 xor (%edi),%dh ... 00000b95 <ht_call27>: CS550HTSYSCALL(ht_call27) b95: b8 8b 0b 00 00 mov $0xb8b,%eax b9a: cd 42 int $0x42 b9c: c3 ret 00000b9d <str_ht_call28>: b9d: 68 74 5f 63 61 push $0x61635f74 ba2: 6c insb (%dx),%es:(%edi) ba3: 6c insb (%dx),%es:(%edi) ba4: 32 38 xor (%eax),%bh ... 00000ba7 <ht_call28>: CS550HTSYSCALL(ht_call28) ba7: b8 9d 0b 00 00 mov $0xb9d,%eax bac: cd 42 int $0x42 bae: c3 ret 00000baf <str_ht_call29>: baf: 68 74 5f 63 61 push $0x61635f74 bb4: 6c insb (%dx),%es:(%edi) bb5: 6c insb (%dx),%es:(%edi) bb6: 32 39 xor (%ecx),%bh ... 00000bb9 <ht_call29>: CS550HTSYSCALL(ht_call29) bb9: b8 af 0b 00 00 mov $0xbaf,%eax bbe: cd 42 int $0x42 bc0: c3 ret 00000bc1 <str_ht_call30>: bc1: 68 74 5f 63 61 push $0x61635f74 bc6: 6c insb (%dx),%es:(%edi) bc7: 6c insb (%dx),%es:(%edi) bc8: 33 30 xor (%eax),%esi ... 00000bcb <ht_call30>: CS550HTSYSCALL(ht_call30) bcb: b8 c1 0b 00 00 mov $0xbc1,%eax bd0: cd 42 int $0x42 bd2: c3 ret 00000bd3 <str_ht_call31>: bd3: 68 74 5f 63 61 push $0x61635f74 bd8: 6c insb (%dx),%es:(%edi) bd9: 6c insb (%dx),%es:(%edi) bda: 33 31 xor (%ecx),%esi ... 00000bdd <ht_call31>: CS550HTSYSCALL(ht_call31) bdd: b8 d3 0b 00 00 mov $0xbd3,%eax be2: cd 42 int $0x42 be4: c3 ret 00000be5 <str_ht_call32>: be5: 68 74 5f 63 61 push $0x61635f74 bea: 6c insb (%dx),%es:(%edi) beb: 6c insb (%dx),%es:(%edi) bec: 33 32 xor (%edx),%esi ... 00000bef <ht_call32>: CS550HTSYSCALL(ht_call32) bef: b8 e5 0b 00 00 mov $0xbe5,%eax bf4: cd 42 int $0x42 bf6: c3 ret 00000bf7 <str_ht_call33>: bf7: 68 74 5f 63 61 push $0x61635f74 bfc: 6c insb (%dx),%es:(%edi) bfd: 6c insb (%dx),%es:(%edi) bfe: 33 33 xor (%ebx),%esi ... 00000c01 <ht_call33>: CS550HTSYSCALL(ht_call33) c01: b8 f7 0b 00 00 mov $0xbf7,%eax c06: cd 42 int $0x42 c08: c3 ret 00000c09 <str_ht_call34>: c09: 68 74 5f 63 61 push $0x61635f74 c0e: 6c insb (%dx),%es:(%edi) c0f: 6c insb (%dx),%es:(%edi) c10: 33 34 00 xor (%eax,%eax,1),%esi 00000c13 <ht_call34>: CS550HTSYSCALL(ht_call34) c13: b8 09 0c 00 00 mov $0xc09,%eax c18: cd 42 int $0x42 c1a: c3 ret 00000c1b <str_ht_call35>: c1b: 68 74 5f 63 61 push $0x61635f74 c20: 6c insb (%dx),%es:(%edi) c21: 6c insb (%dx),%es:(%edi) c22: 33 .byte 0x33 c23: 35 .byte 0x35 ... 00000c25 <ht_call35>: CS550HTSYSCALL(ht_call35) c25: b8 1b 0c 00 00 mov $0xc1b,%eax c2a: cd 42 int $0x42 c2c: c3 ret 00000c2d <str_ht_call36>: c2d: 68 74 5f 63 61 push $0x61635f74 c32: 6c insb (%dx),%es:(%edi) c33: 6c insb (%dx),%es:(%edi) c34: 33 36 xor (%esi),%esi ... 00000c37 <ht_call36>: CS550HTSYSCALL(ht_call36) c37: b8 2d 0c 00 00 mov $0xc2d,%eax c3c: cd 42 int $0x42 c3e: c3 ret 00000c3f <str_ht_call37>: c3f: 68 74 5f 63 61 push $0x61635f74 c44: 6c insb (%dx),%es:(%edi) c45: 6c insb (%dx),%es:(%edi) c46: 33 37 xor (%edi),%esi ... 00000c49 <ht_call37>: CS550HTSYSCALL(ht_call37) c49: b8 3f 0c 00 00 mov $0xc3f,%eax c4e: cd 42 int $0x42 c50: c3 ret 00000c51 <str_ht_call38>: c51: 68 74 5f 63 61 push $0x61635f74 c56: 6c insb (%dx),%es:(%edi) c57: 6c insb (%dx),%es:(%edi) c58: 33 38 xor (%eax),%edi ... 00000c5b <ht_call38>: CS550HTSYSCALL(ht_call38) c5b: b8 51 0c 00 00 mov $0xc51,%eax c60: cd 42 int $0x42 c62: c3 ret 00000c63 <str_ht_call39>: c63: 68 74 5f 63 61 push $0x61635f74 c68: 6c insb (%dx),%es:(%edi) c69: 6c insb (%dx),%es:(%edi) c6a: 33 39 xor (%ecx),%edi ... 00000c6d <ht_call39>: CS550HTSYSCALL(ht_call39) c6d: b8 63 0c 00 00 mov $0xc63,%eax c72: cd 42 int $0x42 c74: c3 ret 00000c75 <str_ht_call40>: c75: 68 74 5f 63 61 push $0x61635f74 c7a: 6c insb (%dx),%es:(%edi) c7b: 6c insb (%dx),%es:(%edi) c7c: 34 30 xor $0x30,%al ... 00000c7f <ht_call40>: CS550HTSYSCALL(ht_call40) c7f: b8 75 0c 00 00 mov $0xc75,%eax c84: cd 42 int $0x42 c86: c3 ret 00000c87 <str_ht_call41>: c87: 68 74 5f 63 61 push $0x61635f74 c8c: 6c insb (%dx),%es:(%edi) c8d: 6c insb (%dx),%es:(%edi) c8e: 34 31 xor $0x31,%al ... 00000c91 <ht_call41>: CS550HTSYSCALL(ht_call41) c91: b8 87 0c 00 00 mov $0xc87,%eax c96: cd 42 int $0x42 c98: c3 ret 00000c99 <str_ht_call42>: c99: 68 74 5f 63 61 push $0x61635f74 c9e: 6c insb (%dx),%es:(%edi) c9f: 6c insb (%dx),%es:(%edi) ca0: 34 32 xor $0x32,%al ... 00000ca3 <ht_call42>: CS550HTSYSCALL(ht_call42) ca3: b8 99 0c 00 00 mov $0xc99,%eax ca8: cd 42 int $0x42 caa: c3 ret 00000cab <str_ht_call43>: cab: 68 74 5f 63 61 push $0x61635f74 cb0: 6c insb (%dx),%es:(%edi) cb1: 6c insb (%dx),%es:(%edi) cb2: 34 33 xor $0x33,%al ... 00000cb5 <ht_call43>: CS550HTSYSCALL(ht_call43) cb5: b8 ab 0c 00 00 mov $0xcab,%eax cba: cd 42 int $0x42 cbc: c3 ret 00000cbd <str_ht_call44>: cbd: 68 74 5f 63 61 push $0x61635f74 cc2: 6c insb (%dx),%es:(%edi) cc3: 6c insb (%dx),%es:(%edi) cc4: 34 34 xor $0x34,%al ... 00000cc7 <ht_call44>: CS550HTSYSCALL(ht_call44) cc7: b8 bd 0c 00 00 mov $0xcbd,%eax ccc: cd 42 int $0x42 cce: c3 ret 00000ccf <str_ht_call45>: ccf: 68 74 5f 63 61 push $0x61635f74 cd4: 6c insb (%dx),%es:(%edi) cd5: 6c insb (%dx),%es:(%edi) cd6: 34 35 xor $0x35,%al ... 00000cd9 <ht_call45>: CS550HTSYSCALL(ht_call45) cd9: b8 cf 0c 00 00 mov $0xccf,%eax cde: cd 42 int $0x42 ce0: c3 ret 00000ce1 <str_ht_call46>: ce1: 68 74 5f 63 61 push $0x61635f74 ce6: 6c insb (%dx),%es:(%edi) ce7: 6c insb (%dx),%es:(%edi) ce8: 34 36 xor $0x36,%al ... 00000ceb <ht_call46>: CS550HTSYSCALL(ht_call46) ceb: b8 e1 0c 00 00 mov $0xce1,%eax cf0: cd 42 int $0x42 cf2: c3 ret 00000cf3 <str_ht_call47>: cf3: 68 74 5f 63 61 push $0x61635f74 cf8: 6c insb (%dx),%es:(%edi) cf9: 6c insb (%dx),%es:(%edi) cfa: 34 37 xor $0x37,%al ... 00000cfd <ht_call47>: CS550HTSYSCALL(ht_call47) cfd: b8 f3 0c 00 00 mov $0xcf3,%eax d02: cd 42 int $0x42 d04: c3 ret 00000d05 <str_ht_call48>: d05: 68 74 5f 63 61 push $0x61635f74 d0a: 6c insb (%dx),%es:(%edi) d0b: 6c insb (%dx),%es:(%edi) d0c: 34 38 xor $0x38,%al ... 00000d0f <ht_call48>: CS550HTSYSCALL(ht_call48) d0f: b8 05 0d 00 00 mov $0xd05,%eax d14: cd 42 int $0x42 d16: c3 ret 00000d17 <str_ht_call49>: d17: 68 74 5f 63 61 push $0x61635f74 d1c: 6c insb (%dx),%es:(%edi) d1d: 6c insb (%dx),%es:(%edi) d1e: 34 39 xor $0x39,%al ... 00000d21 <ht_call49>: CS550HTSYSCALL(ht_call49) d21: b8 17 0d 00 00 mov $0xd17,%eax d26: cd 42 int $0x42 d28: c3 ret 00000d29 <str_ht_call50>: d29: 68 74 5f 63 61 push $0x61635f74 d2e: 6c insb (%dx),%es:(%edi) d2f: 6c insb (%dx),%es:(%edi) d30: 35 .byte 0x35 d31: 30 00 xor %al,(%eax) 00000d33 <ht_call50>: CS550HTSYSCALL(ht_call50) d33: b8 29 0d 00 00 mov $0xd29,%eax d38: cd 42 int $0x42 d3a: c3 ret 00000d3b <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { d3b: 55 push %ebp d3c: 89 e5 mov %esp,%ebp d3e: 83 ec 18 sub $0x18,%esp d41: 8b 45 0c mov 0xc(%ebp),%eax d44: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); d47: 83 ec 04 sub $0x4,%esp d4a: 6a 01 push $0x1 d4c: 8d 45 f4 lea -0xc(%ebp),%eax d4f: 50 push %eax d50: ff 75 08 pushl 0x8(%ebp) d53: e8 65 f8 ff ff call 5bd <write> d58: 83 c4 10 add $0x10,%esp } d5b: 90 nop d5c: c9 leave d5d: c3 ret 00000d5e <printint>: static void printint(int fd, int xx, int base, int sgn) { d5e: 55 push %ebp d5f: 89 e5 mov %esp,%ebp d61: 53 push %ebx d62: 83 ec 24 sub $0x24,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; d65: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ d6c: 83 7d 14 00 cmpl $0x0,0x14(%ebp) d70: 74 17 je d89 <printint+0x2b> d72: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) d76: 79 11 jns d89 <printint+0x2b> neg = 1; d78: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; d7f: 8b 45 0c mov 0xc(%ebp),%eax d82: f7 d8 neg %eax d84: 89 45 ec mov %eax,-0x14(%ebp) d87: eb 06 jmp d8f <printint+0x31> } else { x = xx; d89: 8b 45 0c mov 0xc(%ebp),%eax d8c: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; d8f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; d96: 8b 4d f4 mov -0xc(%ebp),%ecx d99: 8d 41 01 lea 0x1(%ecx),%eax d9c: 89 45 f4 mov %eax,-0xc(%ebp) d9f: 8b 5d 10 mov 0x10(%ebp),%ebx da2: 8b 45 ec mov -0x14(%ebp),%eax da5: ba 00 00 00 00 mov $0x0,%edx daa: f7 f3 div %ebx dac: 89 d0 mov %edx,%eax dae: 0f b6 80 bc 14 00 00 movzbl 0x14bc(%eax),%eax db5: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); db9: 8b 5d 10 mov 0x10(%ebp),%ebx dbc: 8b 45 ec mov -0x14(%ebp),%eax dbf: ba 00 00 00 00 mov $0x0,%edx dc4: f7 f3 div %ebx dc6: 89 45 ec mov %eax,-0x14(%ebp) dc9: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) dcd: 75 c7 jne d96 <printint+0x38> if(neg) dcf: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) dd3: 74 2d je e02 <printint+0xa4> buf[i++] = '-'; dd5: 8b 45 f4 mov -0xc(%ebp),%eax dd8: 8d 50 01 lea 0x1(%eax),%edx ddb: 89 55 f4 mov %edx,-0xc(%ebp) dde: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) de3: eb 1d jmp e02 <printint+0xa4> putc(fd, buf[i]); de5: 8d 55 dc lea -0x24(%ebp),%edx de8: 8b 45 f4 mov -0xc(%ebp),%eax deb: 01 d0 add %edx,%eax ded: 0f b6 00 movzbl (%eax),%eax df0: 0f be c0 movsbl %al,%eax df3: 83 ec 08 sub $0x8,%esp df6: 50 push %eax df7: ff 75 08 pushl 0x8(%ebp) dfa: e8 3c ff ff ff call d3b <putc> dff: 83 c4 10 add $0x10,%esp buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) e02: 83 6d f4 01 subl $0x1,-0xc(%ebp) e06: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) e0a: 79 d9 jns de5 <printint+0x87> putc(fd, buf[i]); } e0c: 90 nop e0d: 8b 5d fc mov -0x4(%ebp),%ebx e10: c9 leave e11: c3 ret 00000e12 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { e12: 55 push %ebp e13: 89 e5 mov %esp,%ebp e15: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; e18: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; e1f: 8d 45 0c lea 0xc(%ebp),%eax e22: 83 c0 04 add $0x4,%eax e25: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ e28: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) e2f: e9 59 01 00 00 jmp f8d <printf+0x17b> c = fmt[i] & 0xff; e34: 8b 55 0c mov 0xc(%ebp),%edx e37: 8b 45 f0 mov -0x10(%ebp),%eax e3a: 01 d0 add %edx,%eax e3c: 0f b6 00 movzbl (%eax),%eax e3f: 0f be c0 movsbl %al,%eax e42: 25 ff 00 00 00 and $0xff,%eax e47: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ e4a: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) e4e: 75 2c jne e7c <printf+0x6a> if(c == '%'){ e50: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) e54: 75 0c jne e62 <printf+0x50> state = '%'; e56: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) e5d: e9 27 01 00 00 jmp f89 <printf+0x177> } else { putc(fd, c); e62: 8b 45 e4 mov -0x1c(%ebp),%eax e65: 0f be c0 movsbl %al,%eax e68: 83 ec 08 sub $0x8,%esp e6b: 50 push %eax e6c: ff 75 08 pushl 0x8(%ebp) e6f: e8 c7 fe ff ff call d3b <putc> e74: 83 c4 10 add $0x10,%esp e77: e9 0d 01 00 00 jmp f89 <printf+0x177> } } else if(state == '%'){ e7c: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) e80: 0f 85 03 01 00 00 jne f89 <printf+0x177> if(c == 'd'){ e86: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) e8a: 75 1e jne eaa <printf+0x98> printint(fd, *ap, 10, 1); e8c: 8b 45 e8 mov -0x18(%ebp),%eax e8f: 8b 00 mov (%eax),%eax e91: 6a 01 push $0x1 e93: 6a 0a push $0xa e95: 50 push %eax e96: ff 75 08 pushl 0x8(%ebp) e99: e8 c0 fe ff ff call d5e <printint> e9e: 83 c4 10 add $0x10,%esp ap++; ea1: 83 45 e8 04 addl $0x4,-0x18(%ebp) ea5: e9 d8 00 00 00 jmp f82 <printf+0x170> } else if(c == 'x' || c == 'p'){ eaa: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) eae: 74 06 je eb6 <printf+0xa4> eb0: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) eb4: 75 1e jne ed4 <printf+0xc2> printint(fd, *ap, 16, 0); eb6: 8b 45 e8 mov -0x18(%ebp),%eax eb9: 8b 00 mov (%eax),%eax ebb: 6a 00 push $0x0 ebd: 6a 10 push $0x10 ebf: 50 push %eax ec0: ff 75 08 pushl 0x8(%ebp) ec3: e8 96 fe ff ff call d5e <printint> ec8: 83 c4 10 add $0x10,%esp ap++; ecb: 83 45 e8 04 addl $0x4,-0x18(%ebp) ecf: e9 ae 00 00 00 jmp f82 <printf+0x170> } else if(c == 's'){ ed4: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) ed8: 75 43 jne f1d <printf+0x10b> s = (char*)*ap; eda: 8b 45 e8 mov -0x18(%ebp),%eax edd: 8b 00 mov (%eax),%eax edf: 89 45 f4 mov %eax,-0xc(%ebp) ap++; ee2: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) ee6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) eea: 75 25 jne f11 <printf+0xff> s = "(null)"; eec: c7 45 f4 12 12 00 00 movl $0x1212,-0xc(%ebp) while(*s != 0){ ef3: eb 1c jmp f11 <printf+0xff> putc(fd, *s); ef5: 8b 45 f4 mov -0xc(%ebp),%eax ef8: 0f b6 00 movzbl (%eax),%eax efb: 0f be c0 movsbl %al,%eax efe: 83 ec 08 sub $0x8,%esp f01: 50 push %eax f02: ff 75 08 pushl 0x8(%ebp) f05: e8 31 fe ff ff call d3b <putc> f0a: 83 c4 10 add $0x10,%esp s++; f0d: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ f11: 8b 45 f4 mov -0xc(%ebp),%eax f14: 0f b6 00 movzbl (%eax),%eax f17: 84 c0 test %al,%al f19: 75 da jne ef5 <printf+0xe3> f1b: eb 65 jmp f82 <printf+0x170> putc(fd, *s); s++; } } else if(c == 'c'){ f1d: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) f21: 75 1d jne f40 <printf+0x12e> putc(fd, *ap); f23: 8b 45 e8 mov -0x18(%ebp),%eax f26: 8b 00 mov (%eax),%eax f28: 0f be c0 movsbl %al,%eax f2b: 83 ec 08 sub $0x8,%esp f2e: 50 push %eax f2f: ff 75 08 pushl 0x8(%ebp) f32: e8 04 fe ff ff call d3b <putc> f37: 83 c4 10 add $0x10,%esp ap++; f3a: 83 45 e8 04 addl $0x4,-0x18(%ebp) f3e: eb 42 jmp f82 <printf+0x170> } else if(c == '%'){ f40: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) f44: 75 17 jne f5d <printf+0x14b> putc(fd, c); f46: 8b 45 e4 mov -0x1c(%ebp),%eax f49: 0f be c0 movsbl %al,%eax f4c: 83 ec 08 sub $0x8,%esp f4f: 50 push %eax f50: ff 75 08 pushl 0x8(%ebp) f53: e8 e3 fd ff ff call d3b <putc> f58: 83 c4 10 add $0x10,%esp f5b: eb 25 jmp f82 <printf+0x170> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); f5d: 83 ec 08 sub $0x8,%esp f60: 6a 25 push $0x25 f62: ff 75 08 pushl 0x8(%ebp) f65: e8 d1 fd ff ff call d3b <putc> f6a: 83 c4 10 add $0x10,%esp putc(fd, c); f6d: 8b 45 e4 mov -0x1c(%ebp),%eax f70: 0f be c0 movsbl %al,%eax f73: 83 ec 08 sub $0x8,%esp f76: 50 push %eax f77: ff 75 08 pushl 0x8(%ebp) f7a: e8 bc fd ff ff call d3b <putc> f7f: 83 c4 10 add $0x10,%esp } state = 0; f82: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ f89: 83 45 f0 01 addl $0x1,-0x10(%ebp) f8d: 8b 55 0c mov 0xc(%ebp),%edx f90: 8b 45 f0 mov -0x10(%ebp),%eax f93: 01 d0 add %edx,%eax f95: 0f b6 00 movzbl (%eax),%eax f98: 84 c0 test %al,%al f9a: 0f 85 94 fe ff ff jne e34 <printf+0x22> putc(fd, c); } state = 0; } } } fa0: 90 nop fa1: c9 leave fa2: c3 ret 00000fa3 <free>: static Header base; static Header *freep; void free(void *ap) { fa3: 55 push %ebp fa4: 89 e5 mov %esp,%ebp fa6: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; fa9: 8b 45 08 mov 0x8(%ebp),%eax fac: 83 e8 08 sub $0x8,%eax faf: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) fb2: a1 e8 14 00 00 mov 0x14e8,%eax fb7: 89 45 fc mov %eax,-0x4(%ebp) fba: eb 24 jmp fe0 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) fbc: 8b 45 fc mov -0x4(%ebp),%eax fbf: 8b 00 mov (%eax),%eax fc1: 3b 45 fc cmp -0x4(%ebp),%eax fc4: 77 12 ja fd8 <free+0x35> fc6: 8b 45 f8 mov -0x8(%ebp),%eax fc9: 3b 45 fc cmp -0x4(%ebp),%eax fcc: 77 24 ja ff2 <free+0x4f> fce: 8b 45 fc mov -0x4(%ebp),%eax fd1: 8b 00 mov (%eax),%eax fd3: 3b 45 f8 cmp -0x8(%ebp),%eax fd6: 77 1a ja ff2 <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) fd8: 8b 45 fc mov -0x4(%ebp),%eax fdb: 8b 00 mov (%eax),%eax fdd: 89 45 fc mov %eax,-0x4(%ebp) fe0: 8b 45 f8 mov -0x8(%ebp),%eax fe3: 3b 45 fc cmp -0x4(%ebp),%eax fe6: 76 d4 jbe fbc <free+0x19> fe8: 8b 45 fc mov -0x4(%ebp),%eax feb: 8b 00 mov (%eax),%eax fed: 3b 45 f8 cmp -0x8(%ebp),%eax ff0: 76 ca jbe fbc <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ ff2: 8b 45 f8 mov -0x8(%ebp),%eax ff5: 8b 40 04 mov 0x4(%eax),%eax ff8: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx fff: 8b 45 f8 mov -0x8(%ebp),%eax 1002: 01 c2 add %eax,%edx 1004: 8b 45 fc mov -0x4(%ebp),%eax 1007: 8b 00 mov (%eax),%eax 1009: 39 c2 cmp %eax,%edx 100b: 75 24 jne 1031 <free+0x8e> bp->s.size += p->s.ptr->s.size; 100d: 8b 45 f8 mov -0x8(%ebp),%eax 1010: 8b 50 04 mov 0x4(%eax),%edx 1013: 8b 45 fc mov -0x4(%ebp),%eax 1016: 8b 00 mov (%eax),%eax 1018: 8b 40 04 mov 0x4(%eax),%eax 101b: 01 c2 add %eax,%edx 101d: 8b 45 f8 mov -0x8(%ebp),%eax 1020: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 1023: 8b 45 fc mov -0x4(%ebp),%eax 1026: 8b 00 mov (%eax),%eax 1028: 8b 10 mov (%eax),%edx 102a: 8b 45 f8 mov -0x8(%ebp),%eax 102d: 89 10 mov %edx,(%eax) 102f: eb 0a jmp 103b <free+0x98> } else bp->s.ptr = p->s.ptr; 1031: 8b 45 fc mov -0x4(%ebp),%eax 1034: 8b 10 mov (%eax),%edx 1036: 8b 45 f8 mov -0x8(%ebp),%eax 1039: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 103b: 8b 45 fc mov -0x4(%ebp),%eax 103e: 8b 40 04 mov 0x4(%eax),%eax 1041: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 1048: 8b 45 fc mov -0x4(%ebp),%eax 104b: 01 d0 add %edx,%eax 104d: 3b 45 f8 cmp -0x8(%ebp),%eax 1050: 75 20 jne 1072 <free+0xcf> p->s.size += bp->s.size; 1052: 8b 45 fc mov -0x4(%ebp),%eax 1055: 8b 50 04 mov 0x4(%eax),%edx 1058: 8b 45 f8 mov -0x8(%ebp),%eax 105b: 8b 40 04 mov 0x4(%eax),%eax 105e: 01 c2 add %eax,%edx 1060: 8b 45 fc mov -0x4(%ebp),%eax 1063: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 1066: 8b 45 f8 mov -0x8(%ebp),%eax 1069: 8b 10 mov (%eax),%edx 106b: 8b 45 fc mov -0x4(%ebp),%eax 106e: 89 10 mov %edx,(%eax) 1070: eb 08 jmp 107a <free+0xd7> } else p->s.ptr = bp; 1072: 8b 45 fc mov -0x4(%ebp),%eax 1075: 8b 55 f8 mov -0x8(%ebp),%edx 1078: 89 10 mov %edx,(%eax) freep = p; 107a: 8b 45 fc mov -0x4(%ebp),%eax 107d: a3 e8 14 00 00 mov %eax,0x14e8 } 1082: 90 nop 1083: c9 leave 1084: c3 ret 00001085 <morecore>: static Header* morecore(uint nu) { 1085: 55 push %ebp 1086: 89 e5 mov %esp,%ebp 1088: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) 108b: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 1092: 77 07 ja 109b <morecore+0x16> nu = 4096; 1094: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 109b: 8b 45 08 mov 0x8(%ebp),%eax 109e: c1 e0 03 shl $0x3,%eax 10a1: 83 ec 0c sub $0xc,%esp 10a4: 50 push %eax 10a5: e8 7b f5 ff ff call 625 <sbrk> 10aa: 83 c4 10 add $0x10,%esp 10ad: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 10b0: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 10b4: 75 07 jne 10bd <morecore+0x38> return 0; 10b6: b8 00 00 00 00 mov $0x0,%eax 10bb: eb 26 jmp 10e3 <morecore+0x5e> hp = (Header*)p; 10bd: 8b 45 f4 mov -0xc(%ebp),%eax 10c0: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 10c3: 8b 45 f0 mov -0x10(%ebp),%eax 10c6: 8b 55 08 mov 0x8(%ebp),%edx 10c9: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 10cc: 8b 45 f0 mov -0x10(%ebp),%eax 10cf: 83 c0 08 add $0x8,%eax 10d2: 83 ec 0c sub $0xc,%esp 10d5: 50 push %eax 10d6: e8 c8 fe ff ff call fa3 <free> 10db: 83 c4 10 add $0x10,%esp return freep; 10de: a1 e8 14 00 00 mov 0x14e8,%eax } 10e3: c9 leave 10e4: c3 ret 000010e5 <malloc>: void* malloc(uint nbytes) { 10e5: 55 push %ebp 10e6: 89 e5 mov %esp,%ebp 10e8: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 10eb: 8b 45 08 mov 0x8(%ebp),%eax 10ee: 83 c0 07 add $0x7,%eax 10f1: c1 e8 03 shr $0x3,%eax 10f4: 83 c0 01 add $0x1,%eax 10f7: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 10fa: a1 e8 14 00 00 mov 0x14e8,%eax 10ff: 89 45 f0 mov %eax,-0x10(%ebp) 1102: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1106: 75 23 jne 112b <malloc+0x46> base.s.ptr = freep = prevp = &base; 1108: c7 45 f0 e0 14 00 00 movl $0x14e0,-0x10(%ebp) 110f: 8b 45 f0 mov -0x10(%ebp),%eax 1112: a3 e8 14 00 00 mov %eax,0x14e8 1117: a1 e8 14 00 00 mov 0x14e8,%eax 111c: a3 e0 14 00 00 mov %eax,0x14e0 base.s.size = 0; 1121: c7 05 e4 14 00 00 00 movl $0x0,0x14e4 1128: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 112b: 8b 45 f0 mov -0x10(%ebp),%eax 112e: 8b 00 mov (%eax),%eax 1130: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 1133: 8b 45 f4 mov -0xc(%ebp),%eax 1136: 8b 40 04 mov 0x4(%eax),%eax 1139: 3b 45 ec cmp -0x14(%ebp),%eax 113c: 72 4d jb 118b <malloc+0xa6> if(p->s.size == nunits) 113e: 8b 45 f4 mov -0xc(%ebp),%eax 1141: 8b 40 04 mov 0x4(%eax),%eax 1144: 3b 45 ec cmp -0x14(%ebp),%eax 1147: 75 0c jne 1155 <malloc+0x70> prevp->s.ptr = p->s.ptr; 1149: 8b 45 f4 mov -0xc(%ebp),%eax 114c: 8b 10 mov (%eax),%edx 114e: 8b 45 f0 mov -0x10(%ebp),%eax 1151: 89 10 mov %edx,(%eax) 1153: eb 26 jmp 117b <malloc+0x96> else { p->s.size -= nunits; 1155: 8b 45 f4 mov -0xc(%ebp),%eax 1158: 8b 40 04 mov 0x4(%eax),%eax 115b: 2b 45 ec sub -0x14(%ebp),%eax 115e: 89 c2 mov %eax,%edx 1160: 8b 45 f4 mov -0xc(%ebp),%eax 1163: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 1166: 8b 45 f4 mov -0xc(%ebp),%eax 1169: 8b 40 04 mov 0x4(%eax),%eax 116c: c1 e0 03 shl $0x3,%eax 116f: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 1172: 8b 45 f4 mov -0xc(%ebp),%eax 1175: 8b 55 ec mov -0x14(%ebp),%edx 1178: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 117b: 8b 45 f0 mov -0x10(%ebp),%eax 117e: a3 e8 14 00 00 mov %eax,0x14e8 return (void*)(p + 1); 1183: 8b 45 f4 mov -0xc(%ebp),%eax 1186: 83 c0 08 add $0x8,%eax 1189: eb 3b jmp 11c6 <malloc+0xe1> } if(p == freep) 118b: a1 e8 14 00 00 mov 0x14e8,%eax 1190: 39 45 f4 cmp %eax,-0xc(%ebp) 1193: 75 1e jne 11b3 <malloc+0xce> if((p = morecore(nunits)) == 0) 1195: 83 ec 0c sub $0xc,%esp 1198: ff 75 ec pushl -0x14(%ebp) 119b: e8 e5 fe ff ff call 1085 <morecore> 11a0: 83 c4 10 add $0x10,%esp 11a3: 89 45 f4 mov %eax,-0xc(%ebp) 11a6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 11aa: 75 07 jne 11b3 <malloc+0xce> return 0; 11ac: b8 00 00 00 00 mov $0x0,%eax 11b1: eb 13 jmp 11c6 <malloc+0xe1> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 11b3: 8b 45 f4 mov -0xc(%ebp),%eax 11b6: 89 45 f0 mov %eax,-0x10(%ebp) 11b9: 8b 45 f4 mov -0xc(%ebp),%eax 11bc: 8b 00 mov (%eax),%eax 11be: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 11c1: e9 6d ff ff ff jmp 1133 <malloc+0x4e> } 11c6: c9 leave 11c7: c3 ret
36.135664
73
0.407691
38e8987acf37db69ac1d15fe92039e77605aa50e
203
asm
Assembly
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/modf.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/modf.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/modf.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_fp_am9511 PUBLIC modf EXTERN cam32_sccz80_modf defc modf = cam32_sccz80_modf ; SDCC bridge for Classic IF __CLASSIC PUBLIC _modf EXTERN _am9511_modf defc _modf = _am9511_modf ENDIF
12.6875
30
0.812808
d477cfe1e6817242daf4ef1b77469e1e888c966d
1,851
asm
Assembly
puzzles.asm
raphnet/super_sudoku
227c9ff570c80f5cf58d0d7b62fe1a99e6f3844b
[ "MIT" ]
6
2022-02-16T23:06:14.000Z
2022-03-23T01:50:13.000Z
puzzles.asm
raphnet/super_sudoku
227c9ff570c80f5cf58d0d7b62fe1a99e6f3844b
[ "MIT" ]
null
null
null
puzzles.asm
raphnet/super_sudoku
227c9ff570c80f5cf58d0d7b62fe1a99e6f3844b
[ "MIT" ]
null
null
null
.include "header.inc" .include "puzzles.inc" .include "misc_macros.inc" .16bit .ramsection "puzzle buffer" SLOT RAM_SLOT puzzle_buffer: dsb 81 puzzle_level: dw puzzle_id: dw .ends .bank 0 .section "Puzzle loader" FREE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Initialize puzzle_buffer with a blank puzzle ; puzzles_loadEmpty: Memset puzzle_buffer 0 _sizeof_puzzle_buffer rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Load a puzzle from ROM to a RAM buffer ; ; puzzles_load: pushall A16 XY16 ; Multiply puzzle ID by puzzle size (128) lda puzzle_id asl asl asl asl asl asl asl tax A8 lda puzzle_level beq @simple_load cmp #1 beq @easy_load cmp #2 beq @intermediate_load cmp #3 beq @expert_load @simple_load: ldy #0 ; counter for 81 bytes @simple_loop: lda puzzles_simple.L, X sta puzzle_buffer, Y inx iny cpy #81 bne @simple_loop bra @done @easy_load: ldy #0 ; counter for 81 bytes @easy_loop: lda puzzles_easy.L, X sta puzzle_buffer, Y inx iny cpy #81 bne @easy_loop bra @done @intermediate_load: ldy #0 ; counter for 81 bytes @intermediate_loop: lda puzzles_intermediate.L, X sta puzzle_buffer, Y inx iny cpy #81 bne @intermediate_loop bra @done @expert_load: ldy #0 ; counter for 81 bytes @expert_loop: lda puzzles_expert.L, X sta puzzle_buffer, Y inx iny cpy #81 bne @expert_loop bra @done @done: popall rts .ends .bank 1 .section "Simple puzzles" FREE puzzles_simple: .incbin "puzzles/simple.bin" .ends .bank 2 .section "Easy puzzles" FREE puzzles_easy: .incbin "puzzles/easy.bin" .ends .bank 3 .section "Intermediate puzzles" FREE puzzles_intermediate: .incbin "puzzles/intermediate.bin" .ends .bank 4 .section "Expert puzzles" FREE puzzles_expert: .incbin "puzzles/expert.bin" .ends
12.944056
68
0.672609
aa534ee9054e1d85f7b50959f49218f19f477dbe
14,154
asm
Assembly
solver.asm
raphnet/super_sudoku
227c9ff570c80f5cf58d0d7b62fe1a99e6f3844b
[ "MIT" ]
6
2022-02-16T23:06:14.000Z
2022-03-23T01:50:13.000Z
solver.asm
raphnet/super_sudoku
227c9ff570c80f5cf58d0d7b62fe1a99e6f3844b
[ "MIT" ]
null
null
null
solver.asm
raphnet/super_sudoku
227c9ff570c80f5cf58d0d7b62fe1a99e6f3844b
[ "MIT" ]
null
null
null
; Super Sudoku - A Sudoku game for the SNES ; Copyright 2019-2022 Raphaël Assenat <raph@raphnet.net> ; ; 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 "header.inc" .include "snesregs.inc" .include "misc_macros.inc" .include "zeropage.inc" .include "grid.inc" .bank 0 .ramsection "solver_variables" SLOT RAM_SLOT slv_num_valid_moves: dw slv_valid_list: dsb 9 slv_digit: dw slv_x: dw slv_y: dw slv_tmp_x: dw slv_tmp_y: dw ; An array whose indexes matches gridata. Each element ; is a count of how many valid moves there are. slv_num_moves_per_cell: dsw 81 ;slv_tmpval: dw .ends .16BIT .section "solver code" FREE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Count how many legal moves a cell has. ; ; Input args: gridarg_x, gridarg_y ; Output: slv_num_valid_moves, slv_valid_list ; solver_countValidMovesInCell: pushall A8 XY8 ldx #0 ; legal move counter lda #1 ; digit to try @next_digit sta gridarg_value jsr grid_canInsertValueAt ; sets carry when illegal bcs @illegal @legal: sta slv_valid_list, X inx @illegal: inc A ; advance to next digit value cmp #10 bne @next_digit XY16 stx slv_num_valid_moves popall rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Check if a given digit is already present in a column ; ; Args: ; - X: Index into griddata ; - slv_digit: The value to look for ; ; Returns with carry set if present. _solver_isDigitInColumn: pushall AXY16 ldy #9 ; Check 9 cells @next_cell: lda griddata, X and #$ff cmp slv_digit beq @present ; Skip to next row (+18) txa clc adc #18 tax dey ; count where we're at bne @next_cell @absent: popall clc rts @present: popall sec rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Check if a given digit is already present in a row. ; ; Args: ; - X: Index into griddata ; - slv_digit: The value to look for ; ; Returns with carry set if present. _solver_isDigitInRow: pushall AXY16 ldy #9 ; Check 9 cells @next_cell: lda griddata, X and #$ff cmp slv_digit beq @present inx ; advance to inx ; next cell dey ; count where we're at bne @next_cell @absent: popall clc rts @present: popall sec rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Check if a number that is not already in a given column can be inserted ; legally in only ONE empty cell. ; ; Input: gridarg_x, slv_digit ; Output: slv_tmp_y, carry ; ; Modifies: gridarg_y ; ; returns with carry clear if it only fits in one place. ; sets slv_tmp_y to Y coordinate where the digit fits ; _solver_canNumberFitInOnlyOneColumnCell: pushall AXY16 ; First, check if the number is already in the column stz gridarg_y jsr grid_getDataOffset jsr _solver_isDigitInColumn bcs @return_no ; already there ; Now check each cell ldx #0 ; Holds current Y ldy #0 ; Counter for places it can fit lda slv_digit ; prepare argument for sta gridarg_value ; grid_canInsertValueAt calls @next_cell: stx gridarg_y ; gridarg_y stays constant jsr grid_isEmptyAt bcs @cannot jsr grid_canInsertValueAt bcs @cannot ; we can. count it! stx slv_tmp_y ; save where it fitted iny cpy #2 ; Check if it was found to fit in more than 1 place beq @return_no ; Yes? Then return false @cannot: inx cpx #9 bne @next_cell ; Done looping. Did we find a place where it fits? cpy #1 bne @return_no ; if this branch is taken, the puzzle is not solvable @return_yes: popall clc rts @return_no: popall sec rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Check if a number that is not already in a given row can be inserted ; legally in only ONE empty cell. ; ; Input: gridarg_y, slv_digit ; Output: slv_tmp_x, carry ; ; Modifies: gridarg_x ; ; returns with carry clear if it only fits in one place. ; sets slv_tmp_x to X coordinate where the digit fits ; _solver_canNumberFitInOnlyOneRowCell: pushall AXY16 ; First, check if the number is already in the row stz gridarg_x jsr grid_getDataOffset jsr _solver_isDigitInRow bcs @return_no ; already there ; Now check each cell ldx #0 ; Holds current X ldy #0 ; Counter for places it can fit lda slv_digit ; prepare argument for sta gridarg_value ; grid_canInsertValueAt calls @next_cell: stx gridarg_x ; gridarg_y stays constant jsr grid_isEmptyAt bcs @cannot jsr grid_canInsertValueAt bcs @cannot ; we can. count it! stx slv_tmp_x ; save where it fitted iny cpy #2 ; Check if it was found to fit in more than 1 place beq @return_no ; Yes? Then return false @cannot: inx cpx #9 bne @next_cell ; Done looping. Did we find a place where it fits? cpy #1 bne @return_no ; if this branch is taken, the puzzle is not solvable @return_yes: popall clc rts @return_no: popall sec rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Iterate over non-occupied cells, looking for a cell that would ; legally accept only once value. ; ; Uses: gridarg_x, gridarg_y, gridarg_value (for grid_* functions) ; ; Output: slv_digit (if found), slv_x, slv_y ; ; Returns with carry clear if a candidate was found. ; solver_findUniqueColumnCandidate: pushall AXY16 lda #1 ; First digit to try @next_digit: ldy #0 ; X coord. @next_row: sta slv_digit sty gridarg_x jsr _solver_canNumberFitInOnlyOneColumnCell bcc @found iny cpy #9 bne @next_row inc A cmp #10 bne @next_digit bra @not_found @found: sty slv_x ldx slv_tmp_y stx slv_y ; note: slv_digit already set popall clc rts @not_found: popall sec rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Iterate over non-occupied cells, looking for a cell that would ; legally accept only once value. ; ; Uses: gridarg_x, gridarg_y, gridarg_value (for grid_* functions) ; ; Output: slv_digit (if found), slv_x, slv_y ; ; Returns with carry clear if a candidate was found. ; solver_findUniqueRowCandidate: pushall AXY16 lda #1 ; First digit to try @next_digit: ldy #0 ; Y coord. @next_row: sta slv_digit sty gridarg_y jsr _solver_canNumberFitInOnlyOneRowCell bcc @found iny cpy #9 bne @next_row inc A cmp #10 bne @next_digit bra @not_found @found: sty slv_y ldx slv_tmp_x stx slv_x ; note: slv_digit already set popall clc rts @not_found: popall sec rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Iterate over non-occupied cells, looking for a cell that would ; legally accept only once value. ; ; Uses: gridarg_x, gridarg_y, gridarg_value (for grid_* functions) ; ; Output: slv_digit (if found), slv_x, slv_y ; ; Returns with carry clear if a candidate was found. ; solver_findSoleCandidate: pushall AXY16 ldy #0 @next_y: ldx #0 @next_x: ; Try all digits, from 9 to 1, counting how many are valid ; moves in this cell lda #9 sta gridarg_value ; Counter for valid digits lda #0 stx gridarg_x sty gridarg_y @next_digit: jsr grid_isEmptyAt bcs @occupied ; If occupied, noting to do here jsr grid_canInsertValueAt ; sets carry when illegal bcs @not_legal pha lda gridarg_value sta slv_digit pla ina ; Count the possibility cmp #2 ; When more than 1, stop trying digits in this cell beq @more_than_1 @not_legal: dec gridarg_value bne @next_digit ; Check if we found 1 digit cmp #1 beq @found_single @occupied: @more_than_1: inx cpx #9 bne @next_x iny cpy #9 bne @next_y ; No cell found popall sec rts @found_single: ; slv_digit is already set. Store X and Y. stx slv_x sty slv_y popall clc rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Setup a list of cell indices (for griddata) in dp_slv_emptyCells in ; increasing number of possible moves. Celles with 0 moves omitted. ; ; The last entry is set to 0xFFFF ; _solver_prepareEmptyCellList: ; First count how many valid moves in each cell, storing the result ; in slv_num_moves_per_cell in the same order as griddata jsr _solver_buildNumMovesArray pushall AXY16 ; Now create a sorted (1 to 9) array of griddata indices. ldy #0 ; Offset into dp_slv_emptyCells lda #9 sta dp_slv_sorttmp @next_count: ldx #0 ; Offset into griddata @nextcell: ; Load the number of moves for the current cell lda slv_num_moves_per_cell, X beq @skip ; cmp dp_slv_sorttmp ; bne @skip stx dp_slv_emptyCells, Y iny iny @skip: inx inx cpx #81*2 bne @nextcell ; dec dp_slv_sorttmp ; bpl @next_count ; End of list marker ldx #$ffff stx dp_slv_emptyCells, Y popall rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Populate an array whose indexes matches gridata. Each element ; is a count of how many valid moves there are. ; ; Uses: dp_slv_tmpval ; ; Output: slv_num_moves_per_cell ; _solver_buildNumMovesArray: pushall AXY16 lda #slv_num_moves_per_cell sta dp_slv_tmpval ldy #0 @next_row: ldx #0 @next_cell: stx gridarg_x sty gridarg_y ; First check if the cell is occupied. An occupied cell has ; no valid moves. It is assumed that it holds the correct value already. lda #0 ; prepare a move count of 0 jsr grid_isEmptyAt bcs @occupied ; Count valid moves jsr solver_countValidMovesInCell ; Retrive the number of valid moves lda slv_num_valid_moves @occupied: ; write it to the array sta (dp_slv_tmpval) ; advance pointer to next cell inc dp_slv_tmpval inc dp_slv_tmpval inx cpx #9 bne @next_cell iny cpy #9 bne @next_row popall rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Find an empty cell, starting at offset X. ; ; Return with X the offset into griddata ; ; If none is found, returns with carry set ; AXY16 _solver_findEmptyCellNew: ldx #0 A8 @nextCell: ldy dp_slv_emptyCells, X bmi @nomore ; Stop at $ffff lda griddata, Y beq @empty_found inx inx bra @nextCell @nomore: A16 ; None found. Return with carry set. sec rts @empty_found: A16 tyx clc rts */ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Find an empty cell, starting at offset X. ; ; Return with X the offset into griddata ; ; If none is found, returns with carry set ; AXY16 _solver_findEmptyCell: ; ldx #0 @nextCell: lda griddata, X and #$ff beq @empty_found inx inx cpx #81*2 bne @nextCell ; None found. Re sec rts @empty_found: clc rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Check if a given values exists in the neighbors of a cell. ; ; Arguments: ; - X : Offset in gridata/neighbor_list ; - dp_slv_tmpval : Value to look for ; ; Return with carry set if found, clear otherwise. ; AXY16 _solverCheckNeighborsForValue: phx phy ; Get the pointer to the list of neighbors for the designated cell lda neighbor_list, X ; Store it in the direct page for upcoming indirect acceses sta dp_indirect_tmp1 ldy #20*2 @checknext: dey dey bmi @not_found lda (dp_indirect_tmp1),Y ; Load offset for neighbor tax ; Move the offset to X to use it lda griddata, X ; Load the value at this position and #$FF cmp dp_slv_tmpval ; Check if it is the value we are looking for bne @checknext @foundit: sec ply plx rts @not_found: clc ply plx rts ;;;;;;;; ; ; Recursive routine for solving a sudoku. ; ; Returns with carry set when all cells are populated. ; ; X: Current offset in griddata for faster empty cell finding ; AXY16 _solver_bruteforcer: phy phx lda cancel_solver bne @triedall ; 1. Find an empty cell. ;jsr _solver_findEmptyCell2 ;bcs @solved ; Carry set means none was found. Puzzle solved. ; inlined version of the above @nextCell: lda griddata, X and #$ff beq @empty_found inx inx cpx #81*2 bne @nextCell bra @solved @empty_found: ; X now holds the offset for the cell. It is used by the neighbor ; check in the loop below. ; 2. Try digits at current position ldy #10 ; First digit to try @next_value: dey beq @triedall ; Check if this is a valid move here sty dp_slv_tmpval ; Value to check (arg for subroutine below) jsr _solverCheckNeighborsForValue bcs @next_value ; Carry is set if value is unallowed ; Value allowed! Insert it. tya ; jsr grid_insertHintedValueOffset ora #(BRUTEFORCED_DIGIT_PAL<<8) sta griddata, X ; Try recursion. jsr _solver_bruteforcer bcs @solved ; Carry clear? Then this was a dead end. Try another digit... bra @next_value @triedall: ; None of the tried digits worked. Clear the cell. ;lda #0 ;jsr grid_insertHintedValueOffset stz griddata, X lda #1 sta grid_changed clc plx ply rts @solved: lda #1 sta grid_changed plx ply rts solver_bruteForce: pushall AXY16 ; this was for use with _solver_findEmptyCellNew but ; it seems slower. ; jsr _solver_prepareEmptyCellList brk1: ldx #0 ; stx dp_slv_nextEmpty jsr _solver_bruteforcer popall rts .ends
18.076628
85
0.671683
ced510f7929191d601cf240d101d957e57f447cc
1,330
asm
Assembly
Userland/SampleCodeModule/libasm/syscallManager.asm
glpecile/2020Q2_ARQ_TPE
6f8ba936ac8a99e529fed46d0b3b2e01770bc07f
[ "BSD-3-Clause-Clear", "BSD-3-Clause" ]
null
null
null
Userland/SampleCodeModule/libasm/syscallManager.asm
glpecile/2020Q2_ARQ_TPE
6f8ba936ac8a99e529fed46d0b3b2e01770bc07f
[ "BSD-3-Clause-Clear", "BSD-3-Clause" ]
null
null
null
Userland/SampleCodeModule/libasm/syscallManager.asm
glpecile/2020Q2_ARQ_TPE
6f8ba936ac8a99e529fed46d0b3b2e01770bc07f
[ "BSD-3-Clause-Clear", "BSD-3-Clause" ]
null
null
null
; ; syscallManager.asm: Manejo de syscalls de Userland a Kernerl. ; Si bien se debe reducir el código en assembler por no ser portable, ; es indispensable para la conexión por la interrupción int80h (igual que Linux). GLOBAL _getTime GLOBAL _sGetChar GLOBAL _swrite GLOBAL _setCursor GLOBAL _drawFigure GLOBAL _clearScreen GLOBAL _timerFunc GLOBAL _getPixelHeight GLOBAL _getPixelWidth SECTION .text %macro pushState 0 push rbx push rcx push rdx push rbp push rdi push rsi push r8 push r9 push r10 push r11 push r12 push r13 push r14 push r15 %endmacro %macro popState 0 pop r15 pop r14 pop r13 pop r12 pop r11 pop r10 pop r9 pop r8 pop rsi pop rdi pop rbp pop rdx pop rcx pop rbx %endmacro %macro syscall 1 pushState mov r10, r9 ; sexto. Se pasa otro vector en drawFigure. mov r9, r8 ; quinto. Se pasa un vector en drawFigure. mov r8, rcx ; cuarto. mov rcx, rdx ; tercero. mov rdx, rsi ; segundo. mov rsi, rdi ; primer parametro que reciben las funciones. mov rdi, %1 ; pasaje de parametro de syscall. int 80h ; interrupción. popState ret %endmacro _timerFunc: syscall 0 _getTime: syscall 1 _drawFigure: syscall 2 _swrite: syscall 3 _sGetChar: syscall 4 _setCursor: syscall 5 _clearScreen: syscall 6 _getPixelHeight: syscall 7 _getPixelWidth: syscall 8
15.833333
81
0.741353
2802c02c81ab71d3999307f70a361a6ea99ba93c
7,838
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_zr_4k_/i7-7700_9_0xca_notsx.log_21829_1414.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_4k_/i7-7700_9_0xca_notsx.log_21829_1414.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_4k_/i7-7700_9_0xca_notsx.log_21829_1414.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r15 push %r8 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x1aa6e, %r14 nop add %r8, %r8 mov $0x6162636465666768, %r9 movq %r9, %xmm2 vmovups %ymm2, (%r14) nop nop nop nop nop dec %r10 lea addresses_WC_ht+0x1110e, %r15 nop nop nop nop nop inc %r8 and $0xffffffffffffffc0, %r15 vmovntdqa (%r15), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %rdx nop nop nop inc %r10 lea addresses_A_ht+0x17dca, %rdx nop nop dec %rbp movb (%rdx), %r9b nop nop nop nop sub %r15, %r15 lea addresses_D_ht+0x1b08e, %rbp clflush (%rbp) nop nop sub %r14, %r14 movb $0x61, (%rbp) dec %rbp lea addresses_normal_ht+0xc30e, %r15 nop nop nop nop nop inc %r8 mov $0x6162636465666768, %r14 movq %r14, %xmm1 movups %xmm1, (%r15) nop nop nop nop and %r10, %r10 lea addresses_UC_ht+0xfc0e, %rsi lea addresses_D_ht+0x13f0e, %rdi nop nop inc %r8 mov $63, %rcx rep movsl nop nop nop sub $42363, %r15 lea addresses_WC_ht+0x5cf6, %rsi lea addresses_A_ht+0x1d70e, %rdi sub %rbp, %rbp mov $61, %rcx rep movsb nop nop nop nop nop and $15352, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r8 push %rbx push %rcx push %rdi push %rdx push %rsi // Store lea addresses_RW+0xa4ee, %rcx clflush (%rcx) nop nop nop nop xor %r13, %r13 movw $0x5152, (%rcx) nop nop nop add $42849, %r8 // Load lea addresses_US+0x1e70e, %rdx nop sub %rcx, %rcx movups (%rdx), %xmm4 vpextrq $0, %xmm4, %rbx nop nop nop nop sub %rdx, %rdx // Load lea addresses_A+0x16ab6, %rcx nop nop nop nop add $39245, %rdi mov (%rcx), %r8 nop and $8221, %r13 // Store lea addresses_normal+0xd30e, %rcx nop nop nop nop dec %rdi mov $0x5152535455565758, %rbx movq %rbx, %xmm0 vmovups %ymm0, (%rcx) nop nop nop nop nop and $49476, %rdi // Store lea addresses_WT+0x3ede, %r13 nop nop nop xor %r8, %r8 movl $0x51525354, (%r13) nop inc %rsi // Store lea addresses_normal+0xf096, %r8 nop nop nop nop sub $64632, %r13 movw $0x5152, (%r8) nop nop nop nop inc %rdx // Store lea addresses_UC+0x12f0e, %rdx nop nop sub %r13, %r13 mov $0x5152535455565758, %rsi movq %rsi, %xmm5 vmovups %ymm5, (%rdx) nop nop nop and %rbx, %rbx // Store lea addresses_UC+0x1870e, %r13 add $64797, %r8 movw $0x5152, (%r13) nop nop nop and %rsi, %rsi // Faulty Load lea addresses_US+0x1e70e, %rdi nop nop nop nop nop dec %rsi mov (%rdi), %rbx lea oracles, %rdx and $0xff, %rbx shlq $12, %rbx mov (%rdx,%rbx,1), %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'00': 77, '52': 21752} 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 */
29.802281
2,999
0.653611
afb3d1c47e37b299fd8a4ac9258bd72d9cc6f7be
2,598
asm
Assembly
Driver/Printer/PrintCom/Graphics/graphicsPrintSwathPCL.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/Printer/PrintCom/Graphics/graphicsPrintSwathPCL.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/Printer/PrintCom/Graphics/graphicsPrintSwathPCL.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: HP PCL type print drivers FILE: graphicsPrintSwathPCL.asm AUTHOR: Dave Durran 1 March 1990 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 3/1/90 Initial revision Dave 3/92 moved from epson9 DESCRIPTION: $Id: graphicsPrintSwathPCL.asm,v 1.1 97/04/18 11:51:25 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrintSwath %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Print a swath passed from spooler, all in one variable sized band, since the min band height is 1 scanline. CALLED BY: GLOBAL PASS: bp - PState segment dx.cx - VM file and block handle for Huge bitmap RETURN: carry - set if some transmission error DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrintSwath proc far uses ax,cx,ds,bx,dx,si,di,ds,es .enter mov es, bp ; es -> PState ; load the bitmap header into the PState call LoadSwathHeader ; bitmap header into PS_swath ; load up the band width and height call PrLoadPstateVars ;set up the pstate band Vars. ; size and allocate a graphics data buffer call PrCreatePrintBuffers ;allocate the print buffer. ; get pointer to data clr ax mov es:[PS_curColorNumber],ax ;init offset into scanline. call DerefFirstScanline ; ds:si -> scan line zero ; dec cx ; see if only one band to do clc jcxz destroyBuffer ;set the graphics mode in the printer. clr bh mov bl,es:PS_mode mov ax,cs:[bx].pr_graphic_Res_Values mov di,offset pr_codes_SetGraphicRes call WriteNumCommand jc destroyBuffer scanlineLoop: call DerefAScanline call PrSendScanline ;print a line from this swath. jc destroyBuffer inc es:[PS_newScanNumber] ;point at next line down. loop scanlineLoop mov si,offset pr_codes_EndGraphics call SendCodeOut ; all done, kill the buffer and leave destroyBuffer: pushf call PrDestroyPrintBuffers ;get rid of print buffer space. popf ; no errors .leave ret PrintSwath endp
24.055556
79
0.594688
b292959310bbd5e93d966e607953866aaa28ac4c
1,416
asm
Assembly
programs/oeis/022/A022352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/022/A022352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/022/A022352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A022352: Fibonacci sequence beginning 0, 18. ; 0,18,18,36,54,90,144,234,378,612,990,1602,2592,4194,6786,10980,17766,28746,46512,75258,121770,197028,318798,515826,834624,1350450,2185074,3535524,5720598,9256122,14976720,24232842,39209562,63442404,102651966,166094370,268746336,434840706,703587042,1138427748,1842014790,2980442538,4822457328,7802899866,12625357194,20428257060,33053614254,53481871314,86535485568,140017356882,226552842450,366570199332,593123041782,959693241114,1552816282896,2512509524010,4065325806906,6577835330916,10643161137822,17220996468738,27864157606560,45085154075298,72949311681858,118034465757156,190983777439014,309018243196170,500002020635184,809020263831354,1309022284466538,2118042548297892,3427064832764430,5545107381062322,8972172213826752,14517279594889074,23489451808715826,38006731403604900,61496183212320726,99502914615925626,160999097828246352,260502012444171978,421501110272418330,682003122716590308,1103504232989008638,1785507355705598946,2889011588694607584,4674518944400206530,7563530533094814114,12238049477495020644,19801580010589834758,32039629488084855402,51841209498674690160,83880838986759545562,135722048485434235722,219602887472193781284,355324935957628017006,574927823429821798290,930252759387449815296,1505180582817271613586,2435433342204721428882,3940613925021993042468 seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. mul $0,18
236
1,275
0.889124
1d9432b4b8d897b43a170068ba4284ec96351991
348
asm
Assembly
programs/oeis/186/A186685.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/186/A186685.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/186/A186685.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A186685: Total number of n-digit numbers requiring 19 positive biquadrates in their representation as sum of biquadrates. ; 0,1,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 sub $0,1 pow $0,3 mov $1,6 bin $1,$0 mov $0,$1
38.666667
175
0.614943
30523f4d8196b318d9df03f547454198974c190c
745
asm
Assembly
oeis/159/A159926.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/159/A159926.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/159/A159926.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A159926: The sum of all terms in row 1 through m of triangle A159924. ; Submitted by Jamie Morken(s2) ; 1,4,16,77,447,3053,23978,212750,2103523,22926004,273008526,3526184835,49093579165,732877502641,11676946463092,197775212369924,3548276876195541,67219485435345356,1340841431830711580,28090450583009597825,616649071394380440571,14154838191487740535309,339099467524311392406846,8463331849916297069635842,219707528630299412418125047,5923639941168167838219740428,165642210824078400057734606938,4797700473957105433836083860775,143765372007889084615024781216313,4451928831770604517631932133844929 mov $2,$0 mov $4,$0 add $4,1 lpb $4 mov $0,$2 sub $4,1 sub $0,$4 lpb $0 sub $0,1 add $3,$1 lpe add $3,1 add $1,$3 lpe mov $0,$1
37.25
489
0.812081
656e8f8d190c0380f953e306147760ee50f7e2ff
685
asm
Assembly
oeis/145/A145528.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/145/A145528.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/145/A145528.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A145528: Numbers x such that (x+91)^3 - x^3 is a square. ; Submitted by Jamie Morken(s3) ; 455,728182,1058842239,1539555953390,2238513297452887,3254796794940610374,4732472301330350096975,6881011471337534100457342,10004985946852473251714944359,14547242685712024770459428706710,21151680860039337163774757624678047,30754529423254510524103727126853239694,44717064629731198262709655467686985903095,65018581217099739019469314946289750649926502,94536972372598390803110121222249829758007296879,137456692811176843127983096787836306178391959801630 mov $2,1 mov $3,1 lpb $0 sub $0,$3 add $4,1 mov $1,$4 mul $1,1452 add $2,$1 add $4,$2 lpe mov $0,$4 div $0,2 mul $0,1001 add $0,455
36.052632
448
0.829197
e555a59d26f111102c63062098304b91e44c072f
3,385
asm
Assembly
coverage/PENDING_SUBMIT/amdvlk/0598-COVERAGE-instruction-simplify-1093/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
null
null
null
coverage/PENDING_SUBMIT/amdvlk/0598-COVERAGE-instruction-simplify-1093/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
47
2021-03-11T07:42:51.000Z
2022-03-14T06:30:14.000Z
coverage/PENDING_SUBMIT/amdvlk/0598-COVERAGE-instruction-simplify-1093/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
6a3672040dcfa0d164d313224446496d1775a15e
[ "Apache-2.0" ]
4
2021-03-09T13:37:19.000Z
2022-02-25T07:32:11.000Z
; SPIR-V ; Version: 1.0 ; Generator: Khronos Glslang Reference Front End; 10 ; Bound: 60 ; Schema: 0 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %13 %35 OpExecutionMode %4 OriginUpperLeft OpSource ESSL 320 OpName %4 "main" OpName %8 "a" OpName %13 "gl_FragCoord" OpName %35 "_GLF_color" OpName %38 "buf0" OpMemberName %38 0 "_GLF_uniform_int_values" OpName %40 "" OpDecorate %13 BuiltIn FragCoord OpDecorate %35 Location 0 OpDecorate %37 ArrayStride 16 OpMemberDecorate %38 0 Offset 0 OpDecorate %38 Block OpDecorate %40 DescriptorSet 0 OpDecorate %40 Binding 0 %2 = OpTypeVoid %3 = OpTypeFunction %2 %6 = OpTypeInt 32 1 %7 = OpTypePointer Function %6 %9 = OpConstant %6 0 %10 = OpTypeFloat 32 %11 = OpTypeVector %10 4 %12 = OpTypePointer Input %11 %13 = OpVariable %12 Input %14 = OpTypeInt 32 0 %15 = OpConstant %14 1 %16 = OpTypePointer Input %10 %19 = OpConstant %10 10 %20 = OpTypeBool %25 = OpConstant %6 1 %27 = OpConstant %6 2 %34 = OpTypePointer Output %11 %35 = OpVariable %34 Output %36 = OpConstant %14 2 %37 = OpTypeArray %6 %36 %38 = OpTypeStruct %37 %39 = OpTypePointer Uniform %38 %40 = OpVariable %39 Uniform %41 = OpTypePointer Uniform %6 %4 = OpFunction %2 None %3 %5 = OpLabel %8 = OpVariable %7 Function OpStore %8 %9 %17 = OpAccessChain %16 %13 %15 %18 = OpLoad %10 %17 %21 = OpFOrdGreaterThan %20 %18 %19 OpSelectionMerge %23 None OpBranchConditional %21 %22 %23 %22 = OpLabel %24 = OpLoad %6 %8 %26 = OpIAdd %6 %24 %25 OpStore %8 %26 OpBranch %23 %23 = OpLabel %28 = OpLoad %6 %8 %29 = OpSDiv %6 %28 %27 OpStore %8 %29 %30 = OpLoad %6 %8 %31 = OpIEqual %20 %30 %9 OpSelectionMerge %33 None OpBranchConditional %31 %32 %55 %32 = OpLabel %42 = OpAccessChain %41 %40 %9 %9 %43 = OpLoad %6 %42 %44 = OpConvertSToF %10 %43 %45 = OpAccessChain %41 %40 %9 %25 %46 = OpLoad %6 %45 %47 = OpConvertSToF %10 %46 %48 = OpAccessChain %41 %40 %9 %25 %49 = OpLoad %6 %48 %50 = OpConvertSToF %10 %49 %51 = OpAccessChain %41 %40 %9 %9 %52 = OpLoad %6 %51 %53 = OpConvertSToF %10 %52 %54 = OpCompositeConstruct %11 %44 %47 %50 %53 OpStore %35 %54 OpBranch %33 %55 = OpLabel %56 = OpAccessChain %41 %40 %9 %25 %57 = OpLoad %6 %56 %58 = OpConvertSToF %10 %57 %59 = OpCompositeConstruct %11 %58 %58 %58 %58 OpStore %35 %59 OpBranch %33 %33 = OpLabel OpReturn OpFunctionEnd
34.540816
59
0.485968
943ee6539f3d561917e951435576651fc2ca609a
209
asm
Assembly
libsrc/target/pc88/interrupt/add_raster_int.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/target/pc88/interrupt/add_raster_int.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/target/pc88/interrupt/add_raster_int.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_clib PUBLIC add_raster_int PUBLIC _add_raster_int EXTERN im1_install_isr defc add_raster_int = im1_install_isr defc _add_raster_int = im1_install_isr
19
57
0.69378
daa6bb6e0bff9ebb7de351ea3bf11ec3d60b769b
376
asm
Assembly
programs/oeis/119/A119913.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/119/A119913.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/119/A119913.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A119913: Number of directed simple cycles in the complete graph K_n. ; 0,0,2,14,74,394,2344,16036,125628,1112028,10976118,119481218,1421542550,18348340022,255323504812,3809950976872,60683990530072,1027542662934744,18430998766219146,349096664728623126,6962409983976703106,145841989688186383106 lpb $0 sub $1,$0 add $2,$0 sub $0,1 add $1,$2 mul $2,$0 lpe mov $0,$1
31.333333
223
0.779255
016ca6fbc26a069418beddb29a19eb70701faefe
786
asm
Assembly
programs/oeis/250/A250352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/250/A250352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/250/A250352.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A250352: Number of length 3 arrays x(i), i=1..3 with x(i) in i..i+n and no value appearing more than 2 times. ; 8,26,62,122,212,338,506,722,992,1322,1718,2186,2732,3362,4082,4898,5816,6842,7982,9242,10628,12146,13802,15602,17552,19658,21926,24362,26972,29762,32738,35906,39272,42842,46622,50618,54836,59282,63962,68882,74048,79466,85142,91082,97292,103778,110546,117602,124952,132602,140558,148826,157412,166322,175562,185138,195056,205322,215942,226922,238268,249986,262082,274562,287432,300698,314366,328442,342932,357842,373178,388946,405152,421802,438902,456458,474476,492962,511922,531362,551288,571706,592622,614042,635972,658418,681386,704882,728912,753482,778598,804266,830492,857282,884642,912578,941096,970202,999902,1030202 mov $1,2 add $1,$0 pow $1,3 sub $1,$0 mov $0,$1
87.333333
624
0.795165
c528ce7955bfeae2ebf7e1691ef664306cc76f73
5,899
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1709.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1709.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1709.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r15 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0xbd2a, %rsi lea addresses_WC_ht+0x19506, %rdi nop nop nop sub $43375, %r14 mov $2, %rcx rep movsb and %rbx, %rbx lea addresses_WC_ht+0x1be2a, %rdi sub %r10, %r10 mov (%rdi), %ecx nop lfence lea addresses_UC_ht+0x1402a, %rdi cmp $30358, %r15 mov $0x6162636465666768, %r14 movq %r14, %xmm1 and $0xffffffffffffffc0, %rdi movntdq %xmm1, (%rdi) nop nop inc %r10 lea addresses_normal_ht+0x112a, %rsi lea addresses_normal_ht+0x392a, %rdi nop sub $28415, %rbp mov $100, %rcx rep movsq nop nop nop xor $54801, %r10 lea addresses_D_ht+0xabaa, %r15 nop nop dec %rcx movw $0x6162, (%r15) nop nop nop nop cmp %rdi, %rdi lea addresses_WC_ht+0xa6aa, %r10 nop nop nop nop cmp $6931, %rbp movb $0x61, (%r10) xor %rbp, %rbp lea addresses_WT_ht+0x8faa, %rsi lea addresses_WC_ht+0x1b92a, %rdi nop nop nop nop nop xor %r14, %r14 mov $110, %rcx rep movsw sub %rbp, %rbp lea addresses_WT_ht+0x1092a, %rcx nop nop nop nop nop and %rbx, %rbx movw $0x6162, (%rcx) inc %r14 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r8 push %rbp push %rbx push %rdi // Faulty Load lea addresses_UC+0x1792a, %rbx nop nop nop nop cmp $47198, %rdi movb (%rbx), %r15b lea oracles, %rdi and $0xff, %r15 shlq $12, %r15 mov (%rdi,%r15,1), %r15 pop %rdi pop %rbx pop %rbp pop %r8 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 8, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
42.438849
2,999
0.660959
a098f9d9251a9900b381aadda5108ca1feca8d49
2,241
asm
Assembly
asm/integerArithmetic/phoneNumber.main.asm
IronHeart7334/AssemblyPrograms
e5b0649d2a1eb69bb5632c8219187d72fd69d057
[ "MIT" ]
null
null
null
asm/integerArithmetic/phoneNumber.main.asm
IronHeart7334/AssemblyPrograms
e5b0649d2a1eb69bb5632c8219187d72fd69d057
[ "MIT" ]
null
null
null
asm/integerArithmetic/phoneNumber.main.asm
IronHeart7334/AssemblyPrograms
e5b0649d2a1eb69bb5632c8219187d72fd69d057
[ "MIT" ]
null
null
null
; Assignment: ; Use the template console32 package to complete this lab. ; Write a complete assembly language program to compute the expression ; 2(−a + b − 1) + c ; where ; a is the area code of your phone number ; b is the first three digits of your phone number ; c is the last four digits of your phone number ; Create a Google Doc, saved as a PDF, that contains the following information: ; 1. a discussion of your choice of size for this problem. Include all the intermediate calculated values and justify your choice. You must choose the smallest register size possible. ; 2. A discussion of signed or unsigned integers for this problem. Justify your choice with data. ; 3. An image of your main.asm file. Include in the comments the data that is held in each of the registers that you use in the problem (a Register Dictionary). ; 4. Multiple screen shots of a line-by-line execution of the program. After each calculation show the result as hexadecimal and decimal, and the EFLAGS bit showing the result of the calculation is mathematically correct. ; Name your PDF whatever you like. Upload it before the due date and time. ; general comments ; Register Dictionary ; AX holds the result as it's being calculated ; BX holds temporary values ; preprocessor directives .586 .MODEL FLAT ; external files to link with ; stack configuration .STACK 4096 ; named memory allocation and initialization .DATA phone_a WORD 916d ; area code of phone number phone_b WORD 205d ; first 3 digits of phone number phone_c WORD 0465d ; last 4 digits of phone number result WORD 0d ; this will store the result of 2(-phone_a + phone_b - 1) + phone_c ; All of these should be interpreted as being signed ; names of procedures defined in other *.asm files in the project ; procedure code .CODE main PROC mov AX, phone_b ; AX is now phone_b mov BX, phone_a sub AX, BX ; AX is now -phone_a + phone_b dec AX ; AX is now -phone_a + phone_b - 1 add AX, AX ; AX is now 2(-phone_a + phone_b - 1) mov BX, phone_c add AX, BX ; AX is now 2(-phone_a + phone_b - 1) + phone_c mov result, AX ; result is now 2(-phone_a + phone_b - 1) + phone_c mov EAX, 0 ret main ENDP END
38.637931
223
0.726908
213e4bff8487f2ef287698dbd3e2ff2e80694f2e
782
asm
Assembly
oeis/253/A253715.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/253/A253715.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/253/A253715.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A253715: Indices of centered heptagonal numbers (A069099) which are also hexagonal numbers (A000384). ; Submitted by Christian Krause ; 1,2160,34417,139317984,2220346081,8987960385360,143243407002961,579849276161764800,9241205157168647617,37408396193312133889584,596187109366334725327921,2413365271435489729590825120,38462415164418513312636815521,155695847083980788221510357869840,2481364251321108858485116791161617,10044561876362571299887029498024000384,160082733271267601731890311352363711361,648014864735959077756931032814010002871280,10327577451781193806810062688101275683549681,41806030973531102066048077351076011827213725280 mov $2,$0 mul $0,2 mod $2,2 add $0,$2 seq $0,253879 ; Indices of centered heptagonal numbers (A069099) which are also triangular numbers (A000217).
78.2
496
0.883632
892ac77e35fcc6174d54405b4393dcaedefe786c
204
asm
Assembly
data/pokemon/dex_entries/azumarill.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
data/pokemon/dex_entries/azumarill.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
data/pokemon/dex_entries/azumarill.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
db "AQUARABBIT@" ; species name dw 207, 630 ; height, weight db "The bubble-like" next "pattern on its" next "stomach helps it" page "camouflage itself" next "when it's in the" next "water.@"
18.545455
32
0.671569
c15f5ebb79538b75985074fc0f1f648c3d78c7ee
4,064
asm
Assembly
Transynther/x86/_processed/NONE/_ht_st_zr_un_/i7-7700_9_0xca.log_21829_223.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_ht_st_zr_un_/i7-7700_9_0xca.log_21829_223.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_ht_st_zr_un_/i7-7700_9_0xca.log_21829_223.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %rdx push %rsi lea addresses_WC_ht+0x10ebe, %rsi nop nop nop inc %r11 and $0xffffffffffffffc0, %rsi movaps (%rsi), %xmm2 vpextrq $0, %xmm2, %rdx and $33281, %rdx pop %rsi pop %rdx pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r8 push %rbp push %rsi // Faulty Load lea addresses_WT+0x17a7e, %r8 clflush (%r8) nop nop nop nop cmp $23401, %r10 mov (%r8), %r13 lea oracles, %rbp and $0xff, %r13 shlq $12, %r13 mov (%rbp,%r13,1), %r13 pop %rsi pop %rbp pop %r8 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 6, 'AVXalign': True, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'53': 68, '48': 2386, 'd0': 98, '00': 18290, 'ff': 987} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 48 48 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 48 00 00 00 00 48 00 00 00 00 00 00 48 00 48 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 48 00 00 48 00 00 00 00 ff 00 00 48 00 48 00 00 48 00 00 00 00 00 48 00 00 00 00 00 00 ff 48 00 00 00 00 00 00 ff 00 00 48 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 ff ff 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff 48 00 00 00 48 00 00 ff 48 00 00 00 48 48 00 00 00 00 00 00 00 00 00 48 00 00 00 00 48 00 48 48 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff d0 00 00 00 00 00 00 48 00 00 d0 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 48 00 ff ff ff ff ff d0 00 00 48 00 00 00 00 00 00 48 00 00 00 00 48 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 48 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 48 00 00 48 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 ff ff 00 00 00 00 48 00 00 ff ff ff ff ff d0 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 48 00 ff ff 48 00 00 48 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 48 00 00 00 48 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 48 00 48 00 00 48 00 00 00 48 00 00 00 00 00 00 00 48 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 48 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 00 00 48 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff 48 00 00 48 00 00 00 ff ff 48 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 48 00 48 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 ff 48 48 00 00 48 00 00 00 00 00 00 00 00 00 48 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 48 00 00 00 00 00 00 00 00 00 ff 48 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
68.881356
2,999
0.660679
6f72be287ded3f663b464fe790539a8ec8597090
641
asm
Assembly
programs/oeis/001/A001196.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/001/A001196.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/001/A001196.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A001196: Double-bitters: only even length runs in binary expansion. ; 0,3,12,15,48,51,60,63,192,195,204,207,240,243,252,255,768,771,780,783,816,819,828,831,960,963,972,975,1008,1011,1020,1023,3072,3075,3084,3087,3120,3123,3132,3135,3264,3267,3276,3279,3312,3315,3324,3327,3840,3843,3852,3855,3888,3891,3900,3903,4032,4035,4044,4047,4080,4083,4092,4095,12288,12291,12300,12303,12336,12339,12348,12351,12480,12483,12492,12495,12528,12531,12540,12543,13056,13059,13068,13071,13104,13107,13116,13119,13248,13251,13260,13263,13296,13299,13308,13311,15360,15363,15372,15375 seq $0,98871 ; Sums of distinct powers of 4 plus 1. mul $0,3 sub $0,3
91.571429
499
0.780031
2960d5fc0c27c4914c00b12271a65e0f8f02f16c
109
asm
Assembly
src/main/fragment/mos6502-common/(qwuz1_derefidx_vbuyy)_derefidx_vbuc2=pwuz1_derefidx_vbuc2.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/main/fragment/mos6502-common/(qwuz1_derefidx_vbuyy)_derefidx_vbuc2=pwuz1_derefidx_vbuc2.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/main/fragment/mos6502-common/(qwuz1_derefidx_vbuyy)_derefidx_vbuc2=pwuz1_derefidx_vbuc2.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
lda ({z1}),y sta $fe iny lda ({z1}),y sta $ff ldy #{c2} lda ({z1}),y sta ($fe),y iny lda ({z1}),y sta ($fe),y
9.909091
12
0.522936
a439ea4014c7181d3d05549b3a86e9056540091f
1,527
asm
Assembly
programs/oeis/157/A157990.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/157/A157990.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/157/A157990.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A157990: a(n) = 288*n + 1. ; 289,577,865,1153,1441,1729,2017,2305,2593,2881,3169,3457,3745,4033,4321,4609,4897,5185,5473,5761,6049,6337,6625,6913,7201,7489,7777,8065,8353,8641,8929,9217,9505,9793,10081,10369,10657,10945,11233,11521,11809,12097,12385,12673,12961,13249,13537,13825,14113,14401,14689,14977,15265,15553,15841,16129,16417,16705,16993,17281,17569,17857,18145,18433,18721,19009,19297,19585,19873,20161,20449,20737,21025,21313,21601,21889,22177,22465,22753,23041,23329,23617,23905,24193,24481,24769,25057,25345,25633,25921,26209,26497,26785,27073,27361,27649,27937,28225,28513,28801,29089,29377,29665,29953,30241,30529,30817,31105,31393,31681,31969,32257,32545,32833,33121,33409,33697,33985,34273,34561,34849,35137,35425,35713,36001,36289,36577,36865,37153,37441,37729,38017,38305,38593,38881,39169,39457,39745,40033,40321,40609,40897,41185,41473,41761,42049,42337,42625,42913,43201,43489,43777,44065,44353,44641,44929,45217,45505,45793,46081,46369,46657,46945,47233,47521,47809,48097,48385,48673,48961,49249,49537,49825,50113,50401,50689,50977,51265,51553,51841,52129,52417,52705,52993,53281,53569,53857,54145,54433,54721,55009,55297,55585,55873,56161,56449,56737,57025,57313,57601,57889,58177,58465,58753,59041,59329,59617,59905,60193,60481,60769,61057,61345,61633,61921,62209,62497,62785,63073,63361,63649,63937,64225,64513,64801,65089,65377,65665,65953,66241,66529,66817,67105,67393,67681,67969,68257,68545,68833,69121,69409,69697,69985,70273,70561,70849,71137,71425,71713,72001 mov $1,$0 mul $1,288 add $1,289
218.142857
1,464
0.815979
59a9bf33659e58a9cb217d08288ab5a744a86e1c
234
asm
Assembly
programs/oeis/085/A085820.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/085/A085820.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/085/A085820.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A085820: Possible two-digit endings of primes (with leading zeros). ; 1,3,7,9,11,13,17,19,21,23,27,29,31,33,37,39,41,43,47,49,51,53,57,59,61,63,67,69,71,73,77,79,81,83,87,89,91,93,97,99 mul $0,5 add $0,2 div $0,4 mul $0,2 add $0,1
26
117
0.662393
3efbf7a4c556bb62edec8cb67ab5a1df4c55292d
145
asm
Assembly
spectranet/libspectranet/setpageb.asm
speccytools/spectranet-gdbserver
c76acd970e5e8bbf793d8514bf64c32a180c26a4
[ "MIT" ]
40
2021-07-23T21:33:59.000Z
2022-02-07T19:07:46.000Z
spectranet/libspectranet/setpageb.asm
speccytools/spectranet-gdbserver
c76acd970e5e8bbf793d8514bf64c32a180c26a4
[ "MIT" ]
null
null
null
spectranet/libspectranet/setpageb.asm
speccytools/spectranet-gdbserver
c76acd970e5e8bbf793d8514bf64c32a180c26a4
[ "MIT" ]
2
2021-08-02T17:49:03.000Z
2021-10-09T21:53:41.000Z
; void setpageb(unsigned char page); PUBLIC setpageb EXTERN libspectranet include "spectranet.asm" .setpageb ld a, l call SETPAGEB_ROM ret
14.5
36
0.772414
3026967c555ec099eb4035a0d98dd2cb613440e9
560
asm
Assembly
oeis/017/A017024.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/017/A017024.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/017/A017024.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A017024: a(n) = (7*n + 3)^8. ; 6561,100000000,6975757441,110075314176,852891037441,4347792138496,16815125390625,53459728531456,146830437604321,360040606269696,806460091894081,1677721600000000,3282116715437121,6095689385410816,10828567056280801,18509302102818816,30590228625390625,49077072127303936,76686282021340161,117033789351264256,174859124550883201,256289062500000000,369145194573386401,523300059815673856,731086699811838561,1007766734259732736,1372062286687890625,1846757322198614016,2459374191553118401,3242931408352297216 mul $0,7 add $0,3 pow $0,8
80
500
0.8875
f7455ef164234c2b8fcebc3bd81cf4d184acf9de
52
asm
Assembly
libsrc/nc100/padinitserial.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/nc100/padinitserial.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/nc100/padinitserial.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
PUBLIC padinitserial .padinitserial jp 0xb85a
8.666667
22
0.769231
3bd6f92162d9927645a7c43ef205ae3297a8275e
601,987
asm
Assembly
kernel.asm
hyunW3/OS-3-1
8ab0792a67bafe8aadd9f5341fdabedbf6efd31b
[ "MIT-0" ]
null
null
null
kernel.asm
hyunW3/OS-3-1
8ab0792a67bafe8aadd9f5341fdabedbf6efd31b
[ "MIT-0" ]
null
null
null
kernel.asm
hyunW3/OS-3-1
8ab0792a67bafe8aadd9f5341fdabedbf6efd31b
[ "MIT-0" ]
null
null
null
kernel: file format elf32-i386 Disassembly of section .text: 80100000 <multiboot_header>: 80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh 80100006: 00 00 add %al,(%eax) 80100008: fe 4f 52 decb 0x52(%edi) 8010000b: e4 .byte 0xe4 8010000c <entry>: # Entering xv6 on boot processor, with paging off. .globl entry entry: # Turn on page size extension for 4Mbyte pages movl %cr4, %eax 8010000c: 0f 20 e0 mov %cr4,%eax orl $(CR4_PSE), %eax 8010000f: 83 c8 10 or $0x10,%eax movl %eax, %cr4 80100012: 0f 22 e0 mov %eax,%cr4 # Set page directory movl $(V2P_WO(entrypgdir)), %eax 80100015: b8 00 90 10 00 mov $0x109000,%eax movl %eax, %cr3 8010001a: 0f 22 d8 mov %eax,%cr3 # Turn on paging. movl %cr0, %eax 8010001d: 0f 20 c0 mov %cr0,%eax orl $(CR0_PG|CR0_WP), %eax 80100020: 0d 00 00 01 80 or $0x80010000,%eax movl %eax, %cr0 80100025: 0f 22 c0 mov %eax,%cr0 # Set up the stack pointer. movl $(stack + KSTACKSIZE), %esp 80100028: bc c0 b5 10 80 mov $0x8010b5c0,%esp # Jump to main(), and switch to executing at # high addresses. The indirect call is needed because # the assembler produces a PC-relative instruction # for a direct jump. mov $main, %eax 8010002d: b8 c0 2f 10 80 mov $0x80102fc0,%eax jmp *%eax 80100032: ff e0 jmp *%eax 80100034: 66 90 xchg %ax,%ax 80100036: 66 90 xchg %ax,%ax 80100038: 66 90 xchg %ax,%ax 8010003a: 66 90 xchg %ax,%ax 8010003c: 66 90 xchg %ax,%ax 8010003e: 66 90 xchg %ax,%ax 80100040 <binit>: struct buf head; } bcache; void binit(void) { 80100040: 55 push %ebp 80100041: 89 e5 mov %esp,%ebp 80100043: 53 push %ebx //PAGEBREAK! // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80100044: bb f4 b5 10 80 mov $0x8010b5f4,%ebx { 80100049: 83 ec 0c sub $0xc,%esp initlock(&bcache.lock, "bcache"); 8010004c: 68 c0 70 10 80 push $0x801070c0 80100051: 68 c0 b5 10 80 push $0x8010b5c0 80100056: e8 e5 42 00 00 call 80104340 <initlock> bcache.head.prev = &bcache.head; 8010005b: c7 05 0c fd 10 80 bc movl $0x8010fcbc,0x8010fd0c 80100062: fc 10 80 bcache.head.next = &bcache.head; 80100065: c7 05 10 fd 10 80 bc movl $0x8010fcbc,0x8010fd10 8010006c: fc 10 80 8010006f: 83 c4 10 add $0x10,%esp 80100072: ba bc fc 10 80 mov $0x8010fcbc,%edx 80100077: eb 09 jmp 80100082 <binit+0x42> 80100079: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100080: 89 c3 mov %eax,%ebx b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); 80100082: 8d 43 0c lea 0xc(%ebx),%eax 80100085: 83 ec 08 sub $0x8,%esp b->next = bcache.head.next; 80100088: 89 53 54 mov %edx,0x54(%ebx) b->prev = &bcache.head; 8010008b: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100092: 68 c7 70 10 80 push $0x801070c7 80100097: 50 push %eax 80100098: e8 73 41 00 00 call 80104210 <initsleeplock> bcache.head.next->prev = b; 8010009d: a1 10 fd 10 80 mov 0x8010fd10,%eax for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000a2: 83 c4 10 add $0x10,%esp 801000a5: 89 da mov %ebx,%edx bcache.head.next->prev = b; 801000a7: 89 58 50 mov %ebx,0x50(%eax) for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000aa: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax bcache.head.next = b; 801000b0: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000b6: 3d bc fc 10 80 cmp $0x8010fcbc,%eax 801000bb: 72 c3 jb 80100080 <binit+0x40> } } 801000bd: 8b 5d fc mov -0x4(%ebp),%ebx 801000c0: c9 leave 801000c1: c3 ret 801000c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801000c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801000d0 <bread>: } // Return a locked buf with the contents of the indicated block. struct buf* bread(uint dev, uint blockno) { 801000d0: 55 push %ebp 801000d1: 89 e5 mov %esp,%ebp 801000d3: 57 push %edi 801000d4: 56 push %esi 801000d5: 53 push %ebx 801000d6: 83 ec 18 sub $0x18,%esp 801000d9: 8b 75 08 mov 0x8(%ebp),%esi 801000dc: 8b 7d 0c mov 0xc(%ebp),%edi acquire(&bcache.lock); 801000df: 68 c0 b5 10 80 push $0x8010b5c0 801000e4: e8 97 43 00 00 call 80104480 <acquire> for(b = bcache.head.next; b != &bcache.head; b = b->next){ 801000e9: 8b 1d 10 fd 10 80 mov 0x8010fd10,%ebx 801000ef: 83 c4 10 add $0x10,%esp 801000f2: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 801000f8: 75 11 jne 8010010b <bread+0x3b> 801000fa: eb 24 jmp 80100120 <bread+0x50> 801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100100: 8b 5b 54 mov 0x54(%ebx),%ebx 80100103: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100109: 74 15 je 80100120 <bread+0x50> if(b->dev == dev && b->blockno == blockno){ 8010010b: 3b 73 04 cmp 0x4(%ebx),%esi 8010010e: 75 f0 jne 80100100 <bread+0x30> 80100110: 3b 7b 08 cmp 0x8(%ebx),%edi 80100113: 75 eb jne 80100100 <bread+0x30> b->refcnt++; 80100115: 83 43 4c 01 addl $0x1,0x4c(%ebx) 80100119: eb 3f jmp 8010015a <bread+0x8a> 8010011b: 90 nop 8010011c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 80100120: 8b 1d 0c fd 10 80 mov 0x8010fd0c,%ebx 80100126: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 8010012c: 75 0d jne 8010013b <bread+0x6b> 8010012e: eb 60 jmp 80100190 <bread+0xc0> 80100130: 8b 5b 50 mov 0x50(%ebx),%ebx 80100133: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100139: 74 55 je 80100190 <bread+0xc0> if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) { 8010013b: 8b 43 4c mov 0x4c(%ebx),%eax 8010013e: 85 c0 test %eax,%eax 80100140: 75 ee jne 80100130 <bread+0x60> 80100142: f6 03 04 testb $0x4,(%ebx) 80100145: 75 e9 jne 80100130 <bread+0x60> b->dev = dev; 80100147: 89 73 04 mov %esi,0x4(%ebx) b->blockno = blockno; 8010014a: 89 7b 08 mov %edi,0x8(%ebx) b->flags = 0; 8010014d: c7 03 00 00 00 00 movl $0x0,(%ebx) b->refcnt = 1; 80100153: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) release(&bcache.lock); 8010015a: 83 ec 0c sub $0xc,%esp 8010015d: 68 c0 b5 10 80 push $0x8010b5c0 80100162: e8 d9 43 00 00 call 80104540 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 de 40 00 00 call 80104250 <acquiresleep> 80100172: 83 c4 10 add $0x10,%esp struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { 80100175: f6 03 02 testb $0x2,(%ebx) 80100178: 75 0c jne 80100186 <bread+0xb6> iderw(b); 8010017a: 83 ec 0c sub $0xc,%esp 8010017d: 53 push %ebx 8010017e: e8 bd 20 00 00 call 80102240 <iderw> 80100183: 83 c4 10 add $0x10,%esp } return b; } 80100186: 8d 65 f4 lea -0xc(%ebp),%esp 80100189: 89 d8 mov %ebx,%eax 8010018b: 5b pop %ebx 8010018c: 5e pop %esi 8010018d: 5f pop %edi 8010018e: 5d pop %ebp 8010018f: c3 ret panic("bget: no buffers"); 80100190: 83 ec 0c sub $0xc,%esp 80100193: 68 ce 70 10 80 push $0x801070ce 80100198: e8 f3 01 00 00 call 80100390 <panic> 8010019d: 8d 76 00 lea 0x0(%esi),%esi 801001a0 <bwrite>: // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { 801001a0: 55 push %ebp 801001a1: 89 e5 mov %esp,%ebp 801001a3: 53 push %ebx 801001a4: 83 ec 10 sub $0x10,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 50 push %eax 801001ae: e8 3d 41 00 00 call 801042f0 <holdingsleep> 801001b3: 83 c4 10 add $0x10,%esp 801001b6: 85 c0 test %eax,%eax 801001b8: 74 0f je 801001c9 <bwrite+0x29> panic("bwrite"); b->flags |= B_DIRTY; 801001ba: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bd: 89 5d 08 mov %ebx,0x8(%ebp) } 801001c0: 8b 5d fc mov -0x4(%ebp),%ebx 801001c3: c9 leave iderw(b); 801001c4: e9 77 20 00 00 jmp 80102240 <iderw> panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 df 70 10 80 push $0x801070df 801001d1: e8 ba 01 00 00 call 80100390 <panic> 801001d6: 8d 76 00 lea 0x0(%esi),%esi 801001d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801001e0 <brelse>: // Release a locked buffer. // Move to the head of the MRU list. void brelse(struct buf *b) { 801001e0: 55 push %ebp 801001e1: 89 e5 mov %esp,%ebp 801001e3: 56 push %esi 801001e4: 53 push %ebx 801001e5: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001e8: 83 ec 0c sub $0xc,%esp 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 56 push %esi 801001ef: e8 fc 40 00 00 call 801042f0 <holdingsleep> 801001f4: 83 c4 10 add $0x10,%esp 801001f7: 85 c0 test %eax,%eax 801001f9: 74 66 je 80100261 <brelse+0x81> panic("brelse"); releasesleep(&b->lock); 801001fb: 83 ec 0c sub $0xc,%esp 801001fe: 56 push %esi 801001ff: e8 ac 40 00 00 call 801042b0 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 8010020b: e8 70 42 00 00 call 80104480 <acquire> b->refcnt--; 80100210: 8b 43 4c mov 0x4c(%ebx),%eax if (b->refcnt == 0) { 80100213: 83 c4 10 add $0x10,%esp b->refcnt--; 80100216: 83 e8 01 sub $0x1,%eax if (b->refcnt == 0) { 80100219: 85 c0 test %eax,%eax b->refcnt--; 8010021b: 89 43 4c mov %eax,0x4c(%ebx) if (b->refcnt == 0) { 8010021e: 75 2f jne 8010024f <brelse+0x6f> // no one is waiting for it. b->next->prev = b->prev; 80100220: 8b 43 54 mov 0x54(%ebx),%eax 80100223: 8b 53 50 mov 0x50(%ebx),%edx 80100226: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 80100229: 8b 43 50 mov 0x50(%ebx),%eax 8010022c: 8b 53 54 mov 0x54(%ebx),%edx 8010022f: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100232: a1 10 fd 10 80 mov 0x8010fd10,%eax b->prev = &bcache.head; 80100237: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) b->next = bcache.head.next; 8010023e: 89 43 54 mov %eax,0x54(%ebx) bcache.head.next->prev = b; 80100241: a1 10 fd 10 80 mov 0x8010fd10,%eax 80100246: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 80100249: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 } release(&bcache.lock); 8010024f: c7 45 08 c0 b5 10 80 movl $0x8010b5c0,0x8(%ebp) } 80100256: 8d 65 f8 lea -0x8(%ebp),%esp 80100259: 5b pop %ebx 8010025a: 5e pop %esi 8010025b: 5d pop %ebp release(&bcache.lock); 8010025c: e9 df 42 00 00 jmp 80104540 <release> panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 e6 70 10 80 push $0x801070e6 80100269: e8 22 01 00 00 call 80100390 <panic> 8010026e: 66 90 xchg %ax,%ax 80100270 <consoleread>: } } int consoleread(struct inode *ip, char *dst, int n) { 80100270: 55 push %ebp 80100271: 89 e5 mov %esp,%ebp 80100273: 57 push %edi 80100274: 56 push %esi 80100275: 53 push %ebx 80100276: 83 ec 28 sub $0x28,%esp 80100279: 8b 7d 08 mov 0x8(%ebp),%edi 8010027c: 8b 75 0c mov 0xc(%ebp),%esi uint target; int c; iunlock(ip); 8010027f: 57 push %edi 80100280: e8 eb 14 00 00 call 80101770 <iunlock> target = n; acquire(&cons.lock); 80100285: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010028c: e8 ef 41 00 00 call 80104480 <acquire> while(n > 0){ 80100291: 8b 5d 10 mov 0x10(%ebp),%ebx 80100294: 83 c4 10 add $0x10,%esp 80100297: 31 c0 xor %eax,%eax 80100299: 85 db test %ebx,%ebx 8010029b: 0f 8e a1 00 00 00 jle 80100342 <consoleread+0xd2> while(input.r == input.w){ 801002a1: 8b 15 a0 ff 10 80 mov 0x8010ffa0,%edx 801002a7: 39 15 a4 ff 10 80 cmp %edx,0x8010ffa4 801002ad: 74 2c je 801002db <consoleread+0x6b> 801002af: eb 5f jmp 80100310 <consoleread+0xa0> 801002b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&cons.lock); ilock(ip); return -1; } sleep(&input.r, &cons.lock); 801002b8: 83 ec 08 sub $0x8,%esp 801002bb: 68 20 a5 10 80 push $0x8010a520 801002c0: 68 a0 ff 10 80 push $0x8010ffa0 801002c5: e8 f6 3b 00 00 call 80103ec0 <sleep> while(input.r == input.w){ 801002ca: 8b 15 a0 ff 10 80 mov 0x8010ffa0,%edx 801002d0: 83 c4 10 add $0x10,%esp 801002d3: 3b 15 a4 ff 10 80 cmp 0x8010ffa4,%edx 801002d9: 75 35 jne 80100310 <consoleread+0xa0> if(myproc()->killed){ 801002db: e8 20 36 00 00 call 80103900 <myproc> 801002e0: 8b 40 24 mov 0x24(%eax),%eax 801002e3: 85 c0 test %eax,%eax 801002e5: 74 d1 je 801002b8 <consoleread+0x48> release(&cons.lock); 801002e7: 83 ec 0c sub $0xc,%esp 801002ea: 68 20 a5 10 80 push $0x8010a520 801002ef: e8 4c 42 00 00 call 80104540 <release> ilock(ip); 801002f4: 89 3c 24 mov %edi,(%esp) 801002f7: e8 94 13 00 00 call 80101690 <ilock> return -1; 801002fc: 83 c4 10 add $0x10,%esp } release(&cons.lock); ilock(ip); return target - n; } 801002ff: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80100302: b8 ff ff ff ff mov $0xffffffff,%eax } 80100307: 5b pop %ebx 80100308: 5e pop %esi 80100309: 5f pop %edi 8010030a: 5d pop %ebp 8010030b: c3 ret 8010030c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = input.buf[input.r++ % INPUT_BUF]; 80100310: 8d 42 01 lea 0x1(%edx),%eax 80100313: a3 a0 ff 10 80 mov %eax,0x8010ffa0 80100318: 89 d0 mov %edx,%eax 8010031a: 83 e0 7f and $0x7f,%eax 8010031d: 0f be 80 20 ff 10 80 movsbl -0x7fef00e0(%eax),%eax if(c == C('D')){ // EOF 80100324: 83 f8 04 cmp $0x4,%eax 80100327: 74 3f je 80100368 <consoleread+0xf8> *dst++ = c; 80100329: 83 c6 01 add $0x1,%esi --n; 8010032c: 83 eb 01 sub $0x1,%ebx if(c == '\n') 8010032f: 83 f8 0a cmp $0xa,%eax *dst++ = c; 80100332: 88 46 ff mov %al,-0x1(%esi) if(c == '\n') 80100335: 74 43 je 8010037a <consoleread+0x10a> while(n > 0){ 80100337: 85 db test %ebx,%ebx 80100339: 0f 85 62 ff ff ff jne 801002a1 <consoleread+0x31> 8010033f: 8b 45 10 mov 0x10(%ebp),%eax release(&cons.lock); 80100342: 83 ec 0c sub $0xc,%esp 80100345: 89 45 e4 mov %eax,-0x1c(%ebp) 80100348: 68 20 a5 10 80 push $0x8010a520 8010034d: e8 ee 41 00 00 call 80104540 <release> ilock(ip); 80100352: 89 3c 24 mov %edi,(%esp) 80100355: e8 36 13 00 00 call 80101690 <ilock> return target - n; 8010035a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010035d: 83 c4 10 add $0x10,%esp } 80100360: 8d 65 f4 lea -0xc(%ebp),%esp 80100363: 5b pop %ebx 80100364: 5e pop %esi 80100365: 5f pop %edi 80100366: 5d pop %ebp 80100367: c3 ret 80100368: 8b 45 10 mov 0x10(%ebp),%eax 8010036b: 29 d8 sub %ebx,%eax if(n < target){ 8010036d: 3b 5d 10 cmp 0x10(%ebp),%ebx 80100370: 73 d0 jae 80100342 <consoleread+0xd2> input.r--; 80100372: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0 80100378: eb c8 jmp 80100342 <consoleread+0xd2> 8010037a: 8b 45 10 mov 0x10(%ebp),%eax 8010037d: 29 d8 sub %ebx,%eax 8010037f: eb c1 jmp 80100342 <consoleread+0xd2> 80100381: eb 0d jmp 80100390 <panic> 80100383: 90 nop 80100384: 90 nop 80100385: 90 nop 80100386: 90 nop 80100387: 90 nop 80100388: 90 nop 80100389: 90 nop 8010038a: 90 nop 8010038b: 90 nop 8010038c: 90 nop 8010038d: 90 nop 8010038e: 90 nop 8010038f: 90 nop 80100390 <panic>: { 80100390: 55 push %ebp 80100391: 89 e5 mov %esp,%ebp 80100393: 56 push %esi 80100394: 53 push %ebx 80100395: 83 ec 30 sub $0x30,%esp } static inline void cli(void) { asm volatile("cli"); 80100398: fa cli cons.locking = 0; 80100399: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554 801003a0: 00 00 00 getcallerpcs(&s, pcs); 801003a3: 8d 5d d0 lea -0x30(%ebp),%ebx 801003a6: 8d 75 f8 lea -0x8(%ebp),%esi cprintf("lapicid %d: panic: ", lapicid()); 801003a9: e8 a2 24 00 00 call 80102850 <lapicid> 801003ae: 83 ec 08 sub $0x8,%esp 801003b1: 50 push %eax 801003b2: 68 ed 70 10 80 push $0x801070ed 801003b7: e8 a4 02 00 00 call 80100660 <cprintf> cprintf(s); 801003bc: 58 pop %eax 801003bd: ff 75 08 pushl 0x8(%ebp) 801003c0: e8 9b 02 00 00 call 80100660 <cprintf> cprintf("\n"); 801003c5: c7 04 24 5f 7a 10 80 movl $0x80107a5f,(%esp) 801003cc: e8 8f 02 00 00 call 80100660 <cprintf> getcallerpcs(&s, pcs); 801003d1: 5a pop %edx 801003d2: 8d 45 08 lea 0x8(%ebp),%eax 801003d5: 59 pop %ecx 801003d6: 53 push %ebx 801003d7: 50 push %eax 801003d8: e8 83 3f 00 00 call 80104360 <getcallerpcs> 801003dd: 83 c4 10 add $0x10,%esp cprintf(" %p", pcs[i]); 801003e0: 83 ec 08 sub $0x8,%esp 801003e3: ff 33 pushl (%ebx) 801003e5: 83 c3 04 add $0x4,%ebx 801003e8: 68 01 71 10 80 push $0x80107101 801003ed: e8 6e 02 00 00 call 80100660 <cprintf> for(i=0; i<10; i++) 801003f2: 83 c4 10 add $0x10,%esp 801003f5: 39 f3 cmp %esi,%ebx 801003f7: 75 e7 jne 801003e0 <panic+0x50> panicked = 1; // freeze other CPU 801003f9: c7 05 58 a5 10 80 01 movl $0x1,0x8010a558 80100400: 00 00 00 80100403: eb fe jmp 80100403 <panic+0x73> 80100405: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100410 <consputc>: if(panicked){ 80100410: 8b 0d 58 a5 10 80 mov 0x8010a558,%ecx 80100416: 85 c9 test %ecx,%ecx 80100418: 74 06 je 80100420 <consputc+0x10> 8010041a: fa cli 8010041b: eb fe jmp 8010041b <consputc+0xb> 8010041d: 8d 76 00 lea 0x0(%esi),%esi { 80100420: 55 push %ebp 80100421: 89 e5 mov %esp,%ebp 80100423: 57 push %edi 80100424: 56 push %esi 80100425: 53 push %ebx 80100426: 89 c6 mov %eax,%esi 80100428: 83 ec 0c sub $0xc,%esp if(c == BACKSPACE){ 8010042b: 3d 00 01 00 00 cmp $0x100,%eax 80100430: 0f 84 b1 00 00 00 je 801004e7 <consputc+0xd7> uartputc(c); 80100436: 83 ec 0c sub $0xc,%esp 80100439: 50 push %eax 8010043a: e8 81 58 00 00 call 80105cc0 <uartputc> 8010043f: 83 c4 10 add $0x10,%esp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100442: bb d4 03 00 00 mov $0x3d4,%ebx 80100447: b8 0e 00 00 00 mov $0xe,%eax 8010044c: 89 da mov %ebx,%edx 8010044e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010044f: b9 d5 03 00 00 mov $0x3d5,%ecx 80100454: 89 ca mov %ecx,%edx 80100456: ec in (%dx),%al pos = inb(CRTPORT+1) << 8; 80100457: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010045a: 89 da mov %ebx,%edx 8010045c: c1 e0 08 shl $0x8,%eax 8010045f: 89 c7 mov %eax,%edi 80100461: b8 0f 00 00 00 mov $0xf,%eax 80100466: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80100467: 89 ca mov %ecx,%edx 80100469: ec in (%dx),%al 8010046a: 0f b6 d8 movzbl %al,%ebx pos |= inb(CRTPORT+1); 8010046d: 09 fb or %edi,%ebx if(c == '\n') 8010046f: 83 fe 0a cmp $0xa,%esi 80100472: 0f 84 f3 00 00 00 je 8010056b <consputc+0x15b> else if(c == BACKSPACE){ 80100478: 81 fe 00 01 00 00 cmp $0x100,%esi 8010047e: 0f 84 d7 00 00 00 je 8010055b <consputc+0x14b> crt[pos++] = (c&0xff) | 0x0700; // black on white 80100484: 89 f0 mov %esi,%eax 80100486: 0f b6 c0 movzbl %al,%eax 80100489: 80 cc 07 or $0x7,%ah 8010048c: 66 89 84 1b 00 80 0b mov %ax,-0x7ff48000(%ebx,%ebx,1) 80100493: 80 80100494: 83 c3 01 add $0x1,%ebx if(pos < 0 || pos > 25*80) 80100497: 81 fb d0 07 00 00 cmp $0x7d0,%ebx 8010049d: 0f 8f ab 00 00 00 jg 8010054e <consputc+0x13e> if((pos/80) >= 24){ // Scroll up. 801004a3: 81 fb 7f 07 00 00 cmp $0x77f,%ebx 801004a9: 7f 66 jg 80100511 <consputc+0x101> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801004ab: be d4 03 00 00 mov $0x3d4,%esi 801004b0: b8 0e 00 00 00 mov $0xe,%eax 801004b5: 89 f2 mov %esi,%edx 801004b7: ee out %al,(%dx) 801004b8: b9 d5 03 00 00 mov $0x3d5,%ecx outb(CRTPORT+1, pos>>8); 801004bd: 89 d8 mov %ebx,%eax 801004bf: c1 f8 08 sar $0x8,%eax 801004c2: 89 ca mov %ecx,%edx 801004c4: ee out %al,(%dx) 801004c5: b8 0f 00 00 00 mov $0xf,%eax 801004ca: 89 f2 mov %esi,%edx 801004cc: ee out %al,(%dx) 801004cd: 89 d8 mov %ebx,%eax 801004cf: 89 ca mov %ecx,%edx 801004d1: ee out %al,(%dx) crt[pos] = ' ' | 0x0700; 801004d2: b8 20 07 00 00 mov $0x720,%eax 801004d7: 66 89 84 1b 00 80 0b mov %ax,-0x7ff48000(%ebx,%ebx,1) 801004de: 80 } 801004df: 8d 65 f4 lea -0xc(%ebp),%esp 801004e2: 5b pop %ebx 801004e3: 5e pop %esi 801004e4: 5f pop %edi 801004e5: 5d pop %ebp 801004e6: c3 ret uartputc('\b'); uartputc(' '); uartputc('\b'); 801004e7: 83 ec 0c sub $0xc,%esp 801004ea: 6a 08 push $0x8 801004ec: e8 cf 57 00 00 call 80105cc0 <uartputc> 801004f1: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004f8: e8 c3 57 00 00 call 80105cc0 <uartputc> 801004fd: c7 04 24 08 00 00 00 movl $0x8,(%esp) 80100504: e8 b7 57 00 00 call 80105cc0 <uartputc> 80100509: 83 c4 10 add $0x10,%esp 8010050c: e9 31 ff ff ff jmp 80100442 <consputc+0x32> memmove(crt, crt+80, sizeof(crt[0])*23*80); 80100511: 52 push %edx 80100512: 68 60 0e 00 00 push $0xe60 pos -= 80; 80100517: 83 eb 50 sub $0x50,%ebx memmove(crt, crt+80, sizeof(crt[0])*23*80); 8010051a: 68 a0 80 0b 80 push $0x800b80a0 8010051f: 68 00 80 0b 80 push $0x800b8000 80100524: e8 17 41 00 00 call 80104640 <memmove> memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100529: b8 80 07 00 00 mov $0x780,%eax 8010052e: 83 c4 0c add $0xc,%esp 80100531: 29 d8 sub %ebx,%eax 80100533: 01 c0 add %eax,%eax 80100535: 50 push %eax 80100536: 8d 04 1b lea (%ebx,%ebx,1),%eax 80100539: 6a 00 push $0x0 8010053b: 2d 00 80 f4 7f sub $0x7ff48000,%eax 80100540: 50 push %eax 80100541: e8 4a 40 00 00 call 80104590 <memset> 80100546: 83 c4 10 add $0x10,%esp 80100549: e9 5d ff ff ff jmp 801004ab <consputc+0x9b> panic("pos under/overflow"); 8010054e: 83 ec 0c sub $0xc,%esp 80100551: 68 05 71 10 80 push $0x80107105 80100556: e8 35 fe ff ff call 80100390 <panic> if(pos > 0) --pos; 8010055b: 85 db test %ebx,%ebx 8010055d: 0f 84 48 ff ff ff je 801004ab <consputc+0x9b> 80100563: 83 eb 01 sub $0x1,%ebx 80100566: e9 2c ff ff ff jmp 80100497 <consputc+0x87> pos += 80 - pos%80; 8010056b: 89 d8 mov %ebx,%eax 8010056d: b9 50 00 00 00 mov $0x50,%ecx 80100572: 99 cltd 80100573: f7 f9 idiv %ecx 80100575: 29 d1 sub %edx,%ecx 80100577: 01 cb add %ecx,%ebx 80100579: e9 19 ff ff ff jmp 80100497 <consputc+0x87> 8010057e: 66 90 xchg %ax,%ax 80100580 <printint>: { 80100580: 55 push %ebp 80100581: 89 e5 mov %esp,%ebp 80100583: 57 push %edi 80100584: 56 push %esi 80100585: 53 push %ebx 80100586: 89 d3 mov %edx,%ebx 80100588: 83 ec 2c sub $0x2c,%esp if(sign && (sign = xx < 0)) 8010058b: 85 c9 test %ecx,%ecx { 8010058d: 89 4d d4 mov %ecx,-0x2c(%ebp) if(sign && (sign = xx < 0)) 80100590: 74 04 je 80100596 <printint+0x16> 80100592: 85 c0 test %eax,%eax 80100594: 78 5a js 801005f0 <printint+0x70> x = xx; 80100596: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) i = 0; 8010059d: 31 c9 xor %ecx,%ecx 8010059f: 8d 75 d7 lea -0x29(%ebp),%esi 801005a2: eb 06 jmp 801005aa <printint+0x2a> 801005a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi buf[i++] = digits[x % base]; 801005a8: 89 f9 mov %edi,%ecx 801005aa: 31 d2 xor %edx,%edx 801005ac: 8d 79 01 lea 0x1(%ecx),%edi 801005af: f7 f3 div %ebx 801005b1: 0f b6 92 30 71 10 80 movzbl -0x7fef8ed0(%edx),%edx }while((x /= base) != 0); 801005b8: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 801005ba: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 801005bd: 75 e9 jne 801005a8 <printint+0x28> if(sign) 801005bf: 8b 45 d4 mov -0x2c(%ebp),%eax 801005c2: 85 c0 test %eax,%eax 801005c4: 74 08 je 801005ce <printint+0x4e> buf[i++] = '-'; 801005c6: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 801005cb: 8d 79 02 lea 0x2(%ecx),%edi 801005ce: 8d 5c 3d d7 lea -0x29(%ebp,%edi,1),%ebx 801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi consputc(buf[i]); 801005d8: 0f be 03 movsbl (%ebx),%eax 801005db: 83 eb 01 sub $0x1,%ebx 801005de: e8 2d fe ff ff call 80100410 <consputc> while(--i >= 0) 801005e3: 39 f3 cmp %esi,%ebx 801005e5: 75 f1 jne 801005d8 <printint+0x58> } 801005e7: 83 c4 2c add $0x2c,%esp 801005ea: 5b pop %ebx 801005eb: 5e pop %esi 801005ec: 5f pop %edi 801005ed: 5d pop %ebp 801005ee: c3 ret 801005ef: 90 nop x = -xx; 801005f0: f7 d8 neg %eax 801005f2: eb a9 jmp 8010059d <printint+0x1d> 801005f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801005fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80100600 <consolewrite>: int consolewrite(struct inode *ip, char *buf, int n) { 80100600: 55 push %ebp 80100601: 89 e5 mov %esp,%ebp 80100603: 57 push %edi 80100604: 56 push %esi 80100605: 53 push %ebx 80100606: 83 ec 18 sub $0x18,%esp 80100609: 8b 75 10 mov 0x10(%ebp),%esi int i; iunlock(ip); 8010060c: ff 75 08 pushl 0x8(%ebp) 8010060f: e8 5c 11 00 00 call 80101770 <iunlock> acquire(&cons.lock); 80100614: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010061b: e8 60 3e 00 00 call 80104480 <acquire> for(i = 0; i < n; i++) 80100620: 83 c4 10 add $0x10,%esp 80100623: 85 f6 test %esi,%esi 80100625: 7e 18 jle 8010063f <consolewrite+0x3f> 80100627: 8b 7d 0c mov 0xc(%ebp),%edi 8010062a: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010062d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100630: 0f b6 07 movzbl (%edi),%eax 80100633: 83 c7 01 add $0x1,%edi 80100636: e8 d5 fd ff ff call 80100410 <consputc> for(i = 0; i < n; i++) 8010063b: 39 fb cmp %edi,%ebx 8010063d: 75 f1 jne 80100630 <consolewrite+0x30> release(&cons.lock); 8010063f: 83 ec 0c sub $0xc,%esp 80100642: 68 20 a5 10 80 push $0x8010a520 80100647: e8 f4 3e 00 00 call 80104540 <release> ilock(ip); 8010064c: 58 pop %eax 8010064d: ff 75 08 pushl 0x8(%ebp) 80100650: e8 3b 10 00 00 call 80101690 <ilock> return n; } 80100655: 8d 65 f4 lea -0xc(%ebp),%esp 80100658: 89 f0 mov %esi,%eax 8010065a: 5b pop %ebx 8010065b: 5e pop %esi 8010065c: 5f pop %edi 8010065d: 5d pop %ebp 8010065e: c3 ret 8010065f: 90 nop 80100660 <cprintf>: { 80100660: 55 push %ebp 80100661: 89 e5 mov %esp,%ebp 80100663: 57 push %edi 80100664: 56 push %esi 80100665: 53 push %ebx 80100666: 83 ec 1c sub $0x1c,%esp locking = cons.locking; 80100669: a1 54 a5 10 80 mov 0x8010a554,%eax if(locking) 8010066e: 85 c0 test %eax,%eax locking = cons.locking; 80100670: 89 45 dc mov %eax,-0x24(%ebp) if(locking) 80100673: 0f 85 6f 01 00 00 jne 801007e8 <cprintf+0x188> if (fmt == 0) 80100679: 8b 45 08 mov 0x8(%ebp),%eax 8010067c: 85 c0 test %eax,%eax 8010067e: 89 c7 mov %eax,%edi 80100680: 0f 84 77 01 00 00 je 801007fd <cprintf+0x19d> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100686: 0f b6 00 movzbl (%eax),%eax argp = (uint*)(void*)(&fmt + 1); 80100689: 8d 4d 0c lea 0xc(%ebp),%ecx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 8010068c: 31 db xor %ebx,%ebx argp = (uint*)(void*)(&fmt + 1); 8010068e: 89 4d e4 mov %ecx,-0x1c(%ebp) for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100691: 85 c0 test %eax,%eax 80100693: 75 56 jne 801006eb <cprintf+0x8b> 80100695: eb 79 jmp 80100710 <cprintf+0xb0> 80100697: 89 f6 mov %esi,%esi 80100699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi c = fmt[++i] & 0xff; 801006a0: 0f b6 16 movzbl (%esi),%edx if(c == 0) 801006a3: 85 d2 test %edx,%edx 801006a5: 74 69 je 80100710 <cprintf+0xb0> 801006a7: 83 c3 02 add $0x2,%ebx switch(c){ 801006aa: 83 fa 70 cmp $0x70,%edx 801006ad: 8d 34 1f lea (%edi,%ebx,1),%esi 801006b0: 0f 84 84 00 00 00 je 8010073a <cprintf+0xda> 801006b6: 7f 78 jg 80100730 <cprintf+0xd0> 801006b8: 83 fa 25 cmp $0x25,%edx 801006bb: 0f 84 ff 00 00 00 je 801007c0 <cprintf+0x160> 801006c1: 83 fa 64 cmp $0x64,%edx 801006c4: 0f 85 8e 00 00 00 jne 80100758 <cprintf+0xf8> printint(*argp++, 10, 1); 801006ca: 8b 45 e4 mov -0x1c(%ebp),%eax 801006cd: ba 0a 00 00 00 mov $0xa,%edx 801006d2: 8d 48 04 lea 0x4(%eax),%ecx 801006d5: 8b 00 mov (%eax),%eax 801006d7: 89 4d e4 mov %ecx,-0x1c(%ebp) 801006da: b9 01 00 00 00 mov $0x1,%ecx 801006df: e8 9c fe ff ff call 80100580 <printint> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006e4: 0f b6 06 movzbl (%esi),%eax 801006e7: 85 c0 test %eax,%eax 801006e9: 74 25 je 80100710 <cprintf+0xb0> 801006eb: 8d 53 01 lea 0x1(%ebx),%edx if(c != '%'){ 801006ee: 83 f8 25 cmp $0x25,%eax 801006f1: 8d 34 17 lea (%edi,%edx,1),%esi 801006f4: 74 aa je 801006a0 <cprintf+0x40> 801006f6: 89 55 e0 mov %edx,-0x20(%ebp) consputc(c); 801006f9: e8 12 fd ff ff call 80100410 <consputc> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006fe: 0f b6 06 movzbl (%esi),%eax continue; 80100701: 8b 55 e0 mov -0x20(%ebp),%edx 80100704: 89 d3 mov %edx,%ebx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100706: 85 c0 test %eax,%eax 80100708: 75 e1 jne 801006eb <cprintf+0x8b> 8010070a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(locking) 80100710: 8b 45 dc mov -0x24(%ebp),%eax 80100713: 85 c0 test %eax,%eax 80100715: 74 10 je 80100727 <cprintf+0xc7> release(&cons.lock); 80100717: 83 ec 0c sub $0xc,%esp 8010071a: 68 20 a5 10 80 push $0x8010a520 8010071f: e8 1c 3e 00 00 call 80104540 <release> 80100724: 83 c4 10 add $0x10,%esp } 80100727: 8d 65 f4 lea -0xc(%ebp),%esp 8010072a: 5b pop %ebx 8010072b: 5e pop %esi 8010072c: 5f pop %edi 8010072d: 5d pop %ebp 8010072e: c3 ret 8010072f: 90 nop switch(c){ 80100730: 83 fa 73 cmp $0x73,%edx 80100733: 74 43 je 80100778 <cprintf+0x118> 80100735: 83 fa 78 cmp $0x78,%edx 80100738: 75 1e jne 80100758 <cprintf+0xf8> printint(*argp++, 16, 0); 8010073a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010073d: ba 10 00 00 00 mov $0x10,%edx 80100742: 8d 48 04 lea 0x4(%eax),%ecx 80100745: 8b 00 mov (%eax),%eax 80100747: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010074a: 31 c9 xor %ecx,%ecx 8010074c: e8 2f fe ff ff call 80100580 <printint> break; 80100751: eb 91 jmp 801006e4 <cprintf+0x84> 80100753: 90 nop 80100754: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100758: b8 25 00 00 00 mov $0x25,%eax 8010075d: 89 55 e0 mov %edx,-0x20(%ebp) 80100760: e8 ab fc ff ff call 80100410 <consputc> consputc(c); 80100765: 8b 55 e0 mov -0x20(%ebp),%edx 80100768: 89 d0 mov %edx,%eax 8010076a: e8 a1 fc ff ff call 80100410 <consputc> break; 8010076f: e9 70 ff ff ff jmp 801006e4 <cprintf+0x84> 80100774: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((s = (char*)*argp++) == 0) 80100778: 8b 45 e4 mov -0x1c(%ebp),%eax 8010077b: 8b 10 mov (%eax),%edx 8010077d: 8d 48 04 lea 0x4(%eax),%ecx 80100780: 89 4d e0 mov %ecx,-0x20(%ebp) 80100783: 85 d2 test %edx,%edx 80100785: 74 49 je 801007d0 <cprintf+0x170> for(; *s; s++) 80100787: 0f be 02 movsbl (%edx),%eax if((s = (char*)*argp++) == 0) 8010078a: 89 4d e4 mov %ecx,-0x1c(%ebp) for(; *s; s++) 8010078d: 84 c0 test %al,%al 8010078f: 0f 84 4f ff ff ff je 801006e4 <cprintf+0x84> 80100795: 89 5d e4 mov %ebx,-0x1c(%ebp) 80100798: 89 d3 mov %edx,%ebx 8010079a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801007a0: 83 c3 01 add $0x1,%ebx consputc(*s); 801007a3: e8 68 fc ff ff call 80100410 <consputc> for(; *s; s++) 801007a8: 0f be 03 movsbl (%ebx),%eax 801007ab: 84 c0 test %al,%al 801007ad: 75 f1 jne 801007a0 <cprintf+0x140> if((s = (char*)*argp++) == 0) 801007af: 8b 45 e0 mov -0x20(%ebp),%eax 801007b2: 8b 5d e4 mov -0x1c(%ebp),%ebx 801007b5: 89 45 e4 mov %eax,-0x1c(%ebp) 801007b8: e9 27 ff ff ff jmp 801006e4 <cprintf+0x84> 801007bd: 8d 76 00 lea 0x0(%esi),%esi consputc('%'); 801007c0: b8 25 00 00 00 mov $0x25,%eax 801007c5: e8 46 fc ff ff call 80100410 <consputc> break; 801007ca: e9 15 ff ff ff jmp 801006e4 <cprintf+0x84> 801007cf: 90 nop s = "(null)"; 801007d0: ba 18 71 10 80 mov $0x80107118,%edx for(; *s; s++) 801007d5: 89 5d e4 mov %ebx,-0x1c(%ebp) 801007d8: b8 28 00 00 00 mov $0x28,%eax 801007dd: 89 d3 mov %edx,%ebx 801007df: eb bf jmp 801007a0 <cprintf+0x140> 801007e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi acquire(&cons.lock); 801007e8: 83 ec 0c sub $0xc,%esp 801007eb: 68 20 a5 10 80 push $0x8010a520 801007f0: e8 8b 3c 00 00 call 80104480 <acquire> 801007f5: 83 c4 10 add $0x10,%esp 801007f8: e9 7c fe ff ff jmp 80100679 <cprintf+0x19> panic("null fmt"); 801007fd: 83 ec 0c sub $0xc,%esp 80100800: 68 1f 71 10 80 push $0x8010711f 80100805: e8 86 fb ff ff call 80100390 <panic> 8010080a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100810 <consoleintr>: { 80100810: 55 push %ebp 80100811: 89 e5 mov %esp,%ebp 80100813: 57 push %edi 80100814: 56 push %esi 80100815: 53 push %ebx int c, doprocdump = 0; 80100816: 31 f6 xor %esi,%esi { 80100818: 83 ec 18 sub $0x18,%esp 8010081b: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&cons.lock); 8010081e: 68 20 a5 10 80 push $0x8010a520 80100823: e8 58 3c 00 00 call 80104480 <acquire> while((c = getc()) >= 0){ 80100828: 83 c4 10 add $0x10,%esp 8010082b: 90 nop 8010082c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100830: ff d3 call *%ebx 80100832: 85 c0 test %eax,%eax 80100834: 89 c7 mov %eax,%edi 80100836: 78 48 js 80100880 <consoleintr+0x70> switch(c){ 80100838: 83 ff 10 cmp $0x10,%edi 8010083b: 0f 84 e7 00 00 00 je 80100928 <consoleintr+0x118> 80100841: 7e 5d jle 801008a0 <consoleintr+0x90> 80100843: 83 ff 15 cmp $0x15,%edi 80100846: 0f 84 ec 00 00 00 je 80100938 <consoleintr+0x128> 8010084c: 83 ff 7f cmp $0x7f,%edi 8010084f: 75 54 jne 801008a5 <consoleintr+0x95> if(input.e != input.w){ 80100851: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100856: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 8010085c: 74 d2 je 80100830 <consoleintr+0x20> input.e--; 8010085e: 83 e8 01 sub $0x1,%eax 80100861: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100866: b8 00 01 00 00 mov $0x100,%eax 8010086b: e8 a0 fb ff ff call 80100410 <consputc> while((c = getc()) >= 0){ 80100870: ff d3 call *%ebx 80100872: 85 c0 test %eax,%eax 80100874: 89 c7 mov %eax,%edi 80100876: 79 c0 jns 80100838 <consoleintr+0x28> 80100878: 90 nop 80100879: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&cons.lock); 80100880: 83 ec 0c sub $0xc,%esp 80100883: 68 20 a5 10 80 push $0x8010a520 80100888: e8 b3 3c 00 00 call 80104540 <release> if(doprocdump) { 8010088d: 83 c4 10 add $0x10,%esp 80100890: 85 f6 test %esi,%esi 80100892: 0f 85 f8 00 00 00 jne 80100990 <consoleintr+0x180> } 80100898: 8d 65 f4 lea -0xc(%ebp),%esp 8010089b: 5b pop %ebx 8010089c: 5e pop %esi 8010089d: 5f pop %edi 8010089e: 5d pop %ebp 8010089f: c3 ret switch(c){ 801008a0: 83 ff 08 cmp $0x8,%edi 801008a3: 74 ac je 80100851 <consoleintr+0x41> if(c != 0 && input.e-input.r < INPUT_BUF){ 801008a5: 85 ff test %edi,%edi 801008a7: 74 87 je 80100830 <consoleintr+0x20> 801008a9: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801008ae: 89 c2 mov %eax,%edx 801008b0: 2b 15 a0 ff 10 80 sub 0x8010ffa0,%edx 801008b6: 83 fa 7f cmp $0x7f,%edx 801008b9: 0f 87 71 ff ff ff ja 80100830 <consoleintr+0x20> 801008bf: 8d 50 01 lea 0x1(%eax),%edx 801008c2: 83 e0 7f and $0x7f,%eax c = (c == '\r') ? '\n' : c; 801008c5: 83 ff 0d cmp $0xd,%edi input.buf[input.e++ % INPUT_BUF] = c; 801008c8: 89 15 a8 ff 10 80 mov %edx,0x8010ffa8 c = (c == '\r') ? '\n' : c; 801008ce: 0f 84 cc 00 00 00 je 801009a0 <consoleintr+0x190> input.buf[input.e++ % INPUT_BUF] = c; 801008d4: 89 f9 mov %edi,%ecx 801008d6: 88 88 20 ff 10 80 mov %cl,-0x7fef00e0(%eax) consputc(c); 801008dc: 89 f8 mov %edi,%eax 801008de: e8 2d fb ff ff call 80100410 <consputc> if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ 801008e3: 83 ff 0a cmp $0xa,%edi 801008e6: 0f 84 c5 00 00 00 je 801009b1 <consoleintr+0x1a1> 801008ec: 83 ff 04 cmp $0x4,%edi 801008ef: 0f 84 bc 00 00 00 je 801009b1 <consoleintr+0x1a1> 801008f5: a1 a0 ff 10 80 mov 0x8010ffa0,%eax 801008fa: 83 e8 80 sub $0xffffff80,%eax 801008fd: 39 05 a8 ff 10 80 cmp %eax,0x8010ffa8 80100903: 0f 85 27 ff ff ff jne 80100830 <consoleintr+0x20> wakeup(&input.r); 80100909: 83 ec 0c sub $0xc,%esp input.w = input.e; 8010090c: a3 a4 ff 10 80 mov %eax,0x8010ffa4 wakeup(&input.r); 80100911: 68 a0 ff 10 80 push $0x8010ffa0 80100916: e8 55 37 00 00 call 80104070 <wakeup> 8010091b: 83 c4 10 add $0x10,%esp 8010091e: e9 0d ff ff ff jmp 80100830 <consoleintr+0x20> 80100923: 90 nop 80100924: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi doprocdump = 1; 80100928: be 01 00 00 00 mov $0x1,%esi 8010092d: e9 fe fe ff ff jmp 80100830 <consoleintr+0x20> 80100932: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while(input.e != input.w && 80100938: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 8010093d: 39 05 a4 ff 10 80 cmp %eax,0x8010ffa4 80100943: 75 2b jne 80100970 <consoleintr+0x160> 80100945: e9 e6 fe ff ff jmp 80100830 <consoleintr+0x20> 8010094a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi input.e--; 80100950: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100955: b8 00 01 00 00 mov $0x100,%eax 8010095a: e8 b1 fa ff ff call 80100410 <consputc> while(input.e != input.w && 8010095f: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100964: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 8010096a: 0f 84 c0 fe ff ff je 80100830 <consoleintr+0x20> input.buf[(input.e-1) % INPUT_BUF] != '\n'){ 80100970: 83 e8 01 sub $0x1,%eax 80100973: 89 c2 mov %eax,%edx 80100975: 83 e2 7f and $0x7f,%edx while(input.e != input.w && 80100978: 80 ba 20 ff 10 80 0a cmpb $0xa,-0x7fef00e0(%edx) 8010097f: 75 cf jne 80100950 <consoleintr+0x140> 80100981: e9 aa fe ff ff jmp 80100830 <consoleintr+0x20> 80100986: 8d 76 00 lea 0x0(%esi),%esi 80100989: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi } 80100990: 8d 65 f4 lea -0xc(%ebp),%esp 80100993: 5b pop %ebx 80100994: 5e pop %esi 80100995: 5f pop %edi 80100996: 5d pop %ebp procdump(); // now call procdump() wo. cons.lock held 80100997: e9 b4 37 00 00 jmp 80104150 <procdump> 8010099c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi input.buf[input.e++ % INPUT_BUF] = c; 801009a0: c6 80 20 ff 10 80 0a movb $0xa,-0x7fef00e0(%eax) consputc(c); 801009a7: b8 0a 00 00 00 mov $0xa,%eax 801009ac: e8 5f fa ff ff call 80100410 <consputc> 801009b1: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801009b6: e9 4e ff ff ff jmp 80100909 <consoleintr+0xf9> 801009bb: 90 nop 801009bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801009c0 <consoleinit>: void consoleinit(void) { 801009c0: 55 push %ebp 801009c1: 89 e5 mov %esp,%ebp 801009c3: 83 ec 10 sub $0x10,%esp initlock(&cons.lock, "console"); 801009c6: 68 28 71 10 80 push $0x80107128 801009cb: 68 20 a5 10 80 push $0x8010a520 801009d0: e8 6b 39 00 00 call 80104340 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; ioapicenable(IRQ_KBD, 0); 801009d5: 58 pop %eax 801009d6: 5a pop %edx 801009d7: 6a 00 push $0x0 801009d9: 6a 01 push $0x1 devsw[CONSOLE].write = consolewrite; 801009db: c7 05 6c 09 11 80 00 movl $0x80100600,0x8011096c 801009e2: 06 10 80 devsw[CONSOLE].read = consoleread; 801009e5: c7 05 68 09 11 80 70 movl $0x80100270,0x80110968 801009ec: 02 10 80 cons.locking = 1; 801009ef: c7 05 54 a5 10 80 01 movl $0x1,0x8010a554 801009f6: 00 00 00 ioapicenable(IRQ_KBD, 0); 801009f9: e8 f2 19 00 00 call 801023f0 <ioapicenable> } 801009fe: 83 c4 10 add $0x10,%esp 80100a01: c9 leave 80100a02: c3 ret 80100a03: 66 90 xchg %ax,%ax 80100a05: 66 90 xchg %ax,%ax 80100a07: 66 90 xchg %ax,%ax 80100a09: 66 90 xchg %ax,%ax 80100a0b: 66 90 xchg %ax,%ax 80100a0d: 66 90 xchg %ax,%ax 80100a0f: 90 nop 80100a10 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 80100a10: 55 push %ebp 80100a11: 89 e5 mov %esp,%ebp 80100a13: 57 push %edi 80100a14: 56 push %esi 80100a15: 53 push %ebx 80100a16: 81 ec 0c 01 00 00 sub $0x10c,%esp uint argc, sz, sp, ustack[3+MAXARG+1]; struct elfhdr elf; struct inode *ip; struct proghdr ph; pde_t *pgdir, *oldpgdir; struct proc *curproc = myproc(); 80100a1c: e8 df 2e 00 00 call 80103900 <myproc> 80100a21: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 80100a27: e8 94 22 00 00 call 80102cc0 <begin_op> if((ip = namei(path)) == 0){ 80100a2c: 83 ec 0c sub $0xc,%esp 80100a2f: ff 75 08 pushl 0x8(%ebp) 80100a32: e8 b9 14 00 00 call 80101ef0 <namei> 80100a37: 83 c4 10 add $0x10,%esp 80100a3a: 85 c0 test %eax,%eax 80100a3c: 0f 84 91 01 00 00 je 80100bd3 <exec+0x1c3> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 80100a42: 83 ec 0c sub $0xc,%esp 80100a45: 89 c3 mov %eax,%ebx 80100a47: 50 push %eax 80100a48: e8 43 0c 00 00 call 80101690 <ilock> pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a4d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 80100a53: 6a 34 push $0x34 80100a55: 6a 00 push $0x0 80100a57: 50 push %eax 80100a58: 53 push %ebx 80100a59: e8 12 0f 00 00 call 80101970 <readi> 80100a5e: 83 c4 20 add $0x20,%esp 80100a61: 83 f8 34 cmp $0x34,%eax 80100a64: 74 22 je 80100a88 <exec+0x78> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a66: 83 ec 0c sub $0xc,%esp 80100a69: 53 push %ebx 80100a6a: e8 b1 0e 00 00 call 80101920 <iunlockput> end_op(); 80100a6f: e8 bc 22 00 00 call 80102d30 <end_op> 80100a74: 83 c4 10 add $0x10,%esp } return -1; 80100a77: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a7c: 8d 65 f4 lea -0xc(%ebp),%esp 80100a7f: 5b pop %ebx 80100a80: 5e pop %esi 80100a81: 5f pop %edi 80100a82: 5d pop %ebp 80100a83: c3 ret 80100a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(elf.magic != ELF_MAGIC) 80100a88: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a8f: 45 4c 46 80100a92: 75 d2 jne 80100a66 <exec+0x56> if((pgdir = setupkvm()) == 0) 80100a94: e8 77 63 00 00 call 80106e10 <setupkvm> 80100a99: 85 c0 test %eax,%eax 80100a9b: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80100aa1: 74 c3 je 80100a66 <exec+0x56> sz = 0; 80100aa3: 31 ff xor %edi,%edi for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100aa5: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp) 80100aac: 00 80100aad: 8b 85 40 ff ff ff mov -0xc0(%ebp),%eax 80100ab3: 89 85 ec fe ff ff mov %eax,-0x114(%ebp) 80100ab9: 0f 84 8c 02 00 00 je 80100d4b <exec+0x33b> 80100abf: 31 f6 xor %esi,%esi 80100ac1: eb 7f jmp 80100b42 <exec+0x132> 80100ac3: 90 nop 80100ac4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ph.type != ELF_PROG_LOAD) 80100ac8: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp) 80100acf: 75 63 jne 80100b34 <exec+0x124> if(ph.memsz < ph.filesz) 80100ad1: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax 80100ad7: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax 80100add: 0f 82 86 00 00 00 jb 80100b69 <exec+0x159> 80100ae3: 03 85 0c ff ff ff add -0xf4(%ebp),%eax 80100ae9: 72 7e jb 80100b69 <exec+0x159> if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0) 80100aeb: 83 ec 04 sub $0x4,%esp 80100aee: 50 push %eax 80100aef: 57 push %edi 80100af0: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100af6: e8 35 61 00 00 call 80106c30 <allocuvm> 80100afb: 83 c4 10 add $0x10,%esp 80100afe: 85 c0 test %eax,%eax 80100b00: 89 c7 mov %eax,%edi 80100b02: 74 65 je 80100b69 <exec+0x159> if(ph.vaddr % PGSIZE != 0) 80100b04: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax 80100b0a: a9 ff 0f 00 00 test $0xfff,%eax 80100b0f: 75 58 jne 80100b69 <exec+0x159> if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) 80100b11: 83 ec 0c sub $0xc,%esp 80100b14: ff b5 14 ff ff ff pushl -0xec(%ebp) 80100b1a: ff b5 08 ff ff ff pushl -0xf8(%ebp) 80100b20: 53 push %ebx 80100b21: 50 push %eax 80100b22: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b28: e8 43 60 00 00 call 80106b70 <loaduvm> 80100b2d: 83 c4 20 add $0x20,%esp 80100b30: 85 c0 test %eax,%eax 80100b32: 78 35 js 80100b69 <exec+0x159> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100b34: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 80100b3b: 83 c6 01 add $0x1,%esi 80100b3e: 39 f0 cmp %esi,%eax 80100b40: 7e 3d jle 80100b7f <exec+0x16f> if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) 80100b42: 89 f0 mov %esi,%eax 80100b44: 6a 20 push $0x20 80100b46: c1 e0 05 shl $0x5,%eax 80100b49: 03 85 ec fe ff ff add -0x114(%ebp),%eax 80100b4f: 50 push %eax 80100b50: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 80100b56: 50 push %eax 80100b57: 53 push %ebx 80100b58: e8 13 0e 00 00 call 80101970 <readi> 80100b5d: 83 c4 10 add $0x10,%esp 80100b60: 83 f8 20 cmp $0x20,%eax 80100b63: 0f 84 5f ff ff ff je 80100ac8 <exec+0xb8> freevm(pgdir); 80100b69: 83 ec 0c sub $0xc,%esp 80100b6c: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b72: e8 19 62 00 00 call 80106d90 <freevm> 80100b77: 83 c4 10 add $0x10,%esp 80100b7a: e9 e7 fe ff ff jmp 80100a66 <exec+0x56> 80100b7f: 81 c7 ff 0f 00 00 add $0xfff,%edi 80100b85: 81 e7 00 f0 ff ff and $0xfffff000,%edi 80100b8b: 8d b7 00 20 00 00 lea 0x2000(%edi),%esi iunlockput(ip); 80100b91: 83 ec 0c sub $0xc,%esp 80100b94: 53 push %ebx 80100b95: e8 86 0d 00 00 call 80101920 <iunlockput> end_op(); 80100b9a: e8 91 21 00 00 call 80102d30 <end_op> if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b9f: 83 c4 0c add $0xc,%esp 80100ba2: 56 push %esi 80100ba3: 57 push %edi 80100ba4: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100baa: e8 81 60 00 00 call 80106c30 <allocuvm> 80100baf: 83 c4 10 add $0x10,%esp 80100bb2: 85 c0 test %eax,%eax 80100bb4: 89 c6 mov %eax,%esi 80100bb6: 75 3a jne 80100bf2 <exec+0x1e2> freevm(pgdir); 80100bb8: 83 ec 0c sub $0xc,%esp 80100bbb: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100bc1: e8 ca 61 00 00 call 80106d90 <freevm> 80100bc6: 83 c4 10 add $0x10,%esp return -1; 80100bc9: b8 ff ff ff ff mov $0xffffffff,%eax 80100bce: e9 a9 fe ff ff jmp 80100a7c <exec+0x6c> end_op(); 80100bd3: e8 58 21 00 00 call 80102d30 <end_op> cprintf("exec: fail\n"); 80100bd8: 83 ec 0c sub $0xc,%esp 80100bdb: 68 41 71 10 80 push $0x80107141 80100be0: e8 7b fa ff ff call 80100660 <cprintf> return -1; 80100be5: 83 c4 10 add $0x10,%esp 80100be8: b8 ff ff ff ff mov $0xffffffff,%eax 80100bed: e9 8a fe ff ff jmp 80100a7c <exec+0x6c> clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bf2: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax 80100bf8: 83 ec 08 sub $0x8,%esp for(argc = 0; argv[argc]; argc++) { 80100bfb: 31 ff xor %edi,%edi 80100bfd: 89 f3 mov %esi,%ebx clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bff: 50 push %eax 80100c00: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100c06: e8 a5 62 00 00 call 80106eb0 <clearpteu> for(argc = 0; argv[argc]; argc++) { 80100c0b: 8b 45 0c mov 0xc(%ebp),%eax 80100c0e: 83 c4 10 add $0x10,%esp 80100c11: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80100c17: 8b 00 mov (%eax),%eax 80100c19: 85 c0 test %eax,%eax 80100c1b: 74 70 je 80100c8d <exec+0x27d> 80100c1d: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp) 80100c23: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi 80100c29: eb 0a jmp 80100c35 <exec+0x225> 80100c2b: 90 nop 80100c2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(argc >= MAXARG) 80100c30: 83 ff 20 cmp $0x20,%edi 80100c33: 74 83 je 80100bb8 <exec+0x1a8> sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c35: 83 ec 0c sub $0xc,%esp 80100c38: 50 push %eax 80100c39: e8 72 3b 00 00 call 801047b0 <strlen> 80100c3e: f7 d0 not %eax 80100c40: 01 c3 add %eax,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c42: 8b 45 0c mov 0xc(%ebp),%eax 80100c45: 5a pop %edx sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c46: 83 e3 fc and $0xfffffffc,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c49: ff 34 b8 pushl (%eax,%edi,4) 80100c4c: e8 5f 3b 00 00 call 801047b0 <strlen> 80100c51: 83 c0 01 add $0x1,%eax 80100c54: 50 push %eax 80100c55: 8b 45 0c mov 0xc(%ebp),%eax 80100c58: ff 34 b8 pushl (%eax,%edi,4) 80100c5b: 53 push %ebx 80100c5c: 56 push %esi 80100c5d: e8 ae 63 00 00 call 80107010 <copyout> 80100c62: 83 c4 20 add $0x20,%esp 80100c65: 85 c0 test %eax,%eax 80100c67: 0f 88 4b ff ff ff js 80100bb8 <exec+0x1a8> for(argc = 0; argv[argc]; argc++) { 80100c6d: 8b 45 0c mov 0xc(%ebp),%eax ustack[3+argc] = sp; 80100c70: 89 9c bd 64 ff ff ff mov %ebx,-0x9c(%ebp,%edi,4) for(argc = 0; argv[argc]; argc++) { 80100c77: 83 c7 01 add $0x1,%edi ustack[3+argc] = sp; 80100c7a: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx for(argc = 0; argv[argc]; argc++) { 80100c80: 8b 04 b8 mov (%eax,%edi,4),%eax 80100c83: 85 c0 test %eax,%eax 80100c85: 75 a9 jne 80100c30 <exec+0x220> 80100c87: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi ustack[2] = sp - (argc+1)*4; // argv pointer 80100c8d: 8d 04 bd 04 00 00 00 lea 0x4(,%edi,4),%eax 80100c94: 89 d9 mov %ebx,%ecx ustack[3+argc] = 0; 80100c96: c7 84 bd 64 ff ff ff movl $0x0,-0x9c(%ebp,%edi,4) 80100c9d: 00 00 00 00 ustack[0] = 0xffffffff; // fake return PC 80100ca1: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp) 80100ca8: ff ff ff ustack[1] = argc; 80100cab: 89 bd 5c ff ff ff mov %edi,-0xa4(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100cb1: 29 c1 sub %eax,%ecx sp -= (3+argc+1) * 4; 80100cb3: 83 c0 0c add $0xc,%eax 80100cb6: 29 c3 sub %eax,%ebx if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cb8: 50 push %eax 80100cb9: 52 push %edx 80100cba: 53 push %ebx 80100cbb: ff b5 f0 fe ff ff pushl -0x110(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100cc1: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp) if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cc7: e8 44 63 00 00 call 80107010 <copyout> 80100ccc: 83 c4 10 add $0x10,%esp 80100ccf: 85 c0 test %eax,%eax 80100cd1: 0f 88 e1 fe ff ff js 80100bb8 <exec+0x1a8> for(last=s=path; *s; s++) 80100cd7: 8b 45 08 mov 0x8(%ebp),%eax 80100cda: 0f b6 00 movzbl (%eax),%eax 80100cdd: 84 c0 test %al,%al 80100cdf: 74 17 je 80100cf8 <exec+0x2e8> 80100ce1: 8b 55 08 mov 0x8(%ebp),%edx 80100ce4: 89 d1 mov %edx,%ecx 80100ce6: 83 c1 01 add $0x1,%ecx 80100ce9: 3c 2f cmp $0x2f,%al 80100ceb: 0f b6 01 movzbl (%ecx),%eax 80100cee: 0f 44 d1 cmove %ecx,%edx 80100cf1: 84 c0 test %al,%al 80100cf3: 75 f1 jne 80100ce6 <exec+0x2d6> 80100cf5: 89 55 08 mov %edx,0x8(%ebp) safestrcpy(curproc->name, last, sizeof(curproc->name)); 80100cf8: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi 80100cfe: 50 push %eax 80100cff: 6a 10 push $0x10 80100d01: ff 75 08 pushl 0x8(%ebp) 80100d04: 89 f8 mov %edi,%eax 80100d06: 83 c0 6c add $0x6c,%eax 80100d09: 50 push %eax 80100d0a: e8 61 3a 00 00 call 80104770 <safestrcpy> curproc->pgdir = pgdir; 80100d0f: 8b 95 f0 fe ff ff mov -0x110(%ebp),%edx oldpgdir = curproc->pgdir; 80100d15: 89 f9 mov %edi,%ecx 80100d17: 8b 7f 04 mov 0x4(%edi),%edi curproc->tf->eip = elf.entry; // main 80100d1a: 8b 41 18 mov 0x18(%ecx),%eax curproc->sz = sz; 80100d1d: 89 31 mov %esi,(%ecx) curproc->pgdir = pgdir; 80100d1f: 89 51 04 mov %edx,0x4(%ecx) curproc->tf->eip = elf.entry; // main 80100d22: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 80100d28: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 80100d2b: 8b 41 18 mov 0x18(%ecx),%eax 80100d2e: 89 58 44 mov %ebx,0x44(%eax) switchuvm(curproc); 80100d31: 89 0c 24 mov %ecx,(%esp) 80100d34: e8 a7 5c 00 00 call 801069e0 <switchuvm> freevm(oldpgdir); 80100d39: 89 3c 24 mov %edi,(%esp) 80100d3c: e8 4f 60 00 00 call 80106d90 <freevm> return 0; 80100d41: 83 c4 10 add $0x10,%esp 80100d44: 31 c0 xor %eax,%eax 80100d46: e9 31 fd ff ff jmp 80100a7c <exec+0x6c> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100d4b: be 00 20 00 00 mov $0x2000,%esi 80100d50: e9 3c fe ff ff jmp 80100b91 <exec+0x181> 80100d55: 66 90 xchg %ax,%ax 80100d57: 66 90 xchg %ax,%ax 80100d59: 66 90 xchg %ax,%ax 80100d5b: 66 90 xchg %ax,%ax 80100d5d: 66 90 xchg %ax,%ax 80100d5f: 90 nop 80100d60 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 80100d60: 55 push %ebp 80100d61: 89 e5 mov %esp,%ebp 80100d63: 83 ec 10 sub $0x10,%esp initlock(&ftable.lock, "ftable"); 80100d66: 68 4d 71 10 80 push $0x8010714d 80100d6b: 68 c0 ff 10 80 push $0x8010ffc0 80100d70: e8 cb 35 00 00 call 80104340 <initlock> } 80100d75: 83 c4 10 add $0x10,%esp 80100d78: c9 leave 80100d79: c3 ret 80100d7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100d80 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80100d80: 55 push %ebp 80100d81: 89 e5 mov %esp,%ebp 80100d83: 53 push %ebx struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d84: bb f4 ff 10 80 mov $0x8010fff4,%ebx { 80100d89: 83 ec 10 sub $0x10,%esp acquire(&ftable.lock); 80100d8c: 68 c0 ff 10 80 push $0x8010ffc0 80100d91: e8 ea 36 00 00 call 80104480 <acquire> 80100d96: 83 c4 10 add $0x10,%esp 80100d99: eb 10 jmp 80100dab <filealloc+0x2b> 80100d9b: 90 nop 80100d9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100da0: 83 c3 18 add $0x18,%ebx 80100da3: 81 fb 54 09 11 80 cmp $0x80110954,%ebx 80100da9: 73 25 jae 80100dd0 <filealloc+0x50> if(f->ref == 0){ 80100dab: 8b 43 04 mov 0x4(%ebx),%eax 80100dae: 85 c0 test %eax,%eax 80100db0: 75 ee jne 80100da0 <filealloc+0x20> f->ref = 1; release(&ftable.lock); 80100db2: 83 ec 0c sub $0xc,%esp f->ref = 1; 80100db5: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) release(&ftable.lock); 80100dbc: 68 c0 ff 10 80 push $0x8010ffc0 80100dc1: e8 7a 37 00 00 call 80104540 <release> return f; } } release(&ftable.lock); return 0; } 80100dc6: 89 d8 mov %ebx,%eax return f; 80100dc8: 83 c4 10 add $0x10,%esp } 80100dcb: 8b 5d fc mov -0x4(%ebp),%ebx 80100dce: c9 leave 80100dcf: c3 ret release(&ftable.lock); 80100dd0: 83 ec 0c sub $0xc,%esp return 0; 80100dd3: 31 db xor %ebx,%ebx release(&ftable.lock); 80100dd5: 68 c0 ff 10 80 push $0x8010ffc0 80100dda: e8 61 37 00 00 call 80104540 <release> } 80100ddf: 89 d8 mov %ebx,%eax return 0; 80100de1: 83 c4 10 add $0x10,%esp } 80100de4: 8b 5d fc mov -0x4(%ebp),%ebx 80100de7: c9 leave 80100de8: c3 ret 80100de9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100df0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80100df0: 55 push %ebp 80100df1: 89 e5 mov %esp,%ebp 80100df3: 53 push %ebx 80100df4: 83 ec 10 sub $0x10,%esp 80100df7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 80100dfa: 68 c0 ff 10 80 push $0x8010ffc0 80100dff: e8 7c 36 00 00 call 80104480 <acquire> if(f->ref < 1) 80100e04: 8b 43 04 mov 0x4(%ebx),%eax 80100e07: 83 c4 10 add $0x10,%esp 80100e0a: 85 c0 test %eax,%eax 80100e0c: 7e 1a jle 80100e28 <filedup+0x38> panic("filedup"); f->ref++; 80100e0e: 83 c0 01 add $0x1,%eax release(&ftable.lock); 80100e11: 83 ec 0c sub $0xc,%esp f->ref++; 80100e14: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 80100e17: 68 c0 ff 10 80 push $0x8010ffc0 80100e1c: e8 1f 37 00 00 call 80104540 <release> return f; } 80100e21: 89 d8 mov %ebx,%eax 80100e23: 8b 5d fc mov -0x4(%ebp),%ebx 80100e26: c9 leave 80100e27: c3 ret panic("filedup"); 80100e28: 83 ec 0c sub $0xc,%esp 80100e2b: 68 54 71 10 80 push $0x80107154 80100e30: e8 5b f5 ff ff call 80100390 <panic> 80100e35: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100e39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100e40 <fileclose>: // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80100e40: 55 push %ebp 80100e41: 89 e5 mov %esp,%ebp 80100e43: 57 push %edi 80100e44: 56 push %esi 80100e45: 53 push %ebx 80100e46: 83 ec 28 sub $0x28,%esp 80100e49: 8b 5d 08 mov 0x8(%ebp),%ebx struct file ff; acquire(&ftable.lock); 80100e4c: 68 c0 ff 10 80 push $0x8010ffc0 80100e51: e8 2a 36 00 00 call 80104480 <acquire> if(f->ref < 1) 80100e56: 8b 43 04 mov 0x4(%ebx),%eax 80100e59: 83 c4 10 add $0x10,%esp 80100e5c: 85 c0 test %eax,%eax 80100e5e: 0f 8e 9b 00 00 00 jle 80100eff <fileclose+0xbf> panic("fileclose"); if(--f->ref > 0){ 80100e64: 83 e8 01 sub $0x1,%eax 80100e67: 85 c0 test %eax,%eax 80100e69: 89 43 04 mov %eax,0x4(%ebx) 80100e6c: 74 1a je 80100e88 <fileclose+0x48> release(&ftable.lock); 80100e6e: c7 45 08 c0 ff 10 80 movl $0x8010ffc0,0x8(%ebp) else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); } } 80100e75: 8d 65 f4 lea -0xc(%ebp),%esp 80100e78: 5b pop %ebx 80100e79: 5e pop %esi 80100e7a: 5f pop %edi 80100e7b: 5d pop %ebp release(&ftable.lock); 80100e7c: e9 bf 36 00 00 jmp 80104540 <release> 80100e81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ff = *f; 80100e88: 0f b6 43 09 movzbl 0x9(%ebx),%eax 80100e8c: 8b 3b mov (%ebx),%edi release(&ftable.lock); 80100e8e: 83 ec 0c sub $0xc,%esp ff = *f; 80100e91: 8b 73 0c mov 0xc(%ebx),%esi f->type = FD_NONE; 80100e94: c7 03 00 00 00 00 movl $0x0,(%ebx) ff = *f; 80100e9a: 88 45 e7 mov %al,-0x19(%ebp) 80100e9d: 8b 43 10 mov 0x10(%ebx),%eax release(&ftable.lock); 80100ea0: 68 c0 ff 10 80 push $0x8010ffc0 ff = *f; 80100ea5: 89 45 e0 mov %eax,-0x20(%ebp) release(&ftable.lock); 80100ea8: e8 93 36 00 00 call 80104540 <release> if(ff.type == FD_PIPE) 80100ead: 83 c4 10 add $0x10,%esp 80100eb0: 83 ff 01 cmp $0x1,%edi 80100eb3: 74 13 je 80100ec8 <fileclose+0x88> else if(ff.type == FD_INODE){ 80100eb5: 83 ff 02 cmp $0x2,%edi 80100eb8: 74 26 je 80100ee0 <fileclose+0xa0> } 80100eba: 8d 65 f4 lea -0xc(%ebp),%esp 80100ebd: 5b pop %ebx 80100ebe: 5e pop %esi 80100ebf: 5f pop %edi 80100ec0: 5d pop %ebp 80100ec1: c3 ret 80100ec2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pipeclose(ff.pipe, ff.writable); 80100ec8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 80100ecc: 83 ec 08 sub $0x8,%esp 80100ecf: 53 push %ebx 80100ed0: 56 push %esi 80100ed1: e8 9a 25 00 00 call 80103470 <pipeclose> 80100ed6: 83 c4 10 add $0x10,%esp 80100ed9: eb df jmp 80100eba <fileclose+0x7a> 80100edb: 90 nop 80100edc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi begin_op(); 80100ee0: e8 db 1d 00 00 call 80102cc0 <begin_op> iput(ff.ip); 80100ee5: 83 ec 0c sub $0xc,%esp 80100ee8: ff 75 e0 pushl -0x20(%ebp) 80100eeb: e8 d0 08 00 00 call 801017c0 <iput> end_op(); 80100ef0: 83 c4 10 add $0x10,%esp } 80100ef3: 8d 65 f4 lea -0xc(%ebp),%esp 80100ef6: 5b pop %ebx 80100ef7: 5e pop %esi 80100ef8: 5f pop %edi 80100ef9: 5d pop %ebp end_op(); 80100efa: e9 31 1e 00 00 jmp 80102d30 <end_op> panic("fileclose"); 80100eff: 83 ec 0c sub $0xc,%esp 80100f02: 68 5c 71 10 80 push $0x8010715c 80100f07: e8 84 f4 ff ff call 80100390 <panic> 80100f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100f10 <filestat>: // Get metadata about file f. int filestat(struct file *f, struct stat *st) { 80100f10: 55 push %ebp 80100f11: 89 e5 mov %esp,%ebp 80100f13: 53 push %ebx 80100f14: 83 ec 04 sub $0x4,%esp 80100f17: 8b 5d 08 mov 0x8(%ebp),%ebx if(f->type == FD_INODE){ 80100f1a: 83 3b 02 cmpl $0x2,(%ebx) 80100f1d: 75 31 jne 80100f50 <filestat+0x40> ilock(f->ip); 80100f1f: 83 ec 0c sub $0xc,%esp 80100f22: ff 73 10 pushl 0x10(%ebx) 80100f25: e8 66 07 00 00 call 80101690 <ilock> stati(f->ip, st); 80100f2a: 58 pop %eax 80100f2b: 5a pop %edx 80100f2c: ff 75 0c pushl 0xc(%ebp) 80100f2f: ff 73 10 pushl 0x10(%ebx) 80100f32: e8 09 0a 00 00 call 80101940 <stati> iunlock(f->ip); 80100f37: 59 pop %ecx 80100f38: ff 73 10 pushl 0x10(%ebx) 80100f3b: e8 30 08 00 00 call 80101770 <iunlock> return 0; 80100f40: 83 c4 10 add $0x10,%esp 80100f43: 31 c0 xor %eax,%eax } return -1; } 80100f45: 8b 5d fc mov -0x4(%ebp),%ebx 80100f48: c9 leave 80100f49: c3 ret 80100f4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100f50: b8 ff ff ff ff mov $0xffffffff,%eax 80100f55: eb ee jmp 80100f45 <filestat+0x35> 80100f57: 89 f6 mov %esi,%esi 80100f59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100f60 <fileread>: // Read from file f. int fileread(struct file *f, char *addr, int n) { 80100f60: 55 push %ebp 80100f61: 89 e5 mov %esp,%ebp 80100f63: 57 push %edi 80100f64: 56 push %esi 80100f65: 53 push %ebx 80100f66: 83 ec 0c sub $0xc,%esp 80100f69: 8b 5d 08 mov 0x8(%ebp),%ebx 80100f6c: 8b 75 0c mov 0xc(%ebp),%esi 80100f6f: 8b 7d 10 mov 0x10(%ebp),%edi int r; if(f->readable == 0) 80100f72: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80100f76: 74 60 je 80100fd8 <fileread+0x78> return -1; if(f->type == FD_PIPE) 80100f78: 8b 03 mov (%ebx),%eax 80100f7a: 83 f8 01 cmp $0x1,%eax 80100f7d: 74 41 je 80100fc0 <fileread+0x60> return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ 80100f7f: 83 f8 02 cmp $0x2,%eax 80100f82: 75 5b jne 80100fdf <fileread+0x7f> ilock(f->ip); 80100f84: 83 ec 0c sub $0xc,%esp 80100f87: ff 73 10 pushl 0x10(%ebx) 80100f8a: e8 01 07 00 00 call 80101690 <ilock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f8f: 57 push %edi 80100f90: ff 73 14 pushl 0x14(%ebx) 80100f93: 56 push %esi 80100f94: ff 73 10 pushl 0x10(%ebx) 80100f97: e8 d4 09 00 00 call 80101970 <readi> 80100f9c: 83 c4 20 add $0x20,%esp 80100f9f: 85 c0 test %eax,%eax 80100fa1: 89 c6 mov %eax,%esi 80100fa3: 7e 03 jle 80100fa8 <fileread+0x48> f->off += r; 80100fa5: 01 43 14 add %eax,0x14(%ebx) iunlock(f->ip); 80100fa8: 83 ec 0c sub $0xc,%esp 80100fab: ff 73 10 pushl 0x10(%ebx) 80100fae: e8 bd 07 00 00 call 80101770 <iunlock> return r; 80100fb3: 83 c4 10 add $0x10,%esp } panic("fileread"); } 80100fb6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fb9: 89 f0 mov %esi,%eax 80100fbb: 5b pop %ebx 80100fbc: 5e pop %esi 80100fbd: 5f pop %edi 80100fbe: 5d pop %ebp 80100fbf: c3 ret return piperead(f->pipe, addr, n); 80100fc0: 8b 43 0c mov 0xc(%ebx),%eax 80100fc3: 89 45 08 mov %eax,0x8(%ebp) } 80100fc6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fc9: 5b pop %ebx 80100fca: 5e pop %esi 80100fcb: 5f pop %edi 80100fcc: 5d pop %ebp return piperead(f->pipe, addr, n); 80100fcd: e9 4e 26 00 00 jmp 80103620 <piperead> 80100fd2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100fd8: be ff ff ff ff mov $0xffffffff,%esi 80100fdd: eb d7 jmp 80100fb6 <fileread+0x56> panic("fileread"); 80100fdf: 83 ec 0c sub $0xc,%esp 80100fe2: 68 66 71 10 80 push $0x80107166 80100fe7: e8 a4 f3 ff ff call 80100390 <panic> 80100fec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100ff0 <filewrite>: //PAGEBREAK! // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100ff0: 55 push %ebp 80100ff1: 89 e5 mov %esp,%ebp 80100ff3: 57 push %edi 80100ff4: 56 push %esi 80100ff5: 53 push %ebx 80100ff6: 83 ec 1c sub $0x1c,%esp 80100ff9: 8b 75 08 mov 0x8(%ebp),%esi 80100ffc: 8b 45 0c mov 0xc(%ebp),%eax int r; if(f->writable == 0) 80100fff: 80 7e 09 00 cmpb $0x0,0x9(%esi) { 80101003: 89 45 dc mov %eax,-0x24(%ebp) 80101006: 8b 45 10 mov 0x10(%ebp),%eax 80101009: 89 45 e4 mov %eax,-0x1c(%ebp) if(f->writable == 0) 8010100c: 0f 84 aa 00 00 00 je 801010bc <filewrite+0xcc> return -1; if(f->type == FD_PIPE) 80101012: 8b 06 mov (%esi),%eax 80101014: 83 f8 01 cmp $0x1,%eax 80101017: 0f 84 c3 00 00 00 je 801010e0 <filewrite+0xf0> return pipewrite(f->pipe, addr, n); if(f->type == FD_INODE){ 8010101d: 83 f8 02 cmp $0x2,%eax 80101020: 0f 85 d9 00 00 00 jne 801010ff <filewrite+0x10f> // and 2 blocks of slop for non-aligned writes. // this really belongs lower down, since writei() // might be writing a device like the console. int max = ((MAXOPBLOCKS-1-1-2) / 2) * 512; int i = 0; while(i < n){ 80101026: 8b 45 e4 mov -0x1c(%ebp),%eax int i = 0; 80101029: 31 ff xor %edi,%edi while(i < n){ 8010102b: 85 c0 test %eax,%eax 8010102d: 7f 34 jg 80101063 <filewrite+0x73> 8010102f: e9 9c 00 00 00 jmp 801010d0 <filewrite+0xe0> 80101034: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi n1 = max; begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) f->off += r; 80101038: 01 46 14 add %eax,0x14(%esi) iunlock(f->ip); 8010103b: 83 ec 0c sub $0xc,%esp 8010103e: ff 76 10 pushl 0x10(%esi) f->off += r; 80101041: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101044: e8 27 07 00 00 call 80101770 <iunlock> end_op(); 80101049: e8 e2 1c 00 00 call 80102d30 <end_op> 8010104e: 8b 45 e0 mov -0x20(%ebp),%eax 80101051: 83 c4 10 add $0x10,%esp if(r < 0) break; if(r != n1) 80101054: 39 c3 cmp %eax,%ebx 80101056: 0f 85 96 00 00 00 jne 801010f2 <filewrite+0x102> panic("short filewrite"); i += r; 8010105c: 01 df add %ebx,%edi while(i < n){ 8010105e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101061: 7e 6d jle 801010d0 <filewrite+0xe0> int n1 = n - i; 80101063: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101066: b8 00 06 00 00 mov $0x600,%eax 8010106b: 29 fb sub %edi,%ebx 8010106d: 81 fb 00 06 00 00 cmp $0x600,%ebx 80101073: 0f 4f d8 cmovg %eax,%ebx begin_op(); 80101076: e8 45 1c 00 00 call 80102cc0 <begin_op> ilock(f->ip); 8010107b: 83 ec 0c sub $0xc,%esp 8010107e: ff 76 10 pushl 0x10(%esi) 80101081: e8 0a 06 00 00 call 80101690 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) 80101086: 8b 45 dc mov -0x24(%ebp),%eax 80101089: 53 push %ebx 8010108a: ff 76 14 pushl 0x14(%esi) 8010108d: 01 f8 add %edi,%eax 8010108f: 50 push %eax 80101090: ff 76 10 pushl 0x10(%esi) 80101093: e8 d8 09 00 00 call 80101a70 <writei> 80101098: 83 c4 20 add $0x20,%esp 8010109b: 85 c0 test %eax,%eax 8010109d: 7f 99 jg 80101038 <filewrite+0x48> iunlock(f->ip); 8010109f: 83 ec 0c sub $0xc,%esp 801010a2: ff 76 10 pushl 0x10(%esi) 801010a5: 89 45 e0 mov %eax,-0x20(%ebp) 801010a8: e8 c3 06 00 00 call 80101770 <iunlock> end_op(); 801010ad: e8 7e 1c 00 00 call 80102d30 <end_op> if(r < 0) 801010b2: 8b 45 e0 mov -0x20(%ebp),%eax 801010b5: 83 c4 10 add $0x10,%esp 801010b8: 85 c0 test %eax,%eax 801010ba: 74 98 je 80101054 <filewrite+0x64> } return i == n ? n : -1; } panic("filewrite"); } 801010bc: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801010bf: bf ff ff ff ff mov $0xffffffff,%edi } 801010c4: 89 f8 mov %edi,%eax 801010c6: 5b pop %ebx 801010c7: 5e pop %esi 801010c8: 5f pop %edi 801010c9: 5d pop %ebp 801010ca: c3 ret 801010cb: 90 nop 801010cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return i == n ? n : -1; 801010d0: 39 7d e4 cmp %edi,-0x1c(%ebp) 801010d3: 75 e7 jne 801010bc <filewrite+0xcc> } 801010d5: 8d 65 f4 lea -0xc(%ebp),%esp 801010d8: 89 f8 mov %edi,%eax 801010da: 5b pop %ebx 801010db: 5e pop %esi 801010dc: 5f pop %edi 801010dd: 5d pop %ebp 801010de: c3 ret 801010df: 90 nop return pipewrite(f->pipe, addr, n); 801010e0: 8b 46 0c mov 0xc(%esi),%eax 801010e3: 89 45 08 mov %eax,0x8(%ebp) } 801010e6: 8d 65 f4 lea -0xc(%ebp),%esp 801010e9: 5b pop %ebx 801010ea: 5e pop %esi 801010eb: 5f pop %edi 801010ec: 5d pop %ebp return pipewrite(f->pipe, addr, n); 801010ed: e9 1e 24 00 00 jmp 80103510 <pipewrite> panic("short filewrite"); 801010f2: 83 ec 0c sub $0xc,%esp 801010f5: 68 6f 71 10 80 push $0x8010716f 801010fa: e8 91 f2 ff ff call 80100390 <panic> panic("filewrite"); 801010ff: 83 ec 0c sub $0xc,%esp 80101102: 68 75 71 10 80 push $0x80107175 80101107: e8 84 f2 ff ff call 80100390 <panic> 8010110c: 66 90 xchg %ax,%ax 8010110e: 66 90 xchg %ax,%ax 80101110 <balloc>: // Blocks. // Allocate a zeroed disk block. static uint balloc(uint dev) { 80101110: 55 push %ebp 80101111: 89 e5 mov %esp,%ebp 80101113: 57 push %edi 80101114: 56 push %esi 80101115: 53 push %ebx 80101116: 83 ec 1c sub $0x1c,%esp int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 80101119: 8b 0d c0 09 11 80 mov 0x801109c0,%ecx { 8010111f: 89 45 d8 mov %eax,-0x28(%ebp) for(b = 0; b < sb.size; b += BPB){ 80101122: 85 c9 test %ecx,%ecx 80101124: 0f 84 87 00 00 00 je 801011b1 <balloc+0xa1> 8010112a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 80101131: 8b 75 dc mov -0x24(%ebp),%esi 80101134: 83 ec 08 sub $0x8,%esp 80101137: 89 f0 mov %esi,%eax 80101139: c1 f8 0c sar $0xc,%eax 8010113c: 03 05 d8 09 11 80 add 0x801109d8,%eax 80101142: 50 push %eax 80101143: ff 75 d8 pushl -0x28(%ebp) 80101146: e8 85 ef ff ff call 801000d0 <bread> 8010114b: 89 45 e4 mov %eax,-0x1c(%ebp) for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 8010114e: a1 c0 09 11 80 mov 0x801109c0,%eax 80101153: 83 c4 10 add $0x10,%esp 80101156: 89 45 e0 mov %eax,-0x20(%ebp) 80101159: 31 c0 xor %eax,%eax 8010115b: eb 2f jmp 8010118c <balloc+0x7c> 8010115d: 8d 76 00 lea 0x0(%esi),%esi m = 1 << (bi % 8); 80101160: 89 c1 mov %eax,%ecx if((bp->data[bi/8] & m) == 0){ // Is block free? 80101162: 8b 55 e4 mov -0x1c(%ebp),%edx m = 1 << (bi % 8); 80101165: bb 01 00 00 00 mov $0x1,%ebx 8010116a: 83 e1 07 and $0x7,%ecx 8010116d: d3 e3 shl %cl,%ebx if((bp->data[bi/8] & m) == 0){ // Is block free? 8010116f: 89 c1 mov %eax,%ecx 80101171: c1 f9 03 sar $0x3,%ecx 80101174: 0f b6 7c 0a 5c movzbl 0x5c(%edx,%ecx,1),%edi 80101179: 85 df test %ebx,%edi 8010117b: 89 fa mov %edi,%edx 8010117d: 74 41 je 801011c0 <balloc+0xb0> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 8010117f: 83 c0 01 add $0x1,%eax 80101182: 83 c6 01 add $0x1,%esi 80101185: 3d 00 10 00 00 cmp $0x1000,%eax 8010118a: 74 05 je 80101191 <balloc+0x81> 8010118c: 39 75 e0 cmp %esi,-0x20(%ebp) 8010118f: 77 cf ja 80101160 <balloc+0x50> brelse(bp); bzero(dev, b + bi); return b + bi; } } brelse(bp); 80101191: 83 ec 0c sub $0xc,%esp 80101194: ff 75 e4 pushl -0x1c(%ebp) 80101197: e8 44 f0 ff ff call 801001e0 <brelse> for(b = 0; b < sb.size; b += BPB){ 8010119c: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 801011a3: 83 c4 10 add $0x10,%esp 801011a6: 8b 45 dc mov -0x24(%ebp),%eax 801011a9: 39 05 c0 09 11 80 cmp %eax,0x801109c0 801011af: 77 80 ja 80101131 <balloc+0x21> } panic("balloc: out of blocks"); 801011b1: 83 ec 0c sub $0xc,%esp 801011b4: 68 7f 71 10 80 push $0x8010717f 801011b9: e8 d2 f1 ff ff call 80100390 <panic> 801011be: 66 90 xchg %ax,%ax bp->data[bi/8] |= m; // Mark block in use. 801011c0: 8b 7d e4 mov -0x1c(%ebp),%edi log_write(bp); 801011c3: 83 ec 0c sub $0xc,%esp bp->data[bi/8] |= m; // Mark block in use. 801011c6: 09 da or %ebx,%edx 801011c8: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1) log_write(bp); 801011cc: 57 push %edi 801011cd: e8 be 1c 00 00 call 80102e90 <log_write> brelse(bp); 801011d2: 89 3c 24 mov %edi,(%esp) 801011d5: e8 06 f0 ff ff call 801001e0 <brelse> bp = bread(dev, bno); 801011da: 58 pop %eax 801011db: 5a pop %edx 801011dc: 56 push %esi 801011dd: ff 75 d8 pushl -0x28(%ebp) 801011e0: e8 eb ee ff ff call 801000d0 <bread> 801011e5: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 801011e7: 8d 40 5c lea 0x5c(%eax),%eax 801011ea: 83 c4 0c add $0xc,%esp 801011ed: 68 00 02 00 00 push $0x200 801011f2: 6a 00 push $0x0 801011f4: 50 push %eax 801011f5: e8 96 33 00 00 call 80104590 <memset> log_write(bp); 801011fa: 89 1c 24 mov %ebx,(%esp) 801011fd: e8 8e 1c 00 00 call 80102e90 <log_write> brelse(bp); 80101202: 89 1c 24 mov %ebx,(%esp) 80101205: e8 d6 ef ff ff call 801001e0 <brelse> } 8010120a: 8d 65 f4 lea -0xc(%ebp),%esp 8010120d: 89 f0 mov %esi,%eax 8010120f: 5b pop %ebx 80101210: 5e pop %esi 80101211: 5f pop %edi 80101212: 5d pop %ebp 80101213: c3 ret 80101214: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010121a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101220 <iget>: // Find the inode with number inum on device dev // and return the in-memory copy. Does not lock // the inode and does not read it from disk. static struct inode* iget(uint dev, uint inum) { 80101220: 55 push %ebp 80101221: 89 e5 mov %esp,%ebp 80101223: 57 push %edi 80101224: 56 push %esi 80101225: 53 push %ebx 80101226: 89 c7 mov %eax,%edi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101228: 31 f6 xor %esi,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010122a: bb 14 0a 11 80 mov $0x80110a14,%ebx { 8010122f: 83 ec 28 sub $0x28,%esp 80101232: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 80101235: 68 e0 09 11 80 push $0x801109e0 8010123a: e8 41 32 00 00 call 80104480 <acquire> 8010123f: 83 c4 10 add $0x10,%esp for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101242: 8b 55 e4 mov -0x1c(%ebp),%edx 80101245: eb 17 jmp 8010125e <iget+0x3e> 80101247: 89 f6 mov %esi,%esi 80101249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101250: 81 c3 90 00 00 00 add $0x90,%ebx 80101256: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 8010125c: 73 22 jae 80101280 <iget+0x60> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 8010125e: 8b 4b 08 mov 0x8(%ebx),%ecx 80101261: 85 c9 test %ecx,%ecx 80101263: 7e 04 jle 80101269 <iget+0x49> 80101265: 39 3b cmp %edi,(%ebx) 80101267: 74 4f je 801012b8 <iget+0x98> ip->ref++; release(&icache.lock); return ip; } if(empty == 0 && ip->ref == 0) // Remember empty slot. 80101269: 85 f6 test %esi,%esi 8010126b: 75 e3 jne 80101250 <iget+0x30> 8010126d: 85 c9 test %ecx,%ecx 8010126f: 0f 44 f3 cmove %ebx,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101272: 81 c3 90 00 00 00 add $0x90,%ebx 80101278: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 8010127e: 72 de jb 8010125e <iget+0x3e> empty = ip; } // Recycle an inode cache entry. if(empty == 0) 80101280: 85 f6 test %esi,%esi 80101282: 74 5b je 801012df <iget+0xbf> ip = empty; ip->dev = dev; ip->inum = inum; ip->ref = 1; ip->valid = 0; release(&icache.lock); 80101284: 83 ec 0c sub $0xc,%esp ip->dev = dev; 80101287: 89 3e mov %edi,(%esi) ip->inum = inum; 80101289: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 8010128c: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 80101293: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 8010129a: 68 e0 09 11 80 push $0x801109e0 8010129f: e8 9c 32 00 00 call 80104540 <release> return ip; 801012a4: 83 c4 10 add $0x10,%esp } 801012a7: 8d 65 f4 lea -0xc(%ebp),%esp 801012aa: 89 f0 mov %esi,%eax 801012ac: 5b pop %ebx 801012ad: 5e pop %esi 801012ae: 5f pop %edi 801012af: 5d pop %ebp 801012b0: c3 ret 801012b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 801012b8: 39 53 04 cmp %edx,0x4(%ebx) 801012bb: 75 ac jne 80101269 <iget+0x49> release(&icache.lock); 801012bd: 83 ec 0c sub $0xc,%esp ip->ref++; 801012c0: 83 c1 01 add $0x1,%ecx return ip; 801012c3: 89 de mov %ebx,%esi release(&icache.lock); 801012c5: 68 e0 09 11 80 push $0x801109e0 ip->ref++; 801012ca: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 801012cd: e8 6e 32 00 00 call 80104540 <release> return ip; 801012d2: 83 c4 10 add $0x10,%esp } 801012d5: 8d 65 f4 lea -0xc(%ebp),%esp 801012d8: 89 f0 mov %esi,%eax 801012da: 5b pop %ebx 801012db: 5e pop %esi 801012dc: 5f pop %edi 801012dd: 5d pop %ebp 801012de: c3 ret panic("iget: no inodes"); 801012df: 83 ec 0c sub $0xc,%esp 801012e2: 68 95 71 10 80 push $0x80107195 801012e7: e8 a4 f0 ff ff call 80100390 <panic> 801012ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801012f0 <bmap>: // Return the disk block address of the nth block in inode ip. // If there is no such block, bmap allocates one. static uint bmap(struct inode *ip, uint bn) { 801012f0: 55 push %ebp 801012f1: 89 e5 mov %esp,%ebp 801012f3: 57 push %edi 801012f4: 56 push %esi 801012f5: 53 push %ebx 801012f6: 89 c6 mov %eax,%esi 801012f8: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 801012fb: 83 fa 0b cmp $0xb,%edx 801012fe: 77 18 ja 80101318 <bmap+0x28> 80101300: 8d 3c 90 lea (%eax,%edx,4),%edi if((addr = ip->addrs[bn]) == 0) 80101303: 8b 5f 5c mov 0x5c(%edi),%ebx 80101306: 85 db test %ebx,%ebx 80101308: 74 76 je 80101380 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 8010130a: 8d 65 f4 lea -0xc(%ebp),%esp 8010130d: 89 d8 mov %ebx,%eax 8010130f: 5b pop %ebx 80101310: 5e pop %esi 80101311: 5f pop %edi 80101312: 5d pop %ebp 80101313: c3 ret 80101314: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bn -= NDIRECT; 80101318: 8d 5a f4 lea -0xc(%edx),%ebx if(bn < NINDIRECT){ 8010131b: 83 fb 7f cmp $0x7f,%ebx 8010131e: 0f 87 90 00 00 00 ja 801013b4 <bmap+0xc4> if((addr = ip->addrs[NDIRECT]) == 0) 80101324: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx 8010132a: 8b 00 mov (%eax),%eax 8010132c: 85 d2 test %edx,%edx 8010132e: 74 70 je 801013a0 <bmap+0xb0> bp = bread(ip->dev, addr); 80101330: 83 ec 08 sub $0x8,%esp 80101333: 52 push %edx 80101334: 50 push %eax 80101335: e8 96 ed ff ff call 801000d0 <bread> if((addr = a[bn]) == 0){ 8010133a: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx 8010133e: 83 c4 10 add $0x10,%esp bp = bread(ip->dev, addr); 80101341: 89 c7 mov %eax,%edi if((addr = a[bn]) == 0){ 80101343: 8b 1a mov (%edx),%ebx 80101345: 85 db test %ebx,%ebx 80101347: 75 1d jne 80101366 <bmap+0x76> a[bn] = addr = balloc(ip->dev); 80101349: 8b 06 mov (%esi),%eax 8010134b: 89 55 e4 mov %edx,-0x1c(%ebp) 8010134e: e8 bd fd ff ff call 80101110 <balloc> 80101353: 8b 55 e4 mov -0x1c(%ebp),%edx log_write(bp); 80101356: 83 ec 0c sub $0xc,%esp a[bn] = addr = balloc(ip->dev); 80101359: 89 c3 mov %eax,%ebx 8010135b: 89 02 mov %eax,(%edx) log_write(bp); 8010135d: 57 push %edi 8010135e: e8 2d 1b 00 00 call 80102e90 <log_write> 80101363: 83 c4 10 add $0x10,%esp brelse(bp); 80101366: 83 ec 0c sub $0xc,%esp 80101369: 57 push %edi 8010136a: e8 71 ee ff ff call 801001e0 <brelse> 8010136f: 83 c4 10 add $0x10,%esp } 80101372: 8d 65 f4 lea -0xc(%ebp),%esp 80101375: 89 d8 mov %ebx,%eax 80101377: 5b pop %ebx 80101378: 5e pop %esi 80101379: 5f pop %edi 8010137a: 5d pop %ebp 8010137b: c3 ret 8010137c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ip->addrs[bn] = addr = balloc(ip->dev); 80101380: 8b 00 mov (%eax),%eax 80101382: e8 89 fd ff ff call 80101110 <balloc> 80101387: 89 47 5c mov %eax,0x5c(%edi) } 8010138a: 8d 65 f4 lea -0xc(%ebp),%esp ip->addrs[bn] = addr = balloc(ip->dev); 8010138d: 89 c3 mov %eax,%ebx } 8010138f: 89 d8 mov %ebx,%eax 80101391: 5b pop %ebx 80101392: 5e pop %esi 80101393: 5f pop %edi 80101394: 5d pop %ebp 80101395: c3 ret 80101396: 8d 76 00 lea 0x0(%esi),%esi 80101399: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip->addrs[NDIRECT] = addr = balloc(ip->dev); 801013a0: e8 6b fd ff ff call 80101110 <balloc> 801013a5: 89 c2 mov %eax,%edx 801013a7: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 801013ad: 8b 06 mov (%esi),%eax 801013af: e9 7c ff ff ff jmp 80101330 <bmap+0x40> panic("bmap: out of range"); 801013b4: 83 ec 0c sub $0xc,%esp 801013b7: 68 a5 71 10 80 push $0x801071a5 801013bc: e8 cf ef ff ff call 80100390 <panic> 801013c1: eb 0d jmp 801013d0 <readsb> 801013c3: 90 nop 801013c4: 90 nop 801013c5: 90 nop 801013c6: 90 nop 801013c7: 90 nop 801013c8: 90 nop 801013c9: 90 nop 801013ca: 90 nop 801013cb: 90 nop 801013cc: 90 nop 801013cd: 90 nop 801013ce: 90 nop 801013cf: 90 nop 801013d0 <readsb>: { 801013d0: 55 push %ebp 801013d1: 89 e5 mov %esp,%ebp 801013d3: 56 push %esi 801013d4: 53 push %ebx 801013d5: 8b 75 0c mov 0xc(%ebp),%esi bp = bread(dev, 1); 801013d8: 83 ec 08 sub $0x8,%esp 801013db: 6a 01 push $0x1 801013dd: ff 75 08 pushl 0x8(%ebp) 801013e0: e8 eb ec ff ff call 801000d0 <bread> 801013e5: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 801013e7: 8d 40 5c lea 0x5c(%eax),%eax 801013ea: 83 c4 0c add $0xc,%esp 801013ed: 6a 1c push $0x1c 801013ef: 50 push %eax 801013f0: 56 push %esi 801013f1: e8 4a 32 00 00 call 80104640 <memmove> brelse(bp); 801013f6: 89 5d 08 mov %ebx,0x8(%ebp) 801013f9: 83 c4 10 add $0x10,%esp } 801013fc: 8d 65 f8 lea -0x8(%ebp),%esp 801013ff: 5b pop %ebx 80101400: 5e pop %esi 80101401: 5d pop %ebp brelse(bp); 80101402: e9 d9 ed ff ff jmp 801001e0 <brelse> 80101407: 89 f6 mov %esi,%esi 80101409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101410 <bfree>: { 80101410: 55 push %ebp 80101411: 89 e5 mov %esp,%ebp 80101413: 56 push %esi 80101414: 53 push %ebx 80101415: 89 d3 mov %edx,%ebx 80101417: 89 c6 mov %eax,%esi readsb(dev, &sb); 80101419: 83 ec 08 sub $0x8,%esp 8010141c: 68 c0 09 11 80 push $0x801109c0 80101421: 50 push %eax 80101422: e8 a9 ff ff ff call 801013d0 <readsb> bp = bread(dev, BBLOCK(b, sb)); 80101427: 58 pop %eax 80101428: 5a pop %edx 80101429: 89 da mov %ebx,%edx 8010142b: c1 ea 0c shr $0xc,%edx 8010142e: 03 15 d8 09 11 80 add 0x801109d8,%edx 80101434: 52 push %edx 80101435: 56 push %esi 80101436: e8 95 ec ff ff call 801000d0 <bread> m = 1 << (bi % 8); 8010143b: 89 d9 mov %ebx,%ecx if((bp->data[bi/8] & m) == 0) 8010143d: c1 fb 03 sar $0x3,%ebx m = 1 << (bi % 8); 80101440: ba 01 00 00 00 mov $0x1,%edx 80101445: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 80101448: 81 e3 ff 01 00 00 and $0x1ff,%ebx 8010144e: 83 c4 10 add $0x10,%esp m = 1 << (bi % 8); 80101451: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0) 80101453: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx 80101458: 85 d1 test %edx,%ecx 8010145a: 74 25 je 80101481 <bfree+0x71> bp->data[bi/8] &= ~m; 8010145c: f7 d2 not %edx 8010145e: 89 c6 mov %eax,%esi log_write(bp); 80101460: 83 ec 0c sub $0xc,%esp bp->data[bi/8] &= ~m; 80101463: 21 ca and %ecx,%edx 80101465: 88 54 1e 5c mov %dl,0x5c(%esi,%ebx,1) log_write(bp); 80101469: 56 push %esi 8010146a: e8 21 1a 00 00 call 80102e90 <log_write> brelse(bp); 8010146f: 89 34 24 mov %esi,(%esp) 80101472: e8 69 ed ff ff call 801001e0 <brelse> } 80101477: 83 c4 10 add $0x10,%esp 8010147a: 8d 65 f8 lea -0x8(%ebp),%esp 8010147d: 5b pop %ebx 8010147e: 5e pop %esi 8010147f: 5d pop %ebp 80101480: c3 ret panic("freeing free block"); 80101481: 83 ec 0c sub $0xc,%esp 80101484: 68 b8 71 10 80 push $0x801071b8 80101489: e8 02 ef ff ff call 80100390 <panic> 8010148e: 66 90 xchg %ax,%ax 80101490 <iinit>: { 80101490: 55 push %ebp 80101491: 89 e5 mov %esp,%ebp 80101493: 53 push %ebx 80101494: bb 20 0a 11 80 mov $0x80110a20,%ebx 80101499: 83 ec 0c sub $0xc,%esp initlock(&icache.lock, "icache"); 8010149c: 68 cb 71 10 80 push $0x801071cb 801014a1: 68 e0 09 11 80 push $0x801109e0 801014a6: e8 95 2e 00 00 call 80104340 <initlock> 801014ab: 83 c4 10 add $0x10,%esp 801014ae: 66 90 xchg %ax,%ax initsleeplock(&icache.inode[i].lock, "inode"); 801014b0: 83 ec 08 sub $0x8,%esp 801014b3: 68 d2 71 10 80 push $0x801071d2 801014b8: 53 push %ebx 801014b9: 81 c3 90 00 00 00 add $0x90,%ebx 801014bf: e8 4c 2d 00 00 call 80104210 <initsleeplock> for(i = 0; i < NINODE; i++) { 801014c4: 83 c4 10 add $0x10,%esp 801014c7: 81 fb 40 26 11 80 cmp $0x80112640,%ebx 801014cd: 75 e1 jne 801014b0 <iinit+0x20> readsb(dev, &sb); 801014cf: 83 ec 08 sub $0x8,%esp 801014d2: 68 c0 09 11 80 push $0x801109c0 801014d7: ff 75 08 pushl 0x8(%ebp) 801014da: e8 f1 fe ff ff call 801013d0 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 801014df: ff 35 d8 09 11 80 pushl 0x801109d8 801014e5: ff 35 d4 09 11 80 pushl 0x801109d4 801014eb: ff 35 d0 09 11 80 pushl 0x801109d0 801014f1: ff 35 cc 09 11 80 pushl 0x801109cc 801014f7: ff 35 c8 09 11 80 pushl 0x801109c8 801014fd: ff 35 c4 09 11 80 pushl 0x801109c4 80101503: ff 35 c0 09 11 80 pushl 0x801109c0 80101509: 68 54 72 10 80 push $0x80107254 8010150e: e8 4d f1 ff ff call 80100660 <cprintf> } 80101513: 83 c4 30 add $0x30,%esp 80101516: 8b 5d fc mov -0x4(%ebp),%ebx 80101519: c9 leave 8010151a: c3 ret 8010151b: 90 nop 8010151c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101520 <ialloc>: { 80101520: 55 push %ebp 80101521: 89 e5 mov %esp,%ebp 80101523: 57 push %edi 80101524: 56 push %esi 80101525: 53 push %ebx 80101526: 83 ec 1c sub $0x1c,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101529: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8 { 80101530: 8b 45 0c mov 0xc(%ebp),%eax 80101533: 8b 75 08 mov 0x8(%ebp),%esi 80101536: 89 45 e4 mov %eax,-0x1c(%ebp) for(inum = 1; inum < sb.ninodes; inum++){ 80101539: 0f 86 91 00 00 00 jbe 801015d0 <ialloc+0xb0> 8010153f: bb 01 00 00 00 mov $0x1,%ebx 80101544: eb 21 jmp 80101567 <ialloc+0x47> 80101546: 8d 76 00 lea 0x0(%esi),%esi 80101549: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi brelse(bp); 80101550: 83 ec 0c sub $0xc,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101553: 83 c3 01 add $0x1,%ebx brelse(bp); 80101556: 57 push %edi 80101557: e8 84 ec ff ff call 801001e0 <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 8010155c: 83 c4 10 add $0x10,%esp 8010155f: 39 1d c8 09 11 80 cmp %ebx,0x801109c8 80101565: 76 69 jbe 801015d0 <ialloc+0xb0> bp = bread(dev, IBLOCK(inum, sb)); 80101567: 89 d8 mov %ebx,%eax 80101569: 83 ec 08 sub $0x8,%esp 8010156c: c1 e8 03 shr $0x3,%eax 8010156f: 03 05 d4 09 11 80 add 0x801109d4,%eax 80101575: 50 push %eax 80101576: 56 push %esi 80101577: e8 54 eb ff ff call 801000d0 <bread> 8010157c: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum%IPB; 8010157e: 89 d8 mov %ebx,%eax if(dip->type == 0){ // a free inode 80101580: 83 c4 10 add $0x10,%esp dip = (struct dinode*)bp->data + inum%IPB; 80101583: 83 e0 07 and $0x7,%eax 80101586: c1 e0 06 shl $0x6,%eax 80101589: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if(dip->type == 0){ // a free inode 8010158d: 66 83 39 00 cmpw $0x0,(%ecx) 80101591: 75 bd jne 80101550 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80101593: 83 ec 04 sub $0x4,%esp 80101596: 89 4d e0 mov %ecx,-0x20(%ebp) 80101599: 6a 40 push $0x40 8010159b: 6a 00 push $0x0 8010159d: 51 push %ecx 8010159e: e8 ed 2f 00 00 call 80104590 <memset> dip->type = type; 801015a3: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax 801015a7: 8b 4d e0 mov -0x20(%ebp),%ecx 801015aa: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 801015ad: 89 3c 24 mov %edi,(%esp) 801015b0: e8 db 18 00 00 call 80102e90 <log_write> brelse(bp); 801015b5: 89 3c 24 mov %edi,(%esp) 801015b8: e8 23 ec ff ff call 801001e0 <brelse> return iget(dev, inum); 801015bd: 83 c4 10 add $0x10,%esp } 801015c0: 8d 65 f4 lea -0xc(%ebp),%esp return iget(dev, inum); 801015c3: 89 da mov %ebx,%edx 801015c5: 89 f0 mov %esi,%eax } 801015c7: 5b pop %ebx 801015c8: 5e pop %esi 801015c9: 5f pop %edi 801015ca: 5d pop %ebp return iget(dev, inum); 801015cb: e9 50 fc ff ff jmp 80101220 <iget> panic("ialloc: no inodes"); 801015d0: 83 ec 0c sub $0xc,%esp 801015d3: 68 d8 71 10 80 push $0x801071d8 801015d8: e8 b3 ed ff ff call 80100390 <panic> 801015dd: 8d 76 00 lea 0x0(%esi),%esi 801015e0 <iupdate>: { 801015e0: 55 push %ebp 801015e1: 89 e5 mov %esp,%ebp 801015e3: 56 push %esi 801015e4: 53 push %ebx 801015e5: 8b 5d 08 mov 0x8(%ebp),%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015e8: 83 ec 08 sub $0x8,%esp 801015eb: 8b 43 04 mov 0x4(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015ee: 83 c3 5c add $0x5c,%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015f1: c1 e8 03 shr $0x3,%eax 801015f4: 03 05 d4 09 11 80 add 0x801109d4,%eax 801015fa: 50 push %eax 801015fb: ff 73 a4 pushl -0x5c(%ebx) 801015fe: e8 cd ea ff ff call 801000d0 <bread> 80101603: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 80101605: 8b 43 a8 mov -0x58(%ebx),%eax dip->type = ip->type; 80101608: 0f b7 53 f4 movzwl -0xc(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010160c: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 8010160f: 83 e0 07 and $0x7,%eax 80101612: c1 e0 06 shl $0x6,%eax 80101615: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 80101619: 66 89 10 mov %dx,(%eax) dip->major = ip->major; 8010161c: 0f b7 53 f6 movzwl -0xa(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101620: 83 c0 0c add $0xc,%eax dip->major = ip->major; 80101623: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 80101627: 0f b7 53 f8 movzwl -0x8(%ebx),%edx 8010162b: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 8010162f: 0f b7 53 fa movzwl -0x6(%ebx),%edx 80101633: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 80101637: 8b 53 fc mov -0x4(%ebx),%edx 8010163a: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010163d: 6a 34 push $0x34 8010163f: 53 push %ebx 80101640: 50 push %eax 80101641: e8 fa 2f 00 00 call 80104640 <memmove> log_write(bp); 80101646: 89 34 24 mov %esi,(%esp) 80101649: e8 42 18 00 00 call 80102e90 <log_write> brelse(bp); 8010164e: 89 75 08 mov %esi,0x8(%ebp) 80101651: 83 c4 10 add $0x10,%esp } 80101654: 8d 65 f8 lea -0x8(%ebp),%esp 80101657: 5b pop %ebx 80101658: 5e pop %esi 80101659: 5d pop %ebp brelse(bp); 8010165a: e9 81 eb ff ff jmp 801001e0 <brelse> 8010165f: 90 nop 80101660 <idup>: { 80101660: 55 push %ebp 80101661: 89 e5 mov %esp,%ebp 80101663: 53 push %ebx 80101664: 83 ec 10 sub $0x10,%esp 80101667: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010166a: 68 e0 09 11 80 push $0x801109e0 8010166f: e8 0c 2e 00 00 call 80104480 <acquire> ip->ref++; 80101674: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80101678: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010167f: e8 bc 2e 00 00 call 80104540 <release> } 80101684: 89 d8 mov %ebx,%eax 80101686: 8b 5d fc mov -0x4(%ebp),%ebx 80101689: c9 leave 8010168a: c3 ret 8010168b: 90 nop 8010168c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101690 <ilock>: { 80101690: 55 push %ebp 80101691: 89 e5 mov %esp,%ebp 80101693: 56 push %esi 80101694: 53 push %ebx 80101695: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || ip->ref < 1) 80101698: 85 db test %ebx,%ebx 8010169a: 0f 84 b7 00 00 00 je 80101757 <ilock+0xc7> 801016a0: 8b 53 08 mov 0x8(%ebx),%edx 801016a3: 85 d2 test %edx,%edx 801016a5: 0f 8e ac 00 00 00 jle 80101757 <ilock+0xc7> acquiresleep(&ip->lock); 801016ab: 8d 43 0c lea 0xc(%ebx),%eax 801016ae: 83 ec 0c sub $0xc,%esp 801016b1: 50 push %eax 801016b2: e8 99 2b 00 00 call 80104250 <acquiresleep> if(ip->valid == 0){ 801016b7: 8b 43 4c mov 0x4c(%ebx),%eax 801016ba: 83 c4 10 add $0x10,%esp 801016bd: 85 c0 test %eax,%eax 801016bf: 74 0f je 801016d0 <ilock+0x40> } 801016c1: 8d 65 f8 lea -0x8(%ebp),%esp 801016c4: 5b pop %ebx 801016c5: 5e pop %esi 801016c6: 5d pop %ebp 801016c7: c3 ret 801016c8: 90 nop 801016c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016d0: 8b 43 04 mov 0x4(%ebx),%eax 801016d3: 83 ec 08 sub $0x8,%esp 801016d6: c1 e8 03 shr $0x3,%eax 801016d9: 03 05 d4 09 11 80 add 0x801109d4,%eax 801016df: 50 push %eax 801016e0: ff 33 pushl (%ebx) 801016e2: e8 e9 e9 ff ff call 801000d0 <bread> 801016e7: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801016e9: 8b 43 04 mov 0x4(%ebx),%eax memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016ec: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 801016ef: 83 e0 07 and $0x7,%eax 801016f2: c1 e0 06 shl $0x6,%eax 801016f5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 801016f9: 0f b7 10 movzwl (%eax),%edx memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016fc: 83 c0 0c add $0xc,%eax ip->type = dip->type; 801016ff: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 80101703: 0f b7 50 f6 movzwl -0xa(%eax),%edx 80101707: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 8010170b: 0f b7 50 f8 movzwl -0x8(%eax),%edx 8010170f: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 80101713: 0f b7 50 fa movzwl -0x6(%eax),%edx 80101717: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 8010171b: 8b 50 fc mov -0x4(%eax),%edx 8010171e: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101721: 6a 34 push $0x34 80101723: 50 push %eax 80101724: 8d 43 5c lea 0x5c(%ebx),%eax 80101727: 50 push %eax 80101728: e8 13 2f 00 00 call 80104640 <memmove> brelse(bp); 8010172d: 89 34 24 mov %esi,(%esp) 80101730: e8 ab ea ff ff call 801001e0 <brelse> if(ip->type == 0) 80101735: 83 c4 10 add $0x10,%esp 80101738: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->valid = 1; 8010173d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 80101744: 0f 85 77 ff ff ff jne 801016c1 <ilock+0x31> panic("ilock: no type"); 8010174a: 83 ec 0c sub $0xc,%esp 8010174d: 68 f0 71 10 80 push $0x801071f0 80101752: e8 39 ec ff ff call 80100390 <panic> panic("ilock"); 80101757: 83 ec 0c sub $0xc,%esp 8010175a: 68 ea 71 10 80 push $0x801071ea 8010175f: e8 2c ec ff ff call 80100390 <panic> 80101764: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010176a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101770 <iunlock>: { 80101770: 55 push %ebp 80101771: 89 e5 mov %esp,%ebp 80101773: 56 push %esi 80101774: 53 push %ebx 80101775: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80101778: 85 db test %ebx,%ebx 8010177a: 74 28 je 801017a4 <iunlock+0x34> 8010177c: 8d 73 0c lea 0xc(%ebx),%esi 8010177f: 83 ec 0c sub $0xc,%esp 80101782: 56 push %esi 80101783: e8 68 2b 00 00 call 801042f0 <holdingsleep> 80101788: 83 c4 10 add $0x10,%esp 8010178b: 85 c0 test %eax,%eax 8010178d: 74 15 je 801017a4 <iunlock+0x34> 8010178f: 8b 43 08 mov 0x8(%ebx),%eax 80101792: 85 c0 test %eax,%eax 80101794: 7e 0e jle 801017a4 <iunlock+0x34> releasesleep(&ip->lock); 80101796: 89 75 08 mov %esi,0x8(%ebp) } 80101799: 8d 65 f8 lea -0x8(%ebp),%esp 8010179c: 5b pop %ebx 8010179d: 5e pop %esi 8010179e: 5d pop %ebp releasesleep(&ip->lock); 8010179f: e9 0c 2b 00 00 jmp 801042b0 <releasesleep> panic("iunlock"); 801017a4: 83 ec 0c sub $0xc,%esp 801017a7: 68 ff 71 10 80 push $0x801071ff 801017ac: e8 df eb ff ff call 80100390 <panic> 801017b1: eb 0d jmp 801017c0 <iput> 801017b3: 90 nop 801017b4: 90 nop 801017b5: 90 nop 801017b6: 90 nop 801017b7: 90 nop 801017b8: 90 nop 801017b9: 90 nop 801017ba: 90 nop 801017bb: 90 nop 801017bc: 90 nop 801017bd: 90 nop 801017be: 90 nop 801017bf: 90 nop 801017c0 <iput>: { 801017c0: 55 push %ebp 801017c1: 89 e5 mov %esp,%ebp 801017c3: 57 push %edi 801017c4: 56 push %esi 801017c5: 53 push %ebx 801017c6: 83 ec 28 sub $0x28,%esp 801017c9: 8b 5d 08 mov 0x8(%ebp),%ebx acquiresleep(&ip->lock); 801017cc: 8d 7b 0c lea 0xc(%ebx),%edi 801017cf: 57 push %edi 801017d0: e8 7b 2a 00 00 call 80104250 <acquiresleep> if(ip->valid && ip->nlink == 0){ 801017d5: 8b 53 4c mov 0x4c(%ebx),%edx 801017d8: 83 c4 10 add $0x10,%esp 801017db: 85 d2 test %edx,%edx 801017dd: 74 07 je 801017e6 <iput+0x26> 801017df: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 801017e4: 74 32 je 80101818 <iput+0x58> releasesleep(&ip->lock); 801017e6: 83 ec 0c sub $0xc,%esp 801017e9: 57 push %edi 801017ea: e8 c1 2a 00 00 call 801042b0 <releasesleep> acquire(&icache.lock); 801017ef: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 801017f6: e8 85 2c 00 00 call 80104480 <acquire> ip->ref--; 801017fb: 83 6b 08 01 subl $0x1,0x8(%ebx) release(&icache.lock); 801017ff: 83 c4 10 add $0x10,%esp 80101802: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp) } 80101809: 8d 65 f4 lea -0xc(%ebp),%esp 8010180c: 5b pop %ebx 8010180d: 5e pop %esi 8010180e: 5f pop %edi 8010180f: 5d pop %ebp release(&icache.lock); 80101810: e9 2b 2d 00 00 jmp 80104540 <release> 80101815: 8d 76 00 lea 0x0(%esi),%esi acquire(&icache.lock); 80101818: 83 ec 0c sub $0xc,%esp 8010181b: 68 e0 09 11 80 push $0x801109e0 80101820: e8 5b 2c 00 00 call 80104480 <acquire> int r = ip->ref; 80101825: 8b 73 08 mov 0x8(%ebx),%esi release(&icache.lock); 80101828: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010182f: e8 0c 2d 00 00 call 80104540 <release> if(r == 1){ 80101834: 83 c4 10 add $0x10,%esp 80101837: 83 fe 01 cmp $0x1,%esi 8010183a: 75 aa jne 801017e6 <iput+0x26> 8010183c: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx 80101842: 89 7d e4 mov %edi,-0x1c(%ebp) 80101845: 8d 73 5c lea 0x5c(%ebx),%esi 80101848: 89 cf mov %ecx,%edi 8010184a: eb 0b jmp 80101857 <iput+0x97> 8010184c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101850: 83 c6 04 add $0x4,%esi { int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80101853: 39 fe cmp %edi,%esi 80101855: 74 19 je 80101870 <iput+0xb0> if(ip->addrs[i]){ 80101857: 8b 16 mov (%esi),%edx 80101859: 85 d2 test %edx,%edx 8010185b: 74 f3 je 80101850 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 8010185d: 8b 03 mov (%ebx),%eax 8010185f: e8 ac fb ff ff call 80101410 <bfree> ip->addrs[i] = 0; 80101864: c7 06 00 00 00 00 movl $0x0,(%esi) 8010186a: eb e4 jmp 80101850 <iput+0x90> 8010186c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } if(ip->addrs[NDIRECT]){ 80101870: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 80101876: 8b 7d e4 mov -0x1c(%ebp),%edi 80101879: 85 c0 test %eax,%eax 8010187b: 75 33 jne 801018b0 <iput+0xf0> bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; iupdate(ip); 8010187d: 83 ec 0c sub $0xc,%esp ip->size = 0; 80101880: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) iupdate(ip); 80101887: 53 push %ebx 80101888: e8 53 fd ff ff call 801015e0 <iupdate> ip->type = 0; 8010188d: 31 c0 xor %eax,%eax 8010188f: 66 89 43 50 mov %ax,0x50(%ebx) iupdate(ip); 80101893: 89 1c 24 mov %ebx,(%esp) 80101896: e8 45 fd ff ff call 801015e0 <iupdate> ip->valid = 0; 8010189b: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx) 801018a2: 83 c4 10 add $0x10,%esp 801018a5: e9 3c ff ff ff jmp 801017e6 <iput+0x26> 801018aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bp = bread(ip->dev, ip->addrs[NDIRECT]); 801018b0: 83 ec 08 sub $0x8,%esp 801018b3: 50 push %eax 801018b4: ff 33 pushl (%ebx) 801018b6: e8 15 e8 ff ff call 801000d0 <bread> 801018bb: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 801018c1: 89 7d e0 mov %edi,-0x20(%ebp) 801018c4: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 801018c7: 8d 70 5c lea 0x5c(%eax),%esi 801018ca: 83 c4 10 add $0x10,%esp 801018cd: 89 cf mov %ecx,%edi 801018cf: eb 0e jmp 801018df <iput+0x11f> 801018d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801018d8: 83 c6 04 add $0x4,%esi for(j = 0; j < NINDIRECT; j++){ 801018db: 39 fe cmp %edi,%esi 801018dd: 74 0f je 801018ee <iput+0x12e> if(a[j]) 801018df: 8b 16 mov (%esi),%edx 801018e1: 85 d2 test %edx,%edx 801018e3: 74 f3 je 801018d8 <iput+0x118> bfree(ip->dev, a[j]); 801018e5: 8b 03 mov (%ebx),%eax 801018e7: e8 24 fb ff ff call 80101410 <bfree> 801018ec: eb ea jmp 801018d8 <iput+0x118> brelse(bp); 801018ee: 83 ec 0c sub $0xc,%esp 801018f1: ff 75 e4 pushl -0x1c(%ebp) 801018f4: 8b 7d e0 mov -0x20(%ebp),%edi 801018f7: e8 e4 e8 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801018fc: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx 80101902: 8b 03 mov (%ebx),%eax 80101904: e8 07 fb ff ff call 80101410 <bfree> ip->addrs[NDIRECT] = 0; 80101909: c7 83 8c 00 00 00 00 movl $0x0,0x8c(%ebx) 80101910: 00 00 00 80101913: 83 c4 10 add $0x10,%esp 80101916: e9 62 ff ff ff jmp 8010187d <iput+0xbd> 8010191b: 90 nop 8010191c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101920 <iunlockput>: { 80101920: 55 push %ebp 80101921: 89 e5 mov %esp,%ebp 80101923: 53 push %ebx 80101924: 83 ec 10 sub $0x10,%esp 80101927: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010192a: 53 push %ebx 8010192b: e8 40 fe ff ff call 80101770 <iunlock> iput(ip); 80101930: 89 5d 08 mov %ebx,0x8(%ebp) 80101933: 83 c4 10 add $0x10,%esp } 80101936: 8b 5d fc mov -0x4(%ebp),%ebx 80101939: c9 leave iput(ip); 8010193a: e9 81 fe ff ff jmp 801017c0 <iput> 8010193f: 90 nop 80101940 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80101940: 55 push %ebp 80101941: 89 e5 mov %esp,%ebp 80101943: 8b 55 08 mov 0x8(%ebp),%edx 80101946: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80101949: 8b 0a mov (%edx),%ecx 8010194b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010194e: 8b 4a 04 mov 0x4(%edx),%ecx 80101951: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80101954: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80101958: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010195b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010195f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80101963: 8b 52 58 mov 0x58(%edx),%edx 80101966: 89 50 10 mov %edx,0x10(%eax) } 80101969: 5d pop %ebp 8010196a: c3 ret 8010196b: 90 nop 8010196c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101970 <readi>: //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101970: 55 push %ebp 80101971: 89 e5 mov %esp,%ebp 80101973: 57 push %edi 80101974: 56 push %esi 80101975: 53 push %ebx 80101976: 83 ec 1c sub $0x1c,%esp 80101979: 8b 45 08 mov 0x8(%ebp),%eax 8010197c: 8b 75 0c mov 0xc(%ebp),%esi 8010197f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101982: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101987: 89 75 e0 mov %esi,-0x20(%ebp) 8010198a: 89 45 d8 mov %eax,-0x28(%ebp) 8010198d: 8b 75 10 mov 0x10(%ebp),%esi 80101990: 89 7d e4 mov %edi,-0x1c(%ebp) if(ip->type == T_DEV){ 80101993: 0f 84 a7 00 00 00 je 80101a40 <readi+0xd0> if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) return -1; return devsw[ip->major].read(ip, dst, n); } if(off > ip->size || off + n < off) 80101999: 8b 45 d8 mov -0x28(%ebp),%eax 8010199c: 8b 40 58 mov 0x58(%eax),%eax 8010199f: 39 c6 cmp %eax,%esi 801019a1: 0f 87 ba 00 00 00 ja 80101a61 <readi+0xf1> 801019a7: 8b 7d e4 mov -0x1c(%ebp),%edi 801019aa: 89 f9 mov %edi,%ecx 801019ac: 01 f1 add %esi,%ecx 801019ae: 0f 82 ad 00 00 00 jb 80101a61 <readi+0xf1> return -1; if(off + n > ip->size) n = ip->size - off; 801019b4: 89 c2 mov %eax,%edx 801019b6: 29 f2 sub %esi,%edx 801019b8: 39 c8 cmp %ecx,%eax 801019ba: 0f 43 d7 cmovae %edi,%edx for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019bd: 31 ff xor %edi,%edi 801019bf: 85 d2 test %edx,%edx n = ip->size - off; 801019c1: 89 55 e4 mov %edx,-0x1c(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019c4: 74 6c je 80101a32 <readi+0xc2> 801019c6: 8d 76 00 lea 0x0(%esi),%esi 801019c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019d0: 8b 5d d8 mov -0x28(%ebp),%ebx 801019d3: 89 f2 mov %esi,%edx 801019d5: c1 ea 09 shr $0x9,%edx 801019d8: 89 d8 mov %ebx,%eax 801019da: e8 11 f9 ff ff call 801012f0 <bmap> 801019df: 83 ec 08 sub $0x8,%esp 801019e2: 50 push %eax 801019e3: ff 33 pushl (%ebx) 801019e5: e8 e6 e6 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 801019ea: 8b 5d e4 mov -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019ed: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 801019ef: 89 f0 mov %esi,%eax 801019f1: 25 ff 01 00 00 and $0x1ff,%eax 801019f6: b9 00 02 00 00 mov $0x200,%ecx 801019fb: 83 c4 0c add $0xc,%esp 801019fe: 29 c1 sub %eax,%ecx memmove(dst, bp->data + off%BSIZE, m); 80101a00: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax 80101a04: 89 55 dc mov %edx,-0x24(%ebp) m = min(n - tot, BSIZE - off%BSIZE); 80101a07: 29 fb sub %edi,%ebx 80101a09: 39 d9 cmp %ebx,%ecx 80101a0b: 0f 46 d9 cmovbe %ecx,%ebx memmove(dst, bp->data + off%BSIZE, m); 80101a0e: 53 push %ebx 80101a0f: 50 push %eax for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a10: 01 df add %ebx,%edi memmove(dst, bp->data + off%BSIZE, m); 80101a12: ff 75 e0 pushl -0x20(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a15: 01 de add %ebx,%esi memmove(dst, bp->data + off%BSIZE, m); 80101a17: e8 24 2c 00 00 call 80104640 <memmove> brelse(bp); 80101a1c: 8b 55 dc mov -0x24(%ebp),%edx 80101a1f: 89 14 24 mov %edx,(%esp) 80101a22: e8 b9 e7 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a27: 01 5d e0 add %ebx,-0x20(%ebp) 80101a2a: 83 c4 10 add $0x10,%esp 80101a2d: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101a30: 77 9e ja 801019d0 <readi+0x60> } return n; 80101a32: 8b 45 e4 mov -0x1c(%ebp),%eax } 80101a35: 8d 65 f4 lea -0xc(%ebp),%esp 80101a38: 5b pop %ebx 80101a39: 5e pop %esi 80101a3a: 5f pop %edi 80101a3b: 5d pop %ebp 80101a3c: c3 ret 80101a3d: 8d 76 00 lea 0x0(%esi),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101a40: 0f bf 40 52 movswl 0x52(%eax),%eax 80101a44: 66 83 f8 09 cmp $0x9,%ax 80101a48: 77 17 ja 80101a61 <readi+0xf1> 80101a4a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax 80101a51: 85 c0 test %eax,%eax 80101a53: 74 0c je 80101a61 <readi+0xf1> return devsw[ip->major].read(ip, dst, n); 80101a55: 89 7d 10 mov %edi,0x10(%ebp) } 80101a58: 8d 65 f4 lea -0xc(%ebp),%esp 80101a5b: 5b pop %ebx 80101a5c: 5e pop %esi 80101a5d: 5f pop %edi 80101a5e: 5d pop %ebp return devsw[ip->major].read(ip, dst, n); 80101a5f: ff e0 jmp *%eax return -1; 80101a61: b8 ff ff ff ff mov $0xffffffff,%eax 80101a66: eb cd jmp 80101a35 <readi+0xc5> 80101a68: 90 nop 80101a69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101a70 <writei>: // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a70: 55 push %ebp 80101a71: 89 e5 mov %esp,%ebp 80101a73: 57 push %edi 80101a74: 56 push %esi 80101a75: 53 push %ebx 80101a76: 83 ec 1c sub $0x1c,%esp 80101a79: 8b 45 08 mov 0x8(%ebp),%eax 80101a7c: 8b 75 0c mov 0xc(%ebp),%esi 80101a7f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a82: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101a87: 89 75 dc mov %esi,-0x24(%ebp) 80101a8a: 89 45 d8 mov %eax,-0x28(%ebp) 80101a8d: 8b 75 10 mov 0x10(%ebp),%esi 80101a90: 89 7d e0 mov %edi,-0x20(%ebp) if(ip->type == T_DEV){ 80101a93: 0f 84 b7 00 00 00 je 80101b50 <writei+0xe0> if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) return -1; return devsw[ip->major].write(ip, src, n); } if(off > ip->size || off + n < off) 80101a99: 8b 45 d8 mov -0x28(%ebp),%eax 80101a9c: 39 70 58 cmp %esi,0x58(%eax) 80101a9f: 0f 82 eb 00 00 00 jb 80101b90 <writei+0x120> 80101aa5: 8b 7d e0 mov -0x20(%ebp),%edi 80101aa8: 31 d2 xor %edx,%edx 80101aaa: 89 f8 mov %edi,%eax 80101aac: 01 f0 add %esi,%eax 80101aae: 0f 92 c2 setb %dl return -1; if(off + n > MAXFILE*BSIZE) 80101ab1: 3d 00 18 01 00 cmp $0x11800,%eax 80101ab6: 0f 87 d4 00 00 00 ja 80101b90 <writei+0x120> 80101abc: 85 d2 test %edx,%edx 80101abe: 0f 85 cc 00 00 00 jne 80101b90 <writei+0x120> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101ac4: 85 ff test %edi,%edi 80101ac6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101acd: 74 72 je 80101b41 <writei+0xd1> 80101acf: 90 nop bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ad0: 8b 7d d8 mov -0x28(%ebp),%edi 80101ad3: 89 f2 mov %esi,%edx 80101ad5: c1 ea 09 shr $0x9,%edx 80101ad8: 89 f8 mov %edi,%eax 80101ada: e8 11 f8 ff ff call 801012f0 <bmap> 80101adf: 83 ec 08 sub $0x8,%esp 80101ae2: 50 push %eax 80101ae3: ff 37 pushl (%edi) 80101ae5: e8 e6 e5 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 80101aea: 8b 5d e0 mov -0x20(%ebp),%ebx 80101aed: 2b 5d e4 sub -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101af0: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off%BSIZE); 80101af2: 89 f0 mov %esi,%eax 80101af4: b9 00 02 00 00 mov $0x200,%ecx 80101af9: 83 c4 0c add $0xc,%esp 80101afc: 25 ff 01 00 00 and $0x1ff,%eax 80101b01: 29 c1 sub %eax,%ecx memmove(bp->data + off%BSIZE, src, m); 80101b03: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax m = min(n - tot, BSIZE - off%BSIZE); 80101b07: 39 d9 cmp %ebx,%ecx 80101b09: 0f 46 d9 cmovbe %ecx,%ebx memmove(bp->data + off%BSIZE, src, m); 80101b0c: 53 push %ebx 80101b0d: ff 75 dc pushl -0x24(%ebp) for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b10: 01 de add %ebx,%esi memmove(bp->data + off%BSIZE, src, m); 80101b12: 50 push %eax 80101b13: e8 28 2b 00 00 call 80104640 <memmove> log_write(bp); 80101b18: 89 3c 24 mov %edi,(%esp) 80101b1b: e8 70 13 00 00 call 80102e90 <log_write> brelse(bp); 80101b20: 89 3c 24 mov %edi,(%esp) 80101b23: e8 b8 e6 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b28: 01 5d e4 add %ebx,-0x1c(%ebp) 80101b2b: 01 5d dc add %ebx,-0x24(%ebp) 80101b2e: 83 c4 10 add $0x10,%esp 80101b31: 8b 45 e4 mov -0x1c(%ebp),%eax 80101b34: 39 45 e0 cmp %eax,-0x20(%ebp) 80101b37: 77 97 ja 80101ad0 <writei+0x60> } if(n > 0 && off > ip->size){ 80101b39: 8b 45 d8 mov -0x28(%ebp),%eax 80101b3c: 3b 70 58 cmp 0x58(%eax),%esi 80101b3f: 77 37 ja 80101b78 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80101b41: 8b 45 e0 mov -0x20(%ebp),%eax } 80101b44: 8d 65 f4 lea -0xc(%ebp),%esp 80101b47: 5b pop %ebx 80101b48: 5e pop %esi 80101b49: 5f pop %edi 80101b4a: 5d pop %ebp 80101b4b: c3 ret 80101b4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101b50: 0f bf 40 52 movswl 0x52(%eax),%eax 80101b54: 66 83 f8 09 cmp $0x9,%ax 80101b58: 77 36 ja 80101b90 <writei+0x120> 80101b5a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax 80101b61: 85 c0 test %eax,%eax 80101b63: 74 2b je 80101b90 <writei+0x120> return devsw[ip->major].write(ip, src, n); 80101b65: 89 7d 10 mov %edi,0x10(%ebp) } 80101b68: 8d 65 f4 lea -0xc(%ebp),%esp 80101b6b: 5b pop %ebx 80101b6c: 5e pop %esi 80101b6d: 5f pop %edi 80101b6e: 5d pop %ebp return devsw[ip->major].write(ip, src, n); 80101b6f: ff e0 jmp *%eax 80101b71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ip->size = off; 80101b78: 8b 45 d8 mov -0x28(%ebp),%eax iupdate(ip); 80101b7b: 83 ec 0c sub $0xc,%esp ip->size = off; 80101b7e: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80101b81: 50 push %eax 80101b82: e8 59 fa ff ff call 801015e0 <iupdate> 80101b87: 83 c4 10 add $0x10,%esp 80101b8a: eb b5 jmp 80101b41 <writei+0xd1> 80101b8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80101b90: b8 ff ff ff ff mov $0xffffffff,%eax 80101b95: eb ad jmp 80101b44 <writei+0xd4> 80101b97: 89 f6 mov %esi,%esi 80101b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ba0 <namecmp>: //PAGEBREAK! // Directories int namecmp(const char *s, const char *t) { 80101ba0: 55 push %ebp 80101ba1: 89 e5 mov %esp,%ebp 80101ba3: 83 ec 0c sub $0xc,%esp return strncmp(s, t, DIRSIZ); 80101ba6: 6a 0e push $0xe 80101ba8: ff 75 0c pushl 0xc(%ebp) 80101bab: ff 75 08 pushl 0x8(%ebp) 80101bae: e8 fd 2a 00 00 call 801046b0 <strncmp> } 80101bb3: c9 leave 80101bb4: c3 ret 80101bb5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101bb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101bc0 <dirlookup>: // Look for a directory entry in a directory. // If found, set *poff to byte offset of entry. struct inode* dirlookup(struct inode *dp, char *name, uint *poff) { 80101bc0: 55 push %ebp 80101bc1: 89 e5 mov %esp,%ebp 80101bc3: 57 push %edi 80101bc4: 56 push %esi 80101bc5: 53 push %ebx 80101bc6: 83 ec 1c sub $0x1c,%esp 80101bc9: 8b 5d 08 mov 0x8(%ebp),%ebx uint off, inum; struct dirent de; if(dp->type != T_DIR) 80101bcc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80101bd1: 0f 85 85 00 00 00 jne 80101c5c <dirlookup+0x9c> panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 80101bd7: 8b 53 58 mov 0x58(%ebx),%edx 80101bda: 31 ff xor %edi,%edi 80101bdc: 8d 75 d8 lea -0x28(%ebp),%esi 80101bdf: 85 d2 test %edx,%edx 80101be1: 74 3e je 80101c21 <dirlookup+0x61> 80101be3: 90 nop 80101be4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101be8: 6a 10 push $0x10 80101bea: 57 push %edi 80101beb: 56 push %esi 80101bec: 53 push %ebx 80101bed: e8 7e fd ff ff call 80101970 <readi> 80101bf2: 83 c4 10 add $0x10,%esp 80101bf5: 83 f8 10 cmp $0x10,%eax 80101bf8: 75 55 jne 80101c4f <dirlookup+0x8f> panic("dirlookup read"); if(de.inum == 0) 80101bfa: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101bff: 74 18 je 80101c19 <dirlookup+0x59> return strncmp(s, t, DIRSIZ); 80101c01: 8d 45 da lea -0x26(%ebp),%eax 80101c04: 83 ec 04 sub $0x4,%esp 80101c07: 6a 0e push $0xe 80101c09: 50 push %eax 80101c0a: ff 75 0c pushl 0xc(%ebp) 80101c0d: e8 9e 2a 00 00 call 801046b0 <strncmp> continue; if(namecmp(name, de.name) == 0){ 80101c12: 83 c4 10 add $0x10,%esp 80101c15: 85 c0 test %eax,%eax 80101c17: 74 17 je 80101c30 <dirlookup+0x70> for(off = 0; off < dp->size; off += sizeof(de)){ 80101c19: 83 c7 10 add $0x10,%edi 80101c1c: 3b 7b 58 cmp 0x58(%ebx),%edi 80101c1f: 72 c7 jb 80101be8 <dirlookup+0x28> return iget(dp->dev, inum); } } return 0; } 80101c21: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80101c24: 31 c0 xor %eax,%eax } 80101c26: 5b pop %ebx 80101c27: 5e pop %esi 80101c28: 5f pop %edi 80101c29: 5d pop %ebp 80101c2a: c3 ret 80101c2b: 90 nop 80101c2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(poff) 80101c30: 8b 45 10 mov 0x10(%ebp),%eax 80101c33: 85 c0 test %eax,%eax 80101c35: 74 05 je 80101c3c <dirlookup+0x7c> *poff = off; 80101c37: 8b 45 10 mov 0x10(%ebp),%eax 80101c3a: 89 38 mov %edi,(%eax) inum = de.inum; 80101c3c: 0f b7 55 d8 movzwl -0x28(%ebp),%edx return iget(dp->dev, inum); 80101c40: 8b 03 mov (%ebx),%eax 80101c42: e8 d9 f5 ff ff call 80101220 <iget> } 80101c47: 8d 65 f4 lea -0xc(%ebp),%esp 80101c4a: 5b pop %ebx 80101c4b: 5e pop %esi 80101c4c: 5f pop %edi 80101c4d: 5d pop %ebp 80101c4e: c3 ret panic("dirlookup read"); 80101c4f: 83 ec 0c sub $0xc,%esp 80101c52: 68 19 72 10 80 push $0x80107219 80101c57: e8 34 e7 ff ff call 80100390 <panic> panic("dirlookup not DIR"); 80101c5c: 83 ec 0c sub $0xc,%esp 80101c5f: 68 07 72 10 80 push $0x80107207 80101c64: e8 27 e7 ff ff call 80100390 <panic> 80101c69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101c70 <namex>: // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80101c70: 55 push %ebp 80101c71: 89 e5 mov %esp,%ebp 80101c73: 57 push %edi 80101c74: 56 push %esi 80101c75: 53 push %ebx 80101c76: 89 cf mov %ecx,%edi 80101c78: 89 c3 mov %eax,%ebx 80101c7a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if(*path == '/') 80101c7d: 80 38 2f cmpb $0x2f,(%eax) { 80101c80: 89 55 e0 mov %edx,-0x20(%ebp) if(*path == '/') 80101c83: 0f 84 67 01 00 00 je 80101df0 <namex+0x180> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c89: e8 72 1c 00 00 call 80103900 <myproc> acquire(&icache.lock); 80101c8e: 83 ec 0c sub $0xc,%esp ip = idup(myproc()->cwd); 80101c91: 8b 70 68 mov 0x68(%eax),%esi acquire(&icache.lock); 80101c94: 68 e0 09 11 80 push $0x801109e0 80101c99: e8 e2 27 00 00 call 80104480 <acquire> ip->ref++; 80101c9e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101ca2: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101ca9: e8 92 28 00 00 call 80104540 <release> 80101cae: 83 c4 10 add $0x10,%esp 80101cb1: eb 08 jmp 80101cbb <namex+0x4b> 80101cb3: 90 nop 80101cb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi path++; 80101cb8: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101cbb: 0f b6 03 movzbl (%ebx),%eax 80101cbe: 3c 2f cmp $0x2f,%al 80101cc0: 74 f6 je 80101cb8 <namex+0x48> if(*path == 0) 80101cc2: 84 c0 test %al,%al 80101cc4: 0f 84 ee 00 00 00 je 80101db8 <namex+0x148> while(*path != '/' && *path != 0) 80101cca: 0f b6 03 movzbl (%ebx),%eax 80101ccd: 3c 2f cmp $0x2f,%al 80101ccf: 0f 84 b3 00 00 00 je 80101d88 <namex+0x118> 80101cd5: 84 c0 test %al,%al 80101cd7: 89 da mov %ebx,%edx 80101cd9: 75 09 jne 80101ce4 <namex+0x74> 80101cdb: e9 a8 00 00 00 jmp 80101d88 <namex+0x118> 80101ce0: 84 c0 test %al,%al 80101ce2: 74 0a je 80101cee <namex+0x7e> path++; 80101ce4: 83 c2 01 add $0x1,%edx while(*path != '/' && *path != 0) 80101ce7: 0f b6 02 movzbl (%edx),%eax 80101cea: 3c 2f cmp $0x2f,%al 80101cec: 75 f2 jne 80101ce0 <namex+0x70> 80101cee: 89 d1 mov %edx,%ecx 80101cf0: 29 d9 sub %ebx,%ecx if(len >= DIRSIZ) 80101cf2: 83 f9 0d cmp $0xd,%ecx 80101cf5: 0f 8e 91 00 00 00 jle 80101d8c <namex+0x11c> memmove(name, s, DIRSIZ); 80101cfb: 83 ec 04 sub $0x4,%esp 80101cfe: 89 55 e4 mov %edx,-0x1c(%ebp) 80101d01: 6a 0e push $0xe 80101d03: 53 push %ebx 80101d04: 57 push %edi 80101d05: e8 36 29 00 00 call 80104640 <memmove> path++; 80101d0a: 8b 55 e4 mov -0x1c(%ebp),%edx memmove(name, s, DIRSIZ); 80101d0d: 83 c4 10 add $0x10,%esp path++; 80101d10: 89 d3 mov %edx,%ebx while(*path == '/') 80101d12: 80 3a 2f cmpb $0x2f,(%edx) 80101d15: 75 11 jne 80101d28 <namex+0xb8> 80101d17: 89 f6 mov %esi,%esi 80101d19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi path++; 80101d20: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101d23: 80 3b 2f cmpb $0x2f,(%ebx) 80101d26: 74 f8 je 80101d20 <namex+0xb0> while((path = skipelem(path, name)) != 0){ ilock(ip); 80101d28: 83 ec 0c sub $0xc,%esp 80101d2b: 56 push %esi 80101d2c: e8 5f f9 ff ff call 80101690 <ilock> if(ip->type != T_DIR){ 80101d31: 83 c4 10 add $0x10,%esp 80101d34: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101d39: 0f 85 91 00 00 00 jne 80101dd0 <namex+0x160> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101d3f: 8b 55 e0 mov -0x20(%ebp),%edx 80101d42: 85 d2 test %edx,%edx 80101d44: 74 09 je 80101d4f <namex+0xdf> 80101d46: 80 3b 00 cmpb $0x0,(%ebx) 80101d49: 0f 84 b7 00 00 00 je 80101e06 <namex+0x196> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101d4f: 83 ec 04 sub $0x4,%esp 80101d52: 6a 00 push $0x0 80101d54: 57 push %edi 80101d55: 56 push %esi 80101d56: e8 65 fe ff ff call 80101bc0 <dirlookup> 80101d5b: 83 c4 10 add $0x10,%esp 80101d5e: 85 c0 test %eax,%eax 80101d60: 74 6e je 80101dd0 <namex+0x160> iunlock(ip); 80101d62: 83 ec 0c sub $0xc,%esp 80101d65: 89 45 e4 mov %eax,-0x1c(%ebp) 80101d68: 56 push %esi 80101d69: e8 02 fa ff ff call 80101770 <iunlock> iput(ip); 80101d6e: 89 34 24 mov %esi,(%esp) 80101d71: e8 4a fa ff ff call 801017c0 <iput> 80101d76: 8b 45 e4 mov -0x1c(%ebp),%eax 80101d79: 83 c4 10 add $0x10,%esp 80101d7c: 89 c6 mov %eax,%esi 80101d7e: e9 38 ff ff ff jmp 80101cbb <namex+0x4b> 80101d83: 90 nop 80101d84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(*path != '/' && *path != 0) 80101d88: 89 da mov %ebx,%edx 80101d8a: 31 c9 xor %ecx,%ecx memmove(name, s, len); 80101d8c: 83 ec 04 sub $0x4,%esp 80101d8f: 89 55 dc mov %edx,-0x24(%ebp) 80101d92: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101d95: 51 push %ecx 80101d96: 53 push %ebx 80101d97: 57 push %edi 80101d98: e8 a3 28 00 00 call 80104640 <memmove> name[len] = 0; 80101d9d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101da0: 8b 55 dc mov -0x24(%ebp),%edx 80101da3: 83 c4 10 add $0x10,%esp 80101da6: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101daa: 89 d3 mov %edx,%ebx 80101dac: e9 61 ff ff ff jmp 80101d12 <namex+0xa2> 80101db1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; } iunlockput(ip); ip = next; } if(nameiparent){ 80101db8: 8b 45 e0 mov -0x20(%ebp),%eax 80101dbb: 85 c0 test %eax,%eax 80101dbd: 75 5d jne 80101e1c <namex+0x1ac> iput(ip); return 0; } return ip; } 80101dbf: 8d 65 f4 lea -0xc(%ebp),%esp 80101dc2: 89 f0 mov %esi,%eax 80101dc4: 5b pop %ebx 80101dc5: 5e pop %esi 80101dc6: 5f pop %edi 80101dc7: 5d pop %ebp 80101dc8: c3 ret 80101dc9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi iunlock(ip); 80101dd0: 83 ec 0c sub $0xc,%esp 80101dd3: 56 push %esi 80101dd4: e8 97 f9 ff ff call 80101770 <iunlock> iput(ip); 80101dd9: 89 34 24 mov %esi,(%esp) return 0; 80101ddc: 31 f6 xor %esi,%esi iput(ip); 80101dde: e8 dd f9 ff ff call 801017c0 <iput> return 0; 80101de3: 83 c4 10 add $0x10,%esp } 80101de6: 8d 65 f4 lea -0xc(%ebp),%esp 80101de9: 89 f0 mov %esi,%eax 80101deb: 5b pop %ebx 80101dec: 5e pop %esi 80101ded: 5f pop %edi 80101dee: 5d pop %ebp 80101def: c3 ret ip = iget(ROOTDEV, ROOTINO); 80101df0: ba 01 00 00 00 mov $0x1,%edx 80101df5: b8 01 00 00 00 mov $0x1,%eax 80101dfa: e8 21 f4 ff ff call 80101220 <iget> 80101dff: 89 c6 mov %eax,%esi 80101e01: e9 b5 fe ff ff jmp 80101cbb <namex+0x4b> iunlock(ip); 80101e06: 83 ec 0c sub $0xc,%esp 80101e09: 56 push %esi 80101e0a: e8 61 f9 ff ff call 80101770 <iunlock> return ip; 80101e0f: 83 c4 10 add $0x10,%esp } 80101e12: 8d 65 f4 lea -0xc(%ebp),%esp 80101e15: 89 f0 mov %esi,%eax 80101e17: 5b pop %ebx 80101e18: 5e pop %esi 80101e19: 5f pop %edi 80101e1a: 5d pop %ebp 80101e1b: c3 ret iput(ip); 80101e1c: 83 ec 0c sub $0xc,%esp 80101e1f: 56 push %esi return 0; 80101e20: 31 f6 xor %esi,%esi iput(ip); 80101e22: e8 99 f9 ff ff call 801017c0 <iput> return 0; 80101e27: 83 c4 10 add $0x10,%esp 80101e2a: eb 93 jmp 80101dbf <namex+0x14f> 80101e2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101e30 <dirlink>: { 80101e30: 55 push %ebp 80101e31: 89 e5 mov %esp,%ebp 80101e33: 57 push %edi 80101e34: 56 push %esi 80101e35: 53 push %ebx 80101e36: 83 ec 20 sub $0x20,%esp 80101e39: 8b 5d 08 mov 0x8(%ebp),%ebx if((ip = dirlookup(dp, name, 0)) != 0){ 80101e3c: 6a 00 push $0x0 80101e3e: ff 75 0c pushl 0xc(%ebp) 80101e41: 53 push %ebx 80101e42: e8 79 fd ff ff call 80101bc0 <dirlookup> 80101e47: 83 c4 10 add $0x10,%esp 80101e4a: 85 c0 test %eax,%eax 80101e4c: 75 67 jne 80101eb5 <dirlink+0x85> for(off = 0; off < dp->size; off += sizeof(de)){ 80101e4e: 8b 7b 58 mov 0x58(%ebx),%edi 80101e51: 8d 75 d8 lea -0x28(%ebp),%esi 80101e54: 85 ff test %edi,%edi 80101e56: 74 29 je 80101e81 <dirlink+0x51> 80101e58: 31 ff xor %edi,%edi 80101e5a: 8d 75 d8 lea -0x28(%ebp),%esi 80101e5d: eb 09 jmp 80101e68 <dirlink+0x38> 80101e5f: 90 nop 80101e60: 83 c7 10 add $0x10,%edi 80101e63: 3b 7b 58 cmp 0x58(%ebx),%edi 80101e66: 73 19 jae 80101e81 <dirlink+0x51> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e68: 6a 10 push $0x10 80101e6a: 57 push %edi 80101e6b: 56 push %esi 80101e6c: 53 push %ebx 80101e6d: e8 fe fa ff ff call 80101970 <readi> 80101e72: 83 c4 10 add $0x10,%esp 80101e75: 83 f8 10 cmp $0x10,%eax 80101e78: 75 4e jne 80101ec8 <dirlink+0x98> if(de.inum == 0) 80101e7a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101e7f: 75 df jne 80101e60 <dirlink+0x30> strncpy(de.name, name, DIRSIZ); 80101e81: 8d 45 da lea -0x26(%ebp),%eax 80101e84: 83 ec 04 sub $0x4,%esp 80101e87: 6a 0e push $0xe 80101e89: ff 75 0c pushl 0xc(%ebp) 80101e8c: 50 push %eax 80101e8d: e8 7e 28 00 00 call 80104710 <strncpy> de.inum = inum; 80101e92: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e95: 6a 10 push $0x10 80101e97: 57 push %edi 80101e98: 56 push %esi 80101e99: 53 push %ebx de.inum = inum; 80101e9a: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e9e: e8 cd fb ff ff call 80101a70 <writei> 80101ea3: 83 c4 20 add $0x20,%esp 80101ea6: 83 f8 10 cmp $0x10,%eax 80101ea9: 75 2a jne 80101ed5 <dirlink+0xa5> return 0; 80101eab: 31 c0 xor %eax,%eax } 80101ead: 8d 65 f4 lea -0xc(%ebp),%esp 80101eb0: 5b pop %ebx 80101eb1: 5e pop %esi 80101eb2: 5f pop %edi 80101eb3: 5d pop %ebp 80101eb4: c3 ret iput(ip); 80101eb5: 83 ec 0c sub $0xc,%esp 80101eb8: 50 push %eax 80101eb9: e8 02 f9 ff ff call 801017c0 <iput> return -1; 80101ebe: 83 c4 10 add $0x10,%esp 80101ec1: b8 ff ff ff ff mov $0xffffffff,%eax 80101ec6: eb e5 jmp 80101ead <dirlink+0x7d> panic("dirlink read"); 80101ec8: 83 ec 0c sub $0xc,%esp 80101ecb: 68 28 72 10 80 push $0x80107228 80101ed0: e8 bb e4 ff ff call 80100390 <panic> panic("dirlink"); 80101ed5: 83 ec 0c sub $0xc,%esp 80101ed8: 68 46 78 10 80 push $0x80107846 80101edd: e8 ae e4 ff ff call 80100390 <panic> 80101ee2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ee9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ef0 <namei>: struct inode* namei(char *path) { 80101ef0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101ef1: 31 d2 xor %edx,%edx { 80101ef3: 89 e5 mov %esp,%ebp 80101ef5: 83 ec 18 sub $0x18,%esp return namex(path, 0, name); 80101ef8: 8b 45 08 mov 0x8(%ebp),%eax 80101efb: 8d 4d ea lea -0x16(%ebp),%ecx 80101efe: e8 6d fd ff ff call 80101c70 <namex> } 80101f03: c9 leave 80101f04: c3 ret 80101f05: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101f09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f10 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101f10: 55 push %ebp return namex(path, 1, name); 80101f11: ba 01 00 00 00 mov $0x1,%edx { 80101f16: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101f18: 8b 4d 0c mov 0xc(%ebp),%ecx 80101f1b: 8b 45 08 mov 0x8(%ebp),%eax } 80101f1e: 5d pop %ebp return namex(path, 1, name); 80101f1f: e9 4c fd ff ff jmp 80101c70 <namex> 80101f24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101f2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101f30 <swapread>: #define SWAPBASE 500 #define SWAPMAX (100000 - SWAPBASE) void swapread(char* ptr, int blkno) { 80101f30: 55 push %ebp 80101f31: 89 e5 mov %esp,%ebp 80101f33: 57 push %edi 80101f34: 56 push %esi 80101f35: 53 push %ebx 80101f36: 83 ec 1c sub $0x1c,%esp 80101f39: 8b 7d 0c mov 0xc(%ebp),%edi struct buf* bp; int i; if ( blkno < 0 || blkno >= SWAPMAX ) 80101f3c: 81 ff ab 84 01 00 cmp $0x184ab,%edi 80101f42: 77 5c ja 80101fa0 <swapread+0x70> 80101f44: 8d 87 fc 01 00 00 lea 0x1fc(%edi),%eax 80101f4a: 8b 75 08 mov 0x8(%ebp),%esi 80101f4d: 8d 9f f4 01 00 00 lea 0x1f4(%edi),%ebx 80101f53: 89 45 e4 mov %eax,-0x1c(%ebp) 80101f56: 8d 76 00 lea 0x0(%esi),%esi 80101f59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi panic("swapread: blkno exceed range"); for ( i=0; i < 8; ++i ) { bp = bread(0, blkno + SWAPBASE + i); 80101f60: 83 ec 08 sub $0x8,%esp 80101f63: 53 push %ebx 80101f64: 6a 00 push $0x0 80101f66: 83 c3 01 add $0x1,%ebx 80101f69: e8 62 e1 ff ff call 801000d0 <bread> 80101f6e: 89 c7 mov %eax,%edi memmove(ptr + i * BSIZE, bp->data, BSIZE); 80101f70: 8d 40 5c lea 0x5c(%eax),%eax 80101f73: 83 c4 0c add $0xc,%esp 80101f76: 68 00 02 00 00 push $0x200 80101f7b: 50 push %eax 80101f7c: 56 push %esi 80101f7d: 81 c6 00 02 00 00 add $0x200,%esi 80101f83: e8 b8 26 00 00 call 80104640 <memmove> brelse(bp); 80101f88: 89 3c 24 mov %edi,(%esp) 80101f8b: e8 50 e2 ff ff call 801001e0 <brelse> for ( i=0; i < 8; ++i ) { 80101f90: 83 c4 10 add $0x10,%esp 80101f93: 3b 5d e4 cmp -0x1c(%ebp),%ebx 80101f96: 75 c8 jne 80101f60 <swapread+0x30> } } 80101f98: 8d 65 f4 lea -0xc(%ebp),%esp 80101f9b: 5b pop %ebx 80101f9c: 5e pop %esi 80101f9d: 5f pop %edi 80101f9e: 5d pop %ebp 80101f9f: c3 ret panic("swapread: blkno exceed range"); 80101fa0: 83 ec 0c sub $0xc,%esp 80101fa3: 68 35 72 10 80 push $0x80107235 80101fa8: e8 e3 e3 ff ff call 80100390 <panic> 80101fad: 8d 76 00 lea 0x0(%esi),%esi 80101fb0 <swapwrite>: void swapwrite(char* ptr, int blkno) { 80101fb0: 55 push %ebp 80101fb1: 89 e5 mov %esp,%ebp 80101fb3: 57 push %edi 80101fb4: 56 push %esi 80101fb5: 53 push %ebx 80101fb6: 83 ec 1c sub $0x1c,%esp 80101fb9: 8b 7d 0c mov 0xc(%ebp),%edi struct buf* bp; int i; if ( blkno < 0 || blkno >= SWAPMAX ) 80101fbc: 81 ff ab 84 01 00 cmp $0x184ab,%edi 80101fc2: 77 64 ja 80102028 <swapwrite+0x78> 80101fc4: 8d 87 fc 01 00 00 lea 0x1fc(%edi),%eax 80101fca: 8b 75 08 mov 0x8(%ebp),%esi 80101fcd: 8d 9f f4 01 00 00 lea 0x1f4(%edi),%ebx 80101fd3: 89 45 e4 mov %eax,-0x1c(%ebp) 80101fd6: 8d 76 00 lea 0x0(%esi),%esi 80101fd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi panic("swapread: blkno exceed range"); for ( i=0; i < 8; ++i ) { bp = bread(0, blkno + SWAPBASE + i); 80101fe0: 83 ec 08 sub $0x8,%esp 80101fe3: 53 push %ebx 80101fe4: 6a 00 push $0x0 80101fe6: 83 c3 01 add $0x1,%ebx 80101fe9: e8 e2 e0 ff ff call 801000d0 <bread> 80101fee: 89 c7 mov %eax,%edi memmove(bp->data, ptr + i * BSIZE, BSIZE); 80101ff0: 8d 40 5c lea 0x5c(%eax),%eax 80101ff3: 83 c4 0c add $0xc,%esp 80101ff6: 68 00 02 00 00 push $0x200 80101ffb: 56 push %esi 80101ffc: 81 c6 00 02 00 00 add $0x200,%esi 80102002: 50 push %eax 80102003: e8 38 26 00 00 call 80104640 <memmove> bwrite(bp); 80102008: 89 3c 24 mov %edi,(%esp) 8010200b: e8 90 e1 ff ff call 801001a0 <bwrite> brelse(bp); 80102010: 89 3c 24 mov %edi,(%esp) 80102013: e8 c8 e1 ff ff call 801001e0 <brelse> for ( i=0; i < 8; ++i ) { 80102018: 83 c4 10 add $0x10,%esp 8010201b: 3b 5d e4 cmp -0x1c(%ebp),%ebx 8010201e: 75 c0 jne 80101fe0 <swapwrite+0x30> } } 80102020: 8d 65 f4 lea -0xc(%ebp),%esp 80102023: 5b pop %ebx 80102024: 5e pop %esi 80102025: 5f pop %edi 80102026: 5d pop %ebp 80102027: c3 ret panic("swapread: blkno exceed range"); 80102028: 83 ec 0c sub $0xc,%esp 8010202b: 68 35 72 10 80 push $0x80107235 80102030: e8 5b e3 ff ff call 80100390 <panic> 80102035: 66 90 xchg %ax,%ax 80102037: 66 90 xchg %ax,%ax 80102039: 66 90 xchg %ax,%ax 8010203b: 66 90 xchg %ax,%ax 8010203d: 66 90 xchg %ax,%ax 8010203f: 90 nop 80102040 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80102040: 55 push %ebp 80102041: 89 e5 mov %esp,%ebp 80102043: 57 push %edi 80102044: 56 push %esi 80102045: 53 push %ebx 80102046: 83 ec 0c sub $0xc,%esp if(b == 0) 80102049: 85 c0 test %eax,%eax 8010204b: 0f 84 b4 00 00 00 je 80102105 <idestart+0xc5> panic("idestart"); if(b->blockno >= FSSIZE) 80102051: 8b 58 08 mov 0x8(%eax),%ebx 80102054: 89 c6 mov %eax,%esi 80102056: 81 fb e7 03 00 00 cmp $0x3e7,%ebx 8010205c: 0f 87 96 00 00 00 ja 801020f8 <idestart+0xb8> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102062: b9 f7 01 00 00 mov $0x1f7,%ecx 80102067: 89 f6 mov %esi,%esi 80102069: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102070: 89 ca mov %ecx,%edx 80102072: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102073: 83 e0 c0 and $0xffffffc0,%eax 80102076: 3c 40 cmp $0x40,%al 80102078: 75 f6 jne 80102070 <idestart+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010207a: 31 ff xor %edi,%edi 8010207c: ba f6 03 00 00 mov $0x3f6,%edx 80102081: 89 f8 mov %edi,%eax 80102083: ee out %al,(%dx) 80102084: b8 01 00 00 00 mov $0x1,%eax 80102089: ba f2 01 00 00 mov $0x1f2,%edx 8010208e: ee out %al,(%dx) 8010208f: ba f3 01 00 00 mov $0x1f3,%edx 80102094: 89 d8 mov %ebx,%eax 80102096: ee out %al,(%dx) idewait(0); outb(0x3f6, 0); // generate interrupt outb(0x1f2, sector_per_block); // number of sectors outb(0x1f3, sector & 0xff); outb(0x1f4, (sector >> 8) & 0xff); 80102097: 89 d8 mov %ebx,%eax 80102099: ba f4 01 00 00 mov $0x1f4,%edx 8010209e: c1 f8 08 sar $0x8,%eax 801020a1: ee out %al,(%dx) 801020a2: ba f5 01 00 00 mov $0x1f5,%edx 801020a7: 89 f8 mov %edi,%eax 801020a9: ee out %al,(%dx) outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); 801020aa: 0f b6 46 04 movzbl 0x4(%esi),%eax 801020ae: ba f6 01 00 00 mov $0x1f6,%edx 801020b3: c1 e0 04 shl $0x4,%eax 801020b6: 83 e0 10 and $0x10,%eax 801020b9: 83 c8 e0 or $0xffffffe0,%eax 801020bc: ee out %al,(%dx) if(b->flags & B_DIRTY){ 801020bd: f6 06 04 testb $0x4,(%esi) 801020c0: 75 16 jne 801020d8 <idestart+0x98> 801020c2: b8 20 00 00 00 mov $0x20,%eax 801020c7: 89 ca mov %ecx,%edx 801020c9: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 801020ca: 8d 65 f4 lea -0xc(%ebp),%esp 801020cd: 5b pop %ebx 801020ce: 5e pop %esi 801020cf: 5f pop %edi 801020d0: 5d pop %ebp 801020d1: c3 ret 801020d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801020d8: b8 30 00 00 00 mov $0x30,%eax 801020dd: 89 ca mov %ecx,%edx 801020df: ee out %al,(%dx) asm volatile("cld; rep outsl" : 801020e0: b9 80 00 00 00 mov $0x80,%ecx outsl(0x1f0, b->data, BSIZE/4); 801020e5: 83 c6 5c add $0x5c,%esi 801020e8: ba f0 01 00 00 mov $0x1f0,%edx 801020ed: fc cld 801020ee: f3 6f rep outsl %ds:(%esi),(%dx) } 801020f0: 8d 65 f4 lea -0xc(%ebp),%esp 801020f3: 5b pop %ebx 801020f4: 5e pop %esi 801020f5: 5f pop %edi 801020f6: 5d pop %ebp 801020f7: c3 ret panic("incorrect blockno"); 801020f8: 83 ec 0c sub $0xc,%esp 801020fb: 68 b0 72 10 80 push $0x801072b0 80102100: e8 8b e2 ff ff call 80100390 <panic> panic("idestart"); 80102105: 83 ec 0c sub $0xc,%esp 80102108: 68 a7 72 10 80 push $0x801072a7 8010210d: e8 7e e2 ff ff call 80100390 <panic> 80102112: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102119: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102120 <ideinit>: { 80102120: 55 push %ebp 80102121: 89 e5 mov %esp,%ebp 80102123: 83 ec 10 sub $0x10,%esp initlock(&idelock, "ide"); 80102126: 68 c2 72 10 80 push $0x801072c2 8010212b: 68 80 a5 10 80 push $0x8010a580 80102130: e8 0b 22 00 00 call 80104340 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80102135: 58 pop %eax 80102136: a1 00 2d 11 80 mov 0x80112d00,%eax 8010213b: 5a pop %edx 8010213c: 83 e8 01 sub $0x1,%eax 8010213f: 50 push %eax 80102140: 6a 0e push $0xe 80102142: e8 a9 02 00 00 call 801023f0 <ioapicenable> 80102147: 83 c4 10 add $0x10,%esp asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010214a: ba f7 01 00 00 mov $0x1f7,%edx 8010214f: 90 nop 80102150: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102151: 83 e0 c0 and $0xffffffc0,%eax 80102154: 3c 40 cmp $0x40,%al 80102156: 75 f8 jne 80102150 <ideinit+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102158: b8 f0 ff ff ff mov $0xfffffff0,%eax 8010215d: ba f6 01 00 00 mov $0x1f6,%edx 80102162: ee out %al,(%dx) 80102163: b9 e8 03 00 00 mov $0x3e8,%ecx asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102168: ba f7 01 00 00 mov $0x1f7,%edx 8010216d: eb 06 jmp 80102175 <ideinit+0x55> 8010216f: 90 nop for(i=0; i<1000; i++){ 80102170: 83 e9 01 sub $0x1,%ecx 80102173: 74 0f je 80102184 <ideinit+0x64> 80102175: ec in (%dx),%al if(inb(0x1f7) != 0){ 80102176: 84 c0 test %al,%al 80102178: 74 f6 je 80102170 <ideinit+0x50> havedisk1 = 1; 8010217a: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560 80102181: 00 00 00 asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102184: b8 e0 ff ff ff mov $0xffffffe0,%eax 80102189: ba f6 01 00 00 mov $0x1f6,%edx 8010218e: ee out %al,(%dx) } 8010218f: c9 leave 80102190: c3 ret 80102191: eb 0d jmp 801021a0 <ideintr> 80102193: 90 nop 80102194: 90 nop 80102195: 90 nop 80102196: 90 nop 80102197: 90 nop 80102198: 90 nop 80102199: 90 nop 8010219a: 90 nop 8010219b: 90 nop 8010219c: 90 nop 8010219d: 90 nop 8010219e: 90 nop 8010219f: 90 nop 801021a0 <ideintr>: // Interrupt handler. void ideintr(void) { 801021a0: 55 push %ebp 801021a1: 89 e5 mov %esp,%ebp 801021a3: 57 push %edi 801021a4: 56 push %esi 801021a5: 53 push %ebx 801021a6: 83 ec 18 sub $0x18,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 801021a9: 68 80 a5 10 80 push $0x8010a580 801021ae: e8 cd 22 00 00 call 80104480 <acquire> if((b = idequeue) == 0){ 801021b3: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx 801021b9: 83 c4 10 add $0x10,%esp 801021bc: 85 db test %ebx,%ebx 801021be: 74 67 je 80102227 <ideintr+0x87> release(&idelock); return; } idequeue = b->qnext; 801021c0: 8b 43 58 mov 0x58(%ebx),%eax 801021c3: a3 64 a5 10 80 mov %eax,0x8010a564 // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) 801021c8: 8b 3b mov (%ebx),%edi 801021ca: f7 c7 04 00 00 00 test $0x4,%edi 801021d0: 75 31 jne 80102203 <ideintr+0x63> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801021d2: ba f7 01 00 00 mov $0x1f7,%edx 801021d7: 89 f6 mov %esi,%esi 801021d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801021e0: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 801021e1: 89 c6 mov %eax,%esi 801021e3: 83 e6 c0 and $0xffffffc0,%esi 801021e6: 89 f1 mov %esi,%ecx 801021e8: 80 f9 40 cmp $0x40,%cl 801021eb: 75 f3 jne 801021e0 <ideintr+0x40> if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0) 801021ed: a8 21 test $0x21,%al 801021ef: 75 12 jne 80102203 <ideintr+0x63> insl(0x1f0, b->data, BSIZE/4); 801021f1: 8d 7b 5c lea 0x5c(%ebx),%edi asm volatile("cld; rep insl" : 801021f4: b9 80 00 00 00 mov $0x80,%ecx 801021f9: ba f0 01 00 00 mov $0x1f0,%edx 801021fe: fc cld 801021ff: f3 6d rep insl (%dx),%es:(%edi) 80102201: 8b 3b mov (%ebx),%edi // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 80102203: 83 e7 fb and $0xfffffffb,%edi wakeup(b); 80102206: 83 ec 0c sub $0xc,%esp b->flags &= ~B_DIRTY; 80102209: 89 f9 mov %edi,%ecx 8010220b: 83 c9 02 or $0x2,%ecx 8010220e: 89 0b mov %ecx,(%ebx) wakeup(b); 80102210: 53 push %ebx 80102211: e8 5a 1e 00 00 call 80104070 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 80102216: a1 64 a5 10 80 mov 0x8010a564,%eax 8010221b: 83 c4 10 add $0x10,%esp 8010221e: 85 c0 test %eax,%eax 80102220: 74 05 je 80102227 <ideintr+0x87> idestart(idequeue); 80102222: e8 19 fe ff ff call 80102040 <idestart> release(&idelock); 80102227: 83 ec 0c sub $0xc,%esp 8010222a: 68 80 a5 10 80 push $0x8010a580 8010222f: e8 0c 23 00 00 call 80104540 <release> release(&idelock); } 80102234: 8d 65 f4 lea -0xc(%ebp),%esp 80102237: 5b pop %ebx 80102238: 5e pop %esi 80102239: 5f pop %edi 8010223a: 5d pop %ebp 8010223b: c3 ret 8010223c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102240 <iderw>: // Sync buf with disk. // If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID. // Else if B_VALID is not set, read buf from disk, set B_VALID. void iderw(struct buf *b) { 80102240: 55 push %ebp 80102241: 89 e5 mov %esp,%ebp 80102243: 53 push %ebx 80102244: 83 ec 10 sub $0x10,%esp 80102247: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if(!holdingsleep(&b->lock)) 8010224a: 8d 43 0c lea 0xc(%ebx),%eax 8010224d: 50 push %eax 8010224e: e8 9d 20 00 00 call 801042f0 <holdingsleep> 80102253: 83 c4 10 add $0x10,%esp 80102256: 85 c0 test %eax,%eax 80102258: 0f 84 c6 00 00 00 je 80102324 <iderw+0xe4> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010225e: 8b 03 mov (%ebx),%eax 80102260: 83 e0 06 and $0x6,%eax 80102263: 83 f8 02 cmp $0x2,%eax 80102266: 0f 84 ab 00 00 00 je 80102317 <iderw+0xd7> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010226c: 8b 53 04 mov 0x4(%ebx),%edx 8010226f: 85 d2 test %edx,%edx 80102271: 74 0d je 80102280 <iderw+0x40> 80102273: a1 60 a5 10 80 mov 0x8010a560,%eax 80102278: 85 c0 test %eax,%eax 8010227a: 0f 84 b1 00 00 00 je 80102331 <iderw+0xf1> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 80102280: 83 ec 0c sub $0xc,%esp 80102283: 68 80 a5 10 80 push $0x8010a580 80102288: e8 f3 21 00 00 call 80104480 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010228d: 8b 15 64 a5 10 80 mov 0x8010a564,%edx 80102293: 83 c4 10 add $0x10,%esp b->qnext = 0; 80102296: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010229d: 85 d2 test %edx,%edx 8010229f: 75 09 jne 801022aa <iderw+0x6a> 801022a1: eb 6d jmp 80102310 <iderw+0xd0> 801022a3: 90 nop 801022a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801022a8: 89 c2 mov %eax,%edx 801022aa: 8b 42 58 mov 0x58(%edx),%eax 801022ad: 85 c0 test %eax,%eax 801022af: 75 f7 jne 801022a8 <iderw+0x68> 801022b1: 83 c2 58 add $0x58,%edx ; *pp = b; 801022b4: 89 1a mov %ebx,(%edx) // Start disk if necessary. if(idequeue == b) 801022b6: 39 1d 64 a5 10 80 cmp %ebx,0x8010a564 801022bc: 74 42 je 80102300 <iderw+0xc0> idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 801022be: 8b 03 mov (%ebx),%eax 801022c0: 83 e0 06 and $0x6,%eax 801022c3: 83 f8 02 cmp $0x2,%eax 801022c6: 74 23 je 801022eb <iderw+0xab> 801022c8: 90 nop 801022c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(b, &idelock); 801022d0: 83 ec 08 sub $0x8,%esp 801022d3: 68 80 a5 10 80 push $0x8010a580 801022d8: 53 push %ebx 801022d9: e8 e2 1b 00 00 call 80103ec0 <sleep> while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 801022de: 8b 03 mov (%ebx),%eax 801022e0: 83 c4 10 add $0x10,%esp 801022e3: 83 e0 06 and $0x6,%eax 801022e6: 83 f8 02 cmp $0x2,%eax 801022e9: 75 e5 jne 801022d0 <iderw+0x90> } release(&idelock); 801022eb: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp) } 801022f2: 8b 5d fc mov -0x4(%ebp),%ebx 801022f5: c9 leave release(&idelock); 801022f6: e9 45 22 00 00 jmp 80104540 <release> 801022fb: 90 nop 801022fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi idestart(b); 80102300: 89 d8 mov %ebx,%eax 80102302: e8 39 fd ff ff call 80102040 <idestart> 80102307: eb b5 jmp 801022be <iderw+0x7e> 80102309: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 80102310: ba 64 a5 10 80 mov $0x8010a564,%edx 80102315: eb 9d jmp 801022b4 <iderw+0x74> panic("iderw: nothing to do"); 80102317: 83 ec 0c sub $0xc,%esp 8010231a: 68 dc 72 10 80 push $0x801072dc 8010231f: e8 6c e0 ff ff call 80100390 <panic> panic("iderw: buf not locked"); 80102324: 83 ec 0c sub $0xc,%esp 80102327: 68 c6 72 10 80 push $0x801072c6 8010232c: e8 5f e0 ff ff call 80100390 <panic> panic("iderw: ide disk 1 not present"); 80102331: 83 ec 0c sub $0xc,%esp 80102334: 68 f1 72 10 80 push $0x801072f1 80102339: e8 52 e0 ff ff call 80100390 <panic> 8010233e: 66 90 xchg %ax,%ax 80102340 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 80102340: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 80102341: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634 80102348: 00 c0 fe { 8010234b: 89 e5 mov %esp,%ebp 8010234d: 56 push %esi 8010234e: 53 push %ebx ioapic->reg = reg; 8010234f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102356: 00 00 00 return ioapic->data; 80102359: a1 34 26 11 80 mov 0x80112634,%eax 8010235e: 8b 58 10 mov 0x10(%eax),%ebx ioapic->reg = reg; 80102361: c7 00 00 00 00 00 movl $0x0,(%eax) return ioapic->data; 80102367: 8b 0d 34 26 11 80 mov 0x80112634,%ecx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 8010236d: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102374: c1 eb 10 shr $0x10,%ebx return ioapic->data; 80102377: 8b 41 10 mov 0x10(%ecx),%eax maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 8010237a: 0f b6 db movzbl %bl,%ebx id = ioapicread(REG_ID) >> 24; 8010237d: c1 e8 18 shr $0x18,%eax if(id != ioapicid) 80102380: 39 c2 cmp %eax,%edx 80102382: 74 16 je 8010239a <ioapicinit+0x5a> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102384: 83 ec 0c sub $0xc,%esp 80102387: 68 10 73 10 80 push $0x80107310 8010238c: e8 cf e2 ff ff call 80100660 <cprintf> 80102391: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 80102397: 83 c4 10 add $0x10,%esp 8010239a: 83 c3 21 add $0x21,%ebx { 8010239d: ba 10 00 00 00 mov $0x10,%edx 801023a2: b8 20 00 00 00 mov $0x20,%eax 801023a7: 89 f6 mov %esi,%esi 801023a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ioapic->reg = reg; 801023b0: 89 11 mov %edx,(%ecx) ioapic->data = data; 801023b2: 8b 0d 34 26 11 80 mov 0x80112634,%ecx // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for(i = 0; i <= maxintr; i++){ ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); 801023b8: 89 c6 mov %eax,%esi 801023ba: 81 ce 00 00 01 00 or $0x10000,%esi 801023c0: 83 c0 01 add $0x1,%eax ioapic->data = data; 801023c3: 89 71 10 mov %esi,0x10(%ecx) 801023c6: 8d 72 01 lea 0x1(%edx),%esi 801023c9: 83 c2 02 add $0x2,%edx for(i = 0; i <= maxintr; i++){ 801023cc: 39 d8 cmp %ebx,%eax ioapic->reg = reg; 801023ce: 89 31 mov %esi,(%ecx) ioapic->data = data; 801023d0: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 801023d6: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) for(i = 0; i <= maxintr; i++){ 801023dd: 75 d1 jne 801023b0 <ioapicinit+0x70> ioapicwrite(REG_TABLE+2*i+1, 0); } } 801023df: 8d 65 f8 lea -0x8(%ebp),%esp 801023e2: 5b pop %ebx 801023e3: 5e pop %esi 801023e4: 5d pop %ebp 801023e5: c3 ret 801023e6: 8d 76 00 lea 0x0(%esi),%esi 801023e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801023f0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801023f0: 55 push %ebp ioapic->reg = reg; 801023f1: 8b 0d 34 26 11 80 mov 0x80112634,%ecx { 801023f7: 89 e5 mov %esp,%ebp 801023f9: 8b 45 08 mov 0x8(%ebp),%eax // Mark interrupt edge-triggered, active high, // enabled, and routed to the given cpunum, // which happens to be that cpu's APIC ID. ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq); 801023fc: 8d 50 20 lea 0x20(%eax),%edx 801023ff: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax ioapic->reg = reg; 80102403: 89 01 mov %eax,(%ecx) ioapic->data = data; 80102405: 8b 0d 34 26 11 80 mov 0x80112634,%ecx ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 8010240b: 83 c0 01 add $0x1,%eax ioapic->data = data; 8010240e: 89 51 10 mov %edx,0x10(%ecx) ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 80102411: 8b 55 0c mov 0xc(%ebp),%edx ioapic->reg = reg; 80102414: 89 01 mov %eax,(%ecx) ioapic->data = data; 80102416: a1 34 26 11 80 mov 0x80112634,%eax ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 8010241b: c1 e2 18 shl $0x18,%edx ioapic->data = data; 8010241e: 89 50 10 mov %edx,0x10(%eax) } 80102421: 5d pop %ebp 80102422: c3 ret 80102423: 66 90 xchg %ax,%ax 80102425: 66 90 xchg %ax,%ax 80102427: 66 90 xchg %ax,%ax 80102429: 66 90 xchg %ax,%ax 8010242b: 66 90 xchg %ax,%ax 8010242d: 66 90 xchg %ax,%ax 8010242f: 90 nop 80102430 <kfree>: // which normally should have been returned by a // call to kalloc(). (The exception is when // initializing the allocator; see kinit above.) void kfree(char *v) { 80102430: 55 push %ebp 80102431: 89 e5 mov %esp,%ebp 80102433: 53 push %ebx 80102434: 83 ec 04 sub $0x4,%esp 80102437: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) 8010243a: f7 c3 ff 0f 00 00 test $0xfff,%ebx 80102440: 75 70 jne 801024b2 <kfree+0x82> 80102442: 81 fb a8 54 11 80 cmp $0x801154a8,%ebx 80102448: 72 68 jb 801024b2 <kfree+0x82> 8010244a: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102450: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102455: 77 5b ja 801024b2 <kfree+0x82> panic("kfree"); // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 80102457: 83 ec 04 sub $0x4,%esp 8010245a: 68 00 10 00 00 push $0x1000 8010245f: 6a 01 push $0x1 80102461: 53 push %ebx 80102462: e8 29 21 00 00 call 80104590 <memset> if(kmem.use_lock) 80102467: 8b 15 74 26 11 80 mov 0x80112674,%edx 8010246d: 83 c4 10 add $0x10,%esp 80102470: 85 d2 test %edx,%edx 80102472: 75 2c jne 801024a0 <kfree+0x70> acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; 80102474: a1 78 26 11 80 mov 0x80112678,%eax 80102479: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 8010247b: a1 74 26 11 80 mov 0x80112674,%eax kmem.freelist = r; 80102480: 89 1d 78 26 11 80 mov %ebx,0x80112678 if(kmem.use_lock) 80102486: 85 c0 test %eax,%eax 80102488: 75 06 jne 80102490 <kfree+0x60> release(&kmem.lock); } 8010248a: 8b 5d fc mov -0x4(%ebp),%ebx 8010248d: c9 leave 8010248e: c3 ret 8010248f: 90 nop release(&kmem.lock); 80102490: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp) } 80102497: 8b 5d fc mov -0x4(%ebp),%ebx 8010249a: c9 leave release(&kmem.lock); 8010249b: e9 a0 20 00 00 jmp 80104540 <release> acquire(&kmem.lock); 801024a0: 83 ec 0c sub $0xc,%esp 801024a3: 68 40 26 11 80 push $0x80112640 801024a8: e8 d3 1f 00 00 call 80104480 <acquire> 801024ad: 83 c4 10 add $0x10,%esp 801024b0: eb c2 jmp 80102474 <kfree+0x44> panic("kfree"); 801024b2: 83 ec 0c sub $0xc,%esp 801024b5: 68 42 73 10 80 push $0x80107342 801024ba: e8 d1 de ff ff call 80100390 <panic> 801024bf: 90 nop 801024c0 <freerange>: { 801024c0: 55 push %ebp 801024c1: 89 e5 mov %esp,%ebp 801024c3: 56 push %esi 801024c4: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 801024c5: 8b 45 08 mov 0x8(%ebp),%eax { 801024c8: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 801024cb: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801024d1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024d7: 81 c3 00 10 00 00 add $0x1000,%ebx 801024dd: 39 de cmp %ebx,%esi 801024df: 72 23 jb 80102504 <freerange+0x44> 801024e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 801024e8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 801024ee: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024f1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801024f7: 50 push %eax 801024f8: e8 33 ff ff ff call 80102430 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024fd: 83 c4 10 add $0x10,%esp 80102500: 39 f3 cmp %esi,%ebx 80102502: 76 e4 jbe 801024e8 <freerange+0x28> } 80102504: 8d 65 f8 lea -0x8(%ebp),%esp 80102507: 5b pop %ebx 80102508: 5e pop %esi 80102509: 5d pop %ebp 8010250a: c3 ret 8010250b: 90 nop 8010250c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102510 <kinit1>: { 80102510: 55 push %ebp 80102511: 89 e5 mov %esp,%ebp 80102513: 56 push %esi 80102514: 53 push %ebx 80102515: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 80102518: 83 ec 08 sub $0x8,%esp 8010251b: 68 48 73 10 80 push $0x80107348 80102520: 68 40 26 11 80 push $0x80112640 80102525: e8 16 1e 00 00 call 80104340 <initlock> p = (char*)PGROUNDUP((uint)vstart); 8010252a: 8b 45 08 mov 0x8(%ebp),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010252d: 83 c4 10 add $0x10,%esp kmem.use_lock = 0; 80102530: c7 05 74 26 11 80 00 movl $0x0,0x80112674 80102537: 00 00 00 p = (char*)PGROUNDUP((uint)vstart); 8010253a: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102540: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102546: 81 c3 00 10 00 00 add $0x1000,%ebx 8010254c: 39 de cmp %ebx,%esi 8010254e: 72 1c jb 8010256c <kinit1+0x5c> kfree(p); 80102550: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102556: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102559: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010255f: 50 push %eax 80102560: e8 cb fe ff ff call 80102430 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102565: 83 c4 10 add $0x10,%esp 80102568: 39 de cmp %ebx,%esi 8010256a: 73 e4 jae 80102550 <kinit1+0x40> } 8010256c: 8d 65 f8 lea -0x8(%ebp),%esp 8010256f: 5b pop %ebx 80102570: 5e pop %esi 80102571: 5d pop %ebp 80102572: c3 ret 80102573: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102579: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102580 <kinit2>: { 80102580: 55 push %ebp 80102581: 89 e5 mov %esp,%ebp 80102583: 56 push %esi 80102584: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 80102585: 8b 45 08 mov 0x8(%ebp),%eax { 80102588: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 8010258b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102591: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102597: 81 c3 00 10 00 00 add $0x1000,%ebx 8010259d: 39 de cmp %ebx,%esi 8010259f: 72 23 jb 801025c4 <kinit2+0x44> 801025a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 801025a8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 801025ae: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801025b1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801025b7: 50 push %eax 801025b8: e8 73 fe ff ff call 80102430 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801025bd: 83 c4 10 add $0x10,%esp 801025c0: 39 de cmp %ebx,%esi 801025c2: 73 e4 jae 801025a8 <kinit2+0x28> kmem.use_lock = 1; 801025c4: c7 05 74 26 11 80 01 movl $0x1,0x80112674 801025cb: 00 00 00 } 801025ce: 8d 65 f8 lea -0x8(%ebp),%esp 801025d1: 5b pop %ebx 801025d2: 5e pop %esi 801025d3: 5d pop %ebp 801025d4: c3 ret 801025d5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801025d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801025e0 <kalloc>: char* kalloc(void) { struct run *r; if(kmem.use_lock) 801025e0: a1 74 26 11 80 mov 0x80112674,%eax 801025e5: 85 c0 test %eax,%eax 801025e7: 75 1f jne 80102608 <kalloc+0x28> acquire(&kmem.lock); r = kmem.freelist; 801025e9: a1 78 26 11 80 mov 0x80112678,%eax if(r) 801025ee: 85 c0 test %eax,%eax 801025f0: 74 0e je 80102600 <kalloc+0x20> kmem.freelist = r->next; 801025f2: 8b 10 mov (%eax),%edx 801025f4: 89 15 78 26 11 80 mov %edx,0x80112678 801025fa: c3 ret 801025fb: 90 nop 801025fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(kmem.use_lock) release(&kmem.lock); return (char*)r; } 80102600: f3 c3 repz ret 80102602: 8d b6 00 00 00 00 lea 0x0(%esi),%esi { 80102608: 55 push %ebp 80102609: 89 e5 mov %esp,%ebp 8010260b: 83 ec 24 sub $0x24,%esp acquire(&kmem.lock); 8010260e: 68 40 26 11 80 push $0x80112640 80102613: e8 68 1e 00 00 call 80104480 <acquire> r = kmem.freelist; 80102618: a1 78 26 11 80 mov 0x80112678,%eax if(r) 8010261d: 83 c4 10 add $0x10,%esp 80102620: 8b 15 74 26 11 80 mov 0x80112674,%edx 80102626: 85 c0 test %eax,%eax 80102628: 74 08 je 80102632 <kalloc+0x52> kmem.freelist = r->next; 8010262a: 8b 08 mov (%eax),%ecx 8010262c: 89 0d 78 26 11 80 mov %ecx,0x80112678 if(kmem.use_lock) 80102632: 85 d2 test %edx,%edx 80102634: 74 16 je 8010264c <kalloc+0x6c> release(&kmem.lock); 80102636: 83 ec 0c sub $0xc,%esp 80102639: 89 45 f4 mov %eax,-0xc(%ebp) 8010263c: 68 40 26 11 80 push $0x80112640 80102641: e8 fa 1e 00 00 call 80104540 <release> return (char*)r; 80102646: 8b 45 f4 mov -0xc(%ebp),%eax release(&kmem.lock); 80102649: 83 c4 10 add $0x10,%esp } 8010264c: c9 leave 8010264d: c3 ret 8010264e: 66 90 xchg %ax,%ax 80102650 <kbdgetc>: asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102650: ba 64 00 00 00 mov $0x64,%edx 80102655: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) 80102656: a8 01 test $0x1,%al 80102658: 0f 84 c2 00 00 00 je 80102720 <kbdgetc+0xd0> 8010265e: ba 60 00 00 00 mov $0x60,%edx 80102663: ec in (%dx),%al return -1; data = inb(KBDATAP); 80102664: 0f b6 d0 movzbl %al,%edx 80102667: 8b 0d b4 a5 10 80 mov 0x8010a5b4,%ecx if(data == 0xE0){ 8010266d: 81 fa e0 00 00 00 cmp $0xe0,%edx 80102673: 0f 84 7f 00 00 00 je 801026f8 <kbdgetc+0xa8> { 80102679: 55 push %ebp 8010267a: 89 e5 mov %esp,%ebp 8010267c: 53 push %ebx 8010267d: 89 cb mov %ecx,%ebx 8010267f: 83 e3 40 and $0x40,%ebx shift |= E0ESC; return 0; } else if(data & 0x80){ 80102682: 84 c0 test %al,%al 80102684: 78 4a js 801026d0 <kbdgetc+0x80> // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ 80102686: 85 db test %ebx,%ebx 80102688: 74 09 je 80102693 <kbdgetc+0x43> // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010268a: 83 c8 80 or $0xffffff80,%eax shift &= ~E0ESC; 8010268d: 83 e1 bf and $0xffffffbf,%ecx data |= 0x80; 80102690: 0f b6 d0 movzbl %al,%edx } shift |= shiftcode[data]; 80102693: 0f b6 82 80 74 10 80 movzbl -0x7fef8b80(%edx),%eax 8010269a: 09 c1 or %eax,%ecx shift ^= togglecode[data]; 8010269c: 0f b6 82 80 73 10 80 movzbl -0x7fef8c80(%edx),%eax 801026a3: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 801026a5: 89 c8 mov %ecx,%eax shift ^= togglecode[data]; 801026a7: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 c = charcode[shift & (CTL | SHIFT)][data]; 801026ad: 83 e0 03 and $0x3,%eax if(shift & CAPSLOCK){ 801026b0: 83 e1 08 and $0x8,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 801026b3: 8b 04 85 60 73 10 80 mov -0x7fef8ca0(,%eax,4),%eax 801026ba: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if(shift & CAPSLOCK){ 801026be: 74 31 je 801026f1 <kbdgetc+0xa1> if('a' <= c && c <= 'z') 801026c0: 8d 50 9f lea -0x61(%eax),%edx 801026c3: 83 fa 19 cmp $0x19,%edx 801026c6: 77 40 ja 80102708 <kbdgetc+0xb8> c += 'A' - 'a'; 801026c8: 83 e8 20 sub $0x20,%eax else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801026cb: 5b pop %ebx 801026cc: 5d pop %ebp 801026cd: c3 ret 801026ce: 66 90 xchg %ax,%ax data = (shift & E0ESC ? data : data & 0x7F); 801026d0: 83 e0 7f and $0x7f,%eax 801026d3: 85 db test %ebx,%ebx 801026d5: 0f 44 d0 cmove %eax,%edx shift &= ~(shiftcode[data] | E0ESC); 801026d8: 0f b6 82 80 74 10 80 movzbl -0x7fef8b80(%edx),%eax 801026df: 83 c8 40 or $0x40,%eax 801026e2: 0f b6 c0 movzbl %al,%eax 801026e5: f7 d0 not %eax 801026e7: 21 c1 and %eax,%ecx return 0; 801026e9: 31 c0 xor %eax,%eax shift &= ~(shiftcode[data] | E0ESC); 801026eb: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 } 801026f1: 5b pop %ebx 801026f2: 5d pop %ebp 801026f3: c3 ret 801026f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift |= E0ESC; 801026f8: 83 c9 40 or $0x40,%ecx return 0; 801026fb: 31 c0 xor %eax,%eax shift |= E0ESC; 801026fd: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 return 0; 80102703: c3 ret 80102704: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi else if('A' <= c && c <= 'Z') 80102708: 8d 48 bf lea -0x41(%eax),%ecx c += 'a' - 'A'; 8010270b: 8d 50 20 lea 0x20(%eax),%edx } 8010270e: 5b pop %ebx c += 'a' - 'A'; 8010270f: 83 f9 1a cmp $0x1a,%ecx 80102712: 0f 42 c2 cmovb %edx,%eax } 80102715: 5d pop %ebp 80102716: c3 ret 80102717: 89 f6 mov %esi,%esi 80102719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80102720: b8 ff ff ff ff mov $0xffffffff,%eax } 80102725: c3 ret 80102726: 8d 76 00 lea 0x0(%esi),%esi 80102729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102730 <kbdintr>: void kbdintr(void) { 80102730: 55 push %ebp 80102731: 89 e5 mov %esp,%ebp 80102733: 83 ec 14 sub $0x14,%esp consoleintr(kbdgetc); 80102736: 68 50 26 10 80 push $0x80102650 8010273b: e8 d0 e0 ff ff call 80100810 <consoleintr> } 80102740: 83 c4 10 add $0x10,%esp 80102743: c9 leave 80102744: c3 ret 80102745: 66 90 xchg %ax,%ax 80102747: 66 90 xchg %ax,%ax 80102749: 66 90 xchg %ax,%ax 8010274b: 66 90 xchg %ax,%ax 8010274d: 66 90 xchg %ax,%ax 8010274f: 90 nop 80102750 <lapicinit>: } void lapicinit(void) { if(!lapic) 80102750: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102755: 55 push %ebp 80102756: 89 e5 mov %esp,%ebp if(!lapic) 80102758: 85 c0 test %eax,%eax 8010275a: 0f 84 c8 00 00 00 je 80102828 <lapicinit+0xd8> lapic[index] = value; 80102760: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax) 80102767: 01 00 00 lapic[ID]; // wait for write to finish, by reading 8010276a: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010276d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax) 80102774: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102777: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010277a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax) 80102781: 00 02 00 lapic[ID]; // wait for write to finish, by reading 80102784: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102787: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax) 8010278e: 96 98 00 lapic[ID]; // wait for write to finish, by reading 80102791: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102794: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax) 8010279b: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010279e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027a1: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax) 801027a8: 00 01 00 lapic[ID]; // wait for write to finish, by reading 801027ab: 8b 50 20 mov 0x20(%eax),%edx lapicw(LINT0, MASKED); lapicw(LINT1, MASKED); // Disable performance counter overflow interrupts // on machines that provide that interrupt entry. if(((lapic[VER]>>16) & 0xFF) >= 4) 801027ae: 8b 50 30 mov 0x30(%eax),%edx 801027b1: c1 ea 10 shr $0x10,%edx 801027b4: 80 fa 03 cmp $0x3,%dl 801027b7: 77 77 ja 80102830 <lapicinit+0xe0> lapic[index] = value; 801027b9: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax) 801027c0: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027c3: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027c6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801027cd: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027d0: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027d3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801027da: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027dd: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027e0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 801027e7: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027ea: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027ed: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax) 801027f4: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801027f7: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027fa: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax) 80102801: 85 08 00 lapic[ID]; // wait for write to finish, by reading 80102804: 8b 50 20 mov 0x20(%eax),%edx 80102807: 89 f6 mov %esi,%esi 80102809: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapicw(EOI, 0); // Send an Init Level De-Assert to synchronise arbitration ID's. lapicw(ICRHI, 0); lapicw(ICRLO, BCAST | INIT | LEVEL); while(lapic[ICRLO] & DELIVS) 80102810: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 80102816: 80 e6 10 and $0x10,%dh 80102819: 75 f5 jne 80102810 <lapicinit+0xc0> lapic[index] = value; 8010281b: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax) 80102822: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102825: 8b 40 20 mov 0x20(%eax),%eax ; // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 80102828: 5d pop %ebp 80102829: c3 ret 8010282a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi lapic[index] = value; 80102830: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax) 80102837: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010283a: 8b 50 20 mov 0x20(%eax),%edx 8010283d: e9 77 ff ff ff jmp 801027b9 <lapicinit+0x69> 80102842: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102849: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102850 <lapicid>: int lapicid(void) { if (!lapic) 80102850: 8b 15 7c 26 11 80 mov 0x8011267c,%edx { 80102856: 55 push %ebp 80102857: 31 c0 xor %eax,%eax 80102859: 89 e5 mov %esp,%ebp if (!lapic) 8010285b: 85 d2 test %edx,%edx 8010285d: 74 06 je 80102865 <lapicid+0x15> return 0; return lapic[ID] >> 24; 8010285f: 8b 42 20 mov 0x20(%edx),%eax 80102862: c1 e8 18 shr $0x18,%eax } 80102865: 5d pop %ebp 80102866: c3 ret 80102867: 89 f6 mov %esi,%esi 80102869: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102870 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { if(lapic) 80102870: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102875: 55 push %ebp 80102876: 89 e5 mov %esp,%ebp if(lapic) 80102878: 85 c0 test %eax,%eax 8010287a: 74 0d je 80102889 <lapiceoi+0x19> lapic[index] = value; 8010287c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102883: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102886: 8b 40 20 mov 0x20(%eax),%eax lapicw(EOI, 0); } 80102889: 5d pop %ebp 8010288a: c3 ret 8010288b: 90 nop 8010288c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102890 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80102890: 55 push %ebp 80102891: 89 e5 mov %esp,%ebp } 80102893: 5d pop %ebp 80102894: c3 ret 80102895: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102899: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801028a0 <lapicstartap>: // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 801028a0: 55 push %ebp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028a1: b8 0f 00 00 00 mov $0xf,%eax 801028a6: ba 70 00 00 00 mov $0x70,%edx 801028ab: 89 e5 mov %esp,%ebp 801028ad: 53 push %ebx 801028ae: 8b 4d 0c mov 0xc(%ebp),%ecx 801028b1: 8b 5d 08 mov 0x8(%ebp),%ebx 801028b4: ee out %al,(%dx) 801028b5: b8 0a 00 00 00 mov $0xa,%eax 801028ba: ba 71 00 00 00 mov $0x71,%edx 801028bf: ee out %al,(%dx) // and the warm reset vector (DWORD based at 40:67) to point at // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT+1, 0x0A); wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector wrv[0] = 0; 801028c0: 31 c0 xor %eax,%eax wrv[1] = addr >> 4; // "Universal startup algorithm." // Send INIT (level-triggered) interrupt to reset other CPU. lapicw(ICRHI, apicid<<24); 801028c2: c1 e3 18 shl $0x18,%ebx wrv[0] = 0; 801028c5: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 801028cb: 89 c8 mov %ecx,%eax // when it is in the halted state due to an INIT. So the second // should be ignored, but it is part of the official Intel algorithm. // Bochs complains about the second one. Too bad for Bochs. for(i = 0; i < 2; i++){ lapicw(ICRHI, apicid<<24); lapicw(ICRLO, STARTUP | (addr>>12)); 801028cd: c1 e9 0c shr $0xc,%ecx wrv[1] = addr >> 4; 801028d0: c1 e8 04 shr $0x4,%eax lapicw(ICRHI, apicid<<24); 801028d3: 89 da mov %ebx,%edx lapicw(ICRLO, STARTUP | (addr>>12)); 801028d5: 80 cd 06 or $0x6,%ch wrv[1] = addr >> 4; 801028d8: 66 a3 69 04 00 80 mov %ax,0x80000469 lapic[index] = value; 801028de: a1 7c 26 11 80 mov 0x8011267c,%eax 801028e3: 89 98 10 03 00 00 mov %ebx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801028e9: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801028ec: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 801028f3: c5 00 00 lapic[ID]; // wait for write to finish, by reading 801028f6: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801028f9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 80102900: 85 00 00 lapic[ID]; // wait for write to finish, by reading 80102903: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 80102906: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 8010290c: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 8010290f: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102915: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 80102918: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 8010291e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102921: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102927: 8b 40 20 mov 0x20(%eax),%eax microdelay(200); } } 8010292a: 5b pop %ebx 8010292b: 5d pop %ebp 8010292c: c3 ret 8010292d: 8d 76 00 lea 0x0(%esi),%esi 80102930 <cmostime>: } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 80102930: 55 push %ebp 80102931: b8 0b 00 00 00 mov $0xb,%eax 80102936: ba 70 00 00 00 mov $0x70,%edx 8010293b: 89 e5 mov %esp,%ebp 8010293d: 57 push %edi 8010293e: 56 push %esi 8010293f: 53 push %ebx 80102940: 83 ec 4c sub $0x4c,%esp 80102943: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102944: ba 71 00 00 00 mov $0x71,%edx 80102949: ec in (%dx),%al 8010294a: 83 e0 04 and $0x4,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010294d: bb 70 00 00 00 mov $0x70,%ebx 80102952: 88 45 b3 mov %al,-0x4d(%ebp) 80102955: 8d 76 00 lea 0x0(%esi),%esi 80102958: 31 c0 xor %eax,%eax 8010295a: 89 da mov %ebx,%edx 8010295c: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010295d: b9 71 00 00 00 mov $0x71,%ecx 80102962: 89 ca mov %ecx,%edx 80102964: ec in (%dx),%al 80102965: 88 45 b7 mov %al,-0x49(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102968: 89 da mov %ebx,%edx 8010296a: b8 02 00 00 00 mov $0x2,%eax 8010296f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102970: 89 ca mov %ecx,%edx 80102972: ec in (%dx),%al 80102973: 88 45 b6 mov %al,-0x4a(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102976: 89 da mov %ebx,%edx 80102978: b8 04 00 00 00 mov $0x4,%eax 8010297d: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010297e: 89 ca mov %ecx,%edx 80102980: ec in (%dx),%al 80102981: 88 45 b5 mov %al,-0x4b(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102984: 89 da mov %ebx,%edx 80102986: b8 07 00 00 00 mov $0x7,%eax 8010298b: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010298c: 89 ca mov %ecx,%edx 8010298e: ec in (%dx),%al 8010298f: 88 45 b4 mov %al,-0x4c(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102992: 89 da mov %ebx,%edx 80102994: b8 08 00 00 00 mov $0x8,%eax 80102999: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010299a: 89 ca mov %ecx,%edx 8010299c: ec in (%dx),%al 8010299d: 89 c7 mov %eax,%edi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010299f: 89 da mov %ebx,%edx 801029a1: b8 09 00 00 00 mov $0x9,%eax 801029a6: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029a7: 89 ca mov %ecx,%edx 801029a9: ec in (%dx),%al 801029aa: 89 c6 mov %eax,%esi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029ac: 89 da mov %ebx,%edx 801029ae: b8 0a 00 00 00 mov $0xa,%eax 801029b3: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029b4: 89 ca mov %ecx,%edx 801029b6: ec in (%dx),%al bcd = (sb & (1 << 2)) == 0; // make sure CMOS doesn't modify time while we read it for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) 801029b7: 84 c0 test %al,%al 801029b9: 78 9d js 80102958 <cmostime+0x28> return inb(CMOS_RETURN); 801029bb: 0f b6 45 b7 movzbl -0x49(%ebp),%eax 801029bf: 89 fa mov %edi,%edx 801029c1: 0f b6 fa movzbl %dl,%edi 801029c4: 89 f2 mov %esi,%edx 801029c6: 0f b6 f2 movzbl %dl,%esi 801029c9: 89 7d c8 mov %edi,-0x38(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029cc: 89 da mov %ebx,%edx 801029ce: 89 75 cc mov %esi,-0x34(%ebp) 801029d1: 89 45 b8 mov %eax,-0x48(%ebp) 801029d4: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax 801029d8: 89 45 bc mov %eax,-0x44(%ebp) 801029db: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax 801029df: 89 45 c0 mov %eax,-0x40(%ebp) 801029e2: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax 801029e6: 89 45 c4 mov %eax,-0x3c(%ebp) 801029e9: 31 c0 xor %eax,%eax 801029eb: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029ec: 89 ca mov %ecx,%edx 801029ee: ec in (%dx),%al 801029ef: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029f2: 89 da mov %ebx,%edx 801029f4: 89 45 d0 mov %eax,-0x30(%ebp) 801029f7: b8 02 00 00 00 mov $0x2,%eax 801029fc: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029fd: 89 ca mov %ecx,%edx 801029ff: ec in (%dx),%al 80102a00: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102a03: 89 da mov %ebx,%edx 80102a05: 89 45 d4 mov %eax,-0x2c(%ebp) 80102a08: b8 04 00 00 00 mov $0x4,%eax 80102a0d: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a0e: 89 ca mov %ecx,%edx 80102a10: ec in (%dx),%al 80102a11: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102a14: 89 da mov %ebx,%edx 80102a16: 89 45 d8 mov %eax,-0x28(%ebp) 80102a19: b8 07 00 00 00 mov $0x7,%eax 80102a1e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a1f: 89 ca mov %ecx,%edx 80102a21: ec in (%dx),%al 80102a22: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102a25: 89 da mov %ebx,%edx 80102a27: 89 45 dc mov %eax,-0x24(%ebp) 80102a2a: b8 08 00 00 00 mov $0x8,%eax 80102a2f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a30: 89 ca mov %ecx,%edx 80102a32: ec in (%dx),%al 80102a33: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102a36: 89 da mov %ebx,%edx 80102a38: 89 45 e0 mov %eax,-0x20(%ebp) 80102a3b: b8 09 00 00 00 mov $0x9,%eax 80102a40: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a41: 89 ca mov %ecx,%edx 80102a43: ec in (%dx),%al 80102a44: 0f b6 c0 movzbl %al,%eax continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 80102a47: 83 ec 04 sub $0x4,%esp return inb(CMOS_RETURN); 80102a4a: 89 45 e4 mov %eax,-0x1c(%ebp) if(memcmp(&t1, &t2, sizeof(t1)) == 0) 80102a4d: 8d 45 d0 lea -0x30(%ebp),%eax 80102a50: 6a 18 push $0x18 80102a52: 50 push %eax 80102a53: 8d 45 b8 lea -0x48(%ebp),%eax 80102a56: 50 push %eax 80102a57: e8 84 1b 00 00 call 801045e0 <memcmp> 80102a5c: 83 c4 10 add $0x10,%esp 80102a5f: 85 c0 test %eax,%eax 80102a61: 0f 85 f1 fe ff ff jne 80102958 <cmostime+0x28> break; } // convert if(bcd) { 80102a67: 80 7d b3 00 cmpb $0x0,-0x4d(%ebp) 80102a6b: 75 78 jne 80102ae5 <cmostime+0x1b5> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 80102a6d: 8b 45 b8 mov -0x48(%ebp),%eax 80102a70: 89 c2 mov %eax,%edx 80102a72: 83 e0 0f and $0xf,%eax 80102a75: c1 ea 04 shr $0x4,%edx 80102a78: 8d 14 92 lea (%edx,%edx,4),%edx 80102a7b: 8d 04 50 lea (%eax,%edx,2),%eax 80102a7e: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 80102a81: 8b 45 bc mov -0x44(%ebp),%eax 80102a84: 89 c2 mov %eax,%edx 80102a86: 83 e0 0f and $0xf,%eax 80102a89: c1 ea 04 shr $0x4,%edx 80102a8c: 8d 14 92 lea (%edx,%edx,4),%edx 80102a8f: 8d 04 50 lea (%eax,%edx,2),%eax 80102a92: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80102a95: 8b 45 c0 mov -0x40(%ebp),%eax 80102a98: 89 c2 mov %eax,%edx 80102a9a: 83 e0 0f and $0xf,%eax 80102a9d: c1 ea 04 shr $0x4,%edx 80102aa0: 8d 14 92 lea (%edx,%edx,4),%edx 80102aa3: 8d 04 50 lea (%eax,%edx,2),%eax 80102aa6: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80102aa9: 8b 45 c4 mov -0x3c(%ebp),%eax 80102aac: 89 c2 mov %eax,%edx 80102aae: 83 e0 0f and $0xf,%eax 80102ab1: c1 ea 04 shr $0x4,%edx 80102ab4: 8d 14 92 lea (%edx,%edx,4),%edx 80102ab7: 8d 04 50 lea (%eax,%edx,2),%eax 80102aba: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 80102abd: 8b 45 c8 mov -0x38(%ebp),%eax 80102ac0: 89 c2 mov %eax,%edx 80102ac2: 83 e0 0f and $0xf,%eax 80102ac5: c1 ea 04 shr $0x4,%edx 80102ac8: 8d 14 92 lea (%edx,%edx,4),%edx 80102acb: 8d 04 50 lea (%eax,%edx,2),%eax 80102ace: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 80102ad1: 8b 45 cc mov -0x34(%ebp),%eax 80102ad4: 89 c2 mov %eax,%edx 80102ad6: 83 e0 0f and $0xf,%eax 80102ad9: c1 ea 04 shr $0x4,%edx 80102adc: 8d 14 92 lea (%edx,%edx,4),%edx 80102adf: 8d 04 50 lea (%eax,%edx,2),%eax 80102ae2: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 80102ae5: 8b 75 08 mov 0x8(%ebp),%esi 80102ae8: 8b 45 b8 mov -0x48(%ebp),%eax 80102aeb: 89 06 mov %eax,(%esi) 80102aed: 8b 45 bc mov -0x44(%ebp),%eax 80102af0: 89 46 04 mov %eax,0x4(%esi) 80102af3: 8b 45 c0 mov -0x40(%ebp),%eax 80102af6: 89 46 08 mov %eax,0x8(%esi) 80102af9: 8b 45 c4 mov -0x3c(%ebp),%eax 80102afc: 89 46 0c mov %eax,0xc(%esi) 80102aff: 8b 45 c8 mov -0x38(%ebp),%eax 80102b02: 89 46 10 mov %eax,0x10(%esi) 80102b05: 8b 45 cc mov -0x34(%ebp),%eax 80102b08: 89 46 14 mov %eax,0x14(%esi) r->year += 2000; 80102b0b: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi) } 80102b12: 8d 65 f4 lea -0xc(%ebp),%esp 80102b15: 5b pop %ebx 80102b16: 5e pop %esi 80102b17: 5f pop %edi 80102b18: 5d pop %ebp 80102b19: c3 ret 80102b1a: 66 90 xchg %ax,%ax 80102b1c: 66 90 xchg %ax,%ax 80102b1e: 66 90 xchg %ax,%ax 80102b20 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102b20: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102b26: 85 c9 test %ecx,%ecx 80102b28: 0f 8e 8a 00 00 00 jle 80102bb8 <install_trans+0x98> { 80102b2e: 55 push %ebp 80102b2f: 89 e5 mov %esp,%ebp 80102b31: 57 push %edi 80102b32: 56 push %esi 80102b33: 53 push %ebx for (tail = 0; tail < log.lh.n; tail++) { 80102b34: 31 db xor %ebx,%ebx { 80102b36: 83 ec 0c sub $0xc,%esp 80102b39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 80102b40: a1 b4 26 11 80 mov 0x801126b4,%eax 80102b45: 83 ec 08 sub $0x8,%esp 80102b48: 01 d8 add %ebx,%eax 80102b4a: 83 c0 01 add $0x1,%eax 80102b4d: 50 push %eax 80102b4e: ff 35 c4 26 11 80 pushl 0x801126c4 80102b54: e8 77 d5 ff ff call 801000d0 <bread> 80102b59: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102b5b: 58 pop %eax 80102b5c: 5a pop %edx 80102b5d: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102b64: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102b6a: 83 c3 01 add $0x1,%ebx struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102b6d: e8 5e d5 ff ff call 801000d0 <bread> 80102b72: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80102b74: 8d 47 5c lea 0x5c(%edi),%eax 80102b77: 83 c4 0c add $0xc,%esp 80102b7a: 68 00 02 00 00 push $0x200 80102b7f: 50 push %eax 80102b80: 8d 46 5c lea 0x5c(%esi),%eax 80102b83: 50 push %eax 80102b84: e8 b7 1a 00 00 call 80104640 <memmove> bwrite(dbuf); // write dst to disk 80102b89: 89 34 24 mov %esi,(%esp) 80102b8c: e8 0f d6 ff ff call 801001a0 <bwrite> brelse(lbuf); 80102b91: 89 3c 24 mov %edi,(%esp) 80102b94: e8 47 d6 ff ff call 801001e0 <brelse> brelse(dbuf); 80102b99: 89 34 24 mov %esi,(%esp) 80102b9c: e8 3f d6 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102ba1: 83 c4 10 add $0x10,%esp 80102ba4: 39 1d c8 26 11 80 cmp %ebx,0x801126c8 80102baa: 7f 94 jg 80102b40 <install_trans+0x20> } } 80102bac: 8d 65 f4 lea -0xc(%ebp),%esp 80102baf: 5b pop %ebx 80102bb0: 5e pop %esi 80102bb1: 5f pop %edi 80102bb2: 5d pop %ebp 80102bb3: c3 ret 80102bb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102bb8: f3 c3 repz ret 80102bba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102bc0 <write_head>: // Write in-memory log header to disk. // This is the true point at which the // current transaction commits. static void write_head(void) { 80102bc0: 55 push %ebp 80102bc1: 89 e5 mov %esp,%ebp 80102bc3: 56 push %esi 80102bc4: 53 push %ebx struct buf *buf = bread(log.dev, log.start); 80102bc5: 83 ec 08 sub $0x8,%esp 80102bc8: ff 35 b4 26 11 80 pushl 0x801126b4 80102bce: ff 35 c4 26 11 80 pushl 0x801126c4 80102bd4: e8 f7 d4 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102bd9: 8b 1d c8 26 11 80 mov 0x801126c8,%ebx for (i = 0; i < log.lh.n; i++) { 80102bdf: 83 c4 10 add $0x10,%esp struct buf *buf = bread(log.dev, log.start); 80102be2: 89 c6 mov %eax,%esi for (i = 0; i < log.lh.n; i++) { 80102be4: 85 db test %ebx,%ebx hb->n = log.lh.n; 80102be6: 89 58 5c mov %ebx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80102be9: 7e 16 jle 80102c01 <write_head+0x41> 80102beb: c1 e3 02 shl $0x2,%ebx 80102bee: 31 d2 xor %edx,%edx hb->block[i] = log.lh.block[i]; 80102bf0: 8b 8a cc 26 11 80 mov -0x7feed934(%edx),%ecx 80102bf6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1) 80102bfa: 83 c2 04 add $0x4,%edx for (i = 0; i < log.lh.n; i++) { 80102bfd: 39 da cmp %ebx,%edx 80102bff: 75 ef jne 80102bf0 <write_head+0x30> } bwrite(buf); 80102c01: 83 ec 0c sub $0xc,%esp 80102c04: 56 push %esi 80102c05: e8 96 d5 ff ff call 801001a0 <bwrite> brelse(buf); 80102c0a: 89 34 24 mov %esi,(%esp) 80102c0d: e8 ce d5 ff ff call 801001e0 <brelse> } 80102c12: 83 c4 10 add $0x10,%esp 80102c15: 8d 65 f8 lea -0x8(%ebp),%esp 80102c18: 5b pop %ebx 80102c19: 5e pop %esi 80102c1a: 5d pop %ebp 80102c1b: c3 ret 80102c1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102c20 <initlog>: { 80102c20: 55 push %ebp 80102c21: 89 e5 mov %esp,%ebp 80102c23: 53 push %ebx 80102c24: 83 ec 2c sub $0x2c,%esp 80102c27: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&log.lock, "log"); 80102c2a: 68 80 75 10 80 push $0x80107580 80102c2f: 68 80 26 11 80 push $0x80112680 80102c34: e8 07 17 00 00 call 80104340 <initlock> readsb(dev, &sb); 80102c39: 58 pop %eax 80102c3a: 8d 45 dc lea -0x24(%ebp),%eax 80102c3d: 5a pop %edx 80102c3e: 50 push %eax 80102c3f: 53 push %ebx 80102c40: e8 8b e7 ff ff call 801013d0 <readsb> log.size = sb.nlog; 80102c45: 8b 55 e8 mov -0x18(%ebp),%edx log.start = sb.logstart; 80102c48: 8b 45 ec mov -0x14(%ebp),%eax struct buf *buf = bread(log.dev, log.start); 80102c4b: 59 pop %ecx log.dev = dev; 80102c4c: 89 1d c4 26 11 80 mov %ebx,0x801126c4 log.size = sb.nlog; 80102c52: 89 15 b8 26 11 80 mov %edx,0x801126b8 log.start = sb.logstart; 80102c58: a3 b4 26 11 80 mov %eax,0x801126b4 struct buf *buf = bread(log.dev, log.start); 80102c5d: 5a pop %edx 80102c5e: 50 push %eax 80102c5f: 53 push %ebx 80102c60: e8 6b d4 ff ff call 801000d0 <bread> log.lh.n = lh->n; 80102c65: 8b 58 5c mov 0x5c(%eax),%ebx for (i = 0; i < log.lh.n; i++) { 80102c68: 83 c4 10 add $0x10,%esp 80102c6b: 85 db test %ebx,%ebx log.lh.n = lh->n; 80102c6d: 89 1d c8 26 11 80 mov %ebx,0x801126c8 for (i = 0; i < log.lh.n; i++) { 80102c73: 7e 1c jle 80102c91 <initlog+0x71> 80102c75: c1 e3 02 shl $0x2,%ebx 80102c78: 31 d2 xor %edx,%edx 80102c7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = lh->block[i]; 80102c80: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80102c84: 83 c2 04 add $0x4,%edx 80102c87: 89 8a c8 26 11 80 mov %ecx,-0x7feed938(%edx) for (i = 0; i < log.lh.n; i++) { 80102c8d: 39 d3 cmp %edx,%ebx 80102c8f: 75 ef jne 80102c80 <initlog+0x60> brelse(buf); 80102c91: 83 ec 0c sub $0xc,%esp 80102c94: 50 push %eax 80102c95: e8 46 d5 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102c9a: e8 81 fe ff ff call 80102b20 <install_trans> log.lh.n = 0; 80102c9f: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102ca6: 00 00 00 write_head(); // clear the log 80102ca9: e8 12 ff ff ff call 80102bc0 <write_head> } 80102cae: 83 c4 10 add $0x10,%esp 80102cb1: 8b 5d fc mov -0x4(%ebp),%ebx 80102cb4: c9 leave 80102cb5: c3 ret 80102cb6: 8d 76 00 lea 0x0(%esi),%esi 80102cb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102cc0 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102cc0: 55 push %ebp 80102cc1: 89 e5 mov %esp,%ebp 80102cc3: 83 ec 14 sub $0x14,%esp acquire(&log.lock); 80102cc6: 68 80 26 11 80 push $0x80112680 80102ccb: e8 b0 17 00 00 call 80104480 <acquire> 80102cd0: 83 c4 10 add $0x10,%esp 80102cd3: eb 18 jmp 80102ced <begin_op+0x2d> 80102cd5: 8d 76 00 lea 0x0(%esi),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102cd8: 83 ec 08 sub $0x8,%esp 80102cdb: 68 80 26 11 80 push $0x80112680 80102ce0: 68 80 26 11 80 push $0x80112680 80102ce5: e8 d6 11 00 00 call 80103ec0 <sleep> 80102cea: 83 c4 10 add $0x10,%esp if(log.committing){ 80102ced: a1 c0 26 11 80 mov 0x801126c0,%eax 80102cf2: 85 c0 test %eax,%eax 80102cf4: 75 e2 jne 80102cd8 <begin_op+0x18> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102cf6: a1 bc 26 11 80 mov 0x801126bc,%eax 80102cfb: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102d01: 83 c0 01 add $0x1,%eax 80102d04: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102d07: 8d 14 4a lea (%edx,%ecx,2),%edx 80102d0a: 83 fa 1e cmp $0x1e,%edx 80102d0d: 7f c9 jg 80102cd8 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102d0f: 83 ec 0c sub $0xc,%esp log.outstanding += 1; 80102d12: a3 bc 26 11 80 mov %eax,0x801126bc release(&log.lock); 80102d17: 68 80 26 11 80 push $0x80112680 80102d1c: e8 1f 18 00 00 call 80104540 <release> break; } } } 80102d21: 83 c4 10 add $0x10,%esp 80102d24: c9 leave 80102d25: c3 ret 80102d26: 8d 76 00 lea 0x0(%esi),%esi 80102d29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102d30 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102d30: 55 push %ebp 80102d31: 89 e5 mov %esp,%ebp 80102d33: 57 push %edi 80102d34: 56 push %esi 80102d35: 53 push %ebx 80102d36: 83 ec 18 sub $0x18,%esp int do_commit = 0; acquire(&log.lock); 80102d39: 68 80 26 11 80 push $0x80112680 80102d3e: e8 3d 17 00 00 call 80104480 <acquire> log.outstanding -= 1; 80102d43: a1 bc 26 11 80 mov 0x801126bc,%eax if(log.committing) 80102d48: 8b 35 c0 26 11 80 mov 0x801126c0,%esi 80102d4e: 83 c4 10 add $0x10,%esp log.outstanding -= 1; 80102d51: 8d 58 ff lea -0x1(%eax),%ebx if(log.committing) 80102d54: 85 f6 test %esi,%esi log.outstanding -= 1; 80102d56: 89 1d bc 26 11 80 mov %ebx,0x801126bc if(log.committing) 80102d5c: 0f 85 1a 01 00 00 jne 80102e7c <end_op+0x14c> panic("log.committing"); if(log.outstanding == 0){ 80102d62: 85 db test %ebx,%ebx 80102d64: 0f 85 ee 00 00 00 jne 80102e58 <end_op+0x128> // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102d6a: 83 ec 0c sub $0xc,%esp log.committing = 1; 80102d6d: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0 80102d74: 00 00 00 release(&log.lock); 80102d77: 68 80 26 11 80 push $0x80112680 80102d7c: e8 bf 17 00 00 call 80104540 <release> } static void commit() { if (log.lh.n > 0) { 80102d81: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102d87: 83 c4 10 add $0x10,%esp 80102d8a: 85 c9 test %ecx,%ecx 80102d8c: 0f 8e 85 00 00 00 jle 80102e17 <end_op+0xe7> struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102d92: a1 b4 26 11 80 mov 0x801126b4,%eax 80102d97: 83 ec 08 sub $0x8,%esp 80102d9a: 01 d8 add %ebx,%eax 80102d9c: 83 c0 01 add $0x1,%eax 80102d9f: 50 push %eax 80102da0: ff 35 c4 26 11 80 pushl 0x801126c4 80102da6: e8 25 d3 ff ff call 801000d0 <bread> 80102dab: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102dad: 58 pop %eax 80102dae: 5a pop %edx 80102daf: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102db6: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102dbc: 83 c3 01 add $0x1,%ebx struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102dbf: e8 0c d3 ff ff call 801000d0 <bread> 80102dc4: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102dc6: 8d 40 5c lea 0x5c(%eax),%eax 80102dc9: 83 c4 0c add $0xc,%esp 80102dcc: 68 00 02 00 00 push $0x200 80102dd1: 50 push %eax 80102dd2: 8d 46 5c lea 0x5c(%esi),%eax 80102dd5: 50 push %eax 80102dd6: e8 65 18 00 00 call 80104640 <memmove> bwrite(to); // write the log 80102ddb: 89 34 24 mov %esi,(%esp) 80102dde: e8 bd d3 ff ff call 801001a0 <bwrite> brelse(from); 80102de3: 89 3c 24 mov %edi,(%esp) 80102de6: e8 f5 d3 ff ff call 801001e0 <brelse> brelse(to); 80102deb: 89 34 24 mov %esi,(%esp) 80102dee: e8 ed d3 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102df3: 83 c4 10 add $0x10,%esp 80102df6: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx 80102dfc: 7c 94 jl 80102d92 <end_op+0x62> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102dfe: e8 bd fd ff ff call 80102bc0 <write_head> install_trans(); // Now install writes to home locations 80102e03: e8 18 fd ff ff call 80102b20 <install_trans> log.lh.n = 0; 80102e08: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102e0f: 00 00 00 write_head(); // Erase the transaction from the log 80102e12: e8 a9 fd ff ff call 80102bc0 <write_head> acquire(&log.lock); 80102e17: 83 ec 0c sub $0xc,%esp 80102e1a: 68 80 26 11 80 push $0x80112680 80102e1f: e8 5c 16 00 00 call 80104480 <acquire> wakeup(&log); 80102e24: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) log.committing = 0; 80102e2b: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0 80102e32: 00 00 00 wakeup(&log); 80102e35: e8 36 12 00 00 call 80104070 <wakeup> release(&log.lock); 80102e3a: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102e41: e8 fa 16 00 00 call 80104540 <release> 80102e46: 83 c4 10 add $0x10,%esp } 80102e49: 8d 65 f4 lea -0xc(%ebp),%esp 80102e4c: 5b pop %ebx 80102e4d: 5e pop %esi 80102e4e: 5f pop %edi 80102e4f: 5d pop %ebp 80102e50: c3 ret 80102e51: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&log); 80102e58: 83 ec 0c sub $0xc,%esp 80102e5b: 68 80 26 11 80 push $0x80112680 80102e60: e8 0b 12 00 00 call 80104070 <wakeup> release(&log.lock); 80102e65: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102e6c: e8 cf 16 00 00 call 80104540 <release> 80102e71: 83 c4 10 add $0x10,%esp } 80102e74: 8d 65 f4 lea -0xc(%ebp),%esp 80102e77: 5b pop %ebx 80102e78: 5e pop %esi 80102e79: 5f pop %edi 80102e7a: 5d pop %ebp 80102e7b: c3 ret panic("log.committing"); 80102e7c: 83 ec 0c sub $0xc,%esp 80102e7f: 68 84 75 10 80 push $0x80107584 80102e84: e8 07 d5 ff ff call 80100390 <panic> 80102e89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102e90 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102e90: 55 push %ebp 80102e91: 89 e5 mov %esp,%ebp 80102e93: 53 push %ebx 80102e94: 83 ec 04 sub $0x4,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102e97: 8b 15 c8 26 11 80 mov 0x801126c8,%edx { 80102e9d: 8b 5d 08 mov 0x8(%ebp),%ebx if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102ea0: 83 fa 1d cmp $0x1d,%edx 80102ea3: 0f 8f 9d 00 00 00 jg 80102f46 <log_write+0xb6> 80102ea9: a1 b8 26 11 80 mov 0x801126b8,%eax 80102eae: 83 e8 01 sub $0x1,%eax 80102eb1: 39 c2 cmp %eax,%edx 80102eb3: 0f 8d 8d 00 00 00 jge 80102f46 <log_write+0xb6> panic("too big a transaction"); if (log.outstanding < 1) 80102eb9: a1 bc 26 11 80 mov 0x801126bc,%eax 80102ebe: 85 c0 test %eax,%eax 80102ec0: 0f 8e 8d 00 00 00 jle 80102f53 <log_write+0xc3> panic("log_write outside of trans"); acquire(&log.lock); 80102ec6: 83 ec 0c sub $0xc,%esp 80102ec9: 68 80 26 11 80 push $0x80112680 80102ece: e8 ad 15 00 00 call 80104480 <acquire> for (i = 0; i < log.lh.n; i++) { 80102ed3: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102ed9: 83 c4 10 add $0x10,%esp 80102edc: 83 f9 00 cmp $0x0,%ecx 80102edf: 7e 57 jle 80102f38 <log_write+0xa8> if (log.lh.block[i] == b->blockno) // log absorbtion 80102ee1: 8b 53 08 mov 0x8(%ebx),%edx for (i = 0; i < log.lh.n; i++) { 80102ee4: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102ee6: 3b 15 cc 26 11 80 cmp 0x801126cc,%edx 80102eec: 75 0b jne 80102ef9 <log_write+0x69> 80102eee: eb 38 jmp 80102f28 <log_write+0x98> 80102ef0: 39 14 85 cc 26 11 80 cmp %edx,-0x7feed934(,%eax,4) 80102ef7: 74 2f je 80102f28 <log_write+0x98> for (i = 0; i < log.lh.n; i++) { 80102ef9: 83 c0 01 add $0x1,%eax 80102efc: 39 c1 cmp %eax,%ecx 80102efe: 75 f0 jne 80102ef0 <log_write+0x60> break; } log.lh.block[i] = b->blockno; 80102f00: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) if (i == log.lh.n) log.lh.n++; 80102f07: 83 c0 01 add $0x1,%eax 80102f0a: a3 c8 26 11 80 mov %eax,0x801126c8 b->flags |= B_DIRTY; // prevent eviction 80102f0f: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102f12: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp) } 80102f19: 8b 5d fc mov -0x4(%ebp),%ebx 80102f1c: c9 leave release(&log.lock); 80102f1d: e9 1e 16 00 00 jmp 80104540 <release> 80102f22: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = b->blockno; 80102f28: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) 80102f2f: eb de jmp 80102f0f <log_write+0x7f> 80102f31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102f38: 8b 43 08 mov 0x8(%ebx),%eax 80102f3b: a3 cc 26 11 80 mov %eax,0x801126cc if (i == log.lh.n) 80102f40: 75 cd jne 80102f0f <log_write+0x7f> 80102f42: 31 c0 xor %eax,%eax 80102f44: eb c1 jmp 80102f07 <log_write+0x77> panic("too big a transaction"); 80102f46: 83 ec 0c sub $0xc,%esp 80102f49: 68 93 75 10 80 push $0x80107593 80102f4e: e8 3d d4 ff ff call 80100390 <panic> panic("log_write outside of trans"); 80102f53: 83 ec 0c sub $0xc,%esp 80102f56: 68 a9 75 10 80 push $0x801075a9 80102f5b: e8 30 d4 ff ff call 80100390 <panic> 80102f60 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102f60: 55 push %ebp 80102f61: 89 e5 mov %esp,%ebp 80102f63: 53 push %ebx 80102f64: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102f67: e8 74 09 00 00 call 801038e0 <cpuid> 80102f6c: 89 c3 mov %eax,%ebx 80102f6e: e8 6d 09 00 00 call 801038e0 <cpuid> 80102f73: 83 ec 04 sub $0x4,%esp 80102f76: 53 push %ebx 80102f77: 50 push %eax 80102f78: 68 c4 75 10 80 push $0x801075c4 80102f7d: e8 de d6 ff ff call 80100660 <cprintf> idtinit(); // load idt register 80102f82: e8 49 29 00 00 call 801058d0 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102f87: e8 d4 08 00 00 call 80103860 <mycpu> 80102f8c: 89 c2 mov %eax,%edx xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 80102f8e: b8 01 00 00 00 mov $0x1,%eax 80102f93: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102f9a: e8 41 0c 00 00 call 80103be0 <scheduler> 80102f9f: 90 nop 80102fa0 <mpenter>: { 80102fa0: 55 push %ebp 80102fa1: 89 e5 mov %esp,%ebp 80102fa3: 83 ec 08 sub $0x8,%esp switchkvm(); 80102fa6: e8 15 3a 00 00 call 801069c0 <switchkvm> seginit(); 80102fab: e8 80 39 00 00 call 80106930 <seginit> lapicinit(); 80102fb0: e8 9b f7 ff ff call 80102750 <lapicinit> mpmain(); 80102fb5: e8 a6 ff ff ff call 80102f60 <mpmain> 80102fba: 66 90 xchg %ax,%ax 80102fbc: 66 90 xchg %ax,%ax 80102fbe: 66 90 xchg %ax,%ax 80102fc0 <main>: { 80102fc0: 8d 4c 24 04 lea 0x4(%esp),%ecx 80102fc4: 83 e4 f0 and $0xfffffff0,%esp 80102fc7: ff 71 fc pushl -0x4(%ecx) 80102fca: 55 push %ebp 80102fcb: 89 e5 mov %esp,%ebp 80102fcd: 53 push %ebx 80102fce: 51 push %ecx kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102fcf: 83 ec 08 sub $0x8,%esp 80102fd2: 68 00 00 40 80 push $0x80400000 80102fd7: 68 a8 54 11 80 push $0x801154a8 80102fdc: e8 2f f5 ff ff call 80102510 <kinit1> kvmalloc(); // kernel page table 80102fe1: e8 aa 3e 00 00 call 80106e90 <kvmalloc> mpinit(); // detect other processors 80102fe6: e8 75 01 00 00 call 80103160 <mpinit> lapicinit(); // interrupt controller 80102feb: e8 60 f7 ff ff call 80102750 <lapicinit> seginit(); // segment descriptors 80102ff0: e8 3b 39 00 00 call 80106930 <seginit> picinit(); // disable pic 80102ff5: e8 46 03 00 00 call 80103340 <picinit> ioapicinit(); // another interrupt controller 80102ffa: e8 41 f3 ff ff call 80102340 <ioapicinit> consoleinit(); // console hardware 80102fff: e8 bc d9 ff ff call 801009c0 <consoleinit> uartinit(); // serial port 80103004: e8 f7 2b 00 00 call 80105c00 <uartinit> pinit(); // process table 80103009: e8 32 08 00 00 call 80103840 <pinit> tvinit(); // trap vectors 8010300e: e8 3d 28 00 00 call 80105850 <tvinit> binit(); // buffer cache 80103013: e8 28 d0 ff ff call 80100040 <binit> fileinit(); // file table 80103018: e8 43 dd ff ff call 80100d60 <fileinit> ideinit(); // disk 8010301d: e8 fe f0 ff ff call 80102120 <ideinit> // Write entry code to unused memory at 0x7000. // The linker has placed the image of entryother.S in // _binary_entryother_start. code = P2V(0x7000); memmove(code, _binary_entryother_start, (uint)_binary_entryother_size); 80103022: 83 c4 0c add $0xc,%esp 80103025: 68 8a 00 00 00 push $0x8a 8010302a: 68 8c a4 10 80 push $0x8010a48c 8010302f: 68 00 70 00 80 push $0x80007000 80103034: e8 07 16 00 00 call 80104640 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80103039: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80103040: 00 00 00 80103043: 83 c4 10 add $0x10,%esp 80103046: 05 80 27 11 80 add $0x80112780,%eax 8010304b: 3d 80 27 11 80 cmp $0x80112780,%eax 80103050: 76 71 jbe 801030c3 <main+0x103> 80103052: bb 80 27 11 80 mov $0x80112780,%ebx 80103057: 89 f6 mov %esi,%esi 80103059: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(c == mycpu()) // We've started already. 80103060: e8 fb 07 00 00 call 80103860 <mycpu> 80103065: 39 d8 cmp %ebx,%eax 80103067: 74 41 je 801030aa <main+0xea> continue; // Tell entryother.S what stack to use, where to enter, and what // pgdir to use. We cannot use kpgdir yet, because the AP processor // is running in low memory, so we use entrypgdir for the APs too. stack = kalloc(); 80103069: e8 72 f5 ff ff call 801025e0 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; 8010306e: 05 00 10 00 00 add $0x1000,%eax *(void(**)(void))(code-8) = mpenter; 80103073: c7 05 f8 6f 00 80 a0 movl $0x80102fa0,0x80006ff8 8010307a: 2f 10 80 *(int**)(code-12) = (void *) V2P(entrypgdir); 8010307d: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4 80103084: 90 10 00 *(void**)(code-4) = stack + KSTACKSIZE; 80103087: a3 fc 6f 00 80 mov %eax,0x80006ffc lapicstartap(c->apicid, V2P(code)); 8010308c: 0f b6 03 movzbl (%ebx),%eax 8010308f: 83 ec 08 sub $0x8,%esp 80103092: 68 00 70 00 00 push $0x7000 80103097: 50 push %eax 80103098: e8 03 f8 ff ff call 801028a0 <lapicstartap> 8010309d: 83 c4 10 add $0x10,%esp // wait for cpu to finish mpmain() while(c->started == 0) 801030a0: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 801030a6: 85 c0 test %eax,%eax 801030a8: 74 f6 je 801030a0 <main+0xe0> for(c = cpus; c < cpus+ncpu; c++){ 801030aa: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 801030b1: 00 00 00 801030b4: 81 c3 b0 00 00 00 add $0xb0,%ebx 801030ba: 05 80 27 11 80 add $0x80112780,%eax 801030bf: 39 c3 cmp %eax,%ebx 801030c1: 72 9d jb 80103060 <main+0xa0> kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 801030c3: 83 ec 08 sub $0x8,%esp 801030c6: 68 00 00 00 8e push $0x8e000000 801030cb: 68 00 00 40 80 push $0x80400000 801030d0: e8 ab f4 ff ff call 80102580 <kinit2> userinit(); // first user process 801030d5: e8 56 08 00 00 call 80103930 <userinit> mpmain(); // finish this processor's setup 801030da: e8 81 fe ff ff call 80102f60 <mpmain> 801030df: 90 nop 801030e0 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 801030e0: 55 push %ebp 801030e1: 89 e5 mov %esp,%ebp 801030e3: 57 push %edi 801030e4: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 801030e5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi { 801030eb: 53 push %ebx e = addr+len; 801030ec: 8d 1c 16 lea (%esi,%edx,1),%ebx { 801030ef: 83 ec 0c sub $0xc,%esp for(p = addr; p < e; p += sizeof(struct mp)) 801030f2: 39 de cmp %ebx,%esi 801030f4: 72 10 jb 80103106 <mpsearch1+0x26> 801030f6: eb 50 jmp 80103148 <mpsearch1+0x68> 801030f8: 90 nop 801030f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103100: 39 fb cmp %edi,%ebx 80103102: 89 fe mov %edi,%esi 80103104: 76 42 jbe 80103148 <mpsearch1+0x68> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80103106: 83 ec 04 sub $0x4,%esp 80103109: 8d 7e 10 lea 0x10(%esi),%edi 8010310c: 6a 04 push $0x4 8010310e: 68 d8 75 10 80 push $0x801075d8 80103113: 56 push %esi 80103114: e8 c7 14 00 00 call 801045e0 <memcmp> 80103119: 83 c4 10 add $0x10,%esp 8010311c: 85 c0 test %eax,%eax 8010311e: 75 e0 jne 80103100 <mpsearch1+0x20> 80103120: 89 f1 mov %esi,%ecx 80103122: 8d b6 00 00 00 00 lea 0x0(%esi),%esi sum += addr[i]; 80103128: 0f b6 11 movzbl (%ecx),%edx 8010312b: 83 c1 01 add $0x1,%ecx 8010312e: 01 d0 add %edx,%eax for(i=0; i<len; i++) 80103130: 39 f9 cmp %edi,%ecx 80103132: 75 f4 jne 80103128 <mpsearch1+0x48> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80103134: 84 c0 test %al,%al 80103136: 75 c8 jne 80103100 <mpsearch1+0x20> return (struct mp*)p; return 0; } 80103138: 8d 65 f4 lea -0xc(%ebp),%esp 8010313b: 89 f0 mov %esi,%eax 8010313d: 5b pop %ebx 8010313e: 5e pop %esi 8010313f: 5f pop %edi 80103140: 5d pop %ebp 80103141: c3 ret 80103142: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103148: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010314b: 31 f6 xor %esi,%esi } 8010314d: 89 f0 mov %esi,%eax 8010314f: 5b pop %ebx 80103150: 5e pop %esi 80103151: 5f pop %edi 80103152: 5d pop %ebp 80103153: c3 ret 80103154: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010315a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103160 <mpinit>: return conf; } void mpinit(void) { 80103160: 55 push %ebp 80103161: 89 e5 mov %esp,%ebp 80103163: 57 push %edi 80103164: 56 push %esi 80103165: 53 push %ebx 80103166: 83 ec 1c sub $0x1c,%esp if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 80103169: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80103170: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80103177: c1 e0 08 shl $0x8,%eax 8010317a: 09 d0 or %edx,%eax 8010317c: c1 e0 04 shl $0x4,%eax 8010317f: 85 c0 test %eax,%eax 80103181: 75 1b jne 8010319e <mpinit+0x3e> p = ((bda[0x14]<<8)|bda[0x13])*1024; 80103183: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 8010318a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80103191: c1 e0 08 shl $0x8,%eax 80103194: 09 d0 or %edx,%eax 80103196: c1 e0 0a shl $0xa,%eax if((mp = mpsearch1(p-1024, 1024))) 80103199: 2d 00 04 00 00 sub $0x400,%eax if((mp = mpsearch1(p, 1024))) 8010319e: ba 00 04 00 00 mov $0x400,%edx 801031a3: e8 38 ff ff ff call 801030e0 <mpsearch1> 801031a8: 85 c0 test %eax,%eax 801031aa: 89 45 e4 mov %eax,-0x1c(%ebp) 801031ad: 0f 84 3d 01 00 00 je 801032f0 <mpinit+0x190> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801031b3: 8b 45 e4 mov -0x1c(%ebp),%eax 801031b6: 8b 58 04 mov 0x4(%eax),%ebx 801031b9: 85 db test %ebx,%ebx 801031bb: 0f 84 4f 01 00 00 je 80103310 <mpinit+0x1b0> conf = (struct mpconf*) P2V((uint) mp->physaddr); 801031c1: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if(memcmp(conf, "PCMP", 4) != 0) 801031c7: 83 ec 04 sub $0x4,%esp 801031ca: 6a 04 push $0x4 801031cc: 68 f5 75 10 80 push $0x801075f5 801031d1: 56 push %esi 801031d2: e8 09 14 00 00 call 801045e0 <memcmp> 801031d7: 83 c4 10 add $0x10,%esp 801031da: 85 c0 test %eax,%eax 801031dc: 0f 85 2e 01 00 00 jne 80103310 <mpinit+0x1b0> if(conf->version != 1 && conf->version != 4) 801031e2: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 801031e9: 3c 01 cmp $0x1,%al 801031eb: 0f 95 c2 setne %dl 801031ee: 3c 04 cmp $0x4,%al 801031f0: 0f 95 c0 setne %al 801031f3: 20 c2 and %al,%dl 801031f5: 0f 85 15 01 00 00 jne 80103310 <mpinit+0x1b0> if(sum((uchar*)conf, conf->length) != 0) 801031fb: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi for(i=0; i<len; i++) 80103202: 66 85 ff test %di,%di 80103205: 74 1a je 80103221 <mpinit+0xc1> 80103207: 89 f0 mov %esi,%eax 80103209: 01 f7 add %esi,%edi sum = 0; 8010320b: 31 d2 xor %edx,%edx 8010320d: 8d 76 00 lea 0x0(%esi),%esi sum += addr[i]; 80103210: 0f b6 08 movzbl (%eax),%ecx 80103213: 83 c0 01 add $0x1,%eax 80103216: 01 ca add %ecx,%edx for(i=0; i<len; i++) 80103218: 39 c7 cmp %eax,%edi 8010321a: 75 f4 jne 80103210 <mpinit+0xb0> 8010321c: 84 d2 test %dl,%dl 8010321e: 0f 95 c2 setne %dl struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 80103221: 85 f6 test %esi,%esi 80103223: 0f 84 e7 00 00 00 je 80103310 <mpinit+0x1b0> 80103229: 84 d2 test %dl,%dl 8010322b: 0f 85 df 00 00 00 jne 80103310 <mpinit+0x1b0> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 80103231: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax 80103237: a3 7c 26 11 80 mov %eax,0x8011267c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010323c: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx 80103243: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax ismp = 1; 80103249: bb 01 00 00 00 mov $0x1,%ebx for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010324e: 01 d6 add %edx,%esi 80103250: 39 c6 cmp %eax,%esi 80103252: 76 23 jbe 80103277 <mpinit+0x117> switch(*p){ 80103254: 0f b6 10 movzbl (%eax),%edx 80103257: 80 fa 04 cmp $0x4,%dl 8010325a: 0f 87 ca 00 00 00 ja 8010332a <mpinit+0x1ca> 80103260: ff 24 95 1c 76 10 80 jmp *-0x7fef89e4(,%edx,4) 80103267: 89 f6 mov %esi,%esi 80103269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p += sizeof(struct mpioapic); continue; case MPBUS: case MPIOINTR: case MPLINTR: p += 8; 80103270: 83 c0 08 add $0x8,%eax for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 80103273: 39 c6 cmp %eax,%esi 80103275: 77 dd ja 80103254 <mpinit+0xf4> default: ismp = 0; break; } } if(!ismp) 80103277: 85 db test %ebx,%ebx 80103279: 0f 84 9e 00 00 00 je 8010331d <mpinit+0x1bd> panic("Didn't find a suitable machine"); if(mp->imcrp){ 8010327f: 8b 45 e4 mov -0x1c(%ebp),%eax 80103282: 80 78 0c 00 cmpb $0x0,0xc(%eax) 80103286: 74 15 je 8010329d <mpinit+0x13d> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103288: b8 70 00 00 00 mov $0x70,%eax 8010328d: ba 22 00 00 00 mov $0x22,%edx 80103292: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80103293: ba 23 00 00 00 mov $0x23,%edx 80103298: ec in (%dx),%al // Bochs doesn't support IMCR, so this doesn't run on Bochs. // But it would on real hardware. outb(0x22, 0x70); // Select IMCR outb(0x23, inb(0x23) | 1); // Mask external interrupts. 80103299: 83 c8 01 or $0x1,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010329c: ee out %al,(%dx) } } 8010329d: 8d 65 f4 lea -0xc(%ebp),%esp 801032a0: 5b pop %ebx 801032a1: 5e pop %esi 801032a2: 5f pop %edi 801032a3: 5d pop %ebp 801032a4: c3 ret 801032a5: 8d 76 00 lea 0x0(%esi),%esi if(ncpu < NCPU) { 801032a8: 8b 0d 00 2d 11 80 mov 0x80112d00,%ecx 801032ae: 83 f9 07 cmp $0x7,%ecx 801032b1: 7f 19 jg 801032cc <mpinit+0x16c> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801032b3: 0f b6 50 01 movzbl 0x1(%eax),%edx 801032b7: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi ncpu++; 801032bd: 83 c1 01 add $0x1,%ecx 801032c0: 89 0d 00 2d 11 80 mov %ecx,0x80112d00 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801032c6: 88 97 80 27 11 80 mov %dl,-0x7feed880(%edi) p += sizeof(struct mpproc); 801032cc: 83 c0 14 add $0x14,%eax continue; 801032cf: e9 7c ff ff ff jmp 80103250 <mpinit+0xf0> 801032d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ioapicid = ioapic->apicno; 801032d8: 0f b6 50 01 movzbl 0x1(%eax),%edx p += sizeof(struct mpioapic); 801032dc: 83 c0 08 add $0x8,%eax ioapicid = ioapic->apicno; 801032df: 88 15 60 27 11 80 mov %dl,0x80112760 continue; 801032e5: e9 66 ff ff ff jmp 80103250 <mpinit+0xf0> 801032ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return mpsearch1(0xF0000, 0x10000); 801032f0: ba 00 00 01 00 mov $0x10000,%edx 801032f5: b8 00 00 0f 00 mov $0xf0000,%eax 801032fa: e8 e1 fd ff ff call 801030e0 <mpsearch1> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801032ff: 85 c0 test %eax,%eax return mpsearch1(0xF0000, 0x10000); 80103301: 89 45 e4 mov %eax,-0x1c(%ebp) if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103304: 0f 85 a9 fe ff ff jne 801031b3 <mpinit+0x53> 8010330a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi panic("Expect to run on an SMP"); 80103310: 83 ec 0c sub $0xc,%esp 80103313: 68 dd 75 10 80 push $0x801075dd 80103318: e8 73 d0 ff ff call 80100390 <panic> panic("Didn't find a suitable machine"); 8010331d: 83 ec 0c sub $0xc,%esp 80103320: 68 fc 75 10 80 push $0x801075fc 80103325: e8 66 d0 ff ff call 80100390 <panic> ismp = 0; 8010332a: 31 db xor %ebx,%ebx 8010332c: e9 26 ff ff ff jmp 80103257 <mpinit+0xf7> 80103331: 66 90 xchg %ax,%ax 80103333: 66 90 xchg %ax,%ax 80103335: 66 90 xchg %ax,%ax 80103337: 66 90 xchg %ax,%ax 80103339: 66 90 xchg %ax,%ax 8010333b: 66 90 xchg %ax,%ax 8010333d: 66 90 xchg %ax,%ax 8010333f: 90 nop 80103340 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 80103340: 55 push %ebp 80103341: b8 ff ff ff ff mov $0xffffffff,%eax 80103346: ba 21 00 00 00 mov $0x21,%edx 8010334b: 89 e5 mov %esp,%ebp 8010334d: ee out %al,(%dx) 8010334e: ba a1 00 00 00 mov $0xa1,%edx 80103353: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 80103354: 5d pop %ebp 80103355: c3 ret 80103356: 66 90 xchg %ax,%ax 80103358: 66 90 xchg %ax,%ax 8010335a: 66 90 xchg %ax,%ax 8010335c: 66 90 xchg %ax,%ax 8010335e: 66 90 xchg %ax,%ax 80103360 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 80103360: 55 push %ebp 80103361: 89 e5 mov %esp,%ebp 80103363: 57 push %edi 80103364: 56 push %esi 80103365: 53 push %ebx 80103366: 83 ec 0c sub $0xc,%esp 80103369: 8b 5d 08 mov 0x8(%ebp),%ebx 8010336c: 8b 75 0c mov 0xc(%ebp),%esi struct pipe *p; p = 0; *f0 = *f1 = 0; 8010336f: c7 06 00 00 00 00 movl $0x0,(%esi) 80103375: c7 03 00 00 00 00 movl $0x0,(%ebx) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 8010337b: e8 00 da ff ff call 80100d80 <filealloc> 80103380: 85 c0 test %eax,%eax 80103382: 89 03 mov %eax,(%ebx) 80103384: 74 22 je 801033a8 <pipealloc+0x48> 80103386: e8 f5 d9 ff ff call 80100d80 <filealloc> 8010338b: 85 c0 test %eax,%eax 8010338d: 89 06 mov %eax,(%esi) 8010338f: 74 3f je 801033d0 <pipealloc+0x70> goto bad; if((p = (struct pipe*)kalloc()) == 0) 80103391: e8 4a f2 ff ff call 801025e0 <kalloc> 80103396: 85 c0 test %eax,%eax 80103398: 89 c7 mov %eax,%edi 8010339a: 75 54 jne 801033f0 <pipealloc+0x90> //PAGEBREAK: 20 bad: if(p) kfree((char*)p); if(*f0) 8010339c: 8b 03 mov (%ebx),%eax 8010339e: 85 c0 test %eax,%eax 801033a0: 75 34 jne 801033d6 <pipealloc+0x76> 801033a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi fileclose(*f0); if(*f1) 801033a8: 8b 06 mov (%esi),%eax 801033aa: 85 c0 test %eax,%eax 801033ac: 74 0c je 801033ba <pipealloc+0x5a> fileclose(*f1); 801033ae: 83 ec 0c sub $0xc,%esp 801033b1: 50 push %eax 801033b2: e8 89 da ff ff call 80100e40 <fileclose> 801033b7: 83 c4 10 add $0x10,%esp return -1; } 801033ba: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801033bd: b8 ff ff ff ff mov $0xffffffff,%eax } 801033c2: 5b pop %ebx 801033c3: 5e pop %esi 801033c4: 5f pop %edi 801033c5: 5d pop %ebp 801033c6: c3 ret 801033c7: 89 f6 mov %esi,%esi 801033c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(*f0) 801033d0: 8b 03 mov (%ebx),%eax 801033d2: 85 c0 test %eax,%eax 801033d4: 74 e4 je 801033ba <pipealloc+0x5a> fileclose(*f0); 801033d6: 83 ec 0c sub $0xc,%esp 801033d9: 50 push %eax 801033da: e8 61 da ff ff call 80100e40 <fileclose> if(*f1) 801033df: 8b 06 mov (%esi),%eax fileclose(*f0); 801033e1: 83 c4 10 add $0x10,%esp if(*f1) 801033e4: 85 c0 test %eax,%eax 801033e6: 75 c6 jne 801033ae <pipealloc+0x4e> 801033e8: eb d0 jmp 801033ba <pipealloc+0x5a> 801033ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi initlock(&p->lock, "pipe"); 801033f0: 83 ec 08 sub $0x8,%esp p->readopen = 1; 801033f3: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 801033fa: 00 00 00 p->writeopen = 1; 801033fd: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 80103404: 00 00 00 p->nwrite = 0; 80103407: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 8010340e: 00 00 00 p->nread = 0; 80103411: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 80103418: 00 00 00 initlock(&p->lock, "pipe"); 8010341b: 68 30 76 10 80 push $0x80107630 80103420: 50 push %eax 80103421: e8 1a 0f 00 00 call 80104340 <initlock> (*f0)->type = FD_PIPE; 80103426: 8b 03 mov (%ebx),%eax return 0; 80103428: 83 c4 10 add $0x10,%esp (*f0)->type = FD_PIPE; 8010342b: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 80103431: 8b 03 mov (%ebx),%eax 80103433: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 80103437: 8b 03 mov (%ebx),%eax 80103439: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 8010343d: 8b 03 mov (%ebx),%eax 8010343f: 89 78 0c mov %edi,0xc(%eax) (*f1)->type = FD_PIPE; 80103442: 8b 06 mov (%esi),%eax 80103444: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 8010344a: 8b 06 mov (%esi),%eax 8010344c: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103450: 8b 06 mov (%esi),%eax 80103452: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 80103456: 8b 06 mov (%esi),%eax 80103458: 89 78 0c mov %edi,0xc(%eax) } 8010345b: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010345e: 31 c0 xor %eax,%eax } 80103460: 5b pop %ebx 80103461: 5e pop %esi 80103462: 5f pop %edi 80103463: 5d pop %ebp 80103464: c3 ret 80103465: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103469: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103470 <pipeclose>: void pipeclose(struct pipe *p, int writable) { 80103470: 55 push %ebp 80103471: 89 e5 mov %esp,%ebp 80103473: 56 push %esi 80103474: 53 push %ebx 80103475: 8b 5d 08 mov 0x8(%ebp),%ebx 80103478: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 8010347b: 83 ec 0c sub $0xc,%esp 8010347e: 53 push %ebx 8010347f: e8 fc 0f 00 00 call 80104480 <acquire> if(writable){ 80103484: 83 c4 10 add $0x10,%esp 80103487: 85 f6 test %esi,%esi 80103489: 74 45 je 801034d0 <pipeclose+0x60> p->writeopen = 0; wakeup(&p->nread); 8010348b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103491: 83 ec 0c sub $0xc,%esp p->writeopen = 0; 80103494: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 8010349b: 00 00 00 wakeup(&p->nread); 8010349e: 50 push %eax 8010349f: e8 cc 0b 00 00 call 80104070 <wakeup> 801034a4: 83 c4 10 add $0x10,%esp } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 801034a7: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 801034ad: 85 d2 test %edx,%edx 801034af: 75 0a jne 801034bb <pipeclose+0x4b> 801034b1: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 801034b7: 85 c0 test %eax,%eax 801034b9: 74 35 je 801034f0 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else release(&p->lock); 801034bb: 89 5d 08 mov %ebx,0x8(%ebp) } 801034be: 8d 65 f8 lea -0x8(%ebp),%esp 801034c1: 5b pop %ebx 801034c2: 5e pop %esi 801034c3: 5d pop %ebp release(&p->lock); 801034c4: e9 77 10 00 00 jmp 80104540 <release> 801034c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&p->nwrite); 801034d0: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 801034d6: 83 ec 0c sub $0xc,%esp p->readopen = 0; 801034d9: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 801034e0: 00 00 00 wakeup(&p->nwrite); 801034e3: 50 push %eax 801034e4: e8 87 0b 00 00 call 80104070 <wakeup> 801034e9: 83 c4 10 add $0x10,%esp 801034ec: eb b9 jmp 801034a7 <pipeclose+0x37> 801034ee: 66 90 xchg %ax,%ax release(&p->lock); 801034f0: 83 ec 0c sub $0xc,%esp 801034f3: 53 push %ebx 801034f4: e8 47 10 00 00 call 80104540 <release> kfree((char*)p); 801034f9: 89 5d 08 mov %ebx,0x8(%ebp) 801034fc: 83 c4 10 add $0x10,%esp } 801034ff: 8d 65 f8 lea -0x8(%ebp),%esp 80103502: 5b pop %ebx 80103503: 5e pop %esi 80103504: 5d pop %ebp kfree((char*)p); 80103505: e9 26 ef ff ff jmp 80102430 <kfree> 8010350a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103510 <pipewrite>: //PAGEBREAK: 40 int pipewrite(struct pipe *p, char *addr, int n) { 80103510: 55 push %ebp 80103511: 89 e5 mov %esp,%ebp 80103513: 57 push %edi 80103514: 56 push %esi 80103515: 53 push %ebx 80103516: 83 ec 28 sub $0x28,%esp 80103519: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 8010351c: 53 push %ebx 8010351d: e8 5e 0f 00 00 call 80104480 <acquire> for(i = 0; i < n; i++){ 80103522: 8b 45 10 mov 0x10(%ebp),%eax 80103525: 83 c4 10 add $0x10,%esp 80103528: 85 c0 test %eax,%eax 8010352a: 0f 8e c9 00 00 00 jle 801035f9 <pipewrite+0xe9> 80103530: 8b 4d 0c mov 0xc(%ebp),%ecx 80103533: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full if(p->readopen == 0 || myproc()->killed){ release(&p->lock); return -1; } wakeup(&p->nread); 80103539: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi 8010353f: 89 4d e4 mov %ecx,-0x1c(%ebp) 80103542: 03 4d 10 add 0x10(%ebp),%ecx 80103545: 89 4d e0 mov %ecx,-0x20(%ebp) while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103548: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 8010354e: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx 80103554: 39 d0 cmp %edx,%eax 80103556: 75 71 jne 801035c9 <pipewrite+0xb9> if(p->readopen == 0 || myproc()->killed){ 80103558: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 8010355e: 85 c0 test %eax,%eax 80103560: 74 4e je 801035b0 <pipewrite+0xa0> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103562: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 80103568: eb 3a jmp 801035a4 <pipewrite+0x94> 8010356a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi wakeup(&p->nread); 80103570: 83 ec 0c sub $0xc,%esp 80103573: 57 push %edi 80103574: e8 f7 0a 00 00 call 80104070 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103579: 5a pop %edx 8010357a: 59 pop %ecx 8010357b: 53 push %ebx 8010357c: 56 push %esi 8010357d: e8 3e 09 00 00 call 80103ec0 <sleep> while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103582: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103588: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010358e: 83 c4 10 add $0x10,%esp 80103591: 05 00 02 00 00 add $0x200,%eax 80103596: 39 c2 cmp %eax,%edx 80103598: 75 36 jne 801035d0 <pipewrite+0xc0> if(p->readopen == 0 || myproc()->killed){ 8010359a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 801035a0: 85 c0 test %eax,%eax 801035a2: 74 0c je 801035b0 <pipewrite+0xa0> 801035a4: e8 57 03 00 00 call 80103900 <myproc> 801035a9: 8b 40 24 mov 0x24(%eax),%eax 801035ac: 85 c0 test %eax,%eax 801035ae: 74 c0 je 80103570 <pipewrite+0x60> release(&p->lock); 801035b0: 83 ec 0c sub $0xc,%esp 801035b3: 53 push %ebx 801035b4: e8 87 0f 00 00 call 80104540 <release> return -1; 801035b9: 83 c4 10 add $0x10,%esp 801035bc: b8 ff ff ff ff mov $0xffffffff,%eax p->data[p->nwrite++ % PIPESIZE] = addr[i]; } wakeup(&p->nread); //DOC: pipewrite-wakeup1 release(&p->lock); return n; } 801035c1: 8d 65 f4 lea -0xc(%ebp),%esp 801035c4: 5b pop %ebx 801035c5: 5e pop %esi 801035c6: 5f pop %edi 801035c7: 5d pop %ebp 801035c8: c3 ret while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801035c9: 89 c2 mov %eax,%edx 801035cb: 90 nop 801035cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801035d0: 8b 75 e4 mov -0x1c(%ebp),%esi 801035d3: 8d 42 01 lea 0x1(%edx),%eax 801035d6: 81 e2 ff 01 00 00 and $0x1ff,%edx 801035dc: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 801035e2: 83 c6 01 add $0x1,%esi 801035e5: 0f b6 4e ff movzbl -0x1(%esi),%ecx for(i = 0; i < n; i++){ 801035e9: 3b 75 e0 cmp -0x20(%ebp),%esi 801035ec: 89 75 e4 mov %esi,-0x1c(%ebp) p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801035ef: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) for(i = 0; i < n; i++){ 801035f3: 0f 85 4f ff ff ff jne 80103548 <pipewrite+0x38> wakeup(&p->nread); //DOC: pipewrite-wakeup1 801035f9: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 801035ff: 83 ec 0c sub $0xc,%esp 80103602: 50 push %eax 80103603: e8 68 0a 00 00 call 80104070 <wakeup> release(&p->lock); 80103608: 89 1c 24 mov %ebx,(%esp) 8010360b: e8 30 0f 00 00 call 80104540 <release> return n; 80103610: 83 c4 10 add $0x10,%esp 80103613: 8b 45 10 mov 0x10(%ebp),%eax 80103616: eb a9 jmp 801035c1 <pipewrite+0xb1> 80103618: 90 nop 80103619: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103620 <piperead>: int piperead(struct pipe *p, char *addr, int n) { 80103620: 55 push %ebp 80103621: 89 e5 mov %esp,%ebp 80103623: 57 push %edi 80103624: 56 push %esi 80103625: 53 push %ebx 80103626: 83 ec 18 sub $0x18,%esp 80103629: 8b 75 08 mov 0x8(%ebp),%esi 8010362c: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 8010362f: 56 push %esi 80103630: e8 4b 0e 00 00 call 80104480 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 80103635: 83 c4 10 add $0x10,%esp 80103638: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 8010363e: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103644: 75 6a jne 801036b0 <piperead+0x90> 80103646: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx 8010364c: 85 db test %ebx,%ebx 8010364e: 0f 84 c4 00 00 00 je 80103718 <piperead+0xf8> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 80103654: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx 8010365a: eb 2d jmp 80103689 <piperead+0x69> 8010365c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103660: 83 ec 08 sub $0x8,%esp 80103663: 56 push %esi 80103664: 53 push %ebx 80103665: e8 56 08 00 00 call 80103ec0 <sleep> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 8010366a: 83 c4 10 add $0x10,%esp 8010366d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80103673: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103679: 75 35 jne 801036b0 <piperead+0x90> 8010367b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 80103681: 85 d2 test %edx,%edx 80103683: 0f 84 8f 00 00 00 je 80103718 <piperead+0xf8> if(myproc()->killed){ 80103689: e8 72 02 00 00 call 80103900 <myproc> 8010368e: 8b 48 24 mov 0x24(%eax),%ecx 80103691: 85 c9 test %ecx,%ecx 80103693: 74 cb je 80103660 <piperead+0x40> release(&p->lock); 80103695: 83 ec 0c sub $0xc,%esp return -1; 80103698: bb ff ff ff ff mov $0xffffffff,%ebx release(&p->lock); 8010369d: 56 push %esi 8010369e: e8 9d 0e 00 00 call 80104540 <release> return -1; 801036a3: 83 c4 10 add $0x10,%esp addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 801036a6: 8d 65 f4 lea -0xc(%ebp),%esp 801036a9: 89 d8 mov %ebx,%eax 801036ab: 5b pop %ebx 801036ac: 5e pop %esi 801036ad: 5f pop %edi 801036ae: 5d pop %ebp 801036af: c3 ret for(i = 0; i < n; i++){ //DOC: piperead-copy 801036b0: 8b 45 10 mov 0x10(%ebp),%eax 801036b3: 85 c0 test %eax,%eax 801036b5: 7e 61 jle 80103718 <piperead+0xf8> if(p->nread == p->nwrite) 801036b7: 31 db xor %ebx,%ebx 801036b9: eb 13 jmp 801036ce <piperead+0xae> 801036bb: 90 nop 801036bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801036c0: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 801036c6: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 801036cc: 74 1f je 801036ed <piperead+0xcd> addr[i] = p->data[p->nread++ % PIPESIZE]; 801036ce: 8d 41 01 lea 0x1(%ecx),%eax 801036d1: 81 e1 ff 01 00 00 and $0x1ff,%ecx 801036d7: 89 86 34 02 00 00 mov %eax,0x234(%esi) 801036dd: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax 801036e2: 88 04 1f mov %al,(%edi,%ebx,1) for(i = 0; i < n; i++){ //DOC: piperead-copy 801036e5: 83 c3 01 add $0x1,%ebx 801036e8: 39 5d 10 cmp %ebx,0x10(%ebp) 801036eb: 75 d3 jne 801036c0 <piperead+0xa0> wakeup(&p->nwrite); //DOC: piperead-wakeup 801036ed: 8d 86 38 02 00 00 lea 0x238(%esi),%eax 801036f3: 83 ec 0c sub $0xc,%esp 801036f6: 50 push %eax 801036f7: e8 74 09 00 00 call 80104070 <wakeup> release(&p->lock); 801036fc: 89 34 24 mov %esi,(%esp) 801036ff: e8 3c 0e 00 00 call 80104540 <release> return i; 80103704: 83 c4 10 add $0x10,%esp } 80103707: 8d 65 f4 lea -0xc(%ebp),%esp 8010370a: 89 d8 mov %ebx,%eax 8010370c: 5b pop %ebx 8010370d: 5e pop %esi 8010370e: 5f pop %edi 8010370f: 5d pop %ebp 80103710: c3 ret 80103711: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103718: 31 db xor %ebx,%ebx 8010371a: eb d1 jmp 801036ed <piperead+0xcd> 8010371c: 66 90 xchg %ax,%ax 8010371e: 66 90 xchg %ax,%ax 80103720 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 80103720: 55 push %ebp 80103721: 89 e5 mov %esp,%ebp 80103723: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103724: bb 54 2d 11 80 mov $0x80112d54,%ebx { 80103729: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); 8010372c: 68 20 2d 11 80 push $0x80112d20 80103731: e8 4a 0d 00 00 call 80104480 <acquire> 80103736: 83 c4 10 add $0x10,%esp 80103739: eb 10 jmp 8010374b <allocproc+0x2b> 8010373b: 90 nop 8010373c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103740: 83 c3 7c add $0x7c,%ebx 80103743: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103749: 73 75 jae 801037c0 <allocproc+0xa0> if(p->state == UNUSED) 8010374b: 8b 43 0c mov 0xc(%ebx),%eax 8010374e: 85 c0 test %eax,%eax 80103750: 75 ee jne 80103740 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 80103752: a1 04 a0 10 80 mov 0x8010a004,%eax release(&ptable.lock); 80103757: 83 ec 0c sub $0xc,%esp p->state = EMBRYO; 8010375a: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->pid = nextpid++; 80103761: 8d 50 01 lea 0x1(%eax),%edx 80103764: 89 43 10 mov %eax,0x10(%ebx) release(&ptable.lock); 80103767: 68 20 2d 11 80 push $0x80112d20 p->pid = nextpid++; 8010376c: 89 15 04 a0 10 80 mov %edx,0x8010a004 release(&ptable.lock); 80103772: e8 c9 0d 00 00 call 80104540 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103777: e8 64 ee ff ff call 801025e0 <kalloc> 8010377c: 83 c4 10 add $0x10,%esp 8010377f: 85 c0 test %eax,%eax 80103781: 89 43 08 mov %eax,0x8(%ebx) 80103784: 74 53 je 801037d9 <allocproc+0xb9> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103786: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); 8010378c: 83 ec 04 sub $0x4,%esp sp -= sizeof *p->context; 8010378f: 05 9c 0f 00 00 add $0xf9c,%eax sp -= sizeof *p->tf; 80103794: 89 53 18 mov %edx,0x18(%ebx) *(uint*)sp = (uint)trapret; 80103797: c7 40 14 42 58 10 80 movl $0x80105842,0x14(%eax) p->context = (struct context*)sp; 8010379e: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 801037a1: 6a 14 push $0x14 801037a3: 6a 00 push $0x0 801037a5: 50 push %eax 801037a6: e8 e5 0d 00 00 call 80104590 <memset> p->context->eip = (uint)forkret; 801037ab: 8b 43 1c mov 0x1c(%ebx),%eax return p; 801037ae: 83 c4 10 add $0x10,%esp p->context->eip = (uint)forkret; 801037b1: c7 40 10 f0 37 10 80 movl $0x801037f0,0x10(%eax) } 801037b8: 89 d8 mov %ebx,%eax 801037ba: 8b 5d fc mov -0x4(%ebp),%ebx 801037bd: c9 leave 801037be: c3 ret 801037bf: 90 nop release(&ptable.lock); 801037c0: 83 ec 0c sub $0xc,%esp return 0; 801037c3: 31 db xor %ebx,%ebx release(&ptable.lock); 801037c5: 68 20 2d 11 80 push $0x80112d20 801037ca: e8 71 0d 00 00 call 80104540 <release> } 801037cf: 89 d8 mov %ebx,%eax return 0; 801037d1: 83 c4 10 add $0x10,%esp } 801037d4: 8b 5d fc mov -0x4(%ebp),%ebx 801037d7: c9 leave 801037d8: c3 ret p->state = UNUSED; 801037d9: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 801037e0: 31 db xor %ebx,%ebx 801037e2: eb d4 jmp 801037b8 <allocproc+0x98> 801037e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801037ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801037f0 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 801037f0: 55 push %ebp 801037f1: 89 e5 mov %esp,%ebp 801037f3: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 801037f6: 68 20 2d 11 80 push $0x80112d20 801037fb: e8 40 0d 00 00 call 80104540 <release> if (first) { 80103800: a1 00 a0 10 80 mov 0x8010a000,%eax 80103805: 83 c4 10 add $0x10,%esp 80103808: 85 c0 test %eax,%eax 8010380a: 75 04 jne 80103810 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 8010380c: c9 leave 8010380d: c3 ret 8010380e: 66 90 xchg %ax,%ax iinit(ROOTDEV); 80103810: 83 ec 0c sub $0xc,%esp first = 0; 80103813: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000 8010381a: 00 00 00 iinit(ROOTDEV); 8010381d: 6a 01 push $0x1 8010381f: e8 6c dc ff ff call 80101490 <iinit> initlog(ROOTDEV); 80103824: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010382b: e8 f0 f3 ff ff call 80102c20 <initlog> 80103830: 83 c4 10 add $0x10,%esp } 80103833: c9 leave 80103834: c3 ret 80103835: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103839: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103840 <pinit>: { 80103840: 55 push %ebp 80103841: 89 e5 mov %esp,%ebp 80103843: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 80103846: 68 35 76 10 80 push $0x80107635 8010384b: 68 20 2d 11 80 push $0x80112d20 80103850: e8 eb 0a 00 00 call 80104340 <initlock> } 80103855: 83 c4 10 add $0x10,%esp 80103858: c9 leave 80103859: c3 ret 8010385a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103860 <mycpu>: { 80103860: 55 push %ebp 80103861: 89 e5 mov %esp,%ebp 80103863: 56 push %esi 80103864: 53 push %ebx asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103865: 9c pushf 80103866: 58 pop %eax if(readeflags()&FL_IF) 80103867: f6 c4 02 test $0x2,%ah 8010386a: 75 5e jne 801038ca <mycpu+0x6a> apicid = lapicid(); 8010386c: e8 df ef ff ff call 80102850 <lapicid> for (i = 0; i < ncpu; ++i) { 80103871: 8b 35 00 2d 11 80 mov 0x80112d00,%esi 80103877: 85 f6 test %esi,%esi 80103879: 7e 42 jle 801038bd <mycpu+0x5d> if (cpus[i].apicid == apicid) 8010387b: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx 80103882: 39 d0 cmp %edx,%eax 80103884: 74 30 je 801038b6 <mycpu+0x56> 80103886: b9 30 28 11 80 mov $0x80112830,%ecx for (i = 0; i < ncpu; ++i) { 8010388b: 31 d2 xor %edx,%edx 8010388d: 8d 76 00 lea 0x0(%esi),%esi 80103890: 83 c2 01 add $0x1,%edx 80103893: 39 f2 cmp %esi,%edx 80103895: 74 26 je 801038bd <mycpu+0x5d> if (cpus[i].apicid == apicid) 80103897: 0f b6 19 movzbl (%ecx),%ebx 8010389a: 81 c1 b0 00 00 00 add $0xb0,%ecx 801038a0: 39 c3 cmp %eax,%ebx 801038a2: 75 ec jne 80103890 <mycpu+0x30> 801038a4: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax 801038aa: 05 80 27 11 80 add $0x80112780,%eax } 801038af: 8d 65 f8 lea -0x8(%ebp),%esp 801038b2: 5b pop %ebx 801038b3: 5e pop %esi 801038b4: 5d pop %ebp 801038b5: c3 ret if (cpus[i].apicid == apicid) 801038b6: b8 80 27 11 80 mov $0x80112780,%eax return &cpus[i]; 801038bb: eb f2 jmp 801038af <mycpu+0x4f> panic("unknown apicid\n"); 801038bd: 83 ec 0c sub $0xc,%esp 801038c0: 68 3c 76 10 80 push $0x8010763c 801038c5: e8 c6 ca ff ff call 80100390 <panic> panic("mycpu called with interrupts enabled\n"); 801038ca: 83 ec 0c sub $0xc,%esp 801038cd: 68 20 77 10 80 push $0x80107720 801038d2: e8 b9 ca ff ff call 80100390 <panic> 801038d7: 89 f6 mov %esi,%esi 801038d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801038e0 <cpuid>: cpuid() { 801038e0: 55 push %ebp 801038e1: 89 e5 mov %esp,%ebp 801038e3: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 801038e6: e8 75 ff ff ff call 80103860 <mycpu> 801038eb: 2d 80 27 11 80 sub $0x80112780,%eax } 801038f0: c9 leave return mycpu()-cpus; 801038f1: c1 f8 04 sar $0x4,%eax 801038f4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 801038fa: c3 ret 801038fb: 90 nop 801038fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103900 <myproc>: myproc(void) { 80103900: 55 push %ebp 80103901: 89 e5 mov %esp,%ebp 80103903: 53 push %ebx 80103904: 83 ec 04 sub $0x4,%esp pushcli(); 80103907: e8 a4 0a 00 00 call 801043b0 <pushcli> c = mycpu(); 8010390c: e8 4f ff ff ff call 80103860 <mycpu> p = c->proc; 80103911: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103917: e8 d4 0a 00 00 call 801043f0 <popcli> } 8010391c: 83 c4 04 add $0x4,%esp 8010391f: 89 d8 mov %ebx,%eax 80103921: 5b pop %ebx 80103922: 5d pop %ebp 80103923: c3 ret 80103924: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010392a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103930 <userinit>: { 80103930: 55 push %ebp 80103931: 89 e5 mov %esp,%ebp 80103933: 53 push %ebx 80103934: 83 ec 04 sub $0x4,%esp p = allocproc(); 80103937: e8 e4 fd ff ff call 80103720 <allocproc> 8010393c: 89 c3 mov %eax,%ebx initproc = p; 8010393e: a3 b8 a5 10 80 mov %eax,0x8010a5b8 if((p->pgdir = setupkvm()) == 0) 80103943: e8 c8 34 00 00 call 80106e10 <setupkvm> 80103948: 85 c0 test %eax,%eax 8010394a: 89 43 04 mov %eax,0x4(%ebx) 8010394d: 0f 84 d6 00 00 00 je 80103a29 <userinit+0xf9> cprintf("%p %p\n", _binary_initcode_start, _binary_initcode_size); 80103953: 83 ec 04 sub $0x4,%esp 80103956: 68 2c 00 00 00 push $0x2c 8010395b: 68 60 a4 10 80 push $0x8010a460 80103960: 68 65 76 10 80 push $0x80107665 80103965: e8 f6 cc ff ff call 80100660 <cprintf> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 8010396a: 83 c4 0c add $0xc,%esp 8010396d: 68 2c 00 00 00 push $0x2c 80103972: 68 60 a4 10 80 push $0x8010a460 80103977: ff 73 04 pushl 0x4(%ebx) 8010397a: e8 71 31 00 00 call 80106af0 <inituvm> memset(p->tf, 0, sizeof(*p->tf)); 8010397f: 83 c4 0c add $0xc,%esp p->sz = PGSIZE; 80103982: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 80103988: 6a 4c push $0x4c 8010398a: 6a 00 push $0x0 8010398c: ff 73 18 pushl 0x18(%ebx) 8010398f: e8 fc 0b 00 00 call 80104590 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 80103994: 8b 43 18 mov 0x18(%ebx),%eax 80103997: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010399c: b9 23 00 00 00 mov $0x23,%ecx safestrcpy(p->name, "initcode", sizeof(p->name)); 801039a1: 83 c4 0c add $0xc,%esp p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 801039a4: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 801039a8: 8b 43 18 mov 0x18(%ebx),%eax 801039ab: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 801039af: 8b 43 18 mov 0x18(%ebx),%eax 801039b2: 0f b7 50 2c movzwl 0x2c(%eax),%edx 801039b6: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 801039ba: 8b 43 18 mov 0x18(%ebx),%eax 801039bd: 0f b7 50 2c movzwl 0x2c(%eax),%edx 801039c1: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 801039c5: 8b 43 18 mov 0x18(%ebx),%eax 801039c8: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 801039cf: 8b 43 18 mov 0x18(%ebx),%eax 801039d2: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 801039d9: 8b 43 18 mov 0x18(%ebx),%eax 801039dc: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 801039e3: 8d 43 6c lea 0x6c(%ebx),%eax 801039e6: 6a 10 push $0x10 801039e8: 68 6c 76 10 80 push $0x8010766c 801039ed: 50 push %eax 801039ee: e8 7d 0d 00 00 call 80104770 <safestrcpy> p->cwd = namei("/"); 801039f3: c7 04 24 75 76 10 80 movl $0x80107675,(%esp) 801039fa: e8 f1 e4 ff ff call 80101ef0 <namei> 801039ff: 89 43 68 mov %eax,0x68(%ebx) acquire(&ptable.lock); 80103a02: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a09: e8 72 0a 00 00 call 80104480 <acquire> p->state = RUNNABLE; 80103a0e: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 80103a15: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a1c: e8 1f 0b 00 00 call 80104540 <release> } 80103a21: 83 c4 10 add $0x10,%esp 80103a24: 8b 5d fc mov -0x4(%ebp),%ebx 80103a27: c9 leave 80103a28: c3 ret panic("userinit: out of memory?"); 80103a29: 83 ec 0c sub $0xc,%esp 80103a2c: 68 4c 76 10 80 push $0x8010764c 80103a31: e8 5a c9 ff ff call 80100390 <panic> 80103a36: 8d 76 00 lea 0x0(%esi),%esi 80103a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103a40 <growproc>: { 80103a40: 55 push %ebp 80103a41: 89 e5 mov %esp,%ebp 80103a43: 56 push %esi 80103a44: 53 push %ebx 80103a45: 8b 75 08 mov 0x8(%ebp),%esi pushcli(); 80103a48: e8 63 09 00 00 call 801043b0 <pushcli> c = mycpu(); 80103a4d: e8 0e fe ff ff call 80103860 <mycpu> p = c->proc; 80103a52: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103a58: e8 93 09 00 00 call 801043f0 <popcli> if(n > 0){ 80103a5d: 83 fe 00 cmp $0x0,%esi sz = curproc->sz; 80103a60: 8b 03 mov (%ebx),%eax if(n > 0){ 80103a62: 7f 1c jg 80103a80 <growproc+0x40> } else if(n < 0){ 80103a64: 75 3a jne 80103aa0 <growproc+0x60> switchuvm(curproc); 80103a66: 83 ec 0c sub $0xc,%esp curproc->sz = sz; 80103a69: 89 03 mov %eax,(%ebx) switchuvm(curproc); 80103a6b: 53 push %ebx 80103a6c: e8 6f 2f 00 00 call 801069e0 <switchuvm> return 0; 80103a71: 83 c4 10 add $0x10,%esp 80103a74: 31 c0 xor %eax,%eax } 80103a76: 8d 65 f8 lea -0x8(%ebp),%esp 80103a79: 5b pop %ebx 80103a7a: 5e pop %esi 80103a7b: 5d pop %ebp 80103a7c: c3 ret 80103a7d: 8d 76 00 lea 0x0(%esi),%esi if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103a80: 83 ec 04 sub $0x4,%esp 80103a83: 01 c6 add %eax,%esi 80103a85: 56 push %esi 80103a86: 50 push %eax 80103a87: ff 73 04 pushl 0x4(%ebx) 80103a8a: e8 a1 31 00 00 call 80106c30 <allocuvm> 80103a8f: 83 c4 10 add $0x10,%esp 80103a92: 85 c0 test %eax,%eax 80103a94: 75 d0 jne 80103a66 <growproc+0x26> return -1; 80103a96: b8 ff ff ff ff mov $0xffffffff,%eax 80103a9b: eb d9 jmp 80103a76 <growproc+0x36> 80103a9d: 8d 76 00 lea 0x0(%esi),%esi if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103aa0: 83 ec 04 sub $0x4,%esp 80103aa3: 01 c6 add %eax,%esi 80103aa5: 56 push %esi 80103aa6: 50 push %eax 80103aa7: ff 73 04 pushl 0x4(%ebx) 80103aaa: e8 b1 32 00 00 call 80106d60 <deallocuvm> 80103aaf: 83 c4 10 add $0x10,%esp 80103ab2: 85 c0 test %eax,%eax 80103ab4: 75 b0 jne 80103a66 <growproc+0x26> 80103ab6: eb de jmp 80103a96 <growproc+0x56> 80103ab8: 90 nop 80103ab9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103ac0 <fork>: { 80103ac0: 55 push %ebp 80103ac1: 89 e5 mov %esp,%ebp 80103ac3: 57 push %edi 80103ac4: 56 push %esi 80103ac5: 53 push %ebx 80103ac6: 83 ec 1c sub $0x1c,%esp pushcli(); 80103ac9: e8 e2 08 00 00 call 801043b0 <pushcli> c = mycpu(); 80103ace: e8 8d fd ff ff call 80103860 <mycpu> p = c->proc; 80103ad3: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103ad9: e8 12 09 00 00 call 801043f0 <popcli> if((np = allocproc()) == 0){ 80103ade: e8 3d fc ff ff call 80103720 <allocproc> 80103ae3: 85 c0 test %eax,%eax 80103ae5: 89 45 e4 mov %eax,-0x1c(%ebp) 80103ae8: 0f 84 b7 00 00 00 je 80103ba5 <fork+0xe5> if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 80103aee: 83 ec 08 sub $0x8,%esp 80103af1: ff 33 pushl (%ebx) 80103af3: ff 73 04 pushl 0x4(%ebx) 80103af6: 89 c7 mov %eax,%edi 80103af8: e8 e3 33 00 00 call 80106ee0 <copyuvm> 80103afd: 83 c4 10 add $0x10,%esp 80103b00: 85 c0 test %eax,%eax 80103b02: 89 47 04 mov %eax,0x4(%edi) 80103b05: 0f 84 a1 00 00 00 je 80103bac <fork+0xec> np->sz = curproc->sz; 80103b0b: 8b 03 mov (%ebx),%eax 80103b0d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80103b10: 89 01 mov %eax,(%ecx) np->parent = curproc; 80103b12: 89 59 14 mov %ebx,0x14(%ecx) 80103b15: 89 c8 mov %ecx,%eax *np->tf = *curproc->tf; 80103b17: 8b 79 18 mov 0x18(%ecx),%edi 80103b1a: 8b 73 18 mov 0x18(%ebx),%esi 80103b1d: b9 13 00 00 00 mov $0x13,%ecx 80103b22: f3 a5 rep movsl %ds:(%esi),%es:(%edi) for(i = 0; i < NOFILE; i++) 80103b24: 31 f6 xor %esi,%esi np->tf->eax = 0; 80103b26: 8b 40 18 mov 0x18(%eax),%eax 80103b29: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) if(curproc->ofile[i]) 80103b30: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 80103b34: 85 c0 test %eax,%eax 80103b36: 74 13 je 80103b4b <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 80103b38: 83 ec 0c sub $0xc,%esp 80103b3b: 50 push %eax 80103b3c: e8 af d2 ff ff call 80100df0 <filedup> 80103b41: 8b 55 e4 mov -0x1c(%ebp),%edx 80103b44: 83 c4 10 add $0x10,%esp 80103b47: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) for(i = 0; i < NOFILE; i++) 80103b4b: 83 c6 01 add $0x1,%esi 80103b4e: 83 fe 10 cmp $0x10,%esi 80103b51: 75 dd jne 80103b30 <fork+0x70> np->cwd = idup(curproc->cwd); 80103b53: 83 ec 0c sub $0xc,%esp 80103b56: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103b59: 83 c3 6c add $0x6c,%ebx np->cwd = idup(curproc->cwd); 80103b5c: e8 ff da ff ff call 80101660 <idup> 80103b61: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103b64: 83 c4 0c add $0xc,%esp np->cwd = idup(curproc->cwd); 80103b67: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103b6a: 8d 47 6c lea 0x6c(%edi),%eax 80103b6d: 6a 10 push $0x10 80103b6f: 53 push %ebx 80103b70: 50 push %eax 80103b71: e8 fa 0b 00 00 call 80104770 <safestrcpy> pid = np->pid; 80103b76: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 80103b79: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103b80: e8 fb 08 00 00 call 80104480 <acquire> np->state = RUNNABLE; 80103b85: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 80103b8c: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103b93: e8 a8 09 00 00 call 80104540 <release> return pid; 80103b98: 83 c4 10 add $0x10,%esp } 80103b9b: 8d 65 f4 lea -0xc(%ebp),%esp 80103b9e: 89 d8 mov %ebx,%eax 80103ba0: 5b pop %ebx 80103ba1: 5e pop %esi 80103ba2: 5f pop %edi 80103ba3: 5d pop %ebp 80103ba4: c3 ret return -1; 80103ba5: bb ff ff ff ff mov $0xffffffff,%ebx 80103baa: eb ef jmp 80103b9b <fork+0xdb> kfree(np->kstack); 80103bac: 8b 5d e4 mov -0x1c(%ebp),%ebx 80103baf: 83 ec 0c sub $0xc,%esp 80103bb2: ff 73 08 pushl 0x8(%ebx) 80103bb5: e8 76 e8 ff ff call 80102430 <kfree> np->kstack = 0; 80103bba: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) np->state = UNUSED; 80103bc1: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return -1; 80103bc8: 83 c4 10 add $0x10,%esp 80103bcb: bb ff ff ff ff mov $0xffffffff,%ebx 80103bd0: eb c9 jmp 80103b9b <fork+0xdb> 80103bd2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103bd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103be0 <scheduler>: { 80103be0: 55 push %ebp 80103be1: 89 e5 mov %esp,%ebp 80103be3: 57 push %edi 80103be4: 56 push %esi 80103be5: 53 push %ebx 80103be6: 83 ec 0c sub $0xc,%esp struct cpu *c = mycpu(); 80103be9: e8 72 fc ff ff call 80103860 <mycpu> 80103bee: 8d 78 04 lea 0x4(%eax),%edi 80103bf1: 89 c6 mov %eax,%esi c->proc = 0; 80103bf3: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103bfa: 00 00 00 80103bfd: 8d 76 00 lea 0x0(%esi),%esi asm volatile("sti"); 80103c00: fb sti acquire(&ptable.lock); 80103c01: 83 ec 0c sub $0xc,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c04: bb 54 2d 11 80 mov $0x80112d54,%ebx acquire(&ptable.lock); 80103c09: 68 20 2d 11 80 push $0x80112d20 80103c0e: e8 6d 08 00 00 call 80104480 <acquire> 80103c13: 83 c4 10 add $0x10,%esp 80103c16: 8d 76 00 lea 0x0(%esi),%esi 80103c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(p->state != RUNNABLE) 80103c20: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 80103c24: 75 33 jne 80103c59 <scheduler+0x79> switchuvm(p); 80103c26: 83 ec 0c sub $0xc,%esp c->proc = p; 80103c29: 89 9e ac 00 00 00 mov %ebx,0xac(%esi) switchuvm(p); 80103c2f: 53 push %ebx 80103c30: e8 ab 2d 00 00 call 801069e0 <switchuvm> swtch(&(c->scheduler), p->context); 80103c35: 58 pop %eax 80103c36: 5a pop %edx 80103c37: ff 73 1c pushl 0x1c(%ebx) 80103c3a: 57 push %edi p->state = RUNNING; 80103c3b: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx) swtch(&(c->scheduler), p->context); 80103c42: e8 84 0b 00 00 call 801047cb <swtch> switchkvm(); 80103c47: e8 74 2d 00 00 call 801069c0 <switchkvm> c->proc = 0; 80103c4c: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi) 80103c53: 00 00 00 80103c56: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c59: 83 c3 7c add $0x7c,%ebx 80103c5c: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103c62: 72 bc jb 80103c20 <scheduler+0x40> release(&ptable.lock); 80103c64: 83 ec 0c sub $0xc,%esp 80103c67: 68 20 2d 11 80 push $0x80112d20 80103c6c: e8 cf 08 00 00 call 80104540 <release> sti(); 80103c71: 83 c4 10 add $0x10,%esp 80103c74: eb 8a jmp 80103c00 <scheduler+0x20> 80103c76: 8d 76 00 lea 0x0(%esi),%esi 80103c79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103c80 <sched>: { 80103c80: 55 push %ebp 80103c81: 89 e5 mov %esp,%ebp 80103c83: 56 push %esi 80103c84: 53 push %ebx pushcli(); 80103c85: e8 26 07 00 00 call 801043b0 <pushcli> c = mycpu(); 80103c8a: e8 d1 fb ff ff call 80103860 <mycpu> p = c->proc; 80103c8f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103c95: e8 56 07 00 00 call 801043f0 <popcli> if(!holding(&ptable.lock)) 80103c9a: 83 ec 0c sub $0xc,%esp 80103c9d: 68 20 2d 11 80 push $0x80112d20 80103ca2: e8 a9 07 00 00 call 80104450 <holding> 80103ca7: 83 c4 10 add $0x10,%esp 80103caa: 85 c0 test %eax,%eax 80103cac: 74 4f je 80103cfd <sched+0x7d> if(mycpu()->ncli != 1) 80103cae: e8 ad fb ff ff call 80103860 <mycpu> 80103cb3: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103cba: 75 68 jne 80103d24 <sched+0xa4> if(p->state == RUNNING) 80103cbc: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80103cc0: 74 55 je 80103d17 <sched+0x97> asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103cc2: 9c pushf 80103cc3: 58 pop %eax if(readeflags()&FL_IF) 80103cc4: f6 c4 02 test $0x2,%ah 80103cc7: 75 41 jne 80103d0a <sched+0x8a> intena = mycpu()->intena; 80103cc9: e8 92 fb ff ff call 80103860 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103cce: 83 c3 1c add $0x1c,%ebx intena = mycpu()->intena; 80103cd1: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103cd7: e8 84 fb ff ff call 80103860 <mycpu> 80103cdc: 83 ec 08 sub $0x8,%esp 80103cdf: ff 70 04 pushl 0x4(%eax) 80103ce2: 53 push %ebx 80103ce3: e8 e3 0a 00 00 call 801047cb <swtch> mycpu()->intena = intena; 80103ce8: e8 73 fb ff ff call 80103860 <mycpu> } 80103ced: 83 c4 10 add $0x10,%esp mycpu()->intena = intena; 80103cf0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103cf6: 8d 65 f8 lea -0x8(%ebp),%esp 80103cf9: 5b pop %ebx 80103cfa: 5e pop %esi 80103cfb: 5d pop %ebp 80103cfc: c3 ret panic("sched ptable.lock"); 80103cfd: 83 ec 0c sub $0xc,%esp 80103d00: 68 77 76 10 80 push $0x80107677 80103d05: e8 86 c6 ff ff call 80100390 <panic> panic("sched interruptible"); 80103d0a: 83 ec 0c sub $0xc,%esp 80103d0d: 68 a3 76 10 80 push $0x801076a3 80103d12: e8 79 c6 ff ff call 80100390 <panic> panic("sched running"); 80103d17: 83 ec 0c sub $0xc,%esp 80103d1a: 68 95 76 10 80 push $0x80107695 80103d1f: e8 6c c6 ff ff call 80100390 <panic> panic("sched locks"); 80103d24: 83 ec 0c sub $0xc,%esp 80103d27: 68 89 76 10 80 push $0x80107689 80103d2c: e8 5f c6 ff ff call 80100390 <panic> 80103d31: eb 0d jmp 80103d40 <exit> 80103d33: 90 nop 80103d34: 90 nop 80103d35: 90 nop 80103d36: 90 nop 80103d37: 90 nop 80103d38: 90 nop 80103d39: 90 nop 80103d3a: 90 nop 80103d3b: 90 nop 80103d3c: 90 nop 80103d3d: 90 nop 80103d3e: 90 nop 80103d3f: 90 nop 80103d40 <exit>: { 80103d40: 55 push %ebp 80103d41: 89 e5 mov %esp,%ebp 80103d43: 57 push %edi 80103d44: 56 push %esi 80103d45: 53 push %ebx 80103d46: 83 ec 0c sub $0xc,%esp pushcli(); 80103d49: e8 62 06 00 00 call 801043b0 <pushcli> c = mycpu(); 80103d4e: e8 0d fb ff ff call 80103860 <mycpu> p = c->proc; 80103d53: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103d59: e8 92 06 00 00 call 801043f0 <popcli> if(curproc == initproc) 80103d5e: 39 35 b8 a5 10 80 cmp %esi,0x8010a5b8 80103d64: 8d 5e 28 lea 0x28(%esi),%ebx 80103d67: 8d 7e 68 lea 0x68(%esi),%edi 80103d6a: 0f 84 e7 00 00 00 je 80103e57 <exit+0x117> if(curproc->ofile[fd]){ 80103d70: 8b 03 mov (%ebx),%eax 80103d72: 85 c0 test %eax,%eax 80103d74: 74 12 je 80103d88 <exit+0x48> fileclose(curproc->ofile[fd]); 80103d76: 83 ec 0c sub $0xc,%esp 80103d79: 50 push %eax 80103d7a: e8 c1 d0 ff ff call 80100e40 <fileclose> curproc->ofile[fd] = 0; 80103d7f: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103d85: 83 c4 10 add $0x10,%esp 80103d88: 83 c3 04 add $0x4,%ebx for(fd = 0; fd < NOFILE; fd++){ 80103d8b: 39 fb cmp %edi,%ebx 80103d8d: 75 e1 jne 80103d70 <exit+0x30> begin_op(); 80103d8f: e8 2c ef ff ff call 80102cc0 <begin_op> iput(curproc->cwd); 80103d94: 83 ec 0c sub $0xc,%esp 80103d97: ff 76 68 pushl 0x68(%esi) 80103d9a: e8 21 da ff ff call 801017c0 <iput> end_op(); 80103d9f: e8 8c ef ff ff call 80102d30 <end_op> curproc->cwd = 0; 80103da4: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103dab: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103db2: e8 c9 06 00 00 call 80104480 <acquire> wakeup1(curproc->parent); 80103db7: 8b 56 14 mov 0x14(%esi),%edx 80103dba: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103dbd: b8 54 2d 11 80 mov $0x80112d54,%eax 80103dc2: eb 0e jmp 80103dd2 <exit+0x92> 80103dc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103dc8: 83 c0 7c add $0x7c,%eax 80103dcb: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103dd0: 73 1c jae 80103dee <exit+0xae> if(p->state == SLEEPING && p->chan == chan) 80103dd2: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103dd6: 75 f0 jne 80103dc8 <exit+0x88> 80103dd8: 3b 50 20 cmp 0x20(%eax),%edx 80103ddb: 75 eb jne 80103dc8 <exit+0x88> p->state = RUNNABLE; 80103ddd: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103de4: 83 c0 7c add $0x7c,%eax 80103de7: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103dec: 72 e4 jb 80103dd2 <exit+0x92> p->parent = initproc; 80103dee: 8b 0d b8 a5 10 80 mov 0x8010a5b8,%ecx for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103df4: ba 54 2d 11 80 mov $0x80112d54,%edx 80103df9: eb 10 jmp 80103e0b <exit+0xcb> 80103dfb: 90 nop 80103dfc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103e00: 83 c2 7c add $0x7c,%edx 80103e03: 81 fa 54 4c 11 80 cmp $0x80114c54,%edx 80103e09: 73 33 jae 80103e3e <exit+0xfe> if(p->parent == curproc){ 80103e0b: 39 72 14 cmp %esi,0x14(%edx) 80103e0e: 75 f0 jne 80103e00 <exit+0xc0> if(p->state == ZOMBIE) 80103e10: 83 7a 0c 05 cmpl $0x5,0xc(%edx) p->parent = initproc; 80103e14: 89 4a 14 mov %ecx,0x14(%edx) if(p->state == ZOMBIE) 80103e17: 75 e7 jne 80103e00 <exit+0xc0> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103e19: b8 54 2d 11 80 mov $0x80112d54,%eax 80103e1e: eb 0a jmp 80103e2a <exit+0xea> 80103e20: 83 c0 7c add $0x7c,%eax 80103e23: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103e28: 73 d6 jae 80103e00 <exit+0xc0> if(p->state == SLEEPING && p->chan == chan) 80103e2a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103e2e: 75 f0 jne 80103e20 <exit+0xe0> 80103e30: 3b 48 20 cmp 0x20(%eax),%ecx 80103e33: 75 eb jne 80103e20 <exit+0xe0> p->state = RUNNABLE; 80103e35: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103e3c: eb e2 jmp 80103e20 <exit+0xe0> curproc->state = ZOMBIE; 80103e3e: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80103e45: e8 36 fe ff ff call 80103c80 <sched> panic("zombie exit"); 80103e4a: 83 ec 0c sub $0xc,%esp 80103e4d: 68 c4 76 10 80 push $0x801076c4 80103e52: e8 39 c5 ff ff call 80100390 <panic> panic("init exiting"); 80103e57: 83 ec 0c sub $0xc,%esp 80103e5a: 68 b7 76 10 80 push $0x801076b7 80103e5f: e8 2c c5 ff ff call 80100390 <panic> 80103e64: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103e6a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103e70 <yield>: { 80103e70: 55 push %ebp 80103e71: 89 e5 mov %esp,%ebp 80103e73: 53 push %ebx 80103e74: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80103e77: 68 20 2d 11 80 push $0x80112d20 80103e7c: e8 ff 05 00 00 call 80104480 <acquire> pushcli(); 80103e81: e8 2a 05 00 00 call 801043b0 <pushcli> c = mycpu(); 80103e86: e8 d5 f9 ff ff call 80103860 <mycpu> p = c->proc; 80103e8b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103e91: e8 5a 05 00 00 call 801043f0 <popcli> myproc()->state = RUNNABLE; 80103e96: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 80103e9d: e8 de fd ff ff call 80103c80 <sched> release(&ptable.lock); 80103ea2: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103ea9: e8 92 06 00 00 call 80104540 <release> } 80103eae: 83 c4 10 add $0x10,%esp 80103eb1: 8b 5d fc mov -0x4(%ebp),%ebx 80103eb4: c9 leave 80103eb5: c3 ret 80103eb6: 8d 76 00 lea 0x0(%esi),%esi 80103eb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103ec0 <sleep>: { 80103ec0: 55 push %ebp 80103ec1: 89 e5 mov %esp,%ebp 80103ec3: 57 push %edi 80103ec4: 56 push %esi 80103ec5: 53 push %ebx 80103ec6: 83 ec 0c sub $0xc,%esp 80103ec9: 8b 7d 08 mov 0x8(%ebp),%edi 80103ecc: 8b 75 0c mov 0xc(%ebp),%esi pushcli(); 80103ecf: e8 dc 04 00 00 call 801043b0 <pushcli> c = mycpu(); 80103ed4: e8 87 f9 ff ff call 80103860 <mycpu> p = c->proc; 80103ed9: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103edf: e8 0c 05 00 00 call 801043f0 <popcli> if(p == 0) 80103ee4: 85 db test %ebx,%ebx 80103ee6: 0f 84 87 00 00 00 je 80103f73 <sleep+0xb3> if(lk == 0) 80103eec: 85 f6 test %esi,%esi 80103eee: 74 76 je 80103f66 <sleep+0xa6> if(lk != &ptable.lock){ //DOC: sleeplock0 80103ef0: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi 80103ef6: 74 50 je 80103f48 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 80103ef8: 83 ec 0c sub $0xc,%esp 80103efb: 68 20 2d 11 80 push $0x80112d20 80103f00: e8 7b 05 00 00 call 80104480 <acquire> release(lk); 80103f05: 89 34 24 mov %esi,(%esp) 80103f08: e8 33 06 00 00 call 80104540 <release> p->chan = chan; 80103f0d: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103f10: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103f17: e8 64 fd ff ff call 80103c80 <sched> p->chan = 0; 80103f1c: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) release(&ptable.lock); 80103f23: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103f2a: e8 11 06 00 00 call 80104540 <release> acquire(lk); 80103f2f: 89 75 08 mov %esi,0x8(%ebp) 80103f32: 83 c4 10 add $0x10,%esp } 80103f35: 8d 65 f4 lea -0xc(%ebp),%esp 80103f38: 5b pop %ebx 80103f39: 5e pop %esi 80103f3a: 5f pop %edi 80103f3b: 5d pop %ebp acquire(lk); 80103f3c: e9 3f 05 00 00 jmp 80104480 <acquire> 80103f41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->chan = chan; 80103f48: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103f4b: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103f52: e8 29 fd ff ff call 80103c80 <sched> p->chan = 0; 80103f57: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) } 80103f5e: 8d 65 f4 lea -0xc(%ebp),%esp 80103f61: 5b pop %ebx 80103f62: 5e pop %esi 80103f63: 5f pop %edi 80103f64: 5d pop %ebp 80103f65: c3 ret panic("sleep without lk"); 80103f66: 83 ec 0c sub $0xc,%esp 80103f69: 68 d6 76 10 80 push $0x801076d6 80103f6e: e8 1d c4 ff ff call 80100390 <panic> panic("sleep"); 80103f73: 83 ec 0c sub $0xc,%esp 80103f76: 68 d0 76 10 80 push $0x801076d0 80103f7b: e8 10 c4 ff ff call 80100390 <panic> 80103f80 <wait>: { 80103f80: 55 push %ebp 80103f81: 89 e5 mov %esp,%ebp 80103f83: 56 push %esi 80103f84: 53 push %ebx pushcli(); 80103f85: e8 26 04 00 00 call 801043b0 <pushcli> c = mycpu(); 80103f8a: e8 d1 f8 ff ff call 80103860 <mycpu> p = c->proc; 80103f8f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103f95: e8 56 04 00 00 call 801043f0 <popcli> acquire(&ptable.lock); 80103f9a: 83 ec 0c sub $0xc,%esp 80103f9d: 68 20 2d 11 80 push $0x80112d20 80103fa2: e8 d9 04 00 00 call 80104480 <acquire> 80103fa7: 83 c4 10 add $0x10,%esp havekids = 0; 80103faa: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fac: bb 54 2d 11 80 mov $0x80112d54,%ebx 80103fb1: eb 10 jmp 80103fc3 <wait+0x43> 80103fb3: 90 nop 80103fb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103fb8: 83 c3 7c add $0x7c,%ebx 80103fbb: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103fc1: 73 1b jae 80103fde <wait+0x5e> if(p->parent != curproc) 80103fc3: 39 73 14 cmp %esi,0x14(%ebx) 80103fc6: 75 f0 jne 80103fb8 <wait+0x38> if(p->state == ZOMBIE){ 80103fc8: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 80103fcc: 74 32 je 80104000 <wait+0x80> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fce: 83 c3 7c add $0x7c,%ebx havekids = 1; 80103fd1: b8 01 00 00 00 mov $0x1,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fd6: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103fdc: 72 e5 jb 80103fc3 <wait+0x43> if(!havekids || curproc->killed){ 80103fde: 85 c0 test %eax,%eax 80103fe0: 74 74 je 80104056 <wait+0xd6> 80103fe2: 8b 46 24 mov 0x24(%esi),%eax 80103fe5: 85 c0 test %eax,%eax 80103fe7: 75 6d jne 80104056 <wait+0xd6> sleep(curproc, &ptable.lock); //DOC: wait-sleep 80103fe9: 83 ec 08 sub $0x8,%esp 80103fec: 68 20 2d 11 80 push $0x80112d20 80103ff1: 56 push %esi 80103ff2: e8 c9 fe ff ff call 80103ec0 <sleep> havekids = 0; 80103ff7: 83 c4 10 add $0x10,%esp 80103ffa: eb ae jmp 80103faa <wait+0x2a> 80103ffc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(p->kstack); 80104000: 83 ec 0c sub $0xc,%esp 80104003: ff 73 08 pushl 0x8(%ebx) pid = p->pid; 80104006: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 80104009: e8 22 e4 ff ff call 80102430 <kfree> freevm(p->pgdir); 8010400e: 5a pop %edx 8010400f: ff 73 04 pushl 0x4(%ebx) p->kstack = 0; 80104012: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80104019: e8 72 2d 00 00 call 80106d90 <freevm> release(&ptable.lock); 8010401e: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) p->pid = 0; 80104025: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 8010402c: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 80104033: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 80104037: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 8010403e: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80104045: e8 f6 04 00 00 call 80104540 <release> return pid; 8010404a: 83 c4 10 add $0x10,%esp } 8010404d: 8d 65 f8 lea -0x8(%ebp),%esp 80104050: 89 f0 mov %esi,%eax 80104052: 5b pop %ebx 80104053: 5e pop %esi 80104054: 5d pop %ebp 80104055: c3 ret release(&ptable.lock); 80104056: 83 ec 0c sub $0xc,%esp return -1; 80104059: be ff ff ff ff mov $0xffffffff,%esi release(&ptable.lock); 8010405e: 68 20 2d 11 80 push $0x80112d20 80104063: e8 d8 04 00 00 call 80104540 <release> return -1; 80104068: 83 c4 10 add $0x10,%esp 8010406b: eb e0 jmp 8010404d <wait+0xcd> 8010406d: 8d 76 00 lea 0x0(%esi),%esi 80104070 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80104070: 55 push %ebp 80104071: 89 e5 mov %esp,%ebp 80104073: 53 push %ebx 80104074: 83 ec 10 sub $0x10,%esp 80104077: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 8010407a: 68 20 2d 11 80 push $0x80112d20 8010407f: e8 fc 03 00 00 call 80104480 <acquire> 80104084: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80104087: b8 54 2d 11 80 mov $0x80112d54,%eax 8010408c: eb 0c jmp 8010409a <wakeup+0x2a> 8010408e: 66 90 xchg %ax,%ax 80104090: 83 c0 7c add $0x7c,%eax 80104093: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80104098: 73 1c jae 801040b6 <wakeup+0x46> if(p->state == SLEEPING && p->chan == chan) 8010409a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 8010409e: 75 f0 jne 80104090 <wakeup+0x20> 801040a0: 3b 58 20 cmp 0x20(%eax),%ebx 801040a3: 75 eb jne 80104090 <wakeup+0x20> p->state = RUNNABLE; 801040a5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801040ac: 83 c0 7c add $0x7c,%eax 801040af: 3d 54 4c 11 80 cmp $0x80114c54,%eax 801040b4: 72 e4 jb 8010409a <wakeup+0x2a> wakeup1(chan); release(&ptable.lock); 801040b6: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp) } 801040bd: 8b 5d fc mov -0x4(%ebp),%ebx 801040c0: c9 leave release(&ptable.lock); 801040c1: e9 7a 04 00 00 jmp 80104540 <release> 801040c6: 8d 76 00 lea 0x0(%esi),%esi 801040c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801040d0 <kill>: // Kill the process with the given pid. // Process won't exit until it returns // to user space (see trap in trap.c). int kill(int pid) { 801040d0: 55 push %ebp 801040d1: 89 e5 mov %esp,%ebp 801040d3: 53 push %ebx 801040d4: 83 ec 10 sub $0x10,%esp 801040d7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 801040da: 68 20 2d 11 80 push $0x80112d20 801040df: e8 9c 03 00 00 call 80104480 <acquire> 801040e4: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801040e7: b8 54 2d 11 80 mov $0x80112d54,%eax 801040ec: eb 0c jmp 801040fa <kill+0x2a> 801040ee: 66 90 xchg %ax,%ax 801040f0: 83 c0 7c add $0x7c,%eax 801040f3: 3d 54 4c 11 80 cmp $0x80114c54,%eax 801040f8: 73 36 jae 80104130 <kill+0x60> if(p->pid == pid){ 801040fa: 39 58 10 cmp %ebx,0x10(%eax) 801040fd: 75 f1 jne 801040f0 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 801040ff: 83 78 0c 02 cmpl $0x2,0xc(%eax) p->killed = 1; 80104103: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) if(p->state == SLEEPING) 8010410a: 75 07 jne 80104113 <kill+0x43> p->state = RUNNABLE; 8010410c: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) release(&ptable.lock); 80104113: 83 ec 0c sub $0xc,%esp 80104116: 68 20 2d 11 80 push $0x80112d20 8010411b: e8 20 04 00 00 call 80104540 <release> return 0; 80104120: 83 c4 10 add $0x10,%esp 80104123: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80104125: 8b 5d fc mov -0x4(%ebp),%ebx 80104128: c9 leave 80104129: c3 ret 8010412a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi release(&ptable.lock); 80104130: 83 ec 0c sub $0xc,%esp 80104133: 68 20 2d 11 80 push $0x80112d20 80104138: e8 03 04 00 00 call 80104540 <release> return -1; 8010413d: 83 c4 10 add $0x10,%esp 80104140: b8 ff ff ff ff mov $0xffffffff,%eax } 80104145: 8b 5d fc mov -0x4(%ebp),%ebx 80104148: c9 leave 80104149: c3 ret 8010414a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104150 <procdump>: // Print a process listing to console. For debugging. // Runs when user types ^P on console. // No lock to avoid wedging a stuck machine further. void procdump(void) { 80104150: 55 push %ebp 80104151: 89 e5 mov %esp,%ebp 80104153: 57 push %edi 80104154: 56 push %esi 80104155: 53 push %ebx 80104156: 8d 75 e8 lea -0x18(%ebp),%esi int i; struct proc *p; char *state; uint pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104159: bb 54 2d 11 80 mov $0x80112d54,%ebx { 8010415e: 83 ec 3c sub $0x3c,%esp 80104161: eb 24 jmp 80104187 <procdump+0x37> 80104163: 90 nop 80104164: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(p->state == SLEEPING){ getcallerpcs((uint*)p->context->ebp+2, pc); for(i=0; i<10 && pc[i] != 0; i++) cprintf(" %p", pc[i]); } cprintf("\n"); 80104168: 83 ec 0c sub $0xc,%esp 8010416b: 68 5f 7a 10 80 push $0x80107a5f 80104170: e8 eb c4 ff ff call 80100660 <cprintf> 80104175: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104178: 83 c3 7c add $0x7c,%ebx 8010417b: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80104181: 0f 83 81 00 00 00 jae 80104208 <procdump+0xb8> if(p->state == UNUSED) 80104187: 8b 43 0c mov 0xc(%ebx),%eax 8010418a: 85 c0 test %eax,%eax 8010418c: 74 ea je 80104178 <procdump+0x28> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8010418e: 83 f8 05 cmp $0x5,%eax state = "???"; 80104191: ba e7 76 10 80 mov $0x801076e7,%edx if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80104196: 77 11 ja 801041a9 <procdump+0x59> 80104198: 8b 14 85 48 77 10 80 mov -0x7fef88b8(,%eax,4),%edx state = "???"; 8010419f: b8 e7 76 10 80 mov $0x801076e7,%eax 801041a4: 85 d2 test %edx,%edx 801041a6: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 801041a9: 8d 43 6c lea 0x6c(%ebx),%eax 801041ac: 50 push %eax 801041ad: 52 push %edx 801041ae: ff 73 10 pushl 0x10(%ebx) 801041b1: 68 eb 76 10 80 push $0x801076eb 801041b6: e8 a5 c4 ff ff call 80100660 <cprintf> if(p->state == SLEEPING){ 801041bb: 83 c4 10 add $0x10,%esp 801041be: 83 7b 0c 02 cmpl $0x2,0xc(%ebx) 801041c2: 75 a4 jne 80104168 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 801041c4: 8d 45 c0 lea -0x40(%ebp),%eax 801041c7: 83 ec 08 sub $0x8,%esp 801041ca: 8d 7d c0 lea -0x40(%ebp),%edi 801041cd: 50 push %eax 801041ce: 8b 43 1c mov 0x1c(%ebx),%eax 801041d1: 8b 40 0c mov 0xc(%eax),%eax 801041d4: 83 c0 08 add $0x8,%eax 801041d7: 50 push %eax 801041d8: e8 83 01 00 00 call 80104360 <getcallerpcs> 801041dd: 83 c4 10 add $0x10,%esp for(i=0; i<10 && pc[i] != 0; i++) 801041e0: 8b 17 mov (%edi),%edx 801041e2: 85 d2 test %edx,%edx 801041e4: 74 82 je 80104168 <procdump+0x18> cprintf(" %p", pc[i]); 801041e6: 83 ec 08 sub $0x8,%esp 801041e9: 83 c7 04 add $0x4,%edi 801041ec: 52 push %edx 801041ed: 68 01 71 10 80 push $0x80107101 801041f2: e8 69 c4 ff ff call 80100660 <cprintf> for(i=0; i<10 && pc[i] != 0; i++) 801041f7: 83 c4 10 add $0x10,%esp 801041fa: 39 fe cmp %edi,%esi 801041fc: 75 e2 jne 801041e0 <procdump+0x90> 801041fe: e9 65 ff ff ff jmp 80104168 <procdump+0x18> 80104203: 90 nop 80104204: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } 80104208: 8d 65 f4 lea -0xc(%ebp),%esp 8010420b: 5b pop %ebx 8010420c: 5e pop %esi 8010420d: 5f pop %edi 8010420e: 5d pop %ebp 8010420f: c3 ret 80104210 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80104210: 55 push %ebp 80104211: 89 e5 mov %esp,%ebp 80104213: 53 push %ebx 80104214: 83 ec 0c sub $0xc,%esp 80104217: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 8010421a: 68 60 77 10 80 push $0x80107760 8010421f: 8d 43 04 lea 0x4(%ebx),%eax 80104222: 50 push %eax 80104223: e8 18 01 00 00 call 80104340 <initlock> lk->name = name; 80104228: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 8010422b: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 80104231: 83 c4 10 add $0x10,%esp lk->pid = 0; 80104234: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 8010423b: 89 43 38 mov %eax,0x38(%ebx) } 8010423e: 8b 5d fc mov -0x4(%ebp),%ebx 80104241: c9 leave 80104242: c3 ret 80104243: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104250 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80104250: 55 push %ebp 80104251: 89 e5 mov %esp,%ebp 80104253: 56 push %esi 80104254: 53 push %ebx 80104255: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104258: 83 ec 0c sub $0xc,%esp 8010425b: 8d 73 04 lea 0x4(%ebx),%esi 8010425e: 56 push %esi 8010425f: e8 1c 02 00 00 call 80104480 <acquire> while (lk->locked) { 80104264: 8b 13 mov (%ebx),%edx 80104266: 83 c4 10 add $0x10,%esp 80104269: 85 d2 test %edx,%edx 8010426b: 74 16 je 80104283 <acquiresleep+0x33> 8010426d: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104270: 83 ec 08 sub $0x8,%esp 80104273: 56 push %esi 80104274: 53 push %ebx 80104275: e8 46 fc ff ff call 80103ec0 <sleep> while (lk->locked) { 8010427a: 8b 03 mov (%ebx),%eax 8010427c: 83 c4 10 add $0x10,%esp 8010427f: 85 c0 test %eax,%eax 80104281: 75 ed jne 80104270 <acquiresleep+0x20> } lk->locked = 1; 80104283: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 80104289: e8 72 f6 ff ff call 80103900 <myproc> 8010428e: 8b 40 10 mov 0x10(%eax),%eax 80104291: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 80104294: 89 75 08 mov %esi,0x8(%ebp) } 80104297: 8d 65 f8 lea -0x8(%ebp),%esp 8010429a: 5b pop %ebx 8010429b: 5e pop %esi 8010429c: 5d pop %ebp release(&lk->lk); 8010429d: e9 9e 02 00 00 jmp 80104540 <release> 801042a2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801042a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801042b0 <releasesleep>: void releasesleep(struct sleeplock *lk) { 801042b0: 55 push %ebp 801042b1: 89 e5 mov %esp,%ebp 801042b3: 56 push %esi 801042b4: 53 push %ebx 801042b5: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 801042b8: 83 ec 0c sub $0xc,%esp 801042bb: 8d 73 04 lea 0x4(%ebx),%esi 801042be: 56 push %esi 801042bf: e8 bc 01 00 00 call 80104480 <acquire> lk->locked = 0; 801042c4: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 801042ca: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 801042d1: 89 1c 24 mov %ebx,(%esp) 801042d4: e8 97 fd ff ff call 80104070 <wakeup> release(&lk->lk); 801042d9: 89 75 08 mov %esi,0x8(%ebp) 801042dc: 83 c4 10 add $0x10,%esp } 801042df: 8d 65 f8 lea -0x8(%ebp),%esp 801042e2: 5b pop %ebx 801042e3: 5e pop %esi 801042e4: 5d pop %ebp release(&lk->lk); 801042e5: e9 56 02 00 00 jmp 80104540 <release> 801042ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801042f0 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 801042f0: 55 push %ebp 801042f1: 89 e5 mov %esp,%ebp 801042f3: 57 push %edi 801042f4: 56 push %esi 801042f5: 53 push %ebx 801042f6: 31 ff xor %edi,%edi 801042f8: 83 ec 18 sub $0x18,%esp 801042fb: 8b 5d 08 mov 0x8(%ebp),%ebx int r; acquire(&lk->lk); 801042fe: 8d 73 04 lea 0x4(%ebx),%esi 80104301: 56 push %esi 80104302: e8 79 01 00 00 call 80104480 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 80104307: 8b 03 mov (%ebx),%eax 80104309: 83 c4 10 add $0x10,%esp 8010430c: 85 c0 test %eax,%eax 8010430e: 74 13 je 80104323 <holdingsleep+0x33> 80104310: 8b 5b 3c mov 0x3c(%ebx),%ebx 80104313: e8 e8 f5 ff ff call 80103900 <myproc> 80104318: 39 58 10 cmp %ebx,0x10(%eax) 8010431b: 0f 94 c0 sete %al 8010431e: 0f b6 c0 movzbl %al,%eax 80104321: 89 c7 mov %eax,%edi release(&lk->lk); 80104323: 83 ec 0c sub $0xc,%esp 80104326: 56 push %esi 80104327: e8 14 02 00 00 call 80104540 <release> return r; } 8010432c: 8d 65 f4 lea -0xc(%ebp),%esp 8010432f: 89 f8 mov %edi,%eax 80104331: 5b pop %ebx 80104332: 5e pop %esi 80104333: 5f pop %edi 80104334: 5d pop %ebp 80104335: c3 ret 80104336: 66 90 xchg %ax,%ax 80104338: 66 90 xchg %ax,%ax 8010433a: 66 90 xchg %ax,%ax 8010433c: 66 90 xchg %ax,%ax 8010433e: 66 90 xchg %ax,%ax 80104340 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104340: 55 push %ebp 80104341: 89 e5 mov %esp,%ebp 80104343: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104346: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104349: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 8010434f: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 80104352: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104359: 5d pop %ebp 8010435a: c3 ret 8010435b: 90 nop 8010435c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104360 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104360: 55 push %ebp uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104361: 31 d2 xor %edx,%edx { 80104363: 89 e5 mov %esp,%ebp 80104365: 53 push %ebx ebp = (uint*)v - 2; 80104366: 8b 45 08 mov 0x8(%ebp),%eax { 80104369: 8b 4d 0c mov 0xc(%ebp),%ecx ebp = (uint*)v - 2; 8010436c: 83 e8 08 sub $0x8,%eax 8010436f: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104370: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 80104376: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 8010437c: 77 1a ja 80104398 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 8010437e: 8b 58 04 mov 0x4(%eax),%ebx 80104381: 89 1c 91 mov %ebx,(%ecx,%edx,4) for(i = 0; i < 10; i++){ 80104384: 83 c2 01 add $0x1,%edx ebp = (uint*)ebp[0]; // saved %ebp 80104387: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 80104389: 83 fa 0a cmp $0xa,%edx 8010438c: 75 e2 jne 80104370 <getcallerpcs+0x10> } for(; i < 10; i++) pcs[i] = 0; } 8010438e: 5b pop %ebx 8010438f: 5d pop %ebp 80104390: c3 ret 80104391: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104398: 8d 04 91 lea (%ecx,%edx,4),%eax 8010439b: 83 c1 28 add $0x28,%ecx 8010439e: 66 90 xchg %ax,%ax pcs[i] = 0; 801043a0: c7 00 00 00 00 00 movl $0x0,(%eax) 801043a6: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 801043a9: 39 c1 cmp %eax,%ecx 801043ab: 75 f3 jne 801043a0 <getcallerpcs+0x40> } 801043ad: 5b pop %ebx 801043ae: 5d pop %ebp 801043af: c3 ret 801043b0 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 801043b0: 55 push %ebp 801043b1: 89 e5 mov %esp,%ebp 801043b3: 53 push %ebx 801043b4: 83 ec 04 sub $0x4,%esp 801043b7: 9c pushf 801043b8: 5b pop %ebx asm volatile("cli"); 801043b9: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 801043ba: e8 a1 f4 ff ff call 80103860 <mycpu> 801043bf: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 801043c5: 85 c0 test %eax,%eax 801043c7: 75 11 jne 801043da <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 801043c9: 81 e3 00 02 00 00 and $0x200,%ebx 801043cf: e8 8c f4 ff ff call 80103860 <mycpu> 801043d4: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 801043da: e8 81 f4 ff ff call 80103860 <mycpu> 801043df: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 801043e6: 83 c4 04 add $0x4,%esp 801043e9: 5b pop %ebx 801043ea: 5d pop %ebp 801043eb: c3 ret 801043ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801043f0 <popcli>: void popcli(void) { 801043f0: 55 push %ebp 801043f1: 89 e5 mov %esp,%ebp 801043f3: 83 ec 08 sub $0x8,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 801043f6: 9c pushf 801043f7: 58 pop %eax if(readeflags()&FL_IF) 801043f8: f6 c4 02 test $0x2,%ah 801043fb: 75 35 jne 80104432 <popcli+0x42> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 801043fd: e8 5e f4 ff ff call 80103860 <mycpu> 80104402: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax) 80104409: 78 34 js 8010443f <popcli+0x4f> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 8010440b: e8 50 f4 ff ff call 80103860 <mycpu> 80104410: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80104416: 85 d2 test %edx,%edx 80104418: 74 06 je 80104420 <popcli+0x30> sti(); } 8010441a: c9 leave 8010441b: c3 ret 8010441c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(mycpu()->ncli == 0 && mycpu()->intena) 80104420: e8 3b f4 ff ff call 80103860 <mycpu> 80104425: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 8010442b: 85 c0 test %eax,%eax 8010442d: 74 eb je 8010441a <popcli+0x2a> asm volatile("sti"); 8010442f: fb sti } 80104430: c9 leave 80104431: c3 ret panic("popcli - interruptible"); 80104432: 83 ec 0c sub $0xc,%esp 80104435: 68 6b 77 10 80 push $0x8010776b 8010443a: e8 51 bf ff ff call 80100390 <panic> panic("popcli"); 8010443f: 83 ec 0c sub $0xc,%esp 80104442: 68 82 77 10 80 push $0x80107782 80104447: e8 44 bf ff ff call 80100390 <panic> 8010444c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104450 <holding>: { 80104450: 55 push %ebp 80104451: 89 e5 mov %esp,%ebp 80104453: 56 push %esi 80104454: 53 push %ebx 80104455: 8b 75 08 mov 0x8(%ebp),%esi 80104458: 31 db xor %ebx,%ebx pushcli(); 8010445a: e8 51 ff ff ff call 801043b0 <pushcli> r = lock->locked && lock->cpu == mycpu(); 8010445f: 8b 06 mov (%esi),%eax 80104461: 85 c0 test %eax,%eax 80104463: 74 10 je 80104475 <holding+0x25> 80104465: 8b 5e 08 mov 0x8(%esi),%ebx 80104468: e8 f3 f3 ff ff call 80103860 <mycpu> 8010446d: 39 c3 cmp %eax,%ebx 8010446f: 0f 94 c3 sete %bl 80104472: 0f b6 db movzbl %bl,%ebx popcli(); 80104475: e8 76 ff ff ff call 801043f0 <popcli> } 8010447a: 89 d8 mov %ebx,%eax 8010447c: 5b pop %ebx 8010447d: 5e pop %esi 8010447e: 5d pop %ebp 8010447f: c3 ret 80104480 <acquire>: { 80104480: 55 push %ebp 80104481: 89 e5 mov %esp,%ebp 80104483: 56 push %esi 80104484: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104485: e8 26 ff ff ff call 801043b0 <pushcli> if(holding(lk)) 8010448a: 8b 5d 08 mov 0x8(%ebp),%ebx 8010448d: 83 ec 0c sub $0xc,%esp 80104490: 53 push %ebx 80104491: e8 ba ff ff ff call 80104450 <holding> 80104496: 83 c4 10 add $0x10,%esp 80104499: 85 c0 test %eax,%eax 8010449b: 0f 85 83 00 00 00 jne 80104524 <acquire+0xa4> 801044a1: 89 c6 mov %eax,%esi asm volatile("lock; xchgl %0, %1" : 801044a3: ba 01 00 00 00 mov $0x1,%edx 801044a8: eb 09 jmp 801044b3 <acquire+0x33> 801044aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801044b0: 8b 5d 08 mov 0x8(%ebp),%ebx 801044b3: 89 d0 mov %edx,%eax 801044b5: f0 87 03 lock xchg %eax,(%ebx) while(xchg(&lk->locked, 1) != 0) 801044b8: 85 c0 test %eax,%eax 801044ba: 75 f4 jne 801044b0 <acquire+0x30> __sync_synchronize(); 801044bc: f0 83 0c 24 00 lock orl $0x0,(%esp) lk->cpu = mycpu(); 801044c1: 8b 5d 08 mov 0x8(%ebp),%ebx 801044c4: e8 97 f3 ff ff call 80103860 <mycpu> getcallerpcs(&lk, lk->pcs); 801044c9: 8d 53 0c lea 0xc(%ebx),%edx lk->cpu = mycpu(); 801044cc: 89 43 08 mov %eax,0x8(%ebx) ebp = (uint*)v - 2; 801044cf: 89 e8 mov %ebp,%eax 801044d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 801044d8: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx 801044de: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx 801044e4: 77 1a ja 80104500 <acquire+0x80> pcs[i] = ebp[1]; // saved %eip 801044e6: 8b 48 04 mov 0x4(%eax),%ecx 801044e9: 89 0c b2 mov %ecx,(%edx,%esi,4) for(i = 0; i < 10; i++){ 801044ec: 83 c6 01 add $0x1,%esi ebp = (uint*)ebp[0]; // saved %ebp 801044ef: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 801044f1: 83 fe 0a cmp $0xa,%esi 801044f4: 75 e2 jne 801044d8 <acquire+0x58> } 801044f6: 8d 65 f8 lea -0x8(%ebp),%esp 801044f9: 5b pop %ebx 801044fa: 5e pop %esi 801044fb: 5d pop %ebp 801044fc: c3 ret 801044fd: 8d 76 00 lea 0x0(%esi),%esi 80104500: 8d 04 b2 lea (%edx,%esi,4),%eax 80104503: 83 c2 28 add $0x28,%edx 80104506: 8d 76 00 lea 0x0(%esi),%esi 80104509: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pcs[i] = 0; 80104510: c7 00 00 00 00 00 movl $0x0,(%eax) 80104516: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 80104519: 39 d0 cmp %edx,%eax 8010451b: 75 f3 jne 80104510 <acquire+0x90> } 8010451d: 8d 65 f8 lea -0x8(%ebp),%esp 80104520: 5b pop %ebx 80104521: 5e pop %esi 80104522: 5d pop %ebp 80104523: c3 ret panic("acquire"); 80104524: 83 ec 0c sub $0xc,%esp 80104527: 68 89 77 10 80 push $0x80107789 8010452c: e8 5f be ff ff call 80100390 <panic> 80104531: eb 0d jmp 80104540 <release> 80104533: 90 nop 80104534: 90 nop 80104535: 90 nop 80104536: 90 nop 80104537: 90 nop 80104538: 90 nop 80104539: 90 nop 8010453a: 90 nop 8010453b: 90 nop 8010453c: 90 nop 8010453d: 90 nop 8010453e: 90 nop 8010453f: 90 nop 80104540 <release>: { 80104540: 55 push %ebp 80104541: 89 e5 mov %esp,%ebp 80104543: 53 push %ebx 80104544: 83 ec 10 sub $0x10,%esp 80104547: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holding(lk)) 8010454a: 53 push %ebx 8010454b: e8 00 ff ff ff call 80104450 <holding> 80104550: 83 c4 10 add $0x10,%esp 80104553: 85 c0 test %eax,%eax 80104555: 74 22 je 80104579 <release+0x39> lk->pcs[0] = 0; 80104557: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 8010455e: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 80104565: f0 83 0c 24 00 lock orl $0x0,(%esp) asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 8010456a: c7 03 00 00 00 00 movl $0x0,(%ebx) } 80104570: 8b 5d fc mov -0x4(%ebp),%ebx 80104573: c9 leave popcli(); 80104574: e9 77 fe ff ff jmp 801043f0 <popcli> panic("release"); 80104579: 83 ec 0c sub $0xc,%esp 8010457c: 68 91 77 10 80 push $0x80107791 80104581: e8 0a be ff ff call 80100390 <panic> 80104586: 66 90 xchg %ax,%ax 80104588: 66 90 xchg %ax,%ax 8010458a: 66 90 xchg %ax,%ax 8010458c: 66 90 xchg %ax,%ax 8010458e: 66 90 xchg %ax,%ax 80104590 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 80104590: 55 push %ebp 80104591: 89 e5 mov %esp,%ebp 80104593: 57 push %edi 80104594: 53 push %ebx 80104595: 8b 55 08 mov 0x8(%ebp),%edx 80104598: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst%4 == 0 && n%4 == 0){ 8010459b: f6 c2 03 test $0x3,%dl 8010459e: 75 05 jne 801045a5 <memset+0x15> 801045a0: f6 c1 03 test $0x3,%cl 801045a3: 74 13 je 801045b8 <memset+0x28> asm volatile("cld; rep stosb" : 801045a5: 89 d7 mov %edx,%edi 801045a7: 8b 45 0c mov 0xc(%ebp),%eax 801045aa: fc cld 801045ab: f3 aa rep stos %al,%es:(%edi) c &= 0xFF; stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); } else stosb(dst, c, n); return dst; } 801045ad: 5b pop %ebx 801045ae: 89 d0 mov %edx,%eax 801045b0: 5f pop %edi 801045b1: 5d pop %ebp 801045b2: c3 ret 801045b3: 90 nop 801045b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c &= 0xFF; 801045b8: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 801045bc: c1 e9 02 shr $0x2,%ecx 801045bf: 89 f8 mov %edi,%eax 801045c1: 89 fb mov %edi,%ebx 801045c3: c1 e0 18 shl $0x18,%eax 801045c6: c1 e3 10 shl $0x10,%ebx 801045c9: 09 d8 or %ebx,%eax 801045cb: 09 f8 or %edi,%eax 801045cd: c1 e7 08 shl $0x8,%edi 801045d0: 09 f8 or %edi,%eax asm volatile("cld; rep stosl" : 801045d2: 89 d7 mov %edx,%edi 801045d4: fc cld 801045d5: f3 ab rep stos %eax,%es:(%edi) } 801045d7: 5b pop %ebx 801045d8: 89 d0 mov %edx,%eax 801045da: 5f pop %edi 801045db: 5d pop %ebp 801045dc: c3 ret 801045dd: 8d 76 00 lea 0x0(%esi),%esi 801045e0 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 801045e0: 55 push %ebp 801045e1: 89 e5 mov %esp,%ebp 801045e3: 57 push %edi 801045e4: 56 push %esi 801045e5: 53 push %ebx 801045e6: 8b 5d 10 mov 0x10(%ebp),%ebx 801045e9: 8b 75 08 mov 0x8(%ebp),%esi 801045ec: 8b 7d 0c mov 0xc(%ebp),%edi const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 801045ef: 85 db test %ebx,%ebx 801045f1: 74 29 je 8010461c <memcmp+0x3c> if(*s1 != *s2) 801045f3: 0f b6 16 movzbl (%esi),%edx 801045f6: 0f b6 0f movzbl (%edi),%ecx 801045f9: 38 d1 cmp %dl,%cl 801045fb: 75 2b jne 80104628 <memcmp+0x48> 801045fd: b8 01 00 00 00 mov $0x1,%eax 80104602: eb 14 jmp 80104618 <memcmp+0x38> 80104604: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104608: 0f b6 14 06 movzbl (%esi,%eax,1),%edx 8010460c: 83 c0 01 add $0x1,%eax 8010460f: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx 80104614: 38 ca cmp %cl,%dl 80104616: 75 10 jne 80104628 <memcmp+0x48> while(n-- > 0){ 80104618: 39 d8 cmp %ebx,%eax 8010461a: 75 ec jne 80104608 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 8010461c: 5b pop %ebx return 0; 8010461d: 31 c0 xor %eax,%eax } 8010461f: 5e pop %esi 80104620: 5f pop %edi 80104621: 5d pop %ebp 80104622: c3 ret 80104623: 90 nop 80104624: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return *s1 - *s2; 80104628: 0f b6 c2 movzbl %dl,%eax } 8010462b: 5b pop %ebx return *s1 - *s2; 8010462c: 29 c8 sub %ecx,%eax } 8010462e: 5e pop %esi 8010462f: 5f pop %edi 80104630: 5d pop %ebp 80104631: c3 ret 80104632: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104639: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104640 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80104640: 55 push %ebp 80104641: 89 e5 mov %esp,%ebp 80104643: 56 push %esi 80104644: 53 push %ebx 80104645: 8b 45 08 mov 0x8(%ebp),%eax 80104648: 8b 5d 0c mov 0xc(%ebp),%ebx 8010464b: 8b 75 10 mov 0x10(%ebp),%esi const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 8010464e: 39 c3 cmp %eax,%ebx 80104650: 73 26 jae 80104678 <memmove+0x38> 80104652: 8d 0c 33 lea (%ebx,%esi,1),%ecx 80104655: 39 c8 cmp %ecx,%eax 80104657: 73 1f jae 80104678 <memmove+0x38> s += n; d += n; while(n-- > 0) 80104659: 85 f6 test %esi,%esi 8010465b: 8d 56 ff lea -0x1(%esi),%edx 8010465e: 74 0f je 8010466f <memmove+0x2f> *--d = *--s; 80104660: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104664: 88 0c 10 mov %cl,(%eax,%edx,1) while(n-- > 0) 80104667: 83 ea 01 sub $0x1,%edx 8010466a: 83 fa ff cmp $0xffffffff,%edx 8010466d: 75 f1 jne 80104660 <memmove+0x20> } else while(n-- > 0) *d++ = *s++; return dst; } 8010466f: 5b pop %ebx 80104670: 5e pop %esi 80104671: 5d pop %ebp 80104672: c3 ret 80104673: 90 nop 80104674: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(n-- > 0) 80104678: 31 d2 xor %edx,%edx 8010467a: 85 f6 test %esi,%esi 8010467c: 74 f1 je 8010466f <memmove+0x2f> 8010467e: 66 90 xchg %ax,%ax *d++ = *s++; 80104680: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104684: 88 0c 10 mov %cl,(%eax,%edx,1) 80104687: 83 c2 01 add $0x1,%edx while(n-- > 0) 8010468a: 39 d6 cmp %edx,%esi 8010468c: 75 f2 jne 80104680 <memmove+0x40> } 8010468e: 5b pop %ebx 8010468f: 5e pop %esi 80104690: 5d pop %ebp 80104691: c3 ret 80104692: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046a0 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 801046a0: 55 push %ebp 801046a1: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 801046a3: 5d pop %ebp return memmove(dst, src, n); 801046a4: eb 9a jmp 80104640 <memmove> 801046a6: 8d 76 00 lea 0x0(%esi),%esi 801046a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046b0 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 801046b0: 55 push %ebp 801046b1: 89 e5 mov %esp,%ebp 801046b3: 57 push %edi 801046b4: 56 push %esi 801046b5: 8b 7d 10 mov 0x10(%ebp),%edi 801046b8: 53 push %ebx 801046b9: 8b 4d 08 mov 0x8(%ebp),%ecx 801046bc: 8b 75 0c mov 0xc(%ebp),%esi while(n > 0 && *p && *p == *q) 801046bf: 85 ff test %edi,%edi 801046c1: 74 2f je 801046f2 <strncmp+0x42> 801046c3: 0f b6 01 movzbl (%ecx),%eax 801046c6: 0f b6 1e movzbl (%esi),%ebx 801046c9: 84 c0 test %al,%al 801046cb: 74 37 je 80104704 <strncmp+0x54> 801046cd: 38 c3 cmp %al,%bl 801046cf: 75 33 jne 80104704 <strncmp+0x54> 801046d1: 01 f7 add %esi,%edi 801046d3: eb 13 jmp 801046e8 <strncmp+0x38> 801046d5: 8d 76 00 lea 0x0(%esi),%esi 801046d8: 0f b6 01 movzbl (%ecx),%eax 801046db: 84 c0 test %al,%al 801046dd: 74 21 je 80104700 <strncmp+0x50> 801046df: 0f b6 1a movzbl (%edx),%ebx 801046e2: 89 d6 mov %edx,%esi 801046e4: 38 d8 cmp %bl,%al 801046e6: 75 1c jne 80104704 <strncmp+0x54> n--, p++, q++; 801046e8: 8d 56 01 lea 0x1(%esi),%edx 801046eb: 83 c1 01 add $0x1,%ecx while(n > 0 && *p && *p == *q) 801046ee: 39 fa cmp %edi,%edx 801046f0: 75 e6 jne 801046d8 <strncmp+0x28> if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 801046f2: 5b pop %ebx return 0; 801046f3: 31 c0 xor %eax,%eax } 801046f5: 5e pop %esi 801046f6: 5f pop %edi 801046f7: 5d pop %ebp 801046f8: c3 ret 801046f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104700: 0f b6 5e 01 movzbl 0x1(%esi),%ebx return (uchar)*p - (uchar)*q; 80104704: 29 d8 sub %ebx,%eax } 80104706: 5b pop %ebx 80104707: 5e pop %esi 80104708: 5f pop %edi 80104709: 5d pop %ebp 8010470a: c3 ret 8010470b: 90 nop 8010470c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104710 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80104710: 55 push %ebp 80104711: 89 e5 mov %esp,%ebp 80104713: 56 push %esi 80104714: 53 push %ebx 80104715: 8b 45 08 mov 0x8(%ebp),%eax 80104718: 8b 5d 0c mov 0xc(%ebp),%ebx 8010471b: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 8010471e: 89 c2 mov %eax,%edx 80104720: eb 19 jmp 8010473b <strncpy+0x2b> 80104722: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104728: 83 c3 01 add $0x1,%ebx 8010472b: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 8010472f: 83 c2 01 add $0x1,%edx 80104732: 84 c9 test %cl,%cl 80104734: 88 4a ff mov %cl,-0x1(%edx) 80104737: 74 09 je 80104742 <strncpy+0x32> 80104739: 89 f1 mov %esi,%ecx 8010473b: 85 c9 test %ecx,%ecx 8010473d: 8d 71 ff lea -0x1(%ecx),%esi 80104740: 7f e6 jg 80104728 <strncpy+0x18> ; while(n-- > 0) 80104742: 31 c9 xor %ecx,%ecx 80104744: 85 f6 test %esi,%esi 80104746: 7e 17 jle 8010475f <strncpy+0x4f> 80104748: 90 nop 80104749: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 80104750: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 80104754: 89 f3 mov %esi,%ebx 80104756: 83 c1 01 add $0x1,%ecx 80104759: 29 cb sub %ecx,%ebx while(n-- > 0) 8010475b: 85 db test %ebx,%ebx 8010475d: 7f f1 jg 80104750 <strncpy+0x40> return os; } 8010475f: 5b pop %ebx 80104760: 5e pop %esi 80104761: 5d pop %ebp 80104762: c3 ret 80104763: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104769: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104770 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80104770: 55 push %ebp 80104771: 89 e5 mov %esp,%ebp 80104773: 56 push %esi 80104774: 53 push %ebx 80104775: 8b 4d 10 mov 0x10(%ebp),%ecx 80104778: 8b 45 08 mov 0x8(%ebp),%eax 8010477b: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 8010477e: 85 c9 test %ecx,%ecx 80104780: 7e 26 jle 801047a8 <safestrcpy+0x38> 80104782: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 80104786: 89 c1 mov %eax,%ecx 80104788: eb 17 jmp 801047a1 <safestrcpy+0x31> 8010478a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 80104790: 83 c2 01 add $0x1,%edx 80104793: 0f b6 5a ff movzbl -0x1(%edx),%ebx 80104797: 83 c1 01 add $0x1,%ecx 8010479a: 84 db test %bl,%bl 8010479c: 88 59 ff mov %bl,-0x1(%ecx) 8010479f: 74 04 je 801047a5 <safestrcpy+0x35> 801047a1: 39 f2 cmp %esi,%edx 801047a3: 75 eb jne 80104790 <safestrcpy+0x20> ; *s = 0; 801047a5: c6 01 00 movb $0x0,(%ecx) return os; } 801047a8: 5b pop %ebx 801047a9: 5e pop %esi 801047aa: 5d pop %ebp 801047ab: c3 ret 801047ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801047b0 <strlen>: int strlen(const char *s) { 801047b0: 55 push %ebp int n; for(n = 0; s[n]; n++) 801047b1: 31 c0 xor %eax,%eax { 801047b3: 89 e5 mov %esp,%ebp 801047b5: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) 801047b8: 80 3a 00 cmpb $0x0,(%edx) 801047bb: 74 0c je 801047c9 <strlen+0x19> 801047bd: 8d 76 00 lea 0x0(%esi),%esi 801047c0: 83 c0 01 add $0x1,%eax 801047c3: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 801047c7: 75 f7 jne 801047c0 <strlen+0x10> ; return n; } 801047c9: 5d pop %ebp 801047ca: c3 ret 801047cb <swtch>: # a struct context, and save its address in *old. # Switch stacks to new and pop previously-saved registers. .globl swtch swtch: movl 4(%esp), %eax 801047cb: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 801047cf: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-saved registers pushl %ebp 801047d3: 55 push %ebp pushl %ebx 801047d4: 53 push %ebx pushl %esi 801047d5: 56 push %esi pushl %edi 801047d6: 57 push %edi # Switch stacks movl %esp, (%eax) 801047d7: 89 20 mov %esp,(%eax) movl %edx, %esp 801047d9: 89 d4 mov %edx,%esp # Load new callee-saved registers popl %edi 801047db: 5f pop %edi popl %esi 801047dc: 5e pop %esi popl %ebx 801047dd: 5b pop %ebx popl %ebp 801047de: 5d pop %ebp ret 801047df: c3 ret 801047e0 <fetchint>: // to a saved program counter, and then the first argument. // Fetch the int at addr from the current process. int fetchint(uint addr, int *ip) { 801047e0: 55 push %ebp 801047e1: 89 e5 mov %esp,%ebp 801047e3: 53 push %ebx 801047e4: 83 ec 04 sub $0x4,%esp 801047e7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 801047ea: e8 11 f1 ff ff call 80103900 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801047ef: 8b 00 mov (%eax),%eax 801047f1: 39 d8 cmp %ebx,%eax 801047f3: 76 1b jbe 80104810 <fetchint+0x30> 801047f5: 8d 53 04 lea 0x4(%ebx),%edx 801047f8: 39 d0 cmp %edx,%eax 801047fa: 72 14 jb 80104810 <fetchint+0x30> return -1; *ip = *(int*)(addr); 801047fc: 8b 45 0c mov 0xc(%ebp),%eax 801047ff: 8b 13 mov (%ebx),%edx 80104801: 89 10 mov %edx,(%eax) return 0; 80104803: 31 c0 xor %eax,%eax } 80104805: 83 c4 04 add $0x4,%esp 80104808: 5b pop %ebx 80104809: 5d pop %ebp 8010480a: c3 ret 8010480b: 90 nop 8010480c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104810: b8 ff ff ff ff mov $0xffffffff,%eax 80104815: eb ee jmp 80104805 <fetchint+0x25> 80104817: 89 f6 mov %esi,%esi 80104819: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104820 <fetchstr>: // Fetch the nul-terminated string at addr from the current process. // Doesn't actually copy the string - just sets *pp to point at it. // Returns length of string, not including nul. int fetchstr(uint addr, char **pp) { 80104820: 55 push %ebp 80104821: 89 e5 mov %esp,%ebp 80104823: 53 push %ebx 80104824: 83 ec 04 sub $0x4,%esp 80104827: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 8010482a: e8 d1 f0 ff ff call 80103900 <myproc> if(addr >= curproc->sz) 8010482f: 39 18 cmp %ebx,(%eax) 80104831: 76 29 jbe 8010485c <fetchstr+0x3c> return -1; *pp = (char*)addr; 80104833: 8b 4d 0c mov 0xc(%ebp),%ecx 80104836: 89 da mov %ebx,%edx 80104838: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 8010483a: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 8010483c: 39 c3 cmp %eax,%ebx 8010483e: 73 1c jae 8010485c <fetchstr+0x3c> if(*s == 0) 80104840: 80 3b 00 cmpb $0x0,(%ebx) 80104843: 75 10 jne 80104855 <fetchstr+0x35> 80104845: eb 39 jmp 80104880 <fetchstr+0x60> 80104847: 89 f6 mov %esi,%esi 80104849: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104850: 80 3a 00 cmpb $0x0,(%edx) 80104853: 74 1b je 80104870 <fetchstr+0x50> for(s = *pp; s < ep; s++){ 80104855: 83 c2 01 add $0x1,%edx 80104858: 39 d0 cmp %edx,%eax 8010485a: 77 f4 ja 80104850 <fetchstr+0x30> return -1; 8010485c: b8 ff ff ff ff mov $0xffffffff,%eax return s - *pp; } return -1; } 80104861: 83 c4 04 add $0x4,%esp 80104864: 5b pop %ebx 80104865: 5d pop %ebp 80104866: c3 ret 80104867: 89 f6 mov %esi,%esi 80104869: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104870: 83 c4 04 add $0x4,%esp 80104873: 89 d0 mov %edx,%eax 80104875: 29 d8 sub %ebx,%eax 80104877: 5b pop %ebx 80104878: 5d pop %ebp 80104879: c3 ret 8010487a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(*s == 0) 80104880: 31 c0 xor %eax,%eax return s - *pp; 80104882: eb dd jmp 80104861 <fetchstr+0x41> 80104884: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010488a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104890 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80104890: 55 push %ebp 80104891: 89 e5 mov %esp,%ebp 80104893: 56 push %esi 80104894: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104895: e8 66 f0 ff ff call 80103900 <myproc> 8010489a: 8b 40 18 mov 0x18(%eax),%eax 8010489d: 8b 55 08 mov 0x8(%ebp),%edx 801048a0: 8b 40 44 mov 0x44(%eax),%eax 801048a3: 8d 1c 90 lea (%eax,%edx,4),%ebx struct proc *curproc = myproc(); 801048a6: e8 55 f0 ff ff call 80103900 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801048ab: 8b 00 mov (%eax),%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801048ad: 8d 73 04 lea 0x4(%ebx),%esi if(addr >= curproc->sz || addr+4 > curproc->sz) 801048b0: 39 c6 cmp %eax,%esi 801048b2: 73 1c jae 801048d0 <argint+0x40> 801048b4: 8d 53 08 lea 0x8(%ebx),%edx 801048b7: 39 d0 cmp %edx,%eax 801048b9: 72 15 jb 801048d0 <argint+0x40> *ip = *(int*)(addr); 801048bb: 8b 45 0c mov 0xc(%ebp),%eax 801048be: 8b 53 04 mov 0x4(%ebx),%edx 801048c1: 89 10 mov %edx,(%eax) return 0; 801048c3: 31 c0 xor %eax,%eax } 801048c5: 5b pop %ebx 801048c6: 5e pop %esi 801048c7: 5d pop %ebp 801048c8: c3 ret 801048c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801048d0: b8 ff ff ff ff mov $0xffffffff,%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801048d5: eb ee jmp 801048c5 <argint+0x35> 801048d7: 89 f6 mov %esi,%esi 801048d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801048e0 <argptr>: // Fetch the nth word-sized system call argument as a pointer // to a block of memory of size bytes. Check that the pointer // lies within the process address space. int argptr(int n, char **pp, int size) { 801048e0: 55 push %ebp 801048e1: 89 e5 mov %esp,%ebp 801048e3: 56 push %esi 801048e4: 53 push %ebx 801048e5: 83 ec 10 sub $0x10,%esp 801048e8: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 801048eb: e8 10 f0 ff ff call 80103900 <myproc> 801048f0: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 801048f2: 8d 45 f4 lea -0xc(%ebp),%eax 801048f5: 83 ec 08 sub $0x8,%esp 801048f8: 50 push %eax 801048f9: ff 75 08 pushl 0x8(%ebp) 801048fc: e8 8f ff ff ff call 80104890 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 80104901: 83 c4 10 add $0x10,%esp 80104904: 85 c0 test %eax,%eax 80104906: 78 28 js 80104930 <argptr+0x50> 80104908: 85 db test %ebx,%ebx 8010490a: 78 24 js 80104930 <argptr+0x50> 8010490c: 8b 16 mov (%esi),%edx 8010490e: 8b 45 f4 mov -0xc(%ebp),%eax 80104911: 39 c2 cmp %eax,%edx 80104913: 76 1b jbe 80104930 <argptr+0x50> 80104915: 01 c3 add %eax,%ebx 80104917: 39 da cmp %ebx,%edx 80104919: 72 15 jb 80104930 <argptr+0x50> return -1; *pp = (char*)i; 8010491b: 8b 55 0c mov 0xc(%ebp),%edx 8010491e: 89 02 mov %eax,(%edx) return 0; 80104920: 31 c0 xor %eax,%eax } 80104922: 8d 65 f8 lea -0x8(%ebp),%esp 80104925: 5b pop %ebx 80104926: 5e pop %esi 80104927: 5d pop %ebp 80104928: c3 ret 80104929: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104930: b8 ff ff ff ff mov $0xffffffff,%eax 80104935: eb eb jmp 80104922 <argptr+0x42> 80104937: 89 f6 mov %esi,%esi 80104939: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104940 <argstr>: // Check that the pointer is valid and the string is nul-terminated. // (There is no shared writable memory, so the string can't change // between this check and being used by the kernel.) int argstr(int n, char **pp) { 80104940: 55 push %ebp 80104941: 89 e5 mov %esp,%ebp 80104943: 83 ec 20 sub $0x20,%esp int addr; if(argint(n, &addr) < 0) 80104946: 8d 45 f4 lea -0xc(%ebp),%eax 80104949: 50 push %eax 8010494a: ff 75 08 pushl 0x8(%ebp) 8010494d: e8 3e ff ff ff call 80104890 <argint> 80104952: 83 c4 10 add $0x10,%esp 80104955: 85 c0 test %eax,%eax 80104957: 78 17 js 80104970 <argstr+0x30> return -1; return fetchstr(addr, pp); 80104959: 83 ec 08 sub $0x8,%esp 8010495c: ff 75 0c pushl 0xc(%ebp) 8010495f: ff 75 f4 pushl -0xc(%ebp) 80104962: e8 b9 fe ff ff call 80104820 <fetchstr> 80104967: 83 c4 10 add $0x10,%esp } 8010496a: c9 leave 8010496b: c3 ret 8010496c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104970: b8 ff ff ff ff mov $0xffffffff,%eax } 80104975: c9 leave 80104976: c3 ret 80104977: 89 f6 mov %esi,%esi 80104979: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104980 <syscall>: [SYS_swapwrite] sys_swapwrite, }; void syscall(void) { 80104980: 55 push %ebp 80104981: 89 e5 mov %esp,%ebp 80104983: 53 push %ebx 80104984: 83 ec 04 sub $0x4,%esp int num; struct proc *curproc = myproc(); 80104987: e8 74 ef ff ff call 80103900 <myproc> 8010498c: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 8010498e: 8b 40 18 mov 0x18(%eax),%eax 80104991: 8b 40 1c mov 0x1c(%eax),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80104994: 8d 50 ff lea -0x1(%eax),%edx 80104997: 83 fa 16 cmp $0x16,%edx 8010499a: 77 1c ja 801049b8 <syscall+0x38> 8010499c: 8b 14 85 c0 77 10 80 mov -0x7fef8840(,%eax,4),%edx 801049a3: 85 d2 test %edx,%edx 801049a5: 74 11 je 801049b8 <syscall+0x38> curproc->tf->eax = syscalls[num](); 801049a7: ff d2 call *%edx 801049a9: 8b 53 18 mov 0x18(%ebx),%edx 801049ac: 89 42 1c mov %eax,0x1c(%edx) } else { cprintf("%d %s: unknown sys call %d\n", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } 801049af: 8b 5d fc mov -0x4(%ebp),%ebx 801049b2: c9 leave 801049b3: c3 ret 801049b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%d %s: unknown sys call %d\n", 801049b8: 50 push %eax curproc->pid, curproc->name, num); 801049b9: 8d 43 6c lea 0x6c(%ebx),%eax cprintf("%d %s: unknown sys call %d\n", 801049bc: 50 push %eax 801049bd: ff 73 10 pushl 0x10(%ebx) 801049c0: 68 99 77 10 80 push $0x80107799 801049c5: e8 96 bc ff ff call 80100660 <cprintf> curproc->tf->eax = -1; 801049ca: 8b 43 18 mov 0x18(%ebx),%eax 801049cd: 83 c4 10 add $0x10,%esp 801049d0: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 801049d7: 8b 5d fc mov -0x4(%ebp),%ebx 801049da: c9 leave 801049db: c3 ret 801049dc: 66 90 xchg %ax,%ax 801049de: 66 90 xchg %ax,%ax 801049e0 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 801049e0: 55 push %ebp 801049e1: 89 e5 mov %esp,%ebp 801049e3: 57 push %edi 801049e4: 56 push %esi 801049e5: 53 push %ebx uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 801049e6: 8d 75 da lea -0x26(%ebp),%esi { 801049e9: 83 ec 44 sub $0x44,%esp 801049ec: 89 4d c0 mov %ecx,-0x40(%ebp) 801049ef: 8b 4d 08 mov 0x8(%ebp),%ecx if((dp = nameiparent(path, name)) == 0) 801049f2: 56 push %esi 801049f3: 50 push %eax { 801049f4: 89 55 c4 mov %edx,-0x3c(%ebp) 801049f7: 89 4d bc mov %ecx,-0x44(%ebp) if((dp = nameiparent(path, name)) == 0) 801049fa: e8 11 d5 ff ff call 80101f10 <nameiparent> 801049ff: 83 c4 10 add $0x10,%esp 80104a02: 85 c0 test %eax,%eax 80104a04: 0f 84 46 01 00 00 je 80104b50 <create+0x170> return 0; ilock(dp); 80104a0a: 83 ec 0c sub $0xc,%esp 80104a0d: 89 c3 mov %eax,%ebx 80104a0f: 50 push %eax 80104a10: e8 7b cc ff ff call 80101690 <ilock> if((ip = dirlookup(dp, name, &off)) != 0){ 80104a15: 8d 45 d4 lea -0x2c(%ebp),%eax 80104a18: 83 c4 0c add $0xc,%esp 80104a1b: 50 push %eax 80104a1c: 56 push %esi 80104a1d: 53 push %ebx 80104a1e: e8 9d d1 ff ff call 80101bc0 <dirlookup> 80104a23: 83 c4 10 add $0x10,%esp 80104a26: 85 c0 test %eax,%eax 80104a28: 89 c7 mov %eax,%edi 80104a2a: 74 34 je 80104a60 <create+0x80> iunlockput(dp); 80104a2c: 83 ec 0c sub $0xc,%esp 80104a2f: 53 push %ebx 80104a30: e8 eb ce ff ff call 80101920 <iunlockput> ilock(ip); 80104a35: 89 3c 24 mov %edi,(%esp) 80104a38: e8 53 cc ff ff call 80101690 <ilock> if(type == T_FILE && ip->type == T_FILE) 80104a3d: 83 c4 10 add $0x10,%esp 80104a40: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp) 80104a45: 0f 85 95 00 00 00 jne 80104ae0 <create+0x100> 80104a4b: 66 83 7f 50 02 cmpw $0x2,0x50(%edi) 80104a50: 0f 85 8a 00 00 00 jne 80104ae0 <create+0x100> panic("create: dirlink"); iunlockput(dp); return ip; } 80104a56: 8d 65 f4 lea -0xc(%ebp),%esp 80104a59: 89 f8 mov %edi,%eax 80104a5b: 5b pop %ebx 80104a5c: 5e pop %esi 80104a5d: 5f pop %edi 80104a5e: 5d pop %ebp 80104a5f: c3 ret if((ip = ialloc(dp->dev, type)) == 0) 80104a60: 0f bf 45 c4 movswl -0x3c(%ebp),%eax 80104a64: 83 ec 08 sub $0x8,%esp 80104a67: 50 push %eax 80104a68: ff 33 pushl (%ebx) 80104a6a: e8 b1 ca ff ff call 80101520 <ialloc> 80104a6f: 83 c4 10 add $0x10,%esp 80104a72: 85 c0 test %eax,%eax 80104a74: 89 c7 mov %eax,%edi 80104a76: 0f 84 e8 00 00 00 je 80104b64 <create+0x184> ilock(ip); 80104a7c: 83 ec 0c sub $0xc,%esp 80104a7f: 50 push %eax 80104a80: e8 0b cc ff ff call 80101690 <ilock> ip->major = major; 80104a85: 0f b7 45 c0 movzwl -0x40(%ebp),%eax 80104a89: 66 89 47 52 mov %ax,0x52(%edi) ip->minor = minor; 80104a8d: 0f b7 45 bc movzwl -0x44(%ebp),%eax 80104a91: 66 89 47 54 mov %ax,0x54(%edi) ip->nlink = 1; 80104a95: b8 01 00 00 00 mov $0x1,%eax 80104a9a: 66 89 47 56 mov %ax,0x56(%edi) iupdate(ip); 80104a9e: 89 3c 24 mov %edi,(%esp) 80104aa1: e8 3a cb ff ff call 801015e0 <iupdate> if(type == T_DIR){ // Create . and .. entries. 80104aa6: 83 c4 10 add $0x10,%esp 80104aa9: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp) 80104aae: 74 50 je 80104b00 <create+0x120> if(dirlink(dp, name, ip->inum) < 0) 80104ab0: 83 ec 04 sub $0x4,%esp 80104ab3: ff 77 04 pushl 0x4(%edi) 80104ab6: 56 push %esi 80104ab7: 53 push %ebx 80104ab8: e8 73 d3 ff ff call 80101e30 <dirlink> 80104abd: 83 c4 10 add $0x10,%esp 80104ac0: 85 c0 test %eax,%eax 80104ac2: 0f 88 8f 00 00 00 js 80104b57 <create+0x177> iunlockput(dp); 80104ac8: 83 ec 0c sub $0xc,%esp 80104acb: 53 push %ebx 80104acc: e8 4f ce ff ff call 80101920 <iunlockput> return ip; 80104ad1: 83 c4 10 add $0x10,%esp } 80104ad4: 8d 65 f4 lea -0xc(%ebp),%esp 80104ad7: 89 f8 mov %edi,%eax 80104ad9: 5b pop %ebx 80104ada: 5e pop %esi 80104adb: 5f pop %edi 80104adc: 5d pop %ebp 80104add: c3 ret 80104ade: 66 90 xchg %ax,%ax iunlockput(ip); 80104ae0: 83 ec 0c sub $0xc,%esp 80104ae3: 57 push %edi return 0; 80104ae4: 31 ff xor %edi,%edi iunlockput(ip); 80104ae6: e8 35 ce ff ff call 80101920 <iunlockput> return 0; 80104aeb: 83 c4 10 add $0x10,%esp } 80104aee: 8d 65 f4 lea -0xc(%ebp),%esp 80104af1: 89 f8 mov %edi,%eax 80104af3: 5b pop %ebx 80104af4: 5e pop %esi 80104af5: 5f pop %edi 80104af6: 5d pop %ebp 80104af7: c3 ret 80104af8: 90 nop 80104af9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink++; // for ".." 80104b00: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(dp); 80104b05: 83 ec 0c sub $0xc,%esp 80104b08: 53 push %ebx 80104b09: e8 d2 ca ff ff call 801015e0 <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80104b0e: 83 c4 0c add $0xc,%esp 80104b11: ff 77 04 pushl 0x4(%edi) 80104b14: 68 3c 78 10 80 push $0x8010783c 80104b19: 57 push %edi 80104b1a: e8 11 d3 ff ff call 80101e30 <dirlink> 80104b1f: 83 c4 10 add $0x10,%esp 80104b22: 85 c0 test %eax,%eax 80104b24: 78 1c js 80104b42 <create+0x162> 80104b26: 83 ec 04 sub $0x4,%esp 80104b29: ff 73 04 pushl 0x4(%ebx) 80104b2c: 68 3b 78 10 80 push $0x8010783b 80104b31: 57 push %edi 80104b32: e8 f9 d2 ff ff call 80101e30 <dirlink> 80104b37: 83 c4 10 add $0x10,%esp 80104b3a: 85 c0 test %eax,%eax 80104b3c: 0f 89 6e ff ff ff jns 80104ab0 <create+0xd0> panic("create dots"); 80104b42: 83 ec 0c sub $0xc,%esp 80104b45: 68 2f 78 10 80 push $0x8010782f 80104b4a: e8 41 b8 ff ff call 80100390 <panic> 80104b4f: 90 nop return 0; 80104b50: 31 ff xor %edi,%edi 80104b52: e9 ff fe ff ff jmp 80104a56 <create+0x76> panic("create: dirlink"); 80104b57: 83 ec 0c sub $0xc,%esp 80104b5a: 68 3e 78 10 80 push $0x8010783e 80104b5f: e8 2c b8 ff ff call 80100390 <panic> panic("create: ialloc"); 80104b64: 83 ec 0c sub $0xc,%esp 80104b67: 68 20 78 10 80 push $0x80107820 80104b6c: e8 1f b8 ff ff call 80100390 <panic> 80104b71: eb 0d jmp 80104b80 <argfd.constprop.0> 80104b73: 90 nop 80104b74: 90 nop 80104b75: 90 nop 80104b76: 90 nop 80104b77: 90 nop 80104b78: 90 nop 80104b79: 90 nop 80104b7a: 90 nop 80104b7b: 90 nop 80104b7c: 90 nop 80104b7d: 90 nop 80104b7e: 90 nop 80104b7f: 90 nop 80104b80 <argfd.constprop.0>: argfd(int n, int *pfd, struct file **pf) 80104b80: 55 push %ebp 80104b81: 89 e5 mov %esp,%ebp 80104b83: 56 push %esi 80104b84: 53 push %ebx 80104b85: 89 c3 mov %eax,%ebx if(argint(n, &fd) < 0) 80104b87: 8d 45 f4 lea -0xc(%ebp),%eax argfd(int n, int *pfd, struct file **pf) 80104b8a: 89 d6 mov %edx,%esi 80104b8c: 83 ec 18 sub $0x18,%esp if(argint(n, &fd) < 0) 80104b8f: 50 push %eax 80104b90: 6a 00 push $0x0 80104b92: e8 f9 fc ff ff call 80104890 <argint> 80104b97: 83 c4 10 add $0x10,%esp 80104b9a: 85 c0 test %eax,%eax 80104b9c: 78 2a js 80104bc8 <argfd.constprop.0+0x48> if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80104b9e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80104ba2: 77 24 ja 80104bc8 <argfd.constprop.0+0x48> 80104ba4: e8 57 ed ff ff call 80103900 <myproc> 80104ba9: 8b 55 f4 mov -0xc(%ebp),%edx 80104bac: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80104bb0: 85 c0 test %eax,%eax 80104bb2: 74 14 je 80104bc8 <argfd.constprop.0+0x48> if(pfd) 80104bb4: 85 db test %ebx,%ebx 80104bb6: 74 02 je 80104bba <argfd.constprop.0+0x3a> *pfd = fd; 80104bb8: 89 13 mov %edx,(%ebx) *pf = f; 80104bba: 89 06 mov %eax,(%esi) return 0; 80104bbc: 31 c0 xor %eax,%eax } 80104bbe: 8d 65 f8 lea -0x8(%ebp),%esp 80104bc1: 5b pop %ebx 80104bc2: 5e pop %esi 80104bc3: 5d pop %ebp 80104bc4: c3 ret 80104bc5: 8d 76 00 lea 0x0(%esi),%esi return -1; 80104bc8: b8 ff ff ff ff mov $0xffffffff,%eax 80104bcd: eb ef jmp 80104bbe <argfd.constprop.0+0x3e> 80104bcf: 90 nop 80104bd0 <sys_dup>: { 80104bd0: 55 push %ebp if(argfd(0, 0, &f) < 0) 80104bd1: 31 c0 xor %eax,%eax { 80104bd3: 89 e5 mov %esp,%ebp 80104bd5: 56 push %esi 80104bd6: 53 push %ebx if(argfd(0, 0, &f) < 0) 80104bd7: 8d 55 f4 lea -0xc(%ebp),%edx { 80104bda: 83 ec 10 sub $0x10,%esp if(argfd(0, 0, &f) < 0) 80104bdd: e8 9e ff ff ff call 80104b80 <argfd.constprop.0> 80104be2: 85 c0 test %eax,%eax 80104be4: 78 42 js 80104c28 <sys_dup+0x58> if((fd=fdalloc(f)) < 0) 80104be6: 8b 75 f4 mov -0xc(%ebp),%esi for(fd = 0; fd < NOFILE; fd++){ 80104be9: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80104beb: e8 10 ed ff ff call 80103900 <myproc> 80104bf0: eb 0e jmp 80104c00 <sys_dup+0x30> 80104bf2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(fd = 0; fd < NOFILE; fd++){ 80104bf8: 83 c3 01 add $0x1,%ebx 80104bfb: 83 fb 10 cmp $0x10,%ebx 80104bfe: 74 28 je 80104c28 <sys_dup+0x58> if(curproc->ofile[fd] == 0){ 80104c00: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80104c04: 85 d2 test %edx,%edx 80104c06: 75 f0 jne 80104bf8 <sys_dup+0x28> curproc->ofile[fd] = f; 80104c08: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) filedup(f); 80104c0c: 83 ec 0c sub $0xc,%esp 80104c0f: ff 75 f4 pushl -0xc(%ebp) 80104c12: e8 d9 c1 ff ff call 80100df0 <filedup> return fd; 80104c17: 83 c4 10 add $0x10,%esp } 80104c1a: 8d 65 f8 lea -0x8(%ebp),%esp 80104c1d: 89 d8 mov %ebx,%eax 80104c1f: 5b pop %ebx 80104c20: 5e pop %esi 80104c21: 5d pop %ebp 80104c22: c3 ret 80104c23: 90 nop 80104c24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104c28: 8d 65 f8 lea -0x8(%ebp),%esp return -1; 80104c2b: bb ff ff ff ff mov $0xffffffff,%ebx } 80104c30: 89 d8 mov %ebx,%eax 80104c32: 5b pop %ebx 80104c33: 5e pop %esi 80104c34: 5d pop %ebp 80104c35: c3 ret 80104c36: 8d 76 00 lea 0x0(%esi),%esi 80104c39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c40 <sys_read>: { 80104c40: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104c41: 31 c0 xor %eax,%eax { 80104c43: 89 e5 mov %esp,%ebp 80104c45: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104c48: 8d 55 ec lea -0x14(%ebp),%edx 80104c4b: e8 30 ff ff ff call 80104b80 <argfd.constprop.0> 80104c50: 85 c0 test %eax,%eax 80104c52: 78 4c js 80104ca0 <sys_read+0x60> 80104c54: 8d 45 f0 lea -0x10(%ebp),%eax 80104c57: 83 ec 08 sub $0x8,%esp 80104c5a: 50 push %eax 80104c5b: 6a 02 push $0x2 80104c5d: e8 2e fc ff ff call 80104890 <argint> 80104c62: 83 c4 10 add $0x10,%esp 80104c65: 85 c0 test %eax,%eax 80104c67: 78 37 js 80104ca0 <sys_read+0x60> 80104c69: 8d 45 f4 lea -0xc(%ebp),%eax 80104c6c: 83 ec 04 sub $0x4,%esp 80104c6f: ff 75 f0 pushl -0x10(%ebp) 80104c72: 50 push %eax 80104c73: 6a 01 push $0x1 80104c75: e8 66 fc ff ff call 801048e0 <argptr> 80104c7a: 83 c4 10 add $0x10,%esp 80104c7d: 85 c0 test %eax,%eax 80104c7f: 78 1f js 80104ca0 <sys_read+0x60> return fileread(f, p, n); 80104c81: 83 ec 04 sub $0x4,%esp 80104c84: ff 75 f0 pushl -0x10(%ebp) 80104c87: ff 75 f4 pushl -0xc(%ebp) 80104c8a: ff 75 ec pushl -0x14(%ebp) 80104c8d: e8 ce c2 ff ff call 80100f60 <fileread> 80104c92: 83 c4 10 add $0x10,%esp } 80104c95: c9 leave 80104c96: c3 ret 80104c97: 89 f6 mov %esi,%esi 80104c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104ca0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ca5: c9 leave 80104ca6: c3 ret 80104ca7: 89 f6 mov %esi,%esi 80104ca9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104cb0 <sys_write>: { 80104cb0: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104cb1: 31 c0 xor %eax,%eax { 80104cb3: 89 e5 mov %esp,%ebp 80104cb5: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104cb8: 8d 55 ec lea -0x14(%ebp),%edx 80104cbb: e8 c0 fe ff ff call 80104b80 <argfd.constprop.0> 80104cc0: 85 c0 test %eax,%eax 80104cc2: 78 4c js 80104d10 <sys_write+0x60> 80104cc4: 8d 45 f0 lea -0x10(%ebp),%eax 80104cc7: 83 ec 08 sub $0x8,%esp 80104cca: 50 push %eax 80104ccb: 6a 02 push $0x2 80104ccd: e8 be fb ff ff call 80104890 <argint> 80104cd2: 83 c4 10 add $0x10,%esp 80104cd5: 85 c0 test %eax,%eax 80104cd7: 78 37 js 80104d10 <sys_write+0x60> 80104cd9: 8d 45 f4 lea -0xc(%ebp),%eax 80104cdc: 83 ec 04 sub $0x4,%esp 80104cdf: ff 75 f0 pushl -0x10(%ebp) 80104ce2: 50 push %eax 80104ce3: 6a 01 push $0x1 80104ce5: e8 f6 fb ff ff call 801048e0 <argptr> 80104cea: 83 c4 10 add $0x10,%esp 80104ced: 85 c0 test %eax,%eax 80104cef: 78 1f js 80104d10 <sys_write+0x60> return filewrite(f, p, n); 80104cf1: 83 ec 04 sub $0x4,%esp 80104cf4: ff 75 f0 pushl -0x10(%ebp) 80104cf7: ff 75 f4 pushl -0xc(%ebp) 80104cfa: ff 75 ec pushl -0x14(%ebp) 80104cfd: e8 ee c2 ff ff call 80100ff0 <filewrite> 80104d02: 83 c4 10 add $0x10,%esp } 80104d05: c9 leave 80104d06: c3 ret 80104d07: 89 f6 mov %esi,%esi 80104d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104d10: b8 ff ff ff ff mov $0xffffffff,%eax } 80104d15: c9 leave 80104d16: c3 ret 80104d17: 89 f6 mov %esi,%esi 80104d19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d20 <sys_close>: { 80104d20: 55 push %ebp 80104d21: 89 e5 mov %esp,%ebp 80104d23: 83 ec 18 sub $0x18,%esp if(argfd(0, &fd, &f) < 0) 80104d26: 8d 55 f4 lea -0xc(%ebp),%edx 80104d29: 8d 45 f0 lea -0x10(%ebp),%eax 80104d2c: e8 4f fe ff ff call 80104b80 <argfd.constprop.0> 80104d31: 85 c0 test %eax,%eax 80104d33: 78 2b js 80104d60 <sys_close+0x40> myproc()->ofile[fd] = 0; 80104d35: e8 c6 eb ff ff call 80103900 <myproc> 80104d3a: 8b 55 f0 mov -0x10(%ebp),%edx fileclose(f); 80104d3d: 83 ec 0c sub $0xc,%esp myproc()->ofile[fd] = 0; 80104d40: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80104d47: 00 fileclose(f); 80104d48: ff 75 f4 pushl -0xc(%ebp) 80104d4b: e8 f0 c0 ff ff call 80100e40 <fileclose> return 0; 80104d50: 83 c4 10 add $0x10,%esp 80104d53: 31 c0 xor %eax,%eax } 80104d55: c9 leave 80104d56: c3 ret 80104d57: 89 f6 mov %esi,%esi 80104d59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104d60: b8 ff ff ff ff mov $0xffffffff,%eax } 80104d65: c9 leave 80104d66: c3 ret 80104d67: 89 f6 mov %esi,%esi 80104d69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d70 <sys_fstat>: { 80104d70: 55 push %ebp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104d71: 31 c0 xor %eax,%eax { 80104d73: 89 e5 mov %esp,%ebp 80104d75: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104d78: 8d 55 f0 lea -0x10(%ebp),%edx 80104d7b: e8 00 fe ff ff call 80104b80 <argfd.constprop.0> 80104d80: 85 c0 test %eax,%eax 80104d82: 78 2c js 80104db0 <sys_fstat+0x40> 80104d84: 8d 45 f4 lea -0xc(%ebp),%eax 80104d87: 83 ec 04 sub $0x4,%esp 80104d8a: 6a 14 push $0x14 80104d8c: 50 push %eax 80104d8d: 6a 01 push $0x1 80104d8f: e8 4c fb ff ff call 801048e0 <argptr> 80104d94: 83 c4 10 add $0x10,%esp 80104d97: 85 c0 test %eax,%eax 80104d99: 78 15 js 80104db0 <sys_fstat+0x40> return filestat(f, st); 80104d9b: 83 ec 08 sub $0x8,%esp 80104d9e: ff 75 f4 pushl -0xc(%ebp) 80104da1: ff 75 f0 pushl -0x10(%ebp) 80104da4: e8 67 c1 ff ff call 80100f10 <filestat> 80104da9: 83 c4 10 add $0x10,%esp } 80104dac: c9 leave 80104dad: c3 ret 80104dae: 66 90 xchg %ax,%ax return -1; 80104db0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104db5: c9 leave 80104db6: c3 ret 80104db7: 89 f6 mov %esi,%esi 80104db9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104dc0 <sys_link>: { 80104dc0: 55 push %ebp 80104dc1: 89 e5 mov %esp,%ebp 80104dc3: 57 push %edi 80104dc4: 56 push %esi 80104dc5: 53 push %ebx if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104dc6: 8d 45 d4 lea -0x2c(%ebp),%eax { 80104dc9: 83 ec 34 sub $0x34,%esp if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104dcc: 50 push %eax 80104dcd: 6a 00 push $0x0 80104dcf: e8 6c fb ff ff call 80104940 <argstr> 80104dd4: 83 c4 10 add $0x10,%esp 80104dd7: 85 c0 test %eax,%eax 80104dd9: 0f 88 fb 00 00 00 js 80104eda <sys_link+0x11a> 80104ddf: 8d 45 d0 lea -0x30(%ebp),%eax 80104de2: 83 ec 08 sub $0x8,%esp 80104de5: 50 push %eax 80104de6: 6a 01 push $0x1 80104de8: e8 53 fb ff ff call 80104940 <argstr> 80104ded: 83 c4 10 add $0x10,%esp 80104df0: 85 c0 test %eax,%eax 80104df2: 0f 88 e2 00 00 00 js 80104eda <sys_link+0x11a> begin_op(); 80104df8: e8 c3 de ff ff call 80102cc0 <begin_op> if((ip = namei(old)) == 0){ 80104dfd: 83 ec 0c sub $0xc,%esp 80104e00: ff 75 d4 pushl -0x2c(%ebp) 80104e03: e8 e8 d0 ff ff call 80101ef0 <namei> 80104e08: 83 c4 10 add $0x10,%esp 80104e0b: 85 c0 test %eax,%eax 80104e0d: 89 c3 mov %eax,%ebx 80104e0f: 0f 84 ea 00 00 00 je 80104eff <sys_link+0x13f> ilock(ip); 80104e15: 83 ec 0c sub $0xc,%esp 80104e18: 50 push %eax 80104e19: e8 72 c8 ff ff call 80101690 <ilock> if(ip->type == T_DIR){ 80104e1e: 83 c4 10 add $0x10,%esp 80104e21: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104e26: 0f 84 bb 00 00 00 je 80104ee7 <sys_link+0x127> ip->nlink++; 80104e2c: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(ip); 80104e31: 83 ec 0c sub $0xc,%esp if((dp = nameiparent(new, name)) == 0) 80104e34: 8d 7d da lea -0x26(%ebp),%edi iupdate(ip); 80104e37: 53 push %ebx 80104e38: e8 a3 c7 ff ff call 801015e0 <iupdate> iunlock(ip); 80104e3d: 89 1c 24 mov %ebx,(%esp) 80104e40: e8 2b c9 ff ff call 80101770 <iunlock> if((dp = nameiparent(new, name)) == 0) 80104e45: 58 pop %eax 80104e46: 5a pop %edx 80104e47: 57 push %edi 80104e48: ff 75 d0 pushl -0x30(%ebp) 80104e4b: e8 c0 d0 ff ff call 80101f10 <nameiparent> 80104e50: 83 c4 10 add $0x10,%esp 80104e53: 85 c0 test %eax,%eax 80104e55: 89 c6 mov %eax,%esi 80104e57: 74 5b je 80104eb4 <sys_link+0xf4> ilock(dp); 80104e59: 83 ec 0c sub $0xc,%esp 80104e5c: 50 push %eax 80104e5d: e8 2e c8 ff ff call 80101690 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 80104e62: 83 c4 10 add $0x10,%esp 80104e65: 8b 03 mov (%ebx),%eax 80104e67: 39 06 cmp %eax,(%esi) 80104e69: 75 3d jne 80104ea8 <sys_link+0xe8> 80104e6b: 83 ec 04 sub $0x4,%esp 80104e6e: ff 73 04 pushl 0x4(%ebx) 80104e71: 57 push %edi 80104e72: 56 push %esi 80104e73: e8 b8 cf ff ff call 80101e30 <dirlink> 80104e78: 83 c4 10 add $0x10,%esp 80104e7b: 85 c0 test %eax,%eax 80104e7d: 78 29 js 80104ea8 <sys_link+0xe8> iunlockput(dp); 80104e7f: 83 ec 0c sub $0xc,%esp 80104e82: 56 push %esi 80104e83: e8 98 ca ff ff call 80101920 <iunlockput> iput(ip); 80104e88: 89 1c 24 mov %ebx,(%esp) 80104e8b: e8 30 c9 ff ff call 801017c0 <iput> end_op(); 80104e90: e8 9b de ff ff call 80102d30 <end_op> return 0; 80104e95: 83 c4 10 add $0x10,%esp 80104e98: 31 c0 xor %eax,%eax } 80104e9a: 8d 65 f4 lea -0xc(%ebp),%esp 80104e9d: 5b pop %ebx 80104e9e: 5e pop %esi 80104e9f: 5f pop %edi 80104ea0: 5d pop %ebp 80104ea1: c3 ret 80104ea2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi iunlockput(dp); 80104ea8: 83 ec 0c sub $0xc,%esp 80104eab: 56 push %esi 80104eac: e8 6f ca ff ff call 80101920 <iunlockput> goto bad; 80104eb1: 83 c4 10 add $0x10,%esp ilock(ip); 80104eb4: 83 ec 0c sub $0xc,%esp 80104eb7: 53 push %ebx 80104eb8: e8 d3 c7 ff ff call 80101690 <ilock> ip->nlink--; 80104ebd: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104ec2: 89 1c 24 mov %ebx,(%esp) 80104ec5: e8 16 c7 ff ff call 801015e0 <iupdate> iunlockput(ip); 80104eca: 89 1c 24 mov %ebx,(%esp) 80104ecd: e8 4e ca ff ff call 80101920 <iunlockput> end_op(); 80104ed2: e8 59 de ff ff call 80102d30 <end_op> return -1; 80104ed7: 83 c4 10 add $0x10,%esp } 80104eda: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80104edd: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ee2: 5b pop %ebx 80104ee3: 5e pop %esi 80104ee4: 5f pop %edi 80104ee5: 5d pop %ebp 80104ee6: c3 ret iunlockput(ip); 80104ee7: 83 ec 0c sub $0xc,%esp 80104eea: 53 push %ebx 80104eeb: e8 30 ca ff ff call 80101920 <iunlockput> end_op(); 80104ef0: e8 3b de ff ff call 80102d30 <end_op> return -1; 80104ef5: 83 c4 10 add $0x10,%esp 80104ef8: b8 ff ff ff ff mov $0xffffffff,%eax 80104efd: eb 9b jmp 80104e9a <sys_link+0xda> end_op(); 80104eff: e8 2c de ff ff call 80102d30 <end_op> return -1; 80104f04: b8 ff ff ff ff mov $0xffffffff,%eax 80104f09: eb 8f jmp 80104e9a <sys_link+0xda> 80104f0b: 90 nop 80104f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104f10 <sys_unlink>: { 80104f10: 55 push %ebp 80104f11: 89 e5 mov %esp,%ebp 80104f13: 57 push %edi 80104f14: 56 push %esi 80104f15: 53 push %ebx if(argstr(0, &path) < 0) 80104f16: 8d 45 c0 lea -0x40(%ebp),%eax { 80104f19: 83 ec 44 sub $0x44,%esp if(argstr(0, &path) < 0) 80104f1c: 50 push %eax 80104f1d: 6a 00 push $0x0 80104f1f: e8 1c fa ff ff call 80104940 <argstr> 80104f24: 83 c4 10 add $0x10,%esp 80104f27: 85 c0 test %eax,%eax 80104f29: 0f 88 77 01 00 00 js 801050a6 <sys_unlink+0x196> if((dp = nameiparent(path, name)) == 0){ 80104f2f: 8d 5d ca lea -0x36(%ebp),%ebx begin_op(); 80104f32: e8 89 dd ff ff call 80102cc0 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80104f37: 83 ec 08 sub $0x8,%esp 80104f3a: 53 push %ebx 80104f3b: ff 75 c0 pushl -0x40(%ebp) 80104f3e: e8 cd cf ff ff call 80101f10 <nameiparent> 80104f43: 83 c4 10 add $0x10,%esp 80104f46: 85 c0 test %eax,%eax 80104f48: 89 c6 mov %eax,%esi 80104f4a: 0f 84 60 01 00 00 je 801050b0 <sys_unlink+0x1a0> ilock(dp); 80104f50: 83 ec 0c sub $0xc,%esp 80104f53: 50 push %eax 80104f54: e8 37 c7 ff ff call 80101690 <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80104f59: 58 pop %eax 80104f5a: 5a pop %edx 80104f5b: 68 3c 78 10 80 push $0x8010783c 80104f60: 53 push %ebx 80104f61: e8 3a cc ff ff call 80101ba0 <namecmp> 80104f66: 83 c4 10 add $0x10,%esp 80104f69: 85 c0 test %eax,%eax 80104f6b: 0f 84 03 01 00 00 je 80105074 <sys_unlink+0x164> 80104f71: 83 ec 08 sub $0x8,%esp 80104f74: 68 3b 78 10 80 push $0x8010783b 80104f79: 53 push %ebx 80104f7a: e8 21 cc ff ff call 80101ba0 <namecmp> 80104f7f: 83 c4 10 add $0x10,%esp 80104f82: 85 c0 test %eax,%eax 80104f84: 0f 84 ea 00 00 00 je 80105074 <sys_unlink+0x164> if((ip = dirlookup(dp, name, &off)) == 0) 80104f8a: 8d 45 c4 lea -0x3c(%ebp),%eax 80104f8d: 83 ec 04 sub $0x4,%esp 80104f90: 50 push %eax 80104f91: 53 push %ebx 80104f92: 56 push %esi 80104f93: e8 28 cc ff ff call 80101bc0 <dirlookup> 80104f98: 83 c4 10 add $0x10,%esp 80104f9b: 85 c0 test %eax,%eax 80104f9d: 89 c3 mov %eax,%ebx 80104f9f: 0f 84 cf 00 00 00 je 80105074 <sys_unlink+0x164> ilock(ip); 80104fa5: 83 ec 0c sub $0xc,%esp 80104fa8: 50 push %eax 80104fa9: e8 e2 c6 ff ff call 80101690 <ilock> if(ip->nlink < 1) 80104fae: 83 c4 10 add $0x10,%esp 80104fb1: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80104fb6: 0f 8e 10 01 00 00 jle 801050cc <sys_unlink+0x1bc> if(ip->type == T_DIR && !isdirempty(ip)){ 80104fbc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104fc1: 74 6d je 80105030 <sys_unlink+0x120> memset(&de, 0, sizeof(de)); 80104fc3: 8d 45 d8 lea -0x28(%ebp),%eax 80104fc6: 83 ec 04 sub $0x4,%esp 80104fc9: 6a 10 push $0x10 80104fcb: 6a 00 push $0x0 80104fcd: 50 push %eax 80104fce: e8 bd f5 ff ff call 80104590 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104fd3: 8d 45 d8 lea -0x28(%ebp),%eax 80104fd6: 6a 10 push $0x10 80104fd8: ff 75 c4 pushl -0x3c(%ebp) 80104fdb: 50 push %eax 80104fdc: 56 push %esi 80104fdd: e8 8e ca ff ff call 80101a70 <writei> 80104fe2: 83 c4 20 add $0x20,%esp 80104fe5: 83 f8 10 cmp $0x10,%eax 80104fe8: 0f 85 eb 00 00 00 jne 801050d9 <sys_unlink+0x1c9> if(ip->type == T_DIR){ 80104fee: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104ff3: 0f 84 97 00 00 00 je 80105090 <sys_unlink+0x180> iunlockput(dp); 80104ff9: 83 ec 0c sub $0xc,%esp 80104ffc: 56 push %esi 80104ffd: e8 1e c9 ff ff call 80101920 <iunlockput> ip->nlink--; 80105002: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80105007: 89 1c 24 mov %ebx,(%esp) 8010500a: e8 d1 c5 ff ff call 801015e0 <iupdate> iunlockput(ip); 8010500f: 89 1c 24 mov %ebx,(%esp) 80105012: e8 09 c9 ff ff call 80101920 <iunlockput> end_op(); 80105017: e8 14 dd ff ff call 80102d30 <end_op> return 0; 8010501c: 83 c4 10 add $0x10,%esp 8010501f: 31 c0 xor %eax,%eax } 80105021: 8d 65 f4 lea -0xc(%ebp),%esp 80105024: 5b pop %ebx 80105025: 5e pop %esi 80105026: 5f pop %edi 80105027: 5d pop %ebp 80105028: c3 ret 80105029: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80105030: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80105034: 76 8d jbe 80104fc3 <sys_unlink+0xb3> 80105036: bf 20 00 00 00 mov $0x20,%edi 8010503b: eb 0f jmp 8010504c <sys_unlink+0x13c> 8010503d: 8d 76 00 lea 0x0(%esi),%esi 80105040: 83 c7 10 add $0x10,%edi 80105043: 3b 7b 58 cmp 0x58(%ebx),%edi 80105046: 0f 83 77 ff ff ff jae 80104fc3 <sys_unlink+0xb3> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 8010504c: 8d 45 d8 lea -0x28(%ebp),%eax 8010504f: 6a 10 push $0x10 80105051: 57 push %edi 80105052: 50 push %eax 80105053: 53 push %ebx 80105054: e8 17 c9 ff ff call 80101970 <readi> 80105059: 83 c4 10 add $0x10,%esp 8010505c: 83 f8 10 cmp $0x10,%eax 8010505f: 75 5e jne 801050bf <sys_unlink+0x1af> if(de.inum != 0) 80105061: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80105066: 74 d8 je 80105040 <sys_unlink+0x130> iunlockput(ip); 80105068: 83 ec 0c sub $0xc,%esp 8010506b: 53 push %ebx 8010506c: e8 af c8 ff ff call 80101920 <iunlockput> goto bad; 80105071: 83 c4 10 add $0x10,%esp iunlockput(dp); 80105074: 83 ec 0c sub $0xc,%esp 80105077: 56 push %esi 80105078: e8 a3 c8 ff ff call 80101920 <iunlockput> end_op(); 8010507d: e8 ae dc ff ff call 80102d30 <end_op> return -1; 80105082: 83 c4 10 add $0x10,%esp 80105085: b8 ff ff ff ff mov $0xffffffff,%eax 8010508a: eb 95 jmp 80105021 <sys_unlink+0x111> 8010508c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink--; 80105090: 66 83 6e 56 01 subw $0x1,0x56(%esi) iupdate(dp); 80105095: 83 ec 0c sub $0xc,%esp 80105098: 56 push %esi 80105099: e8 42 c5 ff ff call 801015e0 <iupdate> 8010509e: 83 c4 10 add $0x10,%esp 801050a1: e9 53 ff ff ff jmp 80104ff9 <sys_unlink+0xe9> return -1; 801050a6: b8 ff ff ff ff mov $0xffffffff,%eax 801050ab: e9 71 ff ff ff jmp 80105021 <sys_unlink+0x111> end_op(); 801050b0: e8 7b dc ff ff call 80102d30 <end_op> return -1; 801050b5: b8 ff ff ff ff mov $0xffffffff,%eax 801050ba: e9 62 ff ff ff jmp 80105021 <sys_unlink+0x111> panic("isdirempty: readi"); 801050bf: 83 ec 0c sub $0xc,%esp 801050c2: 68 60 78 10 80 push $0x80107860 801050c7: e8 c4 b2 ff ff call 80100390 <panic> panic("unlink: nlink < 1"); 801050cc: 83 ec 0c sub $0xc,%esp 801050cf: 68 4e 78 10 80 push $0x8010784e 801050d4: e8 b7 b2 ff ff call 80100390 <panic> panic("unlink: writei"); 801050d9: 83 ec 0c sub $0xc,%esp 801050dc: 68 72 78 10 80 push $0x80107872 801050e1: e8 aa b2 ff ff call 80100390 <panic> 801050e6: 8d 76 00 lea 0x0(%esi),%esi 801050e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801050f0 <sys_open>: int sys_open(void) { 801050f0: 55 push %ebp 801050f1: 89 e5 mov %esp,%ebp 801050f3: 57 push %edi 801050f4: 56 push %esi 801050f5: 53 push %ebx char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 801050f6: 8d 45 e0 lea -0x20(%ebp),%eax { 801050f9: 83 ec 24 sub $0x24,%esp if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 801050fc: 50 push %eax 801050fd: 6a 00 push $0x0 801050ff: e8 3c f8 ff ff call 80104940 <argstr> 80105104: 83 c4 10 add $0x10,%esp 80105107: 85 c0 test %eax,%eax 80105109: 0f 88 1d 01 00 00 js 8010522c <sys_open+0x13c> 8010510f: 8d 45 e4 lea -0x1c(%ebp),%eax 80105112: 83 ec 08 sub $0x8,%esp 80105115: 50 push %eax 80105116: 6a 01 push $0x1 80105118: e8 73 f7 ff ff call 80104890 <argint> 8010511d: 83 c4 10 add $0x10,%esp 80105120: 85 c0 test %eax,%eax 80105122: 0f 88 04 01 00 00 js 8010522c <sys_open+0x13c> return -1; begin_op(); 80105128: e8 93 db ff ff call 80102cc0 <begin_op> if(omode & O_CREATE){ 8010512d: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80105131: 0f 85 a9 00 00 00 jne 801051e0 <sys_open+0xf0> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 80105137: 83 ec 0c sub $0xc,%esp 8010513a: ff 75 e0 pushl -0x20(%ebp) 8010513d: e8 ae cd ff ff call 80101ef0 <namei> 80105142: 83 c4 10 add $0x10,%esp 80105145: 85 c0 test %eax,%eax 80105147: 89 c6 mov %eax,%esi 80105149: 0f 84 b2 00 00 00 je 80105201 <sys_open+0x111> end_op(); return -1; } ilock(ip); 8010514f: 83 ec 0c sub $0xc,%esp 80105152: 50 push %eax 80105153: e8 38 c5 ff ff call 80101690 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 80105158: 83 c4 10 add $0x10,%esp 8010515b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80105160: 0f 84 aa 00 00 00 je 80105210 <sys_open+0x120> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 80105166: e8 15 bc ff ff call 80100d80 <filealloc> 8010516b: 85 c0 test %eax,%eax 8010516d: 89 c7 mov %eax,%edi 8010516f: 0f 84 a6 00 00 00 je 8010521b <sys_open+0x12b> struct proc *curproc = myproc(); 80105175: e8 86 e7 ff ff call 80103900 <myproc> for(fd = 0; fd < NOFILE; fd++){ 8010517a: 31 db xor %ebx,%ebx 8010517c: eb 0e jmp 8010518c <sys_open+0x9c> 8010517e: 66 90 xchg %ax,%ax 80105180: 83 c3 01 add $0x1,%ebx 80105183: 83 fb 10 cmp $0x10,%ebx 80105186: 0f 84 ac 00 00 00 je 80105238 <sys_open+0x148> if(curproc->ofile[fd] == 0){ 8010518c: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105190: 85 d2 test %edx,%edx 80105192: 75 ec jne 80105180 <sys_open+0x90> fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105194: 83 ec 0c sub $0xc,%esp curproc->ofile[fd] = f; 80105197: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) iunlock(ip); 8010519b: 56 push %esi 8010519c: e8 cf c5 ff ff call 80101770 <iunlock> end_op(); 801051a1: e8 8a db ff ff call 80102d30 <end_op> f->type = FD_INODE; 801051a6: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 801051ac: 8b 55 e4 mov -0x1c(%ebp),%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051af: 83 c4 10 add $0x10,%esp f->ip = ip; 801051b2: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 801051b5: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 801051bc: 89 d0 mov %edx,%eax 801051be: f7 d0 not %eax 801051c0: 83 e0 01 and $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051c3: 83 e2 03 and $0x3,%edx f->readable = !(omode & O_WRONLY); 801051c6: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051c9: 0f 95 47 09 setne 0x9(%edi) return fd; } 801051cd: 8d 65 f4 lea -0xc(%ebp),%esp 801051d0: 89 d8 mov %ebx,%eax 801051d2: 5b pop %ebx 801051d3: 5e pop %esi 801051d4: 5f pop %edi 801051d5: 5d pop %ebp 801051d6: c3 ret 801051d7: 89 f6 mov %esi,%esi 801051d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip = create(path, T_FILE, 0, 0); 801051e0: 83 ec 0c sub $0xc,%esp 801051e3: 8b 45 e0 mov -0x20(%ebp),%eax 801051e6: 31 c9 xor %ecx,%ecx 801051e8: 6a 00 push $0x0 801051ea: ba 02 00 00 00 mov $0x2,%edx 801051ef: e8 ec f7 ff ff call 801049e0 <create> if(ip == 0){ 801051f4: 83 c4 10 add $0x10,%esp 801051f7: 85 c0 test %eax,%eax ip = create(path, T_FILE, 0, 0); 801051f9: 89 c6 mov %eax,%esi if(ip == 0){ 801051fb: 0f 85 65 ff ff ff jne 80105166 <sys_open+0x76> end_op(); 80105201: e8 2a db ff ff call 80102d30 <end_op> return -1; 80105206: bb ff ff ff ff mov $0xffffffff,%ebx 8010520b: eb c0 jmp 801051cd <sys_open+0xdd> 8010520d: 8d 76 00 lea 0x0(%esi),%esi if(ip->type == T_DIR && omode != O_RDONLY){ 80105210: 8b 4d e4 mov -0x1c(%ebp),%ecx 80105213: 85 c9 test %ecx,%ecx 80105215: 0f 84 4b ff ff ff je 80105166 <sys_open+0x76> iunlockput(ip); 8010521b: 83 ec 0c sub $0xc,%esp 8010521e: 56 push %esi 8010521f: e8 fc c6 ff ff call 80101920 <iunlockput> end_op(); 80105224: e8 07 db ff ff call 80102d30 <end_op> return -1; 80105229: 83 c4 10 add $0x10,%esp 8010522c: bb ff ff ff ff mov $0xffffffff,%ebx 80105231: eb 9a jmp 801051cd <sys_open+0xdd> 80105233: 90 nop 80105234: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fileclose(f); 80105238: 83 ec 0c sub $0xc,%esp 8010523b: 57 push %edi 8010523c: e8 ff bb ff ff call 80100e40 <fileclose> 80105241: 83 c4 10 add $0x10,%esp 80105244: eb d5 jmp 8010521b <sys_open+0x12b> 80105246: 8d 76 00 lea 0x0(%esi),%esi 80105249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105250 <sys_mkdir>: int sys_mkdir(void) { 80105250: 55 push %ebp 80105251: 89 e5 mov %esp,%ebp 80105253: 83 ec 18 sub $0x18,%esp char *path; struct inode *ip; begin_op(); 80105256: e8 65 da ff ff call 80102cc0 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 8010525b: 8d 45 f4 lea -0xc(%ebp),%eax 8010525e: 83 ec 08 sub $0x8,%esp 80105261: 50 push %eax 80105262: 6a 00 push $0x0 80105264: e8 d7 f6 ff ff call 80104940 <argstr> 80105269: 83 c4 10 add $0x10,%esp 8010526c: 85 c0 test %eax,%eax 8010526e: 78 30 js 801052a0 <sys_mkdir+0x50> 80105270: 83 ec 0c sub $0xc,%esp 80105273: 8b 45 f4 mov -0xc(%ebp),%eax 80105276: 31 c9 xor %ecx,%ecx 80105278: 6a 00 push $0x0 8010527a: ba 01 00 00 00 mov $0x1,%edx 8010527f: e8 5c f7 ff ff call 801049e0 <create> 80105284: 83 c4 10 add $0x10,%esp 80105287: 85 c0 test %eax,%eax 80105289: 74 15 je 801052a0 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 8010528b: 83 ec 0c sub $0xc,%esp 8010528e: 50 push %eax 8010528f: e8 8c c6 ff ff call 80101920 <iunlockput> end_op(); 80105294: e8 97 da ff ff call 80102d30 <end_op> return 0; 80105299: 83 c4 10 add $0x10,%esp 8010529c: 31 c0 xor %eax,%eax } 8010529e: c9 leave 8010529f: c3 ret end_op(); 801052a0: e8 8b da ff ff call 80102d30 <end_op> return -1; 801052a5: b8 ff ff ff ff mov $0xffffffff,%eax } 801052aa: c9 leave 801052ab: c3 ret 801052ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801052b0 <sys_mknod>: int sys_mknod(void) { 801052b0: 55 push %ebp 801052b1: 89 e5 mov %esp,%ebp 801052b3: 83 ec 18 sub $0x18,%esp struct inode *ip; char *path; int major, minor; begin_op(); 801052b6: e8 05 da ff ff call 80102cc0 <begin_op> if((argstr(0, &path)) < 0 || 801052bb: 8d 45 ec lea -0x14(%ebp),%eax 801052be: 83 ec 08 sub $0x8,%esp 801052c1: 50 push %eax 801052c2: 6a 00 push $0x0 801052c4: e8 77 f6 ff ff call 80104940 <argstr> 801052c9: 83 c4 10 add $0x10,%esp 801052cc: 85 c0 test %eax,%eax 801052ce: 78 60 js 80105330 <sys_mknod+0x80> argint(1, &major) < 0 || 801052d0: 8d 45 f0 lea -0x10(%ebp),%eax 801052d3: 83 ec 08 sub $0x8,%esp 801052d6: 50 push %eax 801052d7: 6a 01 push $0x1 801052d9: e8 b2 f5 ff ff call 80104890 <argint> if((argstr(0, &path)) < 0 || 801052de: 83 c4 10 add $0x10,%esp 801052e1: 85 c0 test %eax,%eax 801052e3: 78 4b js 80105330 <sys_mknod+0x80> argint(2, &minor) < 0 || 801052e5: 8d 45 f4 lea -0xc(%ebp),%eax 801052e8: 83 ec 08 sub $0x8,%esp 801052eb: 50 push %eax 801052ec: 6a 02 push $0x2 801052ee: e8 9d f5 ff ff call 80104890 <argint> argint(1, &major) < 0 || 801052f3: 83 c4 10 add $0x10,%esp 801052f6: 85 c0 test %eax,%eax 801052f8: 78 36 js 80105330 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ 801052fa: 0f bf 45 f4 movswl -0xc(%ebp),%eax argint(2, &minor) < 0 || 801052fe: 83 ec 0c sub $0xc,%esp (ip = create(path, T_DEV, major, minor)) == 0){ 80105301: 0f bf 4d f0 movswl -0x10(%ebp),%ecx argint(2, &minor) < 0 || 80105305: ba 03 00 00 00 mov $0x3,%edx 8010530a: 50 push %eax 8010530b: 8b 45 ec mov -0x14(%ebp),%eax 8010530e: e8 cd f6 ff ff call 801049e0 <create> 80105313: 83 c4 10 add $0x10,%esp 80105316: 85 c0 test %eax,%eax 80105318: 74 16 je 80105330 <sys_mknod+0x80> end_op(); return -1; } iunlockput(ip); 8010531a: 83 ec 0c sub $0xc,%esp 8010531d: 50 push %eax 8010531e: e8 fd c5 ff ff call 80101920 <iunlockput> end_op(); 80105323: e8 08 da ff ff call 80102d30 <end_op> return 0; 80105328: 83 c4 10 add $0x10,%esp 8010532b: 31 c0 xor %eax,%eax } 8010532d: c9 leave 8010532e: c3 ret 8010532f: 90 nop end_op(); 80105330: e8 fb d9 ff ff call 80102d30 <end_op> return -1; 80105335: b8 ff ff ff ff mov $0xffffffff,%eax } 8010533a: c9 leave 8010533b: c3 ret 8010533c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105340 <sys_chdir>: int sys_chdir(void) { 80105340: 55 push %ebp 80105341: 89 e5 mov %esp,%ebp 80105343: 56 push %esi 80105344: 53 push %ebx 80105345: 83 ec 10 sub $0x10,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 80105348: e8 b3 e5 ff ff call 80103900 <myproc> 8010534d: 89 c6 mov %eax,%esi begin_op(); 8010534f: e8 6c d9 ff ff call 80102cc0 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 80105354: 8d 45 f4 lea -0xc(%ebp),%eax 80105357: 83 ec 08 sub $0x8,%esp 8010535a: 50 push %eax 8010535b: 6a 00 push $0x0 8010535d: e8 de f5 ff ff call 80104940 <argstr> 80105362: 83 c4 10 add $0x10,%esp 80105365: 85 c0 test %eax,%eax 80105367: 78 77 js 801053e0 <sys_chdir+0xa0> 80105369: 83 ec 0c sub $0xc,%esp 8010536c: ff 75 f4 pushl -0xc(%ebp) 8010536f: e8 7c cb ff ff call 80101ef0 <namei> 80105374: 83 c4 10 add $0x10,%esp 80105377: 85 c0 test %eax,%eax 80105379: 89 c3 mov %eax,%ebx 8010537b: 74 63 je 801053e0 <sys_chdir+0xa0> end_op(); return -1; } ilock(ip); 8010537d: 83 ec 0c sub $0xc,%esp 80105380: 50 push %eax 80105381: e8 0a c3 ff ff call 80101690 <ilock> if(ip->type != T_DIR){ 80105386: 83 c4 10 add $0x10,%esp 80105389: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 8010538e: 75 30 jne 801053c0 <sys_chdir+0x80> iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105390: 83 ec 0c sub $0xc,%esp 80105393: 53 push %ebx 80105394: e8 d7 c3 ff ff call 80101770 <iunlock> iput(curproc->cwd); 80105399: 58 pop %eax 8010539a: ff 76 68 pushl 0x68(%esi) 8010539d: e8 1e c4 ff ff call 801017c0 <iput> end_op(); 801053a2: e8 89 d9 ff ff call 80102d30 <end_op> curproc->cwd = ip; 801053a7: 89 5e 68 mov %ebx,0x68(%esi) return 0; 801053aa: 83 c4 10 add $0x10,%esp 801053ad: 31 c0 xor %eax,%eax } 801053af: 8d 65 f8 lea -0x8(%ebp),%esp 801053b2: 5b pop %ebx 801053b3: 5e pop %esi 801053b4: 5d pop %ebp 801053b5: c3 ret 801053b6: 8d 76 00 lea 0x0(%esi),%esi 801053b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi iunlockput(ip); 801053c0: 83 ec 0c sub $0xc,%esp 801053c3: 53 push %ebx 801053c4: e8 57 c5 ff ff call 80101920 <iunlockput> end_op(); 801053c9: e8 62 d9 ff ff call 80102d30 <end_op> return -1; 801053ce: 83 c4 10 add $0x10,%esp 801053d1: b8 ff ff ff ff mov $0xffffffff,%eax 801053d6: eb d7 jmp 801053af <sys_chdir+0x6f> 801053d8: 90 nop 801053d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi end_op(); 801053e0: e8 4b d9 ff ff call 80102d30 <end_op> return -1; 801053e5: b8 ff ff ff ff mov $0xffffffff,%eax 801053ea: eb c3 jmp 801053af <sys_chdir+0x6f> 801053ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801053f0 <sys_exec>: int sys_exec(void) { 801053f0: 55 push %ebp 801053f1: 89 e5 mov %esp,%ebp 801053f3: 57 push %edi 801053f4: 56 push %esi 801053f5: 53 push %ebx char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 801053f6: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax { 801053fc: 81 ec a4 00 00 00 sub $0xa4,%esp if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105402: 50 push %eax 80105403: 6a 00 push $0x0 80105405: e8 36 f5 ff ff call 80104940 <argstr> 8010540a: 83 c4 10 add $0x10,%esp 8010540d: 85 c0 test %eax,%eax 8010540f: 0f 88 87 00 00 00 js 8010549c <sys_exec+0xac> 80105415: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 8010541b: 83 ec 08 sub $0x8,%esp 8010541e: 50 push %eax 8010541f: 6a 01 push $0x1 80105421: e8 6a f4 ff ff call 80104890 <argint> 80105426: 83 c4 10 add $0x10,%esp 80105429: 85 c0 test %eax,%eax 8010542b: 78 6f js 8010549c <sys_exec+0xac> return -1; } memset(argv, 0, sizeof(argv)); 8010542d: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105433: 83 ec 04 sub $0x4,%esp for(i=0;; i++){ 80105436: 31 db xor %ebx,%ebx memset(argv, 0, sizeof(argv)); 80105438: 68 80 00 00 00 push $0x80 8010543d: 6a 00 push $0x0 8010543f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 80105445: 50 push %eax 80105446: e8 45 f1 ff ff call 80104590 <memset> 8010544b: 83 c4 10 add $0x10,%esp 8010544e: eb 2c jmp 8010547c <sys_exec+0x8c> if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ 80105450: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 80105456: 85 c0 test %eax,%eax 80105458: 74 56 je 801054b0 <sys_exec+0xc0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 8010545a: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx 80105460: 83 ec 08 sub $0x8,%esp 80105463: 8d 14 31 lea (%ecx,%esi,1),%edx 80105466: 52 push %edx 80105467: 50 push %eax 80105468: e8 b3 f3 ff ff call 80104820 <fetchstr> 8010546d: 83 c4 10 add $0x10,%esp 80105470: 85 c0 test %eax,%eax 80105472: 78 28 js 8010549c <sys_exec+0xac> for(i=0;; i++){ 80105474: 83 c3 01 add $0x1,%ebx if(i >= NELEM(argv)) 80105477: 83 fb 20 cmp $0x20,%ebx 8010547a: 74 20 je 8010549c <sys_exec+0xac> if(fetchint(uargv+4*i, (int*)&uarg) < 0) 8010547c: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 80105482: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi 80105489: 83 ec 08 sub $0x8,%esp 8010548c: 57 push %edi 8010548d: 01 f0 add %esi,%eax 8010548f: 50 push %eax 80105490: e8 4b f3 ff ff call 801047e0 <fetchint> 80105495: 83 c4 10 add $0x10,%esp 80105498: 85 c0 test %eax,%eax 8010549a: 79 b4 jns 80105450 <sys_exec+0x60> return -1; } return exec(path, argv); } 8010549c: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010549f: b8 ff ff ff ff mov $0xffffffff,%eax } 801054a4: 5b pop %ebx 801054a5: 5e pop %esi 801054a6: 5f pop %edi 801054a7: 5d pop %ebp 801054a8: c3 ret 801054a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return exec(path, argv); 801054b0: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 801054b6: 83 ec 08 sub $0x8,%esp argv[i] = 0; 801054b9: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 801054c0: 00 00 00 00 return exec(path, argv); 801054c4: 50 push %eax 801054c5: ff b5 5c ff ff ff pushl -0xa4(%ebp) 801054cb: e8 40 b5 ff ff call 80100a10 <exec> 801054d0: 83 c4 10 add $0x10,%esp } 801054d3: 8d 65 f4 lea -0xc(%ebp),%esp 801054d6: 5b pop %ebx 801054d7: 5e pop %esi 801054d8: 5f pop %edi 801054d9: 5d pop %ebp 801054da: c3 ret 801054db: 90 nop 801054dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801054e0 <sys_pipe>: int sys_pipe(void) { 801054e0: 55 push %ebp 801054e1: 89 e5 mov %esp,%ebp 801054e3: 57 push %edi 801054e4: 56 push %esi 801054e5: 53 push %ebx int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 801054e6: 8d 45 dc lea -0x24(%ebp),%eax { 801054e9: 83 ec 20 sub $0x20,%esp if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 801054ec: 6a 08 push $0x8 801054ee: 50 push %eax 801054ef: 6a 00 push $0x0 801054f1: e8 ea f3 ff ff call 801048e0 <argptr> 801054f6: 83 c4 10 add $0x10,%esp 801054f9: 85 c0 test %eax,%eax 801054fb: 0f 88 ae 00 00 00 js 801055af <sys_pipe+0xcf> return -1; if(pipealloc(&rf, &wf) < 0) 80105501: 8d 45 e4 lea -0x1c(%ebp),%eax 80105504: 83 ec 08 sub $0x8,%esp 80105507: 50 push %eax 80105508: 8d 45 e0 lea -0x20(%ebp),%eax 8010550b: 50 push %eax 8010550c: e8 4f de ff ff call 80103360 <pipealloc> 80105511: 83 c4 10 add $0x10,%esp 80105514: 85 c0 test %eax,%eax 80105516: 0f 88 93 00 00 00 js 801055af <sys_pipe+0xcf> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 8010551c: 8b 7d e0 mov -0x20(%ebp),%edi for(fd = 0; fd < NOFILE; fd++){ 8010551f: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80105521: e8 da e3 ff ff call 80103900 <myproc> 80105526: eb 10 jmp 80105538 <sys_pipe+0x58> 80105528: 90 nop 80105529: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(fd = 0; fd < NOFILE; fd++){ 80105530: 83 c3 01 add $0x1,%ebx 80105533: 83 fb 10 cmp $0x10,%ebx 80105536: 74 60 je 80105598 <sys_pipe+0xb8> if(curproc->ofile[fd] == 0){ 80105538: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 8010553c: 85 f6 test %esi,%esi 8010553e: 75 f0 jne 80105530 <sys_pipe+0x50> curproc->ofile[fd] = f; 80105540: 8d 73 08 lea 0x8(%ebx),%esi 80105543: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80105547: 8b 7d e4 mov -0x1c(%ebp),%edi struct proc *curproc = myproc(); 8010554a: e8 b1 e3 ff ff call 80103900 <myproc> for(fd = 0; fd < NOFILE; fd++){ 8010554f: 31 d2 xor %edx,%edx 80105551: eb 0d jmp 80105560 <sys_pipe+0x80> 80105553: 90 nop 80105554: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105558: 83 c2 01 add $0x1,%edx 8010555b: 83 fa 10 cmp $0x10,%edx 8010555e: 74 28 je 80105588 <sys_pipe+0xa8> if(curproc->ofile[fd] == 0){ 80105560: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 80105564: 85 c9 test %ecx,%ecx 80105566: 75 f0 jne 80105558 <sys_pipe+0x78> curproc->ofile[fd] = f; 80105568: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 8010556c: 8b 45 dc mov -0x24(%ebp),%eax 8010556f: 89 18 mov %ebx,(%eax) fd[1] = fd1; 80105571: 8b 45 dc mov -0x24(%ebp),%eax 80105574: 89 50 04 mov %edx,0x4(%eax) return 0; 80105577: 31 c0 xor %eax,%eax } 80105579: 8d 65 f4 lea -0xc(%ebp),%esp 8010557c: 5b pop %ebx 8010557d: 5e pop %esi 8010557e: 5f pop %edi 8010557f: 5d pop %ebp 80105580: c3 ret 80105581: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi myproc()->ofile[fd0] = 0; 80105588: e8 73 e3 ff ff call 80103900 <myproc> 8010558d: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 80105594: 00 80105595: 8d 76 00 lea 0x0(%esi),%esi fileclose(rf); 80105598: 83 ec 0c sub $0xc,%esp 8010559b: ff 75 e0 pushl -0x20(%ebp) 8010559e: e8 9d b8 ff ff call 80100e40 <fileclose> fileclose(wf); 801055a3: 58 pop %eax 801055a4: ff 75 e4 pushl -0x1c(%ebp) 801055a7: e8 94 b8 ff ff call 80100e40 <fileclose> return -1; 801055ac: 83 c4 10 add $0x10,%esp 801055af: b8 ff ff ff ff mov $0xffffffff,%eax 801055b4: eb c3 jmp 80105579 <sys_pipe+0x99> 801055b6: 8d 76 00 lea 0x0(%esi),%esi 801055b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801055c0 <sys_swapread>: int sys_swapread(void) { 801055c0: 55 push %ebp 801055c1: 89 e5 mov %esp,%ebp 801055c3: 83 ec 1c sub $0x1c,%esp char* ptr; int blkno; if(argptr(0, &ptr, PGSIZE) < 0 || argint(1, &blkno) < 0 ) 801055c6: 8d 45 f0 lea -0x10(%ebp),%eax 801055c9: 68 00 10 00 00 push $0x1000 801055ce: 50 push %eax 801055cf: 6a 00 push $0x0 801055d1: e8 0a f3 ff ff call 801048e0 <argptr> 801055d6: 83 c4 10 add $0x10,%esp 801055d9: 85 c0 test %eax,%eax 801055db: 78 33 js 80105610 <sys_swapread+0x50> 801055dd: 8d 45 f4 lea -0xc(%ebp),%eax 801055e0: 83 ec 08 sub $0x8,%esp 801055e3: 50 push %eax 801055e4: 6a 01 push $0x1 801055e6: e8 a5 f2 ff ff call 80104890 <argint> 801055eb: 83 c4 10 add $0x10,%esp 801055ee: 85 c0 test %eax,%eax 801055f0: 78 1e js 80105610 <sys_swapread+0x50> return -1; swapread(ptr, blkno); 801055f2: 83 ec 08 sub $0x8,%esp 801055f5: ff 75 f4 pushl -0xc(%ebp) 801055f8: ff 75 f0 pushl -0x10(%ebp) 801055fb: e8 30 c9 ff ff call 80101f30 <swapread> return 0; 80105600: 83 c4 10 add $0x10,%esp 80105603: 31 c0 xor %eax,%eax } 80105605: c9 leave 80105606: c3 ret 80105607: 89 f6 mov %esi,%esi 80105609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80105610: b8 ff ff ff ff mov $0xffffffff,%eax } 80105615: c9 leave 80105616: c3 ret 80105617: 89 f6 mov %esi,%esi 80105619: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105620 <sys_swapwrite>: int sys_swapwrite(void) { 80105620: 55 push %ebp 80105621: 89 e5 mov %esp,%ebp 80105623: 83 ec 1c sub $0x1c,%esp char* ptr; int blkno; if(argptr(0, &ptr, PGSIZE) < 0 || argint(1, &blkno) < 0 ) 80105626: 8d 45 f0 lea -0x10(%ebp),%eax 80105629: 68 00 10 00 00 push $0x1000 8010562e: 50 push %eax 8010562f: 6a 00 push $0x0 80105631: e8 aa f2 ff ff call 801048e0 <argptr> 80105636: 83 c4 10 add $0x10,%esp 80105639: 85 c0 test %eax,%eax 8010563b: 78 33 js 80105670 <sys_swapwrite+0x50> 8010563d: 8d 45 f4 lea -0xc(%ebp),%eax 80105640: 83 ec 08 sub $0x8,%esp 80105643: 50 push %eax 80105644: 6a 01 push $0x1 80105646: e8 45 f2 ff ff call 80104890 <argint> 8010564b: 83 c4 10 add $0x10,%esp 8010564e: 85 c0 test %eax,%eax 80105650: 78 1e js 80105670 <sys_swapwrite+0x50> return -1; swapwrite(ptr, blkno); 80105652: 83 ec 08 sub $0x8,%esp 80105655: ff 75 f4 pushl -0xc(%ebp) 80105658: ff 75 f0 pushl -0x10(%ebp) 8010565b: e8 50 c9 ff ff call 80101fb0 <swapwrite> return 0; 80105660: 83 c4 10 add $0x10,%esp 80105663: 31 c0 xor %eax,%eax } 80105665: c9 leave 80105666: c3 ret 80105667: 89 f6 mov %esi,%esi 80105669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80105670: b8 ff ff ff ff mov $0xffffffff,%eax } 80105675: c9 leave 80105676: c3 ret 80105677: 66 90 xchg %ax,%ax 80105679: 66 90 xchg %ax,%ax 8010567b: 66 90 xchg %ax,%ax 8010567d: 66 90 xchg %ax,%ax 8010567f: 90 nop 80105680 <sys_fork>: #include "mmu.h" #include "proc.h" int sys_fork(void) { 80105680: 55 push %ebp 80105681: 89 e5 mov %esp,%ebp return fork(); } 80105683: 5d pop %ebp return fork(); 80105684: e9 37 e4 ff ff jmp 80103ac0 <fork> 80105689: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105690 <sys_exit>: int sys_exit(void) { 80105690: 55 push %ebp 80105691: 89 e5 mov %esp,%ebp 80105693: 83 ec 08 sub $0x8,%esp exit(); 80105696: e8 a5 e6 ff ff call 80103d40 <exit> return 0; // not reached } 8010569b: 31 c0 xor %eax,%eax 8010569d: c9 leave 8010569e: c3 ret 8010569f: 90 nop 801056a0 <sys_wait>: int sys_wait(void) { 801056a0: 55 push %ebp 801056a1: 89 e5 mov %esp,%ebp return wait(); } 801056a3: 5d pop %ebp return wait(); 801056a4: e9 d7 e8 ff ff jmp 80103f80 <wait> 801056a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801056b0 <sys_kill>: int sys_kill(void) { 801056b0: 55 push %ebp 801056b1: 89 e5 mov %esp,%ebp 801056b3: 83 ec 20 sub $0x20,%esp int pid; if(argint(0, &pid) < 0) 801056b6: 8d 45 f4 lea -0xc(%ebp),%eax 801056b9: 50 push %eax 801056ba: 6a 00 push $0x0 801056bc: e8 cf f1 ff ff call 80104890 <argint> 801056c1: 83 c4 10 add $0x10,%esp 801056c4: 85 c0 test %eax,%eax 801056c6: 78 18 js 801056e0 <sys_kill+0x30> return -1; return kill(pid); 801056c8: 83 ec 0c sub $0xc,%esp 801056cb: ff 75 f4 pushl -0xc(%ebp) 801056ce: e8 fd e9 ff ff call 801040d0 <kill> 801056d3: 83 c4 10 add $0x10,%esp } 801056d6: c9 leave 801056d7: c3 ret 801056d8: 90 nop 801056d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801056e0: b8 ff ff ff ff mov $0xffffffff,%eax } 801056e5: c9 leave 801056e6: c3 ret 801056e7: 89 f6 mov %esi,%esi 801056e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801056f0 <sys_getpid>: int sys_getpid(void) { 801056f0: 55 push %ebp 801056f1: 89 e5 mov %esp,%ebp 801056f3: 83 ec 08 sub $0x8,%esp return myproc()->pid; 801056f6: e8 05 e2 ff ff call 80103900 <myproc> 801056fb: 8b 40 10 mov 0x10(%eax),%eax } 801056fe: c9 leave 801056ff: c3 ret 80105700 <sys_sbrk>: int sys_sbrk(void) { 80105700: 55 push %ebp 80105701: 89 e5 mov %esp,%ebp 80105703: 53 push %ebx int addr; int n; if(argint(0, &n) < 0) 80105704: 8d 45 f4 lea -0xc(%ebp),%eax { 80105707: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 8010570a: 50 push %eax 8010570b: 6a 00 push $0x0 8010570d: e8 7e f1 ff ff call 80104890 <argint> 80105712: 83 c4 10 add $0x10,%esp 80105715: 85 c0 test %eax,%eax 80105717: 78 27 js 80105740 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 80105719: e8 e2 e1 ff ff call 80103900 <myproc> if(growproc(n) < 0) 8010571e: 83 ec 0c sub $0xc,%esp addr = myproc()->sz; 80105721: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 80105723: ff 75 f4 pushl -0xc(%ebp) 80105726: e8 15 e3 ff ff call 80103a40 <growproc> 8010572b: 83 c4 10 add $0x10,%esp 8010572e: 85 c0 test %eax,%eax 80105730: 78 0e js 80105740 <sys_sbrk+0x40> return -1; return addr; } 80105732: 89 d8 mov %ebx,%eax 80105734: 8b 5d fc mov -0x4(%ebp),%ebx 80105737: c9 leave 80105738: c3 ret 80105739: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105740: bb ff ff ff ff mov $0xffffffff,%ebx 80105745: eb eb jmp 80105732 <sys_sbrk+0x32> 80105747: 89 f6 mov %esi,%esi 80105749: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105750 <sys_sleep>: int sys_sleep(void) { 80105750: 55 push %ebp 80105751: 89 e5 mov %esp,%ebp 80105753: 53 push %ebx int n; uint ticks0; if(argint(0, &n) < 0) 80105754: 8d 45 f4 lea -0xc(%ebp),%eax { 80105757: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 8010575a: 50 push %eax 8010575b: 6a 00 push $0x0 8010575d: e8 2e f1 ff ff call 80104890 <argint> 80105762: 83 c4 10 add $0x10,%esp 80105765: 85 c0 test %eax,%eax 80105767: 0f 88 8a 00 00 00 js 801057f7 <sys_sleep+0xa7> return -1; acquire(&tickslock); 8010576d: 83 ec 0c sub $0xc,%esp 80105770: 68 60 4c 11 80 push $0x80114c60 80105775: e8 06 ed ff ff call 80104480 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 8010577a: 8b 55 f4 mov -0xc(%ebp),%edx 8010577d: 83 c4 10 add $0x10,%esp ticks0 = ticks; 80105780: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx while(ticks - ticks0 < n){ 80105786: 85 d2 test %edx,%edx 80105788: 75 27 jne 801057b1 <sys_sleep+0x61> 8010578a: eb 54 jmp 801057e0 <sys_sleep+0x90> 8010578c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 80105790: 83 ec 08 sub $0x8,%esp 80105793: 68 60 4c 11 80 push $0x80114c60 80105798: 68 a0 54 11 80 push $0x801154a0 8010579d: e8 1e e7 ff ff call 80103ec0 <sleep> while(ticks - ticks0 < n){ 801057a2: a1 a0 54 11 80 mov 0x801154a0,%eax 801057a7: 83 c4 10 add $0x10,%esp 801057aa: 29 d8 sub %ebx,%eax 801057ac: 3b 45 f4 cmp -0xc(%ebp),%eax 801057af: 73 2f jae 801057e0 <sys_sleep+0x90> if(myproc()->killed){ 801057b1: e8 4a e1 ff ff call 80103900 <myproc> 801057b6: 8b 40 24 mov 0x24(%eax),%eax 801057b9: 85 c0 test %eax,%eax 801057bb: 74 d3 je 80105790 <sys_sleep+0x40> release(&tickslock); 801057bd: 83 ec 0c sub $0xc,%esp 801057c0: 68 60 4c 11 80 push $0x80114c60 801057c5: e8 76 ed ff ff call 80104540 <release> return -1; 801057ca: 83 c4 10 add $0x10,%esp 801057cd: b8 ff ff ff ff mov $0xffffffff,%eax } release(&tickslock); return 0; } 801057d2: 8b 5d fc mov -0x4(%ebp),%ebx 801057d5: c9 leave 801057d6: c3 ret 801057d7: 89 f6 mov %esi,%esi 801057d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); 801057e0: 83 ec 0c sub $0xc,%esp 801057e3: 68 60 4c 11 80 push $0x80114c60 801057e8: e8 53 ed ff ff call 80104540 <release> return 0; 801057ed: 83 c4 10 add $0x10,%esp 801057f0: 31 c0 xor %eax,%eax } 801057f2: 8b 5d fc mov -0x4(%ebp),%ebx 801057f5: c9 leave 801057f6: c3 ret return -1; 801057f7: b8 ff ff ff ff mov $0xffffffff,%eax 801057fc: eb f4 jmp 801057f2 <sys_sleep+0xa2> 801057fe: 66 90 xchg %ax,%ax 80105800 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 80105800: 55 push %ebp 80105801: 89 e5 mov %esp,%ebp 80105803: 53 push %ebx 80105804: 83 ec 10 sub $0x10,%esp uint xticks; acquire(&tickslock); 80105807: 68 60 4c 11 80 push $0x80114c60 8010580c: e8 6f ec ff ff call 80104480 <acquire> xticks = ticks; 80105811: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx release(&tickslock); 80105817: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 8010581e: e8 1d ed ff ff call 80104540 <release> return xticks; } 80105823: 89 d8 mov %ebx,%eax 80105825: 8b 5d fc mov -0x4(%ebp),%ebx 80105828: c9 leave 80105829: c3 ret 8010582a <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 8010582a: 1e push %ds pushl %es 8010582b: 06 push %es pushl %fs 8010582c: 0f a0 push %fs pushl %gs 8010582e: 0f a8 push %gs pushal 80105830: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 80105831: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 80105835: 8e d8 mov %eax,%ds movw %ax, %es 80105837: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 80105839: 54 push %esp call trap 8010583a: e8 c1 00 00 00 call 80105900 <trap> addl $4, %esp 8010583f: 83 c4 04 add $0x4,%esp 80105842 <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 80105842: 61 popa popl %gs 80105843: 0f a9 pop %gs popl %fs 80105845: 0f a1 pop %fs popl %es 80105847: 07 pop %es popl %ds 80105848: 1f pop %ds addl $0x8, %esp # trapno and errcode 80105849: 83 c4 08 add $0x8,%esp iret 8010584c: cf iret 8010584d: 66 90 xchg %ax,%ax 8010584f: 90 nop 80105850 <tvinit>: struct spinlock tickslock; uint ticks; void tvinit(void) { 80105850: 55 push %ebp int i; for(i = 0; i < 256; i++) 80105851: 31 c0 xor %eax,%eax { 80105853: 89 e5 mov %esp,%ebp 80105855: 83 ec 08 sub $0x8,%esp 80105858: 90 nop 80105859: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 80105860: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx 80105867: c7 04 c5 a2 4c 11 80 movl $0x8e000008,-0x7feeb35e(,%eax,8) 8010586e: 08 00 00 8e 80105872: 66 89 14 c5 a0 4c 11 mov %dx,-0x7feeb360(,%eax,8) 80105879: 80 8010587a: c1 ea 10 shr $0x10,%edx 8010587d: 66 89 14 c5 a6 4c 11 mov %dx,-0x7feeb35a(,%eax,8) 80105884: 80 for(i = 0; i < 256; i++) 80105885: 83 c0 01 add $0x1,%eax 80105888: 3d 00 01 00 00 cmp $0x100,%eax 8010588d: 75 d1 jne 80105860 <tvinit+0x10> SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 8010588f: a1 08 a1 10 80 mov 0x8010a108,%eax initlock(&tickslock, "time"); 80105894: 83 ec 08 sub $0x8,%esp SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105897: c7 05 a2 4e 11 80 08 movl $0xef000008,0x80114ea2 8010589e: 00 00 ef initlock(&tickslock, "time"); 801058a1: 68 81 78 10 80 push $0x80107881 801058a6: 68 60 4c 11 80 push $0x80114c60 SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801058ab: 66 a3 a0 4e 11 80 mov %ax,0x80114ea0 801058b1: c1 e8 10 shr $0x10,%eax 801058b4: 66 a3 a6 4e 11 80 mov %ax,0x80114ea6 initlock(&tickslock, "time"); 801058ba: e8 81 ea ff ff call 80104340 <initlock> } 801058bf: 83 c4 10 add $0x10,%esp 801058c2: c9 leave 801058c3: c3 ret 801058c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801058ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801058d0 <idtinit>: void idtinit(void) { 801058d0: 55 push %ebp pd[0] = size-1; 801058d1: b8 ff 07 00 00 mov $0x7ff,%eax 801058d6: 89 e5 mov %esp,%ebp 801058d8: 83 ec 10 sub $0x10,%esp 801058db: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 801058df: b8 a0 4c 11 80 mov $0x80114ca0,%eax 801058e4: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 801058e8: c1 e8 10 shr $0x10,%eax 801058eb: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 801058ef: 8d 45 fa lea -0x6(%ebp),%eax 801058f2: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 801058f5: c9 leave 801058f6: c3 ret 801058f7: 89 f6 mov %esi,%esi 801058f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105900 <trap>: //PAGEBREAK: 41 void trap(struct trapframe *tf) { 80105900: 55 push %ebp 80105901: 89 e5 mov %esp,%ebp 80105903: 57 push %edi 80105904: 56 push %esi 80105905: 53 push %ebx 80105906: 83 ec 1c sub $0x1c,%esp 80105909: 8b 7d 08 mov 0x8(%ebp),%edi if(tf->trapno == T_SYSCALL){ 8010590c: 8b 47 30 mov 0x30(%edi),%eax 8010590f: 83 f8 40 cmp $0x40,%eax 80105912: 0f 84 f0 00 00 00 je 80105a08 <trap+0x108> if(myproc()->killed) exit(); return; } switch(tf->trapno){ 80105918: 83 e8 20 sub $0x20,%eax 8010591b: 83 f8 1f cmp $0x1f,%eax 8010591e: 77 10 ja 80105930 <trap+0x30> 80105920: ff 24 85 28 79 10 80 jmp *-0x7fef86d8(,%eax,4) 80105927: 89 f6 mov %esi,%esi 80105929: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapiceoi(); break; //PAGEBREAK: 13 default: if(myproc() == 0 || (tf->cs&3) == 0){ 80105930: e8 cb df ff ff call 80103900 <myproc> 80105935: 85 c0 test %eax,%eax 80105937: 8b 5f 38 mov 0x38(%edi),%ebx 8010593a: 0f 84 14 02 00 00 je 80105b54 <trap+0x254> 80105940: f6 47 3c 03 testb $0x3,0x3c(%edi) 80105944: 0f 84 0a 02 00 00 je 80105b54 <trap+0x254> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 8010594a: 0f 20 d1 mov %cr2,%ecx 8010594d: 89 4d d8 mov %ecx,-0x28(%ebp) cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", tf->trapno, cpuid(), tf->eip, rcr2()); panic("trap"); } // In user space, assume process misbehaved. cprintf("pid %d %s: trap %d err %d on cpu %d " 80105950: e8 8b df ff ff call 801038e0 <cpuid> 80105955: 89 45 dc mov %eax,-0x24(%ebp) 80105958: 8b 47 34 mov 0x34(%edi),%eax 8010595b: 8b 77 30 mov 0x30(%edi),%esi 8010595e: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105961: e8 9a df ff ff call 80103900 <myproc> 80105966: 89 45 e0 mov %eax,-0x20(%ebp) 80105969: e8 92 df ff ff call 80103900 <myproc> cprintf("pid %d %s: trap %d err %d on cpu %d " 8010596e: 8b 4d d8 mov -0x28(%ebp),%ecx 80105971: 8b 55 dc mov -0x24(%ebp),%edx 80105974: 51 push %ecx 80105975: 53 push %ebx 80105976: 52 push %edx myproc()->pid, myproc()->name, tf->trapno, 80105977: 8b 55 e0 mov -0x20(%ebp),%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 8010597a: ff 75 e4 pushl -0x1c(%ebp) 8010597d: 56 push %esi myproc()->pid, myproc()->name, tf->trapno, 8010597e: 83 c2 6c add $0x6c,%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 80105981: 52 push %edx 80105982: ff 70 10 pushl 0x10(%eax) 80105985: 68 e4 78 10 80 push $0x801078e4 8010598a: e8 d1 ac ff ff call 80100660 <cprintf> tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 8010598f: 83 c4 20 add $0x20,%esp 80105992: e8 69 df ff ff call 80103900 <myproc> 80105997: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) } // Force process exit if it has been killed and is in user space. // (If it is still executing in the kernel, let it keep running // until it gets to the regular system call return.) if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 8010599e: e8 5d df ff ff call 80103900 <myproc> 801059a3: 85 c0 test %eax,%eax 801059a5: 74 1d je 801059c4 <trap+0xc4> 801059a7: e8 54 df ff ff call 80103900 <myproc> 801059ac: 8b 50 24 mov 0x24(%eax),%edx 801059af: 85 d2 test %edx,%edx 801059b1: 74 11 je 801059c4 <trap+0xc4> 801059b3: 0f b7 47 3c movzwl 0x3c(%edi),%eax 801059b7: 83 e0 03 and $0x3,%eax 801059ba: 66 83 f8 03 cmp $0x3,%ax 801059be: 0f 84 4c 01 00 00 je 80105b10 <trap+0x210> exit(); // Force process to give up CPU on clock tick. // If interrupts were on while locks held, would need to check nlock. if(myproc() && myproc()->state == RUNNING && 801059c4: e8 37 df ff ff call 80103900 <myproc> 801059c9: 85 c0 test %eax,%eax 801059cb: 74 0b je 801059d8 <trap+0xd8> 801059cd: e8 2e df ff ff call 80103900 <myproc> 801059d2: 83 78 0c 04 cmpl $0x4,0xc(%eax) 801059d6: 74 68 je 80105a40 <trap+0x140> tf->trapno == T_IRQ0+IRQ_TIMER) yield(); // Check if the process has been killed since we yielded if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801059d8: e8 23 df ff ff call 80103900 <myproc> 801059dd: 85 c0 test %eax,%eax 801059df: 74 19 je 801059fa <trap+0xfa> 801059e1: e8 1a df ff ff call 80103900 <myproc> 801059e6: 8b 40 24 mov 0x24(%eax),%eax 801059e9: 85 c0 test %eax,%eax 801059eb: 74 0d je 801059fa <trap+0xfa> 801059ed: 0f b7 47 3c movzwl 0x3c(%edi),%eax 801059f1: 83 e0 03 and $0x3,%eax 801059f4: 66 83 f8 03 cmp $0x3,%ax 801059f8: 74 37 je 80105a31 <trap+0x131> exit(); } 801059fa: 8d 65 f4 lea -0xc(%ebp),%esp 801059fd: 5b pop %ebx 801059fe: 5e pop %esi 801059ff: 5f pop %edi 80105a00: 5d pop %ebp 80105a01: c3 ret 80105a02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(myproc()->killed) 80105a08: e8 f3 de ff ff call 80103900 <myproc> 80105a0d: 8b 58 24 mov 0x24(%eax),%ebx 80105a10: 85 db test %ebx,%ebx 80105a12: 0f 85 e8 00 00 00 jne 80105b00 <trap+0x200> myproc()->tf = tf; 80105a18: e8 e3 de ff ff call 80103900 <myproc> 80105a1d: 89 78 18 mov %edi,0x18(%eax) syscall(); 80105a20: e8 5b ef ff ff call 80104980 <syscall> if(myproc()->killed) 80105a25: e8 d6 de ff ff call 80103900 <myproc> 80105a2a: 8b 48 24 mov 0x24(%eax),%ecx 80105a2d: 85 c9 test %ecx,%ecx 80105a2f: 74 c9 je 801059fa <trap+0xfa> } 80105a31: 8d 65 f4 lea -0xc(%ebp),%esp 80105a34: 5b pop %ebx 80105a35: 5e pop %esi 80105a36: 5f pop %edi 80105a37: 5d pop %ebp exit(); 80105a38: e9 03 e3 ff ff jmp 80103d40 <exit> 80105a3d: 8d 76 00 lea 0x0(%esi),%esi if(myproc() && myproc()->state == RUNNING && 80105a40: 83 7f 30 20 cmpl $0x20,0x30(%edi) 80105a44: 75 92 jne 801059d8 <trap+0xd8> yield(); 80105a46: e8 25 e4 ff ff call 80103e70 <yield> 80105a4b: eb 8b jmp 801059d8 <trap+0xd8> 80105a4d: 8d 76 00 lea 0x0(%esi),%esi if(cpuid() == 0){ 80105a50: e8 8b de ff ff call 801038e0 <cpuid> 80105a55: 85 c0 test %eax,%eax 80105a57: 0f 84 c3 00 00 00 je 80105b20 <trap+0x220> lapiceoi(); 80105a5d: e8 0e ce ff ff call 80102870 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105a62: e8 99 de ff ff call 80103900 <myproc> 80105a67: 85 c0 test %eax,%eax 80105a69: 0f 85 38 ff ff ff jne 801059a7 <trap+0xa7> 80105a6f: e9 50 ff ff ff jmp 801059c4 <trap+0xc4> 80105a74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kbdintr(); 80105a78: e8 b3 cc ff ff call 80102730 <kbdintr> lapiceoi(); 80105a7d: e8 ee cd ff ff call 80102870 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105a82: e8 79 de ff ff call 80103900 <myproc> 80105a87: 85 c0 test %eax,%eax 80105a89: 0f 85 18 ff ff ff jne 801059a7 <trap+0xa7> 80105a8f: e9 30 ff ff ff jmp 801059c4 <trap+0xc4> 80105a94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uartintr(); 80105a98: e8 53 02 00 00 call 80105cf0 <uartintr> lapiceoi(); 80105a9d: e8 ce cd ff ff call 80102870 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105aa2: e8 59 de ff ff call 80103900 <myproc> 80105aa7: 85 c0 test %eax,%eax 80105aa9: 0f 85 f8 fe ff ff jne 801059a7 <trap+0xa7> 80105aaf: e9 10 ff ff ff jmp 801059c4 <trap+0xc4> 80105ab4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("cpu%d: spurious interrupt at %x:%x\n", 80105ab8: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 80105abc: 8b 77 38 mov 0x38(%edi),%esi 80105abf: e8 1c de ff ff call 801038e0 <cpuid> 80105ac4: 56 push %esi 80105ac5: 53 push %ebx 80105ac6: 50 push %eax 80105ac7: 68 8c 78 10 80 push $0x8010788c 80105acc: e8 8f ab ff ff call 80100660 <cprintf> lapiceoi(); 80105ad1: e8 9a cd ff ff call 80102870 <lapiceoi> break; 80105ad6: 83 c4 10 add $0x10,%esp if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105ad9: e8 22 de ff ff call 80103900 <myproc> 80105ade: 85 c0 test %eax,%eax 80105ae0: 0f 85 c1 fe ff ff jne 801059a7 <trap+0xa7> 80105ae6: e9 d9 fe ff ff jmp 801059c4 <trap+0xc4> 80105aeb: 90 nop 80105aec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ideintr(); 80105af0: e8 ab c6 ff ff call 801021a0 <ideintr> 80105af5: e9 63 ff ff ff jmp 80105a5d <trap+0x15d> 80105afa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80105b00: e8 3b e2 ff ff call 80103d40 <exit> 80105b05: e9 0e ff ff ff jmp 80105a18 <trap+0x118> 80105b0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80105b10: e8 2b e2 ff ff call 80103d40 <exit> 80105b15: e9 aa fe ff ff jmp 801059c4 <trap+0xc4> 80105b1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi acquire(&tickslock); 80105b20: 83 ec 0c sub $0xc,%esp 80105b23: 68 60 4c 11 80 push $0x80114c60 80105b28: e8 53 e9 ff ff call 80104480 <acquire> wakeup(&ticks); 80105b2d: c7 04 24 a0 54 11 80 movl $0x801154a0,(%esp) ticks++; 80105b34: 83 05 a0 54 11 80 01 addl $0x1,0x801154a0 wakeup(&ticks); 80105b3b: e8 30 e5 ff ff call 80104070 <wakeup> release(&tickslock); 80105b40: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 80105b47: e8 f4 e9 ff ff call 80104540 <release> 80105b4c: 83 c4 10 add $0x10,%esp 80105b4f: e9 09 ff ff ff jmp 80105a5d <trap+0x15d> 80105b54: 0f 20 d6 mov %cr2,%esi cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 80105b57: e8 84 dd ff ff call 801038e0 <cpuid> 80105b5c: 83 ec 0c sub $0xc,%esp 80105b5f: 56 push %esi 80105b60: 53 push %ebx 80105b61: 50 push %eax 80105b62: ff 77 30 pushl 0x30(%edi) 80105b65: 68 b0 78 10 80 push $0x801078b0 80105b6a: e8 f1 aa ff ff call 80100660 <cprintf> panic("trap"); 80105b6f: 83 c4 14 add $0x14,%esp 80105b72: 68 86 78 10 80 push $0x80107886 80105b77: e8 14 a8 ff ff call 80100390 <panic> 80105b7c: 66 90 xchg %ax,%ax 80105b7e: 66 90 xchg %ax,%ax 80105b80 <uartgetc>: } static int uartgetc(void) { if(!uart) 80105b80: a1 bc a5 10 80 mov 0x8010a5bc,%eax { 80105b85: 55 push %ebp 80105b86: 89 e5 mov %esp,%ebp if(!uart) 80105b88: 85 c0 test %eax,%eax 80105b8a: 74 1c je 80105ba8 <uartgetc+0x28> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105b8c: ba fd 03 00 00 mov $0x3fd,%edx 80105b91: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 80105b92: a8 01 test $0x1,%al 80105b94: 74 12 je 80105ba8 <uartgetc+0x28> 80105b96: ba f8 03 00 00 mov $0x3f8,%edx 80105b9b: ec in (%dx),%al return -1; return inb(COM1+0); 80105b9c: 0f b6 c0 movzbl %al,%eax } 80105b9f: 5d pop %ebp 80105ba0: c3 ret 80105ba1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105ba8: b8 ff ff ff ff mov $0xffffffff,%eax } 80105bad: 5d pop %ebp 80105bae: c3 ret 80105baf: 90 nop 80105bb0 <uartputc.part.0>: uartputc(int c) 80105bb0: 55 push %ebp 80105bb1: 89 e5 mov %esp,%ebp 80105bb3: 57 push %edi 80105bb4: 56 push %esi 80105bb5: 53 push %ebx 80105bb6: 89 c7 mov %eax,%edi 80105bb8: bb 80 00 00 00 mov $0x80,%ebx 80105bbd: be fd 03 00 00 mov $0x3fd,%esi 80105bc2: 83 ec 0c sub $0xc,%esp 80105bc5: eb 1b jmp 80105be2 <uartputc.part.0+0x32> 80105bc7: 89 f6 mov %esi,%esi 80105bc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi microdelay(10); 80105bd0: 83 ec 0c sub $0xc,%esp 80105bd3: 6a 0a push $0xa 80105bd5: e8 b6 cc ff ff call 80102890 <microdelay> for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 80105bda: 83 c4 10 add $0x10,%esp 80105bdd: 83 eb 01 sub $0x1,%ebx 80105be0: 74 07 je 80105be9 <uartputc.part.0+0x39> 80105be2: 89 f2 mov %esi,%edx 80105be4: ec in (%dx),%al 80105be5: a8 20 test $0x20,%al 80105be7: 74 e7 je 80105bd0 <uartputc.part.0+0x20> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80105be9: ba f8 03 00 00 mov $0x3f8,%edx 80105bee: 89 f8 mov %edi,%eax 80105bf0: ee out %al,(%dx) } 80105bf1: 8d 65 f4 lea -0xc(%ebp),%esp 80105bf4: 5b pop %ebx 80105bf5: 5e pop %esi 80105bf6: 5f pop %edi 80105bf7: 5d pop %ebp 80105bf8: c3 ret 80105bf9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105c00 <uartinit>: { 80105c00: 55 push %ebp 80105c01: 31 c9 xor %ecx,%ecx 80105c03: 89 c8 mov %ecx,%eax 80105c05: 89 e5 mov %esp,%ebp 80105c07: 57 push %edi 80105c08: 56 push %esi 80105c09: 53 push %ebx 80105c0a: bb fa 03 00 00 mov $0x3fa,%ebx 80105c0f: 89 da mov %ebx,%edx 80105c11: 83 ec 0c sub $0xc,%esp 80105c14: ee out %al,(%dx) 80105c15: bf fb 03 00 00 mov $0x3fb,%edi 80105c1a: b8 80 ff ff ff mov $0xffffff80,%eax 80105c1f: 89 fa mov %edi,%edx 80105c21: ee out %al,(%dx) 80105c22: b8 0c 00 00 00 mov $0xc,%eax 80105c27: ba f8 03 00 00 mov $0x3f8,%edx 80105c2c: ee out %al,(%dx) 80105c2d: be f9 03 00 00 mov $0x3f9,%esi 80105c32: 89 c8 mov %ecx,%eax 80105c34: 89 f2 mov %esi,%edx 80105c36: ee out %al,(%dx) 80105c37: b8 03 00 00 00 mov $0x3,%eax 80105c3c: 89 fa mov %edi,%edx 80105c3e: ee out %al,(%dx) 80105c3f: ba fc 03 00 00 mov $0x3fc,%edx 80105c44: 89 c8 mov %ecx,%eax 80105c46: ee out %al,(%dx) 80105c47: b8 01 00 00 00 mov $0x1,%eax 80105c4c: 89 f2 mov %esi,%edx 80105c4e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105c4f: ba fd 03 00 00 mov $0x3fd,%edx 80105c54: ec in (%dx),%al if(inb(COM1+5) == 0xFF) 80105c55: 3c ff cmp $0xff,%al 80105c57: 74 5a je 80105cb3 <uartinit+0xb3> uart = 1; 80105c59: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc 80105c60: 00 00 00 80105c63: 89 da mov %ebx,%edx 80105c65: ec in (%dx),%al 80105c66: ba f8 03 00 00 mov $0x3f8,%edx 80105c6b: ec in (%dx),%al ioapicenable(IRQ_COM1, 0); 80105c6c: 83 ec 08 sub $0x8,%esp for(p="xv6...\n"; *p; p++) 80105c6f: bb a8 79 10 80 mov $0x801079a8,%ebx ioapicenable(IRQ_COM1, 0); 80105c74: 6a 00 push $0x0 80105c76: 6a 04 push $0x4 80105c78: e8 73 c7 ff ff call 801023f0 <ioapicenable> 80105c7d: 83 c4 10 add $0x10,%esp for(p="xv6...\n"; *p; p++) 80105c80: b8 78 00 00 00 mov $0x78,%eax 80105c85: eb 13 jmp 80105c9a <uartinit+0x9a> 80105c87: 89 f6 mov %esi,%esi 80105c89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105c90: 83 c3 01 add $0x1,%ebx 80105c93: 0f be 03 movsbl (%ebx),%eax 80105c96: 84 c0 test %al,%al 80105c98: 74 19 je 80105cb3 <uartinit+0xb3> if(!uart) 80105c9a: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx 80105ca0: 85 d2 test %edx,%edx 80105ca2: 74 ec je 80105c90 <uartinit+0x90> for(p="xv6...\n"; *p; p++) 80105ca4: 83 c3 01 add $0x1,%ebx 80105ca7: e8 04 ff ff ff call 80105bb0 <uartputc.part.0> 80105cac: 0f be 03 movsbl (%ebx),%eax 80105caf: 84 c0 test %al,%al 80105cb1: 75 e7 jne 80105c9a <uartinit+0x9a> } 80105cb3: 8d 65 f4 lea -0xc(%ebp),%esp 80105cb6: 5b pop %ebx 80105cb7: 5e pop %esi 80105cb8: 5f pop %edi 80105cb9: 5d pop %ebp 80105cba: c3 ret 80105cbb: 90 nop 80105cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105cc0 <uartputc>: if(!uart) 80105cc0: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx { 80105cc6: 55 push %ebp 80105cc7: 89 e5 mov %esp,%ebp if(!uart) 80105cc9: 85 d2 test %edx,%edx { 80105ccb: 8b 45 08 mov 0x8(%ebp),%eax if(!uart) 80105cce: 74 10 je 80105ce0 <uartputc+0x20> } 80105cd0: 5d pop %ebp 80105cd1: e9 da fe ff ff jmp 80105bb0 <uartputc.part.0> 80105cd6: 8d 76 00 lea 0x0(%esi),%esi 80105cd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105ce0: 5d pop %ebp 80105ce1: c3 ret 80105ce2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105ce9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105cf0 <uartintr>: void uartintr(void) { 80105cf0: 55 push %ebp 80105cf1: 89 e5 mov %esp,%ebp 80105cf3: 83 ec 14 sub $0x14,%esp consoleintr(uartgetc); 80105cf6: 68 80 5b 10 80 push $0x80105b80 80105cfb: e8 10 ab ff ff call 80100810 <consoleintr> } 80105d00: 83 c4 10 add $0x10,%esp 80105d03: c9 leave 80105d04: c3 ret 80105d05 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80105d05: 6a 00 push $0x0 pushl $0 80105d07: 6a 00 push $0x0 jmp alltraps 80105d09: e9 1c fb ff ff jmp 8010582a <alltraps> 80105d0e <vector1>: .globl vector1 vector1: pushl $0 80105d0e: 6a 00 push $0x0 pushl $1 80105d10: 6a 01 push $0x1 jmp alltraps 80105d12: e9 13 fb ff ff jmp 8010582a <alltraps> 80105d17 <vector2>: .globl vector2 vector2: pushl $0 80105d17: 6a 00 push $0x0 pushl $2 80105d19: 6a 02 push $0x2 jmp alltraps 80105d1b: e9 0a fb ff ff jmp 8010582a <alltraps> 80105d20 <vector3>: .globl vector3 vector3: pushl $0 80105d20: 6a 00 push $0x0 pushl $3 80105d22: 6a 03 push $0x3 jmp alltraps 80105d24: e9 01 fb ff ff jmp 8010582a <alltraps> 80105d29 <vector4>: .globl vector4 vector4: pushl $0 80105d29: 6a 00 push $0x0 pushl $4 80105d2b: 6a 04 push $0x4 jmp alltraps 80105d2d: e9 f8 fa ff ff jmp 8010582a <alltraps> 80105d32 <vector5>: .globl vector5 vector5: pushl $0 80105d32: 6a 00 push $0x0 pushl $5 80105d34: 6a 05 push $0x5 jmp alltraps 80105d36: e9 ef fa ff ff jmp 8010582a <alltraps> 80105d3b <vector6>: .globl vector6 vector6: pushl $0 80105d3b: 6a 00 push $0x0 pushl $6 80105d3d: 6a 06 push $0x6 jmp alltraps 80105d3f: e9 e6 fa ff ff jmp 8010582a <alltraps> 80105d44 <vector7>: .globl vector7 vector7: pushl $0 80105d44: 6a 00 push $0x0 pushl $7 80105d46: 6a 07 push $0x7 jmp alltraps 80105d48: e9 dd fa ff ff jmp 8010582a <alltraps> 80105d4d <vector8>: .globl vector8 vector8: pushl $8 80105d4d: 6a 08 push $0x8 jmp alltraps 80105d4f: e9 d6 fa ff ff jmp 8010582a <alltraps> 80105d54 <vector9>: .globl vector9 vector9: pushl $0 80105d54: 6a 00 push $0x0 pushl $9 80105d56: 6a 09 push $0x9 jmp alltraps 80105d58: e9 cd fa ff ff jmp 8010582a <alltraps> 80105d5d <vector10>: .globl vector10 vector10: pushl $10 80105d5d: 6a 0a push $0xa jmp alltraps 80105d5f: e9 c6 fa ff ff jmp 8010582a <alltraps> 80105d64 <vector11>: .globl vector11 vector11: pushl $11 80105d64: 6a 0b push $0xb jmp alltraps 80105d66: e9 bf fa ff ff jmp 8010582a <alltraps> 80105d6b <vector12>: .globl vector12 vector12: pushl $12 80105d6b: 6a 0c push $0xc jmp alltraps 80105d6d: e9 b8 fa ff ff jmp 8010582a <alltraps> 80105d72 <vector13>: .globl vector13 vector13: pushl $13 80105d72: 6a 0d push $0xd jmp alltraps 80105d74: e9 b1 fa ff ff jmp 8010582a <alltraps> 80105d79 <vector14>: .globl vector14 vector14: pushl $14 80105d79: 6a 0e push $0xe jmp alltraps 80105d7b: e9 aa fa ff ff jmp 8010582a <alltraps> 80105d80 <vector15>: .globl vector15 vector15: pushl $0 80105d80: 6a 00 push $0x0 pushl $15 80105d82: 6a 0f push $0xf jmp alltraps 80105d84: e9 a1 fa ff ff jmp 8010582a <alltraps> 80105d89 <vector16>: .globl vector16 vector16: pushl $0 80105d89: 6a 00 push $0x0 pushl $16 80105d8b: 6a 10 push $0x10 jmp alltraps 80105d8d: e9 98 fa ff ff jmp 8010582a <alltraps> 80105d92 <vector17>: .globl vector17 vector17: pushl $17 80105d92: 6a 11 push $0x11 jmp alltraps 80105d94: e9 91 fa ff ff jmp 8010582a <alltraps> 80105d99 <vector18>: .globl vector18 vector18: pushl $0 80105d99: 6a 00 push $0x0 pushl $18 80105d9b: 6a 12 push $0x12 jmp alltraps 80105d9d: e9 88 fa ff ff jmp 8010582a <alltraps> 80105da2 <vector19>: .globl vector19 vector19: pushl $0 80105da2: 6a 00 push $0x0 pushl $19 80105da4: 6a 13 push $0x13 jmp alltraps 80105da6: e9 7f fa ff ff jmp 8010582a <alltraps> 80105dab <vector20>: .globl vector20 vector20: pushl $0 80105dab: 6a 00 push $0x0 pushl $20 80105dad: 6a 14 push $0x14 jmp alltraps 80105daf: e9 76 fa ff ff jmp 8010582a <alltraps> 80105db4 <vector21>: .globl vector21 vector21: pushl $0 80105db4: 6a 00 push $0x0 pushl $21 80105db6: 6a 15 push $0x15 jmp alltraps 80105db8: e9 6d fa ff ff jmp 8010582a <alltraps> 80105dbd <vector22>: .globl vector22 vector22: pushl $0 80105dbd: 6a 00 push $0x0 pushl $22 80105dbf: 6a 16 push $0x16 jmp alltraps 80105dc1: e9 64 fa ff ff jmp 8010582a <alltraps> 80105dc6 <vector23>: .globl vector23 vector23: pushl $0 80105dc6: 6a 00 push $0x0 pushl $23 80105dc8: 6a 17 push $0x17 jmp alltraps 80105dca: e9 5b fa ff ff jmp 8010582a <alltraps> 80105dcf <vector24>: .globl vector24 vector24: pushl $0 80105dcf: 6a 00 push $0x0 pushl $24 80105dd1: 6a 18 push $0x18 jmp alltraps 80105dd3: e9 52 fa ff ff jmp 8010582a <alltraps> 80105dd8 <vector25>: .globl vector25 vector25: pushl $0 80105dd8: 6a 00 push $0x0 pushl $25 80105dda: 6a 19 push $0x19 jmp alltraps 80105ddc: e9 49 fa ff ff jmp 8010582a <alltraps> 80105de1 <vector26>: .globl vector26 vector26: pushl $0 80105de1: 6a 00 push $0x0 pushl $26 80105de3: 6a 1a push $0x1a jmp alltraps 80105de5: e9 40 fa ff ff jmp 8010582a <alltraps> 80105dea <vector27>: .globl vector27 vector27: pushl $0 80105dea: 6a 00 push $0x0 pushl $27 80105dec: 6a 1b push $0x1b jmp alltraps 80105dee: e9 37 fa ff ff jmp 8010582a <alltraps> 80105df3 <vector28>: .globl vector28 vector28: pushl $0 80105df3: 6a 00 push $0x0 pushl $28 80105df5: 6a 1c push $0x1c jmp alltraps 80105df7: e9 2e fa ff ff jmp 8010582a <alltraps> 80105dfc <vector29>: .globl vector29 vector29: pushl $0 80105dfc: 6a 00 push $0x0 pushl $29 80105dfe: 6a 1d push $0x1d jmp alltraps 80105e00: e9 25 fa ff ff jmp 8010582a <alltraps> 80105e05 <vector30>: .globl vector30 vector30: pushl $0 80105e05: 6a 00 push $0x0 pushl $30 80105e07: 6a 1e push $0x1e jmp alltraps 80105e09: e9 1c fa ff ff jmp 8010582a <alltraps> 80105e0e <vector31>: .globl vector31 vector31: pushl $0 80105e0e: 6a 00 push $0x0 pushl $31 80105e10: 6a 1f push $0x1f jmp alltraps 80105e12: e9 13 fa ff ff jmp 8010582a <alltraps> 80105e17 <vector32>: .globl vector32 vector32: pushl $0 80105e17: 6a 00 push $0x0 pushl $32 80105e19: 6a 20 push $0x20 jmp alltraps 80105e1b: e9 0a fa ff ff jmp 8010582a <alltraps> 80105e20 <vector33>: .globl vector33 vector33: pushl $0 80105e20: 6a 00 push $0x0 pushl $33 80105e22: 6a 21 push $0x21 jmp alltraps 80105e24: e9 01 fa ff ff jmp 8010582a <alltraps> 80105e29 <vector34>: .globl vector34 vector34: pushl $0 80105e29: 6a 00 push $0x0 pushl $34 80105e2b: 6a 22 push $0x22 jmp alltraps 80105e2d: e9 f8 f9 ff ff jmp 8010582a <alltraps> 80105e32 <vector35>: .globl vector35 vector35: pushl $0 80105e32: 6a 00 push $0x0 pushl $35 80105e34: 6a 23 push $0x23 jmp alltraps 80105e36: e9 ef f9 ff ff jmp 8010582a <alltraps> 80105e3b <vector36>: .globl vector36 vector36: pushl $0 80105e3b: 6a 00 push $0x0 pushl $36 80105e3d: 6a 24 push $0x24 jmp alltraps 80105e3f: e9 e6 f9 ff ff jmp 8010582a <alltraps> 80105e44 <vector37>: .globl vector37 vector37: pushl $0 80105e44: 6a 00 push $0x0 pushl $37 80105e46: 6a 25 push $0x25 jmp alltraps 80105e48: e9 dd f9 ff ff jmp 8010582a <alltraps> 80105e4d <vector38>: .globl vector38 vector38: pushl $0 80105e4d: 6a 00 push $0x0 pushl $38 80105e4f: 6a 26 push $0x26 jmp alltraps 80105e51: e9 d4 f9 ff ff jmp 8010582a <alltraps> 80105e56 <vector39>: .globl vector39 vector39: pushl $0 80105e56: 6a 00 push $0x0 pushl $39 80105e58: 6a 27 push $0x27 jmp alltraps 80105e5a: e9 cb f9 ff ff jmp 8010582a <alltraps> 80105e5f <vector40>: .globl vector40 vector40: pushl $0 80105e5f: 6a 00 push $0x0 pushl $40 80105e61: 6a 28 push $0x28 jmp alltraps 80105e63: e9 c2 f9 ff ff jmp 8010582a <alltraps> 80105e68 <vector41>: .globl vector41 vector41: pushl $0 80105e68: 6a 00 push $0x0 pushl $41 80105e6a: 6a 29 push $0x29 jmp alltraps 80105e6c: e9 b9 f9 ff ff jmp 8010582a <alltraps> 80105e71 <vector42>: .globl vector42 vector42: pushl $0 80105e71: 6a 00 push $0x0 pushl $42 80105e73: 6a 2a push $0x2a jmp alltraps 80105e75: e9 b0 f9 ff ff jmp 8010582a <alltraps> 80105e7a <vector43>: .globl vector43 vector43: pushl $0 80105e7a: 6a 00 push $0x0 pushl $43 80105e7c: 6a 2b push $0x2b jmp alltraps 80105e7e: e9 a7 f9 ff ff jmp 8010582a <alltraps> 80105e83 <vector44>: .globl vector44 vector44: pushl $0 80105e83: 6a 00 push $0x0 pushl $44 80105e85: 6a 2c push $0x2c jmp alltraps 80105e87: e9 9e f9 ff ff jmp 8010582a <alltraps> 80105e8c <vector45>: .globl vector45 vector45: pushl $0 80105e8c: 6a 00 push $0x0 pushl $45 80105e8e: 6a 2d push $0x2d jmp alltraps 80105e90: e9 95 f9 ff ff jmp 8010582a <alltraps> 80105e95 <vector46>: .globl vector46 vector46: pushl $0 80105e95: 6a 00 push $0x0 pushl $46 80105e97: 6a 2e push $0x2e jmp alltraps 80105e99: e9 8c f9 ff ff jmp 8010582a <alltraps> 80105e9e <vector47>: .globl vector47 vector47: pushl $0 80105e9e: 6a 00 push $0x0 pushl $47 80105ea0: 6a 2f push $0x2f jmp alltraps 80105ea2: e9 83 f9 ff ff jmp 8010582a <alltraps> 80105ea7 <vector48>: .globl vector48 vector48: pushl $0 80105ea7: 6a 00 push $0x0 pushl $48 80105ea9: 6a 30 push $0x30 jmp alltraps 80105eab: e9 7a f9 ff ff jmp 8010582a <alltraps> 80105eb0 <vector49>: .globl vector49 vector49: pushl $0 80105eb0: 6a 00 push $0x0 pushl $49 80105eb2: 6a 31 push $0x31 jmp alltraps 80105eb4: e9 71 f9 ff ff jmp 8010582a <alltraps> 80105eb9 <vector50>: .globl vector50 vector50: pushl $0 80105eb9: 6a 00 push $0x0 pushl $50 80105ebb: 6a 32 push $0x32 jmp alltraps 80105ebd: e9 68 f9 ff ff jmp 8010582a <alltraps> 80105ec2 <vector51>: .globl vector51 vector51: pushl $0 80105ec2: 6a 00 push $0x0 pushl $51 80105ec4: 6a 33 push $0x33 jmp alltraps 80105ec6: e9 5f f9 ff ff jmp 8010582a <alltraps> 80105ecb <vector52>: .globl vector52 vector52: pushl $0 80105ecb: 6a 00 push $0x0 pushl $52 80105ecd: 6a 34 push $0x34 jmp alltraps 80105ecf: e9 56 f9 ff ff jmp 8010582a <alltraps> 80105ed4 <vector53>: .globl vector53 vector53: pushl $0 80105ed4: 6a 00 push $0x0 pushl $53 80105ed6: 6a 35 push $0x35 jmp alltraps 80105ed8: e9 4d f9 ff ff jmp 8010582a <alltraps> 80105edd <vector54>: .globl vector54 vector54: pushl $0 80105edd: 6a 00 push $0x0 pushl $54 80105edf: 6a 36 push $0x36 jmp alltraps 80105ee1: e9 44 f9 ff ff jmp 8010582a <alltraps> 80105ee6 <vector55>: .globl vector55 vector55: pushl $0 80105ee6: 6a 00 push $0x0 pushl $55 80105ee8: 6a 37 push $0x37 jmp alltraps 80105eea: e9 3b f9 ff ff jmp 8010582a <alltraps> 80105eef <vector56>: .globl vector56 vector56: pushl $0 80105eef: 6a 00 push $0x0 pushl $56 80105ef1: 6a 38 push $0x38 jmp alltraps 80105ef3: e9 32 f9 ff ff jmp 8010582a <alltraps> 80105ef8 <vector57>: .globl vector57 vector57: pushl $0 80105ef8: 6a 00 push $0x0 pushl $57 80105efa: 6a 39 push $0x39 jmp alltraps 80105efc: e9 29 f9 ff ff jmp 8010582a <alltraps> 80105f01 <vector58>: .globl vector58 vector58: pushl $0 80105f01: 6a 00 push $0x0 pushl $58 80105f03: 6a 3a push $0x3a jmp alltraps 80105f05: e9 20 f9 ff ff jmp 8010582a <alltraps> 80105f0a <vector59>: .globl vector59 vector59: pushl $0 80105f0a: 6a 00 push $0x0 pushl $59 80105f0c: 6a 3b push $0x3b jmp alltraps 80105f0e: e9 17 f9 ff ff jmp 8010582a <alltraps> 80105f13 <vector60>: .globl vector60 vector60: pushl $0 80105f13: 6a 00 push $0x0 pushl $60 80105f15: 6a 3c push $0x3c jmp alltraps 80105f17: e9 0e f9 ff ff jmp 8010582a <alltraps> 80105f1c <vector61>: .globl vector61 vector61: pushl $0 80105f1c: 6a 00 push $0x0 pushl $61 80105f1e: 6a 3d push $0x3d jmp alltraps 80105f20: e9 05 f9 ff ff jmp 8010582a <alltraps> 80105f25 <vector62>: .globl vector62 vector62: pushl $0 80105f25: 6a 00 push $0x0 pushl $62 80105f27: 6a 3e push $0x3e jmp alltraps 80105f29: e9 fc f8 ff ff jmp 8010582a <alltraps> 80105f2e <vector63>: .globl vector63 vector63: pushl $0 80105f2e: 6a 00 push $0x0 pushl $63 80105f30: 6a 3f push $0x3f jmp alltraps 80105f32: e9 f3 f8 ff ff jmp 8010582a <alltraps> 80105f37 <vector64>: .globl vector64 vector64: pushl $0 80105f37: 6a 00 push $0x0 pushl $64 80105f39: 6a 40 push $0x40 jmp alltraps 80105f3b: e9 ea f8 ff ff jmp 8010582a <alltraps> 80105f40 <vector65>: .globl vector65 vector65: pushl $0 80105f40: 6a 00 push $0x0 pushl $65 80105f42: 6a 41 push $0x41 jmp alltraps 80105f44: e9 e1 f8 ff ff jmp 8010582a <alltraps> 80105f49 <vector66>: .globl vector66 vector66: pushl $0 80105f49: 6a 00 push $0x0 pushl $66 80105f4b: 6a 42 push $0x42 jmp alltraps 80105f4d: e9 d8 f8 ff ff jmp 8010582a <alltraps> 80105f52 <vector67>: .globl vector67 vector67: pushl $0 80105f52: 6a 00 push $0x0 pushl $67 80105f54: 6a 43 push $0x43 jmp alltraps 80105f56: e9 cf f8 ff ff jmp 8010582a <alltraps> 80105f5b <vector68>: .globl vector68 vector68: pushl $0 80105f5b: 6a 00 push $0x0 pushl $68 80105f5d: 6a 44 push $0x44 jmp alltraps 80105f5f: e9 c6 f8 ff ff jmp 8010582a <alltraps> 80105f64 <vector69>: .globl vector69 vector69: pushl $0 80105f64: 6a 00 push $0x0 pushl $69 80105f66: 6a 45 push $0x45 jmp alltraps 80105f68: e9 bd f8 ff ff jmp 8010582a <alltraps> 80105f6d <vector70>: .globl vector70 vector70: pushl $0 80105f6d: 6a 00 push $0x0 pushl $70 80105f6f: 6a 46 push $0x46 jmp alltraps 80105f71: e9 b4 f8 ff ff jmp 8010582a <alltraps> 80105f76 <vector71>: .globl vector71 vector71: pushl $0 80105f76: 6a 00 push $0x0 pushl $71 80105f78: 6a 47 push $0x47 jmp alltraps 80105f7a: e9 ab f8 ff ff jmp 8010582a <alltraps> 80105f7f <vector72>: .globl vector72 vector72: pushl $0 80105f7f: 6a 00 push $0x0 pushl $72 80105f81: 6a 48 push $0x48 jmp alltraps 80105f83: e9 a2 f8 ff ff jmp 8010582a <alltraps> 80105f88 <vector73>: .globl vector73 vector73: pushl $0 80105f88: 6a 00 push $0x0 pushl $73 80105f8a: 6a 49 push $0x49 jmp alltraps 80105f8c: e9 99 f8 ff ff jmp 8010582a <alltraps> 80105f91 <vector74>: .globl vector74 vector74: pushl $0 80105f91: 6a 00 push $0x0 pushl $74 80105f93: 6a 4a push $0x4a jmp alltraps 80105f95: e9 90 f8 ff ff jmp 8010582a <alltraps> 80105f9a <vector75>: .globl vector75 vector75: pushl $0 80105f9a: 6a 00 push $0x0 pushl $75 80105f9c: 6a 4b push $0x4b jmp alltraps 80105f9e: e9 87 f8 ff ff jmp 8010582a <alltraps> 80105fa3 <vector76>: .globl vector76 vector76: pushl $0 80105fa3: 6a 00 push $0x0 pushl $76 80105fa5: 6a 4c push $0x4c jmp alltraps 80105fa7: e9 7e f8 ff ff jmp 8010582a <alltraps> 80105fac <vector77>: .globl vector77 vector77: pushl $0 80105fac: 6a 00 push $0x0 pushl $77 80105fae: 6a 4d push $0x4d jmp alltraps 80105fb0: e9 75 f8 ff ff jmp 8010582a <alltraps> 80105fb5 <vector78>: .globl vector78 vector78: pushl $0 80105fb5: 6a 00 push $0x0 pushl $78 80105fb7: 6a 4e push $0x4e jmp alltraps 80105fb9: e9 6c f8 ff ff jmp 8010582a <alltraps> 80105fbe <vector79>: .globl vector79 vector79: pushl $0 80105fbe: 6a 00 push $0x0 pushl $79 80105fc0: 6a 4f push $0x4f jmp alltraps 80105fc2: e9 63 f8 ff ff jmp 8010582a <alltraps> 80105fc7 <vector80>: .globl vector80 vector80: pushl $0 80105fc7: 6a 00 push $0x0 pushl $80 80105fc9: 6a 50 push $0x50 jmp alltraps 80105fcb: e9 5a f8 ff ff jmp 8010582a <alltraps> 80105fd0 <vector81>: .globl vector81 vector81: pushl $0 80105fd0: 6a 00 push $0x0 pushl $81 80105fd2: 6a 51 push $0x51 jmp alltraps 80105fd4: e9 51 f8 ff ff jmp 8010582a <alltraps> 80105fd9 <vector82>: .globl vector82 vector82: pushl $0 80105fd9: 6a 00 push $0x0 pushl $82 80105fdb: 6a 52 push $0x52 jmp alltraps 80105fdd: e9 48 f8 ff ff jmp 8010582a <alltraps> 80105fe2 <vector83>: .globl vector83 vector83: pushl $0 80105fe2: 6a 00 push $0x0 pushl $83 80105fe4: 6a 53 push $0x53 jmp alltraps 80105fe6: e9 3f f8 ff ff jmp 8010582a <alltraps> 80105feb <vector84>: .globl vector84 vector84: pushl $0 80105feb: 6a 00 push $0x0 pushl $84 80105fed: 6a 54 push $0x54 jmp alltraps 80105fef: e9 36 f8 ff ff jmp 8010582a <alltraps> 80105ff4 <vector85>: .globl vector85 vector85: pushl $0 80105ff4: 6a 00 push $0x0 pushl $85 80105ff6: 6a 55 push $0x55 jmp alltraps 80105ff8: e9 2d f8 ff ff jmp 8010582a <alltraps> 80105ffd <vector86>: .globl vector86 vector86: pushl $0 80105ffd: 6a 00 push $0x0 pushl $86 80105fff: 6a 56 push $0x56 jmp alltraps 80106001: e9 24 f8 ff ff jmp 8010582a <alltraps> 80106006 <vector87>: .globl vector87 vector87: pushl $0 80106006: 6a 00 push $0x0 pushl $87 80106008: 6a 57 push $0x57 jmp alltraps 8010600a: e9 1b f8 ff ff jmp 8010582a <alltraps> 8010600f <vector88>: .globl vector88 vector88: pushl $0 8010600f: 6a 00 push $0x0 pushl $88 80106011: 6a 58 push $0x58 jmp alltraps 80106013: e9 12 f8 ff ff jmp 8010582a <alltraps> 80106018 <vector89>: .globl vector89 vector89: pushl $0 80106018: 6a 00 push $0x0 pushl $89 8010601a: 6a 59 push $0x59 jmp alltraps 8010601c: e9 09 f8 ff ff jmp 8010582a <alltraps> 80106021 <vector90>: .globl vector90 vector90: pushl $0 80106021: 6a 00 push $0x0 pushl $90 80106023: 6a 5a push $0x5a jmp alltraps 80106025: e9 00 f8 ff ff jmp 8010582a <alltraps> 8010602a <vector91>: .globl vector91 vector91: pushl $0 8010602a: 6a 00 push $0x0 pushl $91 8010602c: 6a 5b push $0x5b jmp alltraps 8010602e: e9 f7 f7 ff ff jmp 8010582a <alltraps> 80106033 <vector92>: .globl vector92 vector92: pushl $0 80106033: 6a 00 push $0x0 pushl $92 80106035: 6a 5c push $0x5c jmp alltraps 80106037: e9 ee f7 ff ff jmp 8010582a <alltraps> 8010603c <vector93>: .globl vector93 vector93: pushl $0 8010603c: 6a 00 push $0x0 pushl $93 8010603e: 6a 5d push $0x5d jmp alltraps 80106040: e9 e5 f7 ff ff jmp 8010582a <alltraps> 80106045 <vector94>: .globl vector94 vector94: pushl $0 80106045: 6a 00 push $0x0 pushl $94 80106047: 6a 5e push $0x5e jmp alltraps 80106049: e9 dc f7 ff ff jmp 8010582a <alltraps> 8010604e <vector95>: .globl vector95 vector95: pushl $0 8010604e: 6a 00 push $0x0 pushl $95 80106050: 6a 5f push $0x5f jmp alltraps 80106052: e9 d3 f7 ff ff jmp 8010582a <alltraps> 80106057 <vector96>: .globl vector96 vector96: pushl $0 80106057: 6a 00 push $0x0 pushl $96 80106059: 6a 60 push $0x60 jmp alltraps 8010605b: e9 ca f7 ff ff jmp 8010582a <alltraps> 80106060 <vector97>: .globl vector97 vector97: pushl $0 80106060: 6a 00 push $0x0 pushl $97 80106062: 6a 61 push $0x61 jmp alltraps 80106064: e9 c1 f7 ff ff jmp 8010582a <alltraps> 80106069 <vector98>: .globl vector98 vector98: pushl $0 80106069: 6a 00 push $0x0 pushl $98 8010606b: 6a 62 push $0x62 jmp alltraps 8010606d: e9 b8 f7 ff ff jmp 8010582a <alltraps> 80106072 <vector99>: .globl vector99 vector99: pushl $0 80106072: 6a 00 push $0x0 pushl $99 80106074: 6a 63 push $0x63 jmp alltraps 80106076: e9 af f7 ff ff jmp 8010582a <alltraps> 8010607b <vector100>: .globl vector100 vector100: pushl $0 8010607b: 6a 00 push $0x0 pushl $100 8010607d: 6a 64 push $0x64 jmp alltraps 8010607f: e9 a6 f7 ff ff jmp 8010582a <alltraps> 80106084 <vector101>: .globl vector101 vector101: pushl $0 80106084: 6a 00 push $0x0 pushl $101 80106086: 6a 65 push $0x65 jmp alltraps 80106088: e9 9d f7 ff ff jmp 8010582a <alltraps> 8010608d <vector102>: .globl vector102 vector102: pushl $0 8010608d: 6a 00 push $0x0 pushl $102 8010608f: 6a 66 push $0x66 jmp alltraps 80106091: e9 94 f7 ff ff jmp 8010582a <alltraps> 80106096 <vector103>: .globl vector103 vector103: pushl $0 80106096: 6a 00 push $0x0 pushl $103 80106098: 6a 67 push $0x67 jmp alltraps 8010609a: e9 8b f7 ff ff jmp 8010582a <alltraps> 8010609f <vector104>: .globl vector104 vector104: pushl $0 8010609f: 6a 00 push $0x0 pushl $104 801060a1: 6a 68 push $0x68 jmp alltraps 801060a3: e9 82 f7 ff ff jmp 8010582a <alltraps> 801060a8 <vector105>: .globl vector105 vector105: pushl $0 801060a8: 6a 00 push $0x0 pushl $105 801060aa: 6a 69 push $0x69 jmp alltraps 801060ac: e9 79 f7 ff ff jmp 8010582a <alltraps> 801060b1 <vector106>: .globl vector106 vector106: pushl $0 801060b1: 6a 00 push $0x0 pushl $106 801060b3: 6a 6a push $0x6a jmp alltraps 801060b5: e9 70 f7 ff ff jmp 8010582a <alltraps> 801060ba <vector107>: .globl vector107 vector107: pushl $0 801060ba: 6a 00 push $0x0 pushl $107 801060bc: 6a 6b push $0x6b jmp alltraps 801060be: e9 67 f7 ff ff jmp 8010582a <alltraps> 801060c3 <vector108>: .globl vector108 vector108: pushl $0 801060c3: 6a 00 push $0x0 pushl $108 801060c5: 6a 6c push $0x6c jmp alltraps 801060c7: e9 5e f7 ff ff jmp 8010582a <alltraps> 801060cc <vector109>: .globl vector109 vector109: pushl $0 801060cc: 6a 00 push $0x0 pushl $109 801060ce: 6a 6d push $0x6d jmp alltraps 801060d0: e9 55 f7 ff ff jmp 8010582a <alltraps> 801060d5 <vector110>: .globl vector110 vector110: pushl $0 801060d5: 6a 00 push $0x0 pushl $110 801060d7: 6a 6e push $0x6e jmp alltraps 801060d9: e9 4c f7 ff ff jmp 8010582a <alltraps> 801060de <vector111>: .globl vector111 vector111: pushl $0 801060de: 6a 00 push $0x0 pushl $111 801060e0: 6a 6f push $0x6f jmp alltraps 801060e2: e9 43 f7 ff ff jmp 8010582a <alltraps> 801060e7 <vector112>: .globl vector112 vector112: pushl $0 801060e7: 6a 00 push $0x0 pushl $112 801060e9: 6a 70 push $0x70 jmp alltraps 801060eb: e9 3a f7 ff ff jmp 8010582a <alltraps> 801060f0 <vector113>: .globl vector113 vector113: pushl $0 801060f0: 6a 00 push $0x0 pushl $113 801060f2: 6a 71 push $0x71 jmp alltraps 801060f4: e9 31 f7 ff ff jmp 8010582a <alltraps> 801060f9 <vector114>: .globl vector114 vector114: pushl $0 801060f9: 6a 00 push $0x0 pushl $114 801060fb: 6a 72 push $0x72 jmp alltraps 801060fd: e9 28 f7 ff ff jmp 8010582a <alltraps> 80106102 <vector115>: .globl vector115 vector115: pushl $0 80106102: 6a 00 push $0x0 pushl $115 80106104: 6a 73 push $0x73 jmp alltraps 80106106: e9 1f f7 ff ff jmp 8010582a <alltraps> 8010610b <vector116>: .globl vector116 vector116: pushl $0 8010610b: 6a 00 push $0x0 pushl $116 8010610d: 6a 74 push $0x74 jmp alltraps 8010610f: e9 16 f7 ff ff jmp 8010582a <alltraps> 80106114 <vector117>: .globl vector117 vector117: pushl $0 80106114: 6a 00 push $0x0 pushl $117 80106116: 6a 75 push $0x75 jmp alltraps 80106118: e9 0d f7 ff ff jmp 8010582a <alltraps> 8010611d <vector118>: .globl vector118 vector118: pushl $0 8010611d: 6a 00 push $0x0 pushl $118 8010611f: 6a 76 push $0x76 jmp alltraps 80106121: e9 04 f7 ff ff jmp 8010582a <alltraps> 80106126 <vector119>: .globl vector119 vector119: pushl $0 80106126: 6a 00 push $0x0 pushl $119 80106128: 6a 77 push $0x77 jmp alltraps 8010612a: e9 fb f6 ff ff jmp 8010582a <alltraps> 8010612f <vector120>: .globl vector120 vector120: pushl $0 8010612f: 6a 00 push $0x0 pushl $120 80106131: 6a 78 push $0x78 jmp alltraps 80106133: e9 f2 f6 ff ff jmp 8010582a <alltraps> 80106138 <vector121>: .globl vector121 vector121: pushl $0 80106138: 6a 00 push $0x0 pushl $121 8010613a: 6a 79 push $0x79 jmp alltraps 8010613c: e9 e9 f6 ff ff jmp 8010582a <alltraps> 80106141 <vector122>: .globl vector122 vector122: pushl $0 80106141: 6a 00 push $0x0 pushl $122 80106143: 6a 7a push $0x7a jmp alltraps 80106145: e9 e0 f6 ff ff jmp 8010582a <alltraps> 8010614a <vector123>: .globl vector123 vector123: pushl $0 8010614a: 6a 00 push $0x0 pushl $123 8010614c: 6a 7b push $0x7b jmp alltraps 8010614e: e9 d7 f6 ff ff jmp 8010582a <alltraps> 80106153 <vector124>: .globl vector124 vector124: pushl $0 80106153: 6a 00 push $0x0 pushl $124 80106155: 6a 7c push $0x7c jmp alltraps 80106157: e9 ce f6 ff ff jmp 8010582a <alltraps> 8010615c <vector125>: .globl vector125 vector125: pushl $0 8010615c: 6a 00 push $0x0 pushl $125 8010615e: 6a 7d push $0x7d jmp alltraps 80106160: e9 c5 f6 ff ff jmp 8010582a <alltraps> 80106165 <vector126>: .globl vector126 vector126: pushl $0 80106165: 6a 00 push $0x0 pushl $126 80106167: 6a 7e push $0x7e jmp alltraps 80106169: e9 bc f6 ff ff jmp 8010582a <alltraps> 8010616e <vector127>: .globl vector127 vector127: pushl $0 8010616e: 6a 00 push $0x0 pushl $127 80106170: 6a 7f push $0x7f jmp alltraps 80106172: e9 b3 f6 ff ff jmp 8010582a <alltraps> 80106177 <vector128>: .globl vector128 vector128: pushl $0 80106177: 6a 00 push $0x0 pushl $128 80106179: 68 80 00 00 00 push $0x80 jmp alltraps 8010617e: e9 a7 f6 ff ff jmp 8010582a <alltraps> 80106183 <vector129>: .globl vector129 vector129: pushl $0 80106183: 6a 00 push $0x0 pushl $129 80106185: 68 81 00 00 00 push $0x81 jmp alltraps 8010618a: e9 9b f6 ff ff jmp 8010582a <alltraps> 8010618f <vector130>: .globl vector130 vector130: pushl $0 8010618f: 6a 00 push $0x0 pushl $130 80106191: 68 82 00 00 00 push $0x82 jmp alltraps 80106196: e9 8f f6 ff ff jmp 8010582a <alltraps> 8010619b <vector131>: .globl vector131 vector131: pushl $0 8010619b: 6a 00 push $0x0 pushl $131 8010619d: 68 83 00 00 00 push $0x83 jmp alltraps 801061a2: e9 83 f6 ff ff jmp 8010582a <alltraps> 801061a7 <vector132>: .globl vector132 vector132: pushl $0 801061a7: 6a 00 push $0x0 pushl $132 801061a9: 68 84 00 00 00 push $0x84 jmp alltraps 801061ae: e9 77 f6 ff ff jmp 8010582a <alltraps> 801061b3 <vector133>: .globl vector133 vector133: pushl $0 801061b3: 6a 00 push $0x0 pushl $133 801061b5: 68 85 00 00 00 push $0x85 jmp alltraps 801061ba: e9 6b f6 ff ff jmp 8010582a <alltraps> 801061bf <vector134>: .globl vector134 vector134: pushl $0 801061bf: 6a 00 push $0x0 pushl $134 801061c1: 68 86 00 00 00 push $0x86 jmp alltraps 801061c6: e9 5f f6 ff ff jmp 8010582a <alltraps> 801061cb <vector135>: .globl vector135 vector135: pushl $0 801061cb: 6a 00 push $0x0 pushl $135 801061cd: 68 87 00 00 00 push $0x87 jmp alltraps 801061d2: e9 53 f6 ff ff jmp 8010582a <alltraps> 801061d7 <vector136>: .globl vector136 vector136: pushl $0 801061d7: 6a 00 push $0x0 pushl $136 801061d9: 68 88 00 00 00 push $0x88 jmp alltraps 801061de: e9 47 f6 ff ff jmp 8010582a <alltraps> 801061e3 <vector137>: .globl vector137 vector137: pushl $0 801061e3: 6a 00 push $0x0 pushl $137 801061e5: 68 89 00 00 00 push $0x89 jmp alltraps 801061ea: e9 3b f6 ff ff jmp 8010582a <alltraps> 801061ef <vector138>: .globl vector138 vector138: pushl $0 801061ef: 6a 00 push $0x0 pushl $138 801061f1: 68 8a 00 00 00 push $0x8a jmp alltraps 801061f6: e9 2f f6 ff ff jmp 8010582a <alltraps> 801061fb <vector139>: .globl vector139 vector139: pushl $0 801061fb: 6a 00 push $0x0 pushl $139 801061fd: 68 8b 00 00 00 push $0x8b jmp alltraps 80106202: e9 23 f6 ff ff jmp 8010582a <alltraps> 80106207 <vector140>: .globl vector140 vector140: pushl $0 80106207: 6a 00 push $0x0 pushl $140 80106209: 68 8c 00 00 00 push $0x8c jmp alltraps 8010620e: e9 17 f6 ff ff jmp 8010582a <alltraps> 80106213 <vector141>: .globl vector141 vector141: pushl $0 80106213: 6a 00 push $0x0 pushl $141 80106215: 68 8d 00 00 00 push $0x8d jmp alltraps 8010621a: e9 0b f6 ff ff jmp 8010582a <alltraps> 8010621f <vector142>: .globl vector142 vector142: pushl $0 8010621f: 6a 00 push $0x0 pushl $142 80106221: 68 8e 00 00 00 push $0x8e jmp alltraps 80106226: e9 ff f5 ff ff jmp 8010582a <alltraps> 8010622b <vector143>: .globl vector143 vector143: pushl $0 8010622b: 6a 00 push $0x0 pushl $143 8010622d: 68 8f 00 00 00 push $0x8f jmp alltraps 80106232: e9 f3 f5 ff ff jmp 8010582a <alltraps> 80106237 <vector144>: .globl vector144 vector144: pushl $0 80106237: 6a 00 push $0x0 pushl $144 80106239: 68 90 00 00 00 push $0x90 jmp alltraps 8010623e: e9 e7 f5 ff ff jmp 8010582a <alltraps> 80106243 <vector145>: .globl vector145 vector145: pushl $0 80106243: 6a 00 push $0x0 pushl $145 80106245: 68 91 00 00 00 push $0x91 jmp alltraps 8010624a: e9 db f5 ff ff jmp 8010582a <alltraps> 8010624f <vector146>: .globl vector146 vector146: pushl $0 8010624f: 6a 00 push $0x0 pushl $146 80106251: 68 92 00 00 00 push $0x92 jmp alltraps 80106256: e9 cf f5 ff ff jmp 8010582a <alltraps> 8010625b <vector147>: .globl vector147 vector147: pushl $0 8010625b: 6a 00 push $0x0 pushl $147 8010625d: 68 93 00 00 00 push $0x93 jmp alltraps 80106262: e9 c3 f5 ff ff jmp 8010582a <alltraps> 80106267 <vector148>: .globl vector148 vector148: pushl $0 80106267: 6a 00 push $0x0 pushl $148 80106269: 68 94 00 00 00 push $0x94 jmp alltraps 8010626e: e9 b7 f5 ff ff jmp 8010582a <alltraps> 80106273 <vector149>: .globl vector149 vector149: pushl $0 80106273: 6a 00 push $0x0 pushl $149 80106275: 68 95 00 00 00 push $0x95 jmp alltraps 8010627a: e9 ab f5 ff ff jmp 8010582a <alltraps> 8010627f <vector150>: .globl vector150 vector150: pushl $0 8010627f: 6a 00 push $0x0 pushl $150 80106281: 68 96 00 00 00 push $0x96 jmp alltraps 80106286: e9 9f f5 ff ff jmp 8010582a <alltraps> 8010628b <vector151>: .globl vector151 vector151: pushl $0 8010628b: 6a 00 push $0x0 pushl $151 8010628d: 68 97 00 00 00 push $0x97 jmp alltraps 80106292: e9 93 f5 ff ff jmp 8010582a <alltraps> 80106297 <vector152>: .globl vector152 vector152: pushl $0 80106297: 6a 00 push $0x0 pushl $152 80106299: 68 98 00 00 00 push $0x98 jmp alltraps 8010629e: e9 87 f5 ff ff jmp 8010582a <alltraps> 801062a3 <vector153>: .globl vector153 vector153: pushl $0 801062a3: 6a 00 push $0x0 pushl $153 801062a5: 68 99 00 00 00 push $0x99 jmp alltraps 801062aa: e9 7b f5 ff ff jmp 8010582a <alltraps> 801062af <vector154>: .globl vector154 vector154: pushl $0 801062af: 6a 00 push $0x0 pushl $154 801062b1: 68 9a 00 00 00 push $0x9a jmp alltraps 801062b6: e9 6f f5 ff ff jmp 8010582a <alltraps> 801062bb <vector155>: .globl vector155 vector155: pushl $0 801062bb: 6a 00 push $0x0 pushl $155 801062bd: 68 9b 00 00 00 push $0x9b jmp alltraps 801062c2: e9 63 f5 ff ff jmp 8010582a <alltraps> 801062c7 <vector156>: .globl vector156 vector156: pushl $0 801062c7: 6a 00 push $0x0 pushl $156 801062c9: 68 9c 00 00 00 push $0x9c jmp alltraps 801062ce: e9 57 f5 ff ff jmp 8010582a <alltraps> 801062d3 <vector157>: .globl vector157 vector157: pushl $0 801062d3: 6a 00 push $0x0 pushl $157 801062d5: 68 9d 00 00 00 push $0x9d jmp alltraps 801062da: e9 4b f5 ff ff jmp 8010582a <alltraps> 801062df <vector158>: .globl vector158 vector158: pushl $0 801062df: 6a 00 push $0x0 pushl $158 801062e1: 68 9e 00 00 00 push $0x9e jmp alltraps 801062e6: e9 3f f5 ff ff jmp 8010582a <alltraps> 801062eb <vector159>: .globl vector159 vector159: pushl $0 801062eb: 6a 00 push $0x0 pushl $159 801062ed: 68 9f 00 00 00 push $0x9f jmp alltraps 801062f2: e9 33 f5 ff ff jmp 8010582a <alltraps> 801062f7 <vector160>: .globl vector160 vector160: pushl $0 801062f7: 6a 00 push $0x0 pushl $160 801062f9: 68 a0 00 00 00 push $0xa0 jmp alltraps 801062fe: e9 27 f5 ff ff jmp 8010582a <alltraps> 80106303 <vector161>: .globl vector161 vector161: pushl $0 80106303: 6a 00 push $0x0 pushl $161 80106305: 68 a1 00 00 00 push $0xa1 jmp alltraps 8010630a: e9 1b f5 ff ff jmp 8010582a <alltraps> 8010630f <vector162>: .globl vector162 vector162: pushl $0 8010630f: 6a 00 push $0x0 pushl $162 80106311: 68 a2 00 00 00 push $0xa2 jmp alltraps 80106316: e9 0f f5 ff ff jmp 8010582a <alltraps> 8010631b <vector163>: .globl vector163 vector163: pushl $0 8010631b: 6a 00 push $0x0 pushl $163 8010631d: 68 a3 00 00 00 push $0xa3 jmp alltraps 80106322: e9 03 f5 ff ff jmp 8010582a <alltraps> 80106327 <vector164>: .globl vector164 vector164: pushl $0 80106327: 6a 00 push $0x0 pushl $164 80106329: 68 a4 00 00 00 push $0xa4 jmp alltraps 8010632e: e9 f7 f4 ff ff jmp 8010582a <alltraps> 80106333 <vector165>: .globl vector165 vector165: pushl $0 80106333: 6a 00 push $0x0 pushl $165 80106335: 68 a5 00 00 00 push $0xa5 jmp alltraps 8010633a: e9 eb f4 ff ff jmp 8010582a <alltraps> 8010633f <vector166>: .globl vector166 vector166: pushl $0 8010633f: 6a 00 push $0x0 pushl $166 80106341: 68 a6 00 00 00 push $0xa6 jmp alltraps 80106346: e9 df f4 ff ff jmp 8010582a <alltraps> 8010634b <vector167>: .globl vector167 vector167: pushl $0 8010634b: 6a 00 push $0x0 pushl $167 8010634d: 68 a7 00 00 00 push $0xa7 jmp alltraps 80106352: e9 d3 f4 ff ff jmp 8010582a <alltraps> 80106357 <vector168>: .globl vector168 vector168: pushl $0 80106357: 6a 00 push $0x0 pushl $168 80106359: 68 a8 00 00 00 push $0xa8 jmp alltraps 8010635e: e9 c7 f4 ff ff jmp 8010582a <alltraps> 80106363 <vector169>: .globl vector169 vector169: pushl $0 80106363: 6a 00 push $0x0 pushl $169 80106365: 68 a9 00 00 00 push $0xa9 jmp alltraps 8010636a: e9 bb f4 ff ff jmp 8010582a <alltraps> 8010636f <vector170>: .globl vector170 vector170: pushl $0 8010636f: 6a 00 push $0x0 pushl $170 80106371: 68 aa 00 00 00 push $0xaa jmp alltraps 80106376: e9 af f4 ff ff jmp 8010582a <alltraps> 8010637b <vector171>: .globl vector171 vector171: pushl $0 8010637b: 6a 00 push $0x0 pushl $171 8010637d: 68 ab 00 00 00 push $0xab jmp alltraps 80106382: e9 a3 f4 ff ff jmp 8010582a <alltraps> 80106387 <vector172>: .globl vector172 vector172: pushl $0 80106387: 6a 00 push $0x0 pushl $172 80106389: 68 ac 00 00 00 push $0xac jmp alltraps 8010638e: e9 97 f4 ff ff jmp 8010582a <alltraps> 80106393 <vector173>: .globl vector173 vector173: pushl $0 80106393: 6a 00 push $0x0 pushl $173 80106395: 68 ad 00 00 00 push $0xad jmp alltraps 8010639a: e9 8b f4 ff ff jmp 8010582a <alltraps> 8010639f <vector174>: .globl vector174 vector174: pushl $0 8010639f: 6a 00 push $0x0 pushl $174 801063a1: 68 ae 00 00 00 push $0xae jmp alltraps 801063a6: e9 7f f4 ff ff jmp 8010582a <alltraps> 801063ab <vector175>: .globl vector175 vector175: pushl $0 801063ab: 6a 00 push $0x0 pushl $175 801063ad: 68 af 00 00 00 push $0xaf jmp alltraps 801063b2: e9 73 f4 ff ff jmp 8010582a <alltraps> 801063b7 <vector176>: .globl vector176 vector176: pushl $0 801063b7: 6a 00 push $0x0 pushl $176 801063b9: 68 b0 00 00 00 push $0xb0 jmp alltraps 801063be: e9 67 f4 ff ff jmp 8010582a <alltraps> 801063c3 <vector177>: .globl vector177 vector177: pushl $0 801063c3: 6a 00 push $0x0 pushl $177 801063c5: 68 b1 00 00 00 push $0xb1 jmp alltraps 801063ca: e9 5b f4 ff ff jmp 8010582a <alltraps> 801063cf <vector178>: .globl vector178 vector178: pushl $0 801063cf: 6a 00 push $0x0 pushl $178 801063d1: 68 b2 00 00 00 push $0xb2 jmp alltraps 801063d6: e9 4f f4 ff ff jmp 8010582a <alltraps> 801063db <vector179>: .globl vector179 vector179: pushl $0 801063db: 6a 00 push $0x0 pushl $179 801063dd: 68 b3 00 00 00 push $0xb3 jmp alltraps 801063e2: e9 43 f4 ff ff jmp 8010582a <alltraps> 801063e7 <vector180>: .globl vector180 vector180: pushl $0 801063e7: 6a 00 push $0x0 pushl $180 801063e9: 68 b4 00 00 00 push $0xb4 jmp alltraps 801063ee: e9 37 f4 ff ff jmp 8010582a <alltraps> 801063f3 <vector181>: .globl vector181 vector181: pushl $0 801063f3: 6a 00 push $0x0 pushl $181 801063f5: 68 b5 00 00 00 push $0xb5 jmp alltraps 801063fa: e9 2b f4 ff ff jmp 8010582a <alltraps> 801063ff <vector182>: .globl vector182 vector182: pushl $0 801063ff: 6a 00 push $0x0 pushl $182 80106401: 68 b6 00 00 00 push $0xb6 jmp alltraps 80106406: e9 1f f4 ff ff jmp 8010582a <alltraps> 8010640b <vector183>: .globl vector183 vector183: pushl $0 8010640b: 6a 00 push $0x0 pushl $183 8010640d: 68 b7 00 00 00 push $0xb7 jmp alltraps 80106412: e9 13 f4 ff ff jmp 8010582a <alltraps> 80106417 <vector184>: .globl vector184 vector184: pushl $0 80106417: 6a 00 push $0x0 pushl $184 80106419: 68 b8 00 00 00 push $0xb8 jmp alltraps 8010641e: e9 07 f4 ff ff jmp 8010582a <alltraps> 80106423 <vector185>: .globl vector185 vector185: pushl $0 80106423: 6a 00 push $0x0 pushl $185 80106425: 68 b9 00 00 00 push $0xb9 jmp alltraps 8010642a: e9 fb f3 ff ff jmp 8010582a <alltraps> 8010642f <vector186>: .globl vector186 vector186: pushl $0 8010642f: 6a 00 push $0x0 pushl $186 80106431: 68 ba 00 00 00 push $0xba jmp alltraps 80106436: e9 ef f3 ff ff jmp 8010582a <alltraps> 8010643b <vector187>: .globl vector187 vector187: pushl $0 8010643b: 6a 00 push $0x0 pushl $187 8010643d: 68 bb 00 00 00 push $0xbb jmp alltraps 80106442: e9 e3 f3 ff ff jmp 8010582a <alltraps> 80106447 <vector188>: .globl vector188 vector188: pushl $0 80106447: 6a 00 push $0x0 pushl $188 80106449: 68 bc 00 00 00 push $0xbc jmp alltraps 8010644e: e9 d7 f3 ff ff jmp 8010582a <alltraps> 80106453 <vector189>: .globl vector189 vector189: pushl $0 80106453: 6a 00 push $0x0 pushl $189 80106455: 68 bd 00 00 00 push $0xbd jmp alltraps 8010645a: e9 cb f3 ff ff jmp 8010582a <alltraps> 8010645f <vector190>: .globl vector190 vector190: pushl $0 8010645f: 6a 00 push $0x0 pushl $190 80106461: 68 be 00 00 00 push $0xbe jmp alltraps 80106466: e9 bf f3 ff ff jmp 8010582a <alltraps> 8010646b <vector191>: .globl vector191 vector191: pushl $0 8010646b: 6a 00 push $0x0 pushl $191 8010646d: 68 bf 00 00 00 push $0xbf jmp alltraps 80106472: e9 b3 f3 ff ff jmp 8010582a <alltraps> 80106477 <vector192>: .globl vector192 vector192: pushl $0 80106477: 6a 00 push $0x0 pushl $192 80106479: 68 c0 00 00 00 push $0xc0 jmp alltraps 8010647e: e9 a7 f3 ff ff jmp 8010582a <alltraps> 80106483 <vector193>: .globl vector193 vector193: pushl $0 80106483: 6a 00 push $0x0 pushl $193 80106485: 68 c1 00 00 00 push $0xc1 jmp alltraps 8010648a: e9 9b f3 ff ff jmp 8010582a <alltraps> 8010648f <vector194>: .globl vector194 vector194: pushl $0 8010648f: 6a 00 push $0x0 pushl $194 80106491: 68 c2 00 00 00 push $0xc2 jmp alltraps 80106496: e9 8f f3 ff ff jmp 8010582a <alltraps> 8010649b <vector195>: .globl vector195 vector195: pushl $0 8010649b: 6a 00 push $0x0 pushl $195 8010649d: 68 c3 00 00 00 push $0xc3 jmp alltraps 801064a2: e9 83 f3 ff ff jmp 8010582a <alltraps> 801064a7 <vector196>: .globl vector196 vector196: pushl $0 801064a7: 6a 00 push $0x0 pushl $196 801064a9: 68 c4 00 00 00 push $0xc4 jmp alltraps 801064ae: e9 77 f3 ff ff jmp 8010582a <alltraps> 801064b3 <vector197>: .globl vector197 vector197: pushl $0 801064b3: 6a 00 push $0x0 pushl $197 801064b5: 68 c5 00 00 00 push $0xc5 jmp alltraps 801064ba: e9 6b f3 ff ff jmp 8010582a <alltraps> 801064bf <vector198>: .globl vector198 vector198: pushl $0 801064bf: 6a 00 push $0x0 pushl $198 801064c1: 68 c6 00 00 00 push $0xc6 jmp alltraps 801064c6: e9 5f f3 ff ff jmp 8010582a <alltraps> 801064cb <vector199>: .globl vector199 vector199: pushl $0 801064cb: 6a 00 push $0x0 pushl $199 801064cd: 68 c7 00 00 00 push $0xc7 jmp alltraps 801064d2: e9 53 f3 ff ff jmp 8010582a <alltraps> 801064d7 <vector200>: .globl vector200 vector200: pushl $0 801064d7: 6a 00 push $0x0 pushl $200 801064d9: 68 c8 00 00 00 push $0xc8 jmp alltraps 801064de: e9 47 f3 ff ff jmp 8010582a <alltraps> 801064e3 <vector201>: .globl vector201 vector201: pushl $0 801064e3: 6a 00 push $0x0 pushl $201 801064e5: 68 c9 00 00 00 push $0xc9 jmp alltraps 801064ea: e9 3b f3 ff ff jmp 8010582a <alltraps> 801064ef <vector202>: .globl vector202 vector202: pushl $0 801064ef: 6a 00 push $0x0 pushl $202 801064f1: 68 ca 00 00 00 push $0xca jmp alltraps 801064f6: e9 2f f3 ff ff jmp 8010582a <alltraps> 801064fb <vector203>: .globl vector203 vector203: pushl $0 801064fb: 6a 00 push $0x0 pushl $203 801064fd: 68 cb 00 00 00 push $0xcb jmp alltraps 80106502: e9 23 f3 ff ff jmp 8010582a <alltraps> 80106507 <vector204>: .globl vector204 vector204: pushl $0 80106507: 6a 00 push $0x0 pushl $204 80106509: 68 cc 00 00 00 push $0xcc jmp alltraps 8010650e: e9 17 f3 ff ff jmp 8010582a <alltraps> 80106513 <vector205>: .globl vector205 vector205: pushl $0 80106513: 6a 00 push $0x0 pushl $205 80106515: 68 cd 00 00 00 push $0xcd jmp alltraps 8010651a: e9 0b f3 ff ff jmp 8010582a <alltraps> 8010651f <vector206>: .globl vector206 vector206: pushl $0 8010651f: 6a 00 push $0x0 pushl $206 80106521: 68 ce 00 00 00 push $0xce jmp alltraps 80106526: e9 ff f2 ff ff jmp 8010582a <alltraps> 8010652b <vector207>: .globl vector207 vector207: pushl $0 8010652b: 6a 00 push $0x0 pushl $207 8010652d: 68 cf 00 00 00 push $0xcf jmp alltraps 80106532: e9 f3 f2 ff ff jmp 8010582a <alltraps> 80106537 <vector208>: .globl vector208 vector208: pushl $0 80106537: 6a 00 push $0x0 pushl $208 80106539: 68 d0 00 00 00 push $0xd0 jmp alltraps 8010653e: e9 e7 f2 ff ff jmp 8010582a <alltraps> 80106543 <vector209>: .globl vector209 vector209: pushl $0 80106543: 6a 00 push $0x0 pushl $209 80106545: 68 d1 00 00 00 push $0xd1 jmp alltraps 8010654a: e9 db f2 ff ff jmp 8010582a <alltraps> 8010654f <vector210>: .globl vector210 vector210: pushl $0 8010654f: 6a 00 push $0x0 pushl $210 80106551: 68 d2 00 00 00 push $0xd2 jmp alltraps 80106556: e9 cf f2 ff ff jmp 8010582a <alltraps> 8010655b <vector211>: .globl vector211 vector211: pushl $0 8010655b: 6a 00 push $0x0 pushl $211 8010655d: 68 d3 00 00 00 push $0xd3 jmp alltraps 80106562: e9 c3 f2 ff ff jmp 8010582a <alltraps> 80106567 <vector212>: .globl vector212 vector212: pushl $0 80106567: 6a 00 push $0x0 pushl $212 80106569: 68 d4 00 00 00 push $0xd4 jmp alltraps 8010656e: e9 b7 f2 ff ff jmp 8010582a <alltraps> 80106573 <vector213>: .globl vector213 vector213: pushl $0 80106573: 6a 00 push $0x0 pushl $213 80106575: 68 d5 00 00 00 push $0xd5 jmp alltraps 8010657a: e9 ab f2 ff ff jmp 8010582a <alltraps> 8010657f <vector214>: .globl vector214 vector214: pushl $0 8010657f: 6a 00 push $0x0 pushl $214 80106581: 68 d6 00 00 00 push $0xd6 jmp alltraps 80106586: e9 9f f2 ff ff jmp 8010582a <alltraps> 8010658b <vector215>: .globl vector215 vector215: pushl $0 8010658b: 6a 00 push $0x0 pushl $215 8010658d: 68 d7 00 00 00 push $0xd7 jmp alltraps 80106592: e9 93 f2 ff ff jmp 8010582a <alltraps> 80106597 <vector216>: .globl vector216 vector216: pushl $0 80106597: 6a 00 push $0x0 pushl $216 80106599: 68 d8 00 00 00 push $0xd8 jmp alltraps 8010659e: e9 87 f2 ff ff jmp 8010582a <alltraps> 801065a3 <vector217>: .globl vector217 vector217: pushl $0 801065a3: 6a 00 push $0x0 pushl $217 801065a5: 68 d9 00 00 00 push $0xd9 jmp alltraps 801065aa: e9 7b f2 ff ff jmp 8010582a <alltraps> 801065af <vector218>: .globl vector218 vector218: pushl $0 801065af: 6a 00 push $0x0 pushl $218 801065b1: 68 da 00 00 00 push $0xda jmp alltraps 801065b6: e9 6f f2 ff ff jmp 8010582a <alltraps> 801065bb <vector219>: .globl vector219 vector219: pushl $0 801065bb: 6a 00 push $0x0 pushl $219 801065bd: 68 db 00 00 00 push $0xdb jmp alltraps 801065c2: e9 63 f2 ff ff jmp 8010582a <alltraps> 801065c7 <vector220>: .globl vector220 vector220: pushl $0 801065c7: 6a 00 push $0x0 pushl $220 801065c9: 68 dc 00 00 00 push $0xdc jmp alltraps 801065ce: e9 57 f2 ff ff jmp 8010582a <alltraps> 801065d3 <vector221>: .globl vector221 vector221: pushl $0 801065d3: 6a 00 push $0x0 pushl $221 801065d5: 68 dd 00 00 00 push $0xdd jmp alltraps 801065da: e9 4b f2 ff ff jmp 8010582a <alltraps> 801065df <vector222>: .globl vector222 vector222: pushl $0 801065df: 6a 00 push $0x0 pushl $222 801065e1: 68 de 00 00 00 push $0xde jmp alltraps 801065e6: e9 3f f2 ff ff jmp 8010582a <alltraps> 801065eb <vector223>: .globl vector223 vector223: pushl $0 801065eb: 6a 00 push $0x0 pushl $223 801065ed: 68 df 00 00 00 push $0xdf jmp alltraps 801065f2: e9 33 f2 ff ff jmp 8010582a <alltraps> 801065f7 <vector224>: .globl vector224 vector224: pushl $0 801065f7: 6a 00 push $0x0 pushl $224 801065f9: 68 e0 00 00 00 push $0xe0 jmp alltraps 801065fe: e9 27 f2 ff ff jmp 8010582a <alltraps> 80106603 <vector225>: .globl vector225 vector225: pushl $0 80106603: 6a 00 push $0x0 pushl $225 80106605: 68 e1 00 00 00 push $0xe1 jmp alltraps 8010660a: e9 1b f2 ff ff jmp 8010582a <alltraps> 8010660f <vector226>: .globl vector226 vector226: pushl $0 8010660f: 6a 00 push $0x0 pushl $226 80106611: 68 e2 00 00 00 push $0xe2 jmp alltraps 80106616: e9 0f f2 ff ff jmp 8010582a <alltraps> 8010661b <vector227>: .globl vector227 vector227: pushl $0 8010661b: 6a 00 push $0x0 pushl $227 8010661d: 68 e3 00 00 00 push $0xe3 jmp alltraps 80106622: e9 03 f2 ff ff jmp 8010582a <alltraps> 80106627 <vector228>: .globl vector228 vector228: pushl $0 80106627: 6a 00 push $0x0 pushl $228 80106629: 68 e4 00 00 00 push $0xe4 jmp alltraps 8010662e: e9 f7 f1 ff ff jmp 8010582a <alltraps> 80106633 <vector229>: .globl vector229 vector229: pushl $0 80106633: 6a 00 push $0x0 pushl $229 80106635: 68 e5 00 00 00 push $0xe5 jmp alltraps 8010663a: e9 eb f1 ff ff jmp 8010582a <alltraps> 8010663f <vector230>: .globl vector230 vector230: pushl $0 8010663f: 6a 00 push $0x0 pushl $230 80106641: 68 e6 00 00 00 push $0xe6 jmp alltraps 80106646: e9 df f1 ff ff jmp 8010582a <alltraps> 8010664b <vector231>: .globl vector231 vector231: pushl $0 8010664b: 6a 00 push $0x0 pushl $231 8010664d: 68 e7 00 00 00 push $0xe7 jmp alltraps 80106652: e9 d3 f1 ff ff jmp 8010582a <alltraps> 80106657 <vector232>: .globl vector232 vector232: pushl $0 80106657: 6a 00 push $0x0 pushl $232 80106659: 68 e8 00 00 00 push $0xe8 jmp alltraps 8010665e: e9 c7 f1 ff ff jmp 8010582a <alltraps> 80106663 <vector233>: .globl vector233 vector233: pushl $0 80106663: 6a 00 push $0x0 pushl $233 80106665: 68 e9 00 00 00 push $0xe9 jmp alltraps 8010666a: e9 bb f1 ff ff jmp 8010582a <alltraps> 8010666f <vector234>: .globl vector234 vector234: pushl $0 8010666f: 6a 00 push $0x0 pushl $234 80106671: 68 ea 00 00 00 push $0xea jmp alltraps 80106676: e9 af f1 ff ff jmp 8010582a <alltraps> 8010667b <vector235>: .globl vector235 vector235: pushl $0 8010667b: 6a 00 push $0x0 pushl $235 8010667d: 68 eb 00 00 00 push $0xeb jmp alltraps 80106682: e9 a3 f1 ff ff jmp 8010582a <alltraps> 80106687 <vector236>: .globl vector236 vector236: pushl $0 80106687: 6a 00 push $0x0 pushl $236 80106689: 68 ec 00 00 00 push $0xec jmp alltraps 8010668e: e9 97 f1 ff ff jmp 8010582a <alltraps> 80106693 <vector237>: .globl vector237 vector237: pushl $0 80106693: 6a 00 push $0x0 pushl $237 80106695: 68 ed 00 00 00 push $0xed jmp alltraps 8010669a: e9 8b f1 ff ff jmp 8010582a <alltraps> 8010669f <vector238>: .globl vector238 vector238: pushl $0 8010669f: 6a 00 push $0x0 pushl $238 801066a1: 68 ee 00 00 00 push $0xee jmp alltraps 801066a6: e9 7f f1 ff ff jmp 8010582a <alltraps> 801066ab <vector239>: .globl vector239 vector239: pushl $0 801066ab: 6a 00 push $0x0 pushl $239 801066ad: 68 ef 00 00 00 push $0xef jmp alltraps 801066b2: e9 73 f1 ff ff jmp 8010582a <alltraps> 801066b7 <vector240>: .globl vector240 vector240: pushl $0 801066b7: 6a 00 push $0x0 pushl $240 801066b9: 68 f0 00 00 00 push $0xf0 jmp alltraps 801066be: e9 67 f1 ff ff jmp 8010582a <alltraps> 801066c3 <vector241>: .globl vector241 vector241: pushl $0 801066c3: 6a 00 push $0x0 pushl $241 801066c5: 68 f1 00 00 00 push $0xf1 jmp alltraps 801066ca: e9 5b f1 ff ff jmp 8010582a <alltraps> 801066cf <vector242>: .globl vector242 vector242: pushl $0 801066cf: 6a 00 push $0x0 pushl $242 801066d1: 68 f2 00 00 00 push $0xf2 jmp alltraps 801066d6: e9 4f f1 ff ff jmp 8010582a <alltraps> 801066db <vector243>: .globl vector243 vector243: pushl $0 801066db: 6a 00 push $0x0 pushl $243 801066dd: 68 f3 00 00 00 push $0xf3 jmp alltraps 801066e2: e9 43 f1 ff ff jmp 8010582a <alltraps> 801066e7 <vector244>: .globl vector244 vector244: pushl $0 801066e7: 6a 00 push $0x0 pushl $244 801066e9: 68 f4 00 00 00 push $0xf4 jmp alltraps 801066ee: e9 37 f1 ff ff jmp 8010582a <alltraps> 801066f3 <vector245>: .globl vector245 vector245: pushl $0 801066f3: 6a 00 push $0x0 pushl $245 801066f5: 68 f5 00 00 00 push $0xf5 jmp alltraps 801066fa: e9 2b f1 ff ff jmp 8010582a <alltraps> 801066ff <vector246>: .globl vector246 vector246: pushl $0 801066ff: 6a 00 push $0x0 pushl $246 80106701: 68 f6 00 00 00 push $0xf6 jmp alltraps 80106706: e9 1f f1 ff ff jmp 8010582a <alltraps> 8010670b <vector247>: .globl vector247 vector247: pushl $0 8010670b: 6a 00 push $0x0 pushl $247 8010670d: 68 f7 00 00 00 push $0xf7 jmp alltraps 80106712: e9 13 f1 ff ff jmp 8010582a <alltraps> 80106717 <vector248>: .globl vector248 vector248: pushl $0 80106717: 6a 00 push $0x0 pushl $248 80106719: 68 f8 00 00 00 push $0xf8 jmp alltraps 8010671e: e9 07 f1 ff ff jmp 8010582a <alltraps> 80106723 <vector249>: .globl vector249 vector249: pushl $0 80106723: 6a 00 push $0x0 pushl $249 80106725: 68 f9 00 00 00 push $0xf9 jmp alltraps 8010672a: e9 fb f0 ff ff jmp 8010582a <alltraps> 8010672f <vector250>: .globl vector250 vector250: pushl $0 8010672f: 6a 00 push $0x0 pushl $250 80106731: 68 fa 00 00 00 push $0xfa jmp alltraps 80106736: e9 ef f0 ff ff jmp 8010582a <alltraps> 8010673b <vector251>: .globl vector251 vector251: pushl $0 8010673b: 6a 00 push $0x0 pushl $251 8010673d: 68 fb 00 00 00 push $0xfb jmp alltraps 80106742: e9 e3 f0 ff ff jmp 8010582a <alltraps> 80106747 <vector252>: .globl vector252 vector252: pushl $0 80106747: 6a 00 push $0x0 pushl $252 80106749: 68 fc 00 00 00 push $0xfc jmp alltraps 8010674e: e9 d7 f0 ff ff jmp 8010582a <alltraps> 80106753 <vector253>: .globl vector253 vector253: pushl $0 80106753: 6a 00 push $0x0 pushl $253 80106755: 68 fd 00 00 00 push $0xfd jmp alltraps 8010675a: e9 cb f0 ff ff jmp 8010582a <alltraps> 8010675f <vector254>: .globl vector254 vector254: pushl $0 8010675f: 6a 00 push $0x0 pushl $254 80106761: 68 fe 00 00 00 push $0xfe jmp alltraps 80106766: e9 bf f0 ff ff jmp 8010582a <alltraps> 8010676b <vector255>: .globl vector255 vector255: pushl $0 8010676b: 6a 00 push $0x0 pushl $255 8010676d: 68 ff 00 00 00 push $0xff jmp alltraps 80106772: e9 b3 f0 ff ff jmp 8010582a <alltraps> 80106777: 66 90 xchg %ax,%ax 80106779: 66 90 xchg %ax,%ax 8010677b: 66 90 xchg %ax,%ax 8010677d: 66 90 xchg %ax,%ax 8010677f: 90 nop 80106780 <walkpgdir>: // Return the address of the PTE in page table pgdir // that corresponds to virtual address va. If alloc!=0, // create any required page table pages. static pte_t * walkpgdir(pde_t *pgdir, const void *va, int alloc) { 80106780: 55 push %ebp 80106781: 89 e5 mov %esp,%ebp 80106783: 57 push %edi 80106784: 56 push %esi 80106785: 53 push %ebx pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 80106786: 89 d3 mov %edx,%ebx { 80106788: 89 d7 mov %edx,%edi pde = &pgdir[PDX(va)]; 8010678a: c1 eb 16 shr $0x16,%ebx 8010678d: 8d 34 98 lea (%eax,%ebx,4),%esi { 80106790: 83 ec 0c sub $0xc,%esp if(*pde & PTE_P){ 80106793: 8b 06 mov (%esi),%eax 80106795: a8 01 test $0x1,%al 80106797: 74 27 je 801067c0 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 80106799: 25 00 f0 ff ff and $0xfffff000,%eax 8010679e: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx // The permissions here are overly generous, but they can // be further restricted by the permissions in the page table // entries, if necessary. *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; } return &pgtab[PTX(va)]; 801067a4: c1 ef 0a shr $0xa,%edi } 801067a7: 8d 65 f4 lea -0xc(%ebp),%esp return &pgtab[PTX(va)]; 801067aa: 89 fa mov %edi,%edx 801067ac: 81 e2 fc 0f 00 00 and $0xffc,%edx 801067b2: 8d 04 13 lea (%ebx,%edx,1),%eax } 801067b5: 5b pop %ebx 801067b6: 5e pop %esi 801067b7: 5f pop %edi 801067b8: 5d pop %ebp 801067b9: c3 ret 801067ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 801067c0: 85 c9 test %ecx,%ecx 801067c2: 74 2c je 801067f0 <walkpgdir+0x70> 801067c4: e8 17 be ff ff call 801025e0 <kalloc> 801067c9: 85 c0 test %eax,%eax 801067cb: 89 c3 mov %eax,%ebx 801067cd: 74 21 je 801067f0 <walkpgdir+0x70> memset(pgtab, 0, PGSIZE); 801067cf: 83 ec 04 sub $0x4,%esp 801067d2: 68 00 10 00 00 push $0x1000 801067d7: 6a 00 push $0x0 801067d9: 50 push %eax 801067da: e8 b1 dd ff ff call 80104590 <memset> *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 801067df: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 801067e5: 83 c4 10 add $0x10,%esp 801067e8: 83 c8 07 or $0x7,%eax 801067eb: 89 06 mov %eax,(%esi) 801067ed: eb b5 jmp 801067a4 <walkpgdir+0x24> 801067ef: 90 nop } 801067f0: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 801067f3: 31 c0 xor %eax,%eax } 801067f5: 5b pop %ebx 801067f6: 5e pop %esi 801067f7: 5f pop %edi 801067f8: 5d pop %ebp 801067f9: c3 ret 801067fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106800 <mappages>: // Create PTEs for virtual addresses starting at va that refer to // physical addresses starting at pa. va and size might not // be page-aligned. static int mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm) { 80106800: 55 push %ebp 80106801: 89 e5 mov %esp,%ebp 80106803: 57 push %edi 80106804: 56 push %esi 80106805: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80106806: 89 d3 mov %edx,%ebx 80106808: 81 e3 00 f0 ff ff and $0xfffff000,%ebx { 8010680e: 83 ec 1c sub $0x1c,%esp 80106811: 89 45 e4 mov %eax,-0x1c(%ebp) last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80106814: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80106818: 8b 7d 08 mov 0x8(%ebp),%edi 8010681b: 25 00 f0 ff ff and $0xfffff000,%eax 80106820: 89 45 e0 mov %eax,-0x20(%ebp) for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) panic("remap"); *pte = pa | perm | PTE_P; 80106823: 8b 45 0c mov 0xc(%ebp),%eax 80106826: 29 df sub %ebx,%edi 80106828: 83 c8 01 or $0x1,%eax 8010682b: 89 45 dc mov %eax,-0x24(%ebp) 8010682e: eb 15 jmp 80106845 <mappages+0x45> if(*pte & PTE_P) 80106830: f6 00 01 testb $0x1,(%eax) 80106833: 75 45 jne 8010687a <mappages+0x7a> *pte = pa | perm | PTE_P; 80106835: 0b 75 dc or -0x24(%ebp),%esi if(a == last) 80106838: 3b 5d e0 cmp -0x20(%ebp),%ebx *pte = pa | perm | PTE_P; 8010683b: 89 30 mov %esi,(%eax) if(a == last) 8010683d: 74 31 je 80106870 <mappages+0x70> break; a += PGSIZE; 8010683f: 81 c3 00 10 00 00 add $0x1000,%ebx if((pte = walkpgdir(pgdir, a, 1)) == 0) 80106845: 8b 45 e4 mov -0x1c(%ebp),%eax 80106848: b9 01 00 00 00 mov $0x1,%ecx 8010684d: 89 da mov %ebx,%edx 8010684f: 8d 34 3b lea (%ebx,%edi,1),%esi 80106852: e8 29 ff ff ff call 80106780 <walkpgdir> 80106857: 85 c0 test %eax,%eax 80106859: 75 d5 jne 80106830 <mappages+0x30> pa += PGSIZE; } return 0; } 8010685b: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010685e: b8 ff ff ff ff mov $0xffffffff,%eax } 80106863: 5b pop %ebx 80106864: 5e pop %esi 80106865: 5f pop %edi 80106866: 5d pop %ebp 80106867: c3 ret 80106868: 90 nop 80106869: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106870: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106873: 31 c0 xor %eax,%eax } 80106875: 5b pop %ebx 80106876: 5e pop %esi 80106877: 5f pop %edi 80106878: 5d pop %ebp 80106879: c3 ret panic("remap"); 8010687a: 83 ec 0c sub $0xc,%esp 8010687d: 68 b0 79 10 80 push $0x801079b0 80106882: e8 09 9b ff ff call 80100390 <panic> 80106887: 89 f6 mov %esi,%esi 80106889: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106890 <deallocuvm.part.0>: // Deallocate user pages to bring the process size from oldsz to // newsz. oldsz and newsz need not be page-aligned, nor does newsz // need to be less than oldsz. oldsz can be larger than the actual // process size. Returns the new process size. int deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 80106890: 55 push %ebp 80106891: 89 e5 mov %esp,%ebp 80106893: 57 push %edi 80106894: 56 push %esi 80106895: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 80106896: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 8010689c: 89 c7 mov %eax,%edi a = PGROUNDUP(newsz); 8010689e: 81 e3 00 f0 ff ff and $0xfffff000,%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801068a4: 83 ec 1c sub $0x1c,%esp 801068a7: 89 4d e0 mov %ecx,-0x20(%ebp) for(; a < oldsz; a += PGSIZE){ 801068aa: 39 d3 cmp %edx,%ebx 801068ac: 73 66 jae 80106914 <deallocuvm.part.0+0x84> 801068ae: 89 d6 mov %edx,%esi 801068b0: eb 3d jmp 801068ef <deallocuvm.part.0+0x5f> 801068b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pte = walkpgdir(pgdir, (char*)a, 0); if(!pte) a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; else if((*pte & PTE_P) != 0){ 801068b8: 8b 10 mov (%eax),%edx 801068ba: f6 c2 01 test $0x1,%dl 801068bd: 74 26 je 801068e5 <deallocuvm.part.0+0x55> pa = PTE_ADDR(*pte); if(pa == 0) 801068bf: 81 e2 00 f0 ff ff and $0xfffff000,%edx 801068c5: 74 58 je 8010691f <deallocuvm.part.0+0x8f> panic("kfree"); char *v = P2V(pa); kfree(v); 801068c7: 83 ec 0c sub $0xc,%esp char *v = P2V(pa); 801068ca: 81 c2 00 00 00 80 add $0x80000000,%edx 801068d0: 89 45 e4 mov %eax,-0x1c(%ebp) kfree(v); 801068d3: 52 push %edx 801068d4: e8 57 bb ff ff call 80102430 <kfree> *pte = 0; 801068d9: 8b 45 e4 mov -0x1c(%ebp),%eax 801068dc: 83 c4 10 add $0x10,%esp 801068df: c7 00 00 00 00 00 movl $0x0,(%eax) for(; a < oldsz; a += PGSIZE){ 801068e5: 81 c3 00 10 00 00 add $0x1000,%ebx 801068eb: 39 f3 cmp %esi,%ebx 801068ed: 73 25 jae 80106914 <deallocuvm.part.0+0x84> pte = walkpgdir(pgdir, (char*)a, 0); 801068ef: 31 c9 xor %ecx,%ecx 801068f1: 89 da mov %ebx,%edx 801068f3: 89 f8 mov %edi,%eax 801068f5: e8 86 fe ff ff call 80106780 <walkpgdir> if(!pte) 801068fa: 85 c0 test %eax,%eax 801068fc: 75 ba jne 801068b8 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 801068fe: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106904: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx for(; a < oldsz; a += PGSIZE){ 8010690a: 81 c3 00 10 00 00 add $0x1000,%ebx 80106910: 39 f3 cmp %esi,%ebx 80106912: 72 db jb 801068ef <deallocuvm.part.0+0x5f> } } return newsz; } 80106914: 8b 45 e0 mov -0x20(%ebp),%eax 80106917: 8d 65 f4 lea -0xc(%ebp),%esp 8010691a: 5b pop %ebx 8010691b: 5e pop %esi 8010691c: 5f pop %edi 8010691d: 5d pop %ebp 8010691e: c3 ret panic("kfree"); 8010691f: 83 ec 0c sub $0xc,%esp 80106922: 68 42 73 10 80 push $0x80107342 80106927: e8 64 9a ff ff call 80100390 <panic> 8010692c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106930 <seginit>: { 80106930: 55 push %ebp 80106931: 89 e5 mov %esp,%ebp 80106933: 83 ec 18 sub $0x18,%esp c = &cpus[cpuid()]; 80106936: e8 a5 cf ff ff call 801038e0 <cpuid> 8010693b: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax pd[0] = size-1; 80106941: ba 2f 00 00 00 mov $0x2f,%edx 80106946: 66 89 55 f2 mov %dx,-0xe(%ebp) c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 8010694a: c7 80 f8 27 11 80 ff movl $0xffff,-0x7feed808(%eax) 80106951: ff 00 00 80106954: c7 80 fc 27 11 80 00 movl $0xcf9a00,-0x7feed804(%eax) 8010695b: 9a cf 00 c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 8010695e: c7 80 00 28 11 80 ff movl $0xffff,-0x7feed800(%eax) 80106965: ff 00 00 80106968: c7 80 04 28 11 80 00 movl $0xcf9200,-0x7feed7fc(%eax) 8010696f: 92 cf 00 c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80106972: c7 80 08 28 11 80 ff movl $0xffff,-0x7feed7f8(%eax) 80106979: ff 00 00 8010697c: c7 80 0c 28 11 80 00 movl $0xcffa00,-0x7feed7f4(%eax) 80106983: fa cf 00 c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 80106986: c7 80 10 28 11 80 ff movl $0xffff,-0x7feed7f0(%eax) 8010698d: ff 00 00 80106990: c7 80 14 28 11 80 00 movl $0xcff200,-0x7feed7ec(%eax) 80106997: f2 cf 00 lgdt(c->gdt, sizeof(c->gdt)); 8010699a: 05 f0 27 11 80 add $0x801127f0,%eax pd[1] = (uint)p; 8010699f: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 801069a3: c1 e8 10 shr $0x10,%eax 801069a6: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 801069aa: 8d 45 f2 lea -0xe(%ebp),%eax 801069ad: 0f 01 10 lgdtl (%eax) } 801069b0: c9 leave 801069b1: c3 ret 801069b2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801069b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801069c0 <switchkvm>: lcr3(V2P(kpgdir)); // switch to the kernel page table 801069c0: a1 a4 54 11 80 mov 0x801154a4,%eax { 801069c5: 55 push %ebp 801069c6: 89 e5 mov %esp,%ebp lcr3(V2P(kpgdir)); // switch to the kernel page table 801069c8: 05 00 00 00 80 add $0x80000000,%eax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 801069cd: 0f 22 d8 mov %eax,%cr3 } 801069d0: 5d pop %ebp 801069d1: c3 ret 801069d2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801069d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801069e0 <switchuvm>: { 801069e0: 55 push %ebp 801069e1: 89 e5 mov %esp,%ebp 801069e3: 57 push %edi 801069e4: 56 push %esi 801069e5: 53 push %ebx 801069e6: 83 ec 1c sub $0x1c,%esp 801069e9: 8b 5d 08 mov 0x8(%ebp),%ebx if(p == 0) 801069ec: 85 db test %ebx,%ebx 801069ee: 0f 84 cb 00 00 00 je 80106abf <switchuvm+0xdf> if(p->kstack == 0) 801069f4: 8b 43 08 mov 0x8(%ebx),%eax 801069f7: 85 c0 test %eax,%eax 801069f9: 0f 84 da 00 00 00 je 80106ad9 <switchuvm+0xf9> if(p->pgdir == 0) 801069ff: 8b 43 04 mov 0x4(%ebx),%eax 80106a02: 85 c0 test %eax,%eax 80106a04: 0f 84 c2 00 00 00 je 80106acc <switchuvm+0xec> pushcli(); 80106a0a: e8 a1 d9 ff ff call 801043b0 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 80106a0f: e8 4c ce ff ff call 80103860 <mycpu> 80106a14: 89 c6 mov %eax,%esi 80106a16: e8 45 ce ff ff call 80103860 <mycpu> 80106a1b: 89 c7 mov %eax,%edi 80106a1d: e8 3e ce ff ff call 80103860 <mycpu> 80106a22: 89 45 e4 mov %eax,-0x1c(%ebp) 80106a25: 83 c7 08 add $0x8,%edi 80106a28: e8 33 ce ff ff call 80103860 <mycpu> 80106a2d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106a30: 83 c0 08 add $0x8,%eax 80106a33: ba 67 00 00 00 mov $0x67,%edx 80106a38: c1 e8 18 shr $0x18,%eax 80106a3b: 66 89 96 98 00 00 00 mov %dx,0x98(%esi) 80106a42: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi) 80106a49: 88 86 9f 00 00 00 mov %al,0x9f(%esi) mycpu()->ts.iomb = (ushort) 0xFFFF; 80106a4f: bf ff ff ff ff mov $0xffffffff,%edi mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 80106a54: 83 c1 08 add $0x8,%ecx 80106a57: c1 e9 10 shr $0x10,%ecx 80106a5a: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi) 80106a60: b9 99 40 00 00 mov $0x4099,%ecx 80106a65: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi) mycpu()->ts.ss0 = SEG_KDATA << 3; 80106a6c: be 10 00 00 00 mov $0x10,%esi mycpu()->gdt[SEG_TSS].s = 0; 80106a71: e8 ea cd ff ff call 80103860 <mycpu> 80106a76: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 80106a7d: e8 de cd ff ff call 80103860 <mycpu> 80106a82: 66 89 70 10 mov %si,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 80106a86: 8b 73 08 mov 0x8(%ebx),%esi 80106a89: e8 d2 cd ff ff call 80103860 <mycpu> 80106a8e: 81 c6 00 10 00 00 add $0x1000,%esi 80106a94: 89 70 0c mov %esi,0xc(%eax) mycpu()->ts.iomb = (ushort) 0xFFFF; 80106a97: e8 c4 cd ff ff call 80103860 <mycpu> 80106a9c: 66 89 78 6e mov %di,0x6e(%eax) asm volatile("ltr %0" : : "r" (sel)); 80106aa0: b8 28 00 00 00 mov $0x28,%eax 80106aa5: 0f 00 d8 ltr %ax lcr3(V2P(p->pgdir)); // switch to process's address space 80106aa8: 8b 43 04 mov 0x4(%ebx),%eax 80106aab: 05 00 00 00 80 add $0x80000000,%eax asm volatile("movl %0,%%cr3" : : "r" (val)); 80106ab0: 0f 22 d8 mov %eax,%cr3 } 80106ab3: 8d 65 f4 lea -0xc(%ebp),%esp 80106ab6: 5b pop %ebx 80106ab7: 5e pop %esi 80106ab8: 5f pop %edi 80106ab9: 5d pop %ebp popcli(); 80106aba: e9 31 d9 ff ff jmp 801043f0 <popcli> panic("switchuvm: no process"); 80106abf: 83 ec 0c sub $0xc,%esp 80106ac2: 68 b6 79 10 80 push $0x801079b6 80106ac7: e8 c4 98 ff ff call 80100390 <panic> panic("switchuvm: no pgdir"); 80106acc: 83 ec 0c sub $0xc,%esp 80106acf: 68 e1 79 10 80 push $0x801079e1 80106ad4: e8 b7 98 ff ff call 80100390 <panic> panic("switchuvm: no kstack"); 80106ad9: 83 ec 0c sub $0xc,%esp 80106adc: 68 cc 79 10 80 push $0x801079cc 80106ae1: e8 aa 98 ff ff call 80100390 <panic> 80106ae6: 8d 76 00 lea 0x0(%esi),%esi 80106ae9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106af0 <inituvm>: { 80106af0: 55 push %ebp 80106af1: 89 e5 mov %esp,%ebp 80106af3: 57 push %edi 80106af4: 56 push %esi 80106af5: 53 push %ebx 80106af6: 83 ec 1c sub $0x1c,%esp 80106af9: 8b 75 10 mov 0x10(%ebp),%esi 80106afc: 8b 45 08 mov 0x8(%ebp),%eax 80106aff: 8b 7d 0c mov 0xc(%ebp),%edi if(sz >= PGSIZE) 80106b02: 81 fe ff 0f 00 00 cmp $0xfff,%esi { 80106b08: 89 45 e4 mov %eax,-0x1c(%ebp) if(sz >= PGSIZE) 80106b0b: 77 49 ja 80106b56 <inituvm+0x66> mem = kalloc(); 80106b0d: e8 ce ba ff ff call 801025e0 <kalloc> memset(mem, 0, PGSIZE); 80106b12: 83 ec 04 sub $0x4,%esp mem = kalloc(); 80106b15: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 80106b17: 68 00 10 00 00 push $0x1000 80106b1c: 6a 00 push $0x0 80106b1e: 50 push %eax 80106b1f: e8 6c da ff ff call 80104590 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 80106b24: 58 pop %eax 80106b25: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106b2b: b9 00 10 00 00 mov $0x1000,%ecx 80106b30: 5a pop %edx 80106b31: 6a 06 push $0x6 80106b33: 50 push %eax 80106b34: 31 d2 xor %edx,%edx 80106b36: 8b 45 e4 mov -0x1c(%ebp),%eax 80106b39: e8 c2 fc ff ff call 80106800 <mappages> memmove(mem, init, sz); 80106b3e: 89 75 10 mov %esi,0x10(%ebp) 80106b41: 89 7d 0c mov %edi,0xc(%ebp) 80106b44: 83 c4 10 add $0x10,%esp 80106b47: 89 5d 08 mov %ebx,0x8(%ebp) } 80106b4a: 8d 65 f4 lea -0xc(%ebp),%esp 80106b4d: 5b pop %ebx 80106b4e: 5e pop %esi 80106b4f: 5f pop %edi 80106b50: 5d pop %ebp memmove(mem, init, sz); 80106b51: e9 ea da ff ff jmp 80104640 <memmove> panic("inituvm: more than a page"); 80106b56: 83 ec 0c sub $0xc,%esp 80106b59: 68 f5 79 10 80 push $0x801079f5 80106b5e: e8 2d 98 ff ff call 80100390 <panic> 80106b63: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106b69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106b70 <loaduvm>: { 80106b70: 55 push %ebp 80106b71: 89 e5 mov %esp,%ebp 80106b73: 57 push %edi 80106b74: 56 push %esi 80106b75: 53 push %ebx 80106b76: 83 ec 0c sub $0xc,%esp if((uint) addr % PGSIZE != 0) 80106b79: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80106b80: 0f 85 91 00 00 00 jne 80106c17 <loaduvm+0xa7> for(i = 0; i < sz; i += PGSIZE){ 80106b86: 8b 75 18 mov 0x18(%ebp),%esi 80106b89: 31 db xor %ebx,%ebx 80106b8b: 85 f6 test %esi,%esi 80106b8d: 75 1a jne 80106ba9 <loaduvm+0x39> 80106b8f: eb 6f jmp 80106c00 <loaduvm+0x90> 80106b91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106b98: 81 c3 00 10 00 00 add $0x1000,%ebx 80106b9e: 81 ee 00 10 00 00 sub $0x1000,%esi 80106ba4: 39 5d 18 cmp %ebx,0x18(%ebp) 80106ba7: 76 57 jbe 80106c00 <loaduvm+0x90> if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 80106ba9: 8b 55 0c mov 0xc(%ebp),%edx 80106bac: 8b 45 08 mov 0x8(%ebp),%eax 80106baf: 31 c9 xor %ecx,%ecx 80106bb1: 01 da add %ebx,%edx 80106bb3: e8 c8 fb ff ff call 80106780 <walkpgdir> 80106bb8: 85 c0 test %eax,%eax 80106bba: 74 4e je 80106c0a <loaduvm+0x9a> pa = PTE_ADDR(*pte); 80106bbc: 8b 00 mov (%eax),%eax if(readi(ip, P2V(pa), offset+i, n) != n) 80106bbe: 8b 4d 14 mov 0x14(%ebp),%ecx if(sz - i < PGSIZE) 80106bc1: bf 00 10 00 00 mov $0x1000,%edi pa = PTE_ADDR(*pte); 80106bc6: 25 00 f0 ff ff and $0xfffff000,%eax if(sz - i < PGSIZE) 80106bcb: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80106bd1: 0f 46 fe cmovbe %esi,%edi if(readi(ip, P2V(pa), offset+i, n) != n) 80106bd4: 01 d9 add %ebx,%ecx 80106bd6: 05 00 00 00 80 add $0x80000000,%eax 80106bdb: 57 push %edi 80106bdc: 51 push %ecx 80106bdd: 50 push %eax 80106bde: ff 75 10 pushl 0x10(%ebp) 80106be1: e8 8a ad ff ff call 80101970 <readi> 80106be6: 83 c4 10 add $0x10,%esp 80106be9: 39 f8 cmp %edi,%eax 80106beb: 74 ab je 80106b98 <loaduvm+0x28> } 80106bed: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80106bf0: b8 ff ff ff ff mov $0xffffffff,%eax } 80106bf5: 5b pop %ebx 80106bf6: 5e pop %esi 80106bf7: 5f pop %edi 80106bf8: 5d pop %ebp 80106bf9: c3 ret 80106bfa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106c00: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106c03: 31 c0 xor %eax,%eax } 80106c05: 5b pop %ebx 80106c06: 5e pop %esi 80106c07: 5f pop %edi 80106c08: 5d pop %ebp 80106c09: c3 ret panic("loaduvm: address should exist"); 80106c0a: 83 ec 0c sub $0xc,%esp 80106c0d: 68 0f 7a 10 80 push $0x80107a0f 80106c12: e8 79 97 ff ff call 80100390 <panic> panic("loaduvm: addr must be page aligned"); 80106c17: 83 ec 0c sub $0xc,%esp 80106c1a: 68 b0 7a 10 80 push $0x80107ab0 80106c1f: e8 6c 97 ff ff call 80100390 <panic> 80106c24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106c2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106c30 <allocuvm>: { 80106c30: 55 push %ebp 80106c31: 89 e5 mov %esp,%ebp 80106c33: 57 push %edi 80106c34: 56 push %esi 80106c35: 53 push %ebx 80106c36: 83 ec 1c sub $0x1c,%esp if(newsz >= KERNBASE) 80106c39: 8b 7d 10 mov 0x10(%ebp),%edi 80106c3c: 85 ff test %edi,%edi 80106c3e: 0f 88 8e 00 00 00 js 80106cd2 <allocuvm+0xa2> if(newsz < oldsz) 80106c44: 3b 7d 0c cmp 0xc(%ebp),%edi 80106c47: 0f 82 93 00 00 00 jb 80106ce0 <allocuvm+0xb0> a = PGROUNDUP(oldsz); 80106c4d: 8b 45 0c mov 0xc(%ebp),%eax 80106c50: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80106c56: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 80106c5c: 39 5d 10 cmp %ebx,0x10(%ebp) 80106c5f: 0f 86 7e 00 00 00 jbe 80106ce3 <allocuvm+0xb3> 80106c65: 89 7d e4 mov %edi,-0x1c(%ebp) 80106c68: 8b 7d 08 mov 0x8(%ebp),%edi 80106c6b: eb 42 jmp 80106caf <allocuvm+0x7f> 80106c6d: 8d 76 00 lea 0x0(%esi),%esi memset(mem, 0, PGSIZE); 80106c70: 83 ec 04 sub $0x4,%esp 80106c73: 68 00 10 00 00 push $0x1000 80106c78: 6a 00 push $0x0 80106c7a: 50 push %eax 80106c7b: e8 10 d9 ff ff call 80104590 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 80106c80: 58 pop %eax 80106c81: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106c87: b9 00 10 00 00 mov $0x1000,%ecx 80106c8c: 5a pop %edx 80106c8d: 6a 06 push $0x6 80106c8f: 50 push %eax 80106c90: 89 da mov %ebx,%edx 80106c92: 89 f8 mov %edi,%eax 80106c94: e8 67 fb ff ff call 80106800 <mappages> 80106c99: 83 c4 10 add $0x10,%esp 80106c9c: 85 c0 test %eax,%eax 80106c9e: 78 50 js 80106cf0 <allocuvm+0xc0> for(; a < newsz; a += PGSIZE){ 80106ca0: 81 c3 00 10 00 00 add $0x1000,%ebx 80106ca6: 39 5d 10 cmp %ebx,0x10(%ebp) 80106ca9: 0f 86 81 00 00 00 jbe 80106d30 <allocuvm+0x100> mem = kalloc(); 80106caf: e8 2c b9 ff ff call 801025e0 <kalloc> if(mem == 0){ 80106cb4: 85 c0 test %eax,%eax mem = kalloc(); 80106cb6: 89 c6 mov %eax,%esi if(mem == 0){ 80106cb8: 75 b6 jne 80106c70 <allocuvm+0x40> cprintf("allocuvm out of memory\n"); 80106cba: 83 ec 0c sub $0xc,%esp 80106cbd: 68 2d 7a 10 80 push $0x80107a2d 80106cc2: e8 99 99 ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80106cc7: 83 c4 10 add $0x10,%esp 80106cca: 8b 45 0c mov 0xc(%ebp),%eax 80106ccd: 39 45 10 cmp %eax,0x10(%ebp) 80106cd0: 77 6e ja 80106d40 <allocuvm+0x110> } 80106cd2: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106cd5: 31 ff xor %edi,%edi } 80106cd7: 89 f8 mov %edi,%eax 80106cd9: 5b pop %ebx 80106cda: 5e pop %esi 80106cdb: 5f pop %edi 80106cdc: 5d pop %ebp 80106cdd: c3 ret 80106cde: 66 90 xchg %ax,%ax return oldsz; 80106ce0: 8b 7d 0c mov 0xc(%ebp),%edi } 80106ce3: 8d 65 f4 lea -0xc(%ebp),%esp 80106ce6: 89 f8 mov %edi,%eax 80106ce8: 5b pop %ebx 80106ce9: 5e pop %esi 80106cea: 5f pop %edi 80106ceb: 5d pop %ebp 80106cec: c3 ret 80106ced: 8d 76 00 lea 0x0(%esi),%esi cprintf("allocuvm out of memory (2)\n"); 80106cf0: 83 ec 0c sub $0xc,%esp 80106cf3: 68 45 7a 10 80 push $0x80107a45 80106cf8: e8 63 99 ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80106cfd: 83 c4 10 add $0x10,%esp 80106d00: 8b 45 0c mov 0xc(%ebp),%eax 80106d03: 39 45 10 cmp %eax,0x10(%ebp) 80106d06: 76 0d jbe 80106d15 <allocuvm+0xe5> 80106d08: 89 c1 mov %eax,%ecx 80106d0a: 8b 55 10 mov 0x10(%ebp),%edx 80106d0d: 8b 45 08 mov 0x8(%ebp),%eax 80106d10: e8 7b fb ff ff call 80106890 <deallocuvm.part.0> kfree(mem); 80106d15: 83 ec 0c sub $0xc,%esp return 0; 80106d18: 31 ff xor %edi,%edi kfree(mem); 80106d1a: 56 push %esi 80106d1b: e8 10 b7 ff ff call 80102430 <kfree> return 0; 80106d20: 83 c4 10 add $0x10,%esp } 80106d23: 8d 65 f4 lea -0xc(%ebp),%esp 80106d26: 89 f8 mov %edi,%eax 80106d28: 5b pop %ebx 80106d29: 5e pop %esi 80106d2a: 5f pop %edi 80106d2b: 5d pop %ebp 80106d2c: c3 ret 80106d2d: 8d 76 00 lea 0x0(%esi),%esi 80106d30: 8b 7d e4 mov -0x1c(%ebp),%edi 80106d33: 8d 65 f4 lea -0xc(%ebp),%esp 80106d36: 5b pop %ebx 80106d37: 89 f8 mov %edi,%eax 80106d39: 5e pop %esi 80106d3a: 5f pop %edi 80106d3b: 5d pop %ebp 80106d3c: c3 ret 80106d3d: 8d 76 00 lea 0x0(%esi),%esi 80106d40: 89 c1 mov %eax,%ecx 80106d42: 8b 55 10 mov 0x10(%ebp),%edx 80106d45: 8b 45 08 mov 0x8(%ebp),%eax return 0; 80106d48: 31 ff xor %edi,%edi 80106d4a: e8 41 fb ff ff call 80106890 <deallocuvm.part.0> 80106d4f: eb 92 jmp 80106ce3 <allocuvm+0xb3> 80106d51: eb 0d jmp 80106d60 <deallocuvm> 80106d53: 90 nop 80106d54: 90 nop 80106d55: 90 nop 80106d56: 90 nop 80106d57: 90 nop 80106d58: 90 nop 80106d59: 90 nop 80106d5a: 90 nop 80106d5b: 90 nop 80106d5c: 90 nop 80106d5d: 90 nop 80106d5e: 90 nop 80106d5f: 90 nop 80106d60 <deallocuvm>: { 80106d60: 55 push %ebp 80106d61: 89 e5 mov %esp,%ebp 80106d63: 8b 55 0c mov 0xc(%ebp),%edx 80106d66: 8b 4d 10 mov 0x10(%ebp),%ecx 80106d69: 8b 45 08 mov 0x8(%ebp),%eax if(newsz >= oldsz) 80106d6c: 39 d1 cmp %edx,%ecx 80106d6e: 73 10 jae 80106d80 <deallocuvm+0x20> } 80106d70: 5d pop %ebp 80106d71: e9 1a fb ff ff jmp 80106890 <deallocuvm.part.0> 80106d76: 8d 76 00 lea 0x0(%esi),%esi 80106d79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106d80: 89 d0 mov %edx,%eax 80106d82: 5d pop %ebp 80106d83: c3 ret 80106d84: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106d8a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106d90 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80106d90: 55 push %ebp 80106d91: 89 e5 mov %esp,%ebp 80106d93: 57 push %edi 80106d94: 56 push %esi 80106d95: 53 push %ebx 80106d96: 83 ec 0c sub $0xc,%esp 80106d99: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 80106d9c: 85 f6 test %esi,%esi 80106d9e: 74 59 je 80106df9 <freevm+0x69> 80106da0: 31 c9 xor %ecx,%ecx 80106da2: ba 00 00 00 80 mov $0x80000000,%edx 80106da7: 89 f0 mov %esi,%eax 80106da9: e8 e2 fa ff ff call 80106890 <deallocuvm.part.0> 80106dae: 89 f3 mov %esi,%ebx 80106db0: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80106db6: eb 0f jmp 80106dc7 <freevm+0x37> 80106db8: 90 nop 80106db9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106dc0: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 80106dc3: 39 fb cmp %edi,%ebx 80106dc5: 74 23 je 80106dea <freevm+0x5a> if(pgdir[i] & PTE_P){ 80106dc7: 8b 03 mov (%ebx),%eax 80106dc9: a8 01 test $0x1,%al 80106dcb: 74 f3 je 80106dc0 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); 80106dcd: 25 00 f0 ff ff and $0xfffff000,%eax kfree(v); 80106dd2: 83 ec 0c sub $0xc,%esp 80106dd5: 83 c3 04 add $0x4,%ebx char * v = P2V(PTE_ADDR(pgdir[i])); 80106dd8: 05 00 00 00 80 add $0x80000000,%eax kfree(v); 80106ddd: 50 push %eax 80106dde: e8 4d b6 ff ff call 80102430 <kfree> 80106de3: 83 c4 10 add $0x10,%esp for(i = 0; i < NPDENTRIES; i++){ 80106de6: 39 fb cmp %edi,%ebx 80106de8: 75 dd jne 80106dc7 <freevm+0x37> } } kfree((char*)pgdir); 80106dea: 89 75 08 mov %esi,0x8(%ebp) } 80106ded: 8d 65 f4 lea -0xc(%ebp),%esp 80106df0: 5b pop %ebx 80106df1: 5e pop %esi 80106df2: 5f pop %edi 80106df3: 5d pop %ebp kfree((char*)pgdir); 80106df4: e9 37 b6 ff ff jmp 80102430 <kfree> panic("freevm: no pgdir"); 80106df9: 83 ec 0c sub $0xc,%esp 80106dfc: 68 61 7a 10 80 push $0x80107a61 80106e01: e8 8a 95 ff ff call 80100390 <panic> 80106e06: 8d 76 00 lea 0x0(%esi),%esi 80106e09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106e10 <setupkvm>: { 80106e10: 55 push %ebp 80106e11: 89 e5 mov %esp,%ebp 80106e13: 56 push %esi 80106e14: 53 push %ebx if((pgdir = (pde_t*)kalloc()) == 0) 80106e15: e8 c6 b7 ff ff call 801025e0 <kalloc> 80106e1a: 85 c0 test %eax,%eax 80106e1c: 89 c6 mov %eax,%esi 80106e1e: 74 42 je 80106e62 <setupkvm+0x52> memset(pgdir, 0, PGSIZE); 80106e20: 83 ec 04 sub $0x4,%esp for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106e23: bb 20 a4 10 80 mov $0x8010a420,%ebx memset(pgdir, 0, PGSIZE); 80106e28: 68 00 10 00 00 push $0x1000 80106e2d: 6a 00 push $0x0 80106e2f: 50 push %eax 80106e30: e8 5b d7 ff ff call 80104590 <memset> 80106e35: 83 c4 10 add $0x10,%esp (uint)k->phys_start, k->perm) < 0) { 80106e38: 8b 43 04 mov 0x4(%ebx),%eax if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80106e3b: 8b 4b 08 mov 0x8(%ebx),%ecx 80106e3e: 83 ec 08 sub $0x8,%esp 80106e41: 8b 13 mov (%ebx),%edx 80106e43: ff 73 0c pushl 0xc(%ebx) 80106e46: 50 push %eax 80106e47: 29 c1 sub %eax,%ecx 80106e49: 89 f0 mov %esi,%eax 80106e4b: e8 b0 f9 ff ff call 80106800 <mappages> 80106e50: 83 c4 10 add $0x10,%esp 80106e53: 85 c0 test %eax,%eax 80106e55: 78 19 js 80106e70 <setupkvm+0x60> for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106e57: 83 c3 10 add $0x10,%ebx 80106e5a: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx 80106e60: 75 d6 jne 80106e38 <setupkvm+0x28> } 80106e62: 8d 65 f8 lea -0x8(%ebp),%esp 80106e65: 89 f0 mov %esi,%eax 80106e67: 5b pop %ebx 80106e68: 5e pop %esi 80106e69: 5d pop %ebp 80106e6a: c3 ret 80106e6b: 90 nop 80106e6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi freevm(pgdir); 80106e70: 83 ec 0c sub $0xc,%esp 80106e73: 56 push %esi return 0; 80106e74: 31 f6 xor %esi,%esi freevm(pgdir); 80106e76: e8 15 ff ff ff call 80106d90 <freevm> return 0; 80106e7b: 83 c4 10 add $0x10,%esp } 80106e7e: 8d 65 f8 lea -0x8(%ebp),%esp 80106e81: 89 f0 mov %esi,%eax 80106e83: 5b pop %ebx 80106e84: 5e pop %esi 80106e85: 5d pop %ebp 80106e86: c3 ret 80106e87: 89 f6 mov %esi,%esi 80106e89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106e90 <kvmalloc>: { 80106e90: 55 push %ebp 80106e91: 89 e5 mov %esp,%ebp 80106e93: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80106e96: e8 75 ff ff ff call 80106e10 <setupkvm> 80106e9b: a3 a4 54 11 80 mov %eax,0x801154a4 lcr3(V2P(kpgdir)); // switch to the kernel page table 80106ea0: 05 00 00 00 80 add $0x80000000,%eax 80106ea5: 0f 22 d8 mov %eax,%cr3 } 80106ea8: c9 leave 80106ea9: c3 ret 80106eaa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106eb0 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80106eb0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106eb1: 31 c9 xor %ecx,%ecx { 80106eb3: 89 e5 mov %esp,%ebp 80106eb5: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80106eb8: 8b 55 0c mov 0xc(%ebp),%edx 80106ebb: 8b 45 08 mov 0x8(%ebp),%eax 80106ebe: e8 bd f8 ff ff call 80106780 <walkpgdir> if(pte == 0) 80106ec3: 85 c0 test %eax,%eax 80106ec5: 74 05 je 80106ecc <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 80106ec7: 83 20 fb andl $0xfffffffb,(%eax) } 80106eca: c9 leave 80106ecb: c3 ret panic("clearpteu"); 80106ecc: 83 ec 0c sub $0xc,%esp 80106ecf: 68 72 7a 10 80 push $0x80107a72 80106ed4: e8 b7 94 ff ff call 80100390 <panic> 80106ed9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106ee0 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 80106ee0: 55 push %ebp 80106ee1: 89 e5 mov %esp,%ebp 80106ee3: 57 push %edi 80106ee4: 56 push %esi 80106ee5: 53 push %ebx 80106ee6: 83 ec 1c sub $0x1c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 80106ee9: e8 22 ff ff ff call 80106e10 <setupkvm> 80106eee: 85 c0 test %eax,%eax 80106ef0: 89 45 e0 mov %eax,-0x20(%ebp) 80106ef3: 0f 84 9f 00 00 00 je 80106f98 <copyuvm+0xb8> return 0; for(i = 0; i < sz; i += PGSIZE){ 80106ef9: 8b 4d 0c mov 0xc(%ebp),%ecx 80106efc: 85 c9 test %ecx,%ecx 80106efe: 0f 84 94 00 00 00 je 80106f98 <copyuvm+0xb8> 80106f04: 31 ff xor %edi,%edi 80106f06: eb 4a jmp 80106f52 <copyuvm+0x72> 80106f08: 90 nop 80106f09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi panic("copyuvm: page not present"); pa = PTE_ADDR(*pte); flags = PTE_FLAGS(*pte); if((mem = kalloc()) == 0) goto bad; memmove(mem, (char*)P2V(pa), PGSIZE); 80106f10: 83 ec 04 sub $0x4,%esp 80106f13: 81 c3 00 00 00 80 add $0x80000000,%ebx 80106f19: 68 00 10 00 00 push $0x1000 80106f1e: 53 push %ebx 80106f1f: 50 push %eax 80106f20: e8 1b d7 ff ff call 80104640 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) { 80106f25: 58 pop %eax 80106f26: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106f2c: b9 00 10 00 00 mov $0x1000,%ecx 80106f31: 5a pop %edx 80106f32: ff 75 e4 pushl -0x1c(%ebp) 80106f35: 50 push %eax 80106f36: 89 fa mov %edi,%edx 80106f38: 8b 45 e0 mov -0x20(%ebp),%eax 80106f3b: e8 c0 f8 ff ff call 80106800 <mappages> 80106f40: 83 c4 10 add $0x10,%esp 80106f43: 85 c0 test %eax,%eax 80106f45: 78 61 js 80106fa8 <copyuvm+0xc8> for(i = 0; i < sz; i += PGSIZE){ 80106f47: 81 c7 00 10 00 00 add $0x1000,%edi 80106f4d: 39 7d 0c cmp %edi,0xc(%ebp) 80106f50: 76 46 jbe 80106f98 <copyuvm+0xb8> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 80106f52: 8b 45 08 mov 0x8(%ebp),%eax 80106f55: 31 c9 xor %ecx,%ecx 80106f57: 89 fa mov %edi,%edx 80106f59: e8 22 f8 ff ff call 80106780 <walkpgdir> 80106f5e: 85 c0 test %eax,%eax 80106f60: 74 61 je 80106fc3 <copyuvm+0xe3> if(!(*pte & PTE_P)) 80106f62: 8b 00 mov (%eax),%eax 80106f64: a8 01 test $0x1,%al 80106f66: 74 4e je 80106fb6 <copyuvm+0xd6> pa = PTE_ADDR(*pte); 80106f68: 89 c3 mov %eax,%ebx flags = PTE_FLAGS(*pte); 80106f6a: 25 ff 0f 00 00 and $0xfff,%eax pa = PTE_ADDR(*pte); 80106f6f: 81 e3 00 f0 ff ff and $0xfffff000,%ebx flags = PTE_FLAGS(*pte); 80106f75: 89 45 e4 mov %eax,-0x1c(%ebp) if((mem = kalloc()) == 0) 80106f78: e8 63 b6 ff ff call 801025e0 <kalloc> 80106f7d: 85 c0 test %eax,%eax 80106f7f: 89 c6 mov %eax,%esi 80106f81: 75 8d jne 80106f10 <copyuvm+0x30> } } return d; bad: freevm(d); 80106f83: 83 ec 0c sub $0xc,%esp 80106f86: ff 75 e0 pushl -0x20(%ebp) 80106f89: e8 02 fe ff ff call 80106d90 <freevm> return 0; 80106f8e: 83 c4 10 add $0x10,%esp 80106f91: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) } 80106f98: 8b 45 e0 mov -0x20(%ebp),%eax 80106f9b: 8d 65 f4 lea -0xc(%ebp),%esp 80106f9e: 5b pop %ebx 80106f9f: 5e pop %esi 80106fa0: 5f pop %edi 80106fa1: 5d pop %ebp 80106fa2: c3 ret 80106fa3: 90 nop 80106fa4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(mem); 80106fa8: 83 ec 0c sub $0xc,%esp 80106fab: 56 push %esi 80106fac: e8 7f b4 ff ff call 80102430 <kfree> goto bad; 80106fb1: 83 c4 10 add $0x10,%esp 80106fb4: eb cd jmp 80106f83 <copyuvm+0xa3> panic("copyuvm: page not present"); 80106fb6: 83 ec 0c sub $0xc,%esp 80106fb9: 68 96 7a 10 80 push $0x80107a96 80106fbe: e8 cd 93 ff ff call 80100390 <panic> panic("copyuvm: pte should exist"); 80106fc3: 83 ec 0c sub $0xc,%esp 80106fc6: 68 7c 7a 10 80 push $0x80107a7c 80106fcb: e8 c0 93 ff ff call 80100390 <panic> 80106fd0 <uva2ka>: //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 80106fd0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106fd1: 31 c9 xor %ecx,%ecx { 80106fd3: 89 e5 mov %esp,%ebp 80106fd5: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80106fd8: 8b 55 0c mov 0xc(%ebp),%edx 80106fdb: 8b 45 08 mov 0x8(%ebp),%eax 80106fde: e8 9d f7 ff ff call 80106780 <walkpgdir> if((*pte & PTE_P) == 0) 80106fe3: 8b 00 mov (%eax),%eax return 0; if((*pte & PTE_U) == 0) return 0; return (char*)P2V(PTE_ADDR(*pte)); } 80106fe5: c9 leave if((*pte & PTE_U) == 0) 80106fe6: 89 c2 mov %eax,%edx return (char*)P2V(PTE_ADDR(*pte)); 80106fe8: 25 00 f0 ff ff and $0xfffff000,%eax if((*pte & PTE_U) == 0) 80106fed: 83 e2 05 and $0x5,%edx return (char*)P2V(PTE_ADDR(*pte)); 80106ff0: 05 00 00 00 80 add $0x80000000,%eax 80106ff5: 83 fa 05 cmp $0x5,%edx 80106ff8: ba 00 00 00 00 mov $0x0,%edx 80106ffd: 0f 45 c2 cmovne %edx,%eax } 80107000: c3 ret 80107001: eb 0d jmp 80107010 <copyout> 80107003: 90 nop 80107004: 90 nop 80107005: 90 nop 80107006: 90 nop 80107007: 90 nop 80107008: 90 nop 80107009: 90 nop 8010700a: 90 nop 8010700b: 90 nop 8010700c: 90 nop 8010700d: 90 nop 8010700e: 90 nop 8010700f: 90 nop 80107010 <copyout>: // Copy len bytes from p to user address va in page table pgdir. // Most useful when pgdir is not the current page table. // uva2ka ensures this only works for PTE_U pages. int copyout(pde_t *pgdir, uint va, void *p, uint len) { 80107010: 55 push %ebp 80107011: 89 e5 mov %esp,%ebp 80107013: 57 push %edi 80107014: 56 push %esi 80107015: 53 push %ebx 80107016: 83 ec 1c sub $0x1c,%esp 80107019: 8b 5d 14 mov 0x14(%ebp),%ebx 8010701c: 8b 55 0c mov 0xc(%ebp),%edx 8010701f: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80107022: 85 db test %ebx,%ebx 80107024: 75 40 jne 80107066 <copyout+0x56> 80107026: eb 70 jmp 80107098 <copyout+0x88> 80107028: 90 nop 80107029: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if(pa0 == 0) return -1; n = PGSIZE - (va - va0); 80107030: 8b 55 e4 mov -0x1c(%ebp),%edx 80107033: 89 f1 mov %esi,%ecx 80107035: 29 d1 sub %edx,%ecx 80107037: 81 c1 00 10 00 00 add $0x1000,%ecx 8010703d: 39 d9 cmp %ebx,%ecx 8010703f: 0f 47 cb cmova %ebx,%ecx if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 80107042: 29 f2 sub %esi,%edx 80107044: 83 ec 04 sub $0x4,%esp 80107047: 01 d0 add %edx,%eax 80107049: 51 push %ecx 8010704a: 57 push %edi 8010704b: 50 push %eax 8010704c: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010704f: e8 ec d5 ff ff call 80104640 <memmove> len -= n; buf += n; 80107054: 8b 4d e4 mov -0x1c(%ebp),%ecx while(len > 0){ 80107057: 83 c4 10 add $0x10,%esp va = va0 + PGSIZE; 8010705a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx buf += n; 80107060: 01 cf add %ecx,%edi while(len > 0){ 80107062: 29 cb sub %ecx,%ebx 80107064: 74 32 je 80107098 <copyout+0x88> va0 = (uint)PGROUNDDOWN(va); 80107066: 89 d6 mov %edx,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107068: 83 ec 08 sub $0x8,%esp va0 = (uint)PGROUNDDOWN(va); 8010706b: 89 55 e4 mov %edx,-0x1c(%ebp) 8010706e: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107074: 56 push %esi 80107075: ff 75 08 pushl 0x8(%ebp) 80107078: e8 53 ff ff ff call 80106fd0 <uva2ka> if(pa0 == 0) 8010707d: 83 c4 10 add $0x10,%esp 80107080: 85 c0 test %eax,%eax 80107082: 75 ac jne 80107030 <copyout+0x20> } return 0; } 80107084: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80107087: b8 ff ff ff ff mov $0xffffffff,%eax } 8010708c: 5b pop %ebx 8010708d: 5e pop %esi 8010708e: 5f pop %edi 8010708f: 5d pop %ebp 80107090: c3 ret 80107091: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107098: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010709b: 31 c0 xor %eax,%eax } 8010709d: 5b pop %ebx 8010709e: 5e pop %esi 8010709f: 5f pop %edi 801070a0: 5d pop %ebp 801070a1: c3 ret
38.289467
74
0.521731
7b194baf9dffa68338fe669d1a45e1a19bb1a07f
99
asm
Assembly
tests/assembly/system operations/0400.asm
danecreekphotography/6502ts
85716cf12f879d7c16c297de3251888c32abba6a
[ "MIT" ]
null
null
null
tests/assembly/system operations/0400.asm
danecreekphotography/6502ts
85716cf12f879d7c16c297de3251888c32abba6a
[ "MIT" ]
null
null
null
tests/assembly/system operations/0400.asm
danecreekphotography/6502ts
85716cf12f879d7c16c297de3251888c32abba6a
[ "MIT" ]
null
null
null
; 0400 - NOP .segment "VECTORS" .word $eaea .word init .word $eaea .code init: nop nop nop
7.615385
18
0.626263
6f7dfc685913f5f7f068518a49bf6f6aa4676459
7,291
asm
Assembly
Transynther/x86/_processed/NC/_st_zr_un_/i3-7100_9_0x84_notsx.log_1457_1174.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_st_zr_un_/i3-7100_9_0x84_notsx.log_1457_1174.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_st_zr_un_/i3-7100_9_0x84_notsx.log_1457_1174.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r15 push %r8 push %r9 push %rcx push %rdi push %rsi lea addresses_normal_ht+0x185eb, %rsi lea addresses_A_ht+0xd78b, %rdi nop sub %r11, %r11 mov $50, %rcx rep movsw xor $688, %r12 lea addresses_WT_ht+0x1ceeb, %r8 nop cmp $59600, %rsi movb (%r8), %r12b nop nop nop nop nop cmp %rsi, %rsi lea addresses_WT_ht+0x19d83, %rcx nop nop nop nop xor $49971, %r9 mov $0x6162636465666768, %r11 movq %r11, (%rcx) add $50134, %r11 lea addresses_D_ht+0x1498, %rcx dec %r9 mov $0x6162636465666768, %rsi movq %rsi, %xmm6 movups %xmm6, (%rcx) nop nop nop and $37180, %rsi lea addresses_A_ht+0x33eb, %rdi nop nop nop nop add $31913, %rcx mov (%rdi), %esi nop sub $16440, %r8 lea addresses_normal_ht+0xb51b, %rsi lea addresses_UC_ht+0xf1eb, %rdi nop nop nop nop cmp $52848, %r11 mov $38, %rcx rep movsq nop nop cmp $34027, %r11 lea addresses_A_ht+0x29eb, %rsi lea addresses_A_ht+0x1ed6b, %rdi nop cmp $12442, %r15 mov $77, %rcx rep movsq nop nop dec %r8 lea addresses_WT_ht+0x35eb, %rsi lea addresses_D_ht+0x18c47, %rdi nop nop nop nop add %r15, %r15 mov $52, %rcx rep movsw nop nop nop nop and $1689, %rdi lea addresses_A_ht+0x5cb, %r15 nop nop nop nop add %r8, %r8 mov $0x6162636465666768, %rcx movq %rcx, %xmm1 movups %xmm1, (%r15) nop nop nop sub $4198, %r12 pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r14 push %r9 push %rbp push %rdi // Store mov $0x7876440000000aeb, %r14 nop nop nop and %r9, %r9 mov $0x5152535455565758, %rdi movq %rdi, (%r14) nop nop cmp %rdi, %rdi // Store lea addresses_WC+0x346d, %r12 nop sub $22475, %rbp mov $0x5152535455565758, %r11 movq %r11, %xmm5 movups %xmm5, (%r12) nop sub %r11, %r11 // Store mov $0x7739ae00000005eb, %r11 sub %rbp, %rbp movl $0x51525354, (%r11) nop nop nop xor %rbp, %rbp // Store lea addresses_D+0xedeb, %r13 clflush (%r13) nop nop sub %r12, %r12 movb $0x51, (%r13) cmp %r11, %r11 // Faulty Load mov $0x55ba700000005eb, %r13 nop nop nop nop nop add $34872, %rbp mov (%r13), %r14w lea oracles, %r9 and $0xff, %r14 shlq $12, %r14 mov (%r9,%r14,1), %r14 pop %rdi pop %rbp pop %r9 pop %r14 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_NC', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_NC', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_NC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 8, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': True}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'54': 972, '00': 16, 'e0': 469} 00 54 54 e0 e0 54 54 e0 e0 e0 54 54 54 54 54 54 54 e0 54 54 54 e0 54 e0 e0 54 54 54 54 54 54 54 54 e0 54 e0 54 e0 e0 54 54 00 54 54 54 54 e0 54 54 54 00 54 e0 e0 e0 54 e0 54 54 e0 e0 e0 e0 54 54 e0 54 54 54 54 e0 54 54 54 54 54 e0 e0 e0 e0 e0 e0 e0 e0 54 54 e0 54 54 54 54 e0 e0 54 54 54 54 e0 54 54 54 54 54 e0 54 54 00 54 e0 54 e0 54 54 e0 e0 e0 e0 e0 54 e0 e0 e0 54 e0 e0 e0 e0 e0 54 e0 e0 54 54 e0 54 54 e0 54 e0 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 e0 54 54 e0 e0 54 e0 54 54 e0 54 54 54 54 54 54 54 54 54 54 54 54 54 54 e0 e0 e0 54 54 54 e0 54 e0 e0 e0 e0 54 e0 54 e0 54 54 e0 54 54 54 e0 e0 e0 e0 e0 e0 e0 54 e0 54 54 e0 54 54 54 54 54 54 54 54 54 54 e0 54 54 54 e0 e0 e0 54 54 54 54 54 e0 e0 e0 54 e0 54 54 54 54 54 e0 54 54 54 e0 e0 54 e0 54 54 54 54 e0 e0 e0 54 54 54 e0 54 54 e0 54 54 54 e0 e0 54 54 54 54 54 e0 e0 54 54 e0 54 54 54 54 e0 54 54 54 54 54 54 54 54 54 54 54 54 54 54 e0 54 54 54 54 54 e0 54 e0 e0 54 54 e0 54 54 54 e0 54 e0 54 e0 54 e0 54 54 54 54 54 54 e0 e0 54 e0 54 e0 e0 54 e0 e0 54 54 e0 54 54 54 54 54 54 54 54 54 54 e0 54 54 54 54 e0 54 e0 e0 54 54 54 54 54 e0 54 e0 54 e0 54 e0 e0 e0 e0 00 54 54 e0 54 e0 54 54 54 54 54 54 e0 e0 54 54 e0 54 54 54 54 54 e0 e0 54 e0 e0 54 54 e0 e0 e0 e0 e0 54 54 54 e0 e0 54 54 54 e0 54 54 54 e0 54 e0 54 54 e0 e0 54 54 e0 54 54 54 54 e0 54 54 e0 e0 e0 54 54 e0 54 54 54 54 54 54 54 54 e0 54 54 e0 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 e0 54 54 54 54 54 00 54 54 54 54 e0 e0 54 54 54 e0 54 54 54 54 e0 e0 54 54 e0 e0 54 54 54 54 54 e0 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 e0 e0 54 54 e0 54 54 e0 e0 54 54 e0 54 54 e0 54 e0 e0 e0 54 54 54 54 54 54 54 54 54 54 e0 e0 e0 54 54 e0 54 54 54 e0 54 e0 54 54 e0 54 54 54 54 54 54 e0 54 e0 54 54 54 54 e0 54 e0 54 e0 54 e0 e0 54 54 54 e0 54 54 54 54 e0 e0 54 54 e0 54 e0 54 54 54 e0 e0 54 54 e0 54 54 54 e0 e0 54 54 e0 54 e0 e0 54 54 e0 e0 54 e0 54 e0 e0 e0 54 e0 e0 e0 54 e0 54 54 e0 54 e0 e0 e0 e0 e0 54 54 54 54 e0 54 e0 54 54 54 54 54 e0 54 e0 e0 54 e0 54 54 54 54 54 54 54 54 e0 e0 54 e0 e0 e0 e0 e0 54 54 54 54 e0 e0 54 e0 54 54 e0 54 e0 e0 54 54 54 54 e0 54 54 54 54 54 54 54 54 54 54 e0 54 54 54 54 54 54 54 e0 e0 e0 54 54 54 e0 e0 e0 54 54 54 54 54 54 54 54 54 e0 e0 54 54 54 e0 e0 54 54 54 54 e0 e0 54 54 e0 54 54 54 54 54 54 e0 e0 54 54 54 54 54 54 54 e0 54 54 e0 e0 54 54 54 e0 54 54 54 54 54 e0 54 54 e0 54 e0 54 54 e0 54 e0 54 e0 54 54 e0 54 54 e0 54 e0 54 54 54 e0 54 54 54 54 54 e0 e0 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 e0 54 54 54 54 54 54 54 54 54 54 54 54 54 e0 e0 54 54 54 e0 54 54 e0 54 e0 54 54 e0 54 e0 e0 54 e0 54 54 e0 e0 e0 54 54 54 54 54 54 e0 54 54 54 54 54 54 54 54 e0 e0 54 54 54 e0 e0 54 e0 54 e0 54 54 e0 e0 54 54 e0 54 e0 00 e0 e0 54 e0 54 54 54 54 54 54 54 54 54 54 54 54 e0 54 54 54 54 54 54 54 54 54 54 00 e0 54 54 54 54 e0 54 54 54 00 54 e0 e0 54 e0 e0 e0 e0 54 e0 54 54 e0 e0 54 54 54 54 e0 e0 e0 54 54 e0 54 */
35.052885
2,999
0.654917
7466b76a73e0f32e3a59c6781ec221e1e9158b39
614
asm
Assembly
oeis/107/A107419.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/107/A107419.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/107/A107419.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A107419: a(n) = C(n+4,4)*C(n+7,7). ; Submitted by Jon Maiga ; 1,40,540,4200,23100,99792,360360,1132560,3185325,8179600,19467448,43439760,91706160,184497600,355816800,661028544,1187785665,2071432440,3516320500,5824819000,9436206780,14978106000,23333661000,35728290000,53840548125,79942445856,117075475440,169269617440,241813739200,341587065600,477462809472,660796604160,906014093985,1231313920200,1659504401100,2218994456328,2944961778460,3880723921360,5079340866600,6605480758800,8537583880749,10970363582640,14017686800040,17815881006000,22527518958000 mov $2,$0 add $2,4 bin $2,$0 add $0,7 bin $0,7 mul $0,$2
55.818182
493
0.835505
18f172855bd6446924fc5d1c62c4a5607819a82f
1,041
asm
Assembly
mips-exercises/reference.asm
jufantozzi/computer-organization
0fd0f30fb83a78821532fca32d4eb0474f662074
[ "MIT" ]
null
null
null
mips-exercises/reference.asm
jufantozzi/computer-organization
0fd0f30fb83a78821532fca32d4eb0474f662074
[ "MIT" ]
28
2018-03-27T01:52:01.000Z
2018-06-04T06:41:12.000Z
mips-exercises/reference.asm
jufantozzi/computer-organization
0fd0f30fb83a78821532fca32d4eb0474f662074
[ "MIT" ]
3
2018-03-25T12:42:31.000Z
2018-06-02T00:40:30.000Z
# MIPS executa linha por linha # Começa em .text, main é considerado padrão para começar .text # programa vai embaixo de .text, o que vai rodar # label main: # registradores armazenam informação # no MARS, podemos ver os registradores na direita ($) # Carregar valores em um registrador: li $t0, 5 # load immediate, registrador <- valor li $v0, 10 # valores armazenados em hex (10 = A) # Operandos add $t0, $t1, $t2 # t0 <- t1 + t2 sub $t0, $t1, $t2 # t0 <- t1 - t2 mul $t0, $t1, $t2 # t0 <- t1 * t2 # div $t0, $t1, $t2 # t0 <- t1 / t2 # Encerrar execução do programa li $v0, 10 syscall .data # dados vão embaixo de .data, variáveis, labels, words # 0x10010000 - Primeiro endereço cake: .ascii "the cake is a lie" # string .data str: .asciiz "the answer = " .text li $v0, 4 # $system call code for print_str la $a0, str # $address of string to print syscall # print the string li $v0, 1 # $system call code for print_int li $a0, 5 # $integer to print syscall # print it
26.692308
60
0.637848
7432732003093fdd9470bef6f9eb9a90dc870563
880
asm
Assembly
oeis/295/A295735.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/295/A295735.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/295/A295735.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A295735: a(n) = a(n-1) + 3*a(n-2) -2*a(n-3) - 2*a(n-4), where a(0) = 0, a(1) = -1, a(2) = 0, a(3) = 1. ; Submitted by Christian Krause ; 0,-1,0,1,3,8,15,31,54,101,171,304,507,875,1446,2449,4023,6728,11007,18247,29766,49037,79827,130912,212787,347795,564678,920665,1493535,2430584,3940503,6403855,10377126,16846517,27289179,44266768,71687019,116215931,188165094,304905313,493594695,799548584,1294191855,2095837591,3392126598,5492158493,8888479395,14389026496,23285894499,37691698211,60994369926,98719622569,159747546927,258534278360,418348934151,677017430239,1095500582118,1772786447813,2868555465387,4641878784112,7510971120411 mov $1,1 mov $2,1 mov $5,-1 mov $6,-1 lpb $0 mov $3,1 lpb $3 add $2,1 sub $2,$3 mod $2,2 cmp $4,3 cmp $4,0 sub $3,$4 add $7,$1 lpe sub $0,1 add $2,1 mul $1,$2 mul $7,$5 sub $6,$7 add $7,$6 lpe mov $0,$7
31.428571
492
0.6875
bd38d50c3d694b72d09f387d1b0386e8a8f741b2
674
asm
Assembly
oeis/123/A123270.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/123/A123270.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/123/A123270.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A123270: a(0)=1, a(1)=1, a(n) = 5*a(n-1) + 4*a(n-2). ; Submitted by Jamie Morken(s3) ; 1,1,9,49,281,1601,9129,52049,296761,1692001,9647049,55003249,313604441,1788035201,10194593769,58125109649,331403923321,1889520055201,10773215969289,61424160067249,350213664213401,1996764961336001,11384679463533609,64910457163012049,370091003669194681,2110096846998021601,12030848249666886729,68594628636326520049,391096536180300147161,2229861195446806816001,12713692121955234668649,72487905391563400607249,413294295445637941710841,2356423098794443310983201,13435292675754768321759369 mov $3,1 lpb $0 sub $0,1 mul $1,4 add $3,$1 mov $2,$3 add $3,$1 mov $1,$2 lpe mov $0,$3
44.933333
485
0.805638
26f402c238519e2973ee7c44158bc5acc51576e5
2,687
asm
Assembly
llvm/test/tools/llvm-ml/strings.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
2,338
2018-06-19T17:34:51.000Z
2022-03-31T11:00:37.000Z
llvm/test/tools/llvm-ml/strings.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
3,740
2019-01-23T15:36:48.000Z
2022-03-31T22:01:13.000Z
llvm/test/tools/llvm-ml/strings.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
500
2019-01-23T07:49:22.000Z
2022-03-30T02:59:37.000Z
; RUN: llvm-ml -filetype=s %s /Fo - | FileCheck %s .data dq_single_character BYTE "a" ; CHECK-LABEL: dq_single_character: ; CHECK-NEXT: .byte 97 ; CHECK-NOT: .byte dq_join BYTE "ab", "cd" ; CHECK-LABEL: dq_join: ; CHECK-NEXT: .byte 97 ; CHECK-NEXT: .byte 98 ; CHECK-NEXT: .byte 99 ; CHECK-NEXT: .byte 100 ; CHECK-NOT: .byte dq_quote_escape BYTE "ab""""cd" ; Intended result: ab""cd ; CHECK-LABEL: dq_quote_escape: ; CHECK-NEXT: .byte 97 ; CHECK-NEXT: .byte 98 ; CHECK-NEXT: .byte 34 ; CHECK-NEXT: .byte 34 ; CHECK-NEXT: .byte 99 ; CHECK-NEXT: .byte 100 ; CHECK-NOT: .byte dq_single_quote BYTE "ab''''cd" ; Intended result: ab''''cd ; CHECK-LABEL: dq_single_quote: ; CHECK-NEXT: .byte 97 ; CHECK-NEXT: .byte 98 ; CHECK-NEXT: .byte 39 ; CHECK-NEXT: .byte 39 ; CHECK-NEXT: .byte 39 ; CHECK-NEXT: .byte 39 ; CHECK-NEXT: .byte 99 ; CHECK-NEXT: .byte 100 ; CHECK-NOT: .byte sq_single_character BYTE 'a' ; CHECK-LABEL: sq_single_character: ; CHECK-NEXT: .byte 97 ; CHECK-NOT: .byte sq_join BYTE 'ab', 'cd' ; CHECK-LABEL: sq_join: ; CHECK-NEXT: .byte 97 ; CHECK-NEXT: .byte 98 ; CHECK-NEXT: .byte 99 ; CHECK-NEXT: .byte 100 ; CHECK-NOT: .byte sq_quote_escape BYTE 'ab''''cd' ; Intended result: ab''cd ; CHECK-LABEL: sq_quote_escape: ; CHECK-NEXT: .byte 97 ; CHECK-NEXT: .byte 98 ; CHECK-NEXT: .byte 39 ; CHECK-NEXT: .byte 39 ; CHECK-NEXT: .byte 99 ; CHECK-NEXT: .byte 100 ; CHECK-NOT: .byte sq_double_quote BYTE 'ab""""cd' ; Intended result: ab""""cd ; CHECK-LABEL: sq_double_quote: ; CHECK-NEXT: .byte 97 ; CHECK-NEXT: .byte 98 ; CHECK-NEXT: .byte 34 ; CHECK-NEXT: .byte 34 ; CHECK-NEXT: .byte 34 ; CHECK-NEXT: .byte 34 ; CHECK-NEXT: .byte 99 ; CHECK-NEXT: .byte 100 ; CHECK-NOT: .byte mixed_quotes_join BYTE "a'b", 'c"d' ; Intended result: a'bc"d ; CHECK-LABEL: mixed_quotes_join: ; CHECK-NEXT: .byte 97 ; CHECK-NEXT: .byte 39 ; CHECK-NEXT: .byte 98 ; CHECK-NEXT: .byte 99 ; CHECK-NEXT: .byte 34 ; CHECK-NEXT: .byte 100 ; CHECK-NOT: .byte .code sq_char_test PROC ; CHECK-LABEL: sq_char_test: mov eax, 'a' ; CHECK: mov eax, 97 mov eax, '''' ; CHECK: mov eax, 39 mov eax, '"' ; CHECK: mov eax, 34 ret sq_char_test ENDP dq_char_test PROC ; CHECK-LABEL: dq_char_test: mov eax, "b" ; CHECK: mov eax, 98 mov eax, """" ; CHECK: mov eax, 34 mov eax, "'" ; CHECK: mov eax, 39 ret dq_char_test ENDP string_constant_test PROC ; CHECK-LABEL: string_constant_test: mov eax, 'ab' mov eax, "ab" ; CHECK: mov eax, 24930 ; CHECK: mov eax, 24930 mov eax, "abc" mov eax, 'abc' ; CHECK: mov eax, 6382179 ; CHECK: mov eax, 6382179 mov eax, "abc""" mov eax, 'abc''' ; CHECK: mov eax, 1633837858 ; CHECK: mov eax, 1633837863 ret string_constant_test ENDP end
18.659722
50
0.667659
e9a07631c4bb13dde020678d69b12062cee7d99c
3,830
asm
Assembly
libtool/src/gmp-6.1.2/mpn/x86_64/nano/dive_1.asm
kroggen/aergo
05af317eaa1b62b21dc0144ef74a9e7acb14fb87
[ "MIT" ]
1,602
2015-01-06T11:26:31.000Z
2022-03-30T06:17:21.000Z
libtool/src/gmp-6.1.2/mpn/x86_64/nano/dive_1.asm
kroggen/aergo
05af317eaa1b62b21dc0144ef74a9e7acb14fb87
[ "MIT" ]
11,789
2015-01-05T04:50:15.000Z
2022-03-31T23:39:19.000Z
libtool/src/gmp-6.1.2/mpn/x86_64/nano/dive_1.asm
kroggen/aergo
05af317eaa1b62b21dc0144ef74a9e7acb14fb87
[ "MIT" ]
498
2015-01-08T18:58:18.000Z
2022-03-20T15:37:45.000Z
dnl AMD64 mpn_divexact_1 -- mpn by limb exact division. dnl Copyright 2001, 2002, 2004-2006, 2010-2012 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb C norm unorm C AMD K8,K9 11 11 C AMD K10 11 11 C Intel P4 ? C Intel core2 13.5 13.25 C Intel corei 14.25 C Intel atom 34 36 C VIA nano 19.25 19.25 C INPUT PARAMETERS C rp rdi C up rsi C n rdx C divisor rcx ABI_SUPPORT(DOS64) ABI_SUPPORT(STD64) ASM_START() TEXT ALIGN(16) PROLOGUE(mpn_divexact_1) FUNC_ENTRY(4) push %rbx mov %rcx, %rax xor R32(%rcx), R32(%rcx) C shift count mov %rdx, %r8 bt $0, R32(%rax) jc L(odd) C skip bsfq unless divisor is even bsf %rax, %rcx shr R8(%rcx), %rax L(odd): mov %rax, %rbx shr R32(%rax) and $127, R32(%rax) C d/2, 7 bits LEA( binvert_limb_table, %rdx) movzbl (%rdx,%rax), R32(%rax) C inv 8 bits mov %rbx, %r11 C d without twos lea (%rax,%rax), R32(%rdx) C 2*inv imul R32(%rax), R32(%rax) C inv*inv imul R32(%rbx), R32(%rax) C inv*inv*d sub R32(%rax), R32(%rdx) C inv = 2*inv - inv*inv*d, 16 bits lea (%rdx,%rdx), R32(%rax) C 2*inv imul R32(%rdx), R32(%rdx) C inv*inv imul R32(%rbx), R32(%rdx) C inv*inv*d sub R32(%rdx), R32(%rax) C inv = 2*inv - inv*inv*d, 32 bits lea (%rax,%rax), %r10 C 2*inv imul %rax, %rax C inv*inv imul %rbx, %rax C inv*inv*d sub %rax, %r10 C inv = 2*inv - inv*inv*d, 64 bits lea (%rsi,%r8,8), %rsi C up end lea -8(%rdi,%r8,8), %rdi C rp end neg %r8 C -n mov (%rsi,%r8,8), %rax C up[0] inc %r8 jz L(one) test R32(%rcx), R32(%rcx) jnz L(unorm) C branch if count != 0 xor R32(%rbx), R32(%rbx) jmp L(nent) ALIGN(8) L(ntop):mul %r11 C carry limb in rdx 0 10 mov -8(%rsi,%r8,8), %rax C sub %rbx, %rax C apply carry bit setc %bl C sub %rdx, %rax C apply carry limb 5 adc $0, %rbx C 6 L(nent):imul %r10, %rax C 6 mov %rax, (%rdi,%r8,8) C inc %r8 C jnz L(ntop) mov -8(%rsi), %r9 C up high limb jmp L(com) L(unorm): mov (%rsi,%r8,8), %r9 C up[1] shr R8(%rcx), %rax C neg R32(%rcx) shl R8(%rcx), %r9 C neg R32(%rcx) or %r9, %rax xor R32(%rbx), R32(%rbx) jmp L(uent) ALIGN(8) L(utop):mul %r11 C carry limb in rdx 0 10 mov (%rsi,%r8,8), %rax C shl R8(%rcx), %rax C neg R32(%rcx) or %r9, %rax sub %rbx, %rax C apply carry bit setc %bl C sub %rdx, %rax C apply carry limb 5 adc $0, %rbx C 6 L(uent):imul %r10, %rax C 6 mov (%rsi,%r8,8), %r9 C shr R8(%rcx), %r9 C neg R32(%rcx) mov %rax, (%rdi,%r8,8) C inc %r8 C jnz L(utop) L(com): mul %r11 C carry limb in rdx sub %rbx, %r9 C apply carry bit sub %rdx, %r9 C apply carry limb imul %r10, %r9 mov %r9, (%rdi) pop %rbx FUNC_EXIT() ret L(one): shr R8(%rcx), %rax imul %r10, %rax mov %rax, (%rdi) pop %rbx FUNC_EXIT() ret EPILOGUE()
22.934132
79
0.644125
aab983875efc467ca1a3e0b51f4e6c6ef796e77e
237
asm
Assembly
programs/oeis/092/A092043.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/092/A092043.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/092/A092043.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A092043: Numerator of n!/n^2. ; 1,1,2,3,24,20,720,630,4480,36288,3628800,3326400,479001600,444787200,5811886080,81729648000,20922789888000,19760412672000,6402373705728000,6082255020441600 mov $1,$0 add $0,1 fac $1 gcd $0,$1 div $1,$0
26.333333
157
0.763713
7431759c857c03cea09efa2b9f1645e11ee77a55
691
asm
Assembly
oeis/130/A130291.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/130/A130291.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/130/A130291.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A130291: Number of quadratic residues (including 0) modulo the n-th prime. ; Submitted by Jon Maiga ; 2,2,3,4,6,7,9,10,12,15,16,19,21,22,24,27,30,31,34,36,37,40,42,45,49,51,52,54,55,57,64,66,69,70,75,76,79,82,84,87,90,91,96,97,99,100,106,112,114,115,117,120,121,126,129,132,135,136,139,141,142,147,154,156,157,159,166,169,174,175,177,180,184,187,190,192,195,199,201,205,210,211,216,217,220,222,225,229,231,232,234,240,244,246,250,252,255,261,262,271 mov $2,36 mul $2,$0 mov $4,2 lpb $2 mov $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,1 cmp $1,$0 mul $2,$1 sub $2,1 add $4,2 lpe mov $0,$4 div $0,2 add $0,1
31.409091
349
0.664255
c4e74570276855b4f315ff2b0c947ebe7bdc5a8d
701
asm
Assembly
ZX-Spectrum/library/print_string.asm
peroff/8-Bit-Tea-Party
374d486a9712a7d6286d8080c1e98e28b1c5e066
[ "MIT" ]
13
2018-08-01T20:29:20.000Z
2021-09-03T21:49:25.000Z
ZX-Spectrum/library/print_string.asm
peroff/8-Bit-Tea-Party
374d486a9712a7d6286d8080c1e98e28b1c5e066
[ "MIT" ]
3
2019-09-18T21:13:41.000Z
2021-10-10T13:45:17.000Z
ZX-Spectrum/library/print_string.asm
peroff/8-Bit-Tea-Party
374d486a9712a7d6286d8080c1e98e28b1c5e066
[ "MIT" ]
4
2019-09-18T20:25:37.000Z
2021-08-19T10:17:46.000Z
;Unversal function to print string on screen with windows. ;Authours: ... ; ;Function description and globals. ; ;Parameters: ; ;Returns: ; ;Function comment. ;Platforms: ... ;Assemble: ... ;Code size: ... ;Static data size: ... ;Performance: ; ;Полное название функции на русском. ;Автор: ... ; ;Описание, подробное функиции, что именно ;она длеает. ; ;Параметры: ; ;Возврат(регистры или память): ; ;Дополнительный комментарий, как функция ;работает и если есть неявные моменты. ; ;Платформы: машины совместимости; ;Ассемблер: чем можно точно собрать; ;Размер кода: если есть возможность; ;Размер статичных данных: для статичности; ;Производительность: быстро! :)
20.028571
60
0.697575
754e28b8fee8d56a0e335e8daaa74b5a09ead520
7,829
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_1702.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_1702.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_1702.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r15 push %rax push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0xa724, %r10 nop nop nop and %rdx, %rdx vmovups (%r10), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %r12 nop nop nop nop xor $1488, %rbp lea addresses_UC_ht+0x7ce4, %r15 clflush (%r15) nop nop nop nop nop cmp %rax, %rax movl $0x61626364, (%r15) nop nop nop nop and $60828, %rbp lea addresses_UC_ht+0x188d0, %r12 nop nop nop sub %rbp, %rbp mov $0x6162636465666768, %r15 movq %r15, %xmm4 and $0xffffffffffffffc0, %r12 vmovaps %ymm4, (%r12) nop nop nop nop nop xor %r12, %r12 lea addresses_UC_ht+0x1a364, %r10 clflush (%r10) nop nop nop nop nop cmp %rbx, %rbx movb $0x61, (%r10) nop nop nop nop xor $37706, %rax lea addresses_UC_ht+0xe66, %r10 nop cmp $47111, %rbp mov $0x6162636465666768, %rax movq %rax, %xmm6 vmovups %ymm6, (%r10) nop nop nop nop nop inc %rbp lea addresses_normal_ht+0x2f24, %r15 nop nop nop nop add %r10, %r10 mov (%r15), %dx nop nop nop nop and $48155, %r12 lea addresses_UC_ht+0xc124, %r12 nop inc %rbp movb (%r12), %al nop nop sub %r12, %r12 lea addresses_WC_ht+0x9464, %rbp nop nop nop nop xor %r10, %r10 movw $0x6162, (%rbp) add $13596, %rdx lea addresses_UC_ht+0xd624, %rdx nop nop nop nop and $40460, %rbx movb (%rdx), %r12b add %rax, %rax lea addresses_normal_ht+0x15be4, %rsi lea addresses_WT_ht+0x1d924, %rdi sub $50615, %rdx mov $37, %rcx rep movsb nop nop nop xor %r10, %r10 lea addresses_normal_ht+0x16ee4, %rcx nop nop add %rdx, %rdx movups (%rcx), %xmm6 vpextrq $1, %xmm6, %rdi cmp %rax, %rax lea addresses_A_ht+0x1c264, %rbx add $1653, %r15 mov $0x6162636465666768, %rsi movq %rsi, %xmm3 movups %xmm3, (%rbx) nop and $12621, %rcx lea addresses_D_ht+0xdd22, %rsi lea addresses_WT_ht+0x155e4, %rdi nop nop and $59592, %rdx mov $14, %rcx rep movsb nop nop nop nop nop add $46589, %rax lea addresses_UC_ht+0x1c524, %rbp nop nop add $6088, %r12 mov $0x6162636465666768, %rdi movq %rdi, (%rbp) nop nop nop dec %rax lea addresses_normal_ht+0xd24, %rsi lea addresses_UC_ht+0x1bdb4, %rdi nop inc %rbp mov $49, %rcx rep movsl and $5396, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r15 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %rbp push %rdx push %rsi // Faulty Load lea addresses_WT+0xa124, %r14 nop nop nop cmp $15152, %rbp mov (%r14), %si lea oracles, %rdx and $0xff, %rsi shlq $12, %rsi mov (%rdx,%rsi,1), %rsi pop %rsi pop %rdx pop %rbp pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
33.74569
2,999
0.658449
e9f1fb4c18b2cd9bd35e2e96c3f88d918bd866f9
3,354
asm
Assembly
1581/64tass/fndrel.asm
silverdr/assembly
c2851f7033223e089285dce22443b7e219ed4f61
[ "Unlicense" ]
23
2015-03-23T15:16:57.000Z
2022-03-18T12:43:42.000Z
1581/64tass/fndrel.asm
silverdr/assembly
c2851f7033223e089285dce22443b7e219ed4f61
[ "Unlicense" ]
null
null
null
1581/64tass/fndrel.asm
silverdr/assembly
c2851f7033223e089285dce22443b7e219ed4f61
[ "Unlicense" ]
8
2016-04-13T11:19:35.000Z
2021-12-22T07:39:00.000Z
;******************************** ;* ;* find relative file ;* ;* version 10 ;* ;* ;* inputs ;* recl - 1byte=lo record # ;* rech - 1byte=hi record # ;* rs - 1byte=record size ;* recptr - 1byte=first byte ;* wanted from record ;* ;* outputs ;* ssnum - 1byte=side sector # ;* ssind - 1byte=index into ss ;* relptr - 1byte=ptr to first ;* byte wanted ;* ;******************************** ; ; fndrel jsr mulply ; result=rn*rs+rp jsr div254 ; divide by 254 lda accum+1 ; save remainder sta relptr jsr div120 ; divide by 120 inc relptr inc relptr jsr hugerel beq fndre1 ; br, big lda result ; save quotient sta ssnum lda accum+1 ; save remainder asl a ; calc index into ss clc adc #16 ; skip link table sta ssind rts fndre1 lda accum+1 asl a clc adc #16 sta ssind ; steps to figure grpnum jsr div006 lda accum+1 sta ssnum lda result sta grpnum rts ; multiply ; result=recnum*rs+recptr ; destroys a,x mulply jsr zerres ; result=0 sta accum+3 ; a=0 ldx lindx ; get index lda recl,x sta accum+1 lda rech,x sta accum+2 bne mul25 ; adjust for rec #1 &... lda accum+1 ; ...#0 = 1st rec beq mul50 mul25 lda accum+1 sec sbc #1 sta accum+1 bcs mul50 dec accum+2 mul50 lda rs,x ; copy recsiz sta temp mul100 lsr temp ; do an add ? bcc mul200 ; no jsr addres ; result=result+accum+1,2,3 mul200 jsr accx2 ; 2*(accum+1,2,3) lda temp ; done ? bne mul100 ; no lda recptr ; add in last bit clc adc result sta result bcc mul400 ; skip no carry inc result+1 bne mul400 inc result+2 mul400 rts ; divide ; result=quotient ,accum+1=remainder ; destroys a,x div254 lda #254 ; divide by 254 .byte skip2 ; skip two bytes div120 lda #120 ; divide by 120 .byte skip2 div006 lda #6 ; divide by 6 sta temp ; 8 bit divisor lda #0 sta accum+1 sta accum+2 ldx #24 divid1 asl result rol result+1 rol result+2 rol accum+1 rol accum+2 lda accum+1 sec sbc temp tay ; save result lda accum+2 sbc #0 bcc divid2 ; br, if temp > dividend inc result sta accum+2 sty accum+1 divid2 dex bne divid1 rts ; zero result zerres lda #0 sta result sta result+1 sta result+2 rts ; multiply accum by 4 accx4 jsr accx2 ; ; multiply accum by 2 accx2 clc acc200 rol accum+1 rol accum+2 rol accum+3 rts ; add accum to result ; result=result+accum+1,2,3 addres clc ldx #$fd add100 lda result+3,x adc accum+4,x sta result+3,x inx bne add100 rts
19.614035
51
0.472868
3a8bad40eed998822df9cc66fd947275de2e107d
4,267
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_6_594.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_6_594.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_6_594.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x17c99, %r9 nop nop inc %r12 movl $0x61626364, (%r9) sub $26835, %rbp lea addresses_A_ht+0xd3bb, %rsi lea addresses_WC_ht+0x4d60, %rdi nop nop sub $63578, %rdx mov $118, %rcx rep movsl nop nop nop nop add $15048, %rbp lea addresses_A_ht+0xcfb, %rsi lea addresses_D_ht+0x122dd, %rdi nop nop nop nop and %r15, %r15 mov $103, %rcx rep movsw nop nop nop nop nop xor %rbp, %rbp lea addresses_D_ht+0x1cb4b, %rdx nop nop nop sub $53026, %rcx mov (%rdx), %di nop nop nop cmp %r9, %r9 lea addresses_D_ht+0xd5fb, %rcx nop nop add %r9, %r9 mov $0x6162636465666768, %rsi movq %rsi, (%rcx) sub %rcx, %rcx lea addresses_normal_ht+0x194fb, %rcx nop nop nop nop xor %rdi, %rdi movl $0x61626364, (%rcx) nop nop cmp %rbp, %rbp lea addresses_UC_ht+0x8bfb, %r9 nop nop nop nop nop add %rbp, %rbp movl $0x61626364, (%r9) nop sub %r12, %r12 lea addresses_WT_ht+0x1246b, %rbp nop nop nop nop add $61271, %rdx mov (%rbp), %r15 xor $4879, %rdx lea addresses_A_ht+0xb077, %r15 nop nop nop nop and %rdx, %rdx mov $0x6162636465666768, %rcx movq %rcx, %xmm4 movups %xmm4, (%r15) nop nop add %rdi, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi // Store lea addresses_normal+0xe6ab, %rsi nop nop nop cmp $46862, %rdx mov $0x5152535455565758, %rbx movq %rbx, %xmm7 vmovups %ymm7, (%rsi) nop nop nop nop nop dec %rdx // REPMOV lea addresses_normal+0x2237, %rsi lea addresses_PSE+0xf906, %rdi and %rax, %rax mov $3, %rcx rep movsl nop nop and %rax, %rax // REPMOV mov $0xa61, %rsi lea addresses_D+0x18d6f, %rdi nop nop nop nop nop sub $8015, %r12 mov $80, %rcx rep movsb nop nop and %rdi, %rdi // Store lea addresses_RW+0x1b159, %rax nop nop sub $11998, %rdx movl $0x51525354, (%rax) xor $63102, %rax // Faulty Load lea addresses_WC+0x1edfb, %rcx add $63968, %r12 movaps (%rcx), %xmm7 vpextrq $0, %xmm7, %rdx lea oracles, %r12 and $0xff, %rdx shlq $12, %rdx mov (%r12,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_PSE', 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_P', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}} {'00': 6} 00 00 00 00 00 00 */
20.222749
147
0.647996
c43f3d53ac753cfb780a9d5e4d0bb2e133bcf7ef
965
asm
Assembly
programs/oeis/071/A071521.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/071/A071521.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/071/A071521.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A071521: Number of 3-smooth numbers <= n. ; 1,2,3,4,4,5,5,6,7,7,7,8,8,8,8,9,9,10,10,10,10,10,10,11,11,11,12,12,12,12,12,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27 mov $4,$0 add $4,1 mov $5,$0 lpb $4 mov $0,$5 sub $4,1 sub $0,$4 mov $2,$0 add $2,1 mov $3,1679616 mod $3,$2 mov $0,$3 mod $2,5 trn $2,8 cmp $0,$2 add $1,$0 lpe
45.952381
734
0.622798
a63bab4aea561fcf3dcc096f1eed17ff10c2e781
89
asm
Assembly
examples/c64_vice/test.asm
PleXone2019/ProDBG
c7042f32da9e54662c3c575725c4cd24a878a2de
[ "MIT" ]
445
2015-01-04T16:30:56.000Z
2022-03-30T02:27:05.000Z
examples/c64_vice/test.asm
PleXone2019/ProDBG
c7042f32da9e54662c3c575725c4cd24a878a2de
[ "MIT" ]
305
2015-01-04T09:20:03.000Z
2020-10-01T08:45:45.000Z
examples/c64_vice/test.asm
PleXone2019/ProDBG
c7042f32da9e54662c3c575725c4cd24a878a2de
[ "MIT" ]
49
2015-02-14T01:43:38.000Z
2022-02-15T17:03:55.000Z
:BasicUpstart2(start) start: lda #$22 ldx #$32 iny inc $d020 inc $d021 jmp start
8.9
21
0.651685
22ad32831a8596c7120537004cd89c6f092e9054
13,319
asm
Assembly
MasmEd/Addins/raASCII/ASCII.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
11
2016-12-03T16:35:42.000Z
2022-03-26T06:02:53.000Z
MasmEd/Addins/raASCII/ASCII.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
1
2018-02-24T20:17:46.000Z
2018-03-02T08:57:40.000Z
MasmEd/Addins/raASCII/ASCII.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
4
2018-10-19T01:14:55.000Z
2021-09-11T18:51:48.000Z
include ASCII.inc .code DlgProc proc hwnd:HWND,umsg:UINT,wParam:WPARAM,lParam:LPARAM LOCAL szBuffer[256]:BYTE .if umsg==WM_CLOSE invoke EraseArray invoke DestroyIcon,hIcon invoke DeleteObject,hMFont invoke DestroyWindow,hwnd ;invoke EndDialog,hwnd,TRUE .elseif umsg==WM_PAINT .if ( !InPaint ) invoke PaintASCII,hwnd .endif .elseif umsg==WM_INITDIALOG ; invoke LoadCursor,hInstance,IDC_HAND ; mov hCurHand,eax ; invoke LoadCursor,hInstance,IDC_ARROW ; mov hCurArrow,eax invoke LoadImage,hInstance,101,IMAGE_ICON,0,0,LR_DEFAULTSIZE mov hIcon,eax invoke SendMessage,hwnd,WM_SETICON,ICON_BIG,hIcon invoke CreateArray invoke InitRects,hwnd invoke DefineSizes,hwnd invoke SendDlgItemMessage,hwnd,IDC_RBN_HEX,BM_SETCHECK,BST_CHECKED,0 mov wOutput,IDC_RBN_HEX invoke CreateStandardFont invoke ShowFontData,hwnd,m_LogFont.lfCharSet invoke SetWindowPos,hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE .elseif umsg==WM_MOUSEMOVE .if ( !wParam ) .if ( !InMove ) invoke SelectCurrent,hwnd,lParam .endif .endif .elseif umsg==WM_COMMAND mov eax,wParam mov edx,eax shr edx,16 .if dx==BN_CLICKED .if ax == IDC_BTN_CLEAR invoke SetDlgItemText,hwnd,IDC_EDT_CLIP,NULL .elseif ax == IDC_BTN_INSERT invoke InsertChars,hwnd .elseif ax == IDC_BTN_FONT invoke NewFont,hwnd .else mov wOutput,ax .endif .elseif dx == EN_CHANGE invoke SendDlgItemMessage,hwnd,IDC_EDT_CLIP,WM_GETTEXTLENGTH,0,0 .if ( eax ) invoke GetDlgItem,hwnd,IDC_BTN_CLEAR invoke EnableWindow,eax,TRUE invoke GetDlgItem,hwnd,IDC_BTN_INSERT invoke EnableWindow,eax,TRUE .else invoke GetDlgItem,hwnd,IDC_BTN_CLEAR invoke EnableWindow,eax,FALSE invoke GetDlgItem,hwnd,IDC_BTN_INSERT invoke EnableWindow,eax,FALSE .endif .endif .elseif umsg==WM_LBUTTONDBLCLK .if (wParam == MK_LBUTTON) invoke TypeSelected,hwnd,lParam .endif .else mov eax,FALSE ret .endif mov eax,TRUE ret DlgProc endp ;prints out selected character TypeSelected proc hwnd:HWND,lParam:LPARAM LOCAL pt:POINT LOCAL szChar[16]:BYTE LOCAL szTemp[256]:BYTE push edi push edx push ecx push ebx mov edi,rects assume edi: ptr ASCIIRECT mov edx,lParam movzx eax,dx mov pt.x,eax shr edx,16 mov pt.y,edx mov ecx,UpperBound mov ebx,sizeof ASCIIRECT sub edi,ebx _loop: add edi,ebx push ecx invoke PtInRect,addr [edi].rc, pt.x ,pt.y .if ( eax ) .if wOutput == IDC_RBN_HEX .if ([edi].index > 159) invoke wsprintf,addr szChar,addr FormatLongHex,[edi].index .else invoke wsprintf,addr szChar,addr FormatHex,[edi].index .endif invoke lstrcat,addr szChar,addr HSfx .elseif wOutput == IDC_RBN_OCT invoke byt2oct,byte ptr [edi].index,addr szChar .elseif wOutput == IDC_RBN_DEC invoke wsprintf,addr szChar,addr FormatDec,[edi].index .elseif wOutput == IDC_RBN_BIN invoke byt2bin_ex,byte ptr [edi].index,addr szChar invoke lstrcat,addr szChar,addr BSfx .endif invoke GetDlgItemText,hwnd,IDC_EDT_CLIP,addr szTemp,255 .if ( eax ) invoke lstrcat,addr szTemp,addr Comma invoke lstrcat,addr szTemp,addr szChar invoke SetDlgItemText,hwnd,IDC_EDT_CLIP,addr szTemp .else invoke SetDlgItemText,hwnd,IDC_EDT_CLIP,addr szChar .endif pop ecx jmp _exit .endif pop ecx dec ecx cmp ecx,0 jge _loop _exit: assume edi: nothing pop ebx pop ecx pop edx pop edi ret TypeSelected endp ;selects the rectangle under mouse cursor SelectCurrent proc hwnd:HWND,lParam:LPARAM LOCAL pt:POINT LOCAL bFound:BOOL LOCAL bInRects:BOOL LOCAL szBuffer[256]:BYTE push edi push edx push ecx push ebx mov bInRects,FALSE mov bFound,FALSE mov InMove,TRUE mov edi,rects assume edi: ptr ASCIIRECT mov edx,lParam movzx eax,dx mov pt.x,eax shr edx,16 mov pt.y,edx mov eax,dwRight mov edx,dwBottom .if (pt.x < 12 || pt.x > eax || pt.y < 12 || pt.y > edx) .if (RectCurrent != -1) invoke SetDlgItemText,hwnd,IDC_SBR_ASC,NULL push RectCurrent pop RectPrev mov RectCurrent,-1 mov bFound,TRUE jmp _exit .endif .endif mov ecx,UpperBound mov ebx,sizeof ASCIIRECT sub edi,ebx _loop: add edi,ebx push ecx invoke PtInRect,addr [edi].rc, pt.x ,pt.y .if ( eax ) mov bInRects,TRUE mov edx,[edi].index .if (edx != RectCurrent) .if edx < 33 add edx,101 invoke LoadString,hInstance,edx,addr szBuffer,255 invoke SetDlgItemText,hwnd,IDC_SBR_ASC,addr szBuffer .else invoke SetDlgItemText,hwnd,IDC_SBR_ASC,NULL .endif push RectCurrent pop RectPrev push [edi].index pop RectCurrent mov bFound,TRUE pop ecx jmp _exit .endif .endif pop ecx dec ecx cmp ecx,0 jge _loop .if ( !bInRects ) invoke PtInRect,addr rcBig,pt.x,pt.y .if ( eax ) invoke SetDlgItemText,hwnd,IDC_SBR_ASC,NULL push RectCurrent pop RectPrev mov RectCurrent,-1 mov bFound,TRUE jmp _exit .endif .endif _exit: assume edi: nothing .if ( bFound ) invoke RedrawWindow,hwnd,NULL,NULL,TRUE .endif mov InMove,FALSE pop ebx pop ecx pop edx pop edi ret SelectCurrent endp ;draws ASCII table PaintASCII proc hwnd:HWND local ps:PAINTSTRUCT local hdc:HDC local pt:POINT local rc:RECT local cnt:DWORD LOCAL sz:DWORD LOCAL br:HBRUSH LOCAL szBuffer[256]:BYTE LOCAL hSelBrush:HBRUSH LOCAL penBlue:HPEN push edi push edx push ebx mov InPaint,TRUE invoke BeginPaint,hwnd,addr ps mov hdc,eax invoke SelectObject,hdc,hMFont invoke SetBkMode,hdc,TRANSPARENT invoke GetSysColorBrush,COLOR_BTNSHADOW mov br,eax mov sz,sizeof ASCIIRECT mov edi,rects assume edi: ptr ASCIIRECT ; .if RectPrev != -1 ; invoke GetSysColorBrush,COLOR_BTNFACE ; mov hSelBrush,eax ; mov eax,RectPrev ; mov edx,sz ; mul edx ; invoke FillRect,hdc,addr [edi+eax].rc,hSelBrush ; .endif ; .if RectCurrent != -1 ; invoke GetStockObject,WHITE_BRUSH ; mov hSelBrush,eax ; mov eax,RectCurrent ; mov edx,sz ; mul edx ; invoke FillRect,hdc,addr [edi+eax].rc,hSelBrush ; .endif push UpperBound pop cnt sub edi,sz _loop: add edi,sz invoke FrameRect,hdc,addr [edi].rc,br .if ([edi].index > 32 && [edi].index < 128) invoke SetTextColor,hdc,COLOR_BLUE invoke DrawText,hdc,addr [edi].index,1,addr [edi].rc,DT_CENTER or DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX or DT_NOCLIP .elseif ([edi].index > 127) invoke SetTextColor,hdc,COLOR_BROWN invoke DrawText,hdc,addr [edi].index,1,addr [edi].rc,DT_CENTER or DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX or DT_NOCLIP .else invoke SetTextColor,hdc,COLOR_GREEN mov edx,[edi].index inc edx invoke LoadString,hInstance,edx,addr szBuffer,255 invoke DrawText,hdc,addr szBuffer,-1,addr [edi].rc,DT_CENTER or DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX or DT_NOCLIP .endif dec cnt cmp cnt,0 jge _loop assume edi: nothing invoke EndPaint,hwnd,addr ps mov InPaint,FALSE pop ebx pop edx pop edi Ret PaintASCII EndP ;inits array of rectangles InitRects proc hwnd:HWND LOCAL sz :DWORD LOCAL ind:DWORD LOCAL CellW:DWORD LOCAL JumpW:DWORD LOCAL CellH:DWORD LOCAL JumpH:DWORD LOCAL rc:RECT LOCAL rc1:RECT LOCAL rc2:RECT LOCAL Handle:HWND push edi push edx push ecx push ebx invoke GetClientRect,hwnd,addr rc mov eax,rc.right sub eax,rc.left sub eax,22 ;12 + 10 shr eax,4 sub eax,2 mov CellW,eax mov JumpW,eax add JumpW,2 invoke GetDlgItem,hwnd,IDC_GRP_OPTIONS mov Handle,eax invoke GetWindowRect,Handle,addr rc1 invoke GetDlgItem,hwnd,IDC_SBR_ASC mov Handle,eax invoke GetWindowRect,Handle,addr rc2 mov edx,rc1.bottom sub edx,rc1.top add edx,rc2.bottom sub edx,rc2.top mov eax,rc.bottom sub eax,rc.top sub eax,edx sub eax,22 ;12 + 10 shr eax,4 sub eax,2 mov CellH,eax mov JumpH,eax add JumpH,2 mov ind,0 ;lea edi,rects mov edi,rects assume edi:ptr ASCIIRECT xor ecx,ecx xor eax,eax add eax,12 mov sz,sizeof ASCIIRECT _loop1: xor ebx,ebx xor edx,edx add edx,12 _loop2: mov [edi].rc.left,edx mov [edi].rc.top,eax push edx add edx,CellW mov [edi].rc.right,edx pop edx push eax add eax,CellH mov [edi].rc.bottom,eax pop eax push ind pop [edi].index inc ind add edx,JumpW add edi,sz inc ebx cmp ebx,16 jl _loop2 add eax,JumpH inc ecx cmp ecx,16 jl _loop1 sub edi,sz invoke SetRect,addr rcBig,12,12,[edi].rc.right,[edi].rc.bottom assume edi:nothing pop ebx pop ecx pop edx pop edi ret InitRects endp ;stores needed sizes DefineSizes proc hwnd:HWND LOCAL sz :DWORD LOCAL rc:RECT push edi mov edi,rects assume edi:ptr ASCIIRECT mov sz,sizeof ASCIIRECT mov eax,255 mul sz push [edi+eax].rc.right pop dwRight push [edi+eax].rc.bottom pop dwBottom assume edi:nothing pop edi ret DefineSizes endp CreateStandardFont proc LOCAL ncm:NONCLIENTMETRICS mov ncm.cbSize,sizeof NONCLIENTMETRICS invoke SystemParametersInfo,SPI_GETNONCLIENTMETRICS,sizeof NONCLIENTMETRICS,addr ncm,NULL invoke RtlMoveMemory,addr m_LogFont,addr ncm.lfMessageFont,sizeof LOGFONT invoke CreateFontIndirect,addr m_LogFont mov hMFont,eax ret CreateStandardFont endp ;creates array for storing data CreateArray proc push edx mov eax,256 mov edx,sizeof ASCIIRECT mul edx invoke LocalAlloc,LMEM_ZEROINIT,eax mov hMem,eax invoke LocalLock,hMem mov rects,eax pop edx ret CreateArray endp ;erases array of data and frees up memory EraseArray proc invoke LocalUnlock,hMem invoke LocalFree,hMem mov hMem,0 ret EraseArray endp ;converts byte to octal characters byt2oct proc var:BYTE,lpBuffer:LPSTR push esi push edx xor eax,eax mov esi,lpBuffer mov [esi+4],al mov dl,OSfx mov [esi+3],dl xor edx,edx mov al,var mov dl,var and al,00000111b add al,48 mov [esi+2],al mov al,dl shr al,3 and al,00000111b add al,48 mov [esi+1],al mov al,dl shr al,6 and al,00000111b add al,48 mov [esi],al pop edx pop esi ret byt2oct endp ;insert string into editor window InsertChars proc hwnd:HWND local hEditor:HWND local chr:CHARRANGE local szBuffer[256]:BYTE invoke GetDlgItemText,hwnd,IDC_EDT_CLIP,addr szBuffer,255 invoke OutputString,addr szBuffer Ret InsertChars EndP NewFont proc hwnd:HWND LOCAL hdc:HDC LOCAL cf:CHOOSEFONT invoke RtlZeroMemory,addr cf,sizeof CHOOSEFONT mov cf.lStructSize,sizeof CHOOSEFONT invoke GetDC,hwnd mov hdc,eax push hdc pop cf.hDC push hwnd pop cf.hwndOwner push offset m_LogFont pop cf.lpLogFont mov cf.nSizeMin, 8 mov cf.nSizeMax, 72 mov cf.lpTemplateName, NULL mov cf.lpfnHook, NULL mov cf.Flags,CF_SCREENFONTS or CF_INITTOLOGFONTSTRUCT invoke ChooseFont,addr cf .if eax != 0 invoke ShowFontData,hwnd,m_LogFont.lfCharSet invoke DeleteObject,hMFont invoke CreateFontIndirect,addr m_LogFont mov hMFont,eax invoke SendMessage,hwnd,WM_ERASEBKGND,hdc,0 invoke RedrawWindow,hwnd,NULL,NULL,TRUE invoke ReleaseDC,hwnd,hdc .else invoke ReleaseDC,hwnd,hdc .endif ret NewFont endp ShowFontData proc hwnd:HWND,charset:DWORD LOCAL szData[256]:BYTE empty$ szData,256 invoke lstrcat,addr szData,addr m_LogFont.lfFaceName invoke lstrcat,addr szData,CADD(" - ") .if charset == DEFAULT_CHARSET invoke lstrcat,addr szData,CADD("Default") .elseif charset == SYMBOL_CHARSET invoke lstrcat,addr szData,CADD("Symbol") .elseif charset == OEM_CHARSET invoke lstrcat,addr szData,CADD("OEM") .elseif charset == ANSI_CHARSET invoke lstrcat,addr szData,CADD("ANSI") .elseif charset == RUSSIAN_CHARSET invoke lstrcat,addr szData,CADD("Cyrillic") .elseif charset == EE_CHARSET invoke lstrcat,addr szData,CADD("Central European") .elseif charset == GREEK_CHARSET invoke lstrcat,addr szData,CADD("Greek") .elseif charset == TURKISH_CHARSET invoke lstrcat,addr szData,CADD("Turkish") .elseif charset == BALTIC_CHARSET invoke lstrcat,addr szData,CADD("Baltic") .elseif charset == HEBREW_CHARSET invoke lstrcat,addr szData,CADD("Hebrew") .elseif charset == ARABIC_CHARSET invoke lstrcat,addr szData,CADD("Arabic") .elseif charset == SHIFTJIS_CHARSET invoke lstrcat,addr szData,CADD("Japanese") .elseif charset == HANGEUL_CHARSET invoke lstrcat,addr szData,CADD("Hangul") .elseif charset == GB2313_CHARSET invoke lstrcat,addr szData,CADD("Simplified Chinese") .elseif charset == CHINESEBIG5_CHARSET invoke lstrcat,addr szData,CADD("Traditional Chinese") .elseif charset == VIETNAMESE_CHARSET invoke lstrcat,addr szData,CADD("Vietnamese") .elseif charset == THAI_CHARSET invoke lstrcat,addr szData,CADD("Thai") .else invoke lstrcat,addr szData,CADD("Other") .endif invoke SetDlgItemText,hwnd,IDC_STC_FONT,addr szData ret ShowFontData endp
20.746106
125
0.703431
e5b2f43fbbb08b78d40f17b4b7149f42c3428eb7
228,310
asm
Assembly
smb3.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
smb3.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
smb3.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
.inesprg 16 ; 16x 16KB PRG code (32 banks of 8KB) .ineschr 16 ; 16x 8KB CHR data (128 banks of 1KB) .inesmap 4 ; mapper 4 = MMC3, 8KB PRG, 1/2KB CHR bank swapping .inesmir 0 ; background mirroring ; Verifies: ; \$[0-9A-F][0-9A-F][0-9A-F][0-9A-F] ; Translators: ; ; Standard S&R on any address found via: ; [BJ].. \$[0-9A-F][0-9A-F][0-9A-F][0-9A-F] ; ; Then do the following for address label fixing: ; (^\s*.*\s*); (PRG005_[0-9A-F][0-9A-F][0-9A-F][0-9A-F]) --> \n\2:\n\1 (Labels from comment to beginning of line) ; ^(\s*[BJ].. PRG005_[0-9A-F][0-9A-F][0-9A-F][0-9A-F]).* --> \1\n (Formatting linebreak after B.. J..) ; \s*;.* --> (nothing) (Cleans off remaining address constants) ; Handy pseudo instructions... only make sense in the context of CMPing a number... BLT .macro BCC \1 ; A < CMP (unsigned) .endm BGE .macro BCS \1 ; A >= CMP (unsigned) .endm BLS .macro BMI \1 ; A < CMP (signed) .endm BGS .macro BPL \1 ; A >= CMP (signed) .endm ; Clarifying pseudo instructions ADD .macro ; RegEx S&R "CLC.*\n.*?ADC" -> "ADD" CLC ADC \1 .endm SUB .macro ; RegEx S&R "SEC.*\n.*?SBC" -> "SUB" SEC SBC \1 .endm NEG .macro ; RegEx S&R "EOR #\$ff.*\n.*ADD #\$01" -> "NEG" EOR #$ff ADD #$01 .endm ; This is used in video update streams; since the video address register ; takes the address high-then-low (contrary to 6502's normal low-then-high), ; this allows a 16-bit value but "corrects" it to the proper endianness. vaddr .macro .byte (\1 & $FF00) >> 8 .byte (\1 & $00FF) .endm ; These are flags related to a video update stream value VU_VERT = $80 ; Update in vertical (+32B) mode instead of horizontal (+1B) mode VU_REPEAT = $40 ; Repeat following value several times instead of several raw values ; Provides a compilation-failing boundary check BoundCheck: .macro if \1 > \2 fail \3 boundary exceeded (> \2) endif .endm ; Pads bytes to align to nearest 64 byte boundary for DMC samples ; SB: This would be useful for your own works, but I can't use ; it in the natively disassembly since the assembler pads zeroes ; instead of $FF values... just FYI! ; ; Usage example: ; ; .LabelPriorToDMC: DMCAlign .LabelPriorToDMC DMCAlign: .macro .ds ((\1 + $3F) & $FFC0) - \1 .endm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; PPU I/O regs (CPU side) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; PPU_CTL1: ; 0-1: Name table address, changes between the four name tables at $2000 (0), $2400 (1), $2800 (2) and $2C00 (3). ; 2: Clear, PPU incs by 1 ("horizontal"); Set, PPU incs by 32 ("vertical") ; 3: Which pattern table holds for sprites; 0 for PT1 ($0000) or 1 for PT2 ($1000) ; 4: Which pattern table holds for BG; 0 for PT1 ($0000) or 1 for PT2 ($1000) ; 5: Set to use 8x16 sprites instead of 8x8 ; 7: Set to generate VBlank NMIs PPU_CTL1 = $2000 ; Write only ; PPU_CTL2: ; 0: Clear for color, set for mono ; 1: Clear to clip 8 left pixels of BG ; 2: Clear to clip 8 left pixels of sprites ; 3: If clear, BG hidden ; 4: If clear, sprites hidden ; 5-7: BG color in mono mode, "color intensity" in color mode (??) PPU_CTL2 = $2001 ; Write only ; PPU_STAT: ; 4: if set, can write to VRAM, else writes ignored ; 5: if set, sprite overflow occurred on scanline ; 6: Set if any non-transparent pixel of sprite 0 is overlapping a non-transparent pixel of BG ; 7: VBlank is occurring (cleared after read) PPU_STAT = $2002 ; Sprites: 256 bytes, each sprite takes 4, so 64 sprites total ; Only 8 sprites per scanline, sprite 0 is drawn on top (thus highest priority) ; PPU_SPR_ADDR / PPU_SPR_DATA ; * Byte 0 - Stores the y-coordinate of the top left of the sprite minus 1. ; * Byte 1 - Index number of the sprite in the pattern tables. ; * Byte 2 - Stores the attributes of the sprite. ; * Bits 0-1 - Most significant two bits of the colour. (Or "palette" 0-3) ; * Bit 5 - Indicates whether this sprite has priority over the background. ; * Bit 6 - Indicates whether to flip the sprite horizontally. ; * Bit 7 - Indicates whether to flip the sprite vertically. ; * Byte 3 - X coordinate PPU_SPR_ADDR = $2003 ; Set address sprite data PPU_SPR_DATA = $2004 ; Read or write this sprite byte PPU_SCROLL = $2005 ; Scroll register; read PPU_STAT, then write horiz/vert scroll PPU_VRAM_ADDR = $2006 ; VRAM address (first write is high, next write is low) PPU_VRAM_DATA = $2007 ; Data to read/write at this address ; Note that all transparent colors ($3F04, $3F08, $3F0C, $3F10, $3F14, $3F18 and $3F1C) are mirrored from 3F00 PPU_BG_PAL = $3F00 ; 3F00-3F0F PPU_SPR_PAL = $3F10 ; 3F10-3F1F ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; SOUND I/O regs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $4000(rct1)/$4004(rct2)/$400C(noise) bits ; --------------------------------------- ; 0-3 volume / envelope decay rate ; 4 envelope decay disable ; 5 length counter clock disable / envelope decay looping enable ; 6-7 duty cycle type (unused on noise channel) ; Duty cycles: ; 00 = a weak, grainy tone. (12.5% Duty), 01 = a solid mid-strength tone. (25% Duty), ; 10 = a strong, full tone (50% Duty), 11 = sounds a lot like 01 (25% Duty negated) PAPU_CTL1 = $4000 ; pAPU Pulse 1 Control Register. PAPU_CTL2 = $4004 ; pAPU Pulse 2 Control Register. PAPU_NCTL1 = $400C ; pAPU Noise Control Register 1. ; $4008(tri) bits ; --------------- ; 0-6 linear counter load register ; 7 length counter clock disable / linear counter start PAPU_TCR1 = $4008 ; pAPU Triangle Control Register 1. ; $4001(rct1)/$4005(rct2) bits ; -------------------------- ; 0-2 right shift amount ; 3 decrease / increase (1/0) wavelength ; 4-6 sweep update rate ; 7 sweep enable PAPU_RAMP1 = $4001 ; pAPU Pulse 1 Ramp Control Register. PAPU_RAMP2 = $4005 ; pAPU Pulse 2 Ramp Control Register. ; $4002(rct1)/$4006(rct2)/$400A(Tri) bits ; ------------------------------------- ; 0-7 8 LSB of wavelength PAPU_FT1 = $4002 ; pAPU Pulse 1 Fine Tune (FT) Register. PAPU_FT2 = $4006 ; pAPU Pulse 2 Fine Tune (FT) Register. PAPU_TFREQ1 = $400A ; pAPU Triangle Frequency Register 1. ; $400E(noise) bits ; ----------------- ; 0-3 playback sample rate ; 4-6 unused ; 7 random number type generation PAPU_NFREQ1 = $400E ; pAPU Noise Frequency Register 1. ; $4003(rct1)/$4007(rct2)/$400B(tri)/$400F(noise) bits ; -------------------------------------------------- ; 0-2 3 MS bits of wavelength (unused on noise channel) (the "high" frequency) ; 3-7 length of tone PAPU_CT1 = $4003 ; pAPU Pulse 1 Coarse Tune (CT) Register. PAPU_CT2 = $4007 ; pAPU Pulse 2 Coarse Tune (CT) Register. PAPU_TFREQ2 = $400B ; pAPU Triangle Frequency Register 2. PAPU_NFREQ2 = $400F ; pAPU Noise Frequency Register 2. ; $4010 - DMC Play mode and DMA frequency ; Bits 0-3: ; f period ; ---------- ; 0 $1AC ; 1 $17C ; 2 $154 ; 3 $140 ; 4 $11E ; 5 $0FE ; 6 $0E2 ; 7 $0D6 ; 8 $0BE ; 9 $0A0 ; A $08E ; B $080 ; C $06A ; D $054 ; E $048 ; F $036 ; Bits 6-7: this is the playback mode. ; 00 - play DMC sample until length counter reaches 0 (see $4013) ; x1 - loop the DMC sample (x = immaterial) ; 10 - play DMC sample until length counter reaches 0, then generate a CPU PAPU_MODCTL = $4010 ; pAPU Delta Modulation Control Register. PAPU_MODDA = $4011 ; pAPU Delta Modulation D/A Register. PAPU_MODADDR = $4012 ; pAPU Delta Modulation Address Register. PAPU_MODLEN = $4013 ; pAPU Delta Modulation Data Length Register. ; read ; ---- ; 0 rectangle wave channel 1 length counter status ; 1 rectangle wave channel 2 length counter status ; 2 triangle wave channel length counter status ; 3 noise channel length counter status ; 4 DMC is currently enabled (playing a stream of samples) ; 5 unknown ; 6 frame IRQ status (active when set) ; 7 DMC's IRQ status (active when set) ; ; write ; ----- ; 0 rectangle wave channel 1 enable ; 1 rectangle wave channel 2 enable ; 2 triangle wave channel enable ; 3 noise channel enable ; 4 enable/disable DMC (1=start/continue playing a sample;0=stop playing) ; 5-7 unknown PAPU_EN = $4015 ; R/W pAPU Sound Enable ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; OTHER I/O regs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SPR_DMA = $4014 ; Sprite DMA Register -- DMA from CPU memory at $100 x n to SPR-RAM (256 bytes) ; Read / Write Joypad 1/2: ; * Bit 0 - Reads data from joypad or causes joypad strobe ; when writing. ; * Bit 3 - Indicates whether Zapper is pointing at a sprite. ; * Bit 4 - Cleared when Zapper trigger is released. ; Only bit 0 is involved in writing. JOYPAD = $4016 ; Frame counter control ; Changes the frame counter that changes updates on sound; any write resets ; the frame counter, good for synchronizing sound with VBlank etc. ; 0 4, 0,1,2,3, 0,1,2,3,..., etc. ; 1 0,1,2,3,4, 0,1,2,3,4,..., etc. ; bit 6 - enable frame IRQs (when zero) ; bit 7 - 0 = 60 IRQs a frame / 1 = 48 IRQs a frame (obviously need bit 6 clear to use) ; Interestingly, both of the above are clear on bootup, meaning IRQs are being generated, ; but the 6502 ignores NMIs on startup; also, need to read from $4015 (PAPU_EN) to acknowledge ; the interrupt, otherwise it holds the status on! FRAMECTR_CTL = $4017 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MMC3 regs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MMC3_COMMAND: ; Bits 0-2 - Command number: ; * 0 - Swap two 1 KB VROM banks at PPU $0000. ; * 1 - Swap two 1 KB VROM banks at PPU $0800. ; * 2 - Swap one 1 KB VROM bank at PPU $1000. ; * 3 - Swap one 1 KB VROM bank at PPU $1400. ; * 4 - Swap one 1 KB VROM bank at PPU $1800. ; * 5 - Swap one 1 KB VROM bank at PPU $1C00. ; * 6 - Swap PRG-ROM bank at either $8000 or $C000 based on bit 6. ; * 7 - Swap PRG-ROM bank at either $A000 ; ; Bit 6 - If 0, enables swapping at $8000 and $A000, otherwise enables ; swapping at $C000 and $A000. (NOTE: This is what SMB3 uses, so we only ; have defs for this mode!) ; ; Bit 7 - If 1, causes addresses for commands 0-5 to be the exclusive-or ; of the address stated and $1000. ; Note that bit 6 is set on all of these consistently since SMB3 uses the PRG switch this way MMC3_2K_TO_PPU_0000 = %01000000 ; 0 MMC3_2K_TO_PPU_0800 = %01000001 ; 1 MMC3_1K_TO_PPU_1000 = %01000010 ; 2 MMC3_1K_TO_PPU_1400 = %01000011 ; 3 MMC3_1K_TO_PPU_1800 = %01000100 ; 4 MMC3_1K_TO_PPU_1C00 = %01000101 ; 5 MMC3_8K_TO_PRG_C000 = %01000110 ; 6 MMC3_8K_TO_PRG_A000 = %01000111 ; 7 MMC3_PPU_XOR_1000 = %10000000 MMC3_COMMAND = $8000 ; consult ref MMC3_PAGE = $8001 ; page number to MMC3_COMMAND MMC3_MIRROR = $A000 ; bit 0 clear is horizontal mirroring, bit 0 set is vertical mirroring MMC3_SRAM_EN = $A001 ; bit 7 set to enable SRAM at $6000-$7FFF MMC3_IRQCNT = $C000 ; Countdown to an IRQ MMC3_IRQLATCH = $C001 ; Store a temp val to be copied to MMC3_IRQCNT later MMC3_IRQDISABLE = $E000 ; Disables IRQ generation and copies MMC3_IRQLATCH to MMC3_IRQCNT MMC3_IRQENABLE = $E001 ; Enables IRQ generation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; SMB3 RAM DEFS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; (.*?)\s*=.*?; ; \t\1:\t\t.ds 1\t; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ZERO PAGE RAM COMMON ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Common use zero page RAM. Bytes in $75-$F3 are context-dependent .data ; SB: Using .data instead of .zp to export labels .org $00 ; For clarification, none of the other "Temp" vars are damaged by NMI, ; the NMI does employ Temp_Var1-3, and restores them when it's done. Temp_Var1: .ds 1 ; Temporary storage variable (protected from damage by NMI) Temp_Var2: .ds 1 ; Temporary storage variable (protected from damage by NMI) Temp_Var3: .ds 1 ; Temporary storage variable (protected from damage by NMI) Temp_Var4: .ds 1 ; Temporary storage variable Temp_Var5: .ds 1 ; Temporary storage variable Temp_Var6: .ds 1 ; Temporary storage variable Temp_Var7: .ds 1 ; Temporary storage variable Temp_Var8: .ds 1 ; Temporary storage variable Temp_Var9: .ds 1 ; Temporary storage variable Temp_Var10: .ds 1 ; Temporary storage variable Temp_Var11: .ds 1 ; Temporary storage variable Temp_Var12: .ds 1 ; Temporary storage variable Temp_Var13: .ds 1 ; Temporary storage variable Temp_Var14: .ds 1 ; Temporary storage variable Temp_Var15: .ds 1 ; Temporary storage variable Temp_Var16: .ds 1 ; Temporary storage variable VBlank_Tick: .ds 1 ; can be used for timing, or knowing when an NMI just fired off .ds 1 ; $11 unused Horz_Scroll_Hi: .ds 1 ; Provides a "High" byte for horizontally scrolling, or could be phrased as "current screen" PPU_CTL1_Mod: ; NOT DURING GAMEPLAY, this is used as an additional modifier to PPU_CTL1 Vert_Scroll_Hi: .ds 1 ; Provides a "High" byte for vertically scrolling (only used during vertical levels!) Level_ExitToMap: .ds 1 ; When non-zero, kicks back to map (OR to event when Player_FallToKing or Player_RescuePrincess is nonzero!) Counter_1: .ds 1 ; This value simply increments every frame, used for timing various things PPU_CTL2_Copy: .ds 1 ; Essentially a copy of PPU_CTL2, which updates it as well, though the sprite/BG visibility setting is usually (always?) forced on PAD_A = $80 PAD_B = $40 PAD_SELECT = $20 PAD_START = $10 PAD_UP = $08 PAD_DOWN = $04 PAD_LEFT = $02 PAD_RIGHT = $01 Pad_Holding: .ds 1 ; Active player's inputs (i.e. 1P or 2P, whoever's playing) buttons being held in (continuous) Pad_Input: .ds 1 ; Active player's inputs (i.e. 1P or 2P, whoever's playing) buttons newly pressed only (one shot) Roulette_RowIdx: .ds 1 ; Roulette Bonus Game only obviously ; Pal_Force_Set12: ; This overrides the normal palette routine of selecting by Level_Tileset and ; loading the color sets PalSel_Tile_Colors/PalSel_Obj_Colors. Setting ; Pal_Force_Set12 to a non-zero value will select as the index instead of ; Level_Tileset, and then it will copy the first two sets of 16 colors from ; the palette data as bg / sprite colors. FIXME is this used though?? Pal_Force_Set12: .ds 1 PlantInfest_ACnt: .ds 1 ; Plant infestation level animation counter VBlank_TickEn: .ds 1 ; Enables the VBlank_Tick decrement and typically other things like joypad reading Map_Enter2PFlag: .ds 1 ; If $00, entering level, otherwise set if entering 2P VS mode Map_EnterViaID: .ds 1 ; Overrides whatever spot on the map you entered with something special (see Map_DoEnterViaID) .ds 1 ; $1F unused ; $20 has a lot of different uses on the World Map... Map_EnterLevelFX: ; When entering a level on the map, dictates the status of the entry (0=None, 1=Boxing in, 2=Boxing out [J only]) NOTE: Overlap/reuse Map_IntBoxErase: ; Used for determining where in erasing the "World X" intro box we are NOTE: Overlap/reuse Map_ClearLevelFXCnt: ; Counter for "clear level" FX occurring (1-6: Poof, 7-9: Flip) ("poof"/"panel flip") NOTE: Overlap/reuse Map_ScrollOddEven: .ds 1 ; Toggles odd/even column as it scrolls .ds 1 ; $21 unused Level_Width: .ds 1 ; Width of current level, in screens (0 = don't move at all, max is 15H/16V) ; In horizontal "typical" levels, Scroll_ColumnR/L are a column and ; levels are rendered in vertical stripes by these start points Scroll_ColumnR: .ds 1 ; ($23) Current tile column (every 16px) of right side of screen (non-vertical level style ONLY) Scroll_ColumnL: .ds 1 ; ($24) Current tile column (every 16px) of left side of screen (non-vertical level style ONLY) .org $23 ; NOTE, the following two are also $23/$24 ; In vertical style levels, Scroll_VOffsetT/B are an offset into the ; visible tile grid, and levels are rendered in horizontal strips Scroll_VOffsetT: .ds 1 ; ($23) Current tile offset (every 16px) of top of screen (vertical level style ONLY) Scroll_VOffsetB: .ds 1 ; ($24) Current tile offset (every 16px) of bottom of screen (vertical level style ONLY) Scroll_ColorStrip: .ds 54 ; $25-$5A This stores a strip of just the upper 2 bits of a tile ($00, $40, $80, $C0) to produce attribute info Scroll_LastDir: .ds 1 ; 0=screen last moved right (or up, if vertical), 1=screen last moved left (or down, if vertical) Scroll_RightUpd: ; Indicates every 8 pixels update going to the right, or $FF if screen moves left Scroll_VertUpd: .ds 1 ; Indicates every 8 pixels update up or down, in vertical levels Scroll_LeftUpd: .ds 1 ; Indicates every 8 pixels update going to the left, or $FF if screen moves right ; Prepares to perform a Video_Update when possible, indexes the "Video_Upd_Table" ; in PRG030 OR Video_Upd_Table2 in PRG025 (whichever is currently in context) ; Also resets the graphics buffer afterward, since the RAM buffer is ; constantly being called to possibly perform its own updates after this value ; resets to zero. Graphics_Queue: .ds 1 .ds 1 ; $5F unused .ds 1 ; $60 unused Level_LayPtr_AddrL: .ds 1 ; Low byte of address to tile layout (ORIGINAL stored in Level_LayPtrOrig_AddrL) Level_LayPtr_AddrH: .ds 1 ; High byte of address to tile layout (ORIGINAL stored in Level_LayPtrOrig_AddrH) ; Typical use pair at $63/$64 Map_Tile_AddrL: .ds 1 ; Low byte of tile address Map_Tile_AddrH: .ds 1 ; High byte of tile address .org $63 ; NOTE, the following two are also $63/$64, bonus game context BonusText_BaseL: .ds 1 ; Instruction text base address low BonusText_BaseH: .ds 1 ; Instruction text base address high Level_ObjPtr_AddrL: .ds 1 ; Low byte of address to object set (ORIGINAL stored in Level_ObjPtrOrig_AddrL) Level_ObjPtr_AddrH: .ds 1 ; High byte of address to object set (ORIGINAL stored in Level_ObjPtrOrig_AddrH) .ds 1 ; $67 unused .ds 1 ; $68 unused Video_Upd_AddrL: .ds 1 ; Video_Misc_Updates routine uses this as an address, low byte Video_Upd_AddrH: .ds 1 ; Video_Misc_Updates routine uses this as an address, hi byte Music_Base_L: .ds 1 ; Current music segment base address low byte Music_Base_H: .ds 1 ; Current music segment base address high byte Sound_Sqr_FreqL: .ds 1 ; Calculated square wave frequency for Note On (low byte) Sound_Sqr_FreqH: .ds 1 ; Calculated square wave frequency for Note On (high byte) Sound_Map_EntrV: .ds 1 ; Current index into the volume ramp-down table used exclusively for the "level enter" sound Sound_Map_EntV2: .ds 1 ; Same as Sound_Map_EntrV, only for the second track Music_PatchAdrL: .ds 1 ; Music current patch address low byte Music_PatchAdrH: .ds 1 ; Music current patch address high byte Sound_Map_Off: .ds 1 ; Current "offset" within a map sound effect ; ASSEMBLER BOUNDARY CHECK, END OF ZERO PAGE PRE CONTEXT @ $74 .BoundZP_PreCtx: BoundCheck .BoundZP_PreCtx, $74, Zero Page ; NOTE: $75 - $F3 are context specific; see contexts below .org $F4 Scroll_OddEven: .ds 1 ; 0 or 1, depending on what part of 8 pixels has crossed (need better description) Controller1Press: .ds 1 ; Player 1's controller "pressed this frame only" (see Controller1 for values) Controller2Press: .ds 1 ; Player 2's controller "pressed this frame only" (see Controller2 for values) Controller1: .ds 1 ; Player 1's controller inputs -- R01 L02 D04 U08 S10 E20 B40 A80 Controller2: .ds 1 ; Player 2's controller inputs -- R01 L02 D04 U08 S10 E20 B40 A80 .ds 1 ; $F9 unused .ds 1 ; $FA unused .ds 1 ; $FB unused Vert_Scroll: .ds 1 ; Vertical scroll of name table; typically at $EF (239, basically showing the bottom half) Horz_Scroll: .ds 1 ; Horizontal scroll of name table .ds 1 ; $FE unused PPU_CTL1_Copy: .ds 1 ; Holds PPU_CTL1 register data ; ASSEMBLER BOUNDARY CHECK, END OF ZERO PAGE @ $100 .BoundZP: BoundCheck .BoundZP, $100, Zero Page ; NOTE: CONTEXT -- Page 0 RAM changes meaning depending on the "context", i.e. what state ; of the game we're currently in! This means that variables are defined with overlapping ; addresses, and care must be taken to use the correct labels depending on the code! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ZERO PAGE RAM: TITLE SCREEN / ENDING CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $75 ; $75-$F3 is available for this context-dependent situation ; Title screen "objects", which includes Mario, Luigi, and the assortment of other things ; The following are the offsets from any of the object arrays: ; 0 = Mario, 1 = Luigi, 2 = Starman, 3 = Mushroom, 4 = Super Leaf, 5 = Goomba, 6 = Buzzy Beatle, 7 = Koopa shell ; Note that some of this is used for the engine (especially in the Princess's chamber) but some of it is ; different (especially during the montage) so consider the overlapped variables in the next section Title_XPosHi: .ds 8 ; $75-$7C "High" part of the extended precision X position for all objects Title_YPosHi: .ds 8 ; $7D-$84 "High" part of the extended precision X position for all objects Title_ObjX: .ds 8 ; $85-$8C Title screen object X positions Title_ObjY: .ds 8 ; $8D-$94 Title screen object Y positions Title_ObjXVel: .ds 8 ; $95-$9C X velocities of title screen objects (4.4FP) Title_ObjYVel: .ds 8 ; $9D-$A3 Y velocities of title screen objects Title_XPosFrac: .ds 8 ; $A5-$AC X position extended precision of objects (provides 4-bit fixed point) Title_YPosFrac: .ds 8 ; $AD-$B4 Y position extended precision of objects (provides 4-bit fixed point) Title_ObjYVelChng: .ds 2 ; $B5-$B6 Mario / Luigi change in Y velocity flag Title_ObjMLFlags: .ds 2 ; $B7-$B8 Mario / Luigi Sprite flags Title_ObjMLMoveDir: .ds 1 ; 0 = No move, 1 = Left, 2 = Right .ds 1 ; $BA unused Title_ObjMLAnimFrame: .ds 2 ; $BB-$BC Mario / Luigi animation frame Title_ObjMLDirTicks: .ds 2 ; $BD-$BE Mario / Luigi animation ticks Title_ObjMLSprite: .ds 2 ; $BF-$C0 Mario / Luigi next sprite to display Title_ObjMLPower: .ds 2 ; $C1-$C2 Mario / Luigi current powerup (0 = Small, 1 = Big, 2 = Leaf) Title_ObjMLSprRAMOff: .ds 2 ; $C3-$C4 Mario / Luigi Defines a Sprite_RAM offset for Mario / Luigi Title_ObjMLSprVis: .ds 2 ; $C5-$C6 Mario / Luigi sprite sliver visibility bits (generated by Title_MLDetermineSpriteVis) Title_ObjMLTailTick: .ds 2 ; $C7-$C8 Mario / Luigi tail wagging tick Title_ObjMLHold: .ds 2 ; $C9-$CA Mario / Luigi holding something flag (when non-zero) Title_ObjMLBonkTick: .ds 2 ; $CB-$CC Mario / Luigi use "bonked" frame while > 0 Title_ObjMLKickTick: .ds 2 ; $CD-$CE Mario / Luigi use kicking frame while > 0 Title_ObjMPowerDown: .ds 1 ; Mario power down animation counter Title_ObjMLStop: .ds 1 ; Flag used briefly to "hold" Mario/Luigi from moving so they get a "running start" Title_CurMLIndex: .ds 1 ; 0 for Mario, 1 for Luigi Title_ObjFlags: .ds 6 ; $D2-$D7 Minor objects' sprite flags Title_ObjStates: .ds 6 ; $D8-$DD Title screen array of states for the individual objects (NOT including Mario/Luigi) Title_State: .ds 1 ; 00 = Prior to red curtain rise, 01 = Rising curtain... Title_ResetCnt: .ds 1 ; Title reset counter -- when on the menu, once this hits zero, the title sequence restarts Title_ResetCnt2: .ds 1 ; when this goes to zero, it decrements Title_ResetCnt Title_ResetTrig: .ds 1 ; when non-zero, resets title screen Title_UnusedFlag: .ds 1 ; doesn't seem to do anything useful but not do the "skip" state if Player presses START early on the title screen Title_Ticker: .ds 1 ; Tick counter for title screen intro "movie" Title_MActScriptPos: .ds 1 ; Offset within Mario's action script Title_LActScriptPos: .ds 1 ; Offset within Luigi's action script Title_MActScriptDelay: .ds 1 ; Mario's action script delay until next event Title_LActScriptDelay: .ds 1 ; Luigi's action script delay until next event Title_MActScriptDirSet: .ds 1 ; Mario's action script Buffer for last queue command (sets respective "Title_ObjMLDir" variable) Title_LActScriptDirSet: .ds 1 ; Luigi's action script Buffer for last queue command (sets respective "Title_ObjMLDir" variable) Title_ObjMLDir: .ds 2 ; $EA-$EB Mario / Luigi vector direction bitfield (1 = Left, 2 = Right, 4 = Down, 8 = Up, $10 = Sprite behind BG, $80 = Tail wagging) Title_ObjMLQueue: .ds 2 ; $EC-$ED Mario / Luigi queue to do something ($04 = Luigi's rebound off Mario, $10 = Kick shell, $20 = Begin carrying, $40 = Clear carry/bonk, do kick) Title_EventIndex: .ds 1 ; Title background event index (dynamic jump index for events on the title Title_EventGrafX: .ds 1 ; Title background current graphic index to load (loads items from Video_Upd_Table2 in PRG025) Title_ObjInitIdx: .ds 1 ; Current title screen "event" ID during the intro scene with Mario and Luigi Title_ObjInitDly: .ds 1 ; Timer count before next object init Title_3GlowFlag: .ds 1 ; When non-zero, begins the "glowing" effect for the big '3' Title_3GlowIndex: .ds 1 ; Index into an array of colors to cause the big '3' on the title screen to glow ; ASSEMBLER BOUNDARY CHECK, END OF CONTEXT @ $F5 .BoundZP_Title: BoundCheck .BoundZP_Title, $F5, Zero Page Title Screen Context ; Ending-specific vars -- NOTE that Ending system uses some of the Title Screen code, so these variables overlap some of the above ; Basically don't assume anything here is free space without consulting above as well... .org $75 Ending2_PicState: .ds 1 ; Ending part 2 picture loader state Ending2_ClearLen: .ds 1 ; Length of clear run Ending2_ClearPat: .ds 1 ; Pattern to clear the screen with Ending2_PicVRAMH: .ds 1 ; Ending part 2 picture VRAM Hi Ending2_PicVRAML: .ds 1 ; Ending part 2 picture VRAM Hi Ending2_QCmdEnd: .ds 1 ; Ending2_QueueCmd is incremented to this point Ending2_FadeTimer: .ds 1 ; Timer which controls the speed of the fade between worlds Ending2_QueueCmd: .ds 1 ; incremented after posting, up to Ending2_QCmdEnd Ending2_TimerH: .ds 1 ; Ending part 2 timer "high" part Ending2_TimerL: .ds 1 ; Ending part 2 timer "low" part Ending2_CurWorld: .ds 1 ; Current world we're showing (8 = THE END) .org $D2 Ending_Timer: .ds 2 ; $D2-$D3 Twin ending timers, generally one for Mario and one for Princess EndText_Timer: .ds 1 ; Timer used for the ending text display Ending_State: .ds 1 ; Current state value for initial part of ending (the princess, prior to curtain) EndText_VL: .ds 1 ; Princess speech VRAM Address Low EndText_VH: .ds 1 ; Princess speech VRAM Address High EndText_CPos: .ds 1 ; Princess speech Character Position EndText_State: .ds 1 ; Princess speech state variable .org $F4 Ending2_IntCmd: .ds 1 ; used during ending to buffer out the ending picture data on the interrupt. Triggers "Do_Ending2_IntCmd" in PRG024 in interrupt context. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ZERO PAGE RAM: WORLD MAP CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $75 ; $75-$F3 is available for this context-dependent situation World_Map_Y: .ds 2 ; $75-$76 (Mario/Luigi) Y pixel coordinate position of Mario on world map World_Map_XHi: .ds 2 ; $77-$78 (Mario/Luigi) X pixel (hi byte) coordinate position of Mario on world map World_Map_X: .ds 2 ; $79-$7A (Mario/Luigi) X pixel (lo byte) coordinate position of Mario on world map World_Map_Move: .ds 2 ; $7B-$7C (Mario/Luigi) Movement left in specified direction (even numbers only!) World_Map_Dir: .ds 2 ; $7D-$7E (Mario/Luigi) Specified travel direction (8=Up, 4=Down, 2=Left, 1=Right) Map_UnusedPlayerVal: .ds 2 ; $7F-$80 (Mario/Luigi) Set for each Player to $20 when returning to map, but apparently unused otherwise! .ds 1 ; $81 unused .ds 1 ; $82 unused .ds 1 ; $83 unused Map_UnusedPlayerVal2: .ds 2 ; $84-$85 (Mario/Luigi) Apparently unused at all, but backed up and persisted on the world map ; All the WarpWind vars are shared with the HandTrap; they share code, too... Map_WWOrHT_Y: .ds 1 ; Warp Whistle wind or Hand Trap Y position Map_HandTrap_XHi: .ds 1 ; Hand Trap X Hi (most vars are shared with warp wind, but technically not this one!) Map_WWOrHT_X: .ds 1 ; Warp Whistle wind or Hand Trap X position Map_WWOrHT_Cnt: .ds 1 ; Warp Whistle wind or Hand Trap counter Map_WWOrHT_Dir: .ds 1 ; Direction the Warp Whistle wind travels (0 = right, 1 = left) ; Double use Map_WarpWind_FX: ; 1 - 4 is the warp whistle effect Map_StarFX_State: .ds 1 ; 0 - 2 NOTE: Shared with Map_WarpWind_FX World_Map_Twirl: .ds 1 ; If set, Mario is "twirling" .ds 1 ; $8D unused ; When Player is "skidding" backward (from death or "twirling" from game over continuation) Map_Skid_DeltaY: .ds 1 ; Delta applied directly to Y Map_Skid_DeltaFracY: .ds 1 ; Fractional delta Y Map_Skid_FracY: .ds 1 ; Fractional Y accumulator .ds 1 ; $91 unused Map_Skid_DeltaX: .ds 1 ; Delta applied directly to X Map_Skid_DeltaFracX: .ds 1 ; Fractional delta X Map_Skid_FracX: .ds 1 ; Fractional X accumulator Map_Skid_FracCarry: .ds 1 ; Fractional carry over accumulator (I think?) Map_Skid_Count: .ds 1 ; Just a ticker controlling the display frame of the twirl Map_Skid_Counter: .ds 1 ; Map_Skid_TravDirs -- specifies which way Player must "twirl" to get to the destination ; Bit 0 Set = Player must travel to the right versus the left ; Bit 1 Set = Player must travel downward versus upward Map_Skid_TravDirs: .ds 1 .ds 1 ; $99 unused .ds 1 ; $9A unused Map_StarsX: .ds 8 ; $9B-$A2 During World Intro, X position of each star Map_StarsY: .ds 8 ; $A3-$AA During World Intro, Y position of each star Map_StarsOutRad: .ds 1 ; During World Intro, stars take off radius (0 = smallest, increments for larger) .ds 1 ; $AC unused .ds 1 ; $AD unused .ds 1 ; $AE unused Map_StarsXSteps: .ds 1 ; During World Intro, number of "steps" remaining in the X position adjustment Map_StarsRadCnt: .ds 1 ; During World Intro, adds $70 per display frame and adds 1 to the radius when it overflows Map_StarsCenterX: .ds 1 ; During World Intro, X center of stars Map_StarsCenterY: .ds 1 ; During World Intro, Y center of stars Map_StarsDeltaR: .ds 1 ; During World Intro, delta to the star radii Map_StarsConst9: .ds 1 ; During World Intro, ... Constant 9? .ds 1 ; $B5 unused Map_StarsAnimCnt: .ds 1 ; During World Intro, a simple counter that adds 32 per frame and toggles Map_StarsFrame when it overflows Map_StarsFrame: .ds 1 ; During World Intro, "frame" of stars (0/1) Map_StarsPattern: .ds 1 ; During World Intro, stars current VROM pattern Map_StarsLandRad: .ds 1 ; During World Intro, stars landing radius (0 = largest, increments for smaller) Map_StarsYSteps: .ds 1 ; During World Intro, number of "steps" remaining in the Y position adjustment .ds 1 ; $BB unused Map_StarsRadius: .ds 8 ; $BC-$C3 During World Intro, each star's "radius" position (each radius position is 0-31) Map_StarsState: .ds 1 ; 0 = Stars coming out from center, 1 = Stars moving in towards Player start Map_SkidBack: .ds 1 ; Player is skidding back (Map_Player_SkidBack stores whether they skidded on their last turn at all) .ds 1 ; $C6 unused Map_UnusedGOFlag: .ds 1 ; Set at map initialization or if Player gets Game Over and selects CONTINUE/END, no apparent purpose .ds 1 ; $C8 unused .ds 1 ; $C9 unused .ds 1 ; $CA unused .ds 1 ; $CB unused Map_Intro_CurStripe: .ds 1 ; Current stripe of the "World X" intro box to be erased (0 - 7) Map_Intro_NTOff: .ds 1 ; Offset into nametable for erasing the "World X" intro box Map_Intro_ATOff: .ds 1 ; Offset into the attribute table for erasing the "World X" intro box Map_Airship_DC: .ds 1 ; set to 1 when the Airship knows where it's going Map_Airship_DY: .ds 1 ; Airship delta between current and target Y coordinate Map_Airship_YNib: .ds 1 ; Map_Airship_DY shifts out its lower 4 bits as upper 4 bits to this value Map_Airship_YAcc: .ds 1 ; Additional Y accumulator when traveling Map_Airship_DXHi: .ds 1 ; Airship delta between current and target X Hi coordinate Map_Airship_DX: .ds 1 ; Airship delta between current and target X coordinate Map_Airship_XNib: .ds 1 ; Map_Airship_DXHi/Map_Airship_DX shifts out its lower 4 bits as upper 4 bits to this value Map_Airship_Dir: .ds 1 ; Airship horizontal travel direction in bit 0, vertical direction in bit 1 Map_HideObj: .ds 1 ; used for completion) MapPoof_Y: .ds 1 ; When using a power-up, "poof" appears at this Y coordinate MapPoof_X: .ds 1 ; When using a power-up, "poof" appears at this X coordinate Map_UseItem: .ds 1 ; Flag to signal that item is to be used .ds 10 ; $DB-$E4 unused World_Map_Tile: .ds 1 ; Current tile index Mario is standing on .ds 1 ; $E6 unused .ds 1 ; $E7 unused .ds 1 ; $E8 unused Scroll_Temp: .ds 1 ; Scroll hold value .ds 1 ; $EA unused .ds 1 ; $EB unused Player_WalkFrame: .ds 1 ; relative, not the same as Player_Frame .ds 7 ; $ED-$F3 unused ; ASSEMBLER BOUNDARY CHECK, END OF CONTEXT @ $F4 .BoundZP_Map: BoundCheck .BoundZP_Map, $F4, Zero Page World Map Context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ZERO PAGE RAM: BONUS GAME CONTEXT (see PRG022 for lots more info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $75 ; $75-$F3 is available for this context-dependent situation .ds 22 ; $75-$8A unused BonusCoins_State: .ds 1 .ds 59 ; $8C-$C6 unused BonusDie_Y: .ds 1 ; UNUSED Bonus Game Die (1-6) Y position BonusDie_X: .ds 1 ; UNUSED Bonus Game Die (1-6) X position BonusDie_YVel: .ds 1 ; UNUSED Bonus Game Die Y Velocity (when it departs) BonusDie_YVelFrac: .ds 1 ; UNUSED Bonus Game Die Y Velocity fractional accumulator .ds 41 ; $CB-$F3 unused ; ASSEMBLER BOUNDARY CHECK, END OF CONTEXT @ $F4 .BoundZP_Bonus: BoundCheck .BoundZP_Bonus, $F4, Zero Page Bonus Context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ZERO PAGE RAM: 2P VS CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $75 ; $75-$F3 is available for this context-dependent situation Vs_State: .ds 1 ; 2P Vs Mode state Vs_IsPaused: .ds 1 ; If set, 2P Vs is paused .ds 125 ; $77-$F3 unused ; ASSEMBLER BOUNDARY CHECK, END OF CONTEXT @ $F4 .BoundZP_Vs: BoundCheck .BoundZP_Vs, $F4, Zero Page 2P Vs Context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ZERO PAGE RAM: GAMEPLAY CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $75 ; $75-$F3 is available for this context-dependent situation ; There's a consistent difference of $12 between X and Y; this consistent distancing is meant to be maintained, so leave it alone! Player_XHi: .ds 1 ; Player X Hi Objects_XHi: .ds 8 ; $76-$7D Other object's X Hi positions .ds 1 ; $7E unused ; Reuse of $7F CineKing_DialogState: ; Toad & King Cinematic: When 1, we're doing the text versus the dialog box itself ; NOTE!! This object var is OBJECT SLOT 0 - 4 ONLY! Objects_Var4: .ds 5 ; $7F-$83 Generic variable 4 for objects SLOT 0 - 4 ONLY ; Pipe_PlayerX/Y variables in use when traveling through pipes Pipe_PlayerX: .ds 1 ; Stores Player's X when they went into pipe (non-transit) Pipe_PlayerY: .ds 1 ; Stores Player's Y when they went into pipe (non-transit, aligned to nearest 16, minus 1) .org $84 ; NOTE, the following two are also $84/$85 ; Otherwise, they are replaced with a lookup address Level_GndLUT_Addr: .ds 2 .ds 1 ; $86 unused Player_YHi: .ds 1 ; Player Y Hi Objects_YHi: .ds 8 ; $88-$8F Other object's Y Hi positions Player_X: .ds 1 ; Player X Objects_X: .ds 8 ; $91-$98 Other object's X positions .ds 1 ; $99 unused ; Reuse of $9A CineKing_Var: ; General variable Objects_Var5: .ds 8 ; $9A-$A1 Generic variable 5 for objects Player_Y: .ds 1 ; Player Y Objects_Y: .ds 8 ; $A3-$A9 Other object's Y positions Player_SpriteX: .ds 1 ; Player's sprite X Objects_SpriteX: .ds 8 ; $AC-$B3 Other object's sprite X positions Player_SpriteY: .ds 1 ; Player's sprite Y Objects_SpriteY: .ds 8 ; $B5-$BC Other object's sprite Y positions ; WARNING: The distance between Player/Objects_XVel and Player/Objects_YVel must be same as Player/Objects_X/YVelFrac! Player_XVel: .ds 1 ; Player's X Velocity (negative values to the left) (max value is $38) Objects_XVel: .ds 8 ; $BE-$C5 Other object's X velocities Objects_VarBSS: .ds 7 ; $C6-$CC OBJECT SLOTS 0 - 5 ONLY ... uncleared var?? SlotIndexBackup: .ds 1 ; Used as a backup for the slot index (e.g. current object, current score, etc.) Player_HaltGame: .ds 1 ; Player is halting game (e.g. dying, shrinking/growing, etc.) ; WARNING: The distance between Player/Objects_XVel and Player/Objects_YVel must be same as Player/Objects_X/YVelFrac! Player_YVel: .ds 1 ; Player's Y Velocity (negative values upward) Objects_YVel: .ds 8 ; $D0-$D7 Other object's Y velocities Player_InAir: .ds 1 ; When set, Player is in the air ; Reuse of $D9 CineKing_Frame2: ; Used only by the World 6 King (Seal juggling a crown, the crown's frame) ; Objects_DetStat: ; Object's detection bits: ; $01-hit wall right ; $02-hit wall left ; $04-hit ground ; $08-hit ceiling ; $80-object touching "32 pixel partition" floor (if active) Objects_DetStat: .ds 8 ; $D9-$E0 on screen Player_SprWorkL: .ds 1 ; Sprite work address low Player_SprWorkH: .ds 1 ; Sprite work address high .ds 1 ; $E3 unused Level_TileOff: .ds 1 ; Tile mem offset Level_Tile: .ds 1 ; Temporary holding point for a detected tile index Player_Slopes: .ds 3 ; for sloped levels only (3 bytes allocated, but only one actually used) ; *NOTE: Code at PRG030_9EDB clears Player_Slopes+1 and Player_Slopes+2, but these are never used! .ds 1 ; $E9 unused .ds 1 ; $EA unused Player_XStart: .ds 1 ; Set to Player's original starting X position (also used to check if level has initialized) .ds 1 ; $EC unused ; Player_Suit -- Player's active powerup (see also: Player_QueueSuit) PLAYERSUIT_SMALL = 0 PLAYERSUIT_BIG = 1 PLAYERSUIT_FIRE = 2 PLAYERSUIT_RACCOON = 3 PLAYERSUIT_FROG = 4 PLAYERSUIT_TANOOKI = 5 PLAYERSUIT_HAMMER = 6 PLAYERSUIT_SUPERSUITBEGIN = PLAYERSUIT_FROG ; Marker for when "Super Suits" begin PLAYERSUIT_LAST = PLAYERSUIT_HAMMER ; Marker for "last" suit (Debug cycler needs it) Player_Suit: .ds 1 Player_Frame: .ds 1 ; Player display frame Player_FlipBits: .ds 1 ; Set to $00 for Player to face left, Set to $40 for Player to face right Player_WagCount: .ds 1 ; after wagging raccoon tail, until this hits zero, holding 'A' keeps your fall rate low Player_IsDying: .ds 1 ; 0 = Not dying, 1 = Dying, 2 = Dropped off screen, 3 = Death due to TIME UP .ds 1 ; $F2 unused Obj01_Flag: .ds 1 ; Not sure what Obj01 is!! This blocks its left/right handler logic. ; ASSEMBLER BOUNDARY CHECK, END OF CONTEXT @ $F4 .BoundZP_Game: BoundCheck .BoundZP_Game, $F4, Zero Page Gameplay Context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $1xx LOW STACK VARIABLES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; These are actually "bottom" of the stack; I don't think this is normally recommended. ; but this is probably to keep them "safe" from other RAM clearing routines, since they directly effect the IRQ. ; The debug flag in particular is pretty precariously placed, and under some kind of heavy call stack, seems like ; there's risk it could be set by accident... but I guess this never happens... ? .data .org $0100 Update_Select: .ds 1 ; Changes which path of "update routines" are selected; $00 = ??, $20 = Title Screen, $40 = Spade Game, $80 = Vertical level, $A0 = 32 pixel partition, $C0 = Normal Raster_Effect: .ds 1 ; $00 is standard status bar, $20 is title/ending, $40 = 32 pixel partition, $60 = Spade Bonus Game (3 sliding rows), $80 is nothing (e.g. as in 2P versus), $A0 = ??? .org $0160 Debug_Flag: .ds 1 ; Set to $80 by the debug menu, enables debug functionality like power level cycling and not dying from time over ; Main NES SRAM begin .data ; SB: Using .data instead of .bss to export labels ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $2xx SPRITE RAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0200 ; \$02([0-9A-F][0-9A-F]) ; Sprite_RAM+$\1 ; Sprite memory is laid out in four bytes: ; Byte 0 - Stores the y-coordinate of the top left of the sprite minus 1. ; Byte 1 - Index number of the sprite in the pattern tables. ; Byte 2 - Stores the attributes of the sprite. ; * Bits 0-1 - Most significant two bits of the colour. ; * Bit 5 - Indicates whether this sprite has priority over the background. ; * Bit 6 - Indicates whether to flip the sprite horizontally. ; * Bit 7 - Indicates whether to flip the sprite vertically. ; Byte 3 - X coordinate Sprite_RAM: .ds 256 ; $0200 - $02FF; This is where sprite memory is stored locally prior to being DMA'ed ; Relevant flags SPR_PAL0 = %00000000 SPR_PAL1 = %00000001 SPR_PAL2 = %00000010 SPR_PAL3 = %00000011 SPR_BEHINDBG = %00100000 SPR_HFLIP = %01000000 SPR_VFLIP = %10000000 ; ASSEMBLER BOUNDARY CHECK, END OF SPRITE RAM .Bound_SprRAM: BoundCheck .Bound_SprRAM, $0300, Sprite RAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $03xx RAM (Largely graphics updating / control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0300 Graphics_BufCnt: .ds 1 ; first byte holds current position within buffer (Graphics_Buffer+) to store info Graphics_Buffer: .ds 107 ; $0301-$036B Simple (and small!) delayed write buffer; uses same format as Video_Upd_Table in PRG030, get format info there TileChng_VRAM_H: .ds 1 ; High part of VRAM address to change TileChng_VRAM_L: .ds 1 ; Low part of VRAM address to change TileChng_Pats: .ds 4 ; $036E-$0371 The four patterns required to change a tile (for Level_ChgTileEvent) Level_SizeOrig: .ds 1 ; Holds original size (width or height) of level (in screens) Level_PipeExitDir: .ds 1 ; Direction Player is going to exit from a pipe (1 = Up, 2 = Down, 3 = Right, 4 = Left, 5 = In-level Transit) Level_7VertCopy: .ds 1 ; Just seems to be an unmaintained copy of Level_7Vertical from level load, but that's it Level_PipeNotExit: .ds 1 ; If set, pipes do NOT exit to map (i.e. as in pipe junctions) Level_PauseFlag: .ds 1 ; Set to 0 when not paused, or 1 when paused Level_SkipStatusBarUpd: .ds 1 ; When set, skips updating the status bar for one frame (priority graphics buffer changes I think) Raster_State: .ds 1 ; This variable's meaning depends on the Raster_Effect in use; typically 0 is first pass, then more for further scanlines .ds 7 ; $0379-$037F unused Scroll_ToVRAMHi: .ds 1 ; High byte for when pushing a column of tile data to VRAM (Set to $20, Name Table 0, after scroll update) ; $381 dual use Scroll_LastCol8: ; Last 8x8 block column that was updated (non-vertical level ONLY) Scroll_LastOff8: .ds 1 ; Last 8x8 block offset that was updated (vertical level style ONLY) Scroll_PatStrip: .ds 54 ; $0382-$03B7 (may be less?) This stores a strip of 8x8 blocks, (non-vertical level: top to bottom with 2 columns), to render the next 16 pixel "sliver" of screen space Scroll_ToVRAMHA: .ds 1 ; High byte for when pushing attribute data to VRAM (Set to $23, attribute table 0) Scroll_LastAttr: .ds 1 Scroll_AttrStrip: .ds 14 ; $03BA-$03C7 (may be less?) This stores a 2x2 block of attribute coloring data World_Num_Debug: .ds 1 ; When debug mode is activated (KKKZSPIU), this is the world you select to start on Map_StarsDeltaX: .ds 1 ; Delta the stars move in X to reach the Player (always positive, code figures direction) Map_StarsDeltaY: .ds 1 ; Delta the stars move in Y to reach the Player (always positive, code figures direction) .ds 16 ; $03CB-$03DA unused Map_Stars_PRelX: .ds 1 ; During world intro, screen relative position of Player X Map_Stars_PRelY: .ds 1 ; During world intro, screen relative position of Player Y Player_Power: .ds 1 ; >>>>>>[P] charge level ($7F max) ; Level_JctCtl is configured when you enter a door or a pipe ; * When $80, use current values for Level_AltLayout and Level_AltObjects ; * When otherwise non-zero (inc $80), skips setting vertical start position ; ; Normal values for the junction: ; 0 - Disables junction (i.e. no junction occurring) ; 1 - Junction initialization ; 2 - Big Question Block bonus area ; 3 - General purpose junction (as specified by Level_AltLayout and Level_AltObjects) ; 4 - Generic level exit (where you come up from a pipe in the generic exit area) ; 5 - Special Toad House (used for the 1-3 warp whistle) Level_JctCtl: .ds 1 Level_JctFlag: .ds 1 ; Toggles when you junction .ds 1 ; $03E0 unused Map_DrawPanState: .ds 1 ; Map draw/pan state ObjGroupRel_Idx: .ds 1 ; Holds relative index of object within its group (see PRG000_CA51) InvFlip_VAddrHi: .ds 1 ; Hi byte of VRAM address during inventory flip modifications .ds 1 ; $03E4 unused ; CLOSING ; 0: Erase old status bar complete, palette changed to blue ; 1: Draw top bar (at middle) ; 2: Draw bottom bar (at middle) ; 3: Erase top bar (at middle) ; 4: Draw top middle row of normal status bar/cards ; 5: Draw bottom middle row of normal status bar/cards ; 6: Draw top bar (at top) ; 7: Draw bottom bar (at bottom) ; OPENING ; 8: Erase old status bar complete, palette changed to yellow ; 9: Draw top bar (at middle) ; 10: Draw bottom bar (at middle) ; 11: Erase top bar (at middle) ; 12: Erase bottom bar (at middle) ; 13: Draw top middle row of inventory ; 14: Draw bottom middle row of inventory ; 15: Draw top bar (at top) ; 16: Draw bottom bar (at bottom) InvFlip_Frame: .ds 1 ; Sort of a "frame" of animation during flipping of the inventory box; 0-7 during closing, 8-15 during opening InvFlip_Counter: .ds 1 ; 0 = Closed, 4 = Fully Open InvStart_Item: .ds 1 ; Starting inventory item; typ. $00, $07, $0E, $15 (Rows 1-4) InvHilite_X: .ds 1 ; Current hilite position X coordinate InvHilite_Item: .ds 1 ; Which item in the current row is highlighted, 0-6 THouse_ID: .ds 1 ; An unused ID value that would track boxes already opened in a Toad House (concept unused!) ; Treasure type you'll get at this Toad House ; 0 = INVALID ; 1 = Warp Whistle ; 2 = P-Wing ; 3 = Frog ; 4 = Tanooki ; 5 = Hammer ; 6 = Random Super Suit ; 7 = Random Basic Item THouse_Treasure: .ds 1 Coins_Earned: .ds 1 ; A "buffer" of coins earned to be added to your total, actual coinage stored in Inventory_Coins[2] Map_Powerup_Poof: .ds 1 ; Counter that handles the "poof" effect when a powerup is used on the map (requires Inventory to be open, and forces it to close afterward) ; Level_FreeVertScroll ; 0 = Screen locked at $EF (lowest point) unless flying or climbing a vine ; 1 = Free vertical scroll ; 2 = Locked at arbitrary point (i.e. whatever Vert_Scroll is, it stays there) Level_FreeVertScroll: .ds 1 Level_7Vertical: .ds 1 ; Set in World 7 vertical type levels Level_SelXStart: .ds 1 ; Selects X starting position when level begins (valid values 0-3) UPDATERASTER_32PIXPART = 1 ; 32 pixel partition; common use is for levels with water along the bottom UPDATERASTER_SPADEGAME = 2 ; Spade game sliders UPDATERASTER_WATERLINE = 3 ; "Water line" mode (described at ObjHorzAutoScroller_Init) UPDATERASTER_32PIXSHOWSPR= $80 ; If NOT set, hides sprites that fall beneath the partition (i.e. for fixed water effect) Update_Request: .ds 1 ; This changes the current Raster_Effect and Update_Select and doesn't persist Map_Starman: .ds 1 ; Player used a Starman! Map_Power_Disp: .ds 1 ; This is the powerup currently DISPLAYED on the map; it should be the same as $0746 World_Map_Power, except for Judgem's Cloud Map_Warp_PrevWorld: .ds 1 ; The world you're coming FROM when warping (also used as output from warp zone what world you're going to) ; ASSEMBLER BOUNDARY CHECK, END OF $03xx .Bound_0300: BoundCheck .Bound_0300, $0400, $03xx ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $04xx WORLD MAP CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $0400-$04CF (except $0461 and $0462, see "$04xx RAM SOUND/MUSIC ENGINE") is available for this context-dependent situation ; $0400-$0443 unused in either of the following cases ; Doing double .org's because of major overlap, but be careful! .org $0447 ; W8D = World 8 Darkness; overlaps the vars used by the entrance transition Map_W8D_VAddrH: .ds 1 .ds 3 ; $0448-$044A unused Map_W8D_VAddrL: .ds 1 .ds 5 ; $044C-$0450 unused Map_W8D_VAddrH2: .ds 1 .ds 1 ; $0452 unused Map_W8D_VAddrL2: .ds 1 .ds 1 ; $0454 unused Map_W8D_TileOff: .ds 1 ; In-tile offset (0 = upper left, 1 = lower left, 2 = upper right, 3 = lower right) .ds 2 ; $0456-$0457 unused Map_W8D_YOff: .ds 1 ; Y Offset from Player when doing darkness Map_W8D_XOff: .ds 1 ; X Offset from Player when doing darkness Map_W8D_RC: .ds 1 ; Row in the upper bits, column in the lower bits Map_W8D_Dir: .ds 1 ; Direction of travel in darkness (1 = Right, 2 = Left, 4 = Down, 8 = Up) Map_W8D_X: .ds 1 Map_W8D_Y: .ds 1 Map_W8D_Idx: .ds 1 ; ASSEMBLER BOUNDARY CHECK, CONTEXT END OF $04D0 .BoundW8D_04D0: BoundCheck .BoundW8D_04D0, $04D0, $04xx range World Map Entrance Transition context .org $0444 ; Entrance transition; overlaps with above ; NOTE: Memory is cleared from here to +$1C, $460 ; For border arrays, 0-3: Top 0, bottom 1, right 2, left 3 Map_EntTran_VLHalf: .ds 1 ; When 1, offset starts vertically "lower half" (at $F0 of first screen) Map_EntTran_TBCnt: .ds 1 ; decreasing counter as the transition moves inward top/bottom Map_EntTran_LRCnt: .ds 1 ; decreasing counter as the transition moves inward left/right Map_EntTran_BVAddrH: .ds 4 ; $0447-$044A Each border's current high part of VRAM address Map_EntTran_BVAddrL: .ds 4 ; $044B-$044E Each border's current low part of VRAM address Map_EntTran_BorderLoop: .ds 1 ; Border loop counter Map_EntTran_Cnt: .ds 1 Map_EntTran_VAddrH: .ds 1 ; high part of VRAM address to modify Map_EntTran_VAddrHAdj: .ds 1 ; An adjusted version of the high address as needed to wrap (used in removed "box out" version only) Map_EntTran_VAddrL: .ds 1 ; low part of VRAM address to modify Map_EntTran_TileOff: .ds 1 ; Offset into tile memory (used in removed "box out" version only) Map_EntTran_Tile8x8: .ds 1 ; Offset to which 8x8 pattern of the tile we're grabbing that we need (used in removed "box out" version only) Map_EntTran_VRAMGap: .ds 1 ; Sets gap (i.e. 1 for vertical, 32 for horizontal; used in removed "box out" version only) .ds 8 ; $0457-$045E unused Map_EntTran_Temp: .ds 1 ; Seems to me a multi-purpose value in entrance transition Map_EntTran_InitValIdx: .ds 1 ; Selects an index of values to initialize by ; ASSEMBLER BOUNDARY CHECK, CONTEXT END OF $04D0 .BoundET_04D0: BoundCheck .BoundET_04D0, $04D0, $04xx range World Map Entrance Transition context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $04xx BONUS GAME CONTEXT (see PRG022 for lots more info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0400 ; $0400-$04CF (except $0461 and $0462, see "$04xx RAM SOUND/MUSIC ENGINE") is available for this context-dependent situation ; WARNING: $0400-$04CF gets cleared at end of bonus game! Roulette_Pos: .ds 3 ; $0400-$0402 horizontal position of each row Roulette_PosHi: .ds 3 ; $0403-$0405 Hi part of Roulette_Pos Roulette_ShapeLock: .ds 3 ; $0406-$0408 Locked position of each row (0 = Mushroom, 1 = Flower, 2 = Mushroom, 3 = Star) Roulette_ConfigRun: .ds 1 ; 0 = Configuring, 1 = Running Roulette_ConfigState: .ds 1 ; Early configuration state Roulette_RunState: .ds 1 ; Running state of game ; NOTE: Watch the reuse here... Roulette_StopState: ; $040C-$040E Current "state" of each row while it is coming to a stop (1+) Roulette_xUpY: .ds 1 ; "x Up" display Y position (overlaps first byte of Roulette_StopState) Roulette_LivesToGive: .ds 1 ; Lives left to give in reward (overlaps second byte of Roulette_StopState) .ds 1 ; Third byte of Roulette_StopState Roulette_Speed: .ds 3 ; $040F-$0411 Movement speed of each row (4.4FP) Roulette_StopCnt: .ds 3 ; $0412-$0414 Decrements to zero while each row is stopping Roulette_PosFrac: .ds 3 ; $0415-$0417 Fractional accumulator for position of row 1-3 .ds 1 ; $0418 unused Roulette_Turns: .ds 1 ; UNUSED "Turns Remaining" (if > 0, and you lose Roulette, hit a button and spin again!) .ds 12 ; $041A-$0425 unused ; UNUSED "Prize" that appears in some varities of the lost bonus games ; (Or that's my best guess anyway.) BMF54123's patch shows these as ; Mushroom, Flower, Star, or Judgem's Cloud. Perhaps it was a situation ; like "Here's the prize on the table, if you can get it"... Card_SelectX: ; Card cursor X (NOTE: Shared with Bonus_PrizeX) Bonus_PrizeX: .ds 1 ; UNUSED Prize sprite X Card_SelectY: ; Card cursor Y (NOTE: Shared with Bonus_PrizeY) Bonus_PrizeY: .ds 1 ; UNUSED Prize sprite Y Card_Index: ; Currently selected card in "N-Spade" Card game (NOTE: Shared with Bonus_CurBufOffset) Bonus_CurBufOffset: .ds 1 ; Offset in graphics buffer while generating instruction box Card_FirstIndex: .ds 1 ; Card_Index of the first card you flipped (in case you get it wrong on the second...) Bonus_Round2: ; UNUSED Picks which "Round 2" game would be played (NOTE: Shared with Card_SelectXOrig) Card_SelectXOrig: .ds 1 ; Card cursor original X Card_MoveDelay: .ds 1 ; Decrements to zero; if not zero, can't move on N-Spade game Card_SprRAMOff: .ds 1 ; Sprite RAM offset after cursor is drawn; for drawing card flip Card_AnimTick: .ds 1 ; Animation tick, decrements to zero Card_VRAM_L: .ds 1 ; Low part of VRAM address of N-Spade card to modify Card_VRAM_H: .ds 1 ; High part of VRAM address of N-Spade card to modify Card_FlipCount: .ds 1 ; +1 for every card flip Card_MatchCard: .ds 1 ; Card to match, i.e. the first card you selected of the pair Card_UnusedVL: .ds 1 ; ?? Some VRAM Low; Seems to only be part of an unused routine Card_UnusedVH: .ds 1 ; ?? Some VRAM High; Seems to only be part of an unused routine ; Bonus_GameHost ; 0 = Toad Host: The only one we ever got ; All others are UNUSED... ; 1 = Koopa Troopa Host + "Prize" Game ; 2 = Koopa Troopa Host, no "Prize" Game ; 3 = Hammer Bro Bonus_GameHost: ; NOTE: Shared with Card_GameState Card_GameState: .ds 1 ; State of N-Spade card game Card_TurnsRemain: .ds 1 ; Number of turns remaining Card_FlipFrame: .ds 1 ; Frame of flipping card ; The next three vars belong to an unused routine @ PRG022:DA62; unclear what it did exactly Card_UnusedArray: .ds 4 ; $0437-$043A ?? Card_UnusedAttr: .ds 1 ; Seems to only be part of an unused routine; attribute table offset of some sort Card_UnusedArrIdx: .ds 1 ; Seems to only be part of an unused routine; index for Card_UnusedArrIdx Card_Matches: .ds 1 ; Matches (local, this round; Seems to only be used as part of the unused routine) Card_CoinsToGive: .ds 1 ; If greater than zero, coins are being given .ds 1 ; $043F unused ; Bonus_GameState ; ; 0 = ? ; 1 = Giving instructions die game ; 2 = Rotating "die" ; 3 = Coin spurt prize ; 4 = Stopped die ; 5 = Die flies away ; 6 = ?? Initialize instructions? ; 7 = Giving instructions ; 8 = Pause before proceeding ; 9 = Exiting Bonus_GameState: .ds 1 Card_InitState: .ds 1 ; Initialization state of N-Spade card game ; Bonus_GameType ; This appears to determine what game you're about to play. ; This also reveals some of the greatest questionable loss in SMB3... ; When this value is anything besides 1 or 2, it plays what I SUPPOSE ; was a "roulette" game? With a fixed graphics patch, it appears to ; be a die cycling 1-6. ; ; 0 = Japanese text, translated as: ; If "1" appears, 1 (?) ; If "2" appears, I'll give you a key ; Otherwise, I'll give you coins. ; 1 = Standard Spade game (UNUSED BONUS GAMES NOTE: May have once been the "odd" game spoken of in type 5) ; 2 = N-Spade (UNUSED BONUS GAMES NOTE: May have once been the "even" game spoken of in type 5) ; 3: .ds 1 ; I suspect this is a placeholder ('C' being the 3rd) ; 4: .ds 1 ; I suspect this is a placeholder ('D' being the 4th) ; 5 = Japanese: "If an odd number appears, I'll let you play the Roulette Game." ; 6 = Japanese: "If an even number appears, I'll let you play the Card Game." ; 7 = Japanese: "2, return (?)" ; ; The "unused" ones are just guesses (where even possible) based on the ; semi-translated "greetings" for the sake of tracking... BONUS_UNUSED_KEYCOIN = 0 BONUS_SPADE = 1 ; Line up images Spade game BONUS_NSPADE = 2 ; Card matching N-Spade game BONUS_UNUSED_CCCC = 3 BONUS_UNUSED_DDDD = 4 ; Unused placeholder (I think), but does actually set something when it exits! BONUS_UNUSED_ODDROULETTE= 5 BONUS_UNUSED_EVENCARD = 6 BONUS_UNUSED_2RETURN = 7 ; MAY have been Koopa Troopa's "Prize" Game... Bonus_GameType: .ds 1 Bonus_KTPrize: .ds 1 ; UNUSED Koopa Troopa's "Prize" Game Prize ID (0 = Mushroom, 1 = Star, 2 = Flower, 3 = Judgem's, by BMF54123's patch) ; $0444-$04CF unused in this context (excluding $0461 and $0462, see "$04xx RAM SOUND/MUSIC ENGINE") ; ASSEMBLER BOUNDARY CHECK, CONTEXT END OF $04D0 .BoundBonus_04D0: BoundCheck .BoundBonus_04D0, $04D0, $04xx range Bonus context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $04xx GAMEPLAY CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0400 ; $0400-$04CF (except $0461 and $0462, see "$04xx RAM SOUND/MUSIC ENGINE") is available for this context-dependent situation .ds 27 ; $0400-$041A unused Fade_State: .ds 1 ; 0 = Nothing, 1 = Fade in, 3 = Fade out Fade_Tick: .ds 1 ; Ticks down and then decrements Fade_Level Fade_Level: .ds 1 ; 4 to 0, fade in level FadeOut_Cancel: .ds 1 ; If set, the next attempted fade out will be cancelled, which then resets this to zero Player_AllowAirJump: .ds 1 ; Counts down to zero, but while set, you can jump in the air Player_XVelAdj: .ds 1 ; Applies additional value to the X Velocity CineKing_Frame: ; King's animation frame (NOTE: Shared with Objects_Var7 first byte) Objects_Var7: .ds 8 ; $0421-$0428 General object variable 7 ; $0429-$04CF unused in this context (excluding $0461 and $0462, see "$04xx RAM SOUND/MUSIC ENGINE") ; ASSEMBLER BOUNDARY CHECK, CONTEXT END OF $04D0 .BoundGame_04D0: BoundCheck .BoundGame_04D0, $04D0, $04xx range Bonus context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $04xx RAM SOUND/MUSIC ENGINE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0461 ; $0461-$0462 are reserved for use by the sound/music engine ; These ought to be moved into the greater range to spare this area... ; $04EB and $04EC are unused, good place for these vars!! Level_MusicQueue: .ds 1 ; Requests a song from Set 2A/B (used to allow delayed start) Level_MusicQueueRestore: .ds 1 ; What to "restore" the BGM to when it changes (e.g. Starman, P-Switch, etc.) .org $04D0 ; $04D0-$04FF is reserved for use by the sound/music engine ; Lower ranges are context-dependent Music_TriTrkPos: .ds 1 ; Offset of triangle track in currently playing index Music_NseTrkPos: .ds 1 ; Offset of noise track in currently playing index Music_PCMTrkPos: .ds 1 ; Offset of DMC track in currently playing index Music_Sq2RestH: .ds 1 ; Square 2 Track hold for rest values to be applied after each event Music_Sq2Rest: .ds 1 ; Square 2 Track "Rest" period (counts down to zero) Music_Sq2NoteLen: .ds 1 ; Square 2 Track length of note (counts down to zero, cuts off sound) Music_Sq1Rest: .ds 1 ; Square 1 Track "Rest" period (counts down to zero) Music_Sq1NoteLen: .ds 1 ; Square 1 Track length of note (counts down to zero, cuts off sound) Music_TriRestH: .ds 1 ; Triangle Track hold for rest values to be applied after each event Music_TriRest: .ds 1 ; Triangle Track "Rest" period (counts down to zero) Music_NoiseRest: .ds 1 ; Noise Track "Rest" period (counts down to zero) Music_NseRestH: .ds 1 ; Noise Track hold for rest values to be applied after each event Music_DMCRest: .ds 1 ; DMC Track "Rest" period (counts down to zero) Music_DMCRestH: .ds 1 ; DMC Track hold for rest values to be applied after each event Music_PCMStart: .ds 1 ; Holds the starting offset of the DMC track Music_NextIndex: .ds 1 ; Next "index" to be played SFX_Counter1: .ds 1 ; Generic purpose SFX counter SndCur_Player: .ds 1 ; Currently playing Player sound (blocks music on Square 1) SndCur_Level1: .ds 1 ; Currently playing "level 1" sound (blocks music on Square 2) SndCur_Level2: .ds 1 ; Currently playing "level 2" sound SndCur_Music1: .ds 1 ; Currently playing BGM from Music 1 set SndCur_Music2: .ds 1 ; Currently playing BGM from Music 2 set SndCur_Map: .ds 1 ; Currently playing map sound (blocks music on Square 1) SndCur_Pause: .ds 1 ; Holds copy of Sound_QPause, to play sound while everything else is paused SFX_Counter2: .ds 1 ; Generic purpose SFX counter for level sounds SFX_Counter3: .ds 1 ; Generic purpose SFX counter SFX_Counter4: .ds 1 ; Generic purpose SFX counter .ds 1 ; $04EB unused .ds 1 ; $04EC unused Sound_IsPaused: .ds 1 ; When set, sound processing is PAUSED .ds 1 ; $04EE ununsed .ds 1 ; $04EF ununsed .ds 1 ; $04F0 ununsed ; For any of these queues, the value is a bit value, which offers ; a simple prioritization system; lowest value plays over any other ; Queue Player sound effects SND_PLAYERJUMP = $01 ; Jump SND_PLAYERBUMP = $02 ; Bump SND_PLAYERSWIM = $04 ; Swim / Squish SND_PLAYERKICK = $08 ; Kick SND_PLAYERPIPE = $10 ; Pipe / shrink SND_PLAYERFIRE = $20 ; Fireball SND_PLAYERPOWER = $40 ; Full power ringing (must be constantly set or you don't hear it) SND_PLAYERFROG = $80 ; frog hop Sound_QPlayer: .ds 1 ; Queue Level sound effects 1 SND_LEVELCOIN = $01 ; Coin SND_LEVELRISE = $02 ; Powerup rising from block SND_LEVELVINE = $04 ; Vine rising SND_LEVELBABOOM = $08 ; Cannon fire SND_LEVELBLIP = $10 ; Text "type" sound / card select SND_LEVELPOWER = $20 ; Power up SND_LEVEL1UP = $40 ; 1-up SND_LEVELPOOF = $80 ; Lost suit / wand shot SND_LEVELUNK = $90 ; Unknown / lost sound SND_LEVELSHOE = $A0 ; Lost Kuirbo's Shoe SND_LEVELTAILWAG= $B0 ; Tail wag Sound_QLevel1: .ds 1 ; Queue Level sound effects 2 SND_LEVELCRUMBLE= $01 ; Crumbling brick SND_LEVELFLAME = $02 ; Flame jet SND_BOOMERANG = $04 ; Boomerang SND_LEVELAIRSHIP= $08 ; Airship fly SND_LEVELMARCH = $10 ; Hammer Bros. march around ; $20 - Unused ; $40 - Unused SND_LEVELSKID = $80 ; Skid Sound_QLevel2: .ds 1 ; Queue music request 1 ; The following I've grouped into "Set 1" (which play song index 0-7): MUS1_PLAYERDEATH = $01 ; Player death MUS1_GAMEOVER = $02 ; Game over MUS1_BOSSVICTORY = $04 ; Victory normal MUS1_WORLDVICTORY = $08 ; Victory super (King reverted, Bowser defeated, etc.) MUS1_BOWSERFALL = $10 ; Bowser dramatic falling MUS1_COURSECLEAR = $20 ; Course Clear MUS1_TIMEWARNING = $40 ; Time Warning (attempts to speed up song playing) MUS1_STOPMUSIC = $80 ; Stops playing any music Sound_QMusic1: .ds 1 ; Queue music request 2 ; The following I've grouped into "Set 2A": MUS2A_WORLD1 = $01 ; World 1 MUS2A_WORLD2 = $02 ; World 2 MUS2A_WORLD3 = $03 ; World 3 MUS2A_WORLD4 = $04 ; World 4 MUS2A_WORLD5 = $05 ; World 5 MUS2A_WORLD6 = $06 ; World 6 MUS2A_WORLD7 = $07 ; World 7 MUS2A_WORLD8 = $08 ; World 8 MUS2A_SKY = $09 ; Coin Heaven / Sky World / Warp Zone (World 9) MUS2A_INVINCIBILITY = $0A ; Invincibility MUS2A_WARPWHISTLE = $0B ; Warp whistle MUS2A_MUSICBOX = $0C ; Music box MUS2A_THRONEROOM = $0D ; King's room MUS2A_BONUSGAME = $0E ; Bonus game MUS2A_ENDING = $0F ; Ending music ; The following I've grouped into "Set 2B": MUS2B_OVERWORLD = $10 ; Overworld 1 MUS2B_UNDERGROUND = $20 ; Underground MUS2B_UNDERWATER = $30 ; Water MUS2B_FORTRESS = $40 ; Fortress MUS2B_BOSS = $50 ; Boss MUS2B_AIRSHIP = $60 ; Airship MUS2B_BATTLE = $70 ; Hammer Bros. battle MUS2B_TOADHOUSE = $80 ; Toad House MUS2B_ATHLETIC = $90 ; Overworld 2 MUS2B_PSWITCH = $A0 ; P-Switch MUS2B_BOWSER = $B0 ; Bowser MUS2B_WORLD8LETTER = $C0 ; Bowser's World 8 Letter MUS2B_MASK = $F0 ; Not intended for use in code, readability/traceability only Sound_QMusic2: .ds 1 ; Queue map sound effects SND_MAPENTERWORLD = $01 ; World begin starry entrance sound SND_MAPPATHMOVE = $02 ; Path move SND_MAPENTERLEVEL = $04 ; Enter level SND_MAPINVENTORYFLIP = $08 ; Flip inventory SND_MAPBONUSAPPEAR = $10 ; Bonus appears ; $20: ?? unused ? ; $40: ?? unused ? SND_MAPDENY = $80 ; Denied Sound_QMap: .ds 1 ; Queue pause sound PAUSE_STOPMUSIC = $01 ; Pause sound effect (like pressing START, pauses music!) PAUSE_RESUMEMUSIC = $02 ; Resume sound (resumes music) Sound_QPause: .ds 1 DMC_Time: .ds 1 ; Time remaining on DMC sound Music_Sq1RestH: .ds 1 ; Square 1 Track hold for rest values to be applied after each event Music_Sq1AltRamp: .ds 1 ; When Square 1 track encounters a $00 byte, it actives a ramping mode, the value of which is stored here Music_LOST4FB: .ds 1 ; AFAIK, value in music engine that is "lost"; nothing seems to set it, and it doesn't do very much (possibly was a note length override??) Music_LOST4FC: .ds 1 ; AFAIK, value in music engine that is "lost"; nothing seems to set it, and it doesn't do very much Music_RestH_Base: .ds 1 ; Base offset into Music_RestH_LUT Music_Sq2TrkOff: .ds 1 ; Offset of square wave 2 track in currently playing index Music_Sq1TrkOff: .ds 1 ; Offset of square wave 1 track in currently playing index ; ASSEMBLER BOUNDARY CHECK, CONTEXT END OF $04D0 .BoundSound_0500: BoundCheck .BoundSound_0500, $0500, $04xx Sound Engine ; NOTE: CONTEXT -- RAM in the $500-$5FF range changes meaning depending on the "context", i.e. what ; state of the game we're currently in! This means that variables are defined with overlapping ; addresses, and care must be taken to use the correct labels depending on the code! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $05xx TITLE SCREEN CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0500 ; $0500-$05FF is available for this context-dependent situation .ds 16 ; $0500-$050F unused ; NOTE: All of this block is cleared by the title screen Title_MLAccelCnt: .ds 1 ; constant moving counter which overflows to provide a more "natural" acceleration to the Bros Title_MarioPoof: .ds 1 ; countdown of Mario's "poof" when he collects the power up Title_MLHoldTick: .ds 1 ; Set to $40 when Mario/Luigi are "held" (count down to zero) Title_ObjVar: .ds 6 ; $513-$518 Minor objects user-defined variable 1 (automatically decrements if not zero!) Title_ObjVar2: .ds 6 ; $519-$51E Minor objects user-defined variable 2 Title_ObjFrame: .ds 6 ; $51F-$524 Minor object "frame"; adds 2x the value here to the pattern selection for the object's sprites ; $0525-$05FF unused ; ASSEMBLER BOUNDARY CHECK, END OF $0600 .BoundTS_0600: BoundCheck .BoundTS_0600, $0600, $05xx Title Screen context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $5xx MAP CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0500 ; $0500-$05FF is available for this context-dependent situation ; NOTE: Most of the memory in this space is shared with Gameplay Context ; so don't assume that any value that should be spared is safe in here... ; NOTE: There are 8 defined "core" map objects, but up to 15 (?) can exist! ; *** Index 1 is assumed reserved for the Airship, however... Map_Object_ActY: .ds 15 ; $0500-$050E For map objects, their actual display Y coordinate (as it may modify, esp. with marchers) Map_Object_ActX: .ds 15 ; $050F-$051D For map objects, their actual display X coordinate (as it may modify, esp. with marchers) Map_Object_ActXH: .ds 15 ; $051E-$052C For map objects, their actual display X Hi byte (as it may modify, esp. with marchers) Map_Object_Data: .ds 15 ; $052D-$053B For marching objects, 0/1 for their direction, could be anything though Map_March_Count: .ds 15 ; $053C-$054A Simply counts and overflows, but used to determine position of marching map objects (PER ID, not object index ... Actually is seems they go back and forth on that??) .ds 60 ; $054B-$0586 unused Map_Objects_Vis: .ds 15 ; $0587-$058E Set for map objects as visible, clear if it's not Map_MarchInit: .ds 1 ; Set when marching data has been initialized (done once per marching cycle on the map) Map_InCanoe_Flag: .ds 1 ; Set when Player is in Canoe (modifies movement, allows movement in water, etc.) World_8_Dark: .ds 1 ; Darkness on World 8 Map, level 2 -- counts 0-7 while setting up the effect World_Map_AnimF: .ds 1 ; World map animation frame (for bushes, etc.) World_Map_AnimT: .ds 1 ; World map animation tick ; $059B-$05FF unused ; ASSEMBLER BOUNDARY CHECK, END OF $0600 .BoundM_0600: BoundCheck .BoundM_0600, $0600, $05xx World Map context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $5xx BONUS GAME CONTEXT (see PRG022 for lots more info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0500 ; $0500-$05FF is available for this context-dependent situation .ds 231 ; $0500-$05E6 unused BonusText_VH: .ds 1 BonusText_VL: .ds 1 ; $05E9-$05FF unused ; ASSEMBLER BOUNDARY CHECK, END OF $0600 .BoundBonus_0600: BoundCheck .BoundBonus_0600, $0600, $05xx World Map context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $5xx GAMEPLAY CONTEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0500 ; $0500-$05FF is available for this context-dependent situation .ds 16 ; $0500-$050F unused ; Event_Countdown is context dependent; without context, does nothing ; * When you come out of a pipe, this counter decrements until the pipe should be finished ; * When you die, counts down until dropping back to map ; NOTE: Event_Countdown and the following 7 are all decremented together! Event_Countdown: .ds 1 Player_TailCount: .ds 1 ; Determines display frame of tail wag Player_InAir_OLD: .ds 1 ; Stores backup of Player_InAir Player_FireCount: ; Player shoots fireball/hammer, sets sprite frame (shared with Player_FrogHopCnt) Player_FrogHopCnt: .ds 1 ; Counter used for frog hopping along the ground (shared with Player_FireCount) .ds 1 ; $0514 unused Player_PMeterCnt: .ds 1 ; Tick counter used to count when to increase/decrease Power Meter B10Coin_Timer: .ds 1 ; Decrements until zero, which is how much time you have to get the max coins from a 10 coin block Player_TailAttack: .ds 1 ; Initiailized to $12; counts down to zero, performs tail attack! CineKing_Timer: ; Timer; decrements to zero (shares Objects_Timer first byte) Objects_Timer: .ds 8 ; $0518-$051F "Timer" values; automatically decrements to zero ; NOTE: Until Timer2 expires, object will not hit other objects. ; Probably used as a dampener to keep an object from slaughtering ; another bunch of objects TOO quickly! Objects_Timer2: .ds 8 ; $0520-$0527 "Timer" values; automatically decrements to zero ; All the Level_BlockChgX/Y values are aligned to nearest 16 (i.e. tile coordinate) Level_BlockChgXHi: .ds 1 ; Player X High value when block change was queued Level_BlockChgXLo: .ds 1 ; Player X Low value when block change was queued Level_BlockChgYHi: .ds 1 ; Player Y High value when block change was queued Level_BlockChgYLo: .ds 1 ; Player Y Low value when block change was queued ; the block "bounce" that occurs after hitting ? block, music note block, etc. Level_BlkBump_Pos: .ds 2 ; $052C-$052D Block bump effect slot "position" (from 10 down, "position" of bounce) Level_BlkBump: .ds 3 ; $052E-$0530 Block bump effect slot (use Level_ChgTileEvent value, or 0 for inactive) Level_BlkBump_XHi: .ds 3 ; $0531-$0533 Block bump slot X Hi Level_BlkBump_XLo: .ds 3 ; $0534-$0536 Block bump slot X Lo Level_BlkBump_YHi: .ds 3 ; $0537-$0539 Block bump slot Y Hi Level_BlkBump_YLo: .ds 3 ; $053A-$053C Block bump slot Y Lo .ds 5 ; $053D-$0541 unused ; The alternate vertical scrolls are used so that raster effects can be properly implemented! Level_VertScrollH: .ds 1 ; Alternate VertScroll_Hi used by engine, adjusted before being sent to Vert_Scroll_Hi Level_VertScroll: .ds 1 ; Alternate VertScroll used by engine, adjusted before being sent to Vert_Scroll Player_AboveTop: .ds 1 ; If Player is above top of level, this is $FF (-1), otherwise it is zero Level_InitAction: ; AT LEVEL INITIALIZATION ONLY: Performs a specific initialization routine (NOTE: Shared with Player_Slide) Player_Slide: .ds 1 ; Positive values sliding forward, negative values sliding backward; directly sets Player_XVel Player_UphillFlag: .ds 1 ; When set, Player is walking uphill, and uses speed index value at Player_UphillSpeedIdx .ds 8 ; $0547-$054E unused Player_Flip: .ds 1 ; Invincibility Somersault is used when set; only works in air, reset on ground Level_AirshipH: ; Height of the airship during the Airship Intro (shared with Player_KuriboDir) Player_KuriboDir: .ds 1 ; While Kuribo's shoe is moving: 0 - Not requesting move, 1 - move right, 2 - move left Player_Grow: .ds 1 ; Tick counter used to animate growth into Super Mario (20 is starting value, or 2f to shrink) Player_FlashInv: .ds 1 ; Player "flashing invincibility" after being hit, counts down to zero Player_StarInv: .ds 1 ; Starman Invincibility counter; full/fatal invincibility, counts down to zero Player_SuitLost: .ds 1 ; Suit lost to hit discard "poof" counter Player_StarOff: .ds 1 ; Starman Invincibility wear-off (the last second or so when it slows and vanishes), counts down to zero Player_HaltTick: .ds 1 ; When non-zero, all action halts until this countdown hits zero Player_Kick: .ds 1 ; Kick frame in use, counts down to zero Player_PipeFace: .ds 1 ; Player forward frame, used for vertical pipe entrance, counts down to zero Player_EndLevel: .ds 1 ; Player's end of level run-off until count down to zero (player will actually wrap around horizontally if too large) Level_AirshipCtl: .ds 1 ; Airship control -- 1 = run and jump to catch air ship, 2 = climb to enter, 3 = enter .ds 1 ; $055B unused Counter_Wiggly: .ds 1 ; "Wiggly" counter, provides rippled movement (like the airship rising during its intro) Counter_7to0: .ds 1 ; Counter that runs from 7 to 0 continuously while level is in progress .ds 1 ; $055E unused LevelPartialInit: .ds 1 ; When set, performs a partial reinitialization of level data (notably does not perform the Level InitAction unless it is airship related) Level_TilesetIdx: .ds 1 ; Holds Level_Tileset as an "index" value instead, relative to levels (i.e. Level_Tileset - 1) Level_ChangeReset: .ds 1 ; When set to zero, a mass reset is performed (used when changing "scenes" in a single level) Level_UnusedFlag: .ds 1 ; Unused; only set in a couple places, but never read back! Level_SlopeEn: .ds 1 ; If set, enables slope tiles (otherwise they're considered flat top-only solids) CHNGTILE_DELETECOIN = $01 CHNGTILE_DELETETOBG = $02 CHNGTILE_TOGNOTEBLOCK = $03 ; miscolored note block CHNGTILE_TOBOUNCEWOOD = $04 CHNGTILE_TONOTEBLOCK = $05 CHNGTILE_COINHEAVEN = $06 CHNGTILE_TOBRICK = $07 CHNGTILE_TOMETALPLATE = $08 ; i.e. "plate" that appears after ? block is hit CHNGTILE_PSWITCHSTOMP = $09 CHNGTILE_TOBRICKCOIN = $0B ; brick containing coin CHNGTILE_DELETETOBGALT = $0C CHNGTILE_PIPEJCT = $0E ; UNUSED replaces the unused TILE9_PIPEWORKS_JCT tile! CHNGTILE_DELETEDONUT = $0F CHNGTILE_FROZENMUNCHER = $10 CHNGTILE_FROZENCOIN = $11 CHNGTILE_PSWITCHAPPEAR = $12 CHNGTILE_DOORAPPEAR = $13 CHNGTILE_TOADBOXOPEN = $14 CHNGTILE_4WAYCANNON = $15 CHNGTILE_GIANTBRICKBUST = $16 ; Giant World brick bust CHNGTILE_GIANTBLOCKHIT = $17 ; Giant World [?] block hit to metal CHNGTILE_GIANTBRICKFIX = $18 ; Giant World brick restore (small Mario hit giant brick) Level_ChgTileEvent: .ds 1 ; When non-zero, queues a "change tile" event Level_NoStopCnt: .ds 1 ; A counter which continuously increments unless something is "stopping" the action Level_Event: .ds 1 ; Check "LevelEvent_Do" for values; 0 means nothing Level_PSwitchCnt: .ds 1 ; When non-zero, P-Switch is active (init @ $80); counts down to zero and restarts music .ds 1 ; $0568 unused Player_SlideRate: .ds 1 ; While Player is sliding, this is added to X Velocity (does not persist, however) .ds 1 ; $056A unused Player_IsClimbing: .ds 1 ; Set when Player is climing vine Player_FlipBits_OLD: .ds 1 ; Holds backup of Player_FlipBits Player_HitCeiling: .ds 1 ; Flag set when Player has just hit head off ceiling Player_FlyTime: .ds 1 ; When > 0, Player can fly (for power ups that do so); decrements (unless $FF) to 0 Player_IsDucking: .ds 1 ; Set when Player is ducking down Player_WhiteBlkCnt: .ds 1 ; White block counter; counts up while Player is standing on white block and holding down ; Level_PipeMove is set to various values that dictate ; how Player is moving within a pipe ; ; The lower 2 bits form a direction as follows: ; 00 - right ; 01 - left ; 10 - down ; 11 - up ; ; If bit 7 ($80) is NOT set, then we're just entering ; the pipe, and next 3 bits say what it will do: ; 000xx - Does nothing (not used, invalid) ; 001xx - Exits level (i.e. World Map pipe junctions) ; 010xx - Junction to appropriate "Big Question Block" bonus area (Level_JctCtl = 2) ; 011xx - Junction general (Level_JctCtl = 3) ; 100xx - Junction to generic exit area (Level_JctCtl = 4) ; 101xx - In-level transit (a la World 7 pipe mazes and other places; does not set Level_JctCtl) ; ; If bit 7 IS set, we're moving through the pipe (either exiting out one end or in-transit) Level_PipeMove: .ds 1 Level_CoinHeav: .ds 1 ; Enter coin heaven when set $80; Increments; at $D0, "soft jump" arrival; terminates at wrap to $00 Player_MoveLR: .ds 1 ; 0 - Not moving left/right, 1 - Moving left, 2 - Moving right (reversed from the pad input) Player_WalkAnimTicks: .ds 1 ; Ticks between animation frames of walking; max value varies by Player's X velocity Player_InWater: .ds 1 ; Set for when in water (1 = Regular water specifically, other non-zero values indicate waterfall) Player_SwimCnt: .ds 1 ; Swim counter FIXME Describe better 0-3 Player_Kuribo: .ds 1 ; Set for Kuribo's Shoe active Player_QueueSuit: .ds 1 ; Queues a suit change (values like Player_Suit, but add 1, EXCEPT: $0F = Statue enable, $40 = Splash, $80 = Kuribo's Shoe) Player_mGoomba: .ds 1 ; Player is caught by a micro Goomba (jump short) Player_Statue: .ds 1 ; Player is in Tanooki Statue mode; counts down to zero Player_RunFlag: .ds 1 ; Set while Player is actually considered "running" (holding down B and at enough speed; doesn't persist) Player_Bounce: .ds 1 ; Set to cause block bounce (upper 4 bits specifies what kind of block will be bounced) Player_BounceDir: .ds 1 ; Direction of Player bounce -- 0 = Down, 1 = Up, 2 = Left, 3 = Right Player_BounceObj: .ds 1 ; Set if it was a kicked shelled object that hit the bounce block (i.e. don't bounce the Player if the object is the one that hit) Counter_ByPlayerSpd: .ds 1 ; A counter which increments faster as the Player goes faster Level_HAutoScroll: .ds 1 ; When set to 1, "auto horizontal scroll" is active (this can be toggled mid-level) B10Coin_Count: .ds 1 ; Decrements until -1, you continue to get a coin until it does so B10Coin_ID: .ds 1 ; Forms a sort of unique ID so game knows if you've switched blocks Player_OffScreen: .ds 1 ; Set when Player is completely off screen ; FloatLevel_PlayerWaterStat: For levels that "float" and have a fixed set of water at the bottom ; Bit 6: Set if Player is beneath bottom of water ; Bit 7: Set if beneath top of water FloatLevel_PlayerWaterStat: .ds 1 Player_LowClearance: .ds 1 ; Set when Player is in a "low clearance" situation (big Mario in a single block high tunnel) PUp_StarManFlash: .ds 1 ; Set when a Starman is bouncing about so it cycles colors! (also used to get super suit if set in advance) ; Player_Behind_En: ; Specifies whether the "Behind the scenes" effect is actually active ; If the Player has stepped out from behind the background, it can be ; still active, but he won't get the effect of it! Player_Behind_En: .ds 1 Player_Behind: .ds 1 ; When non-zero, Player is "behind the scenes" (as by white block) Player_Slippery: .ds 1 ; 0 = Ground is not slippery, 1 = Ground is a little slippery, 2 = Ground is REALLY slippery Player_SandSink: .ds 1 ; Sinking in quicksand! (holds Y when quicksand hit in upper 4 bits, bit 0 sets '0' jumping, '1' sinking) ; Player_PartDetEn: "32 Pixel Partition Detection" enabler ; When set, if Player Y >= 160, Player detects bottom two rows of tiles implicitly ; Used with Update_Request = UPDATERASTER_32PIXPART if there's a floor ; (i.e. NOT used in levels with fixed water; for that, see FloatLevel_PlayerWaterStat) Player_PartDetEn: .ds 1 Player_InPipe: .ds 1 ; Player is going through pipe Player_MushFall: .ds 1 ; Set to 0 when mushroom is to fall to the left, 1 to the right Player_SprOff: .ds 1 ; Player sprite offset (NOTE: Should be multiples of 4, otherwise bad unaligned stuff happens!) ; Strange gapping here; there's pretty much enough room for a couple more special objects Object_SprRAM: .ds 8 ; $058F-$0596 Sprite_RAM offset by object SpecialObj_Var2: .ds 8 ; $0597-$059E General purpose variable 2 .ds 2 ; $059F-$05A0 unused SpecialObj_YVelFrac: .ds 8 ; $05A1-$05A8 Y velocity fractional accumulator .ds 2 ; $05A9-$05AA unused SpecialObj_XVelFrac: .ds 8 ; $05AB-$05B2 X velocity fractional accumulator .ds 2 ; $05B3-$05B4 unused SpecialObj_Var3: .ds 8 ; $05B5-$05BC General purpose variable 3 .ds 2 ; $05BD-$05BE unused SpecialObj_YLo: .ds 8 ; $05BF-$05C6 Y low coordinate of special object .ds 2 ; $05C7-$05C8 unused SpecialObj_XLo: .ds 8 ; $05C9-$05D0 X low coordinate of special object .ds 2 ; $05D1-$05D2 unused SpecialObj_YVel: .ds 8 ; $05D3-$05DA Y Velocity of special object .ds 2 ; $05DB-$05DC unused SpecialObj_XVel: .ds 8 ; $05DD-$05E4 X Velocity of special object .ds 8 ; $05E5-$05EC unused Misc_Counter: .ds 1 ; Miscellaneous loop counter ? Level_TimerMSD: .ds 1 ; Leftmost / most significant digit on timer Level_TimerMid: .ds 1 ; Middle digit on timer Level_TimerLSD: .ds 1 ; Rightmost / least significant digit on timer Level_TimerTick: .ds 1 ; Timer decrementing tick Inventory_Open: .ds 1 ; Set when inventory panel is open, also used to dictate whether it is "opening" (1) or "closing" (0) Level_TimerEn: .ds 1 ; Set to disable clock (bit 7 will also disable level animations, e.g. '?s') Kill_Tally: .ds 1 ; Counter that increases with each successful hit of an object without touching the ground Objects_KillTally: .ds 5 ; $05F5-$05F9 OBJECT SLOTS 0 - 4 ONLY: Kill_Tally for a kicked shell as it hits other enemies PlayerProj_YHi: .ds 2 ; $05FA-$05FB Player projectile Y Hi ; NOTE: Since Level_AScrlConfig checks are generally implemented as "BEQ/BNE", technically ANY ; value enables auto scroll adjustments, but officially ASCONFIG_ENABLE is used to enable it ASCONFIG_ENABLE = $01 ; Enables auto scroll coordinate adjustments of any sort ASCONFIG_HDISABLE = $80 ; Disables horizontal auto scroll coordinate adjustment (generally if Horz Auto Scroll is not in use) Level_AScrlConfig: .ds 1 Cine_ToadKing: .ds 1 ; Set to 1, initializes Toad and transformed king; set to 2 while running that cinematic ; The diagonal auto scroller wraps vertically several times to give the illusion ; of a long vertical strip. AScrlURDiag_WrapState is set to 1 and 2 during this ; process which makes it possible. Objects that need to offset themselves to ; cope with this behavior utilize AScrlURDiag_WrapState_Copy to stay in sync. AScrlURDiag_WrapState_Copy: .ds 1 ; Copy of AScrlURDiag_WrapState AScrlURDiag_WrapState: .ds 1 ; ASSEMBLER BOUNDARY CHECK, END OF $0600 .BoundGame_0600: BoundCheck .BoundGame_0600, $0600, $05xx Gameplay context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $06xx RAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; DURING ENDING ONLY .org $0600 Ending_CmdBuffer: .ds 192 ; $0600-$06C0 Buffer used during ending sequence ; Normal purpose $06xx RAM... .org $0600 .ds 2 ; $0600-$0601 unused Level_Tile_Head: .ds 1 ; Tile at Player's head Level_Tile_GndL: .ds 1 ; Tile at Player's feet left Level_Tile_GndR: .ds 1 ; Tile at Player's feet right Level_Tile_InFL: .ds 1 ; Tile "in front" of Player ("lower", at feet) Level_Tile_InFU: .ds 1 ; Tile "in front" of Player ("upper", at face) Level_Tile_Whack: .ds 1 ; Tile last hit by tail attack or shell Level_Tile_Quad: .ds 4 ; $0608-$060B Quadrant of tile for each of the positions above .ds 1 ; $060C unused ; Level_Tile_Slope: Slope of tile for each of the positions above (first byte also used by objects) ; 0: Slope shape at feet ; 1: Slope shape at head ; 2: "in front" of Player ("lower", at feet) ; 3: "in front" of Player ("upper", at face) Level_Tile_Slope: .ds 4 ; $060D-$0610 .ds 1 ; $0611 unused Scroll_Cols2Upd: .ds 1 ; Number of 8x8 columns to update (typically set to 32 for a full dirty update) .ds 6 ; $0613-$0618 unused Bonus_CoinsYVel: .ds 6 ; $0619-$061E UNUSED Bonus game coins Y velocity Bonus_CoinsY: .ds 6 ; $061F-$0624 UNUSED Bonus game coins Y Bonus_CoinsXVel: .ds 6 ; $0625-$062A UNUSED Bonus game coins X velocity Bonus_CoinsX: .ds 6 ; $062B-$0630 UNUSED Bonus game coins X Bonus_CoinsYVelFrac: .ds 6 ; $0631-$0636 UNUSED Bonus game coins Y velocity fractional accumulator .ds 6 ; $0637-$063C unused Bonus_CoinsXVelFrac: .ds 6 ; $063D-$0642 UNUSED Bonus game coins X velocity fractional accumulator .ds 8 ; $0643-$064A unused Object_TileFeet: .ds 1 ; Object tile detected at "feet" of object Object_TileWall: .ds 1 ; Object tile detected in front of object, i.e. a wall .ds 1 ; $064D unused Object_AttrFeet: .ds 1 ; Object tile quadrant of Object_TileFeet Object_AttrWall: .ds 1 ; Object tile quadrant of Object_TileWall .ds 1 ; $0650 unused Objects_SprHVis: .ds 8 ; $0651-$0658 Flags; Bits 7-2 set when each 8x16 sprite is horizontally off-screen (left-to-right from MSb) Objects_SpawnIdx: .ds 8 ; $0659-$0660 Holds the index into level data that this object was spawned from ; Objects_State OBJSTATE_DEADEMPTY = 0 ; Dead/Empty OBJSTATE_INIT = 1 ; Init OBJSTATE_NORMAL = 2 ; Normal (typical operation) OBJSTATE_SHELLED = 3 ; Shelled (shelled enemy post-stomp) OBJSTATE_HELD = 4 ; Held (held by Player) OBJSTATE_KICKED = 5 ; Kicked (kicked by Player / spinning shell) OBJSTATE_KILLED = 6 ; Killed (flipped over and falling off screen) OBJSTATE_SQUASHED = 7 ; Squashed (generally Goomba only) OBJSTATE_POOFDEATH = 8 ; "Poof" Death (e.g. Piranha death) Objects_State: .ds 8 Objects_Frame: .ds 8 ; $0669-$0670 "Frame" of object (see ObjectGroup_PatternSets) Level_ObjectID: .ds 8 ; $0671-$0678 All active actor IDs Objects_FlipBits: .ds 8 ; $0679-$0680 Applied sprite attributes for this object (usually just horizontal/vertical flip) Objects_SprVVis: .ds 8 ; $0681-$0688 Flags; Bits 3-0 set when each 8x16 sprite is vertically off-screen (top-to-bottom from MSb) Objects_Var1: .ds 8 ; $0689-$0690 Generic variable 1 for objects Objects_Var2: .ds 8 ; $0691-$0698 Generic variable 2 for objects Unused699: .ds 1 ; Absolutely no idea, it is set once in one place and never used again... MAY be lost bonus game related? ; UNUSED Bonus Game Die counter ; While the die is rotating, just used as a counter 0 to 3 to time the rolling animation. ; After Player would press 'A', this value is immediately set to 0. ; In the case of the odd/even game, if the Player "won", it is set to 5 or 6. Bonus_DieCnt: .ds 1 .ds 1 ; $069B unused Score_Earned: .ds 2 ; $069C-$069D (16-bit value) A "buffer" of score earned to be added to your total, total score stored in Player_Score Score_Temp: .ds 1 ; Temp used when figuring out to display a 3-byte integer worth of score .ds 5 ; $069F-$06A3 unused Player_IsHolding: .ds 1 ; Set when Player is holding something (animation effect only) Player_ISHolding_OLD: .ds 1 ; Holds onto whether Player WAS holding onto something (so we can be sure to clear Player_IsHolding) ; NOTE!! These object vars are OBJECT SLOT 0 - 4 ONLY! ; Objects_Timer3: Used as the "wake up" out of shell timer ; If timer is less than $60, it decrements normally, otherwise... ; If object is in state 2, timer decrements normally ; If object is in state 4 (being held), timer only decrements every 4 ticks ; In all other states, timer decrements every 2 ticks Objects_Timer3: .ds 5 ; $06A6-$06AA Used as the "wake up" out of shell timer Objects_Timer4: .ds 5 ; $06AB-$06AF "Timer" values; automatically decrements to zero (used in "shakin' awake" effect) .ds 3 ; $06B0-$06B2 unused Object_SlopeHeight: .ds 1 ; Object calculated slope height Buffer_Occupied: .ds 2 ; $06B4-$06B5 Set if respective Object_BufferX/Y buffer is already taken by an object Player_UphillSpeedIdx: ; Override when Player_UphillFlag is set (shared with Player_Microgoomba) Player_Microgoomba: .ds 1 ; Microgoomba stuck to Player Objects_InWater: .ds 5 ; $06B7-$06BB Set when object is in water .ds 1 ; $06BC unused SpecialObj_Var1: .ds 8 ; $06BD-$06C4 General purpose variable 1 .ds 2 ; $06C5-$06C6 unused SpecialObj_Data: .ds 8 ; $06C7-$06CE Special object "data" field, defined by object .ds 2 ; $06CF-$06D0 unused SpecialObj_Timer: .ds 8 ; $06D1-$06D8 "Timer" values; automatically decrements to zero .ds 2 ; $06D9-$06DA unused CannonFire_Var: .ds 8 ; $06DB-$06E2 CannonFire_Timer: .ds 8 ; $06E3-$06EA Cannon Fire timer, decrements to zero Objects_QSandCtr: .ds 8 ; $06EB-$06F2 When enemy has fallen into quicksand, increments until $90 which deletes it ; ASSEMBLER BOUNDARY CHECK, END OF $0700 .Bound_0700: BoundCheck .Bound_0700, $0700, $06xx RAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $07xx RAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $0700 TileAddr_Off: .ds 1 ; During level loading, specifies an offset into the current Mem_Tile_Addr setting ; LevLoad_Unused1-4 are initialized when about to load a level, ; but never used. May have been reserved or intended or ; even debugging, but who knows now... LevLoad_Unused1: .ds 1 LevLoad_Unused2: .ds 1 LevLoad_Unused3: .ds 1 LevLoad_Unused4: .ds 1 .ds 1 ; $0705 unused LL_ShapeDef: .ds 1 ; During level loading, defines a shape of something (context-specific) Scroll_UpdAttrFlag: .ds 1 ; Set when it is time to update attributes .ds 2 ; $0708-$0709 unused ; Tileset values: ; 00 = On map ; 01 = Plains style; bushes, zigzag ground, blocks (includes blue-block bonus area) ; 02 = Mini fortress style; gray blocks, lava (and king's room) ; 03 = Hills style; green grass, bushes (works in desert like 2-2 also) ; 04 = High-Up style; "cliffside" grass, swirly clouds, wooden block style ground ; 05 = pipe world plant infestation ; 06 = Water world ; 07 = Toad House ; 08 = Vertical pipe maze ; 09 = desert level, sand, pyramids (and desert fortress) ; 10 = Airship ; 11 = Giant World ; 12 = Ice level, frozen "1" style ; 13 = Coin heaven / Sky level ; 14 = Underground ; 15 = Bonus game intro and N-Spade ; 16 = Spade game sliders ; 17 = N-Spade ; 18 = 2P vs Level_Tileset: .ds 1 ; Different tilesets which changes the detection and meaning in levels Bonus_UnusedVH: ; VRAM High address ?? Seems to only be part of an unused routine ToadTalk_VH: .ds 1 ; Cinematic Toad & King / "Toad House" Toad VRAM Address High Bonus_UnusedVL: ; VRAM Low address ?? Seems to only be part of an unused routine ToadTalk_VL: .ds 1 ; Cinematic Toad & King / "Toad House" Toad VRAM Address Low BonusText_CPos: ToadTalk_CPos: .ds 1 ; Cinematic Toad & King / "Toad House" Toad Character Position BonusText_CharPause: .ds 1 ; Counter that decrements to zero between letters Bonus_UnusedFlag: .ds 1 ; Doesn't do much besides block an unused subroutine Map_Pan_Count: .ds 1 ; Map is panning, counts to zero (Scroll_LastDir sets which direction we're panning) ; NOTE sharing CineKing_Timer2: ; Timer; decrements to zero Bonus_Timer: ; Decrements to zero Map_Intro_Tick: .ds 1 ; Counts down to zero while displaying the "World X" intro .ds 1 ; $0712 unused Map_ReturnStatus: .ds 1 ; When 0, level panel is cleared; otherwise, Player is considered to have died (decrements life!) MaxPower_Tick: .ds 1 ; When Player has maximum "power" charge, this counts for the flashing [P] Player_Score: .ds 3 ; $0715 (H)-$0717 (L) treated as 3-byte integer, with least significant zero on display not part of this value .ds 1 ; $0718 unused ; Each byte of PatTable_BankSel sets the VROM available at ; 0000 (first half BG), 0800 (second half BG, typ animated), ; 1000 (1/4 sprites), 1400 (2/4 sprites), 1800 (3/4 sprites), ; and 1C00 (4/4 sprites), respectively PatTable_BankSel: .ds 6 ; $0719-$071E Provides an array of 6 pages to set the entire Pattern Table [BG_Full_CHRROM_Switch] PAGE_C000: .ds 1 ; Page to set PRG ROM C000 (PRGROM_Change_Both) PAGE_A000: .ds 1 ; Page to set PRG ROM A000 (PRGROM_Change_Both) PAGE_CMD: .ds 1 ; When using PRGROM_Change_Both2 or PRGROM_Change_A000, this value stores the MMC3 command Map_Prev_XOff: .ds 2 ; $0722-$0723 (Mario/Luigi) Stores previous scroll X offset on map Map_Prev_XHi: .ds 2 ; $0724-$0725 (Mario/Luigi) Stores previous "hi byte" of map X Player_Current: .ds 1 ; Which Player is currently up (0 = Mario, 1 = Luigi) World_Num: .ds 1 ; Current world index (0-8, where 0 = World 1, 7 = World 8, 8 = World 9 / Warp Zone) ; NOTE: sharing World_EnterState: ; State variable during "world X" intro entrance, set to 3 when entering a level; overlaps GameOver_State CineKing_State: ; State of King-got-his-wand-back sequence GameOver_State: .ds 1 ; State variable used during "Gameover!" sequence only; overlaps World_EnterState Map_Operation: .ds 1 ; Map_Operation: Current "operation" happening on map (See Map_DoOperation in PRG010) .ds 1 ; $072A unused Total_Players: .ds 1 ; Total players (0 = 1P, 1 = 2P) Map_Unused72C: .ds 1 ; No apparent use; only assigned to, but never read back Bonus_DDDD: .ds 1 ; ?? Set to '1' if you exit the unused bonus game BONUS_UNUSED_DDDD Map_HandState: .ds 1 ; Hand trap state .ds 1 ; $072F unused Map_WW_Backup_Y: .ds 1 ; Warp Whistle wind backs up the Player's map Y Map_WW_Backup_XH: .ds 1 ; Warp Whistle wind backs up the Player's map X Hi byte Map_WW_Backup_X: .ds 1 ; Warp Whistle wind backs up the Player's map X Map_WW_Backup_UPV2: .ds 1 ; Warp Whistle wind backs up Map_UnusedPlayerVal2 .ds 2 ; $0734-$0735 unused Player_Lives: .ds 2 ; $0736-$0737 (Mario/Luigi) Player's lives Map_Unused738: .ds 1 ; Index used in some dead code in PRG011; sometimes index of unused array Map_Unused7DC6 ClearPattern: .ds 1 ; Set by ClearPattern_ByTileset for use in Clear_Nametable_Short PalSel_Tile_Colors: .ds 1 ; Stores value to index which tile color set to use when palette loading routine is called PalSel_Obj_Colors: .ds 1 ; Stores value to index which object color set to use when palette loading routine is called Player_FallToKing: .ds 2 ; $073C-$073D (Mario/Luigi) Player will fall to king when Level_ExitToMap is nonzero (instead of map) Map_Player_SkidBack: .ds 2 ; $073E-$073F (Mario/Luigi) Set to '1' if Player died last turn or otherwise ejected (that is, they DID skid from their last turn, not necessarily currently skidding) Map_NSpadeMatches: .ds 1 ; Keeps count of N-Spade matches of active session (9 means game is done) Map_NSpadeInProg: .ds 1 ; If set, there's an N-Spade game "in progress" (so if you lose, you pick it up later) Map_Airship_Trav: .ds 1 ; Airship's current travel-table offset (randomly offset by 0-2, spices up life) .ds 2 ; $0743-$0744 unused Map_DoFortressFX: .ds 1 ; Bust locks, build bridges, whatever after Mini-Fortress is toppled World_Map_Power: .ds 2 ; $0746-$0747 (Mario/Luigi) MAP Power up # (1 - big, 2 - Fire, 3 - Leaf, 4 - Frog, 5 - Tanooki, 6 - Hammer, 7 - Judgems, 8 - Pwing, 9 - Star) .ds 1 ; $0748 unused Map_Unused749: .ds 2 ; $0749-$074A (Mario/Luigi) ? Another value just set once and never read back! .ds 1 ; $074B unused Object_VelCarry: .ds 1 ; '1' when last Object Velocity fraction accumulation rolled over ; WARNING: The distance between Player/Objects_XVelFrac and Player/Objects_YVelFrac must be same as Player/Objects_X/YVel! Player_XVelFrac: .ds 1 ; X velocity fractional accumulator Objects_XVelFrac: .ds 8 ; $074E-$0755 Other object's X velocity fractional accumulator .ds 1 ; $0756 unused THouse_UnusedFlag: .ds 1 ; Cleared when Toad House gives you an item, but never used otherwise ; WARNING: Though unused, this is required for the consistent padding between XVel(Frac) and YVel(Frac) ; So use it if you want, but maintain the distance!! .ds 7 ; $0758-$075E unused ; WARNING: The distance between Player/Objects_XVelFrac and Player/Objects_YVelFrac must be same as Player/Objects_X/YVel! Player_YVelFrac: .ds 1 ; Y velocity fractional accumulator Objects_YVelFrac: .ds 8 ; $0760-$0767 Other object's Y velocity fractional accumulator Objects_ColorCycle: .ds 8 ; $0768-$076F Cycles colors of object and decrements to zero (e.g. "Melting" ice block, starman, etc.) ; Objects_Var6: Special hardcoded behavior for the following objects ONLY: ; OBJ_FIRECHOMP, OBJ_CHAINCHOMPFREE, OBJ_BLOOPERCHILDSHOOT, ; OBJ_BLOOPERWITHKIDS, or OBJ_FIRESNAKE ; ... as the X/Y buffer slot they occupy (see Object_Delete) Objects_Var6: .ds 5 ; $0770-$0774 General purpose variable 6 (except as noted above) Objects_TargetingXVal: .ds 5 ; $0775-$0779 X velocity result of Object_CalcHomingVels for this object OR some other X pixel target King_Y: ; Y position (NOTE: shared with Objects_TargetingYVal) Objects_TargetingYVal: .ds 5 ; $077A-$077E Y velocity result of Object_CalcHomingVels for this object OR some other Y pixel target Pipe_TransYDelta: ; In-level transit pipe Y delta value (WARNING: Shared with Level_ScrollDiffV) Level_ScrollDiffV: .ds 1 ; Difference between desired vertical and the current Vert_Scroll (WARNING: Shared with Pipe_TransYDelta) Level_ScrollDiffH: .ds 1 ; Difference between desired horizontal and the current Horz_Scroll Random_Pool: .ds 10 ; $0781-$078A (or $0789?) Data pool for pseudo-random number generator algorithm RandomN = Random_Pool+1 ; Pull a random number from the sequence (NOTE: RandomN+1 is also good; If you need multiple random numbers, call Randomize) Map_PlayerLost2PVs: .ds 1 ; When > 0, (1=Mario, 2=Luigi) doesn't lose a life for "death" exiting to map, but does lose their turn .ds 1 ; $078C unused Player_RescuePrincess: .ds 1 ; Player will jump to the princess rescue when Level_ExitToMap is nonzero (instead of map) .ds 8 ; $078E-$0795 unused ; Objects_PlayerHitStat: ; Bit 0 - Set if Player's bbox bottom is HIGHER than object's bbox bottom ; Bit 1 - Set if Player's bbox left edge is to the LEFT of object's bbox left edge ; Bit 4 - Set if Player tail attacked an object Objects_PlayerHitStat: .ds 8 ; $0796-$079D Player hit status ; Up to five "scores" can be displayed at once Scores_Value: .ds 5 ; $079E-$07A2 score "value"; '0' none, (10, 20, 40, 80, 100, 200, 400, 800, 1000, 2000, 4000, 8000, 1-up) Scores_Counter: .ds 5 ; $07A3-$07A7 "counter" until score disappears Scores_Y: .ds 5 ; $07A8-$07AC Score's Y Scores_X: .ds 5 ; $07AD-$07B1 Score's X LRBounce_Y: .ds 1 ; Left/right bouncer as sprite Y ($FF is disabled) LRBounce_X: .ds 1 ; Left/right bouncer as sprite X LRBounce_Vel: .ds 1 ; Left/right bouncer absolute value of X velocity ; NOTE!! These object vars are OBJECT SLOT 0 - 4 ONLY! Objects_Slope: .ds 5 ; $07B5-$07B9 Absolute slope calc value .ds 1 ; $07BA unused World3_Bridge: .ds 1 ; 0 - Bridges are down, 1 - Bridges are up ArrowPlat_IsActive: .ds 1 ; Set if arrow platform is active Level_GetWandState: .ds 1 ; See Koopaling code in PRG001 ; ******************************************************************************** ; The Palette_* vars here form a graphics buffer to be committed in the ; style of the Video_Upd_Table; see "Video_Upd_Table" in PRG030 for format. Video_DoPalUpd: ; Name consistent with Video_Upd_Table Palette_AddrHi: .ds 1 ; Stores high part of palette address when committing palettes Palette_AddrLo: .ds 1 ; Stores low part of palette address when committing palettes Palette_BufCnt: .ds 1 ; 32 for updating entire palette Palette_Buffer: .ds 32 ; $07C1-$07E0 Buffer of palette bytes to commit, used for fade in/out Palette_Term: .ds 1 ; Set to zero as terminator, per requirement of the Video_Upd_Table format ; ******************************************************************************** ; BigQBlock_GotIt: ; Big ? Blocks can only be retrieved once; this is a bitfield that marks which ; ones you've gotten by setting a bit per screen space in the Big ? Block area. ; Basically, if you reenter a Big ? Block area after opening it, it won't reappear! ; See ObjInit_BigQBlock and ObjNorm_BigQBlock for usage... ; NOTE: This is cleared completely upon Player death which works since levels ; are not re-enterable, but still seems a bit extreme... BigQBlock_GotIt: .ds 1 .ds 13 ; $07E3-$07EF unused DMC_Queue: .ds 1 ; Stores value to play on DMC DMC_Current: .ds 1 ; Currently playing DMC sound Sound_Sq1_CurFL: .ds 1 ; Holds current "low" frequency of Square Wave 1 (Warning: Must be +4 to Sound_Sq2_CurFL, see PRG031_E808) Music_NseStart: .ds 1 ; Holds the starting offset of the noise track (CHECK: Reuse of $07F3, is this bad??) .ds 1 ; $07F4 unused, but required for padding Music2_Hold: .ds 1 ; A very little used feature, Music Set 1 overrides Music Set 2, but after a M1 song finishes, it restarts the M2 song Sound_Sq2_CurFL: .ds 1 ; Holds current "low" frequency of Square Wave 1 (Warning: Must be +4 from Sound_Sq1_CurFL, see PRG031_E808) Music_Sq2Patch: .ds 1 ; Current "instrument patch" for Square 2 (only upper 4 bits stored, 0ppp 0000) Music_Sq1Patch: .ds 1 ; Current "instrument patch" for Square 1 (only upper 4 bits stored, 0ppp 0000) .ds 1 ; $07F9 unused Sound_Map_L2Hld: .ds 1 ; Same as Sound_Map_LHold, used for the secondary track (Warning: Will be affected by triangle, see PRG031_E808) Sound_Map_Len2: .ds 1 ; Same as Sound_Map_Len, used for the secondary track Sound_Map_LHold: .ds 1 ; Current length setting, used as delay after each byte of map sound (changed by special bytes in range $80-$FF) Sound_Map_Len: .ds 1 ; Countdown tick for current note/rest that map sound effect is on Sound_Map_Off2: .ds 1 ; Same as Sound_Map_Off, used for the secondary track Sound_Unused7FF: .ds 1 ; Cleared once, never used otherwise ; ASSEMBLER BOUNDARY CHECK, END OF $0800 .Bound_0800: BoundCheck .Bound_0800, $0800, $07xx RAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $68xx SRAM for 2P Vs ONLY ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; NOTE: $6000-$67FF is still in considered tile grid memory (see next section) ; 2P Vs just utilizes a chunk where no tiles will ever exist in 2P Mode ; 2P Vs Only .data .org $6800 Vs_MemStart: ; Should be at "top"; this point and 512 bytes forward are cleared at start of 2P Vs ; Vs_PlayerFrame ; 0/1: Standing (0) / walking (0/1) / falling-not-jumped (1) frames ; 2: Skidding turnaround ; 3: Jumping/Falling-jumped ; 4: Dizzy ; 5: Kicking ; 6: Dying ; 7: Climbing Vs_PlayerFrame: .ds 2 ; $6800-$6801 Mario/Luigi Frame Vs_PlayerState: .ds 2 ; $6802-$6803 Mario/Luigi State (0=Init, 1=Normal, 2=Dying, 3=Ladder climbing) Vs_ObjectState: .ds 12 ; $6804-$680F Objects State (0=Dead/empty, 1=Normal, 2=Flipped over, 3=Dying) .ds 1 ; $6810 unused Vs_PlayerBlkHitCnt: .ds 2 ; $6811-$6812 Mario/Luigi Hit block counter value Vs_PlayerY: .ds 2 ; $6813-$6814 Mario/Luigi Y Vs_ObjectsY: .ds 12 ; $6815-$6820 Objects Y .ds 1 ; $6821 unused Vs_PlayerBlkHitY: .ds 2 ; $6822-$6823 Mario/Luigi Aligned Y position where block was hit Vs_PlayerX: .ds 2 ; $6824-$6825 Mario/Luigi X Vs_ObjectsX: .ds 12 ; $6826-$6831 Objects X .ds 1 ; $6832 unused Vs_PlayerBlkHitX: .ds 2 ; $6833-$6834 Mario/Luigi Aligned Y position where block was hit Vs_PlayerYVel: .ds 2 ; $6835-$6836 Mario/Luigi Y Velocity Vs_ObjectYVel: .ds 12 ; $6837-$6842 Objects Y Velocity .ds 1 ; $6843 unused Vs_PlayerBlkHitYVel: .ds 2 ; $6844-$6845 Mario/Luigi Hit block Y velocity Vs_PlayerXVel: .ds 2 ; $6846-$6847 Mario/Luigi X Velocity Vs_ObjectXVel: .ds 12 ; $6848-$6853 Objects X Velocity .ds 3 ; $6854-$6856 unused Vs_PlayerClimbFrame: .ds 2 ; $6857-$6858 incremented as Player climbs Vs_ObjectAnimCnt: .ds 12 ; $6859-$6864 A continuous counter per object for animating (typically 2 frames) .ds 1 ; $6865 unused Vs_PlayerDir: .ds 2 ; $6866-$6867 Mario/Luigi direction (1=Right, 2=Left) Vs_ObjectDir: .ds 12 ; $6868-$6873 Objects direction (1=Right, 2=Left) .ds 1 ; $6874 unused Vs_PlayerYVelFrac: .ds 2 ; $6875-$6876 Mario/Luigi Y velocity fractional accumulator Vs_ObjectYVelFrac: .ds 12 ; $6877-$6882 .ds 3 ; $6883-$6885 unused Vs_PlayerXVelFrac: .ds 2 ; $6886-$6887 Mario/Luigi X velocity fractional accumulator Vs_ObjectXVelFrac: .ds 12 ; $6888-$6893 .ds 3 ; $6894-$6896 unused Vs_PlayerDetStat: .ds 2 ; $6897-$6898 Mario/Luigi detection status Vs_ObjectDetStat: .ds 12 ; $6899-$68A4 Objects detection status .ds 3 ; $68A5-$68A7 unused Vs_ObjectVar1: .ds 12 ; $68A8-$68B3 General variable 1 .ds 1 ; $68B4 unused Vs_PlayerKick: .ds 2 ; $68B5-$68B6 Mario/Luigi Player is kicking until decrements to zero Vs_PlayerDizzy: .ds 2 ; $68B7-$68B8 Mario/Luigi Player "dizzy" face until decrements to zero Vs_PlayerStick: .ds 2 ; $68B9-$68BA Mario/Luigi Mario/Luigi Player "sticking" to ceiling; decrements to zero Vs_PlayerBumpTimer: .ds 1 ; Mario/Luigi Players bumped off eachother (and can't again until zero); decrements to zero Vs_POWBlockCnt: .ds 1 ; POW block counter; decrements to zero; until then, POW shaking! ; 2P Vs Object IDs VSOBJID_SPINY = 0 ; Spiny VSOBJID_SIDESTEPPER = 2 ; Sidestepper VSOBJID_FIGHTERFLY = 3 ; Fighter Fly VSOBJID_FIREBALL_HORZ = 4 ; Horizontal Fireball that spawns to keep Players from hiding down at the bottom VSOBJID_FIREBALL_ENDER = 5 ; Game Ender Fireball (bounces around, attempts to kill Players who've stuck around too long!) VSOBJID_FIREBALL_FOUNTAIN= 6 ; Fountain Fireball VSOBJID_COIN = 7 ; Coin (from [?] block) VSOBJID_MUSHROOMCARD = 8 ; Mushroom card VSOBJID_FLOWERCARD = 9 ; Flower card VSOBJID_STARCARD = 10 ; Star card VSOBJID_KICKEDBLOCK = 11 ; Kicked block (from [?] block match) Vs_ObjectId: .ds 12 ; $68BD-$68C8 Objects ID .ds 1 ; $68C9 unused Vs_ObjectSprRAMOff: .ds 1 ; Current object Sprite RAM offset Vs_ObjectSprRAMSel: .ds 1 ; Counter that runs $D to $0 (inclusive) and helps distribute Sprite RAM offsets among the objects Vs_EnemyCount: .ds 1 ; Number of spawned enemies (in the typical game) Vs_PlayerHaltTimer: .ds 2 ; $68CD-$68CE Mario/Luigi timer which halts gameplay; decrements to zero Vs_ObjHaltTimer: .ds 12 ; $68CF-$68DA Object timer which halts object when greater than zero; decrements to zero .ds 1 ; $68DB unused Vs_ObjectTimer3: .ds 12 ; $68DC-$68E7 .ds 1 ; $68E8 unused Vs_PlayerCnt: .ds 2 ; $68E9-$68EA Mario/Luigi "counter" value; decrements to zero Vs_EnemyGetUpTimer: .ds 12 ; $68EB-$68F6 Timer for flipped-over enemy; decrements to zero .ds 1 ; $68F7 unused Vs_PlayerJumped: .ds 2 ; $68F8-$68F9 Set to 1 if Player jumped; prevents Player from jumping again until they hit floor Vs_PlayerTileL: .ds 2 ; $68FA-$68FB Mario/Luigi Tile detected at Player's feet Vs_ObjectTileL: .ds 12 ; $68FC-$6907 .ds 2 ; $6908-$6909 unused Vs_PlayerBlkHit: .ds 2 ; $690A-$690B Mario/Luigi Holds Tile_Mem offset to bounce block they hit Vs_PlayerFlashInv: .ds 2 ; $690C-$690D Mario/Luigi Flashing invicibility (?) Vs_SpawnCnt2: .ds 1 ; FIXME describe better Vs_TooLongCnt: .ds 1 ; Increments after each round of spawning; if it overflows, "game ender" fireballs are spawned Vs_CurIndex: .ds 1 ; Current index (Player or object) Vs_PlayerTileU: .ds 2 ; $6911-$6912 Mario/Luigi Tile detected above Player's feet .ds 13 ; $6913-$691F unused Vs_ObjectPipeTimer: .ds 12 ; $6920-$692B Timer used for enemies to exit and emerge from pipes; decrements to zero .ds 1 ; $692C unused Vs_Random: .ds 3 ; $692D-$692F Random generator for 2P Vs mode Vs_PlayerCoins: .ds 2 ; $6930-$6931 Player's coins (in 2P Vs); 5 wins the match Vs_TimeToExit: .ds 1 ; Decrements to zero then exits the 2P Vs Vs_ObjectIsLast: .ds 12 ; $6933-$693E Set if this is the last object (turns blue, move fast) .ds 1 ; $693F unused Vs_POWHits: .ds 1 ; Number of times POW block has been hit (disabled on 3) Vs_PlayerYOff: .ds 2 ; $6941-$6942 Mario/Luigi Y offset applied Vs_UNKGAMECnt: .ds 1 ; Unknown "game" counter; after overflow, we exit Vs_PlayerYHi: .ds 2 ; $6944-$6945 Mario/Luigi Y Hi Vs_ObjectYHi: .ds 12 ; $6946-$6951 Object Y Hi .ds 3 ; $6952-$6954 unused Vs_ObjectIsAngry: .ds 12 ; $6955-$6960 Set when Sidestepper is angry (not used for anything else) .ds 1 ; $6961 unused Vs_AngrySidesteppers: .ds 1 ; When greater than zero, and spawning a Sidestepper, next one is an "angry" Sidestepper (then decrement) .ds 1 ; $6963 unused Vs_ObjectVDir: .ds 12 ; $6964-$696F Objects vertical direction (4=Down, 8=Up) .ds 1 ; $6970 Vs_ObjectRestoreXVel: .ds 12 ; $6971-$697C Flipped over object restore X velocity .ds 1 ; $697D unused Vs_ObjTimer2: .ds 12 ; $697E-$6989 Object timer; decrements to zero .ds 1 ; $698A unused Vs_CardFlash: .ds 2 ; $698B-$698C Mario/Luigi Cycles color for card (when picked up from another Player) Vs_HaltTimerBackup: .ds 15 ; $698D-$699B Backs up all halt timers Vs_EnemySet: .ds 1 ; Specifies an index of active enemy set, selecting one of the quintuples from Vs_5EnemySets Vs_ObjectXOff: .ds 1 ; A one-shot X offset for display of object FIXME: When? Vs_PlayerWalkCnt: .ds 2 ; $699E-$699F Mario/Luigi counts up and overflows to toggle walk frames Vs_PlayerWalkFrame: .ds 2 ; $69A0-$69A1 Mario/Luigi incremented when Vs_PlayerWalkCnt overflows Vs_NextObjectIsLast: .ds 1 ; If there are 5 enemies and this is set, next enemy out is the "last" (turns blue, moves fast) ; Display of "x Up" after getting 3 cards Vs_xUpCnt: .ds 2 ; $69A3-$69A4 Mario/Luigi "x Up" counter Vs_xUpY: .ds 2 ; $69A5-$69A6 Mario/Luigi "x Up" Y pos Vs_xUpX: .ds 2 ; $69A7-$69A8 Mario/Luigi "x Up" X pos Vs_xUpLives: .ds 2 ; $69A9-$69AA Mario/Luigi "x Up" Lives amount (1, 2, 3, 5) Vs_SpawnCnt: .ds 1 ; Spawn counter; increments and triggers spawning ; ASSEMBLER BOUNDARY CHECK, 2P VS END OF $7950 .Bound_7950: BoundCheck .Bound_7950, $7950, 2P VS RAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $6000-$7FFF MMC3 SRAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .org $6000 ; NOTE: $6800+ is used by 2P Vs RAM, see previous section ; Tile_Mem stores for the greatest case: ; Vertical level max size is 15 rows * 16 columns * 16 screens = 3840 ($0F00) bytes ; Non-vertical level max size is 27 rows * 16 columns * 15 screens = 6480 ($1950) bytes Tile_Mem: .ds 6480 ; $6000-$794F Space used to store the 16x16 "tiles" that make up the World Map or Level Map_MoveRepeat: .ds 2 ; $7950-$7951 (Mario/Luigi) counts up to $18 and then you keep moving without pause AScrlURDiag_OffsetX: .ds 1 ; When diagonal autoscroller is wrapping, this holds an X offset for Player/Objects to temporarily correct AScrlURDiag_OffsetY: .ds 1 ; When diagonal autoscroller is wrapping, this holds an Y offset for Player/Objects to temporarily correct StatusBar_UpdFl: .ds 1 ; Status bar Update Flag; toggles so to update status bar only every other frame UpdSel_Disable: .ds 1 ; When set, disables the Update_Select routine during the NMI, which halts most activity due to no reported V-Blanking Map_Objects_Itm: .ds 13 ; $7956-$795D, "Item given by" map objects ; Item that will be given by treasure box; set by the object OBJ_TREASURESET by its row ; Level_TreasureItem: ; 0 = INVALID ; 1 = Mushroom ; 2 = Flower ; 3 = Leaf ; 4 = Frog ; 5 = Tanooki ; 6 = Hammer ; 7 = Judgem's cloud ; 8 = P-Wing ; 9 = Star ; A = Anchor ; B = Hammer ; C = Warp Whistle ; D = Music Box Level_TreasureItem: .ds 1 Reset_Latch: .ds 1 ; If this value is anything besides $5A, the reset is run (I assume this is considered a safe value in case of data corruption, e.g. from runaway generator) Map_BonusType: .ds 1 ; 0 = No bonus, 1 = White Toad House, 2 = UNKNOWN WHITE THING (MAPOBJ_UNK0C) Map_BonusCoinsReqd: .ds 1 ; Number of coins you need for White Toad House (or the MAPOBJ_UNK0C thing!); value ranges 0-127 Coins_ThisLevel: .ds 1 ; Internal counter of coins earned -this level- (so always starts at 0 and increments) Map_NSpade_NextScore: .ds 3 ; $7968 (H)-$796A (L) treated as 3-byte integer Map_BonusAppY: .ds 1 ; Map "white" bonus appearance Y (set to Player's last "succeeded" map position) Map_BonusAppXHi: .ds 1 ; Map "white" bonus appearance XHi (set to Player's last "succeeded" map position) Map_BonusAppX: .ds 1 ; Map "white" bonus appearance X (set to Player's last "succeeded" map position) Map_NoLoseTurn: .ds 1 ; If set, Player does not lose turn after having completed a level (used for Toad House, pipeways, etc.) Map_Got13Warp: .ds 1 ; Set non-zero if Player already got the 1-3 Warp Whistle Map_Anchored: .ds 1 ; Set if anchor is set on this map Map_WhiteHouse: .ds 1 ; Set if you have already earned the White Toad House for this world Map_CoinShip: .ds 1 ; Set if you have already earned the Coin Ship for this world Map_WasInPipeway: .ds 1 ; Set if you just came out of a pipeway EndCard_Flag: .ds 1 ; Set when End Level card is hit (can determine when level has ended) Map_PlyrSprOvrY: .ds 1 ; "Player Sprite Override Y"; If set to $F8 during warp, erases Player's map sprite; otherwise provides a Y to put it at Map_Entered_Y: .ds 2 ; $7976-$7977 (Mario/Luigi) Stores the Y value when you enter a level; this is the Y used if you complete the level Map_Entered_XHi: .ds 2 ; $7978-$7979 (Mario/Luigi) Hi byte for Map_Entered_X Map_Entered_X: .ds 2 ; $797A-$797B (Mario/Luigi) Same as Map_Entered_Y, only for X Map_Previous_UnusedPVal2:.ds 2 ; $797C-$797D (Mario/Luigi) Backup of Map_UnusedPlayerVal2 Map_Previous_Y: .ds 2 ; $797E-$797F (Mario/Luigi) Stores the previous Y you were "safe" at; this is the Y you go back to if you die Map_Previous_XHi: .ds 2 ; $7980-$7981 (Mario/Luigi) Same as Map_Previous_Y, only for XHi Map_Previous_X: .ds 2 ; $7982-$7983 (Mario/Luigi) Same as Map_Previous_Y, only for X Map_Unused7984: .ds 2 ; $7984-$7985 (Mario/Luigi) Unused; cleared and never touched again Map_Prev_XOff2: .ds 2 ; $7986-$7987 (Mario/Luigi) Holds a copy of Map_Prev_XOff, but I'm not sure why? Map_Prev_XHi2: .ds 2 ; $7988-$7989 (Mario/Luigi) Holds a copy of Map_Prev_XHi, but I'm not sure why? Map_Unused798A: .ds 2 ; $798A-$798B (Mario/Luigi) Unused; cleared and never touched again ; These define values to use when you junction back ; to the level you were before... Level_Jct_HSHi: .ds 1 ; Level junction horizontal scroll high value Level_Jct_HS: .ds 1 ; Level junction horizontal scroll value Level_Jct_VSHi: .ds 1 ; Level junction vertical scroll high value Level_Jct_VS: .ds 1 ; Level junction vertical scroll value .ds 2 ; $7990-7991 unused Map_Unused7992: ; Value used in some dead code in PRG011; cleared elsewhere (NOT SURE if maybe it sometimes meant Bonus_DiePos?) Bonus_DiePos: .ds 1 ; UNUSED Die in the lost bonus games, counts 0-5 Map_Previous_Dir: .ds 2 ; $7993-$7994 (Mario/Luigi) Backup movement dir (remember which way Player moved last) (8=Up, 4=Down, 2=Left, 1=Right) Map_Unused7995: .ds 1 ; Unused; cleared but never used otherwise Player_NoSlopeStick: .ds 1 ; If set, Player does not stick to slopes (noticeable running downhill) .ds 105 ; $7997-$79FF unused ; Auto scroll effect variables -- everything to do with screens that aren't scrolling in the normal way ; NOTE: Post-airship cinematic scene with Toad and King ONLY uses $7A01-$7A11 MMC3 SRAM (from Level_AScrlSelect to Level_AScrlHVelCarry) AScroll_Anchor: .ds 1 ; Used as starting point for $7A00-$7A14 clear, but never actually used in Auto-Scroll Level_AScrlSelect: .ds 1 ; Selects auto scroll routine to use (see PRG009_B922) ; Values used in horizontal scrolling (Level_AScrlSelect = 0/1) only: ; $00: World 3-6 / 1-4 ; $01: World 3 Airship ; $02: World 6-2 ; $03: World 5 Airship ; $04: World 2 Airship ; $05: World 4 Airship ; $06: World 6 Airship ; $07: World 5-6 ; $0A: World 6-7 ; $0B: World 1 Airship ; $0C: World 7 Airship ; $0D: World 8 Airship ; $0E: World 8 Battleship ; $0F: World 7-4 ; $10: World 1 Coin Heaven ; $11: Coin Ship ; $13: World 8 Tank 1 ; $14: World 8 Tank 2 Level_AScrlLimitSel: .ds 1 ; "Limit Selector" for the auto scroll (typically selects an end or a start/end pair, depending on style) ; Level_AScrlVar ; Variable used for different things depending on the auto scroll style ; In horizontal scroll style (Level_AScrlSelect = 0), it's the current "movement" (see table AScroll_Movement) Level_AScrlVar: .ds 1 Level_AScrlLoopSel: .ds 1 ; Currently selected "movement loop" (horizontal only, see AScroll_MovementLoopStart; Just a var in others?) Level_AScrlMoveRepeat: .ds 1 ; Repeat current move until zero (decrements each full expiration of Level_AScrlMoveTicks); $FF when on last move, passes control to movement loop Level_AScrlLoopCurMove: .ds 1 ; Current "movement loop" index (into AScroll_MovementLoop) Level_AScrlSclLastDir: .ds 1 ; Auto scroll "Scroll_LastDir" Level_AScrlMoveTicks: .ds 1 ; Counts down to zero, decrements Level_AScrlMoveRepeat (goes to next "movement") Level_AScrlTimer: .ds 1 ; Auto scroll counter, decrements to zero Level_AScrlPosHHi: .ds 1 ; Raster effect horizontal "high" position .ds 1 ; $7A0B Level_AScrlPosH: .ds 1 ; Raster effect horizontal position Level_AScrlPosV: .ds 1 ; Raster effect vertical position Level_AScrlHVel: .ds 1 ; Auto scroll horizontal "velocity" Level_AScrlVVel: .ds 1 ; Auto scroll vertical "velocity" Level_AScrlHVelFrac: .ds 1 ; Auto scroll horizontal velocity fractional accumulator Level_AScrlVVelFrac: .ds 1 ; Auto scroll vertical velocity fractional accumulator Level_AScrlHVelCarry: .ds 1 ; '1' when last auto scroll H Velocity fraction accumulation rolled over Level_AScrlVVelCarry: .ds 1 ; '1' when last auto scroll V Velocity fraction accumulation rolled over World8Tank_OnTank: .ds 1 ; Set when Player is standing on tank surface in Tank level (as opposed to ground); for the illusion the tank is moving through... ;;;;;;;;;;;; ; "Cannon Fire" are sort of objects that exist to repeatedly fire off cannon balls ; or other such armaments. They are created by CFIRE_BULLETBILL = $01 ; Bullet Bill cannon CFIRE_MISSILEBILL = $02 ; Missile Bill (homing Bullet Bill) CFIRE_ROCKYWRENCH = $03 ; (Re-)Creates Rocky Wrench on timer CFIRE_4WAY = $04 ; 4-way cannon CFIRE_GOOMBAPIPE_L = $05 ; Goomba pipe (left output) CFIRE_GOOMBAPIPE_R = $06 ; Goomba pipe (right output) CFIRE_HLCANNON = $07 ; Fires cannonballs horizontally left CFIRE_HLBIGCANNON = $08 ; Fires BIG cannonballs horizontally left CFIRE_ULCANNON = $09 ; Fires cannonballs diagonally, upper left CFIRE_URCANNON = $0A ; Fires cannonballs diagonally, upper right CFIRE_LLCANNON = $0B ; Fires cannonballs diagonally, lower left CFIRE_LRCANNON = $0C ; Fires cannonballs diagonally, lower right CFIRE_HLCANNON2 = $0D ; ?? Same as CFIRE_HLCANNON? CFIRE_ULCANNON2 = $0E ; ?? Same as CFIRE_ULCANNON? CFIRE_URCANNON2 = $0F ; ?? Same as CFIRE_URCANNON? CFIRE_LLCANNON2 = $10 ; ?? Same as CFIRE_LLCANNON? CFIRE_HRCANNON = $11 ; Fires cannonballs horizontally right CFIRE_HRBIGCANNON = $12 ; Fires BIG cannonballs horizontally right CFIRE_LBOBOMBS = $13 ; Launches fused Bob-ombs to the left CFIRE_RBOBOMBS = $14 ; Launches fused Bob-ombs to the right CFIRE_LASER = $15 ; Laser fire CannonFire_ID: .ds 8 ; $7A15-$7A1C ID of the cannon fire CannonFire_YHi: .ds 8 ; $7A1D-$7A24 Cannon fire Y Hi CannonFire_Y: .ds 8 ; $7A25-$7A2C Cannon fire Y CannonFire_XHi: .ds 8 ; $7A2D-$7A34 Cannon fire X Hi CannonFire_X: .ds 8 ; $7A35-$7A3C Cannon fire X CannonFire_Parent: .ds 8 ; $7A3D-$7A44 Tie back to level object index of "parent" object Splash_DisTimer: .ds 1 ; Player water splashes are disabled until decrements to zero; set when Player hits any bounce block ; For that little "flash" that comes from the shell kill impact! ShellKillFlash_Cnt: .ds 1 ; "Shell Kill Flash" counter ShellKillFlash_Y: .ds 1 ; "Shell Kill Flash" Y ShellKillFlash_X: .ds 1 ; "Shell Kill Flash" X ; NOTE!! Objects_DisPatChng for OBJECT SLOT 0 - 5 ONLY! Objects_DisPatChng: .ds 6 ; $7A49-$7A4E If set, this object no longer enforces a pattern bank change ; NOTE!! These object vars are OBJECT SLOT 0 - 5 ONLY! ObjSplash_DisTimer: .ds 6 ; $7A4F-$7A54 Object water/lava splashes are disabled until decrements to zero PlayerProj_XVelFrac: .ds 2 ; $7A55-$7A56 Player Projectile X velocity fractional accumulator CannonFire_Timer2: .ds 8 ; $7A57-$7A5E Cannon Fire timer (decrements to zero) Roulette_Unused7A5F: .ds 1 ; Unused value in Roulette game Roulette_Unused7A5F_Delta:.ds 1 ; Delta value added to Roulette_Unused7A5F Bowser_Tiles: .ds 2 ; $7A61-$7A62 Bowser's detected tiles (to determine what to break) Bowser_Counter1: .ds 1 ; A counter used by Bowser, decrements to zero Bowser_Counter2: .ds 1 ; A counter used by Bowser, decrements to zero Bowser_Counter3: .ds 1 ; A counter used by Bowser, random setting, decrements to zero CoinShip_CoinGlowIdx: .ds 1 ; Coin Ship only: Glowing coins palette color index CoinShip_CoinGlowCnt: .ds 1 ; Coin Ship only: Glowing coins palette color counter SObjBlooperKid_OutOfWater:.ds 8 ; $7A68-$7A6F Blooper kid only; if set, Blooper Kid is trying to go out of water .ds 2 ; $7A70-$7A71 unused Object_SplashAlt: .ds 1 ; Used to alternate the "splash slots" 1 and 2 as objects hit the water .ds 109 ; $7A73-$7ADF unused Music_Start: .ds 1 ; Music start index (beginning of this song) Music_End: .ds 1 ; Music end index (inclusive last index to play before loop) Music_Loop: .ds 1 ; Music loop index (index to start from when song reaches end) Sound_Octave: .ds 1 ; Used for calculating octave .ds 12 ; $7AE4-$7AEF unused Music_Sq1Bend: .ds 1 ; Alters PAPU_FT1 for bend effects .ds 3 ; $7AF1-$7AF3 unused Music_Sq2Bend: .ds 1 ; Alters PAPU_FT2 for bend effects .ds 2 ; $7AF5-$7AF6 unused Music_RestH_Off: .ds 1 ; Offset added to Music_RestH_Base; typically $00 or $10 (for low time warning on compatible songs) .ds 7 ; $7AF8-$7AFE unused PAPU_MODCTL_Copy: .ds 1 ; Current PAPU_MODCTL register Level_ObjIdxStartByScreen:.ds 16 ; $7B00-$7B0F Defines the starting index into Level_Objects for each "screen" Level_ObjectsSpawned: .ds 48 ; $7B10-$7B3F When $80 set, object is already spawned, $00 means not ; Level_ObjPtr_AddrL is an array that defines the level objects to appear ; The first byte copied in has no apparent purpose ; The rest is a repeating series of 3 bytes -- ID, Column, Row (C/R of tile grid, multiply by 16 for pixel location), $FF for terminator Level_Objects: .ds 48*3 ; $7B40-$7BCF .ds 80 ; $7BD0-$7C1F unused ; For certain objects that require a buffer of X or Y values; only a couple are available. ; Each contains 32 bytes, intended for enemies that have "tails"; Buffer_Occupied determines ; which of the two buffers is free, if any at all. The object will hold onto it then. ; Because of this, objects which employ it must also be hardcoded to release it; see ; "Object_Delete" for the hardcoded list of objects which must release this resource... Object_BufferX: .ds 32*2 ; $7C20-$7C3F / $7C40-$7C5F Object_BufferY: .ds 32*2 ; $7C60-$7C7F / $7C80-$7C9F ; Variables used by Chain Chomps ONLY -- manages the chain links ChainChomp_ChainX1: .ds 5 ; $7CA0-$7CA4 Chain Link 1 X ChainChomp_ChainX2: .ds 5 ; $7CA5-$7CA9 Chain Link 2 X ChainChomp_ChainX3: .ds 5 ; $7CAA-$7CAE Chain Link 3 X ChainChomp_ChainX4: .ds 5 ; $7CAF-$7CB4 Chain Link 4 X ChainChomp_ChainY1: .ds 5 ; $7CB4-$7CB8 Chain Link 1 Y ChainChomp_ChainY2: .ds 5 ; $7CB9-$7CBD Chain Link 2 Y ChainChomp_ChainY3: .ds 5 ; $7CBE-$7CC2 Chain Link 3 Y ChainChomp_ChainY4: .ds 5 ; $7CC3-$7CC8 Chain Link 4 Y ; NOTE!! These object vars are OBJECT SLOT 0 - 4 ONLY! Objects_Var10: .ds 5 ; $7CC8-$7CCC Generic object variable 10 Objects_Var11: .ds 5 ; $7CCD-$7CD1 Generic object variable 11 Objects_Var12: .ds 5 ; $7CD2-$7CD6 Generic object variable 12 Objects_Var13: .ds 5 ; $7CD7-$7CDB Generic object variable 13 Objects_Var14: .ds 5 ; $7CDC-$7CE0 Generic object variable 14 ; Player's hammer/fireball PlayerProj_ID: .ds 2 ; $7CE1-$7CE2 Player projectile ID (0 = not in use, 1 = fireball, 2 = hammer, 3+ = Fireball impact "Poof") PlayerProj_Y: .ds 2 ; $7CE3-$7CE4 Player projectile Y PlayerProj_X: .ds 2 ; $7CE5-$7CE6 Player projectile X PlayerProj_YVel: .ds 2 ; $7CE7-$7CE8 Player projectile Y Velocity (NOTE: Integer, not 4.4FP) PlayerProj_XVel: .ds 2 ; $7CE9-$7CEA Player projectile X Velocity (NOTE: Fireball is integer, 4.4FP for hammer ONLY) Fireball_HitChkPass: .ds 2 ; $7CEB-$7CEC Count of times Player's fireball has gone through hit check; when it hits 2, fireball poofs PlayerProj_Cnt: .ds 2 ; $7CED-$7CEE Player projectile counter Temp_VarNP0: .ds 1 ; A temporary not on page 0 Lakitu_Active: .ds 1 ; Set while a Lakitu is active; keeps Lakitu "alive" even if off-screen etc. LevelEvent_Cnt: .ds 1 ; General purpose counter used by a couple LevelEvents Vert_Scroll_Off: .ds 1 ; Vertical scroll offset, used for "vibration" effects Level_Vibration: .ds 1 ; While greater than zero, screen vibrates (from impact of heavy fellow) Player_VibeDisable: .ds 1 ; While greater than zero, Player is unable to move (from impact of heavy fellow) Player_TwisterSpin: .ds 1 ; While greater than zero, Player is twirling from sand twister ; NOTE!! This object var is OBJECT SLOT 0 - 4 ONLY! Objects_HitCount: .ds 5 ; $7CF6-$7CFA Somewhat uncommon "HP" used generally for bosses only (e.g. they take so many fireballs) RotatingColor_Cnt: .ds 1 ; When non-zero, causes rainbow palettes in the background; $80 bit is used by Koopaling wand grab ; Some variables used by the recovered magic wand Wand_FrameCnt: .ds 1 ; A counter that overflows to increment Wand_Frame (added to by the wand's SpecialObj_Var1) Wand_Frame: .ds 1 ; Wand frame Wand_BounceFlag: .ds 1 ; Tracks the recovered wand bounce; odd on first bounce Player_DebugNoHitFlag: .ds 1 ; UNUSED: (Old debug routine) When set, disables getting hurt (would be toggled by pressing SELECT; see PRG000 $C91B) ; Map_Completions: ; Stores "rows" of completed levels or other map alterations (e.g. rock break, ; mini-fortress lock removal, etc.) for a given column, from the leftmost. ; Rows 1-7 use decending bits from $80, and row 9 uses bit $01. This makes row 8 ; invalid for hosting a level panel ever! ; --------- TOP OF MAP ; $80 ; $40 ; $20 ; $10 ; $08 ; $04 ; $02 ; INVALID ; $01 ; --------- BOT OF MAP Map_Completions: .ds 16*4*2 ; $7D00-$7D3F (Mario), $7D40-$7D7F (Luigi) Allows a MAX of 4 map screens (64 columns total each player, 16 columns per map screen) ; Inventory_Items: ; 0 = Empty ; 1 = Mushroom ; 2 = Flower ; 3 = Leaf ; 4 = Frog ; 5 = Tanooki ; 6 = Hammer ; 7 = Judgem's cloud ; 8 = P-Wing ; 9 = Star ; A = Anchor ; B = Hammer ; C = Warp Whistle ; D = Music Box Inventory_Items: .ds 4*7 ; $7D80-$7D9B Mario, 4 rows of 7 items Inventory_Cards: .ds 3 ; $7D9C-$7D9E Mario, 3 cards Inventory_Score: .ds 3 ; $7D9F-$7DA1 Mario, 3 byte score Inventory_Coins: .ds 1 ; Mario's coins Inventory_Items2: .ds 4*7 ; $7DA3-$7DBE Luigi, 4 rows of 7 items Inventory_Cards2: .ds 3 ; $7DBF-$7DC1 Luigi, 3 cards Inventory_Score2: .ds 3 ; $7DC2-$7DC4 Luigi, 3 byte score Inventory_Coins2: .ds 1 ; Luigi's coins Map_Unused7DC6: .ds 5 ; $7DC6-$7DCA? Indexed by Map_Unused738, value used in dead routine in PRG011 @ $A2AF Map_GameOver_CursorY: .ds 1 ; Game Over popup cursor Y ($60/$68) .ds 9 ; $7DCC-$7DD4 unused Map_PrevMoveDir: .ds 1 ; Last SUCCESSFUL (allowed) movement direction on map R01 L02 D04 U08 .ds 8 ; $7DD6-$7DDD unused Pal_Data: .ds 32 ; $7DDE-$7DFD Holds an entire bg/sprite palette (this is the MASTER palette, what fades target, and others may source for "original" colors!) Level_AltLayout: .ds 2 ; $7DFE-$7DFF Pointer to level's "alternate" layout (when you go into bonus pipe, etc.) Level_AltObjects: .ds 2 ; $7E00-$7E01 Pointer to level's "alternate" object set (when you go into bonus pipe, etc.) Level_BlockGrabHitMem: .ds 128 ; $7E02-$7E81 Records coins and 1-ups grabbed, so they don't come back if you switch areas CARD_MUSHROOM = 0 CARD_FLOWER = 1 CARD_STAR = 2 CARD_1UP = 3 CARD_10COIN = 4 CARD_20COIN = 5 CARD_WILD = 8 ; UNUSED Wild card (can match any other!) Card_ActiveSet: .ds 18 ; $7E82-$7E93 Active set of N-Spade game cards ; Tile_AttrTable: ; On the world map, it's always the following: ; [03 67 BF E9] [03 67 BF E9] ; There's a usage of checking which "quadrant" of tile the Player is standing on ($00, $40, $80, or $C0) ; and using that as an index (shifted right 6) into the second half of this table ; TILE_PANEL1 = $03 ; Level Panel 1 ; TILE_FORT = $67 ; Mini-Fortress ; TILE_POOL = $BF ; Pool / Oasis ; TILE_WORLD5STAR = $E9 ; Star used on World 5 Sky map ; The check follows with a "less than", as a quick failure check (if you're in this "range" ; of tiles, but less than that value, you can't possibly be on an enterable tile) ; The second half is not used on the world map ; ; In levels, both "halves" define the first tile of a quadrant to be solid ; The first half is solid at the ground (i.e. Player can stand on it) ; The second half is solid at the head and walls (i.e. Player bumps head on it, typically "full solidity" when combined above) ; Interestingly, the Sonic the Hedgehog games implemented this same solidity pattern... Tile_AttrTable: .ds 8 ; $7E94-$7E9B Level_UnusedSlopesTS5: .ds 1 ; UNUSED; If set to 2, forces slopes to be enabled for Level_Tileset = 5 (plant infestation) PlantInfest_ACnt_Max: .ds 1 ; Always set to $1A in plant infestation levels, sets max value for animation counter .ds 24 ; $7E9E-$7EB5 unused LevelJctBQ_Flag: .ds 1 ; Set to '1' while in a Big Question block area, locks horizontal scrolling Level_JctBackupTileset: .ds 1 ; Level Junction tileset backup Level_AltTileset: .ds 1 ; Level's "alternate" tileset (when you go into bonus pipe, etc.) ; The "ORIGINAL" series are so you can switch back after going to a level's "alternate" Level_LayPtrOrig_AddrL: .ds 1 ; ORIGINAL Low byte of address to tile layout Level_LayPtrOrig_AddrH: .ds 1 ; ORIGINAL High byte of address to tile layout Level_ObjPtrOrig_AddrL: .ds 1 ; ORIGINAL Low byte of address to object set Level_ObjPtrOrig_AddrH: .ds 1 ; ORIGINAL High byte of address to object set Level_BG_Page1_2: .ds 1 ; Sets which bank the first and second page (2K / 64 8x8 tiles) of BG is using (see Level_BG_Pages1/2) Map_BorderAttrFromTiles:.ds 44 ; $7EBE-$7EC8 (?) Attributes collected from map tiles that get overwritten by border FIXME SIZE UNCERTAIN Map_Unused7EEA: .ds 1 ; Unused; Value retrieved from LUT at initialization of world, but never used otherwise Map_Objects_Y: .ds 14 ; $7EEB-$7EF8, Y coordinate of all map objects Map_Objects_XLo: .ds 14 ; $7EF9-$7F06, X coordinate lo byte of all map objects Map_Objects_XHi: .ds 14 ; $7F07-$7F14, X coordinate hi byte of all map objects ; Map_Objects_IDs: ID of all 8 map objects MAPOBJ_EMPTY = $00 ; None MAPOBJ_HELP = $01 ; HELP MAPOBJ_AIRSHIP = $02 ; Airship MAPOBJ_HAMMERBRO = $03 ; Hammer Bro MAPOBJ_BOOMERANGBRO = $04 ; Boomerang Bro MAPOBJ_HEAVYBRO = $05 ; Heavy Bro MAPOBJ_FIREBRO = $06 ; Fire Bro MAPOBJ_W7PLANT = $07 ; World 7 Plant MAPOBJ_UNK08 = $08 ; Unknown marching glitch object MAPOBJ_NSPADE = $09 ; N-Spade MAPOBJ_WHITETOADHOUSE = $0A ; White Toad House MAPOBJ_COINSHIP = $0B ; Coin Ship MAPOBJ_UNK0C = $0C ; Unknown white colorization of $0F (goes to World 7 level??) MAPOBJ_BATTLESHIP = $0D ; World 8 Battleship MAPOBJ_TANK = $0E ; World 8 Tank MAPOBJ_W8AIRSHIP = $0F ; World 8 Airship MAPOBJ_CANOE = $10 ; Canoe MAPOBJ_TOTALINIT = $08 ; Total number of map objects initialized per world MAPOBJ_TOTAL = $0E ; Total POSSIBLE map objects Map_Objects_IDs: .ds 14 ; $7F15-$7F22 Map_SprRAMOffDistr: .ds 1 ; A free running counter on the map only which distributes Sprite_RAM offsets to ensure visibility ; Map_2PVsGame ; Sets which "style" of 2P Vs game will be played ; 0: Spiny Only ; 1: Fighter Fly Only ; 2: Spiny and Fighter Fly ; 3: Static coins ; 4: Spiny and Sidestepper ; 5: Fighter Fly and Sidestepper ; 6: Sidestepper Only ; 7: Coin Fountain ; 8: Spiny Only ; 9: Fighter Fly Only ; 10: Sidestepper Only ; 11: Ladder and [?] blocks Map_2PVsGame: .ds 1 .ds 8 ; $7F25-$7F2C unused Map_Airship_Dest: .ds 1 ; Airship travel destination; 6 X/Y map coordinates defined per world, after that it just sits still THouse_OpenByID: .ds 16 ; $7F2E-$7F3D UNUSED would keep track of chests opened for a given Toad House ID (THouse_ID) StatusBar_PMT: .ds 8 ; $7F3E-$7F45, tiles that currently make up the power meter >>>>>>[P] StatusBar_CoinH: .ds 1 ; Status bar tile for coin MSD StatusBar_CoinL: .ds 1 ; Status bar tile for coin LSD StatusBar_LivesH: .ds 1 ; Status bar tile for lives MSD StatusBar_LivesL: .ds 1 ; Status bar tile for lives LSD StatusBar_Score: .ds 6 ; $7F4A-$7F4F Status bar tiles for score StatusBar_Time: .ds 3 ; $7F50-$7F52 Status bar tiles for time remaining Map_MusicBox_Cnt: .ds 1 ; Number of turns remaining until hammer brothers wake up (>= 1 and they're be asleep on the map) ; Store arrays defined by level data as starts after an "alternate" level junction event ; Level_JctXLHStart: ; Lower 4 bits: X Hi ; Upper 4 bits: X Lo ; Level_JctYLHStart: ; Bits 0 - 3: Go into Level_PipeExitDir ; Bits 4 - 6: 0 to 7, selects start position from LevelJct_YLHStarts and sets proper vertical with LevelJct_VertStarts ; Bit 7: If set, entering in vertical mode (for "dirty" refresh purposes) Level_JctYLHStart: .ds 16 ; $7F54-$7F63 Array of Y / YHi starts Level_JctXLHStart: .ds 16 ; $7F64-$7F73 Array of X / XHi starts Object_TileFeet2: .ds 1 ; ? Difference against Object_TileFeet? Object_TileWall2: .ds 1 ; ? Difference against Object_TileWall? ObjTile_DetYHi: .ds 1 ; Object tile detect Y Hi ObjTile_DetYLo: .ds 1 ; Object tile detect Y Lo ObjTile_DetXHi: .ds 1 ; Object tile detect X Hi ObjTile_DetXLo: .ds 1 ; Object tile detect X Lo Bubble_Cnt: .ds 3 ; $7F7A-$7F7C Bubble counter value (0 = no bubble) ; NOTE: Object_WatrHit* values are set only once, then WatrHit_IsSetFlag latches ; and they will never update again; seems it is leftover debug code or maybe ; an unused feature (that an object could respond to a splashdown) WatrHit_IsSetFlag: .ds 1 ; Set when Object_WatrHit* values are stored (but never cleared, so only once!) Bubble_YHi: .ds 3 ; $7F7E-$7F80 Water Bubble Y Hi Object_WatrHitYHi: .ds 1 ; Y Hi of object that just hit water Bubble_Y: .ds 3 ; $7F82-$7F84 Water Bubble Y Object_WatrHitY: .ds 1 ; Y of object that just hit water Bubble_XHi: .ds 3 ; $7F86-$7F88 Water Bubble X Hi Object_WatrHitXHi: .ds 1 ; X Hi of object that just hit water Bubble_X: .ds 3 ; $7F8A-$7F8C Water Bubble X Object_WatrHitX: .ds 1 ; X of object that just hit water Splash_Counter: .ds 3 ; $7F8E-$7F90 Water splash counter Splash_Y: .ds 3 ; $7F91-$7F93 Water splash X Splash_X: .ds 3 ; $7F94-$7F96 Water splash Y Splash_NoScrollY: .ds 3 ; $7F97-$7F99 If set, flags this water splash to not display sprite Y as relative to screen scroll BrickBust_En: .ds 3 ; $7F9A-$7F9C Brick bust "Enable" (0 = disable, 2 = brick debris, anything else = "poof" away) BrickBust_YUpr: .ds 3 ; $7F9D-$7F9F Brick bust upper chunks Y BrickBust_X: .ds 3 ; $7FA0-$7FA2 Brick bust base X BrickBust_YVel: .ds 3 ; $7FA3-$7FA5 Brick bust Y velocity BrickBust_XDist: .ds 3 ; $7FA6-$7FA8 Brick bust X split BrickBust_YLwr: .ds 3 ; $7FA9-$7FAB Brick bust lower chunks Y BrickBust_HEn: .ds 3 ; $7FAC-$7FAE Bits to hide chunks (Bit 0 = Right, 1 = Left, 2 = Lower, 3 = Upper) OR poof counter .ds 3 ; $7FAF-$7FB1 unused CoinPUp_State: .ds 4 ; $7FB2-$7FB5 State of up to 4 "Power Up" coins (i.e. coins that come out of ? blocks and bricks) CoinPUp_Y: .ds 4 ; $7FB6-$7FB9 Y of "Power Up" coins CoinPUp_X: .ds 4 ; $7FBA-$7FBD X of "Power Up" coins CoinPUp_YVel: .ds 4 ; $7FBE-$7FC1 Y velocity of "Power Up" coins CoinPUp_Counter: .ds 4 ; $7FC2-$7FC5 Counter used by "Power Up" coins ; Special Object IDs: SOBJ_HAMMER = $01 ; Hammer Bro hammer SOBJ_BOOMERANG = $02 ; Boomerangs SOBJ_UNKNOWN = $03 ; ??? Floats around, back and forth, some other strange movements (uses bits of boomerang code) SOBJ_NIPPERFIREBALL = $04 ; Nipper fireball (falls) SOBJ_PIRANHAFIREBALL = $05 ; Piranha fireball SOBJ_MICROGOOMBA = $06 ; Micro goombas SOBJ_SPIKEBALL = $07 ; Spike's or Patooie's spike ball SOBJ_WANDBLAST = $08 ; Koopaling wand blast SOBJ_KURIBOSHOE = $09 ; Lost Kuribo shoe that "flies off" (NOTE: In Japanese original, this also featured super suits) SOBJ_WRENCH = $0A ; Rocky's Wrench SOBJ_CANNONBALL = $0B ; Cannonball SOBJ_FIREBROFIREBALL = $0C ; Fire bro bouncing fireball SOBJ_EXPLOSIONSTAR = $0D ; Explosion star SOBJ_BUBBLE = $0E ; Bubble SOBJ_LAVALOTUSFIRE = $0F ; Lava Lotus fire SOBJ_RECOVEREDWAND = $10 ; Recovered wand SOBJ_POPPEDOUTCOIN = $11 ; Popped out coin SOBJ_FIRECHOMPFIRE = $12 ; Fire Chomp's fire SOBJ_BRICKDEBRIS = $13 ; Brick debris (used for busting e.g. Piledriver Microgroomba, OR giant world brick busting) SOBJ_BLOOPERKID = $14 ; Blooper kid SOBJ_LASER = $15 ; Laser SOBJ_POOF = $16 ; Poof SpecialObj_ID: .ds 8 ; $7FC6-$7FCD Special object spawn event IDs .ds 2 ; $7FCE-$7FCF unused Objects_Var3: .ds 5 ; $7FD0-$7FD4 Generic variable 3 for objects SLOT 0 - 4 ONLY SpecialObj_YHi: .ds 8 ; $7FD5-$7FDC Special object Y high coordinate .ds 2 ; $7FDD-$7FDE unused Objects_LastTile: .ds 8 ; $7FDF-$7FE6 Last tile this object detected Objects_SprAttr: .ds 8 ; $7FE7-$7FEE Object sprite attributes (only uses bit 6 for H-Flip and bits 0-1 for palette) Objects_UseShortHTest: .ds 8 ; $7FEF-$7FF6 If set, object will use a short horizontal test to determine if it is off-screen Roulette_Lives: ; Number of lives you are rewarded from winning the Roulette (NOTE: Shared with first byte of Objects_IsGiant) Objects_IsGiant: .ds 8 ; $7FF7-$7FFE Set mainly for World 4 "Giant" enemies (but some others, like Bowser, also use it) ; ASSEMBLER BOUNDARY CHECK, END OF $8000 .Bound_8000: BoundCheck .Bound_8000, $8000, MMC3 SRAM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $7A01-$7A11 MMC3 SRAM as Cinematic for Wand Return (Post-Airship) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .data .org $7A01 ; This uses the same space as most of the Auto Scroll data, I'm annoyed that I have to make a section for this ; After the wand is returned ONLY CineKing_WandState: .ds 1 ; Wand state; 0 = falling, 1 = spinning, 2 = held CineKing_WandFrame: .ds 1 ; Wand frame; 0 to 7 CineKing_ToadFrame: .ds 1 ; Toad's frame CineKing_DiagHi: .ds 1 ; Text high address value .ds 3 ; $7A05-$7A07 unused in this context CineKing_TimerT: .ds 1 ; Cheering Toad animation Timer CineKing_Timer3: .ds 1 ; Timer decremented every 4 ticks (does not appear to be used!) .ds 2 ; $7A0A-$7A0B unused in this context CineKing_WandX: .ds 1 ; Wand X position CineKing_WandY: .ds 1 ; Wand Y position CineKing_WandXVel: .ds 1 ; Wand X velocity (4.4FP) CineKing_WandYVel: .ds 1 ; Wand Y velocity (4.4FP) CineKing_WandXVel_Frac: .ds 1 ; Wand X velocity fractional accumulator CineKing_WandYVel_Frac: .ds 1 ; Wand Y velocity fractional accumulator ; ASSEMBLER BOUNDARY CHECK, END OF $7A12 .Bound_7A12: BoundCheck .Bound_7A12, $7A12, Wand Return Cinematic Vars .code ; The objects are broken up into groups of 36 IDs across 5 ROM banks (1 - 5) ; These lookup table addresses are common, even though their banks are not, ; and so I define these constants for lack of a better solution: ObjectGroup_InitJumpTable = $A000 ObjectGroup_NormalJumpTable = $A048 ObjectGroup_CollideJumpTable = $A090 ObjectGroup_Attributes = $A0D8 ObjectGroup_Attributes2 = $A0FC ObjectGroup_Attributes3 = $A120 ObjectGroup_PatTableSel = $A144 ObjectGroup_KillAction = $A168 ObjectGroup_PatternStarts = $A18C ObjectGroup_PatternSets = $A1B0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; GAME CONSTANTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Size of level (width or height, if vertical) LEVEL1_SIZE_01 = %00000000 LEVEL1_SIZE_02 = %00000001 LEVEL1_SIZE_03 = %00000010 LEVEL1_SIZE_04 = %00000011 LEVEL1_SIZE_05 = %00000100 LEVEL1_SIZE_06 = %00000101 LEVEL1_SIZE_07 = %00000110 LEVEL1_SIZE_08 = %00000111 LEVEL1_SIZE_09 = %00001000 LEVEL1_SIZE_10 = %00001001 LEVEL1_SIZE_11 = %00001010 LEVEL1_SIZE_12 = %00001011 LEVEL1_SIZE_13 = %00001100 LEVEL1_SIZE_14 = %00001101 LEVEL1_SIZE_15 = %00001110 LEVEL1_SIZE_16 = %00001111 ; Player Y Start positions (also selects appropriate starting vertical position) LEVEL1_YSTART_170 = %00000000 LEVEL1_YSTART_040 = %00100000 LEVEL1_YSTART_000 = %01000000 LEVEL1_YSTART_140 = %01100000 LEVEL1_YSTART_070 = %10000000 LEVEL1_YSTART_0B0 = %10100000 LEVEL1_YSTART_0F0 = %11000000 LEVEL1_YSTART_180 = %11100000 LEVEL1_2PVS = %00010000 ; Unknown purpose flag set on 2P Vs levels ; Palettes (full 16 colors in category) are defined by tileset; objects are rooted at index 8 ; BG palette set LEVEL2_BGPAL_00 = %00000000 LEVEL2_BGPAL_01 = %00000001 LEVEL2_BGPAL_02 = %00000010 LEVEL2_BGPAL_03 = %00000011 LEVEL2_BGPAL_04 = %00000100 LEVEL2_BGPAL_05 = %00000101 LEVEL2_BGPAL_06 = %00000110 LEVEL2_BGPAL_07 = %00000111 ; Object palette set LEVEL2_OBJPAL_08 = %00000000 LEVEL2_OBJPAL_09 = %00001000 LEVEL2_OBJPAL_10 = %00010000 LEVEL2_OBJPAL_11 = %00011000 ; Player X Start positions LEVEL2_XSTART_18 = %00000000 LEVEL2_XSTART_70 = %00100000 LEVEL2_XSTART_D8 = %01000000 LEVEL2_XSTART_80 = %01100000 ; Sets "Level_UnusedFlag", which is apparently not used for anything LEVEL2_UNUSEDFLAG = %10000000 ; Sets "Level_AltTileset", the tileset of the "alternate" level LEVEL3_TILESET_00 = %00000000 ; Included for completeness, but not valid (for the world map only) LEVEL3_TILESET_01 = %00000001 LEVEL3_TILESET_02 = %00000010 LEVEL3_TILESET_03 = %00000011 LEVEL3_TILESET_04 = %00000100 LEVEL3_TILESET_05 = %00000101 LEVEL3_TILESET_06 = %00000110 LEVEL3_TILESET_07 = %00000111 LEVEL3_TILESET_08 = %00001000 LEVEL3_TILESET_09 = %00001001 LEVEL3_TILESET_10 = %00001010 LEVEL3_TILESET_11 = %00001011 LEVEL3_TILESET_12 = %00001100 LEVEL3_TILESET_13 = %00001101 LEVEL3_TILESET_14 = %00001110 LEVEL3_TILESET_15 = %00001111 ; Included for completeness, but not valid (bonus game, can't jump in this way) ; Sets "Level_7Vertical", i.e. states object is a vertical oriented one LEVEL3_VERTICAL = %00010000 ; Sets the vertical scroll lock LEVEL3_VSCROLL_LOCKLOW = %00000000 ; Screen locked at $EF (lowest point) unless flying or climbing a vine LEVEL3_VSCROLL_FREE = %00100000 ; Free vertical scroll LEVEL3_VSCROLL_LOCKED = %01000000 ; Locks either high (0) or low ($EF) depending on value of Vert_Scroll ; Sets Level_PipeNotExit LEVEL3_PIPENOTEXIT = %10000000 ; BG pattern bank index LEVEL4_BGBANK_INDEX .func (\1 & %00011111) ; Level initial action LEVEL4_INITACT_NOTHING = %00000000 ; Do nothing LEVEL4_INITACT_SLIDE = %00100000 ; Start level sliding (if able by power-up) LEVEL4_INITACT_PIPE_T = %01000000 ; Start by exiting top of pipe LEVEL4_INITACT_PIPE_B = %01100000 ; Start by exiting bottom of pipe LEVEL4_INITACT_PIPE_R = %10000000 ; Start by exiting right of pipe LEVEL4_INITACT_PIPE_L = %10100000 ; Start by exiting left of pipe LEVEL4_INITACT_AIRSHIP = %11000000 ; Airship intro run & jump init LEVEL4_INITACT_AIRSHIPB = %11100000 ; Boarding the Airship ; Select "Music 2" set BGM (from table GamePlay_BGM) LEVEL5_BGM_OVERWORLD = %00000000 LEVEL5_BGM_UNDERGROUND = %00000001 LEVEL5_BGM_UNDERWATER = %00000010 LEVEL5_BGM_FORTRESS = %00000011 LEVEL5_BGM_BOSS = %00000100 LEVEL5_BGM_AIRSHIP = %00000101 LEVEL5_BGM_BATTLE = %00000110 LEVEL5_BGM_TOADHOUSE = %00000111 LEVEL5_BGM_ATHLETIC = %00001000 LEVEL5_BGM_THRONEROOM = %00001001 LEVEL5_BGM_SKY = %00001010 ; Bits 4-5 are free apparently ; Set starting clock time LEVEL5_TIME_300 = %00000000 ; Clock at 300 LEVEL5_TIME_400 = %01000000 ; Clock at 400 LEVEL5_TIME_200 = %10000000 ; Clock at 200 LEVEL5_TIME_UNLIMITED = %11000000 ; Clock at 000, unlimited ; Special values that go into the Collide Jump Table OCSPECIAL_HIGHSCORE = $0400 ; Stomp-killing this enemy gives you 1000 pts instead of 100 pts base score OCSPECIAL_KILLCHANGETO = $0800 ; When enemy is killed, it changes to the object ID in the lower 8 bits (requires OA3_DIESHELLED) ; Object Attributes Set 1 Flags OA1_PAL0 = %00000000 ; Object uses sprite palette 0 OA1_PAL1 = %00000001 ; Object uses sprite palette 1 OA1_PAL2 = %00000010 ; Object uses sprite palette 2 OA1_PAL3 = %00000011 ; Object uses sprite palette 3 OA1_PALMASK = %00000011 ; Not intended for use in attribute table, readability/traceability only ; NOTE: The width and heights here are for sprite visibility testing ; For the object's bounding box, see OAT_BOUNDBOXxx OA1_HEIGHT16 = %00000000 ; Object is 16 pixels tall OA1_HEIGHT32 = %00000100 ; Object is 32 pixels tall OA1_HEIGHT48 = %00001000 ; Object is 48 pixels tall OA1_HEIGHT64 = %00001100 ; Object is 64 pixels tall OA1_HEIGHTMASK = %00001100 ; Not intended for use in attribute table, readability/traceability only OA1_WIDTH8 = %00000000 ; Object is 8 pixels wide OA1_WIDTH16 = %00010000 ; Object is 16 pixels wide OA1_WIDTH24 = %00100000 ; Object is 24 pixels wide OA1_WIDTH32 = %00110000 ; Object is 32 pixels wide OA1_WIDTH40 = %01000000 ; Object is 40 pixels wide OA1_WIDTH48 = %01010000 ; Object is 48 pixels wide OA1_WIDTHMASK = %01110000 ; Not intended for use in attribute table, readability/traceability only ; Object Attributes Set 2 Flags OA2_NOSHELLORSQUASH = %00000001 ; Enemy does not go into shell (state 3) or squash (state 7) states when stomped on OA2_GNDPLAYERMOD = %00000010 ; "Grounded Player Mod"; Subtly modifies Player detection response; see comments in PRG000_D205 OA2_STOMPDONTCARE = %00000100 ; Object "doesn't care" about being stomped (indifferent, not same as OA3_NOTSTOMPABLE) OA2_USE16BITX = %00001000 ; When applying X velocity, calculate "X Hi" position (applies to vertical levels only; if not set, Object_XHi will be fixed at zero) ; This selects what X/Y offsets are used by an object to detect a tile ; For tile detection groups, see Object_TileDetectOffsets in PRG000 OA2_TDOGRP0 = %00000000 ; Use "Group 0" tile detection offsets OA2_TDOGRP1 = %00010000 ; Use "Group 1" tile detection offsets OA2_TDOGRP2 = %00100000 ; Use "Group 2" tile detection offsets OA2_TDOGRP3 = %00110000 ; Use "Group 3" tile detection offsets OA2_TDOGRP4 = %01000000 ; Use "Group 4" tile detection offsets OA2_TDOGRP5 = %01010000 ; Use "Group 5" tile detection offsets OA2_TDOGRP6 = %01100000 ; Use "Group 6" tile detection offsets OA2_TDOGRP7 = %01110000 ; Use "Group 7" tile detection offsets OA2_TDOGRP8 = %10000000 ; Use "Group 8" tile detection offsets OA2_TDOGRP9 = %10010000 ; Use "Group 9" tile detection offsets OA2_TDOGRP10 = %10100000 ; Use "Group 10" tile detection offsets OA2_TDOGRP11 = %10110000 ; Use "Group 11" tile detection offsets OA2_TDOGRP12 = %11000000 ; Use "Group 12" tile detection offsets OA2_TDOGRPMASK = %11110000 ; Not intended for use in attribute table, readability/traceability only ; Object Attributes Set 3 Flags ; This selects what action should occur with the object when gameplay is halted (e.g. Player died) ; ; TIP: The most commonly used one is OA3_HALT_NORMALONLY, which means to continue executing the ; object's "Normal" state if the object is in state 2, otherwise not do anything at all. ; This does not mean that the other states will be ignored (i.e. object in shell state will ; continue to use the built-in shell type drawing code) but no handling is performed. ; ; Typically then the "Normal" state will have some kind of code to deal with halted gameplay, ; e.g. calling its own draw routine. The fact that there are enemy specific "special" halts ; is ugly and hackish, and I fully recommend using OA3_HALT_NORMALONLY and handle gameplay ; halts in the "Normal" state standard subroutine instead as much as possible. OA3_HALT_HOTFOOTSPECIAL = %00000000 ; 0: Bank2/Hotfoot ONLY OA3_HALT_JUSTDRAW = %00000001 ; 1: Standard draw OA3_HALT_JUSTDRAWTALL = %00000010 ; 2: Draw tall 16x32 sprite OA3_HALT_SPIKESPECIAL = %00000011 ; 3: Bank2/Spike ONLY OA3_HALT_DONOTHING = %00000100 ; 4: Do nothing OA3_HALT_NORMALONLY = %00000101 ; 5: If object is in "normal" state, do its normal routine, otherwise do nothing (COMMON) OA3_HALT_JUSTDRAWWIDE = %00000110 ; 6: Draw wide 48x16 sprite OA3_HALT_DONOTHING2 = %00000111 ; 7: Do nothing OA3_HALT_KURIBOSPECIAL = %00001000 ; 8: Bank2/Kuribo's Shoe ONLY OA3_HALT_DONOTHING3 = %00001001 ; 9: Do nothing OA3_HALT_JUSTDRAWMIRROR = %00001010 ; 10: Draw mirrored 16x16 sprite OA3_HALT_ENDCARDSPECIAL = %00001011 ; 11: Bank2/End Level Card ONLY OA3_HALT_DONOTHING4 = %00001100 ; 12: Do nothing OA3_HALT_BUSTERSPECIAL = %00001101 ; 13: Bank2/Buster Beatle ONLY OA3_HALT_PIRANHASPECIAL = %00001110 ; 14: Bank2/Piranha Spike Ball ONLY OA3_HALT_MASK = %00001111 ; Not intended for use in attribute table, readability/traceability only OA3_SQUASH = %00010000 ; Enemy should "squash" (state 7) not "shell" (state 3), or "killed" (state 6) in case of statue/Kuribo's shoe stomp; requires OA2_NOTSHELLED to be NOT SET OA3_NOTSTOMPABLE = %00100000 ; If the Player tries to stomp this enemy, he will be HURT! (E.g. Spikey enemy) OA3_DIESHELLED = %01000000 ; The CollideJumpTable entry MAY contain the "special" entry; see CollideJumpTable; also "dies" into "shell" (state 3) (i.e. object "bumps" into shell when hit from beneath) OA3_TAILATKIMMUNE = %10000000 ; Object cannot be Raccoon tail attacked ; Object Attribute Common Flags ; Selects a bounding box from Object_BoundBox OAT_BOUNDBOX00 = %00000000 OAT_BOUNDBOX01 = %00000001 OAT_BOUNDBOX02 = %00000010 OAT_BOUNDBOX03 = %00000011 OAT_BOUNDBOX04 = %00000100 OAT_BOUNDBOX05 = %00000101 OAT_BOUNDBOX06 = %00000110 OAT_BOUNDBOX07 = %00000111 OAT_BOUNDBOX08 = %00001000 OAT_BOUNDBOX09 = %00001001 OAT_BOUNDBOX10 = %00001010 OAT_BOUNDBOX11 = %00001011 OAT_BOUNDBOX12 = %00001100 OAT_BOUNDBOX13 = %00001101 OAT_BOUNDBOX14 = %00001110 OAT_BOUNDBOX15 = %00001111 OAT_BOUNDBOXMASK = %00001111 ; Not intended for use in attribute table, readability/traceability only OAT_BOUNCEOFFOTHERS = %00010000 ; Turn away from other enemies if their paths collide OAT_WEAPONIMMUNITY = %00100000 ; Object is immune to Player's weapon (i.e. fireballs/hammers) OAT_FIREIMMUNITY = %01000000 ; Object is immune to Player's fireballs OAT_HITNOTKILL = %10000000 ; Object will run collision routine instead of standard "Kick"-sound/100 points/OBJSTATE_KILLED [i.e. object not killed by being rammed with held object] ; Flags for the ObjectGroup_PatTableSel table OPTS_NOCHANGE = 0 ; Don't set a pattern table OPTS_SETPT5 = $00 ; Set pattern table bank 5 OPTS_SETPT6 = $80 ; Set pattern table bank 6 ; Determines what action is taken when object is in "Killed" state (6) ; See Object_DoKillAction for the jump table ; NOTE: Any action type other than zero always sets the frame to 2 (unless object is not general purpose, i.e. index >= 5) KILLACT_STANDARD = 0 ; 0: Standard kill (does not set frame 2) KILLACT_JUSTDRAW16X16 = 1 ; 1: Standard sprite draw and kill KILLACT_JUSTDRAWMIRROR = 2 ; 2: Draw mirrored sprite KILLACT_JUSTDRAW16X32 = 3 ; 3: Draw tall sprite KILLACT_JUSTDRAWTALLFLIP= 4 ; 4: Draw tall object horizontally flipped KILLACT_NORMALANDKILLED = 5 ; 5: Do "Normal" state and killed action (sinking/vert flip) KILLACT_GIANTKILLED = 6 ; 6: Giant enemy death KILLACT_POOFDEATH = 7 ; 7: Do "poof" dying state while killed KILLACT_DRAWMOVENOHALT = 8 ; 8: Draw and do movements unless gameplay halted KILLACT_NORMALSTATE = 9 ; 9: Just do "Normal" state while killed ; Object IDs OBJ_BOUNCEDOWNUP = $06 ; Down/up block bounce effect object OBJ_WARPHIDE = $07 ; Hidden object that jumps you to the secret warp whistle in 1-3 OBJ_PSWITCHDOOR = $08 ; Door that appears under influence of P-Switch OBJ_AIRSHIPANCHOR = $09 ; Airship anchor OBJ_POWERUP_1UP = $0B ; 1-Up Mushroom OBJ_POWERUP_STARMAN = $0C ; Starman (primarily, but also the super suits -- Tanooki, Frog, Hammer) OBJ_POWERUP_MUSHROOM = $0D ; Super Mushroom OBJ_BOSS_KOOPALING = $0E ; Koopaling (as appropriate to current world) OBJ_SPINYCHEEP = $17 ; Spiny cheep OBJ_BOSS_BOWSER = $18 ; King Bowser OBJ_POWERUP_FIREFLOWER = $19 ; Fire flower OBJ_BOUNCELEFTRIGHT = $1B ; Left/right block bounce effect object OBJ_POWERUP_SUPERLEAF = $1E ; Falling super leaf OBJ_GROWINGVINE = $1F ; Growing vine OBJ_POWERUP_MUSHCARD = $21 ; Free mushroom card ???? OBJ_POWERUP_FIRECARD = $22 ; Free flower card ???? OBJ_POWERUP_STARCARD = $23 ; Free star card ???? OBJ_CLOUDPLATFORM_FAST = $24 ; Fast cloud platform OBJ_PIPEWAYCONTROLLER = $25 ; "Pipe Way" Controller (World Map pipe-to-pipe location setter) OBJ_WOODENPLAT_RIDER = $26 ; Log that rides you to the right after stepping on it OBJ_OSCILLATING_H = $27 ; Horizontal oscillating log platform OBJ_OSCILLATING_V = $28 ; Vertical Oscillating log platform OBJ_SPIKE = $29 ; Spike (the spike ball barfer) OBJ_PATOOIE = $2A ; Patooie OBJ_GOOMBAINSHOE = $2B ; Goomba in Kuribo's Shoe (yes, I know Kuribo = Goomba, quiet) OBJ_CLOUDPLATFORM = $2C ; Cloud platform OBJ_BIGBERTHA = $2D ; Big Bertha that eats you OBJ_INVISIBLELIFT = $2E ; Invisible (until touched) lift that goes up to fixed position of Y/Hi = 64 OBJ_BOO = $2F ; Boo Diddly OBJ_HOTFOOT_SHY = $30 ; Hot Foot (returns to flame if looked at) OBJ_BOOSTRETCH = $31 ; "Stretch" Boo, upright OBJ_BOOSTRETCH_FLIP = $32 ; "Stretch" Boo, upside-down OBJ_NIPPER = $33 ; Stationary nipper plant OBJ_TOAD = $34 ; Toad and his house message OBJ_TOADHOUSEITEM = $35 ; Item that pops out of a treasure box in a Toad House OBJ_WOODENPLATFORM = $36 ; Floating wooden platform OBJ_OSCILLATING_HS = $37 ; left/right short-oscillation log OBJ_OSCILLATING_VS = $38 ; Up/down short-oscillation log OBJ_NIPPERHOPPING = $39 ; Hopping nipper plant OBJ_FALLINGPLATFORM = $3A ; Falling donut lift type platform OBJ_CHARGINGCHEEPCHEEP = $3B ; Charging, hopping cheep cheep OBJ_WOODENPLATFORMFALL = $3C ; Falling wooden platform OBJ_NIPPERFIREBREATHER = $3D ; Fire belching nipper plant OBJ_WOODENPLATFORMFLOAT = $3E ; Floating (on water) log OBJ_DRYBONES = $3F ; Dry Bones OBJ_BUSTERBEATLE = $40 ; Buster Beatle OBJ_ENDLEVELCARD = $41 ; End-of-level card OBJ_CHEEPCHEEPPOOL2POOL = $42 ; Pool-to-pool-to-pool hopping cheep cheep OBJ_CHEEPCHEEPPOOL2POOL2= $43 ; Pool-to-pool hopping cheep cheep OBJ_WOODENPLATUNSTABLE = $44 ; Fall-after-touch log platform OBJ_HOTFOOT = $45 ; Hot Foot (randomly walks and stops, doesn't care if you stare) OBJ_PIRANHASPIKEBALL = $46 ; Tall plant carrying spike ball OBJ_GIANTBLOCKCTL = $47 ; Enables Giant World blocks to function OBJ_TINYCHEEPCHEEP = $48 ; Tiny cheep cheep OBJ_FLOATINGBGCLOUD = $49 ; Floating background cloud OBJ_BOOMBOOMQBALL = $4A ; Boom Boom (?) end-level ball OBJ_BOOMBOOMJUMP = $4B ; Jumping Boom-Boom (can actually hit ? blocks!) OBJ_BOOMBOOMFLY = $4C ; Flying Boom-boom OBJ_CHAINCHOMPFREE = $4F ; Jumping chain chomp head after he breaks free OBJ_BOBOMBEXPLODE = $50 ; Ready-to-explode Bob-Omb OBJ_ROTODISCDUAL = $51 ; Dual Rotodisc, sync, clockwise OBJ_TREASUREBOX = $52 ; Treasure box OBJ_PODOBOOCEILING = $53 ; Podoboo from ceiling OBJ_DONUTLIFTSHAKEFALL = $54 ; Donut lift shake and fall object OBJ_BOBOMB = $55 ; Bob-Omb OBJ_PIRANHASIDEWAYSLEFT = $56 ; Sideways left-facing red piranha OBJ_PIRANHASIDEWAYSRIGHT= $57 ; Sideways right-facing red piranha OBJ_FIRECHOMP = $58 ; Fire chomp OBJ_FIRESNAKE = $59 ; Fire snake OBJ_ROTODISCCLOCKWISE = $5A ; Standard Rotodisc clockwise OBJ_ROTODISCCCLOCKWISE = $5B ; Standard Rotodisc counter-clockwise OBJ_ICEBLOCK = $5C ; Iceblock as held by Mario or Buster Beatle OBJ_TORNADO = $5D ; Tornado OBJ_ROTODISCDUALOPPOSE = $5E ; Dual Rotodisc, opposites, horizontal meeting OBJ_ROTODISCDUALOPPOSE2 = $5F ; Dual Rotodisc, opposites, vertical meeting OBJ_ROTODISCDUALCCLOCK = $60 ; Dual Rotodisc, sync, counter-clockwise OBJ_BLOOPERWITHKIDS = $61 ; Blooper w/ kids OBJ_BLOOPER = $62 ; Blooper OBJ_BIGBERTHABIRTHER = $63 ; Big Bertha with spit-out child OBJ_CHEEPCHEEPHOPPER = $64 ; Cheep Cheep water hopper OBJ_WATERCURRENTUPWARD = $65 ; upward current OBJ_WATERCURRENTDOWNARD = $66 ; Downward current OBJ_LAVALOTUS = $67 ; Underwater lava plant OBJ_TWIRLINGBUZZY = $68 ; Twirling, upside down buzzy beatle OBJ_TWIRLINGSPINY = $69 ; Twirling, upside down spiny OBJ_BLOOPERCHILDSHOOT = $6A ; Blooper (shoots off children) OBJ_PILEDRIVER = $6B ; Pile driver micro goomba OBJ_GREENTROOPA = $6C ; green koopa troopa OBJ_REDTROOPA = $6D ; red koopa troopa OBJ_PARATROOPAGREENHOP = $6E ; Hopping green paratroopa OBJ_FLYINGREDPARATROOPA = $6F ; Flying up/down red winged turtle OBJ_BUZZYBEATLE = $70 ; Buzzy beatle OBJ_SPINY = $71 ; Spiny OBJ_GOOMBA = $72 ; Regular goomba OBJ_PARAGOOMBA = $73 ; Hopping red flying goomba OBJ_PARAGOOMBAWITHMICROS= $74 ; Micro goomba dropping flying goomba OBJ_BOSSATTACK = $75 ; Lemmy's ball, Wendy's ring, Bowser's fireball, depends OBJ_JUMPINGCHEEPCHEEP = $76 ; Jumping Cheep Cheep OBJ_GREENCHEEP = $77 ; Green Cheep Cheep OBJ_BULLETBILL = $78 ; Regular Bullet bill OBJ_BULLETBILLHOMING = $79 ; Homing Bullet Bill OBJ_BIGGREENTROOPA = $7A ; Big Green Turtle OBJ_BIGREDTROOPA = $7B ; Big Red Turtle OBJ_BIGGOOMBA = $7C ; Big Goomba OBJ_BIGGREENPIRANHA = $7D ; Big Green Piranha OBJ_BIGGREENHOPPER = $7E ; Big, bouncing turtle OBJ_BIGREDPIRANHA = $7F ; Big Red Pirahana OBJ_FLYINGGREENPARATROOPA=$80 ; Flying left/right green winged turtle OBJ_HAMMERBRO = $81 ; Classic Hammer Brother OBJ_BOOMERANGBRO = $82 ; Boomerang Brother OBJ_LAKITU = $83 ; Lakitu throwing red spiny eggs OBJ_SPINYEGG = $84 ; Working red spiny egg OBJ_SPINYEGGDUD = $85 ; Rolling "dud" spiny egg OBJ_HEAVYBRO = $86 ; Heavy brother OBJ_FIREBRO = $87 ; Fire Brother OBJ_ORANGECHEEP = $88 ; "Lost" orange cheep cheep OBJ_CHAINCHOMP = $89 ; Chain chomp OBJ_THWOMP = $8A ; Standard Thwomp OBJ_THWOMPLEFTSLIDE = $8B ; Left sliding Thwomp OBJ_THWOMPRIGHTSLIDE = $8C ; Right sliding Thwomp OBJ_THWOMPUPDOWN = $8D ; Up-down sliding Thwomp OBJ_THWOMPDIAGONALUL = $8E ; Diagonal up-left Thwomp OBJ_THWOMPDIAGONALDL = $8F ; Diagonal down-left Thwomp OBJ_TILTINGPLATFORM = $90 ; Tilting platform OBJ_TWIRLINGPLATCWNS = $91 ; Twirling platform, clockwise, non-stop OBJ_TWIRLINGPLATCW = $92 ; Twirling platform, clockwise OBJ_TWIRLINGPERIODIC = $93 ; Twirling platform, periodic OBJ_BIGQBLOCK_3UP = $94 ; Big ? block (3 1-ups) OBJ_BIGQBLOCK_MUSHROOM = $95 ; Big ? block (biggie) OBJ_BIGQBLOCK_FIREFLOWER= $96 ; Big ? block (-flashing??- fireflower) OBJ_BIGQBLOCK_SUPERLEAF = $97 ; Big ? block (-green??- leaf) OBJ_BIGQBLOCK_TANOOKI = $98 ; Big ? block (tanooki) OBJ_BIGQBLOCK_FROG = $99 ; Big ? block (frog suit) OBJ_BIGQBLOCK_HAMMER = $9A ; Big ? block (hammer suit) OBJ_FIREJET_UPWARD = $9D ; upward fire jet OBJ_PODOBOO = $9E ; Podoboo OBJ_PARABEETLE = $9F ; Parabeetle OBJ_GREENPIRANHA = $A0 ; short pipe muncher OBJ_GREENPIRANHA_FLIPPED= $A1 ; upside down short pipe muncher OBJ_REDPIRANHA = $A2 ; tall pipe muncher OBJ_REDPIRANHA_FLIPPED = $A3 ; upside down tall pipe muncher OBJ_GREENPIRANHA_FIRE = $A4 ; short green fire plant OBJ_GREENPIRANHA_FIREC = $A5 ; short, upside down, green fire plant OBJ_VENUSFIRETRAP = $A6 ; Tall red fire plant OBJ_VENUSFIRETRAP_CEIL = $A7 ; upside down tall fire plant OBJ_ARROWONE = $A8 ; One direction arrow platform in motion OBJ_ARROWANY = $A9 ; Changeable direction arrow platform in motion OBJ_AIRSHIPPROP = $AA ; Airship Propellar OBJ_FIREJET_LEFT = $AC ; Left fire jet OBJ_ROCKYWRENCH = $AD ; Rocky wrench (red) OBJ_BOLTLIFT = $AE ; Bolt OBJ_ENEMYSUN = $AF ; Enemy sun OBJ_BIGCANNONBALL = $B0 ; BIG cannon ball OBJ_FIREJET_RIGHT = $B1 ; right fire jet OBJ_FIREJET_UPSIDEDOWN = $B2 ; upside down fire jet ; NOTE: Starting here, all object IDs are now handled specially (see PRG005_B8DB or just before PRG005_BB5F) OBJ_CHEEPCHEEPBEGIN = $B4 ; (Level_Event = 1) Begins swarm of cheep cheeps OBJ_GREENCHEEPBEGIN = $B5 ; (Level_Event = 2) Begins Spike Cheeps floating by OBJ_LAKITUFLEE = $B6 ; (Level_Event = 3) Causes active Lakitu to flee OBJ_PARABEETLESBEGIN = $B7 ; (Level_Event = 4) Begins Green and red parabeetles flyby OBJ_CLOUDSINBGBEGIN = $B8 ; (Level_Event = 5) Begins floating clouds in background OBJ_WOODPLATFORMBEGIN = $B9 ; (Level_Event = 6) Begins random wooden platforms OBJ_TREASUREBOXAPPEAR = $BA ; (Level_Event = 7) Causes treasure box to appear OBJ_CANCELEVENT = $BB ; (Level_Event = 8) Cancels Level_Event (sets to zero) ; Objects $BC to $D0 create Cannon Fires OBJ_CFIRE_BULLETBILL = $BC + CFIRE_BULLETBILL - 1 ; Bullet Bill cannon OBJ_CFIRE_MISSILEBILL = $BC + CFIRE_MISSILEBILL - 1 ; Missile Bill (homing BUllet Bill) OBJ_CFIRE_ROCKYWRENCH = $BC + CFIRE_ROCKYWRENCH - 1 ; Creates Rocky Wrench (um why?) OBJ_CFIRE_4WAY = $BC + CFIRE_4WAY - 1 ; 4-way cannon OBJ_CFIRE_GOOMBAPIPE_L = $BC + CFIRE_GOOMBAPIPE_L - 1 ; Goomba pipe (left output) OBJ_CFIRE_GOOMBAPIPE_R = $BC + CFIRE_GOOMBAPIPE_R - 1 ; Goomba pipe (right output) OBJ_CFIRE_HLCANNON = $BC + CFIRE_HLCANNON - 1 ; Fires cannonballs horizontally left OBJ_CFIRE_HLBIGCANNON = $BC + CFIRE_HLBIGCANNON - 1 ; Fires BIG cannonballs horizontally left OBJ_CFIRE_ULCANNON = $BC + CFIRE_ULCANNON - 1 ; Fires cannonballs diagonally, upper left OBJ_CFIRE_URCANNON = $BC + CFIRE_URCANNON - 1 ; Fires cannonballs diagonally, upper right OBJ_CFIRE_LLCANNON = $BC + CFIRE_LLCANNON - 1 ; Fires cannonballs diagonally, lower left OBJ_CFIRE_LRCANNON = $BC + CFIRE_LRCANNON - 1 ; Fires cannonballs diagonally, lower right OBJ_CFIRE_HLCANNON2 = $BC + CFIRE_HLCANNON2 - 1 ; Fires cannonballs horizontally left OBJ_CFIRE_ULCANNON2 = $BC + CFIRE_ULCANNON2 - 1 ; Fires cannonballs diagonally, upper left OBJ_CFIRE_URCANNON2 = $BC + CFIRE_URCANNON2 - 1 ; Fires cannonballs diagonally, upper right OBJ_CFIRE_LLCANNON2 = $BC + CFIRE_LLCANNON2 - 1 ; Fires cannonballs diagonally, lower left OBJ_CFIRE_HRCANNON = $BC + CFIRE_HRCANNON - 1 ; Fires cannonballs horizontally right OBJ_CFIRE_HRBIGCANNON = $BC + CFIRE_HRBIGCANNON - 1 ; Fires BIG cannonballs horizontally right OBJ_CFIRE_LBOBOMBS = $BC + CFIRE_LBOBOMBS - 1 ; Launches fused Bob-ombs to the left OBJ_CFIRE_RBOBOMBS = $BC + CFIRE_RBOBOMBS - 1 ; Launches fused Bob-ombs to the right OBJ_CFIRE_LASER = $BC + CFIRE_LASER - 1 ; Laser fire ; Objects in $D1+ appear to trigger special events OBJ_SPAWN3GREENTROOPAS = $D1 ; Spawns up to 3 (depending on available slots) hopping green paratroops OBJ_SPAWN3ORANGECHEEPS = $D2 ; Spawns up to 3 (depending on available slots) "lost" orange cheep cheeps (a school) OBJ_AUTOSCROLL = $D3 ; Activates auto scrolling for e.g. World 1-4, World 8 Tank, etc. OBJ_BONUSCONTROLLER = $D4 ; Handles the judgement of whether you get a White Toad House / Coin Ship OBJ_TOADANDKING = $D5 ; Toad and the king from the end of the world OBJ_TREASURESET = $D6 ; Sets the treasure box item (Level_TreasureItem) based on what row this object is placed at ; Miscellaneous Player frames PF_KICK_SMALL = $42 ; Foot out kick when small PF_KICK_BIG = $2D ; Foot out kick when big PF_DIE = $4B ; Dying PF_MIDGROW_SMALL = $0B ; When going from small to big, "Mid-grow" showing small PF_MIDGROW_HALFWAY = $27 ; When going from small to big, "Mid-grow" showing something in between PF_SKID_SMALL = $41 ; Skidding while small PF_SKID_BIG = $30 ; Skidding while not small PF_SLIDE_SMALL = $33 ; Sliding down a slope while small PF_SLIDE_BIG = $31 ; Sliding down a slope otherwise PF_STATUE = $1E ; Tanooki statue frame ; Jump / fall PF_FALLBIG = $06 ; Falling when not small PF_FASTJUMPBIG = $38 ; "Fast" jump frame when not small PF_JUMPFALLSMALL = $40 ; Standard jump/fall frame when small PF_FASTJUMPFALLSMALL = $4E ; "Fast" jump/fall frame when small PF_JUMPBIG = $4F ; Jump as not small (except raccoon) PF_JUMPRACCOON = $50 ; Jump frame as raccoon PF_SOMERSAULT_BASE = $1A ; $1A-$1D Invincibility somersault base frame ; Walking frames PF_WALKSMALL_BASE = $3E ; $3E-$3F Base frame of walking while "small" PF_WALKBIG_BASE = $0C ; $0C-$0E Base frame of walking while big/fire/hammer PF_WALKSPECIAL_BASE = $00 ; $00-$02 Base frame of walking as Raccoon, Frog, or Tanooki PF_FROGHOP_BASE = $15 ; $15-$17 Base frame for frog suit hopping along ; In-pipe frames PF_INPIPE_SMALL = $32 ; "Small", in pipe PF_INPIPE_SMALLKURIBO = $43 ; "Small", in pipe with Kuribo's shoe PF_INPIPE_BIG = $05 ; "Not small", in pipe PF_INPIPE_BIGKURIBO = $18 ; "Not small", in pipe with Kuribo's shoe ; Swim frames PF_SWIMACTIVE_SMALL = $46 ; $46-$48 Base frame of actively swimming while small PF_SWIMACTIVE_BIG = $34 ; $34-$36 Base frame of actively swimming while not small PF_FROGSWIM_UPBASE = $12 ; $12-$14 Base frame for frog suit swimming up PF_FROGSWIM_IDLEBASE = $1F ; $1F-$20 Base frame for idling frog suit in the water (kick kick kick ...) PF_FROGSWIM_LRBASE = $21 ; $21-$23 Base frame for frog suit swimming left/right PF_FROGSWIM_DOWNBASE = $24 ; $24-$26 Base frame for frog suit swimming down ; Swim frames PF_SWIMIDLE_SMALL = $46 ; $46,$49 Base frame of idle swimming while small PF_SWIMIDLE_BIG = $3C ; $34,$3C-$3D Base frame of idle swimming while not small ; Tail attack frames PF_TAILATKGROUND_BASE = $03 ; $03-$05 Base frame of tail attack while on the ground PF_TAILATKINAIR_BASE = $09 ; $04,$05,$09 Base frame of tail attack while in the air (okay not really the "base" I guess) ; Kuribo's Shoe PF_KURIBO_SMALL = $43 ; Kuribo's shoe when small PF_KURIBO_BIG = $18 ; Kuribo's shoe when big ; Ducking PF_DUCK_NOTRACCOON = $0F ; Ducking, not raccoon PF_DUCK_RACCOON = $07 ; Ducking, raccoon ; Player throw (fire/hammer) PF_THROWONGROUND_BASE = $0E ; $0E,$10-$11 Base frame of throwing fire/hammer while on ground PF_THROWINAIR_BASE = $34 ; $34-$36 Base frame oft hrowing fire/hammer while in air ; Player running spread-eagle PF_RUNSMALL_BASE = $4C ; $4C-$4D Base frame of running when small PF_RUNBIG_BASE = $39 ; $39-$3B Base frame of running when not small ; Player tail wag PF_TAILWAGFLY_BASE = $36 ; $36-$38 Base frame of flying tail wag PF_TAILWAGFALL = $08 ; $08-$0A Base frame of fluttering tail wag ; Player holding frames PF_HOLDSMALL_BASE = $2E ; $2E-$2F Base frame of holding an object when small PF_HOLDBIG_BASE = $29 ; $29-$2B Base frame of holding an object when not small ; Player spinning around (inside the desert land twister) (I don't like the determination by "suits that can slide", but that's what it is) PF_SPINSMALLORFROG_BASE = $32 ; $32,$3E Base frame of "spinning" when small or in frog suit PF_SPINSLIDESUITS_BASE = $04 ; $04-$05,$0E Base frame of "spinning" when in a suit that can slide (I guess that's just not hammer then) PF_SPINOTHER_BASE = $02 ; $02,$04-$05 Base frame of "spinning" when in a suit that can't slide (just hammer suit I think) ; Airship "caught anchor" frame or general vine climbing (animation is mirroring this frame) PF_CLIMB_SMALL = $4A ; When small PF_CLIMB_FROG = $28 ; When frog PF_CLIMB_BIG = $2C ; Otherwise ; Velocity affects for Player -- note they are in 4.4 fixed point, so divide them by 16 for pixels/frame PLAYER_TOPWALKSPEED = $18 ; Highest X velocity considered as Player "walking" PLAYER_TOPRUNSPEED = $28 ; Highest X velocity when Player runs PLAYER_TOPPOWERSPEED = $38 ; Highest X velocity hit when Player is at full "power" PLAYER_MAXSPEED = $40 ; Player's maximum speed PLAYER_JUMP = -$38 ; Player's root Y velocity for jumping (further adjusted a bit by Player_SpeedJumpInc) PLAYER_TAILWAG_YVEL = $10 ; The Y velocity that the tail wag attempts to lock you at PLAYER_FLY_YVEL = -$18 ; The Y velocity the Player flies at PLAYER_SWIMSTART_YVEL = -$20 ; The Y velocity the Player starts swimming at (or applied when sinking too fast) PLAYER_SWIM_YVEL = $20 ; The swim Y velocity the rest of the time PLAYER_FROG_MAXYVEL = -$20 ; Applies only to objects following Object_Move's standard movements, but most write their own physics OBJECT_FALL = $03 OBJECT_FALLINWATER = $01 OBJECT_MAXFALL = $40 OBJECT_MAXFALLINWATER = $10 OBJECT_MAXWATERUPWARD = -$18 OBJECT_FALLRATE = $03 OBJECT_FALLRATEINWATER = $01 ; Some key map tiles defined TILE_MARIOCOMP_P = $00 ; Mario Completed, standard panel TILE_LUIGICOMP_P = $01 ; Luigi Completed, standard panel TILE_PANEL1 = $03 ; Level Panel 1 TILE_MARIOCOMP_O = $40 ; Mario Completed, orange color TILE_LUIGICOMP_O = $41 ; Luigi Completed, orange color TILE_HORZPATH = $45 ; Standard horizontal path TILE_VERTPATH = $46 ; Standard vertical path TILE_DOCK = $4B ; Docking spot for canoe TILE_BORDER3 = $4E TILE_BORDER1 = $4F TILE_TOADHOUSE = $50 ; Toad House TILE_ROCKBREAKH = $51 ; Rock which breaks into horizontal path TILE_ROCKBREAKV = $52 ; Rock which breaks into vertical path TILE_ROCK = $53 ; Rock which does not break TILE_LOCKVERT = $54 ; Mini-Fortress lock, removed to vertical path TILE_LOCKHORZ = $56 ; Mini-Fortress lock, removed to horizontal path TILE_SPIRAL = $5F ; World 5 Spiral Castle TILE_FORTRUBBLE = $60 ; Mini-Fortress Rubble TILE_PATHANDNUB = $66 ; Path with nub (I think this is unused... in fact, you can "enter" it!) TILE_FORT = $67 ; Mini-Fortress TILE_LARGEFORT = $6A ; UNUSED "Large Fortress" tile (usually gets visually corrupt by map animation) TILE_MARIOCOMP_G = $80 ; Mario Completed, green color TILE_LUIGICOMP_G = $81 ; Luigi Completed, green color TILE_WATER_INVT = $82 ; Water meeting at inverted 'T' shape TILE_RIVERVERT = $9D ; Vertical river segment (gets bridged) TILE_VERTPATHWLU = $AA ; Standard vertical path over water, land on upper TILE_VERTPATHWLL = $AB ; Standard vertical path over water, land on lower TILE_HORZPATHW = $AC ; Standard horizontal path over water TILE_VERTPATHW = $B0 ; Standard vertical path over water TILE_DRAWBRIDGEV = $B1 ; World 3 Draw Bridge (Vertical) TILE_DRAWBRIDGEH = $B2 ; World 3 Draw Bridge (Horizontal) TILE_BRIDGE = $B3 ; Bridge TILE_DANCINGBUSH = $B4 ; Dancing Bush TILE_HORZPATHWLL = $B7 ; Standard horizontal path over water, land on left end TILE_HORZPATHWLR = $B8 ; Standard horizontal path over water, land on right end TILE_HORZPATHWLB = $B9 ; Standard horizontal path over water, land on both ends TILE_VERTPATHWLB = $BA ; Standard vertical path over water, land on both ends TILE_DANCINGPALM = $BB ; Dancing Palm Tree (World 2) TILE_PIPE = $BC ; Pipe TILE_DANCINGFLOWER = $BD ; Dancing Flower TILE_POOL = $BF ; Pool / Oasis TILE_MARIOCOMP_R = $C0 ; Mario Completed, red color TILE_LUIGICOMP_R = $C1 ; Luigi Completed, red color TILE_CASTLEBOTTOM = $C9 ; Bottom of world castle TILE_BOWSERCASTLELL = $CC ; Bowser's castle lower left TILE_HORZPATHSKY = $DA ; World 5 Sky Horizontal path TILE_VERTPATHSKY = $DB ; World 5 Sky Vertical path TILE_ALTSPIRAL = $DF ; World 5 Spiral Castle Alternate Color (not used) TILE_ALTTOADHOUSE = $E0 ; Alternate color Toad House TILE_ALTRUBBLE = $E3 ; Alternate color Mini-Fortress Rubble TILE_ALTLOCK = $E4 ; Alternate color lock TILE_START = $E5 ; START panel TILE_HANDTRAP = $E6 ; World 8 Hand Trap TILE_BORDER2 = $E7 TILE_SPADEBONUS = $E8 ; Spade bonus panel TILE_WORLD5STAR = $E9 ; Star used on World 5 Sky map TILE_ALTFORT = $EB ; Alternate color Mini-Fortress ; Commons (not really comprehensive) TILEA_NOTEINVIS = $03 ; Invisible (until hit) note block TILEA_PSWITCHCOIN = $05 ; Coins invisible unless P-Switch is active TILEA_NOTE = $2E ; Standard note block TILEA_NOTEFLOWER = $2F ; Note block with fire flower TILEA_NOTELEAF = $30 ; Note block with leaf TILEA_NOTESTAR = $31 ; Note block with star TILEA_ICEBRICK = $32 ; Ice block TILEA_ICEBLOCK = $32 TILEA_COIN = $40 ; Coin TILEA_COINREMOVED = $41 ; Tile used after coin has been collected TILEA_DOOR1 = $42 ; Doorway 1, typically black in appearance (apparently wired to only work in fortresses) TILEA_DOOR2 = $43 ; Doorway 2, typically red in appearance TILEA_INVISCOIN = $44 ; Invisible coin block TILEA_INVIS1UP = $45 ; Invisible 1-up TILEA_NOTECOINHEAVEN = $46 ; Placeholder for invisible note block that takes you to coin heaven TILEA_BLOCKEMPTY = $5F ; Used up ? block type empty block TILEA_QBLOCKFLOWER = $60 ; ? block with fire flower TILEA_QBLOCKLEAF = $61 ; ? block with leaf TILEA_QBLOCKSTAR = $62 ; ? block with star TILEA_QBLOCKCOIN = $63 ; ? block with coin TILEA_QBLOCKCOINSTAR = $64 ; ? block with coin OR star TILEA_QBLOCKCOIN2 = $65 ; ? block with coin (again??) TILEA_MUNCHER = $66 ; Muncher plant! TILEA_BRICK = $67 ; Standard brick TILEA_BRICKFLOWER = $68 ; Brick containing fire flower TILEA_BRICKLEAF = $69 ; Brick containing leaf TILEA_BRICKSTAR = $6A ; Brick containing star TILEA_BRICKCOIN = $6B ; Brick containing single coin TILEA_BRICKCOINSTAR = $6C ; Brick containing single coin OR star TILEA_BRICK10COIN = $6D ; Brick with 10 coins TILEA_BRICK1UP = $6E ; Brick with 1-up TILEA_BRICKVINE = $6F ; Brick with vine TILEA_BRICKPSWITCH = $70 ; Brick with P Switch TILEA_HNOTE = $71 ; Coin Heaven launcher note block TILEA_WOODBLOCKBOUNCE = $72 ; Wood block which bounces (no contents) TILEA_WOODBLOCKFLOWER = $73 ; Wood block which bounces and contains fire flower TILEA_WOODBLOCKLEAF = $74 ; Wood block which bounces and contains leaf TILEA_WOODBLOCKSTAR = $75 ; Wood block which bounces and contains star TILEA_WOODBLOCK = $79 ; Standard solid wood block TILEA_GNOTE = $BC ; Green note block (functions like standard white, just colored wrong) TILEA_PSWITCH_BLANK = $C1 ; Blank tile used to hide a P-Switch after it has been used on level reload TILEA_PATH_HORZ = $C8 ; Horizontal path (typical) TILEA_PATH_VERT = $C9 ; Vertical path (typical) TILEA_PATH_45T2B = $CA ; 45 degree path top-to-bottom (typical) TILEA_PATH_45B2T = $CB ; 45 degree path bottom-to-top (typical) TILEA_PATH_625T2B_U = $CC ; 62.5 degree path top-to-bottom, upper half (typical) TILEA_PATH_625T2B_L = $CD ; 62.5 degree path top-to-bottom, lower half (typical) TILEA_PATH_625B2T_U = $CE ; 62.5 degree path bottom-to-top, upper half (typical) TILEA_PATH_625B2T_L = $CF ; 62.5 degree path bottom-to-top, lower half (typical) TILEA_PSWITCH_PRESSED = $D7 ; Referenced pressed P-Switch TILEA_PSWITCH = $F2 ; P-Switch TILEA_BLOCKBUMP_CLEAR = $F3 ; Tile used when a "bump" block (e.g. ? blocks, note block, etc.) is hit ; Tileset 1 (Plains style) TILE1_GOALBLACK = $00 ; Black background of goal area TILE1_GOALEDGE = $01 ; > shape goal edge TILE1_SKYALT = $02 ; ?? Referenced, appears as sky? TILE1_LITTLEFENCE = $04 ; Little fence (runs atop the 'oo' type cheep-cheep bridge) TILE1_LILBGCLOUD = $06 ; Little background cloud TILE1_WBLOCKLV = $07 ; White big block left vertical runner TILE1_WBLOCKRV = $08 ; White big block right vertical runner TILE1_WBLOCKM = $09 ; White big block center TILE1_WBLOCKBH = $0A ; White big block bottom horizontal runner TILE1_WBLOCK_SHUR = $0B ; White big block shadowed on by another TILE1_WBLOCKSM = $0C ; White big block shadow middle TILE1_WBLOCKLL = $0D ; White big block lower-left TILE1_WBLOCKLR = $0E ; White big block lower-right TILE1_WBLOCKSB = $0F ; White big block shadow bottom TILE1_PUPCLOUD_M = $10 ; "Power Up Cloud" Mushroom TILE1_PUPCLOUD_F = $11 ; "Power Up Cloud" Flower TILE1_PUPCLOUD_S = $12 ; "Power Up Cloud" Star TILE1_CLOUD_UL = $1F ; Cloud upper left TILE1_CLOUD_UM = $20 ; Cloud upper middle TILE1_CLOUD_UR = $21 ; Cloud upper right TILE1_CLOUD_LL = $22 ; Cloud lower left TILE1_CLOUD_LM = $23 ; Cloud lower middle TILE1_CLOUD_LR = $24 ; Cloud lower right TILE1_WBLOCKUL = $26 ; White big block upper-left TILE1_WBLOCKTH = $25 ; White big block top horizontal runner TILE1_WBLOCKUR = $27 ; White big block upper-right TILE1_JCLOUD = $2C ; Judgem's style cloud, solid on top only TILE1_JCLOUDSOLID = $2D ; Judgem's style cloud, solid all around TILE1_OBLOCKLV = $47 ; Orange big block left vertical runner TILE1_OBLOCKRV = $48 ; Orange big block right vertical runner TILE1_OBLOCKM = $49 ; Orange big block center TILE1_OBLOCKBH = $4A ; Orange big block bottom horizontal runner TILE1_OBLOCK_SHUR = $4B ; Orange big block shadowed on by another TILE1_OBLOCKSM = $4C ; Orange big block shadow middle TILE1_OBLOCKLL = $4D ; Orange big block lower-left TILE1_OBLOCKLR = $4E ; Orange big block lower-right TILE1_OBLOCKSB = $4F ; Orange big block shadow bottom TILE1_OBLOCKUL = $51 ; Orange big block upper-left TILE1_OBLOCKTH = $50 ; Orange big block top horizontal runner TILE1_OBLOCKUR = $52 ; Orange big block upper-right TILE1_GROUNDTM = $53 ; Ground top middle TILE1_GROUNDMM = $54 ; Ground middle-middle TILE1_GROUNDTL = $55 ; Ground top left TILE1_GROUNDML = $56 ; Ground middle-left TILE1_GROUNDTR = $57 ; Ground top right TILE1_GROUNDMR = $58 ; Ground middle-right TILE1_CANNONTOP1 = $76 ; Upper top of cannon TILE1_CANNONTOP2 = $77 ; Lower top of cannon TILE1_CANNONMID = $78 ; Mid part to ground TILE1_SANDTOP = $7A ; Solid sand ground, top TILE1_SANDMID = $7B ; Solid sand ground, middle TILE1_SKY = $80 ; Official sky tile TILE1_VINE = $85 ; Vine TILE1_LITTLE_BUSH = $86 ; The little green bush TILE1_GBLOCKLV = $87 ; Green big block left vertical runner TILE1_GBLOCKRV = $88 ; Green big block right vertical runner TILE1_GBLOCKM = $89 ; Green big block center TILE1_GBLOCKBH = $8A ; Green big block bottom horizontal runner TILE1_GBLOCK_SHUR = $8B ; Green big block shadowed on by another TILE1_GBLOCKSM = $8C ; Green big block shadow middle TILE1_GBLOCKLL = $8D ; Green big block lower-left TILE1_GBLOCKLR = $8E ; Green big block lower-right TILE1_GBLOCKSB = $8F ; Green big block shadow bottom TILE1_BUSH_UL = $90 ; Bush upper left TILE1_BUSH_UR = $91 ; Bush upper right TILE1_BUSH_FUL = $92 ; Bush front (of another bush) upper left TILE1_BUSH_FUR = $93 ; Bush front (of another bush) upper right TILE1_BUSH_BL = $94 ; Bush bottom/middle left TILE1_BUSH_BR = $95 ; Bush bottom/middle right TILE1_BUSH_FBL = $96 ; Bush front (of another bush) bottom left TILE1_BUSH_FBR = $97 ; Bush front (of another bush) bottom right TILE1_BUSH_MID = $98 ; Bush middle TILE1_BUSH_SUL = $99 ; Bush shadowed upper left TILE1_BUSH_SUR = $9A ; Bush shadowed upper right TILE1_BUSH_SFUL = $9B ; Bush shadowed front (of another bush) upper left TILE1_BUSH_SFUR = $9C ; Bush shadowed front (of another bush) upper right TILE1_BUSH_SHUR = $9D ; Bush with shadow of big block TILE1_BUSH_SBL = $9E ; Bush shadowed bottom/middle left TILE1_BUSH_SBR = $9F ; Bush shadowed bottom/middle right TILE1_GBLOCKTH = $A0 ; Green big block top horizontal runner TILE1_GBLOCKUL = $A1 ; Green big block upper-left TILE1_GBLOCKUR = $A2 ; Green big block upper-right TILE1_PIPETB1_L = $AD ; Pipe top/bottom 1 left (alt level) TILE1_PIPETB1_R = $AE ; Pipe top/bottom 1 right TILE1_PIPETB2_L = $AF ; Pipe top/bottom 2 left (Big [?] area) TILE1_PIPETB2_R = $B0 ; Pipe top/bottom 2 right TILE1_PIPETB3_L = $B1 ; Pipe top/bottom 3 left (not enterable) TILE1_PIPETB3_R = $B2 ; Pipe top/bottom 3 right TILE1_PIPETB4_L = $B3 ; Pipe top/bottom 4 left (within level transit) TILE1_PIPETB4_R = $B4 ; Pipe top/bottom 4 right TILE1_PIPEH1_B = $B5 ; Pipe horizontal 1 bottom (alt level) TILE1_PIPEH2_B = $B6 ; Pipe horizontal 2 bottom (not enterable) TILE1_PIPEH_T = $B7 ; Pipe horizontal top (common) TILE1_PIPEHT = $B8 ; Pipe horizontal middle top TILE1_PIPEHB = $B9 ; Pipe horizontal middle bottom TILE1_PIPEVL = $BA ; Pipe middle vertical left TILE1_PIPEVR = $BB ; Pipe middle vertical right TILE1_BLOCK_SHUR = $C0 ; Big block shadow upper-right TILE1_BLOCK_SHUL = $C1 ; Big block shadow upper-left (actually none, also used as a cleared P-Switch on level reload, AKA TILEA_PSWITCH_BLANK) TILE1_BLOCK_SHLL = $C2 ; Big block shadow lower-left TILE1_BLOCK_SHLR = $C3 ; Big block shadow lower-right TILE1_BLOCK_SHADOW = $C4 ; Big block general side-shadow TILE1_BLOCK_SHADOWB = $C5 ; Big block general bottom shadow TILE1_BBLOCKLV = $C7 ; Blue big block left vertical runner TILE1_BBLOCKRV = $C8 ; Blue big block right vertical runner TILE1_BBLOCKM = $C9 ; Blue big block center TILE1_BBLOCKBH = $CA ; Blue big block bottom horizontal runner TILE1_BBLOCK_SHUR = $CB ; Blue big block shadowed on by another TILE1_BBLOCKSM = $CC ; Blue big block shadow middle TILE1_BBLOCKLL = $CD ; Blue big block lower-left TILE1_BBLOCKLR = $CE ; Blue big block lower-right TILE1_BBLOCKSB = $CF ; Blue big block shadow bottom TILE1_WATERBUMPS1 = $D8 ; Water ... not sure how to describe it TILE1_WATERBUMPS2 = $D9 ; Water ... not sure how to describe it TILE1_WATERBUMPSSH = $D9 ; Water ... not sure how to describe it, shaded TILE1_WATERWAVEL = $DB ; Water waving to the left TILE1_WATERWAVE = $DC ; Water waving but with no apparent current TILE1_WATERWAVER = $DD ; Water waving to the right TILE1_WATER = $DE ; Water TILE1_WFALLTOP = $E0 ; Top of waterfall TILE1_WFALLMID = $E1 ; Middle of water, extending downward TILE1_BBLOCKUL = $E3 ; Blue big block upper-left TILE1_BBLOCKTH = $E2 ; Blue big block top horizontal runner TILE1_BBLOCKUR = $E4 ; Blue big block upper-right TILE1_DIAMOND = $F0 ; Diamond block TILE1_CCBRIDGE = $F1 ; Cheep-cheep 'oo' bridge TILE1_WGROUNDTM = $F4 ; Underwater ground top middle TILE1_WGROUNDMM = $F5 ; Underwater ground middle-middle TILE1_WGROUNDTL = $F6 ; Underwater ground top left TILE1_WGROUNDML = $F7 ; Underwater ground middle-left TILE1_WGROUNDTR = $F8 ; Underwater ground top right TILE1_WGROUNDMR = $F9 ; Underwater ground middle-right ; Tileset 2 (Fortress style) TILE2_BLACK = $02 ; Solid black background TILE2_WINDOWTOP = $06 ; Top of window TILE2_WINDOWMID = $07 ; Middle of window TILE2_WINDOWBOT = $08 ; Bottom of window ; NOTE: The path (for a moving platform to follow) is typically a ; different value for every Level_Tileset EXCEPT 2) TILE2_PATH_HORZ = $09 ; Horizontal path (TS 2 only) TILE2_PATH_VERT = $0A ; Vertical path (TS 2 only) TILE2_PATH_45T2B = $0B ; 45 degree path top-to-bottom (TS 2 only) TILE2_PATH_45B2T = $0C ; 45 degree path bottom-to-top (TS 2 only) TILE2_PATH_625T2B_U = $0D ; 62.5 degree path top-to-bottom, upper half (TS 2 only) TILE2_PATH_625T2B_L = $0E ; 62.5 degree path top-to-bottom, lower half (TS 2 only) TILE2_PATH_625B2T_U = $0F ; 62.5 degree path bottom-to-top, upper half (TS 2 only) TILE2_PATH_625B2T_L = $10 ; 62.5 degree path bottom-to-top, lower half (TS 2 only) TILE2_GHOSTL = $11 ; Ghost block left TILE2_GHOSTM = $12 ; Ghost block middle TILE2_GHOSTR = $13 ; Ghost block right TILE2_CHECKERBOARDUL = $14 ; Checkerboard floor pattern, upper left TILE2_CHECKERBOARDUR = $15 ; Checkerboard floor pattern, upper right TILE2_CHECKERBOARDLL = $16 ; Checkerboard floor pattern, lower left TILE2_CHECKERBOARDLR = $17 ; Checkerboard floor pattern, lower right TILE2_CONVEYORL = $34 ; Conveyor left TILE2_CONVEYORR = $35 ; Conveyor right TILE2_UNSURE = $5A ; Not sure?? Complements TILE2_GHOST* TILE2_DONUTLIFT = $5B ; Donut lift TILE2_PILLAR_T = $81 ; Background pillar top TILE2_PILLAR_M = $82 ; Background pillar middle TILE2_PILLAR_B = $83 ; Background pillar bottom TILE2_PILLARSHADOW_T = $84 ; Background pillar top, shadowed TILE2_PILLARSHADOW_M = $86 ; Background pillar middle, shadowed TILE2_PILLARSHADOW_B = $87 ; Background pillar bottom, shadowed TILE2_HANGGLOBE_TOP = $88 ; Cable ceiling connector for hanging globe thing TILE2_HANGGLOBE_CABLE = $89 ; Cable for hanging globe thing TILE2_HANGGLOBE_GLOBE = $8A ; Hanging globe thing TILE2_BGBRICK_SHADOW2 = $8B ; Background brickwork pattern, shadowed (same as $8F?) TILE2_BGBRICK_NOSHADOW = $8C ; Background brickwork pattern, non-shadowed TILE2_BGBRICK_LSHADOW = $8D ; Background brickwork pattern, shadowed on left TILE2_BGBRICK_TOPSHADOW = $8E ; Background brickwork pattern, shadowed on top TILE2_BGBRICK_SHADOW = $8F ; Background brickwork pattern, shadowed TILE2_BGBRICK_UNDBRICK = $90 ; Background brickwork pattern, under the TILE2_SOLIDBRICK TILE2_BGBRICK_LDSHADOW = $91 ; Background brickwork pattern, dark shadowed left TILE2_BGBRICK_ULDSHADOW = $92 ; Background brickwork pattern, dark shadowed upper-left TILE2_BGBRICK_TOPDSHADOW= $93 ; Background brickwork pattern, dark shadowed on top TILE2_LAVATOP = $94 ; Top lava tile TILE2_LAVABOTTOM = $95 ; Bottom lava tile TILE2_ENDDOOR_UL = $97 ; The final door to the princess, upper left TILE2_ENDDOOR_UR = $98 ; The final door to the princess, upper right TILE2_ENDDOOR_LL = $99 ; The final door to the princess, lower left TILE2_ENDDOOR_LR = $9A ; The final door to the princess, lower right TILE2_CANDLE = $9B ; Candle (for Hot Foot) TILE2_SOLIDBRICK = $9C ; Solid Bowser's Castle style brick TILE2_DARKREDDIAMOND = $9D ; Dark red diamond block TILE2_ROTODISCBLOCK = $9E ; Roto disc block TILE2_SHADOW = $A2 ; Black TILE2_SPIKEUP = $E2 ; Spikes pointing upward TILE2_SPIKEDOWN = $E3 ; Spikes pointing downward TILE2_DIAMONDBRIGHT = $E4 ; Bright color diamond block TILE2_DIAMONDDARK = $E5 ; Dark color diamond block TILE2_BOWSERSTATUEU = $E8 ; Bowser statue upper TILE2_BOWSERSTATUEL = $E9 ; Bowser statue lower TILE2_SOLIDBLACK = $F4 ; Black tile which is solid ; Tileset 3 (Hills style) TILE3_UNK2 = $88 ; Background referenced, but unknown; possibly belongs to another tileset? TILE3_UNK3 = $89 ; Background referenced, but unknown; possibly belongs to another tileset? TILE3_UNK = $C0 ; Background referenced, but unknown; possibly belongs to another tileset? TILE3_SKY = $02 ; Sky TILE3_CLOUD_UL = $06 ; Cloud upper left TILE3_CLOUD_UM = $07 ; Cloud upper middle TILE3_CLOUD_UR = $08 ; Cloud upper right TILE3_CLOUD_LL = $09 ; Cloud lower left TILE3_CLOUD_LM = $0A ; Cloud lower middle TILE3_CLOUD_LR = $0B ; Cloud lower right TILE3_LILCLOUD = $0C ; Little BG cloud TILE3_ALTDIAMOND = $48 ; Alternate diamond type block, not apparently used (a blue version at $F0 is, but not this one!) TILE3_QUICKSAND_TOP = $49 ; Quicksand top TILE3_QUICKSAND_MID = $4A ; Quicksand middle TILE3_BGBUSH_L = $81 ; Background bush left TILE3_BGBUSH_M = $82 ; Background bush middle TILE3_BGBUSH_R = $83 ; Background bush right TILE3_UNDERGROUND = $86 ; Underground speckled TILE3_TUNNEL = $87 ; "Tunnel" under grassy ground TILE3_SLOPE45B2T = $99 ; 45 degree slope, bottom-to-top TILE3_HORZGROUND = $9A ; Horizontal ground TILE3_SLOPE45T2B = $9B ; 45 degree slope, top-to-bottom TILE3_SLOPE225B2T_L = $9C ; 22.5 degree slope, bottom-to-top, lower TILE3_SLOPE225B2T_U = $9D ; 22.5 degree slope, bottom-to-top, upper TILE3_SLOPE225T2B_U = $9E ; 22.5 degree slope, top-to-bottom, lower TILE3_SLOPE225T2B_L = $9F ; 22.5 degree slope, top-to-bottom, upper TILE3_CEILING = $A6 ; Ceiling TILE3_ULCORNERGROUND = $A7 ; Upper left corner ground TILE3_VERTGROUNDL = $A8 ; Vertical ground, left edge TILE3_URCORNERGROUND = $A9 ; Upper right corner ground TILE3_VERTGROUNDR = $AA ; Vertical ground, right edge TILE3_MIDGROUND = $AB ; Middle ground TILE3_LLCORNERGROUND = $AC ; Lower left corner ground TILE3_PIPETB5_L = $BD ; Pipe top/bottom 5 left (exit to common end area) TILE3_PIPETB5_R = $BE ; Pipe top/bottom 5 right (exit to common end area) TILE3_LRCORNERGROUND = $BF ; Lower right corner ground TILE3_WATERTOP = $C2 ; Top of water TILE3_WATER = $C3 ; Mid water TILE3_WSLOPE45B2T = $E2 ; Underwater 45 degree slope, bottom-to-top TILE3_WHORZGROUND = $E3 ; Underwater Horizontal ground TILE3_WSLOPE45T2B = $E4 ; Underwater 45 degree slope, top-to-bottom TILE3_WSLOPE225B2T_L = $E5 ; Underwater 22.5 degree slope, bottom-to-top, lower TILE3_WSLOPE225B2T_U = $E6 ; Underwater 22.5 degree slope, bottom-to-top, upper TILE3_WSLOPE225T2B_U = $E7 ; Underwater 22.5 degree slope, top-to-bottom, lower TILE3_WSLOPE225T2B_L = $E8 ; Underwater 22.5 degree slope, top-to-bottom, upper TILE3_WCEILING = $F4 ; Underwater ceiling TILE3_WCORNER_UL = $F5 ; Underwater upper-left corner ground TILE3_WVERTGROUND_L = $F6 ; Underwater vertical ground, left edge TILE3_WCORNER_UR = $F7 ; Underwater upper-right corner ground TILE3_WVERTGROUND_R = $F8 ; Underwater vertical ground, right edge TILE3_WMIDGROUND = $F9 ; Underwater middle ground TILE3_WCORNER_LL = $FA ; Underwater lower-left corner ground TILE3_WCORNER_LR = $FB ; Underwater lower-right corner ground ; Tileset 4 (High-Up style, technically shares with Tileset 12) TILE4_LONGCLOUD_UL = $02 ; Long cloud upper left TILE4_LONGCLOUD_UM = $06 ; Long cloud upper middle TILE4_LONGCLOUD_UR = $07 ; Long cloud upper right TILE4_LONGCLOUD_LL = $1F ; Long cloud lower left TILE4_LONGCLOUD_LM = $20 ; Long cloud lower middle TILE4_LONGCLOUD_LR = $21 ; Long cloud lower right TILE4_FATTRUNK = $47 ; Fat trunk (?) tile TILE4_LONGWOOD_L = $4A ; Long wooden block, left TILE4_LONGWOOD_M = $4B ; Long wooden block, middle TILE4_LONGWOOD_R = $4C ; Long wooden block, right TILE4_LARGEWOOD_UL = $4D ; Large wooden block, upper left TILE4_LARGEWOOD_UM = $4E ; Large wooden block, upper middle TILE4_LARGEWOOD_UR = $4F ; Large wooden block, upper right TILE4_LARGEWOOD_LL = $50 ; Large wooden block, lower left TILE4_LARGEWOOD_LM = $51 ; Large wooden block, lower middle TILE4_LARGEWOOD_LR = $52 ; Large wooden block, lower right ; Unverified, this is actually garbage in Tileset 4 TILE4_LARGEBLOCK_LL = $53 ; Large platform, lower left TILE4_LARGEBLOCK_LM = $54 ; Large platform, lower middle TILE4_LARGEBLOCK_LR = $55 ; Large platform, lower right TILE4_MUNCHER = $66 ; Muncher TILE4_SKY = $80 ; Sky TILE4_LITTLEBUSH = $81 ; Little background bush TILE4_BUSHBUNCH_L = $82 ; Bush bunch left TILE4_BUSHBUNCH_M = $83 ; Bush bunch middle TILE4_BUSHBUNCH_R = $84 ; Bush bunch right TILE4_SKY_STOPGEN = $86 ; Appears as sky, used to stop runaway "to ground" generators (I think) TILE4_GREENBLOCK_LL = $87 ; Green platform, upper left TILE4_GREENBLOCK_LM = $88 ; Green platform, upper middle TILE4_GREENBLOCK_LR = $89 ; Green platform, upper right TILE4_GREENBLOCK_UL = $8A ; Green platform, upper left TILE4_GREENBLOCK_UM = $8B ; Green platform, upper middle TILE4_GREENBLOCK_UR = $8C ; Green platform, upper right TILE4_UNKNOWN = $8D ; UNKNOWN, referenced with TILE4_PLATFORMPULLER TILE4_BGCLOUD_L = $C0 ; Wide BG cloud TILE4_BGCLOUD_R = $C2 ; Wide BG cloud TILE4_LILCLOUD = $C3 ; Little background cloud TILE4_CABLE_MIDR = $C4 ; Suspension cable middle right side TILE4_CABLE_CONR = $C5 ; Suspension cable connector right side TILE4_CABLE_MIDL = $C6 ; Suspension cable middle left side TILE4_CABLE_CONL = $C7 ; Suspension cable connector left side TILE4_PLATFORMPULLER = $D0 ; Platform puller thingy TILE4_JELECTRO = $F4 ; Jelectro ; Tileset 5 (World 7 plant infestations) TILE5_SKY = $80 ; Common sky background tile TILE5_MINIPIPE_TOP1 = $98 ; Mini pipe top 1 (as seen in World 7 plant infested levels) TILE5_MINIPIPE_MID = $99 ; Mini pipe mid section TILE5_MINIPIPE_TOP2 = $9A ; Mini pipe top 2 (as seen in World 7 plant infested levels) TILE5_PIPEH3_B = $BF ; Pipe horizontal 3 bottom (not enterable) TILE5_MUNCHER_1 = $C0 ; Muncher 1 (the kind that move up and down the mini pipe) TILE5_MUNCHER_2 = $C2 ; Muncher 2 (the kind that move up and down the mini pipe) ; Tileset 6 (Water level) TILE6_ORANGEBLK_UL = $5D ; Orange block upper left TILE6_ORANGEBLK_UM = $5E ; Orange block upper middle TILE6_ORANGEBLK_UR = $7C ; Orange block upper right TILE6_ORANGEBLK_LL = $7D ; Orange block lower left TILE6_ORANGEBLK_LM = $7E ; Orange block lower middle TILE6_ORANGEBLK_LR = $7F ; Orange block lower right TILE6_SKY = $8A ; Sky TILE6_WATERTOP = $8B ; Top of water TILE6_WATER = $8C ; Water TILE6_UNDERWATERPLANT_T = $8F ; Underwater plant thing top TILE6_UNDERWATERPLANT_M = $90 ; Underwater plant thing middle TILE6_GRAYPLATFORM_MM = $CF ; Gray platform mid middle TILE6_UNDERWATERCIRCLE = $E2 ; Underwater circle thing TILE6_GRAYPLATFORM_UL = $E7 ; Gray platform upper left TILE6_GRAYPLATFORM_UM = $E8 ; Gray platform upper middle TILE6_GRAYPLATFORM_UR = $E9 ; Gray platform upper right TILE6_GRAYPLATFORM_ML = $EA ; Gray platform mid left TILE6_GRAYPLATFORM_MR = $EB ; Gray platform mid right ; Tileset 7 (Toad house) TILE7_BLACK = $09 ; The black background TILE7_CHECKERBOARDUL = $0A ; Checkerboard floor pattern, upper left TILE7_CHECKERBOARDUR = $0B ; Checkerboard floor pattern, upper right TILE7_SKY = $42 ; Not visible, but appears as sky (or maybe the text box's BG?) TILE7_TOADHOUSEBG = $48 ; Toad house background TILE7_TOADHOUSEBGSHAD = $49 ; Toad house background, shadowed TILE7_TOADHOUSEBGSHADUR = $4A ; Toad house background, shadow upper-right TILE7_TOADHOUSEBGSHADR = $4B ; Toad house background, shadow right TILE7_CHEST_UL = $81 ; Toad house chest upper left TILE7_CHEST_UR = $82 ; Toad house chest upper right TILE7_CHEST_LL = $83 ; Toad house chest lower left TILE7_CHEST_LR = $84 ; Toad house chest lower right TILE7_CHEST_OPEN_UL = $86 ; Toad house chest opened upper left TILE7_CHEST_OPEN_UR = $87 ; Toad house chest opened upper right TILE7_MINICHEST = $88 ; UNUSED mini chest tile?! TILE7_MINICHEST_OPEN = $89 ; UNUSED mini chest OPENED tile?! TILE7_UNK = $E3 ; Unknown background block; unsure who'd use it anyway... TILE7_TOADHOUSEBLOCK = $E6 ; Main building block of Toad House ; Tileset 8 (Vertical levels typical of World 7) TILE8_SPIKE_DOWN = $0C ; Downward pointing spikes TILE8_SPIKE_UP = $0D ; Upward pointing spikes TILE8_PIPEELBOW_UL = $4C ; Pipe elbow upper left TILE8_PIPEELBOW_UR = $4D ; Pipe elbow upper right TILE8_PIPEELBOW_LL = $4E ; Pipe elbow lower left TILE8_PIPEELBOW_LR = $4F ; Pipe elbow lower right TILE8_PIPEELBOW_CUL = $50 ; Pipe elbow corner upper left TILE8_PIPEELBOW_CUR = $51 ; Pipe elbow corner upper right TILE8_PIPEELBOW_CLL = $52 ; Pipe elbow corner lower left TILE8_PIPEELBOW_CLR = $53 ; Pipe elbow corner lower right TILE8_ARROWLIFT_UPL = $54 ; Arrow lift UP left tile TILE8_ARROWLIFT_UPR = $55 ; Arrow lift UP right tile TILE8_ARROWLIFT_RIGHTL = $56 ; Arrow lift RIGHT left tile TILE8_ARROWLIFT_RIGHTR = $57 ; Arrow lift RIGHT right tile TILE8_ARROWLIFT_LEFTL = $58 ; Arrow lift LEFT left tile TILE8_ARROWLIFT_LEFTR = $59 ; Arrow lift LEFT right tile TILE8_ARROWLIFT_RANDOML = $5A ; Arrow lift RANDOM left tile TILE8_ARROWLIFT_RANDOMR = $5C ; Arrow lift RANDOM right tile TILE8_BLACK = $80 ; Black space TILE8_SCENPIPE_ENDVL = $91 ; Scenery pipe end vertical left TILE8_SCENPIPE_ENDVR = $92 ; Scenery pipe end vertical right TILE8_MINIPIPE_VT = $93 ; Minipipe vertical top TILE8_MINIPIPE_VM = $94 ; Minipipe vertical middle TILE8_MINIPIPE_VB = $95 ; Minipipe vertical bottom TILE8_MINIPIPE_HL = $96 ; Minipipe horizontal left TILE8_MINIPIPE_HM = $97 ; Minipipe horizontal middle TILE8_MINIPIPE_HR = $98 ; Minipipe horizontal right TILE8_SCENPIPE_HT = $99 ; Scenery pipe horizontal top TILE8_SCENPIPE_ENDH1T = $9A ; Scenery pipe end horizontal 1 top TILE8_SCENPIPE_ENDH2T = $9B ; Scenery pipe end horizontal 2 top TILE8_SCENPIPE_ENDH3T = $9C ; Scenery pipe end horizontal 3 top TILE8_SCENPIPE_ENDH1B = $9E ; Scenery pipe end horizontal 1 bottom (level transit) TILE8_SCENPIPE_ENDH2B = $9F ; Scenery pipe end horizontal 2 bottom (no entry) TILE8_SCENPIPE_HB = $9D ; Scenery pipe horizontal bottom TILE8_SCENPIPE_VL_HMC = $A1 ; Scenery pipe vertical left with horizontal minipipe crossing TILE8_SCENPIPE_VR_HMC = $A2 ; Scenery pipe vertical right with horizontal minipipe crossing TILE8_SCENPIPE_VL_HTC = $A3 ; Scenery pipe vertical left with horizontal top crossing TILE8_SCENPIPE_VR_HTC = $A4 ; Scenery pipe vertical right with horizontal top crossing TILE8_SCENPIPE_HT_VLC = $A5 ; Scenery pipe horizontal top with vertical left crossing TILE8_SCENPIPE_HT_VRC = $A6 ; Scenery pipe horizontal top with vertical right crossing TILE8_SCENPIPE_HT_VMC = $A7 ; Scenery pipe horizontal top with vertical minipipe crossing TILE8_SCENPIPE_VL_HBC = $A8 ; Scenery pipe vertical left with horizontal bottom crossing TILE8_SCENPIPE_VR_HBC = $A9 ; Scenery pipe vertical right with horizontal bottom crossing TILE8_SCENPIPE_HB_VLC = $AA ; Scenery pipe horizontal bottom with vertical left crossing TILE8_SCENPIPE_HB_VRC = $AB ; Scenery pipe horizontal bottom with vertical right crossing TILE8_SCENPIPE_HB_VMC = $AC ; Scenery pipe horizontal bottom with vertical minipipe crossing TILE8_PIPEH3_B = $BF ; Pipe horizontal 3 bottom (not enterable) TILE8_BGPIPE_HT = $C0 ; Background pipe horizontal top TILE8_BGPIPE_ENDHT = $C2 ; Background pipe horizontal end top TILE8_BGPIPE_HB = $C3 ; Background pipe horizontal top TILE8_BGPIPE_ENDHB = $C4 ; Background pipe horizontal end top TILE8_BGPIPE_ENDVL = $C5 ; Background pipe vertical end left TILE8_BGPIPE_ENDVR = $C6 ; Background pipe vertical end right TILE8_BGPIPE_VL = $C7 ; Background pipe vertical left TILE8_BGPIPE_VR = $C8 ; Background pipe vertical right TILE8_BGPIPE_MVT = $C9 ; Background pipe minipipe vertical top TILE8_BGPIPE_MVM = $CA ; Background pipe minipipe vertical middle TILE8_BGPIPE_MVB = $CB ; Background pipe minipipe vertical bottom TILE8_BGPIPE_MHL = $CC ; Background pipe minipipe horizontal left TILE8_BGPIPE_MHM = $CD ; Background pipe minipipe horizontal middle TILE8_BGPIPE_MHR = $CE ; Background pipe minipipe horizontal right ; Tileset 9 (desert) TILE9_THINGROUND_LEDGE = $07 ; blue thin ground left edge (UNUSED?) TILE9_THINGROUND_REDGE = $08 ; blue thin ground right edge (UNUSED?) TILE9_CLOUD_L = $12 ; Cloud left TILE9_CLOUD_R = $13 ; Cloud right TILE9_THINGROUND_BLUE = $33 ; blue thin ground (UNUSED?) TILE9_PYRAMID_SLOPE = $4C ; Pyramid sloped edge TILE9_PYRAMID = $4D ; Pyramid fill TILE9_CHAIN_LEFT_PILLAR = $51 ; Pillar to left of the chain tile (no different than TILE9_CHAIN_RIGHT_PILLAR) TILE9_CHAIN_LEFT = $52 ; Chain on left side (UNUSED?) TILE9_CHAIN_RIGHT = $53 ; Chain on right side (UNUSED?) TILE9_CHAIN_RIGHT_PILLAR= $54 ; Pillar to right of the chain tile (no different than TILE9_CHAIN_LEFT_PILLAR) TILE9_BRICK_UL = $55 ; Sand brick upper left TILE9_BRICK_UM = $56 ; Sand brick upper middle (also desert ground) TILE9_BRICK_UR = $57 ; Sand brick upper right TILE9_BRICK_ML = $58 ; Sand brick middle left TILE9_BRICK_MM = $59 ; Sand brick middle middle TILE9_BRICK_MR = $5A ; Sand brick middle right TILE9_BRICK_LL = $5B ; Sand brick lower left TILE9_BRICK_LM = $5C ; Sand brick lower middle TILE9_BRICK_LR = $5D ; Sand brick lower right TILE9_SPIKEDOWN = $7D ; Spikes pointing downward TILE9_SPIKEUP = $7E ; Spikes pointing upward TILE9_BLOCK = $7F ; A simple orange block TILE9_SKY = $80 ; Sky TILE9_BIGBLOCK_ML = $81 ; Big block middle left TILE9_BIGBLOCK_MM = $82 ; Big block middle middle TILE9_BIGBLOCK_MR = $83 ; Big block middle right TILE9_BIGBLOCK_LL = $84 ; Big block lower left TILE9_BIGBLOCK_LM = $86 ; Big block lower middle TILE9_BIGBLOCK_LR = $87 ; Big block lower right TILE9_THINVBLOCK_B = $88 ; Thin vertical block bottom TILE9_PYRAMIDSH_SLOPE = $8B ; Pyramid shaded sloped edge TILE9_PYRAMIDSH = $8C ; Pyramid shaded fill TILE9_TREETOP_LEFT = $8F ; Tree top left TILE9_TREETOP_MIDDLE = $90 ; Tree top middle TILE9_TREETOP_RIGHT = $91 ; Tree top right TILE9_TREE = $92 ; Tree trunk TILE9_CACTUS = $93 ; BG cactus TILE9_ALTBACKGROUND = $97 ; Alternate background? TILE9_BIGBLOCK_UL = $98 ; Big block upper left TILE9_BIGBLOCK_UM = $99 ; Big block upper middle TILE9_BIGBLOCK_UR = $9A ; Big block upper right TILE9_THINVBLOCK_T = $9B ; Thin vertical block top TILE9_THINHBLOCK_L = $9C ; Thin horizontal block left TILE9_THINHBLOCK_R = $9D ; Thin horizontal block right TILE9_PIPEWORKS_CRACK = $C8 ; Cracked pipe hole TILE9_PIPEWORKS_GROUNDL = $C9 ; Pipeworks left ground connection TILE9_PIPEWORKS_GROUNDR = $CA ; Pipeworks right ground connection TILE9_PIPEWORKS_JCT = $E2 ; Pipeworks breakable junction (UNUSED) TILE9_PIPEWORKS_CORNER = $E3 ; Pipeworks corner TILE9_PIPEWORKS_H = $E4 ; Pipeworks horizontal TILE9_PIPEWORKS_V = $E5 ; Pipeworks vertical TILE9_CANNONBLOCK = $E6 ; Block which surrounds cannon TILE9_PIPEWORKS_GROUND = $E7 ; Pipeworks ground connection TILE9_CANNONTOP1 = $ED ; Upper top of cannon TILE9_CANNONTOP2 = $EE ; Lower top of cannon TILE9_CANNONMID = $ED ; Mid part to ground ; Tileset 10 (Airship) TILE10_SKY = $06 ; Sky TILE10_UPRIGHTCANNON_L = $24 ; Upright cannon pointing left TILE10_UPRIGHTCANNON_R = $25 ; Upright cannon pointing right TILE10_CEILINGCANNON_L = $26 ; Ceiling cannon pointing left TILE10_CEILINGCANNON_R = $27 ; Ceiling cannon pointing right TILE10_BIGCANNONMID_T = $28 ; Big cannon middle top TILE10_BIGCANNONEND_T = $29 ; Big cannon end top TILE10_BIGCANNONMID_B = $2A ; Big cannon middle bottom TILE10_BIGCANNONEND_B = $2B ; Big cannon end bottom TILE10_LILCANNON_END = $2C ; Little cannon end TILE10_LILCANNON_MID = $2D ; Little cannon mid TILE10_WARGROUND_UL = $33 ; "War ground" upper left TILE10_WARGROUND_UR = $34 ; "War ground" upper right TILE10_WARGROUND_LL = $35 ; "War ground" lower left TILE10_WARGROUND_LR = $36 ; "War ground" lower right TILE10_INVISSOLID = $37 ; Generally solid in other tilsets, invisible here? TILE10_CRATE_ML = $49 ; Crate middle left TILE10_CRATE_MM = $4A ; Crate middle middle TILE10_CRATE_MR = $4B ; Crate middle right TILE10_CRATE_LL = $4C ; Crate lower left TILE10_CRATE_LM = $4D ; Crate lower middle TILE10_CRATE_LR = $4E ; Crate lower right TILE10_SUPPORT_UL = $4F ; Wooden supports upper left TILE10_SUPPORT_UM = $50 ; Wooden supports upper middle TILE10_SUPPORT_UR = $51 ; Wooden supports upper right TILE10_SUPPORT_LL = $52 ; Wooden supports lower left TILE10_SUPPORT_LM = $53 ; Wooden supports lower middle TILE10_SUPPORT_LR = $54 ; Wooden supports lower right TILE10_SUPPORT_ML = $55 ; Wooden supports middle left TILE10_SUPPORT_MR = $56 ; Wooden supports middle right TILE10_WOODFLOOR_THK_L = $57 ; Wood floor thick left TILE10_WOODFLOOR_THK_R = $58 ; Wood floor thick right TILE10_WOODFLOOR_1 = $59 ; Wood floor misc 1 TILE10_WOODFLOOR_2 = $5A ; Wood floor misc 2 TILE10_WOODFLOOR_3 = $5B ; Wood floor misc 3 TILE10_CRATE_UL = $5C ; Crate upper left TILE10_CRATE_UM = $5D ; Crate upper middle TILE10_CRATE_UR = $5E ; Crate upper right TILE10_BLACK = $80 ; Black TILE10_THREAD_H = $81 ; Thread horizontal TILE10_THREAD_V = $82 ; Thread vertical TILE10_SCREW_H = $83 ; Screw horizontal TILE10_SCREW_V = $84 ; Screw vertical TILE10_METALBG = $86 ; Metal background TILE10_METSUPPORT_LT = $87 ; Metal support left top TILE10_METSUPPORT_LM = $88 ; Metal support left mid TILE10_METSUPPORT_LB = $89 ; Metal support left bottom TILE10_METSUPPORT_RT = $8A ; Metal support right top TILE10_METSUPPORT_RM = $8B ; Metal support right mid TILE10_METSUPPORT_RB = $8C ; Metal support right bottom TILE10_METSUPPORT_ML = $8D ; Metal support middle left TILE10_METSUPPORT_MR = $8E ; Metal support middle left TILE10_METALPLATE_LL = $8F ; Metal plate lower left TILE10_METALPLATE_LM = $90 ; Metal plate lower middle TILE10_METALPLATE_LR = $91 ; Metal plate lower right TILE10_4WAYCANNON_90_UL = $92 ; 4-way cannon at 90 degrees upper left TILE10_4WAYCANNON_90_UR = $93 ; 4-way cannon at 90 degrees upper right TILE10_4WAYCANNON_90_LL = $94 ; 4-way cannon at 90 degrees lower left TILE10_4WAYCANNON_90_LR = $95 ; 4-way cannon at 90 degrees lower right TILE10_4WAYCANNON_45_UL = $96 ; 4-way cannon at 45 degrees upper left TILE10_4WAYCANNON_45_UR = $97 ; 4-way cannon at 45 degrees upper right TILE10_4WAYCANNON_45_LL = $98 ; 4-way cannon at 45 degrees lower left TILE10_4WAYCANNON_45_LR = $99 ; 4-way cannon at 45 degrees lower right TILE10_4WAYCANNON_MNT_L = $9A ; 4-way cannon ceiling mount left TILE10_4WAYCANNON_MNT_R = $9B ; 4-way cannon ceiling mount right TILE10_BOLT_V = $9C ; Bolt vertical TILE10_BOLT_H = $9D ; Bolt horizontal TILE10_METSUPPORT_UM = $9E ; Metal support upper middle TILE10_METSUPPORT_UL = $9F ; Metal support upper left TILE10_METSUPPORT_UR = $A0 ; Metal support upper right TILE10_METSUPPORT_LL = $A1 ; Metal support lower left TILE10_METSUPPORT_LR = $A2 ; Metal support lower right TILE10_METALPLATE_UL = $A3 ; Metal plate upper left TILE10_METALPLATE_UM = $A4 ; Metal plate upper middle TILE10_METALPLATE_UR = $A5 ; Metal plate upper right TILE10_FLAMEJET_H = $A6 ; Flamejet horizontal TILE10_FLAMEJET_V = $A7 ; Flamejet vertical TILE10_WALLCANNONF_UL = $A8 ; Wall cannon "forward" (a la the slash) upper left TILE10_WALLCANNONF_LL = $A9 ; Wall cannon "forward" (a la the slash) lower left TILE10_WALLCANNONF_UR = $AA ; Wall cannon "forward" (a la the slash) upper right TILE10_WALLCANNONF_LR = $AB ; Wall cannon "forward" (a la the slash) lower right TILE10_WALLCANNONB_UL = $AC ; Wall cannon "backward" (a la the slash) upper left TILE10_WALLCANNONB_UR = $BD ; Wall cannon "backward" (a la the slash) upper right TILE10_WALLCANNONB_LL = $BE ; Wall cannon "backward" (a la the slash) lower left TILE10_WALLCANNONB_LR = $BF ; Wall cannon "backward" (a la the slash) lower right TILE10_WOODUNDERCURVE_L = $C0 ; Wood underside curve left TILE10_WOODUNDERCURVE_R = $C2 ; Wood underside curve right TILE10_ROCKYWRENCH_HOLE = $C3 ; Rocky Wrench's hole TILE10_ROPERAIL = $C6 ; Rope railing (near end pipe) TILE10_ROPERAIL_END = $C7 ; Rope railing end TILE10_STOWEDANCHOR = $C8 ; Stowed anchor at front of ship TILE10_PORTHOLE = $C9 ; Port hole (circular window) TILE10_WOODH_L = $E2 ; Wood log horizontal left TILE10_WOODH_M1 = $E3 ; Wood log horizontal middle 1 TILE10_WOODH_M2 = $E4 ; Wood log horizontal middle 2 TILE10_WOODH_R = $E5 ; Wood log horizontal right TILE10_WOODV_T = $E6 ; Wood log vertical top TILE10_WOODV_M1 = $E7 ; Wood log vertical middle 1 TILE10_WOODV_M2 = $E8 ; Wood log vertical middle 2 TILE10_WOODV_B = $E9 ; Wood log vertical bottom TILE10_WOODTHICK_UL = $EA ; Wood thick upper left TILE10_WOODTHICK_UR = $EB ; Wood thick upper left TILE10_WOODTHICK_M1L = $EC ; Wood thick middle 1 left TILE10_WOODTHICK_M1R = $ED ; Wood thick middle 1 right TILE10_WOODTHICK_M2L = $EE ; Wood thick middle 2 left TILE10_WOODTHICK_M2R = $EF ; Wood thick middle 2 right TILE10_WOODTHICK_LL = $F4 ; Wood thick lower left TILE10_WOODTHICK_LR = $F5 ; Wood thick lower left TILE10_WOODTIP_SHORT = $F6 ; Wood tip short TILE10_WOODTIP_LONGL = $F7 ; Wood tip long left TILE10_WOODTIP_LONGR = $F8 ; Wood tip long right TILE10_WOODBOTTOM_L = $F9 ; Wood bottom left TILE10_WOODBOTTOM_M1 = $FA ; Wood bottom middle 1 TILE10_WOODBOTTOM_M2 = $FB ; Wood bottom middle 2 TILE10_WOODBOTTOM_R = $FC ; Wood bottom right TILE10_LEDGE = $FD ; Wood ledge TILE10_REARTIP = $FE ; Wood rear tip ; Tileset 11 (Giant World) TILE11_JCLOUD_LL = $02 ; Giant Judgem's Cloud Lower Left TILE11_JCLOUD_LR = $06 ; Giant Judgem's Cloud Lower Right TILE11_JCLOUD_UL = $1F ; Giant Judgem's Cloud Upper Left TILE11_JCLOUD_UR = $20 ; Giant Judgem's Cloud Upper Right TILE11_BRICK_UL = $47 ; Giant brick upper left TILE11_BRICK_UR = $48 ; Giant brick upper right TILE11_BRICK_LL = $49 ; Giant brick lower left TILE11_BRICK_LR = $4A ; Giant brick lower right TILE11_QBLOCKC_UL = $4B ; Giant [?] block (with coin) upper left TILE11_QBLOCKC_UR = $4C ; Giant [?] block (with coin) upper right TILE11_QBLOCKC_LL = $4D ; Giant [?] block (with coin) lower left TILE11_QBLOCKC_LR = $4E ; Giant [?] block (with coin) lower right TILE11_WOOD_UL = $4F ; Giant wood block upper left TILE11_WOOD_UR = $50 ; Giant wood block upper right TILE11_WOOD_LL = $51 ; Giant wood block lower left TILE11_WOOD_LR = $52 ; Giant wood block lower right TILE11_METAL_UL = $53 ; Hit block metal plate upper left TILE11_METAL_UR = $54 ; Hit block metal plate upper right TILE11_METAL_LL = $55 ; Hit block metal plate lower left TILE11_METAL_LR = $56 ; Hit block metal plate lower right TILE11_GROUND_UL = $57 ; Giant ground upper left TILE11_GROUND_UR = $58 ; Giant ground upper left TILE11_GROUND_LL = $59 ; Giant ground upper left TILE11_GROUND_LR = $5A ; Giant ground upper left TILE11_QBLOCKP_UL = $5B ; Giant [?] block (with leaf) upper left TILE11_QBLOCKP_UR = $5C ; Giant [?] block (with leaf) upper right TILE11_QBLOCKP_LL = $5D ; Giant [?] block (with leaf) lower left TILE11_QBLOCKP_LR = $5E ; Giant [?] block (with leaf) lower right TILE11_SKY = $80 TILE11_HILL_PEAK = $89 ; Giant hill peak TILE11_HILL_LSLOPE = $8A ; Giant hill left slope TILE11_HILL_MID = $8B ; Giant hill filler TILE11_HILL_RSLOPE = $8C ; Giant hill right slope TILE11_PIPE_UL = $A4 ; Giant Pipe Upper Left TILE11_PIPE_UM = $A5 ; Giant Pipe Upper Middle TILE11_PIPE_UR = $A6 ; Giant Pipe Upper Right TILE11_PIPE_ML = $A7 ; Giant Pipe Middle Left TILE11_PIPE_MM = $A8 ; Giant Pipe Middle Middle TILE11_PIPE_MR = $A9 ; Giant Pipe Middle Right TILE11_PIPE_LL = $AA ; Giant Pipe Lower Left TILE11_PIPE_LM = $AB ; Giant Pipe Lower Middle TILE11_PIPE_LR = $AC ; Giant Pipe Lower Right TILE11_CORAL_UL = $F4 ; Giant coral upper left TILE11_CORAL_UR = $F5 ; Giant coral upper right TILE11_CORAL_LL = $F6 ; Giant coral lower left TILE11_CORAL_LR = $F7 ; Giant coral lower right ; Tileset 12 (Ice, technically shares with Tileset 4) TILE12_CLOUD_UL = $08 ; Cloud upper left TILE12_CLOUD_UM = $09 ; Cloud upper middle TILE12_CLOUD_UR = $0A ; Cloud upper right TILE12_CLOUD_LL = $0B ; Cloud lower left TILE12_CLOUD_LM = $0C ; Cloud lower middle TILE12_CLOUD_LR = $0D ; Cloud lower right TILE12_SNOWBLOCK_LL = $0E ; Snow platform, lower left TILE12_SNOWBLOCK_LM = $0F ; Snow platform, lower middle TILE12_SNOWBLOCK_LR = $10 ; Snow platform, lower right TILE12_SNOWBLOCK_UL = $22 ; Snow platform, upper left TILE12_SNOWBLOCK_UM = $23 ; Snow platform, upper middle TILE12_SNOWBLOCK_UR = $24 ; Snow platform, upper right TILE12_SNOWY_M = $25 ; Middle of large snowy platform TILE12_LARGEICEBLOCK_UL = $36 ; Large 2x2 ice block, upper left TILE12_LARGEICEBLOCK_UR = $37 ; Large 2x2 ice block, upper right TILE12_LARGEICEBLOCK_LL = $38 ; Large 2x2 ice block, lower left TILE12_LARGEICEBLOCK_LR = $39 ; Large 2x2 ice block, lower right TILE12_ICEBLOCK = $3A ; Ice block TILE12_GROUND_L = $4A ; Solid bottom ground left TILE12_GROUND_M = $4B ; Solid bottom ground middle TILE12_GROUND_R = $4C ; Solid bottom ground right TILE12_FROZENCOIN = $55 ; Frozen coin TILE12_FROZENMUNCHER = $56 ; Frozen muncher TILE12_SKY = $80 ; Sky TILE12_SNOWGREEN_UL = $8E ; Frosty green platform, upper left TILE12_SNOWGREEN_UM = $8F ; Frosty green platform, upper middle TILE12_SNOWGREEN_UR = $90 ; Frosty green platform, upper right ; Tileset 13 (Sky areas, inc. coin heaven) TILE13_GOALBLACK = $00 ; Goal darkness TILE13_GOALEDGE = $01 ; Goal edge TILE13_STARS1 = $07 ; Stars! (Lost level) TILE13_STARS2 = $08 ; Stars! (Lost level) TILE13_STARS3 = $09 ; Stars! (Lost level) TILE13_DBLCLOUD_UM = $0A ; Double cloud upper middle TILE13_DBLCLOUD_BM = $0B ; Double cloud bottom middle TILE13_DBLCLOUD_BR = $0C ; Double cloud bottom right TILE13_DBLCLOUD_BL = $0D ; Double cloud bottom left TILE13_DBLCLOUD_UL = $0E ; Double cloud upper left TILE13_DBLCLOUD_UR = $0F ; Double cloud upper right TILE13_GOALBLACKCLOUD = $10 ; Goal darkness on top of cloud TILE13_GOALEDGECLOUD = $11 ; Goal edge on top of cloud TILE13_DBLCLOUD_LM = $21 ; Double cloud lower middle TILE13_DBLCLOUD_MM = $22 ; Double cloud middle middle TILE13_DBLCLOUD_LR = $23 ; Double cloud lower right TILE13_DBLCLOUD_MR = $24 ; Double cloud middle right TILE13_DBLCLOUD_LL = $25 ; Double cloud lower left TILE13_DBLCLOUD_ML = $26 ; Double cloud middle left TILE13_THICKCLOUD_LM = $36 ; Thick cloud lower middle ; As far as I know, NONE of these are used, and they would have provided a fade ; from the bright skies of below into increasingly darker and eventually black ; sky... going into space perhaps? Ultimately would have employed TILE13_STARS1/2/3 TILE13_SKY_DARKTOBLACK = $81 ; Gradient dark to black TILE13_SKY_LIGHTTODARK = $82 ; Gradient light to dark TILE13_SKY_BLACK = $83 ; Black sky TILE13_SKY_DARK = $84 ; Dark sky TILE13_SKY_LIGHT = $86 ; Light sky TILE13_SKY_DARKSTAR = $87 ; Like TILE13_SKY_DARK, but one star visible TILE13_SKY_DARKTOBLACKS = $88 ; Like TILE13_SKY_DARKTOBLACK, but one star visible TILE13_ROUNDCLOUDBLU_T = $C3 ; Round cloud (blue sky BG) top TILE13_ROUNDCLOUDWHT_T = $C4 ; Round cloud (white cloud BG) top TILE13_CLOUD = $C5 ; General white cloud filler TILE13_BALLCLOUD_UL = $C6 ; "Ball cloud" formation with ball formation upper left TILE13_BALLCLOUD_UR = $C7 ; "Ball cloud" formation with ball formation upper right TILE13_BALLCLOUD_LL = $C8 ; "Ball cloud" formation with ball formation lower left TILE13_BALLCLOUD_LR = $C9 ; "Ball cloud" formation with ball formation lower right TILE13_ROUNDCLOUDLAR_LT = $CA ; Round cloud (large round cloud BG) left top TILE13_ROUNDCLOUDLAR_RT = $CB ; Round cloud (large round cloud BG) right top TILE13_SKY = $CC ; Sky TILE13_LARGEROUND_UL = $CD ; Large round cloud upper left TILE13_LARGEROUND_UR = $CE ; Large round cloud upper right TILE13_LARGEROUND_LL = $CF ; Large round cloud lower left TILE13_LARGEROUND_LR = $D0 ; Large round cloud lower right TILE13_LONGCLOUDWHIT_UL = $D1 ; Long cloud (white cloud BG) upper left TILE13_LONGCLOUDWHIT_UM = $D2 ; Long cloud (white cloud BG) upper middle TILE13_LONGCLOUDWHIT_UR = $D3 ; Long cloud (white cloud BG) upper right TILE13_LONGCLOUDBLUE_UL = $D4 ; Long cloud (blue sky BG) upper left TILE13_LONGCLOUDBLUE_UM = $D5 ; Long cloud (blue sky BG) upper middle TILE13_LONGCLOUDBLUE_UR = $D6 ; Long cloud (blue sky BG) upper right TILE13_POINTYCLOUDBLU_L = $E2 ; Pointy-end cloud platform (blue sky BG) left TILE13_POINTYCLOUDBLU_M = $E3 ; Pointy-end cloud platform (blue sky BG) middle TILE13_POINTYCLOUDBLU_R = $E4 ; Pointy-end cloud platform (blue sky BG) right TILE13_POINTYCLOUDWHT_L = $E5 ; Pointy-end cloud platform (white cloud BG) left TILE13_POINTYCLOUDWHT_M = $E6 ; Pointy-end cloud platform (white cloud BG) middle TILE13_POINTYCLOUDWHT_R = $E7 ; Pointy-end cloud platform (white cloud BG) right TILE13_LONGCLOUDWHIT_LL = $E8 ; Long cloud (white cloud BG) lower left TILE13_LONGCLOUDWHIT_LM = $E9 ; Long cloud (white cloud BG) lower middle TILE13_LONGCLOUDWHIT_LR = $EA ; Long cloud (white cloud BG) lower right TILE13_LONGCLOUDBLUE_LL = $EB ; Long cloud (blue sky BG) lower left TILE13_LONGCLOUDBLUE_LM = $EC ; Long cloud (blue sky BG) lower middle TILE13_LONGCLOUDBLUE_LR = $ED ; Long cloud (blue sky BG) lower right TILE13_ROUNDCLOUDLAY_T = $EE ; Round cloud (cloud overlay BG) top ; Tileset 14 (Underground style) TILE14_SKY = $02 ; Sky TILE14_ABOVE_SLOPE45B2T = $25 ; Above ground 45 degree slope, bottom-to-top TILE14_ABOVE_HORZGROUND = $26 ; Above ground horizontal ground TILE14_ABOVE_SLOPE45T2B = $27 ; Above ground 45 degree slope, top-to-bottom TILE14_ABOVE_SLOPE225B2T_L= $28 ; Underwater 22.5 degree slope, bottom-to-top, lower TILE14_ABOVE_SLOPE225B2T_U= $29 ; Underwater 22.5 degree slope, bottom-to-top, upper TILE14_ABOVE_SLOPE225T2B_U= $2A ; Underwater 22.5 degree slope, top-to-bottom, lower TILE14_ABOVE_SLOPE225T2B_L= $2B ; Underwater 22.5 degree slope, top-to-bottom, upper TILE14_ABOVE_CORNER_UL = $33 ; Above ground upper left corner TILE14_ABOVE_CORNER_UR = $35 ; Above ground upper right corner TILE14_ABOVE_VERTGROUNDL= $34 ; Above ground vertical ground left edge TILE14_ABOVE_VERTGROUNDR= $36 ; Above ground vertical ground right edge TILE14_ABOVE_MIDGROUND = $37 ; Above ground Middle ground TILE14_SLOPE45T2B_CEIL = $A0 ; Ceiling slope 45 degrees, top-to-bottom TILE14_SLOPE45B2T_CEIL = $A1 ; Ceiling slope 45 degrees, bottom-to-top TILE14_SLOPE225T2B_L_CEIL= $A2 ; Ceiling 22.5 degree slope, top-to-bottom, lower TILE14_SLOPE225T2B_U_CEIL= $A3 ; Ceiling 22.5 degree slope, top-to-bottom, upper TILE14_SLOPE225B2T_U_CEIL= $A4 ; Ceiling 22.5 degree slope, bottom-to-top, lower TILE14_SLOPE225B2T_L_CEIL= $A5 ; Ceiling 22.5 degree slope, bottom-to-top, upper TILE14_WSLOPE45T2B_CEIL = $E9 ; Underwater Ceiling slope 45 degrees, top-to-bottom TILE14_WSLOPE45B2T_CEIL = $EA ; Underwater Ceiling slope 45 degrees, bottom-to-top TILE14_WSLOPE225T2B_L_CEIL= $EB ; Underwater Ceiling 22.5 degree slope, top-to-bottom, lower TILE14_WSLOPE225T2B_U_CEIL= $EC ; Underwater Ceiling 22.5 degree slope, top-to-bottom, upper TILE14_WSLOPE225B2T_U_CEIL= $ED ; Underwater Ceiling 22.5 degree slope, bottom-to-top, lower TILE14_WSLOPE225B2T_L_CEIL= $EE ; Underwater Ceiling 22.5 degree slope, bottom-to-top, upper ; Tileset 15/16/17 (Bonus Games) TILE15_BLACK = $09 ; Black TILE15_WHITESPACE_PAL0 = $0A ; White space tile in palette 0 TILE15_BRICKBG = $40 ; White/pink brick in the background TILE15_PLAYERRAC_TOPM = $41 ; Middle of Top of Raccoon Player at table TILE15_PLAYERRAC_TOPR = $42 ; Right of Top of Raccoon Player at table TILE15_PLAYERBIG_HEADL = $43 ; Left Head of Big Player at table TILE15_PLAYERBIG_HEADM = $44 ; Middle Head of Big Player at table TILE15_PLAYERBIG_HEADR = $45 ; Right Head of Big Player at table TILE15_PLAYERBIG_RACL = $46 ; Bottom left of Raccoon Player at table TILE15_PLAYERBIG_TOPM = $47 ; Middle of Top of Big Player at table TILE15_PLAYERBIG_TOPR = $48 ; Right of Top of Big Player at table TILE15_PLAYERBIG_BOTL = $49 ; Bottom left of Big Player at table TILE15_PLAYERSM_TOP = $4A ; Top of Small Player at table TILE15_UNKTALL_UL = $4B ; Tile for unknown tall thing top upper left TILE15_UNKTALL_UR = $4C ; Tile for unknown tall thing top upper right TILE15_UNKTALL_R1L = $4D ; Tile for unknown tall thing top row 1 left TILE15_UNKTALL_R1R = $4E ; Tile for unknown tall thing top row 1 right TILE15_UNKTALL_R2L = $4F ; Tile for unknown tall thing top row 2 left TILE15_UNKTALL_R2R = $50 ; Tile for unknown tall thing top row 2 right TILE15_UNKTALL_LL = $51 ; Tile for unknown tall thing top lower left TILE15_UNKTALL_LR = $52 ; Tile for unknown tall thing top lower right TILE15_PLAYERBIG_TORL = $80 ; Left Torso of Big Player at table TILE15_PLAYERBIG_TORM = $81 ; Middle Torso of Big Player at table TILE15_PLAYERBIG_TORR = $82 ; Right Torso of Big Player at table TILE15_PLAYERBIG_RACM = $83 ; Bottom middle of Raccoon Player at table TILE15_PLAYERBIG_BOTR = $84 ; Bottom right of Big Player at table TILE15_PLAYERBIG_BOTM = $85 ; Bottom middle of Big Player at table TILE15_PLAYERSM_BOTTOM = $86 ; Bottom of Small Player at table TILE15_BRICKFLOOR = $C0 ; Orange brick making up the floor TILE15_BORDER_UL = $C1 ; Host greet border upper left TILE15_BORDER_ML = $C2 ; Host greet border middle left TILE15_BORDER_LL = $C3 ; Host greet border lower left TILE15_BORDER_UM = $C4 ; Host greet border upper middle TILE15_BORDER_LM = $C5 ; Host greet border lower middle TILE15_BORDER_UR = $C6 ; Host greet border upper right TILE15_BORDER_MR = $C7 ; Host greet border middle right TILE15_BORDER_LR = $C8 ; Host greet border lower right TILE15_WHITESPACE_PAL3 = $CD ; White space tile in palette 3 TILE15_TABLE_UL = $CE ; Table upper left TILE15_TABLE_UM = $CF ; Table upper middle TILE15_TABLE_UR = $D0 ; Table upper left TILE15_TABLE_LL = $D1 ; Table lower left TILE15_TABLE_LM = $D2 ; Table lower middle TILE15_TABLE_LR = $D3 ; Table lower left ; Tileset 18 (2P Vs) ; NOTE: Several tiles TILE18_BLACK = $02 ; Black tile TILE18_MSTATUS_UL = $44 TILE18_STATUS_UM = $45 TILE18_MSTATUS_UR = $46 TILE18_LSTATUS_UL = $47 TILE18_LSTATUS_UR = $48 TILE18_MSTATUS_LL = $49 TILE18_MSTATUS_LML = $4A TILE18_STATUS_LM = $4B TILE18_MSTATUS_LR = $4C TILE18_LSTATUS_LL = $4D TILE18_LSTATUS_LML = $4E TILE18_LSTATUS_LR = $4F TILE18_BRICKFLOOR = $50 ; Brick floor tiles TILE18_DIAMOND = $51 ; NOT USED SMB1-ish diamond blocks TILE18_QBLOCK = $BC TILE18_LADDER = $C0 ; Ladder (used in final variation) TILE18_BOUNCEBLOCK = $C1 ; Block that bounces when Player hits underneath it TILE18_BOUNCEDBLOCK = $C2 ; Temporary tile for when block has been bounced ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ASM INCLUDES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Object support routines .bank 0 .org $C000 .include "PRG/prg000.asm" ; Objects $00-$23 .bank 1 .org $A000 .include "PRG/prg001.asm" ; Objects $24-$47 .bank 2 .org $A000 .include "PRG/prg002.asm" ; Objects $48-$6B .bank 3 .org $A000 .include "PRG/prg003.asm" ; Objects $6C-$8F .bank 4 .org $A000 .include "PRG/prg004.asm" ; Objects $90-$B3 and special-function object placeholders ($B4-$BC, $D1-$D6) .bank 5 .org $A000 .include "PRG/prg005.asm" ; Object placement/layout data (for levels) .bank 6 .org $C000 .include "PRG/prg006.asm" ; Special Objects, Cannon Fire, and some miscellaneous routines .bank 7 .org $A000 .include "PRG/prg007.asm" ; Most of Player control code .bank 8 .org $A000 .include "PRG/prg008.asm" ; 2P Vs and Autoscroll .bank 9 .org $A000 .include "PRG/prg009.asm" ; Handles map BG graphics and logic code; also stores a few DMC samples .bank 10 .org $C000 .include "PRG/prg010.asm" ; Main map logic and map sprites .bank 11 .org $A000 .include "PRG/prg011.asm" ; Tileset 0 (Map), Map object code, map level layouts (links to level layouts/object sets), ; completion code, Airship / bonus host room / toad shop / coin ship / unused map object $0C layout pointers .bank 12 .org $A000 .include "PRG/prg012.asm" ; Tileset 14 (Underground style) .bank 13 .org $A000 .include "PRG/prg013.asm" ; Tileset 18 (2P Vs), 2P Vs battlefields, and shared level load routines .bank 14 .org $C000 .include "PRG/prg014.asm" ; Tileset 1 (Plains style) .bank 15 .org $A000 .include "PRG/prg015.asm" ; Tileset 3 (Hills style) .bank 16 .org $A000 .include "PRG/prg016.asm" ; Tileset 4 (High-Up style) / 12 (Ice) .bank 17 .org $A000 .include "PRG/prg017.asm" ; Tileset 6 (Water level), 7 (Toad house), 8 (Vertical levels typical of World 7) .bank 18 .org $A000 .include "PRG/prg018.asm" ; Tileset 5 (World 7 plant infestations), 11 (Giant World), 13 (Sky areas, inc. coin heaven) .bank 19 .org $A000 .include "PRG/prg019.asm" ; Tileset 9 (Desert) .bank 20 .org $A000 .include "PRG/prg020.asm" ; Tileset 2 (Fortress) .bank 21 .org $A000 .include "PRG/prg021.asm" ; Bonus games (Spade, N-Spade, and the lost games) .bank 22 .org $C000 .include "PRG/prg022.asm" ; Tileset 10 (Airship) .bank 23 .org $A000 .include "PRG/prg023.asm" ; Title screen, ending (logic and images), Toad and King cinematic (Pre-wand-return only!) ; Also home a large copy/paste error from PRG022, first half of sprite lists for ending .bank 24 .org $A000 .include "PRG/prg024.asm" ; Contains mostly command buffer graphics for title screen / ending (large images), ; second half of sprite lists for ending, and a table to access them .bank 25 .org $C000 .include "PRG/prg025.asm" ; Tileset 15, 16, 17 (Bonus games) ; Status bar routines (draw, use items, etc.), level junctions ; (inc. pointers for Big [?] block area and generic pipe exits), border draw, fade routines .bank 26 .org $A000 .include "PRG/prg026.asm" ; Palettes, palette routines, Toad and King Cinematic (Post-wand-return only!) .bank 27 .org $A000 .include "PRG/prg027.asm" ; First bank of the sound engine .bank 28 .org $A000 .include "PRG/prg028.asm" ; Some of the music segments, tile/block change event, pipe movement code, Toad House code, ; Player's draw and animation routines .bank 29 .org $C000 .include "PRG/prg029.asm" ; This bank is ALWAYS active in ROM, sitting at 8000h-9FFFh ; Contains interrupt handling code and other constantly reused functionality .bank 30 .org $8000 .include "PRG/prg030.asm" ; This bank is ALWAYS active in ROM, sitting at E000h-FFFFh ; Contains interrupt handling code and other constantly reused functionality .bank 31 .org $E000 .include "PRG/prg031.asm" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; CHR ROM BEGINS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .incchr "CHR/chr000.pcx" .incchr "CHR/chr001.pcx" .incchr "CHR/chr002.pcx" .incchr "CHR/chr003.pcx" .incchr "CHR/chr004.pcx" .incchr "CHR/chr005.pcx" .incchr "CHR/chr006.pcx" .incchr "CHR/chr007.pcx" .incchr "CHR/chr008.pcx" .incchr "CHR/chr009.pcx" .incchr "CHR/chr010.pcx" .incchr "CHR/chr011.pcx" .incchr "CHR/chr012.pcx" .incchr "CHR/chr013.pcx" .incchr "CHR/chr014.pcx" .incchr "CHR/chr015.pcx" .incchr "CHR/chr016.pcx" .incchr "CHR/chr017.pcx" .incchr "CHR/chr018.pcx" .incchr "CHR/chr019.pcx" .incchr "CHR/chr020.pcx" .incchr "CHR/chr021.pcx" .incchr "CHR/chr022.pcx" .incchr "CHR/chr023.pcx" .incchr "CHR/chr024.pcx" .incchr "CHR/chr025.pcx" .incchr "CHR/chr026.pcx" .incchr "CHR/chr027.pcx" .incchr "CHR/chr028.pcx" .incchr "CHR/chr029.pcx" .incchr "CHR/chr030.pcx" .incchr "CHR/chr031.pcx" .incchr "CHR/chr032.pcx" .incchr "CHR/chr033.pcx" .incchr "CHR/chr034.pcx" .incchr "CHR/chr035.pcx" .incchr "CHR/chr036.pcx" .incchr "CHR/chr037.pcx" .incchr "CHR/chr038.pcx" .incchr "CHR/chr039.pcx" .incchr "CHR/chr040.pcx" .incchr "CHR/chr041.pcx" .incchr "CHR/chr042.pcx" .incchr "CHR/chr043.pcx" .incchr "CHR/chr044.pcx" .incchr "CHR/chr045.pcx" .incchr "CHR/chr046.pcx" .incchr "CHR/chr047.pcx" .incchr "CHR/chr048.pcx" .incchr "CHR/chr049.pcx" .incchr "CHR/chr050.pcx" .incchr "CHR/chr051.pcx" .incchr "CHR/chr052.pcx" .incchr "CHR/chr053.pcx" .incchr "CHR/chr054.pcx" .incchr "CHR/chr055.pcx" .incchr "CHR/chr056.pcx" .incchr "CHR/chr057.pcx" .incchr "CHR/chr058.pcx" .incchr "CHR/chr059.pcx" .incchr "CHR/chr060.pcx" .incchr "CHR/chr061.pcx" .incchr "CHR/chr062.pcx" .incchr "CHR/chr063.pcx" .incchr "CHR/chr064.pcx" .incchr "CHR/chr065.pcx" .incchr "CHR/chr066.pcx" .incchr "CHR/chr067.pcx" .incchr "CHR/chr068.pcx" .incchr "CHR/chr069.pcx" .incchr "CHR/chr070.pcx" .incchr "CHR/chr071.pcx" .incchr "CHR/chr072.pcx" .incchr "CHR/chr073.pcx" .incchr "CHR/chr074.pcx" .incchr "CHR/chr075.pcx" .incchr "CHR/chr076.pcx" .incchr "CHR/chr077.pcx" .incchr "CHR/chr078.pcx" .incchr "CHR/chr079.pcx" .incchr "CHR/chr080.pcx" .incchr "CHR/chr081.pcx" .incchr "CHR/chr082.pcx" .incchr "CHR/chr083.pcx" .incchr "CHR/chr084.pcx" .incchr "CHR/chr085.pcx" .incchr "CHR/chr086.pcx" .incchr "CHR/chr087.pcx" .incchr "CHR/chr088.pcx" .incchr "CHR/chr089.pcx" .incchr "CHR/chr090.pcx" .incchr "CHR/chr091.pcx" .incchr "CHR/chr092.pcx" .incchr "CHR/chr093.pcx" .incchr "CHR/chr094.pcx" .incchr "CHR/chr095.pcx" .incchr "CHR/chr096.pcx" .incchr "CHR/chr097.pcx" .incchr "CHR/chr098.pcx" .incchr "CHR/chr099.pcx" .incchr "CHR/chr100.pcx" .incchr "CHR/chr101.pcx" .incchr "CHR/chr102.pcx" .incchr "CHR/chr103.pcx" .incchr "CHR/chr104.pcx" .incchr "CHR/chr105.pcx" .incchr "CHR/chr106.pcx" .incchr "CHR/chr107.pcx" .incchr "CHR/chr108.pcx" .incchr "CHR/chr109.pcx" .incchr "CHR/chr110.pcx" .incchr "CHR/chr111.pcx" .incchr "CHR/chr112.pcx" .incchr "CHR/chr113.pcx" .incchr "CHR/chr114.pcx" .incchr "CHR/chr115.pcx" .incchr "CHR/chr116.pcx" .incchr "CHR/chr117.pcx" .incchr "CHR/chr118.pcx" .incchr "CHR/chr119.pcx" .incchr "CHR/chr120.pcx" .incchr "CHR/chr121.pcx" .incchr "CHR/chr122.pcx" .incchr "CHR/chr123.pcx" .incchr "CHR/chr124.pcx" .incchr "CHR/chr125.pcx" .incchr "CHR/chr126.pcx" .incchr "CHR/chr127.pcx"
46.085991
204
0.73084
c483ad05a6bc9f9a600acf35848d3ce088b8571e
945
asm
Assembly
data/games/mining_obstacles.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/games/mining_obstacles.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/games/mining_obstacles.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
2
2021-08-11T19:47:07.000Z
2022-01-01T07:07:56.000Z
MiningObstacleList: dw .v_1x4 dw .v_2x4 dw .h_4x1 dw .h_4x2 dw .s_2x2 dw .s_3x3 dw .z_2x3_1 dw .z_2x3_2 dw .z_3x2_1 dw .z_3x2_2 dw .t_1 dw .t_2 dw .t_3 dw .t_4 .v_1x4 db 1, 4 db $0a db $1a db $1a db $12 .v_2x4 db 2, 4 db $0b, $0c db $1b, $1c db $1b, $1c db $13, $14 .h_4x1 db 4, 1 db $07, $08, $08, $09 .h_4x2 db 4, 2 db $0b, $18, $18, $0c db $13, $19, $19, $14 .s_2x2 db 2, 2 db $0b, $0c db $13, $14 .s_3x3 db 3, 3 db $0b, $18, $0c db $1b, $0d, $1c db $13, $19, $14 .z_2x3_1 db 2, 3 db $0a, $00 db $0e, $0f db $00, $12 .z_2x3_2 db 2, 3 db $00, $0a db $1e, $1f db $12, $00 .z_3x2_1 db 3, 2 db $07, $0f, $00 db $00, $0e, $09 .z_3x2_2 db 3, 2 db $00, $1e, $09 db $07, $1f, $00 .t_1 db 2, 3 db $0a, $00 db $1d, $09 db $12, $00 .t_2 db 2, 3 db $00, $0a db $07, $17 db $00, $12 .t_3 db 3, 2 db $00, $0a, $00 db $07, $15, $09 .t_4 db 3, 2 db $07, $16, $09 db $00, $12, $00
10.053191
22
0.512169
9dd7e897c25b9b141ecdc92558a963f97c405dd3
145
asm
Assembly
examples/loop/loop.asm
kuwatay/6502ctrl
756f58fe5c63ea62515b1269eca32fea5dd9a3bb
[ "MIT", "Unlicense" ]
1
2021-08-06T22:31:53.000Z
2021-08-06T22:31:53.000Z
examples/loop/loop.asm
kuwatay/6502ctrl
756f58fe5c63ea62515b1269eca32fea5dd9a3bb
[ "MIT", "Unlicense" ]
null
null
null
examples/loop/loop.asm
kuwatay/6502ctrl
756f58fe5c63ea62515b1269eca32fea5dd9a3bb
[ "MIT", "Unlicense" ]
1
2021-11-07T11:58:24.000Z
2021-11-07T11:58:24.000Z
; @file loop.asm: simple loop ; use vasm for assemble ; vasm6502_oldstyle -Fbin -dotdir -L loop.lst loop.asm .org 200h loop: jmp loop
20.714286
55
0.682759
96371777bfed142780767d25c657361bc65a1e01
6,924
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2881.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2881.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2881.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x1df5a, %r13 nop and $25620, %rdi movups (%r13), %xmm5 vpextrq $0, %xmm5, %rcx nop nop and %rdi, %rdi lea addresses_A_ht+0x1457a, %rsi lea addresses_WC_ht+0x1156a, %rdi nop nop nop nop sub %rax, %rax mov $75, %rcx rep movsw cmp %r13, %r13 lea addresses_normal_ht+0x8e9a, %rsi lea addresses_D_ht+0x1549a, %rdi nop nop nop xor %rax, %rax mov $24, %rcx rep movsq nop nop nop nop cmp $52438, %rdi lea addresses_WC_ht+0xd49a, %rbx nop cmp %r9, %r9 mov (%rbx), %rcx nop nop nop nop nop sub %rdi, %rdi lea addresses_UC_ht+0x1d6ea, %rbx nop nop nop nop cmp $45178, %r9 mov $0x6162636465666768, %rax movq %rax, %xmm2 vmovups %ymm2, (%rbx) nop nop nop nop nop cmp $9473, %rcx lea addresses_UC_ht+0x1b29a, %rdi nop nop nop nop nop xor %r13, %r13 mov (%rdi), %ax nop nop nop nop add %rcx, %rcx lea addresses_normal_ht+0x1ce80, %rcx nop nop nop nop nop inc %r9 movb (%rcx), %bl nop nop nop sub %rdi, %rdi lea addresses_A_ht+0x13e7a, %r9 and %rbx, %rbx movl $0x61626364, (%r9) add $42785, %rcx lea addresses_UC_ht+0x1be9a, %rsi lea addresses_UC_ht+0xacfe, %rdi and %r9, %r9 mov $75, %rcx rep movsq nop nop nop nop and %rcx, %rcx lea addresses_normal_ht+0x1b7b8, %r13 nop and $11855, %rsi mov (%r13), %ecx cmp $59783, %rbx lea addresses_UC_ht+0x14bda, %rdi nop nop nop and $31566, %r9 movl $0x61626364, (%rdi) nop nop dec %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %rbp push %rcx push %rdi push %rsi // REPMOV lea addresses_WT+0x61ec, %rsi lea addresses_WT+0x1620c, %rdi inc %rbp mov $1, %rcx rep movsb xor %r11, %r11 // Faulty Load mov $0xe9a, %rdi dec %r13 vmovaps (%rdi), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $1, %xmm2, %rsi lea oracles, %r13 and $0xff, %rsi shlq $12, %rsi mov (%r13,%rsi,1), %rsi pop %rsi pop %rdi pop %rcx pop %rbp pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
37.026738
2,999
0.656268
614e5a37739993b3300fc799d8574214c3e91ac9
2,714
asm
Assembly
fibonacci/Fibonacci.asm
gmarciani/assimply
dc99d9f58dac43c8354d9cf7b36d28445bbb8921
[ "MIT" ]
1
2015-12-11T17:48:21.000Z
2015-12-11T17:48:21.000Z
fibonacci/Fibonacci.asm
gmarciani/assimply
dc99d9f58dac43c8354d9cf7b36d28445bbb8921
[ "MIT" ]
null
null
null
fibonacci/Fibonacci.asm
gmarciani/assimply
dc99d9f58dac43c8354d9cf7b36d28445bbb8921
[ "MIT" ]
null
null
null
# @Name: Fibonacci # @Description: The program computes the nth Fibonacci's number. # # @Author: Giacomo Marciani <giacomo.marciani@gmail.com> .data msg_welcome:.asciiz "Il programma calcola l'n-esimo numero di Fibonacci.\n\n" msg_input: .asciiz "Inserisci n: " msg_result: .asciiz "\nRisultato: " .text .globl main ### MAIN ### main: welcome: la $a0,msg_welcome #carica indirizzo msg_welcome. addi $v0,$zero,4 #codice servizio print string. syscall user_input: la $a0,msg_input #carica indirizzo msg_input. addi $v0,$zero,4 #codice servizio print string. syscall addi $v0,$zero,5 #codice servizio read int. syscall add $a0,$v0,$zero #pone n in $a0. jal fibonacci #chiama fibonacci. nop result: add $t0,$v0,$zero #salva il risultato in $t0. la $a0,msg_result #carica indirizzo msg_result. addi $v0,$zero,4 #codice servizio print string. syscall add $a0,$t0,$zero #pone il contenuto di $t0 in $a0. addi $v0,$zero,1 #codice servizio print int. syscall exit_program: addi $v0,$zero,10 #codice servizio exit. syscall ### FINE MAIN ### ### FUNZIONE int fibonacci(int n): $a0=n, $v0=fibonacci(n). ### fibonacci: subu $sp,$sp,16 #alloca lo stack frame da 16 byte per fibonacci(n): 1 locazione per $ra, 1 locazione per $a0=n, 1 locazione per fibonacci(n-1), 1 locazione per fibonacci(n-2). sw $ra, 0($sp) #carica l'indirizzo di ritorno nello stack frame. sw $a0, 4($sp) #carica l'argomento $a0=n nello stack frame. beq $a0,$zero,caso_uguale_0 #salta a caso_uguale_0 sse $a0=n=0. Base della ricorsione: fibonacci(0)=0. nop addi $t0,$zero,1 #$t0=1, usata come costante. beq $a0,$t0,caso_uguale_1 #salta a caso_uguale_1 sse $a0=n=1. Base della ricorsione: fibonacci(1)=1. nop subu $a0,$a0,1 #$a0=($a0-1)=(n-1), argomento per la chiamata ricorsiva fibonacci(n-1). jal fibonacci #chiama fibonacci(n-1). sw $v0,8($sp) #carica $v0=fibonacci(n-1) nello stack frame di fibonacci(n). lw $a0,4($sp) #$a0=n. subu $a0,$a0,2 #$a0=($a0-2)=(n-2), argomento per la chiamata ricorsiva fibonacci(n-2). jal fibonacci #chiama fibonacci(n-2). sw $v0,12($sp) #carica $v0=fibonacci(n-2) nello stack frame di fibonacci(n). lw $ra,0($sp) #carica l'indirizzo di ritorno. lw $t1,8($sp) #$t0=fibonacci(n-1). lw $t2,12($sp) #t1=fibonacci(n-2). add $v0,$t1,$t2 #$v0=fibonacci(n)=fibonacci(n-1)+fibonacci(n-2). addi $sp,$sp,16 #dealloca lo stack frame di fibonacci(n). jr $ra caso_uguale_1: addi $v0,$zero,1 #base della ricorsione: fibonacci(1)=1. lw $ra,0($sp) #carica l'indirizzo di ritorno. addi $sp,$sp,16 jr $ra caso_uguale_0: addi $v0,$zero,0 #base della ricorsione: fibonacci(0)=0. lw $ra,0($sp) #carica l'indirizzo di ritorno. addi $sp,$sp,16 #dealloca lo stack frame di fibonacci(n). jr $ra ### FINE int fibonacci(int n) ###
29.5
175
0.709285
3a4b535924ebad0891b21bdca6e3ab7a7fb83cd4
356
asm
Assembly
oeis/191/A191561.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/191/A191561.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/191/A191561.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A191561: a(n) = 2^n mod 3*n ; 2,4,8,4,2,10,2,16,26,4,2,28,2,4,8,16,2,28,2,16,8,4,2,64,32,4,80,16,2,64,2,64,8,4,53,28,2,4,8,16,2,64,2,16,107,4,2,64,128,124,8,16,2,82,98,88,8,4,2,136,2,4,134,64,32,64,2,16,8,184,2,136,2,4,143,16,95,64,2,16,242,4,2,64,32,4,8,256,2,244,128,16,8,4,203,64,2,214,215,76 add $0,1 mov $1,2 pow $1,$0 mul $0,3 mod $1,$0 mov $0,$1
35.6
267
0.595506
c9e44397f4cb466999478a4bd925a9c273e2d26b
2,443
asm
Assembly
src/input.asm
AmFobes/MineAssemble
3272c597a7b3935d3fa4cf37b77faef82d68e1cd
[ "MIT" ]
479
2015-01-13T14:19:51.000Z
2022-03-30T05:19:05.000Z
src/input.asm
AmFobes/MineAssemble
3272c597a7b3935d3fa4cf37b77faef82d68e1cd
[ "MIT" ]
8
2016-03-14T18:45:04.000Z
2021-03-29T19:59:35.000Z
src/input.asm
AmFobes/MineAssemble
3272c597a7b3935d3fa4cf37b77faef82d68e1cd
[ "MIT" ]
34
2015-02-24T13:25:49.000Z
2022-01-21T17:34:59.000Z
; ; This file contains all functions related to input handling ; [bits 32] %include "constants.asm" global handle_input, handle_collision extern handle_key, raytrace extern colTolerance, zero section .text ; void handle_input() ; Handle input of all key events handle_input: push dword KEY_UP call handle_key mov dword [esp], KEY_DOWN call handle_key mov dword [esp], KEY_LEFT call handle_key mov dword [esp], KEY_RIGHT call handle_key mov dword [esp], KEY_SPACE call handle_key mov dword [esp], KEY_Q call handle_key mov dword [esp], KEY_E call handle_key mov dword [esp], KEY_ESC call handle_key add esp, 4 ret ; void handle_collision(vec3 pos, vec3* velocity) ; Adjust velocity to prevent any collisions handle_collision: push ebp mov ebp, esp ; Allocate space for hit info struct sub esp, 32 ; Trace ray with velocity as direction to check for collision mov eax, ebp sub eax, 32 push eax ; Pointer to hit info struct mov eax, [ebp + 20] ; velocity pointer push dword [eax + 8] ; Copy of velocity vec3 (in reverse because stack grows downwards) push dword [eax + 4] push dword [eax + 0] push dword [ebp + 16] ; Copy of pos vec3 push dword [ebp + 12] push dword [ebp + 8] call raytrace add esp, 28 ; Check for hit cmp byte [ebp - 32], 1 jne .finish ; Check if distance is < 0.1 fld dword [colTolerance] fld dword [ebp - 4] fcomip fstp dword [ebp + 8] ; Discard colTolerance still on stack by writing over now unused pos jae .finish ; Correct velocity to create sliding motion over surface mov ecx, [zero] ; floating point zero mov eax, [ebp + 20] ; velocity pointer cmp dword [ebp - 16], 0 ; nx != 0 -> negate x velocity je .nx_finish mov dword [eax + 0], ecx .nx_finish: cmp dword [ebp - 12], 0 ; ny != 0 -> negate y velocity je .ny_finish mov dword [eax + 4], ecx .ny_finish: cmp dword [ebp - 8], 0 ; nz != 0 -> negate z velocity je .finish mov dword [eax + 8], ecx .finish: mov esp, ebp pop ebp ret
22.412844
97
0.571429
b4277be540d3dc55bf7e7f150012d98136eac7e9
380
asm
Assembly
programs/oeis/340/A340627.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/340/A340627.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/340/A340627.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A340627: a(n) = (11*2^n - 2*(-1)^n)/3 for n >= 0. ; 3,8,14,30,58,118,234,470,938,1878,3754,7510,15018,30038,60074,120150,240298,480598,961194,1922390,3844778,7689558,15379114,30758230,61516458,123032918,246065834,492131670,984263338,1968526678,3937053354,7874106710,15748213418,31496426838 mov $1,3 lpb $0 sub $0,1 sub $1,$2 cmp $2,0 add $1,$2 mul $1,2 lpe mov $0,$1
29.230769
239
0.705263
55268a174e138cc0553b21c91889d0c0b930148b
421
asm
Assembly
programs/oeis/114/A114459.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/114/A114459.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/114/A114459.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A114459: Integer part of sqrt(n)+sqrt(n+1)+sqrt(n+2)+sqrt(n+3). ; 6,7,8,9,10,10,11,12,12,13,14,14,15,15,16,16,17,17,18,18,18,19,19,20,20,20,21,21,22,22,22,23,23,23,24,24,24,25,25,25,26,26,26,26,27,27,27,28,28,28,28,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34 add $0,1 mul $0,8 add $0,11 seq $0,101776 ; Smallest k such that k^2 is equal to the sum of n not-necessarily-distinct primes plus 1. sub $0,1
46.777778
210
0.669834
7b574eadb23b8a660915a621ecffafd0c7934f57
2,285
asm
Assembly
src/sample/3_Sprite_Move/Sprite_Move.asm
Kannagi/LKS
363ccbfbe93a78e227349967053075ba67f4e50c
[ "MIT" ]
6
2019-04-18T12:08:23.000Z
2021-07-07T08:07:28.000Z
src/sample/3_Sprite_Move/Sprite_Move.asm
Kannagi/LKS
363ccbfbe93a78e227349967053075ba67f4e50c
[ "MIT" ]
null
null
null
src/sample/3_Sprite_Move/Sprite_Move.asm
Kannagi/LKS
363ccbfbe93a78e227349967053075ba67f4e50c
[ "MIT" ]
null
null
null
.include "header.asm" .include "snes.asm" .include "MC_libks.asm" Main: SNES_INIT0 rep #$10 ;16 bit xy sep #$20 ; 8 bit a SNES_INIDISP $8F SNES_NMITIMEN $00 jsl LKS_Clear_RAM SNES_INIT Start: jsl LKS_INIT LKS_Clear_VRAM SNES_DMAX $01 SNES_DMAX_BADD $18 ;load font LKS_LOAD_VRAM $4000,$00,bpp_font,$400 LKS_LOAD_CG $00,bpp_fontpal,$10 ;load Sprite pal LKS_LOAD_CG $80,Player_pal,$20 ;Sprite Engine ldx #$20*0 ; Sprite n'0 LKS_SPRITE_INIT 40,40,0,$00,$AA,64 ; X,Y,Tile,Flip+PAL,Ext,OAM LKS_SPRITE_ANIM_INIT $18,0,9,4 ; Size,act,cadence,n LKS_DMA_INIT Player,$100,128,$6000,1 ;Data,Size,largeur,VRAM,Func DMA jsl LKS_GAMELOOP_INIT Game: jsl LKS_Fade_in SNES_DMAX $00 SNES_DMAX_BADD $80 jsl LKS_Joypad ; Read Joypad jsl LKS_OAM_Clear ; Clear Sprite ;------------- ldy #$20*0 ; Target Sprite n'0 lda #0 sta LKS_SPRITE.VX+0,y sta LKS_SPRITE.VX+1,y sta LKS_SPRITE.VY+0,y sta LKS_SPRITE.VY+1,y lda LKS_STDCTRL+_UP cmp #2 bne + rep #$20 lda #-1<<2 sta LKS_SPRITE.VY,y sep #$20 +: lda LKS_STDCTRL+_DOWN cmp #2 bne + rep #$20 lda #1<<2 sta LKS_SPRITE.VY,y sep #$20 +: lda LKS_STDCTRL+_RIGHT cmp #2 bne + rep #$20 lda #1<<2 sta LKS_SPRITE.VX,y sep #$20 +: lda LKS_STDCTRL+_LEFT cmp #2 bne + rep #$20 lda #-1<<2 sta LKS_SPRITE.VX,y sep #$20 +: jsl LKS_Sprite_Move ;For move Sprite jsr Draw_Sprite_Anim jsr Draw_text ;------------- jsl LKS_DMA_SORT ; prepares DMA transfer and sorting jsl WaitVBlank jmp Game ;2) Draw_Sprite_Anim: jsl LKS_Sprite_Draw_32x32_2x2 ;meta sprite jsl LKS_Sprite_Anim ;animation sprite jsl LKS_Sprite_DMA ;Enable DMA for sprite rts ;1) Draw_text: LKS_printf_setpal 0 ; select pal 0 ldx #text_s1 ;address text LKS_printfs 1,1 ; x,y LKS_printf_setpal 1 ; select pal 0 ldx #text_s1 ;address text LKS_printfs 1,2 ;x,y rts text_s1: .db "hello world",0 .include "libksIRQ.asm" .bank 1 slot 0 .org 0 .include "libks.asm" .bank 2 slot 0 .org 0 Player: .incbin "DATA/Player.spr" Player_pal: .incbin "DATA/Player.pal"
15.758621
71
0.623632
dde7b8b8cc4da783e24650c2a4bcce60510a19ad
556
asm
Assembly
programs/oeis/082/A082767.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/082/A082767.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/082/A082767.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A082767: Number of edges in the prime graph. ; 1,3,5,7,9,12,14,16,18,21,23,26,28,31,34,36,38,41,43,46,49,52,54,57,59,62,64,67,69,73,75,77,80,83,86,89,91,94,97,100,102,106,108,111,114,117,119,122,124,127,130,133,135,138,141,144,147,150,152,156,158,161,164,166,169,173,175,178,181,185,187,190,192,195,198,201,204,208,210,213,215,218,220,224,227,230,233,236,238,242,245,248,251,254,257,260,262,265,268,271 mov $1,$0 lpb $1 mov $2,$1 sub $1,1 seq $2,322307 ; Number of multisets in the swell of the n-th multiset multisystem. add $0,$2 lpe add $0,1
46.333333
357
0.696043
ef8507f898a9c98a31267acf1d0e827ae7562245
300
asm
Assembly
oeis/021/A021970.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/021/A021970.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/021/A021970.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A021970: Decimal expansion of 1/966. ; 0,0,1,0,3,5,1,9,6,6,8,7,3,7,0,6,0,0,4,1,4,0,7,8,6,7,4,9,4,8,2,4,0,1,6,5,6,3,1,4,6,9,9,7,9,2,9,6,0,6,6,2,5,2,5,8,7,9,9,1,7,1,8,4,2,6,5,0,1,0,3,5,1,9,6,6,8,7,3,7,0,6,0,0,4,1,4,0,7,8,6,7,4,9,4,8,2,4,0 add $0,1 mov $2,10 pow $2,$0 mov $0,$2 div $0,966 mod $0,10
30
199
0.54
f7e632a4fc61febcf09033cb0071c98edaa88803
706
asm
Assembly
oeis/163/A163198.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/163/A163198.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/163/A163198.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A163198: Sum of the cubes of the first n even-indexed Fibonacci numbers. ; Submitted by Jamie Morken(s1.) ; 0,1,28,540,9801,176176,3162160,56744793,1018249596,18271762300,327873509425,5883451505856,105574253853888,1894453118539345,33994581881622076,610008020755286076,10946149791725643705,196420688230338021808,3524626238354441796016,63246851602149831726825,1134918702600343098500700,20365289795204027431507036,365440297611072154570075873,6557560067204094765043987200,117670640912062633642962629376,2111513976349923310878292020001,37889580933386556962349578830300,679900942824608102011893973545948 lpb $0 mov $2,$0 sub $0,1 seq $2,215039 ; a(n) = Fibonacci(2*n)^3, n>=0. add $1,$2 lpe mov $0,$1
58.833333
491
0.845609
4579f4817569765650af752c3b6e26d3bf5fb328
3,713
asm
Assembly
research/deficon/def_tool-icon_36_214.asm
nicodex/HelloAmi
6dae73b6968cc2caaea356b7a35b0ae1dd78fe09
[ "MIT" ]
16
2019-02-14T15:47:57.000Z
2021-03-28T20:50:54.000Z
research/deficon/def_tool-icon_36_214.asm
nicodex/HelloAmi
6dae73b6968cc2caaea356b7a35b0ae1dd78fe09
[ "MIT" ]
9
2019-01-17T09:08:30.000Z
2021-04-15T19:32:47.000Z
research/deficon/def_tool-icon_36_214.asm
nicodex/HelloAmi
6dae73b6968cc2caaea356b7a35b0ae1dd78fe09
[ "MIT" ]
1
2019-01-04T16:19:03.000Z
2019-01-04T16:19:03.000Z
; vasmm68k_mot[_<HOST>] -Fbin -o icon_36_214/def_tool.info def_tool-icon_36_214.asm ; ; Default "ENV:def_tool.info" data included in "icon 36.214 (11 Dec 1989)". ; Note that this icon data is never used (GetDefDiskObject returns NULL). ; include deficon.inc ifne DEFICON_MEM align 1 endif defIconTool: dc.w $E310 ; do_Magic = WB_DISKMAGIC dc.w $0001 ; do_Version = WB_DISKVERSION dc.l 0 ; do_Gadget+gg_NextGadget dc.w 36,53 ; do_Gadget+gg_LeftEdge/gg_TopEdge dc.w 31,18 ; do_Gadget+gg_Width/gg_Height dc.w $0005 ; do_Gadget+gg_Flags = ; GFLG_GADGBACKFILL ; GFLG_GADGIMAGE dc.w $0003 ; do_Gadget+gg_Activation = ; GACT_RELVERIFY ; GACT_IMMEDIATE dc.w $0001 ; do_Gadget+gg_GadgetType = ; GTYP_BOOLGADGET DEFICON_PTR .GadgetRender ; do_Gadget+gg_GadgetRender dc.l 0 ; do_Gadget+gg_SelectRender dc.l 0 ; do_Gadget+gg_GadgetText dc.l 0 ; do_Gadget+gg_MutualExclude dc.l 0 ; do_Gadget+gg_SpecialInfo dc.w 0 ; do_Gadget+gg_GadgetID dc.l 0 ; do_Gadget+gg_UserData dc.b 3 ; do_Type = WBTOOL dc.b 0 ; do_PAD_BYTE dc.l 0 ; do_DefaultTool dc.l 0 ; do_ToolTypes dc.l $80000000 ; do_CurrentX = NO_ICON_POSITION dc.l $80000000 ; do_CurrentY = NO_ICON_POSITION dc.l 0 ; do_DrawerData dc.l 0 ; do_ToolWindow dc.l 0 ; do_StackSize .GadgetRender: dc.w 0,0 ; ig_LeftEdge/ig_TopEdge dc.w 31,17 ; ig_Width/ig_Height dc.w 2 ; ig_Depth DEFICON_PTR .GadgetImage ; ig_ImageData dc.b (1<<2)-1,0 ; ig_PlanePick/ig_PlaneOnOff dc.l 0 ; ig_NextImage .GadgetImage: dc.w %0000000000000000,%0000000000000000 dc.w %0000000000000000,%0000000000000000 dc.w %0000000000000110,%0000011000000000 dc.w %0000000000000110,%0000011000000000 dc.w %0000000000000110,%0000011000000000 dc.w %0000000000000000,%0000000000000000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111001000 dc.w %0011111111111111,%1111111111000000 dc.w %0000000000000000,%0000000000000000 dc.w %0000011000000110,%0000011000000000 dc.w %0000111100001111,%0000111100000000 dc.w %0001100110011001,%1001111110000000 dc.w %0001100110011001,%1001111110000000 dc.w %0001100110011001,%1001111110000000 dc.w %1111111111111111,%1111111111111110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000110110 dc.w %1100000000000000,%0000000000111100 dc.w %1111111111111111,%1111111111110000
42.193182
83
0.618637
d1b8148b240949c61e2b10ded9479b86a533324c
837
asm
Assembly
LM/Aula5/Lista3/ex1.asm
Kw-Vinicius/Linguagem-de-Montagem-
b0b878bb7ed9093433e0e37037fb61b79570f2b9
[ "MIT" ]
null
null
null
LM/Aula5/Lista3/ex1.asm
Kw-Vinicius/Linguagem-de-Montagem-
b0b878bb7ed9093433e0e37037fb61b79570f2b9
[ "MIT" ]
null
null
null
LM/Aula5/Lista3/ex1.asm
Kw-Vinicius/Linguagem-de-Montagem-
b0b878bb7ed9093433e0e37037fb61b79570f2b9
[ "MIT" ]
null
null
null
;-------------------------------------------------------------------------------------------- ; 1. Escreva um programa que inicialize três posições de memória com valores numéricos ;(<128), e retorne o menor dentre eles. ; Vinicius Atsushi Sato Kawai ;-------------------------------------------------------------------------------------------- SECTION .data var1: db 6 var2: db 7 var3: db 5 SECTION .text global _start _start: mov al, [var1] mov bl, [var2] cmp al,bl ja a_maior_b mov bl,[var3] cmp al,bl ja var1_maior_var3 mov bl,al jmp fim var1_maior_var3: mov bl,bl jmp fim a_maior_b: mov al,[var3] cmp al,bl ja var3_maior_b var3_maior_b: mov bl,bl jmp fim fim: mov eax,1 int 80h
16.411765
93
0.445639
1bbb64af23093b7323608c79626ec154ee1d5961
4,454
asm
Assembly
Transynther/x86/_processed/NONE/_ht_zr_un_/i7-7700_9_0x48.log_16_2019.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_ht_zr_un_/i7-7700_9_0x48.log_16_2019.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_ht_zr_un_/i7-7700_9_0x48.log_16_2019.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x19ee2, %rbx nop nop nop cmp $62386, %r11 movl $0x61626364, (%rbx) xor $3007, %rbx lea addresses_A_ht+0x547a, %r9 nop nop cmp $25439, %rdi mov $0x6162636465666768, %rax movq %rax, %xmm3 movups %xmm3, (%r9) nop nop nop nop nop and $19253, %r12 lea addresses_UC_ht+0x7dfa, %rsi lea addresses_normal_ht+0x1db0, %rdi and %rax, %rax mov $8, %rcx rep movsl nop sub %r11, %r11 lea addresses_A_ht+0x15b7a, %rdi clflush (%rdi) nop nop nop cmp %rcx, %rcx mov $0x6162636465666768, %r9 movq %r9, %xmm4 movups %xmm4, (%rdi) nop nop nop nop inc %rsi lea addresses_WC_ht+0x626a, %rsi lea addresses_WC_ht+0x18dfa, %rdi nop nop inc %r9 mov $27, %rcx rep movsw nop nop nop nop sub %rbx, %rbx lea addresses_UC_ht+0x141fa, %r9 clflush (%r9) nop nop nop nop cmp %rax, %rax mov $0x6162636465666768, %rcx movq %rcx, %xmm6 vmovups %ymm6, (%r9) nop inc %rdi lea addresses_D_ht+0x1894b, %r9 nop nop nop nop add $18512, %r12 vmovups (%r9), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $1, %xmm5, %rdi xor $55578, %rbx lea addresses_normal_ht+0xbc7a, %rdi nop nop nop nop nop and $48084, %rax mov $0x6162636465666768, %r12 movq %r12, %xmm0 movups %xmm0, (%rdi) nop nop nop nop nop add $6003, %r12 lea addresses_normal_ht+0x183fa, %rbx nop nop nop nop nop sub $41505, %rsi movb (%rbx), %r11b nop nop add $9859, %r9 lea addresses_A_ht+0x12dfa, %rcx inc %r12 movb (%rcx), %r11b nop nop and $47095, %r11 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r15 push %rax push %rcx push %rdi push %rsi // Load lea addresses_PSE+0x1275e, %rcx nop sub %rax, %rax movb (%rcx), %r10b nop nop dec %rcx // REPMOV lea addresses_A+0x1ccd8, %rsi lea addresses_US+0x46fa, %rdi nop nop nop nop xor $8357, %rax mov $79, %rcx rep movsb nop nop nop nop inc %r10 // Load lea addresses_normal+0x1f4fa, %rax nop nop nop nop nop xor $4559, %rcx mov (%rax), %edi nop sub $29637, %r15 // Faulty Load lea addresses_UC+0x12dfa, %rax nop nop nop and $36387, %r13 vmovups (%rax), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %rcx lea oracles, %rsi and $0xff, %rcx shlq $12, %rcx mov (%rsi,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rax pop %r15 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_US', 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}} {'08': 2, '72': 3, '46': 6, '00': 5} 46 46 08 46 08 46 72 00 46 46 00 72 00 72 00 00 */
20.153846
153
0.649753
8022b86b3b2c1900b301a6fc9708722842201d96
9,351
asm
Assembly
rom/dos/consolef.asm
hisahi/ellipse1100
930588825d8cc3ad3b069269ff9d596022f84d02
[ "Zlib" ]
null
null
null
rom/dos/consolef.asm
hisahi/ellipse1100
930588825d8cc3ad3b069269ff9d596022f84d02
[ "Zlib" ]
null
null
null
rom/dos/consolef.asm
hisahi/ellipse1100
930588825d8cc3ad3b069269ff9d596022f84d02
[ "Zlib" ]
null
null
null
; Ellipse Workstation 1100 (fictitious computer) ; Ellipse DOS command interpreter (file name related stuff) ; ; Copyright (c) 2020 Sampo Hippeläinen (hisahi) ; ; 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. ; ; Written for the WLA-DX assembler ; COMMAND_MOVE_CPDESTFN: ; FISBUF+2 contains "source filename" ; NAMEBUF will have the output ACC8 LDX #0 LDY #0 - LDA FISBUF+2.W,X CMP #' ' BEQ + STA NAMEBUF.W,Y INY + INX CPX #$0E BCC - LDA #0 STA NAMEBUF.W,Y ACC16 RTS COMMAND_RENAME_MKDESTFN: ; XPATHBUF contains "destination mask" ; FISBUF+48 contains "source mask" ; FISBUF+2 contains "source filename" ; NAMEBUF will have the output ; TMPBUF used ; uses MKFNTMP1,MKFNTMP2,MKFNTMP3 ; REMBUF = DOSINBUF LDA #$4000 DOSCALL STX REMBUF+2.B STA REMBUF.B ; copy REMBUF* to TMPBUF LDY #0 LDA [REMBUF.B],Y AND #$FF TAX STX TMPBUF.W ACC8 INY CPX #0 BEQ + - LDA [REMBUF.B],Y STA TMPBUF.W,Y INY DEX BNE - + ; X = destination mask (XPATHBUF) ; Y = destination filename (NAMEBUF) ; MKFNTMP1 = source filename ; MKFNTMP2 = star index ; MKFNTMP3 = current star end ; TMPBUF = source mask star parameters LDX WC2PATH.W LDY #0 STZ MKFNTMP1.W STZ MKFNTMP2.W STZ MKFNTMP3.W INC MKFNTMP2.W LDA XPATHBUF.W,X BNE @CHLOOP JMP @COPYSFN @CHLOOP LDA XPATHBUF.W,X BEQ @ENDLOOP CMP #'.' BEQ @DOT CMP #'?' BEQ @CPFN CMP #'*' BEQ @STAR JSR CMDUPPERCASE.W STA NAMEBUF.W,Y INY INX CPY MKFNTMP1.W BCC @EY STY MKFNTMP1.W @EY CPY #14 BCC @CHLOOP @ENDLOOP LDA #0 STA NAMEBUF.W,Y ACC16 LDY #NAMEBUF.W RTS .ACCU 8 @DOT: STA NAMEBUF.W,Y INY INX LDA MKFNTMP1.W CMP #10 BCS @EY STA MKFNTMP1.W BRA @EY @CPFN: PHX LDX MKFNTMP1.W LDA FISBUF+2.W,X PLX INX CMP #' ' BEQ + STA NAMEBUF.W,Y INY + BRA @EY @STAR: PHX LDA MKFNTMP2.W CMP TMPBUF.W BEQ + BCS @STARPLX + TAX INC MKFNTMP2.W LDA TMPBUF.W,X STA MKFNTMP3.W LDX MKFNTMP1.W - CPX MKFNTMP3.W BCS @STARPLX LDA FISBUF+2.W,X CMP #' ' BEQ + STA NAMEBUF.W,Y INY + INX BRA - @STARPLX PLX INX BRA @EY ; copy source filename @COPYSFN: LDX #$00 - LDA FISBUF+2.W,X CMP #' ' BEQ + STA NAMEBUF.W,Y INY + INX CPX #$0E BCC - LDA #0 STA NAMEBUF.W,Y RTS ; merge NAMEBUF to WCBUF2 COMMAND_COPY_MERGENAMEBUF: LDX #NAMEBUF.W JSR CMDBUILDWC2PATHX.W TXY RTS COMMAND_DO_MOVEFILE: ACC8 LDA $0000.W,X BEQ ++ LDA $0000.W,Y BEQ ++ LDA $0001.W,X CMP #':' BEQ + LDA $0001.W,Y CMP #':' BEQ + BRA ++ + JMP COMMAND_DO_MOVEFILE_HANDLES ++ ACC16 PHX PHY ; check if target file exists TYX LDA #$1100 LDY #TMPBUF.W DOSCALL BCS @FAIL @CONFIRM LDA 3,S TAX LDA #$1900 DOSCALL LDX #DOSCOPYALREADYEXISTS LDA #$1900 DOSCALL - LDA #$0700 DOSCALL BMI @CNO JSR CMDUPPERCASE16.W CMP #$004E.W ;'N' BEQ @CNO CMP #$0059.W ;'Y' BNE - @CYES PLY PLX BRA @DOMOVE @CNO PLY PLX LDA #$FFFF SEC RTS @FAIL CMP #DOS_ERR_FILE_NOT_FOUND.W BEQ @CYES @MVERR PLY PLX SEC RTS @DOMOVE: PHX PHY ACC16 LDA COPYTMP2.W BEQ + LDA #$1900 DOSCALL LDA #$0220 DOSCALL LDA #$023D DOSCALL LDA #$023E DOSCALL LDA #$0220 DOSCALL LDA 1,S TAX LDA #$1900 DOSCALL LDA #$020D DOSCALL + PLY PLX PHX PHY ACC8 LDX #0 DEY DEX - INX INY LDA $0000.W,Y BNE - - DEX BMI + DEY LDA $0000.W,Y CMP #'\' BNE - @TERM LDA #0 STA $0001.W,Y + ACC16 PLY PLX LDA #$3700 DOSCALL BCS + INC COPYTMP1.W CLC + RTS COMMAND_DO_MOVEFILE_HANDLES: ACC16 PHX JSR COMMAND_DO_COPYFILE.W PLX BCS @ERR LDA #$1300 DOSCALL @ERR RTS ; uses TMPBUF COMMAND_DO_COPYFILE: STX COPYTMP4.W STY COPYTMP3.W ACC16 LDA COPYTMP2.W BEQ + LDA #$1900 DOSCALL LDA #$0220 DOSCALL LDA #$023D DOSCALL LDA #$023E DOSCALL LDA #$0220 DOSCALL LDX COPYTMP3.W LDA #$1900 DOSCALL LDA #$020D DOSCALL + PHD ; check if target file exists LDA #$1100 LDX COPYTMP3.W LDY #TMPBUF.W DOSCALL BCS @FAIL @CONFIRM PHX LDX COPYTMP3.W LDA #$1900 DOSCALL LDX #DOSCOPYALREADYEXISTS LDA #$1900 DOSCALL - LDA #$0700 DOSCALL BMI @CNO JSR CMDUPPERCASE16.W CMP #$004E.W ;'N' BEQ @CNO CMP #$0059.W ;'Y' BNE - @CYES LDA #$020D DOSCALL PLX BRA @DOCOPY @CNO PLX LDA #$FFFF SEC PLD RTS @FAIL CMP #DOS_ERR_FILE_NOT_FOUND BNE @RET @DOCOPY ; COPYTMP3: dest fn/handle ; COPYTMP4: src fn/handle LDA #$0F01 LDX COPYTMP4.W DOSCALL BCS @RET STX COPYTMP4.W LDA #$1602 LDX COPYTMP3.W DOSCALL BCS @CLR STX COPYTMP3.W LDA #FILEBUF.W TCD @CP LDA #$2100 LDX COPYTMP4.W LDY #FILEBUFSIZE.W DOSCALL BCS @CLW CPY #0 BEQ @CPOK LDA #$2200 LDX COPYTMP3.W DOSCALL BCS @CLW BRA @CP @CPOK LDA #$1000 LDX COPYTMP3.W DOSCALL BCS @CLR INC COPYTMP1.W CLC BRA @CLR @CLW PHP PHA LDA #$1000 LDX COPYTMP3.W DOSCALL PLA PLP @CLR PHP PHA LDA #$10FF LDX COPYTMP4.W DOSCALL PLA PLP @RET PLD RTS
22.478365
81
0.424126
80eeecde1906b174d0f7b5122a2109ab55571539
4,767
asm
Assembly
kernel/timer.asm
TheMachine02/Sorcery
ee657f5a64049bee0c947add7ff2cb92d7281ec1
[ "MIT" ]
14
2020-05-27T13:20:35.000Z
2022-02-10T01:19:54.000Z
kernel/timer.asm
TheMachine02/Sorcery
ee657f5a64049bee0c947add7ff2cb92d7281ec1
[ "MIT" ]
10
2020-06-12T20:53:03.000Z
2021-03-21T23:11:44.000Z
kernel/timer.asm
TheMachine02/Sorcery
ee657f5a64049bee0c947add7ff2cb92d7281ec1
[ "MIT" ]
84
2020-06-11T06:27:03.000Z
2021-05-29T17:06:24.000Z
define SIGEV_NONE 0 define SIGEV_SIGNAL 1 define SIGEV_THREAD 2 define SIGEVENT_SIZE 12 define SIGEVENT $0 define SIGEV_SIGNOTIFY $0 define SIGEV_SIGNO $1 define SIGEV_NOTIFY_FUNCTION $2 define SIGEV_NOTIFY_THREAD $5 define SIGEV_VALUE $8 ; uint8_t + prt define TIMER $0 define TIMER_FLAGS $0 define TIMER_NEXT $1 define TIMER_PREVIOUS $4 define TIMER_COUNT $7 define TIMER_SIGEVENT $A define TIMER_EV_SIGNOTIFY $A define TIMER_EV_SIGNO $B define TIMER_EV_NOTIFY_FUNCTION $C define TIMER_EV_NOTIFY_THREAD $F define TIMER_EV_VALUE $12 ; uint8_t + prt define TIMER_SIZE 22 ; (div/32768)*1000*16 ; (32768/div)/1000*256 if CONFIG_CRYSTAL_DIVISOR = 3 define TIME_JIFFIES_TO_MS 153 define TIME_MS_TO_JIFFIES 27 define TIME_S_TO_JIFFIES 104 else if CONFIG_CRYSTAL_DIVISOR = 2 define TIME_JIFFIES_TO_MS 106 define TIME_MS_TO_JIFFIES 38 define TIME_S_TO_JIFFIES 150 else if CONFIG_CRYSTAL_DIVISOR = 1 define TIME_JIFFIES_TO_MS 75 define TIME_MS_TO_JIFFIES 54 define TIME_S_TO_JIFFIES 213 else if CONFIG_CRYSTAL_DIVISOR = 0 define TIME_JIFFIES_TO_MS 36 define TIME_MS_TO_JIFFIES 113 define TIME_S_TO_JIFFIES 222 end if ktimer: ; TODO : use mem_cache for timer structure ( ; please note, timer_next is still valid per timer queue .notify_default = kthread.irq_resume .set_time: ld a, l dec hl inc h ld l, a ld iy, (kthread_current) ld (iy+KERNEL_THREAD_TIMER_COUNT), hl ret .get_time: ld iy, (kthread_current) ld hl, (iy+KERNEL_THREAD_TIMER_COUNT) ld a, l inc hl dec h ld l, a ret ; it timer attached to thread, used by sleep() and alarm() ; .itset: ; create a timer attached to the current thread ; hl as a seig_ev structure ( ; EV_SIGNOTIFY $0 ; EV_SIGNO $1 ; EV_NOTIFY_FUNCTION $2 ; EV_VALUE $5 ; pass NULL for default callback, ie resume thread ; de is timer count ; bc is ev value ld iy, (kthread_current) lea iy, iy+KERNEL_THREAD_TIMER .create: ; iy = timer structure di ld hl, (iy+TIMER_COUNT) ld a, h or a, l jr nz, .create_failed ld (iy+TIMER_COUNT), de add hl, de or a, a sbc hl, de jr z, .create_default lea de, iy+TIMER_SIGEVENT ld bc, SIGEVENT_SIZE ldir jr .create_arm .create_default: ; direct thread waking is the *faster* method than a costly SIGCONT ld (iy+TIMER_EV_SIGNOTIFY), SIGEV_THREAD ld hl, .notify_default ld (iy+TIMER_EV_NOTIFY_FUNCTION), hl .create_arm: ld hl, ktimer_queue call kqueue.insert_head ; will meet "or a, a" (line 23), so carry is null ei sbc hl, hl ret .create_failed: ei ld (iy+KERNEL_THREAD_ERRNO), EINVAL scf sbc hl, hl ret .itreset: ; delete (or disarm) the current timer of the thread ld iy, (kthread_current) lea iy, iy+KERNEL_THREAD_TIMER .delete: di ld hl, (iy+TIMER_COUNT) ld a, l or a, h jr z, .reset_errno ld hl, ktimer_queue call kqueue.remove_head ; won't modify Carry sbc hl, hl ld (iy+TIMER_COUNT), hl ei ret .reset_errno: ei ld (iy+KERNEL_THREAD_ERRNO), EINVAL dec hl ret sysdef _alarm ; TODO verify correct * invocation * .alarm: ld iy, (kthread_current) lea iy, iy+KERNEL_THREAD_TIMER tsti ld de, (iy+TIMER_COUNT) ld a, e or a, d jr nz, .alarm_disarm ; convert second to jiffies ld e, TIME_S_TO_JIFFIES ld d, l ld l, e mlt de mlt hl add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl add hl, de if CONFIG_CRYSTAL_DIVISOR = 0 add hl, hl end if ; add timer ; adapt to a pseudo 16 bits counter ld e, l dec hl inc h ld l, e ld (iy+TIMER_COUNT), hl ld (iy+TIMER_EV_SIGNOTIFY), SIGEV_SIGNAL ld (iy+TIMER_EV_SIGNO), SIGALRM ld hl, ktimer_queue call kqueue.insert_head pop af ret po ei ret .alarm_disarm: ld hl, ktimer_queue call kqueue.remove_head ; carry wasn't modified sbc hl, hl ld (iy+TIMER_COUNT), hl pop af ret po ei ret .trigger: ; remove the timer from the queue ld hl, ktimer_queue call kqueue.remove_head ; switch based on what we should do ld a, (iy+TIMER_EV_SIGNOTIFY) dec a ret m jr nz, .crystal_thread .crystal_signal: ld hl, (iy+TIMER_EV_NOTIFY_THREAD) ld c, (hl) ld a, (iy+TIMER_EV_SIGNO) jp signal.kill .crystal_thread: ; callback push iy push bc pea iy+TIMER_EV_VALUE call .crystal_call pop hl pop bc pop iy ret .crystal_call: ld hl, (iy+TIMER_EV_NOTIFY_FUNCTION) ld iy, (iy+TIMER_EV_NOTIFY_THREAD) xor a, a jp (hl) ; * timer_create(): Create a timer. ; ; * timer_settime(2): Arm (start) or disarm (stop) a timer. ; ; * timer_gettime(2): Fetch the time remaining until the next ; expiration of a timer, along with the interval setting of the ; timer. ; ; * timer_getoverrun(2): Return the overrun count for the last timer ; expiration. ; ; * timer_delete(2): Disarm and delete a timer.
19.698347
76
0.722677
548d989d7520b5203a35747e2c73929b5265e555
1,812
asm
Assembly
programs/oeis/056/A056123.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/056/A056123.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/056/A056123.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A056123: a(n) = 3*a(n-1) - a(n-2) with a(0)=1, a(1)=11. ; 1,11,32,85,223,584,1529,4003,10480,27437,71831,188056,492337,1288955,3374528,8834629,23129359,60553448,158530985,415039507,1086587536,2844723101,7447581767,19498022200,51046484833,133641432299,349877812064,915992003893,2398098199615,6278302594952,16436809585241,43032126160771,112659568897072,294946580530445,772180172694263,2021593937552344,5292601639962769,13856210982335963,36276031307045120,94971882938799397,248639617509353071,650946969589259816,1704201291258426377,4461656904186019315,11680769421299631568,30580651359712875389,80061184657838994599,209602902613804108408,548747523183573330625,1436639666936915883467,3761171477627174319776,9846874765944607075861,25779452820206646907807,67491483694675333647560,176694998263819354034873,462593511096782728457059,1211085535026528831336304,3170663093982803765551853,8300903746921882465319255,21732048146782843630405912,56895240693426648425898481,148953673933497101647289531,389965781107064656515970112,1020943669387696867900620805,2672865227056025947185892303,6997652011780380973657056104,18320090808285116973785276009,47962620413074969947698771923,125567770430939792869311039760,328740690879744408660234347357,860654302208293433111392002311,2253222215745135890673941659576,5899012345027114238910432976417,15443814819336206826057357269675,40432432112981506239261638832608,105853481519608311891727559228149,277128012445843429435921038851839,725530555817921976416035557327368,1899463655007922499812185633130265,4972860409205845523020521342063427,13019117572609614069249378393060016,34084492308622996684727613837116621,89234359353259375984933463118289847,233618585751155131270072775517752920,611621397900206017825284863434968913 mov $1,1 mov $2,9 lpb $0 sub $0,1 add $2,$1 add $1,$2 lpe mov $0,$1
151
1,678
0.913907
a2fd5598e8f044bca1264141bf8262a5feb313a4
231
asm
Assembly
Student/examples/Correct/Subprograms/Reverse.asm
SoftMoore/CPRL-Kt
c2dfdbd5b30ed6175f419398071e2f98e582d23a
[ "Unlicense" ]
6
2021-02-02T10:08:02.000Z
2022-03-24T08:10:44.000Z
Student/examples/Correct/Subprograms/Reverse.asm
SoftMoore/CPRL-Kt
c2dfdbd5b30ed6175f419398071e2f98e582d23a
[ "Unlicense" ]
1
2021-02-27T21:55:26.000Z
2021-02-28T12:39:29.000Z
Student/examples/Correct/Subprograms/Reverse.asm
SoftMoore/CPRL-Kt
c2dfdbd5b30ed6175f419398071e2f98e582d23a
[ "Unlicense" ]
6
2020-02-24T13:51:32.000Z
2021-06-05T19:02:05.000Z
BR L5 L0: PROC 2 LDLADDR 8 GETCH STORE2B LDCB 0 LDCB 0 LDLADDR 8 LOAD2B LDCB 0 LDCB 0 LDCCH 'E' CMP BZ L3 CALL L0 L3: L4: LDLADDR 8 LOAD2B PUTCH RET 0 L5: CALL L0 HALT
8.884615
12
0.532468