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
4289549b7bde6714771afd69254b3773a8a46a5e
7,424
asm
Assembly
asm/mon.asm
chriscamacho/YAZSOF
3a8ff5dcf25dcf149683adf109ac3096caa0a786
[ "MIT" ]
3
2019-12-02T07:39:04.000Z
2020-03-27T12:58:43.000Z
asm/mon.asm
chriscamacho/YAZSOF
3a8ff5dcf25dcf149683adf109ac3096caa0a786
[ "MIT" ]
null
null
null
asm/mon.asm
chriscamacho/YAZSOF
3a8ff5dcf25dcf149683adf109ac3096caa0a786
[ "MIT" ]
null
null
null
RAMTOP EQU 0x07ff ; last ram location LED EQU 0xffff ; LEDS TX EQU 0xfffe ; uart transmit byte BTN EQU 0xfffc ; hardware buttons VID EQU 0xfd00 ; video memory 32x16 but only first 25 of bytes of ; each 32 columns used, and only 15 rows RXTOP EQU 0xfffd ; ptr top rx ring buffer RXBUFF EQU 0xffe0 ; to 0xffef rx buffer ORG 0x0000 START: ; DI JP MAIN ;Jump to the MAIN routine ; vectors to rom routines could go to different groups of routines ; currently all route to SYS ORG 0x0008 RST08 JP SYS ORG 0x0010 RST10 JP SYS ORG 0x0018 RST18 JP SYS ORG 0x0020 RST20 JP SYS ORG 0x0028 RST28 JP SYS ORG 0x0030 RST30 JP SYS ; TODO think of something to do with the interrupt! ORG 0x0038 MODE1_INTERRUPT: DI ;Disable interrupts EX AF,AF' ;Save register states' EXX ;Save register states NOP EXX ;Restore register states EX AF,AF' ;Restore register states' EI ;Enable interrupts RET ORG 0x0048 SYS: ADD A,A ; double the routine number LD H, 0 LD L, A LD DE, VECTOR ADD HL, DE ; address of routine vector LD A,(HL) INC HL LD H,(HL) LD L,A ; load that address into HL JP (HL) VECTOR: defw TXWAIT, PCHAR, PSTR, DLY, GETUART RSTTXWAIT EQU 0 RSTPCHAR EQU 1 RSTPSTR EQU 2 RSTDLY EQU 3 RSTUARTGET EQU 4 ; "SYS" (rst) routines don't preserve any registers ; ; A=0 Wait for uart transmission to finish ; TXWAIT: LD A,(TX) ; tx status (pausing while outputting) CP 0 JR NZ, TXWAIT RET ; ; A=1 Print a character (in B) ; PCHAR: LD A, B LD (TX), A CALL TXWAIT RET ; ; A=2 Print a string (at BC) ; PSTR: LD A,(BC) CP 0 JR Z, PSTR_DONE LD (TX),A WT: LD A,(TX) ; tx status (pausing while outputting) CP 0 JR NZ, WT INC BC JR PSTR PSTR_DONE: RET ; ; a=3 do a delay b=1 == min b=0 == max ; DLY: LD DE, 0x0000 DLYLOOP: INC DE ; doesnt effect flags! LD A,D CP 0 JR NZ, DLYLOOP LD A,E CP 0 JR NZ, DLYLOOP DEC B JR NZ, DLY RET ; ; a=4 get a character from the uart input buffer ; RXBOTTOM: defb 0 GETUART: ; wait for buffer to have something LD A, (RXTOP) LD HL, RXBOTTOM SUB (HL) JR Z, GETUART LD A, (RXBOTTOM) LD DE, RXBUFF ; add buffer address LD H, 0 LD L, A ADD HL, DE ; address in buffer LD D,(HL) LD A, (RXBOTTOM) INC A AND 0x0f LD (RXBOTTOM), A ; increment and save botom pointer LD A,D RET parseHexLine: LD A, 0 LD (payloadCheck), A LD A, (HL) CP ':' JP NZ, parseHexline_err1 ; error if not ":" return a=1 INC HL CALL getByte ; increments HL too LD (payloadBytes), A CALL addCheck CALL getByte ; get where to write data to LD (payloadAddress+1), A CALL addCheck CALL getByte LD (payloadAddress), A CALL addCheck CALL getByte LD (payloadType), A CALL addCheck LD A, (payloadBytes) ; parse payloadBytes bytes into payload LD B, A LD DE, payload parseHexline_1: PUSH BC Call getByte POP BC LD (DE), A CALL addCheck INC DE DJNZ parseHexline_1 LD A,(payloadCheck) NEG LD (payloadCheck),A CALL getByte LD B,A LD A,(payloadCheck) SUB B JR NZ,parseHexline_err2 LD A,0 ; 0 error code RET parseHexline_err1: LD A,1 ; didn't start with : RET parseHexline_err2: LD A,2 ; checksum error RET addCheck: LD C, A LD A, (payloadCheck) ADD A, C LD (payloadCheck), A RET getByte: ; from (HL) returned in A LD A, (HL) INC HL CALL getDigit RLC A RLC A RLC A RLC A LD B, A ; high nibble in B LD A, (HL) INC HL CALL getDigit OR B ; combine hi and low nibble RET getDigit: CP '9'+1 ; Is it a digit (less or equal '9')? JR C, getDigit_1 SUB 7 ; Adjust for A-F getDigit_1: SUB '0' ; back to 0..f AND 0x0F RET ; TODO allocate this somewhere else (stack?) ; so low ram can become ROM! payloadAddress: ; address hex line will be written to defw 0 payloadBytes: ; bytes of data in hex line defb 0 payload: ; saved here before checksub verified max 8 bytes defb 0,0,0,0,0,0,0,0 payloadType: defb 0 payloadCheck: defb 0 HexLine: defb 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 defb 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 defb 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 defb 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 MAIN: ; main entry point for hexloader LD SP,RAMTOP+1 ;IM 1 ;Use interrupt mode 1 ;EI ;Enable interrupts ; print a string LD BC, msgWAIT LD A, RSTPSTR RST 8 LD A, RSTPCHAR LD B,'.' ; output '.' RST 8 LD A, RSTPCHAR LD B,10 ; output CR RST 8 LOOP: LD HL,HexLine LD D,32 lineLoop: PUSH HL PUSH DE LD A,RSTUARTGET ; get char from uart RST 8 POP DE POP HL CP 10 ; if cr JR Z,lineDone LD (HL),A INC HL JR lineLoop lineDone: LD HL,HexLine CALL parseHexLine CP 0 JR Z,lineOK CP 1 JR Z,strF LD BC, msgCHCK LD A,RSTPSTR RST 8 JP LOOP strF: LD BC, msgSTART LD A,RSTPSTR RST 8 JP LOOP lineOK: LD BC, msgOK LD A,RSTPSTR RST 8 LD A,(payloadType) CP 1 JR NZ, cont LD A, RSTPCHAR LD B,10 ; output CR RST 8 JP USERmem cont: LD HL,(payloadAddress) ; copy payload to memory LD DE,payload LD A,(payloadBytes) LD B,A cpy: LD A,(DE) LD (HL),A INC DE INC HL DJNZ cpy JP LOOP ; here in case.... ;END_PROGRAM: ; HALT ; JP END_PROGRAM ; data.... msgWAIT: defm "Waiting for intel format Hex file." defb 10,0 msgOK: defm "OK" defb 10,0 msgCHCK: defm "Checksum failed" defb 10,0 msgSTART: defm "Line should start with :" defb 10,0 ORG 0x0400 USERmem: defb 0
18.467662
78
0.487877
7c4c62990c674d3cf8e65fbeb51fc36656c063d4
29
asm
Assembly
vm/asm_constructions_test/vm_neg.asm
MarkoVMicic/nand2tetris-solutions
a917a861d520348f70d084da6aadbfdc90daa10a
[ "Unlicense" ]
null
null
null
vm/asm_constructions_test/vm_neg.asm
MarkoVMicic/nand2tetris-solutions
a917a861d520348f70d084da6aadbfdc90daa10a
[ "Unlicense" ]
null
null
null
vm/asm_constructions_test/vm_neg.asm
MarkoVMicic/nand2tetris-solutions
a917a861d520348f70d084da6aadbfdc90daa10a
[ "Unlicense" ]
null
null
null
@SP M=M-1 A=M M=-M @SP M=M+1
4.142857
5
0.482759
6085e55bfe54bb8823214906aeec745f3584284a
435
asm
Assembly
oeis/040/A040606.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/040/A040606.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/040/A040606.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A040606: Continued fraction for sqrt(632). ; Submitted by Jon Maiga ; 25,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7,50,7,6,7 seq $0,40281 ; Continued fraction for sqrt(299). mov $1,$0 mov $0,8 mov $2,$1 div $2,7 sub $0,$2 div $0,3 add $0,7 mul $0,4 add $0,$1 pow $2,2 add $2,$0 mov $0,$2 sub $0,32
22.894737
190
0.597701
b4d6496269c14ed76bce59847345739d9250d84c
336
asm
Assembly
oeis/106/A106440.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/106/A106440.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/106/A106440.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A106440: a(n) = binomial(2n+4,n)*binomial(n+4,4). ; Submitted by Jon Maiga ; 1,30,420,4200,34650,252252,1681680,10501920,62355150,355655300,1963217256,10546208400,55367594100,285028443000,1442592936000,7193730107520,35406640372950,172255143129300,829376615067000 mov $1,$0 sub $2,$0 sub $0,$2 mov $2,-5 bin $2,$0 bin $0,$1 mul $0,$2
28
187
0.752976
9606ef21e72a5f62cbdf88e9765b25c2cc2e7970
303
asm
Assembly
data/items/rooftop_sale.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
data/items/rooftop_sale.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
data/items/rooftop_sale.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
RooftopSaleMart1: db 5 dbw POKE_BALL, 150 dbw GREAT_BALL, 500 dbw SUPER_POTION, 500 dbw FULL_HEAL, 500 dbw REVIVE, 1200 db -1 RooftopSaleMart2: db 5 dbw HYPER_POTION, 1000 dbw FULL_RESTORE, 2000 dbw FULL_HEAL, 500 dbw ULTRA_BALL, 1000 dbw PROTEIN, 7800 db -1
16.833333
23
0.676568
2a9542d4a4e4100dc67b51fb826e68096b347779
822
asm
Assembly
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/loadstr.asm
gb-archive/really-old-stuff
ffb39a518cad47e23353b3420b88e2f3521fd3d7
[ "Apache-2.0" ]
10
2016-10-27T20:46:02.000Z
2021-11-01T15:49:13.000Z
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/loadstr.asm
gb-archive/really-old-stuff
ffb39a518cad47e23353b3420b88e2f3521fd3d7
[ "Apache-2.0" ]
null
null
null
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/loadstr.asm
gb-archive/really-old-stuff
ffb39a518cad47e23353b3420b88e2f3521fd3d7
[ "Apache-2.0" ]
2
2015-03-11T14:28:08.000Z
2017-11-02T10:57:57.000Z
#include once <alloc.asm> ; Loads a string (ptr) from HL ; and duplicates it on dynamic memory again ; Finally, it returns result pointer in HL __ILOADSTR: ; This is the indirect pointer entry HL = (HL) ld a, h or l ret z ld a, (hl) inc hl ld h, (hl) ld l, a __LOADSTR: ; __FASTCALL__ entry ld a, h or l ret z ; Return if NULL ld c, (hl) inc hl ld b, (hl) dec hl ; BC = LEN(a$) inc bc inc bc ; BC = LEN(a$) + 2 (two bytes for length) push hl push bc call __MEM_ALLOC pop bc ; Recover length pop de ; Recover origin ld a, h or l ret z ; Return if NULL (No memory) ex de, hl ; ldir takes HL as source, DE as destiny, so SWAP HL,DE push de ; Saves destiny start ldir ; Copies string (length number included) pop hl ; Recovers destiny in hl as result ret
18.681818
67
0.63747
ea9906d86e29b0cad818538845a891df188a6491
2,267
asm
Assembly
Transynther/x86/_processed/NONE/_st_un_xt_sm_/i7-7700_9_0x48.log_11_271.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_st_un_xt_sm_/i7-7700_9_0x48.log_11_271.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_st_un_xt_sm_/i7-7700_9_0x48.log_11_271.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 %r9 push %rbp push %rdi lea addresses_D_ht+0x6cd4, %r12 add %rdi, %rdi mov $0x6162636465666768, %rbp movq %rbp, (%r12) nop nop add $4644, %r9 pop %rdi pop %rbp pop %r9 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r15 push %r9 push %rbp push %rbx // Store lea addresses_A+0xd8d4, %r15 nop nop nop add $62039, %rbx movl $0x51525354, (%r15) inc %rbx // Store mov $0xcd4, %r12 nop cmp $27340, %r9 movb $0x51, (%r12) add $29742, %r9 // Store lea addresses_WT+0xbcd4, %r11 clflush (%r11) xor %r15, %r15 movb $0x51, (%r11) nop nop dec %r12 // Store lea addresses_WC+0xf14, %r15 nop and $20785, %r12 mov $0x5152535455565758, %r11 movq %r11, %xmm7 and $0xffffffffffffffc0, %r15 vmovaps %ymm7, (%r15) and %rbp, %rbp // Store lea addresses_WT+0xbcd4, %r14 nop nop nop cmp %rbp, %rbp movw $0x5152, (%r14) nop nop nop nop add $26569, %r9 // Faulty Load lea addresses_WT+0xbcd4, %r12 nop sub %r14, %r14 mov (%r12), %ebp lea oracles, %r15 and $0xff, %rbp shlq $12, %rbp mov (%r15,%rbp,1), %rbp pop %rbx pop %rbp pop %r9 pop %r15 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': True, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}} {'ae': 1, '52': 8, '34': 1, '2c': 1} 52 ae 34 52 52 2c 52 52 52 52 52 */
20.241071
124
0.630348
caee2adea18781f0b6dc8f756f0e4124decd59b1
1,600
asm
Assembly
src/unison/test/problematic/Mips/speed/gcc.insn-output.output_51.asm
Patstrom/disUnison
94731ad37cefa9dc3b6472de3adea8a8d5f0a44b
[ "BSD-3-Clause" ]
88
2016-09-27T15:20:07.000Z
2022-03-24T15:23:06.000Z
src/unison/test/problematic/Mips/speed/gcc.insn-output.output_51.asm
Patstrom/disUnison
94731ad37cefa9dc3b6472de3adea8a8d5f0a44b
[ "BSD-3-Clause" ]
56
2018-02-26T16:44:15.000Z
2019-02-23T17:07:32.000Z
src/unison/test/problematic/Mips/speed/gcc.insn-output.output_51.asm
Patstrom/disUnison
94731ad37cefa9dc3b6472de3adea8a8d5f0a44b
[ "BSD-3-Clause" ]
10
2016-11-22T15:03:46.000Z
2020-07-13T21:34:31.000Z
.text .abicalls .section .mdebug.abi32,"",@progbits .nan legacy .file "gcc.insn-output.output_51.ll" .text .hidden output_51 .globl output_51 .align 2 .type output_51,@function .set nomicromips .set nomips16 .ent output_51 output_51: # @output_51 .frame $sp,32,$ra .mask 0x80030000,-4 .fmask 0x00000000,0 .set noreorder .set nomacro .set noat # BB#0: lui $2, %hi(_gp_disp) addiu $2, $2, %lo(_gp_disp) addiu $sp, $sp, -32 sw $ra, 28($sp) # 4-byte Folded Spill sw $17, 24($sp) # 4-byte Folded Spill sw $16, 20($sp) # 4-byte Folded Spill addu $16, $2, $25 move $17, $5 lw $25, %call16(get_attr_type)($16) move $4, $17 jalr $25 move $gp, $16 addiu $1, $zero, 8 bne $2, $1, $BB0_2 nop # BB#1: lw $2, %got(.str.2014)($16) b $BB0_3 nop $BB0_2: lw $25, %call16(get_attr_mode)($16) move $4, $17 jalr $25 move $gp, $16 xori $1, $2, 4 addiu $2, $16, %got(.str.75) addiu $3, $16, %got(.str.2015) movz $2, $3, $1 lw $2, 0($2) $BB0_3: lw $16, 20($sp) # 4-byte Folded Reload lw $17, 24($sp) # 4-byte Folded Reload lw $ra, 28($sp) # 4-byte Folded Reload jr $ra addiu $sp, $sp, 32 .set at .set macro .set reorder .end output_51 $func_end0: .size output_51, ($func_end0)-output_51 .hidden .str.75 .hidden .str.2014 .hidden .str.2015 .ident "clang version 3.8.0 (http://llvm.org/git/clang.git 2d49f0a0ae8366964a93e3b7b26e29679bee7160) (http://llvm.org/git/llvm.git 60bc66b44837125843b58ed3e0fd2e6bb948d839)" .section ".note.GNU-stack","",@progbits .text
22.535211
174
0.61
bcac8e62c8ff9fc22a94cb81a50fb5b113eaedea
631
asm
Assembly
oeis/083/A083823.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/083/A083823.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/083/A083823.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A083823: a(1) = 15; then numbers obtained at every stage of division by 3 in the following process: multiply by 3, reverse the digits, divide by 3, reverse the digits, multiply by 3, reverse the digit, divide by 3. ; Submitted by Jon Maiga ; 15,18,114,1107,11004,110007,1100004,11000007,110000004,1100000007,11000000004,110000000007,1100000000004,11000000000007,110000000000004,1100000000000007,11000000000000004,110000000000000007,1100000000000000004,11000000000000000007 lpb $0 sub $0,1 add $1,$2 mul $1,10 add $1,$2 add $1,1 mov $2,$1 mul $2,2 add $2,10 mod $2,3 add $2,2 lpe mov $0,$1 mul $0,3 add $0,15
31.55
232
0.74168
73547b77c44d0a0aa602dbf9c06b288690597d61
721
asm
Assembly
oeis/184/A184631.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/184/A184631.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/184/A184631.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A184631: Floor(1/{(7+n^4)^(1/4)}), where {}=fractional part. ; Submitted by Jon Maiga ; 1,5,15,36,71,123,196,292,416,571,760,987,1255,1568,1928,2340,2807,3332,3919,4571,5292,6084,6952,7899,8928,10043,11247,12544,13936,15428,17023,18724,20535,22459,24500,26660,28944,31355,33896,36571,39383,42336,45432,48676,52071,55620,59327,63195,67228,71428,75800,80347,85072,89979,95071,100352,105824,111492,117359,123428,129703,136187,142884,149796,156928,164283,171864,179675,187719,196000,204520,213284,222295,231556,241071,250843,260876,271172,281736,292571,303680,315067,326735,338688,350928 mov $3,$0 add $3,1 mov $1,$3 pow $1,4 div $1,4 mul $1,12 add $1,6 div $1,3 mul $1,60 mov $2,$3 mul $2,35 div $1,$2 div $1,3 mov $0,$1
37.947368
497
0.74896
611e264e5798507e931ae291dbe8b30d36a2326a
7,559
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_265.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_265.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_265.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 %rax push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x2503, %rsi lea addresses_normal_ht+0x1b259, %rdi clflush (%rdi) nop and $15315, %rax mov $93, %rcx rep movsb nop nop nop sub $41172, %rcx lea addresses_UC_ht+0x12d1, %r12 sub $25800, %rax movb $0x61, (%r12) add $14105, %rsi lea addresses_UC_ht+0x1c625, %rsi nop nop nop cmp $3841, %r15 movups (%rsi), %xmm2 vpextrq $1, %xmm2, %rax nop nop nop dec %rsi lea addresses_A_ht+0x125f1, %rdi nop nop nop nop nop add $1146, %r15 movups (%rdi), %xmm6 vpextrq $1, %xmm6, %rax nop nop nop nop nop and $56641, %rcx lea addresses_normal_ht+0x11391, %rsi lea addresses_WC_ht+0x16d59, %rdi nop nop and %rax, %rax mov $98, %rcx rep movsq nop xor %r12, %r12 lea addresses_UC_ht+0x2ad9, %r15 nop nop nop sub $33746, %rbx movb (%r15), %r12b nop cmp $31541, %rcx lea addresses_normal_ht+0x19599, %rdi nop nop nop and $29201, %rsi mov $0x6162636465666768, %rcx movq %rcx, %xmm3 vmovups %ymm3, (%rdi) xor $2479, %rsi lea addresses_A_ht+0x1b459, %rsi lea addresses_A_ht+0x888f, %rdi nop nop nop xor %rax, %rax mov $78, %rcx rep movsq nop nop nop nop and %rsi, %rsi lea addresses_UC_ht+0x16c59, %rcx nop nop nop nop and $49090, %rbx mov $0x6162636465666768, %rsi movq %rsi, (%rcx) nop dec %rsi lea addresses_WC_ht+0xa341, %rdi nop nop nop and $54692, %r12 vmovups (%rdi), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %r15 nop sub $59737, %rcx lea addresses_normal_ht+0x19359, %rsi lea addresses_normal_ht+0x17d99, %rdi nop nop nop nop add %r12, %r12 mov $113, %rcx rep movsb nop dec %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r9 push %rax push %rcx push %rdx push %rsi // Store lea addresses_PSE+0xfd09, %r9 nop add %rax, %rax mov $0x5152535455565758, %rdx movq %rdx, %xmm4 vmovups %ymm4, (%r9) nop nop cmp $15661, %r9 // Store lea addresses_D+0x6859, %rcx nop nop sub $42079, %r12 movl $0x51525354, (%rcx) nop nop nop and %rdx, %rdx // Store lea addresses_A+0x1b919, %r9 nop nop nop inc %rsi movb $0x51, (%r9) nop nop dec %rdx // Faulty Load lea addresses_UC+0xd459, %rdx nop nop nop xor %r9, %r9 mov (%rdx), %r11d lea oracles, %rsi and $0xff, %r11 shlq $12, %r11 mov (%rsi,%r11,1), %r11 pop %rsi pop %rdx pop %rcx pop %rax pop %r9 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
34.834101
2,999
0.657627
0772bd57ae6da3cc72d21f692cfc32eab237b08e
596
asm
Assembly
oeis/284/A284475.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/284/A284475.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/284/A284475.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A284475: Total number of parts in all partitions of n into equal parts, minus the total number of parts in all partitions of n into consecutive parts. ; Submitted by Jon Maiga ; 0,2,1,6,3,8,5,14,7,13,9,24,11,19,13,30,15,31,17,36,20,31,21,56,23,37,28,48,27,59,29,62,36,49,33,79,35,55,44,84,39,81,41,75,52,67,45,120,47,83,60,89,51,103,54,112,68,85,57,151,59,91,76,126,66,125,65,117,84,127,69,182,71,109,97,131,75,148 mov $1,$0 seq $0,204217 ; G.f.: Sum_{n>=1} n * x^(n*(n+1)/2) / (1 - x^n). seq $1,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n). sub $1,$0 mov $0,$1
59.6
238
0.66443
96af9d74e3364916b69b976cee561ffad683a9f5
1,235
asm
Assembly
programs/oeis/270/A270106.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/270/A270106.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/270/A270106.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A270106: Partial sums of the number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 84", based on the 5-celled von Neumann neighborhood. ; 1,5,13,29,45,77,109,173,205,269,333,461,525,653,781,1037,1101,1229,1357,1613,1741,1997,2253,2765,2893,3149,3405,3917,4173,4685,5197,6221,6349,6605,6861,7373,7629,8141,8653,9677,9933,10445,10957,11981,12493,13517,14541,16589,16845,17357,17869,18893,19405,20429,21453,23501,24013,25037,26061,28109,29133,31181,33229,37325,37581,38093,38605,39629,40141,41165,42189,44237,44749,45773,46797,48845,49869,51917,53965,58061,58573,59597,60621,62669,63693,65741,67789,71885,72909,74957,77005,81101,83149,87245,91341,99533,100045,101069,102093,104141,105165,107213,109261,113357,114381,116429,118477,122573,124621,128717,132813,141005,142029,144077,146125,150221,152269,156365,160461,168653,170701,174797,178893,187085,191181,199373,207565,223949,224461 mov $4,$0 add $4,1 mov $5,$0 lpb $4,1 mov $0,$5 sub $4,1 sub $0,$4 mul $0,4 mov $2,4 mov $3,10 lpb $0,1 mov $6,$0 sub $0,1 gcd $6,2 div $0,$6 sub $3,$2 mul $3,2 add $3,1 lpe add $0,$3 mov $6,$0 sub $6,10 div $6,3 add $6,1 add $1,$6 lpe
41.166667
744
0.725506
eb16af71da2a9a447e7a6e94a7c12f161ddb39dc
637,904
asm
Assembly
kernel.asm
SandeepPithani/XV6_rename_command
d24246e50d7ed44bcf4a1f2958344ad1a52bf84f
[ "MIT-0" ]
1
2020-06-12T16:44:21.000Z
2020-06-12T16:44:21.000Z
kernel.asm
SandeepPithani/XV6_rename_command
d24246e50d7ed44bcf4a1f2958344ad1a52bf84f
[ "MIT-0" ]
null
null
null
kernel.asm
SandeepPithani/XV6_rename_command
d24246e50d7ed44bcf4a1f2958344ad1a52bf84f
[ "MIT-0" ]
1
2022-01-08T02:47:08.000Z
2022-01-08T02:47:08.000Z
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 a0 10 00 mov $0x10a000,%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 c5 10 80 mov $0x8010c5c0,%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 c5 10 80 mov $0x8010c5f4,%ebx { 80100049: 83 ec 0c sub $0xc,%esp initlock(&bcache.lock, "bcache"); 8010004c: 68 40 77 10 80 push $0x80107740 80100051: 68 c0 c5 10 80 push $0x8010c5c0 80100056: e8 e5 42 00 00 call 80104340 <initlock> bcache.head.prev = &bcache.head; 8010005b: c7 05 0c 0d 11 80 bc movl $0x80110cbc,0x80110d0c 80100062: 0c 11 80 bcache.head.next = &bcache.head; 80100065: c7 05 10 0d 11 80 bc movl $0x80110cbc,0x80110d10 8010006c: 0c 11 80 8010006f: 83 c4 10 add $0x10,%esp 80100072: ba bc 0c 11 80 mov $0x80110cbc,%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 0c 11 80 movl $0x80110cbc,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100092: 68 47 77 10 80 push $0x80107747 80100097: 50 push %eax 80100098: e8 73 41 00 00 call 80104210 <initsleeplock> bcache.head.next->prev = b; 8010009d: a1 10 0d 11 80 mov 0x80110d10,%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 0d 11 80 mov %ebx,0x80110d10 for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000b6: 3d bc 0c 11 80 cmp $0x80110cbc,%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 c5 10 80 push $0x8010c5c0 801000e4: e8 97 43 00 00 call 80104480 <acquire> for(b = bcache.head.next; b != &bcache.head; b = b->next){ 801000e9: 8b 1d 10 0d 11 80 mov 0x80110d10,%ebx 801000ef: 83 c4 10 add $0x10,%esp 801000f2: 81 fb bc 0c 11 80 cmp $0x80110cbc,%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 0c 11 80 cmp $0x80110cbc,%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 0d 11 80 mov 0x80110d0c,%ebx 80100126: 81 fb bc 0c 11 80 cmp $0x80110cbc,%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 0c 11 80 cmp $0x80110cbc,%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 c5 10 80 push $0x8010c5c0 80100162: e8 d9 43 00 00 call 80104540 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 de 40 00 00 call 80104250 <acquiresleep> 80100172: 83 c4 10 add $0x10,%esp struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { 80100175: f6 03 02 testb $0x2,(%ebx) 80100178: 75 0c jne 80100186 <bread+0xb6> iderw(b); 8010017a: 83 ec 0c sub $0xc,%esp 8010017d: 53 push %ebx 8010017e: e8 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 4e 77 10 80 push $0x8010774e 80100198: e8 f3 01 00 00 call 80100390 <panic> 8010019d: 8d 76 00 lea 0x0(%esi),%esi 801001a0 <bwrite>: // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { 801001a0: 55 push %ebp 801001a1: 89 e5 mov %esp,%ebp 801001a3: 53 push %ebx 801001a4: 83 ec 10 sub $0x10,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 50 push %eax 801001ae: e8 3d 41 00 00 call 801042f0 <holdingsleep> 801001b3: 83 c4 10 add $0x10,%esp 801001b6: 85 c0 test %eax,%eax 801001b8: 74 0f je 801001c9 <bwrite+0x29> panic("bwrite"); b->flags |= B_DIRTY; 801001ba: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bd: 89 5d 08 mov %ebx,0x8(%ebp) } 801001c0: 8b 5d fc mov -0x4(%ebp),%ebx 801001c3: c9 leave iderw(b); 801001c4: e9 57 1f 00 00 jmp 80102120 <iderw> panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 5f 77 10 80 push $0x8010775f 801001d1: e8 ba 01 00 00 call 80100390 <panic> 801001d6: 8d 76 00 lea 0x0(%esi),%esi 801001d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801001e0 <brelse>: // Release a locked buffer. // Move to the head of the MRU list. void brelse(struct buf *b) { 801001e0: 55 push %ebp 801001e1: 89 e5 mov %esp,%ebp 801001e3: 56 push %esi 801001e4: 53 push %ebx 801001e5: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001e8: 83 ec 0c sub $0xc,%esp 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 56 push %esi 801001ef: e8 fc 40 00 00 call 801042f0 <holdingsleep> 801001f4: 83 c4 10 add $0x10,%esp 801001f7: 85 c0 test %eax,%eax 801001f9: 74 66 je 80100261 <brelse+0x81> panic("brelse"); releasesleep(&b->lock); 801001fb: 83 ec 0c sub $0xc,%esp 801001fe: 56 push %esi 801001ff: e8 ac 40 00 00 call 801042b0 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 c5 10 80 movl $0x8010c5c0,(%esp) 8010020b: e8 70 42 00 00 call 80104480 <acquire> b->refcnt--; 80100210: 8b 43 4c mov 0x4c(%ebx),%eax if (b->refcnt == 0) { 80100213: 83 c4 10 add $0x10,%esp b->refcnt--; 80100216: 83 e8 01 sub $0x1,%eax if (b->refcnt == 0) { 80100219: 85 c0 test %eax,%eax b->refcnt--; 8010021b: 89 43 4c mov %eax,0x4c(%ebx) if (b->refcnt == 0) { 8010021e: 75 2f jne 8010024f <brelse+0x6f> // no one is waiting for it. b->next->prev = b->prev; 80100220: 8b 43 54 mov 0x54(%ebx),%eax 80100223: 8b 53 50 mov 0x50(%ebx),%edx 80100226: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 80100229: 8b 43 50 mov 0x50(%ebx),%eax 8010022c: 8b 53 54 mov 0x54(%ebx),%edx 8010022f: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100232: a1 10 0d 11 80 mov 0x80110d10,%eax b->prev = &bcache.head; 80100237: c7 43 50 bc 0c 11 80 movl $0x80110cbc,0x50(%ebx) b->next = bcache.head.next; 8010023e: 89 43 54 mov %eax,0x54(%ebx) bcache.head.next->prev = b; 80100241: a1 10 0d 11 80 mov 0x80110d10,%eax 80100246: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 80100249: 89 1d 10 0d 11 80 mov %ebx,0x80110d10 } release(&bcache.lock); 8010024f: c7 45 08 c0 c5 10 80 movl $0x8010c5c0,0x8(%ebp) } 80100256: 8d 65 f8 lea -0x8(%ebp),%esp 80100259: 5b pop %ebx 8010025a: 5e pop %esi 8010025b: 5d pop %ebp release(&bcache.lock); 8010025c: e9 df 42 00 00 jmp 80104540 <release> panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 66 77 10 80 push $0x80107766 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 b5 10 80 movl $0x8010b520,(%esp) 8010028c: e8 ef 41 00 00 call 80104480 <acquire> while(n > 0){ 80100291: 8b 5d 10 mov 0x10(%ebp),%ebx 80100294: 83 c4 10 add $0x10,%esp 80100297: 31 c0 xor %eax,%eax 80100299: 85 db test %ebx,%ebx 8010029b: 0f 8e a1 00 00 00 jle 80100342 <consoleread+0xd2> while(input.r == input.w){ 801002a1: 8b 15 a0 0f 11 80 mov 0x80110fa0,%edx 801002a7: 39 15 a4 0f 11 80 cmp %edx,0x80110fa4 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 b5 10 80 push $0x8010b520 801002c0: 68 a0 0f 11 80 push $0x80110fa0 801002c5: e8 d6 3a 00 00 call 80103da0 <sleep> while(input.r == input.w){ 801002ca: 8b 15 a0 0f 11 80 mov 0x80110fa0,%edx 801002d0: 83 c4 10 add $0x10,%esp 801002d3: 3b 15 a4 0f 11 80 cmp 0x80110fa4,%edx 801002d9: 75 35 jne 80100310 <consoleread+0xa0> if(myproc()->killed){ 801002db: e8 00 35 00 00 call 801037e0 <myproc> 801002e0: 8b 40 24 mov 0x24(%eax),%eax 801002e3: 85 c0 test %eax,%eax 801002e5: 74 d1 je 801002b8 <consoleread+0x48> release(&cons.lock); 801002e7: 83 ec 0c sub $0xc,%esp 801002ea: 68 20 b5 10 80 push $0x8010b520 801002ef: e8 4c 42 00 00 call 80104540 <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 0f 11 80 mov %eax,0x80110fa0 80100318: 89 d0 mov %edx,%eax 8010031a: 83 e0 7f and $0x7f,%eax 8010031d: 0f be 80 20 0f 11 80 movsbl -0x7feef0e0(%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 b5 10 80 push $0x8010b520 8010034d: e8 ee 41 00 00 call 80104540 <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 0f 11 80 mov %edx,0x80110fa0 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 b5 10 80 00 movl $0x0,0x8010b554 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 6d 77 10 80 push $0x8010776d 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 73 82 10 80 movl $0x80108273,(%esp) 801003cc: e8 8f 02 00 00 call 80100660 <cprintf> getcallerpcs(&s, pcs); 801003d1: 5a pop %edx 801003d2: 8d 45 08 lea 0x8(%ebp),%eax 801003d5: 59 pop %ecx 801003d6: 53 push %ebx 801003d7: 50 push %eax 801003d8: e8 83 3f 00 00 call 80104360 <getcallerpcs> 801003dd: 83 c4 10 add $0x10,%esp cprintf(" %p", pcs[i]); 801003e0: 83 ec 08 sub $0x8,%esp 801003e3: ff 33 pushl (%ebx) 801003e5: 83 c3 04 add $0x4,%ebx 801003e8: 68 81 77 10 80 push $0x80107781 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 b5 10 80 01 movl $0x1,0x8010b558 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 b5 10 80 mov 0x8010b558,%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 11 5f 00 00 call 80106350 <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 5f 5e 00 00 call 80106350 <uartputc> 801004f1: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004f8: e8 53 5e 00 00 call 80106350 <uartputc> 801004fd: c7 04 24 08 00 00 00 movl $0x8,(%esp) 80100504: e8 47 5e 00 00 call 80106350 <uartputc> 80100509: 83 c4 10 add $0x10,%esp 8010050c: e9 31 ff ff ff jmp 80100442 <consputc+0x32> memmove(crt, crt+80, sizeof(crt[0])*23*80); 80100511: 52 push %edx 80100512: 68 60 0e 00 00 push $0xe60 pos -= 80; 80100517: 83 eb 50 sub $0x50,%ebx memmove(crt, crt+80, sizeof(crt[0])*23*80); 8010051a: 68 a0 80 0b 80 push $0x800b80a0 8010051f: 68 00 80 0b 80 push $0x800b8000 80100524: e8 17 41 00 00 call 80104640 <memmove> memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100529: b8 80 07 00 00 mov $0x780,%eax 8010052e: 83 c4 0c add $0xc,%esp 80100531: 29 d8 sub %ebx,%eax 80100533: 01 c0 add %eax,%eax 80100535: 50 push %eax 80100536: 8d 04 1b lea (%ebx,%ebx,1),%eax 80100539: 6a 00 push $0x0 8010053b: 2d 00 80 f4 7f sub $0x7ff48000,%eax 80100540: 50 push %eax 80100541: e8 4a 40 00 00 call 80104590 <memset> 80100546: 83 c4 10 add $0x10,%esp 80100549: e9 5d ff ff ff jmp 801004ab <consputc+0x9b> panic("pos under/overflow"); 8010054e: 83 ec 0c sub $0xc,%esp 80100551: 68 85 77 10 80 push $0x80107785 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 b0 77 10 80 movzbl -0x7fef8850(%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 b5 10 80 movl $0x8010b520,(%esp) 8010061b: e8 60 3e 00 00 call 80104480 <acquire> for(i = 0; i < n; i++) 80100620: 83 c4 10 add $0x10,%esp 80100623: 85 f6 test %esi,%esi 80100625: 7e 18 jle 8010063f <consolewrite+0x3f> 80100627: 8b 7d 0c mov 0xc(%ebp),%edi 8010062a: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010062d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100630: 0f b6 07 movzbl (%edi),%eax 80100633: 83 c7 01 add $0x1,%edi 80100636: e8 d5 fd ff ff call 80100410 <consputc> for(i = 0; i < n; i++) 8010063b: 39 fb cmp %edi,%ebx 8010063d: 75 f1 jne 80100630 <consolewrite+0x30> release(&cons.lock); 8010063f: 83 ec 0c sub $0xc,%esp 80100642: 68 20 b5 10 80 push $0x8010b520 80100647: e8 f4 3e 00 00 call 80104540 <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 b5 10 80 mov 0x8010b554,%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 b5 10 80 push $0x8010b520 8010071f: e8 1c 3e 00 00 call 80104540 <release> 80100724: 83 c4 10 add $0x10,%esp } 80100727: 8d 65 f4 lea -0xc(%ebp),%esp 8010072a: 5b pop %ebx 8010072b: 5e pop %esi 8010072c: 5f pop %edi 8010072d: 5d pop %ebp 8010072e: c3 ret 8010072f: 90 nop switch(c){ 80100730: 83 fa 73 cmp $0x73,%edx 80100733: 74 43 je 80100778 <cprintf+0x118> 80100735: 83 fa 78 cmp $0x78,%edx 80100738: 75 1e jne 80100758 <cprintf+0xf8> printint(*argp++, 16, 0); 8010073a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010073d: ba 10 00 00 00 mov $0x10,%edx 80100742: 8d 48 04 lea 0x4(%eax),%ecx 80100745: 8b 00 mov (%eax),%eax 80100747: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010074a: 31 c9 xor %ecx,%ecx 8010074c: e8 2f fe ff ff call 80100580 <printint> break; 80100751: eb 91 jmp 801006e4 <cprintf+0x84> 80100753: 90 nop 80100754: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100758: b8 25 00 00 00 mov $0x25,%eax 8010075d: 89 55 e0 mov %edx,-0x20(%ebp) 80100760: e8 ab fc ff ff call 80100410 <consputc> consputc(c); 80100765: 8b 55 e0 mov -0x20(%ebp),%edx 80100768: 89 d0 mov %edx,%eax 8010076a: e8 a1 fc ff ff call 80100410 <consputc> break; 8010076f: e9 70 ff ff ff jmp 801006e4 <cprintf+0x84> 80100774: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((s = (char*)*argp++) == 0) 80100778: 8b 45 e4 mov -0x1c(%ebp),%eax 8010077b: 8b 10 mov (%eax),%edx 8010077d: 8d 48 04 lea 0x4(%eax),%ecx 80100780: 89 4d e0 mov %ecx,-0x20(%ebp) 80100783: 85 d2 test %edx,%edx 80100785: 74 49 je 801007d0 <cprintf+0x170> for(; *s; s++) 80100787: 0f be 02 movsbl (%edx),%eax if((s = (char*)*argp++) == 0) 8010078a: 89 4d e4 mov %ecx,-0x1c(%ebp) for(; *s; s++) 8010078d: 84 c0 test %al,%al 8010078f: 0f 84 4f ff ff ff je 801006e4 <cprintf+0x84> 80100795: 89 5d e4 mov %ebx,-0x1c(%ebp) 80100798: 89 d3 mov %edx,%ebx 8010079a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801007a0: 83 c3 01 add $0x1,%ebx consputc(*s); 801007a3: e8 68 fc ff ff call 80100410 <consputc> for(; *s; s++) 801007a8: 0f be 03 movsbl (%ebx),%eax 801007ab: 84 c0 test %al,%al 801007ad: 75 f1 jne 801007a0 <cprintf+0x140> if((s = (char*)*argp++) == 0) 801007af: 8b 45 e0 mov -0x20(%ebp),%eax 801007b2: 8b 5d e4 mov -0x1c(%ebp),%ebx 801007b5: 89 45 e4 mov %eax,-0x1c(%ebp) 801007b8: e9 27 ff ff ff jmp 801006e4 <cprintf+0x84> 801007bd: 8d 76 00 lea 0x0(%esi),%esi consputc('%'); 801007c0: b8 25 00 00 00 mov $0x25,%eax 801007c5: e8 46 fc ff ff call 80100410 <consputc> break; 801007ca: e9 15 ff ff ff jmp 801006e4 <cprintf+0x84> 801007cf: 90 nop s = "(null)"; 801007d0: ba 98 77 10 80 mov $0x80107798,%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 b5 10 80 push $0x8010b520 801007f0: e8 8b 3c 00 00 call 80104480 <acquire> 801007f5: 83 c4 10 add $0x10,%esp 801007f8: e9 7c fe ff ff jmp 80100679 <cprintf+0x19> panic("null fmt"); 801007fd: 83 ec 0c sub $0xc,%esp 80100800: 68 9f 77 10 80 push $0x8010779f 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 b5 10 80 push $0x8010b520 80100823: e8 58 3c 00 00 call 80104480 <acquire> while((c = getc()) >= 0){ 80100828: 83 c4 10 add $0x10,%esp 8010082b: 90 nop 8010082c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100830: ff d3 call *%ebx 80100832: 85 c0 test %eax,%eax 80100834: 89 c7 mov %eax,%edi 80100836: 78 48 js 80100880 <consoleintr+0x70> switch(c){ 80100838: 83 ff 10 cmp $0x10,%edi 8010083b: 0f 84 e7 00 00 00 je 80100928 <consoleintr+0x118> 80100841: 7e 5d jle 801008a0 <consoleintr+0x90> 80100843: 83 ff 15 cmp $0x15,%edi 80100846: 0f 84 ec 00 00 00 je 80100938 <consoleintr+0x128> 8010084c: 83 ff 7f cmp $0x7f,%edi 8010084f: 75 54 jne 801008a5 <consoleintr+0x95> if(input.e != input.w){ 80100851: a1 a8 0f 11 80 mov 0x80110fa8,%eax 80100856: 3b 05 a4 0f 11 80 cmp 0x80110fa4,%eax 8010085c: 74 d2 je 80100830 <consoleintr+0x20> input.e--; 8010085e: 83 e8 01 sub $0x1,%eax 80100861: a3 a8 0f 11 80 mov %eax,0x80110fa8 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 b5 10 80 push $0x8010b520 80100888: e8 b3 3c 00 00 call 80104540 <release> if(doprocdump) { 8010088d: 83 c4 10 add $0x10,%esp 80100890: 85 f6 test %esi,%esi 80100892: 0f 85 f8 00 00 00 jne 80100990 <consoleintr+0x180> } 80100898: 8d 65 f4 lea -0xc(%ebp),%esp 8010089b: 5b pop %ebx 8010089c: 5e pop %esi 8010089d: 5f pop %edi 8010089e: 5d pop %ebp 8010089f: c3 ret switch(c){ 801008a0: 83 ff 08 cmp $0x8,%edi 801008a3: 74 ac je 80100851 <consoleintr+0x41> if(c != 0 && input.e-input.r < INPUT_BUF){ 801008a5: 85 ff test %edi,%edi 801008a7: 74 87 je 80100830 <consoleintr+0x20> 801008a9: a1 a8 0f 11 80 mov 0x80110fa8,%eax 801008ae: 89 c2 mov %eax,%edx 801008b0: 2b 15 a0 0f 11 80 sub 0x80110fa0,%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 0f 11 80 mov %edx,0x80110fa8 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 0f 11 80 mov %cl,-0x7feef0e0(%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 0f 11 80 mov 0x80110fa0,%eax 801008fa: 83 e8 80 sub $0xffffff80,%eax 801008fd: 39 05 a8 0f 11 80 cmp %eax,0x80110fa8 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 0f 11 80 mov %eax,0x80110fa4 wakeup(&input.r); 80100911: 68 a0 0f 11 80 push $0x80110fa0 80100916: e8 35 36 00 00 call 80103f50 <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 0f 11 80 mov 0x80110fa8,%eax 8010093d: 39 05 a4 0f 11 80 cmp %eax,0x80110fa4 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 0f 11 80 mov %eax,0x80110fa8 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 0f 11 80 mov 0x80110fa8,%eax 80100964: 3b 05 a4 0f 11 80 cmp 0x80110fa4,%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 0f 11 80 0a cmpb $0xa,-0x7feef0e0(%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 94 36 00 00 jmp 80104030 <procdump> 8010099c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi input.buf[input.e++ % INPUT_BUF] = c; 801009a0: c6 80 20 0f 11 80 0a movb $0xa,-0x7feef0e0(%eax) consputc(c); 801009a7: b8 0a 00 00 00 mov $0xa,%eax 801009ac: e8 5f fa ff ff call 80100410 <consputc> 801009b1: a1 a8 0f 11 80 mov 0x80110fa8,%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 a8 77 10 80 push $0x801077a8 801009cb: 68 20 b5 10 80 push $0x8010b520 801009d0: e8 6b 39 00 00 call 80104340 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; ioapicenable(IRQ_KBD, 0); 801009d5: 58 pop %eax 801009d6: 5a pop %edx 801009d7: 6a 00 push $0x0 801009d9: 6a 01 push $0x1 devsw[CONSOLE].write = consolewrite; 801009db: c7 05 6c 19 11 80 00 movl $0x80100600,0x8011196c 801009e2: 06 10 80 devsw[CONSOLE].read = consoleread; 801009e5: c7 05 68 19 11 80 70 movl $0x80100270,0x80111968 801009ec: 02 10 80 cons.locking = 1; 801009ef: c7 05 54 b5 10 80 01 movl $0x1,0x8010b554 801009f6: 00 00 00 ioapicenable(IRQ_KBD, 0); 801009f9: e8 d2 18 00 00 call 801022d0 <ioapicenable> } 801009fe: 83 c4 10 add $0x10,%esp 80100a01: c9 leave 80100a02: c3 ret 80100a03: 66 90 xchg %ax,%ax 80100a05: 66 90 xchg %ax,%ax 80100a07: 66 90 xchg %ax,%ax 80100a09: 66 90 xchg %ax,%ax 80100a0b: 66 90 xchg %ax,%ax 80100a0d: 66 90 xchg %ax,%ax 80100a0f: 90 nop 80100a10 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 80100a10: 55 push %ebp 80100a11: 89 e5 mov %esp,%ebp 80100a13: 57 push %edi 80100a14: 56 push %esi 80100a15: 53 push %ebx 80100a16: 81 ec 0c 01 00 00 sub $0x10c,%esp uint argc, sz, sp, ustack[3+MAXARG+1]; struct elfhdr elf; struct inode *ip; struct proghdr ph; pde_t *pgdir, *oldpgdir; struct proc *curproc = myproc(); 80100a1c: e8 bf 2d 00 00 call 801037e0 <myproc> 80100a21: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 80100a27: e8 74 21 00 00 call 80102ba0 <begin_op> if((ip = namei(path)) == 0){ 80100a2c: 83 ec 0c sub $0xc,%esp 80100a2f: ff 75 08 pushl 0x8(%ebp) 80100a32: e8 a9 14 00 00 call 80101ee0 <namei> 80100a37: 83 c4 10 add $0x10,%esp 80100a3a: 85 c0 test %eax,%eax 80100a3c: 0f 84 91 01 00 00 je 80100bd3 <exec+0x1c3> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 80100a42: 83 ec 0c sub $0xc,%esp 80100a45: 89 c3 mov %eax,%ebx 80100a47: 50 push %eax 80100a48: e8 33 0c 00 00 call 80101680 <ilock> pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a4d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 80100a53: 6a 34 push $0x34 80100a55: 6a 00 push $0x0 80100a57: 50 push %eax 80100a58: 53 push %ebx 80100a59: e8 02 0f 00 00 call 80101960 <readi> 80100a5e: 83 c4 20 add $0x20,%esp 80100a61: 83 f8 34 cmp $0x34,%eax 80100a64: 74 22 je 80100a88 <exec+0x78> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a66: 83 ec 0c sub $0xc,%esp 80100a69: 53 push %ebx 80100a6a: e8 a1 0e 00 00 call 80101910 <iunlockput> end_op(); 80100a6f: e8 9c 21 00 00 call 80102c10 <end_op> 80100a74: 83 c4 10 add $0x10,%esp } return -1; 80100a77: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a7c: 8d 65 f4 lea -0xc(%ebp),%esp 80100a7f: 5b pop %ebx 80100a80: 5e pop %esi 80100a81: 5f pop %edi 80100a82: 5d pop %ebp 80100a83: c3 ret 80100a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(elf.magic != ELF_MAGIC) 80100a88: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a8f: 45 4c 46 80100a92: 75 d2 jne 80100a66 <exec+0x56> if((pgdir = setupkvm()) == 0) 80100a94: e8 07 6a 00 00 call 801074a0 <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 93 02 00 00 je 80100d52 <exec+0x342> 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 c5 67 00 00 call 801072c0 <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 d3 66 00 00 call 80107200 <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 a9 68 00 00 call 80107420 <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 11 67 00 00 call 801072c0 <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 5a 68 00 00 call 80107420 <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 c1 77 10 80 push $0x801077c1 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 35 69 00 00 call 80107540 <clearpteu> for(argc = 0; argv[argc]; argc++) { 80100c0b: 8b 45 0c mov 0xc(%ebp),%eax 80100c0e: 83 c4 10 add $0x10,%esp 80100c11: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80100c17: 8b 00 mov (%eax),%eax 80100c19: 85 c0 test %eax,%eax 80100c1b: 74 70 je 80100c8d <exec+0x27d> 80100c1d: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp) 80100c23: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi 80100c29: eb 0a jmp 80100c35 <exec+0x225> 80100c2b: 90 nop 80100c2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(argc >= MAXARG) 80100c30: 83 ff 20 cmp $0x20,%edi 80100c33: 74 83 je 80100bb8 <exec+0x1a8> sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c35: 83 ec 0c sub $0xc,%esp 80100c38: 50 push %eax 80100c39: e8 72 3b 00 00 call 801047b0 <strlen> 80100c3e: f7 d0 not %eax 80100c40: 01 c3 add %eax,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c42: 8b 45 0c mov 0xc(%ebp),%eax 80100c45: 5a pop %edx sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c46: 83 e3 fc and $0xfffffffc,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c49: ff 34 b8 pushl (%eax,%edi,4) 80100c4c: e8 5f 3b 00 00 call 801047b0 <strlen> 80100c51: 83 c0 01 add $0x1,%eax 80100c54: 50 push %eax 80100c55: 8b 45 0c mov 0xc(%ebp),%eax 80100c58: ff 34 b8 pushl (%eax,%edi,4) 80100c5b: 53 push %ebx 80100c5c: 56 push %esi 80100c5d: e8 3e 6a 00 00 call 801076a0 <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 d4 69 00 00 call 801076a0 <copyout> 80100ccc: 83 c4 10 add $0x10,%esp 80100ccf: 85 c0 test %eax,%eax 80100cd1: 0f 88 e1 fe ff ff js 80100bb8 <exec+0x1a8> for(last=s=path; *s; s++) 80100cd7: 8b 45 08 mov 0x8(%ebp),%eax 80100cda: 0f b6 00 movzbl (%eax),%eax 80100cdd: 84 c0 test %al,%al 80100cdf: 74 17 je 80100cf8 <exec+0x2e8> 80100ce1: 8b 55 08 mov 0x8(%ebp),%edx 80100ce4: 89 d1 mov %edx,%ecx 80100ce6: 83 c1 01 add $0x1,%ecx 80100ce9: 3c 2f cmp $0x2f,%al 80100ceb: 0f b6 01 movzbl (%ecx),%eax 80100cee: 0f 44 d1 cmove %ecx,%edx 80100cf1: 84 c0 test %al,%al 80100cf3: 75 f1 jne 80100ce6 <exec+0x2d6> 80100cf5: 89 55 08 mov %edx,0x8(%ebp) safestrcpy(curproc->name, last, sizeof(curproc->name)); 80100cf8: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi 80100cfe: 50 push %eax 80100cff: 6a 10 push $0x10 80100d01: ff 75 08 pushl 0x8(%ebp) 80100d04: 89 f8 mov %edi,%eax 80100d06: 83 c0 6c add $0x6c,%eax 80100d09: 50 push %eax 80100d0a: e8 61 3a 00 00 call 80104770 <safestrcpy> curproc->pgdir = pgdir; 80100d0f: 8b 95 f0 fe ff ff mov -0x110(%ebp),%edx oldpgdir = curproc->pgdir; 80100d15: 89 f9 mov %edi,%ecx 80100d17: 8b 7f 04 mov 0x4(%edi),%edi curproc->tf->eip = elf.entry; // main 80100d1a: 8b 41 18 mov 0x18(%ecx),%eax curproc->sz = sz; 80100d1d: 89 31 mov %esi,(%ecx) curproc->pgdir = pgdir; 80100d1f: 89 51 04 mov %edx,0x4(%ecx) curproc->tf->eip = elf.entry; // main 80100d22: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 80100d28: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 80100d2b: 8b 41 18 mov 0x18(%ecx),%eax 80100d2e: 89 58 44 mov %ebx,0x44(%eax) curproc->priority = 10; 80100d31: c7 41 7c 0a 00 00 00 movl $0xa,0x7c(%ecx) switchuvm(curproc); 80100d38: 89 0c 24 mov %ecx,(%esp) 80100d3b: e8 30 63 00 00 call 80107070 <switchuvm> freevm(oldpgdir); 80100d40: 89 3c 24 mov %edi,(%esp) 80100d43: e8 d8 66 00 00 call 80107420 <freevm> return 0; 80100d48: 83 c4 10 add $0x10,%esp 80100d4b: 31 c0 xor %eax,%eax 80100d4d: e9 2a fd ff ff jmp 80100a7c <exec+0x6c> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100d52: be 00 20 00 00 mov $0x2000,%esi 80100d57: e9 35 fe ff ff jmp 80100b91 <exec+0x181> 80100d5c: 66 90 xchg %ax,%ax 80100d5e: 66 90 xchg %ax,%ax 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 cd 77 10 80 push $0x801077cd 80100d6b: 68 c0 0f 11 80 push $0x80110fc0 80100d70: e8 cb 35 00 00 call 80104340 <initlock> } 80100d75: 83 c4 10 add $0x10,%esp 80100d78: c9 leave 80100d79: c3 ret 80100d7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100d80 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80100d80: 55 push %ebp 80100d81: 89 e5 mov %esp,%ebp 80100d83: 53 push %ebx struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d84: bb f4 0f 11 80 mov $0x80110ff4,%ebx { 80100d89: 83 ec 10 sub $0x10,%esp acquire(&ftable.lock); 80100d8c: 68 c0 0f 11 80 push $0x80110fc0 80100d91: e8 ea 36 00 00 call 80104480 <acquire> 80100d96: 83 c4 10 add $0x10,%esp 80100d99: eb 10 jmp 80100dab <filealloc+0x2b> 80100d9b: 90 nop 80100d9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100da0: 83 c3 18 add $0x18,%ebx 80100da3: 81 fb 54 19 11 80 cmp $0x80111954,%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 0f 11 80 push $0x80110fc0 80100dc1: e8 7a 37 00 00 call 80104540 <release> return f; } } release(&ftable.lock); return 0; } 80100dc6: 89 d8 mov %ebx,%eax return f; 80100dc8: 83 c4 10 add $0x10,%esp } 80100dcb: 8b 5d fc mov -0x4(%ebp),%ebx 80100dce: c9 leave 80100dcf: c3 ret release(&ftable.lock); 80100dd0: 83 ec 0c sub $0xc,%esp return 0; 80100dd3: 31 db xor %ebx,%ebx release(&ftable.lock); 80100dd5: 68 c0 0f 11 80 push $0x80110fc0 80100dda: e8 61 37 00 00 call 80104540 <release> } 80100ddf: 89 d8 mov %ebx,%eax return 0; 80100de1: 83 c4 10 add $0x10,%esp } 80100de4: 8b 5d fc mov -0x4(%ebp),%ebx 80100de7: c9 leave 80100de8: c3 ret 80100de9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100df0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80100df0: 55 push %ebp 80100df1: 89 e5 mov %esp,%ebp 80100df3: 53 push %ebx 80100df4: 83 ec 10 sub $0x10,%esp 80100df7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 80100dfa: 68 c0 0f 11 80 push $0x80110fc0 80100dff: e8 7c 36 00 00 call 80104480 <acquire> if(f->ref < 1) 80100e04: 8b 43 04 mov 0x4(%ebx),%eax 80100e07: 83 c4 10 add $0x10,%esp 80100e0a: 85 c0 test %eax,%eax 80100e0c: 7e 1a jle 80100e28 <filedup+0x38> panic("filedup"); f->ref++; 80100e0e: 83 c0 01 add $0x1,%eax release(&ftable.lock); 80100e11: 83 ec 0c sub $0xc,%esp f->ref++; 80100e14: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 80100e17: 68 c0 0f 11 80 push $0x80110fc0 80100e1c: e8 1f 37 00 00 call 80104540 <release> return f; } 80100e21: 89 d8 mov %ebx,%eax 80100e23: 8b 5d fc mov -0x4(%ebp),%ebx 80100e26: c9 leave 80100e27: c3 ret panic("filedup"); 80100e28: 83 ec 0c sub $0xc,%esp 80100e2b: 68 d4 77 10 80 push $0x801077d4 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 0f 11 80 push $0x80110fc0 80100e51: e8 2a 36 00 00 call 80104480 <acquire> if(f->ref < 1) 80100e56: 8b 43 04 mov 0x4(%ebx),%eax 80100e59: 83 c4 10 add $0x10,%esp 80100e5c: 85 c0 test %eax,%eax 80100e5e: 0f 8e 9b 00 00 00 jle 80100eff <fileclose+0xbf> panic("fileclose"); if(--f->ref > 0){ 80100e64: 83 e8 01 sub $0x1,%eax 80100e67: 85 c0 test %eax,%eax 80100e69: 89 43 04 mov %eax,0x4(%ebx) 80100e6c: 74 1a je 80100e88 <fileclose+0x48> release(&ftable.lock); 80100e6e: c7 45 08 c0 0f 11 80 movl $0x80110fc0,0x8(%ebp) else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); } } 80100e75: 8d 65 f4 lea -0xc(%ebp),%esp 80100e78: 5b pop %ebx 80100e79: 5e pop %esi 80100e7a: 5f pop %edi 80100e7b: 5d pop %ebp release(&ftable.lock); 80100e7c: e9 bf 36 00 00 jmp 80104540 <release> 80100e81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ff = *f; 80100e88: 0f b6 43 09 movzbl 0x9(%ebx),%eax 80100e8c: 8b 3b mov (%ebx),%edi release(&ftable.lock); 80100e8e: 83 ec 0c sub $0xc,%esp ff = *f; 80100e91: 8b 73 0c mov 0xc(%ebx),%esi f->type = FD_NONE; 80100e94: c7 03 00 00 00 00 movl $0x0,(%ebx) ff = *f; 80100e9a: 88 45 e7 mov %al,-0x19(%ebp) 80100e9d: 8b 43 10 mov 0x10(%ebx),%eax release(&ftable.lock); 80100ea0: 68 c0 0f 11 80 push $0x80110fc0 ff = *f; 80100ea5: 89 45 e0 mov %eax,-0x20(%ebp) release(&ftable.lock); 80100ea8: e8 93 36 00 00 call 80104540 <release> if(ff.type == FD_PIPE) 80100ead: 83 c4 10 add $0x10,%esp 80100eb0: 83 ff 01 cmp $0x1,%edi 80100eb3: 74 13 je 80100ec8 <fileclose+0x88> else if(ff.type == FD_INODE){ 80100eb5: 83 ff 02 cmp $0x2,%edi 80100eb8: 74 26 je 80100ee0 <fileclose+0xa0> } 80100eba: 8d 65 f4 lea -0xc(%ebp),%esp 80100ebd: 5b pop %ebx 80100ebe: 5e pop %esi 80100ebf: 5f pop %edi 80100ec0: 5d pop %ebp 80100ec1: c3 ret 80100ec2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pipeclose(ff.pipe, ff.writable); 80100ec8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 80100ecc: 83 ec 08 sub $0x8,%esp 80100ecf: 53 push %ebx 80100ed0: 56 push %esi 80100ed1: e8 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 dc 77 10 80 push $0x801077dc 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 e6 77 10 80 push $0x801077e6 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 ef 77 10 80 push $0x801077ef 801010fa: e8 91 f2 ff ff call 80100390 <panic> panic("filewrite"); 801010ff: 83 ec 0c sub $0xc,%esp 80101102: 68 f5 77 10 80 push $0x801077f5 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 19 11 80 add 0x801119d8,%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 ff 77 10 80 push $0x801077ff 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 19 11 80 mov 0x801119c0,%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 19 11 80 add 0x801119d8,%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 19 11 80 mov 0x801119c0,%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 19 11 80 cmp %eax,0x801119c0 8010121f: 77 80 ja 801011a1 <balloc+0x21> panic("balloc: out of blocks"); 80101221: 83 ec 0c sub $0xc,%esp 80101224: 68 12 78 10 80 push $0x80107812 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 26 33 00 00 call 80104590 <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 1a 11 80 mov $0x80111a14,%ebx { 8010129f: 83 ec 28 sub $0x28,%esp 801012a2: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 801012a5: 68 e0 19 11 80 push $0x801119e0 801012aa: e8 d1 31 00 00 call 80104480 <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 36 11 80 cmp $0x80113634,%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 36 11 80 cmp $0x80113634,%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 19 11 80 push $0x801119e0 8010130f: e8 2c 32 00 00 call 80104540 <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 19 11 80 push $0x801119e0 ip->ref++; 8010133a: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 8010133d: e8 fe 31 00 00 call 80104540 <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 28 78 10 80 push $0x80107828 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 38 78 10 80 push $0x80107838 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 da 31 00 00 call 80104640 <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 1a 11 80 mov $0x80111a20,%ebx 80101489: 83 ec 0c sub $0xc,%esp initlock(&icache.lock, "icache"); 8010148c: 68 4b 78 10 80 push $0x8010784b 80101491: 68 e0 19 11 80 push $0x801119e0 80101496: e8 a5 2e 00 00 call 80104340 <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 52 78 10 80 push $0x80107852 801014a8: 53 push %ebx 801014a9: 81 c3 90 00 00 00 add $0x90,%ebx 801014af: e8 5c 2d 00 00 call 80104210 <initsleeplock> for(i = 0; i < NINODE; i++) { 801014b4: 83 c4 10 add $0x10,%esp 801014b7: 81 fb 40 36 11 80 cmp $0x80113640,%ebx 801014bd: 75 e1 jne 801014a0 <iinit+0x20> readsb(dev, &sb); 801014bf: 83 ec 08 sub $0x8,%esp 801014c2: 68 c0 19 11 80 push $0x801119c0 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 19 11 80 pushl 0x801119d8 801014d5: ff 35 d4 19 11 80 pushl 0x801119d4 801014db: ff 35 d0 19 11 80 pushl 0x801119d0 801014e1: ff 35 cc 19 11 80 pushl 0x801119cc 801014e7: ff 35 c8 19 11 80 pushl 0x801119c8 801014ed: ff 35 c4 19 11 80 pushl 0x801119c4 801014f3: ff 35 c0 19 11 80 pushl 0x801119c0 801014f9: 68 b8 78 10 80 push $0x801078b8 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 19 11 80 01 cmpl $0x1,0x801119c8 { 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 19 11 80 cmp %ebx,0x801119c8 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 19 11 80 add 0x801119d4,%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 fd 2f 00 00 call 80104590 <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 58 78 10 80 push $0x80107858 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 19 11 80 add 0x801119d4,%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 0a 30 00 00 call 80104640 <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 19 11 80 push $0x801119e0 8010165f: e8 1c 2e 00 00 call 80104480 <acquire> ip->ref++; 80101664: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80101668: c7 04 24 e0 19 11 80 movl $0x801119e0,(%esp) 8010166f: e8 cc 2e 00 00 call 80104540 <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 a9 2b 00 00 call 80104250 <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 19 11 80 add 0x801119d4,%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 23 2f 00 00 call 80104640 <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 70 78 10 80 push $0x80107870 80101742: e8 49 ec ff ff call 80100390 <panic> panic("ilock"); 80101747: 83 ec 0c sub $0xc,%esp 8010174a: 68 6a 78 10 80 push $0x8010786a 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 78 2b 00 00 call 801042f0 <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 1c 2b 00 00 jmp 801042b0 <releasesleep> panic("iunlock"); 80101794: 83 ec 0c sub $0xc,%esp 80101797: 68 7f 78 10 80 push $0x8010787f 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 8b 2a 00 00 call 80104250 <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 d1 2a 00 00 call 801042b0 <releasesleep> acquire(&icache.lock); 801017df: c7 04 24 e0 19 11 80 movl $0x801119e0,(%esp) 801017e6: e8 95 2c 00 00 call 80104480 <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 19 11 80 movl $0x801119e0,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 3b 2d 00 00 jmp 80104540 <release> 80101805: 8d 76 00 lea 0x0(%esi),%esi acquire(&icache.lock); 80101808: 83 ec 0c sub $0xc,%esp 8010180b: 68 e0 19 11 80 push $0x801119e0 80101810: e8 6b 2c 00 00 call 80104480 <acquire> int r = ip->ref; 80101815: 8b 73 08 mov 0x8(%ebx),%esi release(&icache.lock); 80101818: c7 04 24 e0 19 11 80 movl $0x801119e0,(%esp) 8010181f: e8 1c 2d 00 00 call 80104540 <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 34 2c 00 00 call 80104640 <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 19 11 80 mov -0x7feee6a0(,%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 38 2b 00 00 call 80104640 <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 19 11 80 mov -0x7feee69c(,%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 0d 2b 00 00 call 801046b0 <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 ae 2a 00 00 call 801046b0 <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 99 78 10 80 push $0x80107899 80101c47: e8 44 e7 ff ff call 80100390 <panic> panic("dirlookup not DIR"); 80101c4c: 83 ec 0c sub $0xc,%esp 80101c4f: 68 87 78 10 80 push $0x80107887 80101c54: e8 37 e7 ff ff call 80100390 <panic> 80101c59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101c60 <namex>: // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80101c60: 55 push %ebp 80101c61: 89 e5 mov %esp,%ebp 80101c63: 57 push %edi 80101c64: 56 push %esi 80101c65: 53 push %ebx 80101c66: 89 cf mov %ecx,%edi 80101c68: 89 c3 mov %eax,%ebx 80101c6a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if(*path == '/') 80101c6d: 80 38 2f cmpb $0x2f,(%eax) { 80101c70: 89 55 e0 mov %edx,-0x20(%ebp) if(*path == '/') 80101c73: 0f 84 67 01 00 00 je 80101de0 <namex+0x180> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c79: e8 62 1b 00 00 call 801037e0 <myproc> acquire(&icache.lock); 80101c7e: 83 ec 0c sub $0xc,%esp ip = idup(myproc()->cwd); 80101c81: 8b 70 68 mov 0x68(%eax),%esi acquire(&icache.lock); 80101c84: 68 e0 19 11 80 push $0x801119e0 80101c89: e8 f2 27 00 00 call 80104480 <acquire> ip->ref++; 80101c8e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101c92: c7 04 24 e0 19 11 80 movl $0x801119e0,(%esp) 80101c99: e8 a2 28 00 00 call 80104540 <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 46 29 00 00 call 80104640 <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 b3 28 00 00 call 80104640 <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 8e 28 00 00 call 80104710 <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 a8 78 10 80 push $0x801078a8 80101ec0: e8 cb e4 ff ff call 80100390 <panic> panic("dirlink"); 80101ec5: 83 ec 0c sub $0xc,%esp 80101ec8: 68 0e 7f 10 80 push $0x80107f0e 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 14 79 10 80 push $0x80107914 80101fe0: e8 ab e3 ff ff call 80100390 <panic> panic("idestart"); 80101fe5: 83 ec 0c sub $0xc,%esp 80101fe8: 68 0b 79 10 80 push $0x8010790b 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 26 79 10 80 push $0x80107926 8010200b: 68 80 b5 10 80 push $0x8010b580 80102010: e8 2b 23 00 00 call 80104340 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80102015: 58 pop %eax 80102016: a1 e0 38 11 80 mov 0x801138e0,%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 b5 10 80 01 movl $0x1,0x8010b560 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 b5 10 80 push $0x8010b580 8010208e: e8 ed 23 00 00 call 80104480 <acquire> if((b = idequeue) == 0){ 80102093: 8b 1d 64 b5 10 80 mov 0x8010b564,%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 b5 10 80 mov %eax,0x8010b564 // 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 5a 1e 00 00 call 80103f50 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 801020f6: a1 64 b5 10 80 mov 0x8010b564,%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 b5 10 80 push $0x8010b580 8010210f: e8 2c 24 00 00 call 80104540 <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 bd 21 00 00 call 801042f0 <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 b5 10 80 mov 0x8010b560,%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 b5 10 80 push $0x8010b580 80102168: e8 13 23 00 00 call 80104480 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010216d: 8b 15 64 b5 10 80 mov 0x8010b564,%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 b5 10 80 cmp %ebx,0x8010b564 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 b5 10 80 push $0x8010b580 801021b8: 53 push %ebx 801021b9: e8 e2 1b 00 00 call 80103da0 <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 b5 10 80 movl $0x8010b580,0x8(%ebp) } 801021d2: 8b 5d fc mov -0x4(%ebp),%ebx 801021d5: c9 leave release(&idelock); 801021d6: e9 65 23 00 00 jmp 80104540 <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 b5 10 80 mov $0x8010b564,%edx 801021f5: eb 9d jmp 80102194 <iderw+0x74> panic("iderw: nothing to do"); 801021f7: 83 ec 0c sub $0xc,%esp 801021fa: 68 40 79 10 80 push $0x80107940 801021ff: e8 8c e1 ff ff call 80100390 <panic> panic("iderw: buf not locked"); 80102204: 83 ec 0c sub $0xc,%esp 80102207: 68 2a 79 10 80 push $0x8010792a 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 55 79 10 80 push $0x80107955 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 36 11 80 00 movl $0xfec00000,0x80113634 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 36 11 80 mov 0x80113634,%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 36 11 80 mov 0x80113634,%ecx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 8010224d: 0f b6 15 60 37 11 80 movzbl 0x80113760,%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 74 79 10 80 push $0x80107974 8010226c: e8 ef e3 ff ff call 80100660 <cprintf> 80102271: 8b 0d 34 36 11 80 mov 0x80113634,%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 36 11 80 mov 0x80113634,%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 36 11 80 mov 0x80113634,%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 36 11 80 mov 0x80113634,%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 36 11 80 mov 0x80113634,%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 36 11 80 mov 0x80113634,%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 88 61 11 80 cmp $0x80116188,%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 49 22 00 00 call 80104590 <memset> if(kmem.use_lock) 80102347: 8b 15 74 36 11 80 mov 0x80113674,%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 36 11 80 mov 0x80113678,%eax 80102359: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 8010235b: a1 74 36 11 80 mov 0x80113674,%eax kmem.freelist = r; 80102360: 89 1d 78 36 11 80 mov %ebx,0x80113678 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 36 11 80 movl $0x80113640,0x8(%ebp) } 80102377: 8b 5d fc mov -0x4(%ebp),%ebx 8010237a: c9 leave release(&kmem.lock); 8010237b: e9 c0 21 00 00 jmp 80104540 <release> acquire(&kmem.lock); 80102380: 83 ec 0c sub $0xc,%esp 80102383: 68 40 36 11 80 push $0x80113640 80102388: e8 f3 20 00 00 call 80104480 <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 a6 79 10 80 push $0x801079a6 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 ac 79 10 80 push $0x801079ac 80102400: 68 40 36 11 80 push $0x80113640 80102405: e8 36 1f 00 00 call 80104340 <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 36 11 80 00 movl $0x0,0x80113674 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 36 11 80 01 movl $0x1,0x80113674 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 36 11 80 mov 0x80113674,%eax 801024c5: 85 c0 test %eax,%eax 801024c7: 75 1f jne 801024e8 <kalloc+0x28> acquire(&kmem.lock); r = kmem.freelist; 801024c9: a1 78 36 11 80 mov 0x80113678,%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 36 11 80 mov %edx,0x80113678 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 36 11 80 push $0x80113640 801024f3: e8 88 1f 00 00 call 80104480 <acquire> r = kmem.freelist; 801024f8: a1 78 36 11 80 mov 0x80113678,%eax if(r) 801024fd: 83 c4 10 add $0x10,%esp 80102500: 8b 15 74 36 11 80 mov 0x80113674,%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 36 11 80 mov %ecx,0x80113678 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 36 11 80 push $0x80113640 80102521: e8 1a 20 00 00 call 80104540 <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 b5 10 80 mov 0x8010b5b4,%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 e0 7a 10 80 movzbl -0x7fef8520(%edx),%eax 8010257a: 09 c1 or %eax,%ecx shift ^= togglecode[data]; 8010257c: 0f b6 82 e0 79 10 80 movzbl -0x7fef8620(%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 b5 10 80 mov %ecx,0x8010b5b4 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 c0 79 10 80 mov -0x7fef8640(,%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 e0 7a 10 80 movzbl -0x7fef8520(%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 b5 10 80 mov %ecx,0x8010b5b4 } 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 b5 10 80 mov %ecx,0x8010b5b4 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 36 11 80 mov 0x8011367c,%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 36 11 80 mov 0x8011367c,%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 36 11 80 mov 0x8011367c,%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 36 11 80 mov 0x8011367c,%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 a4 1c 00 00 call 801045e0 <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 36 11 80 mov 0x801136c8,%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 36 11 80 mov 0x801136b4,%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 36 11 80 pushl 0x801136c4 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 36 11 80 pushl -0x7feec934(,%ebx,4) 80102a44: ff 35 c4 36 11 80 pushl 0x801136c4 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 d7 1b 00 00 call 80104640 <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 36 11 80 cmp %ebx,0x801136c8 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 36 11 80 pushl 0x801136b4 80102aae: ff 35 c4 36 11 80 pushl 0x801136c4 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 36 11 80 mov 0x801136c8,%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 36 11 80 mov -0x7feec934(%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 e0 7b 10 80 push $0x80107be0 80102b0f: 68 80 36 11 80 push $0x80113680 80102b14: e8 27 18 00 00 call 80104340 <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 36 11 80 mov %ebx,0x801136c4 log.size = sb.nlog; 80102b32: 89 15 b8 36 11 80 mov %edx,0x801136b8 log.start = sb.logstart; 80102b38: a3 b4 36 11 80 mov %eax,0x801136b4 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 36 11 80 mov %ebx,0x801136c8 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 36 11 80 mov %ecx,-0x7feec938(%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 36 11 80 00 movl $0x0,0x801136c8 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 36 11 80 push $0x80113680 80102bab: e8 d0 18 00 00 call 80104480 <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 36 11 80 push $0x80113680 80102bc0: 68 80 36 11 80 push $0x80113680 80102bc5: e8 d6 11 00 00 call 80103da0 <sleep> 80102bca: 83 c4 10 add $0x10,%esp if(log.committing){ 80102bcd: a1 c0 36 11 80 mov 0x801136c0,%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 36 11 80 mov 0x801136bc,%eax 80102bdb: 8b 15 c8 36 11 80 mov 0x801136c8,%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 36 11 80 mov %eax,0x801136bc release(&log.lock); 80102bf7: 68 80 36 11 80 push $0x80113680 80102bfc: e8 3f 19 00 00 call 80104540 <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 36 11 80 push $0x80113680 80102c1e: e8 5d 18 00 00 call 80104480 <acquire> log.outstanding -= 1; 80102c23: a1 bc 36 11 80 mov 0x801136bc,%eax if(log.committing) 80102c28: 8b 35 c0 36 11 80 mov 0x801136c0,%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 36 11 80 mov %ebx,0x801136bc 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 36 11 80 01 movl $0x1,0x801136c0 80102c54: 00 00 00 release(&log.lock); 80102c57: 68 80 36 11 80 push $0x80113680 80102c5c: e8 df 18 00 00 call 80104540 <release> } static void commit() { if (log.lh.n > 0) { 80102c61: 8b 0d c8 36 11 80 mov 0x801136c8,%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 36 11 80 mov 0x801136b4,%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 36 11 80 pushl 0x801136c4 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 36 11 80 pushl -0x7feec934(,%ebx,4) 80102c96: ff 35 c4 36 11 80 pushl 0x801136c4 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 85 19 00 00 call 80104640 <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 36 11 80 cmp 0x801136c8,%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 36 11 80 00 movl $0x0,0x801136c8 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 36 11 80 push $0x80113680 80102cff: e8 7c 17 00 00 call 80104480 <acquire> wakeup(&log); 80102d04: c7 04 24 80 36 11 80 movl $0x80113680,(%esp) log.committing = 0; 80102d0b: c7 05 c0 36 11 80 00 movl $0x0,0x801136c0 80102d12: 00 00 00 wakeup(&log); 80102d15: e8 36 12 00 00 call 80103f50 <wakeup> release(&log.lock); 80102d1a: c7 04 24 80 36 11 80 movl $0x80113680,(%esp) 80102d21: e8 1a 18 00 00 call 80104540 <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 36 11 80 push $0x80113680 80102d40: e8 0b 12 00 00 call 80103f50 <wakeup> release(&log.lock); 80102d45: c7 04 24 80 36 11 80 movl $0x80113680,(%esp) 80102d4c: e8 ef 17 00 00 call 80104540 <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 e4 7b 10 80 push $0x80107be4 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 36 11 80 mov 0x801136c8,%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 36 11 80 mov 0x801136b8,%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 36 11 80 mov 0x801136bc,%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 36 11 80 push $0x80113680 80102dae: e8 cd 16 00 00 call 80104480 <acquire> for (i = 0; i < log.lh.n; i++) { 80102db3: 8b 0d c8 36 11 80 mov 0x801136c8,%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 36 11 80 cmp 0x801136cc,%edx 80102dcc: 75 0b jne 80102dd9 <log_write+0x69> 80102dce: eb 38 jmp 80102e08 <log_write+0x98> 80102dd0: 39 14 85 cc 36 11 80 cmp %edx,-0x7feec934(,%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 36 11 80 mov %edx,-0x7feec934(,%eax,4) if (i == log.lh.n) log.lh.n++; 80102de7: 83 c0 01 add $0x1,%eax 80102dea: a3 c8 36 11 80 mov %eax,0x801136c8 b->flags |= B_DIRTY; // prevent eviction 80102def: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102df2: c7 45 08 80 36 11 80 movl $0x80113680,0x8(%ebp) } 80102df9: 8b 5d fc mov -0x4(%ebp),%ebx 80102dfc: c9 leave release(&log.lock); 80102dfd: e9 3e 17 00 00 jmp 80104540 <release> 80102e02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = b->blockno; 80102e08: 89 14 85 cc 36 11 80 mov %edx,-0x7feec934(,%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 36 11 80 mov %eax,0x801136cc 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 f3 7b 10 80 push $0x80107bf3 80102e2e: e8 5d d5 ff ff call 80100390 <panic> panic("log_write outside of trans"); 80102e33: 83 ec 0c sub $0xc,%esp 80102e36: 68 09 7c 10 80 push $0x80107c09 80102e3b: e8 50 d5 ff ff call 80100390 <panic> 80102e40 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102e40: 55 push %ebp 80102e41: 89 e5 mov %esp,%ebp 80102e43: 53 push %ebx 80102e44: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102e47: e8 74 09 00 00 call 801037c0 <cpuid> 80102e4c: 89 c3 mov %eax,%ebx 80102e4e: e8 6d 09 00 00 call 801037c0 <cpuid> 80102e53: 83 ec 04 sub $0x4,%esp 80102e56: 53 push %ebx 80102e57: 50 push %eax 80102e58: 68 24 7c 10 80 push $0x80107c24 80102e5d: e8 fe d7 ff ff call 80100660 <cprintf> idtinit(); // load idt register 80102e62: e8 f9 30 00 00 call 80105f60 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102e67: e8 e4 08 00 00 call 80103750 <mycpu> 80102e6c: 89 c2 mov %eax,%edx xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 80102e6e: b8 01 00 00 00 mov $0x1,%eax 80102e73: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102e7a: e8 21 0c 00 00 call 80103aa0 <scheduler> 80102e7f: 90 nop 80102e80 <mpenter>: { 80102e80: 55 push %ebp 80102e81: 89 e5 mov %esp,%ebp 80102e83: 83 ec 08 sub $0x8,%esp switchkvm(); 80102e86: e8 c5 41 00 00 call 80107050 <switchkvm> seginit(); 80102e8b: e8 30 41 00 00 call 80106fc0 <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 88 61 11 80 push $0x80116188 80102ebc: e8 2f f5 ff ff call 801023f0 <kinit1> kvmalloc(); // kernel page table 80102ec1: e8 5a 46 00 00 call 80107520 <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 eb 40 00 00 call 80106fc0 <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 a7 33 00 00 call 80106290 <uartinit> pinit(); // process table 80102ee9: e8 42 08 00 00 call 80103730 <pinit> tvinit(); // trap vectors 80102eee: e8 ed 2f 00 00 call 80105ee0 <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 b4 10 80 push $0x8010b48c 80102f0f: 68 00 70 00 80 push $0x80007000 80102f14: e8 27 17 00 00 call 80104640 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80102f19: 69 05 e0 38 11 80 b0 imul $0xb0,0x801138e0,%eax 80102f20: 00 00 00 80102f23: 83 c4 10 add $0x10,%esp 80102f26: 05 80 37 11 80 add $0x80113780,%eax 80102f2b: 3d 80 37 11 80 cmp $0x80113780,%eax 80102f30: 76 71 jbe 80102fa3 <main+0x103> 80102f32: bb 80 37 11 80 mov $0x80113780,%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 0b 08 00 00 call 80103750 <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 $0x10a000,0x80006ff4 80102f64: a0 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 e0 38 11 80 b0 imul $0xb0,0x801138e0,%eax 80102f91: 00 00 00 80102f94: 81 c3 b0 00 00 00 add $0xb0,%ebx 80102f9a: 05 80 37 11 80 add $0x80113780,%eax 80102f9f: 39 c3 cmp %eax,%ebx 80102fa1: 72 9d jb 80102f40 <main+0xa0> kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 80102fa3: 83 ec 08 sub $0x8,%esp 80102fa6: 68 00 00 00 8e push $0x8e000000 80102fab: 68 00 00 40 80 push $0x80400000 80102fb0: e8 ab f4 ff ff call 80102460 <kinit2> userinit(); // first user process 80102fb5: e8 56 08 00 00 call 80103810 <userinit> mpmain(); // finish this processor's setup 80102fba: e8 81 fe ff ff call 80102e40 <mpmain> 80102fbf: 90 nop 80102fc0 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102fc0: 55 push %ebp 80102fc1: 89 e5 mov %esp,%ebp 80102fc3: 57 push %edi 80102fc4: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80102fc5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi { 80102fcb: 53 push %ebx e = addr+len; 80102fcc: 8d 1c 16 lea (%esi,%edx,1),%ebx { 80102fcf: 83 ec 0c sub $0xc,%esp for(p = addr; p < e; p += sizeof(struct mp)) 80102fd2: 39 de cmp %ebx,%esi 80102fd4: 72 10 jb 80102fe6 <mpsearch1+0x26> 80102fd6: eb 50 jmp 80103028 <mpsearch1+0x68> 80102fd8: 90 nop 80102fd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102fe0: 39 fb cmp %edi,%ebx 80102fe2: 89 fe mov %edi,%esi 80102fe4: 76 42 jbe 80103028 <mpsearch1+0x68> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102fe6: 83 ec 04 sub $0x4,%esp 80102fe9: 8d 7e 10 lea 0x10(%esi),%edi 80102fec: 6a 04 push $0x4 80102fee: 68 38 7c 10 80 push $0x80107c38 80102ff3: 56 push %esi 80102ff4: e8 e7 15 00 00 call 801045e0 <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 55 7c 10 80 push $0x80107c55 801030b1: 56 push %esi 801030b2: e8 29 15 00 00 call 801045e0 <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 36 11 80 mov %eax,0x8011367c 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 7c 7c 10 80 jmp *-0x7fef8384(,%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 e0 38 11 80 mov 0x801138e0,%ecx 8010318e: 83 f9 01 cmp $0x1,%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 e0 38 11 80 mov %ecx,0x801138e0 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801031a6: 88 97 80 37 11 80 mov %dl,-0x7feec880(%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 37 11 80 mov %dl,0x80113760 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 3d 7c 10 80 push $0x80107c3d 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 5c 7c 10 80 push $0x80107c5c 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 90 7c 10 80 push $0x80107c90 80103300: 50 push %eax 80103301: e8 3a 10 00 00 call 80104340 <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 1c 11 00 00 call 80104480 <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 cc 0b 00 00 call 80103f50 <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 97 11 00 00 jmp 80104540 <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 87 0b 00 00 call 80103f50 <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 67 11 00 00 call 80104540 <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 7e 10 00 00 call 80104480 <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 f7 0a 00 00 call 80103f50 <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 3e 09 00 00 call 80103da0 <sleep> while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103462: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103468: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010346e: 83 c4 10 add $0x10,%esp 80103471: 05 00 02 00 00 add $0x200,%eax 80103476: 39 c2 cmp %eax,%edx 80103478: 75 36 jne 801034b0 <pipewrite+0xc0> if(p->readopen == 0 || myproc()->killed){ 8010347a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 80103480: 85 c0 test %eax,%eax 80103482: 74 0c je 80103490 <pipewrite+0xa0> 80103484: e8 57 03 00 00 call 801037e0 <myproc> 80103489: 8b 40 24 mov 0x24(%eax),%eax 8010348c: 85 c0 test %eax,%eax 8010348e: 74 c0 je 80103450 <pipewrite+0x60> release(&p->lock); 80103490: 83 ec 0c sub $0xc,%esp 80103493: 53 push %ebx 80103494: e8 a7 10 00 00 call 80104540 <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 68 0a 00 00 call 80103f50 <wakeup> release(&p->lock); 801034e8: 89 1c 24 mov %ebx,(%esp) 801034eb: e8 50 10 00 00 call 80104540 <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 6b 0f 00 00 call 80104480 <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 56 08 00 00 call 80103da0 <sleep> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 8010354a: 83 c4 10 add $0x10,%esp 8010354d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80103553: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103559: 75 35 jne 80103590 <piperead+0x90> 8010355b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 80103561: 85 d2 test %edx,%edx 80103563: 0f 84 8f 00 00 00 je 801035f8 <piperead+0xf8> if(myproc()->killed){ 80103569: e8 72 02 00 00 call 801037e0 <myproc> 8010356e: 8b 48 24 mov 0x24(%eax),%ecx 80103571: 85 c9 test %ecx,%ecx 80103573: 74 cb je 80103540 <piperead+0x40> release(&p->lock); 80103575: 83 ec 0c sub $0xc,%esp return -1; 80103578: bb ff ff ff ff mov $0xffffffff,%ebx release(&p->lock); 8010357d: 56 push %esi 8010357e: e8 bd 0f 00 00 call 80104540 <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 74 09 00 00 call 80103f50 <wakeup> release(&p->lock); 801035dc: 89 34 24 mov %esi,(%esp) 801035df: e8 5c 0f 00 00 call 80104540 <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 34 39 11 80 mov $0x80113934,%ebx { 80103609: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); 8010360c: 68 00 39 11 80 push $0x80113900 80103611: e8 6a 0e 00 00 call 80104480 <acquire> 80103616: 83 c4 10 add $0x10,%esp 80103619: eb 14 jmp 8010362f <allocproc+0x2f> 8010361b: 90 nop 8010361c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103620: 83 eb 80 sub $0xffffff80,%ebx 80103623: 81 fb 34 59 11 80 cmp $0x80115934,%ebx 80103629: 0f 83 89 00 00 00 jae 801036b8 <allocproc+0xb8> if(p->state == UNUSED) 8010362f: 8b 43 0c mov 0xc(%ebx),%eax 80103632: 85 c0 test %eax,%eax 80103634: 75 ea jne 80103620 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 80103636: a1 04 b0 10 80 mov 0x8010b004,%eax p->priority = 10; release(&ptable.lock); 8010363b: 83 ec 0c sub $0xc,%esp p->state = EMBRYO; 8010363e: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->priority = 10; 80103645: c7 43 7c 0a 00 00 00 movl $0xa,0x7c(%ebx) p->pid = nextpid++; 8010364c: 8d 50 01 lea 0x1(%eax),%edx 8010364f: 89 43 10 mov %eax,0x10(%ebx) release(&ptable.lock); 80103652: 68 00 39 11 80 push $0x80113900 p->pid = nextpid++; 80103657: 89 15 04 b0 10 80 mov %edx,0x8010b004 release(&ptable.lock); 8010365d: e8 de 0e 00 00 call 80104540 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103662: e8 59 ee ff ff call 801024c0 <kalloc> 80103667: 83 c4 10 add $0x10,%esp 8010366a: 85 c0 test %eax,%eax 8010366c: 89 43 08 mov %eax,0x8(%ebx) 8010366f: 74 60 je 801036d1 <allocproc+0xd1> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103671: 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); 80103677: 83 ec 04 sub $0x4,%esp sp -= sizeof *p->context; 8010367a: 05 9c 0f 00 00 add $0xf9c,%eax sp -= sizeof *p->tf; 8010367f: 89 53 18 mov %edx,0x18(%ebx) *(uint*)sp = (uint)trapret; 80103682: c7 40 14 cf 5e 10 80 movl $0x80105ecf,0x14(%eax) p->context = (struct context*)sp; 80103689: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 8010368c: 6a 14 push $0x14 8010368e: 6a 00 push $0x0 80103690: 50 push %eax 80103691: e8 fa 0e 00 00 call 80104590 <memset> p->context->eip = (uint)forkret; 80103696: 8b 43 1c mov 0x1c(%ebx),%eax p->priority = 5; //default priority return p; 80103699: 83 c4 10 add $0x10,%esp p->context->eip = (uint)forkret; 8010369c: c7 40 10 e0 36 10 80 movl $0x801036e0,0x10(%eax) p->priority = 5; //default priority 801036a3: c7 43 7c 05 00 00 00 movl $0x5,0x7c(%ebx) } 801036aa: 89 d8 mov %ebx,%eax 801036ac: 8b 5d fc mov -0x4(%ebp),%ebx 801036af: c9 leave 801036b0: c3 ret 801036b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&ptable.lock); 801036b8: 83 ec 0c sub $0xc,%esp return 0; 801036bb: 31 db xor %ebx,%ebx release(&ptable.lock); 801036bd: 68 00 39 11 80 push $0x80113900 801036c2: e8 79 0e 00 00 call 80104540 <release> } 801036c7: 89 d8 mov %ebx,%eax return 0; 801036c9: 83 c4 10 add $0x10,%esp } 801036cc: 8b 5d fc mov -0x4(%ebp),%ebx 801036cf: c9 leave 801036d0: c3 ret p->state = UNUSED; 801036d1: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 801036d8: 31 db xor %ebx,%ebx 801036da: eb ce jmp 801036aa <allocproc+0xaa> 801036dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801036e0 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 801036e0: 55 push %ebp 801036e1: 89 e5 mov %esp,%ebp 801036e3: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 801036e6: 68 00 39 11 80 push $0x80113900 801036eb: e8 50 0e 00 00 call 80104540 <release> if (first) { 801036f0: a1 00 b0 10 80 mov 0x8010b000,%eax 801036f5: 83 c4 10 add $0x10,%esp 801036f8: 85 c0 test %eax,%eax 801036fa: 75 04 jne 80103700 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 801036fc: c9 leave 801036fd: c3 ret 801036fe: 66 90 xchg %ax,%ax iinit(ROOTDEV); 80103700: 83 ec 0c sub $0xc,%esp first = 0; 80103703: c7 05 00 b0 10 80 00 movl $0x0,0x8010b000 8010370a: 00 00 00 iinit(ROOTDEV); 8010370d: 6a 01 push $0x1 8010370f: e8 6c dd ff ff call 80101480 <iinit> initlog(ROOTDEV); 80103714: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010371b: e8 e0 f3 ff ff call 80102b00 <initlog> 80103720: 83 c4 10 add $0x10,%esp } 80103723: c9 leave 80103724: c3 ret 80103725: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103730 <pinit>: { 80103730: 55 push %ebp 80103731: 89 e5 mov %esp,%ebp 80103733: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 80103736: 68 95 7c 10 80 push $0x80107c95 8010373b: 68 00 39 11 80 push $0x80113900 80103740: e8 fb 0b 00 00 call 80104340 <initlock> } 80103745: 83 c4 10 add $0x10,%esp 80103748: c9 leave 80103749: c3 ret 8010374a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103750 <mycpu>: { 80103750: 55 push %ebp 80103751: 89 e5 mov %esp,%ebp 80103753: 83 ec 08 sub $0x8,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103756: 9c pushf 80103757: 58 pop %eax if(readeflags()&FL_IF) 80103758: f6 c4 02 test $0x2,%ah 8010375b: 75 4a jne 801037a7 <mycpu+0x57> apicid = lapicid(); 8010375d: e8 ce ef ff ff call 80102730 <lapicid> for (i = 0; i < ncpu; ++i) { 80103762: 8b 15 e0 38 11 80 mov 0x801138e0,%edx 80103768: 85 d2 test %edx,%edx 8010376a: 7e 1b jle 80103787 <mycpu+0x37> if (cpus[i].apicid == apicid) 8010376c: 0f b6 0d 80 37 11 80 movzbl 0x80113780,%ecx 80103773: 39 c8 cmp %ecx,%eax 80103775: 74 21 je 80103798 <mycpu+0x48> for (i = 0; i < ncpu; ++i) { 80103777: 83 fa 01 cmp $0x1,%edx 8010377a: 74 0b je 80103787 <mycpu+0x37> if (cpus[i].apicid == apicid) 8010377c: 0f b6 15 30 38 11 80 movzbl 0x80113830,%edx 80103783: 39 d0 cmp %edx,%eax 80103785: 74 19 je 801037a0 <mycpu+0x50> panic("unknown apicid\n"); 80103787: 83 ec 0c sub $0xc,%esp 8010378a: 68 9c 7c 10 80 push $0x80107c9c 8010378f: e8 fc cb ff ff call 80100390 <panic> 80103794: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (cpus[i].apicid == apicid) 80103798: b8 80 37 11 80 mov $0x80113780,%eax } 8010379d: c9 leave 8010379e: c3 ret 8010379f: 90 nop if (cpus[i].apicid == apicid) 801037a0: b8 30 38 11 80 mov $0x80113830,%eax } 801037a5: c9 leave 801037a6: c3 ret panic("mycpu called with interrupts enabled\n"); 801037a7: 83 ec 0c sub $0xc,%esp 801037aa: 68 c4 7d 10 80 push $0x80107dc4 801037af: e8 dc cb ff ff call 80100390 <panic> 801037b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801037ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801037c0 <cpuid>: cpuid() { 801037c0: 55 push %ebp 801037c1: 89 e5 mov %esp,%ebp 801037c3: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 801037c6: e8 85 ff ff ff call 80103750 <mycpu> 801037cb: 2d 80 37 11 80 sub $0x80113780,%eax } 801037d0: c9 leave return mycpu()-cpus; 801037d1: c1 f8 04 sar $0x4,%eax 801037d4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 801037da: c3 ret 801037db: 90 nop 801037dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801037e0 <myproc>: myproc(void) { 801037e0: 55 push %ebp 801037e1: 89 e5 mov %esp,%ebp 801037e3: 53 push %ebx 801037e4: 83 ec 04 sub $0x4,%esp pushcli(); 801037e7: e8 c4 0b 00 00 call 801043b0 <pushcli> c = mycpu(); 801037ec: e8 5f ff ff ff call 80103750 <mycpu> p = c->proc; 801037f1: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801037f7: e8 f4 0b 00 00 call 801043f0 <popcli> } 801037fc: 83 c4 04 add $0x4,%esp 801037ff: 89 d8 mov %ebx,%eax 80103801: 5b pop %ebx 80103802: 5d pop %ebp 80103803: c3 ret 80103804: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010380a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103810 <userinit>: { 80103810: 55 push %ebp 80103811: 89 e5 mov %esp,%ebp 80103813: 53 push %ebx 80103814: 83 ec 04 sub $0x4,%esp p = allocproc(); 80103817: e8 e4 fd ff ff call 80103600 <allocproc> 8010381c: 89 c3 mov %eax,%ebx initproc = p; 8010381e: a3 b8 b5 10 80 mov %eax,0x8010b5b8 if((p->pgdir = setupkvm()) == 0) 80103823: e8 78 3c 00 00 call 801074a0 <setupkvm> 80103828: 85 c0 test %eax,%eax 8010382a: 89 43 04 mov %eax,0x4(%ebx) 8010382d: 0f 84 bd 00 00 00 je 801038f0 <userinit+0xe0> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 80103833: 83 ec 04 sub $0x4,%esp 80103836: 68 2c 00 00 00 push $0x2c 8010383b: 68 60 b4 10 80 push $0x8010b460 80103840: 50 push %eax 80103841: e8 3a 39 00 00 call 80107180 <inituvm> memset(p->tf, 0, sizeof(*p->tf)); 80103846: 83 c4 0c add $0xc,%esp p->sz = PGSIZE; 80103849: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 8010384f: 6a 4c push $0x4c 80103851: 6a 00 push $0x0 80103853: ff 73 18 pushl 0x18(%ebx) 80103856: e8 35 0d 00 00 call 80104590 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010385b: 8b 43 18 mov 0x18(%ebx),%eax 8010385e: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80103863: b9 23 00 00 00 mov $0x23,%ecx safestrcpy(p->name, "initcode", sizeof(p->name)); 80103868: 83 c4 0c add $0xc,%esp p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010386b: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010386f: 8b 43 18 mov 0x18(%ebx),%eax 80103872: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 80103876: 8b 43 18 mov 0x18(%ebx),%eax 80103879: 0f b7 50 2c movzwl 0x2c(%eax),%edx 8010387d: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 80103881: 8b 43 18 mov 0x18(%ebx),%eax 80103884: 0f b7 50 2c movzwl 0x2c(%eax),%edx 80103888: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 8010388c: 8b 43 18 mov 0x18(%ebx),%eax 8010388f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 80103896: 8b 43 18 mov 0x18(%ebx),%eax 80103899: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 801038a0: 8b 43 18 mov 0x18(%ebx),%eax 801038a3: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 801038aa: 8d 43 6c lea 0x6c(%ebx),%eax 801038ad: 6a 10 push $0x10 801038af: 68 c5 7c 10 80 push $0x80107cc5 801038b4: 50 push %eax 801038b5: e8 b6 0e 00 00 call 80104770 <safestrcpy> p->cwd = namei("/"); 801038ba: c7 04 24 ce 7c 10 80 movl $0x80107cce,(%esp) 801038c1: e8 1a e6 ff ff call 80101ee0 <namei> 801038c6: 89 43 68 mov %eax,0x68(%ebx) acquire(&ptable.lock); 801038c9: c7 04 24 00 39 11 80 movl $0x80113900,(%esp) 801038d0: e8 ab 0b 00 00 call 80104480 <acquire> p->state = RUNNABLE; 801038d5: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 801038dc: c7 04 24 00 39 11 80 movl $0x80113900,(%esp) 801038e3: e8 58 0c 00 00 call 80104540 <release> } 801038e8: 83 c4 10 add $0x10,%esp 801038eb: 8b 5d fc mov -0x4(%ebp),%ebx 801038ee: c9 leave 801038ef: c3 ret panic("userinit: out of memory?"); 801038f0: 83 ec 0c sub $0xc,%esp 801038f3: 68 ac 7c 10 80 push $0x80107cac 801038f8: e8 93 ca ff ff call 80100390 <panic> 801038fd: 8d 76 00 lea 0x0(%esi),%esi 80103900 <growproc>: { 80103900: 55 push %ebp 80103901: 89 e5 mov %esp,%ebp 80103903: 56 push %esi 80103904: 53 push %ebx 80103905: 8b 75 08 mov 0x8(%ebp),%esi pushcli(); 80103908: e8 a3 0a 00 00 call 801043b0 <pushcli> c = mycpu(); 8010390d: e8 3e fe ff ff call 80103750 <mycpu> p = c->proc; 80103912: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103918: e8 d3 0a 00 00 call 801043f0 <popcli> if(n > 0){ 8010391d: 83 fe 00 cmp $0x0,%esi sz = curproc->sz; 80103920: 8b 03 mov (%ebx),%eax if(n > 0){ 80103922: 7f 1c jg 80103940 <growproc+0x40> } else if(n < 0){ 80103924: 75 3a jne 80103960 <growproc+0x60> switchuvm(curproc); 80103926: 83 ec 0c sub $0xc,%esp curproc->sz = sz; 80103929: 89 03 mov %eax,(%ebx) switchuvm(curproc); 8010392b: 53 push %ebx 8010392c: e8 3f 37 00 00 call 80107070 <switchuvm> return 0; 80103931: 83 c4 10 add $0x10,%esp 80103934: 31 c0 xor %eax,%eax } 80103936: 8d 65 f8 lea -0x8(%ebp),%esp 80103939: 5b pop %ebx 8010393a: 5e pop %esi 8010393b: 5d pop %ebp 8010393c: c3 ret 8010393d: 8d 76 00 lea 0x0(%esi),%esi if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103940: 83 ec 04 sub $0x4,%esp 80103943: 01 c6 add %eax,%esi 80103945: 56 push %esi 80103946: 50 push %eax 80103947: ff 73 04 pushl 0x4(%ebx) 8010394a: e8 71 39 00 00 call 801072c0 <allocuvm> 8010394f: 83 c4 10 add $0x10,%esp 80103952: 85 c0 test %eax,%eax 80103954: 75 d0 jne 80103926 <growproc+0x26> return -1; 80103956: b8 ff ff ff ff mov $0xffffffff,%eax 8010395b: eb d9 jmp 80103936 <growproc+0x36> 8010395d: 8d 76 00 lea 0x0(%esi),%esi if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103960: 83 ec 04 sub $0x4,%esp 80103963: 01 c6 add %eax,%esi 80103965: 56 push %esi 80103966: 50 push %eax 80103967: ff 73 04 pushl 0x4(%ebx) 8010396a: e8 81 3a 00 00 call 801073f0 <deallocuvm> 8010396f: 83 c4 10 add $0x10,%esp 80103972: 85 c0 test %eax,%eax 80103974: 75 b0 jne 80103926 <growproc+0x26> 80103976: eb de jmp 80103956 <growproc+0x56> 80103978: 90 nop 80103979: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103980 <fork>: { 80103980: 55 push %ebp 80103981: 89 e5 mov %esp,%ebp 80103983: 57 push %edi 80103984: 56 push %esi 80103985: 53 push %ebx 80103986: 83 ec 1c sub $0x1c,%esp pushcli(); 80103989: e8 22 0a 00 00 call 801043b0 <pushcli> c = mycpu(); 8010398e: e8 bd fd ff ff call 80103750 <mycpu> p = c->proc; 80103993: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103999: e8 52 0a 00 00 call 801043f0 <popcli> if((np = allocproc()) == 0){ 8010399e: e8 5d fc ff ff call 80103600 <allocproc> 801039a3: 85 c0 test %eax,%eax 801039a5: 89 45 e4 mov %eax,-0x1c(%ebp) 801039a8: 0f 84 b7 00 00 00 je 80103a65 <fork+0xe5> if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 801039ae: 83 ec 08 sub $0x8,%esp 801039b1: ff 33 pushl (%ebx) 801039b3: ff 73 04 pushl 0x4(%ebx) 801039b6: 89 c7 mov %eax,%edi 801039b8: e8 b3 3b 00 00 call 80107570 <copyuvm> 801039bd: 83 c4 10 add $0x10,%esp 801039c0: 85 c0 test %eax,%eax 801039c2: 89 47 04 mov %eax,0x4(%edi) 801039c5: 0f 84 a1 00 00 00 je 80103a6c <fork+0xec> np->sz = curproc->sz; 801039cb: 8b 03 mov (%ebx),%eax 801039cd: 8b 4d e4 mov -0x1c(%ebp),%ecx 801039d0: 89 01 mov %eax,(%ecx) np->parent = curproc; 801039d2: 89 59 14 mov %ebx,0x14(%ecx) 801039d5: 89 c8 mov %ecx,%eax *np->tf = *curproc->tf; 801039d7: 8b 79 18 mov 0x18(%ecx),%edi 801039da: 8b 73 18 mov 0x18(%ebx),%esi 801039dd: b9 13 00 00 00 mov $0x13,%ecx 801039e2: f3 a5 rep movsl %ds:(%esi),%es:(%edi) for(i = 0; i < NOFILE; i++) 801039e4: 31 f6 xor %esi,%esi np->tf->eax = 0; 801039e6: 8b 40 18 mov 0x18(%eax),%eax 801039e9: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) if(curproc->ofile[i]) 801039f0: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 801039f4: 85 c0 test %eax,%eax 801039f6: 74 13 je 80103a0b <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 801039f8: 83 ec 0c sub $0xc,%esp 801039fb: 50 push %eax 801039fc: e8 ef d3 ff ff call 80100df0 <filedup> 80103a01: 8b 55 e4 mov -0x1c(%ebp),%edx 80103a04: 83 c4 10 add $0x10,%esp 80103a07: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) for(i = 0; i < NOFILE; i++) 80103a0b: 83 c6 01 add $0x1,%esi 80103a0e: 83 fe 10 cmp $0x10,%esi 80103a11: 75 dd jne 801039f0 <fork+0x70> np->cwd = idup(curproc->cwd); 80103a13: 83 ec 0c sub $0xc,%esp 80103a16: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a19: 83 c3 6c add $0x6c,%ebx np->cwd = idup(curproc->cwd); 80103a1c: e8 2f dc ff ff call 80101650 <idup> 80103a21: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a24: 83 c4 0c add $0xc,%esp np->cwd = idup(curproc->cwd); 80103a27: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a2a: 8d 47 6c lea 0x6c(%edi),%eax 80103a2d: 6a 10 push $0x10 80103a2f: 53 push %ebx 80103a30: 50 push %eax 80103a31: e8 3a 0d 00 00 call 80104770 <safestrcpy> pid = np->pid; 80103a36: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 80103a39: c7 04 24 00 39 11 80 movl $0x80113900,(%esp) 80103a40: e8 3b 0a 00 00 call 80104480 <acquire> np->state = RUNNABLE; 80103a45: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 80103a4c: c7 04 24 00 39 11 80 movl $0x80113900,(%esp) 80103a53: e8 e8 0a 00 00 call 80104540 <release> return pid; 80103a58: 83 c4 10 add $0x10,%esp } 80103a5b: 8d 65 f4 lea -0xc(%ebp),%esp 80103a5e: 89 d8 mov %ebx,%eax 80103a60: 5b pop %ebx 80103a61: 5e pop %esi 80103a62: 5f pop %edi 80103a63: 5d pop %ebp 80103a64: c3 ret return -1; 80103a65: bb ff ff ff ff mov $0xffffffff,%ebx 80103a6a: eb ef jmp 80103a5b <fork+0xdb> kfree(np->kstack); 80103a6c: 8b 5d e4 mov -0x1c(%ebp),%ebx 80103a6f: 83 ec 0c sub $0xc,%esp 80103a72: ff 73 08 pushl 0x8(%ebx) 80103a75: e8 96 e8 ff ff call 80102310 <kfree> np->kstack = 0; 80103a7a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) np->state = UNUSED; 80103a81: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return -1; 80103a88: 83 c4 10 add $0x10,%esp 80103a8b: bb ff ff ff ff mov $0xffffffff,%ebx 80103a90: eb c9 jmp 80103a5b <fork+0xdb> 80103a92: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103a99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103aa0 <scheduler>: { 80103aa0: 55 push %ebp 80103aa1: 89 e5 mov %esp,%ebp 80103aa3: 57 push %edi 80103aa4: 56 push %esi 80103aa5: 53 push %ebx 80103aa6: 83 ec 0c sub $0xc,%esp struct cpu *c = mycpu(); 80103aa9: e8 a2 fc ff ff call 80103750 <mycpu> 80103aae: 8d 70 04 lea 0x4(%eax),%esi 80103ab1: 89 c3 mov %eax,%ebx c->proc = 0; 80103ab3: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103aba: 00 00 00 asm volatile("sti"); 80103abd: fb sti acquire(&ptable.lock); 80103abe: 83 ec 0c sub $0xc,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103ac1: bf 34 39 11 80 mov $0x80113934,%edi acquire(&ptable.lock); 80103ac6: 68 00 39 11 80 push $0x80113900 80103acb: e8 b0 09 00 00 call 80104480 <acquire> 80103ad0: 83 c4 10 add $0x10,%esp 80103ad3: eb 0e jmp 80103ae3 <scheduler+0x43> 80103ad5: 8d 76 00 lea 0x0(%esi),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103ad8: 83 ef 80 sub $0xffffff80,%edi 80103adb: 81 ff 34 59 11 80 cmp $0x80115934,%edi 80103ae1: 73 64 jae 80103b47 <scheduler+0xa7> if(p->state != RUNNABLE) 80103ae3: 83 7f 0c 03 cmpl $0x3,0xc(%edi) 80103ae7: 75 ef jne 80103ad8 <scheduler+0x38> for(p1 = ptable.proc; p1 < &ptable.proc[NPROC]; p1++) { 80103ae9: b8 34 39 11 80 mov $0x80113934,%eax 80103aee: 66 90 xchg %ax,%ax if (p1->state != RUNNABLE) 80103af0: 83 78 0c 03 cmpl $0x3,0xc(%eax) 80103af4: 75 09 jne 80103aff <scheduler+0x5f> if(highP->priority > p1->priority) 80103af6: 8b 50 7c mov 0x7c(%eax),%edx 80103af9: 39 57 7c cmp %edx,0x7c(%edi) 80103afc: 0f 4f f8 cmovg %eax,%edi for(p1 = ptable.proc; p1 < &ptable.proc[NPROC]; p1++) { 80103aff: 83 e8 80 sub $0xffffff80,%eax 80103b02: 3d 34 59 11 80 cmp $0x80115934,%eax 80103b07: 72 e7 jb 80103af0 <scheduler+0x50> switchuvm(p); 80103b09: 83 ec 0c sub $0xc,%esp c->proc = p; 80103b0c: 89 bb ac 00 00 00 mov %edi,0xac(%ebx) switchuvm(p); 80103b12: 57 push %edi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103b13: 83 ef 80 sub $0xffffff80,%edi switchuvm(p); 80103b16: e8 55 35 00 00 call 80107070 <switchuvm> p->state = RUNNING; 80103b1b: c7 47 8c 04 00 00 00 movl $0x4,-0x74(%edi) swtch(&(c->scheduler), p->context); 80103b22: 58 pop %eax 80103b23: 5a pop %edx 80103b24: ff 77 9c pushl -0x64(%edi) 80103b27: 56 push %esi 80103b28: e8 9e 0c 00 00 call 801047cb <swtch> switchkvm(); 80103b2d: e8 1e 35 00 00 call 80107050 <switchkvm> c->proc = 0; 80103b32: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103b35: 81 ff 34 59 11 80 cmp $0x80115934,%edi c->proc = 0; 80103b3b: c7 83 ac 00 00 00 00 movl $0x0,0xac(%ebx) 80103b42: 00 00 00 for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103b45: 72 9c jb 80103ae3 <scheduler+0x43> release(&ptable.lock); 80103b47: 83 ec 0c sub $0xc,%esp 80103b4a: 68 00 39 11 80 push $0x80113900 80103b4f: e8 ec 09 00 00 call 80104540 <release> for(;;){ 80103b54: 83 c4 10 add $0x10,%esp 80103b57: e9 61 ff ff ff jmp 80103abd <scheduler+0x1d> 80103b5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103b60 <sched>: { 80103b60: 55 push %ebp 80103b61: 89 e5 mov %esp,%ebp 80103b63: 56 push %esi 80103b64: 53 push %ebx pushcli(); 80103b65: e8 46 08 00 00 call 801043b0 <pushcli> c = mycpu(); 80103b6a: e8 e1 fb ff ff call 80103750 <mycpu> p = c->proc; 80103b6f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103b75: e8 76 08 00 00 call 801043f0 <popcli> if(!holding(&ptable.lock)) 80103b7a: 83 ec 0c sub $0xc,%esp 80103b7d: 68 00 39 11 80 push $0x80113900 80103b82: e8 c9 08 00 00 call 80104450 <holding> 80103b87: 83 c4 10 add $0x10,%esp 80103b8a: 85 c0 test %eax,%eax 80103b8c: 74 4f je 80103bdd <sched+0x7d> if(mycpu()->ncli != 1) 80103b8e: e8 bd fb ff ff call 80103750 <mycpu> 80103b93: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103b9a: 75 68 jne 80103c04 <sched+0xa4> if(p->state == RUNNING) 80103b9c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80103ba0: 74 55 je 80103bf7 <sched+0x97> asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103ba2: 9c pushf 80103ba3: 58 pop %eax if(readeflags()&FL_IF) 80103ba4: f6 c4 02 test $0x2,%ah 80103ba7: 75 41 jne 80103bea <sched+0x8a> intena = mycpu()->intena; 80103ba9: e8 a2 fb ff ff call 80103750 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103bae: 83 c3 1c add $0x1c,%ebx intena = mycpu()->intena; 80103bb1: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103bb7: e8 94 fb ff ff call 80103750 <mycpu> 80103bbc: 83 ec 08 sub $0x8,%esp 80103bbf: ff 70 04 pushl 0x4(%eax) 80103bc2: 53 push %ebx 80103bc3: e8 03 0c 00 00 call 801047cb <swtch> mycpu()->intena = intena; 80103bc8: e8 83 fb ff ff call 80103750 <mycpu> } 80103bcd: 83 c4 10 add $0x10,%esp mycpu()->intena = intena; 80103bd0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103bd6: 8d 65 f8 lea -0x8(%ebp),%esp 80103bd9: 5b pop %ebx 80103bda: 5e pop %esi 80103bdb: 5d pop %ebp 80103bdc: c3 ret panic("sched ptable.lock"); 80103bdd: 83 ec 0c sub $0xc,%esp 80103be0: 68 d0 7c 10 80 push $0x80107cd0 80103be5: e8 a6 c7 ff ff call 80100390 <panic> panic("sched interruptible"); 80103bea: 83 ec 0c sub $0xc,%esp 80103bed: 68 fc 7c 10 80 push $0x80107cfc 80103bf2: e8 99 c7 ff ff call 80100390 <panic> panic("sched running"); 80103bf7: 83 ec 0c sub $0xc,%esp 80103bfa: 68 ee 7c 10 80 push $0x80107cee 80103bff: e8 8c c7 ff ff call 80100390 <panic> panic("sched locks"); 80103c04: 83 ec 0c sub $0xc,%esp 80103c07: 68 e2 7c 10 80 push $0x80107ce2 80103c0c: e8 7f c7 ff ff call 80100390 <panic> 80103c11: eb 0d jmp 80103c20 <exit> 80103c13: 90 nop 80103c14: 90 nop 80103c15: 90 nop 80103c16: 90 nop 80103c17: 90 nop 80103c18: 90 nop 80103c19: 90 nop 80103c1a: 90 nop 80103c1b: 90 nop 80103c1c: 90 nop 80103c1d: 90 nop 80103c1e: 90 nop 80103c1f: 90 nop 80103c20 <exit>: { 80103c20: 55 push %ebp 80103c21: 89 e5 mov %esp,%ebp 80103c23: 57 push %edi 80103c24: 56 push %esi 80103c25: 53 push %ebx 80103c26: 83 ec 0c sub $0xc,%esp pushcli(); 80103c29: e8 82 07 00 00 call 801043b0 <pushcli> c = mycpu(); 80103c2e: e8 1d fb ff ff call 80103750 <mycpu> p = c->proc; 80103c33: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103c39: e8 b2 07 00 00 call 801043f0 <popcli> if(curproc == initproc) 80103c3e: 39 35 b8 b5 10 80 cmp %esi,0x8010b5b8 80103c44: 8d 5e 28 lea 0x28(%esi),%ebx 80103c47: 8d 7e 68 lea 0x68(%esi),%edi 80103c4a: 0f 84 e7 00 00 00 je 80103d37 <exit+0x117> if(curproc->ofile[fd]){ 80103c50: 8b 03 mov (%ebx),%eax 80103c52: 85 c0 test %eax,%eax 80103c54: 74 12 je 80103c68 <exit+0x48> fileclose(curproc->ofile[fd]); 80103c56: 83 ec 0c sub $0xc,%esp 80103c59: 50 push %eax 80103c5a: e8 e1 d1 ff ff call 80100e40 <fileclose> curproc->ofile[fd] = 0; 80103c5f: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103c65: 83 c4 10 add $0x10,%esp 80103c68: 83 c3 04 add $0x4,%ebx for(fd = 0; fd < NOFILE; fd++){ 80103c6b: 39 fb cmp %edi,%ebx 80103c6d: 75 e1 jne 80103c50 <exit+0x30> begin_op(); 80103c6f: e8 2c ef ff ff call 80102ba0 <begin_op> iput(curproc->cwd); 80103c74: 83 ec 0c sub $0xc,%esp 80103c77: ff 76 68 pushl 0x68(%esi) 80103c7a: e8 31 db ff ff call 801017b0 <iput> end_op(); 80103c7f: e8 8c ef ff ff call 80102c10 <end_op> curproc->cwd = 0; 80103c84: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103c8b: c7 04 24 00 39 11 80 movl $0x80113900,(%esp) 80103c92: e8 e9 07 00 00 call 80104480 <acquire> wakeup1(curproc->parent); 80103c97: 8b 56 14 mov 0x14(%esi),%edx 80103c9a: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c9d: b8 34 39 11 80 mov $0x80113934,%eax 80103ca2: eb 0e jmp 80103cb2 <exit+0x92> 80103ca4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103ca8: 83 e8 80 sub $0xffffff80,%eax 80103cab: 3d 34 59 11 80 cmp $0x80115934,%eax 80103cb0: 73 1c jae 80103cce <exit+0xae> if(p->state == SLEEPING && p->chan == chan) 80103cb2: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103cb6: 75 f0 jne 80103ca8 <exit+0x88> 80103cb8: 3b 50 20 cmp 0x20(%eax),%edx 80103cbb: 75 eb jne 80103ca8 <exit+0x88> p->state = RUNNABLE; 80103cbd: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103cc4: 83 e8 80 sub $0xffffff80,%eax 80103cc7: 3d 34 59 11 80 cmp $0x80115934,%eax 80103ccc: 72 e4 jb 80103cb2 <exit+0x92> p->parent = initproc; 80103cce: 8b 0d b8 b5 10 80 mov 0x8010b5b8,%ecx for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103cd4: ba 34 39 11 80 mov $0x80113934,%edx 80103cd9: eb 10 jmp 80103ceb <exit+0xcb> 80103cdb: 90 nop 80103cdc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103ce0: 83 ea 80 sub $0xffffff80,%edx 80103ce3: 81 fa 34 59 11 80 cmp $0x80115934,%edx 80103ce9: 73 33 jae 80103d1e <exit+0xfe> if(p->parent == curproc){ 80103ceb: 39 72 14 cmp %esi,0x14(%edx) 80103cee: 75 f0 jne 80103ce0 <exit+0xc0> if(p->state == ZOMBIE) 80103cf0: 83 7a 0c 05 cmpl $0x5,0xc(%edx) p->parent = initproc; 80103cf4: 89 4a 14 mov %ecx,0x14(%edx) if(p->state == ZOMBIE) 80103cf7: 75 e7 jne 80103ce0 <exit+0xc0> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103cf9: b8 34 39 11 80 mov $0x80113934,%eax 80103cfe: eb 0a jmp 80103d0a <exit+0xea> 80103d00: 83 e8 80 sub $0xffffff80,%eax 80103d03: 3d 34 59 11 80 cmp $0x80115934,%eax 80103d08: 73 d6 jae 80103ce0 <exit+0xc0> if(p->state == SLEEPING && p->chan == chan) 80103d0a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103d0e: 75 f0 jne 80103d00 <exit+0xe0> 80103d10: 3b 48 20 cmp 0x20(%eax),%ecx 80103d13: 75 eb jne 80103d00 <exit+0xe0> p->state = RUNNABLE; 80103d15: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103d1c: eb e2 jmp 80103d00 <exit+0xe0> curproc->state = ZOMBIE; 80103d1e: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80103d25: e8 36 fe ff ff call 80103b60 <sched> panic("zombie exit"); 80103d2a: 83 ec 0c sub $0xc,%esp 80103d2d: 68 1d 7d 10 80 push $0x80107d1d 80103d32: e8 59 c6 ff ff call 80100390 <panic> panic("init exiting"); 80103d37: 83 ec 0c sub $0xc,%esp 80103d3a: 68 10 7d 10 80 push $0x80107d10 80103d3f: e8 4c c6 ff ff call 80100390 <panic> 80103d44: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103d4a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103d50 <yield>: { 80103d50: 55 push %ebp 80103d51: 89 e5 mov %esp,%ebp 80103d53: 53 push %ebx 80103d54: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80103d57: 68 00 39 11 80 push $0x80113900 80103d5c: e8 1f 07 00 00 call 80104480 <acquire> pushcli(); 80103d61: e8 4a 06 00 00 call 801043b0 <pushcli> c = mycpu(); 80103d66: e8 e5 f9 ff ff call 80103750 <mycpu> p = c->proc; 80103d6b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d71: e8 7a 06 00 00 call 801043f0 <popcli> myproc()->state = RUNNABLE; 80103d76: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 80103d7d: e8 de fd ff ff call 80103b60 <sched> release(&ptable.lock); 80103d82: c7 04 24 00 39 11 80 movl $0x80113900,(%esp) 80103d89: e8 b2 07 00 00 call 80104540 <release> } 80103d8e: 83 c4 10 add $0x10,%esp 80103d91: 8b 5d fc mov -0x4(%ebp),%ebx 80103d94: c9 leave 80103d95: c3 ret 80103d96: 8d 76 00 lea 0x0(%esi),%esi 80103d99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103da0 <sleep>: { 80103da0: 55 push %ebp 80103da1: 89 e5 mov %esp,%ebp 80103da3: 57 push %edi 80103da4: 56 push %esi 80103da5: 53 push %ebx 80103da6: 83 ec 0c sub $0xc,%esp 80103da9: 8b 7d 08 mov 0x8(%ebp),%edi 80103dac: 8b 75 0c mov 0xc(%ebp),%esi pushcli(); 80103daf: e8 fc 05 00 00 call 801043b0 <pushcli> c = mycpu(); 80103db4: e8 97 f9 ff ff call 80103750 <mycpu> p = c->proc; 80103db9: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103dbf: e8 2c 06 00 00 call 801043f0 <popcli> if(p == 0) 80103dc4: 85 db test %ebx,%ebx 80103dc6: 0f 84 87 00 00 00 je 80103e53 <sleep+0xb3> if(lk == 0) 80103dcc: 85 f6 test %esi,%esi 80103dce: 74 76 je 80103e46 <sleep+0xa6> if(lk != &ptable.lock){ //DOC: sleeplock0 80103dd0: 81 fe 00 39 11 80 cmp $0x80113900,%esi 80103dd6: 74 50 je 80103e28 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 80103dd8: 83 ec 0c sub $0xc,%esp 80103ddb: 68 00 39 11 80 push $0x80113900 80103de0: e8 9b 06 00 00 call 80104480 <acquire> release(lk); 80103de5: 89 34 24 mov %esi,(%esp) 80103de8: e8 53 07 00 00 call 80104540 <release> p->chan = chan; 80103ded: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103df0: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103df7: e8 64 fd ff ff call 80103b60 <sched> p->chan = 0; 80103dfc: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) release(&ptable.lock); 80103e03: c7 04 24 00 39 11 80 movl $0x80113900,(%esp) 80103e0a: e8 31 07 00 00 call 80104540 <release> acquire(lk); 80103e0f: 89 75 08 mov %esi,0x8(%ebp) 80103e12: 83 c4 10 add $0x10,%esp } 80103e15: 8d 65 f4 lea -0xc(%ebp),%esp 80103e18: 5b pop %ebx 80103e19: 5e pop %esi 80103e1a: 5f pop %edi 80103e1b: 5d pop %ebp acquire(lk); 80103e1c: e9 5f 06 00 00 jmp 80104480 <acquire> 80103e21: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->chan = chan; 80103e28: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103e2b: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103e32: e8 29 fd ff ff call 80103b60 <sched> p->chan = 0; 80103e37: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) } 80103e3e: 8d 65 f4 lea -0xc(%ebp),%esp 80103e41: 5b pop %ebx 80103e42: 5e pop %esi 80103e43: 5f pop %edi 80103e44: 5d pop %ebp 80103e45: c3 ret panic("sleep without lk"); 80103e46: 83 ec 0c sub $0xc,%esp 80103e49: 68 2f 7d 10 80 push $0x80107d2f 80103e4e: e8 3d c5 ff ff call 80100390 <panic> panic("sleep"); 80103e53: 83 ec 0c sub $0xc,%esp 80103e56: 68 29 7d 10 80 push $0x80107d29 80103e5b: e8 30 c5 ff ff call 80100390 <panic> 80103e60 <wait>: { 80103e60: 55 push %ebp 80103e61: 89 e5 mov %esp,%ebp 80103e63: 56 push %esi 80103e64: 53 push %ebx pushcli(); 80103e65: e8 46 05 00 00 call 801043b0 <pushcli> c = mycpu(); 80103e6a: e8 e1 f8 ff ff call 80103750 <mycpu> p = c->proc; 80103e6f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103e75: e8 76 05 00 00 call 801043f0 <popcli> acquire(&ptable.lock); 80103e7a: 83 ec 0c sub $0xc,%esp 80103e7d: 68 00 39 11 80 push $0x80113900 80103e82: e8 f9 05 00 00 call 80104480 <acquire> 80103e87: 83 c4 10 add $0x10,%esp havekids = 0; 80103e8a: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e8c: bb 34 39 11 80 mov $0x80113934,%ebx 80103e91: eb 10 jmp 80103ea3 <wait+0x43> 80103e93: 90 nop 80103e94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103e98: 83 eb 80 sub $0xffffff80,%ebx 80103e9b: 81 fb 34 59 11 80 cmp $0x80115934,%ebx 80103ea1: 73 1b jae 80103ebe <wait+0x5e> if(p->parent != curproc) 80103ea3: 39 73 14 cmp %esi,0x14(%ebx) 80103ea6: 75 f0 jne 80103e98 <wait+0x38> if(p->state == ZOMBIE){ 80103ea8: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 80103eac: 74 32 je 80103ee0 <wait+0x80> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103eae: 83 eb 80 sub $0xffffff80,%ebx havekids = 1; 80103eb1: b8 01 00 00 00 mov $0x1,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103eb6: 81 fb 34 59 11 80 cmp $0x80115934,%ebx 80103ebc: 72 e5 jb 80103ea3 <wait+0x43> if(!havekids || curproc->killed){ 80103ebe: 85 c0 test %eax,%eax 80103ec0: 74 74 je 80103f36 <wait+0xd6> 80103ec2: 8b 46 24 mov 0x24(%esi),%eax 80103ec5: 85 c0 test %eax,%eax 80103ec7: 75 6d jne 80103f36 <wait+0xd6> sleep(curproc, &ptable.lock); //DOC: wait-sleep 80103ec9: 83 ec 08 sub $0x8,%esp 80103ecc: 68 00 39 11 80 push $0x80113900 80103ed1: 56 push %esi 80103ed2: e8 c9 fe ff ff call 80103da0 <sleep> havekids = 0; 80103ed7: 83 c4 10 add $0x10,%esp 80103eda: eb ae jmp 80103e8a <wait+0x2a> 80103edc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(p->kstack); 80103ee0: 83 ec 0c sub $0xc,%esp 80103ee3: ff 73 08 pushl 0x8(%ebx) pid = p->pid; 80103ee6: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 80103ee9: e8 22 e4 ff ff call 80102310 <kfree> freevm(p->pgdir); 80103eee: 5a pop %edx 80103eef: ff 73 04 pushl 0x4(%ebx) p->kstack = 0; 80103ef2: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80103ef9: e8 22 35 00 00 call 80107420 <freevm> release(&ptable.lock); 80103efe: c7 04 24 00 39 11 80 movl $0x80113900,(%esp) p->pid = 0; 80103f05: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 80103f0c: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 80103f13: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 80103f17: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 80103f1e: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80103f25: e8 16 06 00 00 call 80104540 <release> return pid; 80103f2a: 83 c4 10 add $0x10,%esp } 80103f2d: 8d 65 f8 lea -0x8(%ebp),%esp 80103f30: 89 f0 mov %esi,%eax 80103f32: 5b pop %ebx 80103f33: 5e pop %esi 80103f34: 5d pop %ebp 80103f35: c3 ret release(&ptable.lock); 80103f36: 83 ec 0c sub $0xc,%esp return -1; 80103f39: be ff ff ff ff mov $0xffffffff,%esi release(&ptable.lock); 80103f3e: 68 00 39 11 80 push $0x80113900 80103f43: e8 f8 05 00 00 call 80104540 <release> return -1; 80103f48: 83 c4 10 add $0x10,%esp 80103f4b: eb e0 jmp 80103f2d <wait+0xcd> 80103f4d: 8d 76 00 lea 0x0(%esi),%esi 80103f50 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80103f50: 55 push %ebp 80103f51: 89 e5 mov %esp,%ebp 80103f53: 53 push %ebx 80103f54: 83 ec 10 sub $0x10,%esp 80103f57: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 80103f5a: 68 00 39 11 80 push $0x80113900 80103f5f: e8 1c 05 00 00 call 80104480 <acquire> 80103f64: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f67: b8 34 39 11 80 mov $0x80113934,%eax 80103f6c: eb 0c jmp 80103f7a <wakeup+0x2a> 80103f6e: 66 90 xchg %ax,%ax 80103f70: 83 e8 80 sub $0xffffff80,%eax 80103f73: 3d 34 59 11 80 cmp $0x80115934,%eax 80103f78: 73 1c jae 80103f96 <wakeup+0x46> if(p->state == SLEEPING && p->chan == chan) 80103f7a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103f7e: 75 f0 jne 80103f70 <wakeup+0x20> 80103f80: 3b 58 20 cmp 0x20(%eax),%ebx 80103f83: 75 eb jne 80103f70 <wakeup+0x20> p->state = RUNNABLE; 80103f85: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f8c: 83 e8 80 sub $0xffffff80,%eax 80103f8f: 3d 34 59 11 80 cmp $0x80115934,%eax 80103f94: 72 e4 jb 80103f7a <wakeup+0x2a> wakeup1(chan); release(&ptable.lock); 80103f96: c7 45 08 00 39 11 80 movl $0x80113900,0x8(%ebp) } 80103f9d: 8b 5d fc mov -0x4(%ebp),%ebx 80103fa0: c9 leave release(&ptable.lock); 80103fa1: e9 9a 05 00 00 jmp 80104540 <release> 80103fa6: 8d 76 00 lea 0x0(%esi),%esi 80103fa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103fb0 <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) { 80103fb0: 55 push %ebp 80103fb1: 89 e5 mov %esp,%ebp 80103fb3: 53 push %ebx 80103fb4: 83 ec 10 sub $0x10,%esp 80103fb7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 80103fba: 68 00 39 11 80 push $0x80113900 80103fbf: e8 bc 04 00 00 call 80104480 <acquire> 80103fc4: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fc7: b8 34 39 11 80 mov $0x80113934,%eax 80103fcc: eb 0c jmp 80103fda <kill+0x2a> 80103fce: 66 90 xchg %ax,%ax 80103fd0: 83 e8 80 sub $0xffffff80,%eax 80103fd3: 3d 34 59 11 80 cmp $0x80115934,%eax 80103fd8: 73 36 jae 80104010 <kill+0x60> if(p->pid == pid){ 80103fda: 39 58 10 cmp %ebx,0x10(%eax) 80103fdd: 75 f1 jne 80103fd0 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 80103fdf: 83 78 0c 02 cmpl $0x2,0xc(%eax) p->killed = 1; 80103fe3: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) if(p->state == SLEEPING) 80103fea: 75 07 jne 80103ff3 <kill+0x43> p->state = RUNNABLE; 80103fec: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) release(&ptable.lock); 80103ff3: 83 ec 0c sub $0xc,%esp 80103ff6: 68 00 39 11 80 push $0x80113900 80103ffb: e8 40 05 00 00 call 80104540 <release> return 0; 80104000: 83 c4 10 add $0x10,%esp 80104003: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80104005: 8b 5d fc mov -0x4(%ebp),%ebx 80104008: c9 leave 80104009: c3 ret 8010400a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi release(&ptable.lock); 80104010: 83 ec 0c sub $0xc,%esp 80104013: 68 00 39 11 80 push $0x80113900 80104018: e8 23 05 00 00 call 80104540 <release> return -1; 8010401d: 83 c4 10 add $0x10,%esp 80104020: b8 ff ff ff ff mov $0xffffffff,%eax } 80104025: 8b 5d fc mov -0x4(%ebp),%ebx 80104028: c9 leave 80104029: c3 ret 8010402a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104030 <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) { 80104030: 55 push %ebp 80104031: 89 e5 mov %esp,%ebp 80104033: 57 push %edi 80104034: 56 push %esi 80104035: 53 push %ebx 80104036: 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++){ 80104039: bb 34 39 11 80 mov $0x80113934,%ebx { 8010403e: 83 ec 3c sub $0x3c,%esp 80104041: eb 24 jmp 80104067 <procdump+0x37> 80104043: 90 nop 80104044: 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"); 80104048: 83 ec 0c sub $0xc,%esp 8010404b: 68 73 82 10 80 push $0x80108273 80104050: e8 0b c6 ff ff call 80100660 <cprintf> 80104055: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104058: 83 eb 80 sub $0xffffff80,%ebx 8010405b: 81 fb 34 59 11 80 cmp $0x80115934,%ebx 80104061: 0f 83 81 00 00 00 jae 801040e8 <procdump+0xb8> if(p->state == UNUSED) 80104067: 8b 43 0c mov 0xc(%ebx),%eax 8010406a: 85 c0 test %eax,%eax 8010406c: 74 ea je 80104058 <procdump+0x28> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8010406e: 83 f8 05 cmp $0x5,%eax state = "???"; 80104071: ba 40 7d 10 80 mov $0x80107d40,%edx if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80104076: 77 11 ja 80104089 <procdump+0x59> 80104078: 8b 14 85 10 7e 10 80 mov -0x7fef81f0(,%eax,4),%edx state = "???"; 8010407f: b8 40 7d 10 80 mov $0x80107d40,%eax 80104084: 85 d2 test %edx,%edx 80104086: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 80104089: 8d 43 6c lea 0x6c(%ebx),%eax 8010408c: 50 push %eax 8010408d: 52 push %edx 8010408e: ff 73 10 pushl 0x10(%ebx) 80104091: 68 44 7d 10 80 push $0x80107d44 80104096: e8 c5 c5 ff ff call 80100660 <cprintf> if(p->state == SLEEPING){ 8010409b: 83 c4 10 add $0x10,%esp 8010409e: 83 7b 0c 02 cmpl $0x2,0xc(%ebx) 801040a2: 75 a4 jne 80104048 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 801040a4: 8d 45 c0 lea -0x40(%ebp),%eax 801040a7: 83 ec 08 sub $0x8,%esp 801040aa: 8d 7d c0 lea -0x40(%ebp),%edi 801040ad: 50 push %eax 801040ae: 8b 43 1c mov 0x1c(%ebx),%eax 801040b1: 8b 40 0c mov 0xc(%eax),%eax 801040b4: 83 c0 08 add $0x8,%eax 801040b7: 50 push %eax 801040b8: e8 a3 02 00 00 call 80104360 <getcallerpcs> 801040bd: 83 c4 10 add $0x10,%esp for(i=0; i<10 && pc[i] != 0; i++) 801040c0: 8b 17 mov (%edi),%edx 801040c2: 85 d2 test %edx,%edx 801040c4: 74 82 je 80104048 <procdump+0x18> cprintf(" %p", pc[i]); 801040c6: 83 ec 08 sub $0x8,%esp 801040c9: 83 c7 04 add $0x4,%edi 801040cc: 52 push %edx 801040cd: 68 81 77 10 80 push $0x80107781 801040d2: e8 89 c5 ff ff call 80100660 <cprintf> for(i=0; i<10 && pc[i] != 0; i++) 801040d7: 83 c4 10 add $0x10,%esp 801040da: 39 fe cmp %edi,%esi 801040dc: 75 e2 jne 801040c0 <procdump+0x90> 801040de: e9 65 ff ff ff jmp 80104048 <procdump+0x18> 801040e3: 90 nop 801040e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } 801040e8: 8d 65 f4 lea -0xc(%ebp),%esp 801040eb: 5b pop %ebx 801040ec: 5e pop %esi 801040ed: 5f pop %edi 801040ee: 5d pop %ebp 801040ef: c3 ret 801040f0 <cps>: int cps(void) { 801040f0: 55 push %ebp 801040f1: 89 e5 mov %esp,%ebp 801040f3: 53 push %ebx 801040f4: 83 ec 10 sub $0x10,%esp asm volatile("sti"); 801040f7: fb sti struct proc *p; sti(); acquire(&ptable.lock); 801040f8: 68 00 39 11 80 push $0x80113900 cprintf("name \t pid \t state \t \t priority\n"); for(p=ptable.proc; p < &ptable.proc[NPROC]; p++){ 801040fd: bb 34 39 11 80 mov $0x80113934,%ebx acquire(&ptable.lock); 80104102: e8 79 03 00 00 call 80104480 <acquire> cprintf("name \t pid \t state \t \t priority\n"); 80104107: c7 04 24 ec 7d 10 80 movl $0x80107dec,(%esp) 8010410e: e8 4d c5 ff ff call 80100660 <cprintf> 80104113: 83 c4 10 add $0x10,%esp 80104116: eb 1d jmp 80104135 <cps+0x45> 80104118: 90 nop 80104119: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p->state == SLEEPING) cprintf("%s \t %d \t SLEEPING \t %d\n", p->name, p->pid, p->priority); else if(p->state == RUNNING) 80104120: 83 f8 04 cmp $0x4,%eax 80104123: 74 5b je 80104180 <cps+0x90> cprintf("%s \t %d \t RUNNING \t %d\n", p->name, p->pid, p->priority); else if(p->state == RUNNABLE) 80104125: 83 f8 03 cmp $0x3,%eax 80104128: 74 76 je 801041a0 <cps+0xb0> for(p=ptable.proc; p < &ptable.proc[NPROC]; p++){ 8010412a: 83 eb 80 sub $0xffffff80,%ebx 8010412d: 81 fb 34 59 11 80 cmp $0x80115934,%ebx 80104133: 73 2a jae 8010415f <cps+0x6f> if(p->state == SLEEPING) 80104135: 8b 43 0c mov 0xc(%ebx),%eax 80104138: 83 f8 02 cmp $0x2,%eax 8010413b: 75 e3 jne 80104120 <cps+0x30> cprintf("%s \t %d \t SLEEPING \t %d\n", p->name, p->pid, p->priority); 8010413d: 8d 43 6c lea 0x6c(%ebx),%eax 80104140: ff 73 7c pushl 0x7c(%ebx) 80104143: ff 73 10 pushl 0x10(%ebx) for(p=ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104146: 83 eb 80 sub $0xffffff80,%ebx cprintf("%s \t %d \t SLEEPING \t %d\n", p->name, p->pid, p->priority); 80104149: 50 push %eax 8010414a: 68 4d 7d 10 80 push $0x80107d4d 8010414f: e8 0c c5 ff ff call 80100660 <cprintf> 80104154: 83 c4 10 add $0x10,%esp for(p=ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104157: 81 fb 34 59 11 80 cmp $0x80115934,%ebx 8010415d: 72 d6 jb 80104135 <cps+0x45> cprintf("%s \t %d \t RUNNABLE \t %d\n", p->name, p->pid, p->priority); } release(&ptable.lock); 8010415f: 83 ec 0c sub $0xc,%esp 80104162: 68 00 39 11 80 push $0x80113900 80104167: e8 d4 03 00 00 call 80104540 <release> return 22; } 8010416c: b8 16 00 00 00 mov $0x16,%eax 80104171: 8b 5d fc mov -0x4(%ebp),%ebx 80104174: c9 leave 80104175: c3 ret 80104176: 8d 76 00 lea 0x0(%esi),%esi 80104179: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi cprintf("%s \t %d \t RUNNING \t %d\n", p->name, p->pid, p->priority); 80104180: 8d 43 6c lea 0x6c(%ebx),%eax 80104183: ff 73 7c pushl 0x7c(%ebx) 80104186: ff 73 10 pushl 0x10(%ebx) 80104189: 50 push %eax 8010418a: 68 66 7d 10 80 push $0x80107d66 8010418f: e8 cc c4 ff ff call 80100660 <cprintf> 80104194: 83 c4 10 add $0x10,%esp 80104197: eb 91 jmp 8010412a <cps+0x3a> 80104199: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%s \t %d \t RUNNABLE \t %d\n", p->name, p->pid, p->priority); 801041a0: 8d 43 6c lea 0x6c(%ebx),%eax 801041a3: ff 73 7c pushl 0x7c(%ebx) 801041a6: ff 73 10 pushl 0x10(%ebx) 801041a9: 50 push %eax 801041aa: 68 7f 7d 10 80 push $0x80107d7f 801041af: e8 ac c4 ff ff call 80100660 <cprintf> 801041b4: 83 c4 10 add $0x10,%esp 801041b7: e9 6e ff ff ff jmp 8010412a <cps+0x3a> 801041bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801041c0 <chpr>: int chpr(int pid, int priority){ 801041c0: 55 push %ebp 801041c1: 89 e5 mov %esp,%ebp 801041c3: 53 push %ebx 801041c4: 83 ec 10 sub $0x10,%esp 801041c7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 801041ca: 68 00 39 11 80 push $0x80113900 801041cf: e8 ac 02 00 00 call 80104480 <acquire> 801041d4: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801041d7: ba 34 39 11 80 mov $0x80113934,%edx 801041dc: eb 0d jmp 801041eb <chpr+0x2b> 801041de: 66 90 xchg %ax,%ax 801041e0: 83 ea 80 sub $0xffffff80,%edx 801041e3: 81 fa 34 59 11 80 cmp $0x80115934,%edx 801041e9: 73 0b jae 801041f6 <chpr+0x36> if(p->pid==pid) { 801041eb: 39 5a 10 cmp %ebx,0x10(%edx) 801041ee: 75 f0 jne 801041e0 <chpr+0x20> p -> priority = priority; 801041f0: 8b 45 0c mov 0xc(%ebp),%eax 801041f3: 89 42 7c mov %eax,0x7c(%edx) break; } } release(&ptable.lock); 801041f6: 83 ec 0c sub $0xc,%esp 801041f9: 68 00 39 11 80 push $0x80113900 801041fe: e8 3d 03 00 00 call 80104540 <release> return pid; } 80104203: 89 d8 mov %ebx,%eax 80104205: 8b 5d fc mov -0x4(%ebp),%ebx 80104208: c9 leave 80104209: c3 ret 8010420a: 66 90 xchg %ax,%ax 8010420c: 66 90 xchg %ax,%ax 8010420e: 66 90 xchg %ax,%ax 80104210 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80104210: 55 push %ebp 80104211: 89 e5 mov %esp,%ebp 80104213: 53 push %ebx 80104214: 83 ec 0c sub $0xc,%esp 80104217: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 8010421a: 68 28 7e 10 80 push $0x80107e28 8010421f: 8d 43 04 lea 0x4(%ebx),%eax 80104222: 50 push %eax 80104223: e8 18 01 00 00 call 80104340 <initlock> lk->name = name; 80104228: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 8010422b: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 80104231: 83 c4 10 add $0x10,%esp lk->pid = 0; 80104234: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 8010423b: 89 43 38 mov %eax,0x38(%ebx) } 8010423e: 8b 5d fc mov -0x4(%ebp),%ebx 80104241: c9 leave 80104242: c3 ret 80104243: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104250 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80104250: 55 push %ebp 80104251: 89 e5 mov %esp,%ebp 80104253: 56 push %esi 80104254: 53 push %ebx 80104255: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104258: 83 ec 0c sub $0xc,%esp 8010425b: 8d 73 04 lea 0x4(%ebx),%esi 8010425e: 56 push %esi 8010425f: e8 1c 02 00 00 call 80104480 <acquire> while (lk->locked) { 80104264: 8b 13 mov (%ebx),%edx 80104266: 83 c4 10 add $0x10,%esp 80104269: 85 d2 test %edx,%edx 8010426b: 74 16 je 80104283 <acquiresleep+0x33> 8010426d: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104270: 83 ec 08 sub $0x8,%esp 80104273: 56 push %esi 80104274: 53 push %ebx 80104275: e8 26 fb ff ff call 80103da0 <sleep> while (lk->locked) { 8010427a: 8b 03 mov (%ebx),%eax 8010427c: 83 c4 10 add $0x10,%esp 8010427f: 85 c0 test %eax,%eax 80104281: 75 ed jne 80104270 <acquiresleep+0x20> } lk->locked = 1; 80104283: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 80104289: e8 52 f5 ff ff call 801037e0 <myproc> 8010428e: 8b 40 10 mov 0x10(%eax),%eax 80104291: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 80104294: 89 75 08 mov %esi,0x8(%ebp) } 80104297: 8d 65 f8 lea -0x8(%ebp),%esp 8010429a: 5b pop %ebx 8010429b: 5e pop %esi 8010429c: 5d pop %ebp release(&lk->lk); 8010429d: e9 9e 02 00 00 jmp 80104540 <release> 801042a2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801042a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801042b0 <releasesleep>: void releasesleep(struct sleeplock *lk) { 801042b0: 55 push %ebp 801042b1: 89 e5 mov %esp,%ebp 801042b3: 56 push %esi 801042b4: 53 push %ebx 801042b5: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 801042b8: 83 ec 0c sub $0xc,%esp 801042bb: 8d 73 04 lea 0x4(%ebx),%esi 801042be: 56 push %esi 801042bf: e8 bc 01 00 00 call 80104480 <acquire> lk->locked = 0; 801042c4: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 801042ca: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 801042d1: 89 1c 24 mov %ebx,(%esp) 801042d4: e8 77 fc ff ff call 80103f50 <wakeup> release(&lk->lk); 801042d9: 89 75 08 mov %esi,0x8(%ebp) 801042dc: 83 c4 10 add $0x10,%esp } 801042df: 8d 65 f8 lea -0x8(%ebp),%esp 801042e2: 5b pop %ebx 801042e3: 5e pop %esi 801042e4: 5d pop %ebp release(&lk->lk); 801042e5: e9 56 02 00 00 jmp 80104540 <release> 801042ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801042f0 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 801042f0: 55 push %ebp 801042f1: 89 e5 mov %esp,%ebp 801042f3: 57 push %edi 801042f4: 56 push %esi 801042f5: 53 push %ebx 801042f6: 31 ff xor %edi,%edi 801042f8: 83 ec 18 sub $0x18,%esp 801042fb: 8b 5d 08 mov 0x8(%ebp),%ebx int r; acquire(&lk->lk); 801042fe: 8d 73 04 lea 0x4(%ebx),%esi 80104301: 56 push %esi 80104302: e8 79 01 00 00 call 80104480 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 80104307: 8b 03 mov (%ebx),%eax 80104309: 83 c4 10 add $0x10,%esp 8010430c: 85 c0 test %eax,%eax 8010430e: 74 13 je 80104323 <holdingsleep+0x33> 80104310: 8b 5b 3c mov 0x3c(%ebx),%ebx 80104313: e8 c8 f4 ff ff call 801037e0 <myproc> 80104318: 39 58 10 cmp %ebx,0x10(%eax) 8010431b: 0f 94 c0 sete %al 8010431e: 0f b6 c0 movzbl %al,%eax 80104321: 89 c7 mov %eax,%edi release(&lk->lk); 80104323: 83 ec 0c sub $0xc,%esp 80104326: 56 push %esi 80104327: e8 14 02 00 00 call 80104540 <release> return r; } 8010432c: 8d 65 f4 lea -0xc(%ebp),%esp 8010432f: 89 f8 mov %edi,%eax 80104331: 5b pop %ebx 80104332: 5e pop %esi 80104333: 5f pop %edi 80104334: 5d pop %ebp 80104335: c3 ret 80104336: 66 90 xchg %ax,%ax 80104338: 66 90 xchg %ax,%ax 8010433a: 66 90 xchg %ax,%ax 8010433c: 66 90 xchg %ax,%ax 8010433e: 66 90 xchg %ax,%ax 80104340 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104340: 55 push %ebp 80104341: 89 e5 mov %esp,%ebp 80104343: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104346: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104349: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 8010434f: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 80104352: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104359: 5d pop %ebp 8010435a: c3 ret 8010435b: 90 nop 8010435c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104360 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104360: 55 push %ebp uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104361: 31 d2 xor %edx,%edx { 80104363: 89 e5 mov %esp,%ebp 80104365: 53 push %ebx ebp = (uint*)v - 2; 80104366: 8b 45 08 mov 0x8(%ebp),%eax { 80104369: 8b 4d 0c mov 0xc(%ebp),%ecx ebp = (uint*)v - 2; 8010436c: 83 e8 08 sub $0x8,%eax 8010436f: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104370: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 80104376: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 8010437c: 77 1a ja 80104398 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 8010437e: 8b 58 04 mov 0x4(%eax),%ebx 80104381: 89 1c 91 mov %ebx,(%ecx,%edx,4) for(i = 0; i < 10; i++){ 80104384: 83 c2 01 add $0x1,%edx ebp = (uint*)ebp[0]; // saved %ebp 80104387: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 80104389: 83 fa 0a cmp $0xa,%edx 8010438c: 75 e2 jne 80104370 <getcallerpcs+0x10> } for(; i < 10; i++) pcs[i] = 0; } 8010438e: 5b pop %ebx 8010438f: 5d pop %ebp 80104390: c3 ret 80104391: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104398: 8d 04 91 lea (%ecx,%edx,4),%eax 8010439b: 83 c1 28 add $0x28,%ecx 8010439e: 66 90 xchg %ax,%ax pcs[i] = 0; 801043a0: c7 00 00 00 00 00 movl $0x0,(%eax) 801043a6: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 801043a9: 39 c1 cmp %eax,%ecx 801043ab: 75 f3 jne 801043a0 <getcallerpcs+0x40> } 801043ad: 5b pop %ebx 801043ae: 5d pop %ebp 801043af: c3 ret 801043b0 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 801043b0: 55 push %ebp 801043b1: 89 e5 mov %esp,%ebp 801043b3: 53 push %ebx 801043b4: 83 ec 04 sub $0x4,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 801043b7: 9c pushf 801043b8: 5b pop %ebx asm volatile("cli"); 801043b9: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 801043ba: e8 91 f3 ff ff call 80103750 <mycpu> 801043bf: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 801043c5: 85 c0 test %eax,%eax 801043c7: 75 11 jne 801043da <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 801043c9: 81 e3 00 02 00 00 and $0x200,%ebx 801043cf: e8 7c f3 ff ff call 80103750 <mycpu> 801043d4: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 801043da: e8 71 f3 ff ff call 80103750 <mycpu> 801043df: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 801043e6: 83 c4 04 add $0x4,%esp 801043e9: 5b pop %ebx 801043ea: 5d pop %ebp 801043eb: c3 ret 801043ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801043f0 <popcli>: void popcli(void) { 801043f0: 55 push %ebp 801043f1: 89 e5 mov %esp,%ebp 801043f3: 83 ec 08 sub $0x8,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 801043f6: 9c pushf 801043f7: 58 pop %eax if(readeflags()&FL_IF) 801043f8: f6 c4 02 test $0x2,%ah 801043fb: 75 35 jne 80104432 <popcli+0x42> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 801043fd: e8 4e f3 ff ff call 80103750 <mycpu> 80104402: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax) 80104409: 78 34 js 8010443f <popcli+0x4f> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 8010440b: e8 40 f3 ff ff call 80103750 <mycpu> 80104410: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80104416: 85 d2 test %edx,%edx 80104418: 74 06 je 80104420 <popcli+0x30> sti(); } 8010441a: c9 leave 8010441b: c3 ret 8010441c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(mycpu()->ncli == 0 && mycpu()->intena) 80104420: e8 2b f3 ff ff call 80103750 <mycpu> 80104425: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 8010442b: 85 c0 test %eax,%eax 8010442d: 74 eb je 8010441a <popcli+0x2a> asm volatile("sti"); 8010442f: fb sti } 80104430: c9 leave 80104431: c3 ret panic("popcli - interruptible"); 80104432: 83 ec 0c sub $0xc,%esp 80104435: 68 33 7e 10 80 push $0x80107e33 8010443a: e8 51 bf ff ff call 80100390 <panic> panic("popcli"); 8010443f: 83 ec 0c sub $0xc,%esp 80104442: 68 4a 7e 10 80 push $0x80107e4a 80104447: e8 44 bf ff ff call 80100390 <panic> 8010444c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104450 <holding>: { 80104450: 55 push %ebp 80104451: 89 e5 mov %esp,%ebp 80104453: 56 push %esi 80104454: 53 push %ebx 80104455: 8b 75 08 mov 0x8(%ebp),%esi 80104458: 31 db xor %ebx,%ebx pushcli(); 8010445a: e8 51 ff ff ff call 801043b0 <pushcli> r = lock->locked && lock->cpu == mycpu(); 8010445f: 8b 06 mov (%esi),%eax 80104461: 85 c0 test %eax,%eax 80104463: 74 10 je 80104475 <holding+0x25> 80104465: 8b 5e 08 mov 0x8(%esi),%ebx 80104468: e8 e3 f2 ff ff call 80103750 <mycpu> 8010446d: 39 c3 cmp %eax,%ebx 8010446f: 0f 94 c3 sete %bl 80104472: 0f b6 db movzbl %bl,%ebx popcli(); 80104475: e8 76 ff ff ff call 801043f0 <popcli> } 8010447a: 89 d8 mov %ebx,%eax 8010447c: 5b pop %ebx 8010447d: 5e pop %esi 8010447e: 5d pop %ebp 8010447f: c3 ret 80104480 <acquire>: { 80104480: 55 push %ebp 80104481: 89 e5 mov %esp,%ebp 80104483: 56 push %esi 80104484: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104485: e8 26 ff ff ff call 801043b0 <pushcli> if(holding(lk)) 8010448a: 8b 5d 08 mov 0x8(%ebp),%ebx 8010448d: 83 ec 0c sub $0xc,%esp 80104490: 53 push %ebx 80104491: e8 ba ff ff ff call 80104450 <holding> 80104496: 83 c4 10 add $0x10,%esp 80104499: 85 c0 test %eax,%eax 8010449b: 0f 85 83 00 00 00 jne 80104524 <acquire+0xa4> 801044a1: 89 c6 mov %eax,%esi asm volatile("lock; xchgl %0, %1" : 801044a3: ba 01 00 00 00 mov $0x1,%edx 801044a8: eb 09 jmp 801044b3 <acquire+0x33> 801044aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801044b0: 8b 5d 08 mov 0x8(%ebp),%ebx 801044b3: 89 d0 mov %edx,%eax 801044b5: f0 87 03 lock xchg %eax,(%ebx) while(xchg(&lk->locked, 1) != 0) 801044b8: 85 c0 test %eax,%eax 801044ba: 75 f4 jne 801044b0 <acquire+0x30> __sync_synchronize(); 801044bc: f0 83 0c 24 00 lock orl $0x0,(%esp) lk->cpu = mycpu(); 801044c1: 8b 5d 08 mov 0x8(%ebp),%ebx 801044c4: e8 87 f2 ff ff call 80103750 <mycpu> getcallerpcs(&lk, lk->pcs); 801044c9: 8d 53 0c lea 0xc(%ebx),%edx lk->cpu = mycpu(); 801044cc: 89 43 08 mov %eax,0x8(%ebx) ebp = (uint*)v - 2; 801044cf: 89 e8 mov %ebp,%eax 801044d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 801044d8: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx 801044de: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx 801044e4: 77 1a ja 80104500 <acquire+0x80> pcs[i] = ebp[1]; // saved %eip 801044e6: 8b 48 04 mov 0x4(%eax),%ecx 801044e9: 89 0c b2 mov %ecx,(%edx,%esi,4) for(i = 0; i < 10; i++){ 801044ec: 83 c6 01 add $0x1,%esi ebp = (uint*)ebp[0]; // saved %ebp 801044ef: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 801044f1: 83 fe 0a cmp $0xa,%esi 801044f4: 75 e2 jne 801044d8 <acquire+0x58> } 801044f6: 8d 65 f8 lea -0x8(%ebp),%esp 801044f9: 5b pop %ebx 801044fa: 5e pop %esi 801044fb: 5d pop %ebp 801044fc: c3 ret 801044fd: 8d 76 00 lea 0x0(%esi),%esi 80104500: 8d 04 b2 lea (%edx,%esi,4),%eax 80104503: 83 c2 28 add $0x28,%edx 80104506: 8d 76 00 lea 0x0(%esi),%esi 80104509: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pcs[i] = 0; 80104510: c7 00 00 00 00 00 movl $0x0,(%eax) 80104516: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 80104519: 39 d0 cmp %edx,%eax 8010451b: 75 f3 jne 80104510 <acquire+0x90> } 8010451d: 8d 65 f8 lea -0x8(%ebp),%esp 80104520: 5b pop %ebx 80104521: 5e pop %esi 80104522: 5d pop %ebp 80104523: c3 ret panic("acquire"); 80104524: 83 ec 0c sub $0xc,%esp 80104527: 68 51 7e 10 80 push $0x80107e51 8010452c: e8 5f be ff ff call 80100390 <panic> 80104531: eb 0d jmp 80104540 <release> 80104533: 90 nop 80104534: 90 nop 80104535: 90 nop 80104536: 90 nop 80104537: 90 nop 80104538: 90 nop 80104539: 90 nop 8010453a: 90 nop 8010453b: 90 nop 8010453c: 90 nop 8010453d: 90 nop 8010453e: 90 nop 8010453f: 90 nop 80104540 <release>: { 80104540: 55 push %ebp 80104541: 89 e5 mov %esp,%ebp 80104543: 53 push %ebx 80104544: 83 ec 10 sub $0x10,%esp 80104547: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holding(lk)) 8010454a: 53 push %ebx 8010454b: e8 00 ff ff ff call 80104450 <holding> 80104550: 83 c4 10 add $0x10,%esp 80104553: 85 c0 test %eax,%eax 80104555: 74 22 je 80104579 <release+0x39> lk->pcs[0] = 0; 80104557: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 8010455e: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 80104565: f0 83 0c 24 00 lock orl $0x0,(%esp) asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 8010456a: c7 03 00 00 00 00 movl $0x0,(%ebx) } 80104570: 8b 5d fc mov -0x4(%ebp),%ebx 80104573: c9 leave popcli(); 80104574: e9 77 fe ff ff jmp 801043f0 <popcli> panic("release"); 80104579: 83 ec 0c sub $0xc,%esp 8010457c: 68 59 7e 10 80 push $0x80107e59 80104581: e8 0a be ff ff call 80100390 <panic> 80104586: 66 90 xchg %ax,%ax 80104588: 66 90 xchg %ax,%ax 8010458a: 66 90 xchg %ax,%ax 8010458c: 66 90 xchg %ax,%ax 8010458e: 66 90 xchg %ax,%ax 80104590 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 80104590: 55 push %ebp 80104591: 89 e5 mov %esp,%ebp 80104593: 57 push %edi 80104594: 53 push %ebx 80104595: 8b 55 08 mov 0x8(%ebp),%edx 80104598: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst%4 == 0 && n%4 == 0){ 8010459b: f6 c2 03 test $0x3,%dl 8010459e: 75 05 jne 801045a5 <memset+0x15> 801045a0: f6 c1 03 test $0x3,%cl 801045a3: 74 13 je 801045b8 <memset+0x28> asm volatile("cld; rep stosb" : 801045a5: 89 d7 mov %edx,%edi 801045a7: 8b 45 0c mov 0xc(%ebp),%eax 801045aa: fc cld 801045ab: f3 aa rep stos %al,%es:(%edi) c &= 0xFF; stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); } else stosb(dst, c, n); return dst; } 801045ad: 5b pop %ebx 801045ae: 89 d0 mov %edx,%eax 801045b0: 5f pop %edi 801045b1: 5d pop %ebp 801045b2: c3 ret 801045b3: 90 nop 801045b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c &= 0xFF; 801045b8: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 801045bc: c1 e9 02 shr $0x2,%ecx 801045bf: 89 f8 mov %edi,%eax 801045c1: 89 fb mov %edi,%ebx 801045c3: c1 e0 18 shl $0x18,%eax 801045c6: c1 e3 10 shl $0x10,%ebx 801045c9: 09 d8 or %ebx,%eax 801045cb: 09 f8 or %edi,%eax 801045cd: c1 e7 08 shl $0x8,%edi 801045d0: 09 f8 or %edi,%eax asm volatile("cld; rep stosl" : 801045d2: 89 d7 mov %edx,%edi 801045d4: fc cld 801045d5: f3 ab rep stos %eax,%es:(%edi) } 801045d7: 5b pop %ebx 801045d8: 89 d0 mov %edx,%eax 801045da: 5f pop %edi 801045db: 5d pop %ebp 801045dc: c3 ret 801045dd: 8d 76 00 lea 0x0(%esi),%esi 801045e0 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 801045e0: 55 push %ebp 801045e1: 89 e5 mov %esp,%ebp 801045e3: 57 push %edi 801045e4: 56 push %esi 801045e5: 53 push %ebx 801045e6: 8b 5d 10 mov 0x10(%ebp),%ebx 801045e9: 8b 75 08 mov 0x8(%ebp),%esi 801045ec: 8b 7d 0c mov 0xc(%ebp),%edi const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 801045ef: 85 db test %ebx,%ebx 801045f1: 74 29 je 8010461c <memcmp+0x3c> if(*s1 != *s2) 801045f3: 0f b6 16 movzbl (%esi),%edx 801045f6: 0f b6 0f movzbl (%edi),%ecx 801045f9: 38 d1 cmp %dl,%cl 801045fb: 75 2b jne 80104628 <memcmp+0x48> 801045fd: b8 01 00 00 00 mov $0x1,%eax 80104602: eb 14 jmp 80104618 <memcmp+0x38> 80104604: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104608: 0f b6 14 06 movzbl (%esi,%eax,1),%edx 8010460c: 83 c0 01 add $0x1,%eax 8010460f: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx 80104614: 38 ca cmp %cl,%dl 80104616: 75 10 jne 80104628 <memcmp+0x48> while(n-- > 0){ 80104618: 39 d8 cmp %ebx,%eax 8010461a: 75 ec jne 80104608 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 8010461c: 5b pop %ebx return 0; 8010461d: 31 c0 xor %eax,%eax } 8010461f: 5e pop %esi 80104620: 5f pop %edi 80104621: 5d pop %ebp 80104622: c3 ret 80104623: 90 nop 80104624: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return *s1 - *s2; 80104628: 0f b6 c2 movzbl %dl,%eax } 8010462b: 5b pop %ebx return *s1 - *s2; 8010462c: 29 c8 sub %ecx,%eax } 8010462e: 5e pop %esi 8010462f: 5f pop %edi 80104630: 5d pop %ebp 80104631: c3 ret 80104632: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104639: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104640 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80104640: 55 push %ebp 80104641: 89 e5 mov %esp,%ebp 80104643: 56 push %esi 80104644: 53 push %ebx 80104645: 8b 45 08 mov 0x8(%ebp),%eax 80104648: 8b 5d 0c mov 0xc(%ebp),%ebx 8010464b: 8b 75 10 mov 0x10(%ebp),%esi const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 8010464e: 39 c3 cmp %eax,%ebx 80104650: 73 26 jae 80104678 <memmove+0x38> 80104652: 8d 0c 33 lea (%ebx,%esi,1),%ecx 80104655: 39 c8 cmp %ecx,%eax 80104657: 73 1f jae 80104678 <memmove+0x38> s += n; d += n; while(n-- > 0) 80104659: 85 f6 test %esi,%esi 8010465b: 8d 56 ff lea -0x1(%esi),%edx 8010465e: 74 0f je 8010466f <memmove+0x2f> *--d = *--s; 80104660: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104664: 88 0c 10 mov %cl,(%eax,%edx,1) while(n-- > 0) 80104667: 83 ea 01 sub $0x1,%edx 8010466a: 83 fa ff cmp $0xffffffff,%edx 8010466d: 75 f1 jne 80104660 <memmove+0x20> } else while(n-- > 0) *d++ = *s++; return dst; } 8010466f: 5b pop %ebx 80104670: 5e pop %esi 80104671: 5d pop %ebp 80104672: c3 ret 80104673: 90 nop 80104674: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(n-- > 0) 80104678: 31 d2 xor %edx,%edx 8010467a: 85 f6 test %esi,%esi 8010467c: 74 f1 je 8010466f <memmove+0x2f> 8010467e: 66 90 xchg %ax,%ax *d++ = *s++; 80104680: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104684: 88 0c 10 mov %cl,(%eax,%edx,1) 80104687: 83 c2 01 add $0x1,%edx while(n-- > 0) 8010468a: 39 d6 cmp %edx,%esi 8010468c: 75 f2 jne 80104680 <memmove+0x40> } 8010468e: 5b pop %ebx 8010468f: 5e pop %esi 80104690: 5d pop %ebp 80104691: c3 ret 80104692: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046a0 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 801046a0: 55 push %ebp 801046a1: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 801046a3: 5d pop %ebp return memmove(dst, src, n); 801046a4: eb 9a jmp 80104640 <memmove> 801046a6: 8d 76 00 lea 0x0(%esi),%esi 801046a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046b0 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 801046b0: 55 push %ebp 801046b1: 89 e5 mov %esp,%ebp 801046b3: 57 push %edi 801046b4: 56 push %esi 801046b5: 8b 7d 10 mov 0x10(%ebp),%edi 801046b8: 53 push %ebx 801046b9: 8b 4d 08 mov 0x8(%ebp),%ecx 801046bc: 8b 75 0c mov 0xc(%ebp),%esi while(n > 0 && *p && *p == *q) 801046bf: 85 ff test %edi,%edi 801046c1: 74 2f je 801046f2 <strncmp+0x42> 801046c3: 0f b6 01 movzbl (%ecx),%eax 801046c6: 0f b6 1e movzbl (%esi),%ebx 801046c9: 84 c0 test %al,%al 801046cb: 74 37 je 80104704 <strncmp+0x54> 801046cd: 38 c3 cmp %al,%bl 801046cf: 75 33 jne 80104704 <strncmp+0x54> 801046d1: 01 f7 add %esi,%edi 801046d3: eb 13 jmp 801046e8 <strncmp+0x38> 801046d5: 8d 76 00 lea 0x0(%esi),%esi 801046d8: 0f b6 01 movzbl (%ecx),%eax 801046db: 84 c0 test %al,%al 801046dd: 74 21 je 80104700 <strncmp+0x50> 801046df: 0f b6 1a movzbl (%edx),%ebx 801046e2: 89 d6 mov %edx,%esi 801046e4: 38 d8 cmp %bl,%al 801046e6: 75 1c jne 80104704 <strncmp+0x54> n--, p++, q++; 801046e8: 8d 56 01 lea 0x1(%esi),%edx 801046eb: 83 c1 01 add $0x1,%ecx while(n > 0 && *p && *p == *q) 801046ee: 39 fa cmp %edi,%edx 801046f0: 75 e6 jne 801046d8 <strncmp+0x28> if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 801046f2: 5b pop %ebx return 0; 801046f3: 31 c0 xor %eax,%eax } 801046f5: 5e pop %esi 801046f6: 5f pop %edi 801046f7: 5d pop %ebp 801046f8: c3 ret 801046f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104700: 0f b6 5e 01 movzbl 0x1(%esi),%ebx return (uchar)*p - (uchar)*q; 80104704: 29 d8 sub %ebx,%eax } 80104706: 5b pop %ebx 80104707: 5e pop %esi 80104708: 5f pop %edi 80104709: 5d pop %ebp 8010470a: c3 ret 8010470b: 90 nop 8010470c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104710 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80104710: 55 push %ebp 80104711: 89 e5 mov %esp,%ebp 80104713: 56 push %esi 80104714: 53 push %ebx 80104715: 8b 45 08 mov 0x8(%ebp),%eax 80104718: 8b 5d 0c mov 0xc(%ebp),%ebx 8010471b: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 8010471e: 89 c2 mov %eax,%edx 80104720: eb 19 jmp 8010473b <strncpy+0x2b> 80104722: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104728: 83 c3 01 add $0x1,%ebx 8010472b: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 8010472f: 83 c2 01 add $0x1,%edx 80104732: 84 c9 test %cl,%cl 80104734: 88 4a ff mov %cl,-0x1(%edx) 80104737: 74 09 je 80104742 <strncpy+0x32> 80104739: 89 f1 mov %esi,%ecx 8010473b: 85 c9 test %ecx,%ecx 8010473d: 8d 71 ff lea -0x1(%ecx),%esi 80104740: 7f e6 jg 80104728 <strncpy+0x18> ; while(n-- > 0) 80104742: 31 c9 xor %ecx,%ecx 80104744: 85 f6 test %esi,%esi 80104746: 7e 17 jle 8010475f <strncpy+0x4f> 80104748: 90 nop 80104749: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 80104750: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 80104754: 89 f3 mov %esi,%ebx 80104756: 83 c1 01 add $0x1,%ecx 80104759: 29 cb sub %ecx,%ebx while(n-- > 0) 8010475b: 85 db test %ebx,%ebx 8010475d: 7f f1 jg 80104750 <strncpy+0x40> return os; } 8010475f: 5b pop %ebx 80104760: 5e pop %esi 80104761: 5d pop %ebp 80104762: c3 ret 80104763: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104769: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104770 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80104770: 55 push %ebp 80104771: 89 e5 mov %esp,%ebp 80104773: 56 push %esi 80104774: 53 push %ebx 80104775: 8b 4d 10 mov 0x10(%ebp),%ecx 80104778: 8b 45 08 mov 0x8(%ebp),%eax 8010477b: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 8010477e: 85 c9 test %ecx,%ecx 80104780: 7e 26 jle 801047a8 <safestrcpy+0x38> 80104782: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 80104786: 89 c1 mov %eax,%ecx 80104788: eb 17 jmp 801047a1 <safestrcpy+0x31> 8010478a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 80104790: 83 c2 01 add $0x1,%edx 80104793: 0f b6 5a ff movzbl -0x1(%edx),%ebx 80104797: 83 c1 01 add $0x1,%ecx 8010479a: 84 db test %bl,%bl 8010479c: 88 59 ff mov %bl,-0x1(%ecx) 8010479f: 74 04 je 801047a5 <safestrcpy+0x35> 801047a1: 39 f2 cmp %esi,%edx 801047a3: 75 eb jne 80104790 <safestrcpy+0x20> ; *s = 0; 801047a5: c6 01 00 movb $0x0,(%ecx) return os; } 801047a8: 5b pop %ebx 801047a9: 5e pop %esi 801047aa: 5d pop %ebp 801047ab: c3 ret 801047ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801047b0 <strlen>: int strlen(const char *s) { 801047b0: 55 push %ebp int n; for(n = 0; s[n]; n++) 801047b1: 31 c0 xor %eax,%eax { 801047b3: 89 e5 mov %esp,%ebp 801047b5: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) 801047b8: 80 3a 00 cmpb $0x0,(%edx) 801047bb: 74 0c je 801047c9 <strlen+0x19> 801047bd: 8d 76 00 lea 0x0(%esi),%esi 801047c0: 83 c0 01 add $0x1,%eax 801047c3: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 801047c7: 75 f7 jne 801047c0 <strlen+0x10> ; return n; } 801047c9: 5d pop %ebp 801047ca: c3 ret 801047cb <swtch>: # a struct context, and save its address in *old. # Switch stacks to new and pop previously-saved registers. .globl swtch swtch: movl 4(%esp), %eax 801047cb: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 801047cf: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-saved registers pushl %ebp 801047d3: 55 push %ebp pushl %ebx 801047d4: 53 push %ebx pushl %esi 801047d5: 56 push %esi pushl %edi 801047d6: 57 push %edi # Switch stacks movl %esp, (%eax) 801047d7: 89 20 mov %esp,(%eax) movl %edx, %esp 801047d9: 89 d4 mov %edx,%esp # Load new callee-saved registers popl %edi 801047db: 5f pop %edi popl %esi 801047dc: 5e pop %esi popl %ebx 801047dd: 5b pop %ebx popl %ebp 801047de: 5d pop %ebp ret 801047df: c3 ret 801047e0 <fetchint>: // to a saved program counter, and then the first argument. // Fetch the int at addr from the current process. int fetchint(uint addr, int *ip) { 801047e0: 55 push %ebp 801047e1: 89 e5 mov %esp,%ebp 801047e3: 53 push %ebx 801047e4: 83 ec 04 sub $0x4,%esp 801047e7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 801047ea: e8 f1 ef ff ff call 801037e0 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801047ef: 8b 00 mov (%eax),%eax 801047f1: 39 d8 cmp %ebx,%eax 801047f3: 76 1b jbe 80104810 <fetchint+0x30> 801047f5: 8d 53 04 lea 0x4(%ebx),%edx 801047f8: 39 d0 cmp %edx,%eax 801047fa: 72 14 jb 80104810 <fetchint+0x30> return -1; *ip = *(int*)(addr); 801047fc: 8b 45 0c mov 0xc(%ebp),%eax 801047ff: 8b 13 mov (%ebx),%edx 80104801: 89 10 mov %edx,(%eax) return 0; 80104803: 31 c0 xor %eax,%eax } 80104805: 83 c4 04 add $0x4,%esp 80104808: 5b pop %ebx 80104809: 5d pop %ebp 8010480a: c3 ret 8010480b: 90 nop 8010480c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104810: b8 ff ff ff ff mov $0xffffffff,%eax 80104815: eb ee jmp 80104805 <fetchint+0x25> 80104817: 89 f6 mov %esi,%esi 80104819: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104820 <fetchstr>: // Fetch the nul-terminated string at addr from the current process. // Doesn't actually copy the string - just sets *pp to point at it. // Returns length of string, not including nul. int fetchstr(uint addr, char **pp) { 80104820: 55 push %ebp 80104821: 89 e5 mov %esp,%ebp 80104823: 53 push %ebx 80104824: 83 ec 04 sub $0x4,%esp 80104827: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 8010482a: e8 b1 ef ff ff call 801037e0 <myproc> if(addr >= curproc->sz) 8010482f: 39 18 cmp %ebx,(%eax) 80104831: 76 29 jbe 8010485c <fetchstr+0x3c> return -1; *pp = (char*)addr; 80104833: 8b 4d 0c mov 0xc(%ebp),%ecx 80104836: 89 da mov %ebx,%edx 80104838: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 8010483a: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 8010483c: 39 c3 cmp %eax,%ebx 8010483e: 73 1c jae 8010485c <fetchstr+0x3c> if(*s == 0) 80104840: 80 3b 00 cmpb $0x0,(%ebx) 80104843: 75 10 jne 80104855 <fetchstr+0x35> 80104845: eb 39 jmp 80104880 <fetchstr+0x60> 80104847: 89 f6 mov %esi,%esi 80104849: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104850: 80 3a 00 cmpb $0x0,(%edx) 80104853: 74 1b je 80104870 <fetchstr+0x50> for(s = *pp; s < ep; s++){ 80104855: 83 c2 01 add $0x1,%edx 80104858: 39 d0 cmp %edx,%eax 8010485a: 77 f4 ja 80104850 <fetchstr+0x30> return -1; 8010485c: b8 ff ff ff ff mov $0xffffffff,%eax return s - *pp; } return -1; } 80104861: 83 c4 04 add $0x4,%esp 80104864: 5b pop %ebx 80104865: 5d pop %ebp 80104866: c3 ret 80104867: 89 f6 mov %esi,%esi 80104869: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104870: 83 c4 04 add $0x4,%esp 80104873: 89 d0 mov %edx,%eax 80104875: 29 d8 sub %ebx,%eax 80104877: 5b pop %ebx 80104878: 5d pop %ebp 80104879: c3 ret 8010487a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(*s == 0) 80104880: 31 c0 xor %eax,%eax return s - *pp; 80104882: eb dd jmp 80104861 <fetchstr+0x41> 80104884: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010488a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104890 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80104890: 55 push %ebp 80104891: 89 e5 mov %esp,%ebp 80104893: 56 push %esi 80104894: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104895: e8 46 ef ff ff call 801037e0 <myproc> 8010489a: 8b 40 18 mov 0x18(%eax),%eax 8010489d: 8b 55 08 mov 0x8(%ebp),%edx 801048a0: 8b 40 44 mov 0x44(%eax),%eax 801048a3: 8d 1c 90 lea (%eax,%edx,4),%ebx struct proc *curproc = myproc(); 801048a6: e8 35 ef ff ff call 801037e0 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801048ab: 8b 00 mov (%eax),%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801048ad: 8d 73 04 lea 0x4(%ebx),%esi if(addr >= curproc->sz || addr+4 > curproc->sz) 801048b0: 39 c6 cmp %eax,%esi 801048b2: 73 1c jae 801048d0 <argint+0x40> 801048b4: 8d 53 08 lea 0x8(%ebx),%edx 801048b7: 39 d0 cmp %edx,%eax 801048b9: 72 15 jb 801048d0 <argint+0x40> *ip = *(int*)(addr); 801048bb: 8b 45 0c mov 0xc(%ebp),%eax 801048be: 8b 53 04 mov 0x4(%ebx),%edx 801048c1: 89 10 mov %edx,(%eax) return 0; 801048c3: 31 c0 xor %eax,%eax } 801048c5: 5b pop %ebx 801048c6: 5e pop %esi 801048c7: 5d pop %ebp 801048c8: c3 ret 801048c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801048d0: b8 ff ff ff ff mov $0xffffffff,%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801048d5: eb ee jmp 801048c5 <argint+0x35> 801048d7: 89 f6 mov %esi,%esi 801048d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801048e0 <argptr>: // Fetch the nth word-sized system call argument as a pointer // to a block of memory of size bytes. Check that the pointer // lies within the process address space. int argptr(int n, char **pp, int size) { 801048e0: 55 push %ebp 801048e1: 89 e5 mov %esp,%ebp 801048e3: 56 push %esi 801048e4: 53 push %ebx 801048e5: 83 ec 10 sub $0x10,%esp 801048e8: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 801048eb: e8 f0 ee ff ff call 801037e0 <myproc> 801048f0: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 801048f2: 8d 45 f4 lea -0xc(%ebp),%eax 801048f5: 83 ec 08 sub $0x8,%esp 801048f8: 50 push %eax 801048f9: ff 75 08 pushl 0x8(%ebp) 801048fc: e8 8f ff ff ff call 80104890 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 80104901: 83 c4 10 add $0x10,%esp 80104904: 85 c0 test %eax,%eax 80104906: 78 28 js 80104930 <argptr+0x50> 80104908: 85 db test %ebx,%ebx 8010490a: 78 24 js 80104930 <argptr+0x50> 8010490c: 8b 16 mov (%esi),%edx 8010490e: 8b 45 f4 mov -0xc(%ebp),%eax 80104911: 39 c2 cmp %eax,%edx 80104913: 76 1b jbe 80104930 <argptr+0x50> 80104915: 01 c3 add %eax,%ebx 80104917: 39 da cmp %ebx,%edx 80104919: 72 15 jb 80104930 <argptr+0x50> return -1; *pp = (char*)i; 8010491b: 8b 55 0c mov 0xc(%ebp),%edx 8010491e: 89 02 mov %eax,(%edx) return 0; 80104920: 31 c0 xor %eax,%eax } 80104922: 8d 65 f8 lea -0x8(%ebp),%esp 80104925: 5b pop %ebx 80104926: 5e pop %esi 80104927: 5d pop %ebp 80104928: c3 ret 80104929: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104930: b8 ff ff ff ff mov $0xffffffff,%eax 80104935: eb eb jmp 80104922 <argptr+0x42> 80104937: 89 f6 mov %esi,%esi 80104939: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104940 <argstr>: // Check that the pointer is valid and the string is nul-terminated. // (There is no shared writable memory, so the string can't change // between this check and being used by the kernel.) int argstr(int n, char **pp) { 80104940: 55 push %ebp 80104941: 89 e5 mov %esp,%ebp 80104943: 83 ec 20 sub $0x20,%esp int addr; if(argint(n, &addr) < 0) 80104946: 8d 45 f4 lea -0xc(%ebp),%eax 80104949: 50 push %eax 8010494a: ff 75 08 pushl 0x8(%ebp) 8010494d: e8 3e ff ff ff call 80104890 <argint> 80104952: 83 c4 10 add $0x10,%esp 80104955: 85 c0 test %eax,%eax 80104957: 78 17 js 80104970 <argstr+0x30> return -1; return fetchstr(addr, pp); 80104959: 83 ec 08 sub $0x8,%esp 8010495c: ff 75 0c pushl 0xc(%ebp) 8010495f: ff 75 f4 pushl -0xc(%ebp) 80104962: e8 b9 fe ff ff call 80104820 <fetchstr> 80104967: 83 c4 10 add $0x10,%esp } 8010496a: c9 leave 8010496b: c3 ret 8010496c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104970: b8 ff ff ff ff mov $0xffffffff,%eax } 80104975: c9 leave 80104976: c3 ret 80104977: 89 f6 mov %esi,%esi 80104979: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104980 <syscall>: [SYS_mv] sys_mv, }; void syscall(void) { 80104980: 55 push %ebp 80104981: 89 e5 mov %esp,%ebp 80104983: 53 push %ebx 80104984: 83 ec 04 sub $0x4,%esp int num; struct proc *curproc = myproc(); 80104987: e8 54 ee ff ff call 801037e0 <myproc> 8010498c: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 8010498e: 8b 40 18 mov 0x18(%eax),%eax 80104991: 8b 40 1c mov 0x1c(%eax),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80104994: 8d 50 ff lea -0x1(%eax),%edx 80104997: 83 fa 18 cmp $0x18,%edx 8010499a: 77 1c ja 801049b8 <syscall+0x38> 8010499c: 8b 14 85 80 7e 10 80 mov -0x7fef8180(,%eax,4),%edx 801049a3: 85 d2 test %edx,%edx 801049a5: 74 11 je 801049b8 <syscall+0x38> curproc->tf->eax = syscalls[num](); 801049a7: ff d2 call *%edx 801049a9: 8b 53 18 mov 0x18(%ebx),%edx 801049ac: 89 42 1c mov %eax,0x1c(%edx) } else { cprintf("%d %s: unknown sys call %d\n", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } 801049af: 8b 5d fc mov -0x4(%ebp),%ebx 801049b2: c9 leave 801049b3: c3 ret 801049b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%d %s: unknown sys call %d\n", 801049b8: 50 push %eax curproc->pid, curproc->name, num); 801049b9: 8d 43 6c lea 0x6c(%ebx),%eax cprintf("%d %s: unknown sys call %d\n", 801049bc: 50 push %eax 801049bd: ff 73 10 pushl 0x10(%ebx) 801049c0: 68 61 7e 10 80 push $0x80107e61 801049c5: e8 96 bc ff ff call 80100660 <cprintf> curproc->tf->eax = -1; 801049ca: 8b 43 18 mov 0x18(%ebx),%eax 801049cd: 83 c4 10 add $0x10,%esp 801049d0: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 801049d7: 8b 5d fc mov -0x4(%ebp),%ebx 801049da: c9 leave 801049db: c3 ret 801049dc: 66 90 xchg %ax,%ax 801049de: 66 90 xchg %ax,%ax 801049e0 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 801049e0: 55 push %ebp 801049e1: 89 e5 mov %esp,%ebp 801049e3: 57 push %edi 801049e4: 56 push %esi 801049e5: 53 push %ebx struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 801049e6: 8d 75 da lea -0x26(%ebp),%esi { 801049e9: 83 ec 34 sub $0x34,%esp 801049ec: 89 4d d0 mov %ecx,-0x30(%ebp) 801049ef: 8b 4d 08 mov 0x8(%ebp),%ecx if((dp = nameiparent(path, name)) == 0) 801049f2: 56 push %esi 801049f3: 50 push %eax { 801049f4: 89 55 d4 mov %edx,-0x2c(%ebp) 801049f7: 89 4d cc mov %ecx,-0x34(%ebp) if((dp = nameiparent(path, name)) == 0) 801049fa: e8 01 d5 ff ff call 80101f00 <nameiparent> 801049ff: 83 c4 10 add $0x10,%esp 80104a02: 85 c0 test %eax,%eax 80104a04: 0f 84 46 01 00 00 je 80104b50 <create+0x170> return 0; ilock(dp); 80104a0a: 83 ec 0c sub $0xc,%esp 80104a0d: 89 c3 mov %eax,%ebx 80104a0f: 50 push %eax 80104a10: e8 6b cc ff ff call 80101680 <ilock> if((ip = dirlookup(dp, name, 0)) != 0){ 80104a15: 83 c4 0c add $0xc,%esp 80104a18: 6a 00 push $0x0 80104a1a: 56 push %esi 80104a1b: 53 push %ebx 80104a1c: e8 8f d1 ff ff call 80101bb0 <dirlookup> 80104a21: 83 c4 10 add $0x10,%esp 80104a24: 85 c0 test %eax,%eax 80104a26: 89 c7 mov %eax,%edi 80104a28: 74 36 je 80104a60 <create+0x80> iunlockput(dp); 80104a2a: 83 ec 0c sub $0xc,%esp 80104a2d: 53 push %ebx 80104a2e: e8 dd ce ff ff call 80101910 <iunlockput> ilock(ip); 80104a33: 89 3c 24 mov %edi,(%esp) 80104a36: e8 45 cc ff ff call 80101680 <ilock> if(type == T_FILE && ip->type == T_FILE) 80104a3b: 83 c4 10 add $0x10,%esp 80104a3e: 66 83 7d d4 02 cmpw $0x2,-0x2c(%ebp) 80104a43: 0f 85 97 00 00 00 jne 80104ae0 <create+0x100> 80104a49: 66 83 7f 50 02 cmpw $0x2,0x50(%edi) 80104a4e: 0f 85 8c 00 00 00 jne 80104ae0 <create+0x100> panic("create: dirlink"); iunlockput(dp); return ip; } 80104a54: 8d 65 f4 lea -0xc(%ebp),%esp 80104a57: 89 f8 mov %edi,%eax 80104a59: 5b pop %ebx 80104a5a: 5e pop %esi 80104a5b: 5f pop %edi 80104a5c: 5d pop %ebp 80104a5d: c3 ret 80104a5e: 66 90 xchg %ax,%ax if((ip = ialloc(dp->dev, type)) == 0) 80104a60: 0f bf 45 d4 movswl -0x2c(%ebp),%eax 80104a64: 83 ec 08 sub $0x8,%esp 80104a67: 50 push %eax 80104a68: ff 33 pushl (%ebx) 80104a6a: e8 a1 ca ff ff call 80101510 <ialloc> 80104a6f: 83 c4 10 add $0x10,%esp 80104a72: 85 c0 test %eax,%eax 80104a74: 89 c7 mov %eax,%edi 80104a76: 0f 84 e8 00 00 00 je 80104b64 <create+0x184> ilock(ip); 80104a7c: 83 ec 0c sub $0xc,%esp 80104a7f: 50 push %eax 80104a80: e8 fb cb ff ff call 80101680 <ilock> ip->major = major; 80104a85: 0f b7 45 d0 movzwl -0x30(%ebp),%eax 80104a89: 66 89 47 52 mov %ax,0x52(%edi) ip->minor = minor; 80104a8d: 0f b7 45 cc movzwl -0x34(%ebp),%eax 80104a91: 66 89 47 54 mov %ax,0x54(%edi) ip->nlink = 1; 80104a95: b8 01 00 00 00 mov $0x1,%eax 80104a9a: 66 89 47 56 mov %ax,0x56(%edi) iupdate(ip); 80104a9e: 89 3c 24 mov %edi,(%esp) 80104aa1: e8 2a cb ff ff call 801015d0 <iupdate> if(type == T_DIR){ // Create . and .. entries. 80104aa6: 83 c4 10 add $0x10,%esp 80104aa9: 66 83 7d d4 01 cmpw $0x1,-0x2c(%ebp) 80104aae: 74 50 je 80104b00 <create+0x120> if(dirlink(dp, name, ip->inum) < 0) 80104ab0: 83 ec 04 sub $0x4,%esp 80104ab3: ff 77 04 pushl 0x4(%edi) 80104ab6: 56 push %esi 80104ab7: 53 push %ebx 80104ab8: e8 63 d3 ff ff call 80101e20 <dirlink> 80104abd: 83 c4 10 add $0x10,%esp 80104ac0: 85 c0 test %eax,%eax 80104ac2: 0f 88 8f 00 00 00 js 80104b57 <create+0x177> iunlockput(dp); 80104ac8: 83 ec 0c sub $0xc,%esp 80104acb: 53 push %ebx 80104acc: e8 3f ce ff ff call 80101910 <iunlockput> return ip; 80104ad1: 83 c4 10 add $0x10,%esp } 80104ad4: 8d 65 f4 lea -0xc(%ebp),%esp 80104ad7: 89 f8 mov %edi,%eax 80104ad9: 5b pop %ebx 80104ada: 5e pop %esi 80104adb: 5f pop %edi 80104adc: 5d pop %ebp 80104add: c3 ret 80104ade: 66 90 xchg %ax,%ax iunlockput(ip); 80104ae0: 83 ec 0c sub $0xc,%esp 80104ae3: 57 push %edi return 0; 80104ae4: 31 ff xor %edi,%edi iunlockput(ip); 80104ae6: e8 25 ce ff ff call 80101910 <iunlockput> return 0; 80104aeb: 83 c4 10 add $0x10,%esp } 80104aee: 8d 65 f4 lea -0xc(%ebp),%esp 80104af1: 89 f8 mov %edi,%eax 80104af3: 5b pop %ebx 80104af4: 5e pop %esi 80104af5: 5f pop %edi 80104af6: 5d pop %ebp 80104af7: c3 ret 80104af8: 90 nop 80104af9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink++; // for ".." 80104b00: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(dp); 80104b05: 83 ec 0c sub $0xc,%esp 80104b08: 53 push %ebx 80104b09: e8 c2 ca ff ff call 801015d0 <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80104b0e: 83 c4 0c add $0xc,%esp 80104b11: ff 77 04 pushl 0x4(%edi) 80104b14: 68 04 7f 10 80 push $0x80107f04 80104b19: 57 push %edi 80104b1a: e8 01 d3 ff ff call 80101e20 <dirlink> 80104b1f: 83 c4 10 add $0x10,%esp 80104b22: 85 c0 test %eax,%eax 80104b24: 78 1c js 80104b42 <create+0x162> 80104b26: 83 ec 04 sub $0x4,%esp 80104b29: ff 73 04 pushl 0x4(%ebx) 80104b2c: 68 03 7f 10 80 push $0x80107f03 80104b31: 57 push %edi 80104b32: e8 e9 d2 ff ff call 80101e20 <dirlink> 80104b37: 83 c4 10 add $0x10,%esp 80104b3a: 85 c0 test %eax,%eax 80104b3c: 0f 89 6e ff ff ff jns 80104ab0 <create+0xd0> panic("create dots"); 80104b42: 83 ec 0c sub $0xc,%esp 80104b45: 68 f7 7e 10 80 push $0x80107ef7 80104b4a: e8 41 b8 ff ff call 80100390 <panic> 80104b4f: 90 nop return 0; 80104b50: 31 ff xor %edi,%edi 80104b52: e9 fd fe ff ff jmp 80104a54 <create+0x74> panic("create: dirlink"); 80104b57: 83 ec 0c sub $0xc,%esp 80104b5a: 68 06 7f 10 80 push $0x80107f06 80104b5f: e8 2c b8 ff ff call 80100390 <panic> panic("create: ialloc"); 80104b64: 83 ec 0c sub $0xc,%esp 80104b67: 68 e8 7e 10 80 push $0x80107ee8 80104b6c: e8 1f b8 ff ff call 80100390 <panic> 80104b71: eb 0d jmp 80104b80 <argfd.constprop.1> 80104b73: 90 nop 80104b74: 90 nop 80104b75: 90 nop 80104b76: 90 nop 80104b77: 90 nop 80104b78: 90 nop 80104b79: 90 nop 80104b7a: 90 nop 80104b7b: 90 nop 80104b7c: 90 nop 80104b7d: 90 nop 80104b7e: 90 nop 80104b7f: 90 nop 80104b80 <argfd.constprop.1>: argfd(int n, int *pfd, struct file **pf) 80104b80: 55 push %ebp 80104b81: 89 e5 mov %esp,%ebp 80104b83: 56 push %esi 80104b84: 53 push %ebx 80104b85: 89 c3 mov %eax,%ebx if(argint(n, &fd) < 0) 80104b87: 8d 45 f4 lea -0xc(%ebp),%eax argfd(int n, int *pfd, struct file **pf) 80104b8a: 89 d6 mov %edx,%esi 80104b8c: 83 ec 18 sub $0x18,%esp if(argint(n, &fd) < 0) 80104b8f: 50 push %eax 80104b90: 6a 00 push $0x0 80104b92: e8 f9 fc ff ff call 80104890 <argint> 80104b97: 83 c4 10 add $0x10,%esp 80104b9a: 85 c0 test %eax,%eax 80104b9c: 78 2a js 80104bc8 <argfd.constprop.1+0x48> if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80104b9e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80104ba2: 77 24 ja 80104bc8 <argfd.constprop.1+0x48> 80104ba4: e8 37 ec ff ff call 801037e0 <myproc> 80104ba9: 8b 55 f4 mov -0xc(%ebp),%edx 80104bac: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80104bb0: 85 c0 test %eax,%eax 80104bb2: 74 14 je 80104bc8 <argfd.constprop.1+0x48> if(pfd) 80104bb4: 85 db test %ebx,%ebx 80104bb6: 74 02 je 80104bba <argfd.constprop.1+0x3a> *pfd = fd; 80104bb8: 89 13 mov %edx,(%ebx) *pf = f; 80104bba: 89 06 mov %eax,(%esi) return 0; 80104bbc: 31 c0 xor %eax,%eax } 80104bbe: 8d 65 f8 lea -0x8(%ebp),%esp 80104bc1: 5b pop %ebx 80104bc2: 5e pop %esi 80104bc3: 5d pop %ebp 80104bc4: c3 ret 80104bc5: 8d 76 00 lea 0x0(%esi),%esi return -1; 80104bc8: b8 ff ff ff ff mov $0xffffffff,%eax 80104bcd: eb ef jmp 80104bbe <argfd.constprop.1+0x3e> 80104bcf: 90 nop 80104bd0 <sys_dup>: { 80104bd0: 55 push %ebp if(argfd(0, 0, &f) < 0) 80104bd1: 31 c0 xor %eax,%eax { 80104bd3: 89 e5 mov %esp,%ebp 80104bd5: 56 push %esi 80104bd6: 53 push %ebx if(argfd(0, 0, &f) < 0) 80104bd7: 8d 55 f4 lea -0xc(%ebp),%edx { 80104bda: 83 ec 10 sub $0x10,%esp if(argfd(0, 0, &f) < 0) 80104bdd: e8 9e ff ff ff call 80104b80 <argfd.constprop.1> 80104be2: 85 c0 test %eax,%eax 80104be4: 78 42 js 80104c28 <sys_dup+0x58> if((fd=fdalloc(f)) < 0) 80104be6: 8b 75 f4 mov -0xc(%ebp),%esi for(fd = 0; fd < NOFILE; fd++){ 80104be9: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80104beb: e8 f0 eb ff ff call 801037e0 <myproc> 80104bf0: eb 0e jmp 80104c00 <sys_dup+0x30> 80104bf2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(fd = 0; fd < NOFILE; fd++){ 80104bf8: 83 c3 01 add $0x1,%ebx 80104bfb: 83 fb 10 cmp $0x10,%ebx 80104bfe: 74 28 je 80104c28 <sys_dup+0x58> if(curproc->ofile[fd] == 0){ 80104c00: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80104c04: 85 d2 test %edx,%edx 80104c06: 75 f0 jne 80104bf8 <sys_dup+0x28> curproc->ofile[fd] = f; 80104c08: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) filedup(f); 80104c0c: 83 ec 0c sub $0xc,%esp 80104c0f: ff 75 f4 pushl -0xc(%ebp) 80104c12: e8 d9 c1 ff ff call 80100df0 <filedup> return fd; 80104c17: 83 c4 10 add $0x10,%esp } 80104c1a: 8d 65 f8 lea -0x8(%ebp),%esp 80104c1d: 89 d8 mov %ebx,%eax 80104c1f: 5b pop %ebx 80104c20: 5e pop %esi 80104c21: 5d pop %ebp 80104c22: c3 ret 80104c23: 90 nop 80104c24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104c28: 8d 65 f8 lea -0x8(%ebp),%esp return -1; 80104c2b: bb ff ff ff ff mov $0xffffffff,%ebx } 80104c30: 89 d8 mov %ebx,%eax 80104c32: 5b pop %ebx 80104c33: 5e pop %esi 80104c34: 5d pop %ebp 80104c35: c3 ret 80104c36: 8d 76 00 lea 0x0(%esi),%esi 80104c39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c40 <sys_read>: { 80104c40: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104c41: 31 c0 xor %eax,%eax { 80104c43: 89 e5 mov %esp,%ebp 80104c45: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104c48: 8d 55 ec lea -0x14(%ebp),%edx 80104c4b: e8 30 ff ff ff call 80104b80 <argfd.constprop.1> 80104c50: 85 c0 test %eax,%eax 80104c52: 78 4c js 80104ca0 <sys_read+0x60> 80104c54: 8d 45 f0 lea -0x10(%ebp),%eax 80104c57: 83 ec 08 sub $0x8,%esp 80104c5a: 50 push %eax 80104c5b: 6a 02 push $0x2 80104c5d: e8 2e fc ff ff call 80104890 <argint> 80104c62: 83 c4 10 add $0x10,%esp 80104c65: 85 c0 test %eax,%eax 80104c67: 78 37 js 80104ca0 <sys_read+0x60> 80104c69: 8d 45 f4 lea -0xc(%ebp),%eax 80104c6c: 83 ec 04 sub $0x4,%esp 80104c6f: ff 75 f0 pushl -0x10(%ebp) 80104c72: 50 push %eax 80104c73: 6a 01 push $0x1 80104c75: e8 66 fc ff ff call 801048e0 <argptr> 80104c7a: 83 c4 10 add $0x10,%esp 80104c7d: 85 c0 test %eax,%eax 80104c7f: 78 1f js 80104ca0 <sys_read+0x60> return fileread(f, p, n); 80104c81: 83 ec 04 sub $0x4,%esp 80104c84: ff 75 f0 pushl -0x10(%ebp) 80104c87: ff 75 f4 pushl -0xc(%ebp) 80104c8a: ff 75 ec pushl -0x14(%ebp) 80104c8d: e8 ce c2 ff ff call 80100f60 <fileread> 80104c92: 83 c4 10 add $0x10,%esp } 80104c95: c9 leave 80104c96: c3 ret 80104c97: 89 f6 mov %esi,%esi 80104c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104ca0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ca5: c9 leave 80104ca6: c3 ret 80104ca7: 89 f6 mov %esi,%esi 80104ca9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104cb0 <sys_write>: { 80104cb0: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104cb1: 31 c0 xor %eax,%eax { 80104cb3: 89 e5 mov %esp,%ebp 80104cb5: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104cb8: 8d 55 ec lea -0x14(%ebp),%edx 80104cbb: e8 c0 fe ff ff call 80104b80 <argfd.constprop.1> 80104cc0: 85 c0 test %eax,%eax 80104cc2: 78 4c js 80104d10 <sys_write+0x60> 80104cc4: 8d 45 f0 lea -0x10(%ebp),%eax 80104cc7: 83 ec 08 sub $0x8,%esp 80104cca: 50 push %eax 80104ccb: 6a 02 push $0x2 80104ccd: e8 be fb ff ff call 80104890 <argint> 80104cd2: 83 c4 10 add $0x10,%esp 80104cd5: 85 c0 test %eax,%eax 80104cd7: 78 37 js 80104d10 <sys_write+0x60> 80104cd9: 8d 45 f4 lea -0xc(%ebp),%eax 80104cdc: 83 ec 04 sub $0x4,%esp 80104cdf: ff 75 f0 pushl -0x10(%ebp) 80104ce2: 50 push %eax 80104ce3: 6a 01 push $0x1 80104ce5: e8 f6 fb ff ff call 801048e0 <argptr> 80104cea: 83 c4 10 add $0x10,%esp 80104ced: 85 c0 test %eax,%eax 80104cef: 78 1f js 80104d10 <sys_write+0x60> return filewrite(f, p, n); 80104cf1: 83 ec 04 sub $0x4,%esp 80104cf4: ff 75 f0 pushl -0x10(%ebp) 80104cf7: ff 75 f4 pushl -0xc(%ebp) 80104cfa: ff 75 ec pushl -0x14(%ebp) 80104cfd: e8 ee c2 ff ff call 80100ff0 <filewrite> 80104d02: 83 c4 10 add $0x10,%esp } 80104d05: c9 leave 80104d06: c3 ret 80104d07: 89 f6 mov %esi,%esi 80104d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104d10: b8 ff ff ff ff mov $0xffffffff,%eax } 80104d15: c9 leave 80104d16: c3 ret 80104d17: 89 f6 mov %esi,%esi 80104d19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d20 <sys_close>: { 80104d20: 55 push %ebp 80104d21: 89 e5 mov %esp,%ebp 80104d23: 83 ec 18 sub $0x18,%esp if(argfd(0, &fd, &f) < 0) 80104d26: 8d 55 f4 lea -0xc(%ebp),%edx 80104d29: 8d 45 f0 lea -0x10(%ebp),%eax 80104d2c: e8 4f fe ff ff call 80104b80 <argfd.constprop.1> 80104d31: 85 c0 test %eax,%eax 80104d33: 78 2b js 80104d60 <sys_close+0x40> myproc()->ofile[fd] = 0; 80104d35: e8 a6 ea ff ff call 801037e0 <myproc> 80104d3a: 8b 55 f0 mov -0x10(%ebp),%edx fileclose(f); 80104d3d: 83 ec 0c sub $0xc,%esp myproc()->ofile[fd] = 0; 80104d40: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80104d47: 00 fileclose(f); 80104d48: ff 75 f4 pushl -0xc(%ebp) 80104d4b: e8 f0 c0 ff ff call 80100e40 <fileclose> return 0; 80104d50: 83 c4 10 add $0x10,%esp 80104d53: 31 c0 xor %eax,%eax } 80104d55: c9 leave 80104d56: c3 ret 80104d57: 89 f6 mov %esi,%esi 80104d59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104d60: b8 ff ff ff ff mov $0xffffffff,%eax } 80104d65: c9 leave 80104d66: c3 ret 80104d67: 89 f6 mov %esi,%esi 80104d69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d70 <sys_fstat>: { 80104d70: 55 push %ebp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104d71: 31 c0 xor %eax,%eax { 80104d73: 89 e5 mov %esp,%ebp 80104d75: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104d78: 8d 55 f0 lea -0x10(%ebp),%edx 80104d7b: e8 00 fe ff ff call 80104b80 <argfd.constprop.1> 80104d80: 85 c0 test %eax,%eax 80104d82: 78 2c js 80104db0 <sys_fstat+0x40> 80104d84: 8d 45 f4 lea -0xc(%ebp),%eax 80104d87: 83 ec 04 sub $0x4,%esp 80104d8a: 6a 14 push $0x14 80104d8c: 50 push %eax 80104d8d: 6a 01 push $0x1 80104d8f: e8 4c fb ff ff call 801048e0 <argptr> 80104d94: 83 c4 10 add $0x10,%esp 80104d97: 85 c0 test %eax,%eax 80104d99: 78 15 js 80104db0 <sys_fstat+0x40> return filestat(f, st); 80104d9b: 83 ec 08 sub $0x8,%esp 80104d9e: ff 75 f4 pushl -0xc(%ebp) 80104da1: ff 75 f0 pushl -0x10(%ebp) 80104da4: e8 67 c1 ff ff call 80100f10 <filestat> 80104da9: 83 c4 10 add $0x10,%esp } 80104dac: c9 leave 80104dad: c3 ret 80104dae: 66 90 xchg %ax,%ax return -1; 80104db0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104db5: c9 leave 80104db6: c3 ret 80104db7: 89 f6 mov %esi,%esi 80104db9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104dc0 <sys_link>: { 80104dc0: 55 push %ebp 80104dc1: 89 e5 mov %esp,%ebp 80104dc3: 57 push %edi 80104dc4: 56 push %esi 80104dc5: 53 push %ebx if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104dc6: 8d 45 d4 lea -0x2c(%ebp),%eax { 80104dc9: 83 ec 34 sub $0x34,%esp if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104dcc: 50 push %eax 80104dcd: 6a 00 push $0x0 80104dcf: e8 6c fb ff ff call 80104940 <argstr> 80104dd4: 83 c4 10 add $0x10,%esp 80104dd7: 85 c0 test %eax,%eax 80104dd9: 0f 88 fb 00 00 00 js 80104eda <sys_link+0x11a> 80104ddf: 8d 45 d0 lea -0x30(%ebp),%eax 80104de2: 83 ec 08 sub $0x8,%esp 80104de5: 50 push %eax 80104de6: 6a 01 push $0x1 80104de8: e8 53 fb ff ff call 80104940 <argstr> 80104ded: 83 c4 10 add $0x10,%esp 80104df0: 85 c0 test %eax,%eax 80104df2: 0f 88 e2 00 00 00 js 80104eda <sys_link+0x11a> begin_op(); 80104df8: e8 a3 dd ff ff call 80102ba0 <begin_op> if((ip = namei(old)) == 0){ 80104dfd: 83 ec 0c sub $0xc,%esp 80104e00: ff 75 d4 pushl -0x2c(%ebp) 80104e03: e8 d8 d0 ff ff call 80101ee0 <namei> 80104e08: 83 c4 10 add $0x10,%esp 80104e0b: 85 c0 test %eax,%eax 80104e0d: 89 c3 mov %eax,%ebx 80104e0f: 0f 84 ea 00 00 00 je 80104eff <sys_link+0x13f> ilock(ip); 80104e15: 83 ec 0c sub $0xc,%esp 80104e18: 50 push %eax 80104e19: e8 62 c8 ff ff call 80101680 <ilock> if(ip->type == T_DIR){ 80104e1e: 83 c4 10 add $0x10,%esp 80104e21: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104e26: 0f 84 bb 00 00 00 je 80104ee7 <sys_link+0x127> ip->nlink++; 80104e2c: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(ip); 80104e31: 83 ec 0c sub $0xc,%esp if((dp = nameiparent(new, name)) == 0) 80104e34: 8d 7d da lea -0x26(%ebp),%edi iupdate(ip); 80104e37: 53 push %ebx 80104e38: e8 93 c7 ff ff call 801015d0 <iupdate> iunlock(ip); 80104e3d: 89 1c 24 mov %ebx,(%esp) 80104e40: e8 1b c9 ff ff call 80101760 <iunlock> if((dp = nameiparent(new, name)) == 0) 80104e45: 58 pop %eax 80104e46: 5a pop %edx 80104e47: 57 push %edi 80104e48: ff 75 d0 pushl -0x30(%ebp) 80104e4b: e8 b0 d0 ff ff call 80101f00 <nameiparent> 80104e50: 83 c4 10 add $0x10,%esp 80104e53: 85 c0 test %eax,%eax 80104e55: 89 c6 mov %eax,%esi 80104e57: 74 5b je 80104eb4 <sys_link+0xf4> ilock(dp); 80104e59: 83 ec 0c sub $0xc,%esp 80104e5c: 50 push %eax 80104e5d: e8 1e c8 ff ff call 80101680 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 80104e62: 83 c4 10 add $0x10,%esp 80104e65: 8b 03 mov (%ebx),%eax 80104e67: 39 06 cmp %eax,(%esi) 80104e69: 75 3d jne 80104ea8 <sys_link+0xe8> 80104e6b: 83 ec 04 sub $0x4,%esp 80104e6e: ff 73 04 pushl 0x4(%ebx) 80104e71: 57 push %edi 80104e72: 56 push %esi 80104e73: e8 a8 cf ff ff call 80101e20 <dirlink> 80104e78: 83 c4 10 add $0x10,%esp 80104e7b: 85 c0 test %eax,%eax 80104e7d: 78 29 js 80104ea8 <sys_link+0xe8> iunlockput(dp); 80104e7f: 83 ec 0c sub $0xc,%esp 80104e82: 56 push %esi 80104e83: e8 88 ca ff ff call 80101910 <iunlockput> iput(ip); 80104e88: 89 1c 24 mov %ebx,(%esp) 80104e8b: e8 20 c9 ff ff call 801017b0 <iput> end_op(); 80104e90: e8 7b dd ff ff call 80102c10 <end_op> return 0; 80104e95: 83 c4 10 add $0x10,%esp 80104e98: 31 c0 xor %eax,%eax } 80104e9a: 8d 65 f4 lea -0xc(%ebp),%esp 80104e9d: 5b pop %ebx 80104e9e: 5e pop %esi 80104e9f: 5f pop %edi 80104ea0: 5d pop %ebp 80104ea1: c3 ret 80104ea2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi iunlockput(dp); 80104ea8: 83 ec 0c sub $0xc,%esp 80104eab: 56 push %esi 80104eac: e8 5f ca ff ff call 80101910 <iunlockput> goto bad; 80104eb1: 83 c4 10 add $0x10,%esp ilock(ip); 80104eb4: 83 ec 0c sub $0xc,%esp 80104eb7: 53 push %ebx 80104eb8: e8 c3 c7 ff ff call 80101680 <ilock> ip->nlink--; 80104ebd: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104ec2: 89 1c 24 mov %ebx,(%esp) 80104ec5: e8 06 c7 ff ff call 801015d0 <iupdate> iunlockput(ip); 80104eca: 89 1c 24 mov %ebx,(%esp) 80104ecd: e8 3e ca ff ff call 80101910 <iunlockput> end_op(); 80104ed2: e8 39 dd ff ff call 80102c10 <end_op> return -1; 80104ed7: 83 c4 10 add $0x10,%esp } 80104eda: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80104edd: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ee2: 5b pop %ebx 80104ee3: 5e pop %esi 80104ee4: 5f pop %edi 80104ee5: 5d pop %ebp 80104ee6: c3 ret iunlockput(ip); 80104ee7: 83 ec 0c sub $0xc,%esp 80104eea: 53 push %ebx 80104eeb: e8 20 ca ff ff call 80101910 <iunlockput> end_op(); 80104ef0: e8 1b dd ff ff call 80102c10 <end_op> return -1; 80104ef5: 83 c4 10 add $0x10,%esp 80104ef8: b8 ff ff ff ff mov $0xffffffff,%eax 80104efd: eb 9b jmp 80104e9a <sys_link+0xda> end_op(); 80104eff: e8 0c dd ff ff call 80102c10 <end_op> return -1; 80104f04: b8 ff ff ff ff mov $0xffffffff,%eax 80104f09: eb 8f jmp 80104e9a <sys_link+0xda> 80104f0b: 90 nop 80104f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104f10 <sys_unlink>: { 80104f10: 55 push %ebp 80104f11: 89 e5 mov %esp,%ebp 80104f13: 57 push %edi 80104f14: 56 push %esi 80104f15: 53 push %ebx if(argstr(0, &path) < 0) 80104f16: 8d 45 c0 lea -0x40(%ebp),%eax { 80104f19: 83 ec 44 sub $0x44,%esp if(argstr(0, &path) < 0) 80104f1c: 50 push %eax 80104f1d: 6a 00 push $0x0 80104f1f: e8 1c fa ff ff call 80104940 <argstr> 80104f24: 83 c4 10 add $0x10,%esp 80104f27: 85 c0 test %eax,%eax 80104f29: 0f 88 77 01 00 00 js 801050a6 <sys_unlink+0x196> if((dp = nameiparent(path, name)) == 0){ 80104f2f: 8d 5d ca lea -0x36(%ebp),%ebx begin_op(); 80104f32: e8 69 dc ff ff call 80102ba0 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80104f37: 83 ec 08 sub $0x8,%esp 80104f3a: 53 push %ebx 80104f3b: ff 75 c0 pushl -0x40(%ebp) 80104f3e: e8 bd cf ff ff call 80101f00 <nameiparent> 80104f43: 83 c4 10 add $0x10,%esp 80104f46: 85 c0 test %eax,%eax 80104f48: 89 c6 mov %eax,%esi 80104f4a: 0f 84 60 01 00 00 je 801050b0 <sys_unlink+0x1a0> ilock(dp); 80104f50: 83 ec 0c sub $0xc,%esp 80104f53: 50 push %eax 80104f54: e8 27 c7 ff ff call 80101680 <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80104f59: 58 pop %eax 80104f5a: 5a pop %edx 80104f5b: 68 04 7f 10 80 push $0x80107f04 80104f60: 53 push %ebx 80104f61: e8 2a cc ff ff call 80101b90 <namecmp> 80104f66: 83 c4 10 add $0x10,%esp 80104f69: 85 c0 test %eax,%eax 80104f6b: 0f 84 03 01 00 00 je 80105074 <sys_unlink+0x164> 80104f71: 83 ec 08 sub $0x8,%esp 80104f74: 68 03 7f 10 80 push $0x80107f03 80104f79: 53 push %ebx 80104f7a: e8 11 cc ff ff call 80101b90 <namecmp> 80104f7f: 83 c4 10 add $0x10,%esp 80104f82: 85 c0 test %eax,%eax 80104f84: 0f 84 ea 00 00 00 je 80105074 <sys_unlink+0x164> if((ip = dirlookup(dp, name, &off)) == 0) 80104f8a: 8d 45 c4 lea -0x3c(%ebp),%eax 80104f8d: 83 ec 04 sub $0x4,%esp 80104f90: 50 push %eax 80104f91: 53 push %ebx 80104f92: 56 push %esi 80104f93: e8 18 cc ff ff call 80101bb0 <dirlookup> 80104f98: 83 c4 10 add $0x10,%esp 80104f9b: 85 c0 test %eax,%eax 80104f9d: 89 c3 mov %eax,%ebx 80104f9f: 0f 84 cf 00 00 00 je 80105074 <sys_unlink+0x164> ilock(ip); 80104fa5: 83 ec 0c sub $0xc,%esp 80104fa8: 50 push %eax 80104fa9: e8 d2 c6 ff ff call 80101680 <ilock> if(ip->nlink < 1) 80104fae: 83 c4 10 add $0x10,%esp 80104fb1: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80104fb6: 0f 8e 10 01 00 00 jle 801050cc <sys_unlink+0x1bc> if(ip->type == T_DIR && !isdirempty(ip)){ 80104fbc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104fc1: 74 6d je 80105030 <sys_unlink+0x120> memset(&de, 0, sizeof(de)); 80104fc3: 8d 45 d8 lea -0x28(%ebp),%eax 80104fc6: 83 ec 04 sub $0x4,%esp 80104fc9: 6a 10 push $0x10 80104fcb: 6a 00 push $0x0 80104fcd: 50 push %eax 80104fce: e8 bd f5 ff ff call 80104590 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104fd3: 8d 45 d8 lea -0x28(%ebp),%eax 80104fd6: 6a 10 push $0x10 80104fd8: ff 75 c4 pushl -0x3c(%ebp) 80104fdb: 50 push %eax 80104fdc: 56 push %esi 80104fdd: e8 7e ca ff ff call 80101a60 <writei> 80104fe2: 83 c4 20 add $0x20,%esp 80104fe5: 83 f8 10 cmp $0x10,%eax 80104fe8: 0f 85 eb 00 00 00 jne 801050d9 <sys_unlink+0x1c9> if(ip->type == T_DIR){ 80104fee: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104ff3: 0f 84 97 00 00 00 je 80105090 <sys_unlink+0x180> iunlockput(dp); 80104ff9: 83 ec 0c sub $0xc,%esp 80104ffc: 56 push %esi 80104ffd: e8 0e c9 ff ff call 80101910 <iunlockput> ip->nlink--; 80105002: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80105007: 89 1c 24 mov %ebx,(%esp) 8010500a: e8 c1 c5 ff ff call 801015d0 <iupdate> iunlockput(ip); 8010500f: 89 1c 24 mov %ebx,(%esp) 80105012: e8 f9 c8 ff ff call 80101910 <iunlockput> end_op(); 80105017: e8 f4 db ff ff call 80102c10 <end_op> return 0; 8010501c: 83 c4 10 add $0x10,%esp 8010501f: 31 c0 xor %eax,%eax } 80105021: 8d 65 f4 lea -0xc(%ebp),%esp 80105024: 5b pop %ebx 80105025: 5e pop %esi 80105026: 5f pop %edi 80105027: 5d pop %ebp 80105028: c3 ret 80105029: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80105030: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80105034: 76 8d jbe 80104fc3 <sys_unlink+0xb3> 80105036: bf 20 00 00 00 mov $0x20,%edi 8010503b: eb 0f jmp 8010504c <sys_unlink+0x13c> 8010503d: 8d 76 00 lea 0x0(%esi),%esi 80105040: 83 c7 10 add $0x10,%edi 80105043: 3b 7b 58 cmp 0x58(%ebx),%edi 80105046: 0f 83 77 ff ff ff jae 80104fc3 <sys_unlink+0xb3> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 8010504c: 8d 45 d8 lea -0x28(%ebp),%eax 8010504f: 6a 10 push $0x10 80105051: 57 push %edi 80105052: 50 push %eax 80105053: 53 push %ebx 80105054: e8 07 c9 ff ff call 80101960 <readi> 80105059: 83 c4 10 add $0x10,%esp 8010505c: 83 f8 10 cmp $0x10,%eax 8010505f: 75 5e jne 801050bf <sys_unlink+0x1af> if(de.inum != 0) 80105061: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80105066: 74 d8 je 80105040 <sys_unlink+0x130> iunlockput(ip); 80105068: 83 ec 0c sub $0xc,%esp 8010506b: 53 push %ebx 8010506c: e8 9f c8 ff ff call 80101910 <iunlockput> goto bad; 80105071: 83 c4 10 add $0x10,%esp iunlockput(dp); 80105074: 83 ec 0c sub $0xc,%esp 80105077: 56 push %esi 80105078: e8 93 c8 ff ff call 80101910 <iunlockput> end_op(); 8010507d: e8 8e db ff ff call 80102c10 <end_op> return -1; 80105082: 83 c4 10 add $0x10,%esp 80105085: b8 ff ff ff ff mov $0xffffffff,%eax 8010508a: eb 95 jmp 80105021 <sys_unlink+0x111> 8010508c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink--; 80105090: 66 83 6e 56 01 subw $0x1,0x56(%esi) iupdate(dp); 80105095: 83 ec 0c sub $0xc,%esp 80105098: 56 push %esi 80105099: e8 32 c5 ff ff call 801015d0 <iupdate> 8010509e: 83 c4 10 add $0x10,%esp 801050a1: e9 53 ff ff ff jmp 80104ff9 <sys_unlink+0xe9> return -1; 801050a6: b8 ff ff ff ff mov $0xffffffff,%eax 801050ab: e9 71 ff ff ff jmp 80105021 <sys_unlink+0x111> end_op(); 801050b0: e8 5b db ff ff call 80102c10 <end_op> return -1; 801050b5: b8 ff ff ff ff mov $0xffffffff,%eax 801050ba: e9 62 ff ff ff jmp 80105021 <sys_unlink+0x111> panic("isdirempty: readi"); 801050bf: 83 ec 0c sub $0xc,%esp 801050c2: 68 28 7f 10 80 push $0x80107f28 801050c7: e8 c4 b2 ff ff call 80100390 <panic> panic("unlink: nlink < 1"); 801050cc: 83 ec 0c sub $0xc,%esp 801050cf: 68 16 7f 10 80 push $0x80107f16 801050d4: e8 b7 b2 ff ff call 80100390 <panic> panic("unlink: writei"); 801050d9: 83 ec 0c sub $0xc,%esp 801050dc: 68 3a 7f 10 80 push $0x80107f3a 801050e1: e8 aa b2 ff ff call 80100390 <panic> 801050e6: 8d 76 00 lea 0x0(%esi),%esi 801050e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801050f0 <sys_open>: int sys_open(void) { 801050f0: 55 push %ebp 801050f1: 89 e5 mov %esp,%ebp 801050f3: 57 push %edi 801050f4: 56 push %esi 801050f5: 53 push %ebx char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 801050f6: 8d 45 e0 lea -0x20(%ebp),%eax { 801050f9: 83 ec 24 sub $0x24,%esp if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 801050fc: 50 push %eax 801050fd: 6a 00 push $0x0 801050ff: e8 3c f8 ff ff call 80104940 <argstr> 80105104: 83 c4 10 add $0x10,%esp 80105107: 85 c0 test %eax,%eax 80105109: 0f 88 1d 01 00 00 js 8010522c <sys_open+0x13c> 8010510f: 8d 45 e4 lea -0x1c(%ebp),%eax 80105112: 83 ec 08 sub $0x8,%esp 80105115: 50 push %eax 80105116: 6a 01 push $0x1 80105118: e8 73 f7 ff ff call 80104890 <argint> 8010511d: 83 c4 10 add $0x10,%esp 80105120: 85 c0 test %eax,%eax 80105122: 0f 88 04 01 00 00 js 8010522c <sys_open+0x13c> return -1; begin_op(); 80105128: e8 73 da ff ff call 80102ba0 <begin_op> if(omode & O_CREATE){ 8010512d: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80105131: 0f 85 a9 00 00 00 jne 801051e0 <sys_open+0xf0> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 80105137: 83 ec 0c sub $0xc,%esp 8010513a: ff 75 e0 pushl -0x20(%ebp) 8010513d: e8 9e cd ff ff call 80101ee0 <namei> 80105142: 83 c4 10 add $0x10,%esp 80105145: 85 c0 test %eax,%eax 80105147: 89 c6 mov %eax,%esi 80105149: 0f 84 b2 00 00 00 je 80105201 <sys_open+0x111> end_op(); return -1; } ilock(ip); 8010514f: 83 ec 0c sub $0xc,%esp 80105152: 50 push %eax 80105153: e8 28 c5 ff ff call 80101680 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 80105158: 83 c4 10 add $0x10,%esp 8010515b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80105160: 0f 84 aa 00 00 00 je 80105210 <sys_open+0x120> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 80105166: e8 15 bc ff ff call 80100d80 <filealloc> 8010516b: 85 c0 test %eax,%eax 8010516d: 89 c7 mov %eax,%edi 8010516f: 0f 84 a6 00 00 00 je 8010521b <sys_open+0x12b> struct proc *curproc = myproc(); 80105175: e8 66 e6 ff ff call 801037e0 <myproc> for(fd = 0; fd < NOFILE; fd++){ 8010517a: 31 db xor %ebx,%ebx 8010517c: eb 0e jmp 8010518c <sys_open+0x9c> 8010517e: 66 90 xchg %ax,%ax 80105180: 83 c3 01 add $0x1,%ebx 80105183: 83 fb 10 cmp $0x10,%ebx 80105186: 0f 84 ac 00 00 00 je 80105238 <sys_open+0x148> if(curproc->ofile[fd] == 0){ 8010518c: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105190: 85 d2 test %edx,%edx 80105192: 75 ec jne 80105180 <sys_open+0x90> fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105194: 83 ec 0c sub $0xc,%esp curproc->ofile[fd] = f; 80105197: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) iunlock(ip); 8010519b: 56 push %esi 8010519c: e8 bf c5 ff ff call 80101760 <iunlock> end_op(); 801051a1: e8 6a da ff ff call 80102c10 <end_op> f->type = FD_INODE; 801051a6: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 801051ac: 8b 55 e4 mov -0x1c(%ebp),%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051af: 83 c4 10 add $0x10,%esp f->ip = ip; 801051b2: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 801051b5: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 801051bc: 89 d0 mov %edx,%eax 801051be: f7 d0 not %eax 801051c0: 83 e0 01 and $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051c3: 83 e2 03 and $0x3,%edx f->readable = !(omode & O_WRONLY); 801051c6: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801051c9: 0f 95 47 09 setne 0x9(%edi) return fd; } 801051cd: 8d 65 f4 lea -0xc(%ebp),%esp 801051d0: 89 d8 mov %ebx,%eax 801051d2: 5b pop %ebx 801051d3: 5e pop %esi 801051d4: 5f pop %edi 801051d5: 5d pop %ebp 801051d6: c3 ret 801051d7: 89 f6 mov %esi,%esi 801051d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip = create(path, T_FILE, 0, 0); 801051e0: 83 ec 0c sub $0xc,%esp 801051e3: 8b 45 e0 mov -0x20(%ebp),%eax 801051e6: 31 c9 xor %ecx,%ecx 801051e8: 6a 00 push $0x0 801051ea: ba 02 00 00 00 mov $0x2,%edx 801051ef: e8 ec f7 ff ff call 801049e0 <create> if(ip == 0){ 801051f4: 83 c4 10 add $0x10,%esp 801051f7: 85 c0 test %eax,%eax ip = create(path, T_FILE, 0, 0); 801051f9: 89 c6 mov %eax,%esi if(ip == 0){ 801051fb: 0f 85 65 ff ff ff jne 80105166 <sys_open+0x76> end_op(); 80105201: e8 0a da ff ff call 80102c10 <end_op> return -1; 80105206: bb ff ff ff ff mov $0xffffffff,%ebx 8010520b: eb c0 jmp 801051cd <sys_open+0xdd> 8010520d: 8d 76 00 lea 0x0(%esi),%esi if(ip->type == T_DIR && omode != O_RDONLY){ 80105210: 8b 4d e4 mov -0x1c(%ebp),%ecx 80105213: 85 c9 test %ecx,%ecx 80105215: 0f 84 4b ff ff ff je 80105166 <sys_open+0x76> iunlockput(ip); 8010521b: 83 ec 0c sub $0xc,%esp 8010521e: 56 push %esi 8010521f: e8 ec c6 ff ff call 80101910 <iunlockput> end_op(); 80105224: e8 e7 d9 ff ff call 80102c10 <end_op> return -1; 80105229: 83 c4 10 add $0x10,%esp 8010522c: bb ff ff ff ff mov $0xffffffff,%ebx 80105231: eb 9a jmp 801051cd <sys_open+0xdd> 80105233: 90 nop 80105234: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fileclose(f); 80105238: 83 ec 0c sub $0xc,%esp 8010523b: 57 push %edi 8010523c: e8 ff bb ff ff call 80100e40 <fileclose> 80105241: 83 c4 10 add $0x10,%esp 80105244: eb d5 jmp 8010521b <sys_open+0x12b> 80105246: 8d 76 00 lea 0x0(%esi),%esi 80105249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105250 <sys_mkdir>: int sys_mkdir(void) { 80105250: 55 push %ebp 80105251: 89 e5 mov %esp,%ebp 80105253: 83 ec 18 sub $0x18,%esp char *path; struct inode *ip; begin_op(); 80105256: e8 45 d9 ff ff call 80102ba0 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 8010525b: 8d 45 f4 lea -0xc(%ebp),%eax 8010525e: 83 ec 08 sub $0x8,%esp 80105261: 50 push %eax 80105262: 6a 00 push $0x0 80105264: e8 d7 f6 ff ff call 80104940 <argstr> 80105269: 83 c4 10 add $0x10,%esp 8010526c: 85 c0 test %eax,%eax 8010526e: 78 30 js 801052a0 <sys_mkdir+0x50> 80105270: 83 ec 0c sub $0xc,%esp 80105273: 8b 45 f4 mov -0xc(%ebp),%eax 80105276: 31 c9 xor %ecx,%ecx 80105278: 6a 00 push $0x0 8010527a: ba 01 00 00 00 mov $0x1,%edx 8010527f: e8 5c f7 ff ff call 801049e0 <create> 80105284: 83 c4 10 add $0x10,%esp 80105287: 85 c0 test %eax,%eax 80105289: 74 15 je 801052a0 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 8010528b: 83 ec 0c sub $0xc,%esp 8010528e: 50 push %eax 8010528f: e8 7c c6 ff ff call 80101910 <iunlockput> end_op(); 80105294: e8 77 d9 ff ff call 80102c10 <end_op> return 0; 80105299: 83 c4 10 add $0x10,%esp 8010529c: 31 c0 xor %eax,%eax } 8010529e: c9 leave 8010529f: c3 ret end_op(); 801052a0: e8 6b d9 ff ff call 80102c10 <end_op> return -1; 801052a5: b8 ff ff ff ff mov $0xffffffff,%eax } 801052aa: c9 leave 801052ab: c3 ret 801052ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801052b0 <sys_mknod>: int sys_mknod(void) { 801052b0: 55 push %ebp 801052b1: 89 e5 mov %esp,%ebp 801052b3: 83 ec 18 sub $0x18,%esp struct inode *ip; char *path; int major, minor; begin_op(); 801052b6: e8 e5 d8 ff ff call 80102ba0 <begin_op> if((argstr(0, &path)) < 0 || 801052bb: 8d 45 ec lea -0x14(%ebp),%eax 801052be: 83 ec 08 sub $0x8,%esp 801052c1: 50 push %eax 801052c2: 6a 00 push $0x0 801052c4: e8 77 f6 ff ff call 80104940 <argstr> 801052c9: 83 c4 10 add $0x10,%esp 801052cc: 85 c0 test %eax,%eax 801052ce: 78 60 js 80105330 <sys_mknod+0x80> argint(1, &major) < 0 || 801052d0: 8d 45 f0 lea -0x10(%ebp),%eax 801052d3: 83 ec 08 sub $0x8,%esp 801052d6: 50 push %eax 801052d7: 6a 01 push $0x1 801052d9: e8 b2 f5 ff ff call 80104890 <argint> if((argstr(0, &path)) < 0 || 801052de: 83 c4 10 add $0x10,%esp 801052e1: 85 c0 test %eax,%eax 801052e3: 78 4b js 80105330 <sys_mknod+0x80> argint(2, &minor) < 0 || 801052e5: 8d 45 f4 lea -0xc(%ebp),%eax 801052e8: 83 ec 08 sub $0x8,%esp 801052eb: 50 push %eax 801052ec: 6a 02 push $0x2 801052ee: e8 9d f5 ff ff call 80104890 <argint> argint(1, &major) < 0 || 801052f3: 83 c4 10 add $0x10,%esp 801052f6: 85 c0 test %eax,%eax 801052f8: 78 36 js 80105330 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ 801052fa: 0f bf 45 f4 movswl -0xc(%ebp),%eax argint(2, &minor) < 0 || 801052fe: 83 ec 0c sub $0xc,%esp (ip = create(path, T_DEV, major, minor)) == 0){ 80105301: 0f bf 4d f0 movswl -0x10(%ebp),%ecx argint(2, &minor) < 0 || 80105305: ba 03 00 00 00 mov $0x3,%edx 8010530a: 50 push %eax 8010530b: 8b 45 ec mov -0x14(%ebp),%eax 8010530e: e8 cd f6 ff ff call 801049e0 <create> 80105313: 83 c4 10 add $0x10,%esp 80105316: 85 c0 test %eax,%eax 80105318: 74 16 je 80105330 <sys_mknod+0x80> end_op(); return -1; } iunlockput(ip); 8010531a: 83 ec 0c sub $0xc,%esp 8010531d: 50 push %eax 8010531e: e8 ed c5 ff ff call 80101910 <iunlockput> end_op(); 80105323: e8 e8 d8 ff ff call 80102c10 <end_op> return 0; 80105328: 83 c4 10 add $0x10,%esp 8010532b: 31 c0 xor %eax,%eax } 8010532d: c9 leave 8010532e: c3 ret 8010532f: 90 nop end_op(); 80105330: e8 db d8 ff ff call 80102c10 <end_op> return -1; 80105335: b8 ff ff ff ff mov $0xffffffff,%eax } 8010533a: c9 leave 8010533b: c3 ret 8010533c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105340 <sys_chdir>: int sys_chdir(void) { 80105340: 55 push %ebp 80105341: 89 e5 mov %esp,%ebp 80105343: 56 push %esi 80105344: 53 push %ebx 80105345: 83 ec 10 sub $0x10,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 80105348: e8 93 e4 ff ff call 801037e0 <myproc> 8010534d: 89 c6 mov %eax,%esi begin_op(); 8010534f: e8 4c d8 ff ff call 80102ba0 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 80105354: 8d 45 f4 lea -0xc(%ebp),%eax 80105357: 83 ec 08 sub $0x8,%esp 8010535a: 50 push %eax 8010535b: 6a 00 push $0x0 8010535d: e8 de f5 ff ff call 80104940 <argstr> 80105362: 83 c4 10 add $0x10,%esp 80105365: 85 c0 test %eax,%eax 80105367: 78 77 js 801053e0 <sys_chdir+0xa0> 80105369: 83 ec 0c sub $0xc,%esp 8010536c: ff 75 f4 pushl -0xc(%ebp) 8010536f: e8 6c cb ff ff call 80101ee0 <namei> 80105374: 83 c4 10 add $0x10,%esp 80105377: 85 c0 test %eax,%eax 80105379: 89 c3 mov %eax,%ebx 8010537b: 74 63 je 801053e0 <sys_chdir+0xa0> end_op(); return -1; } ilock(ip); 8010537d: 83 ec 0c sub $0xc,%esp 80105380: 50 push %eax 80105381: e8 fa c2 ff ff call 80101680 <ilock> if(ip->type != T_DIR){ 80105386: 83 c4 10 add $0x10,%esp 80105389: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 8010538e: 75 30 jne 801053c0 <sys_chdir+0x80> iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105390: 83 ec 0c sub $0xc,%esp 80105393: 53 push %ebx 80105394: e8 c7 c3 ff ff call 80101760 <iunlock> iput(curproc->cwd); 80105399: 58 pop %eax 8010539a: ff 76 68 pushl 0x68(%esi) 8010539d: e8 0e c4 ff ff call 801017b0 <iput> end_op(); 801053a2: e8 69 d8 ff ff call 80102c10 <end_op> curproc->cwd = ip; 801053a7: 89 5e 68 mov %ebx,0x68(%esi) return 0; 801053aa: 83 c4 10 add $0x10,%esp 801053ad: 31 c0 xor %eax,%eax } 801053af: 8d 65 f8 lea -0x8(%ebp),%esp 801053b2: 5b pop %ebx 801053b3: 5e pop %esi 801053b4: 5d pop %ebp 801053b5: c3 ret 801053b6: 8d 76 00 lea 0x0(%esi),%esi 801053b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi iunlockput(ip); 801053c0: 83 ec 0c sub $0xc,%esp 801053c3: 53 push %ebx 801053c4: e8 47 c5 ff ff call 80101910 <iunlockput> end_op(); 801053c9: e8 42 d8 ff ff call 80102c10 <end_op> return -1; 801053ce: 83 c4 10 add $0x10,%esp 801053d1: b8 ff ff ff ff mov $0xffffffff,%eax 801053d6: eb d7 jmp 801053af <sys_chdir+0x6f> 801053d8: 90 nop 801053d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi end_op(); 801053e0: e8 2b d8 ff ff call 80102c10 <end_op> return -1; 801053e5: b8 ff ff ff ff mov $0xffffffff,%eax 801053ea: eb c3 jmp 801053af <sys_chdir+0x6f> 801053ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801053f0 <sys_mv>: int sys_mv(void){ 801053f0: 55 push %ebp 801053f1: 89 e5 mov %esp,%ebp 801053f3: 57 push %edi 801053f4: 56 push %esi 801053f5: 53 push %ebx 801053f6: 83 ec 7c sub $0x7c,%esp char *path1, *path2, *path3; //to take given arguments struct inode *ip, *dp, *kp, *ep; //inodes for respective arguments struct proc *curproc= myproc(); //getting current process going ie. mv 801053f9: e8 e2 e3 ff ff call 801037e0 <myproc> 801053fe: 89 c6 mov %eax,%esi 80105400: 89 45 80 mov %eax,-0x80(%ebp) begin_op(); // acts like a lock , controls the system 80105403: e8 98 d7 ff ff call 80102ba0 <begin_op> dp = curproc->cwd; //getting inode to current working directory 80105408: 8b 46 68 mov 0x68(%esi),%eax if(argstr(0, &path1) < 0 || (ip=namei(path1)) == 0) { //checking for if path1 present and if its inode not present 8010540b: 83 ec 08 sub $0x8,%esp dp = curproc->cwd; //getting inode to current working directory 8010540e: 89 85 7c ff ff ff mov %eax,-0x84(%ebp) if(argstr(0, &path1) < 0 || (ip=namei(path1)) == 0) { //checking for if path1 present and if its inode not present 80105414: 8d 45 8c lea -0x74(%ebp),%eax 80105417: 50 push %eax 80105418: 6a 00 push $0x0 8010541a: e8 21 f5 ff ff call 80104940 <argstr> 8010541f: 83 c4 10 add $0x10,%esp 80105422: 85 c0 test %eax,%eax 80105424: 0f 88 be 03 00 00 js 801057e8 <sys_mv+0x3f8> 8010542a: 83 ec 0c sub $0xc,%esp 8010542d: ff 75 8c pushl -0x74(%ebp) 80105430: e8 ab ca ff ff call 80101ee0 <namei> 80105435: 83 c4 10 add $0x10,%esp 80105438: 85 c0 test %eax,%eax 8010543a: 89 c3 mov %eax,%ebx 8010543c: 0f 84 a6 03 00 00 je 801057e8 <sys_mv+0x3f8> cprintf(" Written by Shivam Marathe\n"); } end_op();//end of operation unlock the process. return -1; } ilock(ip);//locking inode of path1 for making potential changes 80105442: 83 ec 0c sub $0xc,%esp 80105445: 50 push %eax 80105446: e8 35 c2 ff ff call 80101680 <ilock> if(argstr(1, &path2) < 0) { 8010544b: 5e pop %esi 8010544c: 8d 45 90 lea -0x70(%ebp),%eax 8010544f: 5f pop %edi 80105450: 50 push %eax 80105451: 6a 01 push $0x1 80105453: e8 e8 f4 ff ff call 80104940 <argstr> 80105458: 83 c4 10 add $0x10,%esp 8010545b: 85 c0 test %eax,%eax 8010545d: 0f 88 f8 03 00 00 js 8010585b <sys_mv+0x46b> iunlock(ip); end_op(); return -1; } if(argstr(2, &path3) > 0 && ((strncmp(path3, "-n", DIRSIZ) == 0) && (ep=namei(path2)) != 0)) { 80105463: 8d 45 94 lea -0x6c(%ebp),%eax 80105466: 83 ec 08 sub $0x8,%esp 80105469: 50 push %eax 8010546a: 6a 02 push $0x2 8010546c: e8 cf f4 ff ff call 80104940 <argstr> 80105471: 83 c4 10 add $0x10,%esp 80105474: 85 c0 test %eax,%eax 80105476: 7e 19 jle 80105491 <sys_mv+0xa1> 80105478: 83 ec 04 sub $0x4,%esp 8010547b: 6a 0e push $0xe 8010547d: 68 a6 7f 10 80 push $0x80107fa6 80105482: ff 75 94 pushl -0x6c(%ebp) 80105485: e8 26 f2 ff ff call 801046b0 <strncmp> 8010548a: 83 c4 10 add $0x10,%esp 8010548d: 85 c0 test %eax,%eax 8010548f: 74 7f je 80105510 <sys_mv+0x120> safestrcpy(path1, "", DIRSIZ); safestrcpy(path2, "", DIRSIZ); safestrcpy(path3, "", DIRSIZ); //function to copy null terminated string return -1; } if((kp=namei(path2)) != 0 && (kp->type== T_FILE || kp->type==T_DIR)){ 80105491: 83 ec 0c sub $0xc,%esp 80105494: ff 75 90 pushl -0x70(%ebp) 80105497: e8 44 ca ff ff call 80101ee0 <namei> 8010549c: 83 c4 10 add $0x10,%esp 8010549f: 85 c0 test %eax,%eax 801054a1: 74 11 je 801054b4 <sys_mv+0xc4> 801054a3: 0f b7 40 50 movzwl 0x50(%eax),%eax 801054a7: 83 e8 01 sub $0x1,%eax 801054aa: 66 83 f8 01 cmp $0x1,%ax 801054ae: 0f 86 6c 02 00 00 jbe 80105720 <sys_mv+0x330> ap->nlink--;//decreasing the links to self node iupdate(ap); //updating info iunlockput(ap); //send it back to storage } if(ip->type == T_FILE){ 801054b4: 0f b7 43 50 movzwl 0x50(%ebx),%eax 801054b8: 66 83 f8 02 cmp $0x2,%ax 801054bc: 0f 84 d6 01 00 00 je 80105698 <sys_mv+0x2a8> safestrcpy(path1, "", DIRSIZ); safestrcpy(path2, "", DIRSIZ); safestrcpy(path1, "", DIRSIZ); return 0; } else if(ip->type == T_DIR){ 801054c2: 66 83 f8 01 cmp $0x1,%ax 801054c6: 0f 84 bc 00 00 00 je 80105588 <sys_mv+0x198> safestrcpy(path1, "", DIRSIZ); safestrcpy(path2, "", DIRSIZ); safestrcpy(path1, "", DIRSIZ); return 0; } safestrcpy(path1, "", DIRSIZ); 801054cc: 83 ec 04 sub $0x4,%esp 801054cf: 6a 0e push $0xe 801054d1: 68 74 82 10 80 push $0x80108274 801054d6: ff 75 8c pushl -0x74(%ebp) 801054d9: e8 92 f2 ff ff call 80104770 <safestrcpy> safestrcpy(path2, "", DIRSIZ); 801054de: 83 c4 0c add $0xc,%esp 801054e1: 6a 0e push $0xe 801054e3: 68 74 82 10 80 push $0x80108274 801054e8: ff 75 90 pushl -0x70(%ebp) 801054eb: e8 80 f2 ff ff call 80104770 <safestrcpy> safestrcpy(path3, "", DIRSIZ); 801054f0: 83 c4 0c add $0xc,%esp 801054f3: 6a 0e push $0xe 801054f5: 68 74 82 10 80 push $0x80108274 801054fa: ff 75 94 pushl -0x6c(%ebp) 801054fd: e8 6e f2 ff ff call 80104770 <safestrcpy> return 0; 80105502: 83 c4 10 add $0x10,%esp 80105505: 31 c0 xor %eax,%eax } 80105507: 8d 65 f4 lea -0xc(%ebp),%esp 8010550a: 5b pop %ebx 8010550b: 5e pop %esi 8010550c: 5f pop %edi 8010550d: 5d pop %ebp 8010550e: c3 ret 8010550f: 90 nop if(argstr(2, &path3) > 0 && ((strncmp(path3, "-n", DIRSIZ) == 0) && (ep=namei(path2)) != 0)) { 80105510: 83 ec 0c sub $0xc,%esp 80105513: ff 75 90 pushl -0x70(%ebp) 80105516: e8 c5 c9 ff ff call 80101ee0 <namei> 8010551b: 83 c4 10 add $0x10,%esp 8010551e: 85 c0 test %eax,%eax 80105520: 0f 84 6b ff ff ff je 80105491 <sys_mv+0xa1> iunlock(ip); 80105526: 83 ec 0c sub $0xc,%esp 80105529: 53 push %ebx 8010552a: e8 31 c2 ff ff call 80101760 <iunlock> cprintf("%s alredy exists\n", path2); //checking for -n command 8010552f: 5a pop %edx 80105530: 59 pop %ecx 80105531: ff 75 90 pushl -0x70(%ebp) 80105534: 68 a9 7f 10 80 push $0x80107fa9 80105539: e8 22 b1 ff ff call 80100660 <cprintf> end_op(); 8010553e: e8 cd d6 ff ff call 80102c10 <end_op> safestrcpy(path1, "", DIRSIZ); 80105543: 83 c4 0c add $0xc,%esp 80105546: 6a 0e push $0xe 80105548: 68 74 82 10 80 push $0x80108274 8010554d: ff 75 8c pushl -0x74(%ebp) 80105550: e8 1b f2 ff ff call 80104770 <safestrcpy> safestrcpy(path2, "", DIRSIZ); 80105555: 83 c4 0c add $0xc,%esp 80105558: 6a 0e push $0xe 8010555a: 68 74 82 10 80 push $0x80108274 8010555f: ff 75 90 pushl -0x70(%ebp) 80105562: e8 09 f2 ff ff call 80104770 <safestrcpy> safestrcpy(path3, "", DIRSIZ); //function to copy null terminated string 80105567: 83 c4 0c add $0xc,%esp 8010556a: 6a 0e push $0xe 8010556c: 68 74 82 10 80 push $0x80108274 80105571: ff 75 94 pushl -0x6c(%ebp) 80105574: e8 f7 f1 ff ff call 80104770 <safestrcpy> return -1; 80105579: 83 c4 10 add $0x10,%esp 8010557c: b8 ff ff ff ff mov $0xffffffff,%eax 80105581: eb 84 jmp 80105507 <sys_mv+0x117> 80105583: 90 nop 80105584: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi parent = dirlookup(ip, "..", 0); //getting inode of parent directory 80105588: 83 ec 04 sub $0x4,%esp 8010558b: 6a 00 push $0x0 8010558d: 68 03 7f 10 80 push $0x80107f03 80105592: 53 push %ebx 80105593: e8 18 c6 ff ff call 80101bb0 <dirlookup> 80105598: 89 c6 mov %eax,%esi ilock(parent); 8010559a: 89 04 24 mov %eax,(%esp) 8010559d: e8 de c0 ff ff call 80101680 <ilock> for(off = 0; off < (parent->size); off += sizeof(de)){ 801055a2: 8b 7e 58 mov 0x58(%esi),%edi 801055a5: 83 c4 10 add $0x10,%esp 801055a8: 85 ff test %edi,%edi 801055aa: 0f 84 a0 02 00 00 je 80105850 <sys_mv+0x460> 801055b0: 8d 45 d8 lea -0x28(%ebp),%eax 801055b3: 31 ff xor %edi,%edi 801055b5: 89 45 84 mov %eax,-0x7c(%ebp) 801055b8: 89 f0 mov %esi,%eax 801055ba: 89 de mov %ebx,%esi 801055bc: 89 c3 mov %eax,%ebx 801055be: eb 08 jmp 801055c8 <sys_mv+0x1d8> 801055c0: 83 c7 10 add $0x10,%edi 801055c3: 3b 7b 58 cmp 0x58(%ebx),%edi 801055c6: 73 40 jae 80105608 <sys_mv+0x218> if(readi(parent, (char*)&de, off, sizeof(de)) != sizeof(de)) 801055c8: 6a 10 push $0x10 801055ca: 57 push %edi 801055cb: ff 75 84 pushl -0x7c(%ebp) 801055ce: 53 push %ebx 801055cf: e8 8c c3 ff ff call 80101960 <readi> 801055d4: 83 c4 10 add $0x10,%esp 801055d7: 83 f8 10 cmp $0x10,%eax 801055da: 0f 85 a1 02 00 00 jne 80105881 <sys_mv+0x491> if(de.inum == ip->inum){ 801055e0: 0f b7 45 d8 movzwl -0x28(%ebp),%eax 801055e4: 3b 46 04 cmp 0x4(%esi),%eax 801055e7: 75 d7 jne 801055c0 <sys_mv+0x1d0> 801055e9: 89 d8 mov %ebx,%eax 801055eb: 89 f3 mov %esi,%ebx safestrcpy(de.name, path2, DIRSIZ); 801055ed: 83 ec 04 sub $0x4,%esp 801055f0: 89 c6 mov %eax,%esi 801055f2: 8d 45 da lea -0x26(%ebp),%eax 801055f5: 6a 0e push $0xe 801055f7: ff 75 90 pushl -0x70(%ebp) 801055fa: 50 push %eax 801055fb: e8 70 f1 ff ff call 80104770 <safestrcpy> break; 80105600: 83 c4 10 add $0x10,%esp 80105603: eb 09 jmp 8010560e <sys_mv+0x21e> 80105605: 8d 76 00 lea 0x0(%esi),%esi 80105608: 89 d8 mov %ebx,%eax 8010560a: 89 f3 mov %esi,%ebx 8010560c: 89 c6 mov %eax,%esi if(writei(parent, (char*)&de, off, sizeof(de)) != sizeof(de)) { 8010560e: 6a 10 push $0x10 80105610: 57 push %edi 80105611: ff 75 84 pushl -0x7c(%ebp) 80105614: 56 push %esi 80105615: e8 46 c4 ff ff call 80101a60 <writei> 8010561a: 83 c4 10 add $0x10,%esp 8010561d: 83 f8 10 cmp $0x10,%eax 80105620: 0f 85 83 02 00 00 jne 801058a9 <sys_mv+0x4b9> iunlock(ip); 80105626: 83 ec 0c sub $0xc,%esp 80105629: 53 push %ebx 8010562a: e8 31 c1 ff ff call 80101760 <iunlock> iunlock(parent); 8010562f: 89 34 24 mov %esi,(%esp) 80105632: e8 29 c1 ff ff call 80101760 <iunlock> iput(curproc->cwd); 80105637: 8b 75 80 mov -0x80(%ebp),%esi 8010563a: 58 pop %eax 8010563b: ff 76 68 pushl 0x68(%esi) 8010563e: e8 6d c1 ff ff call 801017b0 <iput> end_op(); 80105643: e8 c8 d5 ff ff call 80102c10 <end_op> curproc->cwd = dp; 80105648: 8b 8d 7c ff ff ff mov -0x84(%ebp),%ecx safestrcpy(path1, "", DIRSIZ); 8010564e: 83 c4 0c add $0xc,%esp curproc->cwd = dp; 80105651: 89 4e 68 mov %ecx,0x68(%esi) safestrcpy(path1, "", DIRSIZ); 80105654: 6a 0e push $0xe 80105656: 68 74 82 10 80 push $0x80108274 8010565b: ff 75 8c pushl -0x74(%ebp) 8010565e: e8 0d f1 ff ff call 80104770 <safestrcpy> safestrcpy(path2, "", DIRSIZ); 80105663: 83 c4 0c add $0xc,%esp 80105666: 6a 0e push $0xe 80105668: 68 74 82 10 80 push $0x80108274 8010566d: ff 75 90 pushl -0x70(%ebp) 80105670: e8 fb f0 ff ff call 80104770 <safestrcpy> safestrcpy(path1, "", DIRSIZ); 80105675: 83 c4 0c add $0xc,%esp 80105678: 6a 0e push $0xe 8010567a: 68 74 82 10 80 push $0x80108274 8010567f: ff 75 8c pushl -0x74(%ebp) 80105682: e8 e9 f0 ff ff call 80104770 <safestrcpy> 80105687: 83 c4 10 add $0x10,%esp } 8010568a: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010568d: 31 c0 xor %eax,%eax } 8010568f: 5b pop %ebx 80105690: 5e pop %esi 80105691: 5f pop %edi 80105692: 5d pop %ebp 80105693: c3 ret 80105694: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi sp = nameiparent(path1, name); 80105698: 8d 45 aa lea -0x56(%ebp),%eax 8010569b: 83 ec 08 sub $0x8,%esp 8010569e: 50 push %eax 8010569f: ff 75 8c pushl -0x74(%ebp) 801056a2: e8 59 c8 ff ff call 80101f00 <nameiparent> 801056a7: 89 c6 mov %eax,%esi ilock(sp); 801056a9: 89 04 24 mov %eax,(%esp) 801056ac: e8 cf bf ff ff call 80101680 <ilock> for(off = 0; off < (sp->size); off += sizeof(de)){ 801056b1: 8b 7e 58 mov 0x58(%esi),%edi 801056b4: 83 c4 10 add $0x10,%esp 801056b7: 85 ff test %edi,%edi 801056b9: 0f 84 b7 01 00 00 je 80105876 <sys_mv+0x486> 801056bf: 8d 45 c8 lea -0x38(%ebp),%eax 801056c2: 31 ff xor %edi,%edi 801056c4: 89 45 84 mov %eax,-0x7c(%ebp) 801056c7: 89 f0 mov %esi,%eax 801056c9: 89 de mov %ebx,%esi 801056cb: 89 c3 mov %eax,%ebx 801056cd: eb 0d jmp 801056dc <sys_mv+0x2ec> 801056cf: 90 nop 801056d0: 83 c7 10 add $0x10,%edi 801056d3: 3b 7b 58 cmp 0x58(%ebx),%edi 801056d6: 0f 83 2c ff ff ff jae 80105608 <sys_mv+0x218> if(readi(sp, (char*)&de, off, sizeof(de)) != sizeof(de)) //finding one dirent structure each time 801056dc: 6a 10 push $0x10 801056de: 57 push %edi 801056df: ff 75 84 pushl -0x7c(%ebp) 801056e2: 53 push %ebx 801056e3: e8 78 c2 ff ff call 80101960 <readi> 801056e8: 83 c4 10 add $0x10,%esp 801056eb: 83 f8 10 cmp $0x10,%eax 801056ee: 0f 85 8d 01 00 00 jne 80105881 <sys_mv+0x491> if(de.inum == ip->inum){ //comparing inum 801056f4: 0f b7 45 c8 movzwl -0x38(%ebp),%eax 801056f8: 3b 46 04 cmp 0x4(%esi),%eax 801056fb: 75 d3 jne 801056d0 <sys_mv+0x2e0> 801056fd: 89 d8 mov %ebx,%eax 801056ff: 89 f3 mov %esi,%ebx safestrcpy(de.name, path2, DIRSIZ); //copy the name into de 80105701: 83 ec 04 sub $0x4,%esp 80105704: 89 c6 mov %eax,%esi 80105706: 8d 45 ca lea -0x36(%ebp),%eax 80105709: 6a 0e push $0xe 8010570b: ff 75 90 pushl -0x70(%ebp) 8010570e: 50 push %eax 8010570f: e8 5c f0 ff ff call 80104770 <safestrcpy> break; 80105714: 83 c4 10 add $0x10,%esp 80105717: e9 f2 fe ff ff jmp 8010560e <sys_mv+0x21e> 8010571c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((vp = nameiparent(path2, name1)) == 0){ 80105720: 8d 75 9c lea -0x64(%ebp),%esi 80105723: 83 ec 08 sub $0x8,%esp 80105726: 56 push %esi 80105727: ff 75 90 pushl -0x70(%ebp) 8010572a: e8 d1 c7 ff ff call 80101f00 <nameiparent> 8010572f: 83 c4 10 add $0x10,%esp 80105732: 85 c0 test %eax,%eax 80105734: 89 c7 mov %eax,%edi 80105736: 0f 84 52 01 00 00 je 8010588e <sys_mv+0x49e> ilock(vp); //locking parent structure 8010573c: 83 ec 0c sub $0xc,%esp 8010573f: 50 push %eax 80105740: e8 3b bf ff ff call 80101680 <ilock> ap = dirlookup(vp, name1, &off1); //getting entry of inode in ap and its offset in off1 80105745: 8d 45 98 lea -0x68(%ebp),%eax 80105748: 83 c4 0c add $0xc,%esp 8010574b: 50 push %eax 8010574c: 56 push %esi 8010574d: 57 push %edi 8010574e: e8 5d c4 ff ff call 80101bb0 <dirlookup> 80105753: 89 c6 mov %eax,%esi ilock(ap); 80105755: 89 04 24 mov %eax,(%esp) 80105758: e8 23 bf ff ff call 80101680 <ilock> if(ap->nlink < 1) 8010575d: 83 c4 10 add $0x10,%esp 80105760: 66 83 7e 56 00 cmpw $0x0,0x56(%esi) 80105765: 0f 8e 4b 01 00 00 jle 801058b6 <sys_mv+0x4c6> memset(&dz, 0, sizeof(dz)); //writing the null values in dirent structure 8010576b: 8d 55 b8 lea -0x48(%ebp),%edx 8010576e: 83 ec 04 sub $0x4,%esp 80105771: 6a 10 push $0x10 80105773: 6a 00 push $0x0 80105775: 52 push %edx 80105776: 89 55 84 mov %edx,-0x7c(%ebp) 80105779: e8 12 ee ff ff call 80104590 <memset> if(writei(vp, (char*)&dz, off1, sizeof(dz)) != sizeof(dz)) //writing the structure to off1 offset 8010577e: 8b 55 84 mov -0x7c(%ebp),%edx 80105781: 6a 10 push $0x10 80105783: ff 75 98 pushl -0x68(%ebp) 80105786: 52 push %edx 80105787: 57 push %edi 80105788: e8 d3 c2 ff ff call 80101a60 <writei> 8010578d: 83 c4 20 add $0x20,%esp 80105790: 83 f8 10 cmp $0x10,%eax 80105793: 0f 85 10 01 00 00 jne 801058a9 <sys_mv+0x4b9> if(ap->type == T_DIR){ 80105799: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 8010579e: 74 30 je 801057d0 <sys_mv+0x3e0> iunlockput(vp); 801057a0: 83 ec 0c sub $0xc,%esp 801057a3: 57 push %edi 801057a4: e8 67 c1 ff ff call 80101910 <iunlockput> ap->nlink--;//decreasing the links to self node 801057a9: 66 83 6e 56 01 subw $0x1,0x56(%esi) iupdate(ap); //updating info 801057ae: 89 34 24 mov %esi,(%esp) 801057b1: e8 1a be ff ff call 801015d0 <iupdate> iunlockput(ap); //send it back to storage 801057b6: 89 34 24 mov %esi,(%esp) 801057b9: e8 52 c1 ff ff call 80101910 <iunlockput> 801057be: 83 c4 10 add $0x10,%esp 801057c1: e9 ee fc ff ff jmp 801054b4 <sys_mv+0xc4> 801057c6: 8d 76 00 lea 0x0(%esi),%esi 801057c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi vp->nlink--; //decreasing the links to parent node 801057d0: 66 83 6f 56 01 subw $0x1,0x56(%edi) iupdate(vp); 801057d5: 83 ec 0c sub $0xc,%esp 801057d8: 57 push %edi 801057d9: e8 f2 bd ff ff call 801015d0 <iupdate> 801057de: 83 c4 10 add $0x10,%esp 801057e1: eb bd jmp 801057a0 <sys_mv+0x3b0> 801057e3: 90 nop 801057e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(strncmp(path1, "--ver", DIRSIZ) == 0) { 801057e8: 83 ec 04 sub $0x4,%esp 801057eb: 6a 0e push $0xe 801057ed: 68 49 7f 10 80 push $0x80107f49 801057f2: ff 75 8c pushl -0x74(%ebp) 801057f5: e8 b6 ee ff ff call 801046b0 <strncmp> 801057fa: 83 c4 10 add $0x10,%esp 801057fd: 85 c0 test %eax,%eax 801057ff: 75 40 jne 80105841 <sys_mv+0x451> cprintf(" mv (GNU coreutils) 8.26\n"); 80105801: 83 ec 0c sub $0xc,%esp 80105804: 68 4f 7f 10 80 push $0x80107f4f 80105809: e8 52 ae ff ff call 80100660 <cprintf> cprintf(" Packaged by SEV (8.26-2)\n"); 8010580e: c7 04 24 6b 7f 10 80 movl $0x80107f6b,(%esp) 80105815: e8 46 ae ff ff call 80100660 <cprintf> cprintf(" Copyright (C) 2020 SEV, Inc.\n"); 8010581a: c7 04 24 e8 7f 10 80 movl $0x80107fe8,(%esp) 80105821: e8 3a ae ff ff call 80100660 <cprintf> cprintf(" License GPLv3+: free for Public Use .\n"); 80105826: c7 04 24 0c 80 10 80 movl $0x8010800c,(%esp) 8010582d: e8 2e ae ff ff call 80100660 <cprintf> cprintf(" Written by Shivam Marathe\n"); 80105832: c7 04 24 88 7f 10 80 movl $0x80107f88,(%esp) 80105839: e8 22 ae ff ff call 80100660 <cprintf> 8010583e: 83 c4 10 add $0x10,%esp end_op();//end of operation unlock the process. 80105841: e8 ca d3 ff ff call 80102c10 <end_op> return -1; 80105846: b8 ff ff ff ff mov $0xffffffff,%eax 8010584b: e9 b7 fc ff ff jmp 80105507 <sys_mv+0x117> 80105850: 8d 45 d8 lea -0x28(%ebp),%eax 80105853: 89 45 84 mov %eax,-0x7c(%ebp) 80105856: e9 b3 fd ff ff jmp 8010560e <sys_mv+0x21e> iunlock(ip); 8010585b: 83 ec 0c sub $0xc,%esp 8010585e: 53 push %ebx 8010585f: e8 fc be ff ff call 80101760 <iunlock> end_op(); 80105864: e8 a7 d3 ff ff call 80102c10 <end_op> return -1; 80105869: 83 c4 10 add $0x10,%esp 8010586c: b8 ff ff ff ff mov $0xffffffff,%eax 80105871: e9 91 fc ff ff jmp 80105507 <sys_mv+0x117> 80105876: 8d 45 c8 lea -0x38(%ebp),%eax 80105879: 89 45 84 mov %eax,-0x7c(%ebp) 8010587c: e9 8d fd ff ff jmp 8010560e <sys_mv+0x21e> panic("dirlink read"); 80105881: 83 ec 0c sub $0xc,%esp 80105884: 68 a8 78 10 80 push $0x801078a8 80105889: e8 02 ab ff ff call 80100390 <panic> end_op(); 8010588e: e8 7d d3 ff ff call 80102c10 <end_op> iunlock(ip); 80105893: 83 ec 0c sub $0xc,%esp 80105896: 53 push %ebx 80105897: e8 c4 be ff ff call 80101760 <iunlock> return -1; 8010589c: 83 c4 10 add $0x10,%esp 8010589f: b8 ff ff ff ff mov $0xffffffff,%eax 801058a4: e9 5e fc ff ff jmp 80105507 <sys_mv+0x117> panic("unlink: writei"); 801058a9: 83 ec 0c sub $0xc,%esp 801058ac: 68 3a 7f 10 80 push $0x80107f3a 801058b1: e8 da aa ff ff call 80100390 <panic> panic("unlink: nlink < 1"); 801058b6: 83 ec 0c sub $0xc,%esp 801058b9: 68 16 7f 10 80 push $0x80107f16 801058be: e8 cd aa ff ff call 80100390 <panic> 801058c3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801058c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801058d0 <name_of_inode>: return 1; }*/ int name_of_inode(struct inode *ip, struct inode *parent, char buf[DIRSIZ]) { 801058d0: 55 push %ebp 801058d1: 89 e5 mov %esp,%ebp 801058d3: 57 push %edi 801058d4: 56 push %esi 801058d5: 53 push %ebx 801058d6: 83 ec 1c sub $0x1c,%esp 801058d9: 8b 5d 0c mov 0xc(%ebp),%ebx uint off; struct dirent de; for (off = 0; off < parent->size; off += sizeof(de)) { 801058dc: 8b 43 58 mov 0x58(%ebx),%eax 801058df: 85 c0 test %eax,%eax 801058e1: 74 55 je 80105938 <name_of_inode+0x68> 801058e3: 31 f6 xor %esi,%esi 801058e5: 8d 7d d8 lea -0x28(%ebp),%edi 801058e8: eb 0e jmp 801058f8 <name_of_inode+0x28> 801058ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801058f0: 83 c6 10 add $0x10,%esi 801058f3: 39 73 58 cmp %esi,0x58(%ebx) 801058f6: 76 40 jbe 80105938 <name_of_inode+0x68> if (readi(parent, (char*)&de, off, sizeof(de)) != sizeof(de)) 801058f8: 6a 10 push $0x10 801058fa: 56 push %esi 801058fb: 57 push %edi 801058fc: 53 push %ebx 801058fd: e8 5e c0 ff ff call 80101960 <readi> 80105902: 83 c4 10 add $0x10,%esp 80105905: 83 f8 10 cmp $0x10,%eax 80105908: 75 3b jne 80105945 <name_of_inode+0x75> panic("couldn't read dir entry"); if (de.inum == ip->inum) { 8010590a: 8b 55 08 mov 0x8(%ebp),%edx 8010590d: 0f b7 45 d8 movzwl -0x28(%ebp),%eax 80105911: 3b 42 04 cmp 0x4(%edx),%eax 80105914: 75 da jne 801058f0 <name_of_inode+0x20> safestrcpy(buf, de.name, DIRSIZ); 80105916: 8d 45 da lea -0x26(%ebp),%eax 80105919: 83 ec 04 sub $0x4,%esp 8010591c: 6a 0e push $0xe 8010591e: 50 push %eax 8010591f: ff 75 10 pushl 0x10(%ebp) 80105922: e8 49 ee ff ff call 80104770 <safestrcpy> return 0; 80105927: 83 c4 10 add $0x10,%esp } } return -1; } 8010592a: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010592d: 31 c0 xor %eax,%eax } 8010592f: 5b pop %ebx 80105930: 5e pop %esi 80105931: 5f pop %edi 80105932: 5d pop %ebp 80105933: c3 ret 80105934: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105938: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010593b: b8 ff ff ff ff mov $0xffffffff,%eax } 80105940: 5b pop %ebx 80105941: 5e pop %esi 80105942: 5f pop %edi 80105943: 5d pop %ebp 80105944: c3 ret panic("couldn't read dir entry"); 80105945: 83 ec 0c sub $0xc,%esp 80105948: 68 bb 7f 10 80 push $0x80107fbb 8010594d: e8 3e aa ff ff call 80100390 <panic> 80105952: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105959: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105960 <name_for_inode>: int name_for_inode(char* buf, int n, struct inode *ip) { 80105960: 55 push %ebp 80105961: 89 e5 mov %esp,%ebp 80105963: 57 push %edi 80105964: 56 push %esi 80105965: 53 push %ebx 80105966: 83 ec 38 sub $0x38,%esp 80105969: 8b 5d 10 mov 0x10(%ebp),%ebx int path_offset; struct inode *parent; char node_name[DIRSIZ]; if (ip->inum == namei("/")->inum) { //namei is inefficient but iget isn't exported for some reason 8010596c: 8b 73 04 mov 0x4(%ebx),%esi 8010596f: 68 ce 7c 10 80 push $0x80107cce 80105974: e8 67 c5 ff ff call 80101ee0 <namei> 80105979: 83 c4 10 add $0x10,%esp 8010597c: 3b 70 04 cmp 0x4(%eax),%esi 8010597f: 74 27 je 801059a8 <name_for_inode+0x48> buf[0] = '/'; return 1; } else if (ip->type == T_DIR) { 80105981: 0f b7 43 50 movzwl 0x50(%ebx),%eax 80105985: 66 83 f8 01 cmp $0x1,%ax 80105989: 74 45 je 801059d0 <name_for_inode+0x70> } else { buf[path_offset++] = '/'; } iunlock(parent); //free return path_offset; } else if (ip->type == T_DEV || ip->type == T_FILE) { 8010598b: 83 e8 02 sub $0x2,%eax 8010598e: 66 83 f8 01 cmp $0x1,%ax 80105992: 76 2c jbe 801059c0 <name_for_inode+0x60> panic("process cwd is a device node / file, not a directory!"); } else { panic("unknown inode type"); 80105994: 83 ec 0c sub $0xc,%esp 80105997: 68 d3 7f 10 80 push $0x80107fd3 8010599c: e8 ef a9 ff ff call 80100390 <panic> 801059a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi buf[0] = '/'; 801059a8: 8b 45 08 mov 0x8(%ebp),%eax 801059ab: c6 00 2f movb $0x2f,(%eax) return 1; 801059ae: b8 01 00 00 00 mov $0x1,%eax } } 801059b3: 8d 65 f4 lea -0xc(%ebp),%esp 801059b6: 5b pop %ebx 801059b7: 5e pop %esi 801059b8: 5f pop %edi 801059b9: 5d pop %ebp 801059ba: c3 ret 801059bb: 90 nop 801059bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi panic("process cwd is a device node / file, not a directory!"); 801059c0: 83 ec 0c sub $0xc,%esp 801059c3: 68 60 80 10 80 push $0x80108060 801059c8: e8 c3 a9 ff ff call 80100390 <panic> 801059cd: 8d 76 00 lea 0x0(%esi),%esi parent = dirlookup(ip, "..", 0); 801059d0: 83 ec 04 sub $0x4,%esp if (name_of_inode(ip, parent, node_name)) { 801059d3: 8d 7d da lea -0x26(%ebp),%edi parent = dirlookup(ip, "..", 0); 801059d6: 6a 00 push $0x0 801059d8: 68 03 7f 10 80 push $0x80107f03 801059dd: 53 push %ebx 801059de: e8 cd c1 ff ff call 80101bb0 <dirlookup> 801059e3: 89 c6 mov %eax,%esi ilock(parent); 801059e5: 89 04 24 mov %eax,(%esp) 801059e8: e8 93 bc ff ff call 80101680 <ilock> if (name_of_inode(ip, parent, node_name)) { 801059ed: 83 c4 0c add $0xc,%esp 801059f0: 57 push %edi 801059f1: 56 push %esi 801059f2: 53 push %ebx 801059f3: e8 d8 fe ff ff call 801058d0 <name_of_inode> 801059f8: 83 c4 10 add $0x10,%esp 801059fb: 85 c0 test %eax,%eax 801059fd: 75 72 jne 80105a71 <name_for_inode+0x111> path_offset = name_for_inode(buf, n, parent); 801059ff: 83 ec 04 sub $0x4,%esp 80105a02: 56 push %esi 80105a03: ff 75 0c pushl 0xc(%ebp) 80105a06: ff 75 08 pushl 0x8(%ebp) 80105a09: e8 52 ff ff ff call 80105960 <name_for_inode> 80105a0e: 89 c3 mov %eax,%ebx safestrcpy(buf + path_offset, node_name, n - path_offset); 80105a10: 8b 45 0c mov 0xc(%ebp),%eax 80105a13: 83 c4 0c add $0xc,%esp 80105a16: 29 d8 sub %ebx,%eax 80105a18: 50 push %eax 80105a19: 8b 45 08 mov 0x8(%ebp),%eax 80105a1c: 57 push %edi 80105a1d: 01 d8 add %ebx,%eax 80105a1f: 50 push %eax 80105a20: e8 4b ed ff ff call 80104770 <safestrcpy> path_offset += strlen(node_name); 80105a25: 89 3c 24 mov %edi,(%esp) 80105a28: e8 83 ed ff ff call 801047b0 <strlen> 80105a2d: 01 c3 add %eax,%ebx if (path_offset == n - 1) { 80105a2f: 8b 45 0c mov 0xc(%ebp),%eax 80105a32: 83 c4 10 add $0x10,%esp 80105a35: 83 e8 01 sub $0x1,%eax 80105a38: 39 c3 cmp %eax,%ebx 80105a3a: 75 14 jne 80105a50 <name_for_inode+0xf0> buf[path_offset] = '\0'; 80105a3c: 8b 45 08 mov 0x8(%ebp),%eax 80105a3f: c6 04 18 00 movb $0x0,(%eax,%ebx,1) return n; 80105a43: 8b 45 0c mov 0xc(%ebp),%eax 80105a46: e9 68 ff ff ff jmp 801059b3 <name_for_inode+0x53> 80105a4b: 90 nop 80105a4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi buf[path_offset++] = '/'; 80105a50: 8d 43 01 lea 0x1(%ebx),%eax iunlock(parent); //free 80105a53: 83 ec 0c sub $0xc,%esp buf[path_offset++] = '/'; 80105a56: 89 45 d4 mov %eax,-0x2c(%ebp) 80105a59: 8b 45 08 mov 0x8(%ebp),%eax 80105a5c: c6 04 18 2f movb $0x2f,(%eax,%ebx,1) iunlock(parent); //free 80105a60: 56 push %esi 80105a61: e8 fa bc ff ff call 80101760 <iunlock> 80105a66: 83 c4 10 add $0x10,%esp 80105a69: 8b 45 d4 mov -0x2c(%ebp),%eax 80105a6c: e9 42 ff ff ff jmp 801059b3 <name_for_inode+0x53> panic("could not find name of inode in parent!"); 80105a71: 83 ec 0c sub $0xc,%esp 80105a74: 68 38 80 10 80 push $0x80108038 80105a79: e8 12 a9 ff ff call 80100390 <panic> 80105a7e: 66 90 xchg %ax,%ax 80105a80 <sys_pwd>: int sys_pwd(void) { 80105a80: 55 push %ebp 80105a81: 89 e5 mov %esp,%ebp 80105a83: 53 push %ebx 80105a84: 83 ec 14 sub $0x14,%esp char *p; int n; struct proc *curproc = myproc(); 80105a87: e8 54 dd ff ff call 801037e0 <myproc> 80105a8c: 89 c3 mov %eax,%ebx if(argint(1, &n) < 0 || argptr(0, &p, n) < 0) 80105a8e: 8d 45 f4 lea -0xc(%ebp),%eax 80105a91: 83 ec 08 sub $0x8,%esp 80105a94: 50 push %eax 80105a95: 6a 01 push $0x1 80105a97: e8 f4 ed ff ff call 80104890 <argint> 80105a9c: 83 c4 10 add $0x10,%esp 80105a9f: 85 c0 test %eax,%eax 80105aa1: 78 35 js 80105ad8 <sys_pwd+0x58> 80105aa3: 8d 45 f0 lea -0x10(%ebp),%eax 80105aa6: 83 ec 04 sub $0x4,%esp 80105aa9: ff 75 f4 pushl -0xc(%ebp) 80105aac: 50 push %eax 80105aad: 6a 00 push $0x0 80105aaf: e8 2c ee ff ff call 801048e0 <argptr> 80105ab4: 83 c4 10 add $0x10,%esp 80105ab7: 85 c0 test %eax,%eax 80105ab9: 78 1d js 80105ad8 <sys_pwd+0x58> return -1; return name_for_inode(p, n, curproc->cwd); 80105abb: 83 ec 04 sub $0x4,%esp 80105abe: ff 73 68 pushl 0x68(%ebx) 80105ac1: ff 75 f4 pushl -0xc(%ebp) 80105ac4: ff 75 f0 pushl -0x10(%ebp) 80105ac7: e8 94 fe ff ff call 80105960 <name_for_inode> 80105acc: 83 c4 10 add $0x10,%esp } 80105acf: 8b 5d fc mov -0x4(%ebp),%ebx 80105ad2: c9 leave 80105ad3: c3 ret 80105ad4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105ad8: b8 ff ff ff ff mov $0xffffffff,%eax 80105add: eb f0 jmp 80105acf <sys_pwd+0x4f> 80105adf: 90 nop 80105ae0 <sys_exec>: int sys_exec(void) { 80105ae0: 55 push %ebp 80105ae1: 89 e5 mov %esp,%ebp 80105ae3: 57 push %edi 80105ae4: 56 push %esi 80105ae5: 53 push %ebx char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105ae6: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax { 80105aec: 81 ec a4 00 00 00 sub $0xa4,%esp if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105af2: 50 push %eax 80105af3: 6a 00 push $0x0 80105af5: e8 46 ee ff ff call 80104940 <argstr> 80105afa: 83 c4 10 add $0x10,%esp 80105afd: 85 c0 test %eax,%eax 80105aff: 0f 88 87 00 00 00 js 80105b8c <sys_exec+0xac> 80105b05: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 80105b0b: 83 ec 08 sub $0x8,%esp 80105b0e: 50 push %eax 80105b0f: 6a 01 push $0x1 80105b11: e8 7a ed ff ff call 80104890 <argint> 80105b16: 83 c4 10 add $0x10,%esp 80105b19: 85 c0 test %eax,%eax 80105b1b: 78 6f js 80105b8c <sys_exec+0xac> return -1; } memset(argv, 0, sizeof(argv)); 80105b1d: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105b23: 83 ec 04 sub $0x4,%esp for(i=0;; i++){ 80105b26: 31 db xor %ebx,%ebx memset(argv, 0, sizeof(argv)); 80105b28: 68 80 00 00 00 push $0x80 80105b2d: 6a 00 push $0x0 80105b2f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 80105b35: 50 push %eax 80105b36: e8 55 ea ff ff call 80104590 <memset> 80105b3b: 83 c4 10 add $0x10,%esp 80105b3e: eb 2c jmp 80105b6c <sys_exec+0x8c> if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ 80105b40: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 80105b46: 85 c0 test %eax,%eax 80105b48: 74 56 je 80105ba0 <sys_exec+0xc0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 80105b4a: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx 80105b50: 83 ec 08 sub $0x8,%esp 80105b53: 8d 14 31 lea (%ecx,%esi,1),%edx 80105b56: 52 push %edx 80105b57: 50 push %eax 80105b58: e8 c3 ec ff ff call 80104820 <fetchstr> 80105b5d: 83 c4 10 add $0x10,%esp 80105b60: 85 c0 test %eax,%eax 80105b62: 78 28 js 80105b8c <sys_exec+0xac> for(i=0;; i++){ 80105b64: 83 c3 01 add $0x1,%ebx if(i >= NELEM(argv)) 80105b67: 83 fb 20 cmp $0x20,%ebx 80105b6a: 74 20 je 80105b8c <sys_exec+0xac> if(fetchint(uargv+4*i, (int*)&uarg) < 0) 80105b6c: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 80105b72: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi 80105b79: 83 ec 08 sub $0x8,%esp 80105b7c: 57 push %edi 80105b7d: 01 f0 add %esi,%eax 80105b7f: 50 push %eax 80105b80: e8 5b ec ff ff call 801047e0 <fetchint> 80105b85: 83 c4 10 add $0x10,%esp 80105b88: 85 c0 test %eax,%eax 80105b8a: 79 b4 jns 80105b40 <sys_exec+0x60> return -1; } return exec(path, argv); } 80105b8c: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80105b8f: b8 ff ff ff ff mov $0xffffffff,%eax } 80105b94: 5b pop %ebx 80105b95: 5e pop %esi 80105b96: 5f pop %edi 80105b97: 5d pop %ebp 80105b98: c3 ret 80105b99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return exec(path, argv); 80105ba0: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105ba6: 83 ec 08 sub $0x8,%esp argv[i] = 0; 80105ba9: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 80105bb0: 00 00 00 00 return exec(path, argv); 80105bb4: 50 push %eax 80105bb5: ff b5 5c ff ff ff pushl -0xa4(%ebp) 80105bbb: e8 50 ae ff ff call 80100a10 <exec> 80105bc0: 83 c4 10 add $0x10,%esp } 80105bc3: 8d 65 f4 lea -0xc(%ebp),%esp 80105bc6: 5b pop %ebx 80105bc7: 5e pop %esi 80105bc8: 5f pop %edi 80105bc9: 5d pop %ebp 80105bca: c3 ret 80105bcb: 90 nop 80105bcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105bd0 <sys_pipe>: int sys_pipe(void) { 80105bd0: 55 push %ebp 80105bd1: 89 e5 mov %esp,%ebp 80105bd3: 57 push %edi 80105bd4: 56 push %esi 80105bd5: 53 push %ebx int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 80105bd6: 8d 45 dc lea -0x24(%ebp),%eax { 80105bd9: 83 ec 20 sub $0x20,%esp if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 80105bdc: 6a 08 push $0x8 80105bde: 50 push %eax 80105bdf: 6a 00 push $0x0 80105be1: e8 fa ec ff ff call 801048e0 <argptr> 80105be6: 83 c4 10 add $0x10,%esp 80105be9: 85 c0 test %eax,%eax 80105beb: 0f 88 ae 00 00 00 js 80105c9f <sys_pipe+0xcf> return -1; if(pipealloc(&rf, &wf) < 0) 80105bf1: 8d 45 e4 lea -0x1c(%ebp),%eax 80105bf4: 83 ec 08 sub $0x8,%esp 80105bf7: 50 push %eax 80105bf8: 8d 45 e0 lea -0x20(%ebp),%eax 80105bfb: 50 push %eax 80105bfc: e8 3f d6 ff ff call 80103240 <pipealloc> 80105c01: 83 c4 10 add $0x10,%esp 80105c04: 85 c0 test %eax,%eax 80105c06: 0f 88 93 00 00 00 js 80105c9f <sys_pipe+0xcf> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80105c0c: 8b 7d e0 mov -0x20(%ebp),%edi for(fd = 0; fd < NOFILE; fd++){ 80105c0f: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80105c11: e8 ca db ff ff call 801037e0 <myproc> 80105c16: eb 10 jmp 80105c28 <sys_pipe+0x58> 80105c18: 90 nop 80105c19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(fd = 0; fd < NOFILE; fd++){ 80105c20: 83 c3 01 add $0x1,%ebx 80105c23: 83 fb 10 cmp $0x10,%ebx 80105c26: 74 60 je 80105c88 <sys_pipe+0xb8> if(curproc->ofile[fd] == 0){ 80105c28: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 80105c2c: 85 f6 test %esi,%esi 80105c2e: 75 f0 jne 80105c20 <sys_pipe+0x50> curproc->ofile[fd] = f; 80105c30: 8d 73 08 lea 0x8(%ebx),%esi 80105c33: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80105c37: 8b 7d e4 mov -0x1c(%ebp),%edi struct proc *curproc = myproc(); 80105c3a: e8 a1 db ff ff call 801037e0 <myproc> for(fd = 0; fd < NOFILE; fd++){ 80105c3f: 31 d2 xor %edx,%edx 80105c41: eb 0d jmp 80105c50 <sys_pipe+0x80> 80105c43: 90 nop 80105c44: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105c48: 83 c2 01 add $0x1,%edx 80105c4b: 83 fa 10 cmp $0x10,%edx 80105c4e: 74 28 je 80105c78 <sys_pipe+0xa8> if(curproc->ofile[fd] == 0){ 80105c50: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 80105c54: 85 c9 test %ecx,%ecx 80105c56: 75 f0 jne 80105c48 <sys_pipe+0x78> curproc->ofile[fd] = f; 80105c58: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 80105c5c: 8b 45 dc mov -0x24(%ebp),%eax 80105c5f: 89 18 mov %ebx,(%eax) fd[1] = fd1; 80105c61: 8b 45 dc mov -0x24(%ebp),%eax 80105c64: 89 50 04 mov %edx,0x4(%eax) return 0; 80105c67: 31 c0 xor %eax,%eax } 80105c69: 8d 65 f4 lea -0xc(%ebp),%esp 80105c6c: 5b pop %ebx 80105c6d: 5e pop %esi 80105c6e: 5f pop %edi 80105c6f: 5d pop %ebp 80105c70: c3 ret 80105c71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi myproc()->ofile[fd0] = 0; 80105c78: e8 63 db ff ff call 801037e0 <myproc> 80105c7d: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 80105c84: 00 80105c85: 8d 76 00 lea 0x0(%esi),%esi fileclose(rf); 80105c88: 83 ec 0c sub $0xc,%esp 80105c8b: ff 75 e0 pushl -0x20(%ebp) 80105c8e: e8 ad b1 ff ff call 80100e40 <fileclose> fileclose(wf); 80105c93: 58 pop %eax 80105c94: ff 75 e4 pushl -0x1c(%ebp) 80105c97: e8 a4 b1 ff ff call 80100e40 <fileclose> return -1; 80105c9c: 83 c4 10 add $0x10,%esp 80105c9f: b8 ff ff ff ff mov $0xffffffff,%eax 80105ca4: eb c3 jmp 80105c69 <sys_pipe+0x99> 80105ca6: 66 90 xchg %ax,%ax 80105ca8: 66 90 xchg %ax,%ax 80105caa: 66 90 xchg %ax,%ax 80105cac: 66 90 xchg %ax,%ax 80105cae: 66 90 xchg %ax,%ax 80105cb0 <sys_fork>: #include "mmu.h" #include "proc.h" int sys_fork(void) { 80105cb0: 55 push %ebp 80105cb1: 89 e5 mov %esp,%ebp return fork(); } 80105cb3: 5d pop %ebp return fork(); 80105cb4: e9 c7 dc ff ff jmp 80103980 <fork> 80105cb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105cc0 <sys_exit>: int sys_exit(void) { 80105cc0: 55 push %ebp 80105cc1: 89 e5 mov %esp,%ebp 80105cc3: 83 ec 08 sub $0x8,%esp exit(); 80105cc6: e8 55 df ff ff call 80103c20 <exit> return 0; // not reached } 80105ccb: 31 c0 xor %eax,%eax 80105ccd: c9 leave 80105cce: c3 ret 80105ccf: 90 nop 80105cd0 <sys_wait>: int sys_wait(void) { 80105cd0: 55 push %ebp 80105cd1: 89 e5 mov %esp,%ebp return wait(); } 80105cd3: 5d pop %ebp return wait(); 80105cd4: e9 87 e1 ff ff jmp 80103e60 <wait> 80105cd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105ce0 <sys_kill>: int sys_kill(void) { 80105ce0: 55 push %ebp 80105ce1: 89 e5 mov %esp,%ebp 80105ce3: 83 ec 20 sub $0x20,%esp int pid; if(argint(0, &pid) < 0) 80105ce6: 8d 45 f4 lea -0xc(%ebp),%eax 80105ce9: 50 push %eax 80105cea: 6a 00 push $0x0 80105cec: e8 9f eb ff ff call 80104890 <argint> 80105cf1: 83 c4 10 add $0x10,%esp 80105cf4: 85 c0 test %eax,%eax 80105cf6: 78 18 js 80105d10 <sys_kill+0x30> return -1; return kill(pid); 80105cf8: 83 ec 0c sub $0xc,%esp 80105cfb: ff 75 f4 pushl -0xc(%ebp) 80105cfe: e8 ad e2 ff ff call 80103fb0 <kill> 80105d03: 83 c4 10 add $0x10,%esp } 80105d06: c9 leave 80105d07: c3 ret 80105d08: 90 nop 80105d09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105d10: b8 ff ff ff ff mov $0xffffffff,%eax } 80105d15: c9 leave 80105d16: c3 ret 80105d17: 89 f6 mov %esi,%esi 80105d19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105d20 <sys_getpid>: int sys_getpid(void) { 80105d20: 55 push %ebp 80105d21: 89 e5 mov %esp,%ebp 80105d23: 83 ec 08 sub $0x8,%esp return myproc()->pid; 80105d26: e8 b5 da ff ff call 801037e0 <myproc> 80105d2b: 8b 40 10 mov 0x10(%eax),%eax } 80105d2e: c9 leave 80105d2f: c3 ret 80105d30 <sys_sbrk>: int sys_sbrk(void) { 80105d30: 55 push %ebp 80105d31: 89 e5 mov %esp,%ebp 80105d33: 53 push %ebx int addr; int n; if(argint(0, &n) < 0) 80105d34: 8d 45 f4 lea -0xc(%ebp),%eax { 80105d37: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 80105d3a: 50 push %eax 80105d3b: 6a 00 push $0x0 80105d3d: e8 4e eb ff ff call 80104890 <argint> 80105d42: 83 c4 10 add $0x10,%esp 80105d45: 85 c0 test %eax,%eax 80105d47: 78 27 js 80105d70 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 80105d49: e8 92 da ff ff call 801037e0 <myproc> if(growproc(n) < 0) 80105d4e: 83 ec 0c sub $0xc,%esp addr = myproc()->sz; 80105d51: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 80105d53: ff 75 f4 pushl -0xc(%ebp) 80105d56: e8 a5 db ff ff call 80103900 <growproc> 80105d5b: 83 c4 10 add $0x10,%esp 80105d5e: 85 c0 test %eax,%eax 80105d60: 78 0e js 80105d70 <sys_sbrk+0x40> return -1; return addr; } 80105d62: 89 d8 mov %ebx,%eax 80105d64: 8b 5d fc mov -0x4(%ebp),%ebx 80105d67: c9 leave 80105d68: c3 ret 80105d69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105d70: bb ff ff ff ff mov $0xffffffff,%ebx 80105d75: eb eb jmp 80105d62 <sys_sbrk+0x32> 80105d77: 89 f6 mov %esi,%esi 80105d79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105d80 <sys_sleep>: int sys_sleep(void) { 80105d80: 55 push %ebp 80105d81: 89 e5 mov %esp,%ebp 80105d83: 53 push %ebx int n; uint ticks0; if(argint(0, &n) < 0) 80105d84: 8d 45 f4 lea -0xc(%ebp),%eax { 80105d87: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 80105d8a: 50 push %eax 80105d8b: 6a 00 push $0x0 80105d8d: e8 fe ea ff ff call 80104890 <argint> 80105d92: 83 c4 10 add $0x10,%esp 80105d95: 85 c0 test %eax,%eax 80105d97: 0f 88 8a 00 00 00 js 80105e27 <sys_sleep+0xa7> return -1; acquire(&tickslock); 80105d9d: 83 ec 0c sub $0xc,%esp 80105da0: 68 40 59 11 80 push $0x80115940 80105da5: e8 d6 e6 ff ff call 80104480 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 80105daa: 8b 55 f4 mov -0xc(%ebp),%edx 80105dad: 83 c4 10 add $0x10,%esp ticks0 = ticks; 80105db0: 8b 1d 80 61 11 80 mov 0x80116180,%ebx while(ticks - ticks0 < n){ 80105db6: 85 d2 test %edx,%edx 80105db8: 75 27 jne 80105de1 <sys_sleep+0x61> 80105dba: eb 54 jmp 80105e10 <sys_sleep+0x90> 80105dbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 80105dc0: 83 ec 08 sub $0x8,%esp 80105dc3: 68 40 59 11 80 push $0x80115940 80105dc8: 68 80 61 11 80 push $0x80116180 80105dcd: e8 ce df ff ff call 80103da0 <sleep> while(ticks - ticks0 < n){ 80105dd2: a1 80 61 11 80 mov 0x80116180,%eax 80105dd7: 83 c4 10 add $0x10,%esp 80105dda: 29 d8 sub %ebx,%eax 80105ddc: 3b 45 f4 cmp -0xc(%ebp),%eax 80105ddf: 73 2f jae 80105e10 <sys_sleep+0x90> if(myproc()->killed){ 80105de1: e8 fa d9 ff ff call 801037e0 <myproc> 80105de6: 8b 40 24 mov 0x24(%eax),%eax 80105de9: 85 c0 test %eax,%eax 80105deb: 74 d3 je 80105dc0 <sys_sleep+0x40> release(&tickslock); 80105ded: 83 ec 0c sub $0xc,%esp 80105df0: 68 40 59 11 80 push $0x80115940 80105df5: e8 46 e7 ff ff call 80104540 <release> return -1; 80105dfa: 83 c4 10 add $0x10,%esp 80105dfd: b8 ff ff ff ff mov $0xffffffff,%eax } release(&tickslock); return 0; } 80105e02: 8b 5d fc mov -0x4(%ebp),%ebx 80105e05: c9 leave 80105e06: c3 ret 80105e07: 89 f6 mov %esi,%esi 80105e09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); 80105e10: 83 ec 0c sub $0xc,%esp 80105e13: 68 40 59 11 80 push $0x80115940 80105e18: e8 23 e7 ff ff call 80104540 <release> return 0; 80105e1d: 83 c4 10 add $0x10,%esp 80105e20: 31 c0 xor %eax,%eax } 80105e22: 8b 5d fc mov -0x4(%ebp),%ebx 80105e25: c9 leave 80105e26: c3 ret return -1; 80105e27: b8 ff ff ff ff mov $0xffffffff,%eax 80105e2c: eb f4 jmp 80105e22 <sys_sleep+0xa2> 80105e2e: 66 90 xchg %ax,%ax 80105e30 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 80105e30: 55 push %ebp 80105e31: 89 e5 mov %esp,%ebp 80105e33: 53 push %ebx 80105e34: 83 ec 10 sub $0x10,%esp uint xticks; acquire(&tickslock); 80105e37: 68 40 59 11 80 push $0x80115940 80105e3c: e8 3f e6 ff ff call 80104480 <acquire> xticks = ticks; 80105e41: 8b 1d 80 61 11 80 mov 0x80116180,%ebx release(&tickslock); 80105e47: c7 04 24 40 59 11 80 movl $0x80115940,(%esp) 80105e4e: e8 ed e6 ff ff call 80104540 <release> return xticks; } 80105e53: 89 d8 mov %ebx,%eax 80105e55: 8b 5d fc mov -0x4(%ebp),%ebx 80105e58: c9 leave 80105e59: c3 ret 80105e5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105e60 <sys_cps>: int sys_cps (void) { 80105e60: 55 push %ebp 80105e61: 89 e5 mov %esp,%ebp return cps(); } 80105e63: 5d pop %ebp return cps(); 80105e64: e9 87 e2 ff ff jmp 801040f0 <cps> 80105e69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105e70 <sys_chpr>: int sys_chpr(void){ 80105e70: 55 push %ebp 80105e71: 89 e5 mov %esp,%ebp 80105e73: 83 ec 20 sub $0x20,%esp int pid, pr; if(argint(0, &pid) < 0) 80105e76: 8d 45 f0 lea -0x10(%ebp),%eax 80105e79: 50 push %eax 80105e7a: 6a 00 push $0x0 80105e7c: e8 0f ea ff ff call 80104890 <argint> 80105e81: 83 c4 10 add $0x10,%esp 80105e84: 85 c0 test %eax,%eax 80105e86: 78 28 js 80105eb0 <sys_chpr+0x40> return -1; if(argint(1, &pr) < 0) 80105e88: 8d 45 f4 lea -0xc(%ebp),%eax 80105e8b: 83 ec 08 sub $0x8,%esp 80105e8e: 50 push %eax 80105e8f: 6a 01 push $0x1 80105e91: e8 fa e9 ff ff call 80104890 <argint> 80105e96: 83 c4 10 add $0x10,%esp 80105e99: 85 c0 test %eax,%eax 80105e9b: 78 13 js 80105eb0 <sys_chpr+0x40> return -1; return chpr(pid, pr); 80105e9d: 83 ec 08 sub $0x8,%esp 80105ea0: ff 75 f4 pushl -0xc(%ebp) 80105ea3: ff 75 f0 pushl -0x10(%ebp) 80105ea6: e8 15 e3 ff ff call 801041c0 <chpr> 80105eab: 83 c4 10 add $0x10,%esp } 80105eae: c9 leave 80105eaf: c3 ret return -1; 80105eb0: b8 ff ff ff ff mov $0xffffffff,%eax } 80105eb5: c9 leave 80105eb6: c3 ret 80105eb7 <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 80105eb7: 1e push %ds pushl %es 80105eb8: 06 push %es pushl %fs 80105eb9: 0f a0 push %fs pushl %gs 80105ebb: 0f a8 push %gs pushal 80105ebd: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 80105ebe: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 80105ec2: 8e d8 mov %eax,%ds movw %ax, %es 80105ec4: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 80105ec6: 54 push %esp call trap 80105ec7: e8 c4 00 00 00 call 80105f90 <trap> addl $4, %esp 80105ecc: 83 c4 04 add $0x4,%esp 80105ecf <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 80105ecf: 61 popa popl %gs 80105ed0: 0f a9 pop %gs popl %fs 80105ed2: 0f a1 pop %fs popl %es 80105ed4: 07 pop %es popl %ds 80105ed5: 1f pop %ds addl $0x8, %esp # trapno and errcode 80105ed6: 83 c4 08 add $0x8,%esp iret 80105ed9: cf iret 80105eda: 66 90 xchg %ax,%ax 80105edc: 66 90 xchg %ax,%ax 80105ede: 66 90 xchg %ax,%ax 80105ee0 <tvinit>: struct spinlock tickslock; uint ticks; void tvinit(void) { 80105ee0: 55 push %ebp int i; for(i = 0; i < 256; i++) 80105ee1: 31 c0 xor %eax,%eax { 80105ee3: 89 e5 mov %esp,%ebp 80105ee5: 83 ec 08 sub $0x8,%esp 80105ee8: 90 nop 80105ee9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 80105ef0: 8b 14 85 08 b0 10 80 mov -0x7fef4ff8(,%eax,4),%edx 80105ef7: c7 04 c5 82 59 11 80 movl $0x8e000008,-0x7feea67e(,%eax,8) 80105efe: 08 00 00 8e 80105f02: 66 89 14 c5 80 59 11 mov %dx,-0x7feea680(,%eax,8) 80105f09: 80 80105f0a: c1 ea 10 shr $0x10,%edx 80105f0d: 66 89 14 c5 86 59 11 mov %dx,-0x7feea67a(,%eax,8) 80105f14: 80 for(i = 0; i < 256; i++) 80105f15: 83 c0 01 add $0x1,%eax 80105f18: 3d 00 01 00 00 cmp $0x100,%eax 80105f1d: 75 d1 jne 80105ef0 <tvinit+0x10> SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105f1f: a1 08 b1 10 80 mov 0x8010b108,%eax initlock(&tickslock, "time"); 80105f24: 83 ec 08 sub $0x8,%esp SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105f27: c7 05 82 5b 11 80 08 movl $0xef000008,0x80115b82 80105f2e: 00 00 ef initlock(&tickslock, "time"); 80105f31: 68 96 80 10 80 push $0x80108096 80105f36: 68 40 59 11 80 push $0x80115940 SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105f3b: 66 a3 80 5b 11 80 mov %ax,0x80115b80 80105f41: c1 e8 10 shr $0x10,%eax 80105f44: 66 a3 86 5b 11 80 mov %ax,0x80115b86 initlock(&tickslock, "time"); 80105f4a: e8 f1 e3 ff ff call 80104340 <initlock> } 80105f4f: 83 c4 10 add $0x10,%esp 80105f52: c9 leave 80105f53: c3 ret 80105f54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105f5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80105f60 <idtinit>: void idtinit(void) { 80105f60: 55 push %ebp pd[0] = size-1; 80105f61: b8 ff 07 00 00 mov $0x7ff,%eax 80105f66: 89 e5 mov %esp,%ebp 80105f68: 83 ec 10 sub $0x10,%esp 80105f6b: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 80105f6f: b8 80 59 11 80 mov $0x80115980,%eax 80105f74: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 80105f78: c1 e8 10 shr $0x10,%eax 80105f7b: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 80105f7f: 8d 45 fa lea -0x6(%ebp),%eax 80105f82: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 80105f85: c9 leave 80105f86: c3 ret 80105f87: 89 f6 mov %esi,%esi 80105f89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105f90 <trap>: //PAGEBREAK: 41 void trap(struct trapframe *tf) { 80105f90: 55 push %ebp 80105f91: 89 e5 mov %esp,%ebp 80105f93: 57 push %edi 80105f94: 56 push %esi 80105f95: 53 push %ebx 80105f96: 83 ec 1c sub $0x1c,%esp 80105f99: 8b 7d 08 mov 0x8(%ebp),%edi if(tf->trapno == T_SYSCALL){ 80105f9c: 8b 47 30 mov 0x30(%edi),%eax 80105f9f: 83 f8 40 cmp $0x40,%eax 80105fa2: 0f 84 f0 00 00 00 je 80106098 <trap+0x108> if(myproc()->killed) exit(); return; } switch(tf->trapno){ 80105fa8: 83 e8 20 sub $0x20,%eax 80105fab: 83 f8 1f cmp $0x1f,%eax 80105fae: 77 10 ja 80105fc0 <trap+0x30> 80105fb0: ff 24 85 3c 81 10 80 jmp *-0x7fef7ec4(,%eax,4) 80105fb7: 89 f6 mov %esi,%esi 80105fb9: 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){ 80105fc0: e8 1b d8 ff ff call 801037e0 <myproc> 80105fc5: 85 c0 test %eax,%eax 80105fc7: 8b 5f 38 mov 0x38(%edi),%ebx 80105fca: 0f 84 14 02 00 00 je 801061e4 <trap+0x254> 80105fd0: f6 47 3c 03 testb $0x3,0x3c(%edi) 80105fd4: 0f 84 0a 02 00 00 je 801061e4 <trap+0x254> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 80105fda: 0f 20 d1 mov %cr2,%ecx 80105fdd: 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 " 80105fe0: e8 db d7 ff ff call 801037c0 <cpuid> 80105fe5: 89 45 dc mov %eax,-0x24(%ebp) 80105fe8: 8b 47 34 mov 0x34(%edi),%eax 80105feb: 8b 77 30 mov 0x30(%edi),%esi 80105fee: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105ff1: e8 ea d7 ff ff call 801037e0 <myproc> 80105ff6: 89 45 e0 mov %eax,-0x20(%ebp) 80105ff9: e8 e2 d7 ff ff call 801037e0 <myproc> cprintf("pid %d %s: trap %d err %d on cpu %d " 80105ffe: 8b 4d d8 mov -0x28(%ebp),%ecx 80106001: 8b 55 dc mov -0x24(%ebp),%edx 80106004: 51 push %ecx 80106005: 53 push %ebx 80106006: 52 push %edx myproc()->pid, myproc()->name, tf->trapno, 80106007: 8b 55 e0 mov -0x20(%ebp),%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 8010600a: ff 75 e4 pushl -0x1c(%ebp) 8010600d: 56 push %esi myproc()->pid, myproc()->name, tf->trapno, 8010600e: 83 c2 6c add $0x6c,%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 80106011: 52 push %edx 80106012: ff 70 10 pushl 0x10(%eax) 80106015: 68 f8 80 10 80 push $0x801080f8 8010601a: e8 41 a6 ff ff call 80100660 <cprintf> tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 8010601f: 83 c4 20 add $0x20,%esp 80106022: e8 b9 d7 ff ff call 801037e0 <myproc> 80106027: 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) 8010602e: e8 ad d7 ff ff call 801037e0 <myproc> 80106033: 85 c0 test %eax,%eax 80106035: 74 1d je 80106054 <trap+0xc4> 80106037: e8 a4 d7 ff ff call 801037e0 <myproc> 8010603c: 8b 50 24 mov 0x24(%eax),%edx 8010603f: 85 d2 test %edx,%edx 80106041: 74 11 je 80106054 <trap+0xc4> 80106043: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80106047: 83 e0 03 and $0x3,%eax 8010604a: 66 83 f8 03 cmp $0x3,%ax 8010604e: 0f 84 4c 01 00 00 je 801061a0 <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 && 80106054: e8 87 d7 ff ff call 801037e0 <myproc> 80106059: 85 c0 test %eax,%eax 8010605b: 74 0b je 80106068 <trap+0xd8> 8010605d: e8 7e d7 ff ff call 801037e0 <myproc> 80106062: 83 78 0c 04 cmpl $0x4,0xc(%eax) 80106066: 74 68 je 801060d0 <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) 80106068: e8 73 d7 ff ff call 801037e0 <myproc> 8010606d: 85 c0 test %eax,%eax 8010606f: 74 19 je 8010608a <trap+0xfa> 80106071: e8 6a d7 ff ff call 801037e0 <myproc> 80106076: 8b 40 24 mov 0x24(%eax),%eax 80106079: 85 c0 test %eax,%eax 8010607b: 74 0d je 8010608a <trap+0xfa> 8010607d: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80106081: 83 e0 03 and $0x3,%eax 80106084: 66 83 f8 03 cmp $0x3,%ax 80106088: 74 37 je 801060c1 <trap+0x131> exit(); } 8010608a: 8d 65 f4 lea -0xc(%ebp),%esp 8010608d: 5b pop %ebx 8010608e: 5e pop %esi 8010608f: 5f pop %edi 80106090: 5d pop %ebp 80106091: c3 ret 80106092: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(myproc()->killed) 80106098: e8 43 d7 ff ff call 801037e0 <myproc> 8010609d: 8b 58 24 mov 0x24(%eax),%ebx 801060a0: 85 db test %ebx,%ebx 801060a2: 0f 85 e8 00 00 00 jne 80106190 <trap+0x200> myproc()->tf = tf; 801060a8: e8 33 d7 ff ff call 801037e0 <myproc> 801060ad: 89 78 18 mov %edi,0x18(%eax) syscall(); 801060b0: e8 cb e8 ff ff call 80104980 <syscall> if(myproc()->killed) 801060b5: e8 26 d7 ff ff call 801037e0 <myproc> 801060ba: 8b 48 24 mov 0x24(%eax),%ecx 801060bd: 85 c9 test %ecx,%ecx 801060bf: 74 c9 je 8010608a <trap+0xfa> } 801060c1: 8d 65 f4 lea -0xc(%ebp),%esp 801060c4: 5b pop %ebx 801060c5: 5e pop %esi 801060c6: 5f pop %edi 801060c7: 5d pop %ebp exit(); 801060c8: e9 53 db ff ff jmp 80103c20 <exit> 801060cd: 8d 76 00 lea 0x0(%esi),%esi if(myproc() && myproc()->state == RUNNING && 801060d0: 83 7f 30 20 cmpl $0x20,0x30(%edi) 801060d4: 75 92 jne 80106068 <trap+0xd8> yield(); 801060d6: e8 75 dc ff ff call 80103d50 <yield> 801060db: eb 8b jmp 80106068 <trap+0xd8> 801060dd: 8d 76 00 lea 0x0(%esi),%esi if(cpuid() == 0){ 801060e0: e8 db d6 ff ff call 801037c0 <cpuid> 801060e5: 85 c0 test %eax,%eax 801060e7: 0f 84 c3 00 00 00 je 801061b0 <trap+0x220> lapiceoi(); 801060ed: e8 5e c6 ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801060f2: e8 e9 d6 ff ff call 801037e0 <myproc> 801060f7: 85 c0 test %eax,%eax 801060f9: 0f 85 38 ff ff ff jne 80106037 <trap+0xa7> 801060ff: e9 50 ff ff ff jmp 80106054 <trap+0xc4> 80106104: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kbdintr(); 80106108: e8 03 c5 ff ff call 80102610 <kbdintr> lapiceoi(); 8010610d: e8 3e c6 ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80106112: e8 c9 d6 ff ff call 801037e0 <myproc> 80106117: 85 c0 test %eax,%eax 80106119: 0f 85 18 ff ff ff jne 80106037 <trap+0xa7> 8010611f: e9 30 ff ff ff jmp 80106054 <trap+0xc4> 80106124: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uartintr(); 80106128: e8 53 02 00 00 call 80106380 <uartintr> lapiceoi(); 8010612d: e8 1e c6 ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80106132: e8 a9 d6 ff ff call 801037e0 <myproc> 80106137: 85 c0 test %eax,%eax 80106139: 0f 85 f8 fe ff ff jne 80106037 <trap+0xa7> 8010613f: e9 10 ff ff ff jmp 80106054 <trap+0xc4> 80106144: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("cpu%d: spurious interrupt at %x:%x\n", 80106148: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 8010614c: 8b 77 38 mov 0x38(%edi),%esi 8010614f: e8 6c d6 ff ff call 801037c0 <cpuid> 80106154: 56 push %esi 80106155: 53 push %ebx 80106156: 50 push %eax 80106157: 68 a0 80 10 80 push $0x801080a0 8010615c: e8 ff a4 ff ff call 80100660 <cprintf> lapiceoi(); 80106161: e8 ea c5 ff ff call 80102750 <lapiceoi> break; 80106166: 83 c4 10 add $0x10,%esp if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80106169: e8 72 d6 ff ff call 801037e0 <myproc> 8010616e: 85 c0 test %eax,%eax 80106170: 0f 85 c1 fe ff ff jne 80106037 <trap+0xa7> 80106176: e9 d9 fe ff ff jmp 80106054 <trap+0xc4> 8010617b: 90 nop 8010617c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ideintr(); 80106180: e8 fb be ff ff call 80102080 <ideintr> 80106185: e9 63 ff ff ff jmp 801060ed <trap+0x15d> 8010618a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80106190: e8 8b da ff ff call 80103c20 <exit> 80106195: e9 0e ff ff ff jmp 801060a8 <trap+0x118> 8010619a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 801061a0: e8 7b da ff ff call 80103c20 <exit> 801061a5: e9 aa fe ff ff jmp 80106054 <trap+0xc4> 801061aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi acquire(&tickslock); 801061b0: 83 ec 0c sub $0xc,%esp 801061b3: 68 40 59 11 80 push $0x80115940 801061b8: e8 c3 e2 ff ff call 80104480 <acquire> wakeup(&ticks); 801061bd: c7 04 24 80 61 11 80 movl $0x80116180,(%esp) ticks++; 801061c4: 83 05 80 61 11 80 01 addl $0x1,0x80116180 wakeup(&ticks); 801061cb: e8 80 dd ff ff call 80103f50 <wakeup> release(&tickslock); 801061d0: c7 04 24 40 59 11 80 movl $0x80115940,(%esp) 801061d7: e8 64 e3 ff ff call 80104540 <release> 801061dc: 83 c4 10 add $0x10,%esp 801061df: e9 09 ff ff ff jmp 801060ed <trap+0x15d> 801061e4: 0f 20 d6 mov %cr2,%esi cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 801061e7: e8 d4 d5 ff ff call 801037c0 <cpuid> 801061ec: 83 ec 0c sub $0xc,%esp 801061ef: 56 push %esi 801061f0: 53 push %ebx 801061f1: 50 push %eax 801061f2: ff 77 30 pushl 0x30(%edi) 801061f5: 68 c4 80 10 80 push $0x801080c4 801061fa: e8 61 a4 ff ff call 80100660 <cprintf> panic("trap"); 801061ff: 83 c4 14 add $0x14,%esp 80106202: 68 9b 80 10 80 push $0x8010809b 80106207: e8 84 a1 ff ff call 80100390 <panic> 8010620c: 66 90 xchg %ax,%ax 8010620e: 66 90 xchg %ax,%ax 80106210 <uartgetc>: } static int uartgetc(void) { if(!uart) 80106210: a1 bc b5 10 80 mov 0x8010b5bc,%eax { 80106215: 55 push %ebp 80106216: 89 e5 mov %esp,%ebp if(!uart) 80106218: 85 c0 test %eax,%eax 8010621a: 74 1c je 80106238 <uartgetc+0x28> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010621c: ba fd 03 00 00 mov $0x3fd,%edx 80106221: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 80106222: a8 01 test $0x1,%al 80106224: 74 12 je 80106238 <uartgetc+0x28> 80106226: ba f8 03 00 00 mov $0x3f8,%edx 8010622b: ec in (%dx),%al return -1; return inb(COM1+0); 8010622c: 0f b6 c0 movzbl %al,%eax } 8010622f: 5d pop %ebp 80106230: c3 ret 80106231: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80106238: b8 ff ff ff ff mov $0xffffffff,%eax } 8010623d: 5d pop %ebp 8010623e: c3 ret 8010623f: 90 nop 80106240 <uartputc.part.0>: uartputc(int c) 80106240: 55 push %ebp 80106241: 89 e5 mov %esp,%ebp 80106243: 57 push %edi 80106244: 56 push %esi 80106245: 53 push %ebx 80106246: 89 c7 mov %eax,%edi 80106248: bb 80 00 00 00 mov $0x80,%ebx 8010624d: be fd 03 00 00 mov $0x3fd,%esi 80106252: 83 ec 0c sub $0xc,%esp 80106255: eb 1b jmp 80106272 <uartputc.part.0+0x32> 80106257: 89 f6 mov %esi,%esi 80106259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi microdelay(10); 80106260: 83 ec 0c sub $0xc,%esp 80106263: 6a 0a push $0xa 80106265: e8 06 c5 ff ff call 80102770 <microdelay> for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 8010626a: 83 c4 10 add $0x10,%esp 8010626d: 83 eb 01 sub $0x1,%ebx 80106270: 74 07 je 80106279 <uartputc.part.0+0x39> 80106272: 89 f2 mov %esi,%edx 80106274: ec in (%dx),%al 80106275: a8 20 test $0x20,%al 80106277: 74 e7 je 80106260 <uartputc.part.0+0x20> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80106279: ba f8 03 00 00 mov $0x3f8,%edx 8010627e: 89 f8 mov %edi,%eax 80106280: ee out %al,(%dx) } 80106281: 8d 65 f4 lea -0xc(%ebp),%esp 80106284: 5b pop %ebx 80106285: 5e pop %esi 80106286: 5f pop %edi 80106287: 5d pop %ebp 80106288: c3 ret 80106289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106290 <uartinit>: { 80106290: 55 push %ebp 80106291: 31 c9 xor %ecx,%ecx 80106293: 89 c8 mov %ecx,%eax 80106295: 89 e5 mov %esp,%ebp 80106297: 57 push %edi 80106298: 56 push %esi 80106299: 53 push %ebx 8010629a: bb fa 03 00 00 mov $0x3fa,%ebx 8010629f: 89 da mov %ebx,%edx 801062a1: 83 ec 0c sub $0xc,%esp 801062a4: ee out %al,(%dx) 801062a5: bf fb 03 00 00 mov $0x3fb,%edi 801062aa: b8 80 ff ff ff mov $0xffffff80,%eax 801062af: 89 fa mov %edi,%edx 801062b1: ee out %al,(%dx) 801062b2: b8 0c 00 00 00 mov $0xc,%eax 801062b7: ba f8 03 00 00 mov $0x3f8,%edx 801062bc: ee out %al,(%dx) 801062bd: be f9 03 00 00 mov $0x3f9,%esi 801062c2: 89 c8 mov %ecx,%eax 801062c4: 89 f2 mov %esi,%edx 801062c6: ee out %al,(%dx) 801062c7: b8 03 00 00 00 mov $0x3,%eax 801062cc: 89 fa mov %edi,%edx 801062ce: ee out %al,(%dx) 801062cf: ba fc 03 00 00 mov $0x3fc,%edx 801062d4: 89 c8 mov %ecx,%eax 801062d6: ee out %al,(%dx) 801062d7: b8 01 00 00 00 mov $0x1,%eax 801062dc: 89 f2 mov %esi,%edx 801062de: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801062df: ba fd 03 00 00 mov $0x3fd,%edx 801062e4: ec in (%dx),%al if(inb(COM1+5) == 0xFF) 801062e5: 3c ff cmp $0xff,%al 801062e7: 74 5a je 80106343 <uartinit+0xb3> uart = 1; 801062e9: c7 05 bc b5 10 80 01 movl $0x1,0x8010b5bc 801062f0: 00 00 00 801062f3: 89 da mov %ebx,%edx 801062f5: ec in (%dx),%al 801062f6: ba f8 03 00 00 mov $0x3f8,%edx 801062fb: ec in (%dx),%al ioapicenable(IRQ_COM1, 0); 801062fc: 83 ec 08 sub $0x8,%esp for(p="xv6...\n"; *p; p++) 801062ff: bb bc 81 10 80 mov $0x801081bc,%ebx ioapicenable(IRQ_COM1, 0); 80106304: 6a 00 push $0x0 80106306: 6a 04 push $0x4 80106308: e8 c3 bf ff ff call 801022d0 <ioapicenable> 8010630d: 83 c4 10 add $0x10,%esp for(p="xv6...\n"; *p; p++) 80106310: b8 78 00 00 00 mov $0x78,%eax 80106315: eb 13 jmp 8010632a <uartinit+0x9a> 80106317: 89 f6 mov %esi,%esi 80106319: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106320: 83 c3 01 add $0x1,%ebx 80106323: 0f be 03 movsbl (%ebx),%eax 80106326: 84 c0 test %al,%al 80106328: 74 19 je 80106343 <uartinit+0xb3> if(!uart) 8010632a: 8b 15 bc b5 10 80 mov 0x8010b5bc,%edx 80106330: 85 d2 test %edx,%edx 80106332: 74 ec je 80106320 <uartinit+0x90> for(p="xv6...\n"; *p; p++) 80106334: 83 c3 01 add $0x1,%ebx 80106337: e8 04 ff ff ff call 80106240 <uartputc.part.0> 8010633c: 0f be 03 movsbl (%ebx),%eax 8010633f: 84 c0 test %al,%al 80106341: 75 e7 jne 8010632a <uartinit+0x9a> } 80106343: 8d 65 f4 lea -0xc(%ebp),%esp 80106346: 5b pop %ebx 80106347: 5e pop %esi 80106348: 5f pop %edi 80106349: 5d pop %ebp 8010634a: c3 ret 8010634b: 90 nop 8010634c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106350 <uartputc>: if(!uart) 80106350: 8b 15 bc b5 10 80 mov 0x8010b5bc,%edx { 80106356: 55 push %ebp 80106357: 89 e5 mov %esp,%ebp if(!uart) 80106359: 85 d2 test %edx,%edx { 8010635b: 8b 45 08 mov 0x8(%ebp),%eax if(!uart) 8010635e: 74 10 je 80106370 <uartputc+0x20> } 80106360: 5d pop %ebp 80106361: e9 da fe ff ff jmp 80106240 <uartputc.part.0> 80106366: 8d 76 00 lea 0x0(%esi),%esi 80106369: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106370: 5d pop %ebp 80106371: c3 ret 80106372: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106379: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106380 <uartintr>: void uartintr(void) { 80106380: 55 push %ebp 80106381: 89 e5 mov %esp,%ebp 80106383: 83 ec 14 sub $0x14,%esp consoleintr(uartgetc); 80106386: 68 10 62 10 80 push $0x80106210 8010638b: e8 80 a4 ff ff call 80100810 <consoleintr> } 80106390: 83 c4 10 add $0x10,%esp 80106393: c9 leave 80106394: c3 ret 80106395 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80106395: 6a 00 push $0x0 pushl $0 80106397: 6a 00 push $0x0 jmp alltraps 80106399: e9 19 fb ff ff jmp 80105eb7 <alltraps> 8010639e <vector1>: .globl vector1 vector1: pushl $0 8010639e: 6a 00 push $0x0 pushl $1 801063a0: 6a 01 push $0x1 jmp alltraps 801063a2: e9 10 fb ff ff jmp 80105eb7 <alltraps> 801063a7 <vector2>: .globl vector2 vector2: pushl $0 801063a7: 6a 00 push $0x0 pushl $2 801063a9: 6a 02 push $0x2 jmp alltraps 801063ab: e9 07 fb ff ff jmp 80105eb7 <alltraps> 801063b0 <vector3>: .globl vector3 vector3: pushl $0 801063b0: 6a 00 push $0x0 pushl $3 801063b2: 6a 03 push $0x3 jmp alltraps 801063b4: e9 fe fa ff ff jmp 80105eb7 <alltraps> 801063b9 <vector4>: .globl vector4 vector4: pushl $0 801063b9: 6a 00 push $0x0 pushl $4 801063bb: 6a 04 push $0x4 jmp alltraps 801063bd: e9 f5 fa ff ff jmp 80105eb7 <alltraps> 801063c2 <vector5>: .globl vector5 vector5: pushl $0 801063c2: 6a 00 push $0x0 pushl $5 801063c4: 6a 05 push $0x5 jmp alltraps 801063c6: e9 ec fa ff ff jmp 80105eb7 <alltraps> 801063cb <vector6>: .globl vector6 vector6: pushl $0 801063cb: 6a 00 push $0x0 pushl $6 801063cd: 6a 06 push $0x6 jmp alltraps 801063cf: e9 e3 fa ff ff jmp 80105eb7 <alltraps> 801063d4 <vector7>: .globl vector7 vector7: pushl $0 801063d4: 6a 00 push $0x0 pushl $7 801063d6: 6a 07 push $0x7 jmp alltraps 801063d8: e9 da fa ff ff jmp 80105eb7 <alltraps> 801063dd <vector8>: .globl vector8 vector8: pushl $8 801063dd: 6a 08 push $0x8 jmp alltraps 801063df: e9 d3 fa ff ff jmp 80105eb7 <alltraps> 801063e4 <vector9>: .globl vector9 vector9: pushl $0 801063e4: 6a 00 push $0x0 pushl $9 801063e6: 6a 09 push $0x9 jmp alltraps 801063e8: e9 ca fa ff ff jmp 80105eb7 <alltraps> 801063ed <vector10>: .globl vector10 vector10: pushl $10 801063ed: 6a 0a push $0xa jmp alltraps 801063ef: e9 c3 fa ff ff jmp 80105eb7 <alltraps> 801063f4 <vector11>: .globl vector11 vector11: pushl $11 801063f4: 6a 0b push $0xb jmp alltraps 801063f6: e9 bc fa ff ff jmp 80105eb7 <alltraps> 801063fb <vector12>: .globl vector12 vector12: pushl $12 801063fb: 6a 0c push $0xc jmp alltraps 801063fd: e9 b5 fa ff ff jmp 80105eb7 <alltraps> 80106402 <vector13>: .globl vector13 vector13: pushl $13 80106402: 6a 0d push $0xd jmp alltraps 80106404: e9 ae fa ff ff jmp 80105eb7 <alltraps> 80106409 <vector14>: .globl vector14 vector14: pushl $14 80106409: 6a 0e push $0xe jmp alltraps 8010640b: e9 a7 fa ff ff jmp 80105eb7 <alltraps> 80106410 <vector15>: .globl vector15 vector15: pushl $0 80106410: 6a 00 push $0x0 pushl $15 80106412: 6a 0f push $0xf jmp alltraps 80106414: e9 9e fa ff ff jmp 80105eb7 <alltraps> 80106419 <vector16>: .globl vector16 vector16: pushl $0 80106419: 6a 00 push $0x0 pushl $16 8010641b: 6a 10 push $0x10 jmp alltraps 8010641d: e9 95 fa ff ff jmp 80105eb7 <alltraps> 80106422 <vector17>: .globl vector17 vector17: pushl $17 80106422: 6a 11 push $0x11 jmp alltraps 80106424: e9 8e fa ff ff jmp 80105eb7 <alltraps> 80106429 <vector18>: .globl vector18 vector18: pushl $0 80106429: 6a 00 push $0x0 pushl $18 8010642b: 6a 12 push $0x12 jmp alltraps 8010642d: e9 85 fa ff ff jmp 80105eb7 <alltraps> 80106432 <vector19>: .globl vector19 vector19: pushl $0 80106432: 6a 00 push $0x0 pushl $19 80106434: 6a 13 push $0x13 jmp alltraps 80106436: e9 7c fa ff ff jmp 80105eb7 <alltraps> 8010643b <vector20>: .globl vector20 vector20: pushl $0 8010643b: 6a 00 push $0x0 pushl $20 8010643d: 6a 14 push $0x14 jmp alltraps 8010643f: e9 73 fa ff ff jmp 80105eb7 <alltraps> 80106444 <vector21>: .globl vector21 vector21: pushl $0 80106444: 6a 00 push $0x0 pushl $21 80106446: 6a 15 push $0x15 jmp alltraps 80106448: e9 6a fa ff ff jmp 80105eb7 <alltraps> 8010644d <vector22>: .globl vector22 vector22: pushl $0 8010644d: 6a 00 push $0x0 pushl $22 8010644f: 6a 16 push $0x16 jmp alltraps 80106451: e9 61 fa ff ff jmp 80105eb7 <alltraps> 80106456 <vector23>: .globl vector23 vector23: pushl $0 80106456: 6a 00 push $0x0 pushl $23 80106458: 6a 17 push $0x17 jmp alltraps 8010645a: e9 58 fa ff ff jmp 80105eb7 <alltraps> 8010645f <vector24>: .globl vector24 vector24: pushl $0 8010645f: 6a 00 push $0x0 pushl $24 80106461: 6a 18 push $0x18 jmp alltraps 80106463: e9 4f fa ff ff jmp 80105eb7 <alltraps> 80106468 <vector25>: .globl vector25 vector25: pushl $0 80106468: 6a 00 push $0x0 pushl $25 8010646a: 6a 19 push $0x19 jmp alltraps 8010646c: e9 46 fa ff ff jmp 80105eb7 <alltraps> 80106471 <vector26>: .globl vector26 vector26: pushl $0 80106471: 6a 00 push $0x0 pushl $26 80106473: 6a 1a push $0x1a jmp alltraps 80106475: e9 3d fa ff ff jmp 80105eb7 <alltraps> 8010647a <vector27>: .globl vector27 vector27: pushl $0 8010647a: 6a 00 push $0x0 pushl $27 8010647c: 6a 1b push $0x1b jmp alltraps 8010647e: e9 34 fa ff ff jmp 80105eb7 <alltraps> 80106483 <vector28>: .globl vector28 vector28: pushl $0 80106483: 6a 00 push $0x0 pushl $28 80106485: 6a 1c push $0x1c jmp alltraps 80106487: e9 2b fa ff ff jmp 80105eb7 <alltraps> 8010648c <vector29>: .globl vector29 vector29: pushl $0 8010648c: 6a 00 push $0x0 pushl $29 8010648e: 6a 1d push $0x1d jmp alltraps 80106490: e9 22 fa ff ff jmp 80105eb7 <alltraps> 80106495 <vector30>: .globl vector30 vector30: pushl $0 80106495: 6a 00 push $0x0 pushl $30 80106497: 6a 1e push $0x1e jmp alltraps 80106499: e9 19 fa ff ff jmp 80105eb7 <alltraps> 8010649e <vector31>: .globl vector31 vector31: pushl $0 8010649e: 6a 00 push $0x0 pushl $31 801064a0: 6a 1f push $0x1f jmp alltraps 801064a2: e9 10 fa ff ff jmp 80105eb7 <alltraps> 801064a7 <vector32>: .globl vector32 vector32: pushl $0 801064a7: 6a 00 push $0x0 pushl $32 801064a9: 6a 20 push $0x20 jmp alltraps 801064ab: e9 07 fa ff ff jmp 80105eb7 <alltraps> 801064b0 <vector33>: .globl vector33 vector33: pushl $0 801064b0: 6a 00 push $0x0 pushl $33 801064b2: 6a 21 push $0x21 jmp alltraps 801064b4: e9 fe f9 ff ff jmp 80105eb7 <alltraps> 801064b9 <vector34>: .globl vector34 vector34: pushl $0 801064b9: 6a 00 push $0x0 pushl $34 801064bb: 6a 22 push $0x22 jmp alltraps 801064bd: e9 f5 f9 ff ff jmp 80105eb7 <alltraps> 801064c2 <vector35>: .globl vector35 vector35: pushl $0 801064c2: 6a 00 push $0x0 pushl $35 801064c4: 6a 23 push $0x23 jmp alltraps 801064c6: e9 ec f9 ff ff jmp 80105eb7 <alltraps> 801064cb <vector36>: .globl vector36 vector36: pushl $0 801064cb: 6a 00 push $0x0 pushl $36 801064cd: 6a 24 push $0x24 jmp alltraps 801064cf: e9 e3 f9 ff ff jmp 80105eb7 <alltraps> 801064d4 <vector37>: .globl vector37 vector37: pushl $0 801064d4: 6a 00 push $0x0 pushl $37 801064d6: 6a 25 push $0x25 jmp alltraps 801064d8: e9 da f9 ff ff jmp 80105eb7 <alltraps> 801064dd <vector38>: .globl vector38 vector38: pushl $0 801064dd: 6a 00 push $0x0 pushl $38 801064df: 6a 26 push $0x26 jmp alltraps 801064e1: e9 d1 f9 ff ff jmp 80105eb7 <alltraps> 801064e6 <vector39>: .globl vector39 vector39: pushl $0 801064e6: 6a 00 push $0x0 pushl $39 801064e8: 6a 27 push $0x27 jmp alltraps 801064ea: e9 c8 f9 ff ff jmp 80105eb7 <alltraps> 801064ef <vector40>: .globl vector40 vector40: pushl $0 801064ef: 6a 00 push $0x0 pushl $40 801064f1: 6a 28 push $0x28 jmp alltraps 801064f3: e9 bf f9 ff ff jmp 80105eb7 <alltraps> 801064f8 <vector41>: .globl vector41 vector41: pushl $0 801064f8: 6a 00 push $0x0 pushl $41 801064fa: 6a 29 push $0x29 jmp alltraps 801064fc: e9 b6 f9 ff ff jmp 80105eb7 <alltraps> 80106501 <vector42>: .globl vector42 vector42: pushl $0 80106501: 6a 00 push $0x0 pushl $42 80106503: 6a 2a push $0x2a jmp alltraps 80106505: e9 ad f9 ff ff jmp 80105eb7 <alltraps> 8010650a <vector43>: .globl vector43 vector43: pushl $0 8010650a: 6a 00 push $0x0 pushl $43 8010650c: 6a 2b push $0x2b jmp alltraps 8010650e: e9 a4 f9 ff ff jmp 80105eb7 <alltraps> 80106513 <vector44>: .globl vector44 vector44: pushl $0 80106513: 6a 00 push $0x0 pushl $44 80106515: 6a 2c push $0x2c jmp alltraps 80106517: e9 9b f9 ff ff jmp 80105eb7 <alltraps> 8010651c <vector45>: .globl vector45 vector45: pushl $0 8010651c: 6a 00 push $0x0 pushl $45 8010651e: 6a 2d push $0x2d jmp alltraps 80106520: e9 92 f9 ff ff jmp 80105eb7 <alltraps> 80106525 <vector46>: .globl vector46 vector46: pushl $0 80106525: 6a 00 push $0x0 pushl $46 80106527: 6a 2e push $0x2e jmp alltraps 80106529: e9 89 f9 ff ff jmp 80105eb7 <alltraps> 8010652e <vector47>: .globl vector47 vector47: pushl $0 8010652e: 6a 00 push $0x0 pushl $47 80106530: 6a 2f push $0x2f jmp alltraps 80106532: e9 80 f9 ff ff jmp 80105eb7 <alltraps> 80106537 <vector48>: .globl vector48 vector48: pushl $0 80106537: 6a 00 push $0x0 pushl $48 80106539: 6a 30 push $0x30 jmp alltraps 8010653b: e9 77 f9 ff ff jmp 80105eb7 <alltraps> 80106540 <vector49>: .globl vector49 vector49: pushl $0 80106540: 6a 00 push $0x0 pushl $49 80106542: 6a 31 push $0x31 jmp alltraps 80106544: e9 6e f9 ff ff jmp 80105eb7 <alltraps> 80106549 <vector50>: .globl vector50 vector50: pushl $0 80106549: 6a 00 push $0x0 pushl $50 8010654b: 6a 32 push $0x32 jmp alltraps 8010654d: e9 65 f9 ff ff jmp 80105eb7 <alltraps> 80106552 <vector51>: .globl vector51 vector51: pushl $0 80106552: 6a 00 push $0x0 pushl $51 80106554: 6a 33 push $0x33 jmp alltraps 80106556: e9 5c f9 ff ff jmp 80105eb7 <alltraps> 8010655b <vector52>: .globl vector52 vector52: pushl $0 8010655b: 6a 00 push $0x0 pushl $52 8010655d: 6a 34 push $0x34 jmp alltraps 8010655f: e9 53 f9 ff ff jmp 80105eb7 <alltraps> 80106564 <vector53>: .globl vector53 vector53: pushl $0 80106564: 6a 00 push $0x0 pushl $53 80106566: 6a 35 push $0x35 jmp alltraps 80106568: e9 4a f9 ff ff jmp 80105eb7 <alltraps> 8010656d <vector54>: .globl vector54 vector54: pushl $0 8010656d: 6a 00 push $0x0 pushl $54 8010656f: 6a 36 push $0x36 jmp alltraps 80106571: e9 41 f9 ff ff jmp 80105eb7 <alltraps> 80106576 <vector55>: .globl vector55 vector55: pushl $0 80106576: 6a 00 push $0x0 pushl $55 80106578: 6a 37 push $0x37 jmp alltraps 8010657a: e9 38 f9 ff ff jmp 80105eb7 <alltraps> 8010657f <vector56>: .globl vector56 vector56: pushl $0 8010657f: 6a 00 push $0x0 pushl $56 80106581: 6a 38 push $0x38 jmp alltraps 80106583: e9 2f f9 ff ff jmp 80105eb7 <alltraps> 80106588 <vector57>: .globl vector57 vector57: pushl $0 80106588: 6a 00 push $0x0 pushl $57 8010658a: 6a 39 push $0x39 jmp alltraps 8010658c: e9 26 f9 ff ff jmp 80105eb7 <alltraps> 80106591 <vector58>: .globl vector58 vector58: pushl $0 80106591: 6a 00 push $0x0 pushl $58 80106593: 6a 3a push $0x3a jmp alltraps 80106595: e9 1d f9 ff ff jmp 80105eb7 <alltraps> 8010659a <vector59>: .globl vector59 vector59: pushl $0 8010659a: 6a 00 push $0x0 pushl $59 8010659c: 6a 3b push $0x3b jmp alltraps 8010659e: e9 14 f9 ff ff jmp 80105eb7 <alltraps> 801065a3 <vector60>: .globl vector60 vector60: pushl $0 801065a3: 6a 00 push $0x0 pushl $60 801065a5: 6a 3c push $0x3c jmp alltraps 801065a7: e9 0b f9 ff ff jmp 80105eb7 <alltraps> 801065ac <vector61>: .globl vector61 vector61: pushl $0 801065ac: 6a 00 push $0x0 pushl $61 801065ae: 6a 3d push $0x3d jmp alltraps 801065b0: e9 02 f9 ff ff jmp 80105eb7 <alltraps> 801065b5 <vector62>: .globl vector62 vector62: pushl $0 801065b5: 6a 00 push $0x0 pushl $62 801065b7: 6a 3e push $0x3e jmp alltraps 801065b9: e9 f9 f8 ff ff jmp 80105eb7 <alltraps> 801065be <vector63>: .globl vector63 vector63: pushl $0 801065be: 6a 00 push $0x0 pushl $63 801065c0: 6a 3f push $0x3f jmp alltraps 801065c2: e9 f0 f8 ff ff jmp 80105eb7 <alltraps> 801065c7 <vector64>: .globl vector64 vector64: pushl $0 801065c7: 6a 00 push $0x0 pushl $64 801065c9: 6a 40 push $0x40 jmp alltraps 801065cb: e9 e7 f8 ff ff jmp 80105eb7 <alltraps> 801065d0 <vector65>: .globl vector65 vector65: pushl $0 801065d0: 6a 00 push $0x0 pushl $65 801065d2: 6a 41 push $0x41 jmp alltraps 801065d4: e9 de f8 ff ff jmp 80105eb7 <alltraps> 801065d9 <vector66>: .globl vector66 vector66: pushl $0 801065d9: 6a 00 push $0x0 pushl $66 801065db: 6a 42 push $0x42 jmp alltraps 801065dd: e9 d5 f8 ff ff jmp 80105eb7 <alltraps> 801065e2 <vector67>: .globl vector67 vector67: pushl $0 801065e2: 6a 00 push $0x0 pushl $67 801065e4: 6a 43 push $0x43 jmp alltraps 801065e6: e9 cc f8 ff ff jmp 80105eb7 <alltraps> 801065eb <vector68>: .globl vector68 vector68: pushl $0 801065eb: 6a 00 push $0x0 pushl $68 801065ed: 6a 44 push $0x44 jmp alltraps 801065ef: e9 c3 f8 ff ff jmp 80105eb7 <alltraps> 801065f4 <vector69>: .globl vector69 vector69: pushl $0 801065f4: 6a 00 push $0x0 pushl $69 801065f6: 6a 45 push $0x45 jmp alltraps 801065f8: e9 ba f8 ff ff jmp 80105eb7 <alltraps> 801065fd <vector70>: .globl vector70 vector70: pushl $0 801065fd: 6a 00 push $0x0 pushl $70 801065ff: 6a 46 push $0x46 jmp alltraps 80106601: e9 b1 f8 ff ff jmp 80105eb7 <alltraps> 80106606 <vector71>: .globl vector71 vector71: pushl $0 80106606: 6a 00 push $0x0 pushl $71 80106608: 6a 47 push $0x47 jmp alltraps 8010660a: e9 a8 f8 ff ff jmp 80105eb7 <alltraps> 8010660f <vector72>: .globl vector72 vector72: pushl $0 8010660f: 6a 00 push $0x0 pushl $72 80106611: 6a 48 push $0x48 jmp alltraps 80106613: e9 9f f8 ff ff jmp 80105eb7 <alltraps> 80106618 <vector73>: .globl vector73 vector73: pushl $0 80106618: 6a 00 push $0x0 pushl $73 8010661a: 6a 49 push $0x49 jmp alltraps 8010661c: e9 96 f8 ff ff jmp 80105eb7 <alltraps> 80106621 <vector74>: .globl vector74 vector74: pushl $0 80106621: 6a 00 push $0x0 pushl $74 80106623: 6a 4a push $0x4a jmp alltraps 80106625: e9 8d f8 ff ff jmp 80105eb7 <alltraps> 8010662a <vector75>: .globl vector75 vector75: pushl $0 8010662a: 6a 00 push $0x0 pushl $75 8010662c: 6a 4b push $0x4b jmp alltraps 8010662e: e9 84 f8 ff ff jmp 80105eb7 <alltraps> 80106633 <vector76>: .globl vector76 vector76: pushl $0 80106633: 6a 00 push $0x0 pushl $76 80106635: 6a 4c push $0x4c jmp alltraps 80106637: e9 7b f8 ff ff jmp 80105eb7 <alltraps> 8010663c <vector77>: .globl vector77 vector77: pushl $0 8010663c: 6a 00 push $0x0 pushl $77 8010663e: 6a 4d push $0x4d jmp alltraps 80106640: e9 72 f8 ff ff jmp 80105eb7 <alltraps> 80106645 <vector78>: .globl vector78 vector78: pushl $0 80106645: 6a 00 push $0x0 pushl $78 80106647: 6a 4e push $0x4e jmp alltraps 80106649: e9 69 f8 ff ff jmp 80105eb7 <alltraps> 8010664e <vector79>: .globl vector79 vector79: pushl $0 8010664e: 6a 00 push $0x0 pushl $79 80106650: 6a 4f push $0x4f jmp alltraps 80106652: e9 60 f8 ff ff jmp 80105eb7 <alltraps> 80106657 <vector80>: .globl vector80 vector80: pushl $0 80106657: 6a 00 push $0x0 pushl $80 80106659: 6a 50 push $0x50 jmp alltraps 8010665b: e9 57 f8 ff ff jmp 80105eb7 <alltraps> 80106660 <vector81>: .globl vector81 vector81: pushl $0 80106660: 6a 00 push $0x0 pushl $81 80106662: 6a 51 push $0x51 jmp alltraps 80106664: e9 4e f8 ff ff jmp 80105eb7 <alltraps> 80106669 <vector82>: .globl vector82 vector82: pushl $0 80106669: 6a 00 push $0x0 pushl $82 8010666b: 6a 52 push $0x52 jmp alltraps 8010666d: e9 45 f8 ff ff jmp 80105eb7 <alltraps> 80106672 <vector83>: .globl vector83 vector83: pushl $0 80106672: 6a 00 push $0x0 pushl $83 80106674: 6a 53 push $0x53 jmp alltraps 80106676: e9 3c f8 ff ff jmp 80105eb7 <alltraps> 8010667b <vector84>: .globl vector84 vector84: pushl $0 8010667b: 6a 00 push $0x0 pushl $84 8010667d: 6a 54 push $0x54 jmp alltraps 8010667f: e9 33 f8 ff ff jmp 80105eb7 <alltraps> 80106684 <vector85>: .globl vector85 vector85: pushl $0 80106684: 6a 00 push $0x0 pushl $85 80106686: 6a 55 push $0x55 jmp alltraps 80106688: e9 2a f8 ff ff jmp 80105eb7 <alltraps> 8010668d <vector86>: .globl vector86 vector86: pushl $0 8010668d: 6a 00 push $0x0 pushl $86 8010668f: 6a 56 push $0x56 jmp alltraps 80106691: e9 21 f8 ff ff jmp 80105eb7 <alltraps> 80106696 <vector87>: .globl vector87 vector87: pushl $0 80106696: 6a 00 push $0x0 pushl $87 80106698: 6a 57 push $0x57 jmp alltraps 8010669a: e9 18 f8 ff ff jmp 80105eb7 <alltraps> 8010669f <vector88>: .globl vector88 vector88: pushl $0 8010669f: 6a 00 push $0x0 pushl $88 801066a1: 6a 58 push $0x58 jmp alltraps 801066a3: e9 0f f8 ff ff jmp 80105eb7 <alltraps> 801066a8 <vector89>: .globl vector89 vector89: pushl $0 801066a8: 6a 00 push $0x0 pushl $89 801066aa: 6a 59 push $0x59 jmp alltraps 801066ac: e9 06 f8 ff ff jmp 80105eb7 <alltraps> 801066b1 <vector90>: .globl vector90 vector90: pushl $0 801066b1: 6a 00 push $0x0 pushl $90 801066b3: 6a 5a push $0x5a jmp alltraps 801066b5: e9 fd f7 ff ff jmp 80105eb7 <alltraps> 801066ba <vector91>: .globl vector91 vector91: pushl $0 801066ba: 6a 00 push $0x0 pushl $91 801066bc: 6a 5b push $0x5b jmp alltraps 801066be: e9 f4 f7 ff ff jmp 80105eb7 <alltraps> 801066c3 <vector92>: .globl vector92 vector92: pushl $0 801066c3: 6a 00 push $0x0 pushl $92 801066c5: 6a 5c push $0x5c jmp alltraps 801066c7: e9 eb f7 ff ff jmp 80105eb7 <alltraps> 801066cc <vector93>: .globl vector93 vector93: pushl $0 801066cc: 6a 00 push $0x0 pushl $93 801066ce: 6a 5d push $0x5d jmp alltraps 801066d0: e9 e2 f7 ff ff jmp 80105eb7 <alltraps> 801066d5 <vector94>: .globl vector94 vector94: pushl $0 801066d5: 6a 00 push $0x0 pushl $94 801066d7: 6a 5e push $0x5e jmp alltraps 801066d9: e9 d9 f7 ff ff jmp 80105eb7 <alltraps> 801066de <vector95>: .globl vector95 vector95: pushl $0 801066de: 6a 00 push $0x0 pushl $95 801066e0: 6a 5f push $0x5f jmp alltraps 801066e2: e9 d0 f7 ff ff jmp 80105eb7 <alltraps> 801066e7 <vector96>: .globl vector96 vector96: pushl $0 801066e7: 6a 00 push $0x0 pushl $96 801066e9: 6a 60 push $0x60 jmp alltraps 801066eb: e9 c7 f7 ff ff jmp 80105eb7 <alltraps> 801066f0 <vector97>: .globl vector97 vector97: pushl $0 801066f0: 6a 00 push $0x0 pushl $97 801066f2: 6a 61 push $0x61 jmp alltraps 801066f4: e9 be f7 ff ff jmp 80105eb7 <alltraps> 801066f9 <vector98>: .globl vector98 vector98: pushl $0 801066f9: 6a 00 push $0x0 pushl $98 801066fb: 6a 62 push $0x62 jmp alltraps 801066fd: e9 b5 f7 ff ff jmp 80105eb7 <alltraps> 80106702 <vector99>: .globl vector99 vector99: pushl $0 80106702: 6a 00 push $0x0 pushl $99 80106704: 6a 63 push $0x63 jmp alltraps 80106706: e9 ac f7 ff ff jmp 80105eb7 <alltraps> 8010670b <vector100>: .globl vector100 vector100: pushl $0 8010670b: 6a 00 push $0x0 pushl $100 8010670d: 6a 64 push $0x64 jmp alltraps 8010670f: e9 a3 f7 ff ff jmp 80105eb7 <alltraps> 80106714 <vector101>: .globl vector101 vector101: pushl $0 80106714: 6a 00 push $0x0 pushl $101 80106716: 6a 65 push $0x65 jmp alltraps 80106718: e9 9a f7 ff ff jmp 80105eb7 <alltraps> 8010671d <vector102>: .globl vector102 vector102: pushl $0 8010671d: 6a 00 push $0x0 pushl $102 8010671f: 6a 66 push $0x66 jmp alltraps 80106721: e9 91 f7 ff ff jmp 80105eb7 <alltraps> 80106726 <vector103>: .globl vector103 vector103: pushl $0 80106726: 6a 00 push $0x0 pushl $103 80106728: 6a 67 push $0x67 jmp alltraps 8010672a: e9 88 f7 ff ff jmp 80105eb7 <alltraps> 8010672f <vector104>: .globl vector104 vector104: pushl $0 8010672f: 6a 00 push $0x0 pushl $104 80106731: 6a 68 push $0x68 jmp alltraps 80106733: e9 7f f7 ff ff jmp 80105eb7 <alltraps> 80106738 <vector105>: .globl vector105 vector105: pushl $0 80106738: 6a 00 push $0x0 pushl $105 8010673a: 6a 69 push $0x69 jmp alltraps 8010673c: e9 76 f7 ff ff jmp 80105eb7 <alltraps> 80106741 <vector106>: .globl vector106 vector106: pushl $0 80106741: 6a 00 push $0x0 pushl $106 80106743: 6a 6a push $0x6a jmp alltraps 80106745: e9 6d f7 ff ff jmp 80105eb7 <alltraps> 8010674a <vector107>: .globl vector107 vector107: pushl $0 8010674a: 6a 00 push $0x0 pushl $107 8010674c: 6a 6b push $0x6b jmp alltraps 8010674e: e9 64 f7 ff ff jmp 80105eb7 <alltraps> 80106753 <vector108>: .globl vector108 vector108: pushl $0 80106753: 6a 00 push $0x0 pushl $108 80106755: 6a 6c push $0x6c jmp alltraps 80106757: e9 5b f7 ff ff jmp 80105eb7 <alltraps> 8010675c <vector109>: .globl vector109 vector109: pushl $0 8010675c: 6a 00 push $0x0 pushl $109 8010675e: 6a 6d push $0x6d jmp alltraps 80106760: e9 52 f7 ff ff jmp 80105eb7 <alltraps> 80106765 <vector110>: .globl vector110 vector110: pushl $0 80106765: 6a 00 push $0x0 pushl $110 80106767: 6a 6e push $0x6e jmp alltraps 80106769: e9 49 f7 ff ff jmp 80105eb7 <alltraps> 8010676e <vector111>: .globl vector111 vector111: pushl $0 8010676e: 6a 00 push $0x0 pushl $111 80106770: 6a 6f push $0x6f jmp alltraps 80106772: e9 40 f7 ff ff jmp 80105eb7 <alltraps> 80106777 <vector112>: .globl vector112 vector112: pushl $0 80106777: 6a 00 push $0x0 pushl $112 80106779: 6a 70 push $0x70 jmp alltraps 8010677b: e9 37 f7 ff ff jmp 80105eb7 <alltraps> 80106780 <vector113>: .globl vector113 vector113: pushl $0 80106780: 6a 00 push $0x0 pushl $113 80106782: 6a 71 push $0x71 jmp alltraps 80106784: e9 2e f7 ff ff jmp 80105eb7 <alltraps> 80106789 <vector114>: .globl vector114 vector114: pushl $0 80106789: 6a 00 push $0x0 pushl $114 8010678b: 6a 72 push $0x72 jmp alltraps 8010678d: e9 25 f7 ff ff jmp 80105eb7 <alltraps> 80106792 <vector115>: .globl vector115 vector115: pushl $0 80106792: 6a 00 push $0x0 pushl $115 80106794: 6a 73 push $0x73 jmp alltraps 80106796: e9 1c f7 ff ff jmp 80105eb7 <alltraps> 8010679b <vector116>: .globl vector116 vector116: pushl $0 8010679b: 6a 00 push $0x0 pushl $116 8010679d: 6a 74 push $0x74 jmp alltraps 8010679f: e9 13 f7 ff ff jmp 80105eb7 <alltraps> 801067a4 <vector117>: .globl vector117 vector117: pushl $0 801067a4: 6a 00 push $0x0 pushl $117 801067a6: 6a 75 push $0x75 jmp alltraps 801067a8: e9 0a f7 ff ff jmp 80105eb7 <alltraps> 801067ad <vector118>: .globl vector118 vector118: pushl $0 801067ad: 6a 00 push $0x0 pushl $118 801067af: 6a 76 push $0x76 jmp alltraps 801067b1: e9 01 f7 ff ff jmp 80105eb7 <alltraps> 801067b6 <vector119>: .globl vector119 vector119: pushl $0 801067b6: 6a 00 push $0x0 pushl $119 801067b8: 6a 77 push $0x77 jmp alltraps 801067ba: e9 f8 f6 ff ff jmp 80105eb7 <alltraps> 801067bf <vector120>: .globl vector120 vector120: pushl $0 801067bf: 6a 00 push $0x0 pushl $120 801067c1: 6a 78 push $0x78 jmp alltraps 801067c3: e9 ef f6 ff ff jmp 80105eb7 <alltraps> 801067c8 <vector121>: .globl vector121 vector121: pushl $0 801067c8: 6a 00 push $0x0 pushl $121 801067ca: 6a 79 push $0x79 jmp alltraps 801067cc: e9 e6 f6 ff ff jmp 80105eb7 <alltraps> 801067d1 <vector122>: .globl vector122 vector122: pushl $0 801067d1: 6a 00 push $0x0 pushl $122 801067d3: 6a 7a push $0x7a jmp alltraps 801067d5: e9 dd f6 ff ff jmp 80105eb7 <alltraps> 801067da <vector123>: .globl vector123 vector123: pushl $0 801067da: 6a 00 push $0x0 pushl $123 801067dc: 6a 7b push $0x7b jmp alltraps 801067de: e9 d4 f6 ff ff jmp 80105eb7 <alltraps> 801067e3 <vector124>: .globl vector124 vector124: pushl $0 801067e3: 6a 00 push $0x0 pushl $124 801067e5: 6a 7c push $0x7c jmp alltraps 801067e7: e9 cb f6 ff ff jmp 80105eb7 <alltraps> 801067ec <vector125>: .globl vector125 vector125: pushl $0 801067ec: 6a 00 push $0x0 pushl $125 801067ee: 6a 7d push $0x7d jmp alltraps 801067f0: e9 c2 f6 ff ff jmp 80105eb7 <alltraps> 801067f5 <vector126>: .globl vector126 vector126: pushl $0 801067f5: 6a 00 push $0x0 pushl $126 801067f7: 6a 7e push $0x7e jmp alltraps 801067f9: e9 b9 f6 ff ff jmp 80105eb7 <alltraps> 801067fe <vector127>: .globl vector127 vector127: pushl $0 801067fe: 6a 00 push $0x0 pushl $127 80106800: 6a 7f push $0x7f jmp alltraps 80106802: e9 b0 f6 ff ff jmp 80105eb7 <alltraps> 80106807 <vector128>: .globl vector128 vector128: pushl $0 80106807: 6a 00 push $0x0 pushl $128 80106809: 68 80 00 00 00 push $0x80 jmp alltraps 8010680e: e9 a4 f6 ff ff jmp 80105eb7 <alltraps> 80106813 <vector129>: .globl vector129 vector129: pushl $0 80106813: 6a 00 push $0x0 pushl $129 80106815: 68 81 00 00 00 push $0x81 jmp alltraps 8010681a: e9 98 f6 ff ff jmp 80105eb7 <alltraps> 8010681f <vector130>: .globl vector130 vector130: pushl $0 8010681f: 6a 00 push $0x0 pushl $130 80106821: 68 82 00 00 00 push $0x82 jmp alltraps 80106826: e9 8c f6 ff ff jmp 80105eb7 <alltraps> 8010682b <vector131>: .globl vector131 vector131: pushl $0 8010682b: 6a 00 push $0x0 pushl $131 8010682d: 68 83 00 00 00 push $0x83 jmp alltraps 80106832: e9 80 f6 ff ff jmp 80105eb7 <alltraps> 80106837 <vector132>: .globl vector132 vector132: pushl $0 80106837: 6a 00 push $0x0 pushl $132 80106839: 68 84 00 00 00 push $0x84 jmp alltraps 8010683e: e9 74 f6 ff ff jmp 80105eb7 <alltraps> 80106843 <vector133>: .globl vector133 vector133: pushl $0 80106843: 6a 00 push $0x0 pushl $133 80106845: 68 85 00 00 00 push $0x85 jmp alltraps 8010684a: e9 68 f6 ff ff jmp 80105eb7 <alltraps> 8010684f <vector134>: .globl vector134 vector134: pushl $0 8010684f: 6a 00 push $0x0 pushl $134 80106851: 68 86 00 00 00 push $0x86 jmp alltraps 80106856: e9 5c f6 ff ff jmp 80105eb7 <alltraps> 8010685b <vector135>: .globl vector135 vector135: pushl $0 8010685b: 6a 00 push $0x0 pushl $135 8010685d: 68 87 00 00 00 push $0x87 jmp alltraps 80106862: e9 50 f6 ff ff jmp 80105eb7 <alltraps> 80106867 <vector136>: .globl vector136 vector136: pushl $0 80106867: 6a 00 push $0x0 pushl $136 80106869: 68 88 00 00 00 push $0x88 jmp alltraps 8010686e: e9 44 f6 ff ff jmp 80105eb7 <alltraps> 80106873 <vector137>: .globl vector137 vector137: pushl $0 80106873: 6a 00 push $0x0 pushl $137 80106875: 68 89 00 00 00 push $0x89 jmp alltraps 8010687a: e9 38 f6 ff ff jmp 80105eb7 <alltraps> 8010687f <vector138>: .globl vector138 vector138: pushl $0 8010687f: 6a 00 push $0x0 pushl $138 80106881: 68 8a 00 00 00 push $0x8a jmp alltraps 80106886: e9 2c f6 ff ff jmp 80105eb7 <alltraps> 8010688b <vector139>: .globl vector139 vector139: pushl $0 8010688b: 6a 00 push $0x0 pushl $139 8010688d: 68 8b 00 00 00 push $0x8b jmp alltraps 80106892: e9 20 f6 ff ff jmp 80105eb7 <alltraps> 80106897 <vector140>: .globl vector140 vector140: pushl $0 80106897: 6a 00 push $0x0 pushl $140 80106899: 68 8c 00 00 00 push $0x8c jmp alltraps 8010689e: e9 14 f6 ff ff jmp 80105eb7 <alltraps> 801068a3 <vector141>: .globl vector141 vector141: pushl $0 801068a3: 6a 00 push $0x0 pushl $141 801068a5: 68 8d 00 00 00 push $0x8d jmp alltraps 801068aa: e9 08 f6 ff ff jmp 80105eb7 <alltraps> 801068af <vector142>: .globl vector142 vector142: pushl $0 801068af: 6a 00 push $0x0 pushl $142 801068b1: 68 8e 00 00 00 push $0x8e jmp alltraps 801068b6: e9 fc f5 ff ff jmp 80105eb7 <alltraps> 801068bb <vector143>: .globl vector143 vector143: pushl $0 801068bb: 6a 00 push $0x0 pushl $143 801068bd: 68 8f 00 00 00 push $0x8f jmp alltraps 801068c2: e9 f0 f5 ff ff jmp 80105eb7 <alltraps> 801068c7 <vector144>: .globl vector144 vector144: pushl $0 801068c7: 6a 00 push $0x0 pushl $144 801068c9: 68 90 00 00 00 push $0x90 jmp alltraps 801068ce: e9 e4 f5 ff ff jmp 80105eb7 <alltraps> 801068d3 <vector145>: .globl vector145 vector145: pushl $0 801068d3: 6a 00 push $0x0 pushl $145 801068d5: 68 91 00 00 00 push $0x91 jmp alltraps 801068da: e9 d8 f5 ff ff jmp 80105eb7 <alltraps> 801068df <vector146>: .globl vector146 vector146: pushl $0 801068df: 6a 00 push $0x0 pushl $146 801068e1: 68 92 00 00 00 push $0x92 jmp alltraps 801068e6: e9 cc f5 ff ff jmp 80105eb7 <alltraps> 801068eb <vector147>: .globl vector147 vector147: pushl $0 801068eb: 6a 00 push $0x0 pushl $147 801068ed: 68 93 00 00 00 push $0x93 jmp alltraps 801068f2: e9 c0 f5 ff ff jmp 80105eb7 <alltraps> 801068f7 <vector148>: .globl vector148 vector148: pushl $0 801068f7: 6a 00 push $0x0 pushl $148 801068f9: 68 94 00 00 00 push $0x94 jmp alltraps 801068fe: e9 b4 f5 ff ff jmp 80105eb7 <alltraps> 80106903 <vector149>: .globl vector149 vector149: pushl $0 80106903: 6a 00 push $0x0 pushl $149 80106905: 68 95 00 00 00 push $0x95 jmp alltraps 8010690a: e9 a8 f5 ff ff jmp 80105eb7 <alltraps> 8010690f <vector150>: .globl vector150 vector150: pushl $0 8010690f: 6a 00 push $0x0 pushl $150 80106911: 68 96 00 00 00 push $0x96 jmp alltraps 80106916: e9 9c f5 ff ff jmp 80105eb7 <alltraps> 8010691b <vector151>: .globl vector151 vector151: pushl $0 8010691b: 6a 00 push $0x0 pushl $151 8010691d: 68 97 00 00 00 push $0x97 jmp alltraps 80106922: e9 90 f5 ff ff jmp 80105eb7 <alltraps> 80106927 <vector152>: .globl vector152 vector152: pushl $0 80106927: 6a 00 push $0x0 pushl $152 80106929: 68 98 00 00 00 push $0x98 jmp alltraps 8010692e: e9 84 f5 ff ff jmp 80105eb7 <alltraps> 80106933 <vector153>: .globl vector153 vector153: pushl $0 80106933: 6a 00 push $0x0 pushl $153 80106935: 68 99 00 00 00 push $0x99 jmp alltraps 8010693a: e9 78 f5 ff ff jmp 80105eb7 <alltraps> 8010693f <vector154>: .globl vector154 vector154: pushl $0 8010693f: 6a 00 push $0x0 pushl $154 80106941: 68 9a 00 00 00 push $0x9a jmp alltraps 80106946: e9 6c f5 ff ff jmp 80105eb7 <alltraps> 8010694b <vector155>: .globl vector155 vector155: pushl $0 8010694b: 6a 00 push $0x0 pushl $155 8010694d: 68 9b 00 00 00 push $0x9b jmp alltraps 80106952: e9 60 f5 ff ff jmp 80105eb7 <alltraps> 80106957 <vector156>: .globl vector156 vector156: pushl $0 80106957: 6a 00 push $0x0 pushl $156 80106959: 68 9c 00 00 00 push $0x9c jmp alltraps 8010695e: e9 54 f5 ff ff jmp 80105eb7 <alltraps> 80106963 <vector157>: .globl vector157 vector157: pushl $0 80106963: 6a 00 push $0x0 pushl $157 80106965: 68 9d 00 00 00 push $0x9d jmp alltraps 8010696a: e9 48 f5 ff ff jmp 80105eb7 <alltraps> 8010696f <vector158>: .globl vector158 vector158: pushl $0 8010696f: 6a 00 push $0x0 pushl $158 80106971: 68 9e 00 00 00 push $0x9e jmp alltraps 80106976: e9 3c f5 ff ff jmp 80105eb7 <alltraps> 8010697b <vector159>: .globl vector159 vector159: pushl $0 8010697b: 6a 00 push $0x0 pushl $159 8010697d: 68 9f 00 00 00 push $0x9f jmp alltraps 80106982: e9 30 f5 ff ff jmp 80105eb7 <alltraps> 80106987 <vector160>: .globl vector160 vector160: pushl $0 80106987: 6a 00 push $0x0 pushl $160 80106989: 68 a0 00 00 00 push $0xa0 jmp alltraps 8010698e: e9 24 f5 ff ff jmp 80105eb7 <alltraps> 80106993 <vector161>: .globl vector161 vector161: pushl $0 80106993: 6a 00 push $0x0 pushl $161 80106995: 68 a1 00 00 00 push $0xa1 jmp alltraps 8010699a: e9 18 f5 ff ff jmp 80105eb7 <alltraps> 8010699f <vector162>: .globl vector162 vector162: pushl $0 8010699f: 6a 00 push $0x0 pushl $162 801069a1: 68 a2 00 00 00 push $0xa2 jmp alltraps 801069a6: e9 0c f5 ff ff jmp 80105eb7 <alltraps> 801069ab <vector163>: .globl vector163 vector163: pushl $0 801069ab: 6a 00 push $0x0 pushl $163 801069ad: 68 a3 00 00 00 push $0xa3 jmp alltraps 801069b2: e9 00 f5 ff ff jmp 80105eb7 <alltraps> 801069b7 <vector164>: .globl vector164 vector164: pushl $0 801069b7: 6a 00 push $0x0 pushl $164 801069b9: 68 a4 00 00 00 push $0xa4 jmp alltraps 801069be: e9 f4 f4 ff ff jmp 80105eb7 <alltraps> 801069c3 <vector165>: .globl vector165 vector165: pushl $0 801069c3: 6a 00 push $0x0 pushl $165 801069c5: 68 a5 00 00 00 push $0xa5 jmp alltraps 801069ca: e9 e8 f4 ff ff jmp 80105eb7 <alltraps> 801069cf <vector166>: .globl vector166 vector166: pushl $0 801069cf: 6a 00 push $0x0 pushl $166 801069d1: 68 a6 00 00 00 push $0xa6 jmp alltraps 801069d6: e9 dc f4 ff ff jmp 80105eb7 <alltraps> 801069db <vector167>: .globl vector167 vector167: pushl $0 801069db: 6a 00 push $0x0 pushl $167 801069dd: 68 a7 00 00 00 push $0xa7 jmp alltraps 801069e2: e9 d0 f4 ff ff jmp 80105eb7 <alltraps> 801069e7 <vector168>: .globl vector168 vector168: pushl $0 801069e7: 6a 00 push $0x0 pushl $168 801069e9: 68 a8 00 00 00 push $0xa8 jmp alltraps 801069ee: e9 c4 f4 ff ff jmp 80105eb7 <alltraps> 801069f3 <vector169>: .globl vector169 vector169: pushl $0 801069f3: 6a 00 push $0x0 pushl $169 801069f5: 68 a9 00 00 00 push $0xa9 jmp alltraps 801069fa: e9 b8 f4 ff ff jmp 80105eb7 <alltraps> 801069ff <vector170>: .globl vector170 vector170: pushl $0 801069ff: 6a 00 push $0x0 pushl $170 80106a01: 68 aa 00 00 00 push $0xaa jmp alltraps 80106a06: e9 ac f4 ff ff jmp 80105eb7 <alltraps> 80106a0b <vector171>: .globl vector171 vector171: pushl $0 80106a0b: 6a 00 push $0x0 pushl $171 80106a0d: 68 ab 00 00 00 push $0xab jmp alltraps 80106a12: e9 a0 f4 ff ff jmp 80105eb7 <alltraps> 80106a17 <vector172>: .globl vector172 vector172: pushl $0 80106a17: 6a 00 push $0x0 pushl $172 80106a19: 68 ac 00 00 00 push $0xac jmp alltraps 80106a1e: e9 94 f4 ff ff jmp 80105eb7 <alltraps> 80106a23 <vector173>: .globl vector173 vector173: pushl $0 80106a23: 6a 00 push $0x0 pushl $173 80106a25: 68 ad 00 00 00 push $0xad jmp alltraps 80106a2a: e9 88 f4 ff ff jmp 80105eb7 <alltraps> 80106a2f <vector174>: .globl vector174 vector174: pushl $0 80106a2f: 6a 00 push $0x0 pushl $174 80106a31: 68 ae 00 00 00 push $0xae jmp alltraps 80106a36: e9 7c f4 ff ff jmp 80105eb7 <alltraps> 80106a3b <vector175>: .globl vector175 vector175: pushl $0 80106a3b: 6a 00 push $0x0 pushl $175 80106a3d: 68 af 00 00 00 push $0xaf jmp alltraps 80106a42: e9 70 f4 ff ff jmp 80105eb7 <alltraps> 80106a47 <vector176>: .globl vector176 vector176: pushl $0 80106a47: 6a 00 push $0x0 pushl $176 80106a49: 68 b0 00 00 00 push $0xb0 jmp alltraps 80106a4e: e9 64 f4 ff ff jmp 80105eb7 <alltraps> 80106a53 <vector177>: .globl vector177 vector177: pushl $0 80106a53: 6a 00 push $0x0 pushl $177 80106a55: 68 b1 00 00 00 push $0xb1 jmp alltraps 80106a5a: e9 58 f4 ff ff jmp 80105eb7 <alltraps> 80106a5f <vector178>: .globl vector178 vector178: pushl $0 80106a5f: 6a 00 push $0x0 pushl $178 80106a61: 68 b2 00 00 00 push $0xb2 jmp alltraps 80106a66: e9 4c f4 ff ff jmp 80105eb7 <alltraps> 80106a6b <vector179>: .globl vector179 vector179: pushl $0 80106a6b: 6a 00 push $0x0 pushl $179 80106a6d: 68 b3 00 00 00 push $0xb3 jmp alltraps 80106a72: e9 40 f4 ff ff jmp 80105eb7 <alltraps> 80106a77 <vector180>: .globl vector180 vector180: pushl $0 80106a77: 6a 00 push $0x0 pushl $180 80106a79: 68 b4 00 00 00 push $0xb4 jmp alltraps 80106a7e: e9 34 f4 ff ff jmp 80105eb7 <alltraps> 80106a83 <vector181>: .globl vector181 vector181: pushl $0 80106a83: 6a 00 push $0x0 pushl $181 80106a85: 68 b5 00 00 00 push $0xb5 jmp alltraps 80106a8a: e9 28 f4 ff ff jmp 80105eb7 <alltraps> 80106a8f <vector182>: .globl vector182 vector182: pushl $0 80106a8f: 6a 00 push $0x0 pushl $182 80106a91: 68 b6 00 00 00 push $0xb6 jmp alltraps 80106a96: e9 1c f4 ff ff jmp 80105eb7 <alltraps> 80106a9b <vector183>: .globl vector183 vector183: pushl $0 80106a9b: 6a 00 push $0x0 pushl $183 80106a9d: 68 b7 00 00 00 push $0xb7 jmp alltraps 80106aa2: e9 10 f4 ff ff jmp 80105eb7 <alltraps> 80106aa7 <vector184>: .globl vector184 vector184: pushl $0 80106aa7: 6a 00 push $0x0 pushl $184 80106aa9: 68 b8 00 00 00 push $0xb8 jmp alltraps 80106aae: e9 04 f4 ff ff jmp 80105eb7 <alltraps> 80106ab3 <vector185>: .globl vector185 vector185: pushl $0 80106ab3: 6a 00 push $0x0 pushl $185 80106ab5: 68 b9 00 00 00 push $0xb9 jmp alltraps 80106aba: e9 f8 f3 ff ff jmp 80105eb7 <alltraps> 80106abf <vector186>: .globl vector186 vector186: pushl $0 80106abf: 6a 00 push $0x0 pushl $186 80106ac1: 68 ba 00 00 00 push $0xba jmp alltraps 80106ac6: e9 ec f3 ff ff jmp 80105eb7 <alltraps> 80106acb <vector187>: .globl vector187 vector187: pushl $0 80106acb: 6a 00 push $0x0 pushl $187 80106acd: 68 bb 00 00 00 push $0xbb jmp alltraps 80106ad2: e9 e0 f3 ff ff jmp 80105eb7 <alltraps> 80106ad7 <vector188>: .globl vector188 vector188: pushl $0 80106ad7: 6a 00 push $0x0 pushl $188 80106ad9: 68 bc 00 00 00 push $0xbc jmp alltraps 80106ade: e9 d4 f3 ff ff jmp 80105eb7 <alltraps> 80106ae3 <vector189>: .globl vector189 vector189: pushl $0 80106ae3: 6a 00 push $0x0 pushl $189 80106ae5: 68 bd 00 00 00 push $0xbd jmp alltraps 80106aea: e9 c8 f3 ff ff jmp 80105eb7 <alltraps> 80106aef <vector190>: .globl vector190 vector190: pushl $0 80106aef: 6a 00 push $0x0 pushl $190 80106af1: 68 be 00 00 00 push $0xbe jmp alltraps 80106af6: e9 bc f3 ff ff jmp 80105eb7 <alltraps> 80106afb <vector191>: .globl vector191 vector191: pushl $0 80106afb: 6a 00 push $0x0 pushl $191 80106afd: 68 bf 00 00 00 push $0xbf jmp alltraps 80106b02: e9 b0 f3 ff ff jmp 80105eb7 <alltraps> 80106b07 <vector192>: .globl vector192 vector192: pushl $0 80106b07: 6a 00 push $0x0 pushl $192 80106b09: 68 c0 00 00 00 push $0xc0 jmp alltraps 80106b0e: e9 a4 f3 ff ff jmp 80105eb7 <alltraps> 80106b13 <vector193>: .globl vector193 vector193: pushl $0 80106b13: 6a 00 push $0x0 pushl $193 80106b15: 68 c1 00 00 00 push $0xc1 jmp alltraps 80106b1a: e9 98 f3 ff ff jmp 80105eb7 <alltraps> 80106b1f <vector194>: .globl vector194 vector194: pushl $0 80106b1f: 6a 00 push $0x0 pushl $194 80106b21: 68 c2 00 00 00 push $0xc2 jmp alltraps 80106b26: e9 8c f3 ff ff jmp 80105eb7 <alltraps> 80106b2b <vector195>: .globl vector195 vector195: pushl $0 80106b2b: 6a 00 push $0x0 pushl $195 80106b2d: 68 c3 00 00 00 push $0xc3 jmp alltraps 80106b32: e9 80 f3 ff ff jmp 80105eb7 <alltraps> 80106b37 <vector196>: .globl vector196 vector196: pushl $0 80106b37: 6a 00 push $0x0 pushl $196 80106b39: 68 c4 00 00 00 push $0xc4 jmp alltraps 80106b3e: e9 74 f3 ff ff jmp 80105eb7 <alltraps> 80106b43 <vector197>: .globl vector197 vector197: pushl $0 80106b43: 6a 00 push $0x0 pushl $197 80106b45: 68 c5 00 00 00 push $0xc5 jmp alltraps 80106b4a: e9 68 f3 ff ff jmp 80105eb7 <alltraps> 80106b4f <vector198>: .globl vector198 vector198: pushl $0 80106b4f: 6a 00 push $0x0 pushl $198 80106b51: 68 c6 00 00 00 push $0xc6 jmp alltraps 80106b56: e9 5c f3 ff ff jmp 80105eb7 <alltraps> 80106b5b <vector199>: .globl vector199 vector199: pushl $0 80106b5b: 6a 00 push $0x0 pushl $199 80106b5d: 68 c7 00 00 00 push $0xc7 jmp alltraps 80106b62: e9 50 f3 ff ff jmp 80105eb7 <alltraps> 80106b67 <vector200>: .globl vector200 vector200: pushl $0 80106b67: 6a 00 push $0x0 pushl $200 80106b69: 68 c8 00 00 00 push $0xc8 jmp alltraps 80106b6e: e9 44 f3 ff ff jmp 80105eb7 <alltraps> 80106b73 <vector201>: .globl vector201 vector201: pushl $0 80106b73: 6a 00 push $0x0 pushl $201 80106b75: 68 c9 00 00 00 push $0xc9 jmp alltraps 80106b7a: e9 38 f3 ff ff jmp 80105eb7 <alltraps> 80106b7f <vector202>: .globl vector202 vector202: pushl $0 80106b7f: 6a 00 push $0x0 pushl $202 80106b81: 68 ca 00 00 00 push $0xca jmp alltraps 80106b86: e9 2c f3 ff ff jmp 80105eb7 <alltraps> 80106b8b <vector203>: .globl vector203 vector203: pushl $0 80106b8b: 6a 00 push $0x0 pushl $203 80106b8d: 68 cb 00 00 00 push $0xcb jmp alltraps 80106b92: e9 20 f3 ff ff jmp 80105eb7 <alltraps> 80106b97 <vector204>: .globl vector204 vector204: pushl $0 80106b97: 6a 00 push $0x0 pushl $204 80106b99: 68 cc 00 00 00 push $0xcc jmp alltraps 80106b9e: e9 14 f3 ff ff jmp 80105eb7 <alltraps> 80106ba3 <vector205>: .globl vector205 vector205: pushl $0 80106ba3: 6a 00 push $0x0 pushl $205 80106ba5: 68 cd 00 00 00 push $0xcd jmp alltraps 80106baa: e9 08 f3 ff ff jmp 80105eb7 <alltraps> 80106baf <vector206>: .globl vector206 vector206: pushl $0 80106baf: 6a 00 push $0x0 pushl $206 80106bb1: 68 ce 00 00 00 push $0xce jmp alltraps 80106bb6: e9 fc f2 ff ff jmp 80105eb7 <alltraps> 80106bbb <vector207>: .globl vector207 vector207: pushl $0 80106bbb: 6a 00 push $0x0 pushl $207 80106bbd: 68 cf 00 00 00 push $0xcf jmp alltraps 80106bc2: e9 f0 f2 ff ff jmp 80105eb7 <alltraps> 80106bc7 <vector208>: .globl vector208 vector208: pushl $0 80106bc7: 6a 00 push $0x0 pushl $208 80106bc9: 68 d0 00 00 00 push $0xd0 jmp alltraps 80106bce: e9 e4 f2 ff ff jmp 80105eb7 <alltraps> 80106bd3 <vector209>: .globl vector209 vector209: pushl $0 80106bd3: 6a 00 push $0x0 pushl $209 80106bd5: 68 d1 00 00 00 push $0xd1 jmp alltraps 80106bda: e9 d8 f2 ff ff jmp 80105eb7 <alltraps> 80106bdf <vector210>: .globl vector210 vector210: pushl $0 80106bdf: 6a 00 push $0x0 pushl $210 80106be1: 68 d2 00 00 00 push $0xd2 jmp alltraps 80106be6: e9 cc f2 ff ff jmp 80105eb7 <alltraps> 80106beb <vector211>: .globl vector211 vector211: pushl $0 80106beb: 6a 00 push $0x0 pushl $211 80106bed: 68 d3 00 00 00 push $0xd3 jmp alltraps 80106bf2: e9 c0 f2 ff ff jmp 80105eb7 <alltraps> 80106bf7 <vector212>: .globl vector212 vector212: pushl $0 80106bf7: 6a 00 push $0x0 pushl $212 80106bf9: 68 d4 00 00 00 push $0xd4 jmp alltraps 80106bfe: e9 b4 f2 ff ff jmp 80105eb7 <alltraps> 80106c03 <vector213>: .globl vector213 vector213: pushl $0 80106c03: 6a 00 push $0x0 pushl $213 80106c05: 68 d5 00 00 00 push $0xd5 jmp alltraps 80106c0a: e9 a8 f2 ff ff jmp 80105eb7 <alltraps> 80106c0f <vector214>: .globl vector214 vector214: pushl $0 80106c0f: 6a 00 push $0x0 pushl $214 80106c11: 68 d6 00 00 00 push $0xd6 jmp alltraps 80106c16: e9 9c f2 ff ff jmp 80105eb7 <alltraps> 80106c1b <vector215>: .globl vector215 vector215: pushl $0 80106c1b: 6a 00 push $0x0 pushl $215 80106c1d: 68 d7 00 00 00 push $0xd7 jmp alltraps 80106c22: e9 90 f2 ff ff jmp 80105eb7 <alltraps> 80106c27 <vector216>: .globl vector216 vector216: pushl $0 80106c27: 6a 00 push $0x0 pushl $216 80106c29: 68 d8 00 00 00 push $0xd8 jmp alltraps 80106c2e: e9 84 f2 ff ff jmp 80105eb7 <alltraps> 80106c33 <vector217>: .globl vector217 vector217: pushl $0 80106c33: 6a 00 push $0x0 pushl $217 80106c35: 68 d9 00 00 00 push $0xd9 jmp alltraps 80106c3a: e9 78 f2 ff ff jmp 80105eb7 <alltraps> 80106c3f <vector218>: .globl vector218 vector218: pushl $0 80106c3f: 6a 00 push $0x0 pushl $218 80106c41: 68 da 00 00 00 push $0xda jmp alltraps 80106c46: e9 6c f2 ff ff jmp 80105eb7 <alltraps> 80106c4b <vector219>: .globl vector219 vector219: pushl $0 80106c4b: 6a 00 push $0x0 pushl $219 80106c4d: 68 db 00 00 00 push $0xdb jmp alltraps 80106c52: e9 60 f2 ff ff jmp 80105eb7 <alltraps> 80106c57 <vector220>: .globl vector220 vector220: pushl $0 80106c57: 6a 00 push $0x0 pushl $220 80106c59: 68 dc 00 00 00 push $0xdc jmp alltraps 80106c5e: e9 54 f2 ff ff jmp 80105eb7 <alltraps> 80106c63 <vector221>: .globl vector221 vector221: pushl $0 80106c63: 6a 00 push $0x0 pushl $221 80106c65: 68 dd 00 00 00 push $0xdd jmp alltraps 80106c6a: e9 48 f2 ff ff jmp 80105eb7 <alltraps> 80106c6f <vector222>: .globl vector222 vector222: pushl $0 80106c6f: 6a 00 push $0x0 pushl $222 80106c71: 68 de 00 00 00 push $0xde jmp alltraps 80106c76: e9 3c f2 ff ff jmp 80105eb7 <alltraps> 80106c7b <vector223>: .globl vector223 vector223: pushl $0 80106c7b: 6a 00 push $0x0 pushl $223 80106c7d: 68 df 00 00 00 push $0xdf jmp alltraps 80106c82: e9 30 f2 ff ff jmp 80105eb7 <alltraps> 80106c87 <vector224>: .globl vector224 vector224: pushl $0 80106c87: 6a 00 push $0x0 pushl $224 80106c89: 68 e0 00 00 00 push $0xe0 jmp alltraps 80106c8e: e9 24 f2 ff ff jmp 80105eb7 <alltraps> 80106c93 <vector225>: .globl vector225 vector225: pushl $0 80106c93: 6a 00 push $0x0 pushl $225 80106c95: 68 e1 00 00 00 push $0xe1 jmp alltraps 80106c9a: e9 18 f2 ff ff jmp 80105eb7 <alltraps> 80106c9f <vector226>: .globl vector226 vector226: pushl $0 80106c9f: 6a 00 push $0x0 pushl $226 80106ca1: 68 e2 00 00 00 push $0xe2 jmp alltraps 80106ca6: e9 0c f2 ff ff jmp 80105eb7 <alltraps> 80106cab <vector227>: .globl vector227 vector227: pushl $0 80106cab: 6a 00 push $0x0 pushl $227 80106cad: 68 e3 00 00 00 push $0xe3 jmp alltraps 80106cb2: e9 00 f2 ff ff jmp 80105eb7 <alltraps> 80106cb7 <vector228>: .globl vector228 vector228: pushl $0 80106cb7: 6a 00 push $0x0 pushl $228 80106cb9: 68 e4 00 00 00 push $0xe4 jmp alltraps 80106cbe: e9 f4 f1 ff ff jmp 80105eb7 <alltraps> 80106cc3 <vector229>: .globl vector229 vector229: pushl $0 80106cc3: 6a 00 push $0x0 pushl $229 80106cc5: 68 e5 00 00 00 push $0xe5 jmp alltraps 80106cca: e9 e8 f1 ff ff jmp 80105eb7 <alltraps> 80106ccf <vector230>: .globl vector230 vector230: pushl $0 80106ccf: 6a 00 push $0x0 pushl $230 80106cd1: 68 e6 00 00 00 push $0xe6 jmp alltraps 80106cd6: e9 dc f1 ff ff jmp 80105eb7 <alltraps> 80106cdb <vector231>: .globl vector231 vector231: pushl $0 80106cdb: 6a 00 push $0x0 pushl $231 80106cdd: 68 e7 00 00 00 push $0xe7 jmp alltraps 80106ce2: e9 d0 f1 ff ff jmp 80105eb7 <alltraps> 80106ce7 <vector232>: .globl vector232 vector232: pushl $0 80106ce7: 6a 00 push $0x0 pushl $232 80106ce9: 68 e8 00 00 00 push $0xe8 jmp alltraps 80106cee: e9 c4 f1 ff ff jmp 80105eb7 <alltraps> 80106cf3 <vector233>: .globl vector233 vector233: pushl $0 80106cf3: 6a 00 push $0x0 pushl $233 80106cf5: 68 e9 00 00 00 push $0xe9 jmp alltraps 80106cfa: e9 b8 f1 ff ff jmp 80105eb7 <alltraps> 80106cff <vector234>: .globl vector234 vector234: pushl $0 80106cff: 6a 00 push $0x0 pushl $234 80106d01: 68 ea 00 00 00 push $0xea jmp alltraps 80106d06: e9 ac f1 ff ff jmp 80105eb7 <alltraps> 80106d0b <vector235>: .globl vector235 vector235: pushl $0 80106d0b: 6a 00 push $0x0 pushl $235 80106d0d: 68 eb 00 00 00 push $0xeb jmp alltraps 80106d12: e9 a0 f1 ff ff jmp 80105eb7 <alltraps> 80106d17 <vector236>: .globl vector236 vector236: pushl $0 80106d17: 6a 00 push $0x0 pushl $236 80106d19: 68 ec 00 00 00 push $0xec jmp alltraps 80106d1e: e9 94 f1 ff ff jmp 80105eb7 <alltraps> 80106d23 <vector237>: .globl vector237 vector237: pushl $0 80106d23: 6a 00 push $0x0 pushl $237 80106d25: 68 ed 00 00 00 push $0xed jmp alltraps 80106d2a: e9 88 f1 ff ff jmp 80105eb7 <alltraps> 80106d2f <vector238>: .globl vector238 vector238: pushl $0 80106d2f: 6a 00 push $0x0 pushl $238 80106d31: 68 ee 00 00 00 push $0xee jmp alltraps 80106d36: e9 7c f1 ff ff jmp 80105eb7 <alltraps> 80106d3b <vector239>: .globl vector239 vector239: pushl $0 80106d3b: 6a 00 push $0x0 pushl $239 80106d3d: 68 ef 00 00 00 push $0xef jmp alltraps 80106d42: e9 70 f1 ff ff jmp 80105eb7 <alltraps> 80106d47 <vector240>: .globl vector240 vector240: pushl $0 80106d47: 6a 00 push $0x0 pushl $240 80106d49: 68 f0 00 00 00 push $0xf0 jmp alltraps 80106d4e: e9 64 f1 ff ff jmp 80105eb7 <alltraps> 80106d53 <vector241>: .globl vector241 vector241: pushl $0 80106d53: 6a 00 push $0x0 pushl $241 80106d55: 68 f1 00 00 00 push $0xf1 jmp alltraps 80106d5a: e9 58 f1 ff ff jmp 80105eb7 <alltraps> 80106d5f <vector242>: .globl vector242 vector242: pushl $0 80106d5f: 6a 00 push $0x0 pushl $242 80106d61: 68 f2 00 00 00 push $0xf2 jmp alltraps 80106d66: e9 4c f1 ff ff jmp 80105eb7 <alltraps> 80106d6b <vector243>: .globl vector243 vector243: pushl $0 80106d6b: 6a 00 push $0x0 pushl $243 80106d6d: 68 f3 00 00 00 push $0xf3 jmp alltraps 80106d72: e9 40 f1 ff ff jmp 80105eb7 <alltraps> 80106d77 <vector244>: .globl vector244 vector244: pushl $0 80106d77: 6a 00 push $0x0 pushl $244 80106d79: 68 f4 00 00 00 push $0xf4 jmp alltraps 80106d7e: e9 34 f1 ff ff jmp 80105eb7 <alltraps> 80106d83 <vector245>: .globl vector245 vector245: pushl $0 80106d83: 6a 00 push $0x0 pushl $245 80106d85: 68 f5 00 00 00 push $0xf5 jmp alltraps 80106d8a: e9 28 f1 ff ff jmp 80105eb7 <alltraps> 80106d8f <vector246>: .globl vector246 vector246: pushl $0 80106d8f: 6a 00 push $0x0 pushl $246 80106d91: 68 f6 00 00 00 push $0xf6 jmp alltraps 80106d96: e9 1c f1 ff ff jmp 80105eb7 <alltraps> 80106d9b <vector247>: .globl vector247 vector247: pushl $0 80106d9b: 6a 00 push $0x0 pushl $247 80106d9d: 68 f7 00 00 00 push $0xf7 jmp alltraps 80106da2: e9 10 f1 ff ff jmp 80105eb7 <alltraps> 80106da7 <vector248>: .globl vector248 vector248: pushl $0 80106da7: 6a 00 push $0x0 pushl $248 80106da9: 68 f8 00 00 00 push $0xf8 jmp alltraps 80106dae: e9 04 f1 ff ff jmp 80105eb7 <alltraps> 80106db3 <vector249>: .globl vector249 vector249: pushl $0 80106db3: 6a 00 push $0x0 pushl $249 80106db5: 68 f9 00 00 00 push $0xf9 jmp alltraps 80106dba: e9 f8 f0 ff ff jmp 80105eb7 <alltraps> 80106dbf <vector250>: .globl vector250 vector250: pushl $0 80106dbf: 6a 00 push $0x0 pushl $250 80106dc1: 68 fa 00 00 00 push $0xfa jmp alltraps 80106dc6: e9 ec f0 ff ff jmp 80105eb7 <alltraps> 80106dcb <vector251>: .globl vector251 vector251: pushl $0 80106dcb: 6a 00 push $0x0 pushl $251 80106dcd: 68 fb 00 00 00 push $0xfb jmp alltraps 80106dd2: e9 e0 f0 ff ff jmp 80105eb7 <alltraps> 80106dd7 <vector252>: .globl vector252 vector252: pushl $0 80106dd7: 6a 00 push $0x0 pushl $252 80106dd9: 68 fc 00 00 00 push $0xfc jmp alltraps 80106dde: e9 d4 f0 ff ff jmp 80105eb7 <alltraps> 80106de3 <vector253>: .globl vector253 vector253: pushl $0 80106de3: 6a 00 push $0x0 pushl $253 80106de5: 68 fd 00 00 00 push $0xfd jmp alltraps 80106dea: e9 c8 f0 ff ff jmp 80105eb7 <alltraps> 80106def <vector254>: .globl vector254 vector254: pushl $0 80106def: 6a 00 push $0x0 pushl $254 80106df1: 68 fe 00 00 00 push $0xfe jmp alltraps 80106df6: e9 bc f0 ff ff jmp 80105eb7 <alltraps> 80106dfb <vector255>: .globl vector255 vector255: pushl $0 80106dfb: 6a 00 push $0x0 pushl $255 80106dfd: 68 ff 00 00 00 push $0xff jmp alltraps 80106e02: e9 b0 f0 ff ff jmp 80105eb7 <alltraps> 80106e07: 66 90 xchg %ax,%ax 80106e09: 66 90 xchg %ax,%ax 80106e0b: 66 90 xchg %ax,%ax 80106e0d: 66 90 xchg %ax,%ax 80106e0f: 90 nop 80106e10 <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) { 80106e10: 55 push %ebp 80106e11: 89 e5 mov %esp,%ebp 80106e13: 57 push %edi 80106e14: 56 push %esi 80106e15: 53 push %ebx pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 80106e16: 89 d3 mov %edx,%ebx { 80106e18: 89 d7 mov %edx,%edi pde = &pgdir[PDX(va)]; 80106e1a: c1 eb 16 shr $0x16,%ebx 80106e1d: 8d 34 98 lea (%eax,%ebx,4),%esi { 80106e20: 83 ec 0c sub $0xc,%esp if(*pde & PTE_P){ 80106e23: 8b 06 mov (%esi),%eax 80106e25: a8 01 test $0x1,%al 80106e27: 74 27 je 80106e50 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 80106e29: 25 00 f0 ff ff and $0xfffff000,%eax 80106e2e: 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)]; 80106e34: c1 ef 0a shr $0xa,%edi } 80106e37: 8d 65 f4 lea -0xc(%ebp),%esp return &pgtab[PTX(va)]; 80106e3a: 89 fa mov %edi,%edx 80106e3c: 81 e2 fc 0f 00 00 and $0xffc,%edx 80106e42: 8d 04 13 lea (%ebx,%edx,1),%eax } 80106e45: 5b pop %ebx 80106e46: 5e pop %esi 80106e47: 5f pop %edi 80106e48: 5d pop %ebp 80106e49: c3 ret 80106e4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 80106e50: 85 c9 test %ecx,%ecx 80106e52: 74 2c je 80106e80 <walkpgdir+0x70> 80106e54: e8 67 b6 ff ff call 801024c0 <kalloc> 80106e59: 85 c0 test %eax,%eax 80106e5b: 89 c3 mov %eax,%ebx 80106e5d: 74 21 je 80106e80 <walkpgdir+0x70> memset(pgtab, 0, PGSIZE); 80106e5f: 83 ec 04 sub $0x4,%esp 80106e62: 68 00 10 00 00 push $0x1000 80106e67: 6a 00 push $0x0 80106e69: 50 push %eax 80106e6a: e8 21 d7 ff ff call 80104590 <memset> *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 80106e6f: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106e75: 83 c4 10 add $0x10,%esp 80106e78: 83 c8 07 or $0x7,%eax 80106e7b: 89 06 mov %eax,(%esi) 80106e7d: eb b5 jmp 80106e34 <walkpgdir+0x24> 80106e7f: 90 nop } 80106e80: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106e83: 31 c0 xor %eax,%eax } 80106e85: 5b pop %ebx 80106e86: 5e pop %esi 80106e87: 5f pop %edi 80106e88: 5d pop %ebp 80106e89: c3 ret 80106e8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106e90 <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) { 80106e90: 55 push %ebp 80106e91: 89 e5 mov %esp,%ebp 80106e93: 57 push %edi 80106e94: 56 push %esi 80106e95: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80106e96: 89 d3 mov %edx,%ebx 80106e98: 81 e3 00 f0 ff ff and $0xfffff000,%ebx { 80106e9e: 83 ec 1c sub $0x1c,%esp 80106ea1: 89 45 e4 mov %eax,-0x1c(%ebp) last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80106ea4: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80106ea8: 8b 7d 08 mov 0x8(%ebp),%edi 80106eab: 25 00 f0 ff ff and $0xfffff000,%eax 80106eb0: 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; 80106eb3: 8b 45 0c mov 0xc(%ebp),%eax 80106eb6: 29 df sub %ebx,%edi 80106eb8: 83 c8 01 or $0x1,%eax 80106ebb: 89 45 dc mov %eax,-0x24(%ebp) 80106ebe: eb 15 jmp 80106ed5 <mappages+0x45> if(*pte & PTE_P) 80106ec0: f6 00 01 testb $0x1,(%eax) 80106ec3: 75 45 jne 80106f0a <mappages+0x7a> *pte = pa | perm | PTE_P; 80106ec5: 0b 75 dc or -0x24(%ebp),%esi if(a == last) 80106ec8: 3b 5d e0 cmp -0x20(%ebp),%ebx *pte = pa | perm | PTE_P; 80106ecb: 89 30 mov %esi,(%eax) if(a == last) 80106ecd: 74 31 je 80106f00 <mappages+0x70> break; a += PGSIZE; 80106ecf: 81 c3 00 10 00 00 add $0x1000,%ebx if((pte = walkpgdir(pgdir, a, 1)) == 0) 80106ed5: 8b 45 e4 mov -0x1c(%ebp),%eax 80106ed8: b9 01 00 00 00 mov $0x1,%ecx 80106edd: 89 da mov %ebx,%edx 80106edf: 8d 34 3b lea (%ebx,%edi,1),%esi 80106ee2: e8 29 ff ff ff call 80106e10 <walkpgdir> 80106ee7: 85 c0 test %eax,%eax 80106ee9: 75 d5 jne 80106ec0 <mappages+0x30> pa += PGSIZE; } return 0; } 80106eeb: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80106eee: b8 ff ff ff ff mov $0xffffffff,%eax } 80106ef3: 5b pop %ebx 80106ef4: 5e pop %esi 80106ef5: 5f pop %edi 80106ef6: 5d pop %ebp 80106ef7: c3 ret 80106ef8: 90 nop 80106ef9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106f00: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106f03: 31 c0 xor %eax,%eax } 80106f05: 5b pop %ebx 80106f06: 5e pop %esi 80106f07: 5f pop %edi 80106f08: 5d pop %ebp 80106f09: c3 ret panic("remap"); 80106f0a: 83 ec 0c sub $0xc,%esp 80106f0d: 68 c4 81 10 80 push $0x801081c4 80106f12: e8 79 94 ff ff call 80100390 <panic> 80106f17: 89 f6 mov %esi,%esi 80106f19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106f20 <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) 80106f20: 55 push %ebp 80106f21: 89 e5 mov %esp,%ebp 80106f23: 57 push %edi 80106f24: 56 push %esi 80106f25: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 80106f26: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 80106f2c: 89 c7 mov %eax,%edi a = PGROUNDUP(newsz); 80106f2e: 81 e3 00 f0 ff ff and $0xfffff000,%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 80106f34: 83 ec 1c sub $0x1c,%esp 80106f37: 89 4d e0 mov %ecx,-0x20(%ebp) for(; a < oldsz; a += PGSIZE){ 80106f3a: 39 d3 cmp %edx,%ebx 80106f3c: 73 66 jae 80106fa4 <deallocuvm.part.0+0x84> 80106f3e: 89 d6 mov %edx,%esi 80106f40: eb 3d jmp 80106f7f <deallocuvm.part.0+0x5f> 80106f42: 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){ 80106f48: 8b 10 mov (%eax),%edx 80106f4a: f6 c2 01 test $0x1,%dl 80106f4d: 74 26 je 80106f75 <deallocuvm.part.0+0x55> pa = PTE_ADDR(*pte); if(pa == 0) 80106f4f: 81 e2 00 f0 ff ff and $0xfffff000,%edx 80106f55: 74 58 je 80106faf <deallocuvm.part.0+0x8f> panic("kfree"); char *v = P2V(pa); kfree(v); 80106f57: 83 ec 0c sub $0xc,%esp char *v = P2V(pa); 80106f5a: 81 c2 00 00 00 80 add $0x80000000,%edx 80106f60: 89 45 e4 mov %eax,-0x1c(%ebp) kfree(v); 80106f63: 52 push %edx 80106f64: e8 a7 b3 ff ff call 80102310 <kfree> *pte = 0; 80106f69: 8b 45 e4 mov -0x1c(%ebp),%eax 80106f6c: 83 c4 10 add $0x10,%esp 80106f6f: c7 00 00 00 00 00 movl $0x0,(%eax) for(; a < oldsz; a += PGSIZE){ 80106f75: 81 c3 00 10 00 00 add $0x1000,%ebx 80106f7b: 39 f3 cmp %esi,%ebx 80106f7d: 73 25 jae 80106fa4 <deallocuvm.part.0+0x84> pte = walkpgdir(pgdir, (char*)a, 0); 80106f7f: 31 c9 xor %ecx,%ecx 80106f81: 89 da mov %ebx,%edx 80106f83: 89 f8 mov %edi,%eax 80106f85: e8 86 fe ff ff call 80106e10 <walkpgdir> if(!pte) 80106f8a: 85 c0 test %eax,%eax 80106f8c: 75 ba jne 80106f48 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 80106f8e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106f94: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx for(; a < oldsz; a += PGSIZE){ 80106f9a: 81 c3 00 10 00 00 add $0x1000,%ebx 80106fa0: 39 f3 cmp %esi,%ebx 80106fa2: 72 db jb 80106f7f <deallocuvm.part.0+0x5f> } } return newsz; } 80106fa4: 8b 45 e0 mov -0x20(%ebp),%eax 80106fa7: 8d 65 f4 lea -0xc(%ebp),%esp 80106faa: 5b pop %ebx 80106fab: 5e pop %esi 80106fac: 5f pop %edi 80106fad: 5d pop %ebp 80106fae: c3 ret panic("kfree"); 80106faf: 83 ec 0c sub $0xc,%esp 80106fb2: 68 a6 79 10 80 push $0x801079a6 80106fb7: e8 d4 93 ff ff call 80100390 <panic> 80106fbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106fc0 <seginit>: { 80106fc0: 55 push %ebp 80106fc1: 89 e5 mov %esp,%ebp 80106fc3: 83 ec 18 sub $0x18,%esp c = &cpus[cpuid()]; 80106fc6: e8 f5 c7 ff ff call 801037c0 <cpuid> 80106fcb: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax pd[0] = size-1; 80106fd1: ba 2f 00 00 00 mov $0x2f,%edx 80106fd6: 66 89 55 f2 mov %dx,-0xe(%ebp) c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 80106fda: c7 80 f8 37 11 80 ff movl $0xffff,-0x7feec808(%eax) 80106fe1: ff 00 00 80106fe4: c7 80 fc 37 11 80 00 movl $0xcf9a00,-0x7feec804(%eax) 80106feb: 9a cf 00 c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 80106fee: c7 80 00 38 11 80 ff movl $0xffff,-0x7feec800(%eax) 80106ff5: ff 00 00 80106ff8: c7 80 04 38 11 80 00 movl $0xcf9200,-0x7feec7fc(%eax) 80106fff: 92 cf 00 c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80107002: c7 80 08 38 11 80 ff movl $0xffff,-0x7feec7f8(%eax) 80107009: ff 00 00 8010700c: c7 80 0c 38 11 80 00 movl $0xcffa00,-0x7feec7f4(%eax) 80107013: fa cf 00 c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 80107016: c7 80 10 38 11 80 ff movl $0xffff,-0x7feec7f0(%eax) 8010701d: ff 00 00 80107020: c7 80 14 38 11 80 00 movl $0xcff200,-0x7feec7ec(%eax) 80107027: f2 cf 00 lgdt(c->gdt, sizeof(c->gdt)); 8010702a: 05 f0 37 11 80 add $0x801137f0,%eax pd[1] = (uint)p; 8010702f: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 80107033: c1 e8 10 shr $0x10,%eax 80107036: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 8010703a: 8d 45 f2 lea -0xe(%ebp),%eax 8010703d: 0f 01 10 lgdtl (%eax) } 80107040: c9 leave 80107041: c3 ret 80107042: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107049: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107050 <switchkvm>: lcr3(V2P(kpgdir)); // switch to the kernel page table 80107050: a1 84 61 11 80 mov 0x80116184,%eax { 80107055: 55 push %ebp 80107056: 89 e5 mov %esp,%ebp lcr3(V2P(kpgdir)); // switch to the kernel page table 80107058: 05 00 00 00 80 add $0x80000000,%eax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 8010705d: 0f 22 d8 mov %eax,%cr3 } 80107060: 5d pop %ebp 80107061: c3 ret 80107062: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107069: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107070 <switchuvm>: { 80107070: 55 push %ebp 80107071: 89 e5 mov %esp,%ebp 80107073: 57 push %edi 80107074: 56 push %esi 80107075: 53 push %ebx 80107076: 83 ec 1c sub $0x1c,%esp 80107079: 8b 5d 08 mov 0x8(%ebp),%ebx if(p == 0) 8010707c: 85 db test %ebx,%ebx 8010707e: 0f 84 cb 00 00 00 je 8010714f <switchuvm+0xdf> if(p->kstack == 0) 80107084: 8b 43 08 mov 0x8(%ebx),%eax 80107087: 85 c0 test %eax,%eax 80107089: 0f 84 da 00 00 00 je 80107169 <switchuvm+0xf9> if(p->pgdir == 0) 8010708f: 8b 43 04 mov 0x4(%ebx),%eax 80107092: 85 c0 test %eax,%eax 80107094: 0f 84 c2 00 00 00 je 8010715c <switchuvm+0xec> pushcli(); 8010709a: e8 11 d3 ff ff call 801043b0 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 8010709f: e8 ac c6 ff ff call 80103750 <mycpu> 801070a4: 89 c6 mov %eax,%esi 801070a6: e8 a5 c6 ff ff call 80103750 <mycpu> 801070ab: 89 c7 mov %eax,%edi 801070ad: e8 9e c6 ff ff call 80103750 <mycpu> 801070b2: 89 45 e4 mov %eax,-0x1c(%ebp) 801070b5: 83 c7 08 add $0x8,%edi 801070b8: e8 93 c6 ff ff call 80103750 <mycpu> 801070bd: 8b 4d e4 mov -0x1c(%ebp),%ecx 801070c0: 83 c0 08 add $0x8,%eax 801070c3: ba 67 00 00 00 mov $0x67,%edx 801070c8: c1 e8 18 shr $0x18,%eax 801070cb: 66 89 96 98 00 00 00 mov %dx,0x98(%esi) 801070d2: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi) 801070d9: 88 86 9f 00 00 00 mov %al,0x9f(%esi) mycpu()->ts.iomb = (ushort) 0xFFFF; 801070df: bf ff ff ff ff mov $0xffffffff,%edi mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 801070e4: 83 c1 08 add $0x8,%ecx 801070e7: c1 e9 10 shr $0x10,%ecx 801070ea: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi) 801070f0: b9 99 40 00 00 mov $0x4099,%ecx 801070f5: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi) mycpu()->ts.ss0 = SEG_KDATA << 3; 801070fc: be 10 00 00 00 mov $0x10,%esi mycpu()->gdt[SEG_TSS].s = 0; 80107101: e8 4a c6 ff ff call 80103750 <mycpu> 80107106: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 8010710d: e8 3e c6 ff ff call 80103750 <mycpu> 80107112: 66 89 70 10 mov %si,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 80107116: 8b 73 08 mov 0x8(%ebx),%esi 80107119: e8 32 c6 ff ff call 80103750 <mycpu> 8010711e: 81 c6 00 10 00 00 add $0x1000,%esi 80107124: 89 70 0c mov %esi,0xc(%eax) mycpu()->ts.iomb = (ushort) 0xFFFF; 80107127: e8 24 c6 ff ff call 80103750 <mycpu> 8010712c: 66 89 78 6e mov %di,0x6e(%eax) asm volatile("ltr %0" : : "r" (sel)); 80107130: b8 28 00 00 00 mov $0x28,%eax 80107135: 0f 00 d8 ltr %ax lcr3(V2P(p->pgdir)); // switch to process's address space 80107138: 8b 43 04 mov 0x4(%ebx),%eax 8010713b: 05 00 00 00 80 add $0x80000000,%eax asm volatile("movl %0,%%cr3" : : "r" (val)); 80107140: 0f 22 d8 mov %eax,%cr3 } 80107143: 8d 65 f4 lea -0xc(%ebp),%esp 80107146: 5b pop %ebx 80107147: 5e pop %esi 80107148: 5f pop %edi 80107149: 5d pop %ebp popcli(); 8010714a: e9 a1 d2 ff ff jmp 801043f0 <popcli> panic("switchuvm: no process"); 8010714f: 83 ec 0c sub $0xc,%esp 80107152: 68 ca 81 10 80 push $0x801081ca 80107157: e8 34 92 ff ff call 80100390 <panic> panic("switchuvm: no pgdir"); 8010715c: 83 ec 0c sub $0xc,%esp 8010715f: 68 f5 81 10 80 push $0x801081f5 80107164: e8 27 92 ff ff call 80100390 <panic> panic("switchuvm: no kstack"); 80107169: 83 ec 0c sub $0xc,%esp 8010716c: 68 e0 81 10 80 push $0x801081e0 80107171: e8 1a 92 ff ff call 80100390 <panic> 80107176: 8d 76 00 lea 0x0(%esi),%esi 80107179: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107180 <inituvm>: { 80107180: 55 push %ebp 80107181: 89 e5 mov %esp,%ebp 80107183: 57 push %edi 80107184: 56 push %esi 80107185: 53 push %ebx 80107186: 83 ec 1c sub $0x1c,%esp 80107189: 8b 75 10 mov 0x10(%ebp),%esi 8010718c: 8b 45 08 mov 0x8(%ebp),%eax 8010718f: 8b 7d 0c mov 0xc(%ebp),%edi if(sz >= PGSIZE) 80107192: 81 fe ff 0f 00 00 cmp $0xfff,%esi { 80107198: 89 45 e4 mov %eax,-0x1c(%ebp) if(sz >= PGSIZE) 8010719b: 77 49 ja 801071e6 <inituvm+0x66> mem = kalloc(); 8010719d: e8 1e b3 ff ff call 801024c0 <kalloc> memset(mem, 0, PGSIZE); 801071a2: 83 ec 04 sub $0x4,%esp mem = kalloc(); 801071a5: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 801071a7: 68 00 10 00 00 push $0x1000 801071ac: 6a 00 push $0x0 801071ae: 50 push %eax 801071af: e8 dc d3 ff ff call 80104590 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 801071b4: 58 pop %eax 801071b5: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 801071bb: b9 00 10 00 00 mov $0x1000,%ecx 801071c0: 5a pop %edx 801071c1: 6a 06 push $0x6 801071c3: 50 push %eax 801071c4: 31 d2 xor %edx,%edx 801071c6: 8b 45 e4 mov -0x1c(%ebp),%eax 801071c9: e8 c2 fc ff ff call 80106e90 <mappages> memmove(mem, init, sz); 801071ce: 89 75 10 mov %esi,0x10(%ebp) 801071d1: 89 7d 0c mov %edi,0xc(%ebp) 801071d4: 83 c4 10 add $0x10,%esp 801071d7: 89 5d 08 mov %ebx,0x8(%ebp) } 801071da: 8d 65 f4 lea -0xc(%ebp),%esp 801071dd: 5b pop %ebx 801071de: 5e pop %esi 801071df: 5f pop %edi 801071e0: 5d pop %ebp memmove(mem, init, sz); 801071e1: e9 5a d4 ff ff jmp 80104640 <memmove> panic("inituvm: more than a page"); 801071e6: 83 ec 0c sub $0xc,%esp 801071e9: 68 09 82 10 80 push $0x80108209 801071ee: e8 9d 91 ff ff call 80100390 <panic> 801071f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801071f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107200 <loaduvm>: { 80107200: 55 push %ebp 80107201: 89 e5 mov %esp,%ebp 80107203: 57 push %edi 80107204: 56 push %esi 80107205: 53 push %ebx 80107206: 83 ec 0c sub $0xc,%esp if((uint) addr % PGSIZE != 0) 80107209: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80107210: 0f 85 91 00 00 00 jne 801072a7 <loaduvm+0xa7> for(i = 0; i < sz; i += PGSIZE){ 80107216: 8b 75 18 mov 0x18(%ebp),%esi 80107219: 31 db xor %ebx,%ebx 8010721b: 85 f6 test %esi,%esi 8010721d: 75 1a jne 80107239 <loaduvm+0x39> 8010721f: eb 6f jmp 80107290 <loaduvm+0x90> 80107221: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107228: 81 c3 00 10 00 00 add $0x1000,%ebx 8010722e: 81 ee 00 10 00 00 sub $0x1000,%esi 80107234: 39 5d 18 cmp %ebx,0x18(%ebp) 80107237: 76 57 jbe 80107290 <loaduvm+0x90> if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 80107239: 8b 55 0c mov 0xc(%ebp),%edx 8010723c: 8b 45 08 mov 0x8(%ebp),%eax 8010723f: 31 c9 xor %ecx,%ecx 80107241: 01 da add %ebx,%edx 80107243: e8 c8 fb ff ff call 80106e10 <walkpgdir> 80107248: 85 c0 test %eax,%eax 8010724a: 74 4e je 8010729a <loaduvm+0x9a> pa = PTE_ADDR(*pte); 8010724c: 8b 00 mov (%eax),%eax if(readi(ip, P2V(pa), offset+i, n) != n) 8010724e: 8b 4d 14 mov 0x14(%ebp),%ecx if(sz - i < PGSIZE) 80107251: bf 00 10 00 00 mov $0x1000,%edi pa = PTE_ADDR(*pte); 80107256: 25 00 f0 ff ff and $0xfffff000,%eax if(sz - i < PGSIZE) 8010725b: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80107261: 0f 46 fe cmovbe %esi,%edi if(readi(ip, P2V(pa), offset+i, n) != n) 80107264: 01 d9 add %ebx,%ecx 80107266: 05 00 00 00 80 add $0x80000000,%eax 8010726b: 57 push %edi 8010726c: 51 push %ecx 8010726d: 50 push %eax 8010726e: ff 75 10 pushl 0x10(%ebp) 80107271: e8 ea a6 ff ff call 80101960 <readi> 80107276: 83 c4 10 add $0x10,%esp 80107279: 39 f8 cmp %edi,%eax 8010727b: 74 ab je 80107228 <loaduvm+0x28> } 8010727d: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80107280: b8 ff ff ff ff mov $0xffffffff,%eax } 80107285: 5b pop %ebx 80107286: 5e pop %esi 80107287: 5f pop %edi 80107288: 5d pop %ebp 80107289: c3 ret 8010728a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107290: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80107293: 31 c0 xor %eax,%eax } 80107295: 5b pop %ebx 80107296: 5e pop %esi 80107297: 5f pop %edi 80107298: 5d pop %ebp 80107299: c3 ret panic("loaduvm: address should exist"); 8010729a: 83 ec 0c sub $0xc,%esp 8010729d: 68 23 82 10 80 push $0x80108223 801072a2: e8 e9 90 ff ff call 80100390 <panic> panic("loaduvm: addr must be page aligned"); 801072a7: 83 ec 0c sub $0xc,%esp 801072aa: 68 c4 82 10 80 push $0x801082c4 801072af: e8 dc 90 ff ff call 80100390 <panic> 801072b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801072ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801072c0 <allocuvm>: { 801072c0: 55 push %ebp 801072c1: 89 e5 mov %esp,%ebp 801072c3: 57 push %edi 801072c4: 56 push %esi 801072c5: 53 push %ebx 801072c6: 83 ec 1c sub $0x1c,%esp if(newsz >= KERNBASE) 801072c9: 8b 7d 10 mov 0x10(%ebp),%edi 801072cc: 85 ff test %edi,%edi 801072ce: 0f 88 8e 00 00 00 js 80107362 <allocuvm+0xa2> if(newsz < oldsz) 801072d4: 3b 7d 0c cmp 0xc(%ebp),%edi 801072d7: 0f 82 93 00 00 00 jb 80107370 <allocuvm+0xb0> a = PGROUNDUP(oldsz); 801072dd: 8b 45 0c mov 0xc(%ebp),%eax 801072e0: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801072e6: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 801072ec: 39 5d 10 cmp %ebx,0x10(%ebp) 801072ef: 0f 86 7e 00 00 00 jbe 80107373 <allocuvm+0xb3> 801072f5: 89 7d e4 mov %edi,-0x1c(%ebp) 801072f8: 8b 7d 08 mov 0x8(%ebp),%edi 801072fb: eb 42 jmp 8010733f <allocuvm+0x7f> 801072fd: 8d 76 00 lea 0x0(%esi),%esi memset(mem, 0, PGSIZE); 80107300: 83 ec 04 sub $0x4,%esp 80107303: 68 00 10 00 00 push $0x1000 80107308: 6a 00 push $0x0 8010730a: 50 push %eax 8010730b: e8 80 d2 ff ff call 80104590 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 80107310: 58 pop %eax 80107311: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80107317: b9 00 10 00 00 mov $0x1000,%ecx 8010731c: 5a pop %edx 8010731d: 6a 06 push $0x6 8010731f: 50 push %eax 80107320: 89 da mov %ebx,%edx 80107322: 89 f8 mov %edi,%eax 80107324: e8 67 fb ff ff call 80106e90 <mappages> 80107329: 83 c4 10 add $0x10,%esp 8010732c: 85 c0 test %eax,%eax 8010732e: 78 50 js 80107380 <allocuvm+0xc0> for(; a < newsz; a += PGSIZE){ 80107330: 81 c3 00 10 00 00 add $0x1000,%ebx 80107336: 39 5d 10 cmp %ebx,0x10(%ebp) 80107339: 0f 86 81 00 00 00 jbe 801073c0 <allocuvm+0x100> mem = kalloc(); 8010733f: e8 7c b1 ff ff call 801024c0 <kalloc> if(mem == 0){ 80107344: 85 c0 test %eax,%eax mem = kalloc(); 80107346: 89 c6 mov %eax,%esi if(mem == 0){ 80107348: 75 b6 jne 80107300 <allocuvm+0x40> cprintf("allocuvm out of memory\n"); 8010734a: 83 ec 0c sub $0xc,%esp 8010734d: 68 41 82 10 80 push $0x80108241 80107352: e8 09 93 ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80107357: 83 c4 10 add $0x10,%esp 8010735a: 8b 45 0c mov 0xc(%ebp),%eax 8010735d: 39 45 10 cmp %eax,0x10(%ebp) 80107360: 77 6e ja 801073d0 <allocuvm+0x110> } 80107362: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80107365: 31 ff xor %edi,%edi } 80107367: 89 f8 mov %edi,%eax 80107369: 5b pop %ebx 8010736a: 5e pop %esi 8010736b: 5f pop %edi 8010736c: 5d pop %ebp 8010736d: c3 ret 8010736e: 66 90 xchg %ax,%ax return oldsz; 80107370: 8b 7d 0c mov 0xc(%ebp),%edi } 80107373: 8d 65 f4 lea -0xc(%ebp),%esp 80107376: 89 f8 mov %edi,%eax 80107378: 5b pop %ebx 80107379: 5e pop %esi 8010737a: 5f pop %edi 8010737b: 5d pop %ebp 8010737c: c3 ret 8010737d: 8d 76 00 lea 0x0(%esi),%esi cprintf("allocuvm out of memory (2)\n"); 80107380: 83 ec 0c sub $0xc,%esp 80107383: 68 59 82 10 80 push $0x80108259 80107388: e8 d3 92 ff ff call 80100660 <cprintf> if(newsz >= oldsz) 8010738d: 83 c4 10 add $0x10,%esp 80107390: 8b 45 0c mov 0xc(%ebp),%eax 80107393: 39 45 10 cmp %eax,0x10(%ebp) 80107396: 76 0d jbe 801073a5 <allocuvm+0xe5> 80107398: 89 c1 mov %eax,%ecx 8010739a: 8b 55 10 mov 0x10(%ebp),%edx 8010739d: 8b 45 08 mov 0x8(%ebp),%eax 801073a0: e8 7b fb ff ff call 80106f20 <deallocuvm.part.0> kfree(mem); 801073a5: 83 ec 0c sub $0xc,%esp return 0; 801073a8: 31 ff xor %edi,%edi kfree(mem); 801073aa: 56 push %esi 801073ab: e8 60 af ff ff call 80102310 <kfree> return 0; 801073b0: 83 c4 10 add $0x10,%esp } 801073b3: 8d 65 f4 lea -0xc(%ebp),%esp 801073b6: 89 f8 mov %edi,%eax 801073b8: 5b pop %ebx 801073b9: 5e pop %esi 801073ba: 5f pop %edi 801073bb: 5d pop %ebp 801073bc: c3 ret 801073bd: 8d 76 00 lea 0x0(%esi),%esi 801073c0: 8b 7d e4 mov -0x1c(%ebp),%edi 801073c3: 8d 65 f4 lea -0xc(%ebp),%esp 801073c6: 5b pop %ebx 801073c7: 89 f8 mov %edi,%eax 801073c9: 5e pop %esi 801073ca: 5f pop %edi 801073cb: 5d pop %ebp 801073cc: c3 ret 801073cd: 8d 76 00 lea 0x0(%esi),%esi 801073d0: 89 c1 mov %eax,%ecx 801073d2: 8b 55 10 mov 0x10(%ebp),%edx 801073d5: 8b 45 08 mov 0x8(%ebp),%eax return 0; 801073d8: 31 ff xor %edi,%edi 801073da: e8 41 fb ff ff call 80106f20 <deallocuvm.part.0> 801073df: eb 92 jmp 80107373 <allocuvm+0xb3> 801073e1: eb 0d jmp 801073f0 <deallocuvm> 801073e3: 90 nop 801073e4: 90 nop 801073e5: 90 nop 801073e6: 90 nop 801073e7: 90 nop 801073e8: 90 nop 801073e9: 90 nop 801073ea: 90 nop 801073eb: 90 nop 801073ec: 90 nop 801073ed: 90 nop 801073ee: 90 nop 801073ef: 90 nop 801073f0 <deallocuvm>: { 801073f0: 55 push %ebp 801073f1: 89 e5 mov %esp,%ebp 801073f3: 8b 55 0c mov 0xc(%ebp),%edx 801073f6: 8b 4d 10 mov 0x10(%ebp),%ecx 801073f9: 8b 45 08 mov 0x8(%ebp),%eax if(newsz >= oldsz) 801073fc: 39 d1 cmp %edx,%ecx 801073fe: 73 10 jae 80107410 <deallocuvm+0x20> } 80107400: 5d pop %ebp 80107401: e9 1a fb ff ff jmp 80106f20 <deallocuvm.part.0> 80107406: 8d 76 00 lea 0x0(%esi),%esi 80107409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107410: 89 d0 mov %edx,%eax 80107412: 5d pop %ebp 80107413: c3 ret 80107414: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010741a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80107420 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80107420: 55 push %ebp 80107421: 89 e5 mov %esp,%ebp 80107423: 57 push %edi 80107424: 56 push %esi 80107425: 53 push %ebx 80107426: 83 ec 0c sub $0xc,%esp 80107429: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 8010742c: 85 f6 test %esi,%esi 8010742e: 74 59 je 80107489 <freevm+0x69> 80107430: 31 c9 xor %ecx,%ecx 80107432: ba 00 00 00 80 mov $0x80000000,%edx 80107437: 89 f0 mov %esi,%eax 80107439: e8 e2 fa ff ff call 80106f20 <deallocuvm.part.0> 8010743e: 89 f3 mov %esi,%ebx 80107440: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80107446: eb 0f jmp 80107457 <freevm+0x37> 80107448: 90 nop 80107449: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107450: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 80107453: 39 fb cmp %edi,%ebx 80107455: 74 23 je 8010747a <freevm+0x5a> if(pgdir[i] & PTE_P){ 80107457: 8b 03 mov (%ebx),%eax 80107459: a8 01 test $0x1,%al 8010745b: 74 f3 je 80107450 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); 8010745d: 25 00 f0 ff ff and $0xfffff000,%eax kfree(v); 80107462: 83 ec 0c sub $0xc,%esp 80107465: 83 c3 04 add $0x4,%ebx char * v = P2V(PTE_ADDR(pgdir[i])); 80107468: 05 00 00 00 80 add $0x80000000,%eax kfree(v); 8010746d: 50 push %eax 8010746e: e8 9d ae ff ff call 80102310 <kfree> 80107473: 83 c4 10 add $0x10,%esp for(i = 0; i < NPDENTRIES; i++){ 80107476: 39 fb cmp %edi,%ebx 80107478: 75 dd jne 80107457 <freevm+0x37> } } kfree((char*)pgdir); 8010747a: 89 75 08 mov %esi,0x8(%ebp) } 8010747d: 8d 65 f4 lea -0xc(%ebp),%esp 80107480: 5b pop %ebx 80107481: 5e pop %esi 80107482: 5f pop %edi 80107483: 5d pop %ebp kfree((char*)pgdir); 80107484: e9 87 ae ff ff jmp 80102310 <kfree> panic("freevm: no pgdir"); 80107489: 83 ec 0c sub $0xc,%esp 8010748c: 68 75 82 10 80 push $0x80108275 80107491: e8 fa 8e ff ff call 80100390 <panic> 80107496: 8d 76 00 lea 0x0(%esi),%esi 80107499: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801074a0 <setupkvm>: { 801074a0: 55 push %ebp 801074a1: 89 e5 mov %esp,%ebp 801074a3: 56 push %esi 801074a4: 53 push %ebx if((pgdir = (pde_t*)kalloc()) == 0) 801074a5: e8 16 b0 ff ff call 801024c0 <kalloc> 801074aa: 85 c0 test %eax,%eax 801074ac: 89 c6 mov %eax,%esi 801074ae: 74 42 je 801074f2 <setupkvm+0x52> memset(pgdir, 0, PGSIZE); 801074b0: 83 ec 04 sub $0x4,%esp for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 801074b3: bb 20 b4 10 80 mov $0x8010b420,%ebx memset(pgdir, 0, PGSIZE); 801074b8: 68 00 10 00 00 push $0x1000 801074bd: 6a 00 push $0x0 801074bf: 50 push %eax 801074c0: e8 cb d0 ff ff call 80104590 <memset> 801074c5: 83 c4 10 add $0x10,%esp (uint)k->phys_start, k->perm) < 0) { 801074c8: 8b 43 04 mov 0x4(%ebx),%eax if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 801074cb: 8b 4b 08 mov 0x8(%ebx),%ecx 801074ce: 83 ec 08 sub $0x8,%esp 801074d1: 8b 13 mov (%ebx),%edx 801074d3: ff 73 0c pushl 0xc(%ebx) 801074d6: 50 push %eax 801074d7: 29 c1 sub %eax,%ecx 801074d9: 89 f0 mov %esi,%eax 801074db: e8 b0 f9 ff ff call 80106e90 <mappages> 801074e0: 83 c4 10 add $0x10,%esp 801074e3: 85 c0 test %eax,%eax 801074e5: 78 19 js 80107500 <setupkvm+0x60> for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 801074e7: 83 c3 10 add $0x10,%ebx 801074ea: 81 fb 60 b4 10 80 cmp $0x8010b460,%ebx 801074f0: 75 d6 jne 801074c8 <setupkvm+0x28> } 801074f2: 8d 65 f8 lea -0x8(%ebp),%esp 801074f5: 89 f0 mov %esi,%eax 801074f7: 5b pop %ebx 801074f8: 5e pop %esi 801074f9: 5d pop %ebp 801074fa: c3 ret 801074fb: 90 nop 801074fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi freevm(pgdir); 80107500: 83 ec 0c sub $0xc,%esp 80107503: 56 push %esi return 0; 80107504: 31 f6 xor %esi,%esi freevm(pgdir); 80107506: e8 15 ff ff ff call 80107420 <freevm> return 0; 8010750b: 83 c4 10 add $0x10,%esp } 8010750e: 8d 65 f8 lea -0x8(%ebp),%esp 80107511: 89 f0 mov %esi,%eax 80107513: 5b pop %ebx 80107514: 5e pop %esi 80107515: 5d pop %ebp 80107516: c3 ret 80107517: 89 f6 mov %esi,%esi 80107519: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107520 <kvmalloc>: { 80107520: 55 push %ebp 80107521: 89 e5 mov %esp,%ebp 80107523: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80107526: e8 75 ff ff ff call 801074a0 <setupkvm> 8010752b: a3 84 61 11 80 mov %eax,0x80116184 lcr3(V2P(kpgdir)); // switch to the kernel page table 80107530: 05 00 00 00 80 add $0x80000000,%eax 80107535: 0f 22 d8 mov %eax,%cr3 } 80107538: c9 leave 80107539: c3 ret 8010753a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107540 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80107540: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80107541: 31 c9 xor %ecx,%ecx { 80107543: 89 e5 mov %esp,%ebp 80107545: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80107548: 8b 55 0c mov 0xc(%ebp),%edx 8010754b: 8b 45 08 mov 0x8(%ebp),%eax 8010754e: e8 bd f8 ff ff call 80106e10 <walkpgdir> if(pte == 0) 80107553: 85 c0 test %eax,%eax 80107555: 74 05 je 8010755c <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 80107557: 83 20 fb andl $0xfffffffb,(%eax) } 8010755a: c9 leave 8010755b: c3 ret panic("clearpteu"); 8010755c: 83 ec 0c sub $0xc,%esp 8010755f: 68 86 82 10 80 push $0x80108286 80107564: e8 27 8e ff ff call 80100390 <panic> 80107569: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107570 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 80107570: 55 push %ebp 80107571: 89 e5 mov %esp,%ebp 80107573: 57 push %edi 80107574: 56 push %esi 80107575: 53 push %ebx 80107576: 83 ec 1c sub $0x1c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 80107579: e8 22 ff ff ff call 801074a0 <setupkvm> 8010757e: 85 c0 test %eax,%eax 80107580: 89 45 e0 mov %eax,-0x20(%ebp) 80107583: 0f 84 9f 00 00 00 je 80107628 <copyuvm+0xb8> return 0; for(i = 0; i < sz; i += PGSIZE){ 80107589: 8b 4d 0c mov 0xc(%ebp),%ecx 8010758c: 85 c9 test %ecx,%ecx 8010758e: 0f 84 94 00 00 00 je 80107628 <copyuvm+0xb8> 80107594: 31 ff xor %edi,%edi 80107596: eb 4a jmp 801075e2 <copyuvm+0x72> 80107598: 90 nop 80107599: 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); 801075a0: 83 ec 04 sub $0x4,%esp 801075a3: 81 c3 00 00 00 80 add $0x80000000,%ebx 801075a9: 68 00 10 00 00 push $0x1000 801075ae: 53 push %ebx 801075af: 50 push %eax 801075b0: e8 8b d0 ff ff call 80104640 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) { 801075b5: 58 pop %eax 801075b6: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 801075bc: b9 00 10 00 00 mov $0x1000,%ecx 801075c1: 5a pop %edx 801075c2: ff 75 e4 pushl -0x1c(%ebp) 801075c5: 50 push %eax 801075c6: 89 fa mov %edi,%edx 801075c8: 8b 45 e0 mov -0x20(%ebp),%eax 801075cb: e8 c0 f8 ff ff call 80106e90 <mappages> 801075d0: 83 c4 10 add $0x10,%esp 801075d3: 85 c0 test %eax,%eax 801075d5: 78 61 js 80107638 <copyuvm+0xc8> for(i = 0; i < sz; i += PGSIZE){ 801075d7: 81 c7 00 10 00 00 add $0x1000,%edi 801075dd: 39 7d 0c cmp %edi,0xc(%ebp) 801075e0: 76 46 jbe 80107628 <copyuvm+0xb8> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 801075e2: 8b 45 08 mov 0x8(%ebp),%eax 801075e5: 31 c9 xor %ecx,%ecx 801075e7: 89 fa mov %edi,%edx 801075e9: e8 22 f8 ff ff call 80106e10 <walkpgdir> 801075ee: 85 c0 test %eax,%eax 801075f0: 74 61 je 80107653 <copyuvm+0xe3> if(!(*pte & PTE_P)) 801075f2: 8b 00 mov (%eax),%eax 801075f4: a8 01 test $0x1,%al 801075f6: 74 4e je 80107646 <copyuvm+0xd6> pa = PTE_ADDR(*pte); 801075f8: 89 c3 mov %eax,%ebx flags = PTE_FLAGS(*pte); 801075fa: 25 ff 0f 00 00 and $0xfff,%eax pa = PTE_ADDR(*pte); 801075ff: 81 e3 00 f0 ff ff and $0xfffff000,%ebx flags = PTE_FLAGS(*pte); 80107605: 89 45 e4 mov %eax,-0x1c(%ebp) if((mem = kalloc()) == 0) 80107608: e8 b3 ae ff ff call 801024c0 <kalloc> 8010760d: 85 c0 test %eax,%eax 8010760f: 89 c6 mov %eax,%esi 80107611: 75 8d jne 801075a0 <copyuvm+0x30> } } return d; bad: freevm(d); 80107613: 83 ec 0c sub $0xc,%esp 80107616: ff 75 e0 pushl -0x20(%ebp) 80107619: e8 02 fe ff ff call 80107420 <freevm> return 0; 8010761e: 83 c4 10 add $0x10,%esp 80107621: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) } 80107628: 8b 45 e0 mov -0x20(%ebp),%eax 8010762b: 8d 65 f4 lea -0xc(%ebp),%esp 8010762e: 5b pop %ebx 8010762f: 5e pop %esi 80107630: 5f pop %edi 80107631: 5d pop %ebp 80107632: c3 ret 80107633: 90 nop 80107634: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(mem); 80107638: 83 ec 0c sub $0xc,%esp 8010763b: 56 push %esi 8010763c: e8 cf ac ff ff call 80102310 <kfree> goto bad; 80107641: 83 c4 10 add $0x10,%esp 80107644: eb cd jmp 80107613 <copyuvm+0xa3> panic("copyuvm: page not present"); 80107646: 83 ec 0c sub $0xc,%esp 80107649: 68 aa 82 10 80 push $0x801082aa 8010764e: e8 3d 8d ff ff call 80100390 <panic> panic("copyuvm: pte should exist"); 80107653: 83 ec 0c sub $0xc,%esp 80107656: 68 90 82 10 80 push $0x80108290 8010765b: e8 30 8d ff ff call 80100390 <panic> 80107660 <uva2ka>: //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 80107660: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80107661: 31 c9 xor %ecx,%ecx { 80107663: 89 e5 mov %esp,%ebp 80107665: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80107668: 8b 55 0c mov 0xc(%ebp),%edx 8010766b: 8b 45 08 mov 0x8(%ebp),%eax 8010766e: e8 9d f7 ff ff call 80106e10 <walkpgdir> if((*pte & PTE_P) == 0) 80107673: 8b 00 mov (%eax),%eax return 0; if((*pte & PTE_U) == 0) return 0; return (char*)P2V(PTE_ADDR(*pte)); } 80107675: c9 leave if((*pte & PTE_U) == 0) 80107676: 89 c2 mov %eax,%edx return (char*)P2V(PTE_ADDR(*pte)); 80107678: 25 00 f0 ff ff and $0xfffff000,%eax if((*pte & PTE_U) == 0) 8010767d: 83 e2 05 and $0x5,%edx return (char*)P2V(PTE_ADDR(*pte)); 80107680: 05 00 00 00 80 add $0x80000000,%eax 80107685: 83 fa 05 cmp $0x5,%edx 80107688: ba 00 00 00 00 mov $0x0,%edx 8010768d: 0f 45 c2 cmovne %edx,%eax } 80107690: c3 ret 80107691: eb 0d jmp 801076a0 <copyout> 80107693: 90 nop 80107694: 90 nop 80107695: 90 nop 80107696: 90 nop 80107697: 90 nop 80107698: 90 nop 80107699: 90 nop 8010769a: 90 nop 8010769b: 90 nop 8010769c: 90 nop 8010769d: 90 nop 8010769e: 90 nop 8010769f: 90 nop 801076a0 <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) { 801076a0: 55 push %ebp 801076a1: 89 e5 mov %esp,%ebp 801076a3: 57 push %edi 801076a4: 56 push %esi 801076a5: 53 push %ebx 801076a6: 83 ec 1c sub $0x1c,%esp 801076a9: 8b 5d 14 mov 0x14(%ebp),%ebx 801076ac: 8b 55 0c mov 0xc(%ebp),%edx 801076af: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 801076b2: 85 db test %ebx,%ebx 801076b4: 75 40 jne 801076f6 <copyout+0x56> 801076b6: eb 70 jmp 80107728 <copyout+0x88> 801076b8: 90 nop 801076b9: 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); 801076c0: 8b 55 e4 mov -0x1c(%ebp),%edx 801076c3: 89 f1 mov %esi,%ecx 801076c5: 29 d1 sub %edx,%ecx 801076c7: 81 c1 00 10 00 00 add $0x1000,%ecx 801076cd: 39 d9 cmp %ebx,%ecx 801076cf: 0f 47 cb cmova %ebx,%ecx if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 801076d2: 29 f2 sub %esi,%edx 801076d4: 83 ec 04 sub $0x4,%esp 801076d7: 01 d0 add %edx,%eax 801076d9: 51 push %ecx 801076da: 57 push %edi 801076db: 50 push %eax 801076dc: 89 4d e4 mov %ecx,-0x1c(%ebp) 801076df: e8 5c cf ff ff call 80104640 <memmove> len -= n; buf += n; 801076e4: 8b 4d e4 mov -0x1c(%ebp),%ecx while(len > 0){ 801076e7: 83 c4 10 add $0x10,%esp va = va0 + PGSIZE; 801076ea: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx buf += n; 801076f0: 01 cf add %ecx,%edi while(len > 0){ 801076f2: 29 cb sub %ecx,%ebx 801076f4: 74 32 je 80107728 <copyout+0x88> va0 = (uint)PGROUNDDOWN(va); 801076f6: 89 d6 mov %edx,%esi pa0 = uva2ka(pgdir, (char*)va0); 801076f8: 83 ec 08 sub $0x8,%esp va0 = (uint)PGROUNDDOWN(va); 801076fb: 89 55 e4 mov %edx,-0x1c(%ebp) 801076fe: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107704: 56 push %esi 80107705: ff 75 08 pushl 0x8(%ebp) 80107708: e8 53 ff ff ff call 80107660 <uva2ka> if(pa0 == 0) 8010770d: 83 c4 10 add $0x10,%esp 80107710: 85 c0 test %eax,%eax 80107712: 75 ac jne 801076c0 <copyout+0x20> } return 0; } 80107714: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80107717: b8 ff ff ff ff mov $0xffffffff,%eax } 8010771c: 5b pop %ebx 8010771d: 5e pop %esi 8010771e: 5f pop %edi 8010771f: 5d pop %ebp 80107720: c3 ret 80107721: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107728: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010772b: 31 c0 xor %eax,%eax } 8010772d: 5b pop %ebx 8010772e: 5e pop %esi 8010772f: 5f pop %edi 80107730: 5d pop %ebp 80107731: c3 ret
38.766576
118
0.521723
52af7f1d01c1b572de3db91a262ff1edc68cceda
791
asm
Assembly
src/spread/sprites/csum.asm
olifink/qspread
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
[ "MIT" ]
null
null
null
src/spread/sprites/csum.asm
olifink/qspread
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
[ "MIT" ]
null
null
null
src/spread/sprites/csum.asm
olifink/qspread
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
[ "MIT" ]
null
null
null
;Sprite source code generated with EASYSOURCE  1990 Albin Hessler Software ;************************************************************************** ;Sprite -> spread_s <- 1992 Feb 18 13:42:10 section sprite xdef mes_csum xref mes_zero mes_csum sp1 dc.w $0100,$0000 ;form, time/adaption dc.w $0006,$0009 ;x size, y size dc.w $0000,$0000 ;x origin, y origin dc.l cp1-* ;pointer to colour pattern dc.l mes_zero-* ;pointer to pattern mask dc.l sp_csum-* ;pointer to next definition cp1 dc.w $FCFC,$0000 dc.w $8484,$0000 dc.w $4040,$0000 dc.w $2020,$0000 dc.w $1010,$0000 dc.w $2020,$0000 dc.w $4040,$0000 dc.w $8484,$0000 dc.w $FCFC,$0000 sp_csum incbin 'win1_Spread_sprites_csum_spr' ; end
23.969697
76
0.570164
c8e5ef31fbfac9703bf52a1bb60872e8ab0a9fb5
836
asm
Assembly
oeis/033/A033196.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/033/A033196.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/033/A033196.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A033196: a(n) = n^3*Product_{p|n} (1 + 1/p). ; Submitted by Jon Maiga ; 1,12,36,96,150,432,392,768,972,1800,1452,3456,2366,4704,5400,6144,5202,11664,7220,14400,14112,17424,12696,27648,18750,28392,26244,37632,25230,64800,30752,49152,52272,62424,58800,93312,52022,86640,85176,115200,70602,169344,81356,139392,145800,152352,106032,221184,134456,225000,187272,227136,151686,314928,217800,301056,259920,302760,208860,518400,230702,369024,381024,393216,354900,627264,305252,499392,457056,705600,362952,746496,394346,624264,675000,693120,569184,1022112,499280,921600,708588 add $0,1 pow $0,3 mov $1,1 mov $2,2 lpb $0 mov $3,$0 lpb $3 mov $4,$0 mod $4,$2 add $2,1 cmp $4,0 cmp $4,0 sub $3,$4 lpe mov $5,1 lpb $0 dif $0,$2 mul $5,$2 lpe dif $5,$2 mul $1,$5 add $2,1 mul $1,$2 lpe mov $0,$1
27.866667
496
0.685407
6f33c423ceebcc7b6e7454be63807a929fa7f5be
35
asm
Assembly
loops/ecx-loop.asm
Unshifted1337/5xFibonnaciNumbers
8816d4f057f54a5aa3e0003e2583f7bfdd5bfafb
[ "MIT" ]
null
null
null
loops/ecx-loop.asm
Unshifted1337/5xFibonnaciNumbers
8816d4f057f54a5aa3e0003e2583f7bfdd5bfafb
[ "MIT" ]
null
null
null
loops/ecx-loop.asm
Unshifted1337/5xFibonnaciNumbers
8816d4f057f54a5aa3e0003e2583f7bfdd5bfafb
[ "MIT" ]
null
null
null
mov ECX,10 l1: <loop body> loop l1
7
11
0.685714
bfc3ddf0aa4c6110c5daac12aa522832f025b4df
680
asm
Assembly
oeis/007/A007179.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/007/A007179.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/007/A007179.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A007179: Dual pairs of integrals arising from reflection coefficients. ; Submitted by Christian Krause ; 0,1,1,4,6,16,28,64,120,256,496,1024,2016,4096,8128,16384,32640,65536,130816,262144,523776,1048576,2096128,4194304,8386560,16777216,33550336,67108864,134209536,268435456,536854528,1073741824,2147450880,4294967296,8589869056,17179869184,34359607296,68719476736,137438691328,274877906944,549755289600,1099511627776,2199022206976,4398046511104,8796090925056,17592186044416,35184367894528,70368744177664,140737479966720,281474976710656,562949936644096,1125899906842624,2251799780130816,4503599627370496 seq $0,14236 ; Expansion of g.f.: 2*x*(1-x)/((1-2*x)*(1-2*x^2)). div $0,2
97.142857
499
0.835294
16568c1d659a76f404f5373b8b41abe3fa0f60a7
3,919
asm
Assembly
Basic programming exercises and solutions in C/16- C program to calculate total average and percentage of five subjects/project.asm
MahmoudFawzy01/C-solutions-Code4win-
491d86770895ec4c31a69c7e3d47a88dedc4427a
[ "Apache-2.0" ]
null
null
null
Basic programming exercises and solutions in C/16- C program to calculate total average and percentage of five subjects/project.asm
MahmoudFawzy01/C-solutions-Code4win-
491d86770895ec4c31a69c7e3d47a88dedc4427a
[ "Apache-2.0" ]
null
null
null
Basic programming exercises and solutions in C/16- C program to calculate total average and percentage of five subjects/project.asm
MahmoudFawzy01/C-solutions-Code4win-
491d86770895ec4c31a69c7e3d47a88dedc4427a
[ "Apache-2.0" ]
null
null
null
.file "project.c" .text .globl average .def average; .scl 2; .type 32; .endef .seh_proc average average: pushq %rbp .seh_pushreg %rbp movq %rsp, %rbp .seh_setframe %rbp, 0 subq $16, %rsp .seh_stackalloc 16 .seh_endprologue movq %rcx, 16(%rbp) movl %edx, 24(%rbp) movl $0, -8(%rbp) movl $0, -4(%rbp) jmp .L2 .L3: movl -4(%rbp), %eax cltq leaq 0(,%rax,4), %rdx movq 16(%rbp), %rax addq %rdx, %rax movl (%rax), %eax addl %eax, -8(%rbp) addl $1, -4(%rbp) .L2: movl -4(%rbp), %eax cmpl 24(%rbp), %eax jl .L3 movl -8(%rbp), %eax cltd idivl 24(%rbp) addq $16, %rsp popq %rbp ret .seh_endproc .globl total .def total; .scl 2; .type 32; .endef .seh_proc total total: pushq %rbp .seh_pushreg %rbp movq %rsp, %rbp .seh_setframe %rbp, 0 subq $16, %rsp .seh_stackalloc 16 .seh_endprologue movq %rcx, 16(%rbp) movl %edx, 24(%rbp) movl $0, -8(%rbp) movl $0, -4(%rbp) jmp .L6 .L7: movl -4(%rbp), %eax cltq leaq 0(,%rax,4), %rdx movq 16(%rbp), %rax addq %rdx, %rax movl (%rax), %eax addl %eax, -8(%rbp) addl $1, -4(%rbp) .L6: movl -4(%rbp), %eax cmpl 24(%rbp), %eax jl .L7 movl -8(%rbp), %eax addq $16, %rsp popq %rbp ret .seh_endproc .globl precentage .def precentage; .scl 2; .type 32; .endef .seh_proc precentage precentage: pushq %rbp .seh_pushreg %rbp movq %rsp, %rbp .seh_setframe %rbp, 0 subq $16, %rsp .seh_stackalloc 16 .seh_endprologue movq %rcx, 16(%rbp) movl %edx, 24(%rbp) movl $0, -8(%rbp) movl $0, -4(%rbp) jmp .L10 .L11: movl -4(%rbp), %eax cltq leaq 0(,%rax,4), %rdx movq 16(%rbp), %rax addq %rdx, %rax movl (%rax), %eax addl %eax, -8(%rbp) addl $1, -4(%rbp) .L10: movl -4(%rbp), %eax cmpl 24(%rbp), %eax jl .L11 pxor %xmm0, %xmm0 cvtsi2ss -8(%rbp), %xmm0 movl 24(%rbp), %eax imull $100, %eax, %eax pxor %xmm1, %xmm1 cvtsi2ss %eax, %xmm1 divss %xmm1, %xmm0 movss .LC0(%rip), %xmm1 mulss %xmm1, %xmm0 addq $16, %rsp popq %rbp ret .seh_endproc .def __main; .scl 2; .type 32; .endef .section .rdata,"dr" .align 8 .LC1: .ascii "\12Enter marks of the five subjecs: \0" .LC2: .ascii "%d %d %d %d %d\0" .LC3: .ascii "\12Total = %d\12 \12\0" .LC4: .ascii "\12Average = %d \12 \12\0" .LC5: .ascii "\12Precentage = %.2f\12 \12\0" .LC6: .ascii "\12Enter valid value. \12 \0" .text .globl main .def main; .scl 2; .type 32; .endef .seh_proc main main: pushq %rbp .seh_pushreg %rbp movq %rsp, %rbp .seh_setframe %rbp, 0 subq $80, %rsp .seh_stackalloc 80 .seh_endprologue call __main leaq .LC1(%rip), %rcx call printf leaq -32(%rbp), %rax leaq 8(%rax), %r8 leaq -32(%rbp), %rax leaq 4(%rax), %rcx leaq -32(%rbp), %rax leaq -32(%rbp), %rdx addq $16, %rdx movq %rdx, 40(%rsp) leaq -32(%rbp), %rdx addq $12, %rdx movq %rdx, 32(%rsp) movq %r8, %r9 movq %rcx, %r8 movq %rax, %rdx leaq .LC2(%rip), %rcx call scanf movl -32(%rbp), %eax testl %eax, %eax js .L14 movl -28(%rbp), %eax testl %eax, %eax js .L14 movl -24(%rbp), %eax testl %eax, %eax js .L14 movl -20(%rbp), %eax testl %eax, %eax js .L14 movl -16(%rbp), %eax testl %eax, %eax js .L14 movl $5, -4(%rbp) movl -4(%rbp), %edx leaq -32(%rbp), %rax movq %rax, %rcx call total movl %eax, %edx leaq .LC3(%rip), %rcx call printf movl -4(%rbp), %edx leaq -32(%rbp), %rax movq %rax, %rcx call average movl %eax, %edx leaq .LC4(%rip), %rcx call printf movl -4(%rbp), %edx leaq -32(%rbp), %rax movq %rax, %rcx call precentage cvtss2sd %xmm0, %xmm0 movq %xmm0, %rax movq %rax, %rdx movq %rdx, %xmm1 movq %rax, %rdx leaq .LC5(%rip), %rcx call printf jmp .L15 .L14: leaq .LC6(%rip), %rcx call puts .L15: movl $0, %eax addq $80, %rsp popq %rbp ret .seh_endproc .section .rdata,"dr" .align 4 .LC0: .long 1120403456 .ident "GCC: (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 6.2.0" .def printf; .scl 2; .type 32; .endef .def scanf; .scl 2; .type 32; .endef .def puts; .scl 2; .type 32; .endef
17.813636
72
0.607043
ac61f4ec6bd99e3ca134ef86be45d45b45b7b5fd
3,071
asm
Assembly
ffight/lcs/enemy/5.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/enemy/5.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
ffight/lcs/enemy/5.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 022560 move.b #$2, ($5,A6) 022566 jsr $3bec.w [enemy+ 5] 0225D2 move.b #$2, ($5,A6) 0225D8 jsr $3bec.w [enemy+ 5] 02262C bra $22e4a [enemy+ 5] 022660 bra $22ea2 [enemy+ 5] 022C3A clr.b ($5,A6) [enemy+ 4] 022C3E addi.l #$1, ($8a,A6) 027342 clr.b ($5,A6) [enemy+ 4] 027346 bra $26f24 027358 clr.b ($5,A6) [enemy+ 4] 02735C bra $26f40 027388 clr.b ($5,A6) [enemy+ 4] 02738C bra $26ee6 0273DC clr.b ($5,A6) [enemy+ 4] 0273E0 bra $26ee6 027482 clr.b ($1e,A6) [enemy+ 5] 027506 move.l ($e,A6), ($a,A6) [enemy+ 5] 02756A move.b #$6, ($5,A6) [enemy+ A, enemy+ C] 027570 moveq #$0, D0 [enemy+ 5] 02782E clr.b ($1e,A6) [enemy+ 5] 0278B2 move.l ($e,A6), ($a,A6) [enemy+ 5] 027912 move.b #$6, ($5,A6) [enemy+ A, enemy+ C] 027918 moveq #$0, D0 [enemy+ 5] 027A54 clr.b ($5,A6) [enemy+ 4] 027A58 moveq #$1, D0 027A68 clr.b ($5,A6) [enemy+ 4] 027A6C moveq #$1, D0 0286D0 jsr $3bec.w [enemy+ 5] 02A8B0 move.b #$2, ($5,A6) 02A8B6 jsr $3bec.w [enemy+ 5] 02A922 move.b #$2, ($5,A6) 02A928 jsr $3bec.w [enemy+ 5] 02A97C bra $2b104 [enemy+ 5] 02AFA6 clr.b ($5,A6) [enemy+ 4] 02AFAA addi.l #$1, ($8a,A6) 035494 move.b #$a, ($1e,A6) [enemy+ 5] 0354FC move.b #$12, ($1e,A6) [enemy+ 5] 03553E jsr $3bec.w [enemy+ 5] 03557E move.b #$1e, ($1e,A6) [enemy+ 5] 035628 move.b #$12, ($1e,A6) [enemy+ 5] 035674 move.b #$1e, ($1e,A6) [enemy+ 5] 035692 move.b #$14, ($1e,A6) [enemy+ 5] 0356AA addq.b #2, ($5,A6) 0356AE move.b #$1, ($1e,A6) [enemy+ 5] 03582C jsr $3bec.w 0358EC rts 03590E clr.w ($a4,A6) [enemy+ 5] 03593C clr.b ($5,A6) [enemy+96, enemy+98] 035940 rts 035980 clr.w ($a4,A6) [enemy+ 5] 035BD6 rts [enemy+ 5] 035BE8 rts [enemy+ 5] 035C78 bra $36ec8 [enemy+ 5] 035C8C clr.b ($1e,A6) [enemy+ 5] 035D00 move.l ($e,A6), ($a,A6) [enemy+ 5] 035D5E move.l ($e,A6), ($a,A6) [enemy+ 5] 035DB0 move.b #$14, ($1e,A6) [enemy+ 5] 036074 clr.b ($5,A6) 036078 bra $36dd8 03624A clr.b ($5,A6) 03624E rts 0366B8 clr.b ($5,A6) [enemy+ 3] 0366BC rts 036C0E clr.b ($5,A6) 036C12 bra $36c42 036CA2 clr.b ($5,A6) 036CA6 rts 039058 move.w #$40, D1 [enemy+ 5] 0390F0 addq.b #2, ($4,A6) 0392A4 move.l ($a,A6), ($e,A6) [enemy+ 5] 0392F0 rts [enemy+ 5] 0396F0 clr.b ($5,A6) 0396F4 clr.b ($93,A6) 039780 bra $3adda [enemy+ 5] 039792 rts [enemy+ 5] 0397A4 rts [enemy+ 5] 0397D4 bra $3ade2 [enemy+ 5] 039858 bra $3adea [enemy+ 5] 03986C clr.b ($1e,A6) [enemy+ 5] 0398DC move.l ($e,A6), ($a,A6) [enemy+ 5] 039924 move.l ($e,A6), ($a,A6) [enemy+ 5] 039962 move.b #$14, ($1e,A6) [enemy+ 5] 039D66 clr.b ($5,A6) 039D6A move.b #$2, ($3,A6) 03A308 clr.b ($5,A6) 03A30C rts 03A3A2 clr.b ($5,A6) 03A3A6 rts 03A3D0 clr.b ($5,A6) 03A3D4 jmp $b82.w 03A450 clr.b ($5,A3) 03A454 moveq #$1, D0 03A4BC clr.b ($4,A6) copyright zengfr site:http://github.com/zengfr/romhack
31.020202
54
0.564637
f2d946310e5f05c6cc2966be598476a2c363efc3
411
asm
Assembly
non-destructive-payload64.asm
fiercebrute/d0zer
cd81a8e709ec649fba77372cdf05b08e2aa9ee91
[ "MIT" ]
137
2021-06-16T22:31:52.000Z
2022-02-19T19:25:40.000Z
non-destructive-payload64.asm
chennqqi/d0zer
cd81a8e709ec649fba77372cdf05b08e2aa9ee91
[ "MIT" ]
null
null
null
non-destructive-payload64.asm
chennqqi/d0zer
cd81a8e709ec649fba77372cdf05b08e2aa9ee91
[ "MIT" ]
29
2021-06-17T04:56:54.000Z
2022-02-11T11:42:53.000Z
global _start section .text _start: jmp message message: call shellcode db "hello -- this is a non destructive payload", 0xa shellcode: mov rax, 0x1 ;write system call mov rdi, 0x1 ;stdout fd pop rsi ;make rsi a ptr to message mov rdx, 0x2a ;message length syscall ;xor rdi, rdi ; 0 return status ;xor rax, rax ;mov al, 0x3c ; syscall for exit ;syscall
14.678571
53
0.642336
c933822588772531ebc144beb70f6b05baaad031
209
asm
Assembly
AntiVirtualMachine_driver/Anti_driver/cpuid.asm
wgwjifeng/DriverKit
7593a3f897d072a95b53a50342b713daf557521e
[ "MIT" ]
null
null
null
AntiVirtualMachine_driver/Anti_driver/cpuid.asm
wgwjifeng/DriverKit
7593a3f897d072a95b53a50342b713daf557521e
[ "MIT" ]
null
null
null
AntiVirtualMachine_driver/Anti_driver/cpuid.asm
wgwjifeng/DriverKit
7593a3f897d072a95b53a50342b713daf557521e
[ "MIT" ]
1
2020-12-10T19:00:52.000Z
2020-12-10T19:00:52.000Z
EXTERN a:DWORD; EXTERN b:DWORD; EXTERN c_var:DWORD; EXTERN d:DWORD; .CODE getcpuid PROC xor eax,eax mov eax,1h cpuid mov a,eax mov b,ebx mov c_var,ecx mov d,edx ret getcpuid ENDP END
12.294118
20
0.669856
91be76daa4e3a2984031ca9897ee0d56ef1c528c
519
nasm
Assembly
Microprocessor lab/Factorial/macro1.nasm
IamVaibhavsar/Second_Year_Lab_Assignments
dec3a0d4e71bc30820948d40d4e073b1d3e1da98
[ "MIT" ]
34
2020-02-09T08:42:49.000Z
2022-03-01T09:04:53.000Z
Microprocessor lab/Factorial/macro1.nasm
MXNXV/Second_Year_Lab_Assignments
dec3a0d4e71bc30820948d40d4e073b1d3e1da98
[ "MIT" ]
1
2020-10-16T15:41:43.000Z
2020-10-16T16:03:50.000Z
Microprocessor lab/Factorial/macro1.nasm
MXNXV/Second_Year_Lab_Assignments
dec3a0d4e71bc30820948d40d4e073b1d3e1da98
[ "MIT" ]
34
2020-01-07T08:47:42.000Z
2022-03-29T16:45:56.000Z
%macro fopen 1 mov rax,2 mov rdi,%1 mov rsi,2 mov rdx,0777o syscall %endmacro %macro fread 3 mov rax,0 mov rdi,%1 mov rsi,%2 mov rdx,%3 syscall %endmacro %macro fwrite 3 mov rax,1 mov rdi,%1 mov rsi,%2 mov rdx,%3 syscall %endmacro %macro fclose 1 mov rax,3 mov rdi,%1 syscall %endmacro %macro fdelete 1 mov rax,87 mov rdi,%1 syscall %endmacro %macro accept 2 mov rax,0 mov rdi,0 mov rsi,%1 mov rdx,%2 syscall %endmacro %macro disp 2 mov rax,1 mov rdi,1 mov rsi,%1 mov rdx,%2 syscall %endmacro
11.282609
16
0.691715
64278c8a90cdf044563d3c810f6485041ede2c1b
4,005
asm
Assembly
nasm/strings/findsubs.asm
codingneverends/assembly
dcac8cf841abd64d0a386105daf6c926ab2b124d
[ "MIT" ]
null
null
null
nasm/strings/findsubs.asm
codingneverends/assembly
dcac8cf841abd64d0a386105daf6c926ab2b124d
[ "MIT" ]
null
null
null
nasm/strings/findsubs.asm
codingneverends/assembly
dcac8cf841abd64d0a386105daf6c926ab2b124d
[ "MIT" ]
null
null
null
;Counting no of substrings section .data newline :db 10 space :db ' ' msg1 : db "Enter main String : " size1 : equ $-msg1 msg1_ : db "Enter sub String : " size1_ : equ $-msg1_ msg2 : db "No of presence sub string prent in main string is : " size2 : equ $-msg2 section .bss mainstring : resb 50 substring : resb 50 temp : resb 1 num : resw 1 count : resb 1 _temp : resb 1 len : resb 1 pos : resb 1 presence : resb 1 outeri : resb 1 imax : resb 1 loopi : resb 1 tempval : resb 1 section .text global _start _start : mov eax, 4 mov ebx, 1 mov ecx, msg1 mov edx, size1 int 80h mov ebx,mainstring call readstring mov eax, 4 mov ebx, 1 mov ecx, msg1_ mov edx, size1_ int 80h mov ebx,substring call readstring mov ebx,mainstring call strlen mov dl,byte[len] mov byte[imax],dl mov ebx,substring call strlen mov al,byte[len] dec al mov dl,byte[imax] add dl,al mov byte[imax],dl mov byte[presence],0 mov ebx,mainstring mov eax,0 mov byte[loopi],0 for : mov dl,byte[loopi] cmp dl,byte[imax] jnb endFor mov dl,byte[ebx+eax] cmp dl,0 je endFor push ebx push eax mov ebx,substring innerFor : mov dl,byte[ebx] cmp dl,0 je addendinnerFor mov byte[tempval],dl push ebx mov ebx,mainstring mov dl,byte[ebx+eax] pop ebx inc ebx inc eax cmp dl,byte[tempval] jne endinnerFor jmp innerFor addendinnerFor : inc byte[presence] endinnerFor : pop eax pop ebx inc eax inc byte[loopi] jmp for endFor : mov eax, 4 mov ebx, 1 mov ecx, msg2 mov edx, size2 int 80h mov dl,byte[presence] movzx ax,dl mov word[num],ax call print_num mov eax, 1 mov ebx, 0 int 80h readstring : start_readstring : push ebx mov eax, 3 mov ebx, 0 mov ecx, temp mov edx, 1 int 80h pop ebx cmp byte[temp],10 je end_readstring mov al,byte[temp] mov byte[ebx],al inc ebx jmp start_readstring end_readstring: mov byte[ebx],0 ret printstring : start_printstring : mov dl,byte[ebx] mov byte[temp],dl cmp byte[temp],0 je end_printstring push ebx mov eax,4 mov ebx,1 mov ecx,temp mov edx,1 int 80h pop ebx inc ebx jmp start_printstring end_printstring : mov eax, 4 mov ebx, 1 mov ecx, newline mov edx, 1 int 80h ret strlen : mov byte[len],0 start_strlen : mov dl,byte[ebx] mov byte[temp],dl cmp byte[temp],0 je end_strlen inc byte[len] inc ebx jmp start_strlen end_strlen : ret print_num: mov byte[count],0 cmp word[num],0 jne skip___ mov word[temp],30h mov eax, 4 mov ebx, 1 mov ecx, temp mov edx, 1 int 80h skip___ : extract_no : cmp word[num], 0 je print_no inc byte[count] mov dx, 0 mov ax, word[num] mov bx, 10 div bx push dx mov word[num], ax jmp extract_no print_no : cmp byte[count], 0 je end_print dec byte[count] pop dx mov byte[temp], dl add byte[temp], 30h mov eax, 4 mov ebx, 1 mov ecx, temp mov edx, 1 int 80h jmp print_no end_print : mov eax,4 mov ebx,1 mov ecx,newline mov edx,1 int 80h ret
19.254808
69
0.505368
38e2192df0fe8c45d87dc619bab1b09cd52ab984
46,247
asm
Assembly
DeadCScroll.asm
ISSOtm/DeadCScroll
bd759dfae9d5b3223dcc95b0990a0622e349d9f2
[ "Unlicense" ]
1
2021-10-14T19:26:35.000Z
2021-10-14T19:26:35.000Z
DeadCScroll.asm
gb-archive/DeadCScroll
bd759dfae9d5b3223dcc95b0990a0622e349d9f2
[ "Unlicense" ]
null
null
null
DeadCScroll.asm
gb-archive/DeadCScroll
bd759dfae9d5b3223dcc95b0990a0622e349d9f2
[ "Unlicense" ]
2
2021-09-18T09:19:49.000Z
2021-11-12T13:24:58.000Z
INCLUDE "hardware.inc" ;============================================================== ; rst handlers as routines ;============================================================== CALL_HL EQU $30 RST_38 EQU $38 ;============================================================== ; structs ;============================================================== ; each scanline gets some data, structured like so: RSRESET RASTER_SCRY RB 1 ; data for rSCY RASTER_SCRX RB 1 ; data for rSCX sizeof_RASTER RB 0 sizeof_RASTER_TABLE EQU ((SCRN_Y+1)*sizeof_RASTER) ; the +1 is because data is needed to display raster 0 ; (think of it as an HBlank handler happening on raster '-1' ROLL_SIZE EQU 32 ;============================================================== ; macros ;============================================================== ; breakpoint (halt the debugger) BREAKPOINT: MACRO ld b,b ENDM ;-------------------------------------------------------------- ; display a log message LOGMESSAGE: MACRO ld d,d jr .end\@ DW $6464 DW $0000 DB \1 .end\@: ENDM ;-------------------------------------------------------------- ; wait for the start of the next vblank WaitVBlankStart: MACRO .waitvbl\@ ldh a,[rLY] cp SCRN_Y jr nz,.waitvbl\@ ENDM ;-------------------------------------------------------------- SwapBuffers: MACRO ASSERT(LOW(wRasterTableA) == LOW(wRasterTableB)) ; the README uses hardcoded addresses, but any two aligned addresses work ldh a,[hFillBuffer] ldh [hDrawBuffer],a xor HIGH(wRasterTableA) ^ HIGH(wRasterTableB) ldh [hFillBuffer],a ENDM ;-------------------------------------------------------------- ; set the change tutorial part flag SetChangePartFlag: MACRO ld a,1 ld [wChangePart],a ENDM ;-------------------------------------------------------------- ; SetProcessFunc <funcptr> SetProcessFunc: MACRO ld hl,wProcessFunc ld bc,\1 ld a,c ld [hl+],a ld [hl],b ENDM ;============================================================== ; RST handlers ;============================================================== SECTION "RST $30",ROM0[CALL_HL] ; call the function pointed to by hl CallHL:: jp hl ; ------------------------------------------------------------- SECTION "RST $38",ROM0[RST_38] Rst_38:: BREAKPOINT ret ;============================================================== ; interrupt handlers ;============================================================== SECTION "VBlank Handler",ROM0[$40] VBlankHandler:: push af ld a,1 ld [wVBlankDone],a jr VBlankContinued ; ------------------------------------------------------------- SECTION "HBlank Handler",ROM0[$48] HBlankHandler:: ; 40 cycles push af ; 4 push hl ; 4 ;------------------------------- ; obtain the pointer to the data pair ldh a,[rLY] ; 3 inc a ; 1 add a,a ; 1 ; double the offset since each line uses 2 bytes ld l,a ; 1 ldh a,[hDrawBuffer] ; 3 adc 0 ; 2 ld h,a ; 1 ; hl now points to somewhere in the draw buffer ; set the scroll registers ld a,[hl+] ; 2 ldh [rSCY],a ; 3 ld a,[hl+] ; 2 ldh [rSCX],a ; 3 pop hl ; 3 pop af ; 3 reti ; 4 ; ------------------------------------------------------------- VBlankContinued:: pop af pop af ; remove WaitForVBlankInt's ret from the stack to avoid a race condition reti ;============================================================== ; cartridge header ;============================================================== SECTION "ROM Header",ROM0[$100] ROMHeader:: nop jp Start NINTENDO_LOGO DB "DeadCScroll" ; game title DB "BObj" ; product code DB CART_COMPATIBLE_DMG DW $00 ; license code DB CART_INDICATOR_GB DB CART_ROM_MBC5 DB CART_ROM_32K DB CART_SRAM_NONE DB CART_DEST_NON_JAPANESE DB $33 ; licensee code DB $00 ; mask ROM version DB $00 ; complement check DW $00 ; cartridge checksum ;============================================================== ; starting point ;============================================================== SECTION "Start",ROM0[$150] Start:: call Initialize mainloop: ; call the process function and handle any part transition ld hl,wProcessFunc ld a,[hl+] ld h,[hl] ld l,a rst CALL_HL call ProcessPartTransition ; change parts (if necessary) ;-------------------------------------- call WaitForVBlankDone ; clear the vblank done flag xor a ld [wVBlankDone],a ;-------------------------------------- SwapBuffers call PrepRaster0 ;-------------------------------------- ; update the frame counter ld hl,wFrameCounter inc [hl] jr mainloop ;============================================================== ; support routines (bank 0) ;============================================================== SECTION "WaitForVBlank",ROM0 ; wait for the vblank handler to set the flag ; done as a routine instead of a macro to avoid a halt race condition WaitForVBlankDone:: .waitloop: halt ld a,[wVBlankDone] and a jr z,.waitloop ret ; ------------------------------------------------------------- SECTION "PrepRaster0",ROM0 ; emulate the HBlank handler as if LY=-1 (to render the 0th scanline's worth of pixels correctly) PrepRaster0:: ldh a,[hDrawBuffer] ld h,a ld l,0 ; set the scroll registers ld a,[hl+] ldh [rSCY],a ld a,[hl+] ldh [rSCX],a ret ; ------------------------------------------------------------- SECTION "Tutorial Driver",ROM0 ProcessPartTransition:: ; see if the transition flag is set ld a,[wChangePart] and a ret z ; not set, exit early ; clear the flag xor a ld [wChangePart],a ; put the actual pointer in hl ld hl,wTutePartPtr ld a,[hl+] ld h,[hl] ld l,a ; put the init function pointer in de ld a,[hl+] ld e,a ld a,[hl+] ld d,a push de ; 'jp de' prep (see the ret below) ; update the ptr for the next transition ld d,h ld e,l ld hl,wTutePartPtr ld a,e ld [hl+],a ld [hl],d ; reset the frame counter so each part starts at 0 xor a ld hl,wFrameCounter ld [hl],a ; the ret here actually calls the init function because of the push earlier ; i.e. simulate 'jp de' ret TutePartInitFuncTable: DW InitShowDelay DW InitXSine DW InitShowDelay DW InitYSine DW InitShowDelay DW InitXYSine DW InitShowDelay DW InitSmearOff DW InitLightDelay DW InitSmearOn DW InitShowDelay DW InitRollOff DW InitDarkDelay DW InitRollOn DW InitRestart ; ------------------------------------------------------------- SECTION "Part - X Sine",ROM0 InitXSine: LOGMESSAGE "InitXSine" ; set the progression line to the first raster ld hl,wProgressLine ld a,SCRN_Y ld [hl],a ; set the data pointer (technically an offset) to the end of a raster buffer ; the pointer will be resolved later ld hl,sizeof_RASTER_TABLE-sizeof_RASTER ld a,l ld [wDataPtr],a ld a,h ld [wDataPtr+1],a ; start with subpart 0 ld hl,wFlags xor a ld [hl+],a ; hl = wCounter ; set the counter to 0 ld [hl],a SetProcessFunc ProcessXSine ret ProcessXSine: ; check the flags ld hl,wFlags ld a,[hl] and a jr z,.subpart0 dec a jr z,.subpart1 ; ending (diminish the sine up the screen) .subpart2 call UpdateXSine2 ; update the table index ld hl,wTableIndex inc [hl] ld hl,wProgressLine ld a,[hl] dec a jr z,.subpart2done ld [hl],a ret .subpart2done SetChangePartFlag ret ; middle (watch the sine for a bit) .subpart1 call UpdateXSine1 ; update the table index ld hl,wTableIndex inc [hl] ret ; beginning (progress the sine up the screen) .subpart0 call UpdateXSine0 ld hl,wProgressLine ld a,[hl] dec a cp $FF jr z,.subpart0done ld [hl],a ret .subpart0done ; move to the next subpart ld hl,wFlags inc [hl] ; reset the timer ld hl,wFrameCounter xor a ld [hl],a ; start the sine from 0 ld hl,wTableIndex ld [hl],a ret UpdateXSine0: ld hl,wProgressLine ld a,[hl] cpl add SCRN_Y+2 ld e,a ; e=num iterations ; obtain a pointer into the fill buffer ld hl,wDataPtr ld a,[hl+] ld c,a ld b,[hl] ldh a,[hFillBuffer] ld h,a ld l,0 add hl,bc ; set up loop constants ld bc,XSineTable .loop ; store y value ld a,ROLL_SIZE ld [hl+],a ; store x value ld a,[bc] inc c ld [hl+],a ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; update the data pointer for next time ld hl,wDataPtr ld a,[hl+] ld h,[hl] ld l,a ; assume that sizeof_RASTER is 2, alas dec hl dec hl ; store the new pointer ld a,l ld [wDataPtr],a ld a,h ld [wDataPtr+1],a ret ; just a straight sine table lookup and fill the entire buffer ; (use this one if you don't need a progression effect like sub-part 0/2) UpdateXSine1: ld hl,wTableIndex ld a,[hl] ld c,a ld b,HIGH(XSineTable) ldh a,[hFillBuffer] ld h,a ld l,0 ld e,SCRN_Y+1 .loop ; store y value ld a,ROLL_SIZE ld [hl+],a ; store x value ld a,[bc] inc c ld [hl+],a ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; see if the last raster was 0 ; if it was update a counter ; when the counter reaches 3, move to the next subpart ld a,c and a ret nz ld hl,wCounter ld a,[hl] inc a cp 3 jr z,.subpart1done ld [hl],a ret .subpart1done ; move to the next subpart ld hl,wFlags inc [hl] ; reset the progress line to the bottom of the screen ld hl,wProgressLine ld a,SCRN_Y ld [hl],a ret UpdateXSine2: ld hl,wProgressLine ld a,[hl] ld e,a ld hl,wTableIndex ld a,[hl] ld c,a ld b,HIGH(XSineTable) ldh a,[hFillBuffer] ld h,a ld l,0 .loop ; store y value ld a,ROLL_SIZE ld [hl+],a ; store x value ld a,[bc] inc c ld [hl+],a ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; below (or equal) the line ; only two lines need to be cleared ld bc,(ROLL_SIZE<<8) ld a,b ld [hl+],a ld a,c ld [hl+],a ld a,b ld [hl+],a ld a,c ld [hl+],a ret ; ------------------------------------------------------------- SECTION "Part - Y Sine",ROM0 InitYSine: LOGMESSAGE "InitYSine" ; set the progression line to the last raster ld hl,wProgressLine ld a,SCRN_Y ld [hl],a ; set the data pointer (technically an offset) to the end of a raster buffer ; the pointer will be resolved later ld hl,sizeof_RASTER_TABLE-sizeof_RASTER ld a,l ld [wDataPtr],a ld a,h ld [wDataPtr+1],a ; start with subpart 0 ld hl,wFlags xor a ld [hl+],a ; hl = wCounter ; set the counter to 0 ld [hl],a SetProcessFunc ProcessYSine ret ProcessYSine: ; check the flags ld hl,wFlags ld a,[hl] and a jr z,.subpart0 dec a jr z,.subpart1 ; ending (diminish the sine up the screen) .subpart2 call UpdateYSine2 ; update the table index ld hl,wTableIndex inc [hl] ld hl,wProgressLine ld a,[hl] dec a jr z,.subpart2done ld [hl],a ret .subpart2done SetChangePartFlag ret ; middle (watch the sine for a bit) .subpart1 call UpdateYSine1 ; update the table index ld hl,wTableIndex inc [hl] ret ; beginning (progress the sine up the screen) .subpart0 call UpdateYSine0 ld hl,wProgressLine ld a,[hl] dec a cp $FF jr z,.subpart0done ld [hl],a ret .subpart0done ; move to the next subpart ld hl,wFlags inc [hl] ; reset the timer ld hl,wFrameCounter xor a ld [hl],a ; start the sine from 0 ld hl,wTableIndex ld [hl],a ret UpdateYSine0: ld hl,wProgressLine ld a,[hl] cpl add SCRN_Y+2 ld e,a ; e=num iterations ; obtain a pointer into the fill buffer ld hl,wDataPtr ld a,[hl+] ld c,a ld b,[hl] ldh a,[hFillBuffer] ld h,a ld l,0 add hl,bc ; set up loop constants ld bc,YSineTable .loop ; store y value ld a,[bc] inc c add ROLL_SIZE ld [hl+],a ; store x value xor a ld [hl+],a ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; update the data pointer for next time ld hl,wDataPtr ld a,[hl+] ld h,[hl] ld l,a ; assume that sizeof_RASTER is 2, alas dec hl dec hl ; store the new pointer ld a,l ld [wDataPtr],a ld a,h ld [wDataPtr+1],a ret ; just a straight sine table lookup and fill the entire buffer ; (use this one if you don't need a progression effect like sub-part 0/2) UpdateYSine1: ld hl,wTableIndex ld a,[hl] ld c,a ld b,HIGH(YSineTable) ldh a,[hFillBuffer] ld h,a ld l,0 ld e,SCRN_Y+1 .loop ; store y value ld a,[bc] inc c add ROLL_SIZE ld [hl+],a ; store x value xor a ld [hl+],a ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; see if the last raster was 0 ; if it was update a counter ; when the counter reaches 2, move to the next subpart ld a,c and a ret nz ld hl,wCounter ld a,[hl] inc a cp 2 jr z,.subpart1done ld [hl],a ret .subpart1done ; move to the next subpart ld hl,wFlags inc [hl] ; reset the progress line to the bottom of the screen ld hl,wProgressLine ld a,SCRN_Y ld [hl],a ret UpdateYSine2: ld hl,wProgressLine ld a,[hl] ld e,a ld hl,wTableIndex ld a,[hl] ld c,a ld b,HIGH(YSineTable) ldh a,[hFillBuffer] ld h,a ld l,0 .loop ; store y value ld a,[bc] inc c add ROLL_SIZE ld [hl+],a ; store x value xor a ld [hl+],a ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; below (or equal) the line ; only two lines need to be cleared ld bc,(ROLL_SIZE<<8) ld a,b ld [hl+],a ld a,c ld [hl+],a ld a,b ld [hl+],a ld a,c ld [hl+],a ret ; ------------------------------------------------------------- SECTION "Part - XY Sine",ROM0 InitXYSine: LOGMESSAGE "InitXYSine" ; set the progression line to the first raster ld hl,wProgressLine ld a,SCRN_Y ld [hl],a ; set the data pointer (technically an offset) to the end of a raster buffer ; the pointer will be resolved later ld hl,sizeof_RASTER_TABLE-sizeof_RASTER ld a,l ld [wDataPtr],a ld a,h ld [wDataPtr+1],a ; start with subpart 0 ld hl,wFlags xor a ld [hl+],a ; hl = wCounter ; set the counter to 0 ld [hl],a SetProcessFunc ProcessXYSine ret ProcessXYSine: ; check the flags ld hl,wFlags ld a,[hl] and a jr z,.subpart0 dec a jr z,.subpart1 ; ending (diminish the sine up the screen) .subpart2 call UpdateXYSine2 ; update the table index ld hl,wTableIndex inc [hl] ld hl,wProgressLine ld a,[hl] dec a jr z,.subpart2done ld [hl],a ret .subpart2done SetChangePartFlag ret ; middle (watch the sine for a bit) .subpart1 call UpdateXYSine1 ; update the table index ld hl,wTableIndex inc [hl] ret ; beginning (progress the sine up the screen) .subpart0 call UpdateXYSine0 ld hl,wProgressLine ld a,[hl] dec a cp $FF jr z,.subpart0done ld [hl],a ret .subpart0done ; move to the next subpart ld hl,wFlags inc [hl] ; reset the timer ld hl,wFrameCounter xor a ld [hl],a ; start the sine from 0 ld hl,wTableIndex ld [hl],a ret UpdateXYSine0: ld hl,wProgressLine ld a,[hl] cpl add SCRN_Y+2 ld e,a ; e=num iterations ; obtain a pointer into the fill buffer ld hl,wDataPtr ld a,[hl+] ld c,a ld b,[hl] ldh a,[hFillBuffer] ld h,a ld l,0 add hl,bc ; set up loop constants ld c,0 .loop ; store y value ld b,HIGH(YSineTable) ld a,[bc] add ROLL_SIZE ld [hl+],a ; store x value ld b,HIGH(XSineTable) ld a,[bc] ld [hl+],a inc c ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; update the data pointer for next time ld hl,wDataPtr ld a,[hl+] ld h,[hl] ld l,a ; assume that sizeof_RASTER is 2, alas dec hl dec hl ; store the new pointer ld a,l ld [wDataPtr],a ld a,h ld [wDataPtr+1],a ret ; just a straight sine table lookup and fill the entire buffer ; (use this one if you don't need a progression effect like sub-part 0/2) UpdateXYSine1: ld hl,wTableIndex ld a,[hl] ld c,a ldh a,[hFillBuffer] ld h,a ld l,0 ld e,SCRN_Y+1 .loop ; store y value ld b,HIGH(YSineTable) ld a,[bc] add ROLL_SIZE ld [hl+],a ; store x value ld b,HIGH(XSineTable) ld a,[bc] ld [hl+],a inc c ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; see if the last raster was 0 ; if it was update a counter ; when the counter reaches 3, move to the next subpart ld a,c and a ret nz ld hl,wCounter ld a,[hl] inc a cp 3 jr z,.subpart1done ld [hl],a ret .subpart1done ; move to the next subpart ld hl,wFlags inc [hl] ; reset the progress line to the bottom of the screen ld hl,wProgressLine ld a,SCRN_Y ld [hl],a ret UpdateXYSine2: ld hl,wProgressLine ld a,[hl] ld e,a ld hl,wTableIndex ld a,[hl] ld c,a ldh a,[hFillBuffer] ld h,a ld l,0 .loop ; store y value ld b,HIGH(YSineTable) ld a,[bc] add ROLL_SIZE ld [hl+],a ; store x value ld b,HIGH(XSineTable) ld a,[bc] ld [hl+],a inc c ; loop delimiter (stop at the bottom of the screen) dec e jr nz,.loop ; below (or equal) the line ; only two lines need to be cleared ld bc,(ROLL_SIZE<<8) ld a,b ld [hl+],a ld a,c ld [hl+],a ld a,b ld [hl+],a ld a,c ld [hl+],a ret ; ------------------------------------------------------------- SECTION "Part - Smear On",ROM0 ; smear on (bottom to top) InitSmearOn: LOGMESSAGE "InitSmearOn" ; set the progression line to the last raster ld hl,wProgressLine ld a,SCRN_Y ld [hl],a SetProcessFunc ProcessSmearOn ret ProcessSmearOn: ld hl,wProgressLine ld a,[hl] dec a jr z,.done ld [hl],a call UpdateSmear ret .done SetChangePartFlag ret ; ------------------------------------------------------------- SECTION "Part - Smear Off",ROM0 ; smear off (top to bottom) InitSmearOff: LOGMESSAGE "InitSmearOff" ; set the progression line to the first raster ld hl,wProgressLine xor a ld [hl],a SetProcessFunc ProcessSmearOff ret ProcessSmearOff: ld hl,wProgressLine ld a,[hl] inc a cp SCRN_Y jr z,.done ld [hl],a call UpdateSmear ret .done SetChangePartFlag ret ; a = wProgressLine UpdateSmear: ; only y data is updated here ; from the top of the screen to wProgressLine, set the value to wProgressLine ; below wProgressLine is 0 ld e,a ; copy wProgressLine ldh a,[hFillBuffer] ld h,a ld l,0 ; above the line ld c,l ld b,e ; b = wProgressLine, c = scroll x ld d,c .loop ld a,b add ROLL_SIZE ld [hl+],a ; store scroll y value ld a,c ld [hl+],a ; store scroll x value dec b inc d ld a,d cp e jr nz,.loop ; below (or equal) the line ; only two lines need to be cleared ld bc,(ROLL_SIZE<<8) ld a,b ld [hl+],a ld a,c ld [hl+],a ld a,b ld [hl+],a ld a,c ld [hl+],a ret ; ------------------------------------------------------------- SECTION "Part - Roll Off",ROM0 ; roll off (bottom to top) InitRollOff: LOGMESSAGE "InitRollOff" ; set the progression line to the last raster ld hl,wProgressLine ld a,SCRN_Y+ROLL_SIZE ld [hl],a ; set the data pointer (technically an offset) to the end of a raster buffer ; the pointer will be resolved later ld hl,sizeof_RASTER_TABLE-sizeof_RASTER ld a,l ld [wDataPtr],a ld a,h ld [wDataPtr+1],a SetProcessFunc ProcessRollOff ret ProcessRollOff: ld hl,wProgressLine ld a,[hl] dec a jr z,.done ld [hl],a call UpdateRollOff ret .done SetChangePartFlag ret ; a=wProgressLine UpdateRollOff: ld b,a ; b=progress line ; obtain a pointer into the fill buffer ld hl,wDataPtr ld a,[hl+] ld e,a ld d,[hl] ldh a,[hFillBuffer] ld h,a ld l,0 add hl,de ; for the height of the roll, use the table as a displacement from the current raster ld c,ROLL_SIZE ld de,RollTable .rollloop ; don't update if the current progress line is off-screen (above raster 0) ld a,b cp ROLL_SIZE jr c,.skipstore ; store y value ld a,[de] add ROLL_SIZE ld [hl+],a ; store x value (always 0) xor a ld [hl+],a .skipstore inc de ; prevent going off the end of the buffer inc b ld a,b cp SCRN_Y+ROLL_SIZE jr z,.updatedataptr ; loop delimiter dec c jr nz,.rollloop ; below (or equal) the line ld c,b ld a,b sub ROLL_SIZE ld b,a ld de,SCRN_Y+12+ROLL_SIZE ld a,e sub b ld e,a .clearloop ld a,e ld [hl+],a ld a,d ld [hl+],a dec e inc c ld a,c cp SCRN_Y+ROLL_SIZE jr nz,.clearloop .updatedataptr ; update the data pointer for next time ld hl,wDataPtr ld a,[hl+] ld h,[hl] ld l,a ; prevent a buffer underrun or h ret z ; assume that sizeof_RASTER is 2, alas dec hl dec hl ; store the new pointer ld a,l ld [wDataPtr],a ld a,h ld [wDataPtr+1],a ret ; ------------------------------------------------------------- SECTION "Part - Roll On",ROM0 ; roll on (top to bottom) InitRollOn: LOGMESSAGE "InitRollOn" ; set the progression line to the first raster ld hl,wProgressLine xor a ld [hl],a SetProcessFunc ProcessRollOn ret ProcessRollOn: ld hl,wProgressLine ld a,[hl] inc a cp SCRN_Y+ROLL_SIZE jr z,.done ld [hl],a call UpdateRollOn ret .done SetChangePartFlag ret ; a=wProgressLine UpdateRollOn: ld b,a ; b=progress line ldh a,[hFillBuffer] ld h,a xor a ld l,a ld a,b cp ROLL_SIZE jr z,.doroll jr nc,.dofill jr .doroll ; fill the buffer with $3200 up to the progress line .dofill ld a,b sub ROLL_SIZE ld c,a ld de,(ROLL_SIZE<<8) ; y=32, x=0 .zeroloop ld a,d ld [hl+],a ld a,e ld [hl+],a dec c jr nz,.zeroloop .doroll ; for the height of the roll, use the table as a displacement from the current raster ld c,ROLL_SIZE ld de,RollTable .rollloop cp ROLL_SIZE jr nc,.dostore jr z,.dostore jr .loopend .dostore ; store y value ld a,[de] add ROLL_SIZE ld [hl+],a ; store x value (always 0) xor a ld [hl+],a .loopend inc de ; prevent going off the end of the buffer inc b ld a,b cp SCRN_Y+ROLL_SIZE ret z ; loop delimiter dec c jr nz,.rollloop ret ; ------------------------------------------------------------- SECTION "Part - Show Delay",ROM0 InitShowDelay: LOGMESSAGE "InitShowDelay" ; clear the raster tables to 0,0 for every raster ld hl,wRasterTableA ld b,SCRN_Y+1 call BlankScreenMem ld hl,wRasterTableB ld b,SCRN_Y+1 call BlankScreenMem SetProcessFunc ProcessDelay ret ; 'clear' memory so the normal screen is positioned correctly ; (it starts 4 tiles down instead of at 0,0) BlankScreenMem: ld de,(ROLL_SIZE<<8) ; y=32, x=0 .loop ld a,d ld [hl+],a ld a,e ld [hl+],a dec b jr nz,.loop ret ; ------------------------------------------------------------- SECTION "Part - Light Delay",ROM0 InitLightDelay: LOGMESSAGE "InitLightDelay" ; clear the raster tables to offscreen for every raster ld hl,wRasterTableA ld b,SCRN_Y+1 ld de,SCRN_Y+4+ROLL_SIZE call InitBlankRasterBuffer ld hl,wRasterTableB ld b,SCRN_Y+1 ld de,SCRN_Y+4+ROLL_SIZE call InitBlankRasterBuffer SetProcessFunc ProcessDelay ret ; ------------------------------------------------------------- SECTION "Part - Dark Delay",ROM0 InitDarkDelay: LOGMESSAGE "InitDarkDelay" ; clear the raster tables to offscreen for every raster ld hl,wRasterTableA ld b,SCRN_Y+1 ld de,SCRN_Y+12+ROLL_SIZE call InitBlankRasterBuffer ld hl,wRasterTableB ld b,SCRN_Y+1 ld de,SCRN_Y+12+ROLL_SIZE call InitBlankRasterBuffer SetProcessFunc ProcessDelay ret ProcessDelay: ld hl,wFrameCounter ld a,[hl] cp 150 ; ~2.5 seconds ret nz SetChangePartFlag ret ; b = num buffer entry (pairs) to set ; d = x value (always 0) ; e = y value InitBlankRasterBuffer: .loop ld a,e ld [hl+],a ld a,d ld [hl+],a dec e ; offset by LY dec b jr nz,.loop ret ; ------------------------------------------------------------- SECTION "Part - Restart",ROM0 InitRestart: LOGMESSAGE "InitRestart" SetProcessFunc ProcessRestart ret ProcessRestart: call InitFirstPart ret ;============================================================== ; support routines (bank 2) ;============================================================== SECTION "Bank 1 Routines",ROMX,BANK[1] Initialize: di ;-------------------------------------- ; turn off the screen after entering a vblank WaitVBlankStart ; clear LCD control registers and disable audio xor a ldh [rLCDC],a ldh [rIE],a ldh [rIF],a ldh [rSTAT],a ldh [rAUDENA],a ; disable the audio ;-------------------------------------- ; initialize the window position to 255,255 dec a ldh [rWY],a ldh [rWX],a ;-------------------------------------- ; set the bg palette ld a,$E4 ldh [rBGP],a ;-------------------------------------- ; copy the tile map to vram ld de,BGTileMap ; source ld hl,_SCRN0+(ROLL_SIZE*4) ; dest ld bc,(BGTileMapEnd - BGTileMap) ; num bytes call CopyMem ;-------------------------------------- ; copy the bg tiles to vram ld de,BGTiles ; source ld hl,_VRAM8000 ; dest ld bc,(BGTilesEnd - BGTiles) ; num bytes call CopyMem ;-------------------------------------- ; set up the initial state call InitVariables call InitFirstPart ;-------------------------------------- ; turn on the display ld a,LCDCF_ON|LCDCF_BG8000|LCDCF_BG9800|LCDCF_OBJOFF|LCDCF_BGON ldh [rLCDC],a WaitVBlankStart ;------------------------------- ; set up the lcdc int ld a,STATF_MODE00 ldh [rSTAT],a ;-------------------------------------- ; enable the interrupts ld a,IEF_VBLANK|IEF_LCDC ldh [rIE],a xor a ei ldh [rIF],a ret ;-------------------------------------------------------------- ; copy bc bytes from de to hl CopyMem: .loop ld a,[de] ld [hl+],a inc de dec bc ld a,b or c jr nz,.loop ret ;-------------------------------------------------------------- InitVariables: ld hl,wVBlankDone xor a ld [hl+],a ; wVBlankDone ld [hl+],a ; wFrameCounter ld [hl+],a ; wChangePart ; set up the double-buffering system ld a,HIGH(wRasterTableA) ldh [hDrawBuffer],a xor $02 ldh [hFillBuffer],a ; hDrawBuffer=wRasterTableA ; hFillBuffer=wRasterTableB ret ;-------------------------------------------------------------- InitFirstPart: ; init the part pointer to the start of the table ld de,TutePartInitFuncTable ld hl,wTutePartPtr ld a,e ld [hl+],a ld [hl],d ; prep the first part SetChangePartFlag call ProcessPartTransition call PrepRaster0 ret ;============================================================== ; work ram ;============================================================== SECTION "Raster Table A",WRAM0[$C000] wRasterTableA:: DS sizeof_RASTER_TABLE SECTION "Raster Table B",WRAM0[$C200] wRasterTableB:: DS sizeof_RASTER_TABLE SECTION "Tutorial Part Variables",WRAM0,ALIGN[3] wProcessFunc:: DS 2 ; pointer to a function to call towards the start of a frame wTutePartPtr:: DS 2 ; pointer in TutorialPartInitFuncTable for the next part SECTION "Variables",WRAM0 wVBlankDone: DS 1 wFrameCounter: DS 1 ; a simple frame counter wChangePart: DS 1 wTableIndex: DS 1 ; general-purpose index into a table wProgressLine: DS 1 ; current raster used as a progressive scan wFlags: DS 1 ; a holder of misc flags/data for part's use wCounter: DS 1 ; general-purpose counter for part's use wDataPtr: DS 2 ; (part use) pointer to somewhere in wRasterTableA/wRasterTableB ;============================================================== ; high ram ;============================================================== SECTION "HRAM Variables",HRAM ; buffer offsets (put in h, l=00) ; $C0 = Table A / $C2 = Table B hDrawBuffer:: DS 1 ; the buffer currently being drawn (the inverse of hFillBuffer) hFillBuffer:: DS 1 ; the buffer currently being filled (the inverse of hDrawBuffer) ;============================================================== ; bank 1 data (put down here so it's out of the way) ;============================================================== SECTION "Bank 1 Data",ROMX,BANK[1] BGTileMap: DB $00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$00,$00,$02,$03,$00,$00,$00,$00,$04,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $05,$06,$07,$07,$08,$09,$0a,$07,$07,$07,$0b,$0c,$0d,$09,$0a,$07,$07,$08,$0e,$0f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$10,$11,$11,$12,$13,$14,$15,$16,$11,$17,$18,$19,$13,$14,$11,$11,$12,$13,$1a,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1b,$1c,$00,$00,$1d,$00,$1e,$1f,$00,$20,$1d,$21,$1d,$00,$1c,$22,$23,$1d,$1a,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $02,$24,$1d,$00,$00,$1d,$00,$25,$26,$27,$28,$1d,$29,$1d,$2a,$1d,$2b,$2c,$1d,$1a,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1b,$1d,$2d,$2e,$2f,$30,$31,$32,$33,$34,$1d,$35,$1d,$29,$1d,$2d,$2e,$2f,$1a,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1b,$1d,$36,$37,$38,$39,$3a,$3a,$3a,$3b,$3c,$3d,$3e,$3f,$1d,$36,$37,$38,$40,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$1b,$37,$38,$41,$00,$00,$42,$43,$44,$45,$46,$47,$48,$49,$37,$4a,$4b,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$4c,$4d,$30,$4e,$00,$4f,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$5a,$02,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$5b,$5c,$00,$5d,$1d,$5e,$31,$5f,$60,$61,$1d,$1d,$62,$00,$63,$64,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$65,$66,$00,$67,$5d,$68,$69,$6a,$1d,$1d,$1d,$6b,$6c,$6d,$6e,$1f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$01,$00,$6f,$70,$00,$00,$71,$72,$73,$63,$1d,$1d,$1d,$74,$75,$73,$25,$76,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$77,$00,$00,$00,$78,$79,$00,$7a,$7b,$7c,$1d,$7d,$7e,$31,$76,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $7f,$80,$7f,$80,$77,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$1d,$8d,$20,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $8e,$8f,$8e,$8f,$90,$91,$92,$93,$94,$95,$96,$97,$98,$1d,$1d,$99,$9a,$1d,$9b,$8f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $9c,$9d,$9c,$9d,$9e,$9f,$a0,$a1,$a2,$a3,$31,$a4,$1d,$1d,$1d,$1d,$1d,$a5,$a6,$9d,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $a7,$a8,$a7,$a8,$a7,$a8,$a9,$aa,$ab,$ac,$ad,$5d,$1d,$1d,$1d,$1d,$1d,$ae,$a7,$a8,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$b0,$1d,$1d,$1d,$b1,$b2,$b3,$af,$af,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 DB $af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$af,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 BGTileMapEnd: BGTiles: DB $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $fb,$c7,$fd,$83,$ef,$b7,$ff,$b7,$fd,$83,$bb,$ef,$db,$e7,$ff,$ff DB $ff,$f8,$ff,$f0,$ef,$f0,$ff,$ec,$ee,$fd,$fe,$f3,$f7,$eb,$ff,$ff DB $ff,$7f,$ff,$3f,$ff,$3f,$bf,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f7,$8f,$fb,$07,$df,$6f,$ff,$6f DB $fc,$fc,$fc,$fc,$fc,$fc,$fe,$fe,$fe,$fe,$ff,$ff,$ff,$ff,$ff,$ff DB $00,$00,$00,$00,$7f,$7f,$7f,$7f,$3f,$30,$3f,$30,$18,$1f,$98,$9f DB $00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$00,$ff,$00,$00,$ff,$00,$ff DB $01,$01,$00,$00,$fc,$fc,$ff,$ff,$ff,$03,$ff,$00,$07,$f8,$01,$fe DB $fc,$fc,$7c,$7c,$1c,$1c,$06,$06,$c0,$c0,$f0,$f0,$fc,$3c,$ff,$0f DB $00,$00,$00,$00,$7f,$7f,$7f,$7f,$3f,$30,$3f,$30,$18,$1f,$18,$1f DB $00,$00,$00,$00,$fe,$fe,$fe,$fe,$fc,$0c,$fc,$0c,$18,$f8,$18,$f8 DB $3f,$3f,$3e,$3e,$38,$38,$60,$60,$03,$03,$0f,$0f,$3f,$3c,$ff,$f0 DB $81,$81,$00,$00,$3c,$3c,$ff,$ff,$ff,$c3,$ff,$00,$e7,$18,$81,$7e DB $ff,$ff,$7f,$7f,$1f,$1f,$07,$07,$c1,$c1,$f0,$f0,$fc,$3c,$ff,$0f DB $fb,$07,$77,$df,$b7,$cf,$ff,$ff,$ff,$ff,$7f,$7f,$1f,$1f,$0f,$0f DB $8c,$8f,$cc,$cf,$c6,$c7,$e6,$e7,$e3,$e3,$f3,$f3,$f3,$f3,$f3,$f3 DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$f0,$ff,$fc,$ff,$ff,$ff,$ff,$ff DB $7f,$83,$1f,$e0,$07,$f8,$01,$fe,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $cc,$cf,$fc,$ff,$fe,$ff,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$80,$ff,$80,$ff DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$7f,$ff,$7f,$ff,$3f,$ff,$3f,$ff DB $33,$f3,$3f,$ff,$7f,$ff,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $fe,$c1,$f8,$07,$e0,$1f,$80,$7f,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$3c,$ff,$ff,$ff,$ff,$ff DB $cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf DB $f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3,$f3 DB $ff,$3f,$ff,$0f,$7f,$83,$1f,$e0,$07,$f8,$01,$fe,$00,$ff,$00,$ff DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $c0,$ff,$c0,$ff,$e0,$ff,$e0,$ff,$f0,$ff,$f0,$ff,$f8,$ff,$f8,$ff DB $1f,$ff,$1f,$ff,$0f,$ff,$0f,$ff,$07,$ff,$07,$ff,$03,$ff,$03,$ff DB $ff,$ff,$ff,$ff,$ff,$ff,$fb,$ff,$f7,$ff,$f3,$ff,$f3,$ff,$27,$ff DB $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$df,$ff,$c3,$ff DB $ff,$ff,$ff,$ff,$fc,$ff,$c0,$ff,$c1,$ff,$c0,$ff,$e0,$ff,$f8,$ff DB $ff,$ff,$ff,$ff,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$7f,$ff,$1f,$ff DB $f3,$73,$f3,$33,$f3,$33,$b3,$73,$73,$f3,$f3,$f3,$f3,$f3,$f3,$f3 DB $f8,$ff,$f8,$ff,$f0,$ff,$f0,$ff,$e0,$ff,$e0,$ff,$c0,$ff,$c0,$ff DB $03,$ff,$03,$ff,$07,$ff,$07,$ff,$0f,$ff,$0f,$ff,$1f,$ff,$1f,$ff DB $80,$ff,$c0,$ff,$e1,$ff,$fb,$ff,$ff,$ff,$fc,$ff,$f8,$ff,$f8,$ff DB $7f,$ff,$ff,$ff,$ff,$ff,$e3,$ff,$03,$ff,$03,$ff,$03,$ff,$03,$ff DB $c3,$ff,$c3,$ff,$c3,$ff,$c3,$ff,$c3,$ff,$c3,$ff,$c3,$ff,$c3,$ff DB $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f3,$ff,$c3,$ff,$c3,$ff DB $fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$c7,$ff,$c0,$ff,$fc,$ff DB $0f,$ff,$87,$ff,$c3,$ff,$c3,$ff,$c3,$ff,$c3,$ff,$03,$ff,$03,$ff DB $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fc,$ff,$f0,$ff DB $ff,$ff,$ff,$ff,$fc,$ff,$f0,$ff,$c0,$ff,$00,$ff,$00,$ff,$00,$ff DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$03,$ff DB $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$ff,$fe,$ff,$fc,$ff,$fc,$ff DB $80,$ff,$80,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $3f,$ff,$3f,$ff,$7f,$ff,$7f,$ff,$7f,$80,$7f,$80,$00,$ff,$00,$ff DB $f8,$ff,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$00,$ff,$00,$00,$ff,$00,$ff DB $03,$f3,$03,$c3,$c3,$c3,$c3,$c3,$e3,$63,$e3,$63,$33,$f3,$33,$f3 DB $c3,$ff,$fb,$c7,$ff,$c3,$ff,$c3,$ff,$c3,$cf,$c3,$c7,$c3,$c7,$c3 DB $c0,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$03,$ff DB $00,$ff,$00,$ff,$00,$ff,$03,$ff,$0f,$ff,$3c,$fc,$f0,$f0,$c1,$c1 DB $0f,$ff,$3c,$fc,$f0,$f0,$c1,$c1,$07,$07,$1f,$1f,$7f,$7f,$ff,$ff DB $f8,$ff,$38,$3f,$30,$3f,$30,$3f,$3f,$3f,$3f,$3f,$00,$00,$00,$00 DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$ff,$ff,$ff,$ff,$00,$00,$00,$00 DB $1f,$ff,$1f,$ff,$0c,$fc,$0c,$fc,$fc,$fc,$fc,$fc,$00,$00,$00,$00 DB $00,$ff,$c0,$ff,$f0,$ff,$3c,$3f,$0f,$0f,$83,$83,$e0,$e0,$f8,$f8 DB $c7,$c3,$c7,$c3,$ff,$ff,$ff,$ff,$c3,$c3,$c3,$c3,$00,$00,$00,$00 DB $00,$ff,$03,$ff,$0f,$ff,$3c,$fc,$f0,$f0,$c1,$c1,$07,$07,$1e,$1f DB $ff,$ff,$ff,$ff,$03,$03,$03,$03,$73,$73,$f3,$f3,$b3,$f3,$33,$f3 DB $0f,$0f,$1f,$1f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $07,$07,$1f,$1f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $ff,$ff,$ff,$ff,$c0,$ff,$e0,$ff,$e0,$ff,$e0,$ff,$e0,$ff,$e0,$ff DB $ff,$ff,$ff,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $ff,$ff,$ff,$ff,$1f,$fe,$0f,$fe,$0f,$fe,$0f,$ff,$0f,$ff,$07,$ff DB $ff,$ff,$ff,$ff,$32,$c3,$02,$e3,$22,$e3,$03,$c3,$01,$c0,$60,$60 DB $9f,$ff,$8f,$ff,$1c,$f0,$18,$f0,$38,$e0,$e0,$c0,$c0,$00,$01,$00 DB $ff,$ff,$ff,$ff,$0f,$00,$0f,$00,$1e,$01,$1c,$03,$30,$0f,$f0,$0f DB $f8,$ff,$f0,$ff,$18,$ff,$18,$ff,$18,$ff,$18,$ff,$38,$ff,$38,$ff DB $33,$f3,$33,$f3,$33,$f3,$33,$f3,$33,$f3,$33,$f3,$33,$f3,$33,$f3 DB $0f,$ff,$3c,$fc,$f0,$f0,$c1,$c1,$07,$07,$1e,$1f,$78,$7f,$e0,$ff DB $07,$07,$1e,$1f,$78,$7f,$e1,$ff,$83,$ff,$07,$ff,$07,$ff,$0f,$ff DB $f0,$f0,$f0,$f0,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $07,$07,$1f,$1f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $7f,$ff,$7f,$ff,$7f,$ff,$7f,$ff,$7f,$ff,$3f,$ff,$bf,$7f,$d7,$3f DB $ff,$ff,$ff,$ff,$ff,$ff,$fe,$ff,$f8,$ff,$f0,$ff,$c0,$ff,$80,$ff DB $c0,$ff,$80,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $00,$ff,$00,$ff,$00,$ff,$20,$ff,$10,$ff,$1c,$ff,$0f,$ff,$0f,$ff DB $02,$fe,$00,$fe,$00,$fe,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$c0,$ff DB $00,$18,$01,$0e,$0f,$00,$0e,$80,$06,$f1,$00,$f0,$00,$f0,$00,$f2 DB $0f,$08,$8d,$0e,$85,$06,$05,$46,$47,$06,$5c,$3f,$5e,$bc,$04,$f0 DB $70,$0f,$30,$0f,$b3,$0f,$9f,$0f,$9f,$0f,$9f,$0f,$0f,$1f,$2f,$1f DB $f8,$ff,$f0,$ff,$f0,$ff,$f0,$ff,$e0,$ff,$c0,$ff,$80,$ff,$00,$ff DB $30,$f0,$30,$f0,$3f,$ff,$3f,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $07,$07,$1e,$1f,$f8,$ff,$e0,$ff,$00,$ff,$07,$ff,$0f,$ff,$1f,$ff DB $80,$ff,$00,$ff,$00,$ff,$00,$ff,$1f,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $07,$ff,$07,$ff,$03,$ff,$03,$ff,$c1,$ff,$e0,$ff,$e0,$ff,$f0,$ff DB $ff,$fc,$fb,$fc,$fe,$f8,$fe,$f0,$fc,$f0,$fc,$f0,$fc,$f0,$fc,$f8 DB $d7,$3f,$ff,$1f,$7f,$0f,$3f,$0f,$1f,$07,$1f,$07,$1f,$07,$3f,$0f DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$80,$ff DB $07,$ff,$07,$ff,$0f,$f3,$19,$e7,$1d,$e3,$1c,$e3,$3c,$c3,$3e,$c1 DB $0d,$f2,$04,$fb,$00,$f9,$00,$f8,$00,$fc,$00,$fc,$00,$ff,$00,$ff DB $20,$c0,$80,$60,$00,$21,$2c,$83,$84,$03,$00,$07,$80,$07,$00,$8f DB $06,$3f,$0c,$7f,$0c,$ff,$0c,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $1f,$ff,$3f,$ff,$3f,$fb,$3f,$f9,$40,$c0,$40,$c0,$40,$c0,$00,$80 DB $f0,$ff,$f8,$ff,$f8,$ff,$f8,$ff,$fc,$ff,$fc,$ff,$fc,$ff,$fe,$ff DB $7f,$ff,$7f,$ff,$3f,$ff,$3f,$ff,$3f,$ff,$1f,$ff,$1f,$ff,$1f,$ff DB $fc,$fc,$fb,$fb,$fb,$fb,$fc,$f8,$ff,$fc,$fd,$fc,$fe,$fc,$fe,$ff DB $1f,$1f,$6f,$6f,$ef,$6f,$9f,$8f,$3f,$0f,$7f,$1f,$3f,$1f,$1f,$ff DB $80,$ff,$e0,$ff,$e0,$ff,$f0,$ff,$f8,$ff,$fc,$ff,$ff,$ff,$ff,$ff DB $3e,$c1,$3f,$c0,$3f,$c0,$3f,$c0,$3f,$c0,$3f,$c0,$3f,$c0,$3f,$c0 DB $00,$ff,$01,$ff,$07,$ff,$1f,$ff,$ff,$7f,$ff,$7f,$ff,$3f,$ff,$3f DB $80,$ff,$c0,$ff,$c0,$ff,$e0,$ff,$e0,$ff,$e0,$ff,$e0,$ff,$f0,$ff DB $00,$ff,$00,$ff,$00,$ff,$01,$fe,$03,$fc,$07,$f8,$07,$f8,$07,$f8 DB $00,$80,$80,$00,$e1,$00,$e1,$00,$e1,$00,$e1,$00,$e0,$00,$f0,$00 DB $ff,$ff,$ff,$ff,$ff,$7f,$ff,$7f,$ff,$7f,$ff,$7f,$ff,$3f,$ff,$3f DB $fe,$ff,$fe,$ff,$fe,$ff,$fe,$ff,$fc,$ff,$fc,$ff,$fc,$ff,$fc,$ff DB $fe,$fc,$ff,$fe,$fe,$ff,$fe,$fe,$ff,$fe,$ff,$ff,$ff,$ff,$ff,$ff DB $1f,$0f,$3f,$1f,$df,$3f,$1f,$1f,$3f,$1f,$ff,$3f,$3f,$3f,$3f,$3f DB $e0,$ff,$f0,$ff,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff DB $1f,$e0,$1f,$e0,$1f,$e0,$1f,$e0,$1f,$e0,$1f,$e0,$3f,$c0,$3f,$c0 DB $ff,$3f,$ff,$1f,$ff,$1f,$ff,$1f,$ff,$1f,$ff,$0f,$ff,$0f,$ff,$0f DB $07,$f8,$03,$fc,$01,$fe,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $f0,$00,$f0,$00,$f8,$00,$f8,$00,$fc,$00,$7c,$80,$3c,$c0,$1e,$e0 DB $03,$ff,$03,$ff,$03,$ff,$03,$ff,$03,$ff,$03,$ff,$03,$ff,$03,$ff DB $ff,$3f,$3f,$ff,$3f,$ff,$3f,$ff,$3f,$ff,$3f,$ff,$3f,$ff,$3f,$ff DB $ff,$c0,$ff,$c0,$ff,$c0,$ff,$c0,$ff,$c0,$ff,$c0,$ff,$c0,$ff,$e0 DB $ff,$0f,$ff,$0f,$f7,$0f,$f3,$0f,$f1,$0f,$f0,$0f,$f1,$0f,$e1,$1f DB $c0,$ff,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fc,$fc,$f8,$f8 DB $00,$ff,$00,$ff,$80,$ff,$c0,$ff,$e0,$ff,$a0,$b0,$30,$00,$30,$00 DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$1f,$00,$01 DB $1e,$e0,$0e,$f0,$07,$f8,$07,$f8,$03,$fc,$01,$fe,$01,$fe,$00,$ff DB $7f,$0f,$7f,$0f,$7f,$0f,$7c,$0f,$78,$07,$f8,$07,$f8,$07,$f8,$07 DB $fd,$ff,$fc,$ff,$fc,$ff,$fe,$ff,$ef,$ff,$9f,$ff,$3e,$ff,$3f,$ff DB $ff,$ff,$ff,$ff,$3f,$ff,$1d,$ff,$1b,$ff,$19,$ff,$39,$ff,$f3,$ff DB $ff,$ff,$ff,$f3,$ff,$e1,$ff,$c0,$ff,$c0,$ff,$80,$ff,$80,$ff,$00 DB $fd,$ff,$fc,$ff,$fc,$ff,$fe,$7f,$ff,$7f,$ff,$1f,$ff,$0f,$ff,$06 DB $ff,$ff,$ff,$ff,$7f,$f8,$7f,$e0,$ff,$c0,$ff,$c1,$ff,$83,$ff,$03 DB $ff,$c0,$ff,$00,$ff,$00,$ff,$00,$ff,$78,$f7,$f8,$fd,$f2,$e8,$f7 DB $c1,$3f,$81,$7f,$81,$7f,$01,$ff,$01,$ff,$01,$ff,$01,$ff,$01,$ff DB $ff,$bf,$ff,$8f,$e3,$02,$c0,$00,$88,$00,$bf,$00,$fe,$30,$fc,$b8 DB $f0,$f0,$e0,$c0,$e0,$00,$41,$00,$00,$09,$1b,$00,$72,$00,$46,$00 DB $2c,$00,$67,$00,$c7,$00,$cc,$0b,$1c,$83,$9c,$03,$1c,$03,$00,$1f DB $00,$00,$f8,$00,$f7,$08,$f0,$0f,$0f,$f0,$03,$fc,$00,$ff,$00,$ff DB $00,$1f,$00,$03,$00,$00,$00,$c0,$c0,$38,$86,$01,$70,$80,$04,$f8 DB $00,$ff,$00,$ff,$00,$7f,$00,$0f,$00,$00,$00,$00,$80,$60,$18,$07 DB $f8,$07,$cc,$03,$cc,$03,$c4,$03,$44,$03,$00,$03,$80,$03,$c0,$01 DB $03,$ff,$03,$ff,$03,$ff,$03,$ff,$41,$ff,$31,$ff,$18,$ff,$18,$ff DB $9f,$ff,$ff,$ff,$ff,$ff,$ef,$ff,$cf,$ff,$8f,$ff,$87,$ff,$83,$ff DB $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ef,$ff,$e7,$ff,$c3,$ff,$c7,$ff DB $ff,$fc,$ff,$f8,$ff,$f0,$ff,$e1,$ff,$c1,$ff,$c1,$ff,$c1,$ff,$e1 DB $ff,$38,$ff,$7c,$ff,$ff,$ff,$e0,$7f,$e0,$ff,$e0,$bf,$e0,$bf,$f1 DB $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$c0 DB $ff,$07,$ff,$0f,$ff,$1f,$ff,$3e,$ff,$3c,$ff,$0d,$ff,$01,$ff,$03 DB $d8,$e7,$e0,$9f,$c0,$3f,$80,$7f,$80,$ff,$80,$ff,$80,$ff,$80,$ff DB $01,$ff,$03,$ff,$03,$ff,$03,$ff,$03,$ff,$06,$ff,$06,$ff,$04,$ff DB $f0,$f8,$f0,$f0,$e0,$f0,$e0,$f8,$40,$f8,$c0,$fc,$c0,$fe,$80,$fe DB $4a,$04,$40,$86,$40,$86,$00,$c6,$80,$47,$80,$47,$00,$47,$00,$67 DB $00,$1f,$00,$0f,$00,$0f,$00,$0f,$00,$0f,$00,$87,$00,$c3,$00,$e3 DB $81,$00,$1c,$e0,$03,$fc,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $e0,$01,$20,$01,$e1,$00,$0f,$f0,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $0f,$ff,$0f,$ff,$07,$ff,$07,$ff,$07,$ff,$0f,$ff,$0f,$ff,$0b,$ff DB $00,$ff,$00,$ff,$03,$fc,$47,$b8,$27,$d8,$67,$98,$63,$9c,$30,$cf DB $4f,$bf,$ce,$3f,$c6,$3f,$82,$7f,$08,$f7,$06,$f9,$83,$7c,$03,$fc DB $3f,$e1,$3f,$e1,$3f,$f1,$5f,$b1,$3f,$dd,$67,$9f,$63,$9c,$30,$cf DB $5f,$b0,$df,$38,$cf,$38,$8f,$7c,$0f,$f4,$07,$fe,$83,$7f,$03,$fc DB $ff,$c0,$ff,$80,$ff,$80,$ff,$80,$ff,$80,$ff,$c0,$ff,$c0,$7f,$fc DB $ff,$73,$ff,$e3,$be,$ef,$ba,$ff,$88,$f7,$c6,$f9,$e3,$7c,$f3,$3c DB $80,$ff,$80,$ff,$c0,$ff,$40,$ff,$60,$ff,$60,$bf,$70,$bf,$30,$df DB $0c,$ff,$0f,$ff,$0f,$ff,$1b,$ff,$19,$f7,$17,$f9,$13,$fd,$13,$fd DB $04,$63,$0c,$73,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$03,$ff,$02,$ff,$01,$ff,$01,$ff DB $0c,$ff,$06,$ff,$03,$fe,$03,$fe,$f3,$fe,$7f,$9e,$63,$9c,$30,$cf DB $00,$ff,$18,$e7,$0c,$f3,$1c,$e3,$3c,$c3,$fe,$01,$ff,$00,$ff,$00 DB $26,$d9,$10,$ef,$1c,$e3,$1e,$e1,$3f,$c0,$7f,$80,$ff,$00,$ff,$00 DB $07,$ff,$19,$e7,$0c,$f3,$1c,$e3,$3c,$c3,$fe,$01,$ff,$00,$ff,$00 DB $f6,$19,$f0,$df,$7c,$f3,$1e,$e1,$3f,$c0,$7f,$80,$ff,$00,$ff,$00 DB $18,$ff,$18,$ef,$0c,$ff,$1c,$e7,$3c,$c7,$fe,$07,$ff,$03,$ff,$00 DB $36,$f9,$30,$ef,$3c,$e3,$3e,$e1,$3f,$e0,$3f,$e0,$bf,$e0,$ff,$e0 DB $80,$ff,$c0,$ff,$60,$ff,$20,$ff,$30,$ff,$fc,$1f,$fe,$07,$ff,$03 DB $01,$ff,$01,$ff,$01,$ff,$01,$ff,$01,$ff,$01,$ff,$01,$ff,$03,$ff DB $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00 DB $c0,$ff,$e0,$7f,$f0,$3f,$f8,$1f,$fc,$0f,$fc,$07,$f8,$0f,$f8,$0f DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$02,$ff,$03,$ff,$07,$fd DB $00,$ff,$00,$ff,$00,$ff,$00,$ff,$01,$ff,$07,$ff,$0f,$fc,$bf,$f8 DB $03,$fe,$07,$fe,$1f,$fc,$3f,$f0,$ff,$e0,$ff,$00,$ff,$00,$ff,$00 BGTilesEnd: ; ------------------------------------------------------------- SECTION "X Sine Table",ROMX,BANK[1],ALIGN[8] XSineTable: DB $00,$00,$FF,$FE,$FD,$FD,$FC,$FB,$FA,$F9,$F9,$F8,$F7,$F6,$F6,$F5 DB $F4,$F4,$F3,$F2,$F1,$F1,$F0,$EF,$EF,$EE,$ED,$ED,$EC,$EC,$EB,$EA DB $EA,$E9,$E9,$E8,$E8,$E7,$E7,$E6,$E6,$E5,$E5,$E5,$E4,$E4,$E4,$E3 DB $E3,$E3,$E2,$E2,$E2,$E2,$E1,$E1,$E1,$E1,$E1,$E1,$E1,$E1,$E1,$E1 DB $E0,$E1,$E1,$E1,$E1,$E1,$E1,$E1,$E1,$E1,$E1,$E2,$E2,$E2,$E2,$E3 DB $E3,$E3,$E4,$E4,$E4,$E5,$E5,$E5,$E6,$E6,$E7,$E7,$E8,$E8,$E9,$E9 DB $EA,$EA,$EB,$EC,$EC,$ED,$ED,$EE,$EF,$EF,$F0,$F1,$F1,$F2,$F3,$F4 DB $F4,$F5,$F6,$F6,$F7,$F8,$F9,$F9,$FA,$FB,$FC,$FD,$FD,$FE,$FF,$00 DB $00,$00,$01,$02,$03,$03,$04,$05,$06,$07,$07,$08,$09,$0A,$0A,$0B DB $0C,$0C,$0D,$0E,$0F,$0F,$10,$11,$11,$12,$13,$13,$14,$14,$15,$16 DB $16,$17,$17,$18,$18,$19,$19,$1A,$1A,$1B,$1B,$1B,$1C,$1C,$1C,$1D DB $1D,$1D,$1E,$1E,$1E,$1E,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F DB $20,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F,$1E,$1E,$1E,$1E,$1D DB $1D,$1D,$1C,$1C,$1C,$1B,$1B,$1B,$1A,$1A,$19,$19,$18,$18,$17,$17 DB $16,$16,$15,$14,$14,$13,$13,$12,$11,$11,$10,$0F,$0F,$0E,$0D,$0C DB $0C,$0B,$0A,$0A,$09,$08,$07,$07,$06,$05,$04,$03,$03,$02,$01,$00 SECTION "Y Sine Table",ROMX,BANK[1],ALIGN[8] YSineTable: DB $00,$00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$06,$07 DB $07,$07,$07,$07,$07,$08,$07,$07,$07,$07,$07,$07,$06,$06,$06,$05 DB $05,$04,$04,$03,$03,$02,$02,$01,$01,$00,$00,$00,$FF,$FF,$FE,$FE DB $FD,$FC,$FC,$FC,$FB,$FB,$FA,$FA,$FA,$F9,$F9,$F9,$F9,$F9,$F9,$F8 DB $F9,$F9,$F9,$F9,$F9,$F9,$FA,$FA,$FA,$FB,$FB,$FC,$FC,$FD,$FD,$FE DB $FE,$FF,$FF,$00 DB $00,$00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$06,$07 DB $07,$07,$07,$07,$07,$08,$07,$07,$07,$07,$07,$07,$06,$06,$06,$05 DB $05,$04,$04,$03,$03,$02,$02,$01,$01,$00,$00,$00,$FF,$FF,$FE,$FE DB $FD,$FC,$FC,$FC,$FB,$FB,$FA,$FA,$FA,$F9,$F9,$F9,$F9,$F9,$F9,$F8 DB $F9,$F9,$F9,$F9,$F9,$F9,$FA,$FA,$FA,$FB,$FB,$FC,$FC,$FD,$FD,$FE DB $FE,$FF,$FF,$00 DB $00,$00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$06,$07 DB $07,$07,$07,$07,$07,$08,$07,$07,$07,$07,$07,$07,$06,$06,$06,$05 DB $05,$04,$04,$03,$03,$02,$02,$01,$01,$00,$00,$00,$FF,$FF,$FE,$FE DB $FD,$FC,$FC,$FC,$FB,$FB,$FA,$FA,$FA,$F9,$F9,$F9,$F9,$F9,$F9,$F8 DB $F9,$F9,$F9,$F9,$F9,$F9,$FA,$FA,$FA,$FB,$FB,$FC,$FC,$FD,$FD,$FE DB $FE,$FF,$FF,$00 DB $00 SECTION "Roll Table",ROMX,BANK[1],ALIGN[8] RollTable: DB 64,60,58,56,54,52,50,48,46,44,43,41,39,38,36,34 DB 33,31,29,27,26,24,22,21,19,17,15,13,11, 9, 7, 5
25.764345
132
0.543041
b17c6d68fe6435b4dae674a6b4f86c505fbb43db
746
asm
Assembly
spectranet/socklib/bind_callee.asm
speccytools/spectranet-gdbserver
c76acd970e5e8bbf793d8514bf64c32a180c26a4
[ "MIT" ]
40
2021-07-23T21:33:59.000Z
2022-02-07T19:07:46.000Z
spectranet/socklib/bind_callee.asm
speccytools/spectranet-gdbserver
c76acd970e5e8bbf793d8514bf64c32a180c26a4
[ "MIT" ]
null
null
null
spectranet/socklib/bind_callee.asm
speccytools/spectranet-gdbserver
c76acd970e5e8bbf793d8514bf64c32a180c26a4
[ "MIT" ]
2
2021-08-02T17:49:03.000Z
2021-10-09T21:53:41.000Z
; process ; int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen); ; Bind a name to a local address ; This is simplified compared to the full BSD implementation; the Spectranet ; only uses the port address (and sockaddr_in is the only type of struct ; sockaddr that's actually defined). PUBLIC bind_callee PUBLIC ASMDISP_BIND_CALLEE include "spectranet.asm" .bind_callee pop hl ; return addr pop bc ; addrlen pop ix ; my_addr structure ex (sp), hl ; restore return addr, fd now in l ld a, l .asmentry ld e, (ix+2) ; sin_port LSB ld d, (ix+3) ; sin_port MSB HLCALL BIND jr c, err ld hl, 0 ; return code 0 ret .err ld h, 0x80 ; -ve ld l, a ; return code ret defc ASMDISP_BIND_CALLEE = asmentry - bind_callee
24.064516
76
0.725201
9cbb03c0752451eb5d401a28cfc396463804ddcd
2,809
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_2_115.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_2_115.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_2_115.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 %r14 push %r8 push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0x16a5d, %r14 nop nop cmp $963, %r13 mov (%r14), %esi nop nop nop nop add %r12, %r12 lea addresses_D_ht+0x4165, %rsi lea addresses_normal_ht+0x4b5, %rdi clflush (%rdi) nop nop and %r8, %r8 mov $55, %rcx rep movsl cmp %r14, %r14 lea addresses_D_ht+0xc4d4, %rsi lea addresses_D_ht+0x17725, %rdi clflush (%rsi) nop cmp %rdx, %rdx mov $91, %rcx rep movsq nop nop nop nop and $18320, %r13 lea addresses_WC_ht+0x12ab5, %r8 nop nop nop nop nop add %rsi, %rsi movups (%r8), %xmm3 vpextrq $0, %xmm3, %rdi nop nop nop nop nop cmp %r8, %r8 pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r8 push %r9 push %rcx push %rdi push %rsi // REPMOV lea addresses_A+0x11325, %rsi lea addresses_D+0x10975, %rdi nop nop nop nop nop add %r8, %r8 mov $63, %rcx rep movsw nop inc %r15 // Store lea addresses_normal+0x136a5, %r12 xor $42956, %r15 mov $0x5152535455565758, %r9 movq %r9, %xmm7 movups %xmm7, (%r12) nop sub $33785, %r15 // Store lea addresses_WC+0x172e1, %r9 nop nop nop nop sub %rdi, %rdi movw $0x5152, (%r9) sub %rdi, %rdi // Faulty Load lea addresses_A+0x1b25, %r12 nop nop nop nop nop cmp $57236, %rsi vmovups (%r12), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r8 lea oracles, %rcx and $0xff, %r8 shlq $12, %r8 mov (%rcx,%r8,1), %r8 pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'00': 2} 00 00 */
18.602649
151
0.647205
8f82e3738a1246f7ed33fd82de7a01729cdeb9d3
4,036
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_186_584.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_0xca.log_186_584.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_0xca.log_186_584.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 %r15 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0xe573, %rbx nop nop nop cmp $16798, %rsi movl $0x61626364, (%rbx) nop nop add %r15, %r15 lea addresses_normal_ht+0x1973, %rsi lea addresses_UC_ht+0xe573, %rdi nop nop nop nop nop dec %rax mov $85, %rcx rep movsq nop nop nop sub $17837, %rbx lea addresses_D_ht+0xeb73, %rbx nop nop nop nop sub $43426, %rdi mov (%rbx), %r15d sub $683, %rdi lea addresses_normal_ht+0x4b74, %rsi lea addresses_D_ht+0x2d73, %rdi nop nop nop nop nop xor %r12, %r12 mov $28, %rcx rep movsw nop nop nop nop dec %r15 lea addresses_WT_ht+0x1497a, %rsi lea addresses_WT_ht+0x16083, %rdi nop inc %r13 mov $119, %rcx rep movsw nop dec %rbx lea addresses_WC_ht+0x1820b, %r12 inc %rax vmovups (%r12), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %rbx cmp %rdi, %rdi lea addresses_WT_ht+0x17873, %rsi lea addresses_WC_ht+0xbcb, %rdi nop nop nop and $38432, %rbx mov $70, %rcx rep movsl nop inc %rax lea addresses_A_ht+0xf973, %r13 nop nop nop xor $55408, %rbx movb (%r13), %cl nop nop add %rbx, %rbx lea addresses_WT_ht+0x2753, %rbx nop nop nop xor $14808, %rcx movb (%rbx), %al sub %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r15 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %rbp push %rbx push %rcx push %rdi push %rsi // REPMOV lea addresses_A+0x12d73, %rsi lea addresses_D+0xf293, %rdi nop nop inc %rbx mov $22, %rcx rep movsb nop nop xor %r13, %r13 // Faulty Load lea addresses_normal+0xe573, %rsi nop nop nop nop xor %rbp, %rbp mov (%rsi), %cx lea oracles, %r13 and $0xff, %rcx shlq $12, %rcx mov (%r13,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_A'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_D'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'34': 186} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
23.741176
557
0.6556
fb611f1571d675425a1264e6e538e31c6d037c6a
8,050
asm
Assembly
test/data/ASM-6502/sweet16.asm
jfitz/code-stat
dd2a13177f3ef03ab42123ef3cfcbbd062a2ae26
[ "MIT" ]
null
null
null
test/data/ASM-6502/sweet16.asm
jfitz/code-stat
dd2a13177f3ef03ab42123ef3cfcbbd062a2ae26
[ "MIT" ]
null
null
null
test/data/ASM-6502/sweet16.asm
jfitz/code-stat
dd2a13177f3ef03ab42123ef3cfcbbd062a2ae26
[ "MIT" ]
null
null
null
******************************** * * * APPLE-II PSEUDO MACHINE * * INTERPRETER * * * * COPYRIGHT (C) 1977 * * APPLE COMPUTER, INC * * * * ALL RIGHTS RESERVED * * * * S. WOZNIAK * * * ******************************** * * * TITLE: SWEET 16 INTERPRETER * * * ******************************** R0L EQU $0 R0H EQU $1 R14H EQU $1D R15L EQU $1E R15H EQU $1F SAVE EQU $FF4A RESTORE EQU $FF3F ORG $F689 AST 32 JSR SAVE ;PRESERVE 6502 REG CONTENTS PLA STA R15L ;INIT SWEET16 PC PLA ;FROM RETURN STA R15H ;ADDRESS SW16B JSR SW16C ;INTERPRET AND EXECUTE JMP SW16B ;ONE SWEET16 INSTR. SW16C INC R15L BNE SW16D ;INCR SWEET16 PC FOR FETCH INC R15H SW16D LDA >SET ;COMMON HIGH BYTE FOR ALL ROUTINES PHA ;PUSH ON STACK FOR RTS LDY $0 LDA (R15L),Y ;FETCH INSTR AND $F ;MASK REG SPECIFICATION ASL ;DOUBLE FOR TWO BYTE REGISTERS TAX ;TO X REG FOR INDEXING LSR EOR (R15L),Y ;NOW HAVE OPCODE BEQ TOBR ;IF ZERO THEN NON-REG OP STX R14H ;INDICATE "PRIOR RESULT REG" LSR LSR ;OPCODE*2 TO LSB'S LSR TAY ;TO Y REG FOR INDEXING LDA OPTBL-2,Y ;LOW ORDER ADR BYTE PHA ;ONTO STACK RTS ;GOTO REG-OP ROUTINE TOBR INC R15L BNE TOBR2 ;INCR PC INC R15H TOBR2 LDA BRTBL,X ;LOW ORDER ADR BYTE PHA ;ONTO STACK FOR NON-REG OP LDA R14H ;"PRIOR RESULT REG" INDEX LSR ;PREPARE CARRY FOR BC, BNC. RTS ;GOTO NON-REG OP ROUTINE RTNZ PLA ;POP RETURN ADDRESS PLA JSR RESTORE ;RESTORE 6502 REG CONTENTS JMP (R15L) ;RETURN TO 6502 CODE VIA PC SETZ LDA (R15L),Y ;HIGH ORDER BYTE OF CONSTANT STA R0H,X DEY LDA (R15L),Y ;LOW ORDER BYTE OF CONSTANT STA R0L,X TYA ;Y REG CONTAINS 1 SEC ADC R15L ;ADD 2 TO PC STA R15L BCC SET2 INC R15H SET2 RTS OPTBL DFB SET-1 ;1X BRTBL DFB RTN-1 ;0 DFB LD-1 ;2X DFB BR-1 ;1 DFB ST-1 ;3X DFB BNC-1 ;2 DFB LDAT-1 ;4X DFB BC-1 ;3 DFB STAT-1 ;5X DFB BP-1 ;4 DFB LDDAT-1 ;6X DFB BM-1 ;5 DFB STDAT-1 ;7X DFB BZ-1 ;6 DFB POP-1 ;8X DFB BNZ-1 ;7 DFB STPAT-1 ;9X DFB BM1-1 ;8 DFB ADD-1 ;AX DFB BNM1-1 ;9 DFB SUB-1 ;BX DFB BK-1 ;A DFB POPD-1 ;CX DFB RS-1 ;B DFB CPR-1 ;DX DFB BS-1 ;C DFB INR-1 ;EX DFB NUL-1 ;D DFB DCR-1 ;FX DFB NUL-1 ;E DFB NUL-1 ;UNUSED DFB NUL-1 ;F * FOLLOWING CODE MUST BE * CONTAINED ON A SINGLE PAGE! SET BPL SETZ ;ALWAYS TAKEN LD LDA R0L,X BK EQU *-1 STA R0L LDA R0H,X ;MOVE RX TO R0 STA R0H RTS ST LDA R0L STA R0L,X ;MOVE R0 TO RX LDA R0H STA R0H,X RTS STAT LDA R0L STAT2 STA (R0L,X) ;STORE BYTE INDIRECT LDY $0 STAT3 STY R14H ;INDICATE R0 IS RESULT NEG INR INC R0L,X BNE INR2 ;INCR RX INC R0H,X INR2 RTS LDAT LDA (R0L,X) ;LOAD INDIRECT (RX) STA R0L ;TO R0 LDY $0 STY R0H ;ZERO HIGH ORDER R0 BYTE BEQ STAT3 ;ALWAYS TAKEN POP LDY $0 ;HIGH ORDER BYTE = 0 BEQ POP2 ;ALWAYS TAKEN POPD JSR DCR ;DECR RX LDA (R0L,X) ;POP HIGH ORDER BYTE @RX TAY ;SAVE IN Y REG POP2 JSR DCR ;DECR RX LDA (R0L,X) ;LOW ORDER BYTE STA R0L ;TO R0 STY R0H POP3 LDY $0 ;INDICATE R0 AS LAST RESULT REG STY R14H RTS LDDAT JSR LDAT ;LOW ORDER BYTE TO R0, INCR RX LDA (R0L,X) ;HIGH ORDER BYTE TO R0 STA R0H JMP INR ;INCR RX STDAT JSR STAT ;STORE INDIRECT LOW ORDER LDA R0H ;BYTE AND INCR RX. THEN STA (R0L,X) ;STORE HIGH ORDER BYTE. JMP INR ;INCR RX AND RETURN STPAT JSR DCR ;DECR RX LDA R0L STA (R0L,X) ;STORE R0 LOW BYTE @RX JMP POP3 ;INDICATE R0 AS LAST RESULT REG DCR LDA R0L,X BNE DCR2 ;DECR RX DEC R0H,X DCR2 DEC R0L,X RTS SUB LDY $0 ;RESULT TO R0 CPR SEC ;NOTE Y REG = 13*2 FOR CPR LDA R0L SBC R0L,X STA R0L,Y ;R0-RX TO RY LDA R0H SBC R0H,X SUB2 STA R0H,Y TYA ;LAST RESULT REG*2 ADC $0 ;CARRY TO LSB STA R14H RTS ADD LDA R0L ADC R0L,X STA R0L ;R0+RX TO R0 LDA R0H ADC R0H,X LDY $0 ;R0 FOR RESULT BEQ SUB2 ;FINISH ADD BS LDA R15L ;NOTE X REG IS 12*2! JSR STAT2 ;PUSH LOW PC BYTE VIA R12 LDA R15H JSR STAT2 ;PUSH HIGH ORDER PC BYTE BR CLC BNC BCS BNC2 ;NO CARRY TEST BR1 LDA (R15L),Y ;DISPLACEMENT BYTE BPL BR2 DEY BR2 ADC R15L ;ADD TO PC STA R15L TYA ADC R15H STA R15H BNC2 RTS BC BCS BR RTS BP ASL ;DOUBLE RESULT-REG INDEX TAX ;TO X REG FOR INDEXING LDA R0H,X ;TEST FOR PLUS BPL BR1 ;BRANCH IF SO RTS BM ASL ;DOUBLE RESULT-REG INDEX TAX LDA R0H,X ;TEST FOR MINUS BMI BR1 RTS BZ ASL ;DOUBLE RESULT-REG INDEX TAX LDA R0L,X ;TEST FOR ZERO ORA R0H,X ;(BOTH BYTES) BEQ BR1 ;BRANCH IF SO RTS BNZ ASL ;DOUBLE RESULT-REG INDEX TAX LDA R0L,X ;TEST FOR NON-ZERO ORA R0H,X ;(BOTH BYTES) BNE BR1 ;BRANCH IF SO RTS BM1 ASL ;DOUBLE RESULT-REG INDEX TAX LDA R0L,X ;CHECK BOTH BYTES AND R0H,X ;FOR $FF (MINUS 1) EOR $FF BEQ BR1 ;BRANCH IF SO RTS BNM1 ASL ;DOUBLE RESULT-REG INDEX TAX LDA R0L,X AND R0H,X ;CHECK BOTH BYTES FOR NO $FF EOR $FF BNE BR1 ;BRANCH IF NOT MINUS 1 NUL RTS RS LDX $18 ;12*2 FOR R12 AS STACK POINTER JSR DCR ;DECR STACK POINTER LDA (R0L,X) ;POP HIGH RETURN ADDRESS TO PC STA R15H JSR DCR ;SAME FOR LOW ORDER BYTE LDA (R0L,X) STA R15L RTS RTN JMP RTNZ
31.692913
62
0.403727
7907edaaaec371fc133e4e3d50a3ff09073f5214
5,806
asm
Assembly
dev/emm386/segfix.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
dev/emm386/segfix.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
dev/emm386/segfix.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
.386p ;****************************************************************************** title SEGFIX ;****************************************************************************** ; ; (C) Copyright MICROSOFT Corp. 1989-1991 ; (C) Copyright COMPAQ Computer Corp. 1989-1991 ; ; Title: EMM386.EXE - MICROSOFT Expanded Memory Manager 386 Driver ; ; Module: SEGFIX - Sets the descriptor caches ; ; Version: 0.001 ; ; Date: Feb 16,1990 ; ; Author: Harish K. Naidu ; ;****************************************************************************** ; ; Change log: ; ; DATE REVISION DESCRIPTION ; -------- -------- ------------------------------------------------------- ; 02/16/89 Original ; ;****************************************************************************** ; ; Functional Description: ; ; ;****************************************************************************** ;****************************************************************************** ; P U B L I C S ;****************************************************************************** public segfixup ;****************************************************************************** ; D E F I N E S ;****************************************************************************** include vdmseg.inc include desc.inc SGDTD_GSEL equ 08h ; gdt data alias SIDTD_GSEL equ 10h ; idt data alias SVDMC_GSEL equ 18h ; VDM Code selector SVDMD_GSEL equ 20h ; VDM Data Selector ;****************************************************************************** ; E X T E R N A L R E F E R E N C E S ;****************************************************************************** LAST segment extrn SetSegDesc:near extrn SegTo24:near LAST ends SGDT segment GDT_ENTRY 0, 0, 1, 0 ; null selector GDT_ENTRY 0, 0, 0, D_DATA0 ; GDT alias GDT_ENTRY 0, 0, 0, D_DATA0 ; IDT alias GDT_ENTRY 0, 0, 0, D_CODE0 ; VDM Code GDT_ENTRY 0, 0, 0, D_DATA0 ; VDM Data SGDTLEN EQU $-SGDT SGDT ends SIDT segment IDT_ENTRY 0, 0, 0 SIDTLEN EQU $-SIDT SIDT ends LAST segment assume cs:LAST SGDT_Ptr dd 2 dup (0) ; GDT ptr for LGDT SIDT_Ptr dd 2 dup (0) ; IDT ptr for LIDT Sreal_idt dw 0400h ; real mode DOS IDT limit dd 0 ; and base ptr dw 0 ; just in case qword used ss_save dw ? ; temporary location to save stack sp_save dw ? ;-------------------------------------------------------------------------- ; ; Procedure SegFixup ; ; This routine will switch to protect mode and set up the selectors with ; real mode attributes and return to real mode. This is called at init ; time. This is necessary to fix up the BUGGY ROMS of certain machines ; like APRICOT Qi which does not do this for fs and gs. Therefore on this ; machine one cannot access fs from REAL MODE!! unless something similar ; to this routine is done ; ; USES: ALL ;-------------------------------------------------------------------------- segfixup proc near mov ax,SGDT mov es,ax ; ES:0 -> gdt mov ax,SGDT call SegTo24 mov cx,SGDTLEN mov ah,D_DATA0 mov bx,SGDTD_GSEL call SetSegDesc ; Set up SGDT alias descriptor mov ax,SIDT call SegTo24 mov cx,SIDTLEN mov ah,D_DATA0 mov bx,SIDTD_GSEL call SetSegDesc ; Set up SIDT alias descriptor mov ax,seg LAST call SegTo24 mov cx,0 ; 0 = 64K size mov ah,D_CODE0 mov bx,SVDMC_GSEL call SetSegDesc ; Set up LAST Code descriptor mov ax,seg LAST call SegTo24 mov cx,0 ; 0 = 64K size mov ah,D_DATA0 mov bx,SVDMD_GSEL call SetSegDesc ; Set up LAST Data descriptor ; The GDT and IDT pointers are setup up so that when CEMM gets turned on, ; the LGDT and LIDT instructions will have their correct pointers. ; mov ax,SGDT ; DS:SI point to the GDT's entry location. mov ds,ax mov si,SGDTD_GSEL mov ax,seg LAST ; ES:DI point to data strucutre used by the LGDT. mov es,ax assume es:LAST mov di,offset LAST:SGDT_Ptr movsd ; The 8 byte descriptor is copied over as is. movsd ; ; Since only the first 6 bytes of the GDT pointer is needed for the base and ; linear address, the upper 8 bits of the linear address must be copied down ; to its proper location. ; mov al,byte ptr es:[SGDT_Ptr][7] mov byte ptr es:[SGDT_Ptr][5],al ; ; The exact same operations are done for the IDT pointer. ; mov si,SIDTD_GSEL mov di,offset LAST:SIDT_Ptr movsd movsd mov al,byte ptr es:[SIDT_Ptr][7] mov byte ptr es:[SIDT_Ptr][5],al pushf mov cs:[ss_save],ss mov cs:[sp_save],sp cli ; ; load gdt and ldt base registers (DB 66h needed for 32 bit address) ; db 66h lgdt fword ptr CS:[SGDT_ptr] db 66h lidt fword ptr CS:[SIDT_ptr] ; ; go protected and enable paging - turn on bits in CR0 ; mov eax,cr0 or eax, MSW_PROTECT ; or EAX,imm32 ; PROT MODE mov cr0,eax ; far jump to flush prefetch, and reload CS db 0eah ; far jmp opcode dw offset LAST:spm1 ; offset dw SVDMC_GSEL ; selector spm1: ; We are now in protected mode. ; ; ; Intel shows DS,ES,FS,GS,and SS set up to make sure 'Real Mode' type ; access rights, and limit are installed. In this program, that happens ; to already be the case, but for general purposeness, VDMD_GSEL fits ; the bill. ; mov ax,SVDMD_GSEL ; selector with real mode attributes mov ds,ax mov es,ax mov ss,ax mov fs,ax mov gs,ax ; ; Switch back to real ; ; ; reset the PE bit ... ; mov eax,cr0 ; get CR0 and eax,07FFFFFFEh ; force real mode and shut down paging mov cr0,eax ; set CR0 ; flush prefetched instructions with: db 0EAh ; Far Jump opcode dw offset LAST:srl386_b ; destination offset dw LAST ; destination segment srl386_b: lidt fword ptr cs:[Sreal_idt] mov ss, cs:[ss_save] ; restore stack mov sp, cs:[sp_save] mov eax,cr3 ; get CR3 mov cr3,eax ; set CR3 => clear TLB popf ret segfixup endp LAST ends end
21.909434
79
0.564588
48a7fcf47ed0ce08b2b73aa6d96eb4628450c223
94
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/rint.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/rint.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/rint.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
SECTION code_fp_math48 PUBLIC _rint EXTERN cm48_sdccix_rint defc _rint = cm48_sdccix_rint
10.444444
29
0.840426
952d461c99e8dece60b927db694e384291f2f612
484
asm
Assembly
Documentation/Tutorial/cs50-hello.asm
geoffthorpe/ant-architecture
d85952e3050c352d5d715d9749171a335e6768f7
[ "BSD-3-Clause" ]
null
null
null
Documentation/Tutorial/cs50-hello.asm
geoffthorpe/ant-architecture
d85952e3050c352d5d715d9749171a335e6768f7
[ "BSD-3-Clause" ]
null
null
null
Documentation/Tutorial/cs50-hello.asm
geoffthorpe/ant-architecture
d85952e3050c352d5d715d9749171a335e6768f7
[ "BSD-3-Clause" ]
1
2020-07-15T04:09:05.000Z
2020-07-15T04:09:05.000Z
# Dan Ellard -- 11/2/96 # hello.asm-- A "Hello World" program. # Registers used: # r2 - holds the address of the string lc r2, $str_data # load the address of the string into r2 sys r2, SysPutStr # Print the characters in memory sys r0, SysHalt # Halt _data_: # Data for the program begins here: str_data: .byte 'H', 'e', 'l', 'l', 'o', ' ' .byte 'W', 'o', 'r', 'l', 'd', '\n', 0 # end of hello.asm
28.470588
72
0.524793
852addffaaeac67d83819c4dbd6f0d82622fad58
568
asm
Assembly
oeis/108/A108398.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/108/A108398.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/108/A108398.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A108398: a(n) = n*(1 + n^n)/2. ; 0,1,5,42,514,7815,139971,2882404,67108868,1743392205,50000000005,1569214188366,53496602689542,1968688192849651,77784047778906119,3284204177856445320,147573952589676412936,7031542226033862495513,354117672677668838178825,18794986728772979096677810,1048576000000000000000000010,61347163693052816474501806431,3755706651006415131363113959435,240125381998250988395082878471532,16004829322203409493388977674125324,1110223024625156540423631668090820325,80029554542693045040356765749202649101 mov $2,$0 pow $2,$0 add $2,1 mul $0,$2 div $0,2
63.111111
485
0.873239
1f25a78a7a8723922d1f5c27fa5e64e91b3b73b3
480
asm
Assembly
oeis/314/A314239.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/314/A314239.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/314/A314239.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A314239: Coordination sequence Gal.6.642.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by Jamie Morken(s3) ; 1,5,11,17,23,28,34,39,45,51,57,62,67,73,79,85,90,96,101,107,113,119,124,129,135,141,147,152,158,163,169,175,181,186,191,197,203,209,214,220,225,231,237,243,248,253,259,265,271,276 mov $1,$0 mul $0,13 add $0,5 div $0,11 mul $1,49 sub $1,6 div $1,11 add $1,1 add $0,$1
34.285714
181
0.714583
ccde3cc6efc94515ebba056c92e42cf29cc5f0d1
42
asm
Assembly
Assembler_Unit_Test/AND.asm
hackingotter/LC3-Simulator
dbb58929922149b29c0f0cf630d46261ed7cb01f
[ "MIT" ]
null
null
null
Assembler_Unit_Test/AND.asm
hackingotter/LC3-Simulator
dbb58929922149b29c0f0cf630d46261ed7cb01f
[ "MIT" ]
null
null
null
Assembler_Unit_Test/AND.asm
hackingotter/LC3-Simulator
dbb58929922149b29c0f0cf630d46261ed7cb01f
[ "MIT" ]
1
2018-09-22T23:01:40.000Z
2018-09-22T23:01:40.000Z
.ORIG x3000 AND R0,R7,R3 AND R1,R2,#3 .end
10.5
12
0.690476
c677571fda3c0e7c9e115e9d1206f56542517fc2
899
asm
Assembly
soft1.asm
Euno257/VTU-Microprocessor-and-Microcontroller-LAB-Programs
3ae4bc4da1262fad1bd4e3865ffe47c4d7485582
[ "MIT" ]
1
2021-04-20T03:18:33.000Z
2021-04-20T03:18:33.000Z
soft1.asm
Euno257/VTU-Microprocessor-and-Microcontroller-LAB-Programs
3ae4bc4da1262fad1bd4e3865ffe47c4d7485582
[ "MIT" ]
null
null
null
soft1.asm
Euno257/VTU-Microprocessor-and-Microcontroller-LAB-Programs
3ae4bc4da1262fad1bd4e3865ffe47c4d7485582
[ "MIT" ]
null
null
null
.MODEL SMALL .STACK .DATA MSG DB 10,13,'CURRENT DATE AND TIME IS= $' .CODE MOV AX,@DATA MOV DS,AX LEA DX,MSG MOV AH,09H INT 21H ;TIME MOV AH,2CH INT 21H MOV AL,CH CALL DISP MOV DL,':' MOV AH,02H INT 21H MOV AL,CL CALL DISP MOV DL,' ' MOV AH,02H INT 21H MOV DL,' ' MOV AH,02H INT 21H ;DAY MOV AH,2AH INT 21H MOV AL,DL CALL DISP MOV DL,'/' MOV AH,02H INT 21H ;MONTH MOV AH,2CH INT 21H MOV AL,DH CALL DISP MOV DL,'/' MOV AH,02H INT 21H ;YEAR MOV AH,2CH INT 21H ADD CX,0C30H MOV AL,CH CALL DISP MOV AL,CL CALL DISP MOV AH,4CH INT 21H DISP PROC NEAR AAM ADD AX,3030H MOV BX,AX MOV DL,BH MOV AH,02H INT 21H MOV DL,BL MOV AH,02H INT 21H RET DISP ENDP END
10.333333
44
0.510567
97add5c0682b301be4b89ddf18efc80c2ecba567
310
asm
Assembly
src/test_include/test3.asm
hra1129/zma
c2bfc79df45e1d4d01c6faa1b69216245a4e1d2c
[ "MIT" ]
8
2021-03-19T23:44:14.000Z
2022-03-22T07:29:02.000Z
src/test_include/test3.asm
hra1129/zma
c2bfc79df45e1d4d01c6faa1b69216245a4e1d2c
[ "MIT" ]
null
null
null
src/test_include/test3.asm
hra1129/zma
c2bfc79df45e1d4d01c6faa1b69216245a4e1d2c
[ "MIT" ]
1
2021-11-27T22:37:24.000Z
2021-11-27T22:37:24.000Z
; ----------------------------------------------------------------------------- ; test program ; ----------------------------------------------------------------------------- include "sub_repeat.asm" endr include "sub_macro.asm" endm include "sub_if.asm" endif include "sub_scope.asm" endscope
19.375
79
0.341935
6534152c8c389ee9d01669e317c17ee703a2318e
95,988
asm
Assembly
oslab6/obj/user/badsegment.asm
jasha64/OperatingSystems-lab
25a473adb754171d5c10c6bde391e0e07a2a43de
[ "MIT" ]
null
null
null
oslab6/obj/user/badsegment.asm
jasha64/OperatingSystems-lab
25a473adb754171d5c10c6bde391e0e07a2a43de
[ "MIT" ]
null
null
null
oslab6/obj/user/badsegment.asm
jasha64/OperatingSystems-lab
25a473adb754171d5c10c6bde391e0e07a2a43de
[ "MIT" ]
null
null
null
obj/user/badsegment.debug: 文件格式 elf32-i386 Disassembly of section .text: 00800020 <_start>: // starts us running when we are initially loaded into a new environment. .text .globl _start _start: // See if we were started with arguments on the stack cmpl $USTACKTOP, %esp 800020: 81 fc 00 e0 bf ee cmp $0xeebfe000,%esp jne args_exist 800026: 75 04 jne 80002c <args_exist> // If not, push dummy argc/argv arguments. // This happens when we are loaded by the kernel, // because the kernel does not know about passing arguments. pushl $0 800028: 6a 00 push $0x0 pushl $0 80002a: 6a 00 push $0x0 0080002c <args_exist>: args_exist: call libmain 80002c: e8 0d 00 00 00 call 80003e <libmain> 1: jmp 1b 800031: eb fe jmp 800031 <args_exist+0x5> 00800033 <umain>: #include <inc/lib.h> void umain(int argc, char **argv) { 800033: 55 push %ebp 800034: 89 e5 mov %esp,%ebp // Try to load the kernel's TSS selector into the DS register. asm volatile("movw $0x28,%ax; movw %ax,%ds"); 800036: 66 b8 28 00 mov $0x28,%ax 80003a: 8e d8 mov %eax,%ds } 80003c: 5d pop %ebp 80003d: c3 ret 0080003e <libmain>: const volatile struct Env *thisenv; const char *binaryname = "<unknown>"; void libmain(int argc, char **argv) { 80003e: 55 push %ebp 80003f: 89 e5 mov %esp,%ebp 800041: 56 push %esi 800042: 53 push %ebx 800043: 8b 5d 08 mov 0x8(%ebp),%ebx 800046: 8b 75 0c mov 0xc(%ebp),%esi // set thisenv to point at our Env structure in envs[]. // LAB 3: Your code here. envid_t envid = sys_getenvid(); 800049: e8 c6 00 00 00 call 800114 <sys_getenvid> thisenv = envs + ENVX(envid); 80004e: 25 ff 03 00 00 and $0x3ff,%eax 800053: 6b c0 7c imul $0x7c,%eax,%eax 800056: 05 00 00 c0 ee add $0xeec00000,%eax 80005b: a3 04 20 80 00 mov %eax,0x802004 // save the name of the program so that panic() can use it if (argc > 0) 800060: 85 db test %ebx,%ebx 800062: 7e 07 jle 80006b <libmain+0x2d> binaryname = argv[0]; 800064: 8b 06 mov (%esi),%eax 800066: a3 00 20 80 00 mov %eax,0x802000 // call user main routine umain(argc, argv); 80006b: 83 ec 08 sub $0x8,%esp 80006e: 56 push %esi 80006f: 53 push %ebx 800070: e8 be ff ff ff call 800033 <umain> // exit gracefully exit(); 800075: e8 0a 00 00 00 call 800084 <exit> } 80007a: 83 c4 10 add $0x10,%esp 80007d: 8d 65 f8 lea -0x8(%ebp),%esp 800080: 5b pop %ebx 800081: 5e pop %esi 800082: 5d pop %ebp 800083: c3 ret 00800084 <exit>: #include <inc/lib.h> void exit(void) { 800084: 55 push %ebp 800085: 89 e5 mov %esp,%ebp 800087: 83 ec 14 sub $0x14,%esp // close_all(); sys_env_destroy(0); 80008a: 6a 00 push $0x0 80008c: e8 42 00 00 00 call 8000d3 <sys_env_destroy> } 800091: 83 c4 10 add $0x10,%esp 800094: c9 leave 800095: c3 ret 00800096 <sys_cputs>: return ret; } void sys_cputs(const char *s, size_t len) { 800096: 55 push %ebp 800097: 89 e5 mov %esp,%ebp 800099: 57 push %edi 80009a: 56 push %esi 80009b: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 80009c: b8 00 00 00 00 mov $0x0,%eax 8000a1: 8b 55 08 mov 0x8(%ebp),%edx 8000a4: 8b 4d 0c mov 0xc(%ebp),%ecx 8000a7: 89 c3 mov %eax,%ebx 8000a9: 89 c7 mov %eax,%edi 8000ab: 89 c6 mov %eax,%esi 8000ad: cd 30 int $0x30 syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0); } 8000af: 5b pop %ebx 8000b0: 5e pop %esi 8000b1: 5f pop %edi 8000b2: 5d pop %ebp 8000b3: c3 ret 008000b4 <sys_cgetc>: int sys_cgetc(void) { 8000b4: 55 push %ebp 8000b5: 89 e5 mov %esp,%ebp 8000b7: 57 push %edi 8000b8: 56 push %esi 8000b9: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 8000ba: ba 00 00 00 00 mov $0x0,%edx 8000bf: b8 01 00 00 00 mov $0x1,%eax 8000c4: 89 d1 mov %edx,%ecx 8000c6: 89 d3 mov %edx,%ebx 8000c8: 89 d7 mov %edx,%edi 8000ca: 89 d6 mov %edx,%esi 8000cc: cd 30 int $0x30 return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0); } 8000ce: 5b pop %ebx 8000cf: 5e pop %esi 8000d0: 5f pop %edi 8000d1: 5d pop %ebp 8000d2: c3 ret 008000d3 <sys_env_destroy>: int sys_env_destroy(envid_t envid) { 8000d3: 55 push %ebp 8000d4: 89 e5 mov %esp,%ebp 8000d6: 57 push %edi 8000d7: 56 push %esi 8000d8: 53 push %ebx 8000d9: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 8000dc: b9 00 00 00 00 mov $0x0,%ecx 8000e1: 8b 55 08 mov 0x8(%ebp),%edx 8000e4: b8 03 00 00 00 mov $0x3,%eax 8000e9: 89 cb mov %ecx,%ebx 8000eb: 89 cf mov %ecx,%edi 8000ed: 89 ce mov %ecx,%esi 8000ef: cd 30 int $0x30 if(check && ret > 0) 8000f1: 85 c0 test %eax,%eax 8000f3: 7f 08 jg 8000fd <sys_env_destroy+0x2a> return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0); } 8000f5: 8d 65 f4 lea -0xc(%ebp),%esp 8000f8: 5b pop %ebx 8000f9: 5e pop %esi 8000fa: 5f pop %edi 8000fb: 5d pop %ebp 8000fc: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 8000fd: 83 ec 0c sub $0xc,%esp 800100: 50 push %eax 800101: 6a 03 push $0x3 800103: 68 ca 0f 80 00 push $0x800fca 800108: 6a 23 push $0x23 80010a: 68 e7 0f 80 00 push $0x800fe7 80010f: e8 2f 02 00 00 call 800343 <_panic> 00800114 <sys_getenvid>: envid_t sys_getenvid(void) { 800114: 55 push %ebp 800115: 89 e5 mov %esp,%ebp 800117: 57 push %edi 800118: 56 push %esi 800119: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 80011a: ba 00 00 00 00 mov $0x0,%edx 80011f: b8 02 00 00 00 mov $0x2,%eax 800124: 89 d1 mov %edx,%ecx 800126: 89 d3 mov %edx,%ebx 800128: 89 d7 mov %edx,%edi 80012a: 89 d6 mov %edx,%esi 80012c: cd 30 int $0x30 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0); } 80012e: 5b pop %ebx 80012f: 5e pop %esi 800130: 5f pop %edi 800131: 5d pop %ebp 800132: c3 ret 00800133 <sys_yield>: void sys_yield(void) { 800133: 55 push %ebp 800134: 89 e5 mov %esp,%ebp 800136: 57 push %edi 800137: 56 push %esi 800138: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 800139: ba 00 00 00 00 mov $0x0,%edx 80013e: b8 0b 00 00 00 mov $0xb,%eax 800143: 89 d1 mov %edx,%ecx 800145: 89 d3 mov %edx,%ebx 800147: 89 d7 mov %edx,%edi 800149: 89 d6 mov %edx,%esi 80014b: cd 30 int $0x30 syscall(SYS_yield, 0, 0, 0, 0, 0, 0); } 80014d: 5b pop %ebx 80014e: 5e pop %esi 80014f: 5f pop %edi 800150: 5d pop %ebp 800151: c3 ret 00800152 <sys_page_alloc>: int sys_page_alloc(envid_t envid, void *va, int perm) { 800152: 55 push %ebp 800153: 89 e5 mov %esp,%ebp 800155: 57 push %edi 800156: 56 push %esi 800157: 53 push %ebx 800158: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 80015b: be 00 00 00 00 mov $0x0,%esi 800160: 8b 55 08 mov 0x8(%ebp),%edx 800163: 8b 4d 0c mov 0xc(%ebp),%ecx 800166: b8 04 00 00 00 mov $0x4,%eax 80016b: 8b 5d 10 mov 0x10(%ebp),%ebx 80016e: 89 f7 mov %esi,%edi 800170: cd 30 int $0x30 if(check && ret > 0) 800172: 85 c0 test %eax,%eax 800174: 7f 08 jg 80017e <sys_page_alloc+0x2c> return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0); } 800176: 8d 65 f4 lea -0xc(%ebp),%esp 800179: 5b pop %ebx 80017a: 5e pop %esi 80017b: 5f pop %edi 80017c: 5d pop %ebp 80017d: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 80017e: 83 ec 0c sub $0xc,%esp 800181: 50 push %eax 800182: 6a 04 push $0x4 800184: 68 ca 0f 80 00 push $0x800fca 800189: 6a 23 push $0x23 80018b: 68 e7 0f 80 00 push $0x800fe7 800190: e8 ae 01 00 00 call 800343 <_panic> 00800195 <sys_page_map>: int sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm) { 800195: 55 push %ebp 800196: 89 e5 mov %esp,%ebp 800198: 57 push %edi 800199: 56 push %esi 80019a: 53 push %ebx 80019b: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 80019e: 8b 55 08 mov 0x8(%ebp),%edx 8001a1: 8b 4d 0c mov 0xc(%ebp),%ecx 8001a4: b8 05 00 00 00 mov $0x5,%eax 8001a9: 8b 5d 10 mov 0x10(%ebp),%ebx 8001ac: 8b 7d 14 mov 0x14(%ebp),%edi 8001af: 8b 75 18 mov 0x18(%ebp),%esi 8001b2: cd 30 int $0x30 if(check && ret > 0) 8001b4: 85 c0 test %eax,%eax 8001b6: 7f 08 jg 8001c0 <sys_page_map+0x2b> return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm); } 8001b8: 8d 65 f4 lea -0xc(%ebp),%esp 8001bb: 5b pop %ebx 8001bc: 5e pop %esi 8001bd: 5f pop %edi 8001be: 5d pop %ebp 8001bf: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 8001c0: 83 ec 0c sub $0xc,%esp 8001c3: 50 push %eax 8001c4: 6a 05 push $0x5 8001c6: 68 ca 0f 80 00 push $0x800fca 8001cb: 6a 23 push $0x23 8001cd: 68 e7 0f 80 00 push $0x800fe7 8001d2: e8 6c 01 00 00 call 800343 <_panic> 008001d7 <sys_page_unmap>: int sys_page_unmap(envid_t envid, void *va) { 8001d7: 55 push %ebp 8001d8: 89 e5 mov %esp,%ebp 8001da: 57 push %edi 8001db: 56 push %esi 8001dc: 53 push %ebx 8001dd: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 8001e0: bb 00 00 00 00 mov $0x0,%ebx 8001e5: 8b 55 08 mov 0x8(%ebp),%edx 8001e8: 8b 4d 0c mov 0xc(%ebp),%ecx 8001eb: b8 06 00 00 00 mov $0x6,%eax 8001f0: 89 df mov %ebx,%edi 8001f2: 89 de mov %ebx,%esi 8001f4: cd 30 int $0x30 if(check && ret > 0) 8001f6: 85 c0 test %eax,%eax 8001f8: 7f 08 jg 800202 <sys_page_unmap+0x2b> return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0); } 8001fa: 8d 65 f4 lea -0xc(%ebp),%esp 8001fd: 5b pop %ebx 8001fe: 5e pop %esi 8001ff: 5f pop %edi 800200: 5d pop %ebp 800201: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 800202: 83 ec 0c sub $0xc,%esp 800205: 50 push %eax 800206: 6a 06 push $0x6 800208: 68 ca 0f 80 00 push $0x800fca 80020d: 6a 23 push $0x23 80020f: 68 e7 0f 80 00 push $0x800fe7 800214: e8 2a 01 00 00 call 800343 <_panic> 00800219 <sys_env_set_status>: // sys_exofork is inlined in lib.h int sys_env_set_status(envid_t envid, int status) { 800219: 55 push %ebp 80021a: 89 e5 mov %esp,%ebp 80021c: 57 push %edi 80021d: 56 push %esi 80021e: 53 push %ebx 80021f: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 800222: bb 00 00 00 00 mov $0x0,%ebx 800227: 8b 55 08 mov 0x8(%ebp),%edx 80022a: 8b 4d 0c mov 0xc(%ebp),%ecx 80022d: b8 08 00 00 00 mov $0x8,%eax 800232: 89 df mov %ebx,%edi 800234: 89 de mov %ebx,%esi 800236: cd 30 int $0x30 if(check && ret > 0) 800238: 85 c0 test %eax,%eax 80023a: 7f 08 jg 800244 <sys_env_set_status+0x2b> return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0); } 80023c: 8d 65 f4 lea -0xc(%ebp),%esp 80023f: 5b pop %ebx 800240: 5e pop %esi 800241: 5f pop %edi 800242: 5d pop %ebp 800243: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 800244: 83 ec 0c sub $0xc,%esp 800247: 50 push %eax 800248: 6a 08 push $0x8 80024a: 68 ca 0f 80 00 push $0x800fca 80024f: 6a 23 push $0x23 800251: 68 e7 0f 80 00 push $0x800fe7 800256: e8 e8 00 00 00 call 800343 <_panic> 0080025b <sys_env_set_trapframe>: int sys_env_set_trapframe(envid_t envid, struct Trapframe *tf) { 80025b: 55 push %ebp 80025c: 89 e5 mov %esp,%ebp 80025e: 57 push %edi 80025f: 56 push %esi 800260: 53 push %ebx 800261: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 800264: bb 00 00 00 00 mov $0x0,%ebx 800269: 8b 55 08 mov 0x8(%ebp),%edx 80026c: 8b 4d 0c mov 0xc(%ebp),%ecx 80026f: b8 09 00 00 00 mov $0x9,%eax 800274: 89 df mov %ebx,%edi 800276: 89 de mov %ebx,%esi 800278: cd 30 int $0x30 if(check && ret > 0) 80027a: 85 c0 test %eax,%eax 80027c: 7f 08 jg 800286 <sys_env_set_trapframe+0x2b> return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0); } 80027e: 8d 65 f4 lea -0xc(%ebp),%esp 800281: 5b pop %ebx 800282: 5e pop %esi 800283: 5f pop %edi 800284: 5d pop %ebp 800285: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 800286: 83 ec 0c sub $0xc,%esp 800289: 50 push %eax 80028a: 6a 09 push $0x9 80028c: 68 ca 0f 80 00 push $0x800fca 800291: 6a 23 push $0x23 800293: 68 e7 0f 80 00 push $0x800fe7 800298: e8 a6 00 00 00 call 800343 <_panic> 0080029d <sys_env_set_pgfault_upcall>: int sys_env_set_pgfault_upcall(envid_t envid, void *upcall) { 80029d: 55 push %ebp 80029e: 89 e5 mov %esp,%ebp 8002a0: 57 push %edi 8002a1: 56 push %esi 8002a2: 53 push %ebx 8002a3: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 8002a6: bb 00 00 00 00 mov $0x0,%ebx 8002ab: 8b 55 08 mov 0x8(%ebp),%edx 8002ae: 8b 4d 0c mov 0xc(%ebp),%ecx 8002b1: b8 0a 00 00 00 mov $0xa,%eax 8002b6: 89 df mov %ebx,%edi 8002b8: 89 de mov %ebx,%esi 8002ba: cd 30 int $0x30 if(check && ret > 0) 8002bc: 85 c0 test %eax,%eax 8002be: 7f 08 jg 8002c8 <sys_env_set_pgfault_upcall+0x2b> return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0); } 8002c0: 8d 65 f4 lea -0xc(%ebp),%esp 8002c3: 5b pop %ebx 8002c4: 5e pop %esi 8002c5: 5f pop %edi 8002c6: 5d pop %ebp 8002c7: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 8002c8: 83 ec 0c sub $0xc,%esp 8002cb: 50 push %eax 8002cc: 6a 0a push $0xa 8002ce: 68 ca 0f 80 00 push $0x800fca 8002d3: 6a 23 push $0x23 8002d5: 68 e7 0f 80 00 push $0x800fe7 8002da: e8 64 00 00 00 call 800343 <_panic> 008002df <sys_ipc_try_send>: int sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm) { 8002df: 55 push %ebp 8002e0: 89 e5 mov %esp,%ebp 8002e2: 57 push %edi 8002e3: 56 push %esi 8002e4: 53 push %ebx asm volatile("int %1\n" //执行int T_SYSCALL指令 8002e5: 8b 55 08 mov 0x8(%ebp),%edx 8002e8: 8b 4d 0c mov 0xc(%ebp),%ecx 8002eb: b8 0c 00 00 00 mov $0xc,%eax 8002f0: be 00 00 00 00 mov $0x0,%esi 8002f5: 8b 5d 10 mov 0x10(%ebp),%ebx 8002f8: 8b 7d 14 mov 0x14(%ebp),%edi 8002fb: cd 30 int $0x30 return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0); } 8002fd: 5b pop %ebx 8002fe: 5e pop %esi 8002ff: 5f pop %edi 800300: 5d pop %ebp 800301: c3 ret 00800302 <sys_ipc_recv>: int sys_ipc_recv(void *dstva) { 800302: 55 push %ebp 800303: 89 e5 mov %esp,%ebp 800305: 57 push %edi 800306: 56 push %esi 800307: 53 push %ebx 800308: 83 ec 0c sub $0xc,%esp asm volatile("int %1\n" //执行int T_SYSCALL指令 80030b: b9 00 00 00 00 mov $0x0,%ecx 800310: 8b 55 08 mov 0x8(%ebp),%edx 800313: b8 0d 00 00 00 mov $0xd,%eax 800318: 89 cb mov %ecx,%ebx 80031a: 89 cf mov %ecx,%edi 80031c: 89 ce mov %ecx,%esi 80031e: cd 30 int $0x30 if(check && ret > 0) 800320: 85 c0 test %eax,%eax 800322: 7f 08 jg 80032c <sys_ipc_recv+0x2a> return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0); } 800324: 8d 65 f4 lea -0xc(%ebp),%esp 800327: 5b pop %ebx 800328: 5e pop %esi 800329: 5f pop %edi 80032a: 5d pop %ebp 80032b: c3 ret panic("syscall %d returned %d (> 0)", num, ret); 80032c: 83 ec 0c sub $0xc,%esp 80032f: 50 push %eax 800330: 6a 0d push $0xd 800332: 68 ca 0f 80 00 push $0x800fca 800337: 6a 23 push $0x23 800339: 68 e7 0f 80 00 push $0x800fe7 80033e: e8 00 00 00 00 call 800343 <_panic> 00800343 <_panic>: * It prints "panic: <message>", then causes a breakpoint exception, * which causes JOS to enter the JOS kernel monitor. */ void _panic(const char *file, int line, const char *fmt, ...) { 800343: 55 push %ebp 800344: 89 e5 mov %esp,%ebp 800346: 56 push %esi 800347: 53 push %ebx va_list ap; va_start(ap, fmt); 800348: 8d 5d 14 lea 0x14(%ebp),%ebx // Print the panic message cprintf("[%08x] user panic in %s at %s:%d: ", 80034b: 8b 35 00 20 80 00 mov 0x802000,%esi 800351: e8 be fd ff ff call 800114 <sys_getenvid> 800356: 83 ec 0c sub $0xc,%esp 800359: ff 75 0c pushl 0xc(%ebp) 80035c: ff 75 08 pushl 0x8(%ebp) 80035f: 56 push %esi 800360: 50 push %eax 800361: 68 f8 0f 80 00 push $0x800ff8 800366: e8 b3 00 00 00 call 80041e <cprintf> sys_getenvid(), binaryname, file, line); vcprintf(fmt, ap); 80036b: 83 c4 18 add $0x18,%esp 80036e: 53 push %ebx 80036f: ff 75 10 pushl 0x10(%ebp) 800372: e8 56 00 00 00 call 8003cd <vcprintf> cprintf("\n"); 800377: c7 04 24 1b 10 80 00 movl $0x80101b,(%esp) 80037e: e8 9b 00 00 00 call 80041e <cprintf> 800383: 83 c4 10 add $0x10,%esp // Cause a breakpoint exception while (1) asm volatile("int3"); 800386: cc int3 800387: eb fd jmp 800386 <_panic+0x43> 00800389 <putch>: }; static void putch(int ch, struct printbuf *b) { 800389: 55 push %ebp 80038a: 89 e5 mov %esp,%ebp 80038c: 53 push %ebx 80038d: 83 ec 04 sub $0x4,%esp 800390: 8b 5d 0c mov 0xc(%ebp),%ebx b->buf[b->idx++] = ch; 800393: 8b 13 mov (%ebx),%edx 800395: 8d 42 01 lea 0x1(%edx),%eax 800398: 89 03 mov %eax,(%ebx) 80039a: 8b 4d 08 mov 0x8(%ebp),%ecx 80039d: 88 4c 13 08 mov %cl,0x8(%ebx,%edx,1) if (b->idx == 256-1) { 8003a1: 3d ff 00 00 00 cmp $0xff,%eax 8003a6: 74 09 je 8003b1 <putch+0x28> sys_cputs(b->buf, b->idx); b->idx = 0; } b->cnt++; 8003a8: 83 43 04 01 addl $0x1,0x4(%ebx) } 8003ac: 8b 5d fc mov -0x4(%ebp),%ebx 8003af: c9 leave 8003b0: c3 ret sys_cputs(b->buf, b->idx); 8003b1: 83 ec 08 sub $0x8,%esp 8003b4: 68 ff 00 00 00 push $0xff 8003b9: 8d 43 08 lea 0x8(%ebx),%eax 8003bc: 50 push %eax 8003bd: e8 d4 fc ff ff call 800096 <sys_cputs> b->idx = 0; 8003c2: c7 03 00 00 00 00 movl $0x0,(%ebx) 8003c8: 83 c4 10 add $0x10,%esp 8003cb: eb db jmp 8003a8 <putch+0x1f> 008003cd <vcprintf>: int vcprintf(const char *fmt, va_list ap) { 8003cd: 55 push %ebp 8003ce: 89 e5 mov %esp,%ebp 8003d0: 81 ec 18 01 00 00 sub $0x118,%esp struct printbuf b; b.idx = 0; 8003d6: c7 85 f0 fe ff ff 00 movl $0x0,-0x110(%ebp) 8003dd: 00 00 00 b.cnt = 0; 8003e0: c7 85 f4 fe ff ff 00 movl $0x0,-0x10c(%ebp) 8003e7: 00 00 00 vprintfmt((void*)putch, &b, fmt, ap); 8003ea: ff 75 0c pushl 0xc(%ebp) 8003ed: ff 75 08 pushl 0x8(%ebp) 8003f0: 8d 85 f0 fe ff ff lea -0x110(%ebp),%eax 8003f6: 50 push %eax 8003f7: 68 89 03 80 00 push $0x800389 8003fc: e8 1a 01 00 00 call 80051b <vprintfmt> sys_cputs(b.buf, b.idx); 800401: 83 c4 08 add $0x8,%esp 800404: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80040a: 8d 85 f8 fe ff ff lea -0x108(%ebp),%eax 800410: 50 push %eax 800411: e8 80 fc ff ff call 800096 <sys_cputs> return b.cnt; } 800416: 8b 85 f4 fe ff ff mov -0x10c(%ebp),%eax 80041c: c9 leave 80041d: c3 ret 0080041e <cprintf>: int cprintf(const char *fmt, ...) { 80041e: 55 push %ebp 80041f: 89 e5 mov %esp,%ebp 800421: 83 ec 10 sub $0x10,%esp va_list ap; int cnt; va_start(ap, fmt); 800424: 8d 45 0c lea 0xc(%ebp),%eax cnt = vcprintf(fmt, ap); 800427: 50 push %eax 800428: ff 75 08 pushl 0x8(%ebp) 80042b: e8 9d ff ff ff call 8003cd <vcprintf> va_end(ap); return cnt; } 800430: c9 leave 800431: c3 ret 00800432 <printnum>: * using specified putch function and associated pointer putdat. */ static void printnum(void (*putch)(int, void*), void *putdat, unsigned long long num, unsigned base, int width, int padc) { 800432: 55 push %ebp 800433: 89 e5 mov %esp,%ebp 800435: 57 push %edi 800436: 56 push %esi 800437: 53 push %ebx 800438: 83 ec 1c sub $0x1c,%esp 80043b: 89 c7 mov %eax,%edi 80043d: 89 d6 mov %edx,%esi 80043f: 8b 45 08 mov 0x8(%ebp),%eax 800442: 8b 55 0c mov 0xc(%ebp),%edx 800445: 89 45 d8 mov %eax,-0x28(%ebp) 800448: 89 55 dc mov %edx,-0x24(%ebp) // first recursively print all preceding (more significant) digits if (num >= base) { 80044b: 8b 4d 10 mov 0x10(%ebp),%ecx 80044e: bb 00 00 00 00 mov $0x0,%ebx 800453: 89 4d e0 mov %ecx,-0x20(%ebp) 800456: 89 5d e4 mov %ebx,-0x1c(%ebp) 800459: 39 d3 cmp %edx,%ebx 80045b: 72 05 jb 800462 <printnum+0x30> 80045d: 39 45 10 cmp %eax,0x10(%ebp) 800460: 77 7a ja 8004dc <printnum+0xaa> printnum(putch, putdat, num / base, base, width - 1, padc); 800462: 83 ec 0c sub $0xc,%esp 800465: ff 75 18 pushl 0x18(%ebp) 800468: 8b 45 14 mov 0x14(%ebp),%eax 80046b: 8d 58 ff lea -0x1(%eax),%ebx 80046e: 53 push %ebx 80046f: ff 75 10 pushl 0x10(%ebp) 800472: 83 ec 08 sub $0x8,%esp 800475: ff 75 e4 pushl -0x1c(%ebp) 800478: ff 75 e0 pushl -0x20(%ebp) 80047b: ff 75 dc pushl -0x24(%ebp) 80047e: ff 75 d8 pushl -0x28(%ebp) 800481: e8 fa 08 00 00 call 800d80 <__udivdi3> 800486: 83 c4 18 add $0x18,%esp 800489: 52 push %edx 80048a: 50 push %eax 80048b: 89 f2 mov %esi,%edx 80048d: 89 f8 mov %edi,%eax 80048f: e8 9e ff ff ff call 800432 <printnum> 800494: 83 c4 20 add $0x20,%esp 800497: eb 13 jmp 8004ac <printnum+0x7a> } else { // print any needed pad characters before first digit while (--width > 0) putch(padc, putdat); 800499: 83 ec 08 sub $0x8,%esp 80049c: 56 push %esi 80049d: ff 75 18 pushl 0x18(%ebp) 8004a0: ff d7 call *%edi 8004a2: 83 c4 10 add $0x10,%esp while (--width > 0) 8004a5: 83 eb 01 sub $0x1,%ebx 8004a8: 85 db test %ebx,%ebx 8004aa: 7f ed jg 800499 <printnum+0x67> } // then print this (the least significant) digit putch("0123456789abcdef"[num % base], putdat); 8004ac: 83 ec 08 sub $0x8,%esp 8004af: 56 push %esi 8004b0: 83 ec 04 sub $0x4,%esp 8004b3: ff 75 e4 pushl -0x1c(%ebp) 8004b6: ff 75 e0 pushl -0x20(%ebp) 8004b9: ff 75 dc pushl -0x24(%ebp) 8004bc: ff 75 d8 pushl -0x28(%ebp) 8004bf: e8 dc 09 00 00 call 800ea0 <__umoddi3> 8004c4: 83 c4 14 add $0x14,%esp 8004c7: 0f be 80 1d 10 80 00 movsbl 0x80101d(%eax),%eax 8004ce: 50 push %eax 8004cf: ff d7 call *%edi } 8004d1: 83 c4 10 add $0x10,%esp 8004d4: 8d 65 f4 lea -0xc(%ebp),%esp 8004d7: 5b pop %ebx 8004d8: 5e pop %esi 8004d9: 5f pop %edi 8004da: 5d pop %ebp 8004db: c3 ret 8004dc: 8b 5d 14 mov 0x14(%ebp),%ebx 8004df: eb c4 jmp 8004a5 <printnum+0x73> 008004e1 <sprintputch>: int cnt; }; static void sprintputch(int ch, struct sprintbuf *b) { 8004e1: 55 push %ebp 8004e2: 89 e5 mov %esp,%ebp 8004e4: 8b 45 0c mov 0xc(%ebp),%eax b->cnt++; 8004e7: 83 40 08 01 addl $0x1,0x8(%eax) if (b->buf < b->ebuf) 8004eb: 8b 10 mov (%eax),%edx 8004ed: 3b 50 04 cmp 0x4(%eax),%edx 8004f0: 73 0a jae 8004fc <sprintputch+0x1b> *b->buf++ = ch; 8004f2: 8d 4a 01 lea 0x1(%edx),%ecx 8004f5: 89 08 mov %ecx,(%eax) 8004f7: 8b 45 08 mov 0x8(%ebp),%eax 8004fa: 88 02 mov %al,(%edx) } 8004fc: 5d pop %ebp 8004fd: c3 ret 008004fe <printfmt>: { 8004fe: 55 push %ebp 8004ff: 89 e5 mov %esp,%ebp 800501: 83 ec 08 sub $0x8,%esp va_start(ap, fmt); 800504: 8d 45 14 lea 0x14(%ebp),%eax vprintfmt(putch, putdat, fmt, ap); 800507: 50 push %eax 800508: ff 75 10 pushl 0x10(%ebp) 80050b: ff 75 0c pushl 0xc(%ebp) 80050e: ff 75 08 pushl 0x8(%ebp) 800511: e8 05 00 00 00 call 80051b <vprintfmt> } 800516: 83 c4 10 add $0x10,%esp 800519: c9 leave 80051a: c3 ret 0080051b <vprintfmt>: { 80051b: 55 push %ebp 80051c: 89 e5 mov %esp,%ebp 80051e: 57 push %edi 80051f: 56 push %esi 800520: 53 push %ebx 800521: 83 ec 2c sub $0x2c,%esp 800524: 8b 75 08 mov 0x8(%ebp),%esi 800527: 8b 5d 0c mov 0xc(%ebp),%ebx 80052a: 8b 7d 10 mov 0x10(%ebp),%edi 80052d: e9 c1 03 00 00 jmp 8008f3 <vprintfmt+0x3d8> padc = ' '; 800532: c6 45 d4 20 movb $0x20,-0x2c(%ebp) altflag = 0; 800536: c7 45 d8 00 00 00 00 movl $0x0,-0x28(%ebp) precision = -1; 80053d: c7 45 d0 ff ff ff ff movl $0xffffffff,-0x30(%ebp) width = -1; 800544: c7 45 e0 ff ff ff ff movl $0xffffffff,-0x20(%ebp) lflag = 0; 80054b: b9 00 00 00 00 mov $0x0,%ecx switch (ch = *(unsigned char *) fmt++) { 800550: 8d 47 01 lea 0x1(%edi),%eax 800553: 89 45 e4 mov %eax,-0x1c(%ebp) 800556: 0f b6 17 movzbl (%edi),%edx 800559: 8d 42 dd lea -0x23(%edx),%eax 80055c: 3c 55 cmp $0x55,%al 80055e: 0f 87 12 04 00 00 ja 800976 <vprintfmt+0x45b> 800564: 0f b6 c0 movzbl %al,%eax 800567: ff 24 85 60 11 80 00 jmp *0x801160(,%eax,4) 80056e: 8b 7d e4 mov -0x1c(%ebp),%edi padc = '-'; 800571: c6 45 d4 2d movb $0x2d,-0x2c(%ebp) 800575: eb d9 jmp 800550 <vprintfmt+0x35> switch (ch = *(unsigned char *) fmt++) { 800577: 8b 7d e4 mov -0x1c(%ebp),%edi padc = '0'; 80057a: c6 45 d4 30 movb $0x30,-0x2c(%ebp) 80057e: eb d0 jmp 800550 <vprintfmt+0x35> switch (ch = *(unsigned char *) fmt++) { 800580: 0f b6 d2 movzbl %dl,%edx 800583: 8b 7d e4 mov -0x1c(%ebp),%edi for (precision = 0; ; ++fmt) { 800586: b8 00 00 00 00 mov $0x0,%eax 80058b: 89 4d e4 mov %ecx,-0x1c(%ebp) precision = precision * 10 + ch - '0'; 80058e: 8d 04 80 lea (%eax,%eax,4),%eax 800591: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax ch = *fmt; 800595: 0f be 17 movsbl (%edi),%edx if (ch < '0' || ch > '9') 800598: 8d 4a d0 lea -0x30(%edx),%ecx 80059b: 83 f9 09 cmp $0x9,%ecx 80059e: 77 55 ja 8005f5 <vprintfmt+0xda> for (precision = 0; ; ++fmt) { 8005a0: 83 c7 01 add $0x1,%edi precision = precision * 10 + ch - '0'; 8005a3: eb e9 jmp 80058e <vprintfmt+0x73> precision = va_arg(ap, int); 8005a5: 8b 45 14 mov 0x14(%ebp),%eax 8005a8: 8b 00 mov (%eax),%eax 8005aa: 89 45 d0 mov %eax,-0x30(%ebp) 8005ad: 8b 45 14 mov 0x14(%ebp),%eax 8005b0: 8d 40 04 lea 0x4(%eax),%eax 8005b3: 89 45 14 mov %eax,0x14(%ebp) switch (ch = *(unsigned char *) fmt++) { 8005b6: 8b 7d e4 mov -0x1c(%ebp),%edi if (width < 0) 8005b9: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) 8005bd: 79 91 jns 800550 <vprintfmt+0x35> width = precision, precision = -1; 8005bf: 8b 45 d0 mov -0x30(%ebp),%eax 8005c2: 89 45 e0 mov %eax,-0x20(%ebp) 8005c5: c7 45 d0 ff ff ff ff movl $0xffffffff,-0x30(%ebp) 8005cc: eb 82 jmp 800550 <vprintfmt+0x35> 8005ce: 8b 45 e0 mov -0x20(%ebp),%eax 8005d1: 85 c0 test %eax,%eax 8005d3: ba 00 00 00 00 mov $0x0,%edx 8005d8: 0f 49 d0 cmovns %eax,%edx 8005db: 89 55 e0 mov %edx,-0x20(%ebp) switch (ch = *(unsigned char *) fmt++) { 8005de: 8b 7d e4 mov -0x1c(%ebp),%edi 8005e1: e9 6a ff ff ff jmp 800550 <vprintfmt+0x35> 8005e6: 8b 7d e4 mov -0x1c(%ebp),%edi altflag = 1; 8005e9: c7 45 d8 01 00 00 00 movl $0x1,-0x28(%ebp) goto reswitch; 8005f0: e9 5b ff ff ff jmp 800550 <vprintfmt+0x35> 8005f5: 8b 4d e4 mov -0x1c(%ebp),%ecx 8005f8: 89 45 d0 mov %eax,-0x30(%ebp) 8005fb: eb bc jmp 8005b9 <vprintfmt+0x9e> lflag++; 8005fd: 83 c1 01 add $0x1,%ecx switch (ch = *(unsigned char *) fmt++) { 800600: 8b 7d e4 mov -0x1c(%ebp),%edi goto reswitch; 800603: e9 48 ff ff ff jmp 800550 <vprintfmt+0x35> putch(va_arg(ap, int), putdat); 800608: 8b 45 14 mov 0x14(%ebp),%eax 80060b: 8d 78 04 lea 0x4(%eax),%edi 80060e: 83 ec 08 sub $0x8,%esp 800611: 53 push %ebx 800612: ff 30 pushl (%eax) 800614: ff d6 call *%esi break; 800616: 83 c4 10 add $0x10,%esp putch(va_arg(ap, int), putdat); 800619: 89 7d 14 mov %edi,0x14(%ebp) break; 80061c: e9 cf 02 00 00 jmp 8008f0 <vprintfmt+0x3d5> err = va_arg(ap, int); 800621: 8b 45 14 mov 0x14(%ebp),%eax 800624: 8d 78 04 lea 0x4(%eax),%edi 800627: 8b 00 mov (%eax),%eax 800629: 99 cltd 80062a: 31 d0 xor %edx,%eax 80062c: 29 d0 sub %edx,%eax if (err >= MAXERROR || (p = error_string[err]) == NULL) 80062e: 83 f8 0f cmp $0xf,%eax 800631: 7f 23 jg 800656 <vprintfmt+0x13b> 800633: 8b 14 85 c0 12 80 00 mov 0x8012c0(,%eax,4),%edx 80063a: 85 d2 test %edx,%edx 80063c: 74 18 je 800656 <vprintfmt+0x13b> printfmt(putch, putdat, "%s", p); 80063e: 52 push %edx 80063f: 68 3e 10 80 00 push $0x80103e 800644: 53 push %ebx 800645: 56 push %esi 800646: e8 b3 fe ff ff call 8004fe <printfmt> 80064b: 83 c4 10 add $0x10,%esp err = va_arg(ap, int); 80064e: 89 7d 14 mov %edi,0x14(%ebp) 800651: e9 9a 02 00 00 jmp 8008f0 <vprintfmt+0x3d5> printfmt(putch, putdat, "error %d", err); 800656: 50 push %eax 800657: 68 35 10 80 00 push $0x801035 80065c: 53 push %ebx 80065d: 56 push %esi 80065e: e8 9b fe ff ff call 8004fe <printfmt> 800663: 83 c4 10 add $0x10,%esp err = va_arg(ap, int); 800666: 89 7d 14 mov %edi,0x14(%ebp) printfmt(putch, putdat, "error %d", err); 800669: e9 82 02 00 00 jmp 8008f0 <vprintfmt+0x3d5> if ((p = va_arg(ap, char *)) == NULL) 80066e: 8b 45 14 mov 0x14(%ebp),%eax 800671: 83 c0 04 add $0x4,%eax 800674: 89 45 cc mov %eax,-0x34(%ebp) 800677: 8b 45 14 mov 0x14(%ebp),%eax 80067a: 8b 38 mov (%eax),%edi p = "(null)"; 80067c: 85 ff test %edi,%edi 80067e: b8 2e 10 80 00 mov $0x80102e,%eax 800683: 0f 44 f8 cmove %eax,%edi if (width > 0 && padc != '-') 800686: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) 80068a: 0f 8e bd 00 00 00 jle 80074d <vprintfmt+0x232> 800690: 80 7d d4 2d cmpb $0x2d,-0x2c(%ebp) 800694: 75 0e jne 8006a4 <vprintfmt+0x189> 800696: 89 75 08 mov %esi,0x8(%ebp) 800699: 8b 75 d0 mov -0x30(%ebp),%esi 80069c: 89 5d 0c mov %ebx,0xc(%ebp) 80069f: 8b 5d e0 mov -0x20(%ebp),%ebx 8006a2: eb 6d jmp 800711 <vprintfmt+0x1f6> for (width -= strnlen(p, precision); width > 0; width--) 8006a4: 83 ec 08 sub $0x8,%esp 8006a7: ff 75 d0 pushl -0x30(%ebp) 8006aa: 57 push %edi 8006ab: e8 6e 03 00 00 call 800a1e <strnlen> 8006b0: 8b 4d e0 mov -0x20(%ebp),%ecx 8006b3: 29 c1 sub %eax,%ecx 8006b5: 89 4d c8 mov %ecx,-0x38(%ebp) 8006b8: 83 c4 10 add $0x10,%esp putch(padc, putdat); 8006bb: 0f be 45 d4 movsbl -0x2c(%ebp),%eax 8006bf: 89 45 e0 mov %eax,-0x20(%ebp) 8006c2: 89 7d d4 mov %edi,-0x2c(%ebp) 8006c5: 89 cf mov %ecx,%edi for (width -= strnlen(p, precision); width > 0; width--) 8006c7: eb 0f jmp 8006d8 <vprintfmt+0x1bd> putch(padc, putdat); 8006c9: 83 ec 08 sub $0x8,%esp 8006cc: 53 push %ebx 8006cd: ff 75 e0 pushl -0x20(%ebp) 8006d0: ff d6 call *%esi for (width -= strnlen(p, precision); width > 0; width--) 8006d2: 83 ef 01 sub $0x1,%edi 8006d5: 83 c4 10 add $0x10,%esp 8006d8: 85 ff test %edi,%edi 8006da: 7f ed jg 8006c9 <vprintfmt+0x1ae> 8006dc: 8b 7d d4 mov -0x2c(%ebp),%edi 8006df: 8b 4d c8 mov -0x38(%ebp),%ecx 8006e2: 85 c9 test %ecx,%ecx 8006e4: b8 00 00 00 00 mov $0x0,%eax 8006e9: 0f 49 c1 cmovns %ecx,%eax 8006ec: 29 c1 sub %eax,%ecx 8006ee: 89 75 08 mov %esi,0x8(%ebp) 8006f1: 8b 75 d0 mov -0x30(%ebp),%esi 8006f4: 89 5d 0c mov %ebx,0xc(%ebp) 8006f7: 89 cb mov %ecx,%ebx 8006f9: eb 16 jmp 800711 <vprintfmt+0x1f6> if (altflag && (ch < ' ' || ch > '~')) 8006fb: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) 8006ff: 75 31 jne 800732 <vprintfmt+0x217> putch(ch, putdat); 800701: 83 ec 08 sub $0x8,%esp 800704: ff 75 0c pushl 0xc(%ebp) 800707: 50 push %eax 800708: ff 55 08 call *0x8(%ebp) 80070b: 83 c4 10 add $0x10,%esp for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--) 80070e: 83 eb 01 sub $0x1,%ebx 800711: 83 c7 01 add $0x1,%edi 800714: 0f b6 57 ff movzbl -0x1(%edi),%edx 800718: 0f be c2 movsbl %dl,%eax 80071b: 85 c0 test %eax,%eax 80071d: 74 59 je 800778 <vprintfmt+0x25d> 80071f: 85 f6 test %esi,%esi 800721: 78 d8 js 8006fb <vprintfmt+0x1e0> 800723: 83 ee 01 sub $0x1,%esi 800726: 79 d3 jns 8006fb <vprintfmt+0x1e0> 800728: 89 df mov %ebx,%edi 80072a: 8b 75 08 mov 0x8(%ebp),%esi 80072d: 8b 5d 0c mov 0xc(%ebp),%ebx 800730: eb 37 jmp 800769 <vprintfmt+0x24e> if (altflag && (ch < ' ' || ch > '~')) 800732: 0f be d2 movsbl %dl,%edx 800735: 83 ea 20 sub $0x20,%edx 800738: 83 fa 5e cmp $0x5e,%edx 80073b: 76 c4 jbe 800701 <vprintfmt+0x1e6> putch('?', putdat); 80073d: 83 ec 08 sub $0x8,%esp 800740: ff 75 0c pushl 0xc(%ebp) 800743: 6a 3f push $0x3f 800745: ff 55 08 call *0x8(%ebp) 800748: 83 c4 10 add $0x10,%esp 80074b: eb c1 jmp 80070e <vprintfmt+0x1f3> 80074d: 89 75 08 mov %esi,0x8(%ebp) 800750: 8b 75 d0 mov -0x30(%ebp),%esi 800753: 89 5d 0c mov %ebx,0xc(%ebp) 800756: 8b 5d e0 mov -0x20(%ebp),%ebx 800759: eb b6 jmp 800711 <vprintfmt+0x1f6> putch(' ', putdat); 80075b: 83 ec 08 sub $0x8,%esp 80075e: 53 push %ebx 80075f: 6a 20 push $0x20 800761: ff d6 call *%esi for (; width > 0; width--) 800763: 83 ef 01 sub $0x1,%edi 800766: 83 c4 10 add $0x10,%esp 800769: 85 ff test %edi,%edi 80076b: 7f ee jg 80075b <vprintfmt+0x240> if ((p = va_arg(ap, char *)) == NULL) 80076d: 8b 45 cc mov -0x34(%ebp),%eax 800770: 89 45 14 mov %eax,0x14(%ebp) 800773: e9 78 01 00 00 jmp 8008f0 <vprintfmt+0x3d5> 800778: 89 df mov %ebx,%edi 80077a: 8b 75 08 mov 0x8(%ebp),%esi 80077d: 8b 5d 0c mov 0xc(%ebp),%ebx 800780: eb e7 jmp 800769 <vprintfmt+0x24e> if (lflag >= 2) 800782: 83 f9 01 cmp $0x1,%ecx 800785: 7e 3f jle 8007c6 <vprintfmt+0x2ab> return va_arg(*ap, long long); 800787: 8b 45 14 mov 0x14(%ebp),%eax 80078a: 8b 50 04 mov 0x4(%eax),%edx 80078d: 8b 00 mov (%eax),%eax 80078f: 89 45 d8 mov %eax,-0x28(%ebp) 800792: 89 55 dc mov %edx,-0x24(%ebp) 800795: 8b 45 14 mov 0x14(%ebp),%eax 800798: 8d 40 08 lea 0x8(%eax),%eax 80079b: 89 45 14 mov %eax,0x14(%ebp) if ((long long) num < 0) { 80079e: 83 7d dc 00 cmpl $0x0,-0x24(%ebp) 8007a2: 79 5c jns 800800 <vprintfmt+0x2e5> putch('-', putdat); 8007a4: 83 ec 08 sub $0x8,%esp 8007a7: 53 push %ebx 8007a8: 6a 2d push $0x2d 8007aa: ff d6 call *%esi num = -(long long) num; 8007ac: 8b 55 d8 mov -0x28(%ebp),%edx 8007af: 8b 4d dc mov -0x24(%ebp),%ecx 8007b2: f7 da neg %edx 8007b4: 83 d1 00 adc $0x0,%ecx 8007b7: f7 d9 neg %ecx 8007b9: 83 c4 10 add $0x10,%esp base = 10; 8007bc: b8 0a 00 00 00 mov $0xa,%eax 8007c1: e9 10 01 00 00 jmp 8008d6 <vprintfmt+0x3bb> else if (lflag) 8007c6: 85 c9 test %ecx,%ecx 8007c8: 75 1b jne 8007e5 <vprintfmt+0x2ca> return va_arg(*ap, int); 8007ca: 8b 45 14 mov 0x14(%ebp),%eax 8007cd: 8b 00 mov (%eax),%eax 8007cf: 89 45 d8 mov %eax,-0x28(%ebp) 8007d2: 89 c1 mov %eax,%ecx 8007d4: c1 f9 1f sar $0x1f,%ecx 8007d7: 89 4d dc mov %ecx,-0x24(%ebp) 8007da: 8b 45 14 mov 0x14(%ebp),%eax 8007dd: 8d 40 04 lea 0x4(%eax),%eax 8007e0: 89 45 14 mov %eax,0x14(%ebp) 8007e3: eb b9 jmp 80079e <vprintfmt+0x283> return va_arg(*ap, long); 8007e5: 8b 45 14 mov 0x14(%ebp),%eax 8007e8: 8b 00 mov (%eax),%eax 8007ea: 89 45 d8 mov %eax,-0x28(%ebp) 8007ed: 89 c1 mov %eax,%ecx 8007ef: c1 f9 1f sar $0x1f,%ecx 8007f2: 89 4d dc mov %ecx,-0x24(%ebp) 8007f5: 8b 45 14 mov 0x14(%ebp),%eax 8007f8: 8d 40 04 lea 0x4(%eax),%eax 8007fb: 89 45 14 mov %eax,0x14(%ebp) 8007fe: eb 9e jmp 80079e <vprintfmt+0x283> num = getint(&ap, lflag); 800800: 8b 55 d8 mov -0x28(%ebp),%edx 800803: 8b 4d dc mov -0x24(%ebp),%ecx base = 10; 800806: b8 0a 00 00 00 mov $0xa,%eax 80080b: e9 c6 00 00 00 jmp 8008d6 <vprintfmt+0x3bb> if (lflag >= 2) 800810: 83 f9 01 cmp $0x1,%ecx 800813: 7e 18 jle 80082d <vprintfmt+0x312> return va_arg(*ap, unsigned long long); 800815: 8b 45 14 mov 0x14(%ebp),%eax 800818: 8b 10 mov (%eax),%edx 80081a: 8b 48 04 mov 0x4(%eax),%ecx 80081d: 8d 40 08 lea 0x8(%eax),%eax 800820: 89 45 14 mov %eax,0x14(%ebp) base = 10; 800823: b8 0a 00 00 00 mov $0xa,%eax 800828: e9 a9 00 00 00 jmp 8008d6 <vprintfmt+0x3bb> else if (lflag) 80082d: 85 c9 test %ecx,%ecx 80082f: 75 1a jne 80084b <vprintfmt+0x330> return va_arg(*ap, unsigned int); 800831: 8b 45 14 mov 0x14(%ebp),%eax 800834: 8b 10 mov (%eax),%edx 800836: b9 00 00 00 00 mov $0x0,%ecx 80083b: 8d 40 04 lea 0x4(%eax),%eax 80083e: 89 45 14 mov %eax,0x14(%ebp) base = 10; 800841: b8 0a 00 00 00 mov $0xa,%eax 800846: e9 8b 00 00 00 jmp 8008d6 <vprintfmt+0x3bb> return va_arg(*ap, unsigned long); 80084b: 8b 45 14 mov 0x14(%ebp),%eax 80084e: 8b 10 mov (%eax),%edx 800850: b9 00 00 00 00 mov $0x0,%ecx 800855: 8d 40 04 lea 0x4(%eax),%eax 800858: 89 45 14 mov %eax,0x14(%ebp) base = 10; 80085b: b8 0a 00 00 00 mov $0xa,%eax 800860: eb 74 jmp 8008d6 <vprintfmt+0x3bb> if (lflag >= 2) 800862: 83 f9 01 cmp $0x1,%ecx 800865: 7e 15 jle 80087c <vprintfmt+0x361> return va_arg(*ap, unsigned long long); 800867: 8b 45 14 mov 0x14(%ebp),%eax 80086a: 8b 10 mov (%eax),%edx 80086c: 8b 48 04 mov 0x4(%eax),%ecx 80086f: 8d 40 08 lea 0x8(%eax),%eax 800872: 89 45 14 mov %eax,0x14(%ebp) base = 8; 800875: b8 08 00 00 00 mov $0x8,%eax 80087a: eb 5a jmp 8008d6 <vprintfmt+0x3bb> else if (lflag) 80087c: 85 c9 test %ecx,%ecx 80087e: 75 17 jne 800897 <vprintfmt+0x37c> return va_arg(*ap, unsigned int); 800880: 8b 45 14 mov 0x14(%ebp),%eax 800883: 8b 10 mov (%eax),%edx 800885: b9 00 00 00 00 mov $0x0,%ecx 80088a: 8d 40 04 lea 0x4(%eax),%eax 80088d: 89 45 14 mov %eax,0x14(%ebp) base = 8; 800890: b8 08 00 00 00 mov $0x8,%eax 800895: eb 3f jmp 8008d6 <vprintfmt+0x3bb> return va_arg(*ap, unsigned long); 800897: 8b 45 14 mov 0x14(%ebp),%eax 80089a: 8b 10 mov (%eax),%edx 80089c: b9 00 00 00 00 mov $0x0,%ecx 8008a1: 8d 40 04 lea 0x4(%eax),%eax 8008a4: 89 45 14 mov %eax,0x14(%ebp) base = 8; 8008a7: b8 08 00 00 00 mov $0x8,%eax 8008ac: eb 28 jmp 8008d6 <vprintfmt+0x3bb> putch('0', putdat); 8008ae: 83 ec 08 sub $0x8,%esp 8008b1: 53 push %ebx 8008b2: 6a 30 push $0x30 8008b4: ff d6 call *%esi putch('x', putdat); 8008b6: 83 c4 08 add $0x8,%esp 8008b9: 53 push %ebx 8008ba: 6a 78 push $0x78 8008bc: ff d6 call *%esi num = (unsigned long long) 8008be: 8b 45 14 mov 0x14(%ebp),%eax 8008c1: 8b 10 mov (%eax),%edx 8008c3: b9 00 00 00 00 mov $0x0,%ecx goto number; 8008c8: 83 c4 10 add $0x10,%esp (uintptr_t) va_arg(ap, void *); 8008cb: 8d 40 04 lea 0x4(%eax),%eax 8008ce: 89 45 14 mov %eax,0x14(%ebp) base = 16; 8008d1: b8 10 00 00 00 mov $0x10,%eax printnum(putch, putdat, num, base, width, padc); 8008d6: 83 ec 0c sub $0xc,%esp 8008d9: 0f be 7d d4 movsbl -0x2c(%ebp),%edi 8008dd: 57 push %edi 8008de: ff 75 e0 pushl -0x20(%ebp) 8008e1: 50 push %eax 8008e2: 51 push %ecx 8008e3: 52 push %edx 8008e4: 89 da mov %ebx,%edx 8008e6: 89 f0 mov %esi,%eax 8008e8: e8 45 fb ff ff call 800432 <printnum> break; 8008ed: 83 c4 20 add $0x20,%esp err = va_arg(ap, int); 8008f0: 8b 7d e4 mov -0x1c(%ebp),%edi while ((ch = *(unsigned char *) fmt++) != '%') { //先将非格式化字符输出到控制台。 8008f3: 83 c7 01 add $0x1,%edi 8008f6: 0f b6 47 ff movzbl -0x1(%edi),%eax 8008fa: 83 f8 25 cmp $0x25,%eax 8008fd: 0f 84 2f fc ff ff je 800532 <vprintfmt+0x17> if (ch == '\0') //如果没有格式化字符直接返回 800903: 85 c0 test %eax,%eax 800905: 0f 84 8b 00 00 00 je 800996 <vprintfmt+0x47b> putch(ch, putdat); 80090b: 83 ec 08 sub $0x8,%esp 80090e: 53 push %ebx 80090f: 50 push %eax 800910: ff d6 call *%esi 800912: 83 c4 10 add $0x10,%esp 800915: eb dc jmp 8008f3 <vprintfmt+0x3d8> if (lflag >= 2) 800917: 83 f9 01 cmp $0x1,%ecx 80091a: 7e 15 jle 800931 <vprintfmt+0x416> return va_arg(*ap, unsigned long long); 80091c: 8b 45 14 mov 0x14(%ebp),%eax 80091f: 8b 10 mov (%eax),%edx 800921: 8b 48 04 mov 0x4(%eax),%ecx 800924: 8d 40 08 lea 0x8(%eax),%eax 800927: 89 45 14 mov %eax,0x14(%ebp) base = 16; 80092a: b8 10 00 00 00 mov $0x10,%eax 80092f: eb a5 jmp 8008d6 <vprintfmt+0x3bb> else if (lflag) 800931: 85 c9 test %ecx,%ecx 800933: 75 17 jne 80094c <vprintfmt+0x431> return va_arg(*ap, unsigned int); 800935: 8b 45 14 mov 0x14(%ebp),%eax 800938: 8b 10 mov (%eax),%edx 80093a: b9 00 00 00 00 mov $0x0,%ecx 80093f: 8d 40 04 lea 0x4(%eax),%eax 800942: 89 45 14 mov %eax,0x14(%ebp) base = 16; 800945: b8 10 00 00 00 mov $0x10,%eax 80094a: eb 8a jmp 8008d6 <vprintfmt+0x3bb> return va_arg(*ap, unsigned long); 80094c: 8b 45 14 mov 0x14(%ebp),%eax 80094f: 8b 10 mov (%eax),%edx 800951: b9 00 00 00 00 mov $0x0,%ecx 800956: 8d 40 04 lea 0x4(%eax),%eax 800959: 89 45 14 mov %eax,0x14(%ebp) base = 16; 80095c: b8 10 00 00 00 mov $0x10,%eax 800961: e9 70 ff ff ff jmp 8008d6 <vprintfmt+0x3bb> putch(ch, putdat); 800966: 83 ec 08 sub $0x8,%esp 800969: 53 push %ebx 80096a: 6a 25 push $0x25 80096c: ff d6 call *%esi break; 80096e: 83 c4 10 add $0x10,%esp 800971: e9 7a ff ff ff jmp 8008f0 <vprintfmt+0x3d5> putch('%', putdat); 800976: 83 ec 08 sub $0x8,%esp 800979: 53 push %ebx 80097a: 6a 25 push $0x25 80097c: ff d6 call *%esi for (fmt--; fmt[-1] != '%'; fmt--) 80097e: 83 c4 10 add $0x10,%esp 800981: 89 f8 mov %edi,%eax 800983: eb 03 jmp 800988 <vprintfmt+0x46d> 800985: 83 e8 01 sub $0x1,%eax 800988: 80 78 ff 25 cmpb $0x25,-0x1(%eax) 80098c: 75 f7 jne 800985 <vprintfmt+0x46a> 80098e: 89 45 e4 mov %eax,-0x1c(%ebp) 800991: e9 5a ff ff ff jmp 8008f0 <vprintfmt+0x3d5> } 800996: 8d 65 f4 lea -0xc(%ebp),%esp 800999: 5b pop %ebx 80099a: 5e pop %esi 80099b: 5f pop %edi 80099c: 5d pop %ebp 80099d: c3 ret 0080099e <vsnprintf>: int vsnprintf(char *buf, int n, const char *fmt, va_list ap) { 80099e: 55 push %ebp 80099f: 89 e5 mov %esp,%ebp 8009a1: 83 ec 18 sub $0x18,%esp 8009a4: 8b 45 08 mov 0x8(%ebp),%eax 8009a7: 8b 55 0c mov 0xc(%ebp),%edx struct sprintbuf b = {buf, buf+n-1, 0}; 8009aa: 89 45 ec mov %eax,-0x14(%ebp) 8009ad: 8d 4c 10 ff lea -0x1(%eax,%edx,1),%ecx 8009b1: 89 4d f0 mov %ecx,-0x10(%ebp) 8009b4: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) if (buf == NULL || n < 1) 8009bb: 85 c0 test %eax,%eax 8009bd: 74 26 je 8009e5 <vsnprintf+0x47> 8009bf: 85 d2 test %edx,%edx 8009c1: 7e 22 jle 8009e5 <vsnprintf+0x47> return -E_INVAL; // print the string to the buffer vprintfmt((void*)sprintputch, &b, fmt, ap); 8009c3: ff 75 14 pushl 0x14(%ebp) 8009c6: ff 75 10 pushl 0x10(%ebp) 8009c9: 8d 45 ec lea -0x14(%ebp),%eax 8009cc: 50 push %eax 8009cd: 68 e1 04 80 00 push $0x8004e1 8009d2: e8 44 fb ff ff call 80051b <vprintfmt> // null terminate the buffer *b.buf = '\0'; 8009d7: 8b 45 ec mov -0x14(%ebp),%eax 8009da: c6 00 00 movb $0x0,(%eax) return b.cnt; 8009dd: 8b 45 f4 mov -0xc(%ebp),%eax 8009e0: 83 c4 10 add $0x10,%esp } 8009e3: c9 leave 8009e4: c3 ret return -E_INVAL; 8009e5: b8 fd ff ff ff mov $0xfffffffd,%eax 8009ea: eb f7 jmp 8009e3 <vsnprintf+0x45> 008009ec <snprintf>: int snprintf(char *buf, int n, const char *fmt, ...) { 8009ec: 55 push %ebp 8009ed: 89 e5 mov %esp,%ebp 8009ef: 83 ec 08 sub $0x8,%esp va_list ap; int rc; va_start(ap, fmt); 8009f2: 8d 45 14 lea 0x14(%ebp),%eax rc = vsnprintf(buf, n, fmt, ap); 8009f5: 50 push %eax 8009f6: ff 75 10 pushl 0x10(%ebp) 8009f9: ff 75 0c pushl 0xc(%ebp) 8009fc: ff 75 08 pushl 0x8(%ebp) 8009ff: e8 9a ff ff ff call 80099e <vsnprintf> va_end(ap); return rc; } 800a04: c9 leave 800a05: c3 ret 00800a06 <strlen>: // Primespipe runs 3x faster this way. #define ASM 1 int strlen(const char *s) { 800a06: 55 push %ebp 800a07: 89 e5 mov %esp,%ebp 800a09: 8b 55 08 mov 0x8(%ebp),%edx int n; for (n = 0; *s != '\0'; s++) 800a0c: b8 00 00 00 00 mov $0x0,%eax 800a11: eb 03 jmp 800a16 <strlen+0x10> n++; 800a13: 83 c0 01 add $0x1,%eax for (n = 0; *s != '\0'; s++) 800a16: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 800a1a: 75 f7 jne 800a13 <strlen+0xd> return n; } 800a1c: 5d pop %ebp 800a1d: c3 ret 00800a1e <strnlen>: int strnlen(const char *s, size_t size) { 800a1e: 55 push %ebp 800a1f: 89 e5 mov %esp,%ebp 800a21: 8b 4d 08 mov 0x8(%ebp),%ecx 800a24: 8b 55 0c mov 0xc(%ebp),%edx int n; for (n = 0; size > 0 && *s != '\0'; s++, size--) 800a27: b8 00 00 00 00 mov $0x0,%eax 800a2c: eb 03 jmp 800a31 <strnlen+0x13> n++; 800a2e: 83 c0 01 add $0x1,%eax for (n = 0; size > 0 && *s != '\0'; s++, size--) 800a31: 39 d0 cmp %edx,%eax 800a33: 74 06 je 800a3b <strnlen+0x1d> 800a35: 80 3c 01 00 cmpb $0x0,(%ecx,%eax,1) 800a39: 75 f3 jne 800a2e <strnlen+0x10> return n; } 800a3b: 5d pop %ebp 800a3c: c3 ret 00800a3d <strcpy>: char * strcpy(char *dst, const char *src) { 800a3d: 55 push %ebp 800a3e: 89 e5 mov %esp,%ebp 800a40: 53 push %ebx 800a41: 8b 45 08 mov 0x8(%ebp),%eax 800a44: 8b 4d 0c mov 0xc(%ebp),%ecx char *ret; ret = dst; while ((*dst++ = *src++) != '\0') 800a47: 89 c2 mov %eax,%edx 800a49: 83 c1 01 add $0x1,%ecx 800a4c: 83 c2 01 add $0x1,%edx 800a4f: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 800a53: 88 5a ff mov %bl,-0x1(%edx) 800a56: 84 db test %bl,%bl 800a58: 75 ef jne 800a49 <strcpy+0xc> /* do nothing */; return ret; } 800a5a: 5b pop %ebx 800a5b: 5d pop %ebp 800a5c: c3 ret 00800a5d <strcat>: char * strcat(char *dst, const char *src) { 800a5d: 55 push %ebp 800a5e: 89 e5 mov %esp,%ebp 800a60: 53 push %ebx 800a61: 8b 5d 08 mov 0x8(%ebp),%ebx int len = strlen(dst); 800a64: 53 push %ebx 800a65: e8 9c ff ff ff call 800a06 <strlen> 800a6a: 83 c4 04 add $0x4,%esp strcpy(dst + len, src); 800a6d: ff 75 0c pushl 0xc(%ebp) 800a70: 01 d8 add %ebx,%eax 800a72: 50 push %eax 800a73: e8 c5 ff ff ff call 800a3d <strcpy> return dst; } 800a78: 89 d8 mov %ebx,%eax 800a7a: 8b 5d fc mov -0x4(%ebp),%ebx 800a7d: c9 leave 800a7e: c3 ret 00800a7f <strncpy>: char * strncpy(char *dst, const char *src, size_t size) { 800a7f: 55 push %ebp 800a80: 89 e5 mov %esp,%ebp 800a82: 56 push %esi 800a83: 53 push %ebx 800a84: 8b 75 08 mov 0x8(%ebp),%esi 800a87: 8b 4d 0c mov 0xc(%ebp),%ecx 800a8a: 89 f3 mov %esi,%ebx 800a8c: 03 5d 10 add 0x10(%ebp),%ebx size_t i; char *ret; ret = dst; for (i = 0; i < size; i++) { 800a8f: 89 f2 mov %esi,%edx 800a91: eb 0f jmp 800aa2 <strncpy+0x23> *dst++ = *src; 800a93: 83 c2 01 add $0x1,%edx 800a96: 0f b6 01 movzbl (%ecx),%eax 800a99: 88 42 ff mov %al,-0x1(%edx) // If strlen(src) < size, null-pad 'dst' out to 'size' chars if (*src != '\0') src++; 800a9c: 80 39 01 cmpb $0x1,(%ecx) 800a9f: 83 d9 ff sbb $0xffffffff,%ecx for (i = 0; i < size; i++) { 800aa2: 39 da cmp %ebx,%edx 800aa4: 75 ed jne 800a93 <strncpy+0x14> } return ret; } 800aa6: 89 f0 mov %esi,%eax 800aa8: 5b pop %ebx 800aa9: 5e pop %esi 800aaa: 5d pop %ebp 800aab: c3 ret 00800aac <strlcpy>: size_t strlcpy(char *dst, const char *src, size_t size) { 800aac: 55 push %ebp 800aad: 89 e5 mov %esp,%ebp 800aaf: 56 push %esi 800ab0: 53 push %ebx 800ab1: 8b 75 08 mov 0x8(%ebp),%esi 800ab4: 8b 55 0c mov 0xc(%ebp),%edx 800ab7: 8b 4d 10 mov 0x10(%ebp),%ecx 800aba: 89 f0 mov %esi,%eax 800abc: 8d 5c 0e ff lea -0x1(%esi,%ecx,1),%ebx char *dst_in; dst_in = dst; if (size > 0) { 800ac0: 85 c9 test %ecx,%ecx 800ac2: 75 0b jne 800acf <strlcpy+0x23> 800ac4: eb 17 jmp 800add <strlcpy+0x31> while (--size > 0 && *src != '\0') *dst++ = *src++; 800ac6: 83 c2 01 add $0x1,%edx 800ac9: 83 c0 01 add $0x1,%eax 800acc: 88 48 ff mov %cl,-0x1(%eax) while (--size > 0 && *src != '\0') 800acf: 39 d8 cmp %ebx,%eax 800ad1: 74 07 je 800ada <strlcpy+0x2e> 800ad3: 0f b6 0a movzbl (%edx),%ecx 800ad6: 84 c9 test %cl,%cl 800ad8: 75 ec jne 800ac6 <strlcpy+0x1a> *dst = '\0'; 800ada: c6 00 00 movb $0x0,(%eax) } return dst - dst_in; 800add: 29 f0 sub %esi,%eax } 800adf: 5b pop %ebx 800ae0: 5e pop %esi 800ae1: 5d pop %ebp 800ae2: c3 ret 00800ae3 <strcmp>: int strcmp(const char *p, const char *q) { 800ae3: 55 push %ebp 800ae4: 89 e5 mov %esp,%ebp 800ae6: 8b 4d 08 mov 0x8(%ebp),%ecx 800ae9: 8b 55 0c mov 0xc(%ebp),%edx while (*p && *p == *q) 800aec: eb 06 jmp 800af4 <strcmp+0x11> p++, q++; 800aee: 83 c1 01 add $0x1,%ecx 800af1: 83 c2 01 add $0x1,%edx while (*p && *p == *q) 800af4: 0f b6 01 movzbl (%ecx),%eax 800af7: 84 c0 test %al,%al 800af9: 74 04 je 800aff <strcmp+0x1c> 800afb: 3a 02 cmp (%edx),%al 800afd: 74 ef je 800aee <strcmp+0xb> return (int) ((unsigned char) *p - (unsigned char) *q); 800aff: 0f b6 c0 movzbl %al,%eax 800b02: 0f b6 12 movzbl (%edx),%edx 800b05: 29 d0 sub %edx,%eax } 800b07: 5d pop %ebp 800b08: c3 ret 00800b09 <strncmp>: int strncmp(const char *p, const char *q, size_t n) { 800b09: 55 push %ebp 800b0a: 89 e5 mov %esp,%ebp 800b0c: 53 push %ebx 800b0d: 8b 45 08 mov 0x8(%ebp),%eax 800b10: 8b 55 0c mov 0xc(%ebp),%edx 800b13: 89 c3 mov %eax,%ebx 800b15: 03 5d 10 add 0x10(%ebp),%ebx while (n > 0 && *p && *p == *q) 800b18: eb 06 jmp 800b20 <strncmp+0x17> n--, p++, q++; 800b1a: 83 c0 01 add $0x1,%eax 800b1d: 83 c2 01 add $0x1,%edx while (n > 0 && *p && *p == *q) 800b20: 39 d8 cmp %ebx,%eax 800b22: 74 16 je 800b3a <strncmp+0x31> 800b24: 0f b6 08 movzbl (%eax),%ecx 800b27: 84 c9 test %cl,%cl 800b29: 74 04 je 800b2f <strncmp+0x26> 800b2b: 3a 0a cmp (%edx),%cl 800b2d: 74 eb je 800b1a <strncmp+0x11> if (n == 0) return 0; else return (int) ((unsigned char) *p - (unsigned char) *q); 800b2f: 0f b6 00 movzbl (%eax),%eax 800b32: 0f b6 12 movzbl (%edx),%edx 800b35: 29 d0 sub %edx,%eax } 800b37: 5b pop %ebx 800b38: 5d pop %ebp 800b39: c3 ret return 0; 800b3a: b8 00 00 00 00 mov $0x0,%eax 800b3f: eb f6 jmp 800b37 <strncmp+0x2e> 00800b41 <strchr>: // Return a pointer to the first occurrence of 'c' in 's', // or a null pointer if the string has no 'c'. char * strchr(const char *s, char c) { 800b41: 55 push %ebp 800b42: 89 e5 mov %esp,%ebp 800b44: 8b 45 08 mov 0x8(%ebp),%eax 800b47: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for (; *s; s++) 800b4b: 0f b6 10 movzbl (%eax),%edx 800b4e: 84 d2 test %dl,%dl 800b50: 74 09 je 800b5b <strchr+0x1a> if (*s == c) 800b52: 38 ca cmp %cl,%dl 800b54: 74 0a je 800b60 <strchr+0x1f> for (; *s; s++) 800b56: 83 c0 01 add $0x1,%eax 800b59: eb f0 jmp 800b4b <strchr+0xa> return (char *) s; return 0; 800b5b: b8 00 00 00 00 mov $0x0,%eax } 800b60: 5d pop %ebp 800b61: c3 ret 00800b62 <strfind>: // Return a pointer to the first occurrence of 'c' in 's', // or a pointer to the string-ending null character if the string has no 'c'. char * strfind(const char *s, char c) { 800b62: 55 push %ebp 800b63: 89 e5 mov %esp,%ebp 800b65: 8b 45 08 mov 0x8(%ebp),%eax 800b68: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx for (; *s; s++) 800b6c: eb 03 jmp 800b71 <strfind+0xf> 800b6e: 83 c0 01 add $0x1,%eax 800b71: 0f b6 10 movzbl (%eax),%edx if (*s == c) 800b74: 38 ca cmp %cl,%dl 800b76: 74 04 je 800b7c <strfind+0x1a> 800b78: 84 d2 test %dl,%dl 800b7a: 75 f2 jne 800b6e <strfind+0xc> break; return (char *) s; } 800b7c: 5d pop %ebp 800b7d: c3 ret 00800b7e <memset>: #if ASM void * memset(void *v, int c, size_t n) { 800b7e: 55 push %ebp 800b7f: 89 e5 mov %esp,%ebp 800b81: 57 push %edi 800b82: 56 push %esi 800b83: 53 push %ebx 800b84: 8b 7d 08 mov 0x8(%ebp),%edi 800b87: 8b 4d 10 mov 0x10(%ebp),%ecx char *p; if (n == 0) 800b8a: 85 c9 test %ecx,%ecx 800b8c: 74 13 je 800ba1 <memset+0x23> return v; if ((int)v%4 == 0 && n%4 == 0) { 800b8e: f7 c7 03 00 00 00 test $0x3,%edi 800b94: 75 05 jne 800b9b <memset+0x1d> 800b96: f6 c1 03 test $0x3,%cl 800b99: 74 0d je 800ba8 <memset+0x2a> c = (c<<24)|(c<<16)|(c<<8)|c; asm volatile("cld; rep stosl\n" :: "D" (v), "a" (c), "c" (n/4) : "cc", "memory"); } else asm volatile("cld; rep stosb\n" 800b9b: 8b 45 0c mov 0xc(%ebp),%eax 800b9e: fc cld 800b9f: f3 aa rep stos %al,%es:(%edi) :: "D" (v), "a" (c), "c" (n) : "cc", "memory"); return v; } 800ba1: 89 f8 mov %edi,%eax 800ba3: 5b pop %ebx 800ba4: 5e pop %esi 800ba5: 5f pop %edi 800ba6: 5d pop %ebp 800ba7: c3 ret c &= 0xFF; 800ba8: 0f b6 55 0c movzbl 0xc(%ebp),%edx c = (c<<24)|(c<<16)|(c<<8)|c; 800bac: 89 d3 mov %edx,%ebx 800bae: c1 e3 08 shl $0x8,%ebx 800bb1: 89 d0 mov %edx,%eax 800bb3: c1 e0 18 shl $0x18,%eax 800bb6: 89 d6 mov %edx,%esi 800bb8: c1 e6 10 shl $0x10,%esi 800bbb: 09 f0 or %esi,%eax 800bbd: 09 c2 or %eax,%edx 800bbf: 09 da or %ebx,%edx :: "D" (v), "a" (c), "c" (n/4) 800bc1: c1 e9 02 shr $0x2,%ecx asm volatile("cld; rep stosl\n" 800bc4: 89 d0 mov %edx,%eax 800bc6: fc cld 800bc7: f3 ab rep stos %eax,%es:(%edi) 800bc9: eb d6 jmp 800ba1 <memset+0x23> 00800bcb <memmove>: void * memmove(void *dst, const void *src, size_t n) { 800bcb: 55 push %ebp 800bcc: 89 e5 mov %esp,%ebp 800bce: 57 push %edi 800bcf: 56 push %esi 800bd0: 8b 45 08 mov 0x8(%ebp),%eax 800bd3: 8b 75 0c mov 0xc(%ebp),%esi 800bd6: 8b 4d 10 mov 0x10(%ebp),%ecx const char *s; char *d; s = src; d = dst; if (s < d && s + n > d) { 800bd9: 39 c6 cmp %eax,%esi 800bdb: 73 35 jae 800c12 <memmove+0x47> 800bdd: 8d 14 0e lea (%esi,%ecx,1),%edx 800be0: 39 c2 cmp %eax,%edx 800be2: 76 2e jbe 800c12 <memmove+0x47> s += n; d += n; 800be4: 8d 3c 08 lea (%eax,%ecx,1),%edi if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0) 800be7: 89 d6 mov %edx,%esi 800be9: 09 fe or %edi,%esi 800beb: f7 c6 03 00 00 00 test $0x3,%esi 800bf1: 74 0c je 800bff <memmove+0x34> asm volatile("std; rep movsl\n" :: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory"); else asm volatile("std; rep movsb\n" :: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory"); 800bf3: 83 ef 01 sub $0x1,%edi 800bf6: 8d 72 ff lea -0x1(%edx),%esi asm volatile("std; rep movsb\n" 800bf9: fd std 800bfa: f3 a4 rep movsb %ds:(%esi),%es:(%edi) // Some versions of GCC rely on DF being clear asm volatile("cld" ::: "cc"); 800bfc: fc cld 800bfd: eb 21 jmp 800c20 <memmove+0x55> if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0) 800bff: f6 c1 03 test $0x3,%cl 800c02: 75 ef jne 800bf3 <memmove+0x28> :: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory"); 800c04: 83 ef 04 sub $0x4,%edi 800c07: 8d 72 fc lea -0x4(%edx),%esi 800c0a: c1 e9 02 shr $0x2,%ecx asm volatile("std; rep movsl\n" 800c0d: fd std 800c0e: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 800c10: eb ea jmp 800bfc <memmove+0x31> } else { if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0) 800c12: 89 f2 mov %esi,%edx 800c14: 09 c2 or %eax,%edx 800c16: f6 c2 03 test $0x3,%dl 800c19: 74 09 je 800c24 <memmove+0x59> asm volatile("cld; rep movsl\n" :: "D" (d), "S" (s), "c" (n/4) : "cc", "memory"); else asm volatile("cld; rep movsb\n" 800c1b: 89 c7 mov %eax,%edi 800c1d: fc cld 800c1e: f3 a4 rep movsb %ds:(%esi),%es:(%edi) :: "D" (d), "S" (s), "c" (n) : "cc", "memory"); } return dst; } 800c20: 5e pop %esi 800c21: 5f pop %edi 800c22: 5d pop %ebp 800c23: c3 ret if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0) 800c24: f6 c1 03 test $0x3,%cl 800c27: 75 f2 jne 800c1b <memmove+0x50> :: "D" (d), "S" (s), "c" (n/4) : "cc", "memory"); 800c29: c1 e9 02 shr $0x2,%ecx asm volatile("cld; rep movsl\n" 800c2c: 89 c7 mov %eax,%edi 800c2e: fc cld 800c2f: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 800c31: eb ed jmp 800c20 <memmove+0x55> 00800c33 <memcpy>: } #endif void * memcpy(void *dst, const void *src, size_t n) { 800c33: 55 push %ebp 800c34: 89 e5 mov %esp,%ebp return memmove(dst, src, n); 800c36: ff 75 10 pushl 0x10(%ebp) 800c39: ff 75 0c pushl 0xc(%ebp) 800c3c: ff 75 08 pushl 0x8(%ebp) 800c3f: e8 87 ff ff ff call 800bcb <memmove> } 800c44: c9 leave 800c45: c3 ret 00800c46 <memcmp>: int memcmp(const void *v1, const void *v2, size_t n) { 800c46: 55 push %ebp 800c47: 89 e5 mov %esp,%ebp 800c49: 56 push %esi 800c4a: 53 push %ebx 800c4b: 8b 45 08 mov 0x8(%ebp),%eax 800c4e: 8b 55 0c mov 0xc(%ebp),%edx 800c51: 89 c6 mov %eax,%esi 800c53: 03 75 10 add 0x10(%ebp),%esi const uint8_t *s1 = (const uint8_t *) v1; const uint8_t *s2 = (const uint8_t *) v2; while (n-- > 0) { 800c56: 39 f0 cmp %esi,%eax 800c58: 74 1c je 800c76 <memcmp+0x30> if (*s1 != *s2) 800c5a: 0f b6 08 movzbl (%eax),%ecx 800c5d: 0f b6 1a movzbl (%edx),%ebx 800c60: 38 d9 cmp %bl,%cl 800c62: 75 08 jne 800c6c <memcmp+0x26> return (int) *s1 - (int) *s2; s1++, s2++; 800c64: 83 c0 01 add $0x1,%eax 800c67: 83 c2 01 add $0x1,%edx 800c6a: eb ea jmp 800c56 <memcmp+0x10> return (int) *s1 - (int) *s2; 800c6c: 0f b6 c1 movzbl %cl,%eax 800c6f: 0f b6 db movzbl %bl,%ebx 800c72: 29 d8 sub %ebx,%eax 800c74: eb 05 jmp 800c7b <memcmp+0x35> } return 0; 800c76: b8 00 00 00 00 mov $0x0,%eax } 800c7b: 5b pop %ebx 800c7c: 5e pop %esi 800c7d: 5d pop %ebp 800c7e: c3 ret 00800c7f <memfind>: void * memfind(const void *s, int c, size_t n) { 800c7f: 55 push %ebp 800c80: 89 e5 mov %esp,%ebp 800c82: 8b 45 08 mov 0x8(%ebp),%eax 800c85: 8b 4d 0c mov 0xc(%ebp),%ecx const void *ends = (const char *) s + n; 800c88: 89 c2 mov %eax,%edx 800c8a: 03 55 10 add 0x10(%ebp),%edx for (; s < ends; s++) 800c8d: 39 d0 cmp %edx,%eax 800c8f: 73 09 jae 800c9a <memfind+0x1b> if (*(const unsigned char *) s == (unsigned char) c) 800c91: 38 08 cmp %cl,(%eax) 800c93: 74 05 je 800c9a <memfind+0x1b> for (; s < ends; s++) 800c95: 83 c0 01 add $0x1,%eax 800c98: eb f3 jmp 800c8d <memfind+0xe> break; return (void *) s; } 800c9a: 5d pop %ebp 800c9b: c3 ret 00800c9c <strtol>: long strtol(const char *s, char **endptr, int base) { 800c9c: 55 push %ebp 800c9d: 89 e5 mov %esp,%ebp 800c9f: 57 push %edi 800ca0: 56 push %esi 800ca1: 53 push %ebx 800ca2: 8b 4d 08 mov 0x8(%ebp),%ecx 800ca5: 8b 5d 10 mov 0x10(%ebp),%ebx int neg = 0; long val = 0; // gobble initial whitespace while (*s == ' ' || *s == '\t') 800ca8: eb 03 jmp 800cad <strtol+0x11> s++; 800caa: 83 c1 01 add $0x1,%ecx while (*s == ' ' || *s == '\t') 800cad: 0f b6 01 movzbl (%ecx),%eax 800cb0: 3c 20 cmp $0x20,%al 800cb2: 74 f6 je 800caa <strtol+0xe> 800cb4: 3c 09 cmp $0x9,%al 800cb6: 74 f2 je 800caa <strtol+0xe> // plus/minus sign if (*s == '+') 800cb8: 3c 2b cmp $0x2b,%al 800cba: 74 2e je 800cea <strtol+0x4e> int neg = 0; 800cbc: bf 00 00 00 00 mov $0x0,%edi s++; else if (*s == '-') 800cc1: 3c 2d cmp $0x2d,%al 800cc3: 74 2f je 800cf4 <strtol+0x58> s++, neg = 1; // hex or octal base prefix if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) 800cc5: f7 c3 ef ff ff ff test $0xffffffef,%ebx 800ccb: 75 05 jne 800cd2 <strtol+0x36> 800ccd: 80 39 30 cmpb $0x30,(%ecx) 800cd0: 74 2c je 800cfe <strtol+0x62> s += 2, base = 16; else if (base == 0 && s[0] == '0') 800cd2: 85 db test %ebx,%ebx 800cd4: 75 0a jne 800ce0 <strtol+0x44> s++, base = 8; else if (base == 0) base = 10; 800cd6: bb 0a 00 00 00 mov $0xa,%ebx else if (base == 0 && s[0] == '0') 800cdb: 80 39 30 cmpb $0x30,(%ecx) 800cde: 74 28 je 800d08 <strtol+0x6c> base = 10; 800ce0: b8 00 00 00 00 mov $0x0,%eax 800ce5: 89 5d 10 mov %ebx,0x10(%ebp) 800ce8: eb 50 jmp 800d3a <strtol+0x9e> s++; 800cea: 83 c1 01 add $0x1,%ecx int neg = 0; 800ced: bf 00 00 00 00 mov $0x0,%edi 800cf2: eb d1 jmp 800cc5 <strtol+0x29> s++, neg = 1; 800cf4: 83 c1 01 add $0x1,%ecx 800cf7: bf 01 00 00 00 mov $0x1,%edi 800cfc: eb c7 jmp 800cc5 <strtol+0x29> if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) 800cfe: 80 79 01 78 cmpb $0x78,0x1(%ecx) 800d02: 74 0e je 800d12 <strtol+0x76> else if (base == 0 && s[0] == '0') 800d04: 85 db test %ebx,%ebx 800d06: 75 d8 jne 800ce0 <strtol+0x44> s++, base = 8; 800d08: 83 c1 01 add $0x1,%ecx 800d0b: bb 08 00 00 00 mov $0x8,%ebx 800d10: eb ce jmp 800ce0 <strtol+0x44> s += 2, base = 16; 800d12: 83 c1 02 add $0x2,%ecx 800d15: bb 10 00 00 00 mov $0x10,%ebx 800d1a: eb c4 jmp 800ce0 <strtol+0x44> while (1) { int dig; if (*s >= '0' && *s <= '9') dig = *s - '0'; else if (*s >= 'a' && *s <= 'z') 800d1c: 8d 72 9f lea -0x61(%edx),%esi 800d1f: 89 f3 mov %esi,%ebx 800d21: 80 fb 19 cmp $0x19,%bl 800d24: 77 29 ja 800d4f <strtol+0xb3> dig = *s - 'a' + 10; 800d26: 0f be d2 movsbl %dl,%edx 800d29: 83 ea 57 sub $0x57,%edx else if (*s >= 'A' && *s <= 'Z') dig = *s - 'A' + 10; else break; if (dig >= base) 800d2c: 3b 55 10 cmp 0x10(%ebp),%edx 800d2f: 7d 30 jge 800d61 <strtol+0xc5> break; s++, val = (val * base) + dig; 800d31: 83 c1 01 add $0x1,%ecx 800d34: 0f af 45 10 imul 0x10(%ebp),%eax 800d38: 01 d0 add %edx,%eax if (*s >= '0' && *s <= '9') 800d3a: 0f b6 11 movzbl (%ecx),%edx 800d3d: 8d 72 d0 lea -0x30(%edx),%esi 800d40: 89 f3 mov %esi,%ebx 800d42: 80 fb 09 cmp $0x9,%bl 800d45: 77 d5 ja 800d1c <strtol+0x80> dig = *s - '0'; 800d47: 0f be d2 movsbl %dl,%edx 800d4a: 83 ea 30 sub $0x30,%edx 800d4d: eb dd jmp 800d2c <strtol+0x90> else if (*s >= 'A' && *s <= 'Z') 800d4f: 8d 72 bf lea -0x41(%edx),%esi 800d52: 89 f3 mov %esi,%ebx 800d54: 80 fb 19 cmp $0x19,%bl 800d57: 77 08 ja 800d61 <strtol+0xc5> dig = *s - 'A' + 10; 800d59: 0f be d2 movsbl %dl,%edx 800d5c: 83 ea 37 sub $0x37,%edx 800d5f: eb cb jmp 800d2c <strtol+0x90> // we don't properly detect overflow! } if (endptr) 800d61: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 800d65: 74 05 je 800d6c <strtol+0xd0> *endptr = (char *) s; 800d67: 8b 75 0c mov 0xc(%ebp),%esi 800d6a: 89 0e mov %ecx,(%esi) return (neg ? -val : val); 800d6c: 89 c2 mov %eax,%edx 800d6e: f7 da neg %edx 800d70: 85 ff test %edi,%edi 800d72: 0f 45 c2 cmovne %edx,%eax } 800d75: 5b pop %ebx 800d76: 5e pop %esi 800d77: 5f pop %edi 800d78: 5d pop %ebp 800d79: c3 ret 800d7a: 66 90 xchg %ax,%ax 800d7c: 66 90 xchg %ax,%ax 800d7e: 66 90 xchg %ax,%ax 00800d80 <__udivdi3>: 800d80: 55 push %ebp 800d81: 57 push %edi 800d82: 56 push %esi 800d83: 53 push %ebx 800d84: 83 ec 1c sub $0x1c,%esp 800d87: 8b 54 24 3c mov 0x3c(%esp),%edx 800d8b: 8b 6c 24 30 mov 0x30(%esp),%ebp 800d8f: 8b 74 24 34 mov 0x34(%esp),%esi 800d93: 8b 5c 24 38 mov 0x38(%esp),%ebx 800d97: 85 d2 test %edx,%edx 800d99: 75 35 jne 800dd0 <__udivdi3+0x50> 800d9b: 39 f3 cmp %esi,%ebx 800d9d: 0f 87 bd 00 00 00 ja 800e60 <__udivdi3+0xe0> 800da3: 85 db test %ebx,%ebx 800da5: 89 d9 mov %ebx,%ecx 800da7: 75 0b jne 800db4 <__udivdi3+0x34> 800da9: b8 01 00 00 00 mov $0x1,%eax 800dae: 31 d2 xor %edx,%edx 800db0: f7 f3 div %ebx 800db2: 89 c1 mov %eax,%ecx 800db4: 31 d2 xor %edx,%edx 800db6: 89 f0 mov %esi,%eax 800db8: f7 f1 div %ecx 800dba: 89 c6 mov %eax,%esi 800dbc: 89 e8 mov %ebp,%eax 800dbe: 89 f7 mov %esi,%edi 800dc0: f7 f1 div %ecx 800dc2: 89 fa mov %edi,%edx 800dc4: 83 c4 1c add $0x1c,%esp 800dc7: 5b pop %ebx 800dc8: 5e pop %esi 800dc9: 5f pop %edi 800dca: 5d pop %ebp 800dcb: c3 ret 800dcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 800dd0: 39 f2 cmp %esi,%edx 800dd2: 77 7c ja 800e50 <__udivdi3+0xd0> 800dd4: 0f bd fa bsr %edx,%edi 800dd7: 83 f7 1f xor $0x1f,%edi 800dda: 0f 84 98 00 00 00 je 800e78 <__udivdi3+0xf8> 800de0: 89 f9 mov %edi,%ecx 800de2: b8 20 00 00 00 mov $0x20,%eax 800de7: 29 f8 sub %edi,%eax 800de9: d3 e2 shl %cl,%edx 800deb: 89 54 24 08 mov %edx,0x8(%esp) 800def: 89 c1 mov %eax,%ecx 800df1: 89 da mov %ebx,%edx 800df3: d3 ea shr %cl,%edx 800df5: 8b 4c 24 08 mov 0x8(%esp),%ecx 800df9: 09 d1 or %edx,%ecx 800dfb: 89 f2 mov %esi,%edx 800dfd: 89 4c 24 08 mov %ecx,0x8(%esp) 800e01: 89 f9 mov %edi,%ecx 800e03: d3 e3 shl %cl,%ebx 800e05: 89 c1 mov %eax,%ecx 800e07: d3 ea shr %cl,%edx 800e09: 89 f9 mov %edi,%ecx 800e0b: 89 5c 24 0c mov %ebx,0xc(%esp) 800e0f: d3 e6 shl %cl,%esi 800e11: 89 eb mov %ebp,%ebx 800e13: 89 c1 mov %eax,%ecx 800e15: d3 eb shr %cl,%ebx 800e17: 09 de or %ebx,%esi 800e19: 89 f0 mov %esi,%eax 800e1b: f7 74 24 08 divl 0x8(%esp) 800e1f: 89 d6 mov %edx,%esi 800e21: 89 c3 mov %eax,%ebx 800e23: f7 64 24 0c mull 0xc(%esp) 800e27: 39 d6 cmp %edx,%esi 800e29: 72 0c jb 800e37 <__udivdi3+0xb7> 800e2b: 89 f9 mov %edi,%ecx 800e2d: d3 e5 shl %cl,%ebp 800e2f: 39 c5 cmp %eax,%ebp 800e31: 73 5d jae 800e90 <__udivdi3+0x110> 800e33: 39 d6 cmp %edx,%esi 800e35: 75 59 jne 800e90 <__udivdi3+0x110> 800e37: 8d 43 ff lea -0x1(%ebx),%eax 800e3a: 31 ff xor %edi,%edi 800e3c: 89 fa mov %edi,%edx 800e3e: 83 c4 1c add $0x1c,%esp 800e41: 5b pop %ebx 800e42: 5e pop %esi 800e43: 5f pop %edi 800e44: 5d pop %ebp 800e45: c3 ret 800e46: 8d 76 00 lea 0x0(%esi),%esi 800e49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 800e50: 31 ff xor %edi,%edi 800e52: 31 c0 xor %eax,%eax 800e54: 89 fa mov %edi,%edx 800e56: 83 c4 1c add $0x1c,%esp 800e59: 5b pop %ebx 800e5a: 5e pop %esi 800e5b: 5f pop %edi 800e5c: 5d pop %ebp 800e5d: c3 ret 800e5e: 66 90 xchg %ax,%ax 800e60: 31 ff xor %edi,%edi 800e62: 89 e8 mov %ebp,%eax 800e64: 89 f2 mov %esi,%edx 800e66: f7 f3 div %ebx 800e68: 89 fa mov %edi,%edx 800e6a: 83 c4 1c add $0x1c,%esp 800e6d: 5b pop %ebx 800e6e: 5e pop %esi 800e6f: 5f pop %edi 800e70: 5d pop %ebp 800e71: c3 ret 800e72: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 800e78: 39 f2 cmp %esi,%edx 800e7a: 72 06 jb 800e82 <__udivdi3+0x102> 800e7c: 31 c0 xor %eax,%eax 800e7e: 39 eb cmp %ebp,%ebx 800e80: 77 d2 ja 800e54 <__udivdi3+0xd4> 800e82: b8 01 00 00 00 mov $0x1,%eax 800e87: eb cb jmp 800e54 <__udivdi3+0xd4> 800e89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 800e90: 89 d8 mov %ebx,%eax 800e92: 31 ff xor %edi,%edi 800e94: eb be jmp 800e54 <__udivdi3+0xd4> 800e96: 66 90 xchg %ax,%ax 800e98: 66 90 xchg %ax,%ax 800e9a: 66 90 xchg %ax,%ax 800e9c: 66 90 xchg %ax,%ax 800e9e: 66 90 xchg %ax,%ax 00800ea0 <__umoddi3>: 800ea0: 55 push %ebp 800ea1: 57 push %edi 800ea2: 56 push %esi 800ea3: 53 push %ebx 800ea4: 83 ec 1c sub $0x1c,%esp 800ea7: 8b 6c 24 3c mov 0x3c(%esp),%ebp 800eab: 8b 74 24 30 mov 0x30(%esp),%esi 800eaf: 8b 5c 24 34 mov 0x34(%esp),%ebx 800eb3: 8b 7c 24 38 mov 0x38(%esp),%edi 800eb7: 85 ed test %ebp,%ebp 800eb9: 89 f0 mov %esi,%eax 800ebb: 89 da mov %ebx,%edx 800ebd: 75 19 jne 800ed8 <__umoddi3+0x38> 800ebf: 39 df cmp %ebx,%edi 800ec1: 0f 86 b1 00 00 00 jbe 800f78 <__umoddi3+0xd8> 800ec7: f7 f7 div %edi 800ec9: 89 d0 mov %edx,%eax 800ecb: 31 d2 xor %edx,%edx 800ecd: 83 c4 1c add $0x1c,%esp 800ed0: 5b pop %ebx 800ed1: 5e pop %esi 800ed2: 5f pop %edi 800ed3: 5d pop %ebp 800ed4: c3 ret 800ed5: 8d 76 00 lea 0x0(%esi),%esi 800ed8: 39 dd cmp %ebx,%ebp 800eda: 77 f1 ja 800ecd <__umoddi3+0x2d> 800edc: 0f bd cd bsr %ebp,%ecx 800edf: 83 f1 1f xor $0x1f,%ecx 800ee2: 89 4c 24 04 mov %ecx,0x4(%esp) 800ee6: 0f 84 b4 00 00 00 je 800fa0 <__umoddi3+0x100> 800eec: b8 20 00 00 00 mov $0x20,%eax 800ef1: 89 c2 mov %eax,%edx 800ef3: 8b 44 24 04 mov 0x4(%esp),%eax 800ef7: 29 c2 sub %eax,%edx 800ef9: 89 c1 mov %eax,%ecx 800efb: 89 f8 mov %edi,%eax 800efd: d3 e5 shl %cl,%ebp 800eff: 89 d1 mov %edx,%ecx 800f01: 89 54 24 0c mov %edx,0xc(%esp) 800f05: d3 e8 shr %cl,%eax 800f07: 09 c5 or %eax,%ebp 800f09: 8b 44 24 04 mov 0x4(%esp),%eax 800f0d: 89 c1 mov %eax,%ecx 800f0f: d3 e7 shl %cl,%edi 800f11: 89 d1 mov %edx,%ecx 800f13: 89 7c 24 08 mov %edi,0x8(%esp) 800f17: 89 df mov %ebx,%edi 800f19: d3 ef shr %cl,%edi 800f1b: 89 c1 mov %eax,%ecx 800f1d: 89 f0 mov %esi,%eax 800f1f: d3 e3 shl %cl,%ebx 800f21: 89 d1 mov %edx,%ecx 800f23: 89 fa mov %edi,%edx 800f25: d3 e8 shr %cl,%eax 800f27: 0f b6 4c 24 04 movzbl 0x4(%esp),%ecx 800f2c: 09 d8 or %ebx,%eax 800f2e: f7 f5 div %ebp 800f30: d3 e6 shl %cl,%esi 800f32: 89 d1 mov %edx,%ecx 800f34: f7 64 24 08 mull 0x8(%esp) 800f38: 39 d1 cmp %edx,%ecx 800f3a: 89 c3 mov %eax,%ebx 800f3c: 89 d7 mov %edx,%edi 800f3e: 72 06 jb 800f46 <__umoddi3+0xa6> 800f40: 75 0e jne 800f50 <__umoddi3+0xb0> 800f42: 39 c6 cmp %eax,%esi 800f44: 73 0a jae 800f50 <__umoddi3+0xb0> 800f46: 2b 44 24 08 sub 0x8(%esp),%eax 800f4a: 19 ea sbb %ebp,%edx 800f4c: 89 d7 mov %edx,%edi 800f4e: 89 c3 mov %eax,%ebx 800f50: 89 ca mov %ecx,%edx 800f52: 0f b6 4c 24 0c movzbl 0xc(%esp),%ecx 800f57: 29 de sub %ebx,%esi 800f59: 19 fa sbb %edi,%edx 800f5b: 8b 5c 24 04 mov 0x4(%esp),%ebx 800f5f: 89 d0 mov %edx,%eax 800f61: d3 e0 shl %cl,%eax 800f63: 89 d9 mov %ebx,%ecx 800f65: d3 ee shr %cl,%esi 800f67: d3 ea shr %cl,%edx 800f69: 09 f0 or %esi,%eax 800f6b: 83 c4 1c add $0x1c,%esp 800f6e: 5b pop %ebx 800f6f: 5e pop %esi 800f70: 5f pop %edi 800f71: 5d pop %ebp 800f72: c3 ret 800f73: 90 nop 800f74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 800f78: 85 ff test %edi,%edi 800f7a: 89 f9 mov %edi,%ecx 800f7c: 75 0b jne 800f89 <__umoddi3+0xe9> 800f7e: b8 01 00 00 00 mov $0x1,%eax 800f83: 31 d2 xor %edx,%edx 800f85: f7 f7 div %edi 800f87: 89 c1 mov %eax,%ecx 800f89: 89 d8 mov %ebx,%eax 800f8b: 31 d2 xor %edx,%edx 800f8d: f7 f1 div %ecx 800f8f: 89 f0 mov %esi,%eax 800f91: f7 f1 div %ecx 800f93: e9 31 ff ff ff jmp 800ec9 <__umoddi3+0x29> 800f98: 90 nop 800f99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 800fa0: 39 dd cmp %ebx,%ebp 800fa2: 72 08 jb 800fac <__umoddi3+0x10c> 800fa4: 39 f7 cmp %esi,%edi 800fa6: 0f 87 21 ff ff ff ja 800ecd <__umoddi3+0x2d> 800fac: 89 da mov %ebx,%edx 800fae: 89 f0 mov %esi,%eax 800fb0: 29 f8 sub %edi,%eax 800fb2: 19 ea sbb %ebp,%edx 800fb4: e9 14 ff ff ff jmp 800ecd <__umoddi3+0x2d>
40.655654
91
0.455057
6bd7654995614107d184c515f32905242e8bc805
3,885
asm
Assembly
Project.asm
Luchev/uni-assembly
a20b7a70159719f333b98403a38d8257e874e067
[ "MIT" ]
2
2020-10-29T07:04:35.000Z
2021-04-12T03:34:00.000Z
Project.asm
Luchev/uni-assembly
a20b7a70159719f333b98403a38d8257e874e067
[ "MIT" ]
null
null
null
Project.asm
Luchev/uni-assembly
a20b7a70159719f333b98403a38d8257e874e067
[ "MIT" ]
1
2020-08-03T17:32:22.000Z
2020-08-03T17:32:22.000Z
masm model small stack 256 .386 .data handle dw 0 file_name db 'in.txt',0 file_size dw 0 file_contents db 201 dup('$') level db 0 error_message db 'Error, terminating program$' prompt db 10, 'Please input command: $' output_name db 'out.txt',0 output_handle dw 0 file_saved db 10, 'File saved$' message_is_decrypted db 10, 'Message is not encrypted$' message_is_encrypted db 10, 'Message is fully encrypted to lvl 4$' .code main: mov ax, @data mov ds, ax mov ah, 3Dh;open file mov al, 0;read mov dx, offset file_name int 21h jc error;exit on error mov handle, ax; handle to file mov ah, 3Fh;read file mov bx, handle mov cx, 200; read 200 bytes mov dx, offset file_contents int 21h jc error;exit on error mov file_size, ax mov ah, 3Eh;close file int 21h jc error;exit on error input:;loop input mov ah, 09h mov dx, offset prompt int 21h mov ah, 01h int 21h cmp al, '1'; encrypt one level je encrypt cmp al, '2'; decrypt one level je decrypt cmp al, '3'; save current state of the text in out.txt je save cmp al, '4'; exit je exit jmp input encrypt: cmp level, 4 je level4 inc level cmp level, 1 je reverse; level 1 = reverse encryption (weakest) cmp level, 2 je encryptletters; level 2 = arithmetic encryption cmp level, 3 je encryptrotate; level 3 = ROL/ROR encryption jmp xorstring; level 4 = XOR encryption (strongest) decrypt: cmp level, 0 je level0 dec level cmp level, 0 je reverse; level 1 = reverse encryption (weakest) cmp level, 1 je decryptletters; level 2 = arithmetic encryption cmp level, 2 je decryptrotate; level 3 = ROL/ROR encryption jmp xorstring; level 4 = XOR encryption (strongest) level4:;string is fully encrypted mov ah, 09h mov dx, offset message_is_encrypted int 21h jmp printstring level0:;string is fully decrypted mov ah, 09h mov dx, offset message_is_decrypted int 21h jmp printstring reverse:; reverse string, most basic encryption mov cx, file_size xor si, si mov di, cx dec di shr cx, 1 rl:;loop mov ah, file_contents[di] mov al, file_contents[si] mov file_contents[si], ah mov file_contents[di], al inc si dec di loop rl jmp printstring encryptletters:; encrypt adding 95 to the character value mapping letters to │▄╓╣ and such xor bx, bx mov cx, file_size lenl:;loop add file_contents[bx], 95 inc bx loop lenl jmp printstring decryptletters:; decrypt subtracting 95 from the character value xor bx, bx mov cx, file_size ldel:;loop sub file_contents[bx], 95 inc bx loop ldel jmp printstring encryptrotate:;encrypt using ror 5 xor bx, bx mov cx, file_size lens: mov ah, file_contents[bx] ror file_contents[bx], 5 inc bx loop lens jmp printstring decryptrotate:;decrypt using rol 5 xor bx, bx mov cx, file_size ldes: mov ah, file_contents[bx] rol file_contents[bx], 5 inc bx loop ldes jmp printstring xorstring:;encode/decode xor mov al, 0B7h; encrypt/decrypt with B7 xor bx, bx mov cx, file_size loopxor: mov ah, file_contents[bx] xor file_contents[bx], 0B7h inc bx loop loopxor jmp printstring printstring:;print modified string mov ah, 02h mov dl, 10 int 21h mov ah, 09h mov dx, offset file_contents int 21h jmp input save:;save modified file mov ah, 3Ch;create file xor cx, cx; standard file mov dx, offset output_name int 21h jc error mov output_handle, ax; handle to file mov ah, 40h;write file mov bx, output_handle mov cx, file_size; mov dx, offset file_contents int 21h jc error mov ah, 3Eh;close file int 21h jc error;exit on error mov ah, 09h mov dx, offset file_saved int 21h jmp input error:;error handling mov ah, 09h mov dx, offset error_message int 21h jmp exit exit:;exit program mov ax, 4c00h int 21h end main
21.464088
90
0.704505
0c5145eaa63c994ec8fc153151f4c7e128220f24
391
asm
Assembly
programs/oeis/080/A080121.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/080/A080121.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/080/A080121.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A080121: a(n) is the smallest k > 0 such that n^2^k + (n+1)^2^k is prime, or -1 if no such k exists. ; 1,1,2,1,1,2,1,2,1,5 seq $0,50873 ; Triangular array T read by rows: T(n,k) = gcd(n,k). seq $0,32741 ; a(0) = 0; for n > 0, a(n) = number of proper divisors of n (divisors of n which are less than n). seq $0,94360 ; Pair reversal of Jacobsthal-Lucas numbers. mul $0,2 div $0,3 add $0,1
39.1
112
0.636829
dae57f232505606d28c98247e5d4af3592ace7b6
644
asm
Assembly
engine/overworld/wild_mons.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
engine/overworld/wild_mons.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
engine/overworld/wild_mons.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
LoadWildData: ld hl, WildDataPointers ld a, [wCurMap] ; get wild data for current map ld c, a ld b, 0 add hl, bc add hl, bc ld a, [hli] ld h, [hl] ld l, a ; hl now points to wild data for current map ld a, [hli] ld [wGrassRate], a and a jr z, .NoGrassData ; if no grass data, skip to surfing data push hl ld de, wGrassMons ; otherwise, load grass data ld bc, $0014 call CopyData pop hl ld bc, $0014 add hl, bc .NoGrassData ld a, [hli] ld [wWaterRate], a and a ret z ; if no water data, we're done ld de, wWaterMons ; otherwise, load surfing data ld bc, $0014 jp CopyData INCLUDE "data/wild_mons.asm"
18.941176
60
0.658385
2095729837e7949c448b1dc09809fb519323d34a
1,045
asm
Assembly
code/dsryhh/12.asm
KongoHuster/assembly-exercise
1c4a44c60c0e93a1350ed4f887aeaf1414702a51
[ "0BSD" ]
1
2021-08-20T03:57:29.000Z
2021-08-20T03:57:29.000Z
code/dsryhh/12.asm
KongoHuster/assembly-exercise
1c4a44c60c0e93a1350ed4f887aeaf1414702a51
[ "0BSD" ]
null
null
null
code/dsryhh/12.asm
KongoHuster/assembly-exercise
1c4a44c60c0e93a1350ed4f887aeaf1414702a51
[ "0BSD" ]
null
null
null
;12、试编写一程序,要求比较两个字符串 STRING1 和 STRING2 所含字符是否完全相同,若相同则显示 MATCH,若不相同则显示 NO MATCH。 .model small .data STRING1 db 'hello world!',0 STRING2 db 'hello china!',0 matchString db 'MATCH$' nomatchString db 'NO MATCH$' .code start: mov ax,@data mov ds,ax call compare mov ah,4ch int 21h compare proc push ax push bx push dx push si mov si,0 comstart: mov bx,offset STRING1 mov dl,[bx][si] mov bx,offset STRING2 cmp dl, [bx][si] jne nomatch cmp dl, 0 je match inc si jmp comstart nomatch: mov dx,offset nomatchString mov ah,09h int 21h jmp funcreturn match: mov dx,offset matchString mov ah,09h int 21h jmp funcreturn funcreturn: pop si pop dx pop bx pop ax ret compare endp end start
17.416667
80
0.494737
c8bb15556d7f4da814543a0f2b4d8d78880d8d2c
734
asm
Assembly
programs/oeis/165/A165855.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/165/A165855.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/165/A165855.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A165855: Totally multiplicative sequence with a(p) = 34. ; 1,34,34,1156,34,1156,34,39304,1156,1156,34,39304,34,1156,1156,1336336,34,39304,34,39304,1156,1156,34,1336336,1156,1156,39304,39304,34,39304,34,45435424,1156,1156,1156,1336336,34,1156,1156,1336336,34,39304,34,39304,39304,1156,34,45435424,1156,39304,1156,39304,34,1336336,1156,1336336,1156,1156,34,1336336,34,1156,39304,1544804416,1156,39304,34,39304,1156,39304,34,45435424,34,1156,39304,39304,1156,39304,34,45435424,1336336,1156,34,1336336,1156,1156,1156,1336336,34,1336336,1156,39304,1156,1156,1156,1544804416,34,39304,39304,1336336 seq $0,1222 ; Number of prime divisors of n counted with multiplicity (also called bigomega(n) or Omega(n)). mov $1,34 pow $1,$0 mov $0,$1
91.75
534
0.783379
1e4e72c6be2b8f832b1ffdafe75993b4f1d1a1dd
2,304
asm
Assembly
src/drivers/pci/pci_vga.asm
pwk4m1/TinyBIOS
f9f0ec8b725717cac1756836cf68267e0ed77114
[ "BSD-3-Clause" ]
23
2019-09-28T17:33:32.000Z
2022-03-26T20:30:22.000Z
src/drivers/pci/pci_vga.asm
pwk4m1/TinyBIOS
f9f0ec8b725717cac1756836cf68267e0ed77114
[ "BSD-3-Clause" ]
null
null
null
src/drivers/pci/pci_vga.asm
pwk4m1/TinyBIOS
f9f0ec8b725717cac1756836cf68267e0ed77114
[ "BSD-3-Clause" ]
1
2022-03-24T13:12:04.000Z
2022-03-24T13:12:04.000Z
; BSD 3-Clause License ; ; Copyright (c) 2020, k4m1 <k4m1@protonmail.com> ; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions are met: ; ; * Redistributions of source code must retain the above copyright notice, ; this list of conditions and the following disclaimer. ; ; * Redistributions in binary form must reproduce the above copyright notice, ; this list of conditions and the following disclaimer in the documentation ; and/or other materials provided with the distribution. ; ; * Neither the name of the copyright holder nor the names of its ; contributors may be used to endorse or promote products derived from ; this software without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; %ifndef PCI_VGA %define PCI_VGA ; requires: ; pci_init to be done. ; ; returns: si = ; pointer to entry of vga-device ptr if vga-dev is found or ; 0 if not ; ; notes: ; we'll return on _FIRST_ vga device found, for now ; I don't plant to support multiple monitors.. ; pci_find_vga_dev: push ax ; go through all devices we have mov si, pci_dev_ptr_array .loop_start: ; there are some null-bytes after pci device pointers lodsw test ax, ax jz .not_found push si mov si, ax add si, 18 ; point to class/subclass lodsw pop si cmp ah, 0x03 ; video/graphics device jne .loop_start sub si, 2 mov si, word [si] .done: pop ax ret .not_found: xor si, si pop ax ret %endif
30.72
77
0.746528
693ac20022441c4cb78be63b6a7ebeb0edd731aa
5,716
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_765.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.log_21829_765.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.log_21829_765.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 %r15 push %rcx push %rdi push %rsi lea addresses_D_ht+0x6c5e, %rsi lea addresses_WC_ht+0x13f16, %rdi nop nop nop xor %r12, %r12 mov $120, %rcx rep movsw nop nop nop nop nop add $13859, %r14 lea addresses_UC_ht+0xc25e, %rcx inc %r10 movl $0x61626364, (%rcx) nop nop nop nop nop add $64362, %rdi lea addresses_UC_ht+0x1ad42, %rdi cmp %r12, %r12 mov $0x6162636465666768, %r14 movq %r14, %xmm3 vmovups %ymm3, (%rdi) nop nop nop nop dec %r14 lea addresses_UC_ht+0xe05e, %r10 nop nop and $23226, %r15 movb (%r10), %r12b nop nop nop nop sub $39740, %r15 lea addresses_UC_ht+0xeee, %rdi nop nop dec %rsi and $0xffffffffffffffc0, %rdi vmovaps (%rdi), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $0, %xmm3, %r10 nop nop add $60306, %rdi lea addresses_WC_ht+0xfcde, %rdi and %rcx, %rcx mov $0x6162636465666768, %r14 movq %r14, %xmm5 movups %xmm5, (%rdi) nop inc %r14 lea addresses_WC_ht+0x1640, %rsi lea addresses_D_ht+0x124be, %rdi inc %r10 mov $43, %rcx rep movsw nop sub %r12, %r12 pop %rsi pop %rdi pop %rcx pop %r15 pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %rax push %rbp // Faulty Load lea addresses_normal+0x1685e, %r12 nop nop nop and $55191, %rax movups (%r12), %xmm5 vpextrq $0, %xmm5, %r11 lea oracles, %rbp and $0xff, %r11 shlq $12, %r11 mov (%rbp,%r11,1), %r11 pop %rbp pop %rax pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': True, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'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 */
43.633588
2,999
0.662176
b19be7a840b59f77df8d2dc352b1b08ad18b6d0d
4,166
asm
Assembly
graphics/overworldtitles/overworldtitles.asm
Dimedime-d/kptranslation
62ba88ac2e279ac8bf0539e61a8d5764bdc60c5a
[ "CC-BY-4.0" ]
3
2020-10-25T07:13:17.000Z
2021-11-02T15:47:14.000Z
graphics/overworldtitles/overworldtitles.asm
Dimedime-d/kptranslation
62ba88ac2e279ac8bf0539e61a8d5764bdc60c5a
[ "CC-BY-4.0" ]
5
2021-03-01T02:45:02.000Z
2021-12-15T03:33:28.000Z
graphics/overworldtitles/overworldtitles.asm
Dimedime-d/kptranslation
62ba88ac2e279ac8bf0539e61a8d5764bdc60c5a
[ "CC-BY-4.0" ]
null
null
null
; this file is NOT automatically generated - you can nudge the x and y offsets so they look even... .macro worldtitleheader,xOffset,yOffset .byte 0x03,0x70,0x20+xOffset,0x08+yOffset, \ 0xD1,0xF9,0x24,0x08, \ 0xF1,0xF9,0x24,0x08, \ 0x11,0xF9,0x24,0x08 .endmacro .macro owleveltitleheader,xOffset,yOffset .byte 0x03,0x70,0x27+xOffset,0x08+yOffset, \ 0xD1,0xF9,0x24,0x08, \ 0xF1,0xF9,0x24,0x08, \ 0x11,0xF9,0x24,0x08 .endmacro .macro owleveltitleheaderbig,xOffset,yOffset .byte 0x03,0x70,0x27+xOffset,0x08+yOffset, \ 0xD1,0xE9,0x44,0x10, \ 0xF1,0xE9,0x44,0x10, \ 0x11,0xE9,0x44,0x10 .endmacro .macro inctitle,lvlName .incbin "graphics/overworldtitles/dumps/"+lvlName+".dmp" .endmacro .org 0x0802E3C4 ;repoint world title gfx .word W01 ; world1 .word W02 .word W03 .word W04 .word W05 .word W06 .word L01 ; level1 .word L02 .word L03 .word L04 .word L05 .word L06 .word L07 .word L08 .word L09 .word L0A .word L0B .word L0C .word L0D .word L0E .word L0F .word L10 .word L11 .word L12 .word L13 .word L14 .word L15 .word L16 .word L17 .word L18 .word L19 .word L1A .word L1B .word L1C .word L1D .word L1E .word L1F .word L20 .word L21 .word L22 .word L23 .word L24 .word L25 .word L26 .word L27 .word L28 .word L29 .word L2A .autoregion .align W01: worldtitleheader 0,0 inctitle "world_trainingroom" W02: worldtitleheader 0,0 inctitle "world_kururinvillage" W03: worldtitleheader 0,-1 inctitle "world_flowerland" W04: worldtitleheader 0,-1 inctitle "world_clockland" W05: worldtitleheader 0,0 inctitle "world_magickingdom" W06: worldtitleheader 0,-1 inctitle "world_neoland" L01: owleveltitleheader -2,0 inctitle "training1" L02: owleveltitleheader 0,0 inctitle "training2" L03: owleveltitleheader 0,0 inctitle "training3" L04: owleveltitleheader 0,0 inctitle "training4" L05: owleveltitleheader 0,0 inctitle "training5" L06: owleveltitleheader 0,-1 inctitle "village1" L07: owleveltitleheader 0,-1 inctitle "village2" L08: owleveltitleheader 0,-1 inctitle "village3" L09: owleveltitleheader 0,0 inctitle "village4" L0A: owleveltitleheader 0,-1 inctitle "village5" L0B: owleveltitleheader 0,0 inctitle "village5a" L0C: owleveltitleheader 0,0 inctitle "village4a" L0D: owleveltitleheader 0,-1 inctitle "village4b" L0E: owleveltitleheader 0,-1 inctitle "flower1" L0F: owleveltitleheader 0,-1 inctitle "flower2" L10: owleveltitleheader 0,-1 inctitle "flower3" L11: owleveltitleheader 0,-2 inctitle "flower4" L12: owleveltitleheaderbig 0,-1 inctitle "flower5" L13: owleveltitleheader 0,-1 inctitle "flower5a" L14: owleveltitleheaderbig 0,-1 inctitle "flower3a" L15: owleveltitleheader 0,-1 inctitle "flower3b" L16: owleveltitleheader 0,-1 inctitle "clock1" L17: owleveltitleheader 0,-1 inctitle "clock2" L18: owleveltitleheader 0,-2 inctitle "clock3" L19: owleveltitleheaderbig 0,0 inctitle "clock4" L1A: owleveltitleheaderbig 0,0 inctitle "clock5" L1B: owleveltitleheaderbig 0,0 inctitle "clock4a" L1C: owleveltitleheaderbig 0,-1 inctitle "clock3a" L1D: owleveltitleheader 0,0 inctitle "clock3b" L1E: owleveltitleheader 0,0 inctitle "magic1" L1F: owleveltitleheader 0,0 inctitle "magic2" L20: owleveltitleheader 0,0 inctitle "magic3" L21: owleveltitleheader 0,0 inctitle "magic4" L22: owleveltitleheader 0,1 inctitle "magic5" L23: owleveltitleheaderbig 0,0 inctitle "magic6" L24: owleveltitleheaderbig 0,0 inctitle "magic4a" L25: owleveltitleheaderbig 0,1 inctitle "magic4aa" L26: owleveltitleheader 0,0 inctitle "magic4ab" L27: owleveltitleheaderbig 0,1 inctitle "neo1" L28: owleveltitleheader 0,-1 inctitle "neo2" L29: owleveltitleheader 0,0 inctitle "neo3" L2A: owleveltitleheader 0,-1 inctitle "neo4" ;then, minigames: In the Sky, Spin Shot, Twin Hopper, ;Super Jumper, Falling Down, Grass Cutter ;Starlight Romance, Pit-pat racer, occupy ;Crossfire, Magnemagne, Slip Drop, .endautoregion
18.113043
99
0.713634
0a2a0b5490aa65440b1fe182c0262ef95f50a7d3
654
asm
Assembly
oeis/291/A291773.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/291/A291773.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/291/A291773.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A291773: Domination number of the n-Apollonian network. ; 1,1,3,4,7,16,43,124,367,1096,3283,9844,29527,88576,265723,797164,2391487,7174456,21523363,64570084,193710247,581130736,1743392203,5230176604,15690529807,47071589416,141214768243,423644304724,1270932914167,3812798742496,11438396227483,34315188682444,102945566047327,308836698141976,926510094425923,2779530283277764,8338590849833287,25015772549499856,75047317648499563,225141952945498684,675425858836496047,2026277576509488136,6078832729528464403,18236498188585393204,54709494565756179607 mov $2,$0 lpb $0 mov $0,$2 sub $0,2 mov $1,3 pow $1,$0 add $1,3 lpe div $1,2 add $1,1 mov $0,$1
43.6
488
0.825688
c2a1d3083a930d0e83bf41dea3d6655c42c38102
72,904
asm
Assembly
eliteNext.asm
ped7g/EliteNext
6e930f9b9924b295d7281ee6acb879600d7e597f
[ "Unlicense" ]
null
null
null
eliteNext.asm
ped7g/EliteNext
6e930f9b9924b295d7281ee6acb879600d7e597f
[ "Unlicense" ]
null
null
null
eliteNext.asm
ped7g/EliteNext
6e930f9b9924b295d7281ee6acb879600d7e597f
[ "Unlicense" ]
null
null
null
DEVICE ZXSPECTRUMNEXT DEFINE DOUBLEBUFFER 1 CSPECTMAP eliteN.map OPT --zxnext=cspect --syntax=a --reversepop DEBUGSEGSIZE equ 1 DEBUGLOGSUMMARY equ 1 ;DEBUGLOGDETAIL equ 1 ;---------------------------------------------------------------------------------------------------------------------------------- ; Game Defines ScreenLocal EQU 0 ScreenGalactic EQU ScreenLocal + 1 ScreenMarket EQU ScreenGalactic + 1 ScreenMarketDsp EQU ScreenMarket + 1 ScreenStatus EQU ScreenMarketDsp + 1 ScreenInvent EQU ScreenStatus + 1 ScreenPlanet EQU ScreenInvent + 1 ScreenEquip EQU ScreenPlanet + 1 ScreenLaunch EQU ScreenEquip + 1 ScreenFront EQU ScreenLaunch + 1 ScreenAft EQU ScreenFront+1 ScreenLeft EQU ScreenAft+1 ScreenRight EQU ScreenLeft+1 ScreenDocking EQU ScreenRight+1 ScreenHyperspace EQU ScreenDocking+1 ;---------------------------------------------------------------------------------------------------------------------------------- ; Colour Defines INCLUDE "./Hardware/L2ColourDefines.asm" INCLUDE "./Hardware/L1ColourDefines.asm" ;---------------------------------------------------------------------------------------------------------------------------------- ; Total screen list ; Local Chart ; Galactic Chart ; Market Prices ; Inventory ; Comander status ; System Data ; Mission Briefing ; missio completion ; Docked Menu (only place otehr than pause you can load and save) ; Pause Menu (only place you can load from ) ; byint and selling equipment ; bying and selling stock INCLUDE "./Hardware/register_defines.asm" INCLUDE "./Layer2Graphics/layer2_defines.asm" INCLUDE "./Hardware/memory_bank_defines.asm" INCLUDE "./Hardware/screen_equates.asm" INCLUDE "./Data/ShipModelEquates.asm" INCLUDE "./Macros/MMUMacros.asm" INCLUDE "./Macros/ShiftMacros.asm" INCLUDE "./Macros/MathsMacros.asm" INCLUDE "./Macros/CopyByteMacros.asm" INCLUDE "./Macros/generalMacros.asm" INCLUDE "./Macros/ldCopyMacros.asm" INCLUDE "./Macros/ldIndexedMacros.asm" INCLUDE "./Variables/general_variables_macros.asm" charactersetaddr equ 15360 STEPDEBUG equ 1 ORG $8000 di ; "STARTUP" MMUSelectLayer1 call l1_cls ld a,7 call l1_attr_cls_to_a ld a,$FF call l1_set_border MMUSelectSpriteBank call sprite_load_sprite_data Initialise: MMUSelectLayer2 call l2_initialise ClearForceTransition TidyDEBUG: ld a,16 ld (TidyCounter),a TestText: xor a ld (JSTX),a MMUSelectCmdrData call defaultCommander DEBUGCODE: ClearSafeZone ; just set in open space so compas treacks su n MMUSelectSpriteBank call init_sprites IFDEF DOUBLEBUFFER MMUSelectLayer2 call l2_cls call l2_flip_buffers ENDIF ; Set up all 8 galaxies, 7later this will be pre built and loaded into memory from files InitialiseGalaxies: call ResetUniv ; Reset ship data call ResetGalaxy ; Reset each galaxy copying in code call SeedAllGalaxies .ClearLayer2Buffers: MMUSelectLayer2 call l2_cls IFDEF DOUBLEBUFFER MMUSelectLayer2 call l2_flip_buffers ENDIF ;.Sa MMUSelectUniverseN 0 ;InitialiseDemoShip: call ClearFreeSlotList ; call FindNextFreeSlotInA ; ld b,a ; ld a,13 ;Coriolis station ; call InitialiseShipAUnivB ; xor a InitialiseMainLoop: xor a ld (CurrentUniverseAI),a ld a,3 ld (MenuIdMax),a ld a,$FF ; Starts Docked ld (DockedFlag),a ; call InitialiseFrontView call InitialiseCommander MMUSelectUniverseN 2 call SetInitialShipPosition MMUSelectStockTable call generate_stock_market ;..MAIN GAME LOOP.................................................................................................................. ;.................................................................................................................................. MainLoop: call doRandom ; redo the seeds every frame call scan_keyboard ;.. This bit allows cycling of ships on universe 0 in demo......................................................................... DemoOfShipsDEBUG: call TestForNextShip ;.. Check if keyboard scanning is allowed by screen. If this is set then skip all keyboard and AI.................................. InputBlockerCheck: ld a,$0 JumpIfAEqNusng $01, SkipInputHandlers ; as we are in a transition the whole update AI is skipped call ViewKeyTest call TestPauseMode ld a,(GamePaused) cp 0 jr nz,MainLoop call MovementKeyTest ;.. Process cursor keys for respective screen if the address is 0 then we skill just skip movement................................. HandleMovement: ld a,(CallCursorRoutine+2) IfAIsZeroGoto TestAreWeDocked ;.. Handle displaying correct screen .............................................................................................. HandleBankSelect: ld a,$00 MMUSelectScreenA CallCursorRoutine: call $0000 ;.. Check to see if we are docked as if we are (or are docking.launching then no AI/Ship updates occur............................. ;.. Also end up here if we have the screen input blocker set SkipInputHandlers: ;.. For Docked flag its - 0 = in free space, FF = Docked, FE transition, FD = Setup open space and transition to not docked TestAreWeDocked: ld a,(DockedFlag) ; if if we are in free space do universe update JumpIfANENusng 0, SkipUniveseUpdate ; else we skip it. As we are also in dock/transition then no models should be updated so we dont; need to draw ;.. If we get here then we are in game running mode regardless of which screen we are on, so update AI............................. ;.. we do one universe slot each loop update ...................................................................................... ;.. First update Sun............................................................................................................... .UpdateShips: call UpdateUniverseObjects JumpIfMemNeNusng ScreenTransitionForced, $FF, BruteForceChange ; if we docked then a transition would have been forced CheckIfViewUpdate: ld a,$00 ; if this is set to a view number then we process a view cp 0 ; . jr z, MenusLoop ; This will change as more screens are added TODO ;..Processing a view............................................................................................................... ;..Display any message ............................................................................................................ ld a,(MessageCount) jr z,.NoMessages ; note message end will tidy up display .NoMessages: ld hl,(InnerHyperCount) ld a,h or l jr z,.NoHyperspace ; note message end will tidy up display call HyperSpaceMessage .NoHyperspace: MMUSelectLayer2 call l2_cls MMUSelectLayer1 .UpdateSun: MMUSelectSun .DEBUGFORCE: ;ld hl,$0000 ;ld (SBnKxlo),hl ;ld (SBnKylo),hl ;xor a ;ld (SBnKxsgn),a ;ld (SBnKysgn),a ;ld hl,$0200 ;ld (SBnKzlo),hl ;ld a,$00 ;ld (SBnKzsgn),a call SunUpdateAndRender ;..Later this will be done via self modifying code to load correct stars routine for view.......................................... DrawDustForwards: ld a,$DF ld (line_gfx_colour),a DustUpdateBank: MMUSelectViewFront ; This needs to be self modifying DustUpdateRoutine: call DustForward ; This needs to be self modifying PrepLayer2: MMUSelectLayer2 ; Clear layer 2 for graphics ; call l2_cls ;ProcessSun: call DrawForwardSun ProcessPlanet: ProcessShipModels: call DrawForwardShips ; Draw all ships (this may need to be self modifying) call UpdateConsole ; Update display console on layer 1 jp LoopRepeatPoint ; And we are done with views, so check if there was a special command to do ;..If we were not in views then we were in display screens/menus................................................................... MenusLoop: ld hl,(ScreenLoopJP+1) ld a,h or l jp z,LoopRepeatPoint ;..This is the screen update routine for menus..................................................................................... ;.. Also used by transition routines SkipUniveseUpdate: JumpIfMemZero ScreenLoopJP+1,LoopRepeatPoint ScreenLoopBank: ld a,$0 MMUSelectScreenA ScreenLoopJP: call $0000 LoopRepeatPoint: ld a,(DockedFlag) HandleLaunched: JumpIfAEqNusng $FD, WeHaveCompletedLaunch JumpIfAEqNusng $FE, WeAreInTransition JumpIfAEqNusng $FC, WeAreHJumping JumpIfAEqNusng $FB, WeAreHEntering JumpIfAEqNusng $FA, WeHaveCompletedHJump jp DoubleBufferCheck WeHaveCompletedLaunch: call LaunchedFromStation jp DoubleBufferCheck WeAreHJumping: call hyperspace_Lightning jp c,DoubleBufferCheck ld a,$FB ld (DockedFlag),a jp DoubleBufferCheck WeAreHEntering: ld a,$FA ld (DockedFlag),a jp DoubleBufferCheck WeHaveCompletedHJump: ld a,(Galaxy) ; DEBUG as galaxy n is not working MMUSelectGalaxyA ld hl,(TargetPlanetX) ld (PresentSystemX),hl ld b,h ld c,l CorrectPostJumpFuel ForceTransition ScreenFront ; This will also trigger stars ld a,$00 ld (DockedFlag),a call GalaxyGenerateDesc ; bc holds new system to generate system call copy_working_to_system ; and propogate copies of seeds call copy_working_to_galaxy ; . call get_planet_data_working_seed ; sort out system data ;call GetDigramGalaxySeed ; . MMUSelectStockTable ; . call generate_stock_market ; generate new prices call ClearUnivSlotList ; clear out any ships call ResetPlayerShip HalveFugitiveStatus ; halves status and brings bit into carry MMUSelectSun call CreateSun ; create the local sun and set position based on seed ;TODO call generateSunAndPlanetPos ; uses current carry state too ;TODO.CreateSun: call SetSunSlot ; PROBABLY NOT NEEDED NOW MMUSelectShipBank1 ; PROBABLY NOT NEEDED NOW call GetShipBankId ;;SELECT CORRECT BANK MMUSelectUniverseN 0 ;;TODO call CopyBodyToUniverse ;;TODO call CreateSun ;;TODOCreatePlanet: call SetPlanetSlot ;;TODO MMUSelectShipBank1 ;;TODO call GetShipBankId ;;TODO MMUSelectUniverseBankN 1 ;;TODO call CopyBodyToUniverse ; reset main loop counters ; from BBC TT18 jump code ; need to set system corrodinates, flush out univere ships etc ; set up new star system and landing location in system ; reset ship speed etc (RES2) ; update legal status, missle indicatrions, planet data block, sun data block (SOLAR) ; put planet into data blokc 1 of FRIN ; put sun inot data block (NWWSHIP) ; need to look at in system warp code (WARP) - note we need to -reorg all to code for teh station as that will never be in slot 0 WeAreInTransition: DoubleBufferCheck: ld a,00 IFDEF DOUBLEBUFFER cp 0 jp z,TestTransition MMUSelectLayer2 ld a,(varL2_BUFFER_MODE) cp 0 call nz,l2_flip_buffers ENDIF TestTransition: ld a,(ScreenTransitionForced) ; was there a bruite force screen change in any update loop cp $FF jp z,MainLoop BruteForceChange: ld d,a ld e,ScreenMapRow mul ld ix,ScreenKeyMap add ix,de ; Force screen transition call SetScreenAIX jp MainLoop ;..Hyperspace counter............................................................................................................ HyperSpaceMessage: MMUSelectLayer1 call DisplayHyperCountDown .UpdateHyperCountdown: ld hl,(InnerHyperCount) dec l jr nz,.decHyperInnerOnly dec h ret m .resetHyperInner: ld l,$0B push hl ld d,12 ld a,L1ColourPaperBlack | L1ColourInkYellow call l1_attr_cls_2DlinesA ld d,12 * 8 call l1_cls_2_lines_d ld de,$6000 ld hl,Hyp_centeredTarget call l1_print_at ld de,$6800 ld hl,Hyp_centeredCharging call l1_print_at pop hl .decHyperInnerOnly: ld (InnerHyperCount),hl ret .HyperCountDone: ld hl,0 ld (InnerHyperCount),hl ld d,12 ld a,L1ColourPaperBlack | L1ColourInkBlack call l1_attr_cls_2DlinesA ld d,12 * 8 call l1_cls_2_lines_d ForceTransition ScreenHyperspace ; transition to hyperspace ret ;.................................................................................................................................. ;..Update Universe Objects......................................................................................................... UpdateUniverseObjects: xor a ld (SelectedUniverseSlot),a .UpdateUniverseLoop: ld d,a ; d is unaffected by GetTypeInSlotA ;.. If the slot is empty (FF) then skip this slot.................................................................................. call GetTypeAtSlotA cp $FF jr z,.ProcessedUniverseSlot .UniverseObjectFound: ld a,d ; Get back Universe slot as we want it MMUSelectUniverseA ; and we apply roll and pitch call ApplyMyRollAndPitch call ApplyShipRollAndPitch ;.. If its a space station then see if we are ready to dock........................................................................ .CheckIfDockable: ld a,(ShipTypeAddr) ; Now we have the correct bank JumpIfANENusng ShipTypeStation, .NotDockingCheck ; if its not a station so we don't test docking .IsDockableAngryCheck: JumpOnMemBitSet ShipNewBitsAddr, 4, .NotDockingCheck ; if it is angry then we dont test docking call DockingCheck ; So it is a candiate to test docking. Now we do the position and angle checks ReturnIfMemEquN ScreenTransitionForced, $FF ; if we docked then a transition would have been forced .NotDockingCheck: CallIfMemEqMemusng SelectedUniverseSlot, CurrentUniverseAI, UpdateShip .ProcessedUniverseSlot: ld a,(SelectedUniverseSlot) ; Move to next ship cycling if need be to 0 inc a ; . JumpIfAGTENusng UniverseListSize, .UpdateAICounter ; . ld (SelectedUniverseSlot),a jp .UpdateUniverseLoop .UpdateAICounter: ld a,(CurrentUniverseAI) inc a cp 12 jr c,.IterateAI xor a .IterateAI: ld (CurrentUniverseAI),a ret ;.................................................................................................................................. ;.. Quickly eliminate space stations too far away.................................................................................. DockingCheck: ld bc,(UBnKxlo) ld hl,(UBnKylo) ld de,(UBnKzlo) ld a,b or h or d ret nz .CheckIfInRangeLo: ld a,c or l or e and %11000000 ; Note we should make this 1 test for scoop or collision too ret nz ;.. Now check to see if we are comming in at a viable angle........................................................................ .CheckDockingAngle: ld a,(UBnkrotmatNosevZ+1) ; get get high byte of rotmat ReturnIfALTNusng 214 ; this is the magic angle to be within 26 degrees +/- call GetStationVectorToWork ; Normalise position into XX15 as in effect its a vector from out ship to it given we are always 0,0,0, returns with A holding vector z bit 7,a ; if its negative ret nz ; we are flying away from it ReturnIfALTNusng 89 ; if the axis <89 the we are not in the 22 degree angle ld a,(UBnkrotmatRoofvX+1) ; get roof vector high and SignMask8Bit ReturnIfALTNusng 80 ; note 80 decimal for 36.6 degrees ;.. Its passed all validation and we are docking................................................................................... .AreDocking: MMUSelectLayer1 ld a,$6 call l1_set_border .EnterDockingBay: ForceTransition ScreenDocking ret ;.................................................................................................................................. ;; TODODrawForwardSun: MMUSelectSun ;; TODO ld a,(SunKShipType) ;; TODO.ProcessBody: cp 129 ;; TODO jr nz,.ProcessPlanet ;; TODO.ProcessSun: call ProcessSun ;; TODO ;; TODOProcessSun: call CheckSunDistance ;; TODO ;; TODO ret ;; TODO.ProcessPlanet: call ProcessPlanet ;; TODO ret ;.................................................................................................................................. DrawForwardShips: xor a DrawShipLoop: ld (CurrentShipUniv),a call GetTypeAtSlotA cp $FF jr z,ProcessedDrawShip ; Add in a fast check for ship behind to process nodes and if behind jump to processed Draw ship SelectShipToDraw: ld a,(CurrentShipUniv) MMUSelectUniverseA ; Need check for exploding here .ProcessUnivShip: call ProcessShip ;; call ProcessUnivShip UpdateRadar: ;;;Does nothing ld a,BankFrontView ;;;Does nothing MMUSelectScreenA ;;;Does nothing ld a,(CurrentShipUniv) ;;;Does nothing MMUSelectUniverseA call UpdateScannerShip ProcessedDrawShip: ld a,(CurrentShipUniv) inc a JumpIfALTNusng UniverseListSize, DrawShipLoop DrawSunCompass: MMUSelectSun ; For now for the sun we will take high bytes so it scales down call UpdateScannerSun ret ;.................................................................................................................................. CurrentShipUniv: DB 0 ;;;ProcessUnivShip: call CheckDistance ; Will check for negative Z and skip (how do we deal with read and side views? perhaps minsky transformation handles that?) ;;; ret c ;;; ld a,(UbnkDrawAsDot) ;;; and a ;;; jr z,.CarryOnWithDraw ;;;.itsJustADot: ld bc,(UBnkNodeArray) ; if its at dot range ;;; ld a,$FF ; just draw a pixel ;;; MMUSelectLayer2 ; then go to update radar ;;; call l2_plot_pixel ; ;;; ClearCarryFlag ;;; ret ;;;.ProcessShipNodes: call ProcessShip ;;; ;;;call ProcessNodes ; it hink here we need the star and planet special cases ;;;.DrawShip: call CullV2 ; culling but over aggressive backface assumes all 0 up front TOFIX ;;; call PrepLines ; LL72, process lines and clip, ciorrectly processing face visibility now ;;; ld a,(CurrentShipUniv) ;;; MMUSelectUniverseA ;;; call DrawLines ;;; ClearCarryFlag ;;; ret TestForNextShip: ld a,c_Pressed_Quit call is_key_pressed ret nz ld a,(currentDemoShip) inc a cp 44 jr nz,.TestOK xor a .TestOK: ld (currentDemoShip),a call ClearUnivSlotList ld a,(currentDemoShip) ld b,a xor a call SetSlotAToTypeB MMUSelectUniverseN 2 call ResetUBnkData ; call the routine in the paged in bank, each universe bank will hold a code copy local to it ld a,(currentDemoShip) MMUSelectShipBank1 call GetShipBankId MMUSelectShipBankA ld a,b call CopyShipToUniverse call SetInitialShipPosition call DEBUGSETNODES ret ;---------------------------------------------------------------------------------------------------------------------------------- NeedAMessageQueue: UpdateCountdownNumber: ld a,(OuterHyperCount) ld de,Hyp_counter ld c, -100 call .Num1 ld c,-10 call .Num1 ld c,-1 .Num1: ld b,'0'-1 .Num2: inc b add a,c jr c,.Num2 sub c push bc push af ld a,c cp -1 ld a,b ld (de),a inc de pop af pop bc ret ;---------------------------------------------------------------------------------------------------------------------------------- Hyp_message DB "To:" Hyp_to DS 32 Hyp_space1 DB " " Hyp_dist_amount DB "0.0" Hyp_decimal DB "." Hyp_fraction DB "0" Hyp_dis_ly DB " LY",0 Hyp_charging DB "Charging:" Hyp_counter DB "000",0 Hyp_centeredTarget DS 32 Hyp_centeredEol DB 0 Hyp_bufferpadding DS 32 ; just in case we get a buffer ovverun. shoudl never get beyond 32 chars Hyp_centeredCharging DS 32 Hyp_centeredEol2 DB 0 Hyp_bufferpadding2 DS 32 ; just in case we get a buffer ovverun. shoudl never get beyond 32 chars MainCopyLoop: ld a,(hl) cp 0 ret z ld (de),a inc hl inc de jr MainCopyLoop CountLengthHL: ld b,0 .CountLenLoop: ld a,(hl) cp 0 jr z,.DoneCount inc b inc hl jr .CountLenLoop .DoneCount: ld a,32 sub b sra a ret MainClearTextLoop: ld b,a ld a,32 .ClearLoop: ld (hl),a inc hl djnz .ClearLoop ret DisplayHyperCountDown: ld de,Hyp_to ld hl,name_expanded call MainCopyLoop .DoneName: xor a ld (de),a ld (Hyp_message+31),a ; max out at 32 characters .CentreJustify: ld hl,Hyp_message call CountLengthHL ld hl,Hyp_centeredTarget call MainClearTextLoop ex de,hl ld hl,Hyp_message call MainCopyLoop xor a ld (Hyp_centeredEol),a ld hl,Hyp_counter ; clear counter digits ld a,32 ; clear counter digits ld (hl),a ; clear counter digits inc hl ; clear counter digits ld (hl),a ; clear counter digits inc hl ; clear counter digits ld (hl),a ; clear counter digits call UpdateCountdownNumber ld hl,Hyp_charging call CountLengthHL ld hl,Hyp_centeredCharging call MainClearTextLoop ex de,hl ld hl,Hyp_charging call MainCopyLoop xor a ld (Hyp_centeredEol2),a ret ;DisplayTargetAndRange ;DisplayCountDownNumber ;---------------------------------------------------------------------------------------------------------------------------------- TestPauseMode: ld a,(GamePaused) cp 0 jr nz,.TestForResume .CheckViewMode: ld a,(ScreenIndex) ; we can only pause if not on screen view ReturnIfAGTENusng ScreenFront .CheckPauseKey: ld a,c_Pressed_Freeze call is_key_pressed ret nz .PausePressed: ld a,$FF ; doesn't really matter if we were in pause already as resume is a different key ld (GamePaused),a ret .TestForResume: ld a,c_Pressed_Resume ; In pause loop so we can check for resume key call is_key_pressed ret nz .ResumePressed: xor a ld (GamePaused),a ; Resume pressed to reset pause state ret TestQuit: ld a,c_Pressed_Quit call is_key_pressed ret currentDemoShip: DB 13;$12 ; 13 - corirollis ;---------------------------------------------------------------------------------------------------------------------------------- UpdateShip: ; call DEBUGSETNODES ; call DEBUGSETPOS ld hl,TidyCounter dec (hl) ret nz ld a,16 ld (TidyCounter),a ; call TIDY TIDY IS BROKEN ; add AI in here too ret InitialiseShipAUnivB: push af ld a,b MMUSelectUniverseA ; load up register into universe bank call ResetUBnkData ; call the routine in the paged in bank, each universe bank will hold a code copy local to it MMUSelectShipBank1 pop af call CopyShipToUniverse ret GetStationVectorToWork: ld hl,UBnKxlo ld de,varVector9ByteWork ldi ldi ldi ldi ldi ldi ldi ldi ldi .CalcNormalToXX15: ld hl, (varVector9ByteWork) ; X ld de, (varVector9ByteWork+3); Y ld bc, (varVector9ByteWork+6); Z ld a,l or e or c or 1 ld ixl,a ; or all bytes and with 1 so we have at least a 1 ld a,h or d or b ; or all high bytes but don't worry about 1 as its sorted on low bytes .MulBy2Loop: push bc ld b,ixl sla b ; Shift ixl left ld ixl,b pop bc rl a ; roll into a jr c,.TA2 ; if bit rolled out of rl a then we can't shift any more to the left ShiftHLLeft1 ; Shift Left X ShiftDELeft1 ; Shift Left Y ShiftBCLeft1 ; Shift Left Z jr .MulBy2Loop ; no need to do jr nc as the first check looks for high bits across all X Y and Z .TA2: ld a,(varVector9ByteWork+2); x sign srl h or h ld (XX15VecX),a ; note this is now a signed highbyte ld a,(varVector9ByteWork+5); y sign srl d or d ld (XX15VecY),a ; note this is now a signed highbyte ld a,(varVector9ByteWork+8); y sign srl b or b ld (XX15VecZ),a ; note this is now a signed highbyte call normaliseXX1596fast ret ; will return with a holding Vector Z TidyCounter DB 0 INCLUDE "./debugMatrices.asm" ;TODO Optimisation ; Need this table to handle differnet events ; 1-main loop update - just general updates specfic to that screen that are not galaxy or stars, e.g. update heat, console ; cursor key, joystick press ; cursor key, joystick press ; non cursor keys presses ; ; First byte is now docked flag ; ; Padded to 8 bytes to allow a * 8 for addressing ; Byte 0 - Docked flag : 0 = not applicable (always read), 1 = only whilst docked, 2 = only when not docked, 3 = No keypress allowed ; Byte 1 - Screen Id ; Byte 2,3 - address of keypress table ; Byte 4 - Bank with Display code ; Byte 5,6 - Function for display ; Byte 7,8 - Main loop update routine ; Byte 9 - Draw stars Y/N ; byte 10 - Input Blocker (set to 1 will not allow keyboard screen change until flagged, used by transition screens and pause menus) ; byte 11 - Double Buffering 0 = no, 1 = yes ; byte 12,13 - cursor key input routine ; byte 14 - HyperspaceBlock - can not select this screen if in hyperpace - 00 can , 01 can not ; byte 15 padding at the momnent (should add in an "AI enabled flag" for optimistation, hold previous value and on change create ships ; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ScreenKeyMap: DB 0, ScreenLocal , low addr_Pressed_LocalChart, high addr_Pressed_LocalChart, BankMenuShrCht, low draw_local_chart_menu, high draw_local_chart_menu, $00, $00, $00,$00,$00,low local_chart_cursors, high local_chart_cursors, $01,$00;low loop_local_chart_menu, high loop_local_chart_menu ScreenKeyGalactic: DB 0, ScreenGalactic , low addr_Pressed_GalacticChrt, high addr_Pressed_GalacticChrt, BankMenuGalCht, low draw_galactic_chart_menu,high draw_galactic_chart_menu, low loop_gc_menu, high loop_gc_menu, $00,$00,$00,low galctic_chart_cursors, high galctic_chart_cursors, $01,$00 DB 1, ScreenMarket , low addr_Pressed_MarketPrices, high addr_Pressed_MarketPrices, BankMenuMarket, low draw_market_prices_menu, high draw_market_prices_menu, low loop_market_menu, high loop_market_menu, $00,$00,$00,$00, $00, $01,$00 DB 2, ScreenMarketDsp , low addr_Pressed_MarketPrices, high addr_Pressed_MarketPrices, BankMenuMarket, low draw_market_prices_menu, high draw_market_prices_menu, $00, $00, $00,$00,$00,$00, $00, $01,$00 ScreenCmdr: DB 0, ScreenStatus , low addr_Pressed_Status, high addr_Pressed_Status, BankMenuStatus, low draw_status_menu, high draw_status_menu, low loop_STAT_menu, high loop_STAT_menu, $00,$00,$00,$00, $00, $01,$00 DB 0, ScreenInvent , low addr_Pressed_Inventory, high addr_Pressed_Inventory, BankMenuInvent, low draw_inventory_menu, high draw_inventory_menu, $00, $00, $00,$00,$00,$00, $00, $01,$00 DB 0, ScreenPlanet , low addr_Pressed_PlanetData, high addr_Pressed_PlanetData, BankMenuSystem, low draw_system_data_menu, high draw_system_data_menu, $00, $00, $00,$00,$00,$00, $00, $01,$00 DB 1, ScreenEquip , low addr_Pressed_Equip, high addr_Pressed_Equip, BankMenuEquipS, low draw_eqshp_menu, high draw_eqshp_menu, low loop_eqshp_menu, high loop_eqshp_menu, $00,$00,$00,$00, $00, $01,$00 DB 1, ScreenLaunch , low addr_Pressed_Launch, high addr_Pressed_Launch, BankLaunchShip, low draw_launch_ship, high draw_launch_ship, low loop_launch_ship, high loop_launch_ship, $00,$01,$01,$00, $00, $01,$00 ScreenKeyFront: DB 2, ScreenFront , low addr_Pressed_Front, high addr_Pressed_Front, BankFrontView, low draw_front_view, high draw_front_view, $00, $00, $01,$00,$01,low input_front_view, high input_front_view, $00,$00 DB 2, ScreenAft , low addr_Pressed_Front, high addr_Pressed_Front, BankFrontView, low draw_front_view, high draw_front_view, $00, $00, $01,$00,$01,low input_front_view, high input_front_view, $00,$00 DB 2, ScreenLeft , low addr_Pressed_Front, high addr_Pressed_Front, BankFrontView, low draw_front_view, high draw_front_view, $00, $00, $01,$00,$01,low input_front_view, high input_front_view, $00,$00 DB 2, ScreenRight , low addr_Pressed_Front, high addr_Pressed_Front, BankFrontView, low draw_front_view, high draw_front_view, $00, $00, $01,$00,$01,low input_front_view, high input_front_view, $00,$00 DB 3, ScreenDocking , $FF, $FF, BankLaunchShip, low draw_docking_ship, high draw_docking_ship, low loop_docking_ship,high loop_docking_ship, $00,$01,$01,$00, $00, $01,$00 DB 1, ScreenHyperspace, $FF, $FF, BankFrontView, low draw_hyperspace, high draw_hyperspace, low loop_hyperspace, high loop_hyperspace, $00,$01,$01,$00 ; DB low addr_Pressed_Aft, high addr_Pressed_Aft, BankMenuGalCht, low SelectFrontView, high SelectFrontView, $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; DB low addr_Pressed_Left, high addr_Pressed_Left, BankMenuGalCht, low SelectFrontView, high SelectFrontView, $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; DB low addr_Pressed_Right, high addr_Pressed_Right, BankMenuGalCht, low SelectFrontView, high SelectFrontView, $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ScreenMapRow EQU ScreenKeyGalactic - ScreenKeyMap ScreenMapLen EQU ($ - ScreenKeyMap) / ScreenMapRow ScreenViewsStart EQU (ScreenKeyFront - ScreenKeyMap)/ScreenMapRow ScreenTransitionForced DB $FF INCLUDE "./GameEngine/resetUniverse.asm" ;---------------------------------------------------------------------------------------------------------------------------------- LaunchedFromStation: MMUSelectSun call CreateSun ; create the local sun and set position based on seed call ClearUnivSlotList ld a,1 call SetSlot1ToSpaceStation ; set slot 1 to space station MMUSelectUniverseA ; Prep Target universe MMUSelectShipBank1 ; Bank in the ship model code ld a,CoriloisStation call GetShipBankId MMUSelectShipBankA ; Select the correct bank found ld a,b ; Select the correct ship call CopyShipToUniverse .BuiltStation: call ResetStationLaunch .NowInFlight: xor a ld (DockedFlag),a ForceTransition ScreenFront call ResetPlayerShip ret InitialiseCommander: ld a,(ScreenCmdr+1) ld ix,ScreenCmdr jp SetScreenAIX InitialiseFrontView: ld a,(ScreenKeyFront+1) ld ix,ScreenKeyFront jp SetScreenAIX ; false ret here as we get it free from jp ;---------------------------------------------------------------------------------------------------------------------------------- SetScreenAIX: ld (ScreenIndex),a ; Set screen index to a ClearForceTransition ; In case it was called by a brute force change in an update loop ld (ScreenChanged),a ; Set screen changed to FF ld a,(ix+4) ; Screen Map Byte 4 - Bank with Display code ld (ScreenLoopBank+1),a ; setup loop ld (HandleBankSelect+1),a ; setup cursor keys MMUSelectScreenA ld a,(ix+5) ; Screen Map Byte 5 - Function for display ld (ScreenUpdateAddr+1),a ld a,(ix+6) ; Screen Map Byte 6 - Function for display ld (ScreenUpdateAddr+2),a ld a,(ix+7) ; Screen Map Byte 7 - Main loop update routine ld (ScreenLoopJP+1),a ld a,(ix+8) ; Screen Map Byte 8 - Main loop update routine ld (ScreenLoopJP+2),a ld a,(ix+9) ; Screen Map Byte 9 - Draw stars Y/N ld (CheckIfViewUpdate+1),a ; Set flag to determine if we are on an exterior view ld a,(ix+10) ; Screen Map Byte 10 - Input Blocker (set to 1 will not allow keyboard screen change until flagged, used by transition screens and pause menus) ld (InputBlockerCheck+1),a ; Set flag to block transitions as needed e.g. launch screen ld a,(ix+11) ; Screen Map Byte 11 - Double Buffering 0 = no, 1 = yes ld (DoubleBufferCheck+1),a ld a,(ix+12) ld (CallCursorRoutine+1),a ld a,(ix+13) ld (CallCursorRoutine+2),a ScreenUpdateAddr: jp $0000 ; We can just drop out now and also get a free ret from caller ;---------------------------------------------------------------------------------------------------------------------------------- ViewKeyTest: ld a,(ScreenIndex) ld c,a ld b,ScreenMapLen ; For now until add screens are added ld ix,ScreenKeyMap ld hl,(InnerHyperCount) ld a,h or l ld iyh,a ViewScanLoop: ld a,iyh .HyperspaceCountdown: and a jr z,.DockedFlag ld a,(ix+14) cp 1 jp z,NotReadNextKey .DockedFlag: ld a,(ix+0) ; Screen Map Byte 0 Docked flag ; 0 = not applicable (always read), 1 = only whilst docked, 2 = only when not docked, 3 = No keypress allowed cp 3 ; if not selectable then don't scan this (becuase its a transition screen) jr z,NotReadNextKey ; cp 0 ; if itr a always read skip docking check jr z,.NoDocCheck .DocCheck: ld d,a ld a,(DockedFlag) cp 0 ; if we are docked jr z,.NotDockedCheck .DockedCheck: ld a,d cp 1 ; if we are docked and its a dock only then scan jr nz,NotReadNextKey jr .NoDocCheck .NotDockedCheck: ld a,d cp 2 ; if we are not docked and its a flight only then scan jr nz,NotReadNextKey .NoDocCheck: ld a,(ix+1) ; Screen Map Byte 1 Screen Id cp c ; is the index the current screen, if so skip the scan ld e,a jr z,NotReadNextKey ld a,(ix+2) ; Screen Map Byte 2 - address of keypress table cp $FF ; if upper byte is FF then we do not respond jr z,NotReadNextKey ld (ReadKeyAddr+1),a ; Poke address into the ld hl,(....) below ld a,(ix+3) ; Screen Map Byte 3 - address of keypress table ld (ReadKeyAddr+2),a ReadKeyAddr: ld hl,($0000) ; address is entry in the pointer table to the actual keypress ld a,(hl) ; now fetch the actual keypress IfAIsZeroGoto NotReadNextKey .ValidScreenChange: ld a,e jp SetScreenAIX ;--- CODE WILL NOT FALL TO HERE --- NotReadNextKey: ld de,ScreenMapRow add ix,de ; we have only processed 3 of 8 bytes at here djnz ViewScanLoop ret SetInitialShipPosition: ld hl,$0000 ld (UBnKxlo),hl ld hl,$0000 ld (UBnKylo),hl ld hl,$03B4 ld (UBnKzlo),hl xor a ld (UBnKxsgn),a ld (UBnKysgn),a ld (UBnKzsgn),a ; call Reset TODO call InitialiseOrientation ;#00; ld a,1 ld (DELTA),a ld hl,4 ld (DELTA4),hl ret INCLUDE "./Views/ConsoleDrawing.asm" ;.absXhi: ; ld a,ScannerX ; JumpOnBitSet d,7,ScannerNegX ; add a,e ; jp ScannerZCoord ;ScannerNegX: sub e ;ScannerZCoord: ld e,a ; srl c ; srl c ; ld a,ScannerY ; JumpOnBitSet b,7,ScannerNegZ ; sub c ; jp ScannerYCoord ;ScannerNegZ: add a,c ;ScannerYCoord: ld d,a ; now de = pixel pos d = y e = x for base of stick X & Z , so need Y Stick height ; JumpOnBitSet h,7,ScannerStickDown ; sub l ; a already holds actual Y ; JumpIfAGTENusng 128,ScannerHeightDone ; ld a,128 ; jp ScannerHeightDone ;ScannerStickDown: add a,l ; JumpIfAGTENusng 191,ScannerHeightDone ; ld a,191 ;ScannerHeightDone: ld c,e ; Now sort out line from point DE horzontal by a ; ld b,d ; ld d,a ; cp b ; jp z,Scanner0Height ; ld e,194 ; Should be coloured based on status but this will do for now ; push bc ; push de ; MMUSelectLayer2 ; call l2_draw_vert_line_to ; pop de ; pop bc ;Scanner0Height: ld b,d ; push bc ; ld a,255 ; MMUSelectLayer2 ; call l2_plot_pixel ; pop bc ; inc c ; ld a,255 ; MMUSelectLayer2 ; call l2_plot_pixel ret SeedGalaxy0: xor a MMUSelectGalaxyA ld ix,galaxy_data xor a ld (XSAV),a call copy_galaxy_to_system SeedGalaxy0Loop: push ix pop de ld hl,SystemSeed call copy_seed push ix pop hl add hl,8 push hl pop ix call next_system_seed ld a,(XSAV) dec a cp 0 ret z ld (XSAV),a jr nz,SeedGalaxy0Loop ret ;include "./ModelRender/testdrawing.asm" XX12PVarQ DW 0 XX12PVarR DW 0 XX12PVarS DW 0 XX12PVarResult1 DW 0 XX12PVarResult2 DW 0 XX12PVarResult3 DW 0 XX12PVarSign2 DB 0 XX12PVarSign1 DB 0 ; Note reversed so BC can do a little endian fetch XX12PVarSign3 DB 0 include "./Maths/Utilities/XX12EquNodeDotOrientation.asm" include "ModelRender/CopyXX12ToXX15.asm" include "ModelRender/CopyXX15ToXX12.asm" include "./Maths/Utilities/ScaleXX16Matrix197.asm" include "./Universe/StarRoutines.asm" ; include "Universe/move_object-MVEIT.asm" ; include "./ModelRender/draw_object.asm" ; include "./ModelRender/draw_ship_point.asm" ; include "./ModelRender/drawforwards-LL17.asm" INCLUDE "./Hardware/memfill_dma.asm" INCLUDE "./Hardware/memcopy_dma.asm" INCLUDE "./Hardware/keyboard.asm" INCLUDE "./Variables/constant_equates.asm" INCLUDE "./Variables/general_variables.asm" INCLUDE "./Variables/UniverseSlotRoutines.asm" INCLUDE "./Variables/EquipmentVariables.asm" INCLUDE "./Variables/random_number.asm" INCLUDE "./Variables/galaxy_seed.asm" INCLUDE "./Tables/text_tables.asm" INCLUDE "./Tables/dictionary.asm" INCLUDE "./Tables/name_digrams.asm" ;INCLUDE "Tables/inwk_table.asm" This is no longer needed as we will write to univer object bank ; Include all maths libraries to test assembly INCLUDE "./Maths/addhldesigned.asm" INCLUDE "./Maths/addhlasigned.asm" INCLUDE "./Maths/Utilities/AddDEToCash.asm" INCLUDE "./Maths/DIVD3B2.asm" INCLUDE "./Maths/multiply.asm" INCLUDE "./Maths/asm_square.asm" INCLUDE "./Maths/asm_sqrt.asm" INCLUDE "./Maths/asm_divide.asm" INCLUDE "./Maths/asm_unitvector.asm" INCLUDE "./Maths/compare16.asm" INCLUDE "./Maths/negate16.asm" INCLUDE "./Maths/normalise96.asm" INCLUDE "./Maths/binary_to_decimal.asm" include "./Maths/ADDHLDESignBC.asm" ;INCLUDE "badd_ll38.asm" ;;INCLUDE "XX12equXX15byXX16.asm" INCLUDE "./Maths/Utilities/AequAdivQmul96-TIS2.asm" INCLUDE "./Maths/Utilities/AequAmulQdiv256-FMLTU.asm" INCLUDE "./Maths/Utilities/PRequSpeedDivZZdiv8-DV42-DV42IYH.asm" INCLUDE "./Maths/Utilities/AequDmulEdiv256usgn-DEFMUTL.asm" ;INCLUDE "AP2equAPmulQunsgEorP-MLTU2.asm" ;INCLUDE "APequPmulQUnsg-MULTU.asm" ;INCLUDE "APequPmulX-MU11.asm" INCLUDE "./Maths/Utilities/APequQmulA-MULT1.asm" INCLUDE "./Maths/Utilities/badd_ll38.asm" INCLUDE "./Maths/Utilities/moveship4-MVS4.asm" ;INCLUDE "MoveShip5-MVS5.asm" ;INCLUDE "PAequAmulQusgn-MLU2.asm" ;INCLUDE "PAequDustYIdxYmulQ-MLU1.asm" ;INCLUDE "PlanetP12addInwkX-MVT6.asm" INCLUDE "./Maths/Utilities/RequAmul256divQ-BFRDIV.asm" INCLUDE "./Maths/Utilities/RequAdivQ-LL61.asm" ; INCLUDE "./Maths/Utilities/RSequABSrs-LL129.asm" INCLUDE "./Maths/Utilities/RSequQmulA-MULT12.asm" ;INCLUDE "SwapRotmapXY-PUS1.asm" INCLUDE "./Maths/Utilities/tidy.asm" INCLUDE "./Maths/Utilities/LL28AequAmul256DivD.asm" INCLUDE "./Maths/Utilities/XAequMinusXAPplusRSdiv96-TIS1.asm" ;INCLUDE "XAequQmuilAaddRS-MAD-ADD.asm" ;INCLUDE "XHiYLoequPA-gc3.asm" ;INCLUDE "XHiYLoequPmulAmul4-gc2.asm" ;INCLUDE "XLoYHiequPmulQmul4-gcash.asm" ;INCLUDE "XX12equXX15byXX16-LL51.asm" ; INCLUDE "./Maths/Utilities/XYeqyx1loSmulMdiv256-Ll120-LL123.asm" INCLUDE "./Drive/drive_access.asm" INCLUDE "./Menus/common_menu.asm" ; ARCHIVED INCLUDE "Menus/draw_fuel_and_crosshair.asm" ;INCLUDE "./title_page.asm" ; Blocks dependent on variables in Universe Banks ; Bank 49 ; SEG RESETUNIVSEG ;seg CODE_SEG, 4: $0000, $8000 ; flat address ;seg RESETUNIVSEG, BankResetUniv: StartOfBank, ResetUniverseAddr ; ORG ResetUniverseAddr ;INCLUDE "./GameEngine/resetUniverse.asm" ; Bank 50 SLOT MenuShrChtAddr PAGE BankMenuShrCht ORG MenuShrChtAddr,BankMenuShrCht INCLUDE "./Menus/short_range_chart_menu.asm" ; Bank 51 SLOT MenuGalChtAddr PAGE BankMenuGalCht ORG MenuGalChtAddr INCLUDE "./Menus//galactic_chart_menu.asm" ; Bank 52 SLOT MenuInventAddr PAGE BankMenuInvent ORG MenuInventAddr INCLUDE "./Menus/inventory_menu.asm" ; Bank 53 SLOT MenuSystemAddr PAGE BankMenuSystem ORG MenuSystemAddr INCLUDE "./Menus/system_data_menu.asm" ; Bank 54 SLOT MenuMarketAddr PAGE BankMenuMarket ORG MenuMarketAddr INCLUDE "./Menus/market_prices_menu.asm" ; Bank 66 SLOT DispMarketAddr PAGE BankDispMarket ORG DispMarketAddr INCLUDE "./Menus/market_prices_disp.asm" ; Bank 55 SLOT StockTableAddr PAGE BankStockTable ORG StockTableAddr INCLUDE "./Tables/stock_table.asm" ; Bank 57 SLOT LAYER2Addr PAGE BankLAYER2 ORG LAYER2Addr INCLUDE "./Layer2Graphics/layer2_bank_select.asm" INCLUDE "./Layer2Graphics/layer2_cls.asm" INCLUDE "./Layer2Graphics/layer2_initialise.asm" INCLUDE "./Layer2Graphics/l2_flip_buffers.asm" INCLUDE "./Layer2Graphics/layer2_plot_pixel.asm" INCLUDE "./Layer2Graphics/layer2_print_character.asm" INCLUDE "./Layer2Graphics/layer2_draw_box.asm" INCLUDE "./Layer2Graphics/asm_l2_plot_horizontal.asm" INCLUDE "./Layer2Graphics/asm_l2_plot_vertical.asm" INCLUDE "./Layer2Graphics/layer2_plot_diagonal.asm" INCLUDE "./Layer2Graphics/asm_l2_plot_triangle.asm" INCLUDE "./Layer2Graphics/asm_l2_fill_triangle.asm" INCLUDE "./Layer2Graphics/layer2_plot_circle.asm" INCLUDE "./Layer2Graphics/layer2_plot_circle_fill.asm" INCLUDE "./Layer2Graphics/l2_draw_any_line.asm" INCLUDE "./Layer2Graphics/clearLines-LL155.asm" INCLUDE "./Layer2Graphics/l2_draw_line_v2.asm" ; Bank 56 ------------------------------------------------------------------------------------------------------------------------ SLOT CMDRDATAAddr PAGE BankCmdrData ORG CMDRDATAAddr, BankCmdrData INCLUDE "./Commander/commanderData.asm" INCLUDE "./Commander/zero_player_cargo.asm" ; Bank 58 ------------------------------------------------------------------------------------------------------------------------ SLOT LAYER1Addr PAGE BankLAYER1 ORG LAYER1Addr, BankLAYER1 INCLUDE "./Layer1Graphics/layer1_attr_utils.asm" INCLUDE "./Layer1Graphics/layer1_cls.asm" INCLUDE "./Layer1Graphics/layer1_print_at.asm" ; Bank 59 ------------------------------------------------------------------------------------------------------------------------ ; In the first copy of the banks the "Non number" labels exist. They will map directly in other banks ; as the is aligned and data tables are after that ; need to make the ship index tables same size in each to simplify further SLOT ShipModelsAddr PAGE BankShipModels1 ORG ShipModelsAddr, BankShipModels1 INCLUDE "./Data/ShipModelMacros.asm" INCLUDE "./Data/ShipBank1Label.asm" GetShipBankId: GetShipBank1Id: MGetShipBankId ShipBankTable CopyVertsToUniv: CopyVertsToUniv1: McopyVertsToUniverse CopyEdgesToUniv: CopyEdgesToUniv1: McopyEdgesToUniverse CopyNormsToUniv: CopyNormsToUniv1: McopyNormsToUniverse ShipBankTable: ShipBankTable1: MShipBankTable CopyShipToUniverse: CopyShipToUniverse1 MCopyShipToUniverse BankShipModels1 CopyBodyToUniverse: CopyBodyToUniverse1: MCopyBodyToUniverse CopyShipToUniverse1 INCLUDE "./Data/ShipModelMetaData1.asm" ; Bank 67 ------------------------------------------------------------------------------------------------------------------------ SLOT ShipModelsAddr PAGE BankShipModels2 ORG ShipModelsAddr, BankShipModels2 INCLUDE "./Data/ShipBank2Label.asm" GetShipBank2Id: MGetShipBankId ShipBankTable2 CopyVertsToUniv2: McopyVertsToUniverse CopyEdgesToUniv2: McopyEdgesToUniverse CopyNormsToUniv2: McopyNormsToUniverse ShipBankTable2: MShipBankTable CopyShipToUniverse2 MCopyShipToUniverse BankShipModels2 CopyBodyToUniverse2: MCopyBodyToUniverse CopyShipToUniverse2 INCLUDE "./Data/ShipModelMetaData2.asm" ; Bank 68 ------------------------------------------------------------------------------------------------------------------------ SLOT ShipModelsAddr PAGE BankShipModels3 ORG ShipModelsAddr, BankShipModels3 INCLUDE "./Data/ShipBank3Label.asm" GetShipBank3Id: MGetShipBankId ShipBankTable3 CopyVertsToUniv3: McopyVertsToUniverse CopyEdgesToUniv3: McopyEdgesToUniverse CopyNormsToUniv3: McopyNormsToUniverse ShipBankTable3: MShipBankTable CopyShipToUniverse3 MCopyShipToUniverse BankShipModels3 CopyBodyToUniverse3: MCopyBodyToUniverse CopyShipToUniverse3 INCLUDE "./Data/ShipModelMetaData3.asm" ;;Privisioned for more models ; Bank 69 ------------------------------------------------------------------------------------------------------------------------ ;;Privisioned for more models SLOT ShipModelsAddr ;;Privisioned for more models PAGE BankShipModels4 ;;Privisioned for more models ORG ShipModelsAddr, BankShipModels4 ; Bank 60 ------------------------------------------------------------------------------------------------------------------------ SLOT SpritemembankAddr PAGE BankSPRITE ORG SpritemembankAddr, BankSPRITE INCLUDE "./Layer3Sprites/sprite_routines.asm" INCLUDE "./Layer3Sprites/sprite_load.asm" INCLUDE "./Layer3Sprites/SpriteSheet.asm" ; Bank 61 ------------------------------------------------------------------------------------------------------------------------ SLOT ConsoleImageAddr PAGE BankConsole ORG ConsoleImageAddr, BankConsole INCLUDE "./Images/ConsoleImageData.asm" ; Bank 62 ------------------------------------------------------------------------------------------------------------------------ SLOT ViewFrontAddr PAGE BankFrontView ORG ViewFrontAddr INCLUDE "./Views/Front_View.asm" ; Bank 63 ------------------------------------------------------------------------------------------------------------------------ SLOT MenuStatusAddr PAGE BankMenuStatus ORG MenuStatusAddr INCLUDE "./Menus/status_menu.asm" ; Bank 64 ------------------------------------------------------------------------------------------------------------------------ SLOT MenuEquipSAddr PAGE BankMenuEquipS ORG MenuEquipSAddr INCLUDE "./Menus/equip_ship_menu.asm" SLOT LaunchShipAddr PAGE BankLaunchShip ORG LaunchShipAddr INCLUDE "./Transitions/launch_ship.asm" ; Bank 70 ------------------------------------------------------------------------------------------------------------------------ SLOT UniverseBankAddr PAGE BankUNIVDATA0 ORG UniverseBankAddr,BankUNIVDATA0 INCLUDE "./Universe/univ_ship_data.asm" SLOT UniverseBankAddr PAGE BankUNIVDATA1 ORG UniverseBankAddr,BankUNIVDATA1 UNIVDATABlock1 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA2 ORG UniverseBankAddr,BankUNIVDATA2 UNIVDATABlock2 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA3 ORG UniverseBankAddr,BankUNIVDATA3 UNIVDATABlock3 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA4 ORG UniverseBankAddr,BankUNIVDATA4 UNIVDATABlock4 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA5 ORG UniverseBankAddr,BankUNIVDATA5 UNIVDATABlock5 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA6 ORG UniverseBankAddr,BankUNIVDATA6 UNIVDATABlock6 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA7 ORG UniverseBankAddr,BankUNIVDATA7 UNIVDATABlock7 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA8 ORG UniverseBankAddr,BankUNIVDATA8 UNIVDATABlock8 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA8 ORG UniverseBankAddr,BankUNIVDATA9 UNIVDATABlock9 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA10 ORG UniverseBankAddr,BankUNIVDATA10 UNIVDATABlock10 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA11 ORG UniverseBankAddr,BankUNIVDATA11 UNIVDATABlock11 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT UniverseBankAddr PAGE BankUNIVDATA12 ORG UniverseBankAddr,BankUNIVDATA12 UNIVDATABlock12 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT GalaxyDataAddr PAGE BankGalaxyData0 ORG GalaxyDataAddr, BankGalaxyData0 INCLUDE "./Universe/galaxy_data.asm" DISPLAY "Galaxy Data - Bytes free ",/D, $2000 - ($- GalaxyDataAddr) ; Bank 83 ------------------------------------------------------------------------------------------------------------------------ SLOT SunBankAddr PAGE BankSunData ORG SunBankAddr,BankSunData INCLUDE "./Universe/Sun/sun_data.asm" ; Bank 84 ------------------------------------------------------------------------------------------------------------------------ SLOT PlanetBankAddr PAGE BankPlanetData ORG PlanetBankAddr,BankPlanetData ;TODO INCLUDE "./Universe/planet_data.asm" SLOT GalaxyDataAddr PAGE BankGalaxyData1 ORG GalaxyDataAddr, BankGalaxyData1 GALAXYDATABlock1 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT GalaxyDataAddr PAGE BankGalaxyData2 ORG GalaxyDataAddr, BankGalaxyData2 GALAXYDATABlock2 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT GalaxyDataAddr PAGE BankGalaxyData3 ORG GalaxyDataAddr, BankGalaxyData3 GALAXYDATABlock3 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT GalaxyDataAddr PAGE BankGalaxyData4 ORG GalaxyDataAddr, BankGalaxyData4 GALAXYDATABlock4 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT GalaxyDataAddr PAGE BankGalaxyData5 ORG GalaxyDataAddr,BankGalaxyData5 GALAXYDATABlock5 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT GalaxyDataAddr PAGE BankGalaxyData6 ORG GalaxyDataAddr,BankGalaxyData6 GALAXYDATABlock6 DB $FF DS $1FFF ; just allocate 8000 bytes for now SLOT GalaxyDataAddr PAGE BankGalaxyData7 ORG GalaxyDataAddr,BankGalaxyData7 GALAXYDATABlock7 DB $FF DS $1FFF ; just allocate 8000 bytes for now SAVENEX OPEN "EliteN.nex", $8000 , $7F00 SAVENEX CFG 0,0,0,1 SAVENEX AUTO SAVENEX CLOSE
53.409524
372
0.442911
64fc963187ac322cb66e2499f907a10909202aab
1,365
asm
Assembly
arithmethic_add.asm
tor4z/nasm_training
0d7be19c9ff66ca7972e6270388a385c85829814
[ "Unlicense" ]
null
null
null
arithmethic_add.asm
tor4z/nasm_training
0d7be19c9ff66ca7972e6270388a385c85829814
[ "Unlicense" ]
null
null
null
arithmethic_add.asm
tor4z/nasm_training
0d7be19c9ff66ca7972e6270388a385c85829814
[ "Unlicense" ]
null
null
null
global _start SYS_EXIT equ 1 SYS_READ equ 3 SYS_WRITE equ 4 STDOUT equ 1 STDIN equ 0 section .data msg1 db 'Enter a digit: ' msg1Len equ $ - msg1 msg2 db 'Enter second digit: ' msg2Len equ $ - msg2 msg3 db 'The sum is: ' msg3Len equ $ - msg3 msg4 db 0xa msg4Len equ $ - msg4 section .bss num1 resb 1 num2 resb 1 result resb 1 section .text _start: ; Input digit 1 msg mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, msg1 mov edx, msg1Len int 0x80 ; Read digit 1 mov eax, SYS_READ mov ebx, STDIN mov ecx, num1 mov edx, 2 int 0x80 ; Input digi2 msg mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, msg2 mov edx, msg2Len int 0x80 ; Read digit 2 mov eax, SYS_READ mov ebx, STDIN mov ecx, num2 mov edx, 2 int 0x80 mov eax, [num1] ; move num1 to eax sub eax, '0' ; convert char to number mov ebx, [num2] ; move num2 to ebx sub ebx, '0' ; convert char to number add eax, ebx ; add ebx to eax add eax, '0' ; convert number to char mov [result], eax ; save the eax content to [result] ; Result msg mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, msg3 mov edx, msg3Len int 0x80 ; Print result mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, result mov edx, 1 int 0x80 ; '\n' mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, msg4 mov edx, msg4Len int 0x80 ; Exit mov eax, SYS_EXIT mov ebx, 0 int 0x80
14.677419
53
0.668864
d98c6c69841379541c883a0d5270d8716548c11a
73
asm
Assembly
gfx/pokemon/voltorb/anim_idle.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
gfx/pokemon/voltorb/anim_idle.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
gfx/pokemon/voltorb/anim_idle.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
frame 1, 04 setrepeat 2 frame 2, 08 frame 0, 08 dorepeat 2 endanim
10.428571
12
0.684932
227bc3f7b8f31b0b222f3107d7e34ed807b3e322
9,479
asm
Assembly
Ch2/Experiments/Exp2.3/signalGen/E_signalGen/src/vector.asm
haizzus/TMS320C5505
52bc5b61262122ff78f5202f858d9ac8b957cdaa
[ "MIT" ]
1
2020-02-01T23:52:27.000Z
2020-02-01T23:52:27.000Z
Ch4/Experiments/Exp4.6/realtimeIIR/src/vector.asm
haizzus/TMS320C5505
52bc5b61262122ff78f5202f858d9ac8b957cdaa
[ "MIT" ]
null
null
null
Ch4/Experiments/Exp4.6/realtimeIIR/src/vector.asm
haizzus/TMS320C5505
52bc5b61262122ff78f5202f858d9ac8b957cdaa
[ "MIT" ]
null
null
null
;/* ;* vector.asm ;* ;* Created on: Mar 14, 2012 ;* Author: BLEE, modified ;* ;* For the book "Real Time Digital Signal Processing: ;* Fundamentals, Implementation and Application, 3rd Ed" ;* By Sen M. Kuo, Bob H. Lee, and Wenshun Tian ;* Publisher: John Wiley and Sons, Ltd ;*/ ;////////////////////////////////////////////////////////////////////////////// ;// * File name: vector.asm ;// * ;// * Description: Code for playback using I2S2 and DMA1 to AIC3254. ;// * ;// * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ ;// * ;// * ;// * Redistribution and use in source and binary forms, with or without ;// * modification, are permitted provided that the following conditions ;// * are met: ;// * ;// * Redistributions of source code must retain the above copyright ;// * notice, this list of conditions and the following disclaimer. ;// * ;// * Redistributions in binary form must reproduce the above copyright ;// * notice, this list of conditions and the following disclaimer in the ;// * documentation and/or other materials provided with the ;// * distribution. ;// * ;// * Neither the name of Texas Instruments Incorporated nor the names of ;// * its contributors may be used to endorse or promote products derived ;// * from this software without specific prior written permission. ;// * ;// * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;// * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;// * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;// * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;// * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;// * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ;// * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ;// * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ;// * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ;// * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;// * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;// * ;////////////////////////////////////////////////////////////////////////////// .mmregs .include "lpva200.inc" .C54CM_off .CPL_off .ARMS_off ;********************************************************************************** ; predefined stack operation modes ;********************************************************************************** ; USE_RETA : 2x16-bit fast return mode (RETA used) ; NO_RETA : 2x16-bit slow return mode (RETA not used) ; C54X_STK : 32-bit fast return mode ;********************************************************************************** .global _DMA_Isr ;.global _SAR_Isr ;.global _I2S0_TX_Isr ;.global _I2S1_RX_Isr .global _RTC_Isr ;.global _Timer_isr ;********************************************************************************** .sect "vector" .align 256 ;********************************************************************************** ;**************************************************************************** ;* Other interrupt vector definitions go here ;**************************************************************************** .def _RST _RST: .ivec reset_isr, USE_RETA; Reset / Software Interrupt #0 NMI: .ivec reset_isr ; Nonmaskable Interrupt INT0: .ivec dummy_isr ; External User Interrupt #0 INT1: .ivec dummy_isr ; External User Interrupt #1 ;TINT0: .ivec _Timer_isr ; Timer #0 / Software Interrupt #4 TINT0: .ivec dummy_isr ; Timer #0 / Software Interrupt #4 ;PROG0: .ivec _I2S0_TX_Isr ; Programmable 0 Interrupt PROG0: .ivec dummy_isr ; Programmable 0 Interrupt UART: .ivec dummy_isr ; IIS #1 Receive Interrupt PROG1: .ivec dummy_isr ; Programmable 1 Interrupt DMA: .ivec _DMA_Isr ; DMA Interrupt ;DMA: .ivec dummy_isr ; DMA Interrupt PROG2: .ivec dummy_isr ; Programmable 2 Interrupt COPROCFFT: .ivec dummy_isr ; Coprocessor FFT Module Interrupt ;PROG3: .ivec _I2S1_RX_Isr ; Programmable 3 Interrupt PROG3: .ivec dummy_isr ; Programmable 3 Interrupt LCD: .ivec dummy_isr ; LCD Interrupt SARADC: .ivec dummy_isr ; SAR ADC Interrupt XMIT2: .ivec dummy_isr ; I2S2 Tx Interrupt RCV2: .ivec dummy_isr ; I2S2 Rx Interrupt XMIT3: .ivec dummy_isr ; I2S3 Tx Interrupt RCV3: .ivec dummy_isr ; I2S3 Rx Interrupt ;RTC: .ivec _RTC_Isr ; RTC interrupt RTC: .ivec dummy_isr ; RTC interrupt SPI: .ivec dummy_isr ; SPI Receive Interrupt USB: .ivec dummy_isr ; USB Transmit Interrupt GPIO: .ivec dummy_isr ; GPIO Interrupt EMIF: .ivec dummy_isr ; EMIF Interrupt I2C: .ivec dummy_isr ; IIC interrupt BERRIV: IV24: .ivec dummy_isr ; Bus error interrupt ; .ref _DLOGINT_isr DLOGIV: IV25: .ivec dummy_isr ; Data log (RTDX) interrupt ; .ref _RTOSINT_isr RTOSIV: IV26: .ivec dummy_isr ; Real-time OS interrupt IV27: .ivec dummy_isr ; General-purpose software-only interrupt IV28: .ivec dummy_isr ; General-purpose software-only interrupt IV29: .ivec dummy_isr ; General-purpose software-only interrupt IV30: .ivec dummy_isr ; General-purpose software-only interrupt IV31: .ivec dummy_isr ; General-purpose software-only interrupt ;**************************************************************************** ;* Reset ;**************************************************************************** .text .def reset_isr .ref _c_int00 .align 2 reset_isr: ; *port(#0x1C01) = #0x0 ; Clear idles bset #11, ST1_55 ; Disable interrupts mov #(_RST >> 8), mmap(@IVPD_L) mov #(_RST >> 8), mmap(@IVPH_L) bclr #7,ST3_55 bset #2,ST3_55 bclr #13,ST1_55 mov #0xffff, mmap(@#IFR0_L) ; clear all pending interrupts mov #0xffff, mmap(@#IFR1_L) mov #(RESERVED_ICR|IPORT_IDLE|HWA_IDLE|DPORT_IDLE), *port(#IDLE_ICR) idle ;********************************************************************************** ; Reset all peripherals ;********************************************************************************** mov #0x1, *port(#0x1C04) nop mov #0x00FB, *port(#0x1C05) ; Reset all peripherals nop ;********************************************************************************** ; Enalbe EMIF ;********************************************************************************** mov #0x0, *port(#IDLE_PCGCR) ;/* Config EMIF - System Control Regsiter */ mov #0x0, *port(#0x1C33) ;// for SRAM in memory card (Async_CE1) ;/* Config EMIF - ASYNC Regsiters */ mov #0x0080, *port(#0x1004) mov #0x00E4, *port(#0x1005) ;/* Configure as 16-bit data bus */ ;// Async4 ==> Async_CE1 (SRAM) mov #0x40AD, *port(#0x101C) mov #0x0020, *port(#0x101D) ;// Async3 ==> Async_CE0(Flash) mov #0xFFFD, *port(#0x1018) mov #0x3FFF, *port(#0x1019) ;// do not assign Async_CE0 and Async_CE1 for NAND mov #0x0003, *port(#0x1060) ;// Turn off page mode for all Chip Selects mov #0xFCFC, *port(#0x1068) mov #0xFCFC, *port(#0x1069) b _c_int00 ******************************************************************************** ** Name : no_isr ** ** ** ** Purpose : Spurious interrupt handler ** ** ** ** Author : ** ** ** ******************************************************************************** .text no_isr: b no_isr dummy_isr: reti .end
40.857759
88
0.440025
94e52f676dc1cb9dd3673f8dc1636e7fad78c99b
538
asm
Assembly
oeis/315/A315361.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/315/A315361.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/315/A315361.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A315361: Coordination sequence Gal.5.328.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by Jamie Morken(s2.) ; 1,6,10,18,22,26,36,38,42,54,54,58,72,70,74,90,86,90,108,102,106,126,118,122,144,134,138,162,150,154,180,166,170,198,182,186,216,198,202,234,214,218,252,230,234,270,246,250,288,262 mov $1,$0 seq $0,301720 ; Coordination sequence for node of type V1 in "krb" 2-D tiling (or net). add $0,1 mul $0,2 div $0,3 mul $1,2 add $0,$1
44.833333
181
0.719331
281fd6f2f0dffc36b5a513ed5a7ecececf7e39e6
753
asm
Assembly
color/super_palettes.asm
etdv-thevoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
1
2022-01-09T05:28:52.000Z
2022-01-09T05:28:52.000Z
color/super_palettes.asm
ETDV-TheVoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
null
null
null
color/super_palettes.asm
ETDV-TheVoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
null
null
null
; Note: after calling this, you may need to set W2_ForceBGPUpdate/ForceOBPUpdate to nonzero. ; d = palette to load (see constants/palette_constants.), e = palette index LoadSGBPalette: ld a,[rSVBK] ld b,a ld a,2 ld [rSVBK],a push bc ld a,e ld l,d ld h,0 add hl add hl add hl ld de,SuperPalettes add hl,de ld de,W2_BgPaletteData jr startPaletteTransfer LoadSGBPalette_Sprite: ld a,[rSVBK] ld b,a ld a,2 ld [rSVBK],a push bc ld a,e ld l,d ld h,0 add hl add hl add hl ld de,SuperPalettes add hl,de ld de,W2_BgPaletteData + $40 startPaletteTransfer: add a add a add a add e ld e,a ld b,8 .palLoop ld a,[hli] ld [de],a inc de dec b jr nz,.palLoop pop af ld [rSVBK],a ret INCLUDE "data/super_palettes.asm"
12.55
92
0.687915
196576f8edee0c6c1556c0c53045a514da8ff1c5
1,786
asm
Assembly
asm_obj/asm.asm
sbarisic/CarpOS
c8ab9332f5cd7953601aa5b528cd3f0467770c8c
[ "Unlicense" ]
2
2022-01-20T07:34:04.000Z
2022-02-06T23:37:56.000Z
asm_obj/asm.asm
cartman300/CarpOS
c8ab9332f5cd7953601aa5b528cd3f0467770c8c
[ "Unlicense" ]
null
null
null
asm_obj/asm.asm
cartman300/CarpOS
c8ab9332f5cd7953601aa5b528cd3f0467770c8c
[ "Unlicense" ]
1
2022-01-21T02:06:42.000Z
2022-01-21T02:06:42.000Z
SECTION .text extern _empty_handler global _GDTFlush _GDTFlush: mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax mov ss, ax jmp 0x8:_EndFlush _EndFlush: ret _int_handler: pusha push ds push es push fs push gs mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax mov eax, esp push eax mov eax, _empty_handler call eax pop eax pop gs pop fs pop es pop ds popa add esp, 8 sti iret %macro DEFINE_ISR_NOERROR 1 global _isr_%1 _isr_%1: cli push byte 0 push byte %1 jmp _int_handler %endmacro %macro DEFINE_ISR_ERROR 1 global _isr_%1 _isr_%1: cli push byte %1 jmp _int_handler %endmacro DEFINE_ISR_NOERROR 0 DEFINE_ISR_NOERROR 1 DEFINE_ISR_NOERROR 2 DEFINE_ISR_NOERROR 3 DEFINE_ISR_NOERROR 4 DEFINE_ISR_NOERROR 5 DEFINE_ISR_NOERROR 6 DEFINE_ISR_NOERROR 7 DEFINE_ISR_ERROR 8 DEFINE_ISR_NOERROR 9 DEFINE_ISR_ERROR 10 DEFINE_ISR_ERROR 11 DEFINE_ISR_ERROR 12 DEFINE_ISR_ERROR 13 DEFINE_ISR_ERROR 14 DEFINE_ISR_NOERROR 15 DEFINE_ISR_NOERROR 16 DEFINE_ISR_NOERROR 17 DEFINE_ISR_NOERROR 18 DEFINE_ISR_NOERROR 19 DEFINE_ISR_NOERROR 20 DEFINE_ISR_NOERROR 21 DEFINE_ISR_NOERROR 22 DEFINE_ISR_NOERROR 23 DEFINE_ISR_NOERROR 24 DEFINE_ISR_NOERROR 25 DEFINE_ISR_NOERROR 26 DEFINE_ISR_NOERROR 27 DEFINE_ISR_NOERROR 28 DEFINE_ISR_NOERROR 29 DEFINE_ISR_NOERROR 30 DEFINE_ISR_NOERROR 31 ; IRQs DEFINE_ISR_NOERROR 32 DEFINE_ISR_NOERROR 33 DEFINE_ISR_NOERROR 34 DEFINE_ISR_NOERROR 35 DEFINE_ISR_NOERROR 36 DEFINE_ISR_NOERROR 37 DEFINE_ISR_NOERROR 38 DEFINE_ISR_NOERROR 39 DEFINE_ISR_NOERROR 40 DEFINE_ISR_NOERROR 41 DEFINE_ISR_NOERROR 42 DEFINE_ISR_NOERROR 43 DEFINE_ISR_NOERROR 44 DEFINE_ISR_NOERROR 45 DEFINE_ISR_NOERROR 46 DEFINE_ISR_NOERROR 47 DEFINE_ISR_NOERROR 80 ; SYSCALLS ;section .data ; resb 1024 * 50 ;section .bss ; resb 1024 * 50
15.530435
32
0.819149
516323fa2936aa7e9dfb519c646b10921e6a1570
36,240
asm
Assembly
target/cos_117/disasm/iop_overlay1/UCCLS.asm
jrrk2/cray-sim
52c9639808d6890517092637b188282c00cce4f7
[ "BSL-1.0" ]
49
2020-10-09T12:29:16.000Z
2022-03-12T02:33:35.000Z
target/cos_117/disasm/iop_overlay1/UCCLS.asm
jrrk2/cray-sim
52c9639808d6890517092637b188282c00cce4f7
[ "BSL-1.0" ]
1
2021-12-29T15:59:25.000Z
2021-12-29T15:59:25.000Z
target/cos_117/disasm/iop_overlay1/UCCLS.asm
jrrk2/cray-sim
52c9639808d6890517092637b188282c00cce4f7
[ "BSL-1.0" ]
6
2021-04-12T06:10:32.000Z
2022-02-08T23:11:19.000Z
0x0000 (0x000000) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0001 (0x000002) 0x291A- f:00024 d: 282 | OR[282] = A 0x0002 (0x000004) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0003 (0x000006) 0x291B- f:00024 d: 283 | OR[283] = A 0x0004 (0x000008) 0x7540- f:00072 d: 320 | R = P + 320 (0x0144) 0x0005 (0x00000A) 0x2118- f:00020 d: 280 | A = OR[280] 0x0006 (0x00000C) 0x1417- f:00012 d: 23 | A = A + 23 (0x0017) 0x0007 (0x00000E) 0x2908- f:00024 d: 264 | OR[264] = A 0x0008 (0x000010) 0x211B- f:00020 d: 283 | A = OR[283] 0x0009 (0x000012) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x000A (0x000014) 0x2118- f:00020 d: 280 | A = OR[280] 0x000B (0x000016) 0x1418- f:00012 d: 24 | A = A + 24 (0x0018) 0x000C (0x000018) 0x2908- f:00024 d: 264 | OR[264] = A 0x000D (0x00001A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x000E (0x00001C) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x000F (0x00001E) 0x2118- f:00020 d: 280 | A = OR[280] 0x0010 (0x000020) 0x1419- f:00012 d: 25 | A = A + 25 (0x0019) 0x0011 (0x000022) 0x2908- f:00024 d: 264 | OR[264] = A 0x0012 (0x000024) 0x2119- f:00020 d: 281 | A = OR[281] 0x0013 (0x000026) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0014 (0x000028) 0x1004- f:00010 d: 4 | A = 4 (0x0004) 0x0015 (0x00002A) 0x291C- f:00024 d: 284 | OR[284] = A 0x0016 (0x00002C) 0x3118- f:00030 d: 280 | A = (OR[280]) 0x0017 (0x00002E) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0018 (0x000030) 0x2913- f:00024 d: 275 | OR[275] = A 0x0019 (0x000032) 0x0400- f:00002 d: 0 | I = 0 0x001A (0x000034) 0x0000- f:00000 d: 0 | PASS 0x001B (0x000036) 0x1034- f:00010 d: 52 | A = 52 (0x0034) 0x001C (0x000038) 0x29C3- f:00024 d: 451 | OR[451] = A 0x001D (0x00003A) 0x2113- f:00020 d: 275 | A = OR[275] 0x001E (0x00003C) 0x29C4- f:00024 d: 452 | OR[452] = A 0x001F (0x00003E) 0x2118- f:00020 d: 280 | A = OR[280] 0x0020 (0x000040) 0x29C5- f:00024 d: 453 | OR[453] = A 0x0021 (0x000042) 0x211C- f:00020 d: 284 | A = OR[284] 0x0022 (0x000044) 0x29C6- f:00024 d: 454 | OR[454] = A 0x0023 (0x000046) 0x211B- f:00020 d: 283 | A = OR[283] 0x0024 (0x000048) 0x29C7- f:00024 d: 455 | OR[455] = A 0x0025 (0x00004A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0026 (0x00004C) 0x29C8- f:00024 d: 456 | OR[456] = A 0x0027 (0x00004E) 0x7DC2- f:00076 d: 450 | R = OR[450] 0x0028 (0x000050) 0x2118- f:00020 d: 280 | A = OR[280] 0x0029 (0x000052) 0x1414- f:00012 d: 20 | A = A + 20 (0x0014) 0x002A (0x000054) 0x290D- f:00024 d: 269 | OR[269] = A 0x002B (0x000056) 0x211C- f:00020 d: 284 | A = OR[284] 0x002C (0x000058) 0x390D- f:00034 d: 269 | (OR[269]) = A 0x002D (0x00005A) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1 0x002E (0x00005C) 0x310D- f:00030 d: 269 | A = (OR[269]) 0x002F (0x00005E) 0x840B- f:00102 d: 11 | P = P + 11 (0x003A), A = 0 0x0030 (0x000060) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x0031 (0x000062) 0x2924- f:00024 d: 292 | OR[292] = A 0x0032 (0x000064) 0x210D- f:00020 d: 269 | A = OR[269] 0x0033 (0x000066) 0x2925- f:00024 d: 293 | OR[293] = A 0x0034 (0x000068) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0035 (0x00006A) 0x2926- f:00024 d: 294 | OR[294] = A 0x0036 (0x00006C) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x0037 (0x00006E) 0x5800- f:00054 d: 0 | B = A 0x0038 (0x000070) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0039 (0x000072) 0x7C09- f:00076 d: 9 | R = OR[9] 0x003A (0x000074) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x003B (0x000076) 0x290D- f:00024 d: 269 | OR[269] = A 0x003C (0x000078) 0x2118- f:00020 d: 280 | A = OR[280] 0x003D (0x00007A) 0x141C- f:00012 d: 28 | A = A + 28 (0x001C) 0x003E (0x00007C) 0x2908- f:00024 d: 264 | OR[264] = A 0x003F (0x00007E) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0040 (0x000080) 0x8613- f:00103 d: 19 | P = P + 19 (0x0053), A # 0 0x0041 (0x000082) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0042 (0x000084) 0x2924- f:00024 d: 292 | OR[292] = A 0x0043 (0x000086) 0x2118- f:00020 d: 280 | A = OR[280] 0x0044 (0x000088) 0x141C- f:00012 d: 28 | A = A + 28 (0x001C) 0x0045 (0x00008A) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0046 (0x00008C) 0x2925- f:00024 d: 293 | OR[293] = A 0x0047 (0x00008E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0048 (0x000090) 0x2926- f:00024 d: 294 | OR[294] = A 0x0049 (0x000092) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x004A (0x000094) 0x5800- f:00054 d: 0 | B = A 0x004B (0x000096) 0x1800-0x1918 f:00014 d: 0 | A = 6424 (0x1918) 0x004D (0x00009A) 0x7C09- f:00076 d: 9 | R = OR[9] 0x004E (0x00009C) 0x2006- f:00020 d: 6 | A = OR[6] 0x004F (0x00009E) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x0050 (0x0000A0) 0x2908- f:00024 d: 264 | OR[264] = A 0x0051 (0x0000A2) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0052 (0x0000A4) 0x290D- f:00024 d: 269 | OR[269] = A 0x0053 (0x0000A6) 0x2118- f:00020 d: 280 | A = OR[280] 0x0054 (0x0000A8) 0x141C- f:00012 d: 28 | A = A + 28 (0x001C) 0x0055 (0x0000AA) 0x2908- f:00024 d: 264 | OR[264] = A 0x0056 (0x0000AC) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0057 (0x0000AE) 0x291A- f:00024 d: 282 | OR[282] = A 0x0058 (0x0000B0) 0x2118- f:00020 d: 280 | A = OR[280] 0x0059 (0x0000B2) 0x141C- f:00012 d: 28 | A = A + 28 (0x001C) 0x005A (0x0000B4) 0x2908- f:00024 d: 264 | OR[264] = A 0x005B (0x0000B6) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x005C (0x0000B8) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x005D (0x0000BA) 0x210D- f:00020 d: 269 | A = OR[269] 0x005E (0x0000BC) 0x3118- f:00030 d: 280 | A = (OR[280]) 0x005F (0x0000BE) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0060 (0x0000C0) 0x2913- f:00024 d: 275 | OR[275] = A 0x0061 (0x0000C2) 0x0400- f:00002 d: 0 | I = 0 0x0062 (0x0000C4) 0x0000- f:00000 d: 0 | PASS 0x0063 (0x0000C6) 0x1035- f:00010 d: 53 | A = 53 (0x0035) 0x0064 (0x0000C8) 0x29C3- f:00024 d: 451 | OR[451] = A 0x0065 (0x0000CA) 0x2113- f:00020 d: 275 | A = OR[275] 0x0066 (0x0000CC) 0x29C4- f:00024 d: 452 | OR[452] = A 0x0067 (0x0000CE) 0x2118- f:00020 d: 280 | A = OR[280] 0x0068 (0x0000D0) 0x29C5- f:00024 d: 453 | OR[453] = A 0x0069 (0x0000D2) 0x211A- f:00020 d: 282 | A = OR[282] 0x006A (0x0000D4) 0x29C6- f:00024 d: 454 | OR[454] = A 0x006B (0x0000D6) 0x211B- f:00020 d: 283 | A = OR[283] 0x006C (0x0000D8) 0x29C7- f:00024 d: 455 | OR[455] = A 0x006D (0x0000DA) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x006E (0x0000DC) 0x29C8- f:00024 d: 456 | OR[456] = A 0x006F (0x0000DE) 0x7DC2- f:00076 d: 450 | R = OR[450] 0x0070 (0x0000E0) 0x7513- f:00072 d: 275 | R = P + 275 (0x0183) 0x0071 (0x0000E2) 0x211A- f:00020 d: 282 | A = OR[282] 0x0072 (0x0000E4) 0x8602- f:00103 d: 2 | P = P + 2 (0x0074), A # 0 0x0073 (0x0000E6) 0x7003- f:00070 d: 3 | P = P + 3 (0x0076) 0x0074 (0x0000E8) 0x7064- f:00070 d: 100 | P = P + 100 (0x00D8) 0x0075 (0x0000EA) 0x7009- f:00070 d: 9 | P = P + 9 (0x007E) 0x0076 (0x0000EC) 0x2118- f:00020 d: 280 | A = OR[280] 0x0077 (0x0000EE) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0078 (0x0000F0) 0x2908- f:00024 d: 264 | OR[264] = A 0x0079 (0x0000F2) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x007A (0x0000F4) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00) 0x007C (0x0000F8) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x007D (0x0000FA) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x007E (0x0000FC) 0x2118- f:00020 d: 280 | A = OR[280] 0x007F (0x0000FE) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008) 0x0080 (0x000100) 0x2908- f:00024 d: 264 | OR[264] = A 0x0081 (0x000102) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0082 (0x000104) 0x291D- f:00024 d: 285 | OR[285] = A 0x0083 (0x000106) 0x2118- f:00020 d: 280 | A = OR[280] 0x0084 (0x000108) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009) 0x0085 (0x00010A) 0x2908- f:00024 d: 264 | OR[264] = A 0x0086 (0x00010C) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0087 (0x00010E) 0x291E- f:00024 d: 286 | OR[286] = A 0x0088 (0x000110) 0x211D- f:00020 d: 285 | A = OR[285] 0x0089 (0x000112) 0x8404- f:00102 d: 4 | P = P + 4 (0x008D), A = 0 0x008A (0x000114) 0x211E- f:00020 d: 286 | A = OR[286] 0x008B (0x000116) 0x8402- f:00102 d: 2 | P = P + 2 (0x008D), A = 0 0x008C (0x000118) 0x7003- f:00070 d: 3 | P = P + 3 (0x008F) 0x008D (0x00011A) 0x7C34- f:00076 d: 52 | R = OR[52] 0x008E (0x00011C) 0x0000- f:00000 d: 0 | PASS 0x008F (0x00011E) 0x211E- f:00020 d: 286 | A = OR[286] 0x0090 (0x000120) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008) 0x0091 (0x000122) 0x2908- f:00024 d: 264 | OR[264] = A 0x0092 (0x000124) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x0093 (0x000126) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0094 (0x000128) 0x100E- f:00010 d: 14 | A = 14 (0x000E) 0x0095 (0x00012A) 0x2924- f:00024 d: 292 | OR[292] = A 0x0096 (0x00012C) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0097 (0x00012E) 0x2925- f:00024 d: 293 | OR[293] = A 0x0098 (0x000130) 0x211D- f:00020 d: 285 | A = OR[285] 0x0099 (0x000132) 0x2926- f:00024 d: 294 | OR[294] = A 0x009A (0x000134) 0x211E- f:00020 d: 286 | A = OR[286] 0x009B (0x000136) 0x2927- f:00024 d: 295 | OR[295] = A 0x009C (0x000138) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x009D (0x00013A) 0x5800- f:00054 d: 0 | B = A 0x009E (0x00013C) 0x1800-0x1918 f:00014 d: 0 | A = 6424 (0x1918) 0x00A0 (0x000140) 0x7C09- f:00076 d: 9 | R = OR[9] 0x00A1 (0x000142) 0x2006- f:00020 d: 6 | A = OR[6] 0x00A2 (0x000144) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x00A3 (0x000146) 0x2908- f:00024 d: 264 | OR[264] = A 0x00A4 (0x000148) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00A5 (0x00014A) 0x74C0- f:00072 d: 192 | R = P + 192 (0x0165) 0x00A6 (0x00014C) 0x2118- f:00020 d: 280 | A = OR[280] 0x00A7 (0x00014E) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008) 0x00A8 (0x000150) 0x2908- f:00024 d: 264 | OR[264] = A 0x00A9 (0x000152) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00AA (0x000154) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00AB (0x000156) 0x2118- f:00020 d: 280 | A = OR[280] 0x00AC (0x000158) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009) 0x00AD (0x00015A) 0x2908- f:00024 d: 264 | OR[264] = A 0x00AE (0x00015C) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00AF (0x00015E) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00B0 (0x000160) 0x7434- f:00072 d: 52 | R = P + 52 (0x00E4) 0x00B1 (0x000162) 0x2118- f:00020 d: 280 | A = OR[280] 0x00B2 (0x000164) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A) 0x00B3 (0x000166) 0x2908- f:00024 d: 264 | OR[264] = A 0x00B4 (0x000168) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00B5 (0x00016A) 0x291F- f:00024 d: 287 | OR[287] = A 0x00B6 (0x00016C) 0x2118- f:00020 d: 280 | A = OR[280] 0x00B7 (0x00016E) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x00B8 (0x000170) 0x2908- f:00024 d: 264 | OR[264] = A 0x00B9 (0x000172) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00BA (0x000174) 0x2920- f:00024 d: 288 | OR[288] = A 0x00BB (0x000176) 0x74B6- f:00072 d: 182 | R = P + 182 (0x0171) 0x00BC (0x000178) 0x2118- f:00020 d: 280 | A = OR[280] 0x00BD (0x00017A) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A) 0x00BE (0x00017C) 0x2908- f:00024 d: 264 | OR[264] = A 0x00BF (0x00017E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00C0 (0x000180) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00C1 (0x000182) 0x2118- f:00020 d: 280 | A = OR[280] 0x00C2 (0x000184) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x00C3 (0x000186) 0x2908- f:00024 d: 264 | OR[264] = A 0x00C4 (0x000188) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00C5 (0x00018A) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00C6 (0x00018C) 0x2118- f:00020 d: 280 | A = OR[280] 0x00C7 (0x00018E) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C) 0x00C8 (0x000190) 0x2908- f:00024 d: 264 | OR[264] = A 0x00C9 (0x000192) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00CA (0x000194) 0x2921- f:00024 d: 289 | OR[289] = A 0x00CB (0x000196) 0x1019- f:00010 d: 25 | A = 25 (0x0019) 0x00CC (0x000198) 0x2924- f:00024 d: 292 | OR[292] = A 0x00CD (0x00019A) 0x2121- f:00020 d: 289 | A = OR[289] 0x00CE (0x00019C) 0x2925- f:00024 d: 293 | OR[293] = A 0x00CF (0x00019E) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x00D0 (0x0001A0) 0x5800- f:00054 d: 0 | B = A 0x00D1 (0x0001A2) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00D2 (0x0001A4) 0x7C09- f:00076 d: 9 | R = OR[9] 0x00D3 (0x0001A6) 0x2118- f:00020 d: 280 | A = OR[280] 0x00D4 (0x0001A8) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C) 0x00D5 (0x0001AA) 0x2908- f:00024 d: 264 | OR[264] = A 0x00D6 (0x0001AC) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00D7 (0x0001AE) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00D8 (0x0001B0) 0x7481- f:00072 d: 129 | R = P + 129 (0x0159) 0x00D9 (0x0001B2) 0x2005- f:00020 d: 5 | A = OR[5] 0x00DA (0x0001B4) 0x1406- f:00012 d: 6 | A = A + 6 (0x0006) 0x00DB (0x0001B6) 0x2908- f:00024 d: 264 | OR[264] = A 0x00DC (0x0001B8) 0x211A- f:00020 d: 282 | A = OR[282] 0x00DD (0x0001BA) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00DE (0x0001BC) 0x102A- f:00010 d: 42 | A = 42 (0x002A) 0x00DF (0x0001BE) 0x2924- f:00024 d: 292 | OR[292] = A 0x00E0 (0x0001C0) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x00E1 (0x0001C2) 0x5800- f:00054 d: 0 | B = A 0x00E2 (0x0001C4) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00E3 (0x0001C6) 0x7C09- f:00076 d: 9 | R = OR[9] 0x00E4 (0x0001C8) 0x2118- f:00020 d: 280 | A = OR[280] 0x00E5 (0x0001CA) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A) 0x00E6 (0x0001CC) 0x2908- f:00024 d: 264 | OR[264] = A 0x00E7 (0x0001CE) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00E8 (0x0001D0) 0x291F- f:00024 d: 287 | OR[287] = A 0x00E9 (0x0001D2) 0x2118- f:00020 d: 280 | A = OR[280] 0x00EA (0x0001D4) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x00EB (0x0001D6) 0x2908- f:00024 d: 264 | OR[264] = A 0x00EC (0x0001D8) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00ED (0x0001DA) 0x2920- f:00024 d: 288 | OR[288] = A 0x00EE (0x0001DC) 0x211F- f:00020 d: 287 | A = OR[287] 0x00EF (0x0001DE) 0x8402- f:00102 d: 2 | P = P + 2 (0x00F1), A = 0 0x00F0 (0x0001E0) 0x7006- f:00070 d: 6 | P = P + 6 (0x00F6) 0x00F1 (0x0001E2) 0x2120- f:00020 d: 288 | A = OR[288] 0x00F2 (0x0001E4) 0x8402- f:00102 d: 2 | P = P + 2 (0x00F4), A = 0 0x00F3 (0x0001E6) 0x7003- f:00070 d: 3 | P = P + 3 (0x00F6) 0x00F4 (0x0001E8) 0x7C34- f:00076 d: 52 | R = OR[52] 0x00F5 (0x0001EA) 0x0000- f:00000 d: 0 | PASS 0x00F6 (0x0001EC) 0x1026- f:00010 d: 38 | A = 38 (0x0026) 0x00F7 (0x0001EE) 0x2924- f:00024 d: 292 | OR[292] = A 0x00F8 (0x0001F0) 0x211F- f:00020 d: 287 | A = OR[287] 0x00F9 (0x0001F2) 0x2925- f:00024 d: 293 | OR[293] = A 0x00FA (0x0001F4) 0x2120- f:00020 d: 288 | A = OR[288] 0x00FB (0x0001F6) 0x2926- f:00024 d: 294 | OR[294] = A 0x00FC (0x0001F8) 0x211B- f:00020 d: 283 | A = OR[283] 0x00FD (0x0001FA) 0x2927- f:00024 d: 295 | OR[295] = A 0x00FE (0x0001FC) 0x1800-0x0200 f:00014 d: 0 | A = 512 (0x0200) 0x0100 (0x000200) 0x2928- f:00024 d: 296 | OR[296] = A 0x0101 (0x000202) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0102 (0x000204) 0x2929- f:00024 d: 297 | OR[297] = A 0x0103 (0x000206) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x0104 (0x000208) 0x5800- f:00054 d: 0 | B = A 0x0105 (0x00020A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0106 (0x00020C) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0107 (0x00020E) 0x2118- f:00020 d: 280 | A = OR[280] 0x0108 (0x000210) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C) 0x0109 (0x000212) 0x2908- f:00024 d: 264 | OR[264] = A 0x010A (0x000214) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x010B (0x000216) 0x2921- f:00024 d: 289 | OR[289] = A 0x010C (0x000218) 0x2121- f:00020 d: 289 | A = OR[289] 0x010D (0x00021A) 0xB434- f:00132 d: 52 | R = OR[52], A = 0 0x010E (0x00021C) 0x0000- f:00000 d: 0 | PASS 0x010F (0x00021E) 0x2121- f:00020 d: 289 | A = OR[289] 0x0110 (0x000220) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0111 (0x000222) 0x2908- f:00024 d: 264 | OR[264] = A 0x0112 (0x000224) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0113 (0x000226) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0114 (0x000228) 0x2922- f:00024 d: 290 | OR[290] = A 0x0115 (0x00022A) 0x211B- f:00020 d: 283 | A = OR[283] 0x0116 (0x00022C) 0x2923- f:00024 d: 291 | OR[291] = A 0x0117 (0x00022E) 0x2122- f:00020 d: 290 | A = OR[290] 0x0118 (0x000230) 0x841A- f:00102 d: 26 | P = P + 26 (0x0132), A = 0 0x0119 (0x000232) 0x2123- f:00020 d: 291 | A = OR[291] 0x011A (0x000234) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x011B (0x000236) 0x2908- f:00024 d: 264 | OR[264] = A 0x011C (0x000238) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x011D (0x00023A) 0x291F- f:00024 d: 287 | OR[287] = A 0x011E (0x00023C) 0x2123- f:00020 d: 291 | A = OR[291] 0x011F (0x00023E) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x0120 (0x000240) 0x2908- f:00024 d: 264 | OR[264] = A 0x0121 (0x000242) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0122 (0x000244) 0x2920- f:00024 d: 288 | OR[288] = A 0x0123 (0x000246) 0x744E- f:00072 d: 78 | R = P + 78 (0x0171) 0x0124 (0x000248) 0x2123- f:00020 d: 291 | A = OR[291] 0x0125 (0x00024A) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x0126 (0x00024C) 0x2908- f:00024 d: 264 | OR[264] = A 0x0127 (0x00024E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0128 (0x000250) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0129 (0x000252) 0x2123- f:00020 d: 291 | A = OR[291] 0x012A (0x000254) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x012B (0x000256) 0x2908- f:00024 d: 264 | OR[264] = A 0x012C (0x000258) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x012D (0x00025A) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x012E (0x00025C) 0x1004- f:00010 d: 4 | A = 4 (0x0004) 0x012F (0x00025E) 0x2B23- f:00025 d: 291 | OR[291] = A + OR[291] 0x0130 (0x000260) 0x2F22- f:00027 d: 290 | OR[290] = OR[290] - 1 0x0131 (0x000262) 0x721A- f:00071 d: 26 | P = P - 26 (0x0117) 0x0132 (0x000264) 0x1027- f:00010 d: 39 | A = 39 (0x0027) 0x0133 (0x000266) 0x2924- f:00024 d: 292 | OR[292] = A 0x0134 (0x000268) 0x211F- f:00020 d: 287 | A = OR[287] 0x0135 (0x00026A) 0x2925- f:00024 d: 293 | OR[293] = A 0x0136 (0x00026C) 0x2120- f:00020 d: 288 | A = OR[288] 0x0137 (0x00026E) 0x2926- f:00024 d: 294 | OR[294] = A 0x0138 (0x000270) 0x211B- f:00020 d: 283 | A = OR[283] 0x0139 (0x000272) 0x2927- f:00024 d: 295 | OR[295] = A 0x013A (0x000274) 0x1800-0x0200 f:00014 d: 0 | A = 512 (0x0200) 0x013C (0x000278) 0x2928- f:00024 d: 296 | OR[296] = A 0x013D (0x00027A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x013E (0x00027C) 0x2929- f:00024 d: 297 | OR[297] = A 0x013F (0x00027E) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x0140 (0x000280) 0x5800- f:00054 d: 0 | B = A 0x0141 (0x000282) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0142 (0x000284) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0143 (0x000286) 0x0200- f:00001 d: 0 | EXIT 0x0144 (0x000288) 0x101A- f:00010 d: 26 | A = 26 (0x001A) 0x0145 (0x00028A) 0x2924- f:00024 d: 292 | OR[292] = A 0x0146 (0x00028C) 0x111B- f:00010 d: 283 | A = 283 (0x011B) 0x0147 (0x00028E) 0x2925- f:00024 d: 293 | OR[293] = A 0x0148 (0x000290) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x0149 (0x000292) 0x5800- f:00054 d: 0 | B = A 0x014A (0x000294) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x014B (0x000296) 0x7C09- f:00076 d: 9 | R = OR[9] 0x014C (0x000298) 0x8602- f:00103 d: 2 | P = P + 2 (0x014E), A # 0 0x014D (0x00029A) 0x700B- f:00070 d: 11 | P = P + 11 (0x0158) 0x014E (0x00029C) 0x1007- f:00010 d: 7 | A = 7 (0x0007) 0x014F (0x00029E) 0x2924- f:00024 d: 292 | OR[292] = A 0x0150 (0x0002A0) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0151 (0x0002A2) 0x2925- f:00024 d: 293 | OR[293] = A 0x0152 (0x0002A4) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x0153 (0x0002A6) 0x5800- f:00054 d: 0 | B = A 0x0154 (0x0002A8) 0x1800-0x1918 f:00014 d: 0 | A = 6424 (0x1918) 0x0156 (0x0002AC) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0157 (0x0002AE) 0x7213- f:00071 d: 19 | P = P - 19 (0x0144) 0x0158 (0x0002B0) 0x0200- f:00001 d: 0 | EXIT 0x0159 (0x0002B2) 0x211B- f:00020 d: 283 | A = OR[283] 0x015A (0x0002B4) 0x8602- f:00103 d: 2 | P = P + 2 (0x015C), A # 0 0x015B (0x0002B6) 0x7009- f:00070 d: 9 | P = P + 9 (0x0164) 0x015C (0x0002B8) 0x101B- f:00010 d: 27 | A = 27 (0x001B) 0x015D (0x0002BA) 0x2924- f:00024 d: 292 | OR[292] = A 0x015E (0x0002BC) 0x211B- f:00020 d: 283 | A = OR[283] 0x015F (0x0002BE) 0x2925- f:00024 d: 293 | OR[293] = A 0x0160 (0x0002C0) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x0161 (0x0002C2) 0x5800- f:00054 d: 0 | B = A 0x0162 (0x0002C4) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0163 (0x0002C6) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0164 (0x0002C8) 0x0200- f:00001 d: 0 | EXIT 0x0165 (0x0002CA) 0x211E- f:00020 d: 286 | A = OR[286] 0x0166 (0x0002CC) 0x8602- f:00103 d: 2 | P = P + 2 (0x0168), A # 0 0x0167 (0x0002CE) 0x7009- f:00070 d: 9 | P = P + 9 (0x0170) 0x0168 (0x0002D0) 0x1017- f:00010 d: 23 | A = 23 (0x0017) 0x0169 (0x0002D2) 0x2924- f:00024 d: 292 | OR[292] = A 0x016A (0x0002D4) 0x211E- f:00020 d: 286 | A = OR[286] 0x016B (0x0002D6) 0x2925- f:00024 d: 293 | OR[293] = A 0x016C (0x0002D8) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x016D (0x0002DA) 0x5800- f:00054 d: 0 | B = A 0x016E (0x0002DC) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x016F (0x0002DE) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0170 (0x0002E0) 0x0200- f:00001 d: 0 | EXIT 0x0171 (0x0002E2) 0x211F- f:00020 d: 287 | A = OR[287] 0x0172 (0x0002E4) 0x8604- f:00103 d: 4 | P = P + 4 (0x0176), A # 0 0x0173 (0x0002E6) 0x2120- f:00020 d: 288 | A = OR[288] 0x0174 (0x0002E8) 0x8602- f:00103 d: 2 | P = P + 2 (0x0176), A # 0 0x0175 (0x0002EA) 0x700D- f:00070 d: 13 | P = P + 13 (0x0182) 0x0176 (0x0002EC) 0x101E- f:00010 d: 30 | A = 30 (0x001E) 0x0177 (0x0002EE) 0x2924- f:00024 d: 292 | OR[292] = A 0x0178 (0x0002F0) 0x211F- f:00020 d: 287 | A = OR[287] 0x0179 (0x0002F2) 0x2925- f:00024 d: 293 | OR[293] = A 0x017A (0x0002F4) 0x2120- f:00020 d: 288 | A = OR[288] 0x017B (0x0002F6) 0x2926- f:00024 d: 294 | OR[294] = A 0x017C (0x0002F8) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x017D (0x0002FA) 0x2927- f:00024 d: 295 | OR[295] = A 0x017E (0x0002FC) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x017F (0x0002FE) 0x5800- f:00054 d: 0 | B = A 0x0180 (0x000300) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0181 (0x000302) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0182 (0x000304) 0x0200- f:00001 d: 0 | EXIT 0x0183 (0x000306) 0x3118- f:00030 d: 280 | A = (OR[280]) 0x0184 (0x000308) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0185 (0x00030A) 0x2913- f:00024 d: 275 | OR[275] = A 0x0186 (0x00030C) 0x2118- f:00020 d: 280 | A = OR[280] 0x0187 (0x00030E) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0188 (0x000310) 0x2908- f:00024 d: 264 | OR[264] = A 0x0189 (0x000312) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x018A (0x000314) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x018B (0x000316) 0x2914- f:00024 d: 276 | OR[276] = A 0x018C (0x000318) 0x0400- f:00002 d: 0 | I = 0 0x018D (0x00031A) 0x0000- f:00000 d: 0 | PASS 0x018E (0x00031C) 0x1031- f:00010 d: 49 | A = 49 (0x0031) 0x018F (0x00031E) 0x29C3- f:00024 d: 451 | OR[451] = A 0x0190 (0x000320) 0x2113- f:00020 d: 275 | A = OR[275] 0x0191 (0x000322) 0x29C4- f:00024 d: 452 | OR[452] = A 0x0192 (0x000324) 0x2118- f:00020 d: 280 | A = OR[280] 0x0193 (0x000326) 0x29C5- f:00024 d: 453 | OR[453] = A 0x0194 (0x000328) 0x2114- f:00020 d: 276 | A = OR[276] 0x0195 (0x00032A) 0x29C6- f:00024 d: 454 | OR[454] = A 0x0196 (0x00032C) 0x2119- f:00020 d: 281 | A = OR[281] 0x0197 (0x00032E) 0x29C7- f:00024 d: 455 | OR[455] = A 0x0198 (0x000330) 0x211A- f:00020 d: 282 | A = OR[282] 0x0199 (0x000332) 0x29C8- f:00024 d: 456 | OR[456] = A 0x019A (0x000334) 0x7DC2- f:00076 d: 450 | R = OR[450] 0x019B (0x000336) 0x2119- f:00020 d: 281 | A = OR[281] 0x019C (0x000338) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008) 0x019D (0x00033A) 0x2908- f:00024 d: 264 | OR[264] = A 0x019E (0x00033C) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x019F (0x00033E) 0x2913- f:00024 d: 275 | OR[275] = A 0x01A0 (0x000340) 0x2119- f:00020 d: 281 | A = OR[281] 0x01A1 (0x000342) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009) 0x01A2 (0x000344) 0x2908- f:00024 d: 264 | OR[264] = A 0x01A3 (0x000346) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01A4 (0x000348) 0x2914- f:00024 d: 276 | OR[276] = A 0x01A5 (0x00034A) 0x2119- f:00020 d: 281 | A = OR[281] 0x01A6 (0x00034C) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008) 0x01A7 (0x00034E) 0x2908- f:00024 d: 264 | OR[264] = A 0x01A8 (0x000350) 0x2114- f:00020 d: 276 | A = OR[276] 0x01A9 (0x000352) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x01AA (0x000354) 0x2119- f:00020 d: 281 | A = OR[281] 0x01AB (0x000356) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009) 0x01AC (0x000358) 0x2908- f:00024 d: 264 | OR[264] = A 0x01AD (0x00035A) 0x2113- f:00020 d: 275 | A = OR[275] 0x01AE (0x00035C) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x01AF (0x00035E) 0x211A- f:00020 d: 282 | A = OR[282] 0x01B0 (0x000360) 0x127F- f:00011 d: 127 | A = A & 127 (0x007F) 0x01B1 (0x000362) 0x291A- f:00024 d: 282 | OR[282] = A 0x01B2 (0x000364) 0x2119- f:00020 d: 281 | A = OR[281] 0x01B3 (0x000366) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x01B4 (0x000368) 0x2908- f:00024 d: 264 | OR[264] = A 0x01B5 (0x00036A) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01B6 (0x00036C) 0x1A00-0xFF80 f:00015 d: 0 | A = A & 65408 (0xFF80) 0x01B8 (0x000370) 0x251A- f:00022 d: 282 | A = A + OR[282] 0x01B9 (0x000372) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x01BA (0x000374) 0x101C- f:00010 d: 28 | A = 28 (0x001C) 0x01BB (0x000376) 0x2924- f:00024 d: 292 | OR[292] = A 0x01BC (0x000378) 0x2119- f:00020 d: 281 | A = OR[281] 0x01BD (0x00037A) 0x2925- f:00024 d: 293 | OR[293] = A 0x01BE (0x00037C) 0x1124- f:00010 d: 292 | A = 292 (0x0124) 0x01BF (0x00037E) 0x5800- f:00054 d: 0 | B = A 0x01C0 (0x000380) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01C1 (0x000382) 0x7C09- f:00076 d: 9 | R = OR[9] 0x01C2 (0x000384) 0x2006- f:00020 d: 6 | A = OR[6] 0x01C3 (0x000386) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x01C4 (0x000388) 0x2908- f:00024 d: 264 | OR[264] = A 0x01C5 (0x00038A) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01C6 (0x00038C) 0x0200- f:00001 d: 0 | EXIT 0x01C7 (0x00038E) 0x0000- f:00000 d: 0 | PASS 0x01C8 (0x000390) 0x0000- f:00000 d: 0 | PASS 0x01C9 (0x000392) 0x0000- f:00000 d: 0 | PASS 0x01CA (0x000394) 0x0000- f:00000 d: 0 | PASS 0x01CB (0x000396) 0x0000- f:00000 d: 0 | PASS
79.823789
79
0.453394
036ab8802f82b81e7f64b1bac15bc5c4f9f12410
177
asm
Assembly
data/pokemon/dex_entries/flygon.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/pokemon/dex_entries/flygon.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/pokemon/dex_entries/flygon.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
db "MYSTIC@" ; species name db "It is nicknamed" next "The Desert Spirit" next "because the" page "flapping of its" next "wings sounds like" next "a woman singing.@"
17.7
28
0.677966
5af2a40b6ca876c690e7a7e6f94a0e3505ea1587
1,000
asm
Assembly
data/pokemon/base_stats/vigoroth.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
data/pokemon/base_stats/vigoroth.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
data/pokemon/base_stats/vigoroth.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
2
2021-08-11T19:47:07.000Z
2022-01-01T07:07:56.000Z
db 0 ; species ID placeholder db 80, 80, 80, 90, 55, 55 ; hp atk def spd sat sdf db NORMAL, NORMAL ; type db 120 ; catch rate db 126 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 15 ; step cycles to hatch INCBIN "gfx/pokemon/vigoroth/front.dimensions" db GROWTH_SLOW ; growth rate dn EGG_GROUND, EGG_GROUND ; egg groups db 70 ; happiness ; tm/hm learnset tmhm FOCUS_PUNCH, WATER_PULSE, ROAR, TOXIC, BULK_UP, HIDDEN_POWER, SUNNY_DAY, TAUNT, ICE_BEAM, BLIZZARD, PROTECT, RAIN_DANCE, FRUSTRATION, SOLARBEAM, THUNDERBOLT, THUNDER, EARTHQUAKE, RETURN, SHADOW_BALL, BRICK_BREAK, DOUBLE_TEAM, SHOCK_WAVE, FLAMETHROWER, FIRE_BLAST, ROCK_TOMB, AERIAL_ACE, FACADE, SECRET_POWER, REST, ATTRACT, FOCUS_BLAST, FLING, ENDURE, SHADOW_CLAW, CAPTIVATE, ROCK_SLIDE, SLEEP_TALK, NATURAL_GIFT, SWAGGER, SUBSTITUTE, CUT, STRENGTH, ROCK_SMASH, ROCK_CLIMB, FIRE_PUNCH, FURY_CUTTER, GUNK_SHOT, ICE_PUNCH, ICY_WIND, MUD_SLAP, SUCKER_PUNCH, THUNDERPUNCH, UPROAR ; end
50
582
0.759
5198ead4bd7c220b611eb354766d5215bdba7a85
362
asm
Assembly
programs/oeis/073/A073124.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/073/A073124.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/073/A073124.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A073124: a(n) = prime(1+prime(n)) - prime(prime(n)). ; 2,2,2,2,6,2,2,4,6,4,4,6,2,2,12,10,4,10,6,6,6,8,2,2,12,10,6,6,2,2,10,4,14,12,4,4,10,4,6,2,6,4,10,10,12,6,4,14,6,4,10,12,8,4,6,24,10,6,2,8,14,18,2,6,2,12,16,4,6,6,2,6,26,2,8,10,4,10,4 seq $0,40 ; The prime numbers. sub $0,2 seq $0,28334 ; Differences between consecutive odd primes, divided by 2. mul $0,2
45.25
183
0.616022
a293e88c1ac3dc1aa41aff246c873d9e77daa824
2,490
asm
Assembly
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_26_615.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_26_615.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_26_615.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 %r11 push %r13 push %r8 push %rbp push %rcx push %rsi // Load lea addresses_A+0x1bd33, %rsi clflush (%rsi) and $4861, %r10 mov (%rsi), %ebp nop nop nop nop xor %rbp, %rbp // Store lea addresses_D+0x13133, %rsi nop nop nop dec %r8 movl $0x51525354, (%rsi) nop nop nop nop xor $29615, %r8 // Store lea addresses_US+0x15ab, %r8 nop xor %rcx, %rcx mov $0x5152535455565758, %rbp movq %rbp, %xmm4 vmovups %ymm4, (%r8) nop nop xor $15405, %r8 // Load lea addresses_WT+0x15133, %r11 nop inc %rcx mov (%r11), %r13w nop nop nop xor $36468, %rcx // Store lea addresses_normal+0xe3b3, %r8 clflush (%r8) sub %r13, %r13 movl $0x51525354, (%r8) nop nop nop nop and %rbp, %rbp // Store lea addresses_D+0x54ab, %r13 and %rsi, %rsi mov $0x5152535455565758, %rcx movq %rcx, (%r13) and %rbp, %rbp // Store lea addresses_US+0x18933, %r13 nop nop dec %r8 movb $0x51, (%r13) nop nop nop nop nop and %rsi, %rsi // Faulty Load lea addresses_WT+0x15133, %r13 nop nop nop nop xor %rbp, %rbp mov (%r13), %r11d lea oracles, %r8 and $0xff, %r11 shlq $12, %r11 mov (%r8,%r11,1), %r11 pop %rsi pop %rcx pop %rbp pop %r8 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 2}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 11}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'54': 26} 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 */
19.302326
125
0.633735
75a26757004088ba27da6b8cc12982f1705ef22c
1,387
asm
Assembly
programs/oeis/016/A016961.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/016/A016961.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/016/A016961.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A016961: a(n) = (6*n + 4)^5. ; 1024,100000,1048576,5153632,17210368,45435424,102400000,205962976,380204032,656356768,1073741824,1680700000,2535525376,3707398432,5277319168,7339040224,10000000000,13382255776,17623416832,22877577568,29316250624,37129300000,46525874176,57735339232,71008211968,86617093024,104857600000,126049300576,150536645632,178689902368,210906087424,247609900000,289254654976,336323216032,389328928768,448816553824,515363200000,589579257376,672109330432,763633171168,864866612224,976562500000,1099511627776,1234543668832,1382528109568,1544375182624,1721036800000,1913507486176,2122825311232,2350072823968,2596377985024,2862915100000,3150905752576,3461619737632,3796375994368,4156543539424,4543542400000,4958844546976,5403974828032,5880511900768,6390089165824,6934395700000,7515177189376,8134236862432,8793436423168,9494696984224,10240000000000,11031388199776,11870966520832,12760903041568,13703429914624,14700844300000,15755509298176,16869854883232,18046378835968,19287647677024,20596297600000,21975035404576,23426639429632,24953960486368,26559922791424,28247524900000,30019840638976,31880020040032,33831290272768,35876956577824,38020403200000,40265094321376,42614574994432,45072472075168,47642495156224,50328437500000,53134176971776,56063676972832,59120987373568,62310245446624,65635676800000,69101596310176,72712409055232,76472611247968 mul $0,6 add $0,4 pow $0,5
198.142857
1,327
0.90411
8e2bcdea07293c0300626f76085fd3cd2dcf8824
4,490
asm
Assembly
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2_notsx.log_102_725.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2_notsx.log_102_725.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2_notsx.log_102_725.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r8 push %r9 push %rax push %rcx push %rdx lea addresses_A_ht+0x133ef, %r14 nop add $17728, %r10 mov (%r14), %ecx nop nop nop cmp $4, %rax lea addresses_WC_ht+0xdf0f, %rax clflush (%rax) nop nop nop and $64649, %r9 vmovups (%rax), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %rdx inc %rcx lea addresses_WT_ht+0xf37f, %r10 nop nop xor %r8, %r8 vmovups (%r10), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %rcx nop nop add %rdx, %rdx lea addresses_D_ht+0xcf, %rdx nop nop sub $28345, %r9 movups (%rdx), %xmm7 vpextrq $0, %xmm7, %r10 nop cmp $48636, %r8 lea addresses_D_ht+0x273a, %r14 nop nop lfence vmovups (%r14), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %r9 and %r10, %r10 pop %rdx pop %rcx pop %rax pop %r9 pop %r8 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %r8 push %rdi push %rdx push %rsi // Load lea addresses_D+0x4303, %rdi nop nop nop nop dec %r8 mov (%rdi), %edx nop nop nop add %r8, %r8 // Store lea addresses_UC+0x3bf, %r12 nop dec %r15 mov $0x5152535455565758, %r8 movq %r8, %xmm2 movups %xmm2, (%r12) nop nop inc %rdx // Load lea addresses_US+0x1d0cf, %rdx clflush (%rdx) nop nop nop and $65435, %r13 movups (%rdx), %xmm0 vpextrq $1, %xmm0, %r8 nop add %rsi, %rsi // Store lea addresses_D+0x6bff, %r8 nop nop nop nop inc %r13 mov $0x5152535455565758, %rsi movq %rsi, %xmm5 vmovups %ymm5, (%r8) nop nop nop cmp $57321, %rdi // Store mov $0x4af, %r8 nop and %r12, %r12 movw $0x5152, (%r8) nop nop nop inc %r13 // Store lea addresses_WT+0x1fcaf, %r13 nop nop nop nop and $13186, %r12 movw $0x5152, (%r13) nop and $41282, %rdi // Store lea addresses_US+0x16e2f, %r8 nop nop nop nop and %r15, %r15 mov $0x5152535455565758, %r13 movq %r13, (%r8) nop nop add %rsi, %rsi // Store mov $0x580e800000006c5, %r8 nop nop nop nop nop xor %rsi, %rsi mov $0x5152535455565758, %rdx movq %rdx, %xmm2 movups %xmm2, (%r8) nop nop nop nop nop cmp $8883, %r13 // Faulty Load lea addresses_US+0x16e2f, %rdx inc %r15 movups (%rdx), %xmm5 vpextrq $1, %xmm5, %r12 lea oracles, %r15 and $0xff, %r12 shlq $12, %r12 mov (%r15,%r12,1), %r12 pop %rsi pop %rdx pop %rdi pop %r8 pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'00': 102} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
20.691244
305
0.637862
5e590ea0a581c3554528e557d497a3d5f8954923
10
asm
Assembly
Assembler/TEST.asm
techno-sorcery/CPU-16
be596a4325975c563435f4f72670014d68421ab0
[ "Apache-2.0" ]
null
null
null
Assembler/TEST.asm
techno-sorcery/CPU-16
be596a4325975c563435f4f72670014d68421ab0
[ "Apache-2.0" ]
null
null
null
Assembler/TEST.asm
techno-sorcery/CPU-16
be596a4325975c563435f4f72670014d68421ab0
[ "Apache-2.0" ]
null
null
null
LNK D6,#-4
10
10
0.6
3e084f72d2bca21bb622decbcd3deaa8bff0c5ff
259
asm
Assembly
oeis/347/A347581.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/347/A347581.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/347/A347581.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A347581: The Barnyard sequence: a(n) is the minimum number of unit length line segments required to enclose areas of 1 through n on a square grid. ; Submitted by Jamie Morken(l1) ; 4,9,14,20,26,33,40,47,55,63 add $0,12 pow $0,2 add $0,2 div $0,5 sub $0,25
25.9
148
0.714286
515ff04613f6e3e7784803601984d2dfcc335645
48,925
asm
Assembly
P6/data_P6/testpoint/testpoint34.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
1
2022-01-23T09:24:47.000Z
2022-01-23T09:24:47.000Z
P6/data_P6/testpoint/testpoint34.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
null
null
null
P6/data_P6/testpoint/testpoint34.asm
alxzzhou/BUAA_CO_2020
b54bf367081a5a11701ebc3fc78a23494aecca9e
[ "Apache-2.0" ]
null
null
null
ori $1, $0, 7 ori $2, $0, 2 ori $3, $0, 2 ori $4, $0, 3 sw $4, 0($0) sw $3, 4($0) sw $2, 8($0) sw $1, 12($0) sw $2, 16($0) sw $3, 20($0) sw $2, 24($0) sw $2, 28($0) sw $3, 32($0) sw $2, 36($0) sw $1, 40($0) sw $2, 44($0) sw $3, 48($0) sw $4, 52($0) sw $4, 56($0) sw $2, 60($0) sw $3, 64($0) sw $4, 68($0) sw $2, 72($0) sw $1, 76($0) sw $1, 80($0) sw $4, 84($0) sw $1, 88($0) sw $4, 92($0) sw $3, 96($0) sw $3, 100($0) sw $2, 104($0) sw $2, 108($0) sw $3, 112($0) sw $2, 116($0) sw $3, 120($0) sw $4, 124($0) blez $2, TAG1 lh $2, 0($2) bltz $2, TAG1 multu $2, $2 TAG1: lhu $1, 0($2) mtlo $2 mfhi $1 mfhi $4 TAG2: mflo $3 beq $4, $4, TAG3 sb $4, 0($3) lh $3, 0($3) TAG3: mthi $3 slti $3, $3, 5 mtlo $3 mtlo $3 TAG4: lb $4, 0($3) sb $3, 0($3) mthi $3 mfhi $2 TAG5: xori $3, $2, 0 blez $2, TAG6 ori $1, $2, 2 bgtz $1, TAG6 TAG6: sb $1, 0($1) mtlo $1 lb $3, 0($1) srlv $1, $3, $1 TAG7: bne $1, $1, TAG8 sw $1, 0($1) sw $1, 0($1) sw $1, 0($1) TAG8: mflo $3 srl $3, $3, 14 mthi $3 mflo $1 TAG9: mtlo $1 mfhi $1 bne $1, $1, TAG10 mult $1, $1 TAG10: mfhi $1 multu $1, $1 nor $4, $1, $1 mthi $1 TAG11: divu $4, $4 lw $4, 1($4) mflo $3 mthi $3 TAG12: sltu $4, $3, $3 mfhi $1 bgez $3, TAG13 subu $1, $1, $4 TAG13: mflo $3 beq $3, $3, TAG14 mflo $3 mult $1, $3 TAG14: lbu $2, 0($3) sra $4, $2, 7 multu $2, $4 multu $3, $4 TAG15: lh $2, 0($4) bltz $2, TAG16 lh $1, 0($4) multu $2, $2 TAG16: nor $1, $1, $1 sh $1, 1($1) lw $2, 1($1) subu $3, $2, $1 TAG17: bltz $3, TAG18 multu $3, $3 lui $4, 0 bgez $4, TAG18 TAG18: sub $1, $4, $4 mthi $1 sh $1, 0($1) sb $4, 0($4) TAG19: mult $1, $1 bne $1, $1, TAG20 mthi $1 bne $1, $1, TAG20 TAG20: mflo $1 mfhi $2 lw $4, 0($2) nor $3, $1, $4 TAG21: bne $3, $3, TAG22 mfhi $3 sw $3, 0($3) mtlo $3 TAG22: lui $4, 7 sll $0, $0, 0 bgtz $4, TAG23 mthi $3 TAG23: mflo $4 mflo $3 bgtz $4, TAG24 sh $3, 0($3) TAG24: srl $4, $3, 10 lbu $2, 0($3) lui $3, 14 bgez $3, TAG25 TAG25: multu $3, $3 lui $4, 11 blez $3, TAG26 sll $0, $0, 0 TAG26: bne $4, $4, TAG27 sll $0, $0, 0 blez $2, TAG27 mult $2, $2 TAG27: mult $2, $2 mtlo $2 lui $4, 3 addu $3, $2, $4 TAG28: lui $3, 12 mthi $3 divu $3, $3 beq $3, $3, TAG29 TAG29: subu $1, $3, $3 mtlo $3 mult $1, $1 lui $4, 2 TAG30: mflo $2 andi $4, $4, 1 sub $2, $4, $4 lui $2, 9 TAG31: mult $2, $2 mflo $2 bne $2, $2, TAG32 sll $2, $2, 13 TAG32: srav $4, $2, $2 mflo $3 sh $2, 0($3) add $4, $3, $4 TAG33: mthi $4 sh $4, 0($4) mult $4, $4 bne $4, $4, TAG34 TAG34: sra $4, $4, 8 slti $3, $4, 5 mthi $3 addiu $4, $4, 8 TAG35: mthi $4 bne $4, $4, TAG36 xori $4, $4, 8 lh $2, 0($4) TAG36: mthi $2 andi $1, $2, 3 sllv $4, $1, $1 bltz $1, TAG37 TAG37: or $1, $4, $4 multu $4, $4 lbu $2, 0($4) lw $4, 0($2) TAG38: lui $4, 4 beq $4, $4, TAG39 sll $0, $0, 0 mflo $2 TAG39: andi $3, $2, 10 sllv $4, $2, $3 mthi $2 multu $2, $2 TAG40: lui $3, 8 bltz $4, TAG41 mtlo $3 sltu $2, $4, $3 TAG41: beq $2, $2, TAG42 div $2, $2 sltu $4, $2, $2 beq $2, $2, TAG42 TAG42: lbu $4, 0($4) lh $3, 0($4) lui $1, 8 bne $1, $1, TAG43 TAG43: mfhi $3 lui $1, 14 mflo $2 mfhi $1 TAG44: mtlo $1 sb $1, 0($1) lui $4, 9 mthi $1 TAG45: bgez $4, TAG46 srav $4, $4, $4 mtlo $4 bltz $4, TAG46 TAG46: lui $1, 14 srlv $4, $1, $4 bltz $4, TAG47 srlv $1, $4, $1 TAG47: bne $1, $1, TAG48 sll $0, $0, 0 mtlo $2 sll $0, $0, 0 TAG48: sltiu $4, $3, 1 beq $3, $4, TAG49 slt $4, $3, $3 sllv $2, $4, $4 TAG49: sb $2, 0($2) sw $2, 0($2) mfhi $2 lui $2, 12 TAG50: xori $1, $2, 11 mflo $4 multu $4, $1 bgez $4, TAG51 TAG51: lui $2, 13 mflo $4 subu $4, $4, $4 mthi $4 TAG52: mfhi $3 mflo $3 mthi $3 multu $4, $3 TAG53: beq $3, $3, TAG54 andi $1, $3, 12 sw $1, 0($3) bne $1, $3, TAG54 TAG54: mfhi $2 div $2, $1 sb $2, 0($1) blez $2, TAG55 TAG55: addu $3, $2, $2 multu $3, $3 mflo $2 lui $2, 2 TAG56: lui $2, 0 beq $2, $2, TAG57 slt $4, $2, $2 mfhi $2 TAG57: sra $1, $2, 9 lui $3, 13 sh $3, 0($1) lui $1, 5 TAG58: sll $3, $1, 3 sll $0, $0, 0 sll $4, $3, 9 bne $3, $1, TAG59 TAG59: mtlo $4 sll $0, $0, 0 sll $0, $0, 0 beq $4, $4, TAG60 TAG60: lui $3, 15 blez $3, TAG61 ori $1, $2, 15 mthi $3 TAG61: sb $1, 0($1) sb $1, 0($1) bne $1, $1, TAG62 lui $4, 5 TAG62: bgtz $4, TAG63 mult $4, $4 sh $4, 0($4) divu $4, $4 TAG63: blez $4, TAG64 sll $0, $0, 0 and $2, $4, $4 sltu $4, $2, $4 TAG64: mtlo $4 lui $3, 13 divu $3, $3 lui $3, 11 TAG65: lui $4, 11 or $4, $3, $3 mthi $3 sll $0, $0, 0 TAG66: bgez $4, TAG67 mflo $2 sb $2, 0($2) sh $4, 0($2) TAG67: subu $3, $2, $2 lui $3, 3 mtlo $3 mflo $3 TAG68: mflo $3 mtlo $3 andi $1, $3, 14 lh $4, 0($1) TAG69: sw $4, 0($4) beq $4, $4, TAG70 sll $4, $4, 11 lui $2, 7 TAG70: bltz $2, TAG71 mult $2, $2 mthi $2 beq $2, $2, TAG71 TAG71: mthi $2 mflo $3 lui $1, 6 multu $3, $1 TAG72: sll $0, $0, 0 bne $1, $1, TAG73 lui $3, 9 bgez $1, TAG73 TAG73: srl $1, $3, 10 sh $1, -576($1) addiu $4, $3, 0 multu $3, $4 TAG74: mflo $4 bltz $4, TAG75 mfhi $1 sb $1, 0($1) TAG75: mfhi $1 bgez $1, TAG76 multu $1, $1 divu $1, $1 TAG76: mfhi $3 beq $1, $3, TAG77 xor $2, $1, $3 lb $4, 0($1) TAG77: mfhi $4 sw $4, 0($4) bltz $4, TAG78 mtlo $4 TAG78: lui $3, 13 beq $3, $4, TAG79 sll $0, $0, 0 srav $2, $4, $3 TAG79: mthi $2 nor $4, $2, $2 mthi $4 mfhi $1 TAG80: divu $1, $1 beq $1, $1, TAG81 slt $1, $1, $1 mflo $3 TAG81: divu $3, $3 lui $2, 0 bltz $3, TAG82 subu $4, $2, $3 TAG82: or $4, $4, $4 mtlo $4 mfhi $4 lb $2, 0($4) TAG83: mtlo $2 xori $1, $2, 8 lui $4, 13 mflo $4 TAG84: multu $4, $4 mult $4, $4 lb $3, 0($4) mult $3, $4 TAG85: sh $3, 0($3) mult $3, $3 bne $3, $3, TAG86 sh $3, 0($3) TAG86: mflo $3 or $1, $3, $3 sra $1, $3, 4 mult $1, $1 TAG87: mthi $1 lw $1, 0($1) mult $1, $1 sb $1, 0($1) TAG88: mthi $1 sh $1, 0($1) mflo $3 mflo $4 TAG89: addiu $3, $4, 11 ori $1, $4, 1 sh $4, 0($4) bgtz $3, TAG90 TAG90: mfhi $1 mthi $1 sltiu $3, $1, 5 subu $4, $3, $3 TAG91: multu $4, $4 multu $4, $4 lb $3, 0($4) lui $1, 6 TAG92: mthi $1 xori $3, $1, 3 sltu $4, $3, $3 mtlo $1 TAG93: sb $4, 0($4) ori $1, $4, 15 mfhi $1 lui $1, 2 TAG94: beq $1, $1, TAG95 mult $1, $1 srav $1, $1, $1 sra $4, $1, 9 TAG95: mflo $3 mflo $3 beq $3, $3, TAG96 multu $3, $3 TAG96: beq $3, $3, TAG97 mfhi $3 sub $2, $3, $3 bne $3, $3, TAG97 TAG97: lui $2, 8 addiu $1, $2, 9 mtlo $2 mthi $2 TAG98: sllv $2, $1, $1 multu $2, $1 subu $3, $2, $1 bgez $2, TAG99 TAG99: mtlo $3 srl $2, $3, 3 bgtz $2, TAG100 sll $0, $0, 0 TAG100: divu $3, $3 lui $1, 11 and $2, $1, $1 mfhi $1 TAG101: beq $1, $1, TAG102 lbu $4, 0($1) mthi $1 mfhi $3 TAG102: mflo $1 sll $0, $0, 0 lb $1, 0($4) sh $1, 0($1) TAG103: sll $1, $1, 12 mthi $1 sw $1, 0($1) xori $2, $1, 8 TAG104: ori $3, $2, 5 sb $3, 0($3) mtlo $3 lui $3, 13 TAG105: subu $1, $3, $3 blez $3, TAG106 mthi $3 bgtz $1, TAG106 TAG106: subu $3, $1, $1 lui $1, 14 lui $3, 11 lui $4, 8 TAG107: mfhi $2 bne $2, $2, TAG108 slti $3, $4, 6 mthi $2 TAG108: bne $3, $3, TAG109 addi $2, $3, 2 mthi $3 multu $3, $2 TAG109: slti $1, $2, 2 bne $2, $1, TAG110 lw $4, 0($1) xor $3, $4, $1 TAG110: mthi $3 sb $3, 0($3) lhu $3, 0($3) blez $3, TAG111 TAG111: srlv $3, $3, $3 andi $2, $3, 2 slti $4, $2, 3 sb $4, 0($3) TAG112: mtlo $4 srl $3, $4, 3 beq $3, $3, TAG113 mtlo $3 TAG113: sw $3, 0($3) lui $4, 13 bltz $3, TAG114 addiu $3, $3, 1 TAG114: lui $4, 11 sll $0, $0, 0 lui $1, 8 mtlo $3 TAG115: bltz $1, TAG116 sll $0, $0, 0 nor $4, $1, $1 and $1, $1, $1 TAG116: mflo $1 sb $1, 0($1) lb $4, 0($1) blez $1, TAG117 TAG117: slti $4, $4, 13 lb $4, 0($4) ori $4, $4, 6 bltz $4, TAG118 TAG118: sltiu $2, $4, 9 mflo $2 mflo $1 div $4, $2 TAG119: beq $1, $1, TAG120 sb $1, 0($1) sb $1, 0($1) lhu $3, 0($1) TAG120: beq $3, $3, TAG121 mflo $4 multu $3, $3 mtlo $4 TAG121: bgez $4, TAG122 mtlo $4 srl $2, $4, 5 mflo $4 TAG122: mtlo $4 mthi $4 sb $4, 0($4) bgez $4, TAG123 TAG123: mtlo $4 mtlo $4 lui $4, 11 lui $3, 13 TAG124: mult $3, $3 lui $3, 13 sll $0, $0, 0 sll $0, $0, 0 TAG125: bltz $2, TAG126 lbu $1, 0($2) mthi $2 lbu $2, 0($2) TAG126: addu $1, $2, $2 sh $2, 0($1) srl $3, $1, 0 sh $3, 0($3) TAG127: divu $3, $3 mthi $3 srlv $1, $3, $3 addu $2, $3, $1 TAG128: srlv $3, $2, $2 bgez $3, TAG129 mfhi $3 div $3, $3 TAG129: mult $3, $3 bgtz $3, TAG130 mflo $2 mtlo $2 TAG130: mthi $2 or $2, $2, $2 blez $2, TAG131 mfhi $2 TAG131: blez $2, TAG132 nor $4, $2, $2 lh $3, 5($4) mflo $1 TAG132: sw $1, 0($1) lui $2, 10 mflo $2 sw $2, 0($2) TAG133: addu $1, $2, $2 lui $2, 11 divu $2, $1 andi $3, $2, 6 TAG134: bne $3, $3, TAG135 mtlo $3 lui $4, 11 beq $4, $4, TAG135 TAG135: lui $1, 0 mtlo $4 sll $0, $0, 0 ori $4, $4, 11 TAG136: mult $4, $4 mtlo $4 divu $4, $4 lui $4, 2 TAG137: andi $4, $4, 8 mthi $4 blez $4, TAG138 subu $2, $4, $4 TAG138: mthi $2 sw $2, 0($2) lui $2, 12 sll $0, $0, 0 TAG139: sltiu $1, $2, 12 mflo $4 sll $0, $0, 0 mtlo $2 TAG140: bltz $2, TAG141 lui $2, 7 addu $1, $2, $2 ori $2, $1, 13 TAG141: mthi $2 bne $2, $2, TAG142 lui $4, 1 addiu $4, $2, 13 TAG142: mflo $1 sll $0, $0, 0 lui $4, 11 sra $2, $4, 10 TAG143: beq $2, $2, TAG144 lui $1, 11 multu $1, $2 lui $2, 15 TAG144: divu $2, $2 sw $2, -704($2) lw $2, -704($2) sltu $2, $2, $2 TAG145: ori $1, $2, 5 mult $2, $2 lbu $3, 0($1) beq $2, $1, TAG146 TAG146: mfhi $4 sub $4, $4, $3 lui $1, 12 lbu $4, 0($3) TAG147: blez $4, TAG148 lui $3, 11 mflo $1 lui $2, 2 TAG148: slt $2, $2, $2 bgez $2, TAG149 sltiu $3, $2, 8 sra $3, $2, 14 TAG149: addiu $3, $3, 12 lb $3, 0($3) mtlo $3 addu $2, $3, $3 TAG150: mfhi $2 blez $2, TAG151 andi $2, $2, 9 lui $2, 7 TAG151: srl $4, $2, 9 mtlo $4 bne $2, $4, TAG152 mflo $4 TAG152: lui $1, 13 lh $1, 0($4) mtlo $1 addu $2, $4, $1 TAG153: lui $3, 10 multu $2, $2 beq $3, $3, TAG154 sb $3, -704($2) TAG154: sll $0, $0, 0 mfhi $2 lb $3, -704($1) mflo $2 TAG155: bgez $2, TAG156 mflo $4 mflo $3 mtlo $4 TAG156: bgez $3, TAG157 multu $3, $3 multu $3, $3 srlv $2, $3, $3 TAG157: sll $2, $2, 5 nor $4, $2, $2 blez $2, TAG158 sll $0, $0, 0 TAG158: bne $4, $4, TAG159 lui $3, 4 nor $4, $3, $3 beq $4, $3, TAG159 TAG159: addiu $2, $4, 1 mthi $2 subu $2, $2, $4 slti $2, $4, 4 TAG160: lbu $3, 0($2) sb $3, 0($2) lbu $4, 0($2) lui $4, 6 TAG161: sll $0, $0, 0 sll $0, $0, 0 div $4, $3 lhu $1, -704($1) TAG162: sra $3, $1, 10 and $1, $3, $3 lui $1, 11 sra $1, $1, 2 TAG163: bne $1, $1, TAG164 sll $0, $0, 0 srlv $1, $1, $1 sll $0, $0, 0 TAG164: srlv $4, $2, $2 srl $3, $4, 7 andi $2, $4, 11 lui $2, 13 TAG165: bgtz $2, TAG166 mflo $2 sb $2, 0($2) blez $2, TAG166 TAG166: div $2, $2 sll $0, $0, 0 sll $0, $0, 0 multu $1, $2 TAG167: divu $1, $1 bgtz $1, TAG168 mthi $1 beq $1, $1, TAG168 TAG168: lui $1, 1 bne $1, $1, TAG169 sll $0, $0, 0 beq $1, $1, TAG169 TAG169: mflo $1 sll $0, $0, 0 div $2, $2 mtlo $2 TAG170: bne $1, $1, TAG171 lbu $1, 0($1) lui $1, 13 mthi $1 TAG171: mthi $1 mflo $3 lui $2, 13 mflo $3 TAG172: addu $2, $3, $3 sll $0, $0, 0 bltz $2, TAG173 divu $3, $2 TAG173: sll $0, $0, 0 mult $2, $2 mthi $2 blez $2, TAG174 TAG174: subu $2, $2, $2 mflo $4 mult $4, $2 sllv $4, $2, $2 TAG175: sltiu $2, $4, 13 bne $2, $2, TAG176 mflo $3 slti $2, $3, 11 TAG176: mtlo $2 lui $1, 8 sb $1, 0($2) mtlo $2 TAG177: blez $1, TAG178 sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 TAG178: lhu $4, 0($3) mfhi $1 bgez $3, TAG179 mthi $1 TAG179: mfhi $4 multu $1, $1 sltiu $3, $4, 15 mfhi $3 TAG180: lui $3, 2 blez $3, TAG181 addu $1, $3, $3 sll $0, $0, 0 TAG181: bltz $2, TAG182 mflo $2 sh $2, 0($2) mflo $4 TAG182: bne $4, $4, TAG183 lui $4, 11 lui $1, 12 sll $0, $0, 0 TAG183: sll $0, $0, 0 subu $2, $4, $4 bgtz $4, TAG184 sra $3, $4, 1 TAG184: addu $3, $3, $3 bgtz $3, TAG185 lui $2, 2 divu $3, $2 TAG185: beq $2, $2, TAG186 sll $0, $0, 0 mthi $2 bltz $2, TAG186 TAG186: ori $4, $2, 8 sll $0, $0, 0 bgtz $2, TAG187 srlv $3, $4, $2 TAG187: sll $0, $0, 0 bne $4, $3, TAG188 mtlo $4 multu $3, $3 TAG188: lui $3, 14 divu $4, $3 xori $4, $4, 0 sll $0, $0, 0 TAG189: beq $4, $4, TAG190 mflo $4 subu $4, $4, $4 bgez $4, TAG190 TAG190: sh $4, 0($4) addiu $1, $4, 9 lui $3, 0 sh $4, 0($4) TAG191: lh $2, 0($3) lw $2, 0($2) mult $3, $2 mtlo $3 TAG192: lui $2, 3 mfhi $3 beq $3, $2, TAG193 mult $3, $2 TAG193: lui $4, 0 subu $2, $3, $3 sub $3, $2, $4 beq $3, $4, TAG194 TAG194: mthi $3 mflo $2 sb $3, 0($3) sltu $4, $3, $2 TAG195: bltz $4, TAG196 or $2, $4, $4 mtlo $4 lh $3, 0($4) TAG196: lui $4, 0 bltz $4, TAG197 mtlo $4 lbu $1, 0($4) TAG197: bne $1, $1, TAG198 sh $1, 0($1) blez $1, TAG198 sb $1, 0($1) TAG198: mflo $3 add $4, $3, $1 lw $2, 0($1) bne $3, $1, TAG199 TAG199: mflo $1 lhu $1, 0($2) bne $1, $1, TAG200 mtlo $1 TAG200: sll $2, $1, 7 mult $2, $1 sub $2, $1, $1 bgtz $2, TAG201 TAG201: multu $2, $2 lh $2, 0($2) sb $2, 0($2) sh $2, 0($2) TAG202: sh $2, 0($2) mthi $2 sb $2, 0($2) bne $2, $2, TAG203 TAG203: mfhi $4 sltu $1, $2, $2 multu $4, $1 lui $3, 13 TAG204: lui $3, 12 mflo $4 sb $3, 0($4) lui $4, 12 TAG205: beq $4, $4, TAG206 mflo $4 multu $4, $4 lui $1, 6 TAG206: multu $1, $1 sltu $4, $1, $1 mtlo $1 lhu $3, 0($4) TAG207: lw $1, 0($3) mfhi $4 mfhi $3 andi $4, $1, 3 TAG208: mflo $2 sra $4, $4, 13 lui $3, 5 blez $4, TAG209 TAG209: sll $0, $0, 0 lui $4, 1 lui $4, 2 lui $4, 6 TAG210: nor $1, $4, $4 sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 TAG211: mtlo $4 beq $4, $4, TAG212 sra $2, $4, 5 mfhi $4 TAG212: blez $4, TAG213 sll $0, $0, 0 mtlo $4 slt $3, $4, $4 TAG213: bgtz $3, TAG214 mfhi $3 sltiu $2, $3, 4 blez $2, TAG214 TAG214: sra $3, $2, 9 multu $3, $3 lb $4, 0($2) andi $3, $3, 2 TAG215: mult $3, $3 bne $3, $3, TAG216 mthi $3 lui $3, 1 TAG216: lui $2, 8 mtlo $3 addu $4, $3, $3 bgtz $2, TAG217 TAG217: sllv $4, $4, $4 slt $4, $4, $4 mthi $4 slti $4, $4, 1 TAG218: addu $1, $4, $4 lbu $3, 0($1) mult $1, $1 lbu $4, 0($4) TAG219: bne $4, $4, TAG220 addi $3, $4, 11 bgtz $4, TAG220 slti $2, $4, 7 TAG220: lui $1, 12 xori $2, $1, 0 sll $0, $0, 0 blez $2, TAG221 TAG221: mflo $4 mult $4, $4 multu $4, $4 sll $0, $0, 0 TAG222: divu $4, $4 divu $4, $4 sb $4, 0($4) lui $4, 15 TAG223: sll $0, $0, 0 mtlo $4 mthi $4 sll $0, $0, 0 TAG224: sll $0, $0, 0 sll $4, $4, 5 beq $4, $4, TAG225 sll $0, $0, 0 TAG225: divu $4, $4 addiu $4, $4, 5 sll $0, $0, 0 sll $0, $0, 0 TAG226: xori $3, $3, 8 lb $4, 0($3) lui $3, 10 lui $2, 0 TAG227: mthi $2 lui $1, 5 sh $2, 0($2) mthi $2 TAG228: srlv $3, $1, $1 bgez $1, TAG229 ori $3, $1, 7 slti $3, $1, 13 TAG229: lui $4, 10 bltz $3, TAG230 addu $3, $4, $4 srl $1, $4, 5 TAG230: mtlo $1 lbu $1, -20480($1) xori $2, $1, 15 srl $3, $2, 11 TAG231: sw $3, 0($3) lb $4, 0($3) or $1, $3, $4 mtlo $3 TAG232: mflo $4 mfhi $1 bne $1, $1, TAG233 multu $4, $1 TAG233: lw $2, 0($1) srl $3, $1, 8 beq $1, $1, TAG234 sltiu $4, $3, 13 TAG234: mflo $3 sra $4, $4, 9 multu $4, $4 bgez $4, TAG235 TAG235: sh $4, 0($4) multu $4, $4 mtlo $4 mfhi $3 TAG236: beq $3, $3, TAG237 multu $3, $3 addu $4, $3, $3 lui $1, 0 TAG237: lbu $1, 0($1) sltiu $4, $1, 6 mflo $2 mult $1, $4 TAG238: srav $4, $2, $2 beq $4, $4, TAG239 mtlo $4 slt $4, $2, $2 TAG239: mtlo $4 multu $4, $4 sb $4, 0($4) blez $4, TAG240 TAG240: lh $1, 0($4) bgtz $1, TAG241 sw $4, 0($4) sra $3, $1, 4 TAG241: mfhi $1 and $1, $3, $3 addiu $2, $3, 12 bgtz $1, TAG242 TAG242: lw $4, 0($2) lw $2, 0($2) bne $2, $2, TAG243 sll $0, $0, 0 TAG243: sb $3, 0($3) mtlo $3 blez $3, TAG244 lb $2, 0($3) TAG244: lui $1, 9 xori $3, $2, 10 sh $3, 0($2) slt $4, $2, $1 TAG245: addu $4, $4, $4 lh $1, 0($4) div $1, $4 addiu $3, $4, 10 TAG246: lhu $1, 0($3) mthi $3 lh $1, 0($3) ori $4, $1, 5 TAG247: slti $3, $4, 12 sh $3, -3335($4) slt $3, $3, $4 and $4, $3, $3 TAG248: sllv $1, $4, $4 divu $4, $4 mfhi $3 bgez $1, TAG249 TAG249: multu $3, $3 lbu $3, 0($3) sllv $3, $3, $3 add $1, $3, $3 TAG250: bgtz $1, TAG251 sh $1, 0($1) bne $1, $1, TAG251 sra $2, $1, 7 TAG251: sltu $1, $2, $2 lw $3, 0($1) lw $4, 0($2) sll $2, $4, 14 TAG252: beq $2, $2, TAG253 mthi $2 div $2, $2 divu $2, $2 TAG253: srl $2, $2, 10 multu $2, $2 andi $1, $2, 4 xor $4, $1, $2 TAG254: mtlo $4 beq $4, $4, TAG255 mflo $2 multu $4, $4 TAG255: sltiu $1, $2, 12 beq $2, $2, TAG256 srl $4, $2, 14 lhu $4, 0($4) TAG256: sub $3, $4, $4 mtlo $4 bltz $4, TAG257 addiu $4, $4, 15 TAG257: lui $1, 1 lui $3, 3 slt $2, $4, $4 sll $0, $0, 0 TAG258: mtlo $1 bne $1, $1, TAG259 mult $1, $1 mflo $2 TAG259: bne $2, $2, TAG260 mtlo $2 lb $2, 0($2) mtlo $2 TAG260: mflo $3 bne $3, $2, TAG261 lui $1, 11 lui $3, 5 TAG261: mfhi $2 lui $3, 13 mtlo $3 bne $2, $2, TAG262 TAG262: sll $2, $3, 0 srlv $1, $3, $2 lui $3, 8 mthi $3 TAG263: multu $3, $3 mfhi $1 mfhi $4 mtlo $1 TAG264: sll $2, $4, 1 bgez $2, TAG265 sb $2, 0($2) div $2, $4 TAG265: sh $2, 0($2) multu $2, $2 mflo $3 beq $2, $3, TAG266 TAG266: sb $3, -16384($3) sb $3, -16384($3) bltz $3, TAG267 multu $3, $3 TAG267: sll $0, $0, 0 sra $1, $3, 3 mfhi $3 slti $4, $2, 0 TAG268: lw $3, 0($4) lb $1, 0($4) bne $4, $1, TAG269 ori $2, $1, 5 TAG269: addiu $4, $2, 13 divu $4, $2 multu $2, $2 blez $4, TAG270 TAG270: sb $4, 0($4) sb $4, 0($4) bne $4, $4, TAG271 srav $2, $4, $4 TAG271: sw $2, 0($2) lui $1, 4 mflo $2 addu $4, $2, $1 TAG272: lui $3, 12 sllv $3, $4, $4 or $2, $3, $3 div $4, $2 TAG273: mfhi $3 beq $2, $3, TAG274 xor $2, $2, $2 sll $0, $0, 0 TAG274: sb $2, 0($2) bgtz $2, TAG275 sra $2, $2, 5 slt $2, $2, $2 TAG275: beq $2, $2, TAG276 sltu $4, $2, $2 srav $2, $2, $2 xor $3, $2, $2 TAG276: divu $3, $3 sll $0, $0, 0 beq $3, $3, TAG277 mthi $3 TAG277: sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 slti $1, $3, 12 TAG278: lw $1, 0($1) bne $1, $1, TAG279 mfhi $1 slt $3, $1, $1 TAG279: blez $3, TAG280 sltiu $3, $3, 9 lui $3, 6 sw $3, 0($3) TAG280: multu $3, $3 subu $1, $3, $3 sub $2, $1, $1 div $3, $3 TAG281: lui $3, 2 lh $4, 0($2) sra $1, $4, 13 mflo $4 TAG282: lui $4, 3 bltz $4, TAG283 mthi $4 lui $1, 0 TAG283: sh $1, 0($1) lh $4, 0($1) lui $4, 4 sll $0, $0, 0 TAG284: mthi $4 mult $4, $4 mthi $4 bgtz $4, TAG285 TAG285: sll $0, $0, 0 lui $2, 9 srlv $1, $4, $2 sll $0, $0, 0 TAG286: mtlo $4 bne $4, $4, TAG287 sll $0, $0, 0 sll $0, $0, 0 TAG287: sll $0, $0, 0 sll $0, $0, 0 bne $2, $2, TAG288 lui $2, 0 TAG288: mthi $2 sra $2, $2, 2 slt $2, $2, $2 srlv $2, $2, $2 TAG289: mthi $2 srl $2, $2, 2 xori $3, $2, 7 mult $3, $2 TAG290: addiu $3, $3, 15 bltz $3, TAG291 lui $4, 2 sh $4, 0($3) TAG291: blez $4, TAG292 mtlo $4 bgtz $4, TAG292 sll $0, $0, 0 TAG292: sll $0, $0, 0 ori $4, $1, 8 sll $0, $0, 0 sra $1, $1, 0 TAG293: mfhi $2 sll $0, $0, 0 lui $1, 1 xori $2, $1, 0 TAG294: div $2, $2 mflo $1 sll $0, $0, 0 addiu $1, $1, 12 TAG295: bne $1, $1, TAG296 lb $1, 0($1) lui $2, 2 slti $2, $2, 1 TAG296: lui $4, 0 lhu $1, 0($2) sltu $2, $2, $1 bgez $2, TAG297 TAG297: xori $1, $2, 15 blez $1, TAG298 lui $1, 4 sll $0, $0, 0 TAG298: multu $1, $1 bgtz $1, TAG299 mtlo $1 bne $1, $1, TAG299 TAG299: div $1, $1 sll $0, $0, 0 slt $1, $1, $4 addiu $2, $4, 11 TAG300: sb $2, 0($2) mult $2, $2 blez $2, TAG301 mthi $2 TAG301: sra $3, $2, 12 divu $3, $2 lhu $1, 0($3) subu $4, $2, $2 TAG302: mtlo $4 sra $3, $4, 8 lui $4, 0 mthi $3 TAG303: multu $4, $4 multu $4, $4 bgtz $4, TAG304 mthi $4 TAG304: sh $4, 0($4) lb $4, 0($4) xor $2, $4, $4 beq $4, $4, TAG305 TAG305: lui $2, 10 mflo $3 mflo $2 sub $1, $3, $2 TAG306: andi $4, $1, 8 mtlo $1 slt $2, $1, $4 addiu $2, $1, 5 TAG307: mthi $2 andi $3, $2, 14 div $2, $3 beq $2, $3, TAG308 TAG308: mflo $3 lui $3, 7 bne $3, $3, TAG309 mflo $1 TAG309: mfhi $3 blez $3, TAG310 lui $4, 11 bgez $4, TAG310 TAG310: mfhi $3 lb $3, 0($3) mthi $4 mult $3, $3 TAG311: bltz $3, TAG312 subu $4, $3, $3 multu $4, $4 lui $1, 11 TAG312: bltz $1, TAG313 slt $2, $1, $1 mtlo $1 sll $0, $0, 0 TAG313: bne $2, $2, TAG314 lui $2, 5 bne $2, $2, TAG314 mfhi $3 TAG314: sh $3, 0($3) bltz $3, TAG315 srlv $1, $3, $3 addiu $3, $3, 1 TAG315: lbu $4, 0($3) sb $3, 0($3) lbu $3, 0($3) mult $3, $3 TAG316: sb $3, 0($3) mtlo $3 sb $3, 0($3) mthi $3 TAG317: bne $3, $3, TAG318 srav $3, $3, $3 srl $3, $3, 11 bgtz $3, TAG318 TAG318: ori $1, $3, 15 mtlo $1 ori $1, $1, 1 sltiu $1, $1, 2 TAG319: addu $3, $1, $1 bltz $3, TAG320 mtlo $1 multu $1, $1 TAG320: mflo $3 sltu $2, $3, $3 mthi $3 mfhi $1 TAG321: mtlo $1 lui $2, 14 mthi $1 blez $2, TAG322 TAG322: div $2, $2 sll $0, $0, 0 bne $2, $2, TAG323 xori $4, $2, 13 TAG323: lui $3, 11 multu $4, $4 or $2, $3, $3 mtlo $2 TAG324: lui $4, 1 sll $0, $0, 0 bne $4, $4, TAG325 mfhi $3 TAG325: mfhi $2 srlv $2, $3, $2 bltz $2, TAG326 mflo $4 TAG326: sll $0, $0, 0 bgtz $3, TAG327 sll $0, $0, 0 mflo $4 TAG327: sll $0, $0, 0 lbu $2, -196($3) nor $3, $4, $3 or $2, $4, $3 TAG328: srav $3, $2, $2 mtlo $2 mfhi $4 sw $4, 197($2) TAG329: lui $2, 11 slt $2, $4, $4 lh $3, 0($2) lui $4, 7 TAG330: div $4, $4 sll $0, $0, 0 mthi $4 bltz $4, TAG331 TAG331: sll $0, $0, 0 sll $0, $0, 0 xor $1, $4, $4 lui $1, 12 TAG332: sll $0, $0, 0 multu $1, $1 xor $3, $1, $1 beq $3, $1, TAG333 TAG333: sb $3, 0($3) mthi $3 lbu $3, 0($3) bne $3, $3, TAG334 TAG334: mthi $3 addiu $1, $3, 1 mult $1, $3 sb $1, 0($1) TAG335: bgez $1, TAG336 lbu $1, 0($1) mtlo $1 mflo $1 TAG336: lui $3, 6 mtlo $1 mult $3, $1 lbu $2, 0($1) TAG337: bltz $2, TAG338 lui $2, 8 mfhi $4 lhu $2, 0($4) TAG338: bne $2, $2, TAG339 addu $1, $2, $2 mflo $1 mult $2, $1 TAG339: bne $1, $1, TAG340 mflo $4 xori $1, $4, 11 blez $1, TAG340 TAG340: mflo $3 bgtz $3, TAG341 divu $3, $3 lui $3, 2 TAG341: subu $3, $3, $3 sh $3, 0($3) mthi $3 mthi $3 TAG342: blez $3, TAG343 sltiu $2, $3, 15 srl $2, $2, 15 mflo $4 TAG343: beq $4, $4, TAG344 lui $4, 8 mthi $4 subu $1, $4, $4 TAG344: div $1, $1 bgez $1, TAG345 sll $0, $0, 0 sw $1, 0($1) TAG345: sll $0, $0, 0 addu $3, $1, $1 sll $0, $0, 0 mtlo $1 TAG346: blez $4, TAG347 subu $2, $4, $4 multu $4, $2 beq $2, $2, TAG347 TAG347: sra $4, $2, 10 sw $2, 0($4) mtlo $2 bne $2, $4, TAG348 TAG348: mthi $4 bgtz $4, TAG349 sb $4, 0($4) sllv $4, $4, $4 TAG349: slti $3, $4, 6 mthi $3 mflo $1 bltz $4, TAG350 TAG350: mthi $1 bltz $1, TAG351 lw $1, 0($1) andi $4, $1, 0 TAG351: mtlo $4 mult $4, $4 blez $4, TAG352 sltiu $2, $4, 0 TAG352: lui $3, 0 ori $3, $2, 13 bne $3, $2, TAG353 lui $4, 10 TAG353: multu $4, $4 mflo $1 mthi $1 divu $1, $4 TAG354: multu $1, $1 srlv $2, $1, $1 addu $1, $1, $2 multu $1, $1 TAG355: mult $1, $1 lui $3, 11 mult $3, $1 mflo $3 TAG356: mfhi $1 mflo $4 mtlo $1 and $1, $4, $4 TAG357: sub $3, $1, $1 bne $1, $3, TAG358 xor $3, $3, $3 bne $3, $3, TAG358 TAG358: subu $3, $3, $3 srl $1, $3, 11 beq $3, $1, TAG359 lui $2, 8 TAG359: blez $2, TAG360 lui $4, 0 andi $4, $4, 13 lw $4, 0($4) TAG360: mflo $1 sh $1, 0($1) beq $4, $4, TAG361 mthi $1 TAG361: sub $1, $1, $1 mtlo $1 bgez $1, TAG362 multu $1, $1 TAG362: lui $2, 6 lh $1, 0($1) lb $2, 0($1) multu $2, $1 TAG363: lui $3, 6 mtlo $3 bltz $3, TAG364 sltiu $2, $2, 7 TAG364: addiu $4, $2, 12 lui $3, 14 mtlo $3 mfhi $3 TAG365: sltu $3, $3, $3 mult $3, $3 bne $3, $3, TAG366 lui $2, 4 TAG366: mult $2, $2 bne $2, $2, TAG367 lui $2, 0 mult $2, $2 TAG367: lb $3, 0($2) lbu $3, 0($3) andi $4, $2, 4 bne $2, $4, TAG368 TAG368: sra $2, $4, 4 bne $4, $2, TAG369 lhu $1, 0($2) beq $1, $2, TAG369 TAG369: lbu $4, 0($1) beq $1, $1, TAG370 lui $2, 10 ori $4, $1, 15 TAG370: mthi $4 addu $1, $4, $4 srl $4, $4, 0 mflo $3 TAG371: mfhi $3 blez $3, TAG372 mthi $3 mult $3, $3 TAG372: mfhi $1 beq $1, $1, TAG373 sub $1, $1, $1 nor $3, $3, $3 TAG373: sb $3, 0($3) srlv $1, $3, $3 bltz $1, TAG374 xori $4, $1, 6 TAG374: divu $4, $4 mthi $4 sh $4, 0($4) bltz $4, TAG375 TAG375: lhu $2, 0($4) mthi $4 lui $2, 5 sll $0, $0, 0 TAG376: mfhi $4 mthi $2 mtlo $2 bgtz $4, TAG377 TAG377: addu $4, $4, $4 bgez $4, TAG378 addiu $4, $4, 15 sb $4, 0($4) TAG378: multu $4, $4 lbu $2, 0($4) beq $4, $4, TAG379 lui $4, 2 TAG379: lui $3, 1 sllv $4, $4, $3 divu $4, $3 sll $0, $0, 0 TAG380: sw $1, 0($1) multu $1, $1 mtlo $1 bltz $1, TAG381 TAG381: lw $4, 0($1) lb $1, 0($4) mtlo $1 bne $4, $4, TAG382 TAG382: mtlo $1 lh $2, 0($1) multu $1, $2 mflo $4 TAG383: multu $4, $4 bne $4, $4, TAG384 add $3, $4, $4 sh $4, 0($3) TAG384: mfhi $2 mflo $4 srlv $1, $3, $4 lui $3, 11 TAG385: sll $0, $0, 0 mtlo $3 sll $0, $0, 0 sll $0, $0, 0 TAG386: sll $0, $0, 0 sll $0, $0, 0 bne $1, $1, TAG387 sll $0, $0, 0 TAG387: sh $1, 0($1) bgez $1, TAG388 sb $1, 0($1) bgtz $1, TAG388 TAG388: sra $3, $1, 6 mtlo $3 mthi $1 mtlo $3 TAG389: nor $1, $3, $3 addiu $1, $1, 6 lui $1, 12 lui $4, 15 TAG390: mfhi $3 mult $4, $3 ori $3, $3, 7 mthi $3 TAG391: nor $2, $3, $3 beq $2, $2, TAG392 xor $3, $2, $2 sb $3, 0($3) TAG392: blez $3, TAG393 ori $1, $3, 0 lbu $3, 0($1) sb $3, 0($1) TAG393: beq $3, $3, TAG394 lb $3, 0($3) bltz $3, TAG394 div $3, $3 TAG394: beq $3, $3, TAG395 lui $1, 2 lui $2, 9 mflo $4 TAG395: lui $3, 1 div $3, $4 or $3, $3, $3 lui $2, 15 TAG396: bne $2, $2, TAG397 sll $0, $0, 0 lui $1, 8 lui $3, 11 TAG397: addiu $1, $3, 15 mflo $2 sll $0, $0, 0 lui $1, 1 TAG398: divu $1, $1 mtlo $1 mfhi $3 addiu $4, $1, 14 TAG399: mtlo $4 bgtz $4, TAG400 mfhi $4 div $4, $4 TAG400: slt $3, $4, $4 bne $3, $3, TAG401 mtlo $3 mflo $3 TAG401: or $1, $3, $3 lui $4, 15 lui $2, 4 blez $3, TAG402 TAG402: lui $3, 15 lui $1, 5 multu $2, $2 srlv $4, $3, $2 TAG403: beq $4, $4, TAG404 div $4, $4 bgtz $4, TAG404 divu $4, $4 TAG404: sll $0, $0, 0 addiu $1, $4, 3 addu $1, $4, $4 slti $3, $1, 11 TAG405: bltz $3, TAG406 sllv $4, $3, $3 sw $3, 0($4) lui $2, 0 TAG406: mult $2, $2 mflo $1 sh $1, 0($2) sb $2, 0($1) TAG407: lui $4, 13 bgtz $4, TAG408 sw $4, 0($1) sltu $1, $4, $1 TAG408: xor $1, $1, $1 mult $1, $1 lui $1, 4 bgez $1, TAG409 TAG409: addiu $2, $1, 5 bltz $2, TAG410 div $2, $1 sll $0, $0, 0 TAG410: sll $0, $0, 0 mfhi $3 beq $2, $2, TAG411 multu $3, $2 TAG411: mthi $3 mfhi $3 multu $3, $3 addu $2, $3, $3 TAG412: blez $2, TAG413 sb $2, 0($2) andi $4, $2, 3 sh $2, 0($2) TAG413: slt $2, $4, $4 lb $3, 0($2) sra $3, $4, 6 beq $2, $3, TAG414 TAG414: lhu $3, 0($3) lb $4, 0($3) sh $3, 0($4) lb $1, 0($3) TAG415: sh $1, 0($1) sb $1, 0($1) sb $1, 0($1) mflo $2 TAG416: bgez $2, TAG417 mfhi $4 bgez $4, TAG417 mfhi $2 TAG417: lui $4, 0 mult $4, $4 lbu $3, 0($2) lui $1, 14 TAG418: bgtz $1, TAG419 lui $4, 13 xori $4, $4, 14 addu $2, $1, $4 TAG419: div $2, $2 mflo $1 blez $2, TAG420 mfhi $4 TAG420: lui $1, 2 lui $1, 13 bltz $4, TAG421 or $2, $1, $1 TAG421: sltu $2, $2, $2 addiu $2, $2, 13 beq $2, $2, TAG422 lb $1, 0($2) TAG422: bne $1, $1, TAG423 sb $1, 0($1) div $1, $1 blez $1, TAG423 TAG423: ori $1, $1, 2 lui $1, 5 xori $3, $1, 4 blez $1, TAG424 TAG424: mtlo $3 mfhi $3 mtlo $3 bgtz $3, TAG425 TAG425: sub $4, $3, $3 mflo $2 lh $4, 0($3) lhu $1, 0($2) TAG426: addiu $4, $1, 0 mthi $1 subu $2, $1, $4 multu $4, $1 TAG427: mult $2, $2 mtlo $2 mthi $2 mtlo $2 TAG428: addiu $3, $2, 1 lb $1, 0($3) multu $2, $2 mtlo $1 TAG429: lui $2, 6 addu $4, $2, $2 mult $2, $2 div $1, $4 TAG430: nor $1, $4, $4 divu $1, $4 sltu $2, $1, $1 mthi $1 TAG431: slt $4, $2, $2 lui $1, 1 bne $2, $4, TAG432 slt $3, $2, $2 TAG432: mflo $2 srl $1, $2, 10 srlv $1, $1, $3 sb $1, 0($1) TAG433: lui $2, 2 sra $4, $1, 0 lui $3, 15 mtlo $1 TAG434: sll $0, $0, 0 sll $0, $0, 0 mtlo $2 blez $3, TAG435 TAG435: mthi $2 mfhi $4 mfhi $3 sll $0, $0, 0 TAG436: nor $3, $3, $3 mtlo $3 lui $1, 3 sllv $3, $3, $3 TAG437: sll $0, $0, 0 mfhi $3 bne $3, $3, TAG438 sra $1, $3, 1 TAG438: sll $0, $0, 0 xori $4, $1, 11 beq $1, $4, TAG439 srlv $3, $4, $1 TAG439: sll $0, $0, 0 ori $2, $3, 3 mthi $3 beq $3, $3, TAG440 TAG440: lui $3, 2 sll $0, $0, 0 mthi $2 blez $2, TAG441 TAG441: xor $2, $2, $2 sh $2, 0($2) lbu $4, 0($2) slt $1, $4, $2 TAG442: bgez $1, TAG443 mfhi $2 bgez $1, TAG443 lhu $4, 0($1) TAG443: andi $3, $4, 8 mfhi $3 lui $1, 15 divu $3, $1 TAG444: addiu $4, $1, 2 sll $4, $1, 3 andi $2, $4, 10 bltz $1, TAG445 TAG445: addu $4, $2, $2 mtlo $4 lb $2, 0($2) mfhi $2 TAG446: srl $1, $2, 9 lui $3, 7 sltu $4, $1, $2 lbu $3, 0($4) TAG447: beq $3, $3, TAG448 lw $4, 0($3) mult $3, $3 lui $3, 10 TAG448: mflo $4 bne $4, $3, TAG449 mflo $3 mflo $1 TAG449: sltiu $2, $1, 6 mflo $4 slti $2, $2, 11 sh $2, 0($1) TAG450: sra $4, $2, 9 sb $4, 0($2) sh $4, 0($4) lui $2, 5 TAG451: beq $2, $2, TAG452 mtlo $2 srl $4, $2, 2 divu $4, $2 TAG452: sra $3, $4, 7 lbu $4, 0($4) mtlo $3 mfhi $4 TAG453: bgtz $4, TAG454 sll $0, $0, 0 divu $4, $4 lui $4, 8 TAG454: bne $4, $4, TAG455 mflo $1 mthi $1 beq $1, $1, TAG455 TAG455: sw $1, 0($1) sh $1, 0($1) lbu $1, 0($1) multu $1, $1 TAG456: mtlo $1 mfhi $1 slti $1, $1, 10 multu $1, $1 TAG457: divu $1, $1 lui $4, 5 sb $1, 0($1) lui $4, 11 TAG458: lui $1, 8 mthi $4 slt $1, $1, $1 bgtz $1, TAG459 TAG459: mthi $1 mthi $1 lh $3, 0($1) lui $4, 15 TAG460: sll $0, $0, 0 lui $1, 14 bne $1, $4, TAG461 mfhi $2 TAG461: sh $2, 0($2) lhu $2, 0($2) sltiu $3, $2, 8 slt $1, $2, $3 TAG462: mtlo $1 lui $1, 6 lui $1, 13 mthi $1 TAG463: mfhi $1 mflo $1 lbu $2, 0($1) mfhi $4 TAG464: sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 TAG465: lb $4, 0($1) sh $1, 0($4) lbu $4, 0($1) lb $4, 0($1) TAG466: sll $3, $4, 14 mthi $4 bne $3, $4, TAG467 mult $3, $3 TAG467: mflo $3 sllv $1, $3, $3 mtlo $1 mtlo $3 TAG468: bgtz $1, TAG469 multu $1, $1 sw $1, 0($1) addi $3, $1, 5 TAG469: lb $3, 0($3) subu $2, $3, $3 mult $3, $3 mtlo $3 TAG470: sb $2, 0($2) beq $2, $2, TAG471 sub $1, $2, $2 mfhi $1 TAG471: beq $1, $1, TAG472 sb $1, 0($1) sw $1, 0($1) mfhi $3 TAG472: beq $3, $3, TAG473 lui $2, 12 bne $3, $3, TAG473 mult $3, $2 TAG473: sll $0, $0, 0 sltiu $1, $2, 12 andi $1, $1, 8 multu $1, $1 TAG474: slt $2, $1, $1 lhu $4, 0($1) mtlo $2 lbu $3, 0($4) TAG475: xori $3, $3, 3 mthi $3 multu $3, $3 lui $2, 12 TAG476: and $2, $2, $2 bgtz $2, TAG477 mult $2, $2 lui $1, 3 TAG477: sb $1, 0($1) bltz $1, TAG478 sll $1, $1, 9 srlv $3, $1, $1 TAG478: lb $3, 0($3) subu $4, $3, $3 bne $4, $3, TAG479 mult $4, $4 TAG479: lui $2, 9 andi $1, $2, 10 sw $4, 0($1) bgtz $4, TAG480 TAG480: addiu $1, $1, 13 mthi $1 addu $2, $1, $1 lui $3, 9 TAG481: andi $2, $3, 10 mfhi $4 div $2, $3 srav $1, $4, $2 TAG482: bgez $1, TAG483 div $1, $1 sb $1, 0($1) beq $1, $1, TAG483 TAG483: sb $1, 0($1) beq $1, $1, TAG484 sb $1, 0($1) addi $1, $1, 1 TAG484: lbu $1, 0($1) bne $1, $1, TAG485 subu $1, $1, $1 beq $1, $1, TAG485 TAG485: sh $1, 0($1) lui $3, 7 lui $1, 11 sll $0, $0, 0 TAG486: bne $4, $4, TAG487 mfhi $3 bltz $3, TAG487 lb $1, 0($4) TAG487: lbu $1, 0($1) mthi $1 mfhi $4 mflo $2 TAG488: lb $2, 0($2) sll $2, $2, 15 bgez $2, TAG489 multu $2, $2 TAG489: srl $1, $2, 0 srlv $2, $1, $1 lb $3, 0($2) multu $2, $2 TAG490: mflo $1 bltz $3, TAG491 mflo $3 bgez $1, TAG491 TAG491: mthi $3 sh $3, 0($3) mult $3, $3 sh $3, 0($3) TAG492: mult $3, $3 sltu $3, $3, $3 bgtz $3, TAG493 nor $2, $3, $3 TAG493: div $2, $2 lhu $4, 1($2) lui $1, 3 bltz $2, TAG494 TAG494: sll $0, $0, 0 divu $1, $1 divu $1, $1 bgtz $1, TAG495 TAG495: srl $4, $1, 6 srlv $2, $4, $1 divu $2, $4 mtlo $4 TAG496: lui $1, 0 sb $2, -3072($2) mflo $4 lbu $1, -3072($4) TAG497: ori $1, $1, 13 xor $2, $1, $1 blez $1, TAG498 lb $3, 0($1) TAG498: lbu $4, 0($3) beq $3, $4, TAG499 ori $2, $3, 10 sb $3, 0($4) TAG499: and $4, $2, $2 bltz $4, TAG500 andi $2, $2, 2 or $2, $2, $4 TAG500: srl $1, $2, 0 slt $4, $1, $1 xori $3, $1, 15 mfhi $4 TAG501: mtlo $4 lw $2, 0($4) blez $4, TAG502 lb $3, 0($2) TAG502: mflo $2 lui $1, 3 mtlo $1 sw $2, 0($3) TAG503: bne $1, $1, TAG504 sll $0, $0, 0 bne $3, $3, TAG504 mfhi $4 TAG504: sltiu $1, $4, 1 mtlo $4 beq $4, $4, TAG505 sh $4, 0($4) TAG505: mthi $1 lui $2, 4 lui $2, 0 slti $4, $1, 4 TAG506: blez $4, TAG507 mfhi $3 sb $3, 0($4) lb $2, 0($4) TAG507: mtlo $2 mflo $2 sb $2, 0($2) or $3, $2, $2 TAG508: lui $3, 2 sra $3, $3, 6 blez $3, TAG509 sw $3, -2048($3) TAG509: mthi $3 beq $3, $3, TAG510 lh $3, -2048($3) mflo $2 TAG510: addu $4, $2, $2 beq $4, $4, TAG511 divu $2, $4 mthi $4 TAG511: sh $4, 0($4) mthi $4 lhu $3, 0($4) divu $3, $4 TAG512: lui $3, 10 multu $3, $3 mflo $3 lui $3, 5 TAG513: mtlo $3 addiu $4, $3, 7 lui $2, 12 sll $0, $0, 0 TAG514: sll $0, $0, 0 lui $2, 3 mult $2, $2 mthi $2 TAG515: mthi $2 lui $4, 11 nor $3, $2, $2 mthi $2 TAG516: addiu $3, $3, 8 divu $3, $3 bgtz $3, TAG517 sll $0, $0, 0 TAG517: divu $3, $3 bne $3, $3, TAG518 subu $3, $3, $3 mtlo $3 TAG518: mtlo $3 lb $2, 0($3) slt $3, $2, $3 multu $3, $3 TAG519: bltz $3, TAG520 lui $4, 14 mflo $2 lw $2, 0($3) TAG520: mflo $1 addiu $4, $1, 13 divu $1, $4 sll $0, $0, 0 TAG521: mfhi $1 blez $1, TAG522 mtlo $1 bne $1, $1, TAG522 TAG522: mfhi $3 beq $1, $1, TAG523 sllv $3, $3, $3 sb $1, 0($1) TAG523: mflo $3 addiu $4, $3, 6 sb $3, 0($4) sb $3, 0($4) TAG524: bltz $4, TAG525 mthi $4 sb $4, 0($4) mthi $4 TAG525: sb $4, 0($4) divu $4, $4 lui $2, 11 lui $1, 7 TAG526: sll $0, $0, 0 sll $0, $0, 0 mflo $3 mflo $4 TAG527: sb $4, 0($4) sb $4, 0($4) mthi $4 div $4, $4 TAG528: mtlo $4 bgtz $4, TAG529 mflo $3 bltz $4, TAG529 TAG529: sb $3, 0($3) lui $1, 13 sll $0, $0, 0 lui $4, 1 TAG530: sll $0, $0, 0 lui $3, 8 sll $3, $4, 8 beq $3, $3, TAG531 TAG531: slt $4, $3, $3 lw $2, 0($4) bne $4, $3, TAG532 multu $2, $4 TAG532: lui $3, 12 mflo $2 nor $4, $3, $3 mthi $2 TAG533: sll $0, $0, 0 bgtz $4, TAG534 sll $0, $0, 0 xori $4, $4, 11 TAG534: mflo $1 lui $1, 3 bne $4, $1, TAG535 sll $0, $0, 0 TAG535: beq $4, $4, TAG536 sll $0, $0, 0 slti $2, $4, 11 lh $3, 0($2) TAG536: lui $3, 5 mfhi $4 addu $1, $3, $4 lui $4, 4 TAG537: sll $0, $0, 0 multu $4, $4 mflo $1 sll $0, $0, 0 TAG538: lui $2, 5 bne $1, $2, TAG539 sh $2, 0($1) slti $1, $2, 8 TAG539: blez $1, TAG540 multu $1, $1 lhu $3, 0($1) sltu $1, $1, $3 TAG540: bgtz $1, TAG541 ori $3, $1, 10 mfhi $2 divu $1, $3 TAG541: sh $2, 0($2) lui $3, 14 divu $3, $3 divu $3, $3 TAG542: lui $4, 5 lui $1, 5 beq $1, $4, TAG543 sll $4, $4, 12 TAG543: nor $2, $4, $4 xor $1, $2, $2 lui $2, 3 div $2, $2 TAG544: sll $0, $0, 0 bne $2, $3, TAG545 mflo $2 mtlo $2 TAG545: mtlo $2 mult $2, $2 lui $2, 11 sll $0, $0, 0 TAG546: sra $1, $1, 3 multu $1, $1 lh $4, 0($1) beq $4, $1, TAG547 TAG547: lbu $4, 0($4) bne $4, $4, TAG548 sll $2, $4, 12 mfhi $2 TAG548: lui $1, 8 divu $1, $1 sll $0, $0, 0 nor $3, $1, $2 TAG549: sllv $4, $3, $3 bne $3, $3, TAG550 addiu $4, $4, 2 mfhi $3 TAG550: mflo $1 bgtz $3, TAG551 ori $3, $3, 0 lui $2, 5 TAG551: sll $0, $0, 0 bgez $4, TAG552 mthi $4 div $4, $2 TAG552: and $4, $4, $4 lui $2, 1 or $2, $2, $4 addiu $2, $2, 14 TAG553: xori $4, $2, 9 beq $4, $4, TAG554 lui $3, 8 lui $3, 13 TAG554: beq $3, $3, TAG555 sll $0, $0, 0 bgtz $3, TAG555 sw $3, 0($3) TAG555: sll $0, $0, 0 mtlo $3 addu $3, $3, $3 mult $3, $3 TAG556: mflo $1 lui $1, 5 sll $0, $0, 0 sll $0, $0, 0 TAG557: bgtz $2, TAG558 xor $1, $2, $2 mult $2, $1 blez $2, TAG558 TAG558: mult $1, $1 lui $3, 11 lh $4, 0($1) sll $0, $0, 0 TAG559: ori $3, $4, 6 bgtz $4, TAG560 mthi $4 mult $4, $4 TAG560: slti $3, $3, 13 lui $4, 14 slti $1, $3, 6 divu $4, $3 TAG561: slti $3, $1, 11 lui $1, 6 sllv $3, $3, $1 sll $0, $0, 0 TAG562: div $1, $1 lui $4, 14 nor $4, $1, $4 divu $4, $4 TAG563: mthi $4 sll $0, $0, 0 mflo $3 mfhi $3 TAG564: bne $3, $3, TAG565 mfhi $4 srav $3, $3, $4 bltz $3, TAG565 TAG565: mfhi $1 bgez $3, TAG566 mfhi $4 lui $3, 14 TAG566: sll $0, $0, 0 mtlo $3 bne $3, $3, TAG567 sll $0, $0, 0 TAG567: and $4, $1, $1 mflo $2 addu $4, $4, $4 lui $4, 15 TAG568: blez $4, TAG569 lui $3, 5 mfhi $1 bgtz $1, TAG569 TAG569: lui $3, 4 lui $1, 15 mthi $3 blez $1, TAG570 TAG570: lui $2, 8 srav $2, $2, $1 mtlo $2 subu $4, $2, $2 TAG571: or $3, $4, $4 lui $4, 3 sll $0, $0, 0 bgez $4, TAG572 TAG572: multu $2, $2 sll $0, $0, 0 sll $0, $0, 0 lui $3, 0 TAG573: mtlo $3 addu $1, $3, $3 multu $1, $3 sb $1, 0($3) TAG574: slt $4, $1, $1 mflo $2 lh $1, 0($2) bltz $2, TAG575 TAG575: sb $1, 0($1) mult $1, $1 or $2, $1, $1 beq $2, $2, TAG576 TAG576: lhu $2, 0($2) srl $1, $2, 14 bne $2, $2, TAG577 sra $4, $1, 15 TAG577: sltu $3, $4, $4 mfhi $3 lbu $4, 0($3) mult $4, $3 TAG578: mtlo $4 sb $4, 0($4) mtlo $4 lui $4, 0 TAG579: lui $4, 14 sll $0, $0, 0 sll $0, $0, 0 mult $4, $2 TAG580: nor $1, $2, $2 mflo $1 sb $1, 0($1) mtlo $1 TAG581: mtlo $1 sw $1, 0($1) and $3, $1, $1 sra $3, $1, 5 TAG582: mult $3, $3 slti $3, $3, 3 sb $3, 0($3) divu $3, $3 TAG583: lui $1, 2 mthi $3 mtlo $3 lb $3, 0($3) TAG584: sra $4, $3, 1 mult $4, $3 div $3, $3 beq $4, $3, TAG585 TAG585: lui $2, 1 sra $3, $4, 10 sh $4, 0($4) bltz $3, TAG586 TAG586: mthi $3 slti $3, $3, 11 sb $3, 0($3) mflo $3 TAG587: mthi $3 sb $3, 0($3) divu $3, $3 lbu $1, 0($3) TAG588: srlv $3, $1, $1 beq $1, $1, TAG589 mthi $1 bgez $1, TAG589 TAG589: sh $3, 0($3) lui $1, 8 blez $1, TAG590 addiu $3, $1, 13 TAG590: div $3, $3 bne $3, $3, TAG591 mfhi $2 blez $3, TAG591 TAG591: mtlo $2 lb $3, 0($2) sltiu $1, $3, 1 beq $2, $2, TAG592 TAG592: lbu $3, 0($1) lh $4, 0($3) sh $1, 0($4) lui $3, 6 TAG593: bgez $3, TAG594 xor $3, $3, $3 lui $1, 8 mthi $1 TAG594: lb $2, 0($1) mflo $1 beq $1, $2, TAG595 sltu $4, $1, $1 TAG595: addu $4, $4, $4 bgez $4, TAG596 multu $4, $4 mfhi $2 TAG596: lbu $1, 0($2) xori $1, $2, 5 beq $2, $2, TAG597 sb $1, 0($1) TAG597: bne $1, $1, TAG598 lui $2, 7 beq $1, $2, TAG598 mflo $3 TAG598: mtlo $3 andi $4, $3, 5 lbu $4, 0($4) mflo $4 TAG599: lbu $3, 0($4) bgez $3, TAG600 sb $3, 0($3) divu $3, $3 TAG600: divu $3, $3 addiu $3, $3, 7 beq $3, $3, TAG601 andi $3, $3, 9 TAG601: beq $3, $3, TAG602 srl $1, $3, 4 srav $4, $3, $3 bne $3, $4, TAG602 TAG602: sb $4, 0($4) sw $4, 0($4) sltu $2, $4, $4 andi $4, $2, 10 TAG603: addiu $4, $4, 6 addu $1, $4, $4 bltz $4, TAG604 lui $1, 13 TAG604: mtlo $1 sltu $1, $1, $1 mflo $2 mfhi $3 TAG605: sw $3, 0($3) lh $3, 0($3) sh $3, 0($3) mult $3, $3 TAG606: beq $3, $3, TAG607 mtlo $3 ori $1, $3, 12 beq $1, $1, TAG607 TAG607: mthi $1 lui $4, 7 sll $0, $0, 0 lui $2, 8 TAG608: mflo $2 sh $2, 0($2) mult $2, $2 add $3, $2, $2 TAG609: mult $3, $3 bgez $3, TAG610 lb $3, 0($3) div $3, $3 TAG610: mtlo $3 bne $3, $3, TAG611 mtlo $3 mfhi $2 TAG611: andi $2, $2, 11 lui $3, 5 bne $2, $3, TAG612 mthi $3 TAG612: mthi $3 addiu $3, $3, 13 mflo $3 blez $3, TAG613 TAG613: lw $4, 0($3) sltiu $4, $3, 3 bgez $4, TAG614 sb $4, 0($4) TAG614: mtlo $4 sllv $3, $4, $4 lui $4, 3 bne $4, $4, TAG615 TAG615: addiu $1, $4, 9 sll $0, $0, 0 mtlo $4 sltiu $1, $1, 0 TAG616: subu $2, $1, $1 sltiu $3, $1, 7 sb $2, 0($3) blez $2, TAG617 TAG617: mflo $1 mflo $4 bgtz $3, TAG618 xori $3, $1, 14 TAG618: blez $3, TAG619 mtlo $3 mult $3, $3 sll $0, $0, 0 TAG619: mfhi $4 sll $0, $0, 0 mflo $4 bne $4, $4, TAG620 TAG620: lui $1, 7 beq $1, $4, TAG621 multu $1, $1 and $2, $4, $4 TAG621: mthi $2 sll $0, $0, 0 mthi $2 beq $2, $2, TAG622 TAG622: mult $2, $2 addiu $1, $2, 1 sll $0, $0, 0 sll $0, $0, 0 TAG623: divu $1, $1 bgez $1, TAG624 div $1, $1 mthi $1 TAG624: sll $0, $0, 0 bne $1, $1, TAG625 mult $1, $1 sll $0, $0, 0 TAG625: sll $0, $0, 0 addu $4, $4, $4 mthi $2 mflo $2 TAG626: srlv $1, $2, $2 lui $4, 13 divu $1, $1 mflo $4 TAG627: bgtz $4, TAG628 sb $4, 0($4) bgtz $4, TAG628 mthi $4 TAG628: mtlo $4 mflo $4 sb $4, 0($4) lui $4, 5 TAG629: sll $0, $0, 0 beq $4, $4, TAG630 mthi $4 sb $4, 0($4) TAG630: mtlo $4 sll $0, $0, 0 mthi $4 sll $0, $0, 0 TAG631: div $3, $3 bne $3, $3, TAG632 multu $3, $3 beq $3, $3, TAG632 TAG632: divu $3, $3 beq $3, $3, TAG633 lui $1, 8 lui $1, 11 TAG633: sll $0, $0, 0 mfhi $2 mult $2, $2 mfhi $4 TAG634: sb $4, 0($4) subu $2, $4, $4 sw $4, 0($4) lui $1, 2 TAG635: multu $1, $1 and $4, $1, $1 lui $4, 9 mthi $1 TAG636: mthi $4 beq $4, $4, TAG637 lui $4, 1 lui $3, 10 TAG637: mthi $3 lui $1, 4 mflo $1 bne $3, $1, TAG638 TAG638: mult $1, $1 blez $1, TAG639 multu $1, $1 lui $2, 4 TAG639: mult $2, $2 sb $2, 0($2) sub $3, $2, $2 mtlo $3 TAG640: srl $1, $3, 2 lui $3, 5 sw $3, 0($1) nor $4, $3, $1 TAG641: mfhi $2 mflo $3 bgez $4, TAG642 lbu $3, 0($2) TAG642: lb $2, 0($3) mult $2, $3 multu $3, $2 bne $2, $3, TAG643 TAG643: sh $2, 0($2) lhu $4, 0($2) mflo $2 bne $2, $4, TAG644 TAG644: slti $1, $2, 10 lui $1, 5 mthi $2 addu $4, $2, $2 TAG645: lui $2, 2 addu $4, $2, $4 beq $4, $4, TAG646 mflo $2 TAG646: or $3, $2, $2 mult $2, $3 sh $3, 0($2) sh $3, 0($3) TAG647: bgez $3, TAG648 multu $3, $3 mflo $4 lui $2, 9 TAG648: lb $2, 0($2) mult $2, $2 lui $2, 6 mflo $1 TAG649: sh $1, 0($1) multu $1, $1 mtlo $1 sw $1, 0($1) TAG650: srav $3, $1, $1 sh $1, 0($3) bne $3, $3, TAG651 mult $3, $1 TAG651: lh $3, 0($3) multu $3, $3 bgtz $3, TAG652 lbu $2, 0($3) TAG652: lui $1, 5 blez $2, TAG653 multu $2, $2 ori $4, $2, 3 TAG653: blez $4, TAG654 mult $4, $4 mult $4, $4 nor $3, $4, $4 TAG654: mthi $3 sll $0, $0, 0 mult $3, $2 lui $3, 11 TAG655: sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 TAG656: bne $4, $4, TAG657 sll $0, $0, 0 bne $2, $2, TAG657 multu $4, $2 TAG657: slti $4, $2, 14 lb $3, 0($4) mfhi $2 lui $2, 6 TAG658: beq $2, $2, TAG659 sll $0, $0, 0 mfhi $1 sb $1, 0($1) TAG659: mflo $1 slti $2, $1, 10 sb $1, 0($2) sll $1, $1, 15 TAG660: lui $1, 6 slti $3, $1, 13 sb $1, 0($3) sb $3, 0($3) TAG661: sra $2, $3, 3 addiu $2, $3, 11 blez $2, TAG662 slt $4, $3, $2 TAG662: lbu $4, 0($4) blez $4, TAG663 or $2, $4, $4 beq $4, $4, TAG663 TAG663: xori $1, $2, 8 srav $4, $1, $1 or $2, $1, $4 xori $3, $4, 11 TAG664: mtlo $3 addu $1, $3, $3 mflo $1 sltu $3, $1, $3 TAG665: mflo $1 mtlo $3 lb $4, 0($3) beq $4, $1, TAG666 TAG666: mfhi $4 multu $4, $4 lw $3, 0($4) bgez $3, TAG667 TAG667: sh $3, 0($3) mflo $2 sb $3, 0($2) mult $3, $2 TAG668: subu $3, $2, $2 multu $2, $3 sra $2, $3, 14 mfhi $1 TAG669: mult $1, $1 lui $3, 8 lui $3, 6 bne $3, $3, TAG670 TAG670: mtlo $3 beq $3, $3, TAG671 addiu $3, $3, 4 mfhi $2 TAG671: mtlo $2 blez $2, TAG672 lui $3, 4 mult $2, $3 TAG672: addu $4, $3, $3 mflo $4 addiu $3, $4, 4 beq $4, $3, TAG673 TAG673: lw $2, 0($3) sll $0, $0, 0 mult $4, $2 and $4, $4, $2 TAG674: mfhi $4 mfhi $1 mthi $4 sb $4, 0($4) TAG675: addu $1, $1, $1 andi $4, $1, 15 lui $4, 9 sll $0, $0, 0 TAG676: lbu $1, 0($3) divu $3, $3 bltz $3, TAG677 lbu $4, 0($3) TAG677: bgez $4, TAG678 lui $3, 15 xor $3, $4, $4 beq $3, $3, TAG678 TAG678: sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 bgez $3, TAG679 TAG679: addu $1, $1, $1 bne $1, $1, TAG680 mtlo $1 lui $4, 9 TAG680: srl $2, $4, 4 and $3, $4, $2 mfhi $1 mult $2, $2 TAG681: lhu $2, 0($1) blez $1, TAG682 lui $2, 0 xor $2, $1, $2 TAG682: sw $2, 0($2) lui $2, 10 slti $2, $2, 2 sw $2, 0($2) TAG683: lui $2, 2 lui $2, 5 mfhi $4 sll $0, $0, 0 TAG684: mtlo $4 mflo $4 lhu $3, 0($4) add $3, $3, $4 TAG685: mtlo $3 or $2, $3, $3 mfhi $2 mthi $2 TAG686: beq $2, $2, TAG687 mtlo $2 mfhi $3 lb $4, 0($3) TAG687: slti $2, $4, 8 beq $2, $2, TAG688 sb $2, 0($2) lui $4, 4 TAG688: mult $4, $4 sll $4, $4, 13 lui $2, 13 sltiu $3, $4, 10 TAG689: bne $3, $3, TAG690 lui $2, 11 slt $2, $2, $2 multu $3, $2 TAG690: mtlo $2 sltiu $1, $2, 2 lui $2, 4 bne $1, $2, TAG691 TAG691: mfhi $3 bgez $3, TAG692 subu $4, $3, $2 blez $4, TAG692 TAG692: mfhi $4 sb $4, 0($4) mult $4, $4 blez $4, TAG693 TAG693: lbu $4, 0($4) addu $4, $4, $4 mult $4, $4 lui $3, 5 TAG694: addu $4, $3, $3 mflo $4 lhu $4, 0($4) mfhi $2 TAG695: mfhi $4 slti $1, $2, 12 lb $2, 0($1) bltz $1, TAG696 TAG696: div $2, $2 lui $3, 12 bltz $3, TAG697 sll $0, $0, 0 TAG697: or $3, $3, $3 sll $0, $0, 0 sllv $1, $4, $4 sb $1, 0($4) TAG698: beq $1, $1, TAG699 lui $2, 8 blez $2, TAG699 addiu $2, $2, 4 TAG699: sll $0, $0, 0 bltz $2, TAG700 lui $3, 11 mtlo $3 TAG700: mthi $3 srav $3, $3, $3 lui $3, 3 mflo $2 TAG701: bgtz $2, TAG702 mfhi $1 mfhi $4 bne $1, $4, TAG702 TAG702: addu $4, $4, $4 sltiu $4, $4, 5 mthi $4 divu $4, $4 TAG703: addiu $4, $4, 12 addu $4, $4, $4 lhu $1, 0($4) lbu $3, 0($4) TAG704: lui $4, 15 addiu $1, $4, 7 lui $4, 6 bgez $1, TAG705 TAG705: srlv $1, $4, $4 bltz $4, TAG706 sll $0, $0, 0 sltu $4, $4, $1 TAG706: mflo $2 sltu $1, $2, $2 nor $2, $1, $1 and $3, $2, $2 TAG707: sh $3, 1($3) lw $4, 1($3) lui $4, 1 mflo $4 TAG708: mfhi $3 srl $1, $3, 10 lbu $4, 0($1) lh $1, -255($4) TAG709: lui $2, 1 multu $1, $2 bltz $1, TAG710 mtlo $2 TAG710: sra $1, $2, 4 or $3, $1, $2 bltz $1, TAG711 sll $0, $0, 0 TAG711: beq $3, $3, TAG712 lui $1, 1 sb $3, 0($1) and $2, $3, $3 TAG712: blez $2, TAG713 mthi $2 mflo $4 sll $0, $0, 0 TAG713: mthi $4 bne $4, $4, TAG714 mtlo $4 mflo $4 TAG714: mult $4, $4 mult $4, $4 lui $3, 7 lui $3, 5 TAG715: or $2, $3, $3 sll $0, $0, 0 mflo $1 lb $2, 0($1) TAG716: sll $0, $0, 0 mtlo $1 sra $1, $2, 2 lui $3, 8 TAG717: bltz $3, TAG718 srav $1, $3, $3 mflo $4 sll $0, $0, 0 TAG718: srl $1, $4, 13 addu $1, $1, $4 lui $2, 7 mfhi $2 TAG719: srl $2, $2, 11 lui $4, 15 addu $2, $2, $2 bne $2, $2, TAG720 TAG720: xor $4, $2, $2 bne $2, $2, TAG721 mflo $1 lw $2, 0($2) TAG721: bltz $2, TAG722 multu $2, $2 mthi $2 andi $4, $2, 4 TAG722: lui $3, 8 lui $1, 1 lui $3, 11 slti $4, $3, 1 TAG723: sw $4, 0($4) sw $4, 0($4) mthi $4 mthi $4 TAG724: sh $4, 0($4) srl $2, $4, 15 beq $4, $4, TAG725 multu $2, $4 TAG725: sll $2, $2, 10 lui $2, 10 ori $2, $2, 11 sltu $3, $2, $2 TAG726: mtlo $3 addi $4, $3, 13 beq $4, $4, TAG727 mfhi $4 TAG727: lui $4, 6 mfhi $2 multu $2, $2 mflo $2 TAG728: lui $4, 6 multu $2, $2 mfhi $3 lui $3, 10 TAG729: srav $1, $3, $3 addu $4, $3, $3 sll $0, $0, 0 mflo $2 TAG730: sub $3, $2, $2 sltiu $3, $2, 11 lhu $2, 0($2) beq $2, $2, TAG731 TAG731: mtlo $2 mult $2, $2 sb $2, 0($2) sh $2, 0($2) TAG732: mfhi $3 mtlo $3 mult $2, $2 mtlo $2 TAG733: mflo $4 mfhi $2 beq $4, $3, TAG734 multu $3, $4 TAG734: subu $2, $2, $2 multu $2, $2 lui $3, 7 mflo $4 TAG735: mflo $3 lui $2, 15 slt $3, $4, $3 mult $3, $4 TAG736: mflo $1 mtlo $3 mtlo $1 lh $3, 0($3) TAG737: sh $3, 0($3) mthi $3 lui $1, 7 subu $4, $3, $1 TAG738: xor $4, $4, $4 sh $4, 0($4) beq $4, $4, TAG739 mthi $4 TAG739: lui $1, 13 sllv $4, $1, $4 lui $1, 12 mfhi $3 TAG740: nor $1, $3, $3 sw $1, 1($1) slti $1, $1, 9 mflo $4 TAG741: and $4, $4, $4 beq $4, $4, TAG742 lui $2, 0 lb $1, 0($2) TAG742: div $1, $1 beq $1, $1, TAG743 div $1, $1 mtlo $1 TAG743: mfhi $4 mfhi $1 sh $1, 0($1) xori $1, $1, 15 TAG744: mthi $1 sb $1, 0($1) blez $1, TAG745 mflo $3 TAG745: sb $3, 0($3) bne $3, $3, TAG746 sllv $4, $3, $3 mfhi $2 TAG746: srlv $3, $2, $2 multu $2, $3 addi $2, $3, 3 andi $4, $3, 2 TAG747: sb $4, 0($4) mtlo $4 sh $4, 0($4) slt $3, $4, $4 TAG748: mult $3, $3 mtlo $3 mult $3, $3 xor $3, $3, $3 TAG749: sb $3, 0($3) bltz $3, TAG750 sb $3, 0($3) mtlo $3 TAG750: nop nop test_end: beq $0, $0, test_end nop
12.905566
22
0.500766
4ae5c311ebea2507de6592a7b3d338b2859c482e
4,937
asm
Assembly
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_190_1978.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_190_1978.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_190_1978.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 %r14 push %r15 push %r8 push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0xcc1a, %r8 clflush (%r8) nop nop xor $63243, %rdi and $0xffffffffffffffc0, %r8 vmovaps (%r8), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %r15 nop nop nop nop nop xor $36898, %r13 lea addresses_UC_ht+0x10d6e, %r13 nop nop nop xor $64420, %r15 movb $0x61, (%r13) nop nop nop nop nop dec %r15 lea addresses_WT_ht+0x187ee, %r14 nop nop nop nop add %r13, %r13 vmovups (%r14), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $1, %xmm3, %r8 add $13528, %r14 lea addresses_D_ht+0x16a2e, %rsi lea addresses_normal_ht+0x8e4e, %rdi nop nop nop nop nop and %r15, %r15 mov $4, %rcx rep movsw xor $29206, %rdi lea addresses_D_ht+0x623e, %rcx clflush (%rcx) nop nop nop nop nop sub %rdi, %rdi movw $0x6162, (%rcx) xor $6145, %rdi lea addresses_UC_ht+0x956e, %rsi lea addresses_WC_ht+0x10d88, %rdi nop nop nop nop cmp %rbx, %rbx mov $47, %rcx rep movsw nop nop nop nop xor %rcx, %rcx lea addresses_WC_ht+0xc76e, %rcx nop nop nop add %rbx, %rbx mov (%rcx), %r13w cmp $1198, %r15 lea addresses_normal_ht+0x10f52, %rcx xor %r14, %r14 vmovups (%rcx), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $1, %xmm1, %rsi nop xor $11439, %rsi lea addresses_WC_ht+0x8e6e, %rcx nop nop nop nop sub %r15, %r15 vmovups (%rcx), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $0, %xmm3, %rdi nop nop nop inc %r14 pop %rsi pop %rdi pop %rcx pop %rbx pop %r8 pop %r15 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %r8 push %rdi push %rdx // Store lea addresses_UC+0x1eaee, %r11 nop nop nop and $20893, %r13 mov $0x5152535455565758, %rdx movq %rdx, %xmm6 vmovups %ymm6, (%r11) inc %rdx // Load lea addresses_RW+0x183ee, %r14 nop nop nop nop nop lfence mov (%r14), %r11d nop add %r11, %r11 // Store lea addresses_D+0xd708, %r13 nop nop nop inc %rdi movl $0x51525354, (%r13) nop nop nop nop and %r13, %r13 // Store mov $0x35ddee0000000ace, %r14 nop nop nop nop xor %rdi, %rdi mov $0x5152535455565758, %r13 movq %r13, %xmm4 vmovups %ymm4, (%r14) nop nop nop nop nop xor $60698, %r13 // Faulty Load lea addresses_US+0x556e, %rdx nop nop cmp %r10, %r10 mov (%rdx), %r8w lea oracles, %rdi and $0xff, %r8 shlq $12, %r8 mov (%rdi,%r8,1), %r8 pop %rdx pop %rdi pop %r8 pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 7}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 1}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 1}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 3}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}} {'00': 190} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
21.942222
569
0.649787
f8ccc209987c4c92aa3fa076b7a84889df77d8e4
941
asm
Assembly
_maps/obj3C.asm
vladjester2020/Sonic1TMR
22e749a2aab74cc725729e476d6252b071c12e42
[ "Apache-2.0" ]
null
null
null
_maps/obj3C.asm
vladjester2020/Sonic1TMR
22e749a2aab74cc725729e476d6252b071c12e42
[ "Apache-2.0" ]
2
2019-06-13T14:26:59.000Z
2019-10-10T13:15:14.000Z
_maps/obj3C.asm
vladjester2020/Sonic1TMR
22e749a2aab74cc725729e476d6252b071c12e42
[ "Apache-2.0" ]
null
null
null
; --------------------------------------------------------------------------- ; Sprite mappings - smashable walls (GHZ, SLZ) ; --------------------------------------------------------------------------- dc.w byte_D2BC-Map_obj3C dc.w byte_D2E5-Map_obj3C dc.w byte_D30E-Map_obj3C byte_D2BC: dc.b 8 dc.b $E0, 5, 0, 0, $F0 dc.b $F0, 5, 0, 0, $F0 dc.b 0, 5, 0, 0, $F0 dc.b $10, 5, 0, 0, $F0 dc.b $E0, 5, 0, 4, 0 dc.b $F0, 5, 0, 4, 0 dc.b 0, 5, 0, 4, 0 dc.b $10, 5, 0, 4, 0 byte_D2E5: dc.b 8 dc.b $E0, 5, 0, 4, $F0 dc.b $F0, 5, 0, 4, $F0 dc.b 0, 5, 0, 4, $F0 dc.b $10, 5, 0, 4, $F0 dc.b $E0, 5, 0, 4, 0 dc.b $F0, 5, 0, 4, 0 dc.b 0, 5, 0, 4, 0 dc.b $10, 5, 0, 4, 0 byte_D30E: dc.b 8 dc.b $E0, 5, 0, 4, $F0 dc.b $F0, 5, 0, 4, $F0 dc.b 0, 5, 0, 4, $F0 dc.b $10, 5, 0, 4, $F0 dc.b $E0, 5, 0, 8, 0 dc.b $F0, 5, 0, 8, 0 dc.b 0, 5, 0, 8, 0 dc.b $10, 5, 0, 8, 0 even
27.676471
78
0.384697
ed277826ae8edb36790280e268679edeeafc2749
655
asm
Assembly
oeis/061/A061924.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/061/A061924.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/061/A061924.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A061924: Number of combinations in card games with 4 suits and 4 players. ; Submitted by Jamie Morken(s1.) ; 1,4,56,1320,43680,1860480,96909120,5967561600,424097856000,34162713446400,3075990524006400,306135476264217600,33371339479827148800,3954242643911239680000,506046613478104258560000,69560546966425756200960000,10221346459144248675287040000,1598868904898955862170206208000,265263722088533591588789944320000,46524500867605794213072833740800000,8601077741927290708534393031884800000,1671656528833466732080060425515827200000,340744680334044819743896163081827123200000 mov $1,1 mov $2,$0 mul $2,3 lpb $0 sub $0,1 add $2,1 mul $1,$2 lpe mov $0,$1
46.785714
461
0.858015
0ecb15b1c77c1831b07ff088cf513e3f1875973f
1,048
asm
Assembly
kernel/arch/i386/entry.asm
lochnessdragon/exokernel
829e11e7c6502071691088e8585a54dfe812d1ed
[ "MIT" ]
1
2022-02-16T07:45:43.000Z
2022-02-16T07:45:43.000Z
kernel/arch/i386/entry.asm
lochnessdragon/exokernel
829e11e7c6502071691088e8585a54dfe812d1ed
[ "MIT" ]
null
null
null
kernel/arch/i386/entry.asm
lochnessdragon/exokernel
829e11e7c6502071691088e8585a54dfe812d1ed
[ "MIT" ]
null
null
null
; 32-bit entry is standard for gnu multiboot2 ; so somehow, we have to setup a transition to x86_64 bit mode... bits 32 global entry ; the entry point for the kernel.elf file KERNEL_STACK_SIZE equ 4096 ; the kernels stack size in bytes section .bss align 4 ; align at 4 bytes kernel_stack: ; kernel stack header for later reference resb KERNEL_STACK_SIZE ; reserve KERNEL_STACK_SIZE bytes in the executable for later use. section .text ; start of the code section align 8 ; align with 64 bit boundary (multiboot2 standard) %include "multiboot_header.inc" ; info for the multiboot2 header. align 4 extern kmain ; defined so that we can call it later entry: ;mov eax, 0xCAFEBABE ; tells us that the operating system has initialized correctly ; initialize the stack mov esp, kernel_stack + KERNEL_STACK_SIZE ; point esp to the start of the stack. ; push the multiboot information to the stack to be used by the c function push eax push ebx ; jump to a c function call kmain cli hlt
32.75
94
0.732824
7a09906704f5e1697ba1d6dbebe9987823a60bea
6,400
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1697.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1697.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1697.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r14 push %r15 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x1ba59, %r9 nop nop nop sub $18327, %r15 mov $0x6162636465666768, %r11 movq %r11, %xmm5 movups %xmm5, (%r9) nop dec %r11 lea addresses_D_ht+0x77b9, %rbp nop add $51477, %r14 movb $0x61, (%rbp) nop cmp $18009, %r15 lea addresses_UC_ht+0x2259, %r9 nop nop add %rsi, %rsi movb (%r9), %r15b nop nop nop nop add $52912, %r15 lea addresses_normal_ht+0x4595, %r12 nop nop nop nop xor %r11, %r11 and $0xffffffffffffffc0, %r12 vmovaps (%r12), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %r14 nop nop nop nop xor %r11, %r11 lea addresses_WT_ht+0x17459, %rsi lea addresses_WT_ht+0x1dfd9, %rdi nop nop nop nop nop add $15987, %r12 mov $114, %rcx rep movsl nop nop nop sub %rbp, %rbp lea addresses_normal_ht+0x18259, %rsi lea addresses_D_ht+0x12c5f, %rdi nop nop and %r11, %r11 mov $34, %rcx rep movsq nop nop nop nop sub $15854, %rdi lea addresses_normal_ht+0x1cc23, %rcx nop nop nop nop nop dec %rdi movl $0x61626364, (%rcx) nop nop nop nop nop cmp $11200, %rbp lea addresses_normal_ht+0x7ce9, %rsi lea addresses_WC_ht+0xa059, %rdi clflush (%rsi) add %rbp, %rbp mov $125, %rcx rep movsl nop nop nop cmp $60961, %r14 lea addresses_UC_ht+0x15c59, %r9 nop nop nop nop nop sub %r15, %r15 mov $0x6162636465666768, %rsi movq %rsi, %xmm4 and $0xffffffffffffffc0, %r9 movaps %xmm4, (%r9) nop nop nop add $65188, %r9 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r15 pop %r14 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r13 push %r15 push %r8 push %rax push %rbp push %rsi // Faulty Load lea addresses_D+0x7259, %r8 nop nop nop nop and $17679, %rbp mov (%r8), %eax lea oracles, %rsi and $0xff, %rax shlq $12, %rax mov (%rsi,%rax,1), %rax pop %rsi pop %rbp pop %rax pop %r8 pop %r15 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_D', 'same': True, 'size': 4, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 5, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'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 */
36.158192
2,999
0.662656
a2700b819a6320122860469c1170e6cb5076d415
620
asm
Assembly
oeis/002/A002544.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/002/A002544.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/002/A002544.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A002544: a(n) = binomial(2*n+1,n)*(n+1)^2. ; 1,12,90,560,3150,16632,84084,411840,1969110,9237800,42678636,194699232,878850700,3931426800,17450721000,76938289920,337206098790,1470171918600,6379820115900,27569305764000,118685861314020,509191949220240,2177742427450200,9287309860732800,39503314511797500,167620464136459152,709659420648736824,2998286715498092480,12643285563057007320,53219061704187640800,223638323739152952784,938303560162606353408,3930978782321856695430,16445857972689053355720,68714095162705992827100,286748126099390232924192 add $0,2 mov $1,$0 mul $0,2 sub $0,2 bin $0,$1 bin $1,2 mul $1,$0 mov $0,$1
51.666667
497
0.845161
a7ce79a7215e78aec04027a6c26d6d0686d86248
1,480
asm
Assembly
read_clock.asm
shaochenren/Assembly-swap
8c0e8fd71515748ce8edd0a3560585c53a94ea1f
[ "Apache-2.0" ]
null
null
null
read_clock.asm
shaochenren/Assembly-swap
8c0e8fd71515748ce8edd0a3560585c53a94ea1f
[ "Apache-2.0" ]
null
null
null
read_clock.asm
shaochenren/Assembly-swap
8c0e8fd71515748ce8edd0a3560585c53a94ea1f
[ "Apache-2.0" ]
null
null
null
;shaochen ren extern printf global read_clock section .bss section .text read_clock: push rbp ;Backup rbp mov rbp,rsp ;The base pointer now points to top of stack push rdi ;Backup rdi push rsi ;Backup rsi push rdx ;Backup rdx push rcx ;Backup rcx push r8 ;Backup r8 push r9 ;Backup r9 push r10 ;Backup r10 push r11 ;Backup r11 push r12 ;Backup r12 push r13 ;Backup r13 push r14 ;Backup r14 push r15 ;Backup r15 push rbx ;Backup rbx pushf cpuid rdtsc ;Backup rflags shl rdx, 32 add rax, rdx popf pop rbx pop r15 pop r14 pop r13 pop r12 pop r11 pop r10 pop r9 pop r8 pop rcx pop rdx pop rsi pop rdi pop rbp ret
29.6
105
0.315541
c1888cc8fe21a12ee5f12e827c9b3171d365d618
1,125
asm
Assembly
programs/oeis/016/A016969.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/016/A016969.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/016/A016969.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A016969: a(n) = 6*n + 5. ; 5,11,17,23,29,35,41,47,53,59,65,71,77,83,89,95,101,107,113,119,125,131,137,143,149,155,161,167,173,179,185,191,197,203,209,215,221,227,233,239,245,251,257,263,269,275,281,287,293,299,305,311,317,323,329,335,341,347,353,359,365,371,377,383,389,395,401,407,413,419,425,431,437,443,449,455,461,467,473,479,485,491,497,503,509,515,521,527,533,539,545,551,557,563,569,575,581,587,593,599,605,611,617,623,629,635,641,647,653,659,665,671,677,683,689,695,701,707,713,719,725,731,737,743,749,755,761,767,773,779,785,791,797,803,809,815,821,827,833,839,845,851,857,863,869,875,881,887,893,899,905,911,917,923,929,935,941,947,953,959,965,971,977,983,989,995,1001,1007,1013,1019,1025,1031,1037,1043,1049,1055,1061,1067,1073,1079,1085,1091,1097,1103,1109,1115,1121,1127,1133,1139,1145,1151,1157,1163,1169,1175,1181,1187,1193,1199,1205,1211,1217,1223,1229,1235,1241,1247,1253,1259,1265,1271,1277,1283,1289,1295,1301,1307,1313,1319,1325,1331,1337,1343,1349,1355,1361,1367,1373,1379,1385,1391,1397,1403,1409,1415,1421,1427,1433,1439,1445,1451,1457,1463,1469,1475,1481,1487,1493,1499 mov $1,$0 mul $1,6 add $1,5
160.714286
1,068
0.750222
e26e1bb1effe9b60af41f436238ac905c50c1a9c
139,796
asm
Assembly
Palmtree.Math.Core.Implements/vs_build/x64_Release/pmc_subtruct.asm
rougemeilland/Palmtree.Math.Core.Implements
52f4f6c765d16c9b0baf1fd212c61a33daae138c
[ "MIT" ]
null
null
null
Palmtree.Math.Core.Implements/vs_build/x64_Release/pmc_subtruct.asm
rougemeilland/Palmtree.Math.Core.Implements
52f4f6c765d16c9b0baf1fd212c61a33daae138c
[ "MIT" ]
null
null
null
Palmtree.Math.Core.Implements/vs_build/x64_Release/pmc_subtruct.asm
rougemeilland/Palmtree.Math.Core.Implements
52f4f6c765d16c9b0baf1fd212c61a33daae138c
[ "MIT" ]
null
null
null
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1 include listing.inc INCLUDELIB MSVCRT INCLUDELIB OLDNAMES PUBLIC Subtruct_Imp PUBLIC Initialize_Subtruct PUBLIC PMC_Subtruct_I_X PUBLIC PMC_Subtruct_L_X PUBLIC PMC_Subtruct_X_I PUBLIC PMC_Subtruct_X_L PUBLIC PMC_Subtruct_X_X EXTRN CheckBlockLight:PROC EXTRN AllocateNumber:PROC EXTRN DeallocateNumber:PROC EXTRN CommitNumber:PROC EXTRN CheckNumber:PROC EXTRN DuplicateNumber:PROC EXTRN number_zero:BYTE ; COMDAT pdata pdata SEGMENT $pdata$Subtruct_Imp DD imagerel $LN140 DD imagerel $LN140+985 DD imagerel $unwind$Subtruct_Imp pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$PMC_Subtruct_I_X DD imagerel $LN25 DD imagerel $LN25+221 DD imagerel $unwind$PMC_Subtruct_I_X pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$PMC_Subtruct_L_X DD imagerel $LN58 DD imagerel $LN58+203 DD imagerel $unwind$PMC_Subtruct_L_X pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$PMC_Subtruct_X_I DD imagerel $LN27 DD imagerel $LN27+395 DD imagerel $unwind$PMC_Subtruct_X_I pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$PMC_Subtruct_X_L DD imagerel $LN69 DD imagerel $LN69+399 DD imagerel $unwind$PMC_Subtruct_X_L pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$PMC_Subtruct_X_X DD imagerel $LN23 DD imagerel $LN23+386 DD imagerel $unwind$PMC_Subtruct_X_X pdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$PMC_Subtruct_X_X DD 060f01H DD 0a640fH DD 09340fH DD 0700b520fH xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$PMC_Subtruct_X_L DD 060f01H DD 0a640fH DD 09340fH DD 0700b520fH xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$PMC_Subtruct_X_I DD 060f01H DD 0a640fH DD 09340fH DD 0700b520fH xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$PMC_Subtruct_L_X DD 060f01H DD 07640fH DD 06340fH DD 0700b320fH xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$PMC_Subtruct_I_X DD 060f01H DD 07640fH DD 06340fH DD 0700b320fH xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$Subtruct_Imp DD 020601H DD 030023206H xdata ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT Subtruct_X_2W _TEXT SEGMENT up$ = 8 u_count$ = 16 v_hi$ = 24 v_lo$ = 32 wp$ = 40 w_count$ = 48 Subtruct_X_2W PROC ; COMDAT ; 98 : { mov r11, r9 mov r9, rcx mov r10, rdx ; 99 : if (u_count < 2) cmp rdx, 2 jae SHORT $LN2@Subtruct_X ; 100 : { ; 101 : // u が 1 ワードしかなかった場合 ; 102 : ; 103 : // 明らかに演算結果が負になるのでエラーを通知する。 ; 104 : return (PMC_STATUS_INTERNAL_BORROW); mov eax, -258 ; fffffffffffffefeH ; 116 : w_count -= 2; ; 117 : ; 118 : // 残りの桁の繰り上がりを計算し、復帰する。 ; 119 : return (DoBorrow(c, up, u_count, wp, w_count)); ; 120 : } ; 121 : } ret 0 $LN2@Subtruct_X: ; 105 : } ; 106 : else ; 107 : { ; 108 : // x が 2 ワード以上あった場合 ; 109 : ; 110 : // 最下位のワードの減算をする ; 111 : char c = _SUBTRUCT_UNIT(0, *up++, v_lo, wp++); mov rax, QWORD PTR [rcx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); mov rdx, QWORD PTR wp$[rsp] sub rax, r11 setb cl add cl, -1 mov QWORD PTR [rdx], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 114 : c = _SUBTRUCT_UNIT(c, *up++, v_hi, wp++); mov rax, QWORD PTR [r9+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, r8 mov QWORD PTR [rdx+8], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 114 : c = _SUBTRUCT_UNIT(c, *up++, v_hi, wp++); lea rax, QWORD PTR [rdx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); setb r8b ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 115 : u_count -= 2; lea rdx, QWORD PTR [r10-2] add r9, 16 ; 44 : if (u_count <= 0) test rdx, rdx je SHORT $LN25@Subtruct_X npad 7 $LL10@Subtruct_X: ; 49 : { ; 50 : // かつそれでも桁借りを行う必要がある場合 ; 51 : ; 52 : // 減算結果が負になってしまったので呼び出し元に通知する。 ; 53 : return (PMC_STATUS_INTERNAL_BORROW); ; 54 : } ; 55 : ; 56 : // xの最上位に達してしまった場合はいずれにしろループを中断して正常復帰する。 ; 57 : ; 58 : return (PMC_STATUS_OK); ; 59 : } ; 60 : else if (c) test r8b, r8b je SHORT $LN24@Subtruct_X ; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++); mov rcx, QWORD PTR [r9] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add r8b, -1 sbb rcx, 0 mov QWORD PTR [rax], rcx setb r8b ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++); add r9, 8 add rax, 8 ; 66 : --u_count; sub rdx, 1 jne SHORT $LL10@Subtruct_X $LN25@Subtruct_X: ; 45 : { ; 46 : // x の最上位まで達してしまった場合 ; 47 : ; 48 : if (c) neg r8b sbb eax, eax and eax, -258 ; fffffffffffffefeH ; 116 : w_count -= 2; ; 117 : ; 118 : // 残りの桁の繰り上がりを計算し、復帰する。 ; 119 : return (DoBorrow(c, up, u_count, wp, w_count)); ; 120 : } ; 121 : } ret 0 $LN24@Subtruct_X: ; 74 : while (u_count > 0) test rdx, rdx je SHORT $LN14@Subtruct_X sub r9, rax npad 8 $LL13@Subtruct_X: ; 75 : { ; 76 : *wp++ = *up++; mov rcx, QWORD PTR [r9+rax] mov QWORD PTR [rax], rcx lea rax, QWORD PTR [rax+8] ; 77 : --u_count; sub rdx, 1 jne SHORT $LL13@Subtruct_X $LN14@Subtruct_X: ; 78 : --w_count; ; 79 : } ; 80 : return (PMC_STATUS_OK); xor eax, eax ; 116 : w_count -= 2; ; 117 : ; 118 : // 残りの桁の繰り上がりを計算し、復帰する。 ; 119 : return (DoBorrow(c, up, u_count, wp, w_count)); ; 120 : } ; 121 : } ret 0 Subtruct_X_2W ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT Subtruct_X_1W _TEXT SEGMENT up$ = 8 u_count$ = 16 v$ = 24 wp$ = 32 w_count$ = 40 Subtruct_X_1W PROC ; COMDAT ; 88 : char c = _SUBTRUCT_UNIT(0, *up++, v, wp++); mov rax, QWORD PTR [rcx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sub rax, r8 mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 88 : char c = _SUBTRUCT_UNIT(0, *up++, v, wp++); lea rax, QWORD PTR [r9+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); setb r8b ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 88 : char c = _SUBTRUCT_UNIT(0, *up++, v, wp++); lea r9, QWORD PTR [rcx+8] ; 89 : --u_count; sub rdx, 1 ; 44 : if (u_count <= 0) je SHORT $LN21@Subtruct_X npad 5 $LL6@Subtruct_X: ; 49 : { ; 50 : // かつそれでも桁借りを行う必要がある場合 ; 51 : ; 52 : // 減算結果が負になってしまったので呼び出し元に通知する。 ; 53 : return (PMC_STATUS_INTERNAL_BORROW); ; 54 : } ; 55 : ; 56 : // xの最上位に達してしまった場合はいずれにしろループを中断して正常復帰する。 ; 57 : ; 58 : return (PMC_STATUS_OK); ; 59 : } ; 60 : else if (c) test r8b, r8b je SHORT $LN20@Subtruct_X ; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++); mov rcx, QWORD PTR [r9] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add r8b, -1 sbb rcx, 0 mov QWORD PTR [rax], rcx setb r8b ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++); add r9, 8 add rax, 8 ; 66 : --u_count; sub rdx, 1 jne SHORT $LL6@Subtruct_X $LN21@Subtruct_X: ; 45 : { ; 46 : // x の最上位まで達してしまった場合 ; 47 : ; 48 : if (c) neg r8b sbb eax, eax and eax, -258 ; fffffffffffffefeH ; 94 : } ret 0 $LN20@Subtruct_X: ; 74 : while (u_count > 0) test rdx, rdx je SHORT $LN10@Subtruct_X sub r9, rax npad 8 $LL9@Subtruct_X: ; 75 : { ; 76 : *wp++ = *up++; mov rcx, QWORD PTR [r9+rax] mov QWORD PTR [rax], rcx lea rax, QWORD PTR [rax+8] ; 77 : --u_count; sub rdx, 1 jne SHORT $LL9@Subtruct_X $LN10@Subtruct_X: ; 90 : --w_count; ; 91 : ; 92 : // 残りの桁の繰上りを行い復帰する。 ; 93 : return (DoBorrow(c, up, u_count, wp, w_count)); xor eax, eax ; 94 : } ret 0 Subtruct_X_1W ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT DoBorrow _TEXT SEGMENT c$ = 8 up$ = 16 u_count$ = 24 wp$ = 32 w_count$ = 40 DoBorrow PROC ; COMDAT ; 41 : // 桁借りを続く限り行う ; 42 : for (;;) ; 43 : { ; 44 : if (u_count <= 0) test r8, r8 je SHORT $LN17@DoBorrow $LL2@DoBorrow: ; 54 : } ; 55 : ; 56 : // xの最上位に達してしまった場合はいずれにしろループを中断して正常復帰する。 ; 57 : ; 58 : return (PMC_STATUS_OK); ; 59 : } ; 60 : else if (c) test cl, cl je SHORT $LN16@DoBorrow ; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, 0 mov QWORD PTR [r9], rax setb cl ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++); add rdx, 8 add r9, 8 ; 66 : --u_count; sub r8, 1 jne SHORT $LL2@DoBorrow $LN17@DoBorrow: ; 45 : { ; 46 : // x の最上位まで達してしまった場合 ; 47 : ; 48 : if (c) test cl, cl je SHORT $LN6@DoBorrow ; 49 : { ; 50 : // かつそれでも桁借りを行う必要がある場合 ; 51 : ; 52 : // 減算結果が負になってしまったので呼び出し元に通知する。 ; 53 : return (PMC_STATUS_INTERNAL_BORROW); mov eax, -258 ; fffffffffffffefeH ; 81 : } ; 82 : } ; 83 : } ret 0 $LN16@DoBorrow: ; 67 : --w_count; ; 68 : } ; 69 : else ; 70 : { ; 71 : // xの最上位に達しておらず、かつボローが立っていない場合 ; 72 : ; 73 : // 桁借りを中断し、xの残りのデータをzにそのまま複写し、正常復帰する。 ; 74 : while (u_count > 0) test r8, r8 je SHORT $LN6@DoBorrow sub rdx, r9 npad 7 $LL5@DoBorrow: ; 75 : { ; 76 : *wp++ = *up++; mov rax, QWORD PTR [rdx+r9] mov QWORD PTR [r9], rax lea r9, QWORD PTR [r9+8] ; 77 : --u_count; sub r8, 1 jne SHORT $LL5@DoBorrow $LN6@DoBorrow: ; 78 : --w_count; ; 79 : } ; 80 : return (PMC_STATUS_OK); xor eax, eax ; 81 : } ; 82 : } ; 83 : } ret 0 DoBorrow ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; COMDAT _SUBTRUCT_2WORDS_SBB _TEXT SEGMENT c$ = 8 xp$ = 16 yp$ = 24 zp$ = 32 _SUBTRUCT_2WORDS_SBB PROC ; COMDAT ; 4465 : #ifdef _MSC_VER ; 4466 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4467 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rcx, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rcx, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rcx setb al ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4504 : } ret 0 _SUBTRUCT_2WORDS_SBB ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; COMDAT _SUBTRUCT_4WORDS_SBB _TEXT SEGMENT c$ = 8 xp$ = 16 yp$ = 24 zp$ = 32 _SUBTRUCT_4WORDS_SBB PROC ; COMDAT ; 4051 : #ifdef _MSC_VER ; 4052 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4053 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rax, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4054 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]); mov rax, QWORD PTR [rdx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+16] mov QWORD PTR [r9+16], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4055 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]); mov rcx, QWORD PTR [rdx+24] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rcx, QWORD PTR [r8+24] mov QWORD PTR [r9+24], rcx setb al ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4104 : } ret 0 _SUBTRUCT_4WORDS_SBB ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; COMDAT _SUBTRUCT_8WORDS_SBB _TEXT SEGMENT c$ = 8 xp$ = 16 yp$ = 24 zp$ = 32 _SUBTRUCT_8WORDS_SBB PROC ; COMDAT ; 3455 : #ifdef _MSC_VER ; 3456 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3457 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rax, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3458 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]); mov rax, QWORD PTR [rdx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+16] mov QWORD PTR [r9+16], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3459 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]); mov rax, QWORD PTR [rdx+24] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+24] mov QWORD PTR [r9+24], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3460 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]); mov rax, QWORD PTR [rdx+32] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+32] mov QWORD PTR [r9+32], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3461 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]); mov rax, QWORD PTR [rdx+40] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+40] mov QWORD PTR [r9+40], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3462 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]); mov rax, QWORD PTR [rdx+48] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+48] mov QWORD PTR [r9+48], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3463 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]); mov rcx, QWORD PTR [rdx+56] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rcx, QWORD PTR [r8+56] mov QWORD PTR [r9+56], rcx setb al ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3536 : } ret 0 _SUBTRUCT_8WORDS_SBB ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; COMDAT _SUBTRUCT_16WORDS_SBB _TEXT SEGMENT c$ = 8 xp$ = 16 yp$ = 24 zp$ = 32 _SUBTRUCT_16WORDS_SBB PROC ; COMDAT ; 2495 : #ifdef _MSC_VER ; 2496 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2497 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rax, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2498 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]); mov rax, QWORD PTR [rdx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+16] mov QWORD PTR [r9+16], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2499 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]); mov rax, QWORD PTR [rdx+24] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+24] mov QWORD PTR [r9+24], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2500 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]); mov rax, QWORD PTR [rdx+32] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+32] mov QWORD PTR [r9+32], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2501 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]); mov rax, QWORD PTR [rdx+40] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+40] mov QWORD PTR [r9+40], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2502 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]); mov rax, QWORD PTR [rdx+48] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+48] mov QWORD PTR [r9+48], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2503 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]); mov rax, QWORD PTR [rdx+56] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+56] mov QWORD PTR [r9+56], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2504 : c = _SUBTRUCT_UNIT(c, xp[8], yp[8], &zp[8]); mov rax, QWORD PTR [rdx+64] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+64] mov QWORD PTR [r9+64], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2505 : c = _SUBTRUCT_UNIT(c, xp[9], yp[9], &zp[9]); mov rax, QWORD PTR [rdx+72] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+72] mov QWORD PTR [r9+72], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2506 : c = _SUBTRUCT_UNIT(c, xp[10], yp[10], &zp[10]); mov rax, QWORD PTR [rdx+80] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+80] mov QWORD PTR [r9+80], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2507 : c = _SUBTRUCT_UNIT(c, xp[11], yp[11], &zp[11]); mov rax, QWORD PTR [rdx+88] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+88] mov QWORD PTR [r9+88], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2508 : c = _SUBTRUCT_UNIT(c, xp[12], yp[12], &zp[12]); mov rax, QWORD PTR [rdx+96] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+96] mov QWORD PTR [r9+96], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2509 : c = _SUBTRUCT_UNIT(c, xp[13], yp[13], &zp[13]); mov rax, QWORD PTR [rdx+104] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+104] mov QWORD PTR [r9+104], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2510 : c = _SUBTRUCT_UNIT(c, xp[14], yp[14], &zp[14]); mov rax, QWORD PTR [rdx+112] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+112] mov QWORD PTR [r9+112], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2511 : c = _SUBTRUCT_UNIT(c, xp[15], yp[15], &zp[15]); mov rcx, QWORD PTR [rdx+120] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rcx, QWORD PTR [r8+120] mov QWORD PTR [r9+120], rcx setb al ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 2632 : } ret 0 _SUBTRUCT_16WORDS_SBB ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; COMDAT _SUBTRUCT_32WORDS_SBB _TEXT SEGMENT c$ = 8 xp$ = 16 yp$ = 24 zp$ = 32 _SUBTRUCT_32WORDS_SBB PROC ; COMDAT ; 807 : #ifdef _MSC_VER ; 808 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 809 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rax, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 810 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]); mov rax, QWORD PTR [rdx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+16] mov QWORD PTR [r9+16], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 811 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]); mov rax, QWORD PTR [rdx+24] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+24] mov QWORD PTR [r9+24], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 812 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]); mov rax, QWORD PTR [rdx+32] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+32] mov QWORD PTR [r9+32], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 813 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]); mov rax, QWORD PTR [rdx+40] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+40] mov QWORD PTR [r9+40], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 814 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]); mov rax, QWORD PTR [rdx+48] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+48] mov QWORD PTR [r9+48], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 815 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]); mov rax, QWORD PTR [rdx+56] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+56] mov QWORD PTR [r9+56], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 816 : c = _SUBTRUCT_UNIT(c, xp[8], yp[8], &zp[8]); mov rax, QWORD PTR [rdx+64] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+64] mov QWORD PTR [r9+64], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 817 : c = _SUBTRUCT_UNIT(c, xp[9], yp[9], &zp[9]); mov rax, QWORD PTR [rdx+72] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+72] mov QWORD PTR [r9+72], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 818 : c = _SUBTRUCT_UNIT(c, xp[10], yp[10], &zp[10]); mov rax, QWORD PTR [rdx+80] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+80] mov QWORD PTR [r9+80], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 819 : c = _SUBTRUCT_UNIT(c, xp[11], yp[11], &zp[11]); mov rax, QWORD PTR [rdx+88] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+88] mov QWORD PTR [r9+88], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 820 : c = _SUBTRUCT_UNIT(c, xp[12], yp[12], &zp[12]); mov rax, QWORD PTR [rdx+96] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+96] mov QWORD PTR [r9+96], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 821 : c = _SUBTRUCT_UNIT(c, xp[13], yp[13], &zp[13]); mov rax, QWORD PTR [rdx+104] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+104] mov QWORD PTR [r9+104], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 822 : c = _SUBTRUCT_UNIT(c, xp[14], yp[14], &zp[14]); mov rax, QWORD PTR [rdx+112] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+112] mov QWORD PTR [r9+112], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 823 : c = _SUBTRUCT_UNIT(c, xp[15], yp[15], &zp[15]); mov rax, QWORD PTR [rdx+120] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+120] mov QWORD PTR [r9+120], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 824 : c = _SUBTRUCT_UNIT(c, xp[16], yp[16], &zp[16]); mov rax, QWORD PTR [rdx+128] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+128] mov QWORD PTR [r9+128], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 825 : c = _SUBTRUCT_UNIT(c, xp[17], yp[17], &zp[17]); mov rax, QWORD PTR [rdx+136] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+136] mov QWORD PTR [r9+136], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 826 : c = _SUBTRUCT_UNIT(c, xp[18], yp[18], &zp[18]); mov rax, QWORD PTR [rdx+144] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+144] mov QWORD PTR [r9+144], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 827 : c = _SUBTRUCT_UNIT(c, xp[19], yp[19], &zp[19]); mov rax, QWORD PTR [rdx+152] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+152] mov QWORD PTR [r9+152], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 828 : c = _SUBTRUCT_UNIT(c, xp[20], yp[20], &zp[20]); mov rax, QWORD PTR [rdx+160] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+160] mov QWORD PTR [r9+160], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 829 : c = _SUBTRUCT_UNIT(c, xp[21], yp[21], &zp[21]); mov rax, QWORD PTR [rdx+168] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+168] mov QWORD PTR [r9+168], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 830 : c = _SUBTRUCT_UNIT(c, xp[22], yp[22], &zp[22]); mov rax, QWORD PTR [rdx+176] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+176] mov QWORD PTR [r9+176], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 831 : c = _SUBTRUCT_UNIT(c, xp[23], yp[23], &zp[23]); mov rax, QWORD PTR [rdx+184] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+184] mov QWORD PTR [r9+184], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 832 : c = _SUBTRUCT_UNIT(c, xp[24], yp[24], &zp[24]); mov rax, QWORD PTR [rdx+192] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+192] mov QWORD PTR [r9+192], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 833 : c = _SUBTRUCT_UNIT(c, xp[25], yp[25], &zp[25]); mov rax, QWORD PTR [rdx+200] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+200] mov QWORD PTR [r9+200], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 834 : c = _SUBTRUCT_UNIT(c, xp[26], yp[26], &zp[26]); mov rax, QWORD PTR [rdx+208] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+208] mov QWORD PTR [r9+208], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 835 : c = _SUBTRUCT_UNIT(c, xp[27], yp[27], &zp[27]); mov rax, QWORD PTR [rdx+216] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+216] mov QWORD PTR [r9+216], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 836 : c = _SUBTRUCT_UNIT(c, xp[28], yp[28], &zp[28]); mov rax, QWORD PTR [rdx+224] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+224] mov QWORD PTR [r9+224], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 837 : c = _SUBTRUCT_UNIT(c, xp[29], yp[29], &zp[29]); mov rax, QWORD PTR [rdx+232] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+232] mov QWORD PTR [r9+232], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 838 : c = _SUBTRUCT_UNIT(c, xp[30], yp[30], &zp[30]); mov rax, QWORD PTR [rdx+240] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+240] mov QWORD PTR [r9+240], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 839 : c = _SUBTRUCT_UNIT(c, xp[31], yp[31], &zp[31]); mov rcx, QWORD PTR [rdx+248] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rcx, QWORD PTR [r8+248] mov QWORD PTR [r9+248], rcx setb al ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 1056 : } ret 0 _SUBTRUCT_32WORDS_SBB ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; COMDAT _LZCNT_ALT_UNIT _TEXT SEGMENT x$ = 8 _LZCNT_ALT_UNIT PROC ; COMDAT ; 630 : if (x == 0) test rcx, rcx jne SHORT $LN2@LZCNT_ALT_ ; 631 : return (sizeof(x) * 8); mov eax, 64 ; 00000040H ; 655 : } ret 0 $LN2@LZCNT_ALT_: ; 632 : #ifdef _M_IX86 ; 633 : _UINT32_T pos; ; 634 : #ifdef _MSC_VER ; 635 : _BitScanReverse(&pos, x); ; 636 : #elif defined(__GNUC__) ; 637 : __asm__("bsrl %1, %0" : "=r"(pos) : "rm"(x)); ; 638 : #else ; 639 : #error unknown compiler ; 640 : #endif ; 641 : #elif defined(_M_X64) ; 642 : #ifdef _MSC_VER ; 643 : _UINT32_T pos; ; 644 : _BitScanReverse64(&pos, x); bsr rcx, rcx ; 645 : #elif defined(__GNUC__) ; 646 : _UINT64_T pos; ; 647 : __asm__("bsrq %1, %0" : "=r"(pos) : "rm"(x)); ; 648 : #else ; 649 : #error unknown compiler ; 650 : #endif ; 651 : #else ; 652 : #error unknown platform ; 653 : #endif ; 654 : return (sizeof(x) * 8 - 1 - pos); mov eax, 63 ; 0000003fH sub eax, ecx ; 655 : } ret 0 _LZCNT_ALT_UNIT ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; COMDAT _LZCNT_ALT_32 _TEXT SEGMENT x$ = 8 _LZCNT_ALT_32 PROC ; COMDAT ; 597 : if (x == 0) test ecx, ecx jne SHORT $LN2@LZCNT_ALT_ ; 598 : return (sizeof(x) * 8); mov eax, 32 ; 00000020H ; 608 : } ret 0 $LN2@LZCNT_ALT_: ; 599 : _UINT32_T pos; ; 600 : #ifdef _MSC_VER ; 601 : _BitScanReverse(&pos, x); bsr ecx, ecx ; 602 : #elif defined(__GNUC__) ; 603 : __asm__("bsrl %1, %0" : "=r"(pos) : "rm"(x)); ; 604 : #else ; 605 : #error unknown compiler ; 606 : #endif ; 607 : return (sizeof(x) * 8 - 1 - pos); mov eax, 31 sub eax, ecx ; 608 : } ret 0 _LZCNT_ALT_32 ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; COMDAT _SUBTRUCT_UNIT _TEXT SEGMENT borrow$ = 8 u$ = 16 v$ = 24 w$ = 32 _SUBTRUCT_UNIT PROC ; COMDAT ; 270 : #ifdef _M_IX86 ; 271 : return (_subborrow_u32(borrow, u, v, w)); ; 272 : #elif defined(_M_X64) ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rdx, r8 mov QWORD PTR [r9], rdx setb al ; 274 : #else ; 275 : #error unknown platform ; 276 : #endif ; 277 : } ret 0 _SUBTRUCT_UNIT ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; COMDAT _FROMDWORDTOWORD _TEXT SEGMENT value$ = 8 result_high$ = 16 _FROMDWORDTOWORD PROC ; COMDAT ; 183 : *result_high = (_UINT32_T)(value >> 32); mov rax, rcx shr rax, 32 ; 00000020H mov DWORD PTR [rdx], eax ; 184 : return ((_UINT32_T)value); mov eax, ecx ; 185 : } ret 0 _FROMDWORDTOWORD ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; COMDAT _FROMWORDTODWORD _TEXT SEGMENT value_high$ = 8 value_low$ = 16 _FROMWORDTODWORD PROC ; COMDAT ; 178 : return (((_UINT64_T)value_high << 32) | value_low); mov eax, ecx shl rax, 32 ; 00000020H mov ecx, edx or rax, rcx ; 179 : } ret 0 _FROMWORDTODWORD ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT PMC_Subtruct_X_X _TEXT SEGMENT nz$ = 64 x$ = 64 y$ = 72 o$ = 80 nz_light_check_code$1 = 88 PMC_Subtruct_X_X PROC ; COMDAT ; 665 : { $LN23: mov QWORD PTR [rsp+16], rbx mov QWORD PTR [rsp+24], rsi push rdi sub rsp, 48 ; 00000030H mov rsi, r8 mov rdi, rdx mov rbx, rcx ; 666 : if (x == NULL) test rcx, rcx je $LN20@PMC_Subtru ; 667 : return (PMC_STATUS_ARGUMENT_ERROR); ; 668 : if (y == NULL) test rdx, rdx je $LN20@PMC_Subtru ; 669 : return (PMC_STATUS_ARGUMENT_ERROR); ; 670 : if (o == NULL) test r8, r8 je $LN20@PMC_Subtru ; 672 : NUMBER_HEADER* nx = (NUMBER_HEADER*)x; ; 673 : NUMBER_HEADER* ny = (NUMBER_HEADER*)y; ; 674 : PMC_STATUS_CODE result; ; 675 : if ((result = CheckNumber(nx)) != PMC_STATUS_OK) call CheckNumber test eax, eax jne $LN1@PMC_Subtru ; 676 : return (result); ; 677 : if ((result = CheckNumber(ny)) != PMC_STATUS_OK) mov rcx, rdi call CheckNumber test eax, eax jne $LN1@PMC_Subtru ; 678 : return (result); ; 679 : NUMBER_HEADER* nz; ; 680 : if (nx->IS_ZERO) mov eax, DWORD PTR [rdi+40] and eax, 2 test BYTE PTR [rbx+40], 2 je SHORT $LN7@PMC_Subtru ; 681 : { ; 682 : if (ny->IS_ZERO) test eax, eax je SHORT $LN19@PMC_Subtru ; 683 : { ; 684 : // y が 0 である場合 ; 685 : ; 686 : // x と y がともに 0 であるので、演算結果の 0 を呼び出し元に返す。 ; 687 : *o = &number_zero; lea rax, OFFSET FLAT:number_zero ; 735 : } ; 736 : #ifdef _DEBUG ; 737 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK) ; 738 : return (result); ; 739 : #endif ; 740 : return (PMC_STATUS_OK); mov QWORD PTR [rsi], rax xor eax, eax ; 741 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN7@PMC_Subtru: ; 688 : } ; 689 : else ; 690 : { ; 691 : // y が 0 ではない場合 ; 692 : ; 693 : // 演算結果は負となってしまうのでエラーを返す。 ; 694 : return (PMC_STATUS_OVERFLOW); ; 695 : } ; 696 : } ; 697 : else ; 698 : { ; 699 : // x が 0 ではない場合 ; 700 : ; 701 : if (ny->IS_ZERO) test eax, eax je SHORT $LN11@PMC_Subtru ; 702 : { ; 703 : // y が 0 である場合 ; 704 : ; 705 : // 演算結果となる x の値を持つ NUMBER_HEADER 構造体を獲得し、呼び出し元へ返す。 ; 706 : if ((result = DuplicateNumber(nx, &nz)) != PMC_STATUS_OK) lea rdx, QWORD PTR nz$[rsp] mov rcx, rbx call DuplicateNumber test eax, eax je $LN12@PMC_Subtru ; 741 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN11@PMC_Subtru: ; 707 : return (result); ; 708 : } ; 709 : else ; 710 : { ; 711 : // x と y がともに 0 ではない場合 ; 712 : ; 713 : // x と y の差を計算する ; 714 : __UNIT_TYPE x_bit_count = nx->UNIT_BIT_COUNT; mov rdx, QWORD PTR [rbx+16] ; 715 : __UNIT_TYPE y_bit_count = ny->UNIT_BIT_COUNT; ; 716 : if (x_bit_count < y_bit_count) cmp rdx, QWORD PTR [rdi+16] jae SHORT $LN14@PMC_Subtru $LN19@PMC_Subtru: ; 717 : { ; 718 : // 演算結果は負となってしまうのでエラーを返す。 ; 719 : return (PMC_STATUS_OVERFLOW); mov eax, -2 ; 741 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN14@PMC_Subtru: ; 720 : } ; 721 : __UNIT_TYPE z_bit_count = x_bit_count; ; 722 : __UNIT_TYPE nz_light_check_code; ; 723 : if ((result = AllocateNumber(&nz, z_bit_count, &nz_light_check_code)) != PMC_STATUS_OK) lea r8, QWORD PTR nz_light_check_code$1[rsp] lea rcx, QWORD PTR nz$[rsp] call AllocateNumber test eax, eax jne $LN1@PMC_Subtru ; 724 : return (result); ; 725 : if ((result = Subtruct_Imp(nx->BLOCK, nx->UNIT_WORD_COUNT, ny->BLOCK, ny->UNIT_WORD_COUNT, nz->BLOCK, nz->BLOCK_COUNT)) != PMC_STATUS_OK) mov rcx, QWORD PTR nz$[rsp] mov r9, QWORD PTR [rdi+8] mov r8, QWORD PTR [rdi+56] mov rdx, QWORD PTR [rbx+8] mov rax, QWORD PTR [rcx+48] mov QWORD PTR [rsp+40], rax mov rax, QWORD PTR [rcx+56] mov rcx, QWORD PTR [rbx+56] mov QWORD PTR [rsp+32], rax call Subtruct_Imp mov rcx, QWORD PTR nz$[rsp] mov ebx, eax test eax, eax je SHORT $LN16@PMC_Subtru ; 726 : { ; 727 : DeallocateNumber(nz); call DeallocateNumber ; 728 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result); mov eax, -2 cmp ebx, -258 ; fffffffffffffefeH cmove ebx, eax mov eax, ebx ; 741 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN16@PMC_Subtru: ; 729 : } ; 730 : if ((result = CheckBlockLight(nz->BLOCK, nz_light_check_code)) != PMC_STATUS_OK) mov rdx, QWORD PTR nz_light_check_code$1[rsp] mov rcx, QWORD PTR [rcx+56] call CheckBlockLight test eax, eax jne SHORT $LN1@PMC_Subtru ; 731 : return (result); ; 732 : CommitNumber(nz); mov rcx, QWORD PTR nz$[rsp] call CommitNumber $LN12@PMC_Subtru: ; 733 : } ; 734 : *o = nz; mov rax, QWORD PTR nz$[rsp] ; 735 : } ; 736 : #ifdef _DEBUG ; 737 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK) ; 738 : return (result); ; 739 : #endif ; 740 : return (PMC_STATUS_OK); mov QWORD PTR [rsi], rax xor eax, eax ; 741 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN20@PMC_Subtru: ; 671 : return (PMC_STATUS_ARGUMENT_ERROR); mov eax, -1 $LN1@PMC_Subtru: ; 741 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 PMC_Subtruct_X_X ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT PMC_Subtruct_X_L _TEXT SEGMENT nz$ = 64 x$ = 64 y$ = 72 o$ = 80 nz_light_check_code$1 = 88 PMC_Subtruct_X_L PROC ; COMDAT ; 524 : { $LN69: mov QWORD PTR [rsp+16], rbx mov QWORD PTR [rsp+24], rsi push rdi sub rsp, 48 ; 00000030H mov rsi, r8 mov rdi, rdx mov rbx, rcx ; 525 : if (__UNIT_TYPE_BIT_COUNT * 2 < sizeof(y) * 8) ; 526 : { ; 527 : // _UINT64_T が 2 ワードで表現しきれない処理系には対応しない ; 528 : return (PMC_STATUS_INTERNAL_ERROR); ; 529 : } ; 530 : if (x == NULL) test rcx, rcx je $LN65@PMC_Subtru ; 531 : return (PMC_STATUS_ARGUMENT_ERROR); ; 532 : if (o == NULL) test r8, r8 je $LN65@PMC_Subtru ; 534 : NUMBER_HEADER* nx = (NUMBER_HEADER*)x; ; 535 : PMC_STATUS_CODE result; ; 536 : if ((result = CheckNumber(nx)) != PMC_STATUS_OK) call CheckNumber test eax, eax jne $LN1@PMC_Subtru ; 537 : return (result); ; 538 : NUMBER_HEADER* nz; ; 539 : if (nx->IS_ZERO) test BYTE PTR [rbx+40], 2 je SHORT $LN6@PMC_Subtru ; 540 : { ; 541 : // x が 0 である場合 ; 542 : ; 543 : if (y == 0) test rdi, rdi jne SHORT $LN64@PMC_Subtru ; 652 : nz = &number_zero; ; 653 : } ; 654 : } ; 655 : *o = nz; ; 656 : } ; 657 : #ifdef _DEBUG ; 658 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK) ; 659 : return (result); ; 660 : #endif ; 661 : return (PMC_STATUS_OK); lea rax, OFFSET FLAT:number_zero mov QWORD PTR [rsi], rax xor eax, eax ; 662 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN6@PMC_Subtru: ; 544 : { ; 545 : // y が 0 である場合 ; 546 : ; 547 : // x と y がともに 0 であるので、演算結果の 0 を呼び出し元に返す。 ; 548 : *o = &number_zero; ; 549 : } ; 550 : else ; 551 : { ; 552 : // y が 0 ではない場合 ; 553 : ; 554 : // 演算結果は負となってしまうのでエラーを返す。 ; 555 : return (PMC_STATUS_OVERFLOW); ; 556 : } ; 557 : } ; 558 : else ; 559 : { ; 560 : // x が 0 ではない場合 ; 561 : ; 562 : if (y == 0) test rdi, rdi jne SHORT $LN10@PMC_Subtru ; 563 : { ; 564 : // y が 0 である場合 ; 565 : ; 566 : // 演算結果となる x の値を持つ NUMBER_HEADER 構造体を獲得し、呼び出し元へ返す。 ; 567 : if ((result = DuplicateNumber(nx, &nz)) != PMC_STATUS_OK) lea rdx, QWORD PTR nz$[rsp] mov rcx, rbx call DuplicateNumber test eax, eax jne $LN1@PMC_Subtru mov rax, QWORD PTR nz$[rsp] ; 652 : nz = &number_zero; ; 653 : } ; 654 : } ; 655 : *o = nz; ; 656 : } ; 657 : #ifdef _DEBUG ; 658 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK) ; 659 : return (result); ; 660 : #endif ; 661 : return (PMC_STATUS_OK); mov QWORD PTR [rsi], rax xor eax, eax ; 662 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN10@PMC_Subtru: ; 568 : return (result); ; 569 : } ; 570 : else ; 571 : { ; 572 : // x と y がともに 0 ではない場合 ; 573 : ; 574 : // x と y の差を計算する ; 575 : if (__UNIT_TYPE_BIT_COUNT < sizeof(y) * 8) ; 576 : { ; 577 : // _UINT64_T が 1 ワードで表現しきれない場合 ; 578 : ; 579 : __UNIT_TYPE x_bit_count = nx->UNIT_BIT_COUNT; ; 580 : _UINT32_T y_hi; ; 581 : _UINT32_T y_lo = _FROMDWORDTOWORD(y, &y_hi); ; 582 : if (y_hi == 0) ; 583 : { ; 584 : // y の値が 32bit で表現可能な場合 ; 585 : __UNIT_TYPE y_bit_count = sizeof(y_lo) * 8 - _LZCNT_ALT_32(y_lo); ; 586 : if (x_bit_count < y_bit_count) ; 587 : { ; 588 : // 演算結果は負となってしまうのでエラーを返す。 ; 589 : return (PMC_STATUS_OVERFLOW); ; 590 : } ; 591 : __UNIT_TYPE z_bit_count = x_bit_count; ; 592 : __UNIT_TYPE nz_light_check_code; ; 593 : if ((result = AllocateNumber(&nz, z_bit_count, &nz_light_check_code)) != PMC_STATUS_OK) ; 594 : return (result); ; 595 : if ((result = Subtruct_X_1W(nx->BLOCK, nx->UNIT_WORD_COUNT, y_lo, nz->BLOCK, nz->BLOCK_COUNT)) != PMC_STATUS_OK) ; 596 : { ; 597 : DeallocateNumber(nz); ; 598 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result); ; 599 : } ; 600 : if ((result = CheckBlockLight(nz->BLOCK, nz_light_check_code)) != PMC_STATUS_OK) ; 601 : return (result); ; 602 : } ; 603 : else ; 604 : { ; 605 : // y の値が 32bit では表現できない場合 ; 606 : __UNIT_TYPE y_bit_count = sizeof(y) * 8 - _LZCNT_ALT_32(y_hi); ; 607 : if (x_bit_count < y_bit_count) ; 608 : { ; 609 : // 演算結果は負となってしまうのでエラーを返す。 ; 610 : return (PMC_STATUS_OVERFLOW); ; 611 : } ; 612 : __UNIT_TYPE z_bit_count = x_bit_count; ; 613 : __UNIT_TYPE nz_light_check_code; ; 614 : if ((result = AllocateNumber(&nz, z_bit_count, &nz_light_check_code)) != PMC_STATUS_OK) ; 615 : return (result); ; 616 : if ((result = Subtruct_X_2W(nx->BLOCK, nx->UNIT_WORD_COUNT, y_hi, y_lo, nz->BLOCK, nz->BLOCK_COUNT)) != PMC_STATUS_OK) ; 617 : { ; 618 : DeallocateNumber(nz); ; 619 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result); ; 620 : } ; 621 : if ((result = CheckBlockLight(nz->BLOCK, nz_light_check_code)) != PMC_STATUS_OK) ; 622 : return (result); ; 623 : } ; 624 : } ; 625 : else ; 626 : { ; 627 : // _UINT64_T が 1 ワードで表現できる場合 ; 628 : ; 629 : __UNIT_TYPE x_bit_count = nx->UNIT_BIT_COUNT; mov rdx, QWORD PTR [rbx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 654 : return (sizeof(x) * 8 - 1 - pos); mov ecx, 63 ; 0000003fH bsr rax, rdi sub ecx, eax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 630 : __UNIT_TYPE y_bit_count = sizeof(y) * 8 - _LZCNT_ALT_UNIT((__UNIT_TYPE)y); movsxd rax, ecx mov ecx, 64 ; 00000040H sub rcx, rax ; 631 : if (x_bit_count < y_bit_count) cmp rdx, rcx jae SHORT $LN25@PMC_Subtru $LN64@PMC_Subtru: ; 632 : { ; 633 : // 演算結果は負となってしまうのでエラーを返す。 ; 634 : return (PMC_STATUS_OVERFLOW); mov eax, -2 ; 662 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN25@PMC_Subtru: ; 635 : } ; 636 : __UNIT_TYPE z_bit_count = x_bit_count; ; 637 : __UNIT_TYPE nz_light_check_code; ; 638 : if ((result = AllocateNumber(&nz, z_bit_count, &nz_light_check_code)) != PMC_STATUS_OK) lea r8, QWORD PTR nz_light_check_code$1[rsp] lea rcx, QWORD PTR nz$[rsp] call AllocateNumber test eax, eax jne $LN1@PMC_Subtru ; 639 : return (result); ; 640 : if ((result = Subtruct_X_1W(nx->BLOCK, nx->UNIT_WORD_COUNT, (__UNIT_TYPE)y, nz->BLOCK, nz->BLOCK_COUNT)) != PMC_STATUS_OK) mov r9, QWORD PTR nz$[rsp] mov r8, rdi mov rdx, QWORD PTR [rbx+8] mov rcx, QWORD PTR [rbx+56] mov rax, QWORD PTR [r9+48] mov r9, QWORD PTR [r9+56] mov QWORD PTR [rsp+32], rax call Subtruct_X_1W mov rcx, QWORD PTR nz$[rsp] mov ebx, eax test eax, eax je SHORT $LN27@PMC_Subtru ; 641 : { ; 642 : DeallocateNumber(nz); call DeallocateNumber ; 643 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result); mov eax, -2 cmp ebx, -258 ; fffffffffffffefeH cmove ebx, eax mov eax, ebx ; 662 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN27@PMC_Subtru: ; 644 : } ; 645 : if ((result = CheckBlockLight(nz->BLOCK, nz_light_check_code)) != PMC_STATUS_OK) mov rdx, QWORD PTR nz_light_check_code$1[rsp] mov rcx, QWORD PTR [rcx+56] call CheckBlockLight test eax, eax jne SHORT $LN1@PMC_Subtru ; 646 : return (result); ; 647 : } ; 648 : CommitNumber(nz); mov rcx, QWORD PTR nz$[rsp] call CommitNumber ; 649 : if (nz->IS_ZERO) mov rax, QWORD PTR nz$[rsp] test BYTE PTR [rax+40], 2 je SHORT $LN29@PMC_Subtru ; 650 : { ; 651 : DeallocateNumber(nz); mov rcx, rax call DeallocateNumber ; 652 : nz = &number_zero; ; 653 : } ; 654 : } ; 655 : *o = nz; ; 656 : } ; 657 : #ifdef _DEBUG ; 658 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK) ; 659 : return (result); ; 660 : #endif ; 661 : return (PMC_STATUS_OK); lea rax, OFFSET FLAT:number_zero $LN29@PMC_Subtru: mov QWORD PTR [rsi], rax xor eax, eax ; 662 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN65@PMC_Subtru: ; 533 : return (PMC_STATUS_ARGUMENT_ERROR); mov eax, -1 $LN1@PMC_Subtru: ; 662 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 PMC_Subtruct_X_L ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT PMC_Subtruct_X_I _TEXT SEGMENT nw$ = 64 u$ = 64 v$ = 72 w$ = 80 w_light_check_code$1 = 88 PMC_Subtruct_X_I PROC ; COMDAT ; 269 : { $LN27: mov QWORD PTR [rsp+16], rbx mov QWORD PTR [rsp+24], rsi push rdi sub rsp, 48 ; 00000030H mov edi, edx mov rsi, r8 mov rbx, rcx ; 270 : if (__UNIT_TYPE_BIT_COUNT < sizeof(v) * 8) ; 271 : { ; 272 : // _UINT32_T が 1 ワードで表現しきれない処理系には対応しない ; 273 : return (PMC_STATUS_INTERNAL_ERROR); ; 274 : } ; 275 : if (u == NULL) test rcx, rcx je $LN23@PMC_Subtru ; 276 : return (PMC_STATUS_ARGUMENT_ERROR); ; 277 : if (w == NULL) test r8, r8 je $LN23@PMC_Subtru ; 279 : NUMBER_HEADER* nu = (NUMBER_HEADER*)u; ; 280 : PMC_STATUS_CODE result; ; 281 : if ((result = CheckNumber(nu)) != PMC_STATUS_OK) call CheckNumber test eax, eax jne $LN1@PMC_Subtru ; 282 : return (result); ; 283 : NUMBER_HEADER* nw; ; 284 : if (nu->IS_ZERO) test BYTE PTR [rbx+40], 2 je SHORT $LN6@PMC_Subtru ; 285 : { ; 286 : // u が 0 である場合 ; 287 : ; 288 : if (v == 0) test edi, edi jne SHORT $LN22@PMC_Subtru ; 342 : nw = &number_zero; ; 343 : } ; 344 : } ; 345 : *w = nw; ; 346 : } ; 347 : #ifdef _DEBUG ; 348 : if ((result = CheckNumber(*w)) != PMC_STATUS_OK) ; 349 : return (result); ; 350 : #endif ; 351 : return (PMC_STATUS_OK); lea rax, OFFSET FLAT:number_zero mov QWORD PTR [rsi], rax xor eax, eax ; 352 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN6@PMC_Subtru: ; 289 : { ; 290 : // v が 0 である場合 ; 291 : ; 292 : // u と v がともに 0 であるので、演算結果の 0 を呼び出し元に返す。 ; 293 : *w = &number_zero; ; 294 : } ; 295 : else ; 296 : { ; 297 : // v が 0 ではない場合 ; 298 : ; 299 : // 演算結果は負となってしまうのでエラーを返す。 ; 300 : return (PMC_STATUS_OVERFLOW); ; 301 : } ; 302 : } ; 303 : else ; 304 : { ; 305 : // u が 0 ではない場合 ; 306 : ; 307 : if (v == 0) test edi, edi jne SHORT $LN10@PMC_Subtru ; 308 : { ; 309 : // v が 0 である場合 ; 310 : ; 311 : // 演算結果となる x の値を持つ NUMBER_HEADER 構造体を獲得し、呼び出し元へ返す。 ; 312 : if ((result = DuplicateNumber(nu, &nw)) != PMC_STATUS_OK) lea rdx, QWORD PTR nw$[rsp] mov rcx, rbx call DuplicateNumber test eax, eax jne $LN1@PMC_Subtru mov rax, QWORD PTR nw$[rsp] ; 342 : nw = &number_zero; ; 343 : } ; 344 : } ; 345 : *w = nw; ; 346 : } ; 347 : #ifdef _DEBUG ; 348 : if ((result = CheckNumber(*w)) != PMC_STATUS_OK) ; 349 : return (result); ; 350 : #endif ; 351 : return (PMC_STATUS_OK); mov QWORD PTR [rsi], rax xor eax, eax ; 352 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN10@PMC_Subtru: ; 313 : return (result); ; 314 : } ; 315 : else ; 316 : { ; 317 : // u と v がともに 0 ではない場合 ; 318 : ; 319 : // u と v の差を計算する ; 320 : __UNIT_TYPE u_bit_count = nu->UNIT_BIT_COUNT; mov rdx, QWORD PTR [rbx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 607 : return (sizeof(x) * 8 - 1 - pos); mov ecx, 31 bsr eax, edi sub ecx, eax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 321 : __UNIT_TYPE v_bit_count = sizeof(v) * 8 - _LZCNT_ALT_32(v); movsxd rax, ecx mov ecx, 32 ; 00000020H sub rcx, rax ; 322 : if (u_bit_count < v_bit_count) cmp rdx, rcx jae SHORT $LN13@PMC_Subtru $LN22@PMC_Subtru: ; 323 : { ; 324 : // 演算結果は負となってしまうのでエラーを返す。 ; 325 : return (PMC_STATUS_OVERFLOW); mov eax, -2 ; 352 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN13@PMC_Subtru: ; 326 : } ; 327 : __UNIT_TYPE w_bit_count = u_bit_count; ; 328 : __UNIT_TYPE w_light_check_code; ; 329 : if ((result = AllocateNumber(&nw, w_bit_count, &w_light_check_code)) != PMC_STATUS_OK) lea r8, QWORD PTR w_light_check_code$1[rsp] lea rcx, QWORD PTR nw$[rsp] call AllocateNumber test eax, eax jne $LN1@PMC_Subtru ; 330 : return (result); ; 331 : if ((result = Subtruct_X_1W(nu->BLOCK, nu->UNIT_WORD_COUNT, v, nw->BLOCK, nw->BLOCK_COUNT)) != PMC_STATUS_OK) mov r9, QWORD PTR nw$[rsp] mov r8, rdi mov rdx, QWORD PTR [rbx+8] mov rcx, QWORD PTR [rbx+56] mov rax, QWORD PTR [r9+48] mov r9, QWORD PTR [r9+56] mov QWORD PTR [rsp+32], rax call Subtruct_X_1W mov rcx, QWORD PTR nw$[rsp] mov ebx, eax test eax, eax je SHORT $LN15@PMC_Subtru ; 332 : { ; 333 : DeallocateNumber(nw); call DeallocateNumber ; 334 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result); mov eax, -2 cmp ebx, -258 ; fffffffffffffefeH cmove ebx, eax mov eax, ebx ; 352 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN15@PMC_Subtru: ; 335 : } ; 336 : if ((result = CheckBlockLight(nw->BLOCK, w_light_check_code)) != PMC_STATUS_OK) mov rdx, QWORD PTR w_light_check_code$1[rsp] mov rcx, QWORD PTR [rcx+56] call CheckBlockLight test eax, eax jne SHORT $LN1@PMC_Subtru ; 337 : return (result); ; 338 : CommitNumber(nw); mov rcx, QWORD PTR nw$[rsp] call CommitNumber ; 339 : if (nw->IS_ZERO) mov rax, QWORD PTR nw$[rsp] test BYTE PTR [rax+40], 2 je SHORT $LN17@PMC_Subtru ; 340 : { ; 341 : DeallocateNumber(nw); mov rcx, rax call DeallocateNumber ; 342 : nw = &number_zero; ; 343 : } ; 344 : } ; 345 : *w = nw; ; 346 : } ; 347 : #ifdef _DEBUG ; 348 : if ((result = CheckNumber(*w)) != PMC_STATUS_OK) ; 349 : return (result); ; 350 : #endif ; 351 : return (PMC_STATUS_OK); lea rax, OFFSET FLAT:number_zero $LN17@PMC_Subtru: mov QWORD PTR [rsi], rax xor eax, eax ; 352 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 $LN23@PMC_Subtru: ; 278 : return (PMC_STATUS_ARGUMENT_ERROR); mov eax, -1 $LN1@PMC_Subtru: ; 352 : } mov rbx, QWORD PTR [rsp+72] mov rsi, QWORD PTR [rsp+80] add rsp, 48 ; 00000030H pop rdi ret 0 PMC_Subtruct_X_I ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT PMC_Subtruct_L_X _TEXT SEGMENT u$ = 48 v$ = 56 w$ = 64 PMC_Subtruct_L_X PROC ; COMDAT ; 355 : { $LN58: mov QWORD PTR [rsp+8], rbx mov QWORD PTR [rsp+16], rsi push rdi sub rsp, 32 ; 00000020H mov rdi, r8 mov rsi, rdx mov rbx, rcx ; 356 : if (__UNIT_TYPE_BIT_COUNT * 2 < sizeof(u) * 8) ; 357 : { ; 358 : // _UINT64_T が 2 ワードで表現しきれない処理系には対応しない ; 359 : return (PMC_STATUS_INTERNAL_ERROR); ; 360 : } ; 361 : if (v == NULL) test rdx, rdx je $LN55@PMC_Subtru ; 362 : return (PMC_STATUS_ARGUMENT_ERROR); ; 363 : if (w == NULL) test r8, r8 je $LN55@PMC_Subtru ; 365 : NUMBER_HEADER* nv = (NUMBER_HEADER*)v; ; 366 : PMC_STATUS_CODE result; ; 367 : if ((result = CheckNumber(nv)) != PMC_STATUS_OK) mov rcx, rdx call CheckNumber test eax, eax jne $LN1@PMC_Subtru ; 368 : return (result); ; 369 : if (u == 0) mov eax, DWORD PTR [rsi+40] and eax, 2 test rbx, rbx jne SHORT $LN6@PMC_Subtru ; 370 : { ; 371 : // u が 0 である場合 ; 372 : ; 373 : if (nv->IS_ZERO) test eax, eax je SHORT $LN54@PMC_Subtru ; 374 : { ; 375 : // v が 0 である場合 ; 376 : ; 377 : // x と y がともに 0 であるので、演算結果の 0 を呼び出し元に返す。 ; 378 : *w = 0; mov QWORD PTR [rdi], rbx ; 511 : } ; 512 : else ; 513 : { ; 514 : *w = temp_w; ; 515 : } ; 516 : } ; 517 : } ; 518 : } ; 519 : } ; 520 : return (PMC_STATUS_OK); xor eax, eax ; 521 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 $LN6@PMC_Subtru: ; 379 : } ; 380 : else ; 381 : { ; 382 : // v が 0 ではない場合 ; 383 : ; 384 : // 演算結果は負となってしまうのでエラーを返す。 ; 385 : return (PMC_STATUS_OVERFLOW); ; 386 : } ; 387 : } ; 388 : else ; 389 : { ; 390 : // u が 0 ではない場合 ; 391 : ; 392 : if (nv->IS_ZERO) test eax, eax jne SHORT $LN56@PMC_Subtru ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 644 : _BitScanReverse64(&pos, x); bsr rax, rbx ; 645 : #elif defined(__GNUC__) ; 646 : _UINT64_T pos; ; 647 : __asm__("bsrq %1, %0" : "=r"(pos) : "rm"(x)); ; 648 : #else ; 649 : #error unknown compiler ; 650 : #endif ; 651 : #else ; 652 : #error unknown platform ; 653 : #endif ; 654 : return (sizeof(x) * 8 - 1 - pos); mov ecx, 63 ; 0000003fH sub ecx, eax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 490 : __UNIT_TYPE u_bit_count = sizeof(u) * 8 - _LZCNT_ALT_UNIT((__UNIT_TYPE)u); movsxd rax, ecx mov ecx, 64 ; 00000040H sub rcx, rax ; 491 : __UNIT_TYPE v_bit_count = nv->UNIT_BIT_COUNT; ; 492 : if (u_bit_count < v_bit_count) cmp rcx, QWORD PTR [rsi+16] jb SHORT $LN54@PMC_Subtru ; 493 : { ; 494 : // 明らかに u < v である場合 ; 495 : ; 496 : // 演算結果は負となってしまうのでエラーを返す。 ; 497 : return (PMC_STATUS_OVERFLOW); ; 498 : } ; 499 : else ; 500 : { ; 501 : // u のビット長が v のビット長以上である場合 ; 502 : ; 503 : // u が 64bit 整数で表現できるので v も 64bit 整数で表現できる ; 504 : ; 505 : __UNIT_TYPE temp_w; ; 506 : char borrow = _SUBTRUCT_UNIT(0, (__UNIT_TYPE)u, nv->BLOCK[0], &temp_w); mov rax, QWORD PTR [rsi+56] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sub rbx, QWORD PTR [rax] setb al ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 507 : if (borrow) test al, al jne SHORT $LN54@PMC_Subtru $LN56@PMC_Subtru: ; 511 : } ; 512 : else ; 513 : { ; 514 : *w = temp_w; ; 515 : } ; 516 : } ; 517 : } ; 518 : } ; 519 : } ; 520 : return (PMC_STATUS_OK); mov QWORD PTR [rdi], rbx xor eax, eax ; 521 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 $LN54@PMC_Subtru: ; 508 : { ; 509 : // ボローが発生した場合は演算結果が負なのでエラーとする ; 510 : return (PMC_STATUS_OVERFLOW); mov eax, -2 ; 521 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 $LN55@PMC_Subtru: ; 364 : return (PMC_STATUS_ARGUMENT_ERROR); mov eax, -1 $LN1@PMC_Subtru: ; 521 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 PMC_Subtruct_L_X ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT PMC_Subtruct_I_X _TEXT SEGMENT u$ = 48 v$ = 56 w$ = 64 PMC_Subtruct_I_X PROC ; COMDAT ; 189 : { $LN25: mov QWORD PTR [rsp+8], rbx mov QWORD PTR [rsp+16], rsi push rdi sub rsp, 32 ; 00000020H mov esi, ecx mov rbx, r8 mov rdi, rdx ; 190 : if (__UNIT_TYPE_BIT_COUNT < sizeof(u) * 8) ; 191 : { ; 192 : // _UINT32_T が 1 ワードで表現しきれない処理系には対応しない ; 193 : return (PMC_STATUS_INTERNAL_ERROR); ; 194 : } ; 195 : if (v == NULL) test rdx, rdx je $LN23@PMC_Subtru ; 196 : return (PMC_STATUS_ARGUMENT_ERROR); ; 197 : if (w == NULL) test rbx, rbx je $LN23@PMC_Subtru ; 199 : NUMBER_HEADER* nv = (NUMBER_HEADER*)v; ; 200 : PMC_STATUS_CODE result; ; 201 : if ((result = CheckNumber(nv)) != PMC_STATUS_OK) mov rcx, rdx call CheckNumber test eax, eax jne $LN1@PMC_Subtru ; 202 : return (result); ; 203 : if (u == 0) mov eax, DWORD PTR [rdi+40] and eax, 2 test esi, esi jne SHORT $LN6@PMC_Subtru ; 204 : { ; 205 : // u が 0 である場合 ; 206 : ; 207 : if (nv->IS_ZERO) test eax, eax je SHORT $LN22@PMC_Subtru ; 208 : { ; 209 : // v が 0 である場合 ; 210 : ; 211 : // u と v がともに 0 であるので、演算結果の 0 を呼び出し元に返す。 ; 212 : *w = 0; mov DWORD PTR [rbx], esi ; 261 : } ; 262 : } ; 263 : } ; 264 : } ; 265 : return (PMC_STATUS_OK); xor eax, eax ; 266 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 $LN6@PMC_Subtru: ; 213 : } ; 214 : else ; 215 : { ; 216 : // v が 0 ではない場合 ; 217 : ; 218 : // 演算結果は負となってしまうのでエラーを返す。 ; 219 : return (PMC_STATUS_OVERFLOW); ; 220 : } ; 221 : } ; 222 : else ; 223 : { ; 224 : // u が 0 ではない場合 ; 225 : ; 226 : if (nv->IS_ZERO) test eax, eax je SHORT $LN10@PMC_Subtru ; 227 : { ; 228 : // v が 0 である場合 ; 229 : ; 230 : // 演算結果となる u の値を持つ NUMBER_HEADER 構造体を獲得し、呼び出し元へ返す。 ; 231 : *w = u; mov DWORD PTR [rbx], esi ; 261 : } ; 262 : } ; 263 : } ; 264 : } ; 265 : return (PMC_STATUS_OK); xor eax, eax ; 266 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 $LN10@PMC_Subtru: ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 601 : _BitScanReverse(&pos, x); bsr eax, esi ; 602 : #elif defined(__GNUC__) ; 603 : __asm__("bsrl %1, %0" : "=r"(pos) : "rm"(x)); ; 604 : #else ; 605 : #error unknown compiler ; 606 : #endif ; 607 : return (sizeof(x) * 8 - 1 - pos); mov ecx, 31 sub ecx, eax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 238 : __UNIT_TYPE u_bit_count = sizeof(u) * 8 - _LZCNT_ALT_32(u); movsxd rax, ecx mov ecx, 32 ; 00000020H sub rcx, rax ; 239 : __UNIT_TYPE v_bit_count = nv->UNIT_BIT_COUNT; ; 240 : if (u_bit_count < v_bit_count) cmp rcx, QWORD PTR [rdi+16] jb SHORT $LN22@PMC_Subtru ; 241 : { ; 242 : // 明らかに u < v である場合 ; 243 : // 演算結果は負となってしまうのでエラーを返す。 ; 244 : return (PMC_STATUS_OVERFLOW); ; 245 : } ; 246 : else ; 247 : { ; 248 : // u のビット長が v のビット長以上である場合 ; 249 : ; 250 : // u が 32bit 整数なので、v も32bit 整数で表現できる ; 251 : __UNIT_TYPE temp_w; ; 252 : char borrow = _SUBTRUCT_UNIT(0, u, nv->BLOCK[0], &temp_w); mov rax, QWORD PTR [rdi+56] mov rcx, rsi ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sub rcx, QWORD PTR [rax] setb al ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 253 : if (borrow) test al, al jne SHORT $LN22@PMC_Subtru ; 257 : } ; 258 : else ; 259 : { ; 260 : *w = (_UINT32_T)temp_w; mov DWORD PTR [rbx], ecx ; 261 : } ; 262 : } ; 263 : } ; 264 : } ; 265 : return (PMC_STATUS_OK); xor eax, eax ; 266 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 $LN22@PMC_Subtru: ; 254 : { ; 255 : // ボローが発生した場合は演算結果が負なのでエラーとする ; 256 : return (PMC_STATUS_OVERFLOW); mov eax, -2 ; 266 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 $LN23@PMC_Subtru: ; 198 : return (PMC_STATUS_ARGUMENT_ERROR); mov eax, -1 $LN1@PMC_Subtru: ; 266 : } mov rbx, QWORD PTR [rsp+48] mov rsi, QWORD PTR [rsp+56] add rsp, 32 ; 00000020H pop rdi ret 0 PMC_Subtruct_I_X ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT Initialize_Subtruct _TEXT SEGMENT feature$ = 8 Initialize_Subtruct PROC ; COMDAT ; 745 : return (PMC_STATUS_OK); xor eax, eax ; 746 : } ret 0 Initialize_Subtruct ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; COMDAT Subtruct_Imp _TEXT SEGMENT up$ = 48 u_count$ = 56 vp$ = 64 v_count$ = 72 wp$ = 80 w_count$ = 88 Subtruct_Imp PROC ; COMDAT ; 125 : { $LN140: push rbx sub rsp, 32 ; 00000020H ; 126 : char c = 0; ; 127 : ; 128 : // まず 32 ワードずつ減算をする。 ; 129 : __UNIT_TYPE count = v_count >> 5; mov rbx, r9 mov r10, rdx mov rdx, rcx shr rbx, 5 xor cl, cl mov r11, r9 ; 130 : while (count != 0) mov r9, QWORD PTR wp$[rsp] test rbx, rbx je $LN3@Subtruct_I npad 10 $LL2@Subtruct_I: ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 808 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 809 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rax, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 810 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]); mov rax, QWORD PTR [rdx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+16] mov QWORD PTR [r9+16], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 811 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]); mov rax, QWORD PTR [rdx+24] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+24] mov QWORD PTR [r9+24], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 812 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]); mov rax, QWORD PTR [rdx+32] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+32] mov QWORD PTR [r9+32], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 813 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]); mov rax, QWORD PTR [rdx+40] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+40] mov QWORD PTR [r9+40], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 814 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]); mov rax, QWORD PTR [rdx+48] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+48] mov QWORD PTR [r9+48], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 815 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]); mov rax, QWORD PTR [rdx+56] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+56] mov QWORD PTR [r9+56], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 816 : c = _SUBTRUCT_UNIT(c, xp[8], yp[8], &zp[8]); mov rax, QWORD PTR [rdx+64] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+64] mov QWORD PTR [r9+64], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 817 : c = _SUBTRUCT_UNIT(c, xp[9], yp[9], &zp[9]); mov rax, QWORD PTR [rdx+72] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+72] mov QWORD PTR [r9+72], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 818 : c = _SUBTRUCT_UNIT(c, xp[10], yp[10], &zp[10]); mov rax, QWORD PTR [rdx+80] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+80] mov QWORD PTR [r9+80], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 819 : c = _SUBTRUCT_UNIT(c, xp[11], yp[11], &zp[11]); mov rax, QWORD PTR [rdx+88] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+88] mov QWORD PTR [r9+88], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 820 : c = _SUBTRUCT_UNIT(c, xp[12], yp[12], &zp[12]); mov rax, QWORD PTR [rdx+96] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+96] mov QWORD PTR [r9+96], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 821 : c = _SUBTRUCT_UNIT(c, xp[13], yp[13], &zp[13]); mov rax, QWORD PTR [rdx+104] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+104] mov QWORD PTR [r9+104], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 822 : c = _SUBTRUCT_UNIT(c, xp[14], yp[14], &zp[14]); mov rax, QWORD PTR [rdx+112] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+112] mov QWORD PTR [r9+112], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 823 : c = _SUBTRUCT_UNIT(c, xp[15], yp[15], &zp[15]); mov rax, QWORD PTR [rdx+120] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+120] mov QWORD PTR [r9+120], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 824 : c = _SUBTRUCT_UNIT(c, xp[16], yp[16], &zp[16]); mov rax, QWORD PTR [rdx+128] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+128] mov QWORD PTR [r9+128], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 825 : c = _SUBTRUCT_UNIT(c, xp[17], yp[17], &zp[17]); mov rax, QWORD PTR [rdx+136] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+136] mov QWORD PTR [r9+136], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 826 : c = _SUBTRUCT_UNIT(c, xp[18], yp[18], &zp[18]); mov rax, QWORD PTR [rdx+144] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+144] mov QWORD PTR [r9+144], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 827 : c = _SUBTRUCT_UNIT(c, xp[19], yp[19], &zp[19]); mov rax, QWORD PTR [rdx+152] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+152] mov QWORD PTR [r9+152], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 828 : c = _SUBTRUCT_UNIT(c, xp[20], yp[20], &zp[20]); mov rax, QWORD PTR [rdx+160] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+160] mov QWORD PTR [r9+160], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 829 : c = _SUBTRUCT_UNIT(c, xp[21], yp[21], &zp[21]); mov rax, QWORD PTR [rdx+168] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+168] mov QWORD PTR [r9+168], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 830 : c = _SUBTRUCT_UNIT(c, xp[22], yp[22], &zp[22]); mov rax, QWORD PTR [rdx+176] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+176] mov QWORD PTR [r9+176], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 831 : c = _SUBTRUCT_UNIT(c, xp[23], yp[23], &zp[23]); mov rax, QWORD PTR [rdx+184] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+184] mov QWORD PTR [r9+184], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 832 : c = _SUBTRUCT_UNIT(c, xp[24], yp[24], &zp[24]); mov rax, QWORD PTR [rdx+192] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+192] mov QWORD PTR [r9+192], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 833 : c = _SUBTRUCT_UNIT(c, xp[25], yp[25], &zp[25]); mov rax, QWORD PTR [rdx+200] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+200] mov QWORD PTR [r9+200], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 834 : c = _SUBTRUCT_UNIT(c, xp[26], yp[26], &zp[26]); mov rax, QWORD PTR [rdx+208] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+208] mov QWORD PTR [r9+208], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 835 : c = _SUBTRUCT_UNIT(c, xp[27], yp[27], &zp[27]); mov rax, QWORD PTR [rdx+216] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+216] mov QWORD PTR [r9+216], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 836 : c = _SUBTRUCT_UNIT(c, xp[28], yp[28], &zp[28]); mov rax, QWORD PTR [rdx+224] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+224] mov QWORD PTR [r9+224], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 837 : c = _SUBTRUCT_UNIT(c, xp[29], yp[29], &zp[29]); mov rax, QWORD PTR [rdx+232] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+232] mov QWORD PTR [r9+232], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 838 : c = _SUBTRUCT_UNIT(c, xp[30], yp[30], &zp[30]); mov rax, QWORD PTR [rdx+240] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+240] mov QWORD PTR [r9+240], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 839 : c = _SUBTRUCT_UNIT(c, xp[31], yp[31], &zp[31]); mov rax, QWORD PTR [rdx+248] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+248] mov QWORD PTR [r9+248], rax setb cl ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 133 : up += 32; add rdx, 256 ; 00000100H ; 134 : vp += 32; add r8, 256 ; 00000100H ; 135 : wp += 32; add r9, 256 ; 00000100H ; 136 : --count; sub rbx, 1 jne $LL2@Subtruct_I $LN3@Subtruct_I: ; 137 : } ; 138 : // この時点で未処理の桁は 32 ワード未満のはず ; 139 : ; 140 : // 未処理の桁が 16 ワード以上あるなら 16 ワード減算を行う。 ; 141 : if (v_count & 0x10) test r11b, 16 je SHORT $LN4@Subtruct_I ; 142 : { ; 143 : c = _SUBTRUCT_16WORDS_SBB(c, up, vp, wp); call _SUBTRUCT_16WORDS_SBB ; 144 : up += 16; sub rdx, -128 ; ffffffffffffff80H ; 145 : vp += 16; sub r8, -128 ; ffffffffffffff80H ; 146 : wp += 16; sub r9, -128 ; ffffffffffffff80H movzx ecx, al $LN4@Subtruct_I: ; 147 : } ; 148 : // この時点で未処理の桁は 16 ワード未満のはず ; 149 : ; 150 : // 未処理の桁が 8 ワード以上あるなら 8 ワード減算を行う。 ; 151 : if (v_count & 0x8) test r11b, 8 je SHORT $LN5@Subtruct_I ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3456 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3457 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rax, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3458 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]); mov rax, QWORD PTR [rdx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+16] mov QWORD PTR [r9+16], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3459 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]); mov rax, QWORD PTR [rdx+24] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+24] mov QWORD PTR [r9+24], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3460 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]); mov rax, QWORD PTR [rdx+32] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+32] mov QWORD PTR [r9+32], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3461 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]); mov rax, QWORD PTR [rdx+40] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+40] mov QWORD PTR [r9+40], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3462 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]); mov rax, QWORD PTR [rdx+48] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+48] mov QWORD PTR [r9+48], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 3463 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]); mov rax, QWORD PTR [rdx+56] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+56] mov QWORD PTR [r9+56], rax setb cl ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 154 : up += 8; add rdx, 64 ; 00000040H ; 155 : vp += 8; add r8, 64 ; 00000040H ; 156 : wp += 8; add r9, 64 ; 00000040H $LN5@Subtruct_I: ; 157 : } ; 158 : // この時点で未処理の桁は 8 ワード未満のはず ; 159 : ; 160 : // 未処理の桁が 4 ワード以上あるなら 4 ワード減算を行う。 ; 161 : if (v_count & 0x4) test r11b, 4 je SHORT $LN6@Subtruct_I ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4052 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4053 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rax, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4054 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]); mov rax, QWORD PTR [rdx+16] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+16] mov QWORD PTR [r9+16], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4055 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]); mov rax, QWORD PTR [rdx+24] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+24] mov QWORD PTR [r9+24], rax setb cl ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 164 : up += 4; add rdx, 32 ; 00000020H ; 165 : vp += 4; add r8, 32 ; 00000020H ; 166 : wp += 4; add r9, 32 ; 00000020H $LN6@Subtruct_I: ; 167 : } ; 168 : // この時点で未処理の桁は 4 ワード未満のはず ; 169 : ; 170 : // 未処理の桁が 2 ワード以上あるなら 2 ワード減算を行う。 ; 171 : if (v_count & 0x2) test r11b, 2 je SHORT $LN7@Subtruct_I ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4466 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h ; 4467 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]); mov rax, QWORD PTR [rdx+8] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); sbb rax, QWORD PTR [r8+8] mov QWORD PTR [r9+8], rax setb cl ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 174 : up += 2; add rdx, 16 ; 175 : vp += 2; add r8, 16 ; 176 : wp += 2; add r9, 16 $LN7@Subtruct_I: ; 177 : } ; 178 : // この時点で未処理の桁は 2 ワード未満のはず ; 179 : ; 180 : // 未処理の桁が 1 ワード以上あるなら 1 ワード減算を行う。 ; 181 : if (v_count & 1) test r11b, 1 je SHORT $LN8@Subtruct_I ; 182 : c = _SUBTRUCT_UNIT(c, *up++, *vp++, wp++); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, QWORD PTR [r8] mov QWORD PTR [r9], rax setb cl ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 182 : c = _SUBTRUCT_UNIT(c, *up++, *vp++, wp++); add rdx, 8 add r9, 8 $LN8@Subtruct_I: ; 183 : ; 184 : // 残りの桁の繰り上がりを計算し、復帰する。 ; 185 : return (DoBorrow(c, up, u_count - v_count, wp, w_count - v_count)); sub r10, r11 ; 44 : if (u_count <= 0) je SHORT $LN129@Subtruct_I $LL113@Subtruct_I: ; 49 : { ; 50 : // かつそれでも桁借りを行う必要がある場合 ; 51 : ; 52 : // 減算結果が負になってしまったので呼び出し元に通知する。 ; 53 : return (PMC_STATUS_INTERNAL_BORROW); ; 54 : } ; 55 : ; 56 : // xの最上位に達してしまった場合はいずれにしろループを中断して正常復帰する。 ; 57 : ; 58 : return (PMC_STATUS_OK); ; 59 : } ; 60 : else if (c) test cl, cl je SHORT $LN128@Subtruct_I ; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++); mov rax, QWORD PTR [rdx] ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h ; 273 : return (_subborrow_u64(borrow, u, v, w)); add cl, -1 sbb rax, 0 mov QWORD PTR [r9], rax setb cl ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c ; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++); add rdx, 8 add r9, 8 ; 66 : --u_count; sub r10, 1 jne SHORT $LL113@Subtruct_I $LN129@Subtruct_I: ; 45 : { ; 46 : // x の最上位まで達してしまった場合 ; 47 : ; 48 : if (c) neg cl sbb eax, eax and eax, -258 ; fffffffffffffefeH ; 186 : } add rsp, 32 ; 00000020H pop rbx ret 0 $LN128@Subtruct_I: ; 74 : while (u_count > 0) test r10, r10 je SHORT $LN117@Subtruct_I sub rdx, r9 npad 2 $LL116@Subtruct_I: ; 75 : { ; 76 : *wp++ = *up++; mov rax, QWORD PTR [rdx+r9] mov QWORD PTR [r9], rax lea r9, QWORD PTR [r9+8] ; 77 : --u_count; sub r10, 1 jne SHORT $LL116@Subtruct_I $LN117@Subtruct_I: ; 183 : ; 184 : // 残りの桁の繰り上がりを計算し、復帰する。 ; 185 : return (DoBorrow(c, up, u_count - v_count, wp, w_count - v_count)); xor eax, eax ; 186 : } add rsp, 32 ; 00000020H pop rbx ret 0 Subtruct_Imp ENDP _TEXT ENDS END
35.436248
158
0.68944
7137c48d215ca8eeef8459658dd2835705281bcf
6,119
asm
Assembly
base/boot/detect/i386/main.asm
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/boot/detect/i386/main.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/boot/detect/i386/main.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
title "Processor type and stepping detection" ;++ ; ; Copyright (c) 1989 Microsoft Corporation ; ; Module Name: ; ; main.asm ; ; Abstract: ; ; This file implements the main entry code for x86 hardware detection ; module. This assembly file is required in order to link C modules ; into a "/TINY" (single segment) memory module. ; ; Author: ; ; Shie-Lin Tzong (shielint) 15-Feb-1992. ; The code is extracted from NTLDR su.asm. ; ; Environment: ; ; x86 Real Mode. ; ; Revision History: ; ; ; Build Notes: ; ~~~~~~~~~~~~ ; The microsoft C compiler will not produce "tiny" model programs. In the ; tiny model, the entire program consists of only one segment. The small ; model produced by our compilers consists of two segments: DGROUP and _TEXT. ; If you convert a small model program into a tiny model program, DS (which ; should point to DGROUP (bss,const,data) will always be wrong. For this reason ; we need an assembly module to do a simple run-time fixup on SS and DS. To ; guarantee that DS will point to DGROUP no matter where the detection module ; is loaded, the paragraph (shifted right four bits) offset of DGROUP from ; _TEXT must be added to the value in CS to compute DS and SS. ; ; We get the linker to fixup the offset of the beginning of the dgroup segment ; relative to the beginning of the code segment and it's this value added ; to the value in CS that allows us to build a "tiny" model program in C ; without a lot of munging around in order to get the data reference offsets ; in the code correct. ; ; If the _TEXT:DGROUP fixup appears in other files (which it does), the linker ; will not compute the correct value unless the accumulated data pointer is ; zero when it gets there. Therefore, no data should be placed in the data segment ; until after all instances of _TEXT:DGROUP have been encountered by the linker. ; The linker processes files from right to left on the command line. ; ;-- .386p include main.inc _DATA SEGMENT PARA USE16 PUBLIC 'DATA' ; ; Define double wrod to save caller's (ntldr's) stack pointer ; NtldrStack df 0 ; saved area for ss:esp dw 2048 dup (0) DetectionStack equ $ _DATA ends _TEXT segment para use16 public 'CODE' ASSUME CS: _TEXT, DS: DGROUP, SS: DGROUP ;++ ; ; VOID ; DetectionMain ( ; ULONG HeapStart, ; ULONG HeapSize, ; ULONG ConfigurationTree, ; ULONG HeapUsed, ; ULONG LoadOptions, ; ULONG LoadOptionsLength ; ) ; ; Routine Description: ; ; This is the entry point of the detection module. ; Memory from HeapStart to (HeapStart + HeapSize) is allocated for detection ; module to store the hardware configuration tree. ; Note that detection module loaded address will be resued by loader after ; the control is passed back to ntldr. ; ; Arguments: ; ; HeapStart - supplies a 32 bit FLAT starting addr of the heap ; ; HeapSize - Supplies the size of the useable heap ; ; ConfigurationTree - Supplies a 32 bit FLAT address of the variable to ; receive the configuration tree. ; ; HeapUsed - Supplies a 32 bit FLAT address of the variable to receive ; the size of heap we acually used. ; ; LoadOptions - Supplies a 32 bit FLAT address of the load options string. ; ; LoadOptionsLength - Supplies the length of the LoadOptions string. Note, ; this is for sanity check to make sure the LoadOptions string is valid. ; (in case use usews Nt 1.0 ntldr with the new ntdetect.com.) ; ; Return Value: ; ; None. ; ;-- ; ; ; Run-time fixups for stack and data segment ; public DetectionMain DetectionMain: ; ; Save all the registers we need to preserved on NTLDR's stack ; push ebp mov ebp, esp and ebp, 0ffffh push ds push es push ebx push esi push edi ; ; Compute the paragraph needed for DS ; mov cx,offset _TEXT:DGROUP ; first calculate offset to data shr cx,4 ; must be para aligned mov ax,cs ; get base of code add ax,cx ; add paragraph offset to data ; ; Make DS point to the paragraph address of DGROUP ; mov ds,ax ; ds now points to beginning of DGROUP mov es,ax ; ; Save old stack pointer and set up our own stack. ; mov ecx, esp mov dword ptr NtldrStack, ecx mov cx, ss mov word ptr NtldrStack + 4, cx mov ebx, [bp + 8] ; [ebx] = Heap Start mov ecx, [bp + 12] ; [ecx] = Heap Size mov esi, [bp + 16] ; [esi] -> addr of ConfigurationTree mov edi, [bp + 20] ; [edi] -> Addr of HeapUsed variable mov edx, [bp + 24] ; [edx]-> Addr of LoadOptions string mov ebp, [bp + 28] ; [ebp] = length of LoadOptions mov ss,ax mov esp,offset DGROUP:DetectionStack ; (ss:esp) = top of internal stack ; ; Set up parameters and invoke real detection code to collect hardware ; information. ; push ebp push edx push edi push esi push ecx push ebx xor eax, eax xor ebx, ebx xor ecx, ecx xor edx, edx xor esi, esi xor edi, edi call _HardwareDetection ; ; The hardware detection is done. We need to switch to ntldr's stack, ; restore registers and return back to ntldr. ; lss esp, NtldrStack pop edi ; retore registers pop esi pop ebx pop es pop ds pop ebp retf _TEXT ends end DetectionMain
28.328704
84
0.594542
5aa69db6a2daa50b386b458c6ac914b10c1fc809
470
asm
Assembly
8_kyu/I_love_you_a_little_a_lot_passionately_not_at_all.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
8_kyu/I_love_you_a_little_a_lot_passionately_not_at_all.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
8_kyu/I_love_you_a_little_a_lot_passionately_not_at_all.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
SECTION .text global how_much_i_love_you how_much_i_love_you: xor rdx, rdx mov rax, rdi dec rax mov rcx, 6 div rcx ; rdx = (rdi-1) % 6 mov rax,[table+rdx*8] ret SECTION .data text0: db 'I love you',0 text1: db 'a little',0 text2: db 'a lot',0 text3: db 'passionately',0 text4: db 'madly',0 text5: db 'not at all',0 table: dq text0 dq text1 dq text2 dq text3 dq text4 dq text5
16.785714
46
0.570213
f88a4f7dc2aa5efa0cefa13361b6a41e52493aef
144
asm
Assembly
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Window.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Window.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Window.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: Window.asm Type: file Size: 25851 Last-Modified: '1992-11-18T01:48:27Z' SHA-1: 96B695104427D18C422FADA947172E82F6DA7868 Description: null
20.571429
47
0.8125
9fb8884c41a8a9d53c4177c15e3f8b451ea08a76
2,590
asm
Assembly
src/state_handlers/playing.asm
Xeyler/gb-hello-world
f8a10a3589caab9d3d183d459cdfd070c1d73070
[ "MIT" ]
null
null
null
src/state_handlers/playing.asm
Xeyler/gb-hello-world
f8a10a3589caab9d3d183d459cdfd070c1d73070
[ "MIT" ]
null
null
null
src/state_handlers/playing.asm
Xeyler/gb-hello-world
f8a10a3589caab9d3d183d459cdfd070c1d73070
[ "MIT" ]
null
null
null
SECTION "playing state handler", ROM0 state_playing: ld a, [h_scene_bank] set_rom_bank_from_a ; Get input ld a, [w_input_held] ld c, a call get_input ld [w_input_held], a ld d, a ld b, a xor c and b ld [w_input_pressed], a ld hl, h_scene_map ld c, [hl] inc hl ld b, [hl] ld a, [h_player_y] ld h, a ld a, [h_player_x] ld l, a push hl ; Move actor bit 3, d jp z, .dont_move_down ld a, l sub a, 7 ld l, a call get_tile_index_at_location pop hl push hl cp a, $20 jp c, .dont_move_down ld a, l add a, 6 ld l, a call get_tile_index_at_location pop hl push hl cp a, $20 jp c, .dont_move_down ld a, h inc a ld [h_player_y], a .dont_move_down: bit 2, d jp z, .dont_move_up ld a, l sub a, 7 ld l, a ld a, h sub a, 5 ld h, a call get_tile_index_at_location pop hl push hl cp a, $20 jp c, .dont_move_up ld a, l add a, 6 ld l, a ld a, h sub a, 5 ld h, a call get_tile_index_at_location pop hl push hl cp a, $20 jp c, .dont_move_up ld a, h dec a ld [h_player_y], a .dont_move_up: bit 1, d jp z, .dont_move_left ld a, l sub a, 8 ld l, a ld a, h sub a, 1 ld h, a call get_tile_index_at_location pop hl push hl cp a, $20 jp c, .dont_move_left ld a, l sub a, 8 ld l, a ld a, h sub a, 4 ld h, a call get_tile_index_at_location pop hl push hl cp a, $20 jp c, .dont_move_left ld a, l dec a ld [h_player_x], a .dont_move_left: bit 0, d jp z, .dont_move_right ld a, l add a, 7 ld l, a ld a, h sub a, 1 ld h, a call get_tile_index_at_location pop hl push hl cp a, $20 jp c, .dont_move_right ld a, l add a, 7 ld l, a ld a, h sub a, 4 ld h, a call get_tile_index_at_location pop hl push hl cp a, $20 jp c, .dont_move_right ld a, l inc a ld [h_player_x], a .dont_move_right: pop hl ; Check for events ; Update player location ld a, [h_player_y] ld hl, w_shadow_oam ld [hli], a ld a, [h_player_x] ld [hli], a inc hl inc hl ld a, [h_player_y] ld [hli], a ld a, [h_player_x] add 8 ld [hl], a ; Signal vblank to update ld a, VBLANK_FLAG_OAM_DMA ld [h_vblank_flag], a call wait_for_vblank jp state_playing ; @param h y position ; @param l x position ; @param bc tilemap pointer ; This function assumes the necessary ROM bank has already been set get_tile_index_at_location: srl l srl l srl l srl l srl h srl h srl h srl h swap h xor a or l or h ; a now contains tile location ld l, a xor a ld h, a add hl, bc ld a, [hl] ret SECTION "playing hram variables", HRAM h_player_x: db h_player_y: db
10.614754
67
0.647104
a7d35571a99e4b788a1f35c8ea439c9d46c6804f
1,331
asm
Assembly
programs/oeis/085/A085280.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/085/A085280.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/085/A085280.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A085280: Expansion of (1-4x+x^2)/((1-x)(1-3x)(1-4x)). ; 1,4,14,48,166,584,2094,7648,28406,107064,408574,1575248,6123846,23963944,94261454,372262848,1474702486,5855763224,23293912734,92788230448,369990660326,1476475856904,5895443074414,23550391238048,94107421773366,376147257556984,1503741741618494,6012425100645648,24042074805097606,96145422427935464,384513059334376974,1537846346205413248,6150767711425369046,24601217825512624344,98399312241483941854,393580571784236100848,1574272255591845403686,6296938927732084615624,25187305427022447465134,100747870856372116868448,402987430870335448497526,1611937565815882737061304,6447713790267153777458814,25790745742079483597476048,103162654711350539852826566,412649634074499975800073384,1650595581985293352366594894,6602373465003053756965283648,26409467271197856070357846806,105637789318348347408921523864,422550917974064159018156505374,1690202953998268944220037251248,6760809662299112701322382694246,27043232188114561578616231844744,108172909369212578634445030582254,432691579327113311497720431938848,1730766142859242236870702656584886,6923064048089335920122273412828024,27692254622314444598407482010777534,110769013779129081147385093121506448,443076040986130232850805867721214726 mov $1,$0 add $1,1 mov $2,4 pow $2,$0 mov $0,3 pow $0,$1 add $2,9 add $0,$2 sub $0,13 div $0,3 add $0,1
88.733333
1,169
0.89707
8a993e90e81a3c26545b23bde4f6da6bf5714f3f
369
asm
Assembly
programs/oeis/130/A130508.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/130/A130508.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/130/A130508.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A130508: a(1)=2. a(2)=3. a(3)=1. a(n+3) = 3 + a(n), for all positive integers n. ; 2,3,1,5,6,4,8,9,7,11,12,10,14,15,13,17,18,16,20,21,19,23,24,22,26,27,25,29,30,28,32,33,31,35,36,34,38,39,37,41,42,40,44,45,43,47,48,46,50,51,49,53,54,52,56,57,55,59,60,58,62,63,61,65,66,64,68 mov $1,$0 mul $0,2 sub $0,1 mod $0,3 mov $2,$0 lpb $2,1 add $1,3 trn $2,7 lpe sub $1,1
26.357143
193
0.590786
955c2aaff9dd4778d26e77a6041b180214966731
346
asm
Assembly
bootdict/x86/comma.asm
ikysil/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
8
2017-08-03T08:49:06.000Z
2021-12-17T12:02:19.000Z
bootdict/x86/comma.asm
clstrfsck/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
58
2016-04-21T20:03:54.000Z
2022-01-16T00:40:50.000Z
bootdict/x86/comma.asm
clstrfsck/ikforth
165e049fc007003cd05f59332dc856d553d8aac8
[ "Unlicense" ]
1
2018-07-25T21:07:00.000Z
2018-07-25T21:07:00.000Z
; 6.1.0150 , ; Reserve one cell of data space and store x in the cell ; D: x -- $CODE ',',$COMMA POPDS EAX MOV EBX,DWORD [VAR_DP + IMAGE_BASE] MOV DWORD [EBX],EAX ADD DWORD [VAR_DP + IMAGE_BASE],CELL_SIZE $NEXT
34.6
65
0.421965
aa383961df6b112ca7bfa4e0ba71732ea78e47ca
1,987
asm
Assembly
PRG/levels/Airship/W8Ship.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/levels/Airship/W8Ship.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/levels/Airship/W8Ship.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
; Original address was $B6B1 ; World 8 Battleship .word W8BS_BossL ; Alternate level layout .word W8BS_BossO ; Alternate object layout .byte LEVEL1_SIZE_10 | LEVEL1_YSTART_140 .byte LEVEL2_BGPAL_07 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_70 .byte LEVEL3_TILESET_10 | LEVEL3_VSCROLL_LOCKLOW | LEVEL3_PIPENOTEXIT .byte LEVEL4_BGBANK_INDEX(21) | LEVEL4_INITACT_AIRSHIPB .byte LEVEL5_BGM_AIRSHIP | LEVEL5_TIME_300 .byte $59, $00, $81, $9F, $35, $0B, $A1, $35, $1F, $A1, $34, $2A, $A1, $36, $45, $A1 .byte $34, $4A, $A1, $34, $5B, $A1, $35, $76, $A1, $35, $83, $A1, $35, $8A, $A1, $16 .byte $03, $20, $2E, $77, $04, $70, $2D, $78, $05, $70, $2B, $16, $03, $03, $58, $05 .byte $0A, $13, $0B, $13, $53, $0B, $0F, $74, $0A, $70, $04, $74, $08, $A2, $75, $08 .byte $C0, $11, $10, $64, $11, $12, $17, $12, $15, $08, $12, $19, $08, $13, $1F, $13 .byte $74, $1E, $70, $04, $53, $1F, $0F, $74, $1C, $A2, $33, $12, $00, $75, $1C, $C0 .byte $12, $28, $14, $13, $28, $14, $13, $28, $03, $15, $28, $19, $72, $2D, $92, $12 .byte $22, $07, $74, $28, $C0, $16, $3B, $16, $16, $3B, $03, $77, $3C, $70, $2A, $78 .byte $3D, $70, $28, $58, $3D, $0A, $15, $49, $20, $1D, $16, $49, $20, $1D, $12, $4A .byte $13, $73, $49, $70, $04, $73, $47, $A2, $52, $4A, $0F, $14, $45, $13, $75, $44 .byte $70, $04, $54, $45, $0F, $75, $42, $A2, $11, $50, $63, $11, $52, $63, $13, $54 .byte $14, $14, $54, $14, $12, $59, $13, $13, $59, $13, $13, $59, $03, $72, $5D, $92 .byte $14, $61, $15, $15, $6B, $17, $15, $6B, $03, $16, $6C, $20, $2F, $16, $6C, $03 .byte $77, $6D, $70, $2E, $78, $6F, $70, $2B, $57, $6D, $0A, $58, $6F, $0A, $12, $76 .byte $13, $13, $76, $13, $74, $75, $70, $04, $52, $76, $0F, $73, $73, $82, $15, $7F .byte $06, $12, $84, $12, $13, $83, $13, $74, $81, $70, $05, $72, $82, $A1, $73, $81 .byte $A1, $74, $80, $A1, $12, $89, $13, $13, $89, $13, $74, $89, $70, $03, $72, $8D .byte $92, $75, $80, $C0, $75, $89, $C0, $14, $94, $16, $15, $91, $1A, $32, $97, $91 .byte $E9, $42, $10, $FF
66.233333
85
0.502768
711d3c0304c2472b98ea4653e275bec10d08dd8f
276
asm
Assembly
programs/oeis/072/A072258.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/072/A072258.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/072/A072258.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A072258: a(n) = ((6*n+1)*4^n - 1)/3. ; 0,9,69,405,2133,10581,50517,234837,1070421,4805973,21321045,93672789,408245589,1767200085,7605671253,32570168661,138870609237,589842175317,2496807654741,10536986432853 mov $1,$0 lpb $0,1 mul $1,4 sub $1,$0 sub $0,1 lpe mul $1,3
25.090909
169
0.713768
c48299aa9fa55f785e2ffe8089ecfedb8222e50a
2,018
asm
Assembly
source/commands/if.asm
paulscottrobson/Atomic-Basic-2
8ee2d894ff06137a7ac0616862be4476dec04f9e
[ "MIT" ]
null
null
null
source/commands/if.asm
paulscottrobson/Atomic-Basic-2
8ee2d894ff06137a7ac0616862be4476dec04f9e
[ "MIT" ]
null
null
null
source/commands/if.asm
paulscottrobson/Atomic-Basic-2
8ee2d894ff06137a7ac0616862be4476dec04f9e
[ "MIT" ]
1
2021-10-21T22:53:41.000Z
2021-10-21T22:53:41.000Z
; ******************************************************************************************* ; ******************************************************************************************* ; ; Name : if.asm ; Purpose : Print Statement ; Date : 30th July 2019 ; Author : Paul Robson (paul@robsons.org.uk) ; ; ******************************************************************************************* ; ******************************************************************************************* ; ******************************************************************************************* ; ; IF <expr> [THEN] commands <[ELSE] commands> ; ; ******************************************************************************************* COMMAND_IF: ;; if ldx #0 ; do test jsr EvaluateBase lda evalStack+0 ; check if test 0 ora evalStack+1 ora evalStack+2 ora evalStack+3 beq _CIFSkip ; if not, then skip to ELSE token or EOL. ; _CIFExit: rts ; _CIFSkip: lda (zCurrentLine),y ; found EOL ? beq _CIFExit iny ; is it ELSE cmp #KW_ELSE bne _CIFSkip ; no, keep going rts ; ******************************************************************************************* ; ; THEN is mostly syntactic, but allows THEN 40 ; ; ******************************************************************************************* COMMAND_THEN: ;; then lda (zCurrentLine),y ; find first non space iny cmp #" " beq COMMAND_THEN dey cmp #"0" ; THEN x is THEN GOTO x bcc _CTHNoBranch cmp #"9"+1 bcs _CTHNoBranch jmp Command_GOTO ; so do the GOTO code. _CTHNoBranch: rts ; ******************************************************************************************* ; ; ELSE skips to end of line. ; ; ******************************************************************************************* COMMAND_ELSE: ;; else lda (zCurrentLine),y iny cmp #0 bne COMMAND_ELSE dey rts
28.422535
93
0.316155
b0e520101270640efa44c26a5b6df139dd2315af
1,956
asm
Assembly
programs/oeis/048/A048477.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/048/A048477.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/048/A048477.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A048477: a(n) = T(5,n), array T given by A048472. ; 1,7,25,73,193,481,1153,2689,6145,13825,30721,67585,147457,319489,688129,1474561,3145729,6684673,14155777,29884417,62914561,132120577,276824065,578813953,1207959553,2516582401,5234491393,10871635969,22548578305,46707769345,96636764161,199715979265,412316860417,850403524609,1752346656769,3607772528641,7421703487489,15255723835393,31336081391617,64321430224897,131941395333121,270479860432897,554153860399105,1134695999864833,2322168557862913,4749890231992321,9710886696517633,19843985858101249,40532396646334465,82753643152932865,168884986026393601,344525371493842945,702561541869797377,1432144681503817729,2918332558536081409,5944751508129054721,12105675798371893249,24643697160971354113,50152085450397843457,102033553157705957377,207525870829232455681,421969270686105993217,857773599427494150145,1743217314965552627713,3541774862152233910273,7194230188746725130241,14609821306377964879873,29662364470524958998529,60210172656587976474625,122191232744252069904385,247924240350656373719041,502932030425617215258625,1020031160299843366158337,2068396519496904603598849,4193461436788244949762049,8500259669165361384652801,17227192929508465739563009,34907733041372417419640833,70722160447455806720311297,143257709624333557202681857,290142196707511001929482241,587537948332709778907201537,1189583006500795107910877185,2408180232672341316014702593,4874388904686184832415301633,9864834688055374065602396161,19961783133476756932748378113,40387793781685531468583927809,81704042592835098143342198785,165264995244598266699033083905,334243810607052674222763540481,675915261449817630094921826305,1366685803371059823488633143297,2763082167684968773574845267969,5585585457255635800344848498689,11290013158282668107080012922881,22817710804108129226940657696769,46110790583301844479442579095553,93172319116774861010007685595137,188246114133892066122260425998337 mov $1,2 pow $1,$0 mul $1,$0 mul $1,3 add $1,1 mov $0,$1
195.6
1,845
0.923313
ec36033b7277471b8d72f6bed0c97889f8b5a5eb
1,019
asm
Assembly
software/obsolete/new-rom/ui_label.asm
Noah1989/micro-21
f574c3dd089ee93737c8babc6f5eddf85e66987e
[ "MIT" ]
1
2019-05-17T14:43:17.000Z
2019-05-17T14:43:17.000Z
software/obsolete/new-rom/ui_label.asm
Noah1989/loopmicro
4d9a49b0aeee1d58aa712c7509cbb46d32477e16
[ "MIT" ]
null
null
null
software/obsolete/new-rom/ui_label.asm
Noah1989/loopmicro
4d9a49b0aeee1d58aa712c7509cbb46d32477e16
[ "MIT" ]
null
null
null
public ui_label_IX_draw extern ui_box_IX_calculate_absolute_position_DE include "ui.inc" include "video_io.inc" ui_label_IX_draw: CALL ui_box_IX_calculate_absolute_position_DE LD B, (IX+ui_box_width) LD C, (IX+ui_box_height) LD L, (IX+ui_label_text) LD H, (IX+ui_label_text+1) ui_label_IX_draw_loop: LD A, E OUT (video_address_l), A LD A, D OUT (video_address_h), A PUSH BC ui_label_IX_draw_loop_line: LD A, (HL) AND A, A JR Z, ui_label_IX_draw_loop_line_fill INC HL CP A, 10 JR Z, ui_label_IX_draw_loop_line_fill OUT (video_table_name_increment), A DJNZ ui_label_IX_draw_loop_line LD A, (HL) CP A, 10 JR NZ, ui_label_IX_draw_loop_line_done INC HL ui_label_IX_draw_loop_line_done: POP BC INC D DEC C JR NZ, ui_label_IX_draw_loop RET ui_label_IX_draw_loop_line_fill: XOR A, A CP A, B JR Z, ui_label_IX_draw_loop_line_done LD A, ' ' ui_label_IX_draw_loop_line_fill_loop: OUT (video_table_name_increment), A DJNZ ui_label_IX_draw_loop_line_fill_loop JR ui_label_IX_draw_loop_line_done
21.229167
47
0.799804
5102fdcd5ea2249780830dd0692feac8a07334d9
1,923
asm
Assembly
tests/tap_files/savetap_test.asm
cizo2000/sjasmplus
615d7c0e09a44aa2a923095fc9ed6dca6ecae4a4
[ "BSD-3-Clause" ]
null
null
null
tests/tap_files/savetap_test.asm
cizo2000/sjasmplus
615d7c0e09a44aa2a923095fc9ed6dca6ecae4a4
[ "BSD-3-Clause" ]
null
null
null
tests/tap_files/savetap_test.asm
cizo2000/sjasmplus
615d7c0e09a44aa2a923095fc9ed6dca6ecae4a4
[ "BSD-3-Clause" ]
null
null
null
device zxspectrum48 ; BASIC block module bas line10: db 0, 10 dw .len .cmds ; BORDER NOT PI: db $E7, $C3, $A7, ':' ; PAPER NOT PI: db $DA, $C3, $A7, ':' ; INK VAL "7": db $D9, $B0, '"7":' ; CLEAR VAL "32767" db $FD, $B0, '"32767"', $0D .len = $ - .cmds line20: db 0, 20 dw .len .cmds ; POKE VAL "23739",CODE "o": db $F4, $B0, '"23739",', $AF, '"o":' ; LOAD ""SCREEN$: LOAD ""CODE db $EF, '""', $AA, ':', $EF, '""', $AF, $0D .len = $ - .cmds line30: db 0, 30 dw .len .cmds ; RANDOMIZE USR VAL "32768" db $F9, $C0, $B0, '"32768"', $0D .len = $ - .cmds total = $ - line10 endmodule ; CHARS block chars: db 1 dw .datalen .data: db "SAVETAP testing character array" .datalen = $ - .data .len = $ - chars ; SCREEN$ block org $4000 screen: rept 12 block 256,$AA block 256,$55 endm rept 24 db $07, $06, $06, $16, $05, $05, $0D, $04, $04, $14, $03, $03, $11, $02, $02, $29 db $29, $02, $02, $11, $03, $03, $14, $04, $04, $0D, $05, $05, $16, $06, $06, $07 endm .len = $ - screen ; CODE block org $8000 demo: ei halt djnz demo .loop ei halt ld hl,$5801 ld de,$5800 ld bc,$300 ld a,(de) ld ($5B00),a ldir call .rnd ld c,a and $0C sub $0B jr nc,.not12 ld a,2 .not12 ld d,a call .rnd ld e,a ld hl,$5800 add hl,de ld a,c and $7F xor (hl) ld (hl),a jr .loop .rnd ld a,$8729 ld b,a rrca rrca rrca xor $1F add a,b sbc a,$FF ld (.rnd+1),a ret .len = $ - demo emptytap "savetap_test.tap" ; store BASIC savetap "savetap_test.tap",BASIC,"tstSAVETAP", bas.line10, bas.total, 10 ; store SCREEN$ savetap "savetap_test.tap",CODE,"intro", screen, screen.len ; store CODE savetap "savetap_test.tap",CODE,"demo", demo, demo.len ; store CHARS savetap "savetap_test.tap",CHARS,"t$", chars, chars.len, 't' ; store HEADLESS savetap "savetap_test.tap",HEADLESS, (screen + $1800), 32, 66 ; custom flag
16.868421
83
0.563183
bf0adbba851523fc14eac33ecc046defe32ffc15
7,560
asm
Assembly
Transynther/x86/_processed/NONE/_un_/i9-9900K_12_0xa0.log_1_1247.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_un_/i9-9900K_12_0xa0.log_1_1247.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_un_/i9-9900K_12_0xa0.log_1_1247.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 %r14 push %r15 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0xb36e, %rsi lea addresses_D_ht+0x16d86, %rdi nop nop sub %r9, %r9 mov $4, %rcx rep movsb nop nop add %r14, %r14 lea addresses_D_ht+0x14566, %rsi lea addresses_normal_ht+0x10f86, %rdi nop nop xor $14530, %r9 mov $69, %rcx rep movsw nop nop nop nop nop cmp %rcx, %rcx lea addresses_D_ht+0xbf86, %rsi lea addresses_A_ht+0x2b86, %rdi clflush (%rdi) sub %rbx, %rbx mov $105, %rcx rep movsq nop nop nop xor %r14, %r14 lea addresses_WC_ht+0x4386, %rsi lea addresses_UC_ht+0x18186, %rdi clflush (%rsi) nop nop nop nop sub %r15, %r15 mov $3, %rcx rep movsq nop nop nop nop nop and $17404, %r15 lea addresses_WC_ht+0x1dd86, %r15 add %rsi, %rsi and $0xffffffffffffffc0, %r15 movaps (%r15), %xmm0 vpextrq $1, %xmm0, %rbx nop nop nop nop nop xor $5353, %rsi lea addresses_normal_ht+0x28f, %rsi lea addresses_UC_ht+0x8a06, %rdi nop inc %r12 mov $24, %rcx rep movsw nop nop nop and %r9, %r9 lea addresses_WT_ht+0x1b806, %rsi lea addresses_WT_ht+0x3586, %rdi nop nop inc %rbx mov $89, %rcx rep movsq nop nop nop nop xor $12832, %r14 lea addresses_normal_ht+0x182a6, %r15 nop nop nop nop nop xor $47935, %rbx movb $0x61, (%r15) nop nop nop nop inc %r14 lea addresses_WT_ht+0x291a, %rsi lea addresses_WT_ht+0xff26, %rdi nop nop nop nop cmp $42741, %rbx mov $122, %rcx rep movsb nop nop nop nop dec %rcx lea addresses_normal_ht+0x1e7a6, %rdi add %rbx, %rbx mov (%rdi), %r12d nop nop nop nop cmp %rbx, %rbx lea addresses_A_ht+0x5835, %rsi nop nop nop nop nop dec %rcx mov (%rsi), %r12 nop mfence lea addresses_D_ht+0xff06, %rsi lea addresses_WC_ht+0x5346, %rdi nop nop nop nop sub $7525, %r15 mov $93, %rcx rep movsb cmp $9842, %r15 lea addresses_A_ht+0x16a0e, %rsi lea addresses_UC_ht+0x14786, %rdi nop nop and %rbx, %rbx mov $37, %rcx rep movsq nop nop nop sub $46744, %r14 lea addresses_normal_ht+0x3986, %r15 nop nop cmp $6333, %r12 movups (%r15), %xmm2 vpextrq $0, %xmm2, %r9 nop and %rdi, %rdi lea addresses_UC_ht+0x9486, %rbx nop nop nop nop dec %rcx mov $0x6162636465666768, %r14 movq %r14, %xmm1 movups %xmm1, (%rbx) sub $12050, %r15 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %rbp push %rbx push %rcx push %rdi push %rsi // REPMOV lea addresses_RW+0x1c986, %rsi lea addresses_RW+0x69f6, %rdi nop nop add %rbx, %rbx mov $116, %rcx rep movsq and %r11, %r11 // Store lea addresses_D+0x2bc6, %r11 nop nop nop nop nop xor %rcx, %rcx mov $0x5152535455565758, %rdi movq %rdi, (%r11) nop nop nop xor %rcx, %rcx // Store lea addresses_WT+0xcdc6, %rbp nop nop cmp $26472, %rbx movb $0x51, (%rbp) nop nop nop and $34407, %rdi // Store lea addresses_normal+0x17786, %rcx nop nop sub $31493, %rbp movb $0x51, (%rcx) nop nop nop nop nop sub $40015, %rbx // Load lea addresses_US+0xf1c6, %r10 nop nop cmp %rbp, %rbp mov (%r10), %rcx nop nop nop nop nop sub $46422, %rsi // Store lea addresses_D+0x139b3, %rsi nop cmp %r10, %r10 mov $0x5152535455565758, %rbp movq %rbp, %xmm7 movups %xmm7, (%rsi) nop nop nop nop nop add $54022, %rdi // Store lea addresses_PSE+0xbe86, %rbp nop nop nop add %rdi, %rdi mov $0x5152535455565758, %rsi movq %rsi, %xmm5 movups %xmm5, (%rbp) nop nop and %rcx, %rcx // Load lea addresses_WC+0x48da, %rcx nop nop and $64679, %rbp mov (%rcx), %r10w nop nop nop sub $53695, %rbx // Store lea addresses_UC+0x10b86, %r10 nop nop nop nop and %rcx, %rcx movb $0x51, (%r10) nop nop dec %rcx // Load lea addresses_UC+0x12786, %rsi nop nop add $62516, %rdi movb (%rsi), %r11b nop xor $42448, %rbx // Faulty Load lea addresses_normal+0x17786, %rsi nop nop nop nop nop dec %rbp mov (%rsi), %bx lea oracles, %rdi and $0xff, %rbx shlq $12, %rbx mov (%rdi,%rbx,1), %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 4, 'type': 'addresses_RW'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_RW'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_D', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT', 'AVXalign': False, 'size': 1}} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 1}} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_US', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 16}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 16}} {'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_UC', 'AVXalign': False, 'size': 1}} {'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_UC', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}} {'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}} {'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}} {'src': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}} {'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 9, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 1}} {'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}} {'src': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 8, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16}} {'22': 1} 22 */
20.16
152
0.649868
094e3d7615d6ae1540a51eb0f912cbe1435d96ba
229
asm
Assembly
libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_pop.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
8
2017-01-18T12:02:17.000Z
2021-06-12T09:40:28.000Z
libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_pop.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
1
2017-03-06T07:41:56.000Z
2017-03-06T07:41:56.000Z
libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_pop.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
3
2017-03-07T03:19:40.000Z
2021-09-15T17:59:19.000Z
; void *wv_priority_queue_pop(wv_priority_queue_t *q) SECTION code_clib SECTION code_adt_wv_priority_queue PUBLIC wv_priority_queue_pop EXTERN asm_wv_priority_queue_pop defc wv_priority_queue_pop = asm_wv_priority_queue_pop
19.083333
54
0.882096
f2fa0d52d077937540ae963962176d1e402810af
2,488
asm
Assembly
experiments/hello-world-st7565/miscsubs.asm
daltonmatos/avrgcc-mixed-with-avrasm2
f28120af3089fdd150d7a609409c56f5408a1658
[ "BSD-3-Clause" ]
2
2019-01-15T16:30:19.000Z
2019-08-15T02:31:22.000Z
experiments/hello-world-st7565/miscsubs.asm
daltonmatos/avrgcc-mixed-with-avrasm2
f28120af3089fdd150d7a609409c56f5408a1658
[ "BSD-3-Clause" ]
null
null
null
experiments/hello-world-st7565/miscsubs.asm
daltonmatos/avrgcc-mixed-with-avrasm2
f28120af3089fdd150d7a609409c56f5408a1658
[ "BSD-3-Clause" ]
null
null
null
WaitXms:ldi yl, 10 rcall wms sbiw x, 1 brne WaitXms ret wms: ldi t, 250 ;wait yl *0.1 ms at 20MHz wm1: dec t nop nop nop nop nop brne wm1 dec yl brne wms ret CmpXy: cp xl, yl cpc xh, yh ret GetButtons: push xl push yl load t, pinb ;read buttons com t swap t andi t, 0x0F breq get1 ;any buttons pressed? ldi yl, 100 ;yes, wait 10ms call wms load t, pinb ;read buttons again com t swap t lds xl, BtnReversed tst xl breq get2 ror t ;swapping button order (for unoriginal KK2 mini) rol xl ror t rol xl ror t rol xl ror t rol xl mov t, xl get2: andi t, 0x0F get1: pop yl ;no, exit pop xl ret ReleaseButtons: rcall GetButtons ;wait for button to be released cpi t, 0x00 brne ReleaseButtons ret GetButtonsBlocking: rcall ReleaseButtons WaitForKeypress: rcall GetButtons cpi t, 0x00 breq WaitForKeypress ;call Beep ret WaitForOkButton: rcall GetButtonsBlocking cpi t, 0x01 ;OK? brne WaitForOkButton rcall ReleaseButtons ret GetEePVariable16: lds zh, UserProfile GetEeVariable16: rcall ReadEeprom adiw z, 1 mov xl, t rcall ReadEeprom adiw z, 1 mov xh, t ret StoreEePVariable16: lds zh, UserProfile StoreEeVariable16: mov t, xl rcall WriteEeprom adiw z, 1 mov t, xh rcall WriteEeprom adiw z, 1 ret GetEePVariable8: lds zh, UserProfile GetEeVariable8: rcall ReadEeprom adiw z, 1 mov xl, t ret StoreEePVariable8: lds zh, UserProfile StoreEeVariable8: mov t, xl rcall WriteEeprom adiw z, 1 ret GetEePVariable168: lds zh, UserProfile rcall ReadEeprom adiw z, 1 mov yh, t rcall ReadEeprom adiw z, 1 mov xl, t rcall ReadEeprom adiw z, 1 mov xh, t ret StoreEePVariable168: lds zh, UserProfile mov t, yh rcall WriteEeprom adiw z, 1 mov t, xl rcall WriteEeprom adiw z, 1 mov t, xh rcall WriteEeprom adiw z, 1 ret ReadEepromP: lds zh, UserProfile ReadEeprom: re1: skbc eecr,1, r0 rjmp re1 store eearl,zl ;(Z) -> t store eearh,zh ldi t,0x01 store eecr,t load t, eedr ret WriteEepromP: lds zh, UserProfile WriteEeprom: cli ;t -> (Z) wr1: skbc eecr,1, r0 rjmp wr1 store eearl,zl store eearh,zh store eedr,t ; 76543210 ldi t,0b00000100 store eecr,t ; 76543210 ldi t,0b00000010 store eecr,t sei ret
11.847619
57
0.640273
c963fe1a5a01b332a7cf94c2820bf6e3090ae681
3,526
asm
Assembly
spec/basic.asm
notwa/lips
0fdac556a813487ca5920b121c7f31972f065f12
[ "MIT" ]
19
2015-11-22T23:54:33.000Z
2022-03-15T08:39:27.000Z
spec/basic.asm
notwa/lips
0fdac556a813487ca5920b121c7f31972f065f12
[ "MIT" ]
null
null
null
spec/basic.asm
notwa/lips
0fdac556a813487ca5920b121c7f31972f065f12
[ "MIT" ]
3
2016-05-13T14:20:08.000Z
2020-04-25T01:38:17.000Z
J 0x80000000 JAL 0x80000000 JALR r0, r0 JR r0 BREAK SYSCALL SYNC LB r0, 0(r0) LBU r0, 0(r0) LD r0, 0(r0) LDL r0, 0(r0) LDR r0, 0(r0) LH r0, 0(r0) LHU r0, 0(r0) LL r0, 0(r0) LLD r0, 0(r0) LW r0, 0(r0) LWL r0, 0(r0) LWR r0, 0(r0) LWU r0, 0(r0) SB r0, 0(r0) SC r0, 0(r0) SCD r0, 0(r0) SD r0, 0(r0) SDL r0, 0(r0) SDR r0, 0(r0) SH r0, 0(r0) SW r0, 0(r0) SWL r0, 0(r0) SWR r0, 0(r0) LUI r0, 0 MFHI r0 MFLO r0 MTHI r0 MTLO r0 ADDI r0, r0, 0 ADDIU r0, r0, 0 ANDI r0, r0, 0 DADDI r0, r0, 0 DADDIU r0, r0, 0 ORI r0, r0, 0 SLTI r0, r0, 0 SLTIU r0, r0, 0 XORI r0, r0, 0 ADD r0, r0, r0 ADDU r0, r0, r0 AND r0, r0, r0 DADD r0, r0, r0 DADDU r0, r0, r0 DSLLV r0, r0, r0 DSUB r0, r0, r0 DSUBU r0, r0, r0 NOR r0, r0, r0 OR r0, r0, r0 SLLV r0, r0, r0 SLT r0, r0, r0 SLTU r0, r0, r0 SRAV r0, r0, r0 SRLV r0, r0, r0 SUB r0, r0, r0 SUBU r0, r0, r0 XOR r0, r0, r0 DDIV r0, r0 DDIVU r0, r0 DIV r0, r0 DIVU r0, r0 DMULT r0, r0 DMULTU r0, r0 MULT r0, r0 MULTU r0, r0 DSLL r0, r0, 0 DSLL32 r0, r0, 0 DSRA r0, r0, 0 DSRA32 r0, r0, 0 DSRAV r0, r0, r0 DSRL r0, r0, 0 DSRL32 r0, r0, 0 DSRLV r0, r0, r0 SLL r0, r0, 0 SRA r0, r0, 0 SRL r0, r0, 0 BEQ r0, r0, 0x80000000 BEQL r0, r0, 0x80000000 BNE r0, r0, 0x80000000 BNEL r0, r0, 0x80000000 BGEZ r0, 0x80000000 BGEZAL r0, 0x80000000 BGEZALL r0, 0x80000000 BGEZL r0, 0x80000000 BGTZ r0, 0x80000000 BGTZL r0, 0x80000000 BLEZ r0, 0x80000000 BLEZL r0, 0x80000000 BLTZ r0, 0x80000000 BLTZAL r0, 0x80000000 BLTZALL r0, 0x80000000 BLTZL r0, 0x80000000 TEQ r0, r0 TGE r0, r0 TGEU r0, r0 TLT r0, r0 TLTU r0, r0 TNE r0, r0 TEQI r0, 0 TGEI r0, 0 TGEIU r0, 0 TLTI r0, 0 TLTIU r0, 0 TNEI r0, 0 CFC1 r0, f0 CTC1 r0, f0 DMFC1 r0, f0 DMTC1 r0, f0 MFC0 r0, Index MFC1 r0, f0 MTC0 r0, Index MTC1 r0, f0 LDC1 f0, 0(r0) LWC1 f0, 0(r0) SDC1 f0, 0(r0) SWC1 f0, 0(r0) CACHE 0, 0(r0) ERET TLBP TLBR TLBWI TLBWR BC1F 0x80000000 BC1FL 0x80000000 BC1T 0x80000000 BC1TL 0x80000000 ADD.D f0, f0, f0 ADD.S f0, f0, f0 DIV.D f0, f0, f0 DIV.S f0, f0, f0 MUL.D f0, f0, f0 MUL.S f0, f0, f0 SUB.D f0, f0, f0 SUB.S f0, f0, f0 C.EQ.D f0, f0 C.EQ.S f0, f0 C.F.D f0, f0 C.F.S f0, f0 C.LE.D f0, f0 C.LE.S f0, f0 C.LT.D f0, f0 C.LT.S f0, f0 C.NGE.D f0, f0 C.NGE.S f0, f0 C.NGL.D f0, f0 C.NGL.S f0, f0 C.NGLE.D f0, f0 C.NGLE.S f0, f0 C.NGT.D f0, f0 C.NGT.S f0, f0 C.OLE.D f0, f0 C.OLE.S f0, f0 C.OLT.D f0, f0 C.OLT.S f0, f0 C.SEQ.D f0, f0 C.SEQ.S f0, f0 C.SF.D f0, f0 C.SF.S f0, f0 C.UEQ.D f0, f0 C.UEQ.S f0, f0 C.ULE.D f0, f0 C.ULE.S f0, f0 C.ULT.D f0, f0 C.ULT.S f0, f0 C.UN.D f0, f0 C.UN.S f0, f0 CVT.D.L f0, f0 CVT.D.S f0, f0 CVT.D.W f0, f0 CVT.L.D f0, f0 CVT.L.S f0, f0 CVT.S.D f0, f0 CVT.S.L f0, f0 CVT.S.W f0, f0 CVT.W.D f0, f0 CVT.W.S f0, f0 ABS.D f0, f0 ABS.S f0, f0 CEIL.L.D f0, f0 CEIL.L.S f0, f0 CEIL.W.D f0, f0 CEIL.W.S f0, f0 FLOOR.L.D f0, f0 FLOOR.L.S f0, f0 FLOOR.W.D f0, f0 FLOOR.W.S f0, f0 MOV.D f0, f0 MOV.S f0, f0 NEG.D f0, f0 NEG.S f0, f0 ROUND.L.D f0, f0 ROUND.L.S f0, f0 ROUND.W.D f0, f0 ROUND.W.S f0, f0 SQRT.D f0, f0 SQRT.S f0, f0 TRUNC.L.D f0, f0 TRUNC.L.S f0, f0 TRUNC.W.D f0, f0 TRUNC.W.S f0, f0
15.264069
26
0.54878
19732dfeb01dad935bbf33e90b63718f804f0da0
339,436
asm
Assembly
usertests.asm
UyChooTran/CS153Lab3
f722060b73ff9f575a7cafd10b0bee5dc72b9272
[ "MIT-0" ]
null
null
null
usertests.asm
UyChooTran/CS153Lab3
f722060b73ff9f575a7cafd10b0bee5dc72b9272
[ "MIT-0" ]
1
2017-12-02T20:32:03.000Z
2017-12-02T20:32:03.000Z
usertests.asm
UyChooTran/CS153Lab3
f722060b73ff9f575a7cafd10b0bee5dc72b9272
[ "MIT-0" ]
null
null
null
_usertests: file format elf32-i386 Disassembly of section .text: 00001000 <main>: return randstate; } int main(int argc, char *argv[]) { 1000: 8d 4c 24 04 lea 0x4(%esp),%ecx 1004: 83 e4 f0 and $0xfffffff0,%esp 1007: ff 71 fc pushl -0x4(%ecx) 100a: 55 push %ebp 100b: 89 e5 mov %esp,%ebp 100d: 51 push %ecx 100e: 83 ec 0c sub $0xc,%esp printf(1, "usertests starting\n"); 1011: 68 42 5d 00 00 push $0x5d42 1016: 6a 01 push $0x1 1018: e8 e3 39 00 00 call 4a00 <printf> if(open("usertests.ran", 0) >= 0){ 101d: 5a pop %edx 101e: 59 pop %ecx 101f: 6a 00 push $0x0 1021: 68 56 5d 00 00 push $0x5d56 1026: e8 b7 38 00 00 call 48e2 <open> 102b: 83 c4 10 add $0x10,%esp 102e: 85 c0 test %eax,%eax 1030: 78 14 js 1046 <main+0x46> printf(1, "already ran user tests -- rebuild fs.img\n"); 1032: 83 ec 08 sub $0x8,%esp 1035: 68 c0 64 00 00 push $0x64c0 103a: 6a 01 push $0x1 103c: e8 bf 39 00 00 call 4a00 <printf> exit(); 1041: e8 5c 38 00 00 call 48a2 <exit> } close(open("usertests.ran", O_CREATE)); 1046: 50 push %eax 1047: 50 push %eax 1048: 68 00 02 00 00 push $0x200 104d: 68 56 5d 00 00 push $0x5d56 1052: e8 8b 38 00 00 call 48e2 <open> 1057: 89 04 24 mov %eax,(%esp) 105a: e8 6b 38 00 00 call 48ca <close> argptest(); 105f: e8 6c 35 00 00 call 45d0 <argptest> createdelete(); 1064: e8 87 11 00 00 call 21f0 <createdelete> linkunlink(); 1069: e8 42 1a 00 00 call 2ab0 <linkunlink> concreate(); 106e: e8 2d 17 00 00 call 27a0 <concreate> fourfiles(); 1073: e8 88 0f 00 00 call 2000 <fourfiles> sharedfd(); 1078: e8 c3 0d 00 00 call 1e40 <sharedfd> bigargtest(); 107d: e8 ee 31 00 00 call 4270 <bigargtest> bigwrite(); 1082: e8 49 23 00 00 call 33d0 <bigwrite> bigargtest(); 1087: e8 e4 31 00 00 call 4270 <bigargtest> bsstest(); 108c: e8 6f 31 00 00 call 4200 <bsstest> sbrktest(); 1091: e8 8a 2c 00 00 call 3d20 <sbrktest> validatetest(); 1096: e8 b5 30 00 00 call 4150 <validatetest> opentest(); 109b: e8 50 03 00 00 call 13f0 <opentest> writetest(); 10a0: e8 db 03 00 00 call 1480 <writetest> writetest1(); 10a5: e8 b6 05 00 00 call 1660 <writetest1> createtest(); 10aa: e8 81 07 00 00 call 1830 <createtest> openiputtest(); 10af: e8 3c 02 00 00 call 12f0 <openiputtest> exitiputtest(); 10b4: e8 47 01 00 00 call 1200 <exitiputtest> iputtest(); 10b9: e8 62 00 00 00 call 1120 <iputtest> mem(); 10be: e8 ad 0c 00 00 call 1d70 <mem> pipe1(); 10c3: e8 48 09 00 00 call 1a10 <pipe1> preempt(); 10c8: e8 d3 0a 00 00 call 1ba0 <preempt> exitwait(); 10cd: e8 0e 0c 00 00 call 1ce0 <exitwait> rmdot(); 10d2: e8 e9 26 00 00 call 37c0 <rmdot> fourteen(); 10d7: e8 a4 25 00 00 call 3680 <fourteen> bigfile(); 10dc: e8 cf 23 00 00 call 34b0 <bigfile> subdir(); 10e1: e8 0a 1c 00 00 call 2cf0 <subdir> linktest(); 10e6: e8 a5 14 00 00 call 2590 <linktest> unlinkread(); 10eb: e8 10 13 00 00 call 2400 <unlinkread> dirfile(); 10f0: e8 4b 28 00 00 call 3940 <dirfile> iref(); 10f5: e8 46 2a 00 00 call 3b40 <iref> forktest(); 10fa: e8 61 2b 00 00 call 3c60 <forktest> bigdir(); // slow 10ff: e8 bc 1a 00 00 call 2bc0 <bigdir> uio(); 1104: e8 57 34 00 00 call 4560 <uio> exectest(); 1109: e8 b2 08 00 00 call 19c0 <exectest> exit(); 110e: e8 8f 37 00 00 call 48a2 <exit> 1113: 66 90 xchg %ax,%ax 1115: 66 90 xchg %ax,%ax 1117: 66 90 xchg %ax,%ax 1119: 66 90 xchg %ax,%ax 111b: 66 90 xchg %ax,%ax 111d: 66 90 xchg %ax,%ax 111f: 90 nop 00001120 <iputtest>: int stdout = 1; // does chdir() call iput(p->cwd) in a transaction? void iputtest(void) { 1120: 55 push %ebp 1121: 89 e5 mov %esp,%ebp 1123: 83 ec 10 sub $0x10,%esp printf(stdout, "iput test\n"); 1126: 68 e8 4d 00 00 push $0x4de8 112b: ff 35 28 6e 00 00 pushl 0x6e28 1131: e8 ca 38 00 00 call 4a00 <printf> if(mkdir("iputdir") < 0){ 1136: c7 04 24 7b 4d 00 00 movl $0x4d7b,(%esp) 113d: e8 c8 37 00 00 call 490a <mkdir> 1142: 83 c4 10 add $0x10,%esp 1145: 85 c0 test %eax,%eax 1147: 78 58 js 11a1 <iputtest+0x81> printf(stdout, "mkdir failed\n"); exit(); } if(chdir("iputdir") < 0){ 1149: 83 ec 0c sub $0xc,%esp 114c: 68 7b 4d 00 00 push $0x4d7b 1151: e8 bc 37 00 00 call 4912 <chdir> 1156: 83 c4 10 add $0x10,%esp 1159: 85 c0 test %eax,%eax 115b: 0f 88 85 00 00 00 js 11e6 <iputtest+0xc6> printf(stdout, "chdir iputdir failed\n"); exit(); } if(unlink("../iputdir") < 0){ 1161: 83 ec 0c sub $0xc,%esp 1164: 68 78 4d 00 00 push $0x4d78 1169: e8 84 37 00 00 call 48f2 <unlink> 116e: 83 c4 10 add $0x10,%esp 1171: 85 c0 test %eax,%eax 1173: 78 5a js 11cf <iputtest+0xaf> printf(stdout, "unlink ../iputdir failed\n"); exit(); } if(chdir("/") < 0){ 1175: 83 ec 0c sub $0xc,%esp 1178: 68 9d 4d 00 00 push $0x4d9d 117d: e8 90 37 00 00 call 4912 <chdir> 1182: 83 c4 10 add $0x10,%esp 1185: 85 c0 test %eax,%eax 1187: 78 2f js 11b8 <iputtest+0x98> printf(stdout, "chdir / failed\n"); exit(); } printf(stdout, "iput test ok\n"); 1189: 83 ec 08 sub $0x8,%esp 118c: 68 20 4e 00 00 push $0x4e20 1191: ff 35 28 6e 00 00 pushl 0x6e28 1197: e8 64 38 00 00 call 4a00 <printf> } 119c: 83 c4 10 add $0x10,%esp 119f: c9 leave 11a0: c3 ret iputtest(void) { printf(stdout, "iput test\n"); if(mkdir("iputdir") < 0){ printf(stdout, "mkdir failed\n"); 11a1: 50 push %eax 11a2: 50 push %eax 11a3: 68 54 4d 00 00 push $0x4d54 11a8: ff 35 28 6e 00 00 pushl 0x6e28 11ae: e8 4d 38 00 00 call 4a00 <printf> exit(); 11b3: e8 ea 36 00 00 call 48a2 <exit> if(unlink("../iputdir") < 0){ printf(stdout, "unlink ../iputdir failed\n"); exit(); } if(chdir("/") < 0){ printf(stdout, "chdir / failed\n"); 11b8: 50 push %eax 11b9: 50 push %eax 11ba: 68 9f 4d 00 00 push $0x4d9f 11bf: ff 35 28 6e 00 00 pushl 0x6e28 11c5: e8 36 38 00 00 call 4a00 <printf> exit(); 11ca: e8 d3 36 00 00 call 48a2 <exit> if(chdir("iputdir") < 0){ printf(stdout, "chdir iputdir failed\n"); exit(); } if(unlink("../iputdir") < 0){ printf(stdout, "unlink ../iputdir failed\n"); 11cf: 52 push %edx 11d0: 52 push %edx 11d1: 68 83 4d 00 00 push $0x4d83 11d6: ff 35 28 6e 00 00 pushl 0x6e28 11dc: e8 1f 38 00 00 call 4a00 <printf> exit(); 11e1: e8 bc 36 00 00 call 48a2 <exit> if(mkdir("iputdir") < 0){ printf(stdout, "mkdir failed\n"); exit(); } if(chdir("iputdir") < 0){ printf(stdout, "chdir iputdir failed\n"); 11e6: 51 push %ecx 11e7: 51 push %ecx 11e8: 68 62 4d 00 00 push $0x4d62 11ed: ff 35 28 6e 00 00 pushl 0x6e28 11f3: e8 08 38 00 00 call 4a00 <printf> exit(); 11f8: e8 a5 36 00 00 call 48a2 <exit> 11fd: 8d 76 00 lea 0x0(%esi),%esi 00001200 <exitiputtest>: } // does exit() call iput(p->cwd) in a transaction? void exitiputtest(void) { 1200: 55 push %ebp 1201: 89 e5 mov %esp,%ebp 1203: 83 ec 10 sub $0x10,%esp int pid; printf(stdout, "exitiput test\n"); 1206: 68 af 4d 00 00 push $0x4daf 120b: ff 35 28 6e 00 00 pushl 0x6e28 1211: e8 ea 37 00 00 call 4a00 <printf> pid = fork(); 1216: e8 7f 36 00 00 call 489a <fork> if(pid < 0){ 121b: 83 c4 10 add $0x10,%esp 121e: 85 c0 test %eax,%eax 1220: 0f 88 82 00 00 00 js 12a8 <exitiputtest+0xa8> printf(stdout, "fork failed\n"); exit(); } if(pid == 0){ 1226: 75 48 jne 1270 <exitiputtest+0x70> if(mkdir("iputdir") < 0){ 1228: 83 ec 0c sub $0xc,%esp 122b: 68 7b 4d 00 00 push $0x4d7b 1230: e8 d5 36 00 00 call 490a <mkdir> 1235: 83 c4 10 add $0x10,%esp 1238: 85 c0 test %eax,%eax 123a: 0f 88 96 00 00 00 js 12d6 <exitiputtest+0xd6> printf(stdout, "mkdir failed\n"); exit(); } if(chdir("iputdir") < 0){ 1240: 83 ec 0c sub $0xc,%esp 1243: 68 7b 4d 00 00 push $0x4d7b 1248: e8 c5 36 00 00 call 4912 <chdir> 124d: 83 c4 10 add $0x10,%esp 1250: 85 c0 test %eax,%eax 1252: 78 6b js 12bf <exitiputtest+0xbf> printf(stdout, "child chdir failed\n"); exit(); } if(unlink("../iputdir") < 0){ 1254: 83 ec 0c sub $0xc,%esp 1257: 68 78 4d 00 00 push $0x4d78 125c: e8 91 36 00 00 call 48f2 <unlink> 1261: 83 c4 10 add $0x10,%esp 1264: 85 c0 test %eax,%eax 1266: 78 28 js 1290 <exitiputtest+0x90> printf(stdout, "unlink ../iputdir failed\n"); exit(); } exit(); 1268: e8 35 36 00 00 call 48a2 <exit> 126d: 8d 76 00 lea 0x0(%esi),%esi } wait(); 1270: e8 35 36 00 00 call 48aa <wait> printf(stdout, "exitiput test ok\n"); 1275: 83 ec 08 sub $0x8,%esp 1278: 68 d2 4d 00 00 push $0x4dd2 127d: ff 35 28 6e 00 00 pushl 0x6e28 1283: e8 78 37 00 00 call 4a00 <printf> } 1288: 83 c4 10 add $0x10,%esp 128b: c9 leave 128c: c3 ret 128d: 8d 76 00 lea 0x0(%esi),%esi if(chdir("iputdir") < 0){ printf(stdout, "child chdir failed\n"); exit(); } if(unlink("../iputdir") < 0){ printf(stdout, "unlink ../iputdir failed\n"); 1290: 83 ec 08 sub $0x8,%esp 1293: 68 83 4d 00 00 push $0x4d83 1298: ff 35 28 6e 00 00 pushl 0x6e28 129e: e8 5d 37 00 00 call 4a00 <printf> exit(); 12a3: e8 fa 35 00 00 call 48a2 <exit> printf(stdout, "exitiput test\n"); pid = fork(); if(pid < 0){ printf(stdout, "fork failed\n"); 12a8: 51 push %ecx 12a9: 51 push %ecx 12aa: 68 95 5c 00 00 push $0x5c95 12af: ff 35 28 6e 00 00 pushl 0x6e28 12b5: e8 46 37 00 00 call 4a00 <printf> exit(); 12ba: e8 e3 35 00 00 call 48a2 <exit> if(mkdir("iputdir") < 0){ printf(stdout, "mkdir failed\n"); exit(); } if(chdir("iputdir") < 0){ printf(stdout, "child chdir failed\n"); 12bf: 50 push %eax 12c0: 50 push %eax 12c1: 68 be 4d 00 00 push $0x4dbe 12c6: ff 35 28 6e 00 00 pushl 0x6e28 12cc: e8 2f 37 00 00 call 4a00 <printf> exit(); 12d1: e8 cc 35 00 00 call 48a2 <exit> printf(stdout, "fork failed\n"); exit(); } if(pid == 0){ if(mkdir("iputdir") < 0){ printf(stdout, "mkdir failed\n"); 12d6: 52 push %edx 12d7: 52 push %edx 12d8: 68 54 4d 00 00 push $0x4d54 12dd: ff 35 28 6e 00 00 pushl 0x6e28 12e3: e8 18 37 00 00 call 4a00 <printf> exit(); 12e8: e8 b5 35 00 00 call 48a2 <exit> 12ed: 8d 76 00 lea 0x0(%esi),%esi 000012f0 <openiputtest>: // for(i = 0; i < 10000; i++) // yield(); // } void openiputtest(void) { 12f0: 55 push %ebp 12f1: 89 e5 mov %esp,%ebp 12f3: 83 ec 10 sub $0x10,%esp int pid; printf(stdout, "openiput test\n"); 12f6: 68 e4 4d 00 00 push $0x4de4 12fb: ff 35 28 6e 00 00 pushl 0x6e28 1301: e8 fa 36 00 00 call 4a00 <printf> if(mkdir("oidir") < 0){ 1306: c7 04 24 f3 4d 00 00 movl $0x4df3,(%esp) 130d: e8 f8 35 00 00 call 490a <mkdir> 1312: 83 c4 10 add $0x10,%esp 1315: 85 c0 test %eax,%eax 1317: 0f 88 88 00 00 00 js 13a5 <openiputtest+0xb5> printf(stdout, "mkdir oidir failed\n"); exit(); } pid = fork(); 131d: e8 78 35 00 00 call 489a <fork> if(pid < 0){ 1322: 85 c0 test %eax,%eax 1324: 0f 88 92 00 00 00 js 13bc <openiputtest+0xcc> printf(stdout, "fork failed\n"); exit(); } if(pid == 0){ 132a: 75 34 jne 1360 <openiputtest+0x70> int fd = open("oidir", O_RDWR); 132c: 83 ec 08 sub $0x8,%esp 132f: 6a 02 push $0x2 1331: 68 f3 4d 00 00 push $0x4df3 1336: e8 a7 35 00 00 call 48e2 <open> if(fd >= 0){ 133b: 83 c4 10 add $0x10,%esp 133e: 85 c0 test %eax,%eax 1340: 78 5e js 13a0 <openiputtest+0xb0> printf(stdout, "open directory for write succeeded\n"); 1342: 83 ec 08 sub $0x8,%esp 1345: 68 78 5d 00 00 push $0x5d78 134a: ff 35 28 6e 00 00 pushl 0x6e28 1350: e8 ab 36 00 00 call 4a00 <printf> exit(); 1355: e8 48 35 00 00 call 48a2 <exit> 135a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } exit(); } sleep(1); 1360: 83 ec 0c sub $0xc,%esp 1363: 6a 01 push $0x1 1365: e8 c8 35 00 00 call 4932 <sleep> if(unlink("oidir") != 0){ 136a: c7 04 24 f3 4d 00 00 movl $0x4df3,(%esp) 1371: e8 7c 35 00 00 call 48f2 <unlink> 1376: 83 c4 10 add $0x10,%esp 1379: 85 c0 test %eax,%eax 137b: 75 56 jne 13d3 <openiputtest+0xe3> printf(stdout, "unlink failed\n"); exit(); } wait(); 137d: e8 28 35 00 00 call 48aa <wait> printf(stdout, "openiput test ok\n"); 1382: 83 ec 08 sub $0x8,%esp 1385: 68 1c 4e 00 00 push $0x4e1c 138a: ff 35 28 6e 00 00 pushl 0x6e28 1390: e8 6b 36 00 00 call 4a00 <printf> 1395: 83 c4 10 add $0x10,%esp } 1398: c9 leave 1399: c3 ret 139a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi int fd = open("oidir", O_RDWR); if(fd >= 0){ printf(stdout, "open directory for write succeeded\n"); exit(); } exit(); 13a0: e8 fd 34 00 00 call 48a2 <exit> { int pid; printf(stdout, "openiput test\n"); if(mkdir("oidir") < 0){ printf(stdout, "mkdir oidir failed\n"); 13a5: 51 push %ecx 13a6: 51 push %ecx 13a7: 68 f9 4d 00 00 push $0x4df9 13ac: ff 35 28 6e 00 00 pushl 0x6e28 13b2: e8 49 36 00 00 call 4a00 <printf> exit(); 13b7: e8 e6 34 00 00 call 48a2 <exit> } pid = fork(); if(pid < 0){ printf(stdout, "fork failed\n"); 13bc: 52 push %edx 13bd: 52 push %edx 13be: 68 95 5c 00 00 push $0x5c95 13c3: ff 35 28 6e 00 00 pushl 0x6e28 13c9: e8 32 36 00 00 call 4a00 <printf> exit(); 13ce: e8 cf 34 00 00 call 48a2 <exit> } exit(); } sleep(1); if(unlink("oidir") != 0){ printf(stdout, "unlink failed\n"); 13d3: 50 push %eax 13d4: 50 push %eax 13d5: 68 0d 4e 00 00 push $0x4e0d 13da: ff 35 28 6e 00 00 pushl 0x6e28 13e0: e8 1b 36 00 00 call 4a00 <printf> exit(); 13e5: e8 b8 34 00 00 call 48a2 <exit> 13ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 000013f0 <opentest>: // simple file system tests void opentest(void) { 13f0: 55 push %ebp 13f1: 89 e5 mov %esp,%ebp 13f3: 83 ec 10 sub $0x10,%esp int fd; printf(stdout, "open test\n"); 13f6: 68 2e 4e 00 00 push $0x4e2e 13fb: ff 35 28 6e 00 00 pushl 0x6e28 1401: e8 fa 35 00 00 call 4a00 <printf> fd = open("echo", 0); 1406: 58 pop %eax 1407: 5a pop %edx 1408: 6a 00 push $0x0 140a: 68 39 4e 00 00 push $0x4e39 140f: e8 ce 34 00 00 call 48e2 <open> if(fd < 0){ 1414: 83 c4 10 add $0x10,%esp 1417: 85 c0 test %eax,%eax 1419: 78 36 js 1451 <opentest+0x61> printf(stdout, "open echo failed!\n"); exit(); } close(fd); 141b: 83 ec 0c sub $0xc,%esp 141e: 50 push %eax 141f: e8 a6 34 00 00 call 48ca <close> fd = open("doesnotexist", 0); 1424: 5a pop %edx 1425: 59 pop %ecx 1426: 6a 00 push $0x0 1428: 68 51 4e 00 00 push $0x4e51 142d: e8 b0 34 00 00 call 48e2 <open> if(fd >= 0){ 1432: 83 c4 10 add $0x10,%esp 1435: 85 c0 test %eax,%eax 1437: 79 2f jns 1468 <opentest+0x78> printf(stdout, "open doesnotexist succeeded!\n"); exit(); } printf(stdout, "open test ok\n"); 1439: 83 ec 08 sub $0x8,%esp 143c: 68 7c 4e 00 00 push $0x4e7c 1441: ff 35 28 6e 00 00 pushl 0x6e28 1447: e8 b4 35 00 00 call 4a00 <printf> } 144c: 83 c4 10 add $0x10,%esp 144f: c9 leave 1450: c3 ret int fd; printf(stdout, "open test\n"); fd = open("echo", 0); if(fd < 0){ printf(stdout, "open echo failed!\n"); 1451: 50 push %eax 1452: 50 push %eax 1453: 68 3e 4e 00 00 push $0x4e3e 1458: ff 35 28 6e 00 00 pushl 0x6e28 145e: e8 9d 35 00 00 call 4a00 <printf> exit(); 1463: e8 3a 34 00 00 call 48a2 <exit> } close(fd); fd = open("doesnotexist", 0); if(fd >= 0){ printf(stdout, "open doesnotexist succeeded!\n"); 1468: 50 push %eax 1469: 50 push %eax 146a: 68 5e 4e 00 00 push $0x4e5e 146f: ff 35 28 6e 00 00 pushl 0x6e28 1475: e8 86 35 00 00 call 4a00 <printf> exit(); 147a: e8 23 34 00 00 call 48a2 <exit> 147f: 90 nop 00001480 <writetest>: printf(stdout, "open test ok\n"); } void writetest(void) { 1480: 55 push %ebp 1481: 89 e5 mov %esp,%ebp 1483: 56 push %esi 1484: 53 push %ebx int fd; int i; printf(stdout, "small file test\n"); 1485: 83 ec 08 sub $0x8,%esp 1488: 68 8a 4e 00 00 push $0x4e8a 148d: ff 35 28 6e 00 00 pushl 0x6e28 1493: e8 68 35 00 00 call 4a00 <printf> fd = open("small", O_CREATE|O_RDWR); 1498: 59 pop %ecx 1499: 5b pop %ebx 149a: 68 02 02 00 00 push $0x202 149f: 68 9b 4e 00 00 push $0x4e9b 14a4: e8 39 34 00 00 call 48e2 <open> if(fd >= 0){ 14a9: 83 c4 10 add $0x10,%esp 14ac: 85 c0 test %eax,%eax 14ae: 0f 88 8b 01 00 00 js 163f <writetest+0x1bf> printf(stdout, "creat small succeeded; ok\n"); 14b4: 83 ec 08 sub $0x8,%esp 14b7: 89 c6 mov %eax,%esi } else { printf(stdout, "error: creat small failed!\n"); exit(); } for(i = 0; i < 100; i++){ 14b9: 31 db xor %ebx,%ebx int i; printf(stdout, "small file test\n"); fd = open("small", O_CREATE|O_RDWR); if(fd >= 0){ printf(stdout, "creat small succeeded; ok\n"); 14bb: 68 a1 4e 00 00 push $0x4ea1 14c0: ff 35 28 6e 00 00 pushl 0x6e28 14c6: e8 35 35 00 00 call 4a00 <printf> 14cb: 83 c4 10 add $0x10,%esp 14ce: 66 90 xchg %ax,%ax } else { printf(stdout, "error: creat small failed!\n"); exit(); } for(i = 0; i < 100; i++){ if(write(fd, "aaaaaaaaaa", 10) != 10){ 14d0: 83 ec 04 sub $0x4,%esp 14d3: 6a 0a push $0xa 14d5: 68 d8 4e 00 00 push $0x4ed8 14da: 56 push %esi 14db: e8 e2 33 00 00 call 48c2 <write> 14e0: 83 c4 10 add $0x10,%esp 14e3: 83 f8 0a cmp $0xa,%eax 14e6: 0f 85 d9 00 00 00 jne 15c5 <writetest+0x145> printf(stdout, "error: write aa %d new file failed\n", i); exit(); } if(write(fd, "bbbbbbbbbb", 10) != 10){ 14ec: 83 ec 04 sub $0x4,%esp 14ef: 6a 0a push $0xa 14f1: 68 e3 4e 00 00 push $0x4ee3 14f6: 56 push %esi 14f7: e8 c6 33 00 00 call 48c2 <write> 14fc: 83 c4 10 add $0x10,%esp 14ff: 83 f8 0a cmp $0xa,%eax 1502: 0f 85 d6 00 00 00 jne 15de <writetest+0x15e> printf(stdout, "creat small succeeded; ok\n"); } else { printf(stdout, "error: creat small failed!\n"); exit(); } for(i = 0; i < 100; i++){ 1508: 83 c3 01 add $0x1,%ebx 150b: 83 fb 64 cmp $0x64,%ebx 150e: 75 c0 jne 14d0 <writetest+0x50> if(write(fd, "bbbbbbbbbb", 10) != 10){ printf(stdout, "error: write bb %d new file failed\n", i); exit(); } } printf(stdout, "writes ok\n"); 1510: 83 ec 08 sub $0x8,%esp 1513: 68 ee 4e 00 00 push $0x4eee 1518: ff 35 28 6e 00 00 pushl 0x6e28 151e: e8 dd 34 00 00 call 4a00 <printf> close(fd); 1523: 89 34 24 mov %esi,(%esp) 1526: e8 9f 33 00 00 call 48ca <close> fd = open("small", O_RDONLY); 152b: 58 pop %eax 152c: 5a pop %edx 152d: 6a 00 push $0x0 152f: 68 9b 4e 00 00 push $0x4e9b 1534: e8 a9 33 00 00 call 48e2 <open> if(fd >= 0){ 1539: 83 c4 10 add $0x10,%esp 153c: 85 c0 test %eax,%eax exit(); } } printf(stdout, "writes ok\n"); close(fd); fd = open("small", O_RDONLY); 153e: 89 c3 mov %eax,%ebx if(fd >= 0){ 1540: 0f 88 b1 00 00 00 js 15f7 <writetest+0x177> printf(stdout, "open small succeeded ok\n"); 1546: 83 ec 08 sub $0x8,%esp 1549: 68 f9 4e 00 00 push $0x4ef9 154e: ff 35 28 6e 00 00 pushl 0x6e28 1554: e8 a7 34 00 00 call 4a00 <printf> } else { printf(stdout, "error: open small failed!\n"); exit(); } i = read(fd, buf, 2000); 1559: 83 c4 0c add $0xc,%esp 155c: 68 d0 07 00 00 push $0x7d0 1561: 68 00 96 00 00 push $0x9600 1566: 53 push %ebx 1567: e8 4e 33 00 00 call 48ba <read> if(i == 2000){ 156c: 83 c4 10 add $0x10,%esp 156f: 3d d0 07 00 00 cmp $0x7d0,%eax 1574: 0f 85 95 00 00 00 jne 160f <writetest+0x18f> printf(stdout, "read succeeded ok\n"); 157a: 83 ec 08 sub $0x8,%esp 157d: 68 2d 4f 00 00 push $0x4f2d 1582: ff 35 28 6e 00 00 pushl 0x6e28 1588: e8 73 34 00 00 call 4a00 <printf> } else { printf(stdout, "read failed\n"); exit(); } close(fd); 158d: 89 1c 24 mov %ebx,(%esp) 1590: e8 35 33 00 00 call 48ca <close> if(unlink("small") < 0){ 1595: c7 04 24 9b 4e 00 00 movl $0x4e9b,(%esp) 159c: e8 51 33 00 00 call 48f2 <unlink> 15a1: 83 c4 10 add $0x10,%esp 15a4: 85 c0 test %eax,%eax 15a6: 78 7f js 1627 <writetest+0x1a7> printf(stdout, "unlink small failed\n"); exit(); } printf(stdout, "small file test ok\n"); 15a8: 83 ec 08 sub $0x8,%esp 15ab: 68 55 4f 00 00 push $0x4f55 15b0: ff 35 28 6e 00 00 pushl 0x6e28 15b6: e8 45 34 00 00 call 4a00 <printf> } 15bb: 83 c4 10 add $0x10,%esp 15be: 8d 65 f8 lea -0x8(%ebp),%esp 15c1: 5b pop %ebx 15c2: 5e pop %esi 15c3: 5d pop %ebp 15c4: c3 ret printf(stdout, "error: creat small failed!\n"); exit(); } for(i = 0; i < 100; i++){ if(write(fd, "aaaaaaaaaa", 10) != 10){ printf(stdout, "error: write aa %d new file failed\n", i); 15c5: 83 ec 04 sub $0x4,%esp 15c8: 53 push %ebx 15c9: 68 9c 5d 00 00 push $0x5d9c 15ce: ff 35 28 6e 00 00 pushl 0x6e28 15d4: e8 27 34 00 00 call 4a00 <printf> exit(); 15d9: e8 c4 32 00 00 call 48a2 <exit> } if(write(fd, "bbbbbbbbbb", 10) != 10){ printf(stdout, "error: write bb %d new file failed\n", i); 15de: 83 ec 04 sub $0x4,%esp 15e1: 53 push %ebx 15e2: 68 c0 5d 00 00 push $0x5dc0 15e7: ff 35 28 6e 00 00 pushl 0x6e28 15ed: e8 0e 34 00 00 call 4a00 <printf> exit(); 15f2: e8 ab 32 00 00 call 48a2 <exit> close(fd); fd = open("small", O_RDONLY); if(fd >= 0){ printf(stdout, "open small succeeded ok\n"); } else { printf(stdout, "error: open small failed!\n"); 15f7: 83 ec 08 sub $0x8,%esp 15fa: 68 12 4f 00 00 push $0x4f12 15ff: ff 35 28 6e 00 00 pushl 0x6e28 1605: e8 f6 33 00 00 call 4a00 <printf> exit(); 160a: e8 93 32 00 00 call 48a2 <exit> } i = read(fd, buf, 2000); if(i == 2000){ printf(stdout, "read succeeded ok\n"); } else { printf(stdout, "read failed\n"); 160f: 83 ec 08 sub $0x8,%esp 1612: 68 59 52 00 00 push $0x5259 1617: ff 35 28 6e 00 00 pushl 0x6e28 161d: e8 de 33 00 00 call 4a00 <printf> exit(); 1622: e8 7b 32 00 00 call 48a2 <exit> } close(fd); if(unlink("small") < 0){ printf(stdout, "unlink small failed\n"); 1627: 83 ec 08 sub $0x8,%esp 162a: 68 40 4f 00 00 push $0x4f40 162f: ff 35 28 6e 00 00 pushl 0x6e28 1635: e8 c6 33 00 00 call 4a00 <printf> exit(); 163a: e8 63 32 00 00 call 48a2 <exit> printf(stdout, "small file test\n"); fd = open("small", O_CREATE|O_RDWR); if(fd >= 0){ printf(stdout, "creat small succeeded; ok\n"); } else { printf(stdout, "error: creat small failed!\n"); 163f: 83 ec 08 sub $0x8,%esp 1642: 68 bc 4e 00 00 push $0x4ebc 1647: ff 35 28 6e 00 00 pushl 0x6e28 164d: e8 ae 33 00 00 call 4a00 <printf> exit(); 1652: e8 4b 32 00 00 call 48a2 <exit> 1657: 89 f6 mov %esi,%esi 1659: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00001660 <writetest1>: printf(stdout, "small file test ok\n"); } void writetest1(void) { 1660: 55 push %ebp 1661: 89 e5 mov %esp,%ebp 1663: 56 push %esi 1664: 53 push %ebx int i, fd, n; printf(stdout, "big files test\n"); 1665: 83 ec 08 sub $0x8,%esp 1668: 68 69 4f 00 00 push $0x4f69 166d: ff 35 28 6e 00 00 pushl 0x6e28 1673: e8 88 33 00 00 call 4a00 <printf> fd = open("big", O_CREATE|O_RDWR); 1678: 59 pop %ecx 1679: 5b pop %ebx 167a: 68 02 02 00 00 push $0x202 167f: 68 e3 4f 00 00 push $0x4fe3 1684: e8 59 32 00 00 call 48e2 <open> if(fd < 0){ 1689: 83 c4 10 add $0x10,%esp 168c: 85 c0 test %eax,%eax 168e: 0f 88 64 01 00 00 js 17f8 <writetest1+0x198> 1694: 89 c6 mov %eax,%esi 1696: 31 db xor %ebx,%ebx 1698: 90 nop 1699: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi exit(); } for(i = 0; i < MAXFILE; i++){ ((int*)buf)[0] = i; if(write(fd, buf, 512) != 512){ 16a0: 83 ec 04 sub $0x4,%esp printf(stdout, "error: creat big failed!\n"); exit(); } for(i = 0; i < MAXFILE; i++){ ((int*)buf)[0] = i; 16a3: 89 1d 00 96 00 00 mov %ebx,0x9600 if(write(fd, buf, 512) != 512){ 16a9: 68 00 02 00 00 push $0x200 16ae: 68 00 96 00 00 push $0x9600 16b3: 56 push %esi 16b4: e8 09 32 00 00 call 48c2 <write> 16b9: 83 c4 10 add $0x10,%esp 16bc: 3d 00 02 00 00 cmp $0x200,%eax 16c1: 0f 85 b3 00 00 00 jne 177a <writetest1+0x11a> if(fd < 0){ printf(stdout, "error: creat big failed!\n"); exit(); } for(i = 0; i < MAXFILE; i++){ 16c7: 83 c3 01 add $0x1,%ebx 16ca: 81 fb 8c 00 00 00 cmp $0x8c,%ebx 16d0: 75 ce jne 16a0 <writetest1+0x40> printf(stdout, "error: write big file failed\n", i); exit(); } } close(fd); 16d2: 83 ec 0c sub $0xc,%esp 16d5: 56 push %esi 16d6: e8 ef 31 00 00 call 48ca <close> fd = open("big", O_RDONLY); 16db: 58 pop %eax 16dc: 5a pop %edx 16dd: 6a 00 push $0x0 16df: 68 e3 4f 00 00 push $0x4fe3 16e4: e8 f9 31 00 00 call 48e2 <open> if(fd < 0){ 16e9: 83 c4 10 add $0x10,%esp 16ec: 85 c0 test %eax,%eax } } close(fd); fd = open("big", O_RDONLY); 16ee: 89 c6 mov %eax,%esi if(fd < 0){ 16f0: 0f 88 ea 00 00 00 js 17e0 <writetest1+0x180> 16f6: 31 db xor %ebx,%ebx 16f8: eb 1d jmp 1717 <writetest1+0xb7> 16fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(n == MAXFILE - 1){ printf(stdout, "read only %d blocks from big", n); exit(); } break; } else if(i != 512){ 1700: 3d 00 02 00 00 cmp $0x200,%eax 1705: 0f 85 9f 00 00 00 jne 17aa <writetest1+0x14a> printf(stdout, "read failed %d\n", i); exit(); } if(((int*)buf)[0] != n){ 170b: a1 00 96 00 00 mov 0x9600,%eax 1710: 39 c3 cmp %eax,%ebx 1712: 75 7f jne 1793 <writetest1+0x133> printf(stdout, "read content of block %d is %d\n", n, ((int*)buf)[0]); exit(); } n++; 1714: 83 c3 01 add $0x1,%ebx exit(); } n = 0; for(;;){ i = read(fd, buf, 512); 1717: 83 ec 04 sub $0x4,%esp 171a: 68 00 02 00 00 push $0x200 171f: 68 00 96 00 00 push $0x9600 1724: 56 push %esi 1725: e8 90 31 00 00 call 48ba <read> if(i == 0){ 172a: 83 c4 10 add $0x10,%esp 172d: 85 c0 test %eax,%eax 172f: 75 cf jne 1700 <writetest1+0xa0> if(n == MAXFILE - 1){ 1731: 81 fb 8b 00 00 00 cmp $0x8b,%ebx 1737: 0f 84 86 00 00 00 je 17c3 <writetest1+0x163> n, ((int*)buf)[0]); exit(); } n++; } close(fd); 173d: 83 ec 0c sub $0xc,%esp 1740: 56 push %esi 1741: e8 84 31 00 00 call 48ca <close> if(unlink("big") < 0){ 1746: c7 04 24 e3 4f 00 00 movl $0x4fe3,(%esp) 174d: e8 a0 31 00 00 call 48f2 <unlink> 1752: 83 c4 10 add $0x10,%esp 1755: 85 c0 test %eax,%eax 1757: 0f 88 b3 00 00 00 js 1810 <writetest1+0x1b0> printf(stdout, "unlink big failed\n"); exit(); } printf(stdout, "big files ok\n"); 175d: 83 ec 08 sub $0x8,%esp 1760: 68 0a 50 00 00 push $0x500a 1765: ff 35 28 6e 00 00 pushl 0x6e28 176b: e8 90 32 00 00 call 4a00 <printf> } 1770: 83 c4 10 add $0x10,%esp 1773: 8d 65 f8 lea -0x8(%ebp),%esp 1776: 5b pop %ebx 1777: 5e pop %esi 1778: 5d pop %ebp 1779: c3 ret } for(i = 0; i < MAXFILE; i++){ ((int*)buf)[0] = i; if(write(fd, buf, 512) != 512){ printf(stdout, "error: write big file failed\n", i); 177a: 83 ec 04 sub $0x4,%esp 177d: 53 push %ebx 177e: 68 93 4f 00 00 push $0x4f93 1783: ff 35 28 6e 00 00 pushl 0x6e28 1789: e8 72 32 00 00 call 4a00 <printf> exit(); 178e: e8 0f 31 00 00 call 48a2 <exit> } else if(i != 512){ printf(stdout, "read failed %d\n", i); exit(); } if(((int*)buf)[0] != n){ printf(stdout, "read content of block %d is %d\n", 1793: 50 push %eax 1794: 53 push %ebx 1795: 68 e4 5d 00 00 push $0x5de4 179a: ff 35 28 6e 00 00 pushl 0x6e28 17a0: e8 5b 32 00 00 call 4a00 <printf> n, ((int*)buf)[0]); exit(); 17a5: e8 f8 30 00 00 call 48a2 <exit> printf(stdout, "read only %d blocks from big", n); exit(); } break; } else if(i != 512){ printf(stdout, "read failed %d\n", i); 17aa: 83 ec 04 sub $0x4,%esp 17ad: 50 push %eax 17ae: 68 e7 4f 00 00 push $0x4fe7 17b3: ff 35 28 6e 00 00 pushl 0x6e28 17b9: e8 42 32 00 00 call 4a00 <printf> exit(); 17be: e8 df 30 00 00 call 48a2 <exit> n = 0; for(;;){ i = read(fd, buf, 512); if(i == 0){ if(n == MAXFILE - 1){ printf(stdout, "read only %d blocks from big", n); 17c3: 83 ec 04 sub $0x4,%esp 17c6: 68 8b 00 00 00 push $0x8b 17cb: 68 ca 4f 00 00 push $0x4fca 17d0: ff 35 28 6e 00 00 pushl 0x6e28 17d6: e8 25 32 00 00 call 4a00 <printf> exit(); 17db: e8 c2 30 00 00 call 48a2 <exit> close(fd); fd = open("big", O_RDONLY); if(fd < 0){ printf(stdout, "error: open big failed!\n"); 17e0: 83 ec 08 sub $0x8,%esp 17e3: 68 b1 4f 00 00 push $0x4fb1 17e8: ff 35 28 6e 00 00 pushl 0x6e28 17ee: e8 0d 32 00 00 call 4a00 <printf> exit(); 17f3: e8 aa 30 00 00 call 48a2 <exit> printf(stdout, "big files test\n"); fd = open("big", O_CREATE|O_RDWR); if(fd < 0){ printf(stdout, "error: creat big failed!\n"); 17f8: 83 ec 08 sub $0x8,%esp 17fb: 68 79 4f 00 00 push $0x4f79 1800: ff 35 28 6e 00 00 pushl 0x6e28 1806: e8 f5 31 00 00 call 4a00 <printf> exit(); 180b: e8 92 30 00 00 call 48a2 <exit> } n++; } close(fd); if(unlink("big") < 0){ printf(stdout, "unlink big failed\n"); 1810: 83 ec 08 sub $0x8,%esp 1813: 68 f7 4f 00 00 push $0x4ff7 1818: ff 35 28 6e 00 00 pushl 0x6e28 181e: e8 dd 31 00 00 call 4a00 <printf> exit(); 1823: e8 7a 30 00 00 call 48a2 <exit> 1828: 90 nop 1829: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00001830 <createtest>: printf(stdout, "big files ok\n"); } void createtest(void) { 1830: 55 push %ebp 1831: 89 e5 mov %esp,%ebp 1833: 53 push %ebx int i, fd; printf(stdout, "many creates, followed by unlink test\n"); name[0] = 'a'; name[2] = '\0'; 1834: bb 30 00 00 00 mov $0x30,%ebx printf(stdout, "big files ok\n"); } void createtest(void) { 1839: 83 ec 0c sub $0xc,%esp int i, fd; printf(stdout, "many creates, followed by unlink test\n"); 183c: 68 04 5e 00 00 push $0x5e04 1841: ff 35 28 6e 00 00 pushl 0x6e28 1847: e8 b4 31 00 00 call 4a00 <printf> name[0] = 'a'; 184c: c6 05 00 b6 00 00 61 movb $0x61,0xb600 name[2] = '\0'; 1853: c6 05 02 b6 00 00 00 movb $0x0,0xb602 185a: 83 c4 10 add $0x10,%esp 185d: 8d 76 00 lea 0x0(%esi),%esi for(i = 0; i < 52; i++){ name[1] = '0' + i; fd = open(name, O_CREATE|O_RDWR); 1860: 83 ec 08 sub $0x8,%esp printf(stdout, "many creates, followed by unlink test\n"); name[0] = 'a'; name[2] = '\0'; for(i = 0; i < 52; i++){ name[1] = '0' + i; 1863: 88 1d 01 b6 00 00 mov %bl,0xb601 1869: 83 c3 01 add $0x1,%ebx fd = open(name, O_CREATE|O_RDWR); 186c: 68 02 02 00 00 push $0x202 1871: 68 00 b6 00 00 push $0xb600 1876: e8 67 30 00 00 call 48e2 <open> close(fd); 187b: 89 04 24 mov %eax,(%esp) 187e: e8 47 30 00 00 call 48ca <close> printf(stdout, "many creates, followed by unlink test\n"); name[0] = 'a'; name[2] = '\0'; for(i = 0; i < 52; i++){ 1883: 83 c4 10 add $0x10,%esp 1886: 80 fb 64 cmp $0x64,%bl 1889: 75 d5 jne 1860 <createtest+0x30> name[1] = '0' + i; fd = open(name, O_CREATE|O_RDWR); close(fd); } name[0] = 'a'; 188b: c6 05 00 b6 00 00 61 movb $0x61,0xb600 name[2] = '\0'; 1892: c6 05 02 b6 00 00 00 movb $0x0,0xb602 1899: bb 30 00 00 00 mov $0x30,%ebx 189e: 66 90 xchg %ax,%ax for(i = 0; i < 52; i++){ name[1] = '0' + i; unlink(name); 18a0: 83 ec 0c sub $0xc,%esp close(fd); } name[0] = 'a'; name[2] = '\0'; for(i = 0; i < 52; i++){ name[1] = '0' + i; 18a3: 88 1d 01 b6 00 00 mov %bl,0xb601 18a9: 83 c3 01 add $0x1,%ebx unlink(name); 18ac: 68 00 b6 00 00 push $0xb600 18b1: e8 3c 30 00 00 call 48f2 <unlink> fd = open(name, O_CREATE|O_RDWR); close(fd); } name[0] = 'a'; name[2] = '\0'; for(i = 0; i < 52; i++){ 18b6: 83 c4 10 add $0x10,%esp 18b9: 80 fb 64 cmp $0x64,%bl 18bc: 75 e2 jne 18a0 <createtest+0x70> name[1] = '0' + i; unlink(name); } printf(stdout, "many creates, followed by unlink; ok\n"); 18be: 83 ec 08 sub $0x8,%esp 18c1: 68 2c 5e 00 00 push $0x5e2c 18c6: ff 35 28 6e 00 00 pushl 0x6e28 18cc: e8 2f 31 00 00 call 4a00 <printf> } 18d1: 83 c4 10 add $0x10,%esp 18d4: 8b 5d fc mov -0x4(%ebp),%ebx 18d7: c9 leave 18d8: c3 ret 18d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 000018e0 <dirtest>: void dirtest(void) { 18e0: 55 push %ebp 18e1: 89 e5 mov %esp,%ebp 18e3: 83 ec 10 sub $0x10,%esp printf(stdout, "mkdir test\n"); 18e6: 68 18 50 00 00 push $0x5018 18eb: ff 35 28 6e 00 00 pushl 0x6e28 18f1: e8 0a 31 00 00 call 4a00 <printf> if(mkdir("dir0") < 0){ 18f6: c7 04 24 24 50 00 00 movl $0x5024,(%esp) 18fd: e8 08 30 00 00 call 490a <mkdir> 1902: 83 c4 10 add $0x10,%esp 1905: 85 c0 test %eax,%eax 1907: 78 58 js 1961 <dirtest+0x81> printf(stdout, "mkdir failed\n"); exit(); } if(chdir("dir0") < 0){ 1909: 83 ec 0c sub $0xc,%esp 190c: 68 24 50 00 00 push $0x5024 1911: e8 fc 2f 00 00 call 4912 <chdir> 1916: 83 c4 10 add $0x10,%esp 1919: 85 c0 test %eax,%eax 191b: 0f 88 85 00 00 00 js 19a6 <dirtest+0xc6> printf(stdout, "chdir dir0 failed\n"); exit(); } if(chdir("..") < 0){ 1921: 83 ec 0c sub $0xc,%esp 1924: 68 c9 55 00 00 push $0x55c9 1929: e8 e4 2f 00 00 call 4912 <chdir> 192e: 83 c4 10 add $0x10,%esp 1931: 85 c0 test %eax,%eax 1933: 78 5a js 198f <dirtest+0xaf> printf(stdout, "chdir .. failed\n"); exit(); } if(unlink("dir0") < 0){ 1935: 83 ec 0c sub $0xc,%esp 1938: 68 24 50 00 00 push $0x5024 193d: e8 b0 2f 00 00 call 48f2 <unlink> 1942: 83 c4 10 add $0x10,%esp 1945: 85 c0 test %eax,%eax 1947: 78 2f js 1978 <dirtest+0x98> printf(stdout, "unlink dir0 failed\n"); exit(); } printf(stdout, "mkdir test ok\n"); 1949: 83 ec 08 sub $0x8,%esp 194c: 68 61 50 00 00 push $0x5061 1951: ff 35 28 6e 00 00 pushl 0x6e28 1957: e8 a4 30 00 00 call 4a00 <printf> } 195c: 83 c4 10 add $0x10,%esp 195f: c9 leave 1960: c3 ret void dirtest(void) { printf(stdout, "mkdir test\n"); if(mkdir("dir0") < 0){ printf(stdout, "mkdir failed\n"); 1961: 50 push %eax 1962: 50 push %eax 1963: 68 54 4d 00 00 push $0x4d54 1968: ff 35 28 6e 00 00 pushl 0x6e28 196e: e8 8d 30 00 00 call 4a00 <printf> exit(); 1973: e8 2a 2f 00 00 call 48a2 <exit> printf(stdout, "chdir .. failed\n"); exit(); } if(unlink("dir0") < 0){ printf(stdout, "unlink dir0 failed\n"); 1978: 50 push %eax 1979: 50 push %eax 197a: 68 4d 50 00 00 push $0x504d 197f: ff 35 28 6e 00 00 pushl 0x6e28 1985: e8 76 30 00 00 call 4a00 <printf> exit(); 198a: e8 13 2f 00 00 call 48a2 <exit> printf(stdout, "chdir dir0 failed\n"); exit(); } if(chdir("..") < 0){ printf(stdout, "chdir .. failed\n"); 198f: 52 push %edx 1990: 52 push %edx 1991: 68 3c 50 00 00 push $0x503c 1996: ff 35 28 6e 00 00 pushl 0x6e28 199c: e8 5f 30 00 00 call 4a00 <printf> exit(); 19a1: e8 fc 2e 00 00 call 48a2 <exit> printf(stdout, "mkdir failed\n"); exit(); } if(chdir("dir0") < 0){ printf(stdout, "chdir dir0 failed\n"); 19a6: 51 push %ecx 19a7: 51 push %ecx 19a8: 68 29 50 00 00 push $0x5029 19ad: ff 35 28 6e 00 00 pushl 0x6e28 19b3: e8 48 30 00 00 call 4a00 <printf> exit(); 19b8: e8 e5 2e 00 00 call 48a2 <exit> 19bd: 8d 76 00 lea 0x0(%esi),%esi 000019c0 <exectest>: printf(stdout, "mkdir test ok\n"); } void exectest(void) { 19c0: 55 push %ebp 19c1: 89 e5 mov %esp,%ebp 19c3: 83 ec 10 sub $0x10,%esp printf(stdout, "exec test\n"); 19c6: 68 70 50 00 00 push $0x5070 19cb: ff 35 28 6e 00 00 pushl 0x6e28 19d1: e8 2a 30 00 00 call 4a00 <printf> if(exec("echo", echoargv) < 0){ 19d6: 5a pop %edx 19d7: 59 pop %ecx 19d8: 68 2c 6e 00 00 push $0x6e2c 19dd: 68 39 4e 00 00 push $0x4e39 19e2: e8 f3 2e 00 00 call 48da <exec> 19e7: 83 c4 10 add $0x10,%esp 19ea: 85 c0 test %eax,%eax 19ec: 78 02 js 19f0 <exectest+0x30> printf(stdout, "exec echo failed\n"); exit(); } } 19ee: c9 leave 19ef: c3 ret void exectest(void) { printf(stdout, "exec test\n"); if(exec("echo", echoargv) < 0){ printf(stdout, "exec echo failed\n"); 19f0: 50 push %eax 19f1: 50 push %eax 19f2: 68 7b 50 00 00 push $0x507b 19f7: ff 35 28 6e 00 00 pushl 0x6e28 19fd: e8 fe 2f 00 00 call 4a00 <printf> exit(); 1a02: e8 9b 2e 00 00 call 48a2 <exit> 1a07: 89 f6 mov %esi,%esi 1a09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00001a10 <pipe1>: // simple fork and pipe read/write void pipe1(void) { 1a10: 55 push %ebp 1a11: 89 e5 mov %esp,%ebp 1a13: 57 push %edi 1a14: 56 push %esi 1a15: 53 push %ebx int fds[2], pid; int seq, i, n, cc, total; if(pipe(fds) != 0){ 1a16: 8d 45 e0 lea -0x20(%ebp),%eax // simple fork and pipe read/write void pipe1(void) { 1a19: 83 ec 38 sub $0x38,%esp int fds[2], pid; int seq, i, n, cc, total; if(pipe(fds) != 0){ 1a1c: 50 push %eax 1a1d: e8 90 2e 00 00 call 48b2 <pipe> 1a22: 83 c4 10 add $0x10,%esp 1a25: 85 c0 test %eax,%eax 1a27: 0f 85 35 01 00 00 jne 1b62 <pipe1+0x152> printf(1, "pipe() failed\n"); exit(); } pid = fork(); 1a2d: e8 68 2e 00 00 call 489a <fork> seq = 0; if(pid == 0){ 1a32: 83 f8 00 cmp $0x0,%eax 1a35: 0f 84 86 00 00 00 je 1ac1 <pipe1+0xb1> printf(1, "pipe1 oops 1\n"); exit(); } } exit(); } else if(pid > 0){ 1a3b: 0f 8e 35 01 00 00 jle 1b76 <pipe1+0x166> close(fds[1]); 1a41: 83 ec 0c sub $0xc,%esp 1a44: ff 75 e4 pushl -0x1c(%ebp) total = 0; cc = 1; 1a47: bf 01 00 00 00 mov $0x1,%edi if(pipe(fds) != 0){ printf(1, "pipe() failed\n"); exit(); } pid = fork(); seq = 0; 1a4c: 31 db xor %ebx,%ebx exit(); } } exit(); } else if(pid > 0){ close(fds[1]); 1a4e: e8 77 2e 00 00 call 48ca <close> total = 0; cc = 1; while((n = read(fds[0], buf, cc)) > 0){ 1a53: 83 c4 10 add $0x10,%esp } } exit(); } else if(pid > 0){ close(fds[1]); total = 0; 1a56: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) cc = 1; while((n = read(fds[0], buf, cc)) > 0){ 1a5d: 83 ec 04 sub $0x4,%esp 1a60: 57 push %edi 1a61: 68 00 96 00 00 push $0x9600 1a66: ff 75 e0 pushl -0x20(%ebp) 1a69: e8 4c 2e 00 00 call 48ba <read> 1a6e: 83 c4 10 add $0x10,%esp 1a71: 85 c0 test %eax,%eax 1a73: 0f 8e a3 00 00 00 jle 1b1c <pipe1+0x10c> for(i = 0; i < n; i++){ if((buf[i] & 0xff) != (seq++ & 0xff)){ 1a79: 89 d9 mov %ebx,%ecx 1a7b: 8d 34 18 lea (%eax,%ebx,1),%esi 1a7e: f7 d9 neg %ecx 1a80: 38 9c 0b 00 96 00 00 cmp %bl,0x9600(%ebx,%ecx,1) 1a87: 8d 53 01 lea 0x1(%ebx),%edx 1a8a: 75 1b jne 1aa7 <pipe1+0x97> } else if(pid > 0){ close(fds[1]); total = 0; cc = 1; while((n = read(fds[0], buf, cc)) > 0){ for(i = 0; i < n; i++){ 1a8c: 39 f2 cmp %esi,%edx 1a8e: 89 d3 mov %edx,%ebx 1a90: 75 ee jne 1a80 <pipe1+0x70> printf(1, "pipe1 oops 2\n"); return; } } total += n; cc = cc * 2; 1a92: 01 ff add %edi,%edi if((buf[i] & 0xff) != (seq++ & 0xff)){ printf(1, "pipe1 oops 2\n"); return; } } total += n; 1a94: 01 45 d4 add %eax,-0x2c(%ebp) 1a97: b8 00 20 00 00 mov $0x2000,%eax 1a9c: 81 ff 00 20 00 00 cmp $0x2000,%edi 1aa2: 0f 4f f8 cmovg %eax,%edi 1aa5: eb b6 jmp 1a5d <pipe1+0x4d> total = 0; cc = 1; while((n = read(fds[0], buf, cc)) > 0){ for(i = 0; i < n; i++){ if((buf[i] & 0xff) != (seq++ & 0xff)){ printf(1, "pipe1 oops 2\n"); 1aa7: 83 ec 08 sub $0x8,%esp 1aaa: 68 aa 50 00 00 push $0x50aa 1aaf: 6a 01 push $0x1 1ab1: e8 4a 2f 00 00 call 4a00 <printf> return; 1ab6: 83 c4 10 add $0x10,%esp } else { printf(1, "fork() failed\n"); exit(); } printf(1, "pipe1 ok\n"); } 1ab9: 8d 65 f4 lea -0xc(%ebp),%esp 1abc: 5b pop %ebx 1abd: 5e pop %esi 1abe: 5f pop %edi 1abf: 5d pop %ebp 1ac0: c3 ret exit(); } pid = fork(); seq = 0; if(pid == 0){ close(fds[0]); 1ac1: 83 ec 0c sub $0xc,%esp 1ac4: ff 75 e0 pushl -0x20(%ebp) if(pipe(fds) != 0){ printf(1, "pipe() failed\n"); exit(); } pid = fork(); seq = 0; 1ac7: 31 f6 xor %esi,%esi if(pid == 0){ close(fds[0]); 1ac9: e8 fc 2d 00 00 call 48ca <close> 1ace: 83 c4 10 add $0x10,%esp for(n = 0; n < 5; n++){ for(i = 0; i < 1033; i++) buf[i] = seq++; 1ad1: 89 f0 mov %esi,%eax 1ad3: 8d 96 09 04 00 00 lea 0x409(%esi),%edx // simple fork and pipe read/write void pipe1(void) { 1ad9: 89 f3 mov %esi,%ebx seq = 0; if(pid == 0){ close(fds[0]); for(n = 0; n < 5; n++){ for(i = 0; i < 1033; i++) buf[i] = seq++; 1adb: f7 d8 neg %eax 1add: 8d 76 00 lea 0x0(%esi),%esi 1ae0: 88 9c 18 00 96 00 00 mov %bl,0x9600(%eax,%ebx,1) 1ae7: 83 c3 01 add $0x1,%ebx pid = fork(); seq = 0; if(pid == 0){ close(fds[0]); for(n = 0; n < 5; n++){ for(i = 0; i < 1033; i++) 1aea: 39 d3 cmp %edx,%ebx 1aec: 75 f2 jne 1ae0 <pipe1+0xd0> buf[i] = seq++; if(write(fds[1], buf, 1033) != 1033){ 1aee: 83 ec 04 sub $0x4,%esp 1af1: 89 de mov %ebx,%esi 1af3: 68 09 04 00 00 push $0x409 1af8: 68 00 96 00 00 push $0x9600 1afd: ff 75 e4 pushl -0x1c(%ebp) 1b00: e8 bd 2d 00 00 call 48c2 <write> 1b05: 83 c4 10 add $0x10,%esp 1b08: 3d 09 04 00 00 cmp $0x409,%eax 1b0d: 75 7b jne 1b8a <pipe1+0x17a> } pid = fork(); seq = 0; if(pid == 0){ close(fds[0]); for(n = 0; n < 5; n++){ 1b0f: 81 fb 2d 14 00 00 cmp $0x142d,%ebx 1b15: 75 ba jne 1ad1 <pipe1+0xc1> if(write(fds[1], buf, 1033) != 1033){ printf(1, "pipe1 oops 1\n"); exit(); } } exit(); 1b17: e8 86 2d 00 00 call 48a2 <exit> total += n; cc = cc * 2; if(cc > sizeof(buf)) cc = sizeof(buf); } if(total != 5 * 1033){ 1b1c: 81 7d d4 2d 14 00 00 cmpl $0x142d,-0x2c(%ebp) 1b23: 75 26 jne 1b4b <pipe1+0x13b> printf(1, "pipe1 oops 3 total %d\n", total); exit(); } close(fds[0]); 1b25: 83 ec 0c sub $0xc,%esp 1b28: ff 75 e0 pushl -0x20(%ebp) 1b2b: e8 9a 2d 00 00 call 48ca <close> wait(); 1b30: e8 75 2d 00 00 call 48aa <wait> } else { printf(1, "fork() failed\n"); exit(); } printf(1, "pipe1 ok\n"); 1b35: 58 pop %eax 1b36: 5a pop %edx 1b37: 68 cf 50 00 00 push $0x50cf 1b3c: 6a 01 push $0x1 1b3e: e8 bd 2e 00 00 call 4a00 <printf> 1b43: 83 c4 10 add $0x10,%esp 1b46: e9 6e ff ff ff jmp 1ab9 <pipe1+0xa9> cc = cc * 2; if(cc > sizeof(buf)) cc = sizeof(buf); } if(total != 5 * 1033){ printf(1, "pipe1 oops 3 total %d\n", total); 1b4b: 83 ec 04 sub $0x4,%esp 1b4e: ff 75 d4 pushl -0x2c(%ebp) 1b51: 68 b8 50 00 00 push $0x50b8 1b56: 6a 01 push $0x1 1b58: e8 a3 2e 00 00 call 4a00 <printf> exit(); 1b5d: e8 40 2d 00 00 call 48a2 <exit> { int fds[2], pid; int seq, i, n, cc, total; if(pipe(fds) != 0){ printf(1, "pipe() failed\n"); 1b62: 83 ec 08 sub $0x8,%esp 1b65: 68 8d 50 00 00 push $0x508d 1b6a: 6a 01 push $0x1 1b6c: e8 8f 2e 00 00 call 4a00 <printf> exit(); 1b71: e8 2c 2d 00 00 call 48a2 <exit> exit(); } close(fds[0]); wait(); } else { printf(1, "fork() failed\n"); 1b76: 83 ec 08 sub $0x8,%esp 1b79: 68 d9 50 00 00 push $0x50d9 1b7e: 6a 01 push $0x1 1b80: e8 7b 2e 00 00 call 4a00 <printf> exit(); 1b85: e8 18 2d 00 00 call 48a2 <exit> close(fds[0]); for(n = 0; n < 5; n++){ for(i = 0; i < 1033; i++) buf[i] = seq++; if(write(fds[1], buf, 1033) != 1033){ printf(1, "pipe1 oops 1\n"); 1b8a: 83 ec 08 sub $0x8,%esp 1b8d: 68 9c 50 00 00 push $0x509c 1b92: 6a 01 push $0x1 1b94: e8 67 2e 00 00 call 4a00 <printf> exit(); 1b99: e8 04 2d 00 00 call 48a2 <exit> 1b9e: 66 90 xchg %ax,%ax 00001ba0 <preempt>: } // meant to be run w/ at most two CPUs void preempt(void) { 1ba0: 55 push %ebp 1ba1: 89 e5 mov %esp,%ebp 1ba3: 57 push %edi 1ba4: 56 push %esi 1ba5: 53 push %ebx 1ba6: 83 ec 24 sub $0x24,%esp int pid1, pid2, pid3; int pfds[2]; printf(1, "preempt: "); 1ba9: 68 e8 50 00 00 push $0x50e8 1bae: 6a 01 push $0x1 1bb0: e8 4b 2e 00 00 call 4a00 <printf> pid1 = fork(); 1bb5: e8 e0 2c 00 00 call 489a <fork> if(pid1 == 0) 1bba: 83 c4 10 add $0x10,%esp 1bbd: 85 c0 test %eax,%eax 1bbf: 75 02 jne 1bc3 <preempt+0x23> 1bc1: eb fe jmp 1bc1 <preempt+0x21> 1bc3: 89 c7 mov %eax,%edi for(;;) ; pid2 = fork(); 1bc5: e8 d0 2c 00 00 call 489a <fork> if(pid2 == 0) 1bca: 85 c0 test %eax,%eax pid1 = fork(); if(pid1 == 0) for(;;) ; pid2 = fork(); 1bcc: 89 c6 mov %eax,%esi if(pid2 == 0) 1bce: 75 02 jne 1bd2 <preempt+0x32> 1bd0: eb fe jmp 1bd0 <preempt+0x30> for(;;) ; pipe(pfds); 1bd2: 8d 45 e0 lea -0x20(%ebp),%eax 1bd5: 83 ec 0c sub $0xc,%esp 1bd8: 50 push %eax 1bd9: e8 d4 2c 00 00 call 48b2 <pipe> pid3 = fork(); 1bde: e8 b7 2c 00 00 call 489a <fork> if(pid3 == 0){ 1be3: 83 c4 10 add $0x10,%esp 1be6: 85 c0 test %eax,%eax if(pid2 == 0) for(;;) ; pipe(pfds); pid3 = fork(); 1be8: 89 c3 mov %eax,%ebx if(pid3 == 0){ 1bea: 75 47 jne 1c33 <preempt+0x93> close(pfds[0]); 1bec: 83 ec 0c sub $0xc,%esp 1bef: ff 75 e0 pushl -0x20(%ebp) 1bf2: e8 d3 2c 00 00 call 48ca <close> if(write(pfds[1], "x", 1) != 1) 1bf7: 83 c4 0c add $0xc,%esp 1bfa: 6a 01 push $0x1 1bfc: 68 ad 56 00 00 push $0x56ad 1c01: ff 75 e4 pushl -0x1c(%ebp) 1c04: e8 b9 2c 00 00 call 48c2 <write> 1c09: 83 c4 10 add $0x10,%esp 1c0c: 83 f8 01 cmp $0x1,%eax 1c0f: 74 12 je 1c23 <preempt+0x83> printf(1, "preempt write error"); 1c11: 83 ec 08 sub $0x8,%esp 1c14: 68 f2 50 00 00 push $0x50f2 1c19: 6a 01 push $0x1 1c1b: e8 e0 2d 00 00 call 4a00 <printf> 1c20: 83 c4 10 add $0x10,%esp close(pfds[1]); 1c23: 83 ec 0c sub $0xc,%esp 1c26: ff 75 e4 pushl -0x1c(%ebp) 1c29: e8 9c 2c 00 00 call 48ca <close> 1c2e: 83 c4 10 add $0x10,%esp 1c31: eb fe jmp 1c31 <preempt+0x91> for(;;) ; } close(pfds[1]); 1c33: 83 ec 0c sub $0xc,%esp 1c36: ff 75 e4 pushl -0x1c(%ebp) 1c39: e8 8c 2c 00 00 call 48ca <close> if(read(pfds[0], buf, sizeof(buf)) != 1){ 1c3e: 83 c4 0c add $0xc,%esp 1c41: 68 00 20 00 00 push $0x2000 1c46: 68 00 96 00 00 push $0x9600 1c4b: ff 75 e0 pushl -0x20(%ebp) 1c4e: e8 67 2c 00 00 call 48ba <read> 1c53: 83 c4 10 add $0x10,%esp 1c56: 83 f8 01 cmp $0x1,%eax 1c59: 74 1a je 1c75 <preempt+0xd5> printf(1, "preempt read error"); 1c5b: 83 ec 08 sub $0x8,%esp 1c5e: 68 06 51 00 00 push $0x5106 1c63: 6a 01 push $0x1 1c65: e8 96 2d 00 00 call 4a00 <printf> return; 1c6a: 83 c4 10 add $0x10,%esp printf(1, "wait... "); wait(); wait(); wait(); printf(1, "preempt ok\n"); } 1c6d: 8d 65 f4 lea -0xc(%ebp),%esp 1c70: 5b pop %ebx 1c71: 5e pop %esi 1c72: 5f pop %edi 1c73: 5d pop %ebp 1c74: c3 ret close(pfds[1]); if(read(pfds[0], buf, sizeof(buf)) != 1){ printf(1, "preempt read error"); return; } close(pfds[0]); 1c75: 83 ec 0c sub $0xc,%esp 1c78: ff 75 e0 pushl -0x20(%ebp) 1c7b: e8 4a 2c 00 00 call 48ca <close> printf(1, "kill... "); 1c80: 58 pop %eax 1c81: 5a pop %edx 1c82: 68 19 51 00 00 push $0x5119 1c87: 6a 01 push $0x1 1c89: e8 72 2d 00 00 call 4a00 <printf> kill(pid1); 1c8e: 89 3c 24 mov %edi,(%esp) 1c91: e8 3c 2c 00 00 call 48d2 <kill> kill(pid2); 1c96: 89 34 24 mov %esi,(%esp) 1c99: e8 34 2c 00 00 call 48d2 <kill> kill(pid3); 1c9e: 89 1c 24 mov %ebx,(%esp) 1ca1: e8 2c 2c 00 00 call 48d2 <kill> printf(1, "wait... "); 1ca6: 59 pop %ecx 1ca7: 5b pop %ebx 1ca8: 68 22 51 00 00 push $0x5122 1cad: 6a 01 push $0x1 1caf: e8 4c 2d 00 00 call 4a00 <printf> wait(); 1cb4: e8 f1 2b 00 00 call 48aa <wait> wait(); 1cb9: e8 ec 2b 00 00 call 48aa <wait> wait(); 1cbe: e8 e7 2b 00 00 call 48aa <wait> printf(1, "preempt ok\n"); 1cc3: 5e pop %esi 1cc4: 5f pop %edi 1cc5: 68 2b 51 00 00 push $0x512b 1cca: 6a 01 push $0x1 1ccc: e8 2f 2d 00 00 call 4a00 <printf> 1cd1: 83 c4 10 add $0x10,%esp 1cd4: eb 97 jmp 1c6d <preempt+0xcd> 1cd6: 8d 76 00 lea 0x0(%esi),%esi 1cd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00001ce0 <exitwait>: } // try to find any races between exit and wait void exitwait(void) { 1ce0: 55 push %ebp 1ce1: 89 e5 mov %esp,%ebp 1ce3: 56 push %esi 1ce4: be 64 00 00 00 mov $0x64,%esi 1ce9: 53 push %ebx 1cea: eb 14 jmp 1d00 <exitwait+0x20> 1cec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi pid = fork(); if(pid < 0){ printf(1, "fork failed\n"); return; } if(pid){ 1cf0: 74 6f je 1d61 <exitwait+0x81> if(wait() != pid){ 1cf2: e8 b3 2b 00 00 call 48aa <wait> 1cf7: 39 c3 cmp %eax,%ebx 1cf9: 75 2d jne 1d28 <exitwait+0x48> void exitwait(void) { int i, pid; for(i = 0; i < 100; i++){ 1cfb: 83 ee 01 sub $0x1,%esi 1cfe: 74 48 je 1d48 <exitwait+0x68> pid = fork(); 1d00: e8 95 2b 00 00 call 489a <fork> if(pid < 0){ 1d05: 85 c0 test %eax,%eax exitwait(void) { int i, pid; for(i = 0; i < 100; i++){ pid = fork(); 1d07: 89 c3 mov %eax,%ebx if(pid < 0){ 1d09: 79 e5 jns 1cf0 <exitwait+0x10> printf(1, "fork failed\n"); 1d0b: 83 ec 08 sub $0x8,%esp 1d0e: 68 95 5c 00 00 push $0x5c95 1d13: 6a 01 push $0x1 1d15: e8 e6 2c 00 00 call 4a00 <printf> return; 1d1a: 83 c4 10 add $0x10,%esp } else { exit(); } } printf(1, "exitwait ok\n"); } 1d1d: 8d 65 f8 lea -0x8(%ebp),%esp 1d20: 5b pop %ebx 1d21: 5e pop %esi 1d22: 5d pop %ebp 1d23: c3 ret 1d24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi printf(1, "fork failed\n"); return; } if(pid){ if(wait() != pid){ printf(1, "wait wrong pid\n"); 1d28: 83 ec 08 sub $0x8,%esp 1d2b: 68 37 51 00 00 push $0x5137 1d30: 6a 01 push $0x1 1d32: e8 c9 2c 00 00 call 4a00 <printf> return; 1d37: 83 c4 10 add $0x10,%esp } else { exit(); } } printf(1, "exitwait ok\n"); } 1d3a: 8d 65 f8 lea -0x8(%ebp),%esp 1d3d: 5b pop %ebx 1d3e: 5e pop %esi 1d3f: 5d pop %ebp 1d40: c3 ret 1d41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } } else { exit(); } } printf(1, "exitwait ok\n"); 1d48: 83 ec 08 sub $0x8,%esp 1d4b: 68 47 51 00 00 push $0x5147 1d50: 6a 01 push $0x1 1d52: e8 a9 2c 00 00 call 4a00 <printf> 1d57: 83 c4 10 add $0x10,%esp } 1d5a: 8d 65 f8 lea -0x8(%ebp),%esp 1d5d: 5b pop %ebx 1d5e: 5e pop %esi 1d5f: 5d pop %ebp 1d60: c3 ret if(wait() != pid){ printf(1, "wait wrong pid\n"); return; } } else { exit(); 1d61: e8 3c 2b 00 00 call 48a2 <exit> 1d66: 8d 76 00 lea 0x0(%esi),%esi 1d69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00001d70 <mem>: printf(1, "exitwait ok\n"); } void mem(void) { 1d70: 55 push %ebp 1d71: 89 e5 mov %esp,%ebp 1d73: 57 push %edi 1d74: 56 push %esi 1d75: 53 push %ebx 1d76: 83 ec 14 sub $0x14,%esp void *m1, *m2; int pid, ppid; printf(1, "mem test\n"); 1d79: 68 54 51 00 00 push $0x5154 1d7e: 6a 01 push $0x1 1d80: e8 7b 2c 00 00 call 4a00 <printf> ppid = getpid(); 1d85: e8 98 2b 00 00 call 4922 <getpid> 1d8a: 89 c6 mov %eax,%esi if((pid = fork()) == 0){ 1d8c: e8 09 2b 00 00 call 489a <fork> 1d91: 83 c4 10 add $0x10,%esp 1d94: 85 c0 test %eax,%eax 1d96: 75 70 jne 1e08 <mem+0x98> 1d98: 31 db xor %ebx,%ebx 1d9a: eb 08 jmp 1da4 <mem+0x34> 1d9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi m1 = 0; while((m2 = malloc(10001)) != 0){ *(char**)m2 = m1; 1da0: 89 18 mov %ebx,(%eax) 1da2: 89 c3 mov %eax,%ebx printf(1, "mem test\n"); ppid = getpid(); if((pid = fork()) == 0){ m1 = 0; while((m2 = malloc(10001)) != 0){ 1da4: 83 ec 0c sub $0xc,%esp 1da7: 68 11 27 00 00 push $0x2711 1dac: e8 7f 2e 00 00 call 4c30 <malloc> 1db1: 83 c4 10 add $0x10,%esp 1db4: 85 c0 test %eax,%eax 1db6: 75 e8 jne 1da0 <mem+0x30> *(char**)m2 = m1; m1 = m2; } while(m1){ 1db8: 85 db test %ebx,%ebx 1dba: 74 18 je 1dd4 <mem+0x64> 1dbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi m2 = *(char**)m1; 1dc0: 8b 3b mov (%ebx),%edi free(m1); 1dc2: 83 ec 0c sub $0xc,%esp 1dc5: 53 push %ebx 1dc6: 89 fb mov %edi,%ebx 1dc8: e8 d3 2d 00 00 call 4ba0 <free> m1 = 0; while((m2 = malloc(10001)) != 0){ *(char**)m2 = m1; m1 = m2; } while(m1){ 1dcd: 83 c4 10 add $0x10,%esp 1dd0: 85 db test %ebx,%ebx 1dd2: 75 ec jne 1dc0 <mem+0x50> m2 = *(char**)m1; free(m1); m1 = m2; } m1 = malloc(1024*20); 1dd4: 83 ec 0c sub $0xc,%esp 1dd7: 68 00 50 00 00 push $0x5000 1ddc: e8 4f 2e 00 00 call 4c30 <malloc> if(m1 == 0){ 1de1: 83 c4 10 add $0x10,%esp 1de4: 85 c0 test %eax,%eax 1de6: 74 30 je 1e18 <mem+0xa8> printf(1, "couldn't allocate mem?!!\n"); kill(ppid); exit(); } free(m1); 1de8: 83 ec 0c sub $0xc,%esp 1deb: 50 push %eax 1dec: e8 af 2d 00 00 call 4ba0 <free> printf(1, "mem ok\n"); 1df1: 58 pop %eax 1df2: 5a pop %edx 1df3: 68 78 51 00 00 push $0x5178 1df8: 6a 01 push $0x1 1dfa: e8 01 2c 00 00 call 4a00 <printf> exit(); 1dff: e8 9e 2a 00 00 call 48a2 <exit> 1e04: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } else { wait(); } } 1e08: 8d 65 f4 lea -0xc(%ebp),%esp 1e0b: 5b pop %ebx 1e0c: 5e pop %esi 1e0d: 5f pop %edi 1e0e: 5d pop %ebp } free(m1); printf(1, "mem ok\n"); exit(); } else { wait(); 1e0f: e9 96 2a 00 00 jmp 48aa <wait> 1e14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi free(m1); m1 = m2; } m1 = malloc(1024*20); if(m1 == 0){ printf(1, "couldn't allocate mem?!!\n"); 1e18: 83 ec 08 sub $0x8,%esp 1e1b: 68 5e 51 00 00 push $0x515e 1e20: 6a 01 push $0x1 1e22: e8 d9 2b 00 00 call 4a00 <printf> kill(ppid); 1e27: 89 34 24 mov %esi,(%esp) 1e2a: e8 a3 2a 00 00 call 48d2 <kill> exit(); 1e2f: e8 6e 2a 00 00 call 48a2 <exit> 1e34: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 1e3a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00001e40 <sharedfd>: // two processes write to the same file descriptor // is the offset shared? does inode locking work? void sharedfd(void) { 1e40: 55 push %ebp 1e41: 89 e5 mov %esp,%ebp 1e43: 57 push %edi 1e44: 56 push %esi 1e45: 53 push %ebx 1e46: 83 ec 34 sub $0x34,%esp int fd, pid, i, n, nc, np; char buf[10]; printf(1, "sharedfd test\n"); 1e49: 68 80 51 00 00 push $0x5180 1e4e: 6a 01 push $0x1 1e50: e8 ab 2b 00 00 call 4a00 <printf> unlink("sharedfd"); 1e55: c7 04 24 8f 51 00 00 movl $0x518f,(%esp) 1e5c: e8 91 2a 00 00 call 48f2 <unlink> fd = open("sharedfd", O_CREATE|O_RDWR); 1e61: 5b pop %ebx 1e62: 5e pop %esi 1e63: 68 02 02 00 00 push $0x202 1e68: 68 8f 51 00 00 push $0x518f 1e6d: e8 70 2a 00 00 call 48e2 <open> if(fd < 0){ 1e72: 83 c4 10 add $0x10,%esp 1e75: 85 c0 test %eax,%eax 1e77: 0f 88 29 01 00 00 js 1fa6 <sharedfd+0x166> 1e7d: 89 c7 mov %eax,%edi printf(1, "fstests: cannot open sharedfd for writing"); return; } pid = fork(); memset(buf, pid==0?'c':'p', sizeof(buf)); 1e7f: 8d 75 de lea -0x22(%ebp),%esi 1e82: bb e8 03 00 00 mov $0x3e8,%ebx fd = open("sharedfd", O_CREATE|O_RDWR); if(fd < 0){ printf(1, "fstests: cannot open sharedfd for writing"); return; } pid = fork(); 1e87: e8 0e 2a 00 00 call 489a <fork> memset(buf, pid==0?'c':'p', sizeof(buf)); 1e8c: 83 f8 01 cmp $0x1,%eax fd = open("sharedfd", O_CREATE|O_RDWR); if(fd < 0){ printf(1, "fstests: cannot open sharedfd for writing"); return; } pid = fork(); 1e8f: 89 45 d4 mov %eax,-0x2c(%ebp) memset(buf, pid==0?'c':'p', sizeof(buf)); 1e92: 19 c0 sbb %eax,%eax 1e94: 83 ec 04 sub $0x4,%esp 1e97: 83 e0 f3 and $0xfffffff3,%eax 1e9a: 6a 0a push $0xa 1e9c: 83 c0 70 add $0x70,%eax 1e9f: 50 push %eax 1ea0: 56 push %esi 1ea1: e8 6a 28 00 00 call 4710 <memset> 1ea6: 83 c4 10 add $0x10,%esp 1ea9: eb 0a jmp 1eb5 <sharedfd+0x75> 1eab: 90 nop 1eac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(i = 0; i < 1000; i++){ 1eb0: 83 eb 01 sub $0x1,%ebx 1eb3: 74 26 je 1edb <sharedfd+0x9b> if(write(fd, buf, sizeof(buf)) != sizeof(buf)){ 1eb5: 83 ec 04 sub $0x4,%esp 1eb8: 6a 0a push $0xa 1eba: 56 push %esi 1ebb: 57 push %edi 1ebc: e8 01 2a 00 00 call 48c2 <write> 1ec1: 83 c4 10 add $0x10,%esp 1ec4: 83 f8 0a cmp $0xa,%eax 1ec7: 74 e7 je 1eb0 <sharedfd+0x70> printf(1, "fstests: write sharedfd failed\n"); 1ec9: 83 ec 08 sub $0x8,%esp 1ecc: 68 80 5e 00 00 push $0x5e80 1ed1: 6a 01 push $0x1 1ed3: e8 28 2b 00 00 call 4a00 <printf> break; 1ed8: 83 c4 10 add $0x10,%esp } } if(pid == 0) 1edb: 8b 4d d4 mov -0x2c(%ebp),%ecx 1ede: 85 c9 test %ecx,%ecx 1ee0: 0f 84 f4 00 00 00 je 1fda <sharedfd+0x19a> exit(); else wait(); 1ee6: e8 bf 29 00 00 call 48aa <wait> close(fd); 1eeb: 83 ec 0c sub $0xc,%esp 1eee: 31 db xor %ebx,%ebx 1ef0: 57 push %edi 1ef1: 8d 7d e8 lea -0x18(%ebp),%edi 1ef4: e8 d1 29 00 00 call 48ca <close> fd = open("sharedfd", 0); 1ef9: 58 pop %eax 1efa: 5a pop %edx 1efb: 6a 00 push $0x0 1efd: 68 8f 51 00 00 push $0x518f 1f02: e8 db 29 00 00 call 48e2 <open> if(fd < 0){ 1f07: 83 c4 10 add $0x10,%esp 1f0a: 31 d2 xor %edx,%edx 1f0c: 85 c0 test %eax,%eax if(pid == 0) exit(); else wait(); close(fd); fd = open("sharedfd", 0); 1f0e: 89 45 d0 mov %eax,-0x30(%ebp) if(fd < 0){ 1f11: 0f 88 a9 00 00 00 js 1fc0 <sharedfd+0x180> 1f17: 89 f6 mov %esi,%esi 1f19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi printf(1, "fstests: cannot open sharedfd for reading\n"); return; } nc = np = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ 1f20: 83 ec 04 sub $0x4,%esp 1f23: 89 55 d4 mov %edx,-0x2c(%ebp) 1f26: 6a 0a push $0xa 1f28: 56 push %esi 1f29: ff 75 d0 pushl -0x30(%ebp) 1f2c: e8 89 29 00 00 call 48ba <read> 1f31: 83 c4 10 add $0x10,%esp 1f34: 85 c0 test %eax,%eax 1f36: 7e 27 jle 1f5f <sharedfd+0x11f> 1f38: 89 f0 mov %esi,%eax 1f3a: 8b 55 d4 mov -0x2c(%ebp),%edx 1f3d: eb 13 jmp 1f52 <sharedfd+0x112> 1f3f: 90 nop for(i = 0; i < sizeof(buf); i++){ if(buf[i] == 'c') nc++; if(buf[i] == 'p') np++; 1f40: 80 f9 70 cmp $0x70,%cl 1f43: 0f 94 c1 sete %cl 1f46: 0f b6 c9 movzbl %cl,%ecx 1f49: 01 cb add %ecx,%ebx 1f4b: 83 c0 01 add $0x1,%eax printf(1, "fstests: cannot open sharedfd for reading\n"); return; } nc = np = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ for(i = 0; i < sizeof(buf); i++){ 1f4e: 39 c7 cmp %eax,%edi 1f50: 74 ce je 1f20 <sharedfd+0xe0> if(buf[i] == 'c') 1f52: 0f b6 08 movzbl (%eax),%ecx 1f55: 80 f9 63 cmp $0x63,%cl 1f58: 75 e6 jne 1f40 <sharedfd+0x100> nc++; 1f5a: 83 c2 01 add $0x1,%edx 1f5d: eb ec jmp 1f4b <sharedfd+0x10b> if(buf[i] == 'p') np++; } } close(fd); 1f5f: 83 ec 0c sub $0xc,%esp 1f62: ff 75 d0 pushl -0x30(%ebp) 1f65: e8 60 29 00 00 call 48ca <close> unlink("sharedfd"); 1f6a: c7 04 24 8f 51 00 00 movl $0x518f,(%esp) 1f71: e8 7c 29 00 00 call 48f2 <unlink> if(nc == 10000 && np == 10000){ 1f76: 8b 55 d4 mov -0x2c(%ebp),%edx 1f79: 83 c4 10 add $0x10,%esp 1f7c: 81 fa 10 27 00 00 cmp $0x2710,%edx 1f82: 75 5b jne 1fdf <sharedfd+0x19f> 1f84: 81 fb 10 27 00 00 cmp $0x2710,%ebx 1f8a: 75 53 jne 1fdf <sharedfd+0x19f> printf(1, "sharedfd ok\n"); 1f8c: 83 ec 08 sub $0x8,%esp 1f8f: 68 98 51 00 00 push $0x5198 1f94: 6a 01 push $0x1 1f96: e8 65 2a 00 00 call 4a00 <printf> 1f9b: 83 c4 10 add $0x10,%esp } else { printf(1, "sharedfd oops %d %d\n", nc, np); exit(); } } 1f9e: 8d 65 f4 lea -0xc(%ebp),%esp 1fa1: 5b pop %ebx 1fa2: 5e pop %esi 1fa3: 5f pop %edi 1fa4: 5d pop %ebp 1fa5: c3 ret printf(1, "sharedfd test\n"); unlink("sharedfd"); fd = open("sharedfd", O_CREATE|O_RDWR); if(fd < 0){ printf(1, "fstests: cannot open sharedfd for writing"); 1fa6: 83 ec 08 sub $0x8,%esp 1fa9: 68 54 5e 00 00 push $0x5e54 1fae: 6a 01 push $0x1 1fb0: e8 4b 2a 00 00 call 4a00 <printf> return; 1fb5: 83 c4 10 add $0x10,%esp printf(1, "sharedfd ok\n"); } else { printf(1, "sharedfd oops %d %d\n", nc, np); exit(); } } 1fb8: 8d 65 f4 lea -0xc(%ebp),%esp 1fbb: 5b pop %ebx 1fbc: 5e pop %esi 1fbd: 5f pop %edi 1fbe: 5d pop %ebp 1fbf: c3 ret else wait(); close(fd); fd = open("sharedfd", 0); if(fd < 0){ printf(1, "fstests: cannot open sharedfd for reading\n"); 1fc0: 83 ec 08 sub $0x8,%esp 1fc3: 68 a0 5e 00 00 push $0x5ea0 1fc8: 6a 01 push $0x1 1fca: e8 31 2a 00 00 call 4a00 <printf> return; 1fcf: 83 c4 10 add $0x10,%esp printf(1, "sharedfd ok\n"); } else { printf(1, "sharedfd oops %d %d\n", nc, np); exit(); } } 1fd2: 8d 65 f4 lea -0xc(%ebp),%esp 1fd5: 5b pop %ebx 1fd6: 5e pop %esi 1fd7: 5f pop %edi 1fd8: 5d pop %ebp 1fd9: c3 ret printf(1, "fstests: write sharedfd failed\n"); break; } } if(pid == 0) exit(); 1fda: e8 c3 28 00 00 call 48a2 <exit> close(fd); unlink("sharedfd"); if(nc == 10000 && np == 10000){ printf(1, "sharedfd ok\n"); } else { printf(1, "sharedfd oops %d %d\n", nc, np); 1fdf: 53 push %ebx 1fe0: 52 push %edx 1fe1: 68 a5 51 00 00 push $0x51a5 1fe6: 6a 01 push $0x1 1fe8: e8 13 2a 00 00 call 4a00 <printf> exit(); 1fed: e8 b0 28 00 00 call 48a2 <exit> 1ff2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1ff9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00002000 <fourfiles>: // four processes write different files at the same // time, to test block allocation. void fourfiles(void) { 2000: 55 push %ebp 2001: 89 e5 mov %esp,%ebp 2003: 57 push %edi 2004: 56 push %esi 2005: 53 push %ebx int fd, pid, i, j, n, total, pi; char *names[] = { "f0", "f1", "f2", "f3" }; char *fname; printf(1, "fourfiles test\n"); 2006: be ba 51 00 00 mov $0x51ba,%esi for(pi = 0; pi < 4; pi++){ 200b: 31 db xor %ebx,%ebx // four processes write different files at the same // time, to test block allocation. void fourfiles(void) { 200d: 83 ec 34 sub $0x34,%esp int fd, pid, i, j, n, total, pi; char *names[] = { "f0", "f1", "f2", "f3" }; 2010: c7 45 d8 ba 51 00 00 movl $0x51ba,-0x28(%ebp) 2017: c7 45 dc 03 53 00 00 movl $0x5303,-0x24(%ebp) char *fname; printf(1, "fourfiles test\n"); 201e: 68 c0 51 00 00 push $0x51c0 2023: 6a 01 push $0x1 // time, to test block allocation. void fourfiles(void) { int fd, pid, i, j, n, total, pi; char *names[] = { "f0", "f1", "f2", "f3" }; 2025: c7 45 e0 07 53 00 00 movl $0x5307,-0x20(%ebp) 202c: c7 45 e4 bd 51 00 00 movl $0x51bd,-0x1c(%ebp) char *fname; printf(1, "fourfiles test\n"); 2033: e8 c8 29 00 00 call 4a00 <printf> 2038: 83 c4 10 add $0x10,%esp for(pi = 0; pi < 4; pi++){ fname = names[pi]; unlink(fname); 203b: 83 ec 0c sub $0xc,%esp 203e: 56 push %esi 203f: e8 ae 28 00 00 call 48f2 <unlink> pid = fork(); 2044: e8 51 28 00 00 call 489a <fork> if(pid < 0){ 2049: 83 c4 10 add $0x10,%esp 204c: 85 c0 test %eax,%eax 204e: 0f 88 83 01 00 00 js 21d7 <fourfiles+0x1d7> printf(1, "fork failed\n"); exit(); } if(pid == 0){ 2054: 0f 84 e3 00 00 00 je 213d <fourfiles+0x13d> char *names[] = { "f0", "f1", "f2", "f3" }; char *fname; printf(1, "fourfiles test\n"); for(pi = 0; pi < 4; pi++){ 205a: 83 c3 01 add $0x1,%ebx 205d: 83 fb 04 cmp $0x4,%ebx 2060: 74 06 je 2068 <fourfiles+0x68> 2062: 8b 74 9d d8 mov -0x28(%ebp,%ebx,4),%esi 2066: eb d3 jmp 203b <fourfiles+0x3b> exit(); } } for(pi = 0; pi < 4; pi++){ wait(); 2068: e8 3d 28 00 00 call 48aa <wait> 206d: bf 30 00 00 00 mov $0x30,%edi 2072: e8 33 28 00 00 call 48aa <wait> 2077: e8 2e 28 00 00 call 48aa <wait> 207c: e8 29 28 00 00 call 48aa <wait> 2081: c7 45 d4 ba 51 00 00 movl $0x51ba,-0x2c(%ebp) } for(i = 0; i < 2; i++){ fname = names[i]; fd = open(fname, 0); 2088: 83 ec 08 sub $0x8,%esp total = 0; 208b: 31 db xor %ebx,%ebx wait(); } for(i = 0; i < 2; i++){ fname = names[i]; fd = open(fname, 0); 208d: 6a 00 push $0x0 208f: ff 75 d4 pushl -0x2c(%ebp) 2092: e8 4b 28 00 00 call 48e2 <open> total = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ 2097: 83 c4 10 add $0x10,%esp wait(); } for(i = 0; i < 2; i++){ fname = names[i]; fd = open(fname, 0); 209a: 89 c6 mov %eax,%esi 209c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi total = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ 20a0: 83 ec 04 sub $0x4,%esp 20a3: 68 00 20 00 00 push $0x2000 20a8: 68 00 96 00 00 push $0x9600 20ad: 56 push %esi 20ae: e8 07 28 00 00 call 48ba <read> 20b3: 83 c4 10 add $0x10,%esp 20b6: 85 c0 test %eax,%eax 20b8: 7e 1c jle 20d6 <fourfiles+0xd6> 20ba: 31 d2 xor %edx,%edx 20bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(j = 0; j < n; j++){ if(buf[j] != '0'+i){ 20c0: 0f be 8a 00 96 00 00 movsbl 0x9600(%edx),%ecx 20c7: 39 cf cmp %ecx,%edi 20c9: 75 5e jne 2129 <fourfiles+0x129> for(i = 0; i < 2; i++){ fname = names[i]; fd = open(fname, 0); total = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ for(j = 0; j < n; j++){ 20cb: 83 c2 01 add $0x1,%edx 20ce: 39 d0 cmp %edx,%eax 20d0: 75 ee jne 20c0 <fourfiles+0xc0> if(buf[j] != '0'+i){ printf(1, "wrong char\n"); exit(); } } total += n; 20d2: 01 c3 add %eax,%ebx 20d4: eb ca jmp 20a0 <fourfiles+0xa0> } close(fd); 20d6: 83 ec 0c sub $0xc,%esp 20d9: 56 push %esi 20da: e8 eb 27 00 00 call 48ca <close> if(total != 12*500){ 20df: 83 c4 10 add $0x10,%esp 20e2: 81 fb 70 17 00 00 cmp $0x1770,%ebx 20e8: 0f 85 d4 00 00 00 jne 21c2 <fourfiles+0x1c2> printf(1, "wrong length %d\n", total); exit(); } unlink(fname); 20ee: 83 ec 0c sub $0xc,%esp 20f1: ff 75 d4 pushl -0x2c(%ebp) 20f4: 83 c7 01 add $0x1,%edi 20f7: e8 f6 27 00 00 call 48f2 <unlink> for(pi = 0; pi < 4; pi++){ wait(); } for(i = 0; i < 2; i++){ 20fc: 83 c4 10 add $0x10,%esp 20ff: 83 ff 32 cmp $0x32,%edi 2102: 75 1a jne 211e <fourfiles+0x11e> exit(); } unlink(fname); } printf(1, "fourfiles ok\n"); 2104: 83 ec 08 sub $0x8,%esp 2107: 68 fe 51 00 00 push $0x51fe 210c: 6a 01 push $0x1 210e: e8 ed 28 00 00 call 4a00 <printf> } 2113: 83 c4 10 add $0x10,%esp 2116: 8d 65 f4 lea -0xc(%ebp),%esp 2119: 5b pop %ebx 211a: 5e pop %esi 211b: 5f pop %edi 211c: 5d pop %ebp 211d: c3 ret 211e: 8b 45 dc mov -0x24(%ebp),%eax 2121: 89 45 d4 mov %eax,-0x2c(%ebp) 2124: e9 5f ff ff ff jmp 2088 <fourfiles+0x88> fd = open(fname, 0); total = 0; while((n = read(fd, buf, sizeof(buf))) > 0){ for(j = 0; j < n; j++){ if(buf[j] != '0'+i){ printf(1, "wrong char\n"); 2129: 83 ec 08 sub $0x8,%esp 212c: 68 e1 51 00 00 push $0x51e1 2131: 6a 01 push $0x1 2133: e8 c8 28 00 00 call 4a00 <printf> exit(); 2138: e8 65 27 00 00 call 48a2 <exit> printf(1, "fork failed\n"); exit(); } if(pid == 0){ fd = open(fname, O_CREATE | O_RDWR); 213d: 83 ec 08 sub $0x8,%esp 2140: 68 02 02 00 00 push $0x202 2145: 56 push %esi 2146: e8 97 27 00 00 call 48e2 <open> if(fd < 0){ 214b: 83 c4 10 add $0x10,%esp 214e: 85 c0 test %eax,%eax printf(1, "fork failed\n"); exit(); } if(pid == 0){ fd = open(fname, O_CREATE | O_RDWR); 2150: 89 c6 mov %eax,%esi if(fd < 0){ 2152: 78 5a js 21ae <fourfiles+0x1ae> printf(1, "create failed\n"); exit(); } memset(buf, '0'+pi, 512); 2154: 83 ec 04 sub $0x4,%esp 2157: 83 c3 30 add $0x30,%ebx 215a: 68 00 02 00 00 push $0x200 215f: 53 push %ebx 2160: bb 0c 00 00 00 mov $0xc,%ebx 2165: 68 00 96 00 00 push $0x9600 216a: e8 a1 25 00 00 call 4710 <memset> 216f: 83 c4 10 add $0x10,%esp for(i = 0; i < 12; i++){ if((n = write(fd, buf, 500)) != 500){ 2172: 83 ec 04 sub $0x4,%esp 2175: 68 f4 01 00 00 push $0x1f4 217a: 68 00 96 00 00 push $0x9600 217f: 56 push %esi 2180: e8 3d 27 00 00 call 48c2 <write> 2185: 83 c4 10 add $0x10,%esp 2188: 3d f4 01 00 00 cmp $0x1f4,%eax 218d: 75 0a jne 2199 <fourfiles+0x199> printf(1, "create failed\n"); exit(); } memset(buf, '0'+pi, 512); for(i = 0; i < 12; i++){ 218f: 83 eb 01 sub $0x1,%ebx 2192: 75 de jne 2172 <fourfiles+0x172> if((n = write(fd, buf, 500)) != 500){ printf(1, "write failed %d\n", n); exit(); } } exit(); 2194: e8 09 27 00 00 call 48a2 <exit> } memset(buf, '0'+pi, 512); for(i = 0; i < 12; i++){ if((n = write(fd, buf, 500)) != 500){ printf(1, "write failed %d\n", n); 2199: 83 ec 04 sub $0x4,%esp 219c: 50 push %eax 219d: 68 d0 51 00 00 push $0x51d0 21a2: 6a 01 push $0x1 21a4: e8 57 28 00 00 call 4a00 <printf> exit(); 21a9: e8 f4 26 00 00 call 48a2 <exit> } if(pid == 0){ fd = open(fname, O_CREATE | O_RDWR); if(fd < 0){ printf(1, "create failed\n"); 21ae: 83 ec 08 sub $0x8,%esp 21b1: 68 5b 54 00 00 push $0x545b 21b6: 6a 01 push $0x1 21b8: e8 43 28 00 00 call 4a00 <printf> exit(); 21bd: e8 e0 26 00 00 call 48a2 <exit> } total += n; } close(fd); if(total != 12*500){ printf(1, "wrong length %d\n", total); 21c2: 83 ec 04 sub $0x4,%esp 21c5: 53 push %ebx 21c6: 68 ed 51 00 00 push $0x51ed 21cb: 6a 01 push $0x1 21cd: e8 2e 28 00 00 call 4a00 <printf> exit(); 21d2: e8 cb 26 00 00 call 48a2 <exit> fname = names[pi]; unlink(fname); pid = fork(); if(pid < 0){ printf(1, "fork failed\n"); 21d7: 83 ec 08 sub $0x8,%esp 21da: 68 95 5c 00 00 push $0x5c95 21df: 6a 01 push $0x1 21e1: e8 1a 28 00 00 call 4a00 <printf> exit(); 21e6: e8 b7 26 00 00 call 48a2 <exit> 21eb: 90 nop 21ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000021f0 <createdelete>: } // four processes create and delete different files in same directory void createdelete(void) { 21f0: 55 push %ebp 21f1: 89 e5 mov %esp,%ebp 21f3: 57 push %edi 21f4: 56 push %esi 21f5: 53 push %ebx int pid, i, fd, pi; char name[32]; printf(1, "createdelete test\n"); for(pi = 0; pi < 4; pi++){ 21f6: 31 db xor %ebx,%ebx } // four processes create and delete different files in same directory void createdelete(void) { 21f8: 83 ec 44 sub $0x44,%esp enum { N = 20 }; int pid, i, fd, pi; char name[32]; printf(1, "createdelete test\n"); 21fb: 68 0c 52 00 00 push $0x520c 2200: 6a 01 push $0x1 2202: e8 f9 27 00 00 call 4a00 <printf> 2207: 83 c4 10 add $0x10,%esp for(pi = 0; pi < 4; pi++){ pid = fork(); 220a: e8 8b 26 00 00 call 489a <fork> if(pid < 0){ 220f: 85 c0 test %eax,%eax 2211: 0f 88 b7 01 00 00 js 23ce <createdelete+0x1de> printf(1, "fork failed\n"); exit(); } if(pid == 0){ 2217: 0f 84 f6 00 00 00 je 2313 <createdelete+0x123> int pid, i, fd, pi; char name[32]; printf(1, "createdelete test\n"); for(pi = 0; pi < 4; pi++){ 221d: 83 c3 01 add $0x1,%ebx 2220: 83 fb 04 cmp $0x4,%ebx 2223: 75 e5 jne 220a <createdelete+0x1a> 2225: 8d 7d c8 lea -0x38(%ebp),%edi for(pi = 0; pi < 4; pi++){ wait(); } name[0] = name[1] = name[2] = 0; for(i = 0; i < N; i++){ 2228: 31 f6 xor %esi,%esi exit(); } } for(pi = 0; pi < 4; pi++){ wait(); 222a: e8 7b 26 00 00 call 48aa <wait> 222f: e8 76 26 00 00 call 48aa <wait> 2234: e8 71 26 00 00 call 48aa <wait> 2239: e8 6c 26 00 00 call 48aa <wait> } name[0] = name[1] = name[2] = 0; 223e: c6 45 ca 00 movb $0x0,-0x36(%ebp) 2242: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 2248: 8d 46 30 lea 0x30(%esi),%eax 224b: 83 fe 09 cmp $0x9,%esi exit(); } if(pid == 0){ name[0] = 'p' + pi; name[2] = '\0'; 224e: bb 70 00 00 00 mov $0x70,%ebx 2253: 0f 9f c2 setg %dl 2256: 85 f6 test %esi,%esi 2258: 88 45 c7 mov %al,-0x39(%ebp) 225b: 0f 94 c0 sete %al 225e: 09 c2 or %eax,%edx name[1] = '0' + i; fd = open(name, 0); if((i == 0 || i >= N/2) && fd < 0){ printf(1, "oops createdelete %s didn't exist\n", name); exit(); } else if((i >= 1 && i < N/2) && fd >= 0){ 2260: 8d 46 ff lea -0x1(%esi),%eax 2263: 88 55 c6 mov %dl,-0x3a(%ebp) 2266: 89 45 c0 mov %eax,-0x40(%ebp) name[0] = name[1] = name[2] = 0; for(i = 0; i < N; i++){ for(pi = 0; pi < 4; pi++){ name[0] = 'p' + pi; name[1] = '0' + i; 2269: 0f b6 45 c7 movzbl -0x39(%ebp),%eax fd = open(name, 0); 226d: 83 ec 08 sub $0x8,%esp } name[0] = name[1] = name[2] = 0; for(i = 0; i < N; i++){ for(pi = 0; pi < 4; pi++){ name[0] = 'p' + pi; 2270: 88 5d c8 mov %bl,-0x38(%ebp) name[1] = '0' + i; fd = open(name, 0); 2273: 6a 00 push $0x0 2275: 57 push %edi name[0] = name[1] = name[2] = 0; for(i = 0; i < N; i++){ for(pi = 0; pi < 4; pi++){ name[0] = 'p' + pi; name[1] = '0' + i; 2276: 88 45 c9 mov %al,-0x37(%ebp) fd = open(name, 0); 2279: e8 64 26 00 00 call 48e2 <open> if((i == 0 || i >= N/2) && fd < 0){ 227e: 89 c1 mov %eax,%ecx 2280: 83 c4 10 add $0x10,%esp 2283: c1 e9 1f shr $0x1f,%ecx 2286: 84 c9 test %cl,%cl 2288: 74 0a je 2294 <createdelete+0xa4> 228a: 80 7d c6 00 cmpb $0x0,-0x3a(%ebp) 228e: 0f 85 11 01 00 00 jne 23a5 <createdelete+0x1b5> printf(1, "oops createdelete %s didn't exist\n", name); exit(); } else if((i >= 1 && i < N/2) && fd >= 0){ 2294: 83 7d c0 08 cmpl $0x8,-0x40(%ebp) 2298: 0f 86 44 01 00 00 jbe 23e2 <createdelete+0x1f2> printf(1, "oops createdelete %s did exist\n", name); exit(); } if(fd >= 0) 229e: 85 c0 test %eax,%eax 22a0: 78 0c js 22ae <createdelete+0xbe> close(fd); 22a2: 83 ec 0c sub $0xc,%esp 22a5: 50 push %eax 22a6: e8 1f 26 00 00 call 48ca <close> 22ab: 83 c4 10 add $0x10,%esp 22ae: 83 c3 01 add $0x1,%ebx wait(); } name[0] = name[1] = name[2] = 0; for(i = 0; i < N; i++){ for(pi = 0; pi < 4; pi++){ 22b1: 80 fb 74 cmp $0x74,%bl 22b4: 75 b3 jne 2269 <createdelete+0x79> for(pi = 0; pi < 4; pi++){ wait(); } name[0] = name[1] = name[2] = 0; for(i = 0; i < N; i++){ 22b6: 83 c6 01 add $0x1,%esi 22b9: 83 fe 14 cmp $0x14,%esi 22bc: 75 8a jne 2248 <createdelete+0x58> 22be: be 70 00 00 00 mov $0x70,%esi 22c3: 90 nop 22c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 22c8: 8d 46 c0 lea -0x40(%esi),%eax 22cb: bb 04 00 00 00 mov $0x4,%ebx 22d0: 88 45 c7 mov %al,-0x39(%ebp) } } for(i = 0; i < N; i++){ for(pi = 0; pi < 4; pi++){ name[0] = 'p' + i; 22d3: 89 f0 mov %esi,%eax name[1] = '0' + i; unlink(name); 22d5: 83 ec 0c sub $0xc,%esp } } for(i = 0; i < N; i++){ for(pi = 0; pi < 4; pi++){ name[0] = 'p' + i; 22d8: 88 45 c8 mov %al,-0x38(%ebp) name[1] = '0' + i; 22db: 0f b6 45 c7 movzbl -0x39(%ebp),%eax unlink(name); 22df: 57 push %edi } for(i = 0; i < N; i++){ for(pi = 0; pi < 4; pi++){ name[0] = 'p' + i; name[1] = '0' + i; 22e0: 88 45 c9 mov %al,-0x37(%ebp) unlink(name); 22e3: e8 0a 26 00 00 call 48f2 <unlink> close(fd); } } for(i = 0; i < N; i++){ for(pi = 0; pi < 4; pi++){ 22e8: 83 c4 10 add $0x10,%esp 22eb: 83 eb 01 sub $0x1,%ebx 22ee: 75 e3 jne 22d3 <createdelete+0xe3> 22f0: 83 c6 01 add $0x1,%esi if(fd >= 0) close(fd); } } for(i = 0; i < N; i++){ 22f3: 89 f0 mov %esi,%eax 22f5: 3c 84 cmp $0x84,%al 22f7: 75 cf jne 22c8 <createdelete+0xd8> name[1] = '0' + i; unlink(name); } } printf(1, "createdelete ok\n"); 22f9: 83 ec 08 sub $0x8,%esp 22fc: 68 1f 52 00 00 push $0x521f 2301: 6a 01 push $0x1 2303: e8 f8 26 00 00 call 4a00 <printf> } 2308: 83 c4 10 add $0x10,%esp 230b: 8d 65 f4 lea -0xc(%ebp),%esp 230e: 5b pop %ebx 230f: 5e pop %esi 2310: 5f pop %edi 2311: 5d pop %ebp 2312: c3 ret printf(1, "fork failed\n"); exit(); } if(pid == 0){ name[0] = 'p' + pi; 2313: 83 c3 70 add $0x70,%ebx name[2] = '\0'; 2316: c6 45 ca 00 movb $0x0,-0x36(%ebp) 231a: be 01 00 00 00 mov $0x1,%esi printf(1, "fork failed\n"); exit(); } if(pid == 0){ name[0] = 'p' + pi; 231f: 88 5d c8 mov %bl,-0x38(%ebp) 2322: 8d 7d c8 lea -0x38(%ebp),%edi name[2] = '\0'; 2325: 31 db xor %ebx,%ebx 2327: eb 12 jmp 233b <createdelete+0x14b> 2329: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(i = 0; i < N; i++){ 2330: 83 fe 14 cmp $0x14,%esi 2333: 74 6b je 23a0 <createdelete+0x1b0> 2335: 83 c3 01 add $0x1,%ebx 2338: 83 c6 01 add $0x1,%esi name[1] = '0' + i; fd = open(name, O_CREATE | O_RDWR); 233b: 83 ec 08 sub $0x8,%esp if(pid == 0){ name[0] = 'p' + pi; name[2] = '\0'; for(i = 0; i < N; i++){ name[1] = '0' + i; 233e: 8d 43 30 lea 0x30(%ebx),%eax fd = open(name, O_CREATE | O_RDWR); 2341: 68 02 02 00 00 push $0x202 2346: 57 push %edi if(pid == 0){ name[0] = 'p' + pi; name[2] = '\0'; for(i = 0; i < N; i++){ name[1] = '0' + i; 2347: 88 45 c9 mov %al,-0x37(%ebp) fd = open(name, O_CREATE | O_RDWR); 234a: e8 93 25 00 00 call 48e2 <open> if(fd < 0){ 234f: 83 c4 10 add $0x10,%esp 2352: 85 c0 test %eax,%eax 2354: 78 64 js 23ba <createdelete+0x1ca> printf(1, "create failed\n"); exit(); } close(fd); 2356: 83 ec 0c sub $0xc,%esp 2359: 50 push %eax 235a: e8 6b 25 00 00 call 48ca <close> if(i > 0 && (i % 2 ) == 0){ 235f: 83 c4 10 add $0x10,%esp 2362: 85 db test %ebx,%ebx 2364: 74 cf je 2335 <createdelete+0x145> 2366: f6 c3 01 test $0x1,%bl 2369: 75 c5 jne 2330 <createdelete+0x140> name[1] = '0' + (i / 2); if(unlink(name) < 0){ 236b: 83 ec 0c sub $0xc,%esp printf(1, "create failed\n"); exit(); } close(fd); if(i > 0 && (i % 2 ) == 0){ name[1] = '0' + (i / 2); 236e: 89 d8 mov %ebx,%eax 2370: d1 f8 sar %eax if(unlink(name) < 0){ 2372: 57 push %edi printf(1, "create failed\n"); exit(); } close(fd); if(i > 0 && (i % 2 ) == 0){ name[1] = '0' + (i / 2); 2373: 83 c0 30 add $0x30,%eax 2376: 88 45 c9 mov %al,-0x37(%ebp) if(unlink(name) < 0){ 2379: e8 74 25 00 00 call 48f2 <unlink> 237e: 83 c4 10 add $0x10,%esp 2381: 85 c0 test %eax,%eax 2383: 79 ab jns 2330 <createdelete+0x140> printf(1, "unlink failed\n"); 2385: 83 ec 08 sub $0x8,%esp 2388: 68 0d 4e 00 00 push $0x4e0d 238d: 6a 01 push $0x1 238f: e8 6c 26 00 00 call 4a00 <printf> exit(); 2394: e8 09 25 00 00 call 48a2 <exit> 2399: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } } } exit(); 23a0: e8 fd 24 00 00 call 48a2 <exit> for(pi = 0; pi < 4; pi++){ name[0] = 'p' + pi; name[1] = '0' + i; fd = open(name, 0); if((i == 0 || i >= N/2) && fd < 0){ printf(1, "oops createdelete %s didn't exist\n", name); 23a5: 83 ec 04 sub $0x4,%esp 23a8: 57 push %edi 23a9: 68 cc 5e 00 00 push $0x5ecc 23ae: 6a 01 push $0x1 23b0: e8 4b 26 00 00 call 4a00 <printf> exit(); 23b5: e8 e8 24 00 00 call 48a2 <exit> name[2] = '\0'; for(i = 0; i < N; i++){ name[1] = '0' + i; fd = open(name, O_CREATE | O_RDWR); if(fd < 0){ printf(1, "create failed\n"); 23ba: 83 ec 08 sub $0x8,%esp 23bd: 68 5b 54 00 00 push $0x545b 23c2: 6a 01 push $0x1 23c4: e8 37 26 00 00 call 4a00 <printf> exit(); 23c9: e8 d4 24 00 00 call 48a2 <exit> printf(1, "createdelete test\n"); for(pi = 0; pi < 4; pi++){ pid = fork(); if(pid < 0){ printf(1, "fork failed\n"); 23ce: 83 ec 08 sub $0x8,%esp 23d1: 68 95 5c 00 00 push $0x5c95 23d6: 6a 01 push $0x1 23d8: e8 23 26 00 00 call 4a00 <printf> exit(); 23dd: e8 c0 24 00 00 call 48a2 <exit> name[1] = '0' + i; fd = open(name, 0); if((i == 0 || i >= N/2) && fd < 0){ printf(1, "oops createdelete %s didn't exist\n", name); exit(); } else if((i >= 1 && i < N/2) && fd >= 0){ 23e2: 85 c0 test %eax,%eax 23e4: 0f 88 c4 fe ff ff js 22ae <createdelete+0xbe> printf(1, "oops createdelete %s did exist\n", name); 23ea: 83 ec 04 sub $0x4,%esp 23ed: 57 push %edi 23ee: 68 f0 5e 00 00 push $0x5ef0 23f3: 6a 01 push $0x1 23f5: e8 06 26 00 00 call 4a00 <printf> exit(); 23fa: e8 a3 24 00 00 call 48a2 <exit> 23ff: 90 nop 00002400 <unlinkread>: } // can I unlink a file and still read it? void unlinkread(void) { 2400: 55 push %ebp 2401: 89 e5 mov %esp,%ebp 2403: 56 push %esi 2404: 53 push %ebx int fd, fd1; printf(1, "unlinkread test\n"); 2405: 83 ec 08 sub $0x8,%esp 2408: 68 30 52 00 00 push $0x5230 240d: 6a 01 push $0x1 240f: e8 ec 25 00 00 call 4a00 <printf> fd = open("unlinkread", O_CREATE | O_RDWR); 2414: 5b pop %ebx 2415: 5e pop %esi 2416: 68 02 02 00 00 push $0x202 241b: 68 41 52 00 00 push $0x5241 2420: e8 bd 24 00 00 call 48e2 <open> if(fd < 0){ 2425: 83 c4 10 add $0x10,%esp 2428: 85 c0 test %eax,%eax 242a: 0f 88 e6 00 00 00 js 2516 <unlinkread+0x116> printf(1, "create unlinkread failed\n"); exit(); } write(fd, "hello", 5); 2430: 83 ec 04 sub $0x4,%esp 2433: 89 c3 mov %eax,%ebx 2435: 6a 05 push $0x5 2437: 68 66 52 00 00 push $0x5266 243c: 50 push %eax 243d: e8 80 24 00 00 call 48c2 <write> close(fd); 2442: 89 1c 24 mov %ebx,(%esp) 2445: e8 80 24 00 00 call 48ca <close> fd = open("unlinkread", O_RDWR); 244a: 58 pop %eax 244b: 5a pop %edx 244c: 6a 02 push $0x2 244e: 68 41 52 00 00 push $0x5241 2453: e8 8a 24 00 00 call 48e2 <open> if(fd < 0){ 2458: 83 c4 10 add $0x10,%esp 245b: 85 c0 test %eax,%eax exit(); } write(fd, "hello", 5); close(fd); fd = open("unlinkread", O_RDWR); 245d: 89 c3 mov %eax,%ebx if(fd < 0){ 245f: 0f 88 10 01 00 00 js 2575 <unlinkread+0x175> printf(1, "open unlinkread failed\n"); exit(); } if(unlink("unlinkread") != 0){ 2465: 83 ec 0c sub $0xc,%esp 2468: 68 41 52 00 00 push $0x5241 246d: e8 80 24 00 00 call 48f2 <unlink> 2472: 83 c4 10 add $0x10,%esp 2475: 85 c0 test %eax,%eax 2477: 0f 85 e5 00 00 00 jne 2562 <unlinkread+0x162> printf(1, "unlink unlinkread failed\n"); exit(); } fd1 = open("unlinkread", O_CREATE | O_RDWR); 247d: 83 ec 08 sub $0x8,%esp 2480: 68 02 02 00 00 push $0x202 2485: 68 41 52 00 00 push $0x5241 248a: e8 53 24 00 00 call 48e2 <open> write(fd1, "yyy", 3); 248f: 83 c4 0c add $0xc,%esp if(unlink("unlinkread") != 0){ printf(1, "unlink unlinkread failed\n"); exit(); } fd1 = open("unlinkread", O_CREATE | O_RDWR); 2492: 89 c6 mov %eax,%esi write(fd1, "yyy", 3); 2494: 6a 03 push $0x3 2496: 68 9e 52 00 00 push $0x529e 249b: 50 push %eax 249c: e8 21 24 00 00 call 48c2 <write> close(fd1); 24a1: 89 34 24 mov %esi,(%esp) 24a4: e8 21 24 00 00 call 48ca <close> if(read(fd, buf, sizeof(buf)) != 5){ 24a9: 83 c4 0c add $0xc,%esp 24ac: 68 00 20 00 00 push $0x2000 24b1: 68 00 96 00 00 push $0x9600 24b6: 53 push %ebx 24b7: e8 fe 23 00 00 call 48ba <read> 24bc: 83 c4 10 add $0x10,%esp 24bf: 83 f8 05 cmp $0x5,%eax 24c2: 0f 85 87 00 00 00 jne 254f <unlinkread+0x14f> printf(1, "unlinkread read failed"); exit(); } if(buf[0] != 'h'){ 24c8: 80 3d 00 96 00 00 68 cmpb $0x68,0x9600 24cf: 75 6b jne 253c <unlinkread+0x13c> printf(1, "unlinkread wrong data\n"); exit(); } if(write(fd, buf, 10) != 10){ 24d1: 83 ec 04 sub $0x4,%esp 24d4: 6a 0a push $0xa 24d6: 68 00 96 00 00 push $0x9600 24db: 53 push %ebx 24dc: e8 e1 23 00 00 call 48c2 <write> 24e1: 83 c4 10 add $0x10,%esp 24e4: 83 f8 0a cmp $0xa,%eax 24e7: 75 40 jne 2529 <unlinkread+0x129> printf(1, "unlinkread write failed\n"); exit(); } close(fd); 24e9: 83 ec 0c sub $0xc,%esp 24ec: 53 push %ebx 24ed: e8 d8 23 00 00 call 48ca <close> unlink("unlinkread"); 24f2: c7 04 24 41 52 00 00 movl $0x5241,(%esp) 24f9: e8 f4 23 00 00 call 48f2 <unlink> printf(1, "unlinkread ok\n"); 24fe: 58 pop %eax 24ff: 5a pop %edx 2500: 68 e9 52 00 00 push $0x52e9 2505: 6a 01 push $0x1 2507: e8 f4 24 00 00 call 4a00 <printf> } 250c: 83 c4 10 add $0x10,%esp 250f: 8d 65 f8 lea -0x8(%ebp),%esp 2512: 5b pop %ebx 2513: 5e pop %esi 2514: 5d pop %ebp 2515: c3 ret int fd, fd1; printf(1, "unlinkread test\n"); fd = open("unlinkread", O_CREATE | O_RDWR); if(fd < 0){ printf(1, "create unlinkread failed\n"); 2516: 51 push %ecx 2517: 51 push %ecx 2518: 68 4c 52 00 00 push $0x524c 251d: 6a 01 push $0x1 251f: e8 dc 24 00 00 call 4a00 <printf> exit(); 2524: e8 79 23 00 00 call 48a2 <exit> if(buf[0] != 'h'){ printf(1, "unlinkread wrong data\n"); exit(); } if(write(fd, buf, 10) != 10){ printf(1, "unlinkread write failed\n"); 2529: 51 push %ecx 252a: 51 push %ecx 252b: 68 d0 52 00 00 push $0x52d0 2530: 6a 01 push $0x1 2532: e8 c9 24 00 00 call 4a00 <printf> exit(); 2537: e8 66 23 00 00 call 48a2 <exit> if(read(fd, buf, sizeof(buf)) != 5){ printf(1, "unlinkread read failed"); exit(); } if(buf[0] != 'h'){ printf(1, "unlinkread wrong data\n"); 253c: 53 push %ebx 253d: 53 push %ebx 253e: 68 b9 52 00 00 push $0x52b9 2543: 6a 01 push $0x1 2545: e8 b6 24 00 00 call 4a00 <printf> exit(); 254a: e8 53 23 00 00 call 48a2 <exit> fd1 = open("unlinkread", O_CREATE | O_RDWR); write(fd1, "yyy", 3); close(fd1); if(read(fd, buf, sizeof(buf)) != 5){ printf(1, "unlinkread read failed"); 254f: 56 push %esi 2550: 56 push %esi 2551: 68 a2 52 00 00 push $0x52a2 2556: 6a 01 push $0x1 2558: e8 a3 24 00 00 call 4a00 <printf> exit(); 255d: e8 40 23 00 00 call 48a2 <exit> if(fd < 0){ printf(1, "open unlinkread failed\n"); exit(); } if(unlink("unlinkread") != 0){ printf(1, "unlink unlinkread failed\n"); 2562: 50 push %eax 2563: 50 push %eax 2564: 68 84 52 00 00 push $0x5284 2569: 6a 01 push $0x1 256b: e8 90 24 00 00 call 4a00 <printf> exit(); 2570: e8 2d 23 00 00 call 48a2 <exit> write(fd, "hello", 5); close(fd); fd = open("unlinkread", O_RDWR); if(fd < 0){ printf(1, "open unlinkread failed\n"); 2575: 50 push %eax 2576: 50 push %eax 2577: 68 6c 52 00 00 push $0x526c 257c: 6a 01 push $0x1 257e: e8 7d 24 00 00 call 4a00 <printf> exit(); 2583: e8 1a 23 00 00 call 48a2 <exit> 2588: 90 nop 2589: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00002590 <linktest>: printf(1, "unlinkread ok\n"); } void linktest(void) { 2590: 55 push %ebp 2591: 89 e5 mov %esp,%ebp 2593: 53 push %ebx 2594: 83 ec 0c sub $0xc,%esp int fd; printf(1, "linktest\n"); 2597: 68 f8 52 00 00 push $0x52f8 259c: 6a 01 push $0x1 259e: e8 5d 24 00 00 call 4a00 <printf> unlink("lf1"); 25a3: c7 04 24 02 53 00 00 movl $0x5302,(%esp) 25aa: e8 43 23 00 00 call 48f2 <unlink> unlink("lf2"); 25af: c7 04 24 06 53 00 00 movl $0x5306,(%esp) 25b6: e8 37 23 00 00 call 48f2 <unlink> fd = open("lf1", O_CREATE|O_RDWR); 25bb: 58 pop %eax 25bc: 5a pop %edx 25bd: 68 02 02 00 00 push $0x202 25c2: 68 02 53 00 00 push $0x5302 25c7: e8 16 23 00 00 call 48e2 <open> if(fd < 0){ 25cc: 83 c4 10 add $0x10,%esp 25cf: 85 c0 test %eax,%eax 25d1: 0f 88 1e 01 00 00 js 26f5 <linktest+0x165> printf(1, "create lf1 failed\n"); exit(); } if(write(fd, "hello", 5) != 5){ 25d7: 83 ec 04 sub $0x4,%esp 25da: 89 c3 mov %eax,%ebx 25dc: 6a 05 push $0x5 25de: 68 66 52 00 00 push $0x5266 25e3: 50 push %eax 25e4: e8 d9 22 00 00 call 48c2 <write> 25e9: 83 c4 10 add $0x10,%esp 25ec: 83 f8 05 cmp $0x5,%eax 25ef: 0f 85 98 01 00 00 jne 278d <linktest+0x1fd> printf(1, "write lf1 failed\n"); exit(); } close(fd); 25f5: 83 ec 0c sub $0xc,%esp 25f8: 53 push %ebx 25f9: e8 cc 22 00 00 call 48ca <close> if(link("lf1", "lf2") < 0){ 25fe: 5b pop %ebx 25ff: 58 pop %eax 2600: 68 06 53 00 00 push $0x5306 2605: 68 02 53 00 00 push $0x5302 260a: e8 f3 22 00 00 call 4902 <link> 260f: 83 c4 10 add $0x10,%esp 2612: 85 c0 test %eax,%eax 2614: 0f 88 60 01 00 00 js 277a <linktest+0x1ea> printf(1, "link lf1 lf2 failed\n"); exit(); } unlink("lf1"); 261a: 83 ec 0c sub $0xc,%esp 261d: 68 02 53 00 00 push $0x5302 2622: e8 cb 22 00 00 call 48f2 <unlink> if(open("lf1", 0) >= 0){ 2627: 58 pop %eax 2628: 5a pop %edx 2629: 6a 00 push $0x0 262b: 68 02 53 00 00 push $0x5302 2630: e8 ad 22 00 00 call 48e2 <open> 2635: 83 c4 10 add $0x10,%esp 2638: 85 c0 test %eax,%eax 263a: 0f 89 27 01 00 00 jns 2767 <linktest+0x1d7> printf(1, "unlinked lf1 but it is still there!\n"); exit(); } fd = open("lf2", 0); 2640: 83 ec 08 sub $0x8,%esp 2643: 6a 00 push $0x0 2645: 68 06 53 00 00 push $0x5306 264a: e8 93 22 00 00 call 48e2 <open> if(fd < 0){ 264f: 83 c4 10 add $0x10,%esp 2652: 85 c0 test %eax,%eax if(open("lf1", 0) >= 0){ printf(1, "unlinked lf1 but it is still there!\n"); exit(); } fd = open("lf2", 0); 2654: 89 c3 mov %eax,%ebx if(fd < 0){ 2656: 0f 88 f8 00 00 00 js 2754 <linktest+0x1c4> printf(1, "open lf2 failed\n"); exit(); } if(read(fd, buf, sizeof(buf)) != 5){ 265c: 83 ec 04 sub $0x4,%esp 265f: 68 00 20 00 00 push $0x2000 2664: 68 00 96 00 00 push $0x9600 2669: 50 push %eax 266a: e8 4b 22 00 00 call 48ba <read> 266f: 83 c4 10 add $0x10,%esp 2672: 83 f8 05 cmp $0x5,%eax 2675: 0f 85 c6 00 00 00 jne 2741 <linktest+0x1b1> printf(1, "read lf2 failed\n"); exit(); } close(fd); 267b: 83 ec 0c sub $0xc,%esp 267e: 53 push %ebx 267f: e8 46 22 00 00 call 48ca <close> if(link("lf2", "lf2") >= 0){ 2684: 58 pop %eax 2685: 5a pop %edx 2686: 68 06 53 00 00 push $0x5306 268b: 68 06 53 00 00 push $0x5306 2690: e8 6d 22 00 00 call 4902 <link> 2695: 83 c4 10 add $0x10,%esp 2698: 85 c0 test %eax,%eax 269a: 0f 89 8e 00 00 00 jns 272e <linktest+0x19e> printf(1, "link lf2 lf2 succeeded! oops\n"); exit(); } unlink("lf2"); 26a0: 83 ec 0c sub $0xc,%esp 26a3: 68 06 53 00 00 push $0x5306 26a8: e8 45 22 00 00 call 48f2 <unlink> if(link("lf2", "lf1") >= 0){ 26ad: 59 pop %ecx 26ae: 5b pop %ebx 26af: 68 02 53 00 00 push $0x5302 26b4: 68 06 53 00 00 push $0x5306 26b9: e8 44 22 00 00 call 4902 <link> 26be: 83 c4 10 add $0x10,%esp 26c1: 85 c0 test %eax,%eax 26c3: 79 56 jns 271b <linktest+0x18b> printf(1, "link non-existant succeeded! oops\n"); exit(); } if(link(".", "lf1") >= 0){ 26c5: 83 ec 08 sub $0x8,%esp 26c8: 68 02 53 00 00 push $0x5302 26cd: 68 ca 55 00 00 push $0x55ca 26d2: e8 2b 22 00 00 call 4902 <link> 26d7: 83 c4 10 add $0x10,%esp 26da: 85 c0 test %eax,%eax 26dc: 79 2a jns 2708 <linktest+0x178> printf(1, "link . lf1 succeeded! oops\n"); exit(); } printf(1, "linktest ok\n"); 26de: 83 ec 08 sub $0x8,%esp 26e1: 68 a0 53 00 00 push $0x53a0 26e6: 6a 01 push $0x1 26e8: e8 13 23 00 00 call 4a00 <printf> } 26ed: 83 c4 10 add $0x10,%esp 26f0: 8b 5d fc mov -0x4(%ebp),%ebx 26f3: c9 leave 26f4: c3 ret unlink("lf1"); unlink("lf2"); fd = open("lf1", O_CREATE|O_RDWR); if(fd < 0){ printf(1, "create lf1 failed\n"); 26f5: 50 push %eax 26f6: 50 push %eax 26f7: 68 0a 53 00 00 push $0x530a 26fc: 6a 01 push $0x1 26fe: e8 fd 22 00 00 call 4a00 <printf> exit(); 2703: e8 9a 21 00 00 call 48a2 <exit> printf(1, "link non-existant succeeded! oops\n"); exit(); } if(link(".", "lf1") >= 0){ printf(1, "link . lf1 succeeded! oops\n"); 2708: 50 push %eax 2709: 50 push %eax 270a: 68 84 53 00 00 push $0x5384 270f: 6a 01 push $0x1 2711: e8 ea 22 00 00 call 4a00 <printf> exit(); 2716: e8 87 21 00 00 call 48a2 <exit> exit(); } unlink("lf2"); if(link("lf2", "lf1") >= 0){ printf(1, "link non-existant succeeded! oops\n"); 271b: 52 push %edx 271c: 52 push %edx 271d: 68 38 5f 00 00 push $0x5f38 2722: 6a 01 push $0x1 2724: e8 d7 22 00 00 call 4a00 <printf> exit(); 2729: e8 74 21 00 00 call 48a2 <exit> exit(); } close(fd); if(link("lf2", "lf2") >= 0){ printf(1, "link lf2 lf2 succeeded! oops\n"); 272e: 50 push %eax 272f: 50 push %eax 2730: 68 66 53 00 00 push $0x5366 2735: 6a 01 push $0x1 2737: e8 c4 22 00 00 call 4a00 <printf> exit(); 273c: e8 61 21 00 00 call 48a2 <exit> if(fd < 0){ printf(1, "open lf2 failed\n"); exit(); } if(read(fd, buf, sizeof(buf)) != 5){ printf(1, "read lf2 failed\n"); 2741: 51 push %ecx 2742: 51 push %ecx 2743: 68 55 53 00 00 push $0x5355 2748: 6a 01 push $0x1 274a: e8 b1 22 00 00 call 4a00 <printf> exit(); 274f: e8 4e 21 00 00 call 48a2 <exit> exit(); } fd = open("lf2", 0); if(fd < 0){ printf(1, "open lf2 failed\n"); 2754: 53 push %ebx 2755: 53 push %ebx 2756: 68 44 53 00 00 push $0x5344 275b: 6a 01 push $0x1 275d: e8 9e 22 00 00 call 4a00 <printf> exit(); 2762: e8 3b 21 00 00 call 48a2 <exit> exit(); } unlink("lf1"); if(open("lf1", 0) >= 0){ printf(1, "unlinked lf1 but it is still there!\n"); 2767: 50 push %eax 2768: 50 push %eax 2769: 68 10 5f 00 00 push $0x5f10 276e: 6a 01 push $0x1 2770: e8 8b 22 00 00 call 4a00 <printf> exit(); 2775: e8 28 21 00 00 call 48a2 <exit> exit(); } close(fd); if(link("lf1", "lf2") < 0){ printf(1, "link lf1 lf2 failed\n"); 277a: 51 push %ecx 277b: 51 push %ecx 277c: 68 2f 53 00 00 push $0x532f 2781: 6a 01 push $0x1 2783: e8 78 22 00 00 call 4a00 <printf> exit(); 2788: e8 15 21 00 00 call 48a2 <exit> if(fd < 0){ printf(1, "create lf1 failed\n"); exit(); } if(write(fd, "hello", 5) != 5){ printf(1, "write lf1 failed\n"); 278d: 50 push %eax 278e: 50 push %eax 278f: 68 1d 53 00 00 push $0x531d 2794: 6a 01 push $0x1 2796: e8 65 22 00 00 call 4a00 <printf> exit(); 279b: e8 02 21 00 00 call 48a2 <exit> 000027a0 <concreate>: } // test concurrent create/link/unlink of the same file void concreate(void) { 27a0: 55 push %ebp 27a1: 89 e5 mov %esp,%ebp 27a3: 57 push %edi 27a4: 56 push %esi 27a5: 53 push %ebx } de; printf(1, "concreate test\n"); file[0] = 'C'; file[2] = '\0'; for(i = 0; i < 40; i++){ 27a6: 31 f6 xor %esi,%esi 27a8: 8d 5d ad lea -0x53(%ebp),%ebx file[1] = '0' + i; unlink(file); pid = fork(); if(pid && (i % 3) == 1){ 27ab: bf 56 55 55 55 mov $0x55555556,%edi } // test concurrent create/link/unlink of the same file void concreate(void) { 27b0: 83 ec 64 sub $0x64,%esp struct { ushort inum; char name[14]; } de; printf(1, "concreate test\n"); 27b3: 68 ad 53 00 00 push $0x53ad 27b8: 6a 01 push $0x1 27ba: e8 41 22 00 00 call 4a00 <printf> file[0] = 'C'; 27bf: c6 45 ad 43 movb $0x43,-0x53(%ebp) file[2] = '\0'; 27c3: c6 45 af 00 movb $0x0,-0x51(%ebp) 27c7: 83 c4 10 add $0x10,%esp 27ca: eb 51 jmp 281d <concreate+0x7d> 27cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(i = 0; i < 40; i++){ file[1] = '0' + i; unlink(file); pid = fork(); if(pid && (i % 3) == 1){ 27d0: 89 f0 mov %esi,%eax 27d2: 89 f1 mov %esi,%ecx 27d4: f7 ef imul %edi 27d6: 89 f0 mov %esi,%eax 27d8: c1 f8 1f sar $0x1f,%eax 27db: 29 c2 sub %eax,%edx 27dd: 8d 04 52 lea (%edx,%edx,2),%eax 27e0: 29 c1 sub %eax,%ecx 27e2: 83 f9 01 cmp $0x1,%ecx 27e5: 0f 84 b5 00 00 00 je 28a0 <concreate+0x100> link("C0", file); } else if(pid == 0 && (i % 5) == 1){ link("C0", file); } else { fd = open(file, O_CREATE | O_RDWR); 27eb: 83 ec 08 sub $0x8,%esp 27ee: 68 02 02 00 00 push $0x202 27f3: 53 push %ebx 27f4: e8 e9 20 00 00 call 48e2 <open> if(fd < 0){ 27f9: 83 c4 10 add $0x10,%esp 27fc: 85 c0 test %eax,%eax 27fe: 78 6d js 286d <concreate+0xcd> printf(1, "concreate create %s failed\n", file); exit(); } close(fd); 2800: 83 ec 0c sub $0xc,%esp } de; printf(1, "concreate test\n"); file[0] = 'C'; file[2] = '\0'; for(i = 0; i < 40; i++){ 2803: 83 c6 01 add $0x1,%esi fd = open(file, O_CREATE | O_RDWR); if(fd < 0){ printf(1, "concreate create %s failed\n", file); exit(); } close(fd); 2806: 50 push %eax 2807: e8 be 20 00 00 call 48ca <close> 280c: 83 c4 10 add $0x10,%esp } if(pid == 0) exit(); else wait(); 280f: e8 96 20 00 00 call 48aa <wait> } de; printf(1, "concreate test\n"); file[0] = 'C'; file[2] = '\0'; for(i = 0; i < 40; i++){ 2814: 83 fe 28 cmp $0x28,%esi 2817: 0f 84 ab 00 00 00 je 28c8 <concreate+0x128> file[1] = '0' + i; unlink(file); 281d: 83 ec 0c sub $0xc,%esp printf(1, "concreate test\n"); file[0] = 'C'; file[2] = '\0'; for(i = 0; i < 40; i++){ file[1] = '0' + i; 2820: 8d 46 30 lea 0x30(%esi),%eax unlink(file); 2823: 53 push %ebx printf(1, "concreate test\n"); file[0] = 'C'; file[2] = '\0'; for(i = 0; i < 40; i++){ file[1] = '0' + i; 2824: 88 45 ae mov %al,-0x52(%ebp) unlink(file); 2827: e8 c6 20 00 00 call 48f2 <unlink> pid = fork(); 282c: e8 69 20 00 00 call 489a <fork> if(pid && (i % 3) == 1){ 2831: 83 c4 10 add $0x10,%esp 2834: 85 c0 test %eax,%eax 2836: 75 98 jne 27d0 <concreate+0x30> link("C0", file); } else if(pid == 0 && (i % 5) == 1){ 2838: 89 f0 mov %esi,%eax 283a: ba 67 66 66 66 mov $0x66666667,%edx 283f: f7 ea imul %edx 2841: 89 f0 mov %esi,%eax 2843: c1 f8 1f sar $0x1f,%eax 2846: d1 fa sar %edx 2848: 29 c2 sub %eax,%edx 284a: 8d 04 92 lea (%edx,%edx,4),%eax 284d: 29 c6 sub %eax,%esi 284f: 83 fe 01 cmp $0x1,%esi 2852: 74 34 je 2888 <concreate+0xe8> link("C0", file); } else { fd = open(file, O_CREATE | O_RDWR); 2854: 83 ec 08 sub $0x8,%esp 2857: 68 02 02 00 00 push $0x202 285c: 53 push %ebx 285d: e8 80 20 00 00 call 48e2 <open> if(fd < 0){ 2862: 83 c4 10 add $0x10,%esp 2865: 85 c0 test %eax,%eax 2867: 0f 89 32 02 00 00 jns 2a9f <concreate+0x2ff> printf(1, "concreate create %s failed\n", file); 286d: 83 ec 04 sub $0x4,%esp 2870: 53 push %ebx 2871: 68 c0 53 00 00 push $0x53c0 2876: 6a 01 push $0x1 2878: e8 83 21 00 00 call 4a00 <printf> exit(); 287d: e8 20 20 00 00 call 48a2 <exit> 2882: 8d b6 00 00 00 00 lea 0x0(%esi),%esi unlink(file); pid = fork(); if(pid && (i % 3) == 1){ link("C0", file); } else if(pid == 0 && (i % 5) == 1){ link("C0", file); 2888: 83 ec 08 sub $0x8,%esp 288b: 53 push %ebx 288c: 68 bd 53 00 00 push $0x53bd 2891: e8 6c 20 00 00 call 4902 <link> 2896: 83 c4 10 add $0x10,%esp exit(); } close(fd); } if(pid == 0) exit(); 2899: e8 04 20 00 00 call 48a2 <exit> 289e: 66 90 xchg %ax,%ax for(i = 0; i < 40; i++){ file[1] = '0' + i; unlink(file); pid = fork(); if(pid && (i % 3) == 1){ link("C0", file); 28a0: 83 ec 08 sub $0x8,%esp } de; printf(1, "concreate test\n"); file[0] = 'C'; file[2] = '\0'; for(i = 0; i < 40; i++){ 28a3: 83 c6 01 add $0x1,%esi file[1] = '0' + i; unlink(file); pid = fork(); if(pid && (i % 3) == 1){ link("C0", file); 28a6: 53 push %ebx 28a7: 68 bd 53 00 00 push $0x53bd 28ac: e8 51 20 00 00 call 4902 <link> 28b1: 83 c4 10 add $0x10,%esp close(fd); } if(pid == 0) exit(); else wait(); 28b4: e8 f1 1f 00 00 call 48aa <wait> } de; printf(1, "concreate test\n"); file[0] = 'C'; file[2] = '\0'; for(i = 0; i < 40; i++){ 28b9: 83 fe 28 cmp $0x28,%esi 28bc: 0f 85 5b ff ff ff jne 281d <concreate+0x7d> 28c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); else wait(); } memset(fa, 0, sizeof(fa)); 28c8: 8d 45 c0 lea -0x40(%ebp),%eax 28cb: 83 ec 04 sub $0x4,%esp 28ce: 8d 7d b0 lea -0x50(%ebp),%edi 28d1: 6a 28 push $0x28 28d3: 6a 00 push $0x0 28d5: 50 push %eax 28d6: e8 35 1e 00 00 call 4710 <memset> fd = open(".", 0); 28db: 59 pop %ecx 28dc: 5e pop %esi 28dd: 6a 00 push $0x0 28df: 68 ca 55 00 00 push $0x55ca 28e4: e8 f9 1f 00 00 call 48e2 <open> n = 0; while(read(fd, &de, sizeof(de)) > 0){ 28e9: 83 c4 10 add $0x10,%esp else wait(); } memset(fa, 0, sizeof(fa)); fd = open(".", 0); 28ec: 89 c6 mov %eax,%esi n = 0; 28ee: c7 45 a4 00 00 00 00 movl $0x0,-0x5c(%ebp) 28f5: 8d 76 00 lea 0x0(%esi),%esi while(read(fd, &de, sizeof(de)) > 0){ 28f8: 83 ec 04 sub $0x4,%esp 28fb: 6a 10 push $0x10 28fd: 57 push %edi 28fe: 56 push %esi 28ff: e8 b6 1f 00 00 call 48ba <read> 2904: 83 c4 10 add $0x10,%esp 2907: 85 c0 test %eax,%eax 2909: 7e 3d jle 2948 <concreate+0x1a8> if(de.inum == 0) 290b: 66 83 7d b0 00 cmpw $0x0,-0x50(%ebp) 2910: 74 e6 je 28f8 <concreate+0x158> continue; if(de.name[0] == 'C' && de.name[2] == '\0'){ 2912: 80 7d b2 43 cmpb $0x43,-0x4e(%ebp) 2916: 75 e0 jne 28f8 <concreate+0x158> 2918: 80 7d b4 00 cmpb $0x0,-0x4c(%ebp) 291c: 75 da jne 28f8 <concreate+0x158> i = de.name[1] - '0'; 291e: 0f be 45 b3 movsbl -0x4d(%ebp),%eax 2922: 83 e8 30 sub $0x30,%eax if(i < 0 || i >= sizeof(fa)){ 2925: 83 f8 27 cmp $0x27,%eax 2928: 0f 87 59 01 00 00 ja 2a87 <concreate+0x2e7> printf(1, "concreate weird file %s\n", de.name); exit(); } if(fa[i]){ 292e: 80 7c 05 c0 00 cmpb $0x0,-0x40(%ebp,%eax,1) 2933: 0f 85 36 01 00 00 jne 2a6f <concreate+0x2cf> printf(1, "concreate duplicate file %s\n", de.name); exit(); } fa[i] = 1; 2939: c6 44 05 c0 01 movb $0x1,-0x40(%ebp,%eax,1) n++; 293e: 83 45 a4 01 addl $0x1,-0x5c(%ebp) 2942: eb b4 jmp 28f8 <concreate+0x158> 2944: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } close(fd); 2948: 83 ec 0c sub $0xc,%esp 294b: 56 push %esi 294c: e8 79 1f 00 00 call 48ca <close> if(n != 40){ 2951: 83 c4 10 add $0x10,%esp 2954: 83 7d a4 28 cmpl $0x28,-0x5c(%ebp) 2958: 0f 85 fd 00 00 00 jne 2a5b <concreate+0x2bb> 295e: 31 f6 xor %esi,%esi 2960: eb 70 jmp 29d2 <concreate+0x232> 2962: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(pid < 0){ printf(1, "fork failed\n"); exit(); } if(((i % 3) == 0 && pid == 0) || ((i % 3) == 1 && pid != 0)){ 2968: 83 fa 01 cmp $0x1,%edx 296b: 0f 85 99 00 00 00 jne 2a0a <concreate+0x26a> close(open(file, 0)); 2971: 83 ec 08 sub $0x8,%esp 2974: 6a 00 push $0x0 2976: 53 push %ebx 2977: e8 66 1f 00 00 call 48e2 <open> 297c: 89 04 24 mov %eax,(%esp) 297f: e8 46 1f 00 00 call 48ca <close> close(open(file, 0)); 2984: 58 pop %eax 2985: 5a pop %edx 2986: 6a 00 push $0x0 2988: 53 push %ebx 2989: e8 54 1f 00 00 call 48e2 <open> 298e: 89 04 24 mov %eax,(%esp) 2991: e8 34 1f 00 00 call 48ca <close> close(open(file, 0)); 2996: 59 pop %ecx 2997: 58 pop %eax 2998: 6a 00 push $0x0 299a: 53 push %ebx 299b: e8 42 1f 00 00 call 48e2 <open> 29a0: 89 04 24 mov %eax,(%esp) 29a3: e8 22 1f 00 00 call 48ca <close> close(open(file, 0)); 29a8: 58 pop %eax 29a9: 5a pop %edx 29aa: 6a 00 push $0x0 29ac: 53 push %ebx 29ad: e8 30 1f 00 00 call 48e2 <open> 29b2: 89 04 24 mov %eax,(%esp) 29b5: e8 10 1f 00 00 call 48ca <close> 29ba: 83 c4 10 add $0x10,%esp unlink(file); unlink(file); unlink(file); unlink(file); } if(pid == 0) 29bd: 85 ff test %edi,%edi 29bf: 0f 84 d4 fe ff ff je 2899 <concreate+0xf9> if(n != 40){ printf(1, "concreate not enough files in directory listing\n"); exit(); } for(i = 0; i < 40; i++){ 29c5: 83 c6 01 add $0x1,%esi unlink(file); } if(pid == 0) exit(); else wait(); 29c8: e8 dd 1e 00 00 call 48aa <wait> if(n != 40){ printf(1, "concreate not enough files in directory listing\n"); exit(); } for(i = 0; i < 40; i++){ 29cd: 83 fe 28 cmp $0x28,%esi 29d0: 74 5e je 2a30 <concreate+0x290> file[1] = '0' + i; 29d2: 8d 46 30 lea 0x30(%esi),%eax 29d5: 88 45 ae mov %al,-0x52(%ebp) pid = fork(); 29d8: e8 bd 1e 00 00 call 489a <fork> if(pid < 0){ 29dd: 85 c0 test %eax,%eax exit(); } for(i = 0; i < 40; i++){ file[1] = '0' + i; pid = fork(); 29df: 89 c7 mov %eax,%edi if(pid < 0){ 29e1: 78 64 js 2a47 <concreate+0x2a7> printf(1, "fork failed\n"); exit(); } if(((i % 3) == 0 && pid == 0) || 29e3: b8 56 55 55 55 mov $0x55555556,%eax 29e8: f7 ee imul %esi 29ea: 89 f0 mov %esi,%eax 29ec: c1 f8 1f sar $0x1f,%eax 29ef: 29 c2 sub %eax,%edx 29f1: 8d 04 52 lea (%edx,%edx,2),%eax 29f4: 89 f2 mov %esi,%edx 29f6: 29 c2 sub %eax,%edx 29f8: 89 f8 mov %edi,%eax 29fa: 09 d0 or %edx,%eax 29fc: 0f 84 6f ff ff ff je 2971 <concreate+0x1d1> ((i % 3) == 1 && pid != 0)){ 2a02: 85 ff test %edi,%edi 2a04: 0f 85 5e ff ff ff jne 2968 <concreate+0x1c8> close(open(file, 0)); close(open(file, 0)); close(open(file, 0)); close(open(file, 0)); } else { unlink(file); 2a0a: 83 ec 0c sub $0xc,%esp 2a0d: 53 push %ebx 2a0e: e8 df 1e 00 00 call 48f2 <unlink> unlink(file); 2a13: 89 1c 24 mov %ebx,(%esp) 2a16: e8 d7 1e 00 00 call 48f2 <unlink> unlink(file); 2a1b: 89 1c 24 mov %ebx,(%esp) 2a1e: e8 cf 1e 00 00 call 48f2 <unlink> unlink(file); 2a23: 89 1c 24 mov %ebx,(%esp) 2a26: e8 c7 1e 00 00 call 48f2 <unlink> 2a2b: 83 c4 10 add $0x10,%esp 2a2e: eb 8d jmp 29bd <concreate+0x21d> exit(); else wait(); } printf(1, "concreate ok\n"); 2a30: 83 ec 08 sub $0x8,%esp 2a33: 68 12 54 00 00 push $0x5412 2a38: 6a 01 push $0x1 2a3a: e8 c1 1f 00 00 call 4a00 <printf> } 2a3f: 8d 65 f4 lea -0xc(%ebp),%esp 2a42: 5b pop %ebx 2a43: 5e pop %esi 2a44: 5f pop %edi 2a45: 5d pop %ebp 2a46: c3 ret for(i = 0; i < 40; i++){ file[1] = '0' + i; pid = fork(); if(pid < 0){ printf(1, "fork failed\n"); 2a47: 83 ec 08 sub $0x8,%esp 2a4a: 68 95 5c 00 00 push $0x5c95 2a4f: 6a 01 push $0x1 2a51: e8 aa 1f 00 00 call 4a00 <printf> exit(); 2a56: e8 47 1e 00 00 call 48a2 <exit> } } close(fd); if(n != 40){ printf(1, "concreate not enough files in directory listing\n"); 2a5b: 83 ec 08 sub $0x8,%esp 2a5e: 68 5c 5f 00 00 push $0x5f5c 2a63: 6a 01 push $0x1 2a65: e8 96 1f 00 00 call 4a00 <printf> exit(); 2a6a: e8 33 1e 00 00 call 48a2 <exit> if(i < 0 || i >= sizeof(fa)){ printf(1, "concreate weird file %s\n", de.name); exit(); } if(fa[i]){ printf(1, "concreate duplicate file %s\n", de.name); 2a6f: 8d 45 b2 lea -0x4e(%ebp),%eax 2a72: 83 ec 04 sub $0x4,%esp 2a75: 50 push %eax 2a76: 68 f5 53 00 00 push $0x53f5 2a7b: 6a 01 push $0x1 2a7d: e8 7e 1f 00 00 call 4a00 <printf> exit(); 2a82: e8 1b 1e 00 00 call 48a2 <exit> if(de.inum == 0) continue; if(de.name[0] == 'C' && de.name[2] == '\0'){ i = de.name[1] - '0'; if(i < 0 || i >= sizeof(fa)){ printf(1, "concreate weird file %s\n", de.name); 2a87: 8d 45 b2 lea -0x4e(%ebp),%eax 2a8a: 83 ec 04 sub $0x4,%esp 2a8d: 50 push %eax 2a8e: 68 dc 53 00 00 push $0x53dc 2a93: 6a 01 push $0x1 2a95: e8 66 1f 00 00 call 4a00 <printf> exit(); 2a9a: e8 03 1e 00 00 call 48a2 <exit> fd = open(file, O_CREATE | O_RDWR); if(fd < 0){ printf(1, "concreate create %s failed\n", file); exit(); } close(fd); 2a9f: 83 ec 0c sub $0xc,%esp 2aa2: 50 push %eax 2aa3: e8 22 1e 00 00 call 48ca <close> 2aa8: 83 c4 10 add $0x10,%esp 2aab: e9 e9 fd ff ff jmp 2899 <concreate+0xf9> 00002ab0 <linkunlink>: // another concurrent link/unlink/create test, // to look for deadlocks. void linkunlink() { 2ab0: 55 push %ebp 2ab1: 89 e5 mov %esp,%ebp 2ab3: 57 push %edi 2ab4: 56 push %esi 2ab5: 53 push %ebx 2ab6: 83 ec 24 sub $0x24,%esp int pid, i; printf(1, "linkunlink test\n"); 2ab9: 68 20 54 00 00 push $0x5420 2abe: 6a 01 push $0x1 2ac0: e8 3b 1f 00 00 call 4a00 <printf> unlink("x"); 2ac5: c7 04 24 ad 56 00 00 movl $0x56ad,(%esp) 2acc: e8 21 1e 00 00 call 48f2 <unlink> pid = fork(); 2ad1: e8 c4 1d 00 00 call 489a <fork> if(pid < 0){ 2ad6: 83 c4 10 add $0x10,%esp 2ad9: 85 c0 test %eax,%eax int pid, i; printf(1, "linkunlink test\n"); unlink("x"); pid = fork(); 2adb: 89 45 e4 mov %eax,-0x1c(%ebp) if(pid < 0){ 2ade: 0f 88 b6 00 00 00 js 2b9a <linkunlink+0xea> printf(1, "fork failed\n"); exit(); } unsigned int x = (pid ? 1 : 97); 2ae4: 83 7d e4 01 cmpl $0x1,-0x1c(%ebp) 2ae8: bb 64 00 00 00 mov $0x64,%ebx for(i = 0; i < 100; i++){ x = x * 1103515245 + 12345; if((x % 3) == 0){ 2aed: be ab aa aa aa mov $0xaaaaaaab,%esi if(pid < 0){ printf(1, "fork failed\n"); exit(); } unsigned int x = (pid ? 1 : 97); 2af2: 19 ff sbb %edi,%edi 2af4: 83 e7 60 and $0x60,%edi 2af7: 83 c7 01 add $0x1,%edi 2afa: eb 1e jmp 2b1a <linkunlink+0x6a> 2afc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(i = 0; i < 100; i++){ x = x * 1103515245 + 12345; if((x % 3) == 0){ close(open("x", O_RDWR | O_CREATE)); } else if((x % 3) == 1){ 2b00: 83 fa 01 cmp $0x1,%edx 2b03: 74 7b je 2b80 <linkunlink+0xd0> link("cat", "x"); } else { unlink("x"); 2b05: 83 ec 0c sub $0xc,%esp 2b08: 68 ad 56 00 00 push $0x56ad 2b0d: e8 e0 1d 00 00 call 48f2 <unlink> 2b12: 83 c4 10 add $0x10,%esp printf(1, "fork failed\n"); exit(); } unsigned int x = (pid ? 1 : 97); for(i = 0; i < 100; i++){ 2b15: 83 eb 01 sub $0x1,%ebx 2b18: 74 3d je 2b57 <linkunlink+0xa7> x = x * 1103515245 + 12345; 2b1a: 69 cf 6d 4e c6 41 imul $0x41c64e6d,%edi,%ecx 2b20: 8d b9 39 30 00 00 lea 0x3039(%ecx),%edi if((x % 3) == 0){ 2b26: 89 f8 mov %edi,%eax 2b28: f7 e6 mul %esi 2b2a: d1 ea shr %edx 2b2c: 8d 04 52 lea (%edx,%edx,2),%eax 2b2f: 89 fa mov %edi,%edx 2b31: 29 c2 sub %eax,%edx 2b33: 75 cb jne 2b00 <linkunlink+0x50> close(open("x", O_RDWR | O_CREATE)); 2b35: 83 ec 08 sub $0x8,%esp 2b38: 68 02 02 00 00 push $0x202 2b3d: 68 ad 56 00 00 push $0x56ad 2b42: e8 9b 1d 00 00 call 48e2 <open> 2b47: 89 04 24 mov %eax,(%esp) 2b4a: e8 7b 1d 00 00 call 48ca <close> 2b4f: 83 c4 10 add $0x10,%esp printf(1, "fork failed\n"); exit(); } unsigned int x = (pid ? 1 : 97); for(i = 0; i < 100; i++){ 2b52: 83 eb 01 sub $0x1,%ebx 2b55: 75 c3 jne 2b1a <linkunlink+0x6a> } else { unlink("x"); } } if(pid) 2b57: 8b 45 e4 mov -0x1c(%ebp),%eax 2b5a: 85 c0 test %eax,%eax 2b5c: 74 50 je 2bae <linkunlink+0xfe> wait(); 2b5e: e8 47 1d 00 00 call 48aa <wait> else exit(); printf(1, "linkunlink ok\n"); 2b63: 83 ec 08 sub $0x8,%esp 2b66: 68 35 54 00 00 push $0x5435 2b6b: 6a 01 push $0x1 2b6d: e8 8e 1e 00 00 call 4a00 <printf> } 2b72: 8d 65 f4 lea -0xc(%ebp),%esp 2b75: 5b pop %ebx 2b76: 5e pop %esi 2b77: 5f pop %edi 2b78: 5d pop %ebp 2b79: c3 ret 2b7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(i = 0; i < 100; i++){ x = x * 1103515245 + 12345; if((x % 3) == 0){ close(open("x", O_RDWR | O_CREATE)); } else if((x % 3) == 1){ link("cat", "x"); 2b80: 83 ec 08 sub $0x8,%esp 2b83: 68 ad 56 00 00 push $0x56ad 2b88: 68 31 54 00 00 push $0x5431 2b8d: e8 70 1d 00 00 call 4902 <link> 2b92: 83 c4 10 add $0x10,%esp 2b95: e9 7b ff ff ff jmp 2b15 <linkunlink+0x65> printf(1, "linkunlink test\n"); unlink("x"); pid = fork(); if(pid < 0){ printf(1, "fork failed\n"); 2b9a: 83 ec 08 sub $0x8,%esp 2b9d: 68 95 5c 00 00 push $0x5c95 2ba2: 6a 01 push $0x1 2ba4: e8 57 1e 00 00 call 4a00 <printf> exit(); 2ba9: e8 f4 1c 00 00 call 48a2 <exit> } if(pid) wait(); else exit(); 2bae: e8 ef 1c 00 00 call 48a2 <exit> 2bb3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 2bb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00002bc0 <bigdir>: } // directory that uses indirect blocks void bigdir(void) { 2bc0: 55 push %ebp 2bc1: 89 e5 mov %esp,%ebp 2bc3: 56 push %esi 2bc4: 53 push %ebx 2bc5: 83 ec 18 sub $0x18,%esp int i, fd; char name[10]; printf(1, "bigdir test\n"); 2bc8: 68 44 54 00 00 push $0x5444 2bcd: 6a 01 push $0x1 2bcf: e8 2c 1e 00 00 call 4a00 <printf> unlink("bd"); 2bd4: c7 04 24 51 54 00 00 movl $0x5451,(%esp) 2bdb: e8 12 1d 00 00 call 48f2 <unlink> fd = open("bd", O_CREATE); 2be0: 58 pop %eax 2be1: 5a pop %edx 2be2: 68 00 02 00 00 push $0x200 2be7: 68 51 54 00 00 push $0x5451 2bec: e8 f1 1c 00 00 call 48e2 <open> if(fd < 0){ 2bf1: 83 c4 10 add $0x10,%esp 2bf4: 85 c0 test %eax,%eax 2bf6: 0f 88 de 00 00 00 js 2cda <bigdir+0x11a> printf(1, "bigdir create failed\n"); exit(); } close(fd); 2bfc: 83 ec 0c sub $0xc,%esp 2bff: 8d 75 ee lea -0x12(%ebp),%esi for(i = 0; i < 500; i++){ 2c02: 31 db xor %ebx,%ebx fd = open("bd", O_CREATE); if(fd < 0){ printf(1, "bigdir create failed\n"); exit(); } close(fd); 2c04: 50 push %eax 2c05: e8 c0 1c 00 00 call 48ca <close> 2c0a: 83 c4 10 add $0x10,%esp 2c0d: 8d 76 00 lea 0x0(%esi),%esi for(i = 0; i < 500; i++){ name[0] = 'x'; name[1] = '0' + (i / 64); 2c10: 89 d8 mov %ebx,%eax name[2] = '0' + (i % 64); name[3] = '\0'; if(link("bd", name) != 0){ 2c12: 83 ec 08 sub $0x8,%esp exit(); } close(fd); for(i = 0; i < 500; i++){ name[0] = 'x'; 2c15: c6 45 ee 78 movb $0x78,-0x12(%ebp) name[1] = '0' + (i / 64); 2c19: c1 f8 06 sar $0x6,%eax name[2] = '0' + (i % 64); name[3] = '\0'; if(link("bd", name) != 0){ 2c1c: 56 push %esi 2c1d: 68 51 54 00 00 push $0x5451 } close(fd); for(i = 0; i < 500; i++){ name[0] = 'x'; name[1] = '0' + (i / 64); 2c22: 83 c0 30 add $0x30,%eax name[2] = '0' + (i % 64); name[3] = '\0'; 2c25: c6 45 f1 00 movb $0x0,-0xf(%ebp) } close(fd); for(i = 0; i < 500; i++){ name[0] = 'x'; name[1] = '0' + (i / 64); 2c29: 88 45 ef mov %al,-0x11(%ebp) name[2] = '0' + (i % 64); 2c2c: 89 d8 mov %ebx,%eax 2c2e: 83 e0 3f and $0x3f,%eax 2c31: 83 c0 30 add $0x30,%eax 2c34: 88 45 f0 mov %al,-0x10(%ebp) name[3] = '\0'; if(link("bd", name) != 0){ 2c37: e8 c6 1c 00 00 call 4902 <link> 2c3c: 83 c4 10 add $0x10,%esp 2c3f: 85 c0 test %eax,%eax 2c41: 75 6f jne 2cb2 <bigdir+0xf2> printf(1, "bigdir create failed\n"); exit(); } close(fd); for(i = 0; i < 500; i++){ 2c43: 83 c3 01 add $0x1,%ebx 2c46: 81 fb f4 01 00 00 cmp $0x1f4,%ebx 2c4c: 75 c2 jne 2c10 <bigdir+0x50> printf(1, "bigdir link failed\n"); exit(); } } unlink("bd"); 2c4e: 83 ec 0c sub $0xc,%esp for(i = 0; i < 500; i++){ 2c51: 31 db xor %ebx,%ebx printf(1, "bigdir link failed\n"); exit(); } } unlink("bd"); 2c53: 68 51 54 00 00 push $0x5451 2c58: e8 95 1c 00 00 call 48f2 <unlink> 2c5d: 83 c4 10 add $0x10,%esp for(i = 0; i < 500; i++){ name[0] = 'x'; name[1] = '0' + (i / 64); 2c60: 89 d8 mov %ebx,%eax name[2] = '0' + (i % 64); name[3] = '\0'; if(unlink(name) != 0){ 2c62: 83 ec 0c sub $0xc,%esp } } unlink("bd"); for(i = 0; i < 500; i++){ name[0] = 'x'; 2c65: c6 45 ee 78 movb $0x78,-0x12(%ebp) name[1] = '0' + (i / 64); 2c69: c1 f8 06 sar $0x6,%eax name[2] = '0' + (i % 64); name[3] = '\0'; if(unlink(name) != 0){ 2c6c: 56 push %esi unlink("bd"); for(i = 0; i < 500; i++){ name[0] = 'x'; name[1] = '0' + (i / 64); name[2] = '0' + (i % 64); name[3] = '\0'; 2c6d: c6 45 f1 00 movb $0x0,-0xf(%ebp) } unlink("bd"); for(i = 0; i < 500; i++){ name[0] = 'x'; name[1] = '0' + (i / 64); 2c71: 83 c0 30 add $0x30,%eax 2c74: 88 45 ef mov %al,-0x11(%ebp) name[2] = '0' + (i % 64); 2c77: 89 d8 mov %ebx,%eax 2c79: 83 e0 3f and $0x3f,%eax 2c7c: 83 c0 30 add $0x30,%eax 2c7f: 88 45 f0 mov %al,-0x10(%ebp) name[3] = '\0'; if(unlink(name) != 0){ 2c82: e8 6b 1c 00 00 call 48f2 <unlink> 2c87: 83 c4 10 add $0x10,%esp 2c8a: 85 c0 test %eax,%eax 2c8c: 75 38 jne 2cc6 <bigdir+0x106> exit(); } } unlink("bd"); for(i = 0; i < 500; i++){ 2c8e: 83 c3 01 add $0x1,%ebx 2c91: 81 fb f4 01 00 00 cmp $0x1f4,%ebx 2c97: 75 c7 jne 2c60 <bigdir+0xa0> printf(1, "bigdir unlink failed"); exit(); } } printf(1, "bigdir ok\n"); 2c99: 83 ec 08 sub $0x8,%esp 2c9c: 68 93 54 00 00 push $0x5493 2ca1: 6a 01 push $0x1 2ca3: e8 58 1d 00 00 call 4a00 <printf> } 2ca8: 83 c4 10 add $0x10,%esp 2cab: 8d 65 f8 lea -0x8(%ebp),%esp 2cae: 5b pop %ebx 2caf: 5e pop %esi 2cb0: 5d pop %ebp 2cb1: c3 ret name[0] = 'x'; name[1] = '0' + (i / 64); name[2] = '0' + (i % 64); name[3] = '\0'; if(link("bd", name) != 0){ printf(1, "bigdir link failed\n"); 2cb2: 83 ec 08 sub $0x8,%esp 2cb5: 68 6a 54 00 00 push $0x546a 2cba: 6a 01 push $0x1 2cbc: e8 3f 1d 00 00 call 4a00 <printf> exit(); 2cc1: e8 dc 1b 00 00 call 48a2 <exit> name[0] = 'x'; name[1] = '0' + (i / 64); name[2] = '0' + (i % 64); name[3] = '\0'; if(unlink(name) != 0){ printf(1, "bigdir unlink failed"); 2cc6: 83 ec 08 sub $0x8,%esp 2cc9: 68 7e 54 00 00 push $0x547e 2cce: 6a 01 push $0x1 2cd0: e8 2b 1d 00 00 call 4a00 <printf> exit(); 2cd5: e8 c8 1b 00 00 call 48a2 <exit> printf(1, "bigdir test\n"); unlink("bd"); fd = open("bd", O_CREATE); if(fd < 0){ printf(1, "bigdir create failed\n"); 2cda: 83 ec 08 sub $0x8,%esp 2cdd: 68 54 54 00 00 push $0x5454 2ce2: 6a 01 push $0x1 2ce4: e8 17 1d 00 00 call 4a00 <printf> exit(); 2ce9: e8 b4 1b 00 00 call 48a2 <exit> 2cee: 66 90 xchg %ax,%ax 00002cf0 <subdir>: printf(1, "bigdir ok\n"); } void subdir(void) { 2cf0: 55 push %ebp 2cf1: 89 e5 mov %esp,%ebp 2cf3: 53 push %ebx 2cf4: 83 ec 0c sub $0xc,%esp int fd, cc; printf(1, "subdir test\n"); 2cf7: 68 9e 54 00 00 push $0x549e 2cfc: 6a 01 push $0x1 2cfe: e8 fd 1c 00 00 call 4a00 <printf> unlink("ff"); 2d03: c7 04 24 27 55 00 00 movl $0x5527,(%esp) 2d0a: e8 e3 1b 00 00 call 48f2 <unlink> if(mkdir("dd") != 0){ 2d0f: c7 04 24 c4 55 00 00 movl $0x55c4,(%esp) 2d16: e8 ef 1b 00 00 call 490a <mkdir> 2d1b: 83 c4 10 add $0x10,%esp 2d1e: 85 c0 test %eax,%eax 2d20: 0f 85 b3 05 00 00 jne 32d9 <subdir+0x5e9> printf(1, "subdir mkdir dd failed\n"); exit(); } fd = open("dd/ff", O_CREATE | O_RDWR); 2d26: 83 ec 08 sub $0x8,%esp 2d29: 68 02 02 00 00 push $0x202 2d2e: 68 fd 54 00 00 push $0x54fd 2d33: e8 aa 1b 00 00 call 48e2 <open> if(fd < 0){ 2d38: 83 c4 10 add $0x10,%esp 2d3b: 85 c0 test %eax,%eax if(mkdir("dd") != 0){ printf(1, "subdir mkdir dd failed\n"); exit(); } fd = open("dd/ff", O_CREATE | O_RDWR); 2d3d: 89 c3 mov %eax,%ebx if(fd < 0){ 2d3f: 0f 88 81 05 00 00 js 32c6 <subdir+0x5d6> printf(1, "create dd/ff failed\n"); exit(); } write(fd, "ff", 2); 2d45: 83 ec 04 sub $0x4,%esp 2d48: 6a 02 push $0x2 2d4a: 68 27 55 00 00 push $0x5527 2d4f: 50 push %eax 2d50: e8 6d 1b 00 00 call 48c2 <write> close(fd); 2d55: 89 1c 24 mov %ebx,(%esp) 2d58: e8 6d 1b 00 00 call 48ca <close> if(unlink("dd") >= 0){ 2d5d: c7 04 24 c4 55 00 00 movl $0x55c4,(%esp) 2d64: e8 89 1b 00 00 call 48f2 <unlink> 2d69: 83 c4 10 add $0x10,%esp 2d6c: 85 c0 test %eax,%eax 2d6e: 0f 89 3f 05 00 00 jns 32b3 <subdir+0x5c3> printf(1, "unlink dd (non-empty dir) succeeded!\n"); exit(); } if(mkdir("/dd/dd") != 0){ 2d74: 83 ec 0c sub $0xc,%esp 2d77: 68 d8 54 00 00 push $0x54d8 2d7c: e8 89 1b 00 00 call 490a <mkdir> 2d81: 83 c4 10 add $0x10,%esp 2d84: 85 c0 test %eax,%eax 2d86: 0f 85 14 05 00 00 jne 32a0 <subdir+0x5b0> printf(1, "subdir mkdir dd/dd failed\n"); exit(); } fd = open("dd/dd/ff", O_CREATE | O_RDWR); 2d8c: 83 ec 08 sub $0x8,%esp 2d8f: 68 02 02 00 00 push $0x202 2d94: 68 fa 54 00 00 push $0x54fa 2d99: e8 44 1b 00 00 call 48e2 <open> if(fd < 0){ 2d9e: 83 c4 10 add $0x10,%esp 2da1: 85 c0 test %eax,%eax if(mkdir("/dd/dd") != 0){ printf(1, "subdir mkdir dd/dd failed\n"); exit(); } fd = open("dd/dd/ff", O_CREATE | O_RDWR); 2da3: 89 c3 mov %eax,%ebx if(fd < 0){ 2da5: 0f 88 24 04 00 00 js 31cf <subdir+0x4df> printf(1, "create dd/dd/ff failed\n"); exit(); } write(fd, "FF", 2); 2dab: 83 ec 04 sub $0x4,%esp 2dae: 6a 02 push $0x2 2db0: 68 1b 55 00 00 push $0x551b 2db5: 50 push %eax 2db6: e8 07 1b 00 00 call 48c2 <write> close(fd); 2dbb: 89 1c 24 mov %ebx,(%esp) 2dbe: e8 07 1b 00 00 call 48ca <close> fd = open("dd/dd/../ff", 0); 2dc3: 58 pop %eax 2dc4: 5a pop %edx 2dc5: 6a 00 push $0x0 2dc7: 68 1e 55 00 00 push $0x551e 2dcc: e8 11 1b 00 00 call 48e2 <open> if(fd < 0){ 2dd1: 83 c4 10 add $0x10,%esp 2dd4: 85 c0 test %eax,%eax exit(); } write(fd, "FF", 2); close(fd); fd = open("dd/dd/../ff", 0); 2dd6: 89 c3 mov %eax,%ebx if(fd < 0){ 2dd8: 0f 88 de 03 00 00 js 31bc <subdir+0x4cc> printf(1, "open dd/dd/../ff failed\n"); exit(); } cc = read(fd, buf, sizeof(buf)); 2dde: 83 ec 04 sub $0x4,%esp 2de1: 68 00 20 00 00 push $0x2000 2de6: 68 00 96 00 00 push $0x9600 2deb: 50 push %eax 2dec: e8 c9 1a 00 00 call 48ba <read> if(cc != 2 || buf[0] != 'f'){ 2df1: 83 c4 10 add $0x10,%esp 2df4: 83 f8 02 cmp $0x2,%eax 2df7: 0f 85 3a 03 00 00 jne 3137 <subdir+0x447> 2dfd: 80 3d 00 96 00 00 66 cmpb $0x66,0x9600 2e04: 0f 85 2d 03 00 00 jne 3137 <subdir+0x447> printf(1, "dd/dd/../ff wrong content\n"); exit(); } close(fd); 2e0a: 83 ec 0c sub $0xc,%esp 2e0d: 53 push %ebx 2e0e: e8 b7 1a 00 00 call 48ca <close> if(link("dd/dd/ff", "dd/dd/ffff") != 0){ 2e13: 5b pop %ebx 2e14: 58 pop %eax 2e15: 68 5e 55 00 00 push $0x555e 2e1a: 68 fa 54 00 00 push $0x54fa 2e1f: e8 de 1a 00 00 call 4902 <link> 2e24: 83 c4 10 add $0x10,%esp 2e27: 85 c0 test %eax,%eax 2e29: 0f 85 c6 03 00 00 jne 31f5 <subdir+0x505> printf(1, "link dd/dd/ff dd/dd/ffff failed\n"); exit(); } if(unlink("dd/dd/ff") != 0){ 2e2f: 83 ec 0c sub $0xc,%esp 2e32: 68 fa 54 00 00 push $0x54fa 2e37: e8 b6 1a 00 00 call 48f2 <unlink> 2e3c: 83 c4 10 add $0x10,%esp 2e3f: 85 c0 test %eax,%eax 2e41: 0f 85 16 03 00 00 jne 315d <subdir+0x46d> printf(1, "unlink dd/dd/ff failed\n"); exit(); } if(open("dd/dd/ff", O_RDONLY) >= 0){ 2e47: 83 ec 08 sub $0x8,%esp 2e4a: 6a 00 push $0x0 2e4c: 68 fa 54 00 00 push $0x54fa 2e51: e8 8c 1a 00 00 call 48e2 <open> 2e56: 83 c4 10 add $0x10,%esp 2e59: 85 c0 test %eax,%eax 2e5b: 0f 89 2c 04 00 00 jns 328d <subdir+0x59d> printf(1, "open (unlinked) dd/dd/ff succeeded\n"); exit(); } if(chdir("dd") != 0){ 2e61: 83 ec 0c sub $0xc,%esp 2e64: 68 c4 55 00 00 push $0x55c4 2e69: e8 a4 1a 00 00 call 4912 <chdir> 2e6e: 83 c4 10 add $0x10,%esp 2e71: 85 c0 test %eax,%eax 2e73: 0f 85 01 04 00 00 jne 327a <subdir+0x58a> printf(1, "chdir dd failed\n"); exit(); } if(chdir("dd/../../dd") != 0){ 2e79: 83 ec 0c sub $0xc,%esp 2e7c: 68 92 55 00 00 push $0x5592 2e81: e8 8c 1a 00 00 call 4912 <chdir> 2e86: 83 c4 10 add $0x10,%esp 2e89: 85 c0 test %eax,%eax 2e8b: 0f 85 b9 02 00 00 jne 314a <subdir+0x45a> printf(1, "chdir dd/../../dd failed\n"); exit(); } if(chdir("dd/../../../dd") != 0){ 2e91: 83 ec 0c sub $0xc,%esp 2e94: 68 b8 55 00 00 push $0x55b8 2e99: e8 74 1a 00 00 call 4912 <chdir> 2e9e: 83 c4 10 add $0x10,%esp 2ea1: 85 c0 test %eax,%eax 2ea3: 0f 85 a1 02 00 00 jne 314a <subdir+0x45a> printf(1, "chdir dd/../../dd failed\n"); exit(); } if(chdir("./..") != 0){ 2ea9: 83 ec 0c sub $0xc,%esp 2eac: 68 c7 55 00 00 push $0x55c7 2eb1: e8 5c 1a 00 00 call 4912 <chdir> 2eb6: 83 c4 10 add $0x10,%esp 2eb9: 85 c0 test %eax,%eax 2ebb: 0f 85 21 03 00 00 jne 31e2 <subdir+0x4f2> printf(1, "chdir ./.. failed\n"); exit(); } fd = open("dd/dd/ffff", 0); 2ec1: 83 ec 08 sub $0x8,%esp 2ec4: 6a 00 push $0x0 2ec6: 68 5e 55 00 00 push $0x555e 2ecb: e8 12 1a 00 00 call 48e2 <open> if(fd < 0){ 2ed0: 83 c4 10 add $0x10,%esp 2ed3: 85 c0 test %eax,%eax if(chdir("./..") != 0){ printf(1, "chdir ./.. failed\n"); exit(); } fd = open("dd/dd/ffff", 0); 2ed5: 89 c3 mov %eax,%ebx if(fd < 0){ 2ed7: 0f 88 e0 04 00 00 js 33bd <subdir+0x6cd> printf(1, "open dd/dd/ffff failed\n"); exit(); } if(read(fd, buf, sizeof(buf)) != 2){ 2edd: 83 ec 04 sub $0x4,%esp 2ee0: 68 00 20 00 00 push $0x2000 2ee5: 68 00 96 00 00 push $0x9600 2eea: 50 push %eax 2eeb: e8 ca 19 00 00 call 48ba <read> 2ef0: 83 c4 10 add $0x10,%esp 2ef3: 83 f8 02 cmp $0x2,%eax 2ef6: 0f 85 ae 04 00 00 jne 33aa <subdir+0x6ba> printf(1, "read dd/dd/ffff wrong len\n"); exit(); } close(fd); 2efc: 83 ec 0c sub $0xc,%esp 2eff: 53 push %ebx 2f00: e8 c5 19 00 00 call 48ca <close> if(open("dd/dd/ff", O_RDONLY) >= 0){ 2f05: 59 pop %ecx 2f06: 5b pop %ebx 2f07: 6a 00 push $0x0 2f09: 68 fa 54 00 00 push $0x54fa 2f0e: e8 cf 19 00 00 call 48e2 <open> 2f13: 83 c4 10 add $0x10,%esp 2f16: 85 c0 test %eax,%eax 2f18: 0f 89 65 02 00 00 jns 3183 <subdir+0x493> printf(1, "open (unlinked) dd/dd/ff succeeded!\n"); exit(); } if(open("dd/ff/ff", O_CREATE|O_RDWR) >= 0){ 2f1e: 83 ec 08 sub $0x8,%esp 2f21: 68 02 02 00 00 push $0x202 2f26: 68 12 56 00 00 push $0x5612 2f2b: e8 b2 19 00 00 call 48e2 <open> 2f30: 83 c4 10 add $0x10,%esp 2f33: 85 c0 test %eax,%eax 2f35: 0f 89 35 02 00 00 jns 3170 <subdir+0x480> printf(1, "create dd/ff/ff succeeded!\n"); exit(); } if(open("dd/xx/ff", O_CREATE|O_RDWR) >= 0){ 2f3b: 83 ec 08 sub $0x8,%esp 2f3e: 68 02 02 00 00 push $0x202 2f43: 68 37 56 00 00 push $0x5637 2f48: e8 95 19 00 00 call 48e2 <open> 2f4d: 83 c4 10 add $0x10,%esp 2f50: 85 c0 test %eax,%eax 2f52: 0f 89 0f 03 00 00 jns 3267 <subdir+0x577> printf(1, "create dd/xx/ff succeeded!\n"); exit(); } if(open("dd", O_CREATE) >= 0){ 2f58: 83 ec 08 sub $0x8,%esp 2f5b: 68 00 02 00 00 push $0x200 2f60: 68 c4 55 00 00 push $0x55c4 2f65: e8 78 19 00 00 call 48e2 <open> 2f6a: 83 c4 10 add $0x10,%esp 2f6d: 85 c0 test %eax,%eax 2f6f: 0f 89 df 02 00 00 jns 3254 <subdir+0x564> printf(1, "create dd succeeded!\n"); exit(); } if(open("dd", O_RDWR) >= 0){ 2f75: 83 ec 08 sub $0x8,%esp 2f78: 6a 02 push $0x2 2f7a: 68 c4 55 00 00 push $0x55c4 2f7f: e8 5e 19 00 00 call 48e2 <open> 2f84: 83 c4 10 add $0x10,%esp 2f87: 85 c0 test %eax,%eax 2f89: 0f 89 b2 02 00 00 jns 3241 <subdir+0x551> printf(1, "open dd rdwr succeeded!\n"); exit(); } if(open("dd", O_WRONLY) >= 0){ 2f8f: 83 ec 08 sub $0x8,%esp 2f92: 6a 01 push $0x1 2f94: 68 c4 55 00 00 push $0x55c4 2f99: e8 44 19 00 00 call 48e2 <open> 2f9e: 83 c4 10 add $0x10,%esp 2fa1: 85 c0 test %eax,%eax 2fa3: 0f 89 85 02 00 00 jns 322e <subdir+0x53e> printf(1, "open dd wronly succeeded!\n"); exit(); } if(link("dd/ff/ff", "dd/dd/xx") == 0){ 2fa9: 83 ec 08 sub $0x8,%esp 2fac: 68 a6 56 00 00 push $0x56a6 2fb1: 68 12 56 00 00 push $0x5612 2fb6: e8 47 19 00 00 call 4902 <link> 2fbb: 83 c4 10 add $0x10,%esp 2fbe: 85 c0 test %eax,%eax 2fc0: 0f 84 55 02 00 00 je 321b <subdir+0x52b> printf(1, "link dd/ff/ff dd/dd/xx succeeded!\n"); exit(); } if(link("dd/xx/ff", "dd/dd/xx") == 0){ 2fc6: 83 ec 08 sub $0x8,%esp 2fc9: 68 a6 56 00 00 push $0x56a6 2fce: 68 37 56 00 00 push $0x5637 2fd3: e8 2a 19 00 00 call 4902 <link> 2fd8: 83 c4 10 add $0x10,%esp 2fdb: 85 c0 test %eax,%eax 2fdd: 0f 84 25 02 00 00 je 3208 <subdir+0x518> printf(1, "link dd/xx/ff dd/dd/xx succeeded!\n"); exit(); } if(link("dd/ff", "dd/dd/ffff") == 0){ 2fe3: 83 ec 08 sub $0x8,%esp 2fe6: 68 5e 55 00 00 push $0x555e 2feb: 68 fd 54 00 00 push $0x54fd 2ff0: e8 0d 19 00 00 call 4902 <link> 2ff5: 83 c4 10 add $0x10,%esp 2ff8: 85 c0 test %eax,%eax 2ffa: 0f 84 a9 01 00 00 je 31a9 <subdir+0x4b9> printf(1, "link dd/ff dd/dd/ffff succeeded!\n"); exit(); } if(mkdir("dd/ff/ff") == 0){ 3000: 83 ec 0c sub $0xc,%esp 3003: 68 12 56 00 00 push $0x5612 3008: e8 fd 18 00 00 call 490a <mkdir> 300d: 83 c4 10 add $0x10,%esp 3010: 85 c0 test %eax,%eax 3012: 0f 84 7e 01 00 00 je 3196 <subdir+0x4a6> printf(1, "mkdir dd/ff/ff succeeded!\n"); exit(); } if(mkdir("dd/xx/ff") == 0){ 3018: 83 ec 0c sub $0xc,%esp 301b: 68 37 56 00 00 push $0x5637 3020: e8 e5 18 00 00 call 490a <mkdir> 3025: 83 c4 10 add $0x10,%esp 3028: 85 c0 test %eax,%eax 302a: 0f 84 67 03 00 00 je 3397 <subdir+0x6a7> printf(1, "mkdir dd/xx/ff succeeded!\n"); exit(); } if(mkdir("dd/dd/ffff") == 0){ 3030: 83 ec 0c sub $0xc,%esp 3033: 68 5e 55 00 00 push $0x555e 3038: e8 cd 18 00 00 call 490a <mkdir> 303d: 83 c4 10 add $0x10,%esp 3040: 85 c0 test %eax,%eax 3042: 0f 84 3c 03 00 00 je 3384 <subdir+0x694> printf(1, "mkdir dd/dd/ffff succeeded!\n"); exit(); } if(unlink("dd/xx/ff") == 0){ 3048: 83 ec 0c sub $0xc,%esp 304b: 68 37 56 00 00 push $0x5637 3050: e8 9d 18 00 00 call 48f2 <unlink> 3055: 83 c4 10 add $0x10,%esp 3058: 85 c0 test %eax,%eax 305a: 0f 84 11 03 00 00 je 3371 <subdir+0x681> printf(1, "unlink dd/xx/ff succeeded!\n"); exit(); } if(unlink("dd/ff/ff") == 0){ 3060: 83 ec 0c sub $0xc,%esp 3063: 68 12 56 00 00 push $0x5612 3068: e8 85 18 00 00 call 48f2 <unlink> 306d: 83 c4 10 add $0x10,%esp 3070: 85 c0 test %eax,%eax 3072: 0f 84 e6 02 00 00 je 335e <subdir+0x66e> printf(1, "unlink dd/ff/ff succeeded!\n"); exit(); } if(chdir("dd/ff") == 0){ 3078: 83 ec 0c sub $0xc,%esp 307b: 68 fd 54 00 00 push $0x54fd 3080: e8 8d 18 00 00 call 4912 <chdir> 3085: 83 c4 10 add $0x10,%esp 3088: 85 c0 test %eax,%eax 308a: 0f 84 bb 02 00 00 je 334b <subdir+0x65b> printf(1, "chdir dd/ff succeeded!\n"); exit(); } if(chdir("dd/xx") == 0){ 3090: 83 ec 0c sub $0xc,%esp 3093: 68 a9 56 00 00 push $0x56a9 3098: e8 75 18 00 00 call 4912 <chdir> 309d: 83 c4 10 add $0x10,%esp 30a0: 85 c0 test %eax,%eax 30a2: 0f 84 90 02 00 00 je 3338 <subdir+0x648> printf(1, "chdir dd/xx succeeded!\n"); exit(); } if(unlink("dd/dd/ffff") != 0){ 30a8: 83 ec 0c sub $0xc,%esp 30ab: 68 5e 55 00 00 push $0x555e 30b0: e8 3d 18 00 00 call 48f2 <unlink> 30b5: 83 c4 10 add $0x10,%esp 30b8: 85 c0 test %eax,%eax 30ba: 0f 85 9d 00 00 00 jne 315d <subdir+0x46d> printf(1, "unlink dd/dd/ff failed\n"); exit(); } if(unlink("dd/ff") != 0){ 30c0: 83 ec 0c sub $0xc,%esp 30c3: 68 fd 54 00 00 push $0x54fd 30c8: e8 25 18 00 00 call 48f2 <unlink> 30cd: 83 c4 10 add $0x10,%esp 30d0: 85 c0 test %eax,%eax 30d2: 0f 85 4d 02 00 00 jne 3325 <subdir+0x635> printf(1, "unlink dd/ff failed\n"); exit(); } if(unlink("dd") == 0){ 30d8: 83 ec 0c sub $0xc,%esp 30db: 68 c4 55 00 00 push $0x55c4 30e0: e8 0d 18 00 00 call 48f2 <unlink> 30e5: 83 c4 10 add $0x10,%esp 30e8: 85 c0 test %eax,%eax 30ea: 0f 84 22 02 00 00 je 3312 <subdir+0x622> printf(1, "unlink non-empty dd succeeded!\n"); exit(); } if(unlink("dd/dd") < 0){ 30f0: 83 ec 0c sub $0xc,%esp 30f3: 68 d9 54 00 00 push $0x54d9 30f8: e8 f5 17 00 00 call 48f2 <unlink> 30fd: 83 c4 10 add $0x10,%esp 3100: 85 c0 test %eax,%eax 3102: 0f 88 f7 01 00 00 js 32ff <subdir+0x60f> printf(1, "unlink dd/dd failed\n"); exit(); } if(unlink("dd") < 0){ 3108: 83 ec 0c sub $0xc,%esp 310b: 68 c4 55 00 00 push $0x55c4 3110: e8 dd 17 00 00 call 48f2 <unlink> 3115: 83 c4 10 add $0x10,%esp 3118: 85 c0 test %eax,%eax 311a: 0f 88 cc 01 00 00 js 32ec <subdir+0x5fc> printf(1, "unlink dd failed\n"); exit(); } printf(1, "subdir ok\n"); 3120: 83 ec 08 sub $0x8,%esp 3123: 68 a6 57 00 00 push $0x57a6 3128: 6a 01 push $0x1 312a: e8 d1 18 00 00 call 4a00 <printf> } 312f: 83 c4 10 add $0x10,%esp 3132: 8b 5d fc mov -0x4(%ebp),%ebx 3135: c9 leave 3136: c3 ret printf(1, "open dd/dd/../ff failed\n"); exit(); } cc = read(fd, buf, sizeof(buf)); if(cc != 2 || buf[0] != 'f'){ printf(1, "dd/dd/../ff wrong content\n"); 3137: 50 push %eax 3138: 50 push %eax 3139: 68 43 55 00 00 push $0x5543 313e: 6a 01 push $0x1 3140: e8 bb 18 00 00 call 4a00 <printf> exit(); 3145: e8 58 17 00 00 call 48a2 <exit> if(chdir("dd") != 0){ printf(1, "chdir dd failed\n"); exit(); } if(chdir("dd/../../dd") != 0){ printf(1, "chdir dd/../../dd failed\n"); 314a: 50 push %eax 314b: 50 push %eax 314c: 68 9e 55 00 00 push $0x559e 3151: 6a 01 push $0x1 3153: e8 a8 18 00 00 call 4a00 <printf> exit(); 3158: e8 45 17 00 00 call 48a2 <exit> printf(1, "link dd/dd/ff dd/dd/ffff failed\n"); exit(); } if(unlink("dd/dd/ff") != 0){ printf(1, "unlink dd/dd/ff failed\n"); 315d: 52 push %edx 315e: 52 push %edx 315f: 68 69 55 00 00 push $0x5569 3164: 6a 01 push $0x1 3166: e8 95 18 00 00 call 4a00 <printf> exit(); 316b: e8 32 17 00 00 call 48a2 <exit> printf(1, "open (unlinked) dd/dd/ff succeeded!\n"); exit(); } if(open("dd/ff/ff", O_CREATE|O_RDWR) >= 0){ printf(1, "create dd/ff/ff succeeded!\n"); 3170: 50 push %eax 3171: 50 push %eax 3172: 68 1b 56 00 00 push $0x561b 3177: 6a 01 push $0x1 3179: e8 82 18 00 00 call 4a00 <printf> exit(); 317e: e8 1f 17 00 00 call 48a2 <exit> exit(); } close(fd); if(open("dd/dd/ff", O_RDONLY) >= 0){ printf(1, "open (unlinked) dd/dd/ff succeeded!\n"); 3183: 52 push %edx 3184: 52 push %edx 3185: 68 00 60 00 00 push $0x6000 318a: 6a 01 push $0x1 318c: e8 6f 18 00 00 call 4a00 <printf> exit(); 3191: e8 0c 17 00 00 call 48a2 <exit> if(link("dd/ff", "dd/dd/ffff") == 0){ printf(1, "link dd/ff dd/dd/ffff succeeded!\n"); exit(); } if(mkdir("dd/ff/ff") == 0){ printf(1, "mkdir dd/ff/ff succeeded!\n"); 3196: 52 push %edx 3197: 52 push %edx 3198: 68 af 56 00 00 push $0x56af 319d: 6a 01 push $0x1 319f: e8 5c 18 00 00 call 4a00 <printf> exit(); 31a4: e8 f9 16 00 00 call 48a2 <exit> if(link("dd/xx/ff", "dd/dd/xx") == 0){ printf(1, "link dd/xx/ff dd/dd/xx succeeded!\n"); exit(); } if(link("dd/ff", "dd/dd/ffff") == 0){ printf(1, "link dd/ff dd/dd/ffff succeeded!\n"); 31a9: 51 push %ecx 31aa: 51 push %ecx 31ab: 68 70 60 00 00 push $0x6070 31b0: 6a 01 push $0x1 31b2: e8 49 18 00 00 call 4a00 <printf> exit(); 31b7: e8 e6 16 00 00 call 48a2 <exit> write(fd, "FF", 2); close(fd); fd = open("dd/dd/../ff", 0); if(fd < 0){ printf(1, "open dd/dd/../ff failed\n"); 31bc: 50 push %eax 31bd: 50 push %eax 31be: 68 2a 55 00 00 push $0x552a 31c3: 6a 01 push $0x1 31c5: e8 36 18 00 00 call 4a00 <printf> exit(); 31ca: e8 d3 16 00 00 call 48a2 <exit> exit(); } fd = open("dd/dd/ff", O_CREATE | O_RDWR); if(fd < 0){ printf(1, "create dd/dd/ff failed\n"); 31cf: 51 push %ecx 31d0: 51 push %ecx 31d1: 68 03 55 00 00 push $0x5503 31d6: 6a 01 push $0x1 31d8: e8 23 18 00 00 call 4a00 <printf> exit(); 31dd: e8 c0 16 00 00 call 48a2 <exit> if(chdir("dd/../../../dd") != 0){ printf(1, "chdir dd/../../dd failed\n"); exit(); } if(chdir("./..") != 0){ printf(1, "chdir ./.. failed\n"); 31e2: 50 push %eax 31e3: 50 push %eax 31e4: 68 cc 55 00 00 push $0x55cc 31e9: 6a 01 push $0x1 31eb: e8 10 18 00 00 call 4a00 <printf> exit(); 31f0: e8 ad 16 00 00 call 48a2 <exit> exit(); } close(fd); if(link("dd/dd/ff", "dd/dd/ffff") != 0){ printf(1, "link dd/dd/ff dd/dd/ffff failed\n"); 31f5: 51 push %ecx 31f6: 51 push %ecx 31f7: 68 b8 5f 00 00 push $0x5fb8 31fc: 6a 01 push $0x1 31fe: e8 fd 17 00 00 call 4a00 <printf> exit(); 3203: e8 9a 16 00 00 call 48a2 <exit> if(link("dd/ff/ff", "dd/dd/xx") == 0){ printf(1, "link dd/ff/ff dd/dd/xx succeeded!\n"); exit(); } if(link("dd/xx/ff", "dd/dd/xx") == 0){ printf(1, "link dd/xx/ff dd/dd/xx succeeded!\n"); 3208: 53 push %ebx 3209: 53 push %ebx 320a: 68 4c 60 00 00 push $0x604c 320f: 6a 01 push $0x1 3211: e8 ea 17 00 00 call 4a00 <printf> exit(); 3216: e8 87 16 00 00 call 48a2 <exit> if(open("dd", O_WRONLY) >= 0){ printf(1, "open dd wronly succeeded!\n"); exit(); } if(link("dd/ff/ff", "dd/dd/xx") == 0){ printf(1, "link dd/ff/ff dd/dd/xx succeeded!\n"); 321b: 50 push %eax 321c: 50 push %eax 321d: 68 28 60 00 00 push $0x6028 3222: 6a 01 push $0x1 3224: e8 d7 17 00 00 call 4a00 <printf> exit(); 3229: e8 74 16 00 00 call 48a2 <exit> if(open("dd", O_RDWR) >= 0){ printf(1, "open dd rdwr succeeded!\n"); exit(); } if(open("dd", O_WRONLY) >= 0){ printf(1, "open dd wronly succeeded!\n"); 322e: 50 push %eax 322f: 50 push %eax 3230: 68 8b 56 00 00 push $0x568b 3235: 6a 01 push $0x1 3237: e8 c4 17 00 00 call 4a00 <printf> exit(); 323c: e8 61 16 00 00 call 48a2 <exit> if(open("dd", O_CREATE) >= 0){ printf(1, "create dd succeeded!\n"); exit(); } if(open("dd", O_RDWR) >= 0){ printf(1, "open dd rdwr succeeded!\n"); 3241: 50 push %eax 3242: 50 push %eax 3243: 68 72 56 00 00 push $0x5672 3248: 6a 01 push $0x1 324a: e8 b1 17 00 00 call 4a00 <printf> exit(); 324f: e8 4e 16 00 00 call 48a2 <exit> if(open("dd/xx/ff", O_CREATE|O_RDWR) >= 0){ printf(1, "create dd/xx/ff succeeded!\n"); exit(); } if(open("dd", O_CREATE) >= 0){ printf(1, "create dd succeeded!\n"); 3254: 50 push %eax 3255: 50 push %eax 3256: 68 5c 56 00 00 push $0x565c 325b: 6a 01 push $0x1 325d: e8 9e 17 00 00 call 4a00 <printf> exit(); 3262: e8 3b 16 00 00 call 48a2 <exit> if(open("dd/ff/ff", O_CREATE|O_RDWR) >= 0){ printf(1, "create dd/ff/ff succeeded!\n"); exit(); } if(open("dd/xx/ff", O_CREATE|O_RDWR) >= 0){ printf(1, "create dd/xx/ff succeeded!\n"); 3267: 50 push %eax 3268: 50 push %eax 3269: 68 40 56 00 00 push $0x5640 326e: 6a 01 push $0x1 3270: e8 8b 17 00 00 call 4a00 <printf> exit(); 3275: e8 28 16 00 00 call 48a2 <exit> printf(1, "open (unlinked) dd/dd/ff succeeded\n"); exit(); } if(chdir("dd") != 0){ printf(1, "chdir dd failed\n"); 327a: 50 push %eax 327b: 50 push %eax 327c: 68 81 55 00 00 push $0x5581 3281: 6a 01 push $0x1 3283: e8 78 17 00 00 call 4a00 <printf> exit(); 3288: e8 15 16 00 00 call 48a2 <exit> if(unlink("dd/dd/ff") != 0){ printf(1, "unlink dd/dd/ff failed\n"); exit(); } if(open("dd/dd/ff", O_RDONLY) >= 0){ printf(1, "open (unlinked) dd/dd/ff succeeded\n"); 328d: 50 push %eax 328e: 50 push %eax 328f: 68 dc 5f 00 00 push $0x5fdc 3294: 6a 01 push $0x1 3296: e8 65 17 00 00 call 4a00 <printf> exit(); 329b: e8 02 16 00 00 call 48a2 <exit> printf(1, "unlink dd (non-empty dir) succeeded!\n"); exit(); } if(mkdir("/dd/dd") != 0){ printf(1, "subdir mkdir dd/dd failed\n"); 32a0: 53 push %ebx 32a1: 53 push %ebx 32a2: 68 df 54 00 00 push $0x54df 32a7: 6a 01 push $0x1 32a9: e8 52 17 00 00 call 4a00 <printf> exit(); 32ae: e8 ef 15 00 00 call 48a2 <exit> } write(fd, "ff", 2); close(fd); if(unlink("dd") >= 0){ printf(1, "unlink dd (non-empty dir) succeeded!\n"); 32b3: 50 push %eax 32b4: 50 push %eax 32b5: 68 90 5f 00 00 push $0x5f90 32ba: 6a 01 push $0x1 32bc: e8 3f 17 00 00 call 4a00 <printf> exit(); 32c1: e8 dc 15 00 00 call 48a2 <exit> exit(); } fd = open("dd/ff", O_CREATE | O_RDWR); if(fd < 0){ printf(1, "create dd/ff failed\n"); 32c6: 50 push %eax 32c7: 50 push %eax 32c8: 68 c3 54 00 00 push $0x54c3 32cd: 6a 01 push $0x1 32cf: e8 2c 17 00 00 call 4a00 <printf> exit(); 32d4: e8 c9 15 00 00 call 48a2 <exit> printf(1, "subdir test\n"); unlink("ff"); if(mkdir("dd") != 0){ printf(1, "subdir mkdir dd failed\n"); 32d9: 50 push %eax 32da: 50 push %eax 32db: 68 ab 54 00 00 push $0x54ab 32e0: 6a 01 push $0x1 32e2: e8 19 17 00 00 call 4a00 <printf> exit(); 32e7: e8 b6 15 00 00 call 48a2 <exit> if(unlink("dd/dd") < 0){ printf(1, "unlink dd/dd failed\n"); exit(); } if(unlink("dd") < 0){ printf(1, "unlink dd failed\n"); 32ec: 50 push %eax 32ed: 50 push %eax 32ee: 68 94 57 00 00 push $0x5794 32f3: 6a 01 push $0x1 32f5: e8 06 17 00 00 call 4a00 <printf> exit(); 32fa: e8 a3 15 00 00 call 48a2 <exit> if(unlink("dd") == 0){ printf(1, "unlink non-empty dd succeeded!\n"); exit(); } if(unlink("dd/dd") < 0){ printf(1, "unlink dd/dd failed\n"); 32ff: 52 push %edx 3300: 52 push %edx 3301: 68 7f 57 00 00 push $0x577f 3306: 6a 01 push $0x1 3308: e8 f3 16 00 00 call 4a00 <printf> exit(); 330d: e8 90 15 00 00 call 48a2 <exit> if(unlink("dd/ff") != 0){ printf(1, "unlink dd/ff failed\n"); exit(); } if(unlink("dd") == 0){ printf(1, "unlink non-empty dd succeeded!\n"); 3312: 51 push %ecx 3313: 51 push %ecx 3314: 68 94 60 00 00 push $0x6094 3319: 6a 01 push $0x1 331b: e8 e0 16 00 00 call 4a00 <printf> exit(); 3320: e8 7d 15 00 00 call 48a2 <exit> if(unlink("dd/dd/ffff") != 0){ printf(1, "unlink dd/dd/ff failed\n"); exit(); } if(unlink("dd/ff") != 0){ printf(1, "unlink dd/ff failed\n"); 3325: 53 push %ebx 3326: 53 push %ebx 3327: 68 6a 57 00 00 push $0x576a 332c: 6a 01 push $0x1 332e: e8 cd 16 00 00 call 4a00 <printf> exit(); 3333: e8 6a 15 00 00 call 48a2 <exit> if(chdir("dd/ff") == 0){ printf(1, "chdir dd/ff succeeded!\n"); exit(); } if(chdir("dd/xx") == 0){ printf(1, "chdir dd/xx succeeded!\n"); 3338: 50 push %eax 3339: 50 push %eax 333a: 68 52 57 00 00 push $0x5752 333f: 6a 01 push $0x1 3341: e8 ba 16 00 00 call 4a00 <printf> exit(); 3346: e8 57 15 00 00 call 48a2 <exit> if(unlink("dd/ff/ff") == 0){ printf(1, "unlink dd/ff/ff succeeded!\n"); exit(); } if(chdir("dd/ff") == 0){ printf(1, "chdir dd/ff succeeded!\n"); 334b: 50 push %eax 334c: 50 push %eax 334d: 68 3a 57 00 00 push $0x573a 3352: 6a 01 push $0x1 3354: e8 a7 16 00 00 call 4a00 <printf> exit(); 3359: e8 44 15 00 00 call 48a2 <exit> if(unlink("dd/xx/ff") == 0){ printf(1, "unlink dd/xx/ff succeeded!\n"); exit(); } if(unlink("dd/ff/ff") == 0){ printf(1, "unlink dd/ff/ff succeeded!\n"); 335e: 50 push %eax 335f: 50 push %eax 3360: 68 1e 57 00 00 push $0x571e 3365: 6a 01 push $0x1 3367: e8 94 16 00 00 call 4a00 <printf> exit(); 336c: e8 31 15 00 00 call 48a2 <exit> if(mkdir("dd/dd/ffff") == 0){ printf(1, "mkdir dd/dd/ffff succeeded!\n"); exit(); } if(unlink("dd/xx/ff") == 0){ printf(1, "unlink dd/xx/ff succeeded!\n"); 3371: 50 push %eax 3372: 50 push %eax 3373: 68 02 57 00 00 push $0x5702 3378: 6a 01 push $0x1 337a: e8 81 16 00 00 call 4a00 <printf> exit(); 337f: e8 1e 15 00 00 call 48a2 <exit> if(mkdir("dd/xx/ff") == 0){ printf(1, "mkdir dd/xx/ff succeeded!\n"); exit(); } if(mkdir("dd/dd/ffff") == 0){ printf(1, "mkdir dd/dd/ffff succeeded!\n"); 3384: 50 push %eax 3385: 50 push %eax 3386: 68 e5 56 00 00 push $0x56e5 338b: 6a 01 push $0x1 338d: e8 6e 16 00 00 call 4a00 <printf> exit(); 3392: e8 0b 15 00 00 call 48a2 <exit> if(mkdir("dd/ff/ff") == 0){ printf(1, "mkdir dd/ff/ff succeeded!\n"); exit(); } if(mkdir("dd/xx/ff") == 0){ printf(1, "mkdir dd/xx/ff succeeded!\n"); 3397: 50 push %eax 3398: 50 push %eax 3399: 68 ca 56 00 00 push $0x56ca 339e: 6a 01 push $0x1 33a0: e8 5b 16 00 00 call 4a00 <printf> exit(); 33a5: e8 f8 14 00 00 call 48a2 <exit> if(fd < 0){ printf(1, "open dd/dd/ffff failed\n"); exit(); } if(read(fd, buf, sizeof(buf)) != 2){ printf(1, "read dd/dd/ffff wrong len\n"); 33aa: 50 push %eax 33ab: 50 push %eax 33ac: 68 f7 55 00 00 push $0x55f7 33b1: 6a 01 push $0x1 33b3: e8 48 16 00 00 call 4a00 <printf> exit(); 33b8: e8 e5 14 00 00 call 48a2 <exit> exit(); } fd = open("dd/dd/ffff", 0); if(fd < 0){ printf(1, "open dd/dd/ffff failed\n"); 33bd: 50 push %eax 33be: 50 push %eax 33bf: 68 df 55 00 00 push $0x55df 33c4: 6a 01 push $0x1 33c6: e8 35 16 00 00 call 4a00 <printf> exit(); 33cb: e8 d2 14 00 00 call 48a2 <exit> 000033d0 <bigwrite>: } // test writes that are larger than the log. void bigwrite(void) { 33d0: 55 push %ebp 33d1: 89 e5 mov %esp,%ebp 33d3: 56 push %esi 33d4: 53 push %ebx int fd, sz; printf(1, "bigwrite test\n"); unlink("bigwrite"); for(sz = 499; sz < 12*512; sz += 471){ 33d5: bb f3 01 00 00 mov $0x1f3,%ebx void bigwrite(void) { int fd, sz; printf(1, "bigwrite test\n"); 33da: 83 ec 08 sub $0x8,%esp 33dd: 68 b1 57 00 00 push $0x57b1 33e2: 6a 01 push $0x1 33e4: e8 17 16 00 00 call 4a00 <printf> unlink("bigwrite"); 33e9: c7 04 24 c0 57 00 00 movl $0x57c0,(%esp) 33f0: e8 fd 14 00 00 call 48f2 <unlink> 33f5: 83 c4 10 add $0x10,%esp 33f8: 90 nop 33f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(sz = 499; sz < 12*512; sz += 471){ fd = open("bigwrite", O_CREATE | O_RDWR); 3400: 83 ec 08 sub $0x8,%esp 3403: 68 02 02 00 00 push $0x202 3408: 68 c0 57 00 00 push $0x57c0 340d: e8 d0 14 00 00 call 48e2 <open> if(fd < 0){ 3412: 83 c4 10 add $0x10,%esp 3415: 85 c0 test %eax,%eax printf(1, "bigwrite test\n"); unlink("bigwrite"); for(sz = 499; sz < 12*512; sz += 471){ fd = open("bigwrite", O_CREATE | O_RDWR); 3417: 89 c6 mov %eax,%esi if(fd < 0){ 3419: 78 7e js 3499 <bigwrite+0xc9> printf(1, "cannot create bigwrite\n"); exit(); } int i; for(i = 0; i < 2; i++){ int cc = write(fd, buf, sz); 341b: 83 ec 04 sub $0x4,%esp 341e: 53 push %ebx 341f: 68 00 96 00 00 push $0x9600 3424: 50 push %eax 3425: e8 98 14 00 00 call 48c2 <write> if(cc != sz){ 342a: 83 c4 10 add $0x10,%esp 342d: 39 c3 cmp %eax,%ebx 342f: 75 55 jne 3486 <bigwrite+0xb6> printf(1, "cannot create bigwrite\n"); exit(); } int i; for(i = 0; i < 2; i++){ int cc = write(fd, buf, sz); 3431: 83 ec 04 sub $0x4,%esp 3434: 53 push %ebx 3435: 68 00 96 00 00 push $0x9600 343a: 56 push %esi 343b: e8 82 14 00 00 call 48c2 <write> if(cc != sz){ 3440: 83 c4 10 add $0x10,%esp 3443: 39 c3 cmp %eax,%ebx 3445: 75 3f jne 3486 <bigwrite+0xb6> printf(1, "write(%d) ret %d\n", sz, cc); exit(); } } close(fd); 3447: 83 ec 0c sub $0xc,%esp int fd, sz; printf(1, "bigwrite test\n"); unlink("bigwrite"); for(sz = 499; sz < 12*512; sz += 471){ 344a: 81 c3 d7 01 00 00 add $0x1d7,%ebx if(cc != sz){ printf(1, "write(%d) ret %d\n", sz, cc); exit(); } } close(fd); 3450: 56 push %esi 3451: e8 74 14 00 00 call 48ca <close> unlink("bigwrite"); 3456: c7 04 24 c0 57 00 00 movl $0x57c0,(%esp) 345d: e8 90 14 00 00 call 48f2 <unlink> int fd, sz; printf(1, "bigwrite test\n"); unlink("bigwrite"); for(sz = 499; sz < 12*512; sz += 471){ 3462: 83 c4 10 add $0x10,%esp 3465: 81 fb 07 18 00 00 cmp $0x1807,%ebx 346b: 75 93 jne 3400 <bigwrite+0x30> } close(fd); unlink("bigwrite"); } printf(1, "bigwrite ok\n"); 346d: 83 ec 08 sub $0x8,%esp 3470: 68 f3 57 00 00 push $0x57f3 3475: 6a 01 push $0x1 3477: e8 84 15 00 00 call 4a00 <printf> } 347c: 83 c4 10 add $0x10,%esp 347f: 8d 65 f8 lea -0x8(%ebp),%esp 3482: 5b pop %ebx 3483: 5e pop %esi 3484: 5d pop %ebp 3485: c3 ret } int i; for(i = 0; i < 2; i++){ int cc = write(fd, buf, sz); if(cc != sz){ printf(1, "write(%d) ret %d\n", sz, cc); 3486: 50 push %eax 3487: 53 push %ebx 3488: 68 e1 57 00 00 push $0x57e1 348d: 6a 01 push $0x1 348f: e8 6c 15 00 00 call 4a00 <printf> exit(); 3494: e8 09 14 00 00 call 48a2 <exit> unlink("bigwrite"); for(sz = 499; sz < 12*512; sz += 471){ fd = open("bigwrite", O_CREATE | O_RDWR); if(fd < 0){ printf(1, "cannot create bigwrite\n"); 3499: 83 ec 08 sub $0x8,%esp 349c: 68 c9 57 00 00 push $0x57c9 34a1: 6a 01 push $0x1 34a3: e8 58 15 00 00 call 4a00 <printf> exit(); 34a8: e8 f5 13 00 00 call 48a2 <exit> 34ad: 8d 76 00 lea 0x0(%esi),%esi 000034b0 <bigfile>: printf(1, "bigwrite ok\n"); } void bigfile(void) { 34b0: 55 push %ebp 34b1: 89 e5 mov %esp,%ebp 34b3: 57 push %edi 34b4: 56 push %esi 34b5: 53 push %ebx 34b6: 83 ec 14 sub $0x14,%esp int fd, i, total, cc; printf(1, "bigfile test\n"); 34b9: 68 00 58 00 00 push $0x5800 34be: 6a 01 push $0x1 34c0: e8 3b 15 00 00 call 4a00 <printf> unlink("bigfile"); 34c5: c7 04 24 1c 58 00 00 movl $0x581c,(%esp) 34cc: e8 21 14 00 00 call 48f2 <unlink> fd = open("bigfile", O_CREATE | O_RDWR); 34d1: 5e pop %esi 34d2: 5f pop %edi 34d3: 68 02 02 00 00 push $0x202 34d8: 68 1c 58 00 00 push $0x581c 34dd: e8 00 14 00 00 call 48e2 <open> if(fd < 0){ 34e2: 83 c4 10 add $0x10,%esp 34e5: 85 c0 test %eax,%eax 34e7: 0f 88 5f 01 00 00 js 364c <bigfile+0x19c> 34ed: 89 c6 mov %eax,%esi 34ef: 31 db xor %ebx,%ebx 34f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printf(1, "cannot create bigfile"); exit(); } for(i = 0; i < 20; i++){ memset(buf, i, 600); 34f8: 83 ec 04 sub $0x4,%esp 34fb: 68 58 02 00 00 push $0x258 3500: 53 push %ebx 3501: 68 00 96 00 00 push $0x9600 3506: e8 05 12 00 00 call 4710 <memset> if(write(fd, buf, 600) != 600){ 350b: 83 c4 0c add $0xc,%esp 350e: 68 58 02 00 00 push $0x258 3513: 68 00 96 00 00 push $0x9600 3518: 56 push %esi 3519: e8 a4 13 00 00 call 48c2 <write> 351e: 83 c4 10 add $0x10,%esp 3521: 3d 58 02 00 00 cmp $0x258,%eax 3526: 0f 85 f8 00 00 00 jne 3624 <bigfile+0x174> fd = open("bigfile", O_CREATE | O_RDWR); if(fd < 0){ printf(1, "cannot create bigfile"); exit(); } for(i = 0; i < 20; i++){ 352c: 83 c3 01 add $0x1,%ebx 352f: 83 fb 14 cmp $0x14,%ebx 3532: 75 c4 jne 34f8 <bigfile+0x48> if(write(fd, buf, 600) != 600){ printf(1, "write bigfile failed\n"); exit(); } } close(fd); 3534: 83 ec 0c sub $0xc,%esp 3537: 56 push %esi 3538: e8 8d 13 00 00 call 48ca <close> fd = open("bigfile", 0); 353d: 59 pop %ecx 353e: 5b pop %ebx 353f: 6a 00 push $0x0 3541: 68 1c 58 00 00 push $0x581c 3546: e8 97 13 00 00 call 48e2 <open> if(fd < 0){ 354b: 83 c4 10 add $0x10,%esp 354e: 85 c0 test %eax,%eax exit(); } } close(fd); fd = open("bigfile", 0); 3550: 89 c6 mov %eax,%esi if(fd < 0){ 3552: 0f 88 e0 00 00 00 js 3638 <bigfile+0x188> 3558: 31 db xor %ebx,%ebx 355a: 31 ff xor %edi,%edi 355c: eb 30 jmp 358e <bigfile+0xde> 355e: 66 90 xchg %ax,%ax printf(1, "read bigfile failed\n"); exit(); } if(cc == 0) break; if(cc != 300){ 3560: 3d 2c 01 00 00 cmp $0x12c,%eax 3565: 0f 85 91 00 00 00 jne 35fc <bigfile+0x14c> printf(1, "short read bigfile\n"); exit(); } if(buf[0] != i/2 || buf[299] != i/2){ 356b: 0f be 05 00 96 00 00 movsbl 0x9600,%eax 3572: 89 fa mov %edi,%edx 3574: d1 fa sar %edx 3576: 39 d0 cmp %edx,%eax 3578: 75 6e jne 35e8 <bigfile+0x138> 357a: 0f be 15 2b 97 00 00 movsbl 0x972b,%edx 3581: 39 d0 cmp %edx,%eax 3583: 75 63 jne 35e8 <bigfile+0x138> printf(1, "read bigfile wrong data\n"); exit(); } total += cc; 3585: 81 c3 2c 01 00 00 add $0x12c,%ebx if(fd < 0){ printf(1, "cannot open bigfile\n"); exit(); } total = 0; for(i = 0; ; i++){ 358b: 83 c7 01 add $0x1,%edi cc = read(fd, buf, 300); 358e: 83 ec 04 sub $0x4,%esp 3591: 68 2c 01 00 00 push $0x12c 3596: 68 00 96 00 00 push $0x9600 359b: 56 push %esi 359c: e8 19 13 00 00 call 48ba <read> if(cc < 0){ 35a1: 83 c4 10 add $0x10,%esp 35a4: 85 c0 test %eax,%eax 35a6: 78 68 js 3610 <bigfile+0x160> printf(1, "read bigfile failed\n"); exit(); } if(cc == 0) 35a8: 75 b6 jne 3560 <bigfile+0xb0> printf(1, "read bigfile wrong data\n"); exit(); } total += cc; } close(fd); 35aa: 83 ec 0c sub $0xc,%esp 35ad: 56 push %esi 35ae: e8 17 13 00 00 call 48ca <close> if(total != 20*600){ 35b3: 83 c4 10 add $0x10,%esp 35b6: 81 fb e0 2e 00 00 cmp $0x2ee0,%ebx 35bc: 0f 85 9e 00 00 00 jne 3660 <bigfile+0x1b0> printf(1, "read bigfile wrong total\n"); exit(); } unlink("bigfile"); 35c2: 83 ec 0c sub $0xc,%esp 35c5: 68 1c 58 00 00 push $0x581c 35ca: e8 23 13 00 00 call 48f2 <unlink> printf(1, "bigfile test ok\n"); 35cf: 58 pop %eax 35d0: 5a pop %edx 35d1: 68 ab 58 00 00 push $0x58ab 35d6: 6a 01 push $0x1 35d8: e8 23 14 00 00 call 4a00 <printf> } 35dd: 83 c4 10 add $0x10,%esp 35e0: 8d 65 f4 lea -0xc(%ebp),%esp 35e3: 5b pop %ebx 35e4: 5e pop %esi 35e5: 5f pop %edi 35e6: 5d pop %ebp 35e7: c3 ret if(cc != 300){ printf(1, "short read bigfile\n"); exit(); } if(buf[0] != i/2 || buf[299] != i/2){ printf(1, "read bigfile wrong data\n"); 35e8: 83 ec 08 sub $0x8,%esp 35eb: 68 78 58 00 00 push $0x5878 35f0: 6a 01 push $0x1 35f2: e8 09 14 00 00 call 4a00 <printf> exit(); 35f7: e8 a6 12 00 00 call 48a2 <exit> exit(); } if(cc == 0) break; if(cc != 300){ printf(1, "short read bigfile\n"); 35fc: 83 ec 08 sub $0x8,%esp 35ff: 68 64 58 00 00 push $0x5864 3604: 6a 01 push $0x1 3606: e8 f5 13 00 00 call 4a00 <printf> exit(); 360b: e8 92 12 00 00 call 48a2 <exit> } total = 0; for(i = 0; ; i++){ cc = read(fd, buf, 300); if(cc < 0){ printf(1, "read bigfile failed\n"); 3610: 83 ec 08 sub $0x8,%esp 3613: 68 4f 58 00 00 push $0x584f 3618: 6a 01 push $0x1 361a: e8 e1 13 00 00 call 4a00 <printf> exit(); 361f: e8 7e 12 00 00 call 48a2 <exit> exit(); } for(i = 0; i < 20; i++){ memset(buf, i, 600); if(write(fd, buf, 600) != 600){ printf(1, "write bigfile failed\n"); 3624: 83 ec 08 sub $0x8,%esp 3627: 68 24 58 00 00 push $0x5824 362c: 6a 01 push $0x1 362e: e8 cd 13 00 00 call 4a00 <printf> exit(); 3633: e8 6a 12 00 00 call 48a2 <exit> } close(fd); fd = open("bigfile", 0); if(fd < 0){ printf(1, "cannot open bigfile\n"); 3638: 83 ec 08 sub $0x8,%esp 363b: 68 3a 58 00 00 push $0x583a 3640: 6a 01 push $0x1 3642: e8 b9 13 00 00 call 4a00 <printf> exit(); 3647: e8 56 12 00 00 call 48a2 <exit> printf(1, "bigfile test\n"); unlink("bigfile"); fd = open("bigfile", O_CREATE | O_RDWR); if(fd < 0){ printf(1, "cannot create bigfile"); 364c: 83 ec 08 sub $0x8,%esp 364f: 68 0e 58 00 00 push $0x580e 3654: 6a 01 push $0x1 3656: e8 a5 13 00 00 call 4a00 <printf> exit(); 365b: e8 42 12 00 00 call 48a2 <exit> } total += cc; } close(fd); if(total != 20*600){ printf(1, "read bigfile wrong total\n"); 3660: 83 ec 08 sub $0x8,%esp 3663: 68 91 58 00 00 push $0x5891 3668: 6a 01 push $0x1 366a: e8 91 13 00 00 call 4a00 <printf> exit(); 366f: e8 2e 12 00 00 call 48a2 <exit> 3674: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 367a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00003680 <fourteen>: printf(1, "bigfile test ok\n"); } void fourteen(void) { 3680: 55 push %ebp 3681: 89 e5 mov %esp,%ebp 3683: 83 ec 10 sub $0x10,%esp int fd; // DIRSIZ is 14. printf(1, "fourteen test\n"); 3686: 68 bc 58 00 00 push $0x58bc 368b: 6a 01 push $0x1 368d: e8 6e 13 00 00 call 4a00 <printf> if(mkdir("12345678901234") != 0){ 3692: c7 04 24 f7 58 00 00 movl $0x58f7,(%esp) 3699: e8 6c 12 00 00 call 490a <mkdir> 369e: 83 c4 10 add $0x10,%esp 36a1: 85 c0 test %eax,%eax 36a3: 0f 85 97 00 00 00 jne 3740 <fourteen+0xc0> printf(1, "mkdir 12345678901234 failed\n"); exit(); } if(mkdir("12345678901234/123456789012345") != 0){ 36a9: 83 ec 0c sub $0xc,%esp 36ac: 68 b4 60 00 00 push $0x60b4 36b1: e8 54 12 00 00 call 490a <mkdir> 36b6: 83 c4 10 add $0x10,%esp 36b9: 85 c0 test %eax,%eax 36bb: 0f 85 de 00 00 00 jne 379f <fourteen+0x11f> printf(1, "mkdir 12345678901234/123456789012345 failed\n"); exit(); } fd = open("123456789012345/123456789012345/123456789012345", O_CREATE); 36c1: 83 ec 08 sub $0x8,%esp 36c4: 68 00 02 00 00 push $0x200 36c9: 68 04 61 00 00 push $0x6104 36ce: e8 0f 12 00 00 call 48e2 <open> if(fd < 0){ 36d3: 83 c4 10 add $0x10,%esp 36d6: 85 c0 test %eax,%eax 36d8: 0f 88 ae 00 00 00 js 378c <fourteen+0x10c> printf(1, "create 123456789012345/123456789012345/123456789012345 failed\n"); exit(); } close(fd); 36de: 83 ec 0c sub $0xc,%esp 36e1: 50 push %eax 36e2: e8 e3 11 00 00 call 48ca <close> fd = open("12345678901234/12345678901234/12345678901234", 0); 36e7: 58 pop %eax 36e8: 5a pop %edx 36e9: 6a 00 push $0x0 36eb: 68 74 61 00 00 push $0x6174 36f0: e8 ed 11 00 00 call 48e2 <open> if(fd < 0){ 36f5: 83 c4 10 add $0x10,%esp 36f8: 85 c0 test %eax,%eax 36fa: 78 7d js 3779 <fourteen+0xf9> printf(1, "open 12345678901234/12345678901234/12345678901234 failed\n"); exit(); } close(fd); 36fc: 83 ec 0c sub $0xc,%esp 36ff: 50 push %eax 3700: e8 c5 11 00 00 call 48ca <close> if(mkdir("12345678901234/12345678901234") == 0){ 3705: c7 04 24 e8 58 00 00 movl $0x58e8,(%esp) 370c: e8 f9 11 00 00 call 490a <mkdir> 3711: 83 c4 10 add $0x10,%esp 3714: 85 c0 test %eax,%eax 3716: 74 4e je 3766 <fourteen+0xe6> printf(1, "mkdir 12345678901234/12345678901234 succeeded!\n"); exit(); } if(mkdir("123456789012345/12345678901234") == 0){ 3718: 83 ec 0c sub $0xc,%esp 371b: 68 10 62 00 00 push $0x6210 3720: e8 e5 11 00 00 call 490a <mkdir> 3725: 83 c4 10 add $0x10,%esp 3728: 85 c0 test %eax,%eax 372a: 74 27 je 3753 <fourteen+0xd3> printf(1, "mkdir 12345678901234/123456789012345 succeeded!\n"); exit(); } printf(1, "fourteen ok\n"); 372c: 83 ec 08 sub $0x8,%esp 372f: 68 06 59 00 00 push $0x5906 3734: 6a 01 push $0x1 3736: e8 c5 12 00 00 call 4a00 <printf> } 373b: 83 c4 10 add $0x10,%esp 373e: c9 leave 373f: c3 ret // DIRSIZ is 14. printf(1, "fourteen test\n"); if(mkdir("12345678901234") != 0){ printf(1, "mkdir 12345678901234 failed\n"); 3740: 50 push %eax 3741: 50 push %eax 3742: 68 cb 58 00 00 push $0x58cb 3747: 6a 01 push $0x1 3749: e8 b2 12 00 00 call 4a00 <printf> exit(); 374e: e8 4f 11 00 00 call 48a2 <exit> if(mkdir("12345678901234/12345678901234") == 0){ printf(1, "mkdir 12345678901234/12345678901234 succeeded!\n"); exit(); } if(mkdir("123456789012345/12345678901234") == 0){ printf(1, "mkdir 12345678901234/123456789012345 succeeded!\n"); 3753: 50 push %eax 3754: 50 push %eax 3755: 68 30 62 00 00 push $0x6230 375a: 6a 01 push $0x1 375c: e8 9f 12 00 00 call 4a00 <printf> exit(); 3761: e8 3c 11 00 00 call 48a2 <exit> exit(); } close(fd); if(mkdir("12345678901234/12345678901234") == 0){ printf(1, "mkdir 12345678901234/12345678901234 succeeded!\n"); 3766: 52 push %edx 3767: 52 push %edx 3768: 68 e0 61 00 00 push $0x61e0 376d: 6a 01 push $0x1 376f: e8 8c 12 00 00 call 4a00 <printf> exit(); 3774: e8 29 11 00 00 call 48a2 <exit> exit(); } close(fd); fd = open("12345678901234/12345678901234/12345678901234", 0); if(fd < 0){ printf(1, "open 12345678901234/12345678901234/12345678901234 failed\n"); 3779: 51 push %ecx 377a: 51 push %ecx 377b: 68 a4 61 00 00 push $0x61a4 3780: 6a 01 push $0x1 3782: e8 79 12 00 00 call 4a00 <printf> exit(); 3787: e8 16 11 00 00 call 48a2 <exit> printf(1, "mkdir 12345678901234/123456789012345 failed\n"); exit(); } fd = open("123456789012345/123456789012345/123456789012345", O_CREATE); if(fd < 0){ printf(1, "create 123456789012345/123456789012345/123456789012345 failed\n"); 378c: 51 push %ecx 378d: 51 push %ecx 378e: 68 34 61 00 00 push $0x6134 3793: 6a 01 push $0x1 3795: e8 66 12 00 00 call 4a00 <printf> exit(); 379a: e8 03 11 00 00 call 48a2 <exit> if(mkdir("12345678901234") != 0){ printf(1, "mkdir 12345678901234 failed\n"); exit(); } if(mkdir("12345678901234/123456789012345") != 0){ printf(1, "mkdir 12345678901234/123456789012345 failed\n"); 379f: 50 push %eax 37a0: 50 push %eax 37a1: 68 d4 60 00 00 push $0x60d4 37a6: 6a 01 push $0x1 37a8: e8 53 12 00 00 call 4a00 <printf> exit(); 37ad: e8 f0 10 00 00 call 48a2 <exit> 37b2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 37b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000037c0 <rmdot>: printf(1, "fourteen ok\n"); } void rmdot(void) { 37c0: 55 push %ebp 37c1: 89 e5 mov %esp,%ebp 37c3: 83 ec 10 sub $0x10,%esp printf(1, "rmdot test\n"); 37c6: 68 13 59 00 00 push $0x5913 37cb: 6a 01 push $0x1 37cd: e8 2e 12 00 00 call 4a00 <printf> if(mkdir("dots") != 0){ 37d2: c7 04 24 1f 59 00 00 movl $0x591f,(%esp) 37d9: e8 2c 11 00 00 call 490a <mkdir> 37de: 83 c4 10 add $0x10,%esp 37e1: 85 c0 test %eax,%eax 37e3: 0f 85 b0 00 00 00 jne 3899 <rmdot+0xd9> printf(1, "mkdir dots failed\n"); exit(); } if(chdir("dots") != 0){ 37e9: 83 ec 0c sub $0xc,%esp 37ec: 68 1f 59 00 00 push $0x591f 37f1: e8 1c 11 00 00 call 4912 <chdir> 37f6: 83 c4 10 add $0x10,%esp 37f9: 85 c0 test %eax,%eax 37fb: 0f 85 1d 01 00 00 jne 391e <rmdot+0x15e> printf(1, "chdir dots failed\n"); exit(); } if(unlink(".") == 0){ 3801: 83 ec 0c sub $0xc,%esp 3804: 68 ca 55 00 00 push $0x55ca 3809: e8 e4 10 00 00 call 48f2 <unlink> 380e: 83 c4 10 add $0x10,%esp 3811: 85 c0 test %eax,%eax 3813: 0f 84 f2 00 00 00 je 390b <rmdot+0x14b> printf(1, "rm . worked!\n"); exit(); } if(unlink("..") == 0){ 3819: 83 ec 0c sub $0xc,%esp 381c: 68 c9 55 00 00 push $0x55c9 3821: e8 cc 10 00 00 call 48f2 <unlink> 3826: 83 c4 10 add $0x10,%esp 3829: 85 c0 test %eax,%eax 382b: 0f 84 c7 00 00 00 je 38f8 <rmdot+0x138> printf(1, "rm .. worked!\n"); exit(); } if(chdir("/") != 0){ 3831: 83 ec 0c sub $0xc,%esp 3834: 68 9d 4d 00 00 push $0x4d9d 3839: e8 d4 10 00 00 call 4912 <chdir> 383e: 83 c4 10 add $0x10,%esp 3841: 85 c0 test %eax,%eax 3843: 0f 85 9c 00 00 00 jne 38e5 <rmdot+0x125> printf(1, "chdir / failed\n"); exit(); } if(unlink("dots/.") == 0){ 3849: 83 ec 0c sub $0xc,%esp 384c: 68 67 59 00 00 push $0x5967 3851: e8 9c 10 00 00 call 48f2 <unlink> 3856: 83 c4 10 add $0x10,%esp 3859: 85 c0 test %eax,%eax 385b: 74 75 je 38d2 <rmdot+0x112> printf(1, "unlink dots/. worked!\n"); exit(); } if(unlink("dots/..") == 0){ 385d: 83 ec 0c sub $0xc,%esp 3860: 68 85 59 00 00 push $0x5985 3865: e8 88 10 00 00 call 48f2 <unlink> 386a: 83 c4 10 add $0x10,%esp 386d: 85 c0 test %eax,%eax 386f: 74 4e je 38bf <rmdot+0xff> printf(1, "unlink dots/.. worked!\n"); exit(); } if(unlink("dots") != 0){ 3871: 83 ec 0c sub $0xc,%esp 3874: 68 1f 59 00 00 push $0x591f 3879: e8 74 10 00 00 call 48f2 <unlink> 387e: 83 c4 10 add $0x10,%esp 3881: 85 c0 test %eax,%eax 3883: 75 27 jne 38ac <rmdot+0xec> printf(1, "unlink dots failed!\n"); exit(); } printf(1, "rmdot ok\n"); 3885: 83 ec 08 sub $0x8,%esp 3888: 68 ba 59 00 00 push $0x59ba 388d: 6a 01 push $0x1 388f: e8 6c 11 00 00 call 4a00 <printf> } 3894: 83 c4 10 add $0x10,%esp 3897: c9 leave 3898: c3 ret void rmdot(void) { printf(1, "rmdot test\n"); if(mkdir("dots") != 0){ printf(1, "mkdir dots failed\n"); 3899: 50 push %eax 389a: 50 push %eax 389b: 68 24 59 00 00 push $0x5924 38a0: 6a 01 push $0x1 38a2: e8 59 11 00 00 call 4a00 <printf> exit(); 38a7: e8 f6 0f 00 00 call 48a2 <exit> if(unlink("dots/..") == 0){ printf(1, "unlink dots/.. worked!\n"); exit(); } if(unlink("dots") != 0){ printf(1, "unlink dots failed!\n"); 38ac: 50 push %eax 38ad: 50 push %eax 38ae: 68 a5 59 00 00 push $0x59a5 38b3: 6a 01 push $0x1 38b5: e8 46 11 00 00 call 4a00 <printf> exit(); 38ba: e8 e3 0f 00 00 call 48a2 <exit> if(unlink("dots/.") == 0){ printf(1, "unlink dots/. worked!\n"); exit(); } if(unlink("dots/..") == 0){ printf(1, "unlink dots/.. worked!\n"); 38bf: 52 push %edx 38c0: 52 push %edx 38c1: 68 8d 59 00 00 push $0x598d 38c6: 6a 01 push $0x1 38c8: e8 33 11 00 00 call 4a00 <printf> exit(); 38cd: e8 d0 0f 00 00 call 48a2 <exit> if(chdir("/") != 0){ printf(1, "chdir / failed\n"); exit(); } if(unlink("dots/.") == 0){ printf(1, "unlink dots/. worked!\n"); 38d2: 51 push %ecx 38d3: 51 push %ecx 38d4: 68 6e 59 00 00 push $0x596e 38d9: 6a 01 push $0x1 38db: e8 20 11 00 00 call 4a00 <printf> exit(); 38e0: e8 bd 0f 00 00 call 48a2 <exit> if(unlink("..") == 0){ printf(1, "rm .. worked!\n"); exit(); } if(chdir("/") != 0){ printf(1, "chdir / failed\n"); 38e5: 50 push %eax 38e6: 50 push %eax 38e7: 68 9f 4d 00 00 push $0x4d9f 38ec: 6a 01 push $0x1 38ee: e8 0d 11 00 00 call 4a00 <printf> exit(); 38f3: e8 aa 0f 00 00 call 48a2 <exit> if(unlink(".") == 0){ printf(1, "rm . worked!\n"); exit(); } if(unlink("..") == 0){ printf(1, "rm .. worked!\n"); 38f8: 50 push %eax 38f9: 50 push %eax 38fa: 68 58 59 00 00 push $0x5958 38ff: 6a 01 push $0x1 3901: e8 fa 10 00 00 call 4a00 <printf> exit(); 3906: e8 97 0f 00 00 call 48a2 <exit> if(chdir("dots") != 0){ printf(1, "chdir dots failed\n"); exit(); } if(unlink(".") == 0){ printf(1, "rm . worked!\n"); 390b: 50 push %eax 390c: 50 push %eax 390d: 68 4a 59 00 00 push $0x594a 3912: 6a 01 push $0x1 3914: e8 e7 10 00 00 call 4a00 <printf> exit(); 3919: e8 84 0f 00 00 call 48a2 <exit> if(mkdir("dots") != 0){ printf(1, "mkdir dots failed\n"); exit(); } if(chdir("dots") != 0){ printf(1, "chdir dots failed\n"); 391e: 50 push %eax 391f: 50 push %eax 3920: 68 37 59 00 00 push $0x5937 3925: 6a 01 push $0x1 3927: e8 d4 10 00 00 call 4a00 <printf> exit(); 392c: e8 71 0f 00 00 call 48a2 <exit> 3931: eb 0d jmp 3940 <dirfile> 3933: 90 nop 3934: 90 nop 3935: 90 nop 3936: 90 nop 3937: 90 nop 3938: 90 nop 3939: 90 nop 393a: 90 nop 393b: 90 nop 393c: 90 nop 393d: 90 nop 393e: 90 nop 393f: 90 nop 00003940 <dirfile>: printf(1, "rmdot ok\n"); } void dirfile(void) { 3940: 55 push %ebp 3941: 89 e5 mov %esp,%ebp 3943: 53 push %ebx 3944: 83 ec 0c sub $0xc,%esp int fd; printf(1, "dir vs file\n"); 3947: 68 c4 59 00 00 push $0x59c4 394c: 6a 01 push $0x1 394e: e8 ad 10 00 00 call 4a00 <printf> fd = open("dirfile", O_CREATE); 3953: 59 pop %ecx 3954: 5b pop %ebx 3955: 68 00 02 00 00 push $0x200 395a: 68 d1 59 00 00 push $0x59d1 395f: e8 7e 0f 00 00 call 48e2 <open> if(fd < 0){ 3964: 83 c4 10 add $0x10,%esp 3967: 85 c0 test %eax,%eax 3969: 0f 88 43 01 00 00 js 3ab2 <dirfile+0x172> printf(1, "create dirfile failed\n"); exit(); } close(fd); 396f: 83 ec 0c sub $0xc,%esp 3972: 50 push %eax 3973: e8 52 0f 00 00 call 48ca <close> if(chdir("dirfile") == 0){ 3978: c7 04 24 d1 59 00 00 movl $0x59d1,(%esp) 397f: e8 8e 0f 00 00 call 4912 <chdir> 3984: 83 c4 10 add $0x10,%esp 3987: 85 c0 test %eax,%eax 3989: 0f 84 10 01 00 00 je 3a9f <dirfile+0x15f> printf(1, "chdir dirfile succeeded!\n"); exit(); } fd = open("dirfile/xx", 0); 398f: 83 ec 08 sub $0x8,%esp 3992: 6a 00 push $0x0 3994: 68 0a 5a 00 00 push $0x5a0a 3999: e8 44 0f 00 00 call 48e2 <open> if(fd >= 0){ 399e: 83 c4 10 add $0x10,%esp 39a1: 85 c0 test %eax,%eax 39a3: 0f 89 e3 00 00 00 jns 3a8c <dirfile+0x14c> printf(1, "create dirfile/xx succeeded!\n"); exit(); } fd = open("dirfile/xx", O_CREATE); 39a9: 83 ec 08 sub $0x8,%esp 39ac: 68 00 02 00 00 push $0x200 39b1: 68 0a 5a 00 00 push $0x5a0a 39b6: e8 27 0f 00 00 call 48e2 <open> if(fd >= 0){ 39bb: 83 c4 10 add $0x10,%esp 39be: 85 c0 test %eax,%eax 39c0: 0f 89 c6 00 00 00 jns 3a8c <dirfile+0x14c> printf(1, "create dirfile/xx succeeded!\n"); exit(); } if(mkdir("dirfile/xx") == 0){ 39c6: 83 ec 0c sub $0xc,%esp 39c9: 68 0a 5a 00 00 push $0x5a0a 39ce: e8 37 0f 00 00 call 490a <mkdir> 39d3: 83 c4 10 add $0x10,%esp 39d6: 85 c0 test %eax,%eax 39d8: 0f 84 46 01 00 00 je 3b24 <dirfile+0x1e4> printf(1, "mkdir dirfile/xx succeeded!\n"); exit(); } if(unlink("dirfile/xx") == 0){ 39de: 83 ec 0c sub $0xc,%esp 39e1: 68 0a 5a 00 00 push $0x5a0a 39e6: e8 07 0f 00 00 call 48f2 <unlink> 39eb: 83 c4 10 add $0x10,%esp 39ee: 85 c0 test %eax,%eax 39f0: 0f 84 1b 01 00 00 je 3b11 <dirfile+0x1d1> printf(1, "unlink dirfile/xx succeeded!\n"); exit(); } if(link("README", "dirfile/xx") == 0){ 39f6: 83 ec 08 sub $0x8,%esp 39f9: 68 0a 5a 00 00 push $0x5a0a 39fe: 68 6e 5a 00 00 push $0x5a6e 3a03: e8 fa 0e 00 00 call 4902 <link> 3a08: 83 c4 10 add $0x10,%esp 3a0b: 85 c0 test %eax,%eax 3a0d: 0f 84 eb 00 00 00 je 3afe <dirfile+0x1be> printf(1, "link to dirfile/xx succeeded!\n"); exit(); } if(unlink("dirfile") != 0){ 3a13: 83 ec 0c sub $0xc,%esp 3a16: 68 d1 59 00 00 push $0x59d1 3a1b: e8 d2 0e 00 00 call 48f2 <unlink> 3a20: 83 c4 10 add $0x10,%esp 3a23: 85 c0 test %eax,%eax 3a25: 0f 85 c0 00 00 00 jne 3aeb <dirfile+0x1ab> printf(1, "unlink dirfile failed!\n"); exit(); } fd = open(".", O_RDWR); 3a2b: 83 ec 08 sub $0x8,%esp 3a2e: 6a 02 push $0x2 3a30: 68 ca 55 00 00 push $0x55ca 3a35: e8 a8 0e 00 00 call 48e2 <open> if(fd >= 0){ 3a3a: 83 c4 10 add $0x10,%esp 3a3d: 85 c0 test %eax,%eax 3a3f: 0f 89 93 00 00 00 jns 3ad8 <dirfile+0x198> printf(1, "open . for writing succeeded!\n"); exit(); } fd = open(".", 0); 3a45: 83 ec 08 sub $0x8,%esp 3a48: 6a 00 push $0x0 3a4a: 68 ca 55 00 00 push $0x55ca 3a4f: e8 8e 0e 00 00 call 48e2 <open> if(write(fd, "x", 1) > 0){ 3a54: 83 c4 0c add $0xc,%esp fd = open(".", O_RDWR); if(fd >= 0){ printf(1, "open . for writing succeeded!\n"); exit(); } fd = open(".", 0); 3a57: 89 c3 mov %eax,%ebx if(write(fd, "x", 1) > 0){ 3a59: 6a 01 push $0x1 3a5b: 68 ad 56 00 00 push $0x56ad 3a60: 50 push %eax 3a61: e8 5c 0e 00 00 call 48c2 <write> 3a66: 83 c4 10 add $0x10,%esp 3a69: 85 c0 test %eax,%eax 3a6b: 7f 58 jg 3ac5 <dirfile+0x185> printf(1, "write . succeeded!\n"); exit(); } close(fd); 3a6d: 83 ec 0c sub $0xc,%esp 3a70: 53 push %ebx 3a71: e8 54 0e 00 00 call 48ca <close> printf(1, "dir vs file OK\n"); 3a76: 58 pop %eax 3a77: 5a pop %edx 3a78: 68 a1 5a 00 00 push $0x5aa1 3a7d: 6a 01 push $0x1 3a7f: e8 7c 0f 00 00 call 4a00 <printf> } 3a84: 83 c4 10 add $0x10,%esp 3a87: 8b 5d fc mov -0x4(%ebp),%ebx 3a8a: c9 leave 3a8b: c3 ret printf(1, "chdir dirfile succeeded!\n"); exit(); } fd = open("dirfile/xx", 0); if(fd >= 0){ printf(1, "create dirfile/xx succeeded!\n"); 3a8c: 50 push %eax 3a8d: 50 push %eax 3a8e: 68 15 5a 00 00 push $0x5a15 3a93: 6a 01 push $0x1 3a95: e8 66 0f 00 00 call 4a00 <printf> exit(); 3a9a: e8 03 0e 00 00 call 48a2 <exit> printf(1, "create dirfile failed\n"); exit(); } close(fd); if(chdir("dirfile") == 0){ printf(1, "chdir dirfile succeeded!\n"); 3a9f: 50 push %eax 3aa0: 50 push %eax 3aa1: 68 f0 59 00 00 push $0x59f0 3aa6: 6a 01 push $0x1 3aa8: e8 53 0f 00 00 call 4a00 <printf> exit(); 3aad: e8 f0 0d 00 00 call 48a2 <exit> printf(1, "dir vs file\n"); fd = open("dirfile", O_CREATE); if(fd < 0){ printf(1, "create dirfile failed\n"); 3ab2: 52 push %edx 3ab3: 52 push %edx 3ab4: 68 d9 59 00 00 push $0x59d9 3ab9: 6a 01 push $0x1 3abb: e8 40 0f 00 00 call 4a00 <printf> exit(); 3ac0: e8 dd 0d 00 00 call 48a2 <exit> printf(1, "open . for writing succeeded!\n"); exit(); } fd = open(".", 0); if(write(fd, "x", 1) > 0){ printf(1, "write . succeeded!\n"); 3ac5: 51 push %ecx 3ac6: 51 push %ecx 3ac7: 68 8d 5a 00 00 push $0x5a8d 3acc: 6a 01 push $0x1 3ace: e8 2d 0f 00 00 call 4a00 <printf> exit(); 3ad3: e8 ca 0d 00 00 call 48a2 <exit> exit(); } fd = open(".", O_RDWR); if(fd >= 0){ printf(1, "open . for writing succeeded!\n"); 3ad8: 53 push %ebx 3ad9: 53 push %ebx 3ada: 68 84 62 00 00 push $0x6284 3adf: 6a 01 push $0x1 3ae1: e8 1a 0f 00 00 call 4a00 <printf> exit(); 3ae6: e8 b7 0d 00 00 call 48a2 <exit> if(link("README", "dirfile/xx") == 0){ printf(1, "link to dirfile/xx succeeded!\n"); exit(); } if(unlink("dirfile") != 0){ printf(1, "unlink dirfile failed!\n"); 3aeb: 50 push %eax 3aec: 50 push %eax 3aed: 68 75 5a 00 00 push $0x5a75 3af2: 6a 01 push $0x1 3af4: e8 07 0f 00 00 call 4a00 <printf> exit(); 3af9: e8 a4 0d 00 00 call 48a2 <exit> if(unlink("dirfile/xx") == 0){ printf(1, "unlink dirfile/xx succeeded!\n"); exit(); } if(link("README", "dirfile/xx") == 0){ printf(1, "link to dirfile/xx succeeded!\n"); 3afe: 50 push %eax 3aff: 50 push %eax 3b00: 68 64 62 00 00 push $0x6264 3b05: 6a 01 push $0x1 3b07: e8 f4 0e 00 00 call 4a00 <printf> exit(); 3b0c: e8 91 0d 00 00 call 48a2 <exit> if(mkdir("dirfile/xx") == 0){ printf(1, "mkdir dirfile/xx succeeded!\n"); exit(); } if(unlink("dirfile/xx") == 0){ printf(1, "unlink dirfile/xx succeeded!\n"); 3b11: 50 push %eax 3b12: 50 push %eax 3b13: 68 50 5a 00 00 push $0x5a50 3b18: 6a 01 push $0x1 3b1a: e8 e1 0e 00 00 call 4a00 <printf> exit(); 3b1f: e8 7e 0d 00 00 call 48a2 <exit> if(fd >= 0){ printf(1, "create dirfile/xx succeeded!\n"); exit(); } if(mkdir("dirfile/xx") == 0){ printf(1, "mkdir dirfile/xx succeeded!\n"); 3b24: 50 push %eax 3b25: 50 push %eax 3b26: 68 33 5a 00 00 push $0x5a33 3b2b: 6a 01 push $0x1 3b2d: e8 ce 0e 00 00 call 4a00 <printf> exit(); 3b32: e8 6b 0d 00 00 call 48a2 <exit> 3b37: 89 f6 mov %esi,%esi 3b39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00003b40 <iref>: } // test that iput() is called at the end of _namei() void iref(void) { 3b40: 55 push %ebp 3b41: 89 e5 mov %esp,%ebp 3b43: 53 push %ebx int i, fd; printf(1, "empty file name\n"); 3b44: bb 33 00 00 00 mov $0x33,%ebx } // test that iput() is called at the end of _namei() void iref(void) { 3b49: 83 ec 0c sub $0xc,%esp int i, fd; printf(1, "empty file name\n"); 3b4c: 68 b1 5a 00 00 push $0x5ab1 3b51: 6a 01 push $0x1 3b53: e8 a8 0e 00 00 call 4a00 <printf> 3b58: 83 c4 10 add $0x10,%esp 3b5b: 90 nop 3b5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi // the 50 is NINODE for(i = 0; i < 50 + 1; i++){ if(mkdir("irefd") != 0){ 3b60: 83 ec 0c sub $0xc,%esp 3b63: 68 c2 5a 00 00 push $0x5ac2 3b68: e8 9d 0d 00 00 call 490a <mkdir> 3b6d: 83 c4 10 add $0x10,%esp 3b70: 85 c0 test %eax,%eax 3b72: 0f 85 bb 00 00 00 jne 3c33 <iref+0xf3> printf(1, "mkdir irefd failed\n"); exit(); } if(chdir("irefd") != 0){ 3b78: 83 ec 0c sub $0xc,%esp 3b7b: 68 c2 5a 00 00 push $0x5ac2 3b80: e8 8d 0d 00 00 call 4912 <chdir> 3b85: 83 c4 10 add $0x10,%esp 3b88: 85 c0 test %eax,%eax 3b8a: 0f 85 b7 00 00 00 jne 3c47 <iref+0x107> printf(1, "chdir irefd failed\n"); exit(); } mkdir(""); 3b90: 83 ec 0c sub $0xc,%esp 3b93: 68 77 51 00 00 push $0x5177 3b98: e8 6d 0d 00 00 call 490a <mkdir> link("README", ""); 3b9d: 59 pop %ecx 3b9e: 58 pop %eax 3b9f: 68 77 51 00 00 push $0x5177 3ba4: 68 6e 5a 00 00 push $0x5a6e 3ba9: e8 54 0d 00 00 call 4902 <link> fd = open("", O_CREATE); 3bae: 58 pop %eax 3baf: 5a pop %edx 3bb0: 68 00 02 00 00 push $0x200 3bb5: 68 77 51 00 00 push $0x5177 3bba: e8 23 0d 00 00 call 48e2 <open> if(fd >= 0) 3bbf: 83 c4 10 add $0x10,%esp 3bc2: 85 c0 test %eax,%eax 3bc4: 78 0c js 3bd2 <iref+0x92> close(fd); 3bc6: 83 ec 0c sub $0xc,%esp 3bc9: 50 push %eax 3bca: e8 fb 0c 00 00 call 48ca <close> 3bcf: 83 c4 10 add $0x10,%esp fd = open("xx", O_CREATE); 3bd2: 83 ec 08 sub $0x8,%esp 3bd5: 68 00 02 00 00 push $0x200 3bda: 68 ac 56 00 00 push $0x56ac 3bdf: e8 fe 0c 00 00 call 48e2 <open> if(fd >= 0) 3be4: 83 c4 10 add $0x10,%esp 3be7: 85 c0 test %eax,%eax 3be9: 78 0c js 3bf7 <iref+0xb7> close(fd); 3beb: 83 ec 0c sub $0xc,%esp 3bee: 50 push %eax 3bef: e8 d6 0c 00 00 call 48ca <close> 3bf4: 83 c4 10 add $0x10,%esp unlink("xx"); 3bf7: 83 ec 0c sub $0xc,%esp 3bfa: 68 ac 56 00 00 push $0x56ac 3bff: e8 ee 0c 00 00 call 48f2 <unlink> int i, fd; printf(1, "empty file name\n"); // the 50 is NINODE for(i = 0; i < 50 + 1; i++){ 3c04: 83 c4 10 add $0x10,%esp 3c07: 83 eb 01 sub $0x1,%ebx 3c0a: 0f 85 50 ff ff ff jne 3b60 <iref+0x20> if(fd >= 0) close(fd); unlink("xx"); } chdir("/"); 3c10: 83 ec 0c sub $0xc,%esp 3c13: 68 9d 4d 00 00 push $0x4d9d 3c18: e8 f5 0c 00 00 call 4912 <chdir> printf(1, "empty file name OK\n"); 3c1d: 58 pop %eax 3c1e: 5a pop %edx 3c1f: 68 f0 5a 00 00 push $0x5af0 3c24: 6a 01 push $0x1 3c26: e8 d5 0d 00 00 call 4a00 <printf> } 3c2b: 83 c4 10 add $0x10,%esp 3c2e: 8b 5d fc mov -0x4(%ebp),%ebx 3c31: c9 leave 3c32: c3 ret printf(1, "empty file name\n"); // the 50 is NINODE for(i = 0; i < 50 + 1; i++){ if(mkdir("irefd") != 0){ printf(1, "mkdir irefd failed\n"); 3c33: 83 ec 08 sub $0x8,%esp 3c36: 68 c8 5a 00 00 push $0x5ac8 3c3b: 6a 01 push $0x1 3c3d: e8 be 0d 00 00 call 4a00 <printf> exit(); 3c42: e8 5b 0c 00 00 call 48a2 <exit> } if(chdir("irefd") != 0){ printf(1, "chdir irefd failed\n"); 3c47: 83 ec 08 sub $0x8,%esp 3c4a: 68 dc 5a 00 00 push $0x5adc 3c4f: 6a 01 push $0x1 3c51: e8 aa 0d 00 00 call 4a00 <printf> exit(); 3c56: e8 47 0c 00 00 call 48a2 <exit> 3c5b: 90 nop 3c5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00003c60 <forktest>: // test that fork fails gracefully // the forktest binary also does this, but it runs out of proc entries first. // inside the bigger usertests binary, we run out of memory first. void forktest(void) { 3c60: 55 push %ebp 3c61: 89 e5 mov %esp,%ebp 3c63: 53 push %ebx int n, pid; printf(1, "fork test\n"); for(n=0; n<1000; n++){ 3c64: 31 db xor %ebx,%ebx // test that fork fails gracefully // the forktest binary also does this, but it runs out of proc entries first. // inside the bigger usertests binary, we run out of memory first. void forktest(void) { 3c66: 83 ec 0c sub $0xc,%esp int n, pid; printf(1, "fork test\n"); 3c69: 68 04 5b 00 00 push $0x5b04 3c6e: 6a 01 push $0x1 3c70: e8 8b 0d 00 00 call 4a00 <printf> 3c75: 83 c4 10 add $0x10,%esp 3c78: eb 13 jmp 3c8d <forktest+0x2d> 3c7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(n=0; n<1000; n++){ pid = fork(); if(pid < 0) break; if(pid == 0) 3c80: 74 62 je 3ce4 <forktest+0x84> { int n, pid; printf(1, "fork test\n"); for(n=0; n<1000; n++){ 3c82: 83 c3 01 add $0x1,%ebx 3c85: 81 fb e8 03 00 00 cmp $0x3e8,%ebx 3c8b: 74 43 je 3cd0 <forktest+0x70> pid = fork(); 3c8d: e8 08 0c 00 00 call 489a <fork> if(pid < 0) 3c92: 85 c0 test %eax,%eax 3c94: 79 ea jns 3c80 <forktest+0x20> if(n == 1000){ printf(1, "fork claimed to work 1000 times!\n"); exit(); } for(; n > 0; n--){ 3c96: 85 db test %ebx,%ebx 3c98: 74 14 je 3cae <forktest+0x4e> 3c9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(wait() < 0){ 3ca0: e8 05 0c 00 00 call 48aa <wait> 3ca5: 85 c0 test %eax,%eax 3ca7: 78 40 js 3ce9 <forktest+0x89> if(n == 1000){ printf(1, "fork claimed to work 1000 times!\n"); exit(); } for(; n > 0; n--){ 3ca9: 83 eb 01 sub $0x1,%ebx 3cac: 75 f2 jne 3ca0 <forktest+0x40> printf(1, "wait stopped early\n"); exit(); } } if(wait() != -1){ 3cae: e8 f7 0b 00 00 call 48aa <wait> 3cb3: 83 f8 ff cmp $0xffffffff,%eax 3cb6: 75 45 jne 3cfd <forktest+0x9d> printf(1, "wait got too many\n"); exit(); } printf(1, "fork test OK\n"); 3cb8: 83 ec 08 sub $0x8,%esp 3cbb: 68 36 5b 00 00 push $0x5b36 3cc0: 6a 01 push $0x1 3cc2: e8 39 0d 00 00 call 4a00 <printf> } 3cc7: 8b 5d fc mov -0x4(%ebp),%ebx 3cca: c9 leave 3ccb: c3 ret 3ccc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(pid == 0) exit(); } if(n == 1000){ printf(1, "fork claimed to work 1000 times!\n"); 3cd0: 83 ec 08 sub $0x8,%esp 3cd3: 68 a4 62 00 00 push $0x62a4 3cd8: 6a 01 push $0x1 3cda: e8 21 0d 00 00 call 4a00 <printf> exit(); 3cdf: e8 be 0b 00 00 call 48a2 <exit> for(n=0; n<1000; n++){ pid = fork(); if(pid < 0) break; if(pid == 0) exit(); 3ce4: e8 b9 0b 00 00 call 48a2 <exit> exit(); } for(; n > 0; n--){ if(wait() < 0){ printf(1, "wait stopped early\n"); 3ce9: 83 ec 08 sub $0x8,%esp 3cec: 68 0f 5b 00 00 push $0x5b0f 3cf1: 6a 01 push $0x1 3cf3: e8 08 0d 00 00 call 4a00 <printf> exit(); 3cf8: e8 a5 0b 00 00 call 48a2 <exit> } } if(wait() != -1){ printf(1, "wait got too many\n"); 3cfd: 83 ec 08 sub $0x8,%esp 3d00: 68 23 5b 00 00 push $0x5b23 3d05: 6a 01 push $0x1 3d07: e8 f4 0c 00 00 call 4a00 <printf> exit(); 3d0c: e8 91 0b 00 00 call 48a2 <exit> 3d11: eb 0d jmp 3d20 <sbrktest> 3d13: 90 nop 3d14: 90 nop 3d15: 90 nop 3d16: 90 nop 3d17: 90 nop 3d18: 90 nop 3d19: 90 nop 3d1a: 90 nop 3d1b: 90 nop 3d1c: 90 nop 3d1d: 90 nop 3d1e: 90 nop 3d1f: 90 nop 00003d20 <sbrktest>: printf(1, "fork test OK\n"); } void sbrktest(void) { 3d20: 55 push %ebp 3d21: 89 e5 mov %esp,%ebp 3d23: 57 push %edi 3d24: 56 push %esi 3d25: 53 push %ebx oldbrk = sbrk(0); // can one sbrk() less than a page? a = sbrk(0); int i; for(i = 0; i < 5000; i++){ 3d26: 31 ff xor %edi,%edi printf(1, "fork test OK\n"); } void sbrktest(void) { 3d28: 83 ec 64 sub $0x64,%esp int fds[2], pid, pids[10], ppid; char *a, *b, *c, *lastaddr, *oldbrk, *p, scratch; uint amt; printf(stdout, "sbrk test\n"); 3d2b: 68 44 5b 00 00 push $0x5b44 3d30: ff 35 28 6e 00 00 pushl 0x6e28 3d36: e8 c5 0c 00 00 call 4a00 <printf> oldbrk = sbrk(0); 3d3b: c7 04 24 00 00 00 00 movl $0x0,(%esp) 3d42: e8 e3 0b 00 00 call 492a <sbrk> // can one sbrk() less than a page? a = sbrk(0); 3d47: c7 04 24 00 00 00 00 movl $0x0,(%esp) int fds[2], pid, pids[10], ppid; char *a, *b, *c, *lastaddr, *oldbrk, *p, scratch; uint amt; printf(stdout, "sbrk test\n"); oldbrk = sbrk(0); 3d4e: 89 45 a4 mov %eax,-0x5c(%ebp) // can one sbrk() less than a page? a = sbrk(0); 3d51: e8 d4 0b 00 00 call 492a <sbrk> 3d56: 83 c4 10 add $0x10,%esp 3d59: 89 c3 mov %eax,%ebx 3d5b: 90 nop 3d5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int i; for(i = 0; i < 5000; i++){ b = sbrk(1); 3d60: 83 ec 0c sub $0xc,%esp 3d63: 6a 01 push $0x1 3d65: e8 c0 0b 00 00 call 492a <sbrk> if(b != a){ 3d6a: 83 c4 10 add $0x10,%esp 3d6d: 39 d8 cmp %ebx,%eax 3d6f: 0f 85 85 02 00 00 jne 3ffa <sbrktest+0x2da> oldbrk = sbrk(0); // can one sbrk() less than a page? a = sbrk(0); int i; for(i = 0; i < 5000; i++){ 3d75: 83 c7 01 add $0x1,%edi b = sbrk(1); if(b != a){ printf(stdout, "sbrk test failed %d %x %x\n", i, a, b); exit(); } *b = 1; 3d78: c6 03 01 movb $0x1,(%ebx) a = b + 1; 3d7b: 83 c3 01 add $0x1,%ebx oldbrk = sbrk(0); // can one sbrk() less than a page? a = sbrk(0); int i; for(i = 0; i < 5000; i++){ 3d7e: 81 ff 88 13 00 00 cmp $0x1388,%edi 3d84: 75 da jne 3d60 <sbrktest+0x40> exit(); } *b = 1; a = b + 1; } pid = fork(); 3d86: e8 0f 0b 00 00 call 489a <fork> if(pid < 0){ 3d8b: 85 c0 test %eax,%eax exit(); } *b = 1; a = b + 1; } pid = fork(); 3d8d: 89 c7 mov %eax,%edi if(pid < 0){ 3d8f: 0f 88 93 03 00 00 js 4128 <sbrktest+0x408> printf(stdout, "sbrk test fork failed\n"); exit(); } c = sbrk(1); 3d95: 83 ec 0c sub $0xc,%esp c = sbrk(1); if(c != a + 1){ 3d98: 83 c3 01 add $0x1,%ebx pid = fork(); if(pid < 0){ printf(stdout, "sbrk test fork failed\n"); exit(); } c = sbrk(1); 3d9b: 6a 01 push $0x1 3d9d: e8 88 0b 00 00 call 492a <sbrk> c = sbrk(1); 3da2: c7 04 24 01 00 00 00 movl $0x1,(%esp) 3da9: e8 7c 0b 00 00 call 492a <sbrk> if(c != a + 1){ 3dae: 83 c4 10 add $0x10,%esp 3db1: 39 d8 cmp %ebx,%eax 3db3: 0f 85 57 03 00 00 jne 4110 <sbrktest+0x3f0> printf(stdout, "sbrk test failed post-fork\n"); exit(); } if(pid == 0) 3db9: 85 ff test %edi,%edi 3dbb: 0f 84 4a 03 00 00 je 410b <sbrktest+0x3eb> exit(); wait(); 3dc1: e8 e4 0a 00 00 call 48aa <wait> // can one grow address space to something big? #define BIG (100*1024*1024) a = sbrk(0); 3dc6: 83 ec 0c sub $0xc,%esp 3dc9: 6a 00 push $0x0 3dcb: e8 5a 0b 00 00 call 492a <sbrk> 3dd0: 89 c3 mov %eax,%ebx amt = (BIG) - (uint)a; p = sbrk(amt); 3dd2: b8 00 00 40 06 mov $0x6400000,%eax 3dd7: 29 d8 sub %ebx,%eax 3dd9: 89 04 24 mov %eax,(%esp) 3ddc: e8 49 0b 00 00 call 492a <sbrk> if (p != a) { 3de1: 83 c4 10 add $0x10,%esp 3de4: 39 c3 cmp %eax,%ebx 3de6: 0f 85 07 03 00 00 jne 40f3 <sbrktest+0x3d3> } lastaddr = (char*) (BIG-1); *lastaddr = 99; // can one de-allocate? a = sbrk(0); 3dec: 83 ec 0c sub $0xc,%esp if (p != a) { printf(stdout, "sbrk test failed to grow big address space; enough phys mem?\n"); exit(); } lastaddr = (char*) (BIG-1); *lastaddr = 99; 3def: c6 05 ff ff 3f 06 63 movb $0x63,0x63fffff // can one de-allocate? a = sbrk(0); 3df6: 6a 00 push $0x0 3df8: e8 2d 0b 00 00 call 492a <sbrk> c = sbrk(-4096); 3dfd: c7 04 24 00 f0 ff ff movl $0xfffff000,(%esp) } lastaddr = (char*) (BIG-1); *lastaddr = 99; // can one de-allocate? a = sbrk(0); 3e04: 89 c3 mov %eax,%ebx c = sbrk(-4096); 3e06: e8 1f 0b 00 00 call 492a <sbrk> if(c == (char*)0xffffffff){ 3e0b: 83 c4 10 add $0x10,%esp 3e0e: 83 f8 ff cmp $0xffffffff,%eax 3e11: 0f 84 c4 02 00 00 je 40db <sbrktest+0x3bb> printf(stdout, "sbrk could not deallocate\n"); exit(); } c = sbrk(0); 3e17: 83 ec 0c sub $0xc,%esp 3e1a: 6a 00 push $0x0 3e1c: e8 09 0b 00 00 call 492a <sbrk> if(c != a - 4096){ 3e21: 8d 93 00 f0 ff ff lea -0x1000(%ebx),%edx 3e27: 83 c4 10 add $0x10,%esp 3e2a: 39 d0 cmp %edx,%eax 3e2c: 0f 85 92 02 00 00 jne 40c4 <sbrktest+0x3a4> printf(stdout, "sbrk deallocation produced wrong address, a %x c %x\n", a, c); exit(); } // can one re-allocate that page? a = sbrk(0); 3e32: 83 ec 0c sub $0xc,%esp 3e35: 6a 00 push $0x0 3e37: e8 ee 0a 00 00 call 492a <sbrk> 3e3c: 89 c3 mov %eax,%ebx c = sbrk(4096); 3e3e: c7 04 24 00 10 00 00 movl $0x1000,(%esp) 3e45: e8 e0 0a 00 00 call 492a <sbrk> if(c != a || sbrk(0) != a + 4096){ 3e4a: 83 c4 10 add $0x10,%esp 3e4d: 39 c3 cmp %eax,%ebx exit(); } // can one re-allocate that page? a = sbrk(0); c = sbrk(4096); 3e4f: 89 c7 mov %eax,%edi if(c != a || sbrk(0) != a + 4096){ 3e51: 0f 85 56 02 00 00 jne 40ad <sbrktest+0x38d> 3e57: 83 ec 0c sub $0xc,%esp 3e5a: 6a 00 push $0x0 3e5c: e8 c9 0a 00 00 call 492a <sbrk> 3e61: 8d 93 00 10 00 00 lea 0x1000(%ebx),%edx 3e67: 83 c4 10 add $0x10,%esp 3e6a: 39 d0 cmp %edx,%eax 3e6c: 0f 85 3b 02 00 00 jne 40ad <sbrktest+0x38d> printf(stdout, "sbrk re-allocation failed, a %x c %x\n", a, c); exit(); } if(*lastaddr == 99){ 3e72: 80 3d ff ff 3f 06 63 cmpb $0x63,0x63fffff 3e79: 0f 84 16 02 00 00 je 4095 <sbrktest+0x375> // should be zero printf(stdout, "sbrk de-allocation didn't really deallocate\n"); exit(); } a = sbrk(0); 3e7f: 83 ec 0c sub $0xc,%esp 3e82: 6a 00 push $0x0 3e84: e8 a1 0a 00 00 call 492a <sbrk> c = sbrk(-(sbrk(0) - oldbrk)); 3e89: c7 04 24 00 00 00 00 movl $0x0,(%esp) // should be zero printf(stdout, "sbrk de-allocation didn't really deallocate\n"); exit(); } a = sbrk(0); 3e90: 89 c3 mov %eax,%ebx c = sbrk(-(sbrk(0) - oldbrk)); 3e92: e8 93 0a 00 00 call 492a <sbrk> 3e97: 8b 4d a4 mov -0x5c(%ebp),%ecx 3e9a: 29 c1 sub %eax,%ecx 3e9c: 89 0c 24 mov %ecx,(%esp) 3e9f: e8 86 0a 00 00 call 492a <sbrk> if(c != a){ 3ea4: 83 c4 10 add $0x10,%esp 3ea7: 39 c3 cmp %eax,%ebx 3ea9: 0f 85 cf 01 00 00 jne 407e <sbrktest+0x35e> 3eaf: bb 00 00 00 80 mov $0x80000000,%ebx 3eb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi exit(); } // can we read the kernel's memory? for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){ ppid = getpid(); 3eb8: e8 65 0a 00 00 call 4922 <getpid> 3ebd: 89 c7 mov %eax,%edi pid = fork(); 3ebf: e8 d6 09 00 00 call 489a <fork> if(pid < 0){ 3ec4: 85 c0 test %eax,%eax 3ec6: 0f 88 9a 01 00 00 js 4066 <sbrktest+0x346> printf(stdout, "fork failed\n"); exit(); } if(pid == 0){ 3ecc: 0f 84 72 01 00 00 je 4044 <sbrktest+0x324> printf(stdout, "sbrk downsize failed, a %x c %x\n", a, c); exit(); } // can we read the kernel's memory? for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){ 3ed2: 81 c3 50 c3 00 00 add $0xc350,%ebx if(pid == 0){ printf(stdout, "oops could read %x = %x\n", a, *a); kill(ppid); exit(); } wait(); 3ed8: e8 cd 09 00 00 call 48aa <wait> printf(stdout, "sbrk downsize failed, a %x c %x\n", a, c); exit(); } // can we read the kernel's memory? for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){ 3edd: 81 fb 80 84 1e 80 cmp $0x801e8480,%ebx 3ee3: 75 d3 jne 3eb8 <sbrktest+0x198> wait(); } // if we run the system out of memory, does it clean up the last // failed allocation? if(pipe(fds) != 0){ 3ee5: 8d 45 b8 lea -0x48(%ebp),%eax 3ee8: 83 ec 0c sub $0xc,%esp 3eeb: 50 push %eax 3eec: e8 c1 09 00 00 call 48b2 <pipe> 3ef1: 83 c4 10 add $0x10,%esp 3ef4: 85 c0 test %eax,%eax 3ef6: 0f 85 34 01 00 00 jne 4030 <sbrktest+0x310> 3efc: 8d 5d c0 lea -0x40(%ebp),%ebx 3eff: 8d 7d e8 lea -0x18(%ebp),%edi 3f02: 89 de mov %ebx,%esi printf(1, "pipe() failed\n"); exit(); } for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ if((pids[i] = fork()) == 0){ 3f04: e8 91 09 00 00 call 489a <fork> 3f09: 85 c0 test %eax,%eax 3f0b: 89 06 mov %eax,(%esi) 3f0d: 0f 84 a1 00 00 00 je 3fb4 <sbrktest+0x294> sbrk(BIG - (uint)sbrk(0)); write(fds[1], "x", 1); // sit around until killed for(;;) sleep(1000); } if(pids[i] != -1) 3f13: 83 f8 ff cmp $0xffffffff,%eax 3f16: 74 14 je 3f2c <sbrktest+0x20c> read(fds[0], &scratch, 1); 3f18: 8d 45 b7 lea -0x49(%ebp),%eax 3f1b: 83 ec 04 sub $0x4,%esp 3f1e: 6a 01 push $0x1 3f20: 50 push %eax 3f21: ff 75 b8 pushl -0x48(%ebp) 3f24: e8 91 09 00 00 call 48ba <read> 3f29: 83 c4 10 add $0x10,%esp 3f2c: 83 c6 04 add $0x4,%esi // failed allocation? if(pipe(fds) != 0){ printf(1, "pipe() failed\n"); exit(); } for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ 3f2f: 39 f7 cmp %esi,%edi 3f31: 75 d1 jne 3f04 <sbrktest+0x1e4> if(pids[i] != -1) read(fds[0], &scratch, 1); } // if those failed allocations freed up the pages they did allocate, // we'll be able to allocate here c = sbrk(4096); 3f33: 83 ec 0c sub $0xc,%esp 3f36: 68 00 10 00 00 push $0x1000 3f3b: e8 ea 09 00 00 call 492a <sbrk> 3f40: 83 c4 10 add $0x10,%esp 3f43: 89 c6 mov %eax,%esi for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ if(pids[i] == -1) 3f45: 8b 03 mov (%ebx),%eax 3f47: 83 f8 ff cmp $0xffffffff,%eax 3f4a: 74 11 je 3f5d <sbrktest+0x23d> continue; kill(pids[i]); 3f4c: 83 ec 0c sub $0xc,%esp 3f4f: 50 push %eax 3f50: e8 7d 09 00 00 call 48d2 <kill> wait(); 3f55: e8 50 09 00 00 call 48aa <wait> 3f5a: 83 c4 10 add $0x10,%esp 3f5d: 83 c3 04 add $0x4,%ebx read(fds[0], &scratch, 1); } // if those failed allocations freed up the pages they did allocate, // we'll be able to allocate here c = sbrk(4096); for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ 3f60: 39 fb cmp %edi,%ebx 3f62: 75 e1 jne 3f45 <sbrktest+0x225> if(pids[i] == -1) continue; kill(pids[i]); wait(); } if(c == (char*)0xffffffff){ 3f64: 83 fe ff cmp $0xffffffff,%esi 3f67: 0f 84 ab 00 00 00 je 4018 <sbrktest+0x2f8> printf(stdout, "failed sbrk leaked memory\n"); exit(); } if(sbrk(0) > oldbrk) 3f6d: 83 ec 0c sub $0xc,%esp 3f70: 6a 00 push $0x0 3f72: e8 b3 09 00 00 call 492a <sbrk> 3f77: 83 c4 10 add $0x10,%esp 3f7a: 39 45 a4 cmp %eax,-0x5c(%ebp) 3f7d: 73 1a jae 3f99 <sbrktest+0x279> sbrk(-(sbrk(0) - oldbrk)); 3f7f: 83 ec 0c sub $0xc,%esp 3f82: 6a 00 push $0x0 3f84: e8 a1 09 00 00 call 492a <sbrk> 3f89: 8b 75 a4 mov -0x5c(%ebp),%esi 3f8c: 29 c6 sub %eax,%esi 3f8e: 89 34 24 mov %esi,(%esp) 3f91: e8 94 09 00 00 call 492a <sbrk> 3f96: 83 c4 10 add $0x10,%esp printf(stdout, "sbrk test OK\n"); 3f99: 83 ec 08 sub $0x8,%esp 3f9c: 68 ec 5b 00 00 push $0x5bec 3fa1: ff 35 28 6e 00 00 pushl 0x6e28 3fa7: e8 54 0a 00 00 call 4a00 <printf> } 3fac: 8d 65 f4 lea -0xc(%ebp),%esp 3faf: 5b pop %ebx 3fb0: 5e pop %esi 3fb1: 5f pop %edi 3fb2: 5d pop %ebp 3fb3: c3 ret exit(); } for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ if((pids[i] = fork()) == 0){ // allocate a lot of memory sbrk(BIG - (uint)sbrk(0)); 3fb4: 83 ec 0c sub $0xc,%esp 3fb7: 6a 00 push $0x0 3fb9: e8 6c 09 00 00 call 492a <sbrk> 3fbe: ba 00 00 40 06 mov $0x6400000,%edx 3fc3: 29 c2 sub %eax,%edx 3fc5: 89 14 24 mov %edx,(%esp) 3fc8: e8 5d 09 00 00 call 492a <sbrk> write(fds[1], "x", 1); 3fcd: 83 c4 0c add $0xc,%esp 3fd0: 6a 01 push $0x1 3fd2: 68 ad 56 00 00 push $0x56ad 3fd7: ff 75 bc pushl -0x44(%ebp) 3fda: e8 e3 08 00 00 call 48c2 <write> 3fdf: 83 c4 10 add $0x10,%esp 3fe2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi // sit around until killed for(;;) sleep(1000); 3fe8: 83 ec 0c sub $0xc,%esp 3feb: 68 e8 03 00 00 push $0x3e8 3ff0: e8 3d 09 00 00 call 4932 <sleep> 3ff5: 83 c4 10 add $0x10,%esp 3ff8: eb ee jmp 3fe8 <sbrktest+0x2c8> a = sbrk(0); int i; for(i = 0; i < 5000; i++){ b = sbrk(1); if(b != a){ printf(stdout, "sbrk test failed %d %x %x\n", i, a, b); 3ffa: 83 ec 0c sub $0xc,%esp 3ffd: 50 push %eax 3ffe: 53 push %ebx 3fff: 57 push %edi 4000: 68 4f 5b 00 00 push $0x5b4f 4005: ff 35 28 6e 00 00 pushl 0x6e28 400b: e8 f0 09 00 00 call 4a00 <printf> exit(); 4010: 83 c4 20 add $0x20,%esp 4013: e8 8a 08 00 00 call 48a2 <exit> continue; kill(pids[i]); wait(); } if(c == (char*)0xffffffff){ printf(stdout, "failed sbrk leaked memory\n"); 4018: 83 ec 08 sub $0x8,%esp 401b: 68 d1 5b 00 00 push $0x5bd1 4020: ff 35 28 6e 00 00 pushl 0x6e28 4026: e8 d5 09 00 00 call 4a00 <printf> exit(); 402b: e8 72 08 00 00 call 48a2 <exit> } // if we run the system out of memory, does it clean up the last // failed allocation? if(pipe(fds) != 0){ printf(1, "pipe() failed\n"); 4030: 83 ec 08 sub $0x8,%esp 4033: 68 8d 50 00 00 push $0x508d 4038: 6a 01 push $0x1 403a: e8 c1 09 00 00 call 4a00 <printf> exit(); 403f: e8 5e 08 00 00 call 48a2 <exit> if(pid < 0){ printf(stdout, "fork failed\n"); exit(); } if(pid == 0){ printf(stdout, "oops could read %x = %x\n", a, *a); 4044: 0f be 03 movsbl (%ebx),%eax 4047: 50 push %eax 4048: 53 push %ebx 4049: 68 b8 5b 00 00 push $0x5bb8 404e: ff 35 28 6e 00 00 pushl 0x6e28 4054: e8 a7 09 00 00 call 4a00 <printf> kill(ppid); 4059: 89 3c 24 mov %edi,(%esp) 405c: e8 71 08 00 00 call 48d2 <kill> exit(); 4061: e8 3c 08 00 00 call 48a2 <exit> // can we read the kernel's memory? for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+2000000); a += 50000){ ppid = getpid(); pid = fork(); if(pid < 0){ printf(stdout, "fork failed\n"); 4066: 83 ec 08 sub $0x8,%esp 4069: 68 95 5c 00 00 push $0x5c95 406e: ff 35 28 6e 00 00 pushl 0x6e28 4074: e8 87 09 00 00 call 4a00 <printf> exit(); 4079: e8 24 08 00 00 call 48a2 <exit> } a = sbrk(0); c = sbrk(-(sbrk(0) - oldbrk)); if(c != a){ printf(stdout, "sbrk downsize failed, a %x c %x\n", a, c); 407e: 50 push %eax 407f: 53 push %ebx 4080: 68 98 63 00 00 push $0x6398 4085: ff 35 28 6e 00 00 pushl 0x6e28 408b: e8 70 09 00 00 call 4a00 <printf> exit(); 4090: e8 0d 08 00 00 call 48a2 <exit> printf(stdout, "sbrk re-allocation failed, a %x c %x\n", a, c); exit(); } if(*lastaddr == 99){ // should be zero printf(stdout, "sbrk de-allocation didn't really deallocate\n"); 4095: 83 ec 08 sub $0x8,%esp 4098: 68 68 63 00 00 push $0x6368 409d: ff 35 28 6e 00 00 pushl 0x6e28 40a3: e8 58 09 00 00 call 4a00 <printf> exit(); 40a8: e8 f5 07 00 00 call 48a2 <exit> // can one re-allocate that page? a = sbrk(0); c = sbrk(4096); if(c != a || sbrk(0) != a + 4096){ printf(stdout, "sbrk re-allocation failed, a %x c %x\n", a, c); 40ad: 57 push %edi 40ae: 53 push %ebx 40af: 68 40 63 00 00 push $0x6340 40b4: ff 35 28 6e 00 00 pushl 0x6e28 40ba: e8 41 09 00 00 call 4a00 <printf> exit(); 40bf: e8 de 07 00 00 call 48a2 <exit> printf(stdout, "sbrk could not deallocate\n"); exit(); } c = sbrk(0); if(c != a - 4096){ printf(stdout, "sbrk deallocation produced wrong address, a %x c %x\n", a, c); 40c4: 50 push %eax 40c5: 53 push %ebx 40c6: 68 08 63 00 00 push $0x6308 40cb: ff 35 28 6e 00 00 pushl 0x6e28 40d1: e8 2a 09 00 00 call 4a00 <printf> exit(); 40d6: e8 c7 07 00 00 call 48a2 <exit> // can one de-allocate? a = sbrk(0); c = sbrk(-4096); if(c == (char*)0xffffffff){ printf(stdout, "sbrk could not deallocate\n"); 40db: 83 ec 08 sub $0x8,%esp 40de: 68 9d 5b 00 00 push $0x5b9d 40e3: ff 35 28 6e 00 00 pushl 0x6e28 40e9: e8 12 09 00 00 call 4a00 <printf> exit(); 40ee: e8 af 07 00 00 call 48a2 <exit> #define BIG (100*1024*1024) a = sbrk(0); amt = (BIG) - (uint)a; p = sbrk(amt); if (p != a) { printf(stdout, "sbrk test failed to grow big address space; enough phys mem?\n"); 40f3: 83 ec 08 sub $0x8,%esp 40f6: 68 c8 62 00 00 push $0x62c8 40fb: ff 35 28 6e 00 00 pushl 0x6e28 4101: e8 fa 08 00 00 call 4a00 <printf> exit(); 4106: e8 97 07 00 00 call 48a2 <exit> if(c != a + 1){ printf(stdout, "sbrk test failed post-fork\n"); exit(); } if(pid == 0) exit(); 410b: e8 92 07 00 00 call 48a2 <exit> exit(); } c = sbrk(1); c = sbrk(1); if(c != a + 1){ printf(stdout, "sbrk test failed post-fork\n"); 4110: 83 ec 08 sub $0x8,%esp 4113: 68 81 5b 00 00 push $0x5b81 4118: ff 35 28 6e 00 00 pushl 0x6e28 411e: e8 dd 08 00 00 call 4a00 <printf> exit(); 4123: e8 7a 07 00 00 call 48a2 <exit> *b = 1; a = b + 1; } pid = fork(); if(pid < 0){ printf(stdout, "sbrk test fork failed\n"); 4128: 83 ec 08 sub $0x8,%esp 412b: 68 6a 5b 00 00 push $0x5b6a 4130: ff 35 28 6e 00 00 pushl 0x6e28 4136: e8 c5 08 00 00 call 4a00 <printf> exit(); 413b: e8 62 07 00 00 call 48a2 <exit> 00004140 <validateint>: printf(stdout, "sbrk test OK\n"); } void validateint(int *p) { 4140: 55 push %ebp 4141: 89 e5 mov %esp,%ebp "int %2\n\t" "mov %%ebx, %%esp" : "=a" (res) : "a" (SYS_sleep), "n" (T_SYSCALL), "c" (p) : "ebx"); } 4143: 5d pop %ebp 4144: c3 ret 4145: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 4149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00004150 <validatetest>: void validatetest(void) { 4150: 55 push %ebp 4151: 89 e5 mov %esp,%ebp 4153: 56 push %esi 4154: 53 push %ebx uint p; printf(stdout, "validate test\n"); hi = 1100*1024; for(p = 0; p <= (uint)hi; p += 4096){ 4155: 31 db xor %ebx,%ebx validatetest(void) { int hi, pid; uint p; printf(stdout, "validate test\n"); 4157: 83 ec 08 sub $0x8,%esp 415a: 68 fa 5b 00 00 push $0x5bfa 415f: ff 35 28 6e 00 00 pushl 0x6e28 4165: e8 96 08 00 00 call 4a00 <printf> 416a: 83 c4 10 add $0x10,%esp 416d: 8d 76 00 lea 0x0(%esi),%esi hi = 1100*1024; for(p = 0; p <= (uint)hi; p += 4096){ if((pid = fork()) == 0){ 4170: e8 25 07 00 00 call 489a <fork> 4175: 85 c0 test %eax,%eax 4177: 89 c6 mov %eax,%esi 4179: 74 63 je 41de <validatetest+0x8e> // try to crash the kernel by passing in a badly placed integer validateint((int*)p); exit(); } sleep(0); 417b: 83 ec 0c sub $0xc,%esp 417e: 6a 00 push $0x0 4180: e8 ad 07 00 00 call 4932 <sleep> sleep(0); 4185: c7 04 24 00 00 00 00 movl $0x0,(%esp) 418c: e8 a1 07 00 00 call 4932 <sleep> kill(pid); 4191: 89 34 24 mov %esi,(%esp) 4194: e8 39 07 00 00 call 48d2 <kill> wait(); 4199: e8 0c 07 00 00 call 48aa <wait> // try to crash the kernel by passing in a bad string pointer if(link("nosuchfile", (char*)p) != -1){ 419e: 58 pop %eax 419f: 5a pop %edx 41a0: 53 push %ebx 41a1: 68 09 5c 00 00 push $0x5c09 41a6: e8 57 07 00 00 call 4902 <link> 41ab: 83 c4 10 add $0x10,%esp 41ae: 83 f8 ff cmp $0xffffffff,%eax 41b1: 75 30 jne 41e3 <validatetest+0x93> uint p; printf(stdout, "validate test\n"); hi = 1100*1024; for(p = 0; p <= (uint)hi; p += 4096){ 41b3: 81 c3 00 10 00 00 add $0x1000,%ebx 41b9: 81 fb 00 40 11 00 cmp $0x114000,%ebx 41bf: 75 af jne 4170 <validatetest+0x20> printf(stdout, "link should not succeed\n"); exit(); } } printf(stdout, "validate ok\n"); 41c1: 83 ec 08 sub $0x8,%esp 41c4: 68 2d 5c 00 00 push $0x5c2d 41c9: ff 35 28 6e 00 00 pushl 0x6e28 41cf: e8 2c 08 00 00 call 4a00 <printf> } 41d4: 83 c4 10 add $0x10,%esp 41d7: 8d 65 f8 lea -0x8(%ebp),%esp 41da: 5b pop %ebx 41db: 5e pop %esi 41dc: 5d pop %ebp 41dd: c3 ret for(p = 0; p <= (uint)hi; p += 4096){ if((pid = fork()) == 0){ // try to crash the kernel by passing in a badly placed integer validateint((int*)p); exit(); 41de: e8 bf 06 00 00 call 48a2 <exit> kill(pid); wait(); // try to crash the kernel by passing in a bad string pointer if(link("nosuchfile", (char*)p) != -1){ printf(stdout, "link should not succeed\n"); 41e3: 83 ec 08 sub $0x8,%esp 41e6: 68 14 5c 00 00 push $0x5c14 41eb: ff 35 28 6e 00 00 pushl 0x6e28 41f1: e8 0a 08 00 00 call 4a00 <printf> exit(); 41f6: e8 a7 06 00 00 call 48a2 <exit> 41fb: 90 nop 41fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00004200 <bsstest>: // does unintialized data start out zero? char uninit[10000]; void bsstest(void) { 4200: 55 push %ebp 4201: 89 e5 mov %esp,%ebp 4203: 83 ec 10 sub $0x10,%esp int i; printf(stdout, "bss test\n"); 4206: 68 3a 5c 00 00 push $0x5c3a 420b: ff 35 28 6e 00 00 pushl 0x6e28 4211: e8 ea 07 00 00 call 4a00 <printf> for(i = 0; i < sizeof(uninit); i++){ if(uninit[i] != '\0'){ 4216: 83 c4 10 add $0x10,%esp 4219: 80 3d e0 6e 00 00 00 cmpb $0x0,0x6ee0 4220: 75 35 jne 4257 <bsstest+0x57> 4222: b8 e1 6e 00 00 mov $0x6ee1,%eax 4227: 89 f6 mov %esi,%esi 4229: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 4230: 80 38 00 cmpb $0x0,(%eax) 4233: 75 22 jne 4257 <bsstest+0x57> 4235: 83 c0 01 add $0x1,%eax bsstest(void) { int i; printf(stdout, "bss test\n"); for(i = 0; i < sizeof(uninit); i++){ 4238: 3d f0 95 00 00 cmp $0x95f0,%eax 423d: 75 f1 jne 4230 <bsstest+0x30> if(uninit[i] != '\0'){ printf(stdout, "bss test failed\n"); exit(); } } printf(stdout, "bss test ok\n"); 423f: 83 ec 08 sub $0x8,%esp 4242: 68 55 5c 00 00 push $0x5c55 4247: ff 35 28 6e 00 00 pushl 0x6e28 424d: e8 ae 07 00 00 call 4a00 <printf> } 4252: 83 c4 10 add $0x10,%esp 4255: c9 leave 4256: c3 ret int i; printf(stdout, "bss test\n"); for(i = 0; i < sizeof(uninit); i++){ if(uninit[i] != '\0'){ printf(stdout, "bss test failed\n"); 4257: 83 ec 08 sub $0x8,%esp 425a: 68 44 5c 00 00 push $0x5c44 425f: ff 35 28 6e 00 00 pushl 0x6e28 4265: e8 96 07 00 00 call 4a00 <printf> exit(); 426a: e8 33 06 00 00 call 48a2 <exit> 426f: 90 nop 00004270 <bigargtest>: // does exec return an error if the arguments // are larger than a page? or does it write // below the stack and wreck the instructions/data? void bigargtest(void) { 4270: 55 push %ebp 4271: 89 e5 mov %esp,%ebp 4273: 83 ec 14 sub $0x14,%esp int pid, fd; unlink("bigarg-ok"); 4276: 68 62 5c 00 00 push $0x5c62 427b: e8 72 06 00 00 call 48f2 <unlink> pid = fork(); 4280: e8 15 06 00 00 call 489a <fork> if(pid == 0){ 4285: 83 c4 10 add $0x10,%esp 4288: 85 c0 test %eax,%eax 428a: 74 3f je 42cb <bigargtest+0x5b> exec("echo", args); printf(stdout, "bigarg test ok\n"); fd = open("bigarg-ok", O_CREATE); close(fd); exit(); } else if(pid < 0){ 428c: 0f 88 c2 00 00 00 js 4354 <bigargtest+0xe4> printf(stdout, "bigargtest: fork failed\n"); exit(); } wait(); 4292: e8 13 06 00 00 call 48aa <wait> fd = open("bigarg-ok", 0); 4297: 83 ec 08 sub $0x8,%esp 429a: 6a 00 push $0x0 429c: 68 62 5c 00 00 push $0x5c62 42a1: e8 3c 06 00 00 call 48e2 <open> if(fd < 0){ 42a6: 83 c4 10 add $0x10,%esp 42a9: 85 c0 test %eax,%eax 42ab: 0f 88 8c 00 00 00 js 433d <bigargtest+0xcd> printf(stdout, "bigarg test failed!\n"); exit(); } close(fd); 42b1: 83 ec 0c sub $0xc,%esp 42b4: 50 push %eax 42b5: e8 10 06 00 00 call 48ca <close> unlink("bigarg-ok"); 42ba: c7 04 24 62 5c 00 00 movl $0x5c62,(%esp) 42c1: e8 2c 06 00 00 call 48f2 <unlink> } 42c6: 83 c4 10 add $0x10,%esp 42c9: c9 leave 42ca: c3 ret 42cb: b8 40 6e 00 00 mov $0x6e40,%eax pid = fork(); if(pid == 0){ static char *args[MAXARG]; int i; for(i = 0; i < MAXARG-1; i++) args[i] = "bigargs test: failed\n "; 42d0: c7 00 bc 63 00 00 movl $0x63bc,(%eax) 42d6: 83 c0 04 add $0x4,%eax unlink("bigarg-ok"); pid = fork(); if(pid == 0){ static char *args[MAXARG]; int i; for(i = 0; i < MAXARG-1; i++) 42d9: 3d bc 6e 00 00 cmp $0x6ebc,%eax 42de: 75 f0 jne 42d0 <bigargtest+0x60> args[i] = "bigargs test: failed\n "; args[MAXARG-1] = 0; printf(stdout, "bigarg test\n"); 42e0: 51 push %ecx 42e1: 51 push %ecx 42e2: 68 6c 5c 00 00 push $0x5c6c 42e7: ff 35 28 6e 00 00 pushl 0x6e28 if(pid == 0){ static char *args[MAXARG]; int i; for(i = 0; i < MAXARG-1; i++) args[i] = "bigargs test: failed\n "; args[MAXARG-1] = 0; 42ed: c7 05 bc 6e 00 00 00 movl $0x0,0x6ebc 42f4: 00 00 00 printf(stdout, "bigarg test\n"); 42f7: e8 04 07 00 00 call 4a00 <printf> exec("echo", args); 42fc: 58 pop %eax 42fd: 5a pop %edx 42fe: 68 40 6e 00 00 push $0x6e40 4303: 68 39 4e 00 00 push $0x4e39 4308: e8 cd 05 00 00 call 48da <exec> printf(stdout, "bigarg test ok\n"); 430d: 59 pop %ecx 430e: 58 pop %eax 430f: 68 79 5c 00 00 push $0x5c79 4314: ff 35 28 6e 00 00 pushl 0x6e28 431a: e8 e1 06 00 00 call 4a00 <printf> fd = open("bigarg-ok", O_CREATE); 431f: 58 pop %eax 4320: 5a pop %edx 4321: 68 00 02 00 00 push $0x200 4326: 68 62 5c 00 00 push $0x5c62 432b: e8 b2 05 00 00 call 48e2 <open> close(fd); 4330: 89 04 24 mov %eax,(%esp) 4333: e8 92 05 00 00 call 48ca <close> exit(); 4338: e8 65 05 00 00 call 48a2 <exit> exit(); } wait(); fd = open("bigarg-ok", 0); if(fd < 0){ printf(stdout, "bigarg test failed!\n"); 433d: 50 push %eax 433e: 50 push %eax 433f: 68 a2 5c 00 00 push $0x5ca2 4344: ff 35 28 6e 00 00 pushl 0x6e28 434a: e8 b1 06 00 00 call 4a00 <printf> exit(); 434f: e8 4e 05 00 00 call 48a2 <exit> printf(stdout, "bigarg test ok\n"); fd = open("bigarg-ok", O_CREATE); close(fd); exit(); } else if(pid < 0){ printf(stdout, "bigargtest: fork failed\n"); 4354: 52 push %edx 4355: 52 push %edx 4356: 68 89 5c 00 00 push $0x5c89 435b: ff 35 28 6e 00 00 pushl 0x6e28 4361: e8 9a 06 00 00 call 4a00 <printf> exit(); 4366: e8 37 05 00 00 call 48a2 <exit> 436b: 90 nop 436c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00004370 <fsfull>: // what happens when the file system runs out of blocks? // answer: balloc panics, so this test is not useful. void fsfull() { 4370: 55 push %ebp 4371: 89 e5 mov %esp,%ebp 4373: 57 push %edi 4374: 56 push %esi 4375: 53 push %ebx int nfiles; int fsblocks = 0; printf(1, "fsfull test\n"); for(nfiles = 0; ; nfiles++){ 4376: 31 db xor %ebx,%ebx // what happens when the file system runs out of blocks? // answer: balloc panics, so this test is not useful. void fsfull() { 4378: 83 ec 54 sub $0x54,%esp int nfiles; int fsblocks = 0; printf(1, "fsfull test\n"); 437b: 68 b7 5c 00 00 push $0x5cb7 4380: 6a 01 push $0x1 4382: e8 79 06 00 00 call 4a00 <printf> 4387: 83 c4 10 add $0x10,%esp 438a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(nfiles = 0; ; nfiles++){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; 4390: b8 d3 4d 62 10 mov $0x10624dd3,%eax 4395: 89 de mov %ebx,%esi name[2] = '0' + (nfiles % 1000) / 100; 4397: 89 d9 mov %ebx,%ecx printf(1, "fsfull test\n"); for(nfiles = 0; ; nfiles++){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; 4399: f7 eb imul %ebx 439b: c1 fe 1f sar $0x1f,%esi name[2] = '0' + (nfiles % 1000) / 100; name[3] = '0' + (nfiles % 100) / 10; 439e: 89 df mov %ebx,%edi name[4] = '0' + (nfiles % 10); name[5] = '\0'; printf(1, "writing %s\n", name); 43a0: 83 ec 04 sub $0x4,%esp printf(1, "fsfull test\n"); for(nfiles = 0; ; nfiles++){ char name[64]; name[0] = 'f'; 43a3: c6 45 a8 66 movb $0x66,-0x58(%ebp) name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; name[3] = '0' + (nfiles % 100) / 10; name[4] = '0' + (nfiles % 10); name[5] = '\0'; 43a7: c6 45 ad 00 movb $0x0,-0x53(%ebp) printf(1, "fsfull test\n"); for(nfiles = 0; ; nfiles++){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; 43ab: c1 fa 06 sar $0x6,%edx 43ae: 29 f2 sub %esi,%edx 43b0: 8d 42 30 lea 0x30(%edx),%eax name[2] = '0' + (nfiles % 1000) / 100; 43b3: 69 d2 e8 03 00 00 imul $0x3e8,%edx,%edx printf(1, "fsfull test\n"); for(nfiles = 0; ; nfiles++){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; 43b9: 88 45 a9 mov %al,-0x57(%ebp) name[2] = '0' + (nfiles % 1000) / 100; 43bc: b8 1f 85 eb 51 mov $0x51eb851f,%eax 43c1: 29 d1 sub %edx,%ecx 43c3: f7 e9 imul %ecx 43c5: c1 f9 1f sar $0x1f,%ecx name[3] = '0' + (nfiles % 100) / 10; 43c8: b8 1f 85 eb 51 mov $0x51eb851f,%eax for(nfiles = 0; ; nfiles++){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; 43cd: c1 fa 05 sar $0x5,%edx 43d0: 29 ca sub %ecx,%edx name[3] = '0' + (nfiles % 100) / 10; 43d2: b9 67 66 66 66 mov $0x66666667,%ecx for(nfiles = 0; ; nfiles++){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; 43d7: 83 c2 30 add $0x30,%edx 43da: 88 55 aa mov %dl,-0x56(%ebp) name[3] = '0' + (nfiles % 100) / 10; 43dd: f7 eb imul %ebx 43df: c1 fa 05 sar $0x5,%edx 43e2: 29 f2 sub %esi,%edx 43e4: 6b d2 64 imul $0x64,%edx,%edx 43e7: 29 d7 sub %edx,%edi 43e9: 89 f8 mov %edi,%eax 43eb: c1 ff 1f sar $0x1f,%edi 43ee: f7 e9 imul %ecx name[4] = '0' + (nfiles % 10); 43f0: 89 d8 mov %ebx,%eax for(nfiles = 0; ; nfiles++){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; name[3] = '0' + (nfiles % 100) / 10; 43f2: c1 fa 02 sar $0x2,%edx 43f5: 29 fa sub %edi,%edx 43f7: 83 c2 30 add $0x30,%edx 43fa: 88 55 ab mov %dl,-0x55(%ebp) name[4] = '0' + (nfiles % 10); 43fd: f7 e9 imul %ecx 43ff: 89 d9 mov %ebx,%ecx 4401: c1 fa 02 sar $0x2,%edx 4404: 29 f2 sub %esi,%edx 4406: 8d 04 92 lea (%edx,%edx,4),%eax 4409: 01 c0 add %eax,%eax 440b: 29 c1 sub %eax,%ecx 440d: 89 c8 mov %ecx,%eax 440f: 83 c0 30 add $0x30,%eax 4412: 88 45 ac mov %al,-0x54(%ebp) name[5] = '\0'; printf(1, "writing %s\n", name); 4415: 8d 45 a8 lea -0x58(%ebp),%eax 4418: 50 push %eax 4419: 68 c4 5c 00 00 push $0x5cc4 441e: 6a 01 push $0x1 4420: e8 db 05 00 00 call 4a00 <printf> int fd = open(name, O_CREATE|O_RDWR); 4425: 58 pop %eax 4426: 8d 45 a8 lea -0x58(%ebp),%eax 4429: 5a pop %edx 442a: 68 02 02 00 00 push $0x202 442f: 50 push %eax 4430: e8 ad 04 00 00 call 48e2 <open> if(fd < 0){ 4435: 83 c4 10 add $0x10,%esp 4438: 85 c0 test %eax,%eax name[2] = '0' + (nfiles % 1000) / 100; name[3] = '0' + (nfiles % 100) / 10; name[4] = '0' + (nfiles % 10); name[5] = '\0'; printf(1, "writing %s\n", name); int fd = open(name, O_CREATE|O_RDWR); 443a: 89 c7 mov %eax,%edi if(fd < 0){ 443c: 78 50 js 448e <fsfull+0x11e> 443e: 31 f6 xor %esi,%esi 4440: eb 08 jmp 444a <fsfull+0xda> 4442: 8d b6 00 00 00 00 lea 0x0(%esi),%esi int total = 0; while(1){ int cc = write(fd, buf, 512); if(cc < 512) break; total += cc; 4448: 01 c6 add %eax,%esi printf(1, "open %s failed\n", name); break; } int total = 0; while(1){ int cc = write(fd, buf, 512); 444a: 83 ec 04 sub $0x4,%esp 444d: 68 00 02 00 00 push $0x200 4452: 68 00 96 00 00 push $0x9600 4457: 57 push %edi 4458: e8 65 04 00 00 call 48c2 <write> if(cc < 512) 445d: 83 c4 10 add $0x10,%esp 4460: 3d ff 01 00 00 cmp $0x1ff,%eax 4465: 7f e1 jg 4448 <fsfull+0xd8> break; total += cc; fsblocks++; } printf(1, "wrote %d bytes\n", total); 4467: 83 ec 04 sub $0x4,%esp 446a: 56 push %esi 446b: 68 e0 5c 00 00 push $0x5ce0 4470: 6a 01 push $0x1 4472: e8 89 05 00 00 call 4a00 <printf> close(fd); 4477: 89 3c 24 mov %edi,(%esp) 447a: e8 4b 04 00 00 call 48ca <close> if(total == 0) 447f: 83 c4 10 add $0x10,%esp 4482: 85 f6 test %esi,%esi 4484: 74 22 je 44a8 <fsfull+0x138> int nfiles; int fsblocks = 0; printf(1, "fsfull test\n"); for(nfiles = 0; ; nfiles++){ 4486: 83 c3 01 add $0x1,%ebx } printf(1, "wrote %d bytes\n", total); close(fd); if(total == 0) break; } 4489: e9 02 ff ff ff jmp 4390 <fsfull+0x20> name[4] = '0' + (nfiles % 10); name[5] = '\0'; printf(1, "writing %s\n", name); int fd = open(name, O_CREATE|O_RDWR); if(fd < 0){ printf(1, "open %s failed\n", name); 448e: 8d 45 a8 lea -0x58(%ebp),%eax 4491: 83 ec 04 sub $0x4,%esp 4494: 50 push %eax 4495: 68 d0 5c 00 00 push $0x5cd0 449a: 6a 01 push $0x1 449c: e8 5f 05 00 00 call 4a00 <printf> break; 44a1: 83 c4 10 add $0x10,%esp 44a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } while(nfiles >= 0){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; 44a8: b8 d3 4d 62 10 mov $0x10624dd3,%eax 44ad: 89 de mov %ebx,%esi name[2] = '0' + (nfiles % 1000) / 100; 44af: 89 d9 mov %ebx,%ecx } while(nfiles >= 0){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; 44b1: f7 eb imul %ebx 44b3: c1 fe 1f sar $0x1f,%esi name[2] = '0' + (nfiles % 1000) / 100; name[3] = '0' + (nfiles % 100) / 10; 44b6: 89 df mov %ebx,%edi name[4] = '0' + (nfiles % 10); name[5] = '\0'; unlink(name); 44b8: 83 ec 0c sub $0xc,%esp break; } while(nfiles >= 0){ char name[64]; name[0] = 'f'; 44bb: c6 45 a8 66 movb $0x66,-0x58(%ebp) name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; name[3] = '0' + (nfiles % 100) / 10; name[4] = '0' + (nfiles % 10); name[5] = '\0'; 44bf: c6 45 ad 00 movb $0x0,-0x53(%ebp) } while(nfiles >= 0){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; 44c3: c1 fa 06 sar $0x6,%edx 44c6: 29 f2 sub %esi,%edx 44c8: 8d 42 30 lea 0x30(%edx),%eax name[2] = '0' + (nfiles % 1000) / 100; 44cb: 69 d2 e8 03 00 00 imul $0x3e8,%edx,%edx } while(nfiles >= 0){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; 44d1: 88 45 a9 mov %al,-0x57(%ebp) name[2] = '0' + (nfiles % 1000) / 100; 44d4: b8 1f 85 eb 51 mov $0x51eb851f,%eax 44d9: 29 d1 sub %edx,%ecx 44db: f7 e9 imul %ecx 44dd: c1 f9 1f sar $0x1f,%ecx name[3] = '0' + (nfiles % 100) / 10; 44e0: b8 1f 85 eb 51 mov $0x51eb851f,%eax while(nfiles >= 0){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; 44e5: c1 fa 05 sar $0x5,%edx 44e8: 29 ca sub %ecx,%edx name[3] = '0' + (nfiles % 100) / 10; 44ea: b9 67 66 66 66 mov $0x66666667,%ecx while(nfiles >= 0){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; 44ef: 83 c2 30 add $0x30,%edx 44f2: 88 55 aa mov %dl,-0x56(%ebp) name[3] = '0' + (nfiles % 100) / 10; 44f5: f7 eb imul %ebx 44f7: c1 fa 05 sar $0x5,%edx 44fa: 29 f2 sub %esi,%edx 44fc: 6b d2 64 imul $0x64,%edx,%edx 44ff: 29 d7 sub %edx,%edi 4501: 89 f8 mov %edi,%eax 4503: c1 ff 1f sar $0x1f,%edi 4506: f7 e9 imul %ecx name[4] = '0' + (nfiles % 10); 4508: 89 d8 mov %ebx,%eax while(nfiles >= 0){ char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; name[3] = '0' + (nfiles % 100) / 10; 450a: c1 fa 02 sar $0x2,%edx 450d: 29 fa sub %edi,%edx 450f: 83 c2 30 add $0x30,%edx 4512: 88 55 ab mov %dl,-0x55(%ebp) name[4] = '0' + (nfiles % 10); 4515: f7 e9 imul %ecx 4517: 89 d9 mov %ebx,%ecx name[5] = '\0'; unlink(name); nfiles--; 4519: 83 eb 01 sub $0x1,%ebx char name[64]; name[0] = 'f'; name[1] = '0' + nfiles / 1000; name[2] = '0' + (nfiles % 1000) / 100; name[3] = '0' + (nfiles % 100) / 10; name[4] = '0' + (nfiles % 10); 451c: c1 fa 02 sar $0x2,%edx 451f: 29 f2 sub %esi,%edx 4521: 8d 04 92 lea (%edx,%edx,4),%eax 4524: 01 c0 add %eax,%eax 4526: 29 c1 sub %eax,%ecx 4528: 89 c8 mov %ecx,%eax 452a: 83 c0 30 add $0x30,%eax 452d: 88 45 ac mov %al,-0x54(%ebp) name[5] = '\0'; unlink(name); 4530: 8d 45 a8 lea -0x58(%ebp),%eax 4533: 50 push %eax 4534: e8 b9 03 00 00 call 48f2 <unlink> close(fd); if(total == 0) break; } while(nfiles >= 0){ 4539: 83 c4 10 add $0x10,%esp 453c: 83 fb ff cmp $0xffffffff,%ebx 453f: 0f 85 63 ff ff ff jne 44a8 <fsfull+0x138> name[5] = '\0'; unlink(name); nfiles--; } printf(1, "fsfull test finished\n"); 4545: 83 ec 08 sub $0x8,%esp 4548: 68 f0 5c 00 00 push $0x5cf0 454d: 6a 01 push $0x1 454f: e8 ac 04 00 00 call 4a00 <printf> } 4554: 83 c4 10 add $0x10,%esp 4557: 8d 65 f4 lea -0xc(%ebp),%esp 455a: 5b pop %ebx 455b: 5e pop %esi 455c: 5f pop %edi 455d: 5d pop %ebp 455e: c3 ret 455f: 90 nop 00004560 <uio>: void uio() { 4560: 55 push %ebp 4561: 89 e5 mov %esp,%ebp 4563: 83 ec 10 sub $0x10,%esp ushort port = 0; uchar val = 0; int pid; printf(1, "uio test\n"); 4566: 68 06 5d 00 00 push $0x5d06 456b: 6a 01 push $0x1 456d: e8 8e 04 00 00 call 4a00 <printf> pid = fork(); 4572: e8 23 03 00 00 call 489a <fork> if(pid == 0){ 4577: 83 c4 10 add $0x10,%esp 457a: 85 c0 test %eax,%eax 457c: 74 1b je 4599 <uio+0x39> asm volatile("outb %0,%1"::"a"(val), "d" (port)); port = RTC_DATA; asm volatile("inb %1,%0" : "=a" (val) : "d" (port)); printf(1, "uio: uio succeeded; test FAILED\n"); exit(); } else if(pid < 0){ 457e: 78 3d js 45bd <uio+0x5d> printf (1, "fork failed\n"); exit(); } wait(); 4580: e8 25 03 00 00 call 48aa <wait> printf(1, "uio test done\n"); 4585: 83 ec 08 sub $0x8,%esp 4588: 68 10 5d 00 00 push $0x5d10 458d: 6a 01 push $0x1 458f: e8 6c 04 00 00 call 4a00 <printf> } 4594: 83 c4 10 add $0x10,%esp 4597: c9 leave 4598: c3 ret pid = fork(); if(pid == 0){ port = RTC_ADDR; val = 0x09; /* year */ /* http://wiki.osdev.org/Inline_Assembly/Examples */ asm volatile("outb %0,%1"::"a"(val), "d" (port)); 4599: ba 70 00 00 00 mov $0x70,%edx 459e: b8 09 00 00 00 mov $0x9,%eax 45a3: ee out %al,(%dx) port = RTC_DATA; asm volatile("inb %1,%0" : "=a" (val) : "d" (port)); 45a4: ba 71 00 00 00 mov $0x71,%edx 45a9: ec in (%dx),%al printf(1, "uio: uio succeeded; test FAILED\n"); 45aa: 52 push %edx 45ab: 52 push %edx 45ac: 68 9c 64 00 00 push $0x649c 45b1: 6a 01 push $0x1 45b3: e8 48 04 00 00 call 4a00 <printf> exit(); 45b8: e8 e5 02 00 00 call 48a2 <exit> } else if(pid < 0){ printf (1, "fork failed\n"); 45bd: 50 push %eax 45be: 50 push %eax 45bf: 68 95 5c 00 00 push $0x5c95 45c4: 6a 01 push $0x1 45c6: e8 35 04 00 00 call 4a00 <printf> exit(); 45cb: e8 d2 02 00 00 call 48a2 <exit> 000045d0 <argptest>: wait(); printf(1, "uio test done\n"); } void argptest() { 45d0: 55 push %ebp 45d1: 89 e5 mov %esp,%ebp 45d3: 53 push %ebx 45d4: 83 ec 0c sub $0xc,%esp int fd; fd = open("init", O_RDONLY); 45d7: 6a 00 push $0x0 45d9: 68 1f 5d 00 00 push $0x5d1f 45de: e8 ff 02 00 00 call 48e2 <open> if (fd < 0) { 45e3: 83 c4 10 add $0x10,%esp 45e6: 85 c0 test %eax,%eax 45e8: 78 39 js 4623 <argptest+0x53> printf(2, "open failed\n"); exit(); } read(fd, sbrk(0) - 1, -1); 45ea: 83 ec 0c sub $0xc,%esp 45ed: 89 c3 mov %eax,%ebx 45ef: 6a 00 push $0x0 45f1: e8 34 03 00 00 call 492a <sbrk> 45f6: 83 c4 0c add $0xc,%esp 45f9: 83 e8 01 sub $0x1,%eax 45fc: 6a ff push $0xffffffff 45fe: 50 push %eax 45ff: 53 push %ebx 4600: e8 b5 02 00 00 call 48ba <read> close(fd); 4605: 89 1c 24 mov %ebx,(%esp) 4608: e8 bd 02 00 00 call 48ca <close> printf(1, "arg test passed\n"); 460d: 58 pop %eax 460e: 5a pop %edx 460f: 68 31 5d 00 00 push $0x5d31 4614: 6a 01 push $0x1 4616: e8 e5 03 00 00 call 4a00 <printf> } 461b: 83 c4 10 add $0x10,%esp 461e: 8b 5d fc mov -0x4(%ebp),%ebx 4621: c9 leave 4622: c3 ret void argptest() { int fd; fd = open("init", O_RDONLY); if (fd < 0) { printf(2, "open failed\n"); 4623: 51 push %ecx 4624: 51 push %ecx 4625: 68 24 5d 00 00 push $0x5d24 462a: 6a 02 push $0x2 462c: e8 cf 03 00 00 call 4a00 <printf> exit(); 4631: e8 6c 02 00 00 call 48a2 <exit> 4636: 8d 76 00 lea 0x0(%esi),%esi 4639: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00004640 <rand>: unsigned long randstate = 1; unsigned int rand() { randstate = randstate * 1664525 + 1013904223; 4640: 69 05 24 6e 00 00 0d imul $0x19660d,0x6e24,%eax 4647: 66 19 00 } unsigned long randstate = 1; unsigned int rand() { 464a: 55 push %ebp 464b: 89 e5 mov %esp,%ebp randstate = randstate * 1664525 + 1013904223; return randstate; } 464d: 5d pop %ebp unsigned long randstate = 1; unsigned int rand() { randstate = randstate * 1664525 + 1013904223; 464e: 05 5f f3 6e 3c add $0x3c6ef35f,%eax 4653: a3 24 6e 00 00 mov %eax,0x6e24 return randstate; } 4658: c3 ret 4659: 66 90 xchg %ax,%ax 465b: 66 90 xchg %ax,%ax 465d: 66 90 xchg %ax,%ax 465f: 90 nop 00004660 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 4660: 55 push %ebp 4661: 89 e5 mov %esp,%ebp 4663: 53 push %ebx 4664: 8b 45 08 mov 0x8(%ebp),%eax 4667: 8b 4d 0c mov 0xc(%ebp),%ecx char *os; os = s; while((*s++ = *t++) != 0) 466a: 89 c2 mov %eax,%edx 466c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 4670: 83 c1 01 add $0x1,%ecx 4673: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 4677: 83 c2 01 add $0x1,%edx 467a: 84 db test %bl,%bl 467c: 88 5a ff mov %bl,-0x1(%edx) 467f: 75 ef jne 4670 <strcpy+0x10> ; return os; } 4681: 5b pop %ebx 4682: 5d pop %ebp 4683: c3 ret 4684: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 468a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00004690 <strcmp>: int strcmp(const char *p, const char *q) { 4690: 55 push %ebp 4691: 89 e5 mov %esp,%ebp 4693: 56 push %esi 4694: 53 push %ebx 4695: 8b 55 08 mov 0x8(%ebp),%edx 4698: 8b 4d 0c mov 0xc(%ebp),%ecx while(*p && *p == *q) 469b: 0f b6 02 movzbl (%edx),%eax 469e: 0f b6 19 movzbl (%ecx),%ebx 46a1: 84 c0 test %al,%al 46a3: 75 1e jne 46c3 <strcmp+0x33> 46a5: eb 29 jmp 46d0 <strcmp+0x40> 46a7: 89 f6 mov %esi,%esi 46a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p++, q++; 46b0: 83 c2 01 add $0x1,%edx } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 46b3: 0f b6 02 movzbl (%edx),%eax p++, q++; 46b6: 8d 71 01 lea 0x1(%ecx),%esi } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 46b9: 0f b6 59 01 movzbl 0x1(%ecx),%ebx 46bd: 84 c0 test %al,%al 46bf: 74 0f je 46d0 <strcmp+0x40> 46c1: 89 f1 mov %esi,%ecx 46c3: 38 d8 cmp %bl,%al 46c5: 74 e9 je 46b0 <strcmp+0x20> p++, q++; return (uchar)*p - (uchar)*q; 46c7: 29 d8 sub %ebx,%eax } 46c9: 5b pop %ebx 46ca: 5e pop %esi 46cb: 5d pop %ebp 46cc: c3 ret 46cd: 8d 76 00 lea 0x0(%esi),%esi } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 46d0: 31 c0 xor %eax,%eax p++, q++; return (uchar)*p - (uchar)*q; 46d2: 29 d8 sub %ebx,%eax } 46d4: 5b pop %ebx 46d5: 5e pop %esi 46d6: 5d pop %ebp 46d7: c3 ret 46d8: 90 nop 46d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 000046e0 <strlen>: uint strlen(char *s) { 46e0: 55 push %ebp 46e1: 89 e5 mov %esp,%ebp 46e3: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 46e6: 80 39 00 cmpb $0x0,(%ecx) 46e9: 74 12 je 46fd <strlen+0x1d> 46eb: 31 d2 xor %edx,%edx 46ed: 8d 76 00 lea 0x0(%esi),%esi 46f0: 83 c2 01 add $0x1,%edx 46f3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 46f7: 89 d0 mov %edx,%eax 46f9: 75 f5 jne 46f0 <strlen+0x10> ; return n; } 46fb: 5d pop %ebp 46fc: c3 ret uint strlen(char *s) { int n; for(n = 0; s[n]; n++) 46fd: 31 c0 xor %eax,%eax ; return n; } 46ff: 5d pop %ebp 4700: c3 ret 4701: eb 0d jmp 4710 <memset> 4703: 90 nop 4704: 90 nop 4705: 90 nop 4706: 90 nop 4707: 90 nop 4708: 90 nop 4709: 90 nop 470a: 90 nop 470b: 90 nop 470c: 90 nop 470d: 90 nop 470e: 90 nop 470f: 90 nop 00004710 <memset>: void* memset(void *dst, int c, uint n) { 4710: 55 push %ebp 4711: 89 e5 mov %esp,%ebp 4713: 57 push %edi 4714: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 4717: 8b 4d 10 mov 0x10(%ebp),%ecx 471a: 8b 45 0c mov 0xc(%ebp),%eax 471d: 89 d7 mov %edx,%edi 471f: fc cld 4720: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 4722: 89 d0 mov %edx,%eax 4724: 5f pop %edi 4725: 5d pop %ebp 4726: c3 ret 4727: 89 f6 mov %esi,%esi 4729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00004730 <strchr>: char* strchr(const char *s, char c) { 4730: 55 push %ebp 4731: 89 e5 mov %esp,%ebp 4733: 53 push %ebx 4734: 8b 45 08 mov 0x8(%ebp),%eax 4737: 8b 5d 0c mov 0xc(%ebp),%ebx for(; *s; s++) 473a: 0f b6 10 movzbl (%eax),%edx 473d: 84 d2 test %dl,%dl 473f: 74 1d je 475e <strchr+0x2e> if(*s == c) 4741: 38 d3 cmp %dl,%bl 4743: 89 d9 mov %ebx,%ecx 4745: 75 0d jne 4754 <strchr+0x24> 4747: eb 17 jmp 4760 <strchr+0x30> 4749: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 4750: 38 ca cmp %cl,%dl 4752: 74 0c je 4760 <strchr+0x30> } char* strchr(const char *s, char c) { for(; *s; s++) 4754: 83 c0 01 add $0x1,%eax 4757: 0f b6 10 movzbl (%eax),%edx 475a: 84 d2 test %dl,%dl 475c: 75 f2 jne 4750 <strchr+0x20> if(*s == c) return (char*)s; return 0; 475e: 31 c0 xor %eax,%eax } 4760: 5b pop %ebx 4761: 5d pop %ebp 4762: c3 ret 4763: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 4769: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00004770 <gets>: char* gets(char *buf, int max) { 4770: 55 push %ebp 4771: 89 e5 mov %esp,%ebp 4773: 57 push %edi 4774: 56 push %esi 4775: 53 push %ebx int i, cc; char c; for(i=0; i+1 < max; ){ 4776: 31 f6 xor %esi,%esi cc = read(0, &c, 1); 4778: 8d 7d e7 lea -0x19(%ebp),%edi return 0; } char* gets(char *buf, int max) { 477b: 83 ec 1c sub $0x1c,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 477e: eb 29 jmp 47a9 <gets+0x39> cc = read(0, &c, 1); 4780: 83 ec 04 sub $0x4,%esp 4783: 6a 01 push $0x1 4785: 57 push %edi 4786: 6a 00 push $0x0 4788: e8 2d 01 00 00 call 48ba <read> if(cc < 1) 478d: 83 c4 10 add $0x10,%esp 4790: 85 c0 test %eax,%eax 4792: 7e 1d jle 47b1 <gets+0x41> break; buf[i++] = c; 4794: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 4798: 8b 55 08 mov 0x8(%ebp),%edx 479b: 89 de mov %ebx,%esi if(c == '\n' || c == '\r') 479d: 3c 0a cmp $0xa,%al for(i=0; i+1 < max; ){ cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; 479f: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1) if(c == '\n' || c == '\r') 47a3: 74 1b je 47c0 <gets+0x50> 47a5: 3c 0d cmp $0xd,%al 47a7: 74 17 je 47c0 <gets+0x50> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 47a9: 8d 5e 01 lea 0x1(%esi),%ebx 47ac: 3b 5d 0c cmp 0xc(%ebp),%ebx 47af: 7c cf jl 4780 <gets+0x10> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 47b1: 8b 45 08 mov 0x8(%ebp),%eax 47b4: c6 04 30 00 movb $0x0,(%eax,%esi,1) return buf; } 47b8: 8d 65 f4 lea -0xc(%ebp),%esp 47bb: 5b pop %ebx 47bc: 5e pop %esi 47bd: 5f pop %edi 47be: 5d pop %ebp 47bf: c3 ret break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 47c0: 8b 45 08 mov 0x8(%ebp),%eax gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 47c3: 89 de mov %ebx,%esi break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 47c5: c6 04 30 00 movb $0x0,(%eax,%esi,1) return buf; } 47c9: 8d 65 f4 lea -0xc(%ebp),%esp 47cc: 5b pop %ebx 47cd: 5e pop %esi 47ce: 5f pop %edi 47cf: 5d pop %ebp 47d0: c3 ret 47d1: eb 0d jmp 47e0 <stat> 47d3: 90 nop 47d4: 90 nop 47d5: 90 nop 47d6: 90 nop 47d7: 90 nop 47d8: 90 nop 47d9: 90 nop 47da: 90 nop 47db: 90 nop 47dc: 90 nop 47dd: 90 nop 47de: 90 nop 47df: 90 nop 000047e0 <stat>: int stat(char *n, struct stat *st) { 47e0: 55 push %ebp 47e1: 89 e5 mov %esp,%ebp 47e3: 56 push %esi 47e4: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 47e5: 83 ec 08 sub $0x8,%esp 47e8: 6a 00 push $0x0 47ea: ff 75 08 pushl 0x8(%ebp) 47ed: e8 f0 00 00 00 call 48e2 <open> if(fd < 0) 47f2: 83 c4 10 add $0x10,%esp 47f5: 85 c0 test %eax,%eax 47f7: 78 27 js 4820 <stat+0x40> return -1; r = fstat(fd, st); 47f9: 83 ec 08 sub $0x8,%esp 47fc: ff 75 0c pushl 0xc(%ebp) 47ff: 89 c3 mov %eax,%ebx 4801: 50 push %eax 4802: e8 f3 00 00 00 call 48fa <fstat> 4807: 89 c6 mov %eax,%esi close(fd); 4809: 89 1c 24 mov %ebx,(%esp) 480c: e8 b9 00 00 00 call 48ca <close> return r; 4811: 83 c4 10 add $0x10,%esp 4814: 89 f0 mov %esi,%eax } 4816: 8d 65 f8 lea -0x8(%ebp),%esp 4819: 5b pop %ebx 481a: 5e pop %esi 481b: 5d pop %ebp 481c: c3 ret 481d: 8d 76 00 lea 0x0(%esi),%esi int fd; int r; fd = open(n, O_RDONLY); if(fd < 0) return -1; 4820: b8 ff ff ff ff mov $0xffffffff,%eax 4825: eb ef jmp 4816 <stat+0x36> 4827: 89 f6 mov %esi,%esi 4829: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00004830 <atoi>: return r; } int atoi(const char *s) { 4830: 55 push %ebp 4831: 89 e5 mov %esp,%ebp 4833: 53 push %ebx 4834: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 4837: 0f be 11 movsbl (%ecx),%edx 483a: 8d 42 d0 lea -0x30(%edx),%eax 483d: 3c 09 cmp $0x9,%al 483f: b8 00 00 00 00 mov $0x0,%eax 4844: 77 1f ja 4865 <atoi+0x35> 4846: 8d 76 00 lea 0x0(%esi),%esi 4849: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi n = n*10 + *s++ - '0'; 4850: 8d 04 80 lea (%eax,%eax,4),%eax 4853: 83 c1 01 add $0x1,%ecx 4856: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 485a: 0f be 11 movsbl (%ecx),%edx 485d: 8d 5a d0 lea -0x30(%edx),%ebx 4860: 80 fb 09 cmp $0x9,%bl 4863: 76 eb jbe 4850 <atoi+0x20> n = n*10 + *s++ - '0'; return n; } 4865: 5b pop %ebx 4866: 5d pop %ebp 4867: c3 ret 4868: 90 nop 4869: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00004870 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 4870: 55 push %ebp 4871: 89 e5 mov %esp,%ebp 4873: 56 push %esi 4874: 53 push %ebx 4875: 8b 5d 10 mov 0x10(%ebp),%ebx 4878: 8b 45 08 mov 0x8(%ebp),%eax 487b: 8b 75 0c mov 0xc(%ebp),%esi char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 487e: 85 db test %ebx,%ebx 4880: 7e 14 jle 4896 <memmove+0x26> 4882: 31 d2 xor %edx,%edx 4884: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi *dst++ = *src++; 4888: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 488c: 88 0c 10 mov %cl,(%eax,%edx,1) 488f: 83 c2 01 add $0x1,%edx { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 4892: 39 da cmp %ebx,%edx 4894: 75 f2 jne 4888 <memmove+0x18> *dst++ = *src++; return vdst; } 4896: 5b pop %ebx 4897: 5e pop %esi 4898: 5d pop %ebp 4899: c3 ret 0000489a <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 489a: b8 01 00 00 00 mov $0x1,%eax 489f: cd 40 int $0x40 48a1: c3 ret 000048a2 <exit>: SYSCALL(exit) 48a2: b8 02 00 00 00 mov $0x2,%eax 48a7: cd 40 int $0x40 48a9: c3 ret 000048aa <wait>: SYSCALL(wait) 48aa: b8 03 00 00 00 mov $0x3,%eax 48af: cd 40 int $0x40 48b1: c3 ret 000048b2 <pipe>: SYSCALL(pipe) 48b2: b8 04 00 00 00 mov $0x4,%eax 48b7: cd 40 int $0x40 48b9: c3 ret 000048ba <read>: SYSCALL(read) 48ba: b8 05 00 00 00 mov $0x5,%eax 48bf: cd 40 int $0x40 48c1: c3 ret 000048c2 <write>: SYSCALL(write) 48c2: b8 10 00 00 00 mov $0x10,%eax 48c7: cd 40 int $0x40 48c9: c3 ret 000048ca <close>: SYSCALL(close) 48ca: b8 15 00 00 00 mov $0x15,%eax 48cf: cd 40 int $0x40 48d1: c3 ret 000048d2 <kill>: SYSCALL(kill) 48d2: b8 06 00 00 00 mov $0x6,%eax 48d7: cd 40 int $0x40 48d9: c3 ret 000048da <exec>: SYSCALL(exec) 48da: b8 07 00 00 00 mov $0x7,%eax 48df: cd 40 int $0x40 48e1: c3 ret 000048e2 <open>: SYSCALL(open) 48e2: b8 0f 00 00 00 mov $0xf,%eax 48e7: cd 40 int $0x40 48e9: c3 ret 000048ea <mknod>: SYSCALL(mknod) 48ea: b8 11 00 00 00 mov $0x11,%eax 48ef: cd 40 int $0x40 48f1: c3 ret 000048f2 <unlink>: SYSCALL(unlink) 48f2: b8 12 00 00 00 mov $0x12,%eax 48f7: cd 40 int $0x40 48f9: c3 ret 000048fa <fstat>: SYSCALL(fstat) 48fa: b8 08 00 00 00 mov $0x8,%eax 48ff: cd 40 int $0x40 4901: c3 ret 00004902 <link>: SYSCALL(link) 4902: b8 13 00 00 00 mov $0x13,%eax 4907: cd 40 int $0x40 4909: c3 ret 0000490a <mkdir>: SYSCALL(mkdir) 490a: b8 14 00 00 00 mov $0x14,%eax 490f: cd 40 int $0x40 4911: c3 ret 00004912 <chdir>: SYSCALL(chdir) 4912: b8 09 00 00 00 mov $0x9,%eax 4917: cd 40 int $0x40 4919: c3 ret 0000491a <dup>: SYSCALL(dup) 491a: b8 0a 00 00 00 mov $0xa,%eax 491f: cd 40 int $0x40 4921: c3 ret 00004922 <getpid>: SYSCALL(getpid) 4922: b8 0b 00 00 00 mov $0xb,%eax 4927: cd 40 int $0x40 4929: c3 ret 0000492a <sbrk>: SYSCALL(sbrk) 492a: b8 0c 00 00 00 mov $0xc,%eax 492f: cd 40 int $0x40 4931: c3 ret 00004932 <sleep>: SYSCALL(sleep) 4932: b8 0d 00 00 00 mov $0xd,%eax 4937: cd 40 int $0x40 4939: c3 ret 0000493a <uptime>: SYSCALL(uptime) 493a: b8 0e 00 00 00 mov $0xe,%eax 493f: cd 40 int $0x40 4941: c3 ret 00004942 <shm_open>: SYSCALL(shm_open) 4942: b8 16 00 00 00 mov $0x16,%eax 4947: cd 40 int $0x40 4949: c3 ret 0000494a <shm_close>: SYSCALL(shm_close) 494a: b8 17 00 00 00 mov $0x17,%eax 494f: cd 40 int $0x40 4951: c3 ret 4952: 66 90 xchg %ax,%ax 4954: 66 90 xchg %ax,%ax 4956: 66 90 xchg %ax,%ax 4958: 66 90 xchg %ax,%ax 495a: 66 90 xchg %ax,%ax 495c: 66 90 xchg %ax,%ax 495e: 66 90 xchg %ax,%ax 00004960 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 4960: 55 push %ebp 4961: 89 e5 mov %esp,%ebp 4963: 57 push %edi 4964: 56 push %esi 4965: 53 push %ebx 4966: 89 c6 mov %eax,%esi 4968: 83 ec 3c sub $0x3c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 496b: 8b 5d 08 mov 0x8(%ebp),%ebx 496e: 85 db test %ebx,%ebx 4970: 74 7e je 49f0 <printint+0x90> 4972: 89 d0 mov %edx,%eax 4974: c1 e8 1f shr $0x1f,%eax 4977: 84 c0 test %al,%al 4979: 74 75 je 49f0 <printint+0x90> neg = 1; x = -xx; 497b: 89 d0 mov %edx,%eax int i, neg; uint x; neg = 0; if(sgn && xx < 0){ neg = 1; 497d: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) x = -xx; 4984: f7 d8 neg %eax 4986: 89 75 c0 mov %esi,-0x40(%ebp) } else { x = xx; } i = 0; 4989: 31 ff xor %edi,%edi 498b: 8d 5d d7 lea -0x29(%ebp),%ebx 498e: 89 ce mov %ecx,%esi 4990: eb 08 jmp 499a <printint+0x3a> 4992: 8d b6 00 00 00 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 4998: 89 cf mov %ecx,%edi 499a: 31 d2 xor %edx,%edx 499c: 8d 4f 01 lea 0x1(%edi),%ecx 499f: f7 f6 div %esi 49a1: 0f b6 92 f4 64 00 00 movzbl 0x64f4(%edx),%edx }while((x /= base) != 0); 49a8: 85 c0 test %eax,%eax x = xx; } i = 0; do{ buf[i++] = digits[x % base]; 49aa: 88 14 0b mov %dl,(%ebx,%ecx,1) }while((x /= base) != 0); 49ad: 75 e9 jne 4998 <printint+0x38> if(neg) 49af: 8b 45 c4 mov -0x3c(%ebp),%eax 49b2: 8b 75 c0 mov -0x40(%ebp),%esi 49b5: 85 c0 test %eax,%eax 49b7: 74 08 je 49c1 <printint+0x61> buf[i++] = '-'; 49b9: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1) 49be: 8d 4f 02 lea 0x2(%edi),%ecx 49c1: 8d 7c 0d d7 lea -0x29(%ebp,%ecx,1),%edi 49c5: 8d 76 00 lea 0x0(%esi),%esi 49c8: 0f b6 07 movzbl (%edi),%eax #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 49cb: 83 ec 04 sub $0x4,%esp 49ce: 83 ef 01 sub $0x1,%edi 49d1: 6a 01 push $0x1 49d3: 53 push %ebx 49d4: 56 push %esi 49d5: 88 45 d7 mov %al,-0x29(%ebp) 49d8: e8 e5 fe ff ff call 48c2 <write> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 49dd: 83 c4 10 add $0x10,%esp 49e0: 39 df cmp %ebx,%edi 49e2: 75 e4 jne 49c8 <printint+0x68> putc(fd, buf[i]); } 49e4: 8d 65 f4 lea -0xc(%ebp),%esp 49e7: 5b pop %ebx 49e8: 5e pop %esi 49e9: 5f pop %edi 49ea: 5d pop %ebp 49eb: c3 ret 49ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; } else { x = xx; 49f0: 89 d0 mov %edx,%eax static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 49f2: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 49f9: eb 8b jmp 4986 <printint+0x26> 49fb: 90 nop 49fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00004a00 <printf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 4a00: 55 push %ebp 4a01: 89 e5 mov %esp,%ebp 4a03: 57 push %edi 4a04: 56 push %esi 4a05: 53 push %ebx int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4a06: 8d 45 10 lea 0x10(%ebp),%eax } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 4a09: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4a0c: 8b 75 0c mov 0xc(%ebp),%esi } // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 4a0f: 8b 7d 08 mov 0x8(%ebp),%edi int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4a12: 89 45 d0 mov %eax,-0x30(%ebp) 4a15: 0f b6 1e movzbl (%esi),%ebx 4a18: 83 c6 01 add $0x1,%esi 4a1b: 84 db test %bl,%bl 4a1d: 0f 84 b0 00 00 00 je 4ad3 <printf+0xd3> 4a23: 31 d2 xor %edx,%edx 4a25: eb 39 jmp 4a60 <printf+0x60> 4a27: 89 f6 mov %esi,%esi 4a29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 4a30: 83 f8 25 cmp $0x25,%eax 4a33: 89 55 d4 mov %edx,-0x2c(%ebp) state = '%'; 4a36: ba 25 00 00 00 mov $0x25,%edx state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 4a3b: 74 18 je 4a55 <printf+0x55> #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4a3d: 8d 45 e2 lea -0x1e(%ebp),%eax 4a40: 83 ec 04 sub $0x4,%esp 4a43: 88 5d e2 mov %bl,-0x1e(%ebp) 4a46: 6a 01 push $0x1 4a48: 50 push %eax 4a49: 57 push %edi 4a4a: e8 73 fe ff ff call 48c2 <write> 4a4f: 8b 55 d4 mov -0x2c(%ebp),%edx 4a52: 83 c4 10 add $0x10,%esp 4a55: 83 c6 01 add $0x1,%esi int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4a58: 0f b6 5e ff movzbl -0x1(%esi),%ebx 4a5c: 84 db test %bl,%bl 4a5e: 74 73 je 4ad3 <printf+0xd3> c = fmt[i] & 0xff; if(state == 0){ 4a60: 85 d2 test %edx,%edx uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ c = fmt[i] & 0xff; 4a62: 0f be cb movsbl %bl,%ecx 4a65: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 4a68: 74 c6 je 4a30 <printf+0x30> if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 4a6a: 83 fa 25 cmp $0x25,%edx 4a6d: 75 e6 jne 4a55 <printf+0x55> if(c == 'd'){ 4a6f: 83 f8 64 cmp $0x64,%eax 4a72: 0f 84 f8 00 00 00 je 4b70 <printf+0x170> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 4a78: 81 e1 f7 00 00 00 and $0xf7,%ecx 4a7e: 83 f9 70 cmp $0x70,%ecx 4a81: 74 5d je 4ae0 <printf+0xe0> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 4a83: 83 f8 73 cmp $0x73,%eax 4a86: 0f 84 84 00 00 00 je 4b10 <printf+0x110> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 4a8c: 83 f8 63 cmp $0x63,%eax 4a8f: 0f 84 ea 00 00 00 je 4b7f <printf+0x17f> putc(fd, *ap); ap++; } else if(c == '%'){ 4a95: 83 f8 25 cmp $0x25,%eax 4a98: 0f 84 c2 00 00 00 je 4b60 <printf+0x160> #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4a9e: 8d 45 e7 lea -0x19(%ebp),%eax 4aa1: 83 ec 04 sub $0x4,%esp 4aa4: c6 45 e7 25 movb $0x25,-0x19(%ebp) 4aa8: 6a 01 push $0x1 4aaa: 50 push %eax 4aab: 57 push %edi 4aac: e8 11 fe ff ff call 48c2 <write> 4ab1: 83 c4 0c add $0xc,%esp 4ab4: 8d 45 e6 lea -0x1a(%ebp),%eax 4ab7: 88 5d e6 mov %bl,-0x1a(%ebp) 4aba: 6a 01 push $0x1 4abc: 50 push %eax 4abd: 57 push %edi 4abe: 83 c6 01 add $0x1,%esi 4ac1: e8 fc fd ff ff call 48c2 <write> int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4ac6: 0f b6 5e ff movzbl -0x1(%esi),%ebx #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4aca: 83 c4 10 add $0x10,%esp } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 4acd: 31 d2 xor %edx,%edx int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 4acf: 84 db test %bl,%bl 4ad1: 75 8d jne 4a60 <printf+0x60> putc(fd, c); } state = 0; } } } 4ad3: 8d 65 f4 lea -0xc(%ebp),%esp 4ad6: 5b pop %ebx 4ad7: 5e pop %esi 4ad8: 5f pop %edi 4ad9: 5d pop %ebp 4ada: c3 ret 4adb: 90 nop 4adc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); 4ae0: 83 ec 0c sub $0xc,%esp 4ae3: b9 10 00 00 00 mov $0x10,%ecx 4ae8: 6a 00 push $0x0 4aea: 8b 5d d0 mov -0x30(%ebp),%ebx 4aed: 89 f8 mov %edi,%eax 4aef: 8b 13 mov (%ebx),%edx 4af1: e8 6a fe ff ff call 4960 <printint> ap++; 4af6: 89 d8 mov %ebx,%eax 4af8: 83 c4 10 add $0x10,%esp } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 4afb: 31 d2 xor %edx,%edx if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ printint(fd, *ap, 16, 0); ap++; 4afd: 83 c0 04 add $0x4,%eax 4b00: 89 45 d0 mov %eax,-0x30(%ebp) 4b03: e9 4d ff ff ff jmp 4a55 <printf+0x55> 4b08: 90 nop 4b09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } else if(c == 's'){ s = (char*)*ap; 4b10: 8b 45 d0 mov -0x30(%ebp),%eax 4b13: 8b 18 mov (%eax),%ebx ap++; 4b15: 83 c0 04 add $0x4,%eax 4b18: 89 45 d0 mov %eax,-0x30(%ebp) if(s == 0) s = "(null)"; 4b1b: b8 ec 64 00 00 mov $0x64ec,%eax 4b20: 85 db test %ebx,%ebx 4b22: 0f 44 d8 cmove %eax,%ebx while(*s != 0){ 4b25: 0f b6 03 movzbl (%ebx),%eax 4b28: 84 c0 test %al,%al 4b2a: 74 23 je 4b4f <printf+0x14f> 4b2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 4b30: 88 45 e3 mov %al,-0x1d(%ebp) #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4b33: 8d 45 e3 lea -0x1d(%ebp),%eax 4b36: 83 ec 04 sub $0x4,%esp 4b39: 6a 01 push $0x1 ap++; if(s == 0) s = "(null)"; while(*s != 0){ putc(fd, *s); s++; 4b3b: 83 c3 01 add $0x1,%ebx #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4b3e: 50 push %eax 4b3f: 57 push %edi 4b40: e8 7d fd ff ff call 48c2 <write> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 4b45: 0f b6 03 movzbl (%ebx),%eax 4b48: 83 c4 10 add $0x10,%esp 4b4b: 84 c0 test %al,%al 4b4d: 75 e1 jne 4b30 <printf+0x130> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 4b4f: 31 d2 xor %edx,%edx 4b51: e9 ff fe ff ff jmp 4a55 <printf+0x55> 4b56: 8d 76 00 lea 0x0(%esi),%esi 4b59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4b60: 83 ec 04 sub $0x4,%esp 4b63: 88 5d e5 mov %bl,-0x1b(%ebp) 4b66: 8d 45 e5 lea -0x1b(%ebp),%eax 4b69: 6a 01 push $0x1 4b6b: e9 4c ff ff ff jmp 4abc <printf+0xbc> } else { putc(fd, c); } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); 4b70: 83 ec 0c sub $0xc,%esp 4b73: b9 0a 00 00 00 mov $0xa,%ecx 4b78: 6a 01 push $0x1 4b7a: e9 6b ff ff ff jmp 4aea <printf+0xea> 4b7f: 8b 5d d0 mov -0x30(%ebp),%ebx #include "user.h" static void putc(int fd, char c) { write(fd, &c, 1); 4b82: 83 ec 04 sub $0x4,%esp 4b85: 8b 03 mov (%ebx),%eax 4b87: 6a 01 push $0x1 4b89: 88 45 e4 mov %al,-0x1c(%ebp) 4b8c: 8d 45 e4 lea -0x1c(%ebp),%eax 4b8f: 50 push %eax 4b90: 57 push %edi 4b91: e8 2c fd ff ff call 48c2 <write> 4b96: e9 5b ff ff ff jmp 4af6 <printf+0xf6> 4b9b: 66 90 xchg %ax,%ax 4b9d: 66 90 xchg %ax,%ax 4b9f: 90 nop 00004ba0 <free>: static Header base; static Header *freep; void free(void *ap) { 4ba0: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 4ba1: a1 c0 6e 00 00 mov 0x6ec0,%eax static Header base; static Header *freep; void free(void *ap) { 4ba6: 89 e5 mov %esp,%ebp 4ba8: 57 push %edi 4ba9: 56 push %esi 4baa: 53 push %ebx 4bab: 8b 5d 08 mov 0x8(%ebp),%ebx Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 4bae: 8b 10 mov (%eax),%edx void free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; 4bb0: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 4bb3: 39 c8 cmp %ecx,%eax 4bb5: 73 19 jae 4bd0 <free+0x30> 4bb7: 89 f6 mov %esi,%esi 4bb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 4bc0: 39 d1 cmp %edx,%ecx 4bc2: 72 1c jb 4be0 <free+0x40> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 4bc4: 39 d0 cmp %edx,%eax 4bc6: 73 18 jae 4be0 <free+0x40> static Header base; static Header *freep; void free(void *ap) { 4bc8: 89 d0 mov %edx,%eax Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 4bca: 39 c8 cmp %ecx,%eax if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 4bcc: 8b 10 mov (%eax),%edx free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 4bce: 72 f0 jb 4bc0 <free+0x20> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 4bd0: 39 d0 cmp %edx,%eax 4bd2: 72 f4 jb 4bc8 <free+0x28> 4bd4: 39 d1 cmp %edx,%ecx 4bd6: 73 f0 jae 4bc8 <free+0x28> 4bd8: 90 nop 4bd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi break; if(bp + bp->s.size == p->s.ptr){ 4be0: 8b 73 fc mov -0x4(%ebx),%esi 4be3: 8d 3c f1 lea (%ecx,%esi,8),%edi 4be6: 39 d7 cmp %edx,%edi 4be8: 74 19 je 4c03 <free+0x63> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 4bea: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 4bed: 8b 50 04 mov 0x4(%eax),%edx 4bf0: 8d 34 d0 lea (%eax,%edx,8),%esi 4bf3: 39 f1 cmp %esi,%ecx 4bf5: 74 23 je 4c1a <free+0x7a> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 4bf7: 89 08 mov %ecx,(%eax) freep = p; 4bf9: a3 c0 6e 00 00 mov %eax,0x6ec0 } 4bfe: 5b pop %ebx 4bff: 5e pop %esi 4c00: 5f pop %edi 4c01: 5d pop %ebp 4c02: c3 ret bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 4c03: 03 72 04 add 0x4(%edx),%esi 4c06: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 4c09: 8b 10 mov (%eax),%edx 4c0b: 8b 12 mov (%edx),%edx 4c0d: 89 53 f8 mov %edx,-0x8(%ebx) } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ 4c10: 8b 50 04 mov 0x4(%eax),%edx 4c13: 8d 34 d0 lea (%eax,%edx,8),%esi 4c16: 39 f1 cmp %esi,%ecx 4c18: 75 dd jne 4bf7 <free+0x57> p->s.size += bp->s.size; 4c1a: 03 53 fc add -0x4(%ebx),%edx p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; freep = p; 4c1d: a3 c0 6e 00 00 mov %eax,0x6ec0 bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 4c22: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 4c25: 8b 53 f8 mov -0x8(%ebx),%edx 4c28: 89 10 mov %edx,(%eax) } else p->s.ptr = bp; freep = p; } 4c2a: 5b pop %ebx 4c2b: 5e pop %esi 4c2c: 5f pop %edi 4c2d: 5d pop %ebp 4c2e: c3 ret 4c2f: 90 nop 00004c30 <malloc>: return freep; } void* malloc(uint nbytes) { 4c30: 55 push %ebp 4c31: 89 e5 mov %esp,%ebp 4c33: 57 push %edi 4c34: 56 push %esi 4c35: 53 push %ebx 4c36: 83 ec 0c sub $0xc,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 4c39: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 4c3c: 8b 15 c0 6e 00 00 mov 0x6ec0,%edx malloc(uint nbytes) { Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 4c42: 8d 78 07 lea 0x7(%eax),%edi 4c45: c1 ef 03 shr $0x3,%edi 4c48: 83 c7 01 add $0x1,%edi if((prevp = freep) == 0){ 4c4b: 85 d2 test %edx,%edx 4c4d: 0f 84 a3 00 00 00 je 4cf6 <malloc+0xc6> 4c53: 8b 02 mov (%edx),%eax 4c55: 8b 48 04 mov 0x4(%eax),%ecx base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 4c58: 39 cf cmp %ecx,%edi 4c5a: 76 74 jbe 4cd0 <malloc+0xa0> 4c5c: 81 ff 00 10 00 00 cmp $0x1000,%edi 4c62: be 00 10 00 00 mov $0x1000,%esi 4c67: 8d 1c fd 00 00 00 00 lea 0x0(,%edi,8),%ebx 4c6e: 0f 43 f7 cmovae %edi,%esi 4c71: ba 00 80 00 00 mov $0x8000,%edx 4c76: 81 ff ff 0f 00 00 cmp $0xfff,%edi 4c7c: 0f 46 da cmovbe %edx,%ebx 4c7f: eb 10 jmp 4c91 <malloc+0x61> 4c81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 4c88: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 4c8a: 8b 48 04 mov 0x4(%eax),%ecx 4c8d: 39 cf cmp %ecx,%edi 4c8f: 76 3f jbe 4cd0 <malloc+0xa0> p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 4c91: 39 05 c0 6e 00 00 cmp %eax,0x6ec0 4c97: 89 c2 mov %eax,%edx 4c99: 75 ed jne 4c88 <malloc+0x58> char *p; Header *hp; if(nu < 4096) nu = 4096; p = sbrk(nu * sizeof(Header)); 4c9b: 83 ec 0c sub $0xc,%esp 4c9e: 53 push %ebx 4c9f: e8 86 fc ff ff call 492a <sbrk> if(p == (char*)-1) 4ca4: 83 c4 10 add $0x10,%esp 4ca7: 83 f8 ff cmp $0xffffffff,%eax 4caa: 74 1c je 4cc8 <malloc+0x98> return 0; hp = (Header*)p; hp->s.size = nu; 4cac: 89 70 04 mov %esi,0x4(%eax) free((void*)(hp + 1)); 4caf: 83 ec 0c sub $0xc,%esp 4cb2: 83 c0 08 add $0x8,%eax 4cb5: 50 push %eax 4cb6: e8 e5 fe ff ff call 4ba0 <free> return freep; 4cbb: 8b 15 c0 6e 00 00 mov 0x6ec0,%edx } freep = prevp; return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) 4cc1: 83 c4 10 add $0x10,%esp 4cc4: 85 d2 test %edx,%edx 4cc6: 75 c0 jne 4c88 <malloc+0x58> return 0; 4cc8: 31 c0 xor %eax,%eax 4cca: eb 1c jmp 4ce8 <malloc+0xb8> 4ccc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ if(p->s.size == nunits) 4cd0: 39 cf cmp %ecx,%edi 4cd2: 74 1c je 4cf0 <malloc+0xc0> prevp->s.ptr = p->s.ptr; else { p->s.size -= nunits; 4cd4: 29 f9 sub %edi,%ecx 4cd6: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 4cd9: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 4cdc: 89 78 04 mov %edi,0x4(%eax) } freep = prevp; 4cdf: 89 15 c0 6e 00 00 mov %edx,0x6ec0 return (void*)(p + 1); 4ce5: 83 c0 08 add $0x8,%eax } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } } 4ce8: 8d 65 f4 lea -0xc(%ebp),%esp 4ceb: 5b pop %ebx 4cec: 5e pop %esi 4ced: 5f pop %edi 4cee: 5d pop %ebp 4cef: c3 ret base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ if(p->s.size == nunits) prevp->s.ptr = p->s.ptr; 4cf0: 8b 08 mov (%eax),%ecx 4cf2: 89 0a mov %ecx,(%edx) 4cf4: eb e9 jmp 4cdf <malloc+0xaf> Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; 4cf6: c7 05 c0 6e 00 00 c4 movl $0x6ec4,0x6ec0 4cfd: 6e 00 00 4d00: c7 05 c4 6e 00 00 c4 movl $0x6ec4,0x6ec4 4d07: 6e 00 00 base.s.size = 0; 4d0a: b8 c4 6e 00 00 mov $0x6ec4,%eax 4d0f: c7 05 c8 6e 00 00 00 movl $0x0,0x6ec8 4d16: 00 00 00 4d19: e9 3e ff ff ff jmp 4c5c <malloc+0x2c> 4d1e: 66 90 xchg %ax,%ax 00004d20 <uacquire>: #include "uspinlock.h" #include "x86.h" void uacquire(struct uspinlock *lk) { 4d20: 55 push %ebp xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 4d21: b9 01 00 00 00 mov $0x1,%ecx 4d26: 89 e5 mov %esp,%ebp 4d28: 8b 55 08 mov 0x8(%ebp),%edx 4d2b: 90 nop 4d2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 4d30: 89 c8 mov %ecx,%eax 4d32: f0 87 02 lock xchg %eax,(%edx) // The xchg is atomic. while(xchg(&lk->locked, 1) != 0) 4d35: 85 c0 test %eax,%eax 4d37: 75 f7 jne 4d30 <uacquire+0x10> ; // Tell the C compiler and the processor to not move loads or stores // past this point, to ensure that the critical section's memory // references happen after the lock is acquired. __sync_synchronize(); 4d39: f0 83 0c 24 00 lock orl $0x0,(%esp) } 4d3e: 5d pop %ebp 4d3f: c3 ret 00004d40 <urelease>: void urelease (struct uspinlock *lk) { 4d40: 55 push %ebp 4d41: 89 e5 mov %esp,%ebp 4d43: 8b 45 08 mov 0x8(%ebp),%eax __sync_synchronize(); 4d46: f0 83 0c 24 00 lock orl $0x0,(%esp) // Release the lock, equivalent to lk->locked = 0. // This code can't use a C assignment, since it might // not be atomic. A real OS would use C atomics here. asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 4d4b: c7 00 00 00 00 00 movl $0x0,(%eax) } 4d51: 5d pop %ebp 4d52: c3 ret
34.076498
240
0.443185
60533b9ff41cff394dba41263a93266879e71d7a
168
asm
Assembly
libsrc/_DEVELOPMENT/inttypes/c/sdcc_iy/strtoimax.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/inttypes/c/sdcc_iy/strtoimax.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/inttypes/c/sdcc_iy/strtoimax.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
null
null
null
; intmax_t strtoimax(const char *nptr, char **endptr, int base) SECTION code_clib SECTION code_inttypes PUBLIC _strtoimax EXTERN _strtol defc _strtoimax = _strtol
14
63
0.791667
92294da026b69e5e8e0c1b3002ab6bc31be6ab4c
572
asm
Assembly
programs/oeis/082/A082149.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/082/A082149.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/082/A082149.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A082149: A transform of C(n,2). ; 0,0,1,6,30,140,615,2562,10220,39384,147645,541310,1948650,6908772,24180611,83702010,286978200,975725744,3293074233,11041484022,36804946550,122037454140,402723598431,1323234680306,4330586226180,14121476824200,45894799678325,148699150957422,480412641554370,1547996289452564,4975702358954235 mov $2,$0 cal $0,229472 ; Number of defective 4-colorings of an n X 1 0..3 array connected horizontally, antidiagonally and vertically with exactly one mistake, and colors introduced in row-major 0..3 order. add $1,$2 sub $1,1 mul $1,$0 div $1,2
57.2
290
0.805944
9bcd45abd5537d5e7d7ee73ebeb26cd9051e0354
8,842
asm
Assembly
NandToTetris/projects/08/FunctionCalls/StaticsTest/StaticsTest.asm
davejlin/coursera
ac156968c1d886acfb88b699b9c31138f785eb50
[ "Unlicense" ]
null
null
null
NandToTetris/projects/08/FunctionCalls/StaticsTest/StaticsTest.asm
davejlin/coursera
ac156968c1d886acfb88b699b9c31138f785eb50
[ "Unlicense" ]
2
2016-12-26T04:13:48.000Z
2020-06-08T01:17:39.000Z
NandToTetris/projects/08/VMTranslator/files/StaticsTest/StaticsTest.asm
davejlin/coursera
ac156968c1d886acfb88b699b9c31138f785eb50
[ "Unlicense" ]
null
null
null
// Bootstrap code @256 D=A @SP M=D @bootstrap$return.0 D=A @SP AM=M+1 A=A-1 M=D // push bootstrap$return.0 @LCL D=M @SP AM=M+1 A=A-1 M=D // push LCL @ARG D=M @SP AM=M+1 A=A-1 M=D // push ARG @THIS D=M @SP AM=M+1 A=A-1 M=D // push THIS @THAT D=M @SP AM=M+1 A=A-1 M=D // push THAT @SP D=M @5 D=D-A @0 D=D-A @ARG M=D // ARG[0] = SP - 5 - nArgs @SP D=M @LCL M=D // LCL = SP @Sys.init 0;JMP (bootstrap$return.0) (bootstrapEnd) @bootstrapEnd 0;JMP // function Class1.set 0 (Class1.set) // push argument 0 @ARG D=M @0 A=A+D D=M @SP AM=M+1 A=A-1 M=D // pop static 0 @SP AM=M-1 D=M @Class1.0 M=D // push argument 1 @ARG D=M @1 A=A+D D=M @SP AM=M+1 A=A-1 M=D // pop static 1 @SP AM=M-1 D=M @Class1.1 M=D // push constant 0 @0 D=A @SP AM=M+1 A=A-1 M=D // return @LCL D=M @endFrame M=D // endFrame = LCL @5 D=D-A A=D D=M @retAddr M=D // retAddr = *(endFrame – 5) @ARG D=M @R13 M=D // R13 = ARG[0] @SP A=M-1 D=M @ARG A=M M=D // *ARG[0] = POP() @R13 D=M @SP M=D+1 // SP = ARG[0] + 1 @endFrame D=M @1 D=D-A A=D D=M @THAT M=D // THAT = *(endFrame - 1) @endFrame D=M @2 D=D-A A=D D=M @THIS M=D // THIS = *(endFrame - 2) @endFrame D=M @3 D=D-A A=D D=M @ARG M=D // ARG = *(endFrame - 3) @endFrame D=M @4 D=D-A A=D D=M @LCL M=D // LCL = *(endFrame - 4) @retAddr A=M 0;JMP // goto retAddr // function Class1.get 0 (Class1.get) // push static 0 @Class1.0 D=M @SP AM=M+1 A=A-1 M=D // push static 1 @Class1.1 D=M @SP AM=M+1 A=A-1 M=D // sub @SP AM=M-1 D=M A=A-1 M=M-D // return @LCL D=M @endFrame M=D // endFrame = LCL @5 D=D-A A=D D=M @retAddr M=D // retAddr = *(endFrame – 5) @ARG D=M @R13 M=D // R13 = ARG[0] @SP A=M-1 D=M @ARG A=M M=D // *ARG[0] = POP() @R13 D=M @SP M=D+1 // SP = ARG[0] + 1 @endFrame D=M @1 D=D-A A=D D=M @THAT M=D // THAT = *(endFrame - 1) @endFrame D=M @2 D=D-A A=D D=M @THIS M=D // THIS = *(endFrame - 2) @endFrame D=M @3 D=D-A A=D D=M @ARG M=D // ARG = *(endFrame - 3) @endFrame D=M @4 D=D-A A=D D=M @LCL M=D // LCL = *(endFrame - 4) @retAddr A=M 0;JMP // goto retAddr // function Class2.set 0 (Class2.set) // push argument 0 @ARG D=M @0 A=A+D D=M @SP AM=M+1 A=A-1 M=D // pop static 0 @SP AM=M-1 D=M @Class2.0 M=D // push argument 1 @ARG D=M @1 A=A+D D=M @SP AM=M+1 A=A-1 M=D // pop static 1 @SP AM=M-1 D=M @Class2.1 M=D // push constant 0 @0 D=A @SP AM=M+1 A=A-1 M=D // return @LCL D=M @endFrame M=D // endFrame = LCL @5 D=D-A A=D D=M @retAddr M=D // retAddr = *(endFrame – 5) @ARG D=M @R13 M=D // R13 = ARG[0] @SP A=M-1 D=M @ARG A=M M=D // *ARG[0] = POP() @R13 D=M @SP M=D+1 // SP = ARG[0] + 1 @endFrame D=M @1 D=D-A A=D D=M @THAT M=D // THAT = *(endFrame - 1) @endFrame D=M @2 D=D-A A=D D=M @THIS M=D // THIS = *(endFrame - 2) @endFrame D=M @3 D=D-A A=D D=M @ARG M=D // ARG = *(endFrame - 3) @endFrame D=M @4 D=D-A A=D D=M @LCL M=D // LCL = *(endFrame - 4) @retAddr A=M 0;JMP // goto retAddr // function Class2.get 0 (Class2.get) // push static 0 @Class2.0 D=M @SP AM=M+1 A=A-1 M=D // push static 1 @Class2.1 D=M @SP AM=M+1 A=A-1 M=D // sub @SP AM=M-1 D=M A=A-1 M=M-D // return @LCL D=M @endFrame M=D // endFrame = LCL @5 D=D-A A=D D=M @retAddr M=D // retAddr = *(endFrame – 5) @ARG D=M @R13 M=D // R13 = ARG[0] @SP A=M-1 D=M @ARG A=M M=D // *ARG[0] = POP() @R13 D=M @SP M=D+1 // SP = ARG[0] + 1 @endFrame D=M @1 D=D-A A=D D=M @THAT M=D // THAT = *(endFrame - 1) @endFrame D=M @2 D=D-A A=D D=M @THIS M=D // THIS = *(endFrame - 2) @endFrame D=M @3 D=D-A A=D D=M @ARG M=D // ARG = *(endFrame - 3) @endFrame D=M @4 D=D-A A=D D=M @LCL M=D // LCL = *(endFrame - 4) @retAddr A=M 0;JMP // goto retAddr // function Sys.init 0 (Sys.init) // push constant 6 @6 D=A @SP AM=M+1 A=A-1 M=D // push constant 8 @8 D=A @SP AM=M+1 A=A-1 M=D // call Class1.set 2 @Sys$return.1 D=A @SP AM=M+1 A=A-1 M=D // push Sys$return.1 @LCL D=M @SP AM=M+1 A=A-1 M=D // push LCL @ARG D=M @SP AM=M+1 A=A-1 M=D // push ARG @THIS D=M @SP AM=M+1 A=A-1 M=D // push THIS @THAT D=M @SP AM=M+1 A=A-1 M=D // push THAT @SP D=M @5 D=D-A @2 D=D-A @ARG M=D // ARG[0] = SP - 5 - nArgs @SP D=M @LCL M=D // LCL = SP @Class1.set 0;JMP (Sys$return.1) // pop temp 0 @SP AM=M-1 D=M @5 M=D // push constant 23 @23 D=A @SP AM=M+1 A=A-1 M=D // push constant 15 @15 D=A @SP AM=M+1 A=A-1 M=D // call Class2.set 2 @Sys$return.2 D=A @SP AM=M+1 A=A-1 M=D // push Sys$return.2 @LCL D=M @SP AM=M+1 A=A-1 M=D // push LCL @ARG D=M @SP AM=M+1 A=A-1 M=D // push ARG @THIS D=M @SP AM=M+1 A=A-1 M=D // push THIS @THAT D=M @SP AM=M+1 A=A-1 M=D // push THAT @SP D=M @5 D=D-A @2 D=D-A @ARG M=D // ARG[0] = SP - 5 - nArgs @SP D=M @LCL M=D // LCL = SP @Class2.set 0;JMP (Sys$return.2) // pop temp 0 @SP AM=M-1 D=M @5 M=D // call Class1.get 0 @Sys$return.3 D=A @SP AM=M+1 A=A-1 M=D // push Sys$return.3 @LCL D=M @SP AM=M+1 A=A-1 M=D // push LCL @ARG D=M @SP AM=M+1 A=A-1 M=D // push ARG @THIS D=M @SP AM=M+1 A=A-1 M=D // push THIS @THAT D=M @SP AM=M+1 A=A-1 M=D // push THAT @SP D=M @5 D=D-A @0 D=D-A @ARG M=D // ARG[0] = SP - 5 - nArgs @SP D=M @LCL M=D // LCL = SP @Class1.get 0;JMP (Sys$return.3) // call Class2.get 0 @Sys$return.4 D=A @SP AM=M+1 A=A-1 M=D // push Sys$return.4 @LCL D=M @SP AM=M+1 A=A-1 M=D // push LCL @ARG D=M @SP AM=M+1 A=A-1 M=D // push ARG @THIS D=M @SP AM=M+1 A=A-1 M=D // push THIS @THAT D=M @SP AM=M+1 A=A-1 M=D // push THAT @SP D=M @5 D=D-A @0 D=D-A @ARG M=D // ARG[0] = SP - 5 - nArgs @SP D=M @LCL M=D // LCL = SP @Class2.get 0;JMP (Sys$return.4) // label WHILE (Sys.init:WHILE) // goto WHILE @Sys.init:WHILE 0;JMP
13.603077
44
0.345736
a7ec7effddb3982a2a0a526164f1e96f08e8fd35
597
asm
Assembly
oeis/294/A294628.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/294/A294628.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/294/A294628.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A294628: a(n) = 8*(sigma(n) - n + (1/2)). ; Submitted by Jon Maiga ; 4,12,12,28,12,52,12,60,36,68,12,132,12,84,76,124,12,172,12,180,92,116,12,292,52,132,108,228,12,340,12,252,124,164,108,444,12,180,140,404,12,436,12,324,268,212,12,612,68,348,172,372,12,532,140,516,188,260,12,868,12,276,332,508,156,628,12,468,220,596,12,988,12,324,396,516,156,724,12,852,324,356,12,1124,188,372,268,740,12,1156,172,612,284,404,204,1252,12,588,460,940 add $0,1 sub $1,$0 mov $2,$0 lpb $0 mov $3,$2 dif $3,$0 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,1 add $1,$3 lpe add $1,1 mov $0,$1 mul $0,8 add $0,4
28.428571
367
0.638191
032db4756c7fc290520857ba1fe4989b6330e42b
945
asm
Assembly
os/keyboard.asm
Sebazzz/sdos
1db1ca3c1e5bd7ad3c7600eb8a2d846b4a0e7005
[ "MIT" ]
1
2017-09-03T23:57:41.000Z
2017-09-03T23:57:41.000Z
os/keyboard.asm
Sebazzz/sdos
1db1ca3c1e5bd7ad3c7600eb8a2d846b4a0e7005
[ "MIT" ]
null
null
null
os/keyboard.asm
Sebazzz/sdos
1db1ca3c1e5bd7ad3c7600eb8a2d846b4a0e7005
[ "MIT" ]
null
null
null
; keyboard.asm ; Keyboard control routines [bits 32] %include "../hwport.incl.asm" section .text ; get_scancode ; Get a single scan code from the keyboard ; ; Input: nothing ; Output: char global get_scancode get_scancode: .loop: in al, KDB_PS2_ADDR ; store key code in eax cmp al, 0xFE jz .loop ; Essentially, keep looping until found in al, KDB_PS2_ADDR ; SystemV calling convention expects return value in eax movzx eax, byte al ret ; wait_key ; Waits for a key to be pressed before returning control ; ; Input: nothing ; Output: nothing ; global wait_key wait_key: mov [last_scancode], dword 0 push eax .loop: hlt ; wake up on interrupt mov eax, [last_scancode] cmp eax, 0 jz .loop .done: pop eax ret ; keyboard_handler ; Record the latest keyboard scan code ; global keyboard_handler keyboard_handler: xor eax, eax in al, KDB_PS2_ADDR mov [last_scancode],eax ret section .data last_scancode: dd 0x0
15.241935
57
0.731217
64bb22a1ab6f7e0d2e3f16818c08cd688bb6540f
612
asm
Assembly
programs/oeis/227/A227316.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/227/A227316.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/227/A227316.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A227316: a(n) = n(n+1) if n == 0 or 1 (mod 4), otherwise a(n) = n(n+1)/2. ; 0,2,3,6,20,30,21,28,72,90,55,66,156,182,105,120,272,306,171,190,420,462,253,276,600,650,351,378,812,870,465,496,1056,1122,595,630,1332,1406,741,780,1640,1722,903,946,1980,2070,1081,1128,2352,2450,1275,1326,2756,2862,1485,1540,3192,3306,1711,1770,3660,3782,1953,2016,4160,4290,2211,2278,4692,4830,2485,2556,5256,5402,2775,2850,5852,6006,3081,3160,6480,6642,3403,3486,7140,7310,3741,3828,7832,8010,4095,4186,8556,8742,4465,4560,9312,9506,4851,4950 mov $1,$0 mod $1,4 mov $2,$0 mul $2,$0 add $0,$2 mov $3,$1 add $3,6 div $3,4 div $0,$3
47.076923
447
0.70098
cee911b1e3159b549a8b3c70a9fe6c40e5f5100d
436
asm
Assembly
programs/oeis/057/A057088.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/057/A057088.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/057/A057088.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A057088: Scaled Chebyshev U-polynomials evaluated at i*sqrt(5)/2. Generalized Fibonacci sequence. ; 1,5,30,175,1025,6000,35125,205625,1203750,7046875,41253125,241500000,1413765625,8276328125,48450468750,283633984375,1660422265625,9720281250000,56903517578125,333118994140625,1950112558593750,11416157763671875,66831351611328125 add $0,1 cal $0,106565 ; Let M={{0, 5}, {1, 5}}, v[n]=M.v[n-1]; then a(n) =v[n][[1]]. mov $1,$0 div $1,5
54.5
229
0.763761
381fc89116bf0110b08aaff6800139f337621240
980
asm
Assembly
Modul 3/latih12.asm
hyuwah/fu-praktikum-smd
a06fe109a42aa96e75f9a425a0905d6bfbfdfc7e
[ "MIT" ]
null
null
null
Modul 3/latih12.asm
hyuwah/fu-praktikum-smd
a06fe109a42aa96e75f9a425a0905d6bfbfdfc7e
[ "MIT" ]
null
null
null
Modul 3/latih12.asm
hyuwah/fu-praktikum-smd
a06fe109a42aa96e75f9a425a0905d6bfbfdfc7e
[ "MIT" ]
null
null
null
;-------------------------------------------------------------------- ; Praktikum SMD 2015 ; M.Wahyudin (140310120031) ; ; Name : LATIH12.ASM ; Desc : Menampilkan digit 1234 dari tabel ke 4-display segmen ; Input : - ; Output: 4-display segmen di P2 ;-------------------------------------------------------------------- cseg at 0 digit: mov R0, #4 ; Menentukan pengulangan 4 kali mov dptr, #tabel ; mengambil alamat tabel ulang: mov A, R0 dec A movc A, @A+dptr ; mengambil tampilan dari tabel mov P2, A ; mengirimkan digi ke P2 call tunda ; tunda djnz R0, ulang ; ulang ke-4 digit tampilan jmp digit ; ulang ke awal tunda: mov R7, #0 djnz R7, $ ret tabel: db 01h, 12h, 23h, 34h ; tabel digit ; Jika bcd (biasa) tak support multi 7 segment diganti : ; 11h, 22h, 43h, 84h ; MSB: 1111b LSB: BCD ; MSB: 8421d LSB: BCD end
29.69697
69
0.489796
6787b5b8bd4f30a3a217564cc37eaf0a35abb555
721
asm
Assembly
oeis/232/A232230.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/232/A232230.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/232/A232230.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A232230: Expansion of (1 - 2*x + x^2 + x^3 + x^5) / ((1 - x)*(1 - 2*x - x^3)). ; 1,1,2,6,14,32,72,160,354,782,1726,3808,8400,18528,40866,90134,198798,438464,967064,2132928,4704322,10375710,22884350,50473024,111321760,245527872,541528770,1194379302,2634286478,5810101728,12814582760,28263452000,62337005730,137488594222,303240640446,668818286624,1475125167472,3253490975392,7175800237410,15826725642294,34906942259982,76989684757376,169806095157048,374519132574080,826027949905538,1821861994968126,4018243122510334,8862514194926208,19546890384820544,43112023892151424 trn $0,1 seq $0,193641 ; Number of arrays of -1..1 integers x(1..n) with every x(i) in a subsequence of length 1 or 2 with sum zero. trn $0,2 add $0,1
90.125
487
0.793343