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
ed09e975ed149316b08a1c264beedaba06d88e06
5,778
asm
Assembly
examples/am2302-test.asm
TPKato/pAVRlib
0565d51b368c11fa0673b1d8b70c1776d355d754
[ "MIT" ]
null
null
null
examples/am2302-test.asm
TPKato/pAVRlib
0565d51b368c11fa0673b1d8b70c1776d355d754
[ "MIT" ]
null
null
null
examples/am2302-test.asm
TPKato/pAVRlib
0565d51b368c11fa0673b1d8b70c1776d355d754
[ "MIT" ]
null
null
null
;;; Test program of devices/am2302.asm ;;; ;;- This program reads data from AM2302 and show the data via USART like this: ;;- ;;- #+begin_src sh ;;- $ dterm /dev/ttyUSB0 4800 ;;- # Hallo AM2302 ;;- 59.6 %RH, 24.0 C [02 54 00 F0 46] (77 33, 62 00) ;;- 59.7 %RH, 23.9 C [02 55 00 EF 46] (77 66, 61 CC) ;;- 59.8 %RH, 23.9 C [02 56 00 EF 47] (77 99, 61 CC) ;;- : ;;- : ;;- #+end_src ;;- where: ;;- - values in [...]: raw data from AM2302 ;;- - values in (...): converted humidity and temperature for CCS811 ;;- ;;- To compile this file, the following files are required ;;- (These files are parts of the pAVRlib). ;;- ;;- - [[../../devices/am2302][devices/am2302]] ;;- - [[../../devices/am2302-ccs811][devices/am2302-ccs811.asm]] ;;- - [[../../usart][usart.asm]] ;;- - [[../../usart-puts][usart-puts.asm]] ;;- - [[../../usart-puthex][usart-puthex.asm]] ;;- - [[../../bin2ascii][bin2ascii.asm]] ;;- - [[../../bin2bcd16][bin2bcd16.asm]] ;;- - [[../../wait][wait.asm]] ;;- ;;- See also: ~examples/README.org~ ;;- ;;; ------------------------------------------------------------ ;;; Define your device in device.inc or use ;;; .include "m8def.inc" ;;; and so on as usual. .include "device.inc" ;; ------------------------------------------------------------ ; interupt vectors rjmp RESET reti ;rjmp EXT_INT0 reti ;rjmp EXT_INT1 reti ;rjmp TIM2_COMP reti ;rjmp TIM2_OVF reti ;rjmp TIM1_CAPT reti ;rjmp TIM1_COMPA reti ;rjmp TIM1_COMPB reti ;rjmp INT_TIM1_OVF reti ;rjmp TIM0_OVF reti ;rjmp SPI_STC reti ;rjmp USART_RXC reti ;rjmp USART_UDRE reti ;rjmp USART_TXC reti ;rjmp ADC reti ;rjmp EE_RDY reti ;rjmp ANA_COMP reti ;rjmp TWI reti ;rjmp SPM_RDY RESET: ldi r16, high(RAMEND) out SPH, r16 ldi r16, low(RAMEND) out SPL, r16 rcall USART_INITIALIZE hello: ldi r25, high(STR_HELLO) ldi r24, low (STR_HELLO) rcall USART_PUTS ;; dummy read to acquire the latest values ;; (It doesn't really matter, because this program reads the ;; data in short enough intervals.) rcall AM2302_READ main: rcall Wait1sec rcall Wait1sec rcall Wait1sec rcall AM2302_READ inc r25 tst r25 brne showinfo ;; parity error ldi r25, high(STR_PERROR) ldi r24, low (STR_PERROR) rcall USART_PUTS rjmp main showinfo: dec r25 ;; ---------------------------------------- ;; show humidity rcall USART_Humidity ;; ---------------------------------------- ;; show temperature push r25 push r24 ldi r24, ',' rcall USART_TRANSMIT ldi r24, ' ' rcall USART_TRANSMIT mov r25, r23 mov r24, r22 rcall USART_Temperature ldi r24, ' ' rcall USART_TRANSMIT pop r24 pop r25 ;; ---------------------------------------- ;; show rawdata rcall AM2302_USART_RAWDATA ;; ---------------------------------------- ;; show converted humidity for CCS811 push r24 ldi r24, ' ' rcall USART_TRANSMIT ldi r24, '(' rcall USART_TRANSMIT pop r24 ;; push r25 ; if you want to keep the original values ;; push r24 rcall CONVERT_HUMIDITY_FOR_CCS811 push r24 mov r24, r25 rcall USART_PUTHEX ldi r24, ' ' rcall USART_TRANSMIT pop r24 rcall USART_PUTHEX ldi r24, ',' rcall USART_TRANSMIT ldi r24, ' ' rcall USART_TRANSMIT ;; pop r24 ;; pop r25 ;; ---------------------------------------- ;; show converted temperature for CCS811 ;; push r25 ; if you want to keep the original values ;; push r24 mov r25, r23 mov r24, r22 rcall CONVERT_TEMPERATURE_FOR_CCS811 push r24 mov r24, r25 rcall USART_PUTHEX ldi r24, ' ' rcall USART_TRANSMIT pop r24 rcall USART_PUTHEX ldi r24, ')' rcall USART_TRANSMIT ;; pop r24 ;; pop r25 ;; ---------------------------------------- ;; push r24 ; if you want to keep the original values ldi r24, 0x0d rcall USART_TRANSMIT ldi r24, 0x0a rcall USART_TRANSMIT ;; pop r24 rjmp main ;;; ------------------------------------------------------------ USART_Humidity: push r25 push r24 rcall _USART_value ldi r24, ' ' rcall USART_TRANSMIT ldi r24, '%' rcall USART_TRANSMIT ldi r24, 'R' rcall USART_TRANSMIT ldi r24, 'H' rcall USART_TRANSMIT pop r24 pop r25 ret USART_Temperature: push r25 push r24 sbrs r25, 7 rjmp _show_temp1 andi r25, 0x7f ldi r24, '-' rcall USART_TRANSMIT _show_temp1: rcall _USART_value ldi r24, ' ' rcall USART_TRANSMIT ldi r24, 'C' rcall USART_TRANSMIT pop r24 pop r25 ret ;;; [in] r25:r24 _USART_value: push r19 clr r19 ;; BIN2BCD16: [in] r25:r24 [out] r25:r24:r23 push r23 rcall BIN2BCD16 andi r25, 0x0f tst r25 breq _show_1 ldi r19, '0' _show_1: add r25, r19 push r24 mov r24, r25 rcall USART_TRANSMIT pop r24 push r24 swap r24 andi r24, 0x0f tst r24 breq _show_2 ldi r19, '0' _show_2: add r24, r19 rcall USART_TRANSMIT pop r24 andi r24, 0x0f tst r24 breq _show_3 ldi r19, '0' _show_3: add r24, r19 rcall USART_TRANSMIT push r23 swap r23 mov r24, r23 andi r24, 0x0f subi r24, -'0' rcall USART_TRANSMIT pop r23 ldi r24, '.' rcall USART_TRANSMIT mov r24, r23 andi r24, 0x0f subi r24, -'0' rcall USART_TRANSMIT pop r23 pop r19 ret ;;; ------------------------------------------------------------ #define AM2303_DEBUG #define AM2303_DEBUG_USE_USART .include "devices/am2302.asm" .include "devices/am2302-ccs811.asm" .include "usart.asm" .include "usart-puts.asm" .include "usart-puthex.asm" .include "bin2ascii.asm" .include "bin2bcd16.asm" .include "wait.asm" ;;; ------------------------------------------------------------ STR_HELLO: .db "# Hallo AM2302", 0x0d, 0x0a, 0, 0 STR_PERROR: .db "# Parity Error", 0x0d, 0x0a, 0, 0
18.342857
78
0.586535
e6272ce9789ce2f619915f097af8a2e56a5a0f39
5,070
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_2003.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_2003.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_2003.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 %r14 push %r15 push %r9 push %rcx push %rdi push %rdx lea addresses_WC_ht+0x1973c, %rcx nop nop nop nop add %r15, %r15 mov (%rcx), %r14d nop nop nop nop add $41677, %r15 lea addresses_D_ht+0x5c54, %r15 nop inc %rdx and $0xffffffffffffffc0, %r15 movntdqa (%r15), %xmm2 vpextrq $1, %xmm2, %r9 nop inc %r9 lea addresses_normal_ht+0xbad4, %rdi nop nop nop sub $44317, %r11 mov $0x6162636465666768, %r9 movq %r9, (%rdi) nop nop nop sub %rdx, %rdx lea addresses_WT_ht+0x5ed4, %r14 nop nop lfence mov (%r14), %rcx inc %r15 lea addresses_A_ht+0x8154, %r11 cmp %rcx, %rcx mov $0x6162636465666768, %rdi movq %rdi, %xmm6 vmovups %ymm6, (%r11) nop nop nop nop nop add %rdi, %rdi pop %rdx pop %rdi pop %rcx pop %r9 pop %r15 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r13 push %r9 push %rax push %rbp push %rdx push %rsi // Faulty Load lea addresses_normal+0x1a6d4, %rsi nop nop sub %rax, %rax mov (%rsi), %ebp lea oracles, %r9 and $0xff, %rbp shlq $12, %rbp mov (%r9,%rbp,1), %rbp pop %rsi pop %rdx pop %rbp pop %rax pop %r9 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 8}} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 5}} {'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 */
46.513761
2,999
0.660552
4dc63d2890d420289c073ecb8a3e3a5f9a696c07
337
asm
Assembly
vm_check/branching/0_call.asm
skiff-vm/skiff
51a4dd736b9d35ff657f09867aff26d15ec1877e
[ "MIT" ]
null
null
null
vm_check/branching/0_call.asm
skiff-vm/skiff
51a4dd736b9d35ff657f09867aff26d15ec1877e
[ "MIT" ]
null
null
null
vm_check/branching/0_call.asm
skiff-vm/skiff
51a4dd736b9d35ff657f09867aff26d15ec1877e
[ "MIT" ]
null
null
null
.init main .code dead_code: mov i0 @0 ; Load the return code ret ; Return to caller mov i0 @99 ; Ret is part of call this should be dead exit ; This too should be kill main: mov i0 @1 ; Should be overwritten by the call call dead_code ; Call and set return code exit
24.071429
61
0.58457
715def453662e05e907ddac5d71c3ed70b720307
1,272
asm
Assembly
oeis/270/A270870.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/270/A270870.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/270/A270870.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A270870: a(n) = n^6 + 5*n^5 + 19*n^4 + 44*n^3 + 72*n^2 + 69*n + 5. ; 5,215,1311,5531,18329,50775,122675,266411,531501,989879,1741895,2923035,4711361,7335671,11084379,16315115,23465045,33061911,45735791,62231579,83422185,110322455,144103811,186109611,237871229,301124855,377829015,470182811,580644881,711953079,867144875,1049578475,1262954661,1511339351,1799186879,2131363995,2513174585,2950385111,3449250771,4016542379,4659573965,5386231095,6204999911,7124996891,8155999329,9308476535,10593621755,12023384811,13610505461,15368547479,17311933455,19455980315,21816935561 mov $2,4 mov $6,$0 mul $0,2 add $2,$0 mov $0,$2 add $0,$2 lpb $0 add $1,$0 sub $0,1 lpe sub $1,$2 sub $1,27 mov $4,37 mov $7,$6 lpb $4 add $1,$7 sub $4,1 lpe mov $5,$6 lpb $5 add $3,$7 sub $5,1 lpe mov $4,64 mov $7,$3 lpb $4 add $1,$7 sub $4,1 lpe mov $3,0 mov $5,$6 lpb $5 add $3,$7 sub $5,1 lpe mov $4,44 mov $7,$3 lpb $4 add $1,$7 sub $4,1 lpe mov $3,0 mov $5,$6 lpb $5 add $3,$7 sub $5,1 lpe mov $4,19 mov $7,$3 lpb $4 add $1,$7 sub $4,1 lpe mov $3,0 mov $5,$6 lpb $5 add $3,$7 sub $5,1 lpe mov $4,5 mov $7,$3 lpb $4 add $1,$7 sub $4,1 lpe mov $3,0 mov $5,$6 lpb $5 add $3,$7 sub $5,1 lpe mov $4,1 mov $7,$3 lpb $4 add $1,$7 sub $4,1 lpe mov $0,$1
15.512195
501
0.657233
ffb09d70a881dbf537f05d8cc6bf69dce1501f63
2,434
asm
Assembly
maps/VermilionPokecenter1F.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
maps/VermilionPokecenter1F.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
maps/VermilionPokecenter1F.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
object_const_def ; object_event constants const VERMILIONPOKECENTER1F_NURSE const VERMILIONPOKECENTER1F_FISHING_GURU const VERMILIONPOKECENTER1F_SAILOR const VERMILIONPOKECENTER1F_BUG_CATCHER VermilionPokecenter1F_MapScripts: db 0 ; scene scripts db 0 ; callbacks VermilionPokecenter1FNurseScript: jumpstd pokecenternurse VermilionPokecenter1FFishingGuruScript: faceplayer opentext checkevent EVENT_FOUGHT_SNORLAX iftrue .FoughtSnorlax writetext VermilionPokecenter1FFishingGuruText waitbutton closetext end .FoughtSnorlax: writetext VermilionPokecenter1FFishingGuruText_FoughtSnorlax waitbutton closetext end VermilionPokecenter1FSailorScript: jumptextfaceplayer VermilionPokecenter1FSailorText VermilionPokecenter1FBugCatcherScript: jumptextfaceplayer VermilionPokecenter1FBugCatcherText VermilionPokecenter1FFishingGuruText: text "A sleeping #MON" line "is lying in front" cont "of DIGLETT'S CAVE." para "It's a fantastic" line "opportunity to get" para "it, but how do you" line "wake it up?" done VermilionPokecenter1FFishingGuruText_FoughtSnorlax: text "There used to be a" line "sleeping #MON" para "lying in front of" line "DIGLETT'S CAVE." para "But it seems to" line "have disappeared." done VermilionPokecenter1FSailorText: text "The FAST SHIP is a" line "great place to" para "meet and battle" line "trainers." done VermilionPokecenter1FBugCatcherText: text "Oh? You have some" line "BADGES I've never" cont "seen before." para "Oh, I get it. You" line "got them in JOHTO." done VermilionPokecenter1F_MapEvents: db 0, 0 ; filler db 3 ; warp events warp_event 3, 7, VERMILION_CITY, 2 warp_event 4, 7, VERMILION_CITY, 2 warp_event 0, 7, POKECENTER_2F, 1 db 0 ; coord events db 0 ; bg events db 4 ; object events object_event 3, 1, SPRITE_NURSE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, VermilionPokecenter1FNurseScript, -1 object_event 7, 2, SPRITE_FISHING_GURU, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, VermilionPokecenter1FFishingGuruScript, -1 object_event 6, 5, SPRITE_SAILOR, SPRITEMOVEDATA_WALK_UP_DOWN, 0, 1, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, VermilionPokecenter1FSailorScript, -1 object_event 1, 5, SPRITE_BUG_CATCHER, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, VermilionPokecenter1FBugCatcherScript, -1
25.893617
166
0.795809
560bc9d6a1cbb41f55197cb6ad88db240de0b762
3,996
asm
Assembly
6309/zx0_6309_standard.asm
dougmasten/zx0-6x09
0c2328776f2d01ece656c2c62c3b66a7a4984d81
[ "Zlib" ]
7
2021-03-14T06:23:10.000Z
2021-12-11T04:24:55.000Z
6309/zx0_6309_standard.asm
dougmasten/zx0-6x09
0c2328776f2d01ece656c2c62c3b66a7a4984d81
[ "Zlib" ]
2
2021-11-21T21:14:52.000Z
2022-02-07T07:11:13.000Z
6309/zx0_6309_standard.asm
dougmasten/zx0-6x09
0c2328776f2d01ece656c2c62c3b66a7a4984d81
[ "Zlib" ]
4
2021-03-23T05:31:21.000Z
2022-02-06T20:10:31.000Z
; zx0_6309_standard.asm - ZX0 decompressor for H6309 - 75 bytes ; ; Copyright (c) 2021 Doug Masten ; ZX0 compression (c) 2021 Einar Saukas, https://github.com/einar-saukas/ZX0 ; ; This software is provided 'as-is', without any express or implied ; warranty. In no event will the authors be held liable for any damages ; arising from the use of this software. ; ; Permission is granted to anyone to use this software for any purpose, ; including commercial applications, and to alter it and redistribute it ; freely, subject to the following restrictions: ; ; 1. The origin of this software must not be misrepresented; you must not ; claim that you wrote the original software. If you use this software ; in a product, an acknowledgment in the product documentation would be ; appreciated but is not required. ; 2. Altered source versions must be plainly marked as such, and must not be ; misrepresented as being the original software. ; 3. This notice may not be removed or altered from any source distribution. ;------------------------------------------------------------------------------ ; Function : zx0_decompress ; Entry : Reg X = start of compressed data ; : Reg U = start of decompression buffer ; Exit : Reg X = end of compressed data + 1 ; : Reg U = end of decompression buffer + 1 ; Destroys : Regs D, V, W, Y ; Description : Decompress ZX0 data (version 1) ;------------------------------------------------------------------------------ zx0_decompress ldq #$ffff0001 ; init offset = -1 and elias = 1 tfr d,v ; preserve offset lda #$80 ; init bit stream ; 0 - literal (copy next N bytes from compressed data) zx0_literals bsr zx0_elias ; obtain length tfm x+,u+ ; copy literals incw ; set elias = 1 lsla ; get next bit bcs zx0_new_offset ; branch if next block is new offset ; 0 - copy from last offset (repeat N bytes from last offset) bsr zx0_elias ; obtain length zx0_copy tfr u,y ; get current buffer address addr v,y ; and calculate offset address tfm y+,u+ ; copy match incw ; set elias = 1 lsla ; get next bit bcc zx0_literals ; branch if next block is literals ; 1 - copy from new offset (repeat N bytes from new offset) zx0_new_offset bsr zx0_elias ; obtain MSB offset comf ; adjust for negative offset (set carry for RORW below) incf ; " " " " beq zx0_eof ; eof? (offset = 256) if so exit tfr f,e ; move to MSB position ldf ,x+ ; obtain LSB offset rorw ; offset bit #0 becomes first length bit tfr w,v ; preserve new offset ldw #1 ; set elias = 1 bcs skip@ ; test first length bit bsr zx0_backtrace ; get elias but skip first bit skip@ incw ; elias = elias + 1 bra zx0_copy ; go copy new offset match ; interlaced elias gamma coding zx0_backtrace loop@ lsla ; get next bit rolw ; rotate bit into gamma value zx0_elias lsla ; get next bit bne skip@ ; branch if bit stream is not empty lda ,x+ ; load another group of 8 bits rola ; get next bit skip@ bcc loop@ ; loop again until done zx0_eof rts ; return
51.230769
94
0.515015
41ded5a0daaa05d356a0403b06daaf5203f5113b
889
asm
Assembly
programs/oeis/061/A061506.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/061/A061506.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/061/A061506.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A061506: a(n) = lcm(6n+2, 6n+4, 6n+6). ; 12,120,1008,1320,5460,4896,15960,12144,35100,24360,65472,42840,109668,68880,170280,103776,249900,148824,351120,205320,476532,274560,628728,357840,810300,456456,1023840,571704,1271940,704880,1557192,857280,1882188,1030200,2249520,1224936,2661780,1442784,3121560,1685040,3631452,1953000,4194048,2247960,4811940,2571216,5487720,2924064,6223980,3307800,7023312,3723720,7888308,4173120,8821560,4657296,9825660,5177544,10903200,5735160,12056772,6331440,13288968,6967680,14602380,7645176,15999600,8365224,17483220,9129120,19055832,9938160,20720028,10793640,22478400,11696856,24333540,12649104,26288040,13651680,28344492,14705880,30505488,15813000,32773620,16974336,35151480,18191184,37641660,19464840,40246752,20796600,42969348,22187760,45812040,23639616,48777420,25153464,51868080,26730600 mul $0,3 seq $0,67046 ; a(n) = lcm(n, n+1, n+2)/6. mul $0,12
127
785
0.827897
3103722bbf8522f7799b0bfa273d64d6eb147fa8
7,601
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_2183_96.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_2183_96.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2_notsx.log_2183_96.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r15 push %r8 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_WT_ht+0x869c, %rbp nop nop sub %rdi, %rdi movb (%rbp), %al nop cmp %r15, %r15 lea addresses_normal_ht+0xfbdc, %r8 nop nop add %r11, %r11 mov $0x6162636465666768, %r15 movq %r15, (%r8) nop nop nop nop nop add $12899, %r15 lea addresses_WC_ht+0x15c44, %rsi lea addresses_D_ht+0x1c5c, %rdi nop nop and $42456, %rax mov $109, %rcx rep movsl nop nop xor $63093, %r8 lea addresses_D_ht+0xdb9c, %rcx clflush (%rcx) nop nop nop nop and $8006, %rbp mov (%rcx), %rsi nop nop nop add %rcx, %rcx lea addresses_D_ht+0x1450e, %rsi lea addresses_A_ht+0x1d39c, %rdi and $6576, %rbp mov $6, %rcx rep movsq nop nop inc %r8 lea addresses_A_ht+0x641c, %r8 inc %rax movb $0x61, (%r8) nop nop nop nop nop add %rsi, %rsi lea addresses_WT_ht+0x18e9c, %rdi nop nop nop dec %r8 movb (%rdi), %cl nop nop and %r15, %r15 lea addresses_WC_ht+0x17f9c, %rbp and %rcx, %rcx movups (%rbp), %xmm7 vpextrq $1, %xmm7, %r11 nop nop add %r15, %r15 lea addresses_A_ht+0xbb7c, %rcx nop sub %r8, %r8 mov (%rcx), %esi nop nop add %r8, %r8 lea addresses_WT_ht+0xa91c, %rbp sub %r11, %r11 movups (%rbp), %xmm5 vpextrq $0, %xmm5, %r8 nop xor %r11, %r11 lea addresses_WT_ht+0x1a91c, %rsi nop nop nop nop xor %rax, %rax and $0xffffffffffffffc0, %rsi vmovntdqa (%rsi), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $0, %xmm2, %r8 nop nop cmp %r11, %r11 lea addresses_D_ht+0x1e2f4, %r11 nop nop nop nop xor %rdi, %rdi movb $0x61, (%r11) nop nop and $62573, %rsi lea addresses_A_ht+0x19f9c, %rsi lea addresses_UC_ht+0x1aa1c, %rdi nop nop xor %r8, %r8 mov $64, %rcx rep movsb nop nop nop nop nop and $27263, %r15 lea addresses_WT_ht+0x848c, %rcx nop nop nop nop sub $52975, %rax mov (%rcx), %esi nop nop nop cmp $17086, %rax pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r15 pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r8 push %r9 push %rax push %rdx push %rsi // Load mov $0x642fe70000000b9c, %r14 nop nop nop nop add $7295, %rdx mov (%r14), %r15 nop nop nop nop nop and %rdx, %rdx // Faulty Load mov $0x2b64270000000f9c, %r9 nop nop xor %r8, %r8 mov (%r9), %si lea oracles, %r15 and $0xff, %rsi shlq $12, %rsi mov (%r15,%rsi,1), %rsi pop %rsi pop %rdx pop %rax pop %r9 pop %r8 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'00': 2183} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
33.933036
2,999
0.651888
2f0da76bcbda319ae2969d383d0f0824ee53dd09
2,366
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_12_1725.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_12_1725.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_12_1725.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 %r14 push %r15 push %r9 push %rax push %rbx push %rcx push %rdi // Store lea addresses_PSE+0x119dc, %r9 nop nop nop nop xor %r15, %r15 mov $0x5152535455565758, %rax movq %rax, (%r9) and %rbx, %rbx // Store lea addresses_A+0x15cbc, %rcx nop nop nop nop xor $23263, %r14 mov $0x5152535455565758, %r15 movq %r15, %xmm7 movups %xmm7, (%rcx) nop nop nop sub $3918, %rax // Store lea addresses_D+0x191bc, %rbx nop inc %r14 movb $0x51, (%rbx) // Exception!!! nop nop nop nop nop mov (0), %r15 nop nop nop nop xor $8854, %rcx // Store lea addresses_RW+0x64bc, %rax nop nop nop nop add %rbx, %rbx mov $0x5152535455565758, %r14 movq %r14, %xmm4 vmovaps %ymm4, (%rax) nop nop nop nop nop dec %r14 // Load lea addresses_WT+0x1d4bc, %rbx nop sub $20174, %rdi mov (%rbx), %rax nop nop nop sub %rdi, %rdi // Store lea addresses_WC+0x50bc, %rax nop nop nop nop and %r14, %r14 movl $0x51525354, (%rax) nop nop nop inc %rcx // Faulty Load lea addresses_A+0x15cbc, %rdi nop dec %r15 vmovaps (%rdi), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $1, %xmm4, %r9 lea oracles, %rdi and $0xff, %r9 shlq $12, %r9 mov (%rdi,%r9,1), %r9 pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_PSE'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_A'}} {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_D'}} {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': True, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_RW'}} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'00': 12} 00 00 00 00 00 00 00 00 00 00 00 00 */
17.397059
122
0.638631
5ecfc06eb5e7e628f6757a96b7fbfc5a32589d49
234
asm
Assembly
libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sccz80/wv_priority_queue_data.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_data.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_data.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
3
2017-03-07T03:19:40.000Z
2021-09-15T17:59:19.000Z
; void *wv_priority_queue_data(wv_priority_queue_t *q) SECTION code_clib SECTION code_adt_wv_priority_queue PUBLIC wv_priority_queue_data EXTERN asm_wv_priority_queue_data defc wv_priority_queue_data = asm_wv_priority_queue_data
19.5
56
0.884615
168bdb07ba7fb96e61ead35cdfc0bf6e5f9e84ec
578
asm
Assembly
programs/oeis/326/A326657.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/326/A326657.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/326/A326657.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A326657: a(n) = 4*floor(n/2) + ceiling((n-1)^2/2). ; 1,0,5,6,13,16,25,30,41,48,61,70,85,96,113,126,145,160,181,198,221,240,265,286,313,336,365,390,421,448,481,510,545,576,613,646,685,720,761,798,841,880,925,966,1013,1056,1105,1150,1201,1248,1301,1350,1405,1456,1513,1566,1625,1680,1741,1798,1861,1920,1985,2046,2113,2176,2245,2310,2381,2448,2521,2590,2665,2736,2813,2886,2965,3040,3121,3198,3281,3360,3445,3526,3613,3696,3785,3870,3961,4048,4141,4230,4325,4416,4513,4606,4705,4800,4901,4998 lpb $0 mov $2,$0 sub $0,2 add $1,$2 lpe mul $1,2 sub $1,$0 add $1,1 mov $0,$1
44.461538
439
0.705882
9a6da38e1c3177f1472700b55a05162455902ea5
6,375
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1066.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1066.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1066.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 %r8 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1115f, %rsi lea addresses_WC_ht+0xeb9f, %rdi xor $36952, %r8 mov $90, %rcx rep movsb nop nop nop nop nop dec %rbp lea addresses_WT_ht+0x889f, %rsi lea addresses_A_ht+0x8dd1, %rdi nop inc %rbx mov $95, %rcx rep movsb nop nop nop nop nop xor %rbp, %rbp lea addresses_WT_ht+0xdf7f, %rbx inc %r12 mov (%rbx), %rbp xor %rbp, %rbp lea addresses_WT_ht+0xbd9f, %rsi lea addresses_WC_ht+0x8977, %rdi nop nop nop lfence mov $28, %rcx rep movsl nop nop and $20674, %rsi lea addresses_WT_ht+0x1256f, %rsi lea addresses_normal_ht+0x2b3f, %rdi clflush (%rsi) nop nop nop nop nop add %rbp, %rbp mov $47, %rcx rep movsb nop nop nop nop nop xor %rdi, %rdi lea addresses_WT_ht+0x71eb, %rdx nop and %rbx, %rbx mov $0x6162636465666768, %rbp movq %rbp, (%rdx) nop nop nop nop nop cmp $8427, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %rax push %rbp push %rcx push %rdi // Store lea addresses_WT+0x1935f, %r13 nop nop xor $47948, %rax mov $0x5152535455565758, %rcx movq %rcx, %xmm1 movups %xmm1, (%r13) nop nop nop nop nop cmp %rcx, %rcx // Store lea addresses_A+0x1e577, %rdi nop nop nop cmp $30576, %r15 mov $0x5152535455565758, %rax movq %rax, %xmm6 movups %xmm6, (%rdi) nop nop nop nop nop cmp $13047, %rcx // Store lea addresses_RW+0x1439f, %rax nop nop add $55048, %r11 mov $0x5152535455565758, %r15 movq %r15, %xmm2 vmovups %ymm2, (%rax) nop nop nop and %r11, %r11 // Faulty Load lea addresses_PSE+0x1fc9f, %rdi xor $14665, %r13 movb (%rdi), %cl lea oracles, %rbp and $0xff, %rcx shlq $12, %rcx mov (%rbp,%rcx,1), %rcx pop %rdi pop %rcx pop %rbp pop %rax pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_PSE', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_RW', 'congruent': 8}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_PSE', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 4}} {'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 4, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 1}, 'OP': 'STOR'} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
36.016949
2,999
0.66102
5e4d153a0447fd8979843a608990e5d923f4f11d
424
asm
Assembly
oeis/309/A309891.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/309/A309891.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/309/A309891.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A309891: a(n) is the total number of trailing zeros in the representations of n over all bases b >= 2. ; 0,1,1,3,1,3,1,5,3,3,1,6,1,3,3,8,1,6,1,6,3,3,1,9,3,3,5,6,1,7,1,10,3,3,3,11,1,3,3,9,1,7,1,6,6,3,1,13,3,6,3,6,1,9,3,9,3,3,1,12,1,3,6,14,3,7,1,6,3,7,1,15,1,3,6,6,3,7,1,13,8,3,1,12,3,3,3,9,1,12,3,6,3,3,3,16,1,6,6,11 add $0,1 mov $2,$0 lpb $0 mov $3,$2 lpb $3 add $1,1 dif $3,$0 lpe sub $0,1 lpe mov $0,$1
28.266667
212
0.558962
672200ec40809b7a64205c9689b3928b6ad30b7e
528
asm
Assembly
programs/oeis/066/A066829.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/066/A066829.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/066/A066829.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A066829: 1 if product of odd number of primes; 0 if product of even number of primes. ; 0,1,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,1,0,0,0,0,1,0,0,0,1,1,1,1,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0,1,0,1,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0 lpb $0 mov $2,$0 seq $2,74828 ; a(1) = 1; for n>1, a(n) = smallest composite multiple of n if n is a prime else the smallest prime divisor of n if n is composite. div $0,$2 mov $3,$2 min $3,1 add $1,$3 lpe mod $1,2 mov $0,$1
37.714286
201
0.587121
c60deb58f81233b5e61ada29507ed20a159b445e
1,003
asm
Assembly
x86-64-assembly/resistor-color/resistor_color.asm
0x28/exercism
615ad622b172bbd84bd9db0122bb205b6a2b0961
[ "MIT" ]
null
null
null
x86-64-assembly/resistor-color/resistor_color.asm
0x28/exercism
615ad622b172bbd84bd9db0122bb205b6a2b0961
[ "MIT" ]
null
null
null
x86-64-assembly/resistor-color/resistor_color.asm
0x28/exercism
615ad622b172bbd84bd9db0122bb205b6a2b0961
[ "MIT" ]
null
null
null
default rel section .data black: db "black",0 brown: db "brown",0 red: db "red",0 orange: db "orange",0 yellow: db "yellow",0 green: db "green",0 blue: db "blue",0 violet: db "violet",0 grey: db "grey",0 white: db "white",0 color_array: dq black,brown,red,orange,yellow,green,blue,violet,grey,white,0 section .text global color_code color_code: mov rcx, -1 colorloop: inc rcx lea rsi, [color_array] mov rsi, [rsi + rcx * 8] test rsi, rsi je notfound push rdi push rcx call cmpstring pop rcx pop rdi test rax, rax je colorloop mov rax, rcx ret notfound: mov rax, -1 ret global colors colors: lea rax, [color_array] ret cmpstring: mov al, [rdi] mov bl, [rsi] test al, al sete cl test bl, bl sete dl and cl, dl jne cmptrue cmp al, bl jne cmpfalse inc rdi inc rsi jmp cmpstring cmptrue: mov rax, 1 ret cmpfalse: xor rax, rax ret
13.739726
76
0.596211
721a05a8bc175f4d8a9973d030cbb323fb27f265
6,862
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i3-7100_9_0x84_notsx.log_21829_705.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i3-7100_9_0x84_notsx.log_21829_705.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i3-7100_9_0x84_notsx.log_21829_705.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 %r8 push %rbp push %rcx push %rdi push %rsi lea addresses_WT_ht+0x13ba9, %rsi lea addresses_normal_ht+0xc7c9, %rdi clflush (%rdi) nop nop nop nop xor $56311, %rbp mov $26, %rcx rep movsl nop nop dec %r12 lea addresses_UC_ht+0x1cc79, %r8 nop nop nop nop nop dec %rdi movb (%r8), %cl nop and %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %rbp pop %r8 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r8 push %r9 push %rcx push %rdi push %rsi // Store lea addresses_normal+0xfa99, %rdi nop nop nop nop and $4705, %r12 mov $0x5152535455565758, %r10 movq %r10, (%rdi) nop nop nop nop add %rsi, %rsi // Store lea addresses_WC+0x3869, %r12 clflush (%r12) nop nop nop nop nop xor $23767, %r8 movl $0x51525354, (%r12) nop nop nop nop cmp %rsi, %rsi // Store lea addresses_normal+0x18669, %r8 nop nop nop nop nop and $63119, %r9 mov $0x5152535455565758, %r13 movq %r13, %xmm2 movups %xmm2, (%r8) nop nop nop and $51230, %rsi // Store lea addresses_normal+0x18669, %rsi nop nop nop nop and $52278, %r8 mov $0x5152535455565758, %r9 movq %r9, %xmm0 movups %xmm0, (%rsi) nop nop nop nop add %r10, %r10 // REPMOV lea addresses_normal+0x16673, %rsi lea addresses_WC+0xa5e9, %rdi clflush (%rdi) nop nop xor $33879, %r8 mov $125, %rcx rep movsl nop nop nop nop add $13387, %rcx // Store lea addresses_normal+0x18669, %r10 nop nop nop nop nop dec %rdi movl $0x51525354, (%r10) and %r13, %r13 // Load lea addresses_WT+0x1fb69, %r8 nop nop nop nop sub $5143, %r12 vmovups (%r8), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $0, %xmm2, %r10 cmp %r13, %r13 // Store mov $0x9c9, %r10 nop nop nop add $14448, %rdi movl $0x51525354, (%r10) nop nop nop nop and $9843, %rsi // Store lea addresses_A+0x13189, %rdi nop inc %r9 movb $0x51, (%rdi) nop nop nop sub $17035, %rdi // Faulty Load lea addresses_normal+0x18669, %rcx nop dec %r9 movntdqa (%rcx), %xmm0 vpextrq $0, %xmm0, %rsi lea oracles, %r9 and $0xff, %rsi shlq $12, %rsi mov (%r9,%rsi,1), %rsi pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 4, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 5, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_normal', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 4, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_normal', 'same': True, 'size': 16, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'54': 20704, '00': 1125} 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 00 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 00 54 00 54 54 54 54 54 00 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 00 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 00 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 00 54 54 54 00 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 00 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 00 54 54 54 54 00 54 54 54 00 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 00 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 00 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 00 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 */
31.768519
2,999
0.655348
dac4ced62791ddd3cf2967a2399dc88f13626fc5
680
asm
Assembly
oeis/048/A048654.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/048/A048654.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/048/A048654.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A048654: a(n) = 2*a(n-1) + a(n-2); a(0)=1, a(1)=4. ; Submitted by Jamie Morken(s2.) ; 1,4,9,22,53,128,309,746,1801,4348,10497,25342,61181,147704,356589,860882,2078353,5017588,12113529,29244646,70602821,170450288,411503397,993457082,2398417561,5790292204,13979001969,33748296142,81475594253,196699484648,474874563549,1146448611746,2767771787041,6681992185828,16131756158697,38945504503222,94022765165141,226991034833504,548004834832149,1323000704497802,3194006243827753,7711013192153308,18616032628134369,44943078448422046,108502189524978461,261947457498378968,632397104521736397 mov $2,1 mov $4,2 lpb $0 sub $0,1 mov $3,$4 add $3,$2 mov $4,$2 add $2,$3 lpe mov $0,$2
45.333333
494
0.792647
f51415097adf7fec5fee04248ccc58a51431e84a
706,655
asm
Assembly
kernel.asm
rohit-100/xv6
7121bd76d59b7aec5698a7a7b4fd729c461c3ec6
[ "MIT-0" ]
null
null
null
kernel.asm
rohit-100/xv6
7121bd76d59b7aec5698a7a7b4fd729c461c3ec6
[ "MIT-0" ]
null
null
null
kernel.asm
rohit-100/xv6
7121bd76d59b7aec5698a7a7b4fd729c461c3ec6
[ "MIT-0" ]
null
null
null
kernel: file format elf32-i386 Disassembly of section .text: 80100000 <multiboot_header>: 80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh 80100006: 00 00 add %al,(%eax) 80100008: fe 4f 52 decb 0x52(%edi) 8010000b: e4 .byte 0xe4 8010000c <entry>: # Entering xv6 on boot processor, with paging off. .globl entry entry: # Turn on page size extension for 4Mbyte pages movl %cr4, %eax 8010000c: 0f 20 e0 mov %cr4,%eax orl $(CR4_PSE), %eax 8010000f: 83 c8 10 or $0x10,%eax movl %eax, %cr4 80100012: 0f 22 e0 mov %eax,%cr4 # Set page directory movl $(V2P_WO(entrypgdir)), %eax 80100015: b8 00 90 10 00 mov $0x109000,%eax movl %eax, %cr3 8010001a: 0f 22 d8 mov %eax,%cr3 # Turn on paging. movl %cr0, %eax 8010001d: 0f 20 c0 mov %cr0,%eax orl $(CR0_PG|CR0_WP), %eax 80100020: 0d 00 00 01 80 or $0x80010000,%eax movl %eax, %cr0 80100025: 0f 22 c0 mov %eax,%cr0 # Set up the stack pointer. movl $(stack + KSTACKSIZE), %esp 80100028: bc c0 b5 10 80 mov $0x8010b5c0,%esp # Jump to main(), and switch to executing at # high addresses. The indirect call is needed because # the assembler produces a PC-relative instruction # for a direct jump. mov $main, %eax 8010002d: b8 60 2e 10 80 mov $0x80102e60,%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 initlock(&bcache.lock, "bcache"); // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80100044: bb f4 b5 10 80 mov $0x8010b5f4,%ebx struct buf head; } bcache; void binit(void) { 80100049: 83 ec 0c sub $0xc,%esp struct buf *b; initlock(&bcache.lock, "bcache"); 8010004c: 68 60 6f 10 80 push $0x80106f60 80100051: 68 c0 b5 10 80 push $0x8010b5c0 80100056: e8 e5 41 00 00 call 80104240 <initlock> // Create linked list of buffers bcache.head.prev = &bcache.head; 8010005b: c7 05 0c fd 10 80 bc movl $0x8010fcbc,0x8010fd0c 80100062: fc 10 80 bcache.head.next = &bcache.head; 80100065: c7 05 10 fd 10 80 bc movl $0x8010fcbc,0x8010fd10 8010006c: fc 10 80 8010006f: 83 c4 10 add $0x10,%esp 80100072: ba bc fc 10 80 mov $0x8010fcbc,%edx 80100077: eb 09 jmp 80100082 <binit+0x42> 80100079: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100080: 89 c3 mov %eax,%ebx for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 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 // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ b->next = bcache.head.next; 80100088: 89 53 54 mov %edx,0x54(%ebx) b->prev = &bcache.head; 8010008b: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100092: 68 67 6f 10 80 push $0x80106f67 80100097: 50 push %eax 80100098: e8 93 40 00 00 call 80104130 <initsleeplock> bcache.head.next->prev = b; 8010009d: a1 10 fd 10 80 mov 0x8010fd10,%eax initlock(&bcache.lock, "bcache"); // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000a2: 83 c4 10 add $0x10,%esp 801000a5: 89 da mov %ebx,%edx b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); bcache.head.next->prev = b; 801000a7: 89 58 50 mov %ebx,0x50(%eax) initlock(&bcache.lock, "bcache"); // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000aa: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); bcache.head.next->prev = b; bcache.head.next = b; 801000b0: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 initlock(&bcache.lock, "bcache"); // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000b6: 3d bc fc 10 80 cmp $0x8010fcbc,%eax 801000bb: 75 c3 jne 80100080 <binit+0x40> b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); bcache.head.next->prev = b; bcache.head.next = b; } } 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 static struct buf* bget(uint dev, uint blockno) { struct buf *b; acquire(&bcache.lock); 801000df: 68 c0 b5 10 80 push $0x8010b5c0 801000e4: e8 57 42 00 00 call 80104340 <acquire> // Is the block already cached? for(b = bcache.head.next; b != &bcache.head; b = b->next){ 801000e9: 8b 1d 10 fd 10 80 mov 0x8010fd10,%ebx 801000ef: 83 c4 10 add $0x10,%esp 801000f2: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 801000f8: 75 11 jne 8010010b <bread+0x3b> 801000fa: eb 24 jmp 80100120 <bread+0x50> 801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100100: 8b 5b 54 mov 0x54(%ebx),%ebx 80100103: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100109: 74 15 je 80100120 <bread+0x50> if(b->dev == dev && b->blockno == blockno){ 8010010b: 3b 73 04 cmp 0x4(%ebx),%esi 8010010e: 75 f0 jne 80100100 <bread+0x30> 80100110: 3b 7b 08 cmp 0x8(%ebx),%edi 80100113: 75 eb jne 80100100 <bread+0x30> b->refcnt++; 80100115: 83 43 4c 01 addl $0x1,0x4c(%ebx) 80100119: eb 3f jmp 8010015a <bread+0x8a> 8010011b: 90 nop 8010011c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } // Not cached; recycle an unused buffer. // Even if refcnt==0, B_DIRTY indicates a buffer is in use // because log.c has modified it but not yet committed it. for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 80100120: 8b 1d 0c fd 10 80 mov 0x8010fd0c,%ebx 80100126: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 8010012c: 75 0d jne 8010013b <bread+0x6b> 8010012e: eb 60 jmp 80100190 <bread+0xc0> 80100130: 8b 5b 50 mov 0x50(%ebx),%ebx 80100133: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100139: 74 55 je 80100190 <bread+0xc0> if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) { 8010013b: 8b 43 4c mov 0x4c(%ebx),%eax 8010013e: 85 c0 test %eax,%eax 80100140: 75 ee jne 80100130 <bread+0x60> 80100142: f6 03 04 testb $0x4,(%ebx) 80100145: 75 e9 jne 80100130 <bread+0x60> b->dev = dev; 80100147: 89 73 04 mov %esi,0x4(%ebx) b->blockno = blockno; 8010014a: 89 7b 08 mov %edi,0x8(%ebx) b->flags = 0; 8010014d: c7 03 00 00 00 00 movl $0x0,(%ebx) b->refcnt = 1; 80100153: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) release(&bcache.lock); 8010015a: 83 ec 0c sub $0xc,%esp 8010015d: 68 c0 b5 10 80 push $0x8010b5c0 80100162: e8 f9 42 00 00 call 80104460 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 fe 3f 00 00 call 80104170 <acquiresleep> 80100172: 83 c4 10 add $0x10,%esp bread(uint dev, uint blockno) { 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 6d 1f 00 00 call 801020f0 <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 release(&bcache.lock); acquiresleep(&b->lock); return b; } } panic("bget: no buffers"); 80100190: 83 ec 0c sub $0xc,%esp 80100193: 68 6e 6f 10 80 push $0x80106f6e 80100198: e8 d3 01 00 00 call 80100370 <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 5d 40 00 00 call 80104210 <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 bwrite(struct buf *b) { if(!holdingsleep(&b->lock)) panic("bwrite"); b->flags |= B_DIRTY; iderw(b); 801001c4: e9 27 1f 00 00 jmp 801020f0 <iderw> // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { if(!holdingsleep(&b->lock)) panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 7f 6f 10 80 push $0x80106f7f 801001d1: e8 9a 01 00 00 call 80100370 <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 1c 40 00 00 call 80104210 <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 cc 3f 00 00 call 801041d0 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 8010020b: e8 30 41 00 00 call 80104340 <acquire> b->refcnt--; 80100210: 8b 43 4c mov 0x4c(%ebx),%eax if (b->refcnt == 0) { 80100213: 83 c4 10 add $0x10,%esp panic("brelse"); releasesleep(&b->lock); acquire(&bcache.lock); b->refcnt--; 80100216: 83 e8 01 sub $0x1,%eax if (b->refcnt == 0) { 80100219: 85 c0 test %eax,%eax panic("brelse"); releasesleep(&b->lock); acquire(&bcache.lock); b->refcnt--; 8010021b: 89 43 4c mov %eax,0x4c(%ebx) if (b->refcnt == 0) { 8010021e: 75 2f jne 8010024f <brelse+0x6f> // no one is waiting for it. b->next->prev = b->prev; 80100220: 8b 43 54 mov 0x54(%ebx),%eax 80100223: 8b 53 50 mov 0x50(%ebx),%edx 80100226: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 80100229: 8b 43 50 mov 0x50(%ebx),%eax 8010022c: 8b 53 54 mov 0x54(%ebx),%edx 8010022f: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100232: a1 10 fd 10 80 mov 0x8010fd10,%eax b->prev = &bcache.head; 80100237: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) b->refcnt--; if (b->refcnt == 0) { // no one is waiting for it. b->next->prev = b->prev; b->prev->next = b->next; b->next = bcache.head.next; 8010023e: 89 43 54 mov %eax,0x54(%ebx) b->prev = &bcache.head; bcache.head.next->prev = b; 80100241: a1 10 fd 10 80 mov 0x8010fd10,%eax 80100246: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 80100249: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 } release(&bcache.lock); 8010024f: c7 45 08 c0 b5 10 80 movl $0x8010b5c0,0x8(%ebp) } 80100256: 8d 65 f8 lea -0x8(%ebp),%esp 80100259: 5b pop %ebx 8010025a: 5e pop %esi 8010025b: 5d pop %ebp b->prev = &bcache.head; bcache.head.next->prev = b; bcache.head.next = b; } release(&bcache.lock); 8010025c: e9 ff 41 00 00 jmp 80104460 <release> // Move to the head of the MRU list. void brelse(struct buf *b) { if(!holdingsleep(&b->lock)) panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 86 6f 10 80 push $0x80106f86 80100269: e8 02 01 00 00 call 80100370 <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 cb 14 00 00 call 80101750 <iunlock> target = n; acquire(&cons.lock); 80100285: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010028c: e8 af 40 00 00 call 80104340 <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 9a 00 00 00 jle 8010033b <consoleread+0xcb> while(input.r == input.w){ 801002a1: a1 a0 ff 10 80 mov 0x8010ffa0,%eax 801002a6: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 801002ac: 74 24 je 801002d2 <consoleread+0x62> 801002ae: eb 58 jmp 80100308 <consoleread+0x98> if(myproc()->killed){ release(&cons.lock); ilock(ip); return -1; } sleep(&input.r, &cons.lock); 801002b0: 83 ec 08 sub $0x8,%esp 801002b3: 68 20 a5 10 80 push $0x8010a520 801002b8: 68 a0 ff 10 80 push $0x8010ffa0 801002bd: e8 6e 3a 00 00 call 80103d30 <sleep> iunlock(ip); target = n; acquire(&cons.lock); while(n > 0){ while(input.r == input.w){ 801002c2: a1 a0 ff 10 80 mov 0x8010ffa0,%eax 801002c7: 83 c4 10 add $0x10,%esp 801002ca: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 801002d0: 75 36 jne 80100308 <consoleread+0x98> if(myproc()->killed){ 801002d2: e8 a9 34 00 00 call 80103780 <myproc> 801002d7: 8b 40 24 mov 0x24(%eax),%eax 801002da: 85 c0 test %eax,%eax 801002dc: 74 d2 je 801002b0 <consoleread+0x40> release(&cons.lock); 801002de: 83 ec 0c sub $0xc,%esp 801002e1: 68 20 a5 10 80 push $0x8010a520 801002e6: e8 75 41 00 00 call 80104460 <release> ilock(ip); 801002eb: 89 3c 24 mov %edi,(%esp) 801002ee: e8 7d 13 00 00 call 80101670 <ilock> return -1; 801002f3: 83 c4 10 add $0x10,%esp 801002f6: b8 ff ff ff ff mov $0xffffffff,%eax } release(&cons.lock); ilock(ip); return target - n; } 801002fb: 8d 65 f4 lea -0xc(%ebp),%esp 801002fe: 5b pop %ebx 801002ff: 5e pop %esi 80100300: 5f pop %edi 80100301: 5d pop %ebp 80100302: c3 ret 80100303: 90 nop 80100304: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ilock(ip); return -1; } sleep(&input.r, &cons.lock); } c = input.buf[input.r++ % INPUT_BUF]; 80100308: 8d 50 01 lea 0x1(%eax),%edx 8010030b: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0 80100311: 89 c2 mov %eax,%edx 80100313: 83 e2 7f and $0x7f,%edx 80100316: 0f be 92 20 ff 10 80 movsbl -0x7fef00e0(%edx),%edx if(c == C('D')){ // EOF 8010031d: 83 fa 04 cmp $0x4,%edx 80100320: 74 39 je 8010035b <consoleread+0xeb> // caller gets a 0-byte result. input.r--; } break; } *dst++ = c; 80100322: 83 c6 01 add $0x1,%esi --n; 80100325: 83 eb 01 sub $0x1,%ebx if(c == '\n') 80100328: 83 fa 0a cmp $0xa,%edx // caller gets a 0-byte result. input.r--; } break; } *dst++ = c; 8010032b: 88 56 ff mov %dl,-0x1(%esi) --n; if(c == '\n') 8010032e: 74 35 je 80100365 <consoleread+0xf5> int c; iunlock(ip); target = n; acquire(&cons.lock); while(n > 0){ 80100330: 85 db test %ebx,%ebx 80100332: 0f 85 69 ff ff ff jne 801002a1 <consoleread+0x31> 80100338: 8b 45 10 mov 0x10(%ebp),%eax *dst++ = c; --n; if(c == '\n') break; } release(&cons.lock); 8010033b: 83 ec 0c sub $0xc,%esp 8010033e: 89 45 e4 mov %eax,-0x1c(%ebp) 80100341: 68 20 a5 10 80 push $0x8010a520 80100346: e8 15 41 00 00 call 80104460 <release> ilock(ip); 8010034b: 89 3c 24 mov %edi,(%esp) 8010034e: e8 1d 13 00 00 call 80101670 <ilock> return target - n; 80100353: 83 c4 10 add $0x10,%esp 80100356: 8b 45 e4 mov -0x1c(%ebp),%eax 80100359: eb a0 jmp 801002fb <consoleread+0x8b> } sleep(&input.r, &cons.lock); } c = input.buf[input.r++ % INPUT_BUF]; if(c == C('D')){ // EOF if(n < target){ 8010035b: 39 5d 10 cmp %ebx,0x10(%ebp) 8010035e: 76 05 jbe 80100365 <consoleread+0xf5> // Save ^D for next time, to make sure // caller gets a 0-byte result. input.r--; 80100360: a3 a0 ff 10 80 mov %eax,0x8010ffa0 80100365: 8b 45 10 mov 0x10(%ebp),%eax 80100368: 29 d8 sub %ebx,%eax 8010036a: eb cf jmp 8010033b <consoleread+0xcb> 8010036c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100370 <panic>: release(&cons.lock); } void panic(char *s) { 80100370: 55 push %ebp 80100371: 89 e5 mov %esp,%ebp 80100373: 56 push %esi 80100374: 53 push %ebx 80100375: 83 ec 30 sub $0x30,%esp } static inline void cli(void) { asm volatile("cli"); 80100378: fa cli int i; uint pcs[10]; cli(); cons.locking = 0; 80100379: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554 80100380: 00 00 00 // use lapiccpunum so that we can call panic from mycpu() cprintf("lapicid %d: panic: ", lapicid()); cprintf(s); cprintf("\n"); getcallerpcs(&s, pcs); 80100383: 8d 5d d0 lea -0x30(%ebp),%ebx 80100386: 8d 75 f8 lea -0x8(%ebp),%esi uint pcs[10]; cli(); cons.locking = 0; // use lapiccpunum so that we can call panic from mycpu() cprintf("lapicid %d: panic: ", lapicid()); 80100389: e8 62 23 00 00 call 801026f0 <lapicid> 8010038e: 83 ec 08 sub $0x8,%esp 80100391: 50 push %eax 80100392: 68 8d 6f 10 80 push $0x80106f8d 80100397: e8 c4 02 00 00 call 80100660 <cprintf> cprintf(s); 8010039c: 58 pop %eax 8010039d: ff 75 08 pushl 0x8(%ebp) 801003a0: e8 bb 02 00 00 call 80100660 <cprintf> cprintf("\n"); 801003a5: c7 04 24 80 75 10 80 movl $0x80107580,(%esp) 801003ac: e8 af 02 00 00 call 80100660 <cprintf> getcallerpcs(&s, pcs); 801003b1: 5a pop %edx 801003b2: 8d 45 08 lea 0x8(%ebp),%eax 801003b5: 59 pop %ecx 801003b6: 53 push %ebx 801003b7: 50 push %eax 801003b8: e8 a3 3e 00 00 call 80104260 <getcallerpcs> 801003bd: 83 c4 10 add $0x10,%esp for(i=0; i<10; i++) cprintf(" %p", pcs[i]); 801003c0: 83 ec 08 sub $0x8,%esp 801003c3: ff 33 pushl (%ebx) 801003c5: 83 c3 04 add $0x4,%ebx 801003c8: 68 a1 6f 10 80 push $0x80106fa1 801003cd: e8 8e 02 00 00 call 80100660 <cprintf> // use lapiccpunum so that we can call panic from mycpu() cprintf("lapicid %d: panic: ", lapicid()); cprintf(s); cprintf("\n"); getcallerpcs(&s, pcs); for(i=0; i<10; i++) 801003d2: 83 c4 10 add $0x10,%esp 801003d5: 39 f3 cmp %esi,%ebx 801003d7: 75 e7 jne 801003c0 <panic+0x50> cprintf(" %p", pcs[i]); panicked = 1; // freeze other CPU 801003d9: c7 05 58 a5 10 80 01 movl $0x1,0x8010a558 801003e0: 00 00 00 801003e3: eb fe jmp 801003e3 <panic+0x73> 801003e5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801003e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801003f0 <consputc>: } void consputc(int c) { if(panicked){ 801003f0: 8b 15 58 a5 10 80 mov 0x8010a558,%edx 801003f6: 85 d2 test %edx,%edx 801003f8: 74 06 je 80100400 <consputc+0x10> 801003fa: fa cli 801003fb: eb fe jmp 801003fb <consputc+0xb> 801003fd: 8d 76 00 lea 0x0(%esi),%esi crt[pos] = ' ' | 0x0700; } void consputc(int c) { 80100400: 55 push %ebp 80100401: 89 e5 mov %esp,%ebp 80100403: 57 push %edi 80100404: 56 push %esi 80100405: 53 push %ebx 80100406: 89 c3 mov %eax,%ebx 80100408: 83 ec 0c sub $0xc,%esp cli(); for(;;) ; } if(c == BACKSPACE){ 8010040b: 3d 00 01 00 00 cmp $0x100,%eax 80100410: 0f 84 b8 00 00 00 je 801004ce <consputc+0xde> uartputc('\b'); uartputc(' '); uartputc('\b'); } else uartputc(c); 80100416: 83 ec 0c sub $0xc,%esp 80100419: 50 push %eax 8010041a: e8 11 57 00 00 call 80105b30 <uartputc> 8010041f: 83 c4 10 add $0x10,%esp } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100422: bf d4 03 00 00 mov $0x3d4,%edi 80100427: b8 0e 00 00 00 mov $0xe,%eax 8010042c: 89 fa mov %edi,%edx 8010042e: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010042f: be d5 03 00 00 mov $0x3d5,%esi 80100434: 89 f2 mov %esi,%edx 80100436: ec in (%dx),%al { int pos; // Cursor position: col + 80*row. outb(CRTPORT, 14); pos = inb(CRTPORT+1) << 8; 80100437: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010043a: 89 fa mov %edi,%edx 8010043c: c1 e0 08 shl $0x8,%eax 8010043f: 89 c1 mov %eax,%ecx 80100441: b8 0f 00 00 00 mov $0xf,%eax 80100446: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80100447: 89 f2 mov %esi,%edx 80100449: ec in (%dx),%al outb(CRTPORT, 15); pos |= inb(CRTPORT+1); 8010044a: 0f b6 c0 movzbl %al,%eax 8010044d: 09 c8 or %ecx,%eax if(c == '\n') 8010044f: 83 fb 0a cmp $0xa,%ebx 80100452: 0f 84 0b 01 00 00 je 80100563 <consputc+0x173> pos += 80 - pos%80; else if(c == BACKSPACE){ 80100458: 81 fb 00 01 00 00 cmp $0x100,%ebx 8010045e: 0f 84 e6 00 00 00 je 8010054a <consputc+0x15a> if(pos > 0) --pos; } else crt[pos++] = (c&0xff) | 0x0700; // black on white 80100464: 0f b6 d3 movzbl %bl,%edx 80100467: 8d 78 01 lea 0x1(%eax),%edi 8010046a: 80 ce 07 or $0x7,%dh 8010046d: 66 89 94 00 00 80 0b mov %dx,-0x7ff48000(%eax,%eax,1) 80100474: 80 if(pos < 0 || pos > 25*80) 80100475: 81 ff d0 07 00 00 cmp $0x7d0,%edi 8010047b: 0f 8f bc 00 00 00 jg 8010053d <consputc+0x14d> panic("pos under/overflow"); if((pos/80) >= 24){ // Scroll up. 80100481: 81 ff 7f 07 00 00 cmp $0x77f,%edi 80100487: 7f 6f jg 801004f8 <consputc+0x108> 80100489: 89 f8 mov %edi,%eax 8010048b: 8d 8c 3f 00 80 0b 80 lea -0x7ff48000(%edi,%edi,1),%ecx 80100492: 89 fb mov %edi,%ebx 80100494: c1 e8 08 shr $0x8,%eax 80100497: 89 c6 mov %eax,%esi } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100499: bf d4 03 00 00 mov $0x3d4,%edi 8010049e: b8 0e 00 00 00 mov $0xe,%eax 801004a3: 89 fa mov %edi,%edx 801004a5: ee out %al,(%dx) 801004a6: ba d5 03 00 00 mov $0x3d5,%edx 801004ab: 89 f0 mov %esi,%eax 801004ad: ee out %al,(%dx) 801004ae: b8 0f 00 00 00 mov $0xf,%eax 801004b3: 89 fa mov %edi,%edx 801004b5: ee out %al,(%dx) 801004b6: ba d5 03 00 00 mov $0x3d5,%edx 801004bb: 89 d8 mov %ebx,%eax 801004bd: ee out %al,(%dx) outb(CRTPORT, 14); outb(CRTPORT+1, pos>>8); outb(CRTPORT, 15); outb(CRTPORT+1, pos); crt[pos] = ' ' | 0x0700; 801004be: b8 20 07 00 00 mov $0x720,%eax 801004c3: 66 89 01 mov %ax,(%ecx) if(c == BACKSPACE){ uartputc('\b'); uartputc(' '); uartputc('\b'); } else uartputc(c); cgaputc(c); } 801004c6: 8d 65 f4 lea -0xc(%ebp),%esp 801004c9: 5b pop %ebx 801004ca: 5e pop %esi 801004cb: 5f pop %edi 801004cc: 5d pop %ebp 801004cd: c3 ret for(;;) ; } if(c == BACKSPACE){ uartputc('\b'); uartputc(' '); uartputc('\b'); 801004ce: 83 ec 0c sub $0xc,%esp 801004d1: 6a 08 push $0x8 801004d3: e8 58 56 00 00 call 80105b30 <uartputc> 801004d8: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004df: e8 4c 56 00 00 call 80105b30 <uartputc> 801004e4: c7 04 24 08 00 00 00 movl $0x8,(%esp) 801004eb: e8 40 56 00 00 call 80105b30 <uartputc> 801004f0: 83 c4 10 add $0x10,%esp 801004f3: e9 2a ff ff ff jmp 80100422 <consputc+0x32> if(pos < 0 || pos > 25*80) panic("pos under/overflow"); if((pos/80) >= 24){ // Scroll up. memmove(crt, crt+80, sizeof(crt[0])*23*80); 801004f8: 83 ec 04 sub $0x4,%esp pos -= 80; 801004fb: 8d 5f b0 lea -0x50(%edi),%ebx if(pos < 0 || pos > 25*80) panic("pos under/overflow"); if((pos/80) >= 24){ // Scroll up. memmove(crt, crt+80, sizeof(crt[0])*23*80); 801004fe: 68 60 0e 00 00 push $0xe60 80100503: 68 a0 80 0b 80 push $0x800b80a0 80100508: 68 00 80 0b 80 push $0x800b8000 pos -= 80; memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 8010050d: 8d b4 1b 00 80 0b 80 lea -0x7ff48000(%ebx,%ebx,1),%esi if(pos < 0 || pos > 25*80) panic("pos under/overflow"); if((pos/80) >= 24){ // Scroll up. memmove(crt, crt+80, sizeof(crt[0])*23*80); 80100514: e8 47 40 00 00 call 80104560 <memmove> pos -= 80; memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100519: b8 80 07 00 00 mov $0x780,%eax 8010051e: 83 c4 0c add $0xc,%esp 80100521: 29 d8 sub %ebx,%eax 80100523: 01 c0 add %eax,%eax 80100525: 50 push %eax 80100526: 6a 00 push $0x0 80100528: 56 push %esi 80100529: e8 82 3f 00 00 call 801044b0 <memset> 8010052e: 89 f1 mov %esi,%ecx 80100530: 83 c4 10 add $0x10,%esp 80100533: be 07 00 00 00 mov $0x7,%esi 80100538: e9 5c ff ff ff jmp 80100499 <consputc+0xa9> if(pos > 0) --pos; } else crt[pos++] = (c&0xff) | 0x0700; // black on white if(pos < 0 || pos > 25*80) panic("pos under/overflow"); 8010053d: 83 ec 0c sub $0xc,%esp 80100540: 68 a5 6f 10 80 push $0x80106fa5 80100545: e8 26 fe ff ff call 80100370 <panic> pos |= inb(CRTPORT+1); if(c == '\n') pos += 80 - pos%80; else if(c == BACKSPACE){ if(pos > 0) --pos; 8010054a: 85 c0 test %eax,%eax 8010054c: 8d 78 ff lea -0x1(%eax),%edi 8010054f: 0f 85 20 ff ff ff jne 80100475 <consputc+0x85> 80100555: b9 00 80 0b 80 mov $0x800b8000,%ecx 8010055a: 31 db xor %ebx,%ebx 8010055c: 31 f6 xor %esi,%esi 8010055e: e9 36 ff ff ff jmp 80100499 <consputc+0xa9> pos = inb(CRTPORT+1) << 8; outb(CRTPORT, 15); pos |= inb(CRTPORT+1); if(c == '\n') pos += 80 - pos%80; 80100563: ba 67 66 66 66 mov $0x66666667,%edx 80100568: f7 ea imul %edx 8010056a: 89 d0 mov %edx,%eax 8010056c: c1 e8 05 shr $0x5,%eax 8010056f: 8d 04 80 lea (%eax,%eax,4),%eax 80100572: c1 e0 04 shl $0x4,%eax 80100575: 8d 78 50 lea 0x50(%eax),%edi 80100578: e9 f8 fe ff ff jmp 80100475 <consputc+0x85> 8010057d: 8d 76 00 lea 0x0(%esi),%esi 80100580 <printint>: int locking; } cons; static void printint(int xx, int base, int sign) { 80100580: 55 push %ebp 80100581: 89 e5 mov %esp,%ebp 80100583: 57 push %edi 80100584: 56 push %esi 80100585: 53 push %ebx 80100586: 89 d6 mov %edx,%esi 80100588: 83 ec 2c sub $0x2c,%esp static char digits[] = "0123456789abcdef"; char buf[16]; int i; uint x; if(sign && (sign = xx < 0)) 8010058b: 85 c9 test %ecx,%ecx int locking; } cons; static void printint(int xx, int base, int sign) { 8010058d: 89 4d d4 mov %ecx,-0x2c(%ebp) static char digits[] = "0123456789abcdef"; char buf[16]; int i; uint x; if(sign && (sign = xx < 0)) 80100590: 74 0c je 8010059e <printint+0x1e> 80100592: 89 c7 mov %eax,%edi 80100594: c1 ef 1f shr $0x1f,%edi 80100597: 85 c0 test %eax,%eax 80100599: 89 7d d4 mov %edi,-0x2c(%ebp) 8010059c: 78 51 js 801005ef <printint+0x6f> x = -xx; else x = xx; i = 0; 8010059e: 31 ff xor %edi,%edi 801005a0: 8d 5d d7 lea -0x29(%ebp),%ebx 801005a3: eb 05 jmp 801005aa <printint+0x2a> 801005a5: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 801005a8: 89 cf mov %ecx,%edi 801005aa: 31 d2 xor %edx,%edx 801005ac: 8d 4f 01 lea 0x1(%edi),%ecx 801005af: f7 f6 div %esi 801005b1: 0f b6 92 d0 6f 10 80 movzbl -0x7fef9030(%edx),%edx }while((x /= base) != 0); 801005b8: 85 c0 test %eax,%eax else x = xx; i = 0; do{ buf[i++] = digits[x % base]; 801005ba: 88 14 0b mov %dl,(%ebx,%ecx,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 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1) 801005cb: 8d 4f 02 lea 0x2(%edi),%ecx 801005ce: 8d 74 0d d7 lea -0x29(%ebp,%ecx,1),%esi 801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while(--i >= 0) consputc(buf[i]); 801005d8: 0f be 06 movsbl (%esi),%eax 801005db: 83 ee 01 sub $0x1,%esi 801005de: e8 0d fe ff ff call 801003f0 <consputc> }while((x /= base) != 0); if(sign) buf[i++] = '-'; while(--i >= 0) 801005e3: 39 de cmp %ebx,%esi 801005e5: 75 f1 jne 801005d8 <printint+0x58> consputc(buf[i]); } 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 char buf[16]; int i; uint x; if(sign && (sign = xx < 0)) x = -xx; 801005ef: f7 d8 neg %eax 801005f1: eb ab jmp 8010059e <printint+0x1e> 801005f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801005f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100600 <consolewrite>: return target - n; } 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 int i; iunlock(ip); 80100609: ff 75 08 pushl 0x8(%ebp) return target - n; } int consolewrite(struct inode *ip, char *buf, int n) { 8010060c: 8b 75 10 mov 0x10(%ebp),%esi int i; iunlock(ip); 8010060f: e8 3c 11 00 00 call 80101750 <iunlock> acquire(&cons.lock); 80100614: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010061b: e8 20 3d 00 00 call 80104340 <acquire> 80100620: 8b 7d 0c mov 0xc(%ebp),%edi for(i = 0; i < n; i++) 80100623: 83 c4 10 add $0x10,%esp 80100626: 85 f6 test %esi,%esi 80100628: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010062b: 7e 12 jle 8010063f <consolewrite+0x3f> 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 b5 fd ff ff call 801003f0 <consputc> { int i; iunlock(ip); acquire(&cons.lock); for(i = 0; i < n; i++) 8010063b: 39 df cmp %ebx,%edi 8010063d: 75 f1 jne 80100630 <consolewrite+0x30> consputc(buf[i] & 0xff); release(&cons.lock); 8010063f: 83 ec 0c sub $0xc,%esp 80100642: 68 20 a5 10 80 push $0x8010a520 80100647: e8 14 3e 00 00 call 80104460 <release> ilock(ip); 8010064c: 58 pop %eax 8010064d: ff 75 08 pushl 0x8(%ebp) 80100650: e8 1b 10 00 00 call 80101670 <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>: } // Print to the console. only understands %d, %x, %p, %s. void cprintf(char *fmt, ...) { 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 int i, c, locking; uint *argp; char *s; locking = cons.locking; 80100669: a1 54 a5 10 80 mov 0x8010a554,%eax if(locking) 8010066e: 85 c0 test %eax,%eax { int i, c, locking; uint *argp; char *s; locking = cons.locking; 80100670: 89 45 e0 mov %eax,-0x20(%ebp) if(locking) 80100673: 0f 85 47 01 00 00 jne 801007c0 <cprintf+0x160> acquire(&cons.lock); if (fmt == 0) 80100679: 8b 45 08 mov 0x8(%ebp),%eax 8010067c: 85 c0 test %eax,%eax 8010067e: 89 c1 mov %eax,%ecx 80100680: 0f 84 4f 01 00 00 je 801007d5 <cprintf+0x175> panic("null fmt"); argp = (uint*)(void*)(&fmt + 1); for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100686: 0f b6 00 movzbl (%eax),%eax 80100689: 31 db xor %ebx,%ebx 8010068b: 8d 75 0c lea 0xc(%ebp),%esi 8010068e: 89 cf mov %ecx,%edi 80100690: 85 c0 test %eax,%eax 80100692: 75 55 jne 801006e9 <cprintf+0x89> 80100694: eb 68 jmp 801006fe <cprintf+0x9e> 80100696: 8d 76 00 lea 0x0(%esi),%esi 80100699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(c != '%'){ consputc(c); continue; } c = fmt[++i] & 0xff; 801006a0: 83 c3 01 add $0x1,%ebx 801006a3: 0f b6 14 1f movzbl (%edi,%ebx,1),%edx if(c == 0) 801006a7: 85 d2 test %edx,%edx 801006a9: 74 53 je 801006fe <cprintf+0x9e> break; switch(c){ 801006ab: 83 fa 70 cmp $0x70,%edx 801006ae: 74 7a je 8010072a <cprintf+0xca> 801006b0: 7f 6e jg 80100720 <cprintf+0xc0> 801006b2: 83 fa 25 cmp $0x25,%edx 801006b5: 0f 84 ad 00 00 00 je 80100768 <cprintf+0x108> 801006bb: 83 fa 64 cmp $0x64,%edx 801006be: 0f 85 84 00 00 00 jne 80100748 <cprintf+0xe8> case 'd': printint(*argp++, 10, 1); 801006c4: 8d 46 04 lea 0x4(%esi),%eax 801006c7: b9 01 00 00 00 mov $0x1,%ecx 801006cc: ba 0a 00 00 00 mov $0xa,%edx 801006d1: 89 45 e4 mov %eax,-0x1c(%ebp) 801006d4: 8b 06 mov (%esi),%eax 801006d6: e8 a5 fe ff ff call 80100580 <printint> 801006db: 8b 75 e4 mov -0x1c(%ebp),%esi if (fmt == 0) panic("null fmt"); argp = (uint*)(void*)(&fmt + 1); for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006de: 83 c3 01 add $0x1,%ebx 801006e1: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax 801006e5: 85 c0 test %eax,%eax 801006e7: 74 15 je 801006fe <cprintf+0x9e> if(c != '%'){ 801006e9: 83 f8 25 cmp $0x25,%eax 801006ec: 74 b2 je 801006a0 <cprintf+0x40> s = "(null)"; for(; *s; s++) consputc(*s); break; case '%': consputc('%'); 801006ee: e8 fd fc ff ff call 801003f0 <consputc> if (fmt == 0) panic("null fmt"); argp = (uint*)(void*)(&fmt + 1); for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006f3: 83 c3 01 add $0x1,%ebx 801006f6: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax 801006fa: 85 c0 test %eax,%eax 801006fc: 75 eb jne 801006e9 <cprintf+0x89> consputc(c); break; } } if(locking) 801006fe: 8b 45 e0 mov -0x20(%ebp),%eax 80100701: 85 c0 test %eax,%eax 80100703: 74 10 je 80100715 <cprintf+0xb5> release(&cons.lock); 80100705: 83 ec 0c sub $0xc,%esp 80100708: 68 20 a5 10 80 push $0x8010a520 8010070d: e8 4e 3d 00 00 call 80104460 <release> 80100712: 83 c4 10 add $0x10,%esp } 80100715: 8d 65 f4 lea -0xc(%ebp),%esp 80100718: 5b pop %ebx 80100719: 5e pop %esi 8010071a: 5f pop %edi 8010071b: 5d pop %ebp 8010071c: c3 ret 8010071d: 8d 76 00 lea 0x0(%esi),%esi continue; } c = fmt[++i] & 0xff; if(c == 0) break; switch(c){ 80100720: 83 fa 73 cmp $0x73,%edx 80100723: 74 5b je 80100780 <cprintf+0x120> 80100725: 83 fa 78 cmp $0x78,%edx 80100728: 75 1e jne 80100748 <cprintf+0xe8> case 'd': printint(*argp++, 10, 1); break; case 'x': case 'p': printint(*argp++, 16, 0); 8010072a: 8d 46 04 lea 0x4(%esi),%eax 8010072d: 31 c9 xor %ecx,%ecx 8010072f: ba 10 00 00 00 mov $0x10,%edx 80100734: 89 45 e4 mov %eax,-0x1c(%ebp) 80100737: 8b 06 mov (%esi),%eax 80100739: e8 42 fe ff ff call 80100580 <printint> 8010073e: 8b 75 e4 mov -0x1c(%ebp),%esi break; 80100741: eb 9b jmp 801006de <cprintf+0x7e> 80100743: 90 nop 80100744: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi case '%': consputc('%'); break; default: // Print unknown % sequence to draw attention. consputc('%'); 80100748: b8 25 00 00 00 mov $0x25,%eax 8010074d: 89 55 e4 mov %edx,-0x1c(%ebp) 80100750: e8 9b fc ff ff call 801003f0 <consputc> consputc(c); 80100755: 8b 55 e4 mov -0x1c(%ebp),%edx 80100758: 89 d0 mov %edx,%eax 8010075a: e8 91 fc ff ff call 801003f0 <consputc> break; 8010075f: e9 7a ff ff ff jmp 801006de <cprintf+0x7e> 80100764: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi s = "(null)"; for(; *s; s++) consputc(*s); break; case '%': consputc('%'); 80100768: b8 25 00 00 00 mov $0x25,%eax 8010076d: e8 7e fc ff ff call 801003f0 <consputc> 80100772: e9 7c ff ff ff jmp 801006f3 <cprintf+0x93> 80100777: 89 f6 mov %esi,%esi 80100779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi case 'x': case 'p': printint(*argp++, 16, 0); break; case 's': if((s = (char*)*argp++) == 0) 80100780: 8d 46 04 lea 0x4(%esi),%eax 80100783: 8b 36 mov (%esi),%esi 80100785: 89 45 e4 mov %eax,-0x1c(%ebp) s = "(null)"; 80100788: b8 b8 6f 10 80 mov $0x80106fb8,%eax 8010078d: 85 f6 test %esi,%esi 8010078f: 0f 44 f0 cmove %eax,%esi for(; *s; s++) 80100792: 0f be 06 movsbl (%esi),%eax 80100795: 84 c0 test %al,%al 80100797: 74 16 je 801007af <cprintf+0x14f> 80100799: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801007a0: 83 c6 01 add $0x1,%esi consputc(*s); 801007a3: e8 48 fc ff ff call 801003f0 <consputc> printint(*argp++, 16, 0); break; case 's': if((s = (char*)*argp++) == 0) s = "(null)"; for(; *s; s++) 801007a8: 0f be 06 movsbl (%esi),%eax 801007ab: 84 c0 test %al,%al 801007ad: 75 f1 jne 801007a0 <cprintf+0x140> case 'x': case 'p': printint(*argp++, 16, 0); break; case 's': if((s = (char*)*argp++) == 0) 801007af: 8b 75 e4 mov -0x1c(%ebp),%esi 801007b2: e9 27 ff ff ff jmp 801006de <cprintf+0x7e> 801007b7: 89 f6 mov %esi,%esi 801007b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi uint *argp; char *s; locking = cons.locking; if(locking) acquire(&cons.lock); 801007c0: 83 ec 0c sub $0xc,%esp 801007c3: 68 20 a5 10 80 push $0x8010a520 801007c8: e8 73 3b 00 00 call 80104340 <acquire> 801007cd: 83 c4 10 add $0x10,%esp 801007d0: e9 a4 fe ff ff jmp 80100679 <cprintf+0x19> if (fmt == 0) panic("null fmt"); 801007d5: 83 ec 0c sub $0xc,%esp 801007d8: 68 bf 6f 10 80 push $0x80106fbf 801007dd: e8 8e fb ff ff call 80100370 <panic> 801007e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801007e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801007f0 <consoleintr>: #define C(x) ((x)-'@') // Control-x void consoleintr(int (*getc)(void)) { 801007f0: 55 push %ebp 801007f1: 89 e5 mov %esp,%ebp 801007f3: 57 push %edi 801007f4: 56 push %esi 801007f5: 53 push %ebx int c, doprocdump = 0; 801007f6: 31 f6 xor %esi,%esi #define C(x) ((x)-'@') // Control-x void consoleintr(int (*getc)(void)) { 801007f8: 83 ec 18 sub $0x18,%esp 801007fb: 8b 5d 08 mov 0x8(%ebp),%ebx int c, doprocdump = 0; acquire(&cons.lock); 801007fe: 68 20 a5 10 80 push $0x8010a520 80100803: e8 38 3b 00 00 call 80104340 <acquire> while((c = getc()) >= 0){ 80100808: 83 c4 10 add $0x10,%esp 8010080b: 90 nop 8010080c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100810: ff d3 call *%ebx 80100812: 85 c0 test %eax,%eax 80100814: 89 c7 mov %eax,%edi 80100816: 78 48 js 80100860 <consoleintr+0x70> switch(c){ 80100818: 83 ff 10 cmp $0x10,%edi 8010081b: 0f 84 3f 01 00 00 je 80100960 <consoleintr+0x170> 80100821: 7e 5d jle 80100880 <consoleintr+0x90> 80100823: 83 ff 15 cmp $0x15,%edi 80100826: 0f 84 dc 00 00 00 je 80100908 <consoleintr+0x118> 8010082c: 83 ff 7f cmp $0x7f,%edi 8010082f: 75 54 jne 80100885 <consoleintr+0x95> input.e--; consputc(BACKSPACE); } break; case C('H'): case '\x7f': // Backspace if(input.e != input.w){ 80100831: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100836: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 8010083c: 74 d2 je 80100810 <consoleintr+0x20> input.e--; 8010083e: 83 e8 01 sub $0x1,%eax 80100841: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100846: b8 00 01 00 00 mov $0x100,%eax 8010084b: e8 a0 fb ff ff call 801003f0 <consputc> consoleintr(int (*getc)(void)) { int c, doprocdump = 0; acquire(&cons.lock); while((c = getc()) >= 0){ 80100850: ff d3 call *%ebx 80100852: 85 c0 test %eax,%eax 80100854: 89 c7 mov %eax,%edi 80100856: 79 c0 jns 80100818 <consoleintr+0x28> 80100858: 90 nop 80100859: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } } break; } } release(&cons.lock); 80100860: 83 ec 0c sub $0xc,%esp 80100863: 68 20 a5 10 80 push $0x8010a520 80100868: e8 f3 3b 00 00 call 80104460 <release> if(doprocdump) { 8010086d: 83 c4 10 add $0x10,%esp 80100870: 85 f6 test %esi,%esi 80100872: 0f 85 f8 00 00 00 jne 80100970 <consoleintr+0x180> procdump(); // now call procdump() wo. cons.lock held } } 80100878: 8d 65 f4 lea -0xc(%ebp),%esp 8010087b: 5b pop %ebx 8010087c: 5e pop %esi 8010087d: 5f pop %edi 8010087e: 5d pop %ebp 8010087f: c3 ret { int c, doprocdump = 0; acquire(&cons.lock); while((c = getc()) >= 0){ switch(c){ 80100880: 83 ff 08 cmp $0x8,%edi 80100883: 74 ac je 80100831 <consoleintr+0x41> input.e--; consputc(BACKSPACE); } break; default: if(c != 0 && input.e-input.r < INPUT_BUF){ 80100885: 85 ff test %edi,%edi 80100887: 74 87 je 80100810 <consoleintr+0x20> 80100889: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 8010088e: 89 c2 mov %eax,%edx 80100890: 2b 15 a0 ff 10 80 sub 0x8010ffa0,%edx 80100896: 83 fa 7f cmp $0x7f,%edx 80100899: 0f 87 71 ff ff ff ja 80100810 <consoleintr+0x20> c = (c == '\r') ? '\n' : c; input.buf[input.e++ % INPUT_BUF] = c; 8010089f: 8d 50 01 lea 0x1(%eax),%edx 801008a2: 83 e0 7f and $0x7f,%eax consputc(BACKSPACE); } break; default: if(c != 0 && input.e-input.r < INPUT_BUF){ c = (c == '\r') ? '\n' : c; 801008a5: 83 ff 0d cmp $0xd,%edi input.buf[input.e++ % INPUT_BUF] = c; 801008a8: 89 15 a8 ff 10 80 mov %edx,0x8010ffa8 consputc(BACKSPACE); } break; default: if(c != 0 && input.e-input.r < INPUT_BUF){ c = (c == '\r') ? '\n' : c; 801008ae: 0f 84 c8 00 00 00 je 8010097c <consoleintr+0x18c> input.buf[input.e++ % INPUT_BUF] = c; 801008b4: 89 f9 mov %edi,%ecx 801008b6: 88 88 20 ff 10 80 mov %cl,-0x7fef00e0(%eax) consputc(c); 801008bc: 89 f8 mov %edi,%eax 801008be: e8 2d fb ff ff call 801003f0 <consputc> if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ 801008c3: 83 ff 0a cmp $0xa,%edi 801008c6: 0f 84 c1 00 00 00 je 8010098d <consoleintr+0x19d> 801008cc: 83 ff 04 cmp $0x4,%edi 801008cf: 0f 84 b8 00 00 00 je 8010098d <consoleintr+0x19d> 801008d5: a1 a0 ff 10 80 mov 0x8010ffa0,%eax 801008da: 83 e8 80 sub $0xffffff80,%eax 801008dd: 39 05 a8 ff 10 80 cmp %eax,0x8010ffa8 801008e3: 0f 85 27 ff ff ff jne 80100810 <consoleintr+0x20> input.w = input.e; wakeup(&input.r); 801008e9: 83 ec 0c sub $0xc,%esp if(c != 0 && input.e-input.r < INPUT_BUF){ c = (c == '\r') ? '\n' : c; input.buf[input.e++ % INPUT_BUF] = c; consputc(c); if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ input.w = input.e; 801008ec: a3 a4 ff 10 80 mov %eax,0x8010ffa4 wakeup(&input.r); 801008f1: 68 a0 ff 10 80 push $0x8010ffa0 801008f6: e8 e5 35 00 00 call 80103ee0 <wakeup> 801008fb: 83 c4 10 add $0x10,%esp 801008fe: e9 0d ff ff ff jmp 80100810 <consoleintr+0x20> 80100903: 90 nop 80100904: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi case C('P'): // Process listing. // procdump() locks cons.lock indirectly; invoke later doprocdump = 1; break; case C('U'): // Kill line. while(input.e != input.w && 80100908: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 8010090d: 39 05 a4 ff 10 80 cmp %eax,0x8010ffa4 80100913: 75 2b jne 80100940 <consoleintr+0x150> 80100915: e9 f6 fe ff ff jmp 80100810 <consoleintr+0x20> 8010091a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi input.buf[(input.e-1) % INPUT_BUF] != '\n'){ input.e--; 80100920: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100925: b8 00 01 00 00 mov $0x100,%eax 8010092a: e8 c1 fa ff ff call 801003f0 <consputc> case C('P'): // Process listing. // procdump() locks cons.lock indirectly; invoke later doprocdump = 1; break; case C('U'): // Kill line. while(input.e != input.w && 8010092f: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100934: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 8010093a: 0f 84 d0 fe ff ff je 80100810 <consoleintr+0x20> input.buf[(input.e-1) % INPUT_BUF] != '\n'){ 80100940: 83 e8 01 sub $0x1,%eax 80100943: 89 c2 mov %eax,%edx 80100945: 83 e2 7f and $0x7f,%edx case C('P'): // Process listing. // procdump() locks cons.lock indirectly; invoke later doprocdump = 1; break; case C('U'): // Kill line. while(input.e != input.w && 80100948: 80 ba 20 ff 10 80 0a cmpb $0xa,-0x7fef00e0(%edx) 8010094f: 75 cf jne 80100920 <consoleintr+0x130> 80100951: e9 ba fe ff ff jmp 80100810 <consoleintr+0x20> 80100956: 8d 76 00 lea 0x0(%esi),%esi 80100959: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi acquire(&cons.lock); while((c = getc()) >= 0){ switch(c){ case C('P'): // Process listing. // procdump() locks cons.lock indirectly; invoke later doprocdump = 1; 80100960: be 01 00 00 00 mov $0x1,%esi 80100965: e9 a6 fe ff ff jmp 80100810 <consoleintr+0x20> 8010096a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } release(&cons.lock); if(doprocdump) { procdump(); // now call procdump() wo. cons.lock held } } 80100970: 8d 65 f4 lea -0xc(%ebp),%esp 80100973: 5b pop %ebx 80100974: 5e pop %esi 80100975: 5f pop %edi 80100976: 5d pop %ebp break; } } release(&cons.lock); if(doprocdump) { procdump(); // now call procdump() wo. cons.lock held 80100977: e9 54 36 00 00 jmp 80103fd0 <procdump> } break; default: if(c != 0 && input.e-input.r < INPUT_BUF){ c = (c == '\r') ? '\n' : c; input.buf[input.e++ % INPUT_BUF] = c; 8010097c: c6 80 20 ff 10 80 0a movb $0xa,-0x7fef00e0(%eax) consputc(c); 80100983: b8 0a 00 00 00 mov $0xa,%eax 80100988: e8 63 fa ff ff call 801003f0 <consputc> 8010098d: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100992: e9 52 ff ff ff jmp 801008e9 <consoleintr+0xf9> 80100997: 89 f6 mov %esi,%esi 80100999: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801009a0 <consoleinit>: return n; } void consoleinit(void) { 801009a0: 55 push %ebp 801009a1: 89 e5 mov %esp,%ebp 801009a3: 83 ec 10 sub $0x10,%esp initlock(&cons.lock, "console"); 801009a6: 68 c8 6f 10 80 push $0x80106fc8 801009ab: 68 20 a5 10 80 push $0x8010a520 801009b0: e8 8b 38 00 00 call 80104240 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; ioapicenable(IRQ_KBD, 0); 801009b5: 58 pop %eax 801009b6: 5a pop %edx 801009b7: 6a 00 push $0x0 801009b9: 6a 01 push $0x1 void consoleinit(void) { initlock(&cons.lock, "console"); devsw[CONSOLE].write = consolewrite; 801009bb: c7 05 6c 09 11 80 00 movl $0x80100600,0x8011096c 801009c2: 06 10 80 devsw[CONSOLE].read = consoleread; 801009c5: c7 05 68 09 11 80 70 movl $0x80100270,0x80110968 801009cc: 02 10 80 cons.locking = 1; 801009cf: c7 05 54 a5 10 80 01 movl $0x1,0x8010a554 801009d6: 00 00 00 ioapicenable(IRQ_KBD, 0); 801009d9: e8 c2 18 00 00 call 801022a0 <ioapicenable> } 801009de: 83 c4 10 add $0x10,%esp 801009e1: c9 leave 801009e2: c3 ret 801009e3: 66 90 xchg %ax,%ax 801009e5: 66 90 xchg %ax,%ax 801009e7: 66 90 xchg %ax,%ax 801009e9: 66 90 xchg %ax,%ax 801009eb: 66 90 xchg %ax,%ax 801009ed: 66 90 xchg %ax,%ax 801009ef: 90 nop 801009f0 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 801009f0: 55 push %ebp 801009f1: 89 e5 mov %esp,%ebp 801009f3: 57 push %edi 801009f4: 56 push %esi 801009f5: 53 push %ebx 801009f6: 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(); 801009fc: e8 7f 2d 00 00 call 80103780 <myproc> 80100a01: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 80100a07: e8 44 21 00 00 call 80102b50 <begin_op> if((ip = namei(path)) == 0){ 80100a0c: 83 ec 0c sub $0xc,%esp 80100a0f: ff 75 08 pushl 0x8(%ebp) 80100a12: e8 a9 14 00 00 call 80101ec0 <namei> 80100a17: 83 c4 10 add $0x10,%esp 80100a1a: 85 c0 test %eax,%eax 80100a1c: 0f 84 9c 01 00 00 je 80100bbe <exec+0x1ce> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 80100a22: 83 ec 0c sub $0xc,%esp 80100a25: 89 c3 mov %eax,%ebx 80100a27: 50 push %eax 80100a28: e8 43 0c 00 00 call 80101670 <ilock> pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a2d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 80100a33: 6a 34 push $0x34 80100a35: 6a 00 push $0x0 80100a37: 50 push %eax 80100a38: 53 push %ebx 80100a39: e8 12 0f 00 00 call 80101950 <readi> 80100a3e: 83 c4 20 add $0x20,%esp 80100a41: 83 f8 34 cmp $0x34,%eax 80100a44: 74 22 je 80100a68 <exec+0x78> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a46: 83 ec 0c sub $0xc,%esp 80100a49: 53 push %ebx 80100a4a: e8 b1 0e 00 00 call 80101900 <iunlockput> end_op(); 80100a4f: e8 6c 21 00 00 call 80102bc0 <end_op> 80100a54: 83 c4 10 add $0x10,%esp } return -1; 80100a57: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a5c: 8d 65 f4 lea -0xc(%ebp),%esp 80100a5f: 5b pop %ebx 80100a60: 5e pop %esi 80100a61: 5f pop %edi 80100a62: 5d pop %ebp 80100a63: c3 ret 80100a64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) goto bad; if(elf.magic != ELF_MAGIC) 80100a68: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a6f: 45 4c 46 80100a72: 75 d2 jne 80100a46 <exec+0x56> goto bad; if((pgdir = setupkvm()) == 0) 80100a74: e8 47 62 00 00 call 80106cc0 <setupkvm> 80100a79: 85 c0 test %eax,%eax 80100a7b: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80100a81: 74 c3 je 80100a46 <exec+0x56> goto bad; // Load program into memory. sz = 0; for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100a83: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp) 80100a8a: 00 80100a8b: 8b b5 40 ff ff ff mov -0xc0(%ebp),%esi 80100a91: c7 85 ec fe ff ff 00 movl $0x0,-0x114(%ebp) 80100a98: 00 00 00 80100a9b: 0f 84 c5 00 00 00 je 80100b66 <exec+0x176> 80100aa1: 31 ff xor %edi,%edi 80100aa3: eb 18 jmp 80100abd <exec+0xcd> 80100aa5: 8d 76 00 lea 0x0(%esi),%esi 80100aa8: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 80100aaf: 83 c7 01 add $0x1,%edi 80100ab2: 83 c6 20 add $0x20,%esi 80100ab5: 39 f8 cmp %edi,%eax 80100ab7: 0f 8e a9 00 00 00 jle 80100b66 <exec+0x176> if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) 80100abd: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 80100ac3: 6a 20 push $0x20 80100ac5: 56 push %esi 80100ac6: 50 push %eax 80100ac7: 53 push %ebx 80100ac8: e8 83 0e 00 00 call 80101950 <readi> 80100acd: 83 c4 10 add $0x10,%esp 80100ad0: 83 f8 20 cmp $0x20,%eax 80100ad3: 75 7b jne 80100b50 <exec+0x160> goto bad; if(ph.type != ELF_PROG_LOAD) 80100ad5: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp) 80100adc: 75 ca jne 80100aa8 <exec+0xb8> continue; if(ph.memsz < ph.filesz) 80100ade: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax 80100ae4: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax 80100aea: 72 64 jb 80100b50 <exec+0x160> goto bad; if(ph.vaddr + ph.memsz < ph.vaddr) 80100aec: 03 85 0c ff ff ff add -0xf4(%ebp),%eax 80100af2: 72 5c jb 80100b50 <exec+0x160> goto bad; if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0) 80100af4: 83 ec 04 sub $0x4,%esp 80100af7: 50 push %eax 80100af8: ff b5 ec fe ff ff pushl -0x114(%ebp) 80100afe: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b04: e8 07 60 00 00 call 80106b10 <allocuvm> 80100b09: 83 c4 10 add $0x10,%esp 80100b0c: 85 c0 test %eax,%eax 80100b0e: 89 85 ec fe ff ff mov %eax,-0x114(%ebp) 80100b14: 74 3a je 80100b50 <exec+0x160> goto bad; if(ph.vaddr % PGSIZE != 0) 80100b16: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax 80100b1c: a9 ff 0f 00 00 test $0xfff,%eax 80100b21: 75 2d jne 80100b50 <exec+0x160> goto bad; if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) 80100b23: 83 ec 0c sub $0xc,%esp 80100b26: ff b5 14 ff ff ff pushl -0xec(%ebp) 80100b2c: ff b5 08 ff ff ff pushl -0xf8(%ebp) 80100b32: 53 push %ebx 80100b33: 50 push %eax 80100b34: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b3a: e8 11 5f 00 00 call 80106a50 <loaduvm> 80100b3f: 83 c4 20 add $0x20,%esp 80100b42: 85 c0 test %eax,%eax 80100b44: 0f 89 5e ff ff ff jns 80100aa8 <exec+0xb8> 80100b4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi freevm(oldpgdir); return 0; bad: if(pgdir) freevm(pgdir); 80100b50: 83 ec 0c sub $0xc,%esp 80100b53: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b59: e8 e2 60 00 00 call 80106c40 <freevm> 80100b5e: 83 c4 10 add $0x10,%esp 80100b61: e9 e0 fe ff ff jmp 80100a46 <exec+0x56> if(ph.vaddr % PGSIZE != 0) goto bad; if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) goto bad; } iunlockput(ip); 80100b66: 83 ec 0c sub $0xc,%esp 80100b69: 53 push %ebx 80100b6a: e8 91 0d 00 00 call 80101900 <iunlockput> end_op(); 80100b6f: e8 4c 20 00 00 call 80102bc0 <end_op> ip = 0; // Allocate two pages at the next page boundary. // Make the first inaccessible. Use the second as the user stack. sz = PGROUNDUP(sz); 80100b74: 8b 85 ec fe ff ff mov -0x114(%ebp),%eax if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b7a: 83 c4 0c add $0xc,%esp end_op(); ip = 0; // Allocate two pages at the next page boundary. // Make the first inaccessible. Use the second as the user stack. sz = PGROUNDUP(sz); 80100b7d: 05 ff 0f 00 00 add $0xfff,%eax 80100b82: 25 00 f0 ff ff and $0xfffff000,%eax if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b87: 8d 90 00 20 00 00 lea 0x2000(%eax),%edx 80100b8d: 52 push %edx 80100b8e: 50 push %eax 80100b8f: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b95: e8 76 5f 00 00 call 80106b10 <allocuvm> 80100b9a: 83 c4 10 add $0x10,%esp 80100b9d: 85 c0 test %eax,%eax 80100b9f: 89 c6 mov %eax,%esi 80100ba1: 75 3a jne 80100bdd <exec+0x1ed> freevm(oldpgdir); return 0; bad: if(pgdir) freevm(pgdir); 80100ba3: 83 ec 0c sub $0xc,%esp 80100ba6: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100bac: e8 8f 60 00 00 call 80106c40 <freevm> 80100bb1: 83 c4 10 add $0x10,%esp if(ip){ iunlockput(ip); end_op(); } return -1; 80100bb4: b8 ff ff ff ff mov $0xffffffff,%eax 80100bb9: e9 9e fe ff ff jmp 80100a5c <exec+0x6c> struct proc *curproc = myproc(); begin_op(); if((ip = namei(path)) == 0){ end_op(); 80100bbe: e8 fd 1f 00 00 call 80102bc0 <end_op> cprintf("exec: fail\n"); 80100bc3: 83 ec 0c sub $0xc,%esp 80100bc6: 68 e1 6f 10 80 push $0x80106fe1 80100bcb: e8 90 fa ff ff call 80100660 <cprintf> return -1; 80100bd0: 83 c4 10 add $0x10,%esp 80100bd3: b8 ff ff ff ff mov $0xffffffff,%eax 80100bd8: e9 7f fe ff ff jmp 80100a5c <exec+0x6c> // Allocate two pages at the next page boundary. // Make the first inaccessible. Use the second as the user stack. sz = PGROUNDUP(sz); if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bdd: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax 80100be3: 83 ec 08 sub $0x8,%esp sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100be6: 31 ff xor %edi,%edi 80100be8: 89 f3 mov %esi,%ebx // Allocate two pages at the next page boundary. // Make the first inaccessible. Use the second as the user stack. sz = PGROUNDUP(sz); if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bea: 50 push %eax 80100beb: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100bf1: e8 6a 61 00 00 call 80106d60 <clearpteu> sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100bf6: 8b 45 0c mov 0xc(%ebp),%eax 80100bf9: 83 c4 10 add $0x10,%esp 80100bfc: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80100c02: 8b 00 mov (%eax),%eax 80100c04: 85 c0 test %eax,%eax 80100c06: 74 79 je 80100c81 <exec+0x291> 80100c08: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp) 80100c0e: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi 80100c14: eb 13 jmp 80100c29 <exec+0x239> 80100c16: 8d 76 00 lea 0x0(%esi),%esi 80100c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(argc >= MAXARG) 80100c20: 83 ff 20 cmp $0x20,%edi 80100c23: 0f 84 7a ff ff ff je 80100ba3 <exec+0x1b3> goto bad; sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c29: 83 ec 0c sub $0xc,%esp 80100c2c: 50 push %eax 80100c2d: e8 be 3a 00 00 call 801046f0 <strlen> 80100c32: f7 d0 not %eax 80100c34: 01 c3 add %eax,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c36: 8b 45 0c mov 0xc(%ebp),%eax 80100c39: 5a pop %edx // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { if(argc >= MAXARG) goto bad; sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c3a: 83 e3 fc and $0xfffffffc,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c3d: ff 34 b8 pushl (%eax,%edi,4) 80100c40: e8 ab 3a 00 00 call 801046f0 <strlen> 80100c45: 83 c0 01 add $0x1,%eax 80100c48: 50 push %eax 80100c49: 8b 45 0c mov 0xc(%ebp),%eax 80100c4c: ff 34 b8 pushl (%eax,%edi,4) 80100c4f: 53 push %ebx 80100c50: 56 push %esi 80100c51: e8 6a 62 00 00 call 80106ec0 <copyout> 80100c56: 83 c4 20 add $0x20,%esp 80100c59: 85 c0 test %eax,%eax 80100c5b: 0f 88 42 ff ff ff js 80100ba3 <exec+0x1b3> goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100c61: 8b 45 0c mov 0xc(%ebp),%eax if(argc >= MAXARG) goto bad; sp = (sp - (strlen(argv[argc]) + 1)) & ~3; if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) goto bad; ustack[3+argc] = sp; 80100c64: 89 9c bd 64 ff ff ff mov %ebx,-0x9c(%ebp,%edi,4) goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100c6b: 83 c7 01 add $0x1,%edi if(argc >= MAXARG) goto bad; sp = (sp - (strlen(argv[argc]) + 1)) & ~3; if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) goto bad; ustack[3+argc] = sp; 80100c6e: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx goto bad; clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); sp = sz; // Push argument strings, prepare rest of stack in ustack. for(argc = 0; argv[argc]; argc++) { 80100c74: 8b 04 b8 mov (%eax,%edi,4),%eax 80100c77: 85 c0 test %eax,%eax 80100c79: 75 a5 jne 80100c20 <exec+0x230> 80100c7b: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi } ustack[3+argc] = 0; ustack[0] = 0xffffffff; // fake return PC ustack[1] = argc; ustack[2] = sp - (argc+1)*4; // argv pointer 80100c81: 8d 04 bd 04 00 00 00 lea 0x4(,%edi,4),%eax 80100c88: 89 d9 mov %ebx,%ecx sp = (sp - (strlen(argv[argc]) + 1)) & ~3; if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) goto bad; ustack[3+argc] = sp; } ustack[3+argc] = 0; 80100c8a: c7 84 bd 64 ff ff ff movl $0x0,-0x9c(%ebp,%edi,4) 80100c91: 00 00 00 00 ustack[0] = 0xffffffff; // fake return PC 80100c95: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp) 80100c9c: ff ff ff ustack[1] = argc; 80100c9f: 89 bd 5c ff ff ff mov %edi,-0xa4(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100ca5: 29 c1 sub %eax,%ecx sp -= (3+argc+1) * 4; 80100ca7: 83 c0 0c add $0xc,%eax 80100caa: 29 c3 sub %eax,%ebx if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cac: 50 push %eax 80100cad: 52 push %edx 80100cae: 53 push %ebx 80100caf: ff b5 f0 fe ff ff pushl -0x110(%ebp) } ustack[3+argc] = 0; ustack[0] = 0xffffffff; // fake return PC ustack[1] = argc; ustack[2] = sp - (argc+1)*4; // argv pointer 80100cb5: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp) sp -= (3+argc+1) * 4; if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cbb: e8 00 62 00 00 call 80106ec0 <copyout> 80100cc0: 83 c4 10 add $0x10,%esp 80100cc3: 85 c0 test %eax,%eax 80100cc5: 0f 88 d8 fe ff ff js 80100ba3 <exec+0x1b3> goto bad; // Save program name for debugging. for(last=s=path; *s; s++) 80100ccb: 8b 45 08 mov 0x8(%ebp),%eax 80100cce: 0f b6 10 movzbl (%eax),%edx 80100cd1: 84 d2 test %dl,%dl 80100cd3: 74 19 je 80100cee <exec+0x2fe> 80100cd5: 8b 4d 08 mov 0x8(%ebp),%ecx 80100cd8: 83 c0 01 add $0x1,%eax if(*s == '/') last = s+1; 80100cdb: 80 fa 2f cmp $0x2f,%dl sp -= (3+argc+1) * 4; if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) goto bad; // Save program name for debugging. for(last=s=path; *s; s++) 80100cde: 0f b6 10 movzbl (%eax),%edx if(*s == '/') last = s+1; 80100ce1: 0f 44 c8 cmove %eax,%ecx 80100ce4: 83 c0 01 add $0x1,%eax sp -= (3+argc+1) * 4; if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) goto bad; // Save program name for debugging. for(last=s=path; *s; s++) 80100ce7: 84 d2 test %dl,%dl 80100ce9: 75 f0 jne 80100cdb <exec+0x2eb> 80100ceb: 89 4d 08 mov %ecx,0x8(%ebp) if(*s == '/') last = s+1; safestrcpy(curproc->name, last, sizeof(curproc->name)); 80100cee: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi 80100cf4: 50 push %eax 80100cf5: 6a 10 push $0x10 80100cf7: ff 75 08 pushl 0x8(%ebp) 80100cfa: 89 f8 mov %edi,%eax 80100cfc: 83 c0 6c add $0x6c,%eax 80100cff: 50 push %eax 80100d00: e8 ab 39 00 00 call 801046b0 <safestrcpy> // Commit to the user image. oldpgdir = curproc->pgdir; curproc->pgdir = pgdir; 80100d05: 8b 8d f0 fe ff ff mov -0x110(%ebp),%ecx if(*s == '/') last = s+1; safestrcpy(curproc->name, last, sizeof(curproc->name)); // Commit to the user image. oldpgdir = curproc->pgdir; 80100d0b: 89 f8 mov %edi,%eax 80100d0d: 8b 7f 04 mov 0x4(%edi),%edi curproc->pgdir = pgdir; curproc->sz = sz; 80100d10: 89 30 mov %esi,(%eax) last = s+1; safestrcpy(curproc->name, last, sizeof(curproc->name)); // Commit to the user image. oldpgdir = curproc->pgdir; curproc->pgdir = pgdir; 80100d12: 89 48 04 mov %ecx,0x4(%eax) curproc->sz = sz; curproc->tf->eip = elf.entry; // main 80100d15: 89 c1 mov %eax,%ecx 80100d17: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 80100d1d: 8b 40 18 mov 0x18(%eax),%eax 80100d20: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 80100d23: 8b 41 18 mov 0x18(%ecx),%eax 80100d26: 89 58 44 mov %ebx,0x44(%eax) switchuvm(curproc); 80100d29: 89 0c 24 mov %ecx,(%esp) 80100d2c: e8 8f 5b 00 00 call 801068c0 <switchuvm> freevm(oldpgdir); 80100d31: 89 3c 24 mov %edi,(%esp) 80100d34: e8 07 5f 00 00 call 80106c40 <freevm> return 0; 80100d39: 83 c4 10 add $0x10,%esp 80100d3c: 31 c0 xor %eax,%eax 80100d3e: e9 19 fd ff ff jmp 80100a5c <exec+0x6c> 80100d43: 66 90 xchg %ax,%ax 80100d45: 66 90 xchg %ax,%ax 80100d47: 66 90 xchg %ax,%ax 80100d49: 66 90 xchg %ax,%ax 80100d4b: 66 90 xchg %ax,%ax 80100d4d: 66 90 xchg %ax,%ax 80100d4f: 90 nop 80100d50 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 80100d50: 55 push %ebp 80100d51: 89 e5 mov %esp,%ebp 80100d53: 83 ec 10 sub $0x10,%esp initlock(&ftable.lock, "ftable"); 80100d56: 68 ed 6f 10 80 push $0x80106fed 80100d5b: 68 c0 ff 10 80 push $0x8010ffc0 80100d60: e8 db 34 00 00 call 80104240 <initlock> } 80100d65: 83 c4 10 add $0x10,%esp 80100d68: c9 leave 80100d69: c3 ret 80100d6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100d70 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80100d70: 55 push %ebp 80100d71: 89 e5 mov %esp,%ebp 80100d73: 53 push %ebx struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d74: bb f4 ff 10 80 mov $0x8010fff4,%ebx } // Allocate a file structure. struct file* filealloc(void) { 80100d79: 83 ec 10 sub $0x10,%esp struct file *f; acquire(&ftable.lock); 80100d7c: 68 c0 ff 10 80 push $0x8010ffc0 80100d81: e8 ba 35 00 00 call 80104340 <acquire> 80100d86: 83 c4 10 add $0x10,%esp 80100d89: eb 10 jmp 80100d9b <filealloc+0x2b> 80100d8b: 90 nop 80100d8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d90: 83 c3 18 add $0x18,%ebx 80100d93: 81 fb 54 09 11 80 cmp $0x80110954,%ebx 80100d99: 74 25 je 80100dc0 <filealloc+0x50> if(f->ref == 0){ 80100d9b: 8b 43 04 mov 0x4(%ebx),%eax 80100d9e: 85 c0 test %eax,%eax 80100da0: 75 ee jne 80100d90 <filealloc+0x20> f->ref = 1; release(&ftable.lock); 80100da2: 83 ec 0c sub $0xc,%esp struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ if(f->ref == 0){ f->ref = 1; 80100da5: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) release(&ftable.lock); 80100dac: 68 c0 ff 10 80 push $0x8010ffc0 80100db1: e8 aa 36 00 00 call 80104460 <release> return f; 80100db6: 89 d8 mov %ebx,%eax 80100db8: 83 c4 10 add $0x10,%esp } } release(&ftable.lock); return 0; } 80100dbb: 8b 5d fc mov -0x4(%ebp),%ebx 80100dbe: c9 leave 80100dbf: c3 ret f->ref = 1; release(&ftable.lock); return f; } } release(&ftable.lock); 80100dc0: 83 ec 0c sub $0xc,%esp 80100dc3: 68 c0 ff 10 80 push $0x8010ffc0 80100dc8: e8 93 36 00 00 call 80104460 <release> return 0; 80100dcd: 83 c4 10 add $0x10,%esp 80100dd0: 31 c0 xor %eax,%eax } 80100dd2: 8b 5d fc mov -0x4(%ebp),%ebx 80100dd5: c9 leave 80100dd6: c3 ret 80100dd7: 89 f6 mov %esi,%esi 80100dd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100de0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80100de0: 55 push %ebp 80100de1: 89 e5 mov %esp,%ebp 80100de3: 53 push %ebx 80100de4: 83 ec 10 sub $0x10,%esp 80100de7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 80100dea: 68 c0 ff 10 80 push $0x8010ffc0 80100def: e8 4c 35 00 00 call 80104340 <acquire> if(f->ref < 1) 80100df4: 8b 43 04 mov 0x4(%ebx),%eax 80100df7: 83 c4 10 add $0x10,%esp 80100dfa: 85 c0 test %eax,%eax 80100dfc: 7e 1a jle 80100e18 <filedup+0x38> panic("filedup"); f->ref++; 80100dfe: 83 c0 01 add $0x1,%eax release(&ftable.lock); 80100e01: 83 ec 0c sub $0xc,%esp filedup(struct file *f) { acquire(&ftable.lock); if(f->ref < 1) panic("filedup"); f->ref++; 80100e04: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 80100e07: 68 c0 ff 10 80 push $0x8010ffc0 80100e0c: e8 4f 36 00 00 call 80104460 <release> return f; } 80100e11: 89 d8 mov %ebx,%eax 80100e13: 8b 5d fc mov -0x4(%ebp),%ebx 80100e16: c9 leave 80100e17: c3 ret struct file* filedup(struct file *f) { acquire(&ftable.lock); if(f->ref < 1) panic("filedup"); 80100e18: 83 ec 0c sub $0xc,%esp 80100e1b: 68 f4 6f 10 80 push $0x80106ff4 80100e20: e8 4b f5 ff ff call 80100370 <panic> 80100e25: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100e29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100e30 <fileclose>: } // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80100e30: 55 push %ebp 80100e31: 89 e5 mov %esp,%ebp 80100e33: 57 push %edi 80100e34: 56 push %esi 80100e35: 53 push %ebx 80100e36: 83 ec 28 sub $0x28,%esp 80100e39: 8b 7d 08 mov 0x8(%ebp),%edi struct file ff; acquire(&ftable.lock); 80100e3c: 68 c0 ff 10 80 push $0x8010ffc0 80100e41: e8 fa 34 00 00 call 80104340 <acquire> if(f->ref < 1) 80100e46: 8b 47 04 mov 0x4(%edi),%eax 80100e49: 83 c4 10 add $0x10,%esp 80100e4c: 85 c0 test %eax,%eax 80100e4e: 0f 8e 9b 00 00 00 jle 80100eef <fileclose+0xbf> panic("fileclose"); if(--f->ref > 0){ 80100e54: 83 e8 01 sub $0x1,%eax 80100e57: 85 c0 test %eax,%eax 80100e59: 89 47 04 mov %eax,0x4(%edi) 80100e5c: 74 1a je 80100e78 <fileclose+0x48> release(&ftable.lock); 80100e5e: c7 45 08 c0 ff 10 80 movl $0x8010ffc0,0x8(%ebp) else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); } } 80100e65: 8d 65 f4 lea -0xc(%ebp),%esp 80100e68: 5b pop %ebx 80100e69: 5e pop %esi 80100e6a: 5f pop %edi 80100e6b: 5d pop %ebp acquire(&ftable.lock); if(f->ref < 1) panic("fileclose"); if(--f->ref > 0){ release(&ftable.lock); 80100e6c: e9 ef 35 00 00 jmp 80104460 <release> 80100e71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return; } ff = *f; 80100e78: 0f b6 47 09 movzbl 0x9(%edi),%eax 80100e7c: 8b 1f mov (%edi),%ebx f->ref = 0; f->type = FD_NONE; release(&ftable.lock); 80100e7e: 83 ec 0c sub $0xc,%esp panic("fileclose"); if(--f->ref > 0){ release(&ftable.lock); return; } ff = *f; 80100e81: 8b 77 0c mov 0xc(%edi),%esi f->ref = 0; f->type = FD_NONE; 80100e84: c7 07 00 00 00 00 movl $0x0,(%edi) panic("fileclose"); if(--f->ref > 0){ release(&ftable.lock); return; } ff = *f; 80100e8a: 88 45 e7 mov %al,-0x19(%ebp) 80100e8d: 8b 47 10 mov 0x10(%edi),%eax f->ref = 0; f->type = FD_NONE; release(&ftable.lock); 80100e90: 68 c0 ff 10 80 push $0x8010ffc0 panic("fileclose"); if(--f->ref > 0){ release(&ftable.lock); return; } ff = *f; 80100e95: 89 45 e0 mov %eax,-0x20(%ebp) f->ref = 0; f->type = FD_NONE; release(&ftable.lock); 80100e98: e8 c3 35 00 00 call 80104460 <release> if(ff.type == FD_PIPE) 80100e9d: 83 c4 10 add $0x10,%esp 80100ea0: 83 fb 01 cmp $0x1,%ebx 80100ea3: 74 13 je 80100eb8 <fileclose+0x88> pipeclose(ff.pipe, ff.writable); else if(ff.type == FD_INODE){ 80100ea5: 83 fb 02 cmp $0x2,%ebx 80100ea8: 74 26 je 80100ed0 <fileclose+0xa0> begin_op(); iput(ff.ip); end_op(); } } 80100eaa: 8d 65 f4 lea -0xc(%ebp),%esp 80100ead: 5b pop %ebx 80100eae: 5e pop %esi 80100eaf: 5f pop %edi 80100eb0: 5d pop %ebp 80100eb1: c3 ret 80100eb2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi f->ref = 0; f->type = FD_NONE; release(&ftable.lock); if(ff.type == FD_PIPE) pipeclose(ff.pipe, ff.writable); 80100eb8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 80100ebc: 83 ec 08 sub $0x8,%esp 80100ebf: 53 push %ebx 80100ec0: 56 push %esi 80100ec1: e8 2a 24 00 00 call 801032f0 <pipeclose> 80100ec6: 83 c4 10 add $0x10,%esp 80100ec9: eb df jmp 80100eaa <fileclose+0x7a> 80100ecb: 90 nop 80100ecc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi else if(ff.type == FD_INODE){ begin_op(); 80100ed0: e8 7b 1c 00 00 call 80102b50 <begin_op> iput(ff.ip); 80100ed5: 83 ec 0c sub $0xc,%esp 80100ed8: ff 75 e0 pushl -0x20(%ebp) 80100edb: e8 c0 08 00 00 call 801017a0 <iput> end_op(); 80100ee0: 83 c4 10 add $0x10,%esp } } 80100ee3: 8d 65 f4 lea -0xc(%ebp),%esp 80100ee6: 5b pop %ebx 80100ee7: 5e pop %esi 80100ee8: 5f pop %edi 80100ee9: 5d pop %ebp if(ff.type == FD_PIPE) pipeclose(ff.pipe, ff.writable); else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); 80100eea: e9 d1 1c 00 00 jmp 80102bc0 <end_op> { struct file ff; acquire(&ftable.lock); if(f->ref < 1) panic("fileclose"); 80100eef: 83 ec 0c sub $0xc,%esp 80100ef2: 68 fc 6f 10 80 push $0x80106ffc 80100ef7: e8 74 f4 ff ff call 80100370 <panic> 80100efc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100f00 <filestat>: } // Get metadata about file f. int filestat(struct file *f, struct stat *st) { 80100f00: 55 push %ebp 80100f01: 89 e5 mov %esp,%ebp 80100f03: 53 push %ebx 80100f04: 83 ec 04 sub $0x4,%esp 80100f07: 8b 5d 08 mov 0x8(%ebp),%ebx if(f->type == FD_INODE){ 80100f0a: 83 3b 02 cmpl $0x2,(%ebx) 80100f0d: 75 31 jne 80100f40 <filestat+0x40> ilock(f->ip); 80100f0f: 83 ec 0c sub $0xc,%esp 80100f12: ff 73 10 pushl 0x10(%ebx) 80100f15: e8 56 07 00 00 call 80101670 <ilock> stati(f->ip, st); 80100f1a: 58 pop %eax 80100f1b: 5a pop %edx 80100f1c: ff 75 0c pushl 0xc(%ebp) 80100f1f: ff 73 10 pushl 0x10(%ebx) 80100f22: e8 f9 09 00 00 call 80101920 <stati> iunlock(f->ip); 80100f27: 59 pop %ecx 80100f28: ff 73 10 pushl 0x10(%ebx) 80100f2b: e8 20 08 00 00 call 80101750 <iunlock> return 0; 80100f30: 83 c4 10 add $0x10,%esp 80100f33: 31 c0 xor %eax,%eax } return -1; } 80100f35: 8b 5d fc mov -0x4(%ebp),%ebx 80100f38: c9 leave 80100f39: c3 ret 80100f3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi ilock(f->ip); stati(f->ip, st); iunlock(f->ip); return 0; } return -1; 80100f40: b8 ff ff ff ff mov $0xffffffff,%eax } 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 80100f50 <fileread>: // Read from file f. int fileread(struct file *f, char *addr, int n) { 80100f50: 55 push %ebp 80100f51: 89 e5 mov %esp,%ebp 80100f53: 57 push %edi 80100f54: 56 push %esi 80100f55: 53 push %ebx 80100f56: 83 ec 0c sub $0xc,%esp 80100f59: 8b 5d 08 mov 0x8(%ebp),%ebx 80100f5c: 8b 75 0c mov 0xc(%ebp),%esi 80100f5f: 8b 7d 10 mov 0x10(%ebp),%edi int r; if(f->readable == 0) 80100f62: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80100f66: 74 60 je 80100fc8 <fileread+0x78> return -1; if(f->type == FD_PIPE) 80100f68: 8b 03 mov (%ebx),%eax 80100f6a: 83 f8 01 cmp $0x1,%eax 80100f6d: 74 41 je 80100fb0 <fileread+0x60> return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ 80100f6f: 83 f8 02 cmp $0x2,%eax 80100f72: 75 5b jne 80100fcf <fileread+0x7f> ilock(f->ip); 80100f74: 83 ec 0c sub $0xc,%esp 80100f77: ff 73 10 pushl 0x10(%ebx) 80100f7a: e8 f1 06 00 00 call 80101670 <ilock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f7f: 57 push %edi 80100f80: ff 73 14 pushl 0x14(%ebx) 80100f83: 56 push %esi 80100f84: ff 73 10 pushl 0x10(%ebx) 80100f87: e8 c4 09 00 00 call 80101950 <readi> 80100f8c: 83 c4 20 add $0x20,%esp 80100f8f: 85 c0 test %eax,%eax 80100f91: 89 c6 mov %eax,%esi 80100f93: 7e 03 jle 80100f98 <fileread+0x48> f->off += r; 80100f95: 01 43 14 add %eax,0x14(%ebx) iunlock(f->ip); 80100f98: 83 ec 0c sub $0xc,%esp 80100f9b: ff 73 10 pushl 0x10(%ebx) 80100f9e: e8 ad 07 00 00 call 80101750 <iunlock> return r; 80100fa3: 83 c4 10 add $0x10,%esp return -1; if(f->type == FD_PIPE) return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ ilock(f->ip); if((r = readi(f->ip, addr, f->off, n)) > 0) 80100fa6: 89 f0 mov %esi,%eax f->off += r; iunlock(f->ip); return r; } panic("fileread"); } 80100fa8: 8d 65 f4 lea -0xc(%ebp),%esp 80100fab: 5b pop %ebx 80100fac: 5e pop %esi 80100fad: 5f pop %edi 80100fae: 5d pop %ebp 80100faf: c3 ret int r; if(f->readable == 0) return -1; if(f->type == FD_PIPE) return piperead(f->pipe, addr, n); 80100fb0: 8b 43 0c mov 0xc(%ebx),%eax 80100fb3: 89 45 08 mov %eax,0x8(%ebp) f->off += r; iunlock(f->ip); return r; } panic("fileread"); } 80100fb6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fb9: 5b pop %ebx 80100fba: 5e pop %esi 80100fbb: 5f pop %edi 80100fbc: 5d pop %ebp int r; if(f->readable == 0) return -1; if(f->type == FD_PIPE) return piperead(f->pipe, addr, n); 80100fbd: e9 ce 24 00 00 jmp 80103490 <piperead> 80100fc2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi fileread(struct file *f, char *addr, int n) { int r; if(f->readable == 0) return -1; 80100fc8: b8 ff ff ff ff mov $0xffffffff,%eax 80100fcd: eb d9 jmp 80100fa8 <fileread+0x58> if((r = readi(f->ip, addr, f->off, n)) > 0) f->off += r; iunlock(f->ip); return r; } panic("fileread"); 80100fcf: 83 ec 0c sub $0xc,%esp 80100fd2: 68 06 70 10 80 push $0x80107006 80100fd7: e8 94 f3 ff ff call 80100370 <panic> 80100fdc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100fe0 <filewrite>: } // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100fe0: 55 push %ebp 80100fe1: 89 e5 mov %esp,%ebp 80100fe3: 57 push %edi 80100fe4: 56 push %esi 80100fe5: 53 push %ebx 80100fe6: 83 ec 1c sub $0x1c,%esp 80100fe9: 8b 75 08 mov 0x8(%ebp),%esi 80100fec: 8b 45 0c mov 0xc(%ebp),%eax int r; if(f->writable == 0) 80100fef: 80 7e 09 00 cmpb $0x0,0x9(%esi) } // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100ff3: 89 45 dc mov %eax,-0x24(%ebp) 80100ff6: 8b 45 10 mov 0x10(%ebp),%eax 80100ff9: 89 45 e4 mov %eax,-0x1c(%ebp) int r; if(f->writable == 0) 80100ffc: 0f 84 aa 00 00 00 je 801010ac <filewrite+0xcc> return -1; if(f->type == FD_PIPE) 80101002: 8b 06 mov (%esi),%eax 80101004: 83 f8 01 cmp $0x1,%eax 80101007: 0f 84 c2 00 00 00 je 801010cf <filewrite+0xef> return pipewrite(f->pipe, addr, n); if(f->type == FD_INODE){ 8010100d: 83 f8 02 cmp $0x2,%eax 80101010: 0f 85 d8 00 00 00 jne 801010ee <filewrite+0x10e> // 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 = ((LOGSIZE-1-1-2) / 2) * 512; int i = 0; while(i < n){ 80101016: 8b 45 e4 mov -0x1c(%ebp),%eax 80101019: 31 ff xor %edi,%edi 8010101b: 85 c0 test %eax,%eax 8010101d: 7f 34 jg 80101053 <filewrite+0x73> 8010101f: e9 9c 00 00 00 jmp 801010c0 <filewrite+0xe0> 80101024: 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; 80101028: 01 46 14 add %eax,0x14(%esi) iunlock(f->ip); 8010102b: 83 ec 0c sub $0xc,%esp 8010102e: ff 76 10 pushl 0x10(%esi) n1 = max; begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) f->off += r; 80101031: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101034: e8 17 07 00 00 call 80101750 <iunlock> end_op(); 80101039: e8 82 1b 00 00 call 80102bc0 <end_op> 8010103e: 8b 45 e0 mov -0x20(%ebp),%eax 80101041: 83 c4 10 add $0x10,%esp if(r < 0) break; if(r != n1) 80101044: 39 d8 cmp %ebx,%eax 80101046: 0f 85 95 00 00 00 jne 801010e1 <filewrite+0x101> panic("short filewrite"); i += r; 8010104c: 01 c7 add %eax,%edi // 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 = ((LOGSIZE-1-1-2) / 2) * 512; int i = 0; while(i < n){ 8010104e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101051: 7e 6d jle 801010c0 <filewrite+0xe0> int n1 = n - i; 80101053: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101056: b8 00 1a 00 00 mov $0x1a00,%eax 8010105b: 29 fb sub %edi,%ebx 8010105d: 81 fb 00 1a 00 00 cmp $0x1a00,%ebx 80101063: 0f 4f d8 cmovg %eax,%ebx if(n1 > max) n1 = max; begin_op(); 80101066: e8 e5 1a 00 00 call 80102b50 <begin_op> ilock(f->ip); 8010106b: 83 ec 0c sub $0xc,%esp 8010106e: ff 76 10 pushl 0x10(%esi) 80101071: e8 fa 05 00 00 call 80101670 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) 80101076: 8b 45 dc mov -0x24(%ebp),%eax 80101079: 53 push %ebx 8010107a: ff 76 14 pushl 0x14(%esi) 8010107d: 01 f8 add %edi,%eax 8010107f: 50 push %eax 80101080: ff 76 10 pushl 0x10(%esi) 80101083: e8 c8 09 00 00 call 80101a50 <writei> 80101088: 83 c4 20 add $0x20,%esp 8010108b: 85 c0 test %eax,%eax 8010108d: 7f 99 jg 80101028 <filewrite+0x48> f->off += r; iunlock(f->ip); 8010108f: 83 ec 0c sub $0xc,%esp 80101092: ff 76 10 pushl 0x10(%esi) 80101095: 89 45 e0 mov %eax,-0x20(%ebp) 80101098: e8 b3 06 00 00 call 80101750 <iunlock> end_op(); 8010109d: e8 1e 1b 00 00 call 80102bc0 <end_op> if(r < 0) 801010a2: 8b 45 e0 mov -0x20(%ebp),%eax 801010a5: 83 c4 10 add $0x10,%esp 801010a8: 85 c0 test %eax,%eax 801010aa: 74 98 je 80101044 <filewrite+0x64> i += r; } return i == n ? n : -1; } panic("filewrite"); } 801010ac: 8d 65 f4 lea -0xc(%ebp),%esp break; if(r != n1) panic("short filewrite"); i += r; } return i == n ? n : -1; 801010af: b8 ff ff ff ff mov $0xffffffff,%eax } panic("filewrite"); } 801010b4: 5b pop %ebx 801010b5: 5e pop %esi 801010b6: 5f pop %edi 801010b7: 5d pop %ebp 801010b8: c3 ret 801010b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi break; if(r != n1) panic("short filewrite"); i += r; } return i == n ? n : -1; 801010c0: 3b 7d e4 cmp -0x1c(%ebp),%edi 801010c3: 75 e7 jne 801010ac <filewrite+0xcc> } panic("filewrite"); } 801010c5: 8d 65 f4 lea -0xc(%ebp),%esp 801010c8: 89 f8 mov %edi,%eax 801010ca: 5b pop %ebx 801010cb: 5e pop %esi 801010cc: 5f pop %edi 801010cd: 5d pop %ebp 801010ce: c3 ret int r; if(f->writable == 0) return -1; if(f->type == FD_PIPE) return pipewrite(f->pipe, addr, n); 801010cf: 8b 46 0c mov 0xc(%esi),%eax 801010d2: 89 45 08 mov %eax,0x8(%ebp) i += r; } return i == n ? n : -1; } panic("filewrite"); } 801010d5: 8d 65 f4 lea -0xc(%ebp),%esp 801010d8: 5b pop %ebx 801010d9: 5e pop %esi 801010da: 5f pop %edi 801010db: 5d pop %ebp int r; if(f->writable == 0) return -1; if(f->type == FD_PIPE) return pipewrite(f->pipe, addr, n); 801010dc: e9 af 22 00 00 jmp 80103390 <pipewrite> end_op(); if(r < 0) break; if(r != n1) panic("short filewrite"); 801010e1: 83 ec 0c sub $0xc,%esp 801010e4: 68 0f 70 10 80 push $0x8010700f 801010e9: e8 82 f2 ff ff call 80100370 <panic> i += r; } return i == n ? n : -1; } panic("filewrite"); 801010ee: 83 ec 0c sub $0xc,%esp 801010f1: 68 15 70 10 80 push $0x80107015 801010f6: e8 75 f2 ff ff call 80100370 <panic> 801010fb: 66 90 xchg %ax,%ax 801010fd: 66 90 xchg %ax,%ax 801010ff: 90 nop 80101100 <balloc>: // Blocks. // Allocate a zeroed disk block. static uint balloc(uint dev) { 80101100: 55 push %ebp 80101101: 89 e5 mov %esp,%ebp 80101103: 57 push %edi 80101104: 56 push %esi 80101105: 53 push %ebx 80101106: 83 ec 1c sub $0x1c,%esp int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 80101109: 8b 0d c0 09 11 80 mov 0x801109c0,%ecx // Blocks. // Allocate a zeroed disk block. static uint balloc(uint dev) { 8010110f: 89 45 d8 mov %eax,-0x28(%ebp) int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 80101112: 85 c9 test %ecx,%ecx 80101114: 0f 84 85 00 00 00 je 8010119f <balloc+0x9f> 8010111a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 80101121: 8b 75 dc mov -0x24(%ebp),%esi 80101124: 83 ec 08 sub $0x8,%esp 80101127: 89 f0 mov %esi,%eax 80101129: c1 f8 0c sar $0xc,%eax 8010112c: 03 05 d8 09 11 80 add 0x801109d8,%eax 80101132: 50 push %eax 80101133: ff 75 d8 pushl -0x28(%ebp) 80101136: e8 95 ef ff ff call 801000d0 <bread> 8010113b: 89 45 e4 mov %eax,-0x1c(%ebp) 8010113e: a1 c0 09 11 80 mov 0x801109c0,%eax 80101143: 83 c4 10 add $0x10,%esp 80101146: 89 45 e0 mov %eax,-0x20(%ebp) for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 80101149: 31 c0 xor %eax,%eax 8010114b: eb 2d jmp 8010117a <balloc+0x7a> 8010114d: 8d 76 00 lea 0x0(%esi),%esi m = 1 << (bi % 8); 80101150: 89 c1 mov %eax,%ecx 80101152: ba 01 00 00 00 mov $0x1,%edx if((bp->data[bi/8] & m) == 0){ // Is block free? 80101157: 8b 5d e4 mov -0x1c(%ebp),%ebx bp = 0; for(b = 0; b < sb.size; b += BPB){ bp = bread(dev, BBLOCK(b, sb)); for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ m = 1 << (bi % 8); 8010115a: 83 e1 07 and $0x7,%ecx 8010115d: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0){ // Is block free? 8010115f: 89 c1 mov %eax,%ecx 80101161: c1 f9 03 sar $0x3,%ecx 80101164: 0f b6 7c 0b 5c movzbl 0x5c(%ebx,%ecx,1),%edi 80101169: 85 d7 test %edx,%edi 8010116b: 74 43 je 801011b0 <balloc+0xb0> struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ bp = bread(dev, BBLOCK(b, sb)); for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 8010116d: 83 c0 01 add $0x1,%eax 80101170: 83 c6 01 add $0x1,%esi 80101173: 3d 00 10 00 00 cmp $0x1000,%eax 80101178: 74 05 je 8010117f <balloc+0x7f> 8010117a: 3b 75 e0 cmp -0x20(%ebp),%esi 8010117d: 72 d1 jb 80101150 <balloc+0x50> brelse(bp); bzero(dev, b + bi); return b + bi; } } brelse(bp); 8010117f: 83 ec 0c sub $0xc,%esp 80101182: ff 75 e4 pushl -0x1c(%ebp) 80101185: e8 56 f0 ff ff call 801001e0 <brelse> { int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 8010118a: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 80101191: 83 c4 10 add $0x10,%esp 80101194: 8b 45 dc mov -0x24(%ebp),%eax 80101197: 39 05 c0 09 11 80 cmp %eax,0x801109c0 8010119d: 77 82 ja 80101121 <balloc+0x21> return b + bi; } } brelse(bp); } panic("balloc: out of blocks"); 8010119f: 83 ec 0c sub $0xc,%esp 801011a2: 68 1f 70 10 80 push $0x8010701f 801011a7: e8 c4 f1 ff ff call 80100370 <panic> 801011ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(b = 0; b < sb.size; b += BPB){ bp = bread(dev, BBLOCK(b, sb)); for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0){ // Is block free? bp->data[bi/8] |= m; // Mark block in use. 801011b0: 09 fa or %edi,%edx 801011b2: 8b 7d e4 mov -0x1c(%ebp),%edi log_write(bp); 801011b5: 83 ec 0c sub $0xc,%esp for(b = 0; b < sb.size; b += BPB){ bp = bread(dev, BBLOCK(b, sb)); for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0){ // Is block free? bp->data[bi/8] |= m; // Mark block in use. 801011b8: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1) log_write(bp); 801011bc: 57 push %edi 801011bd: e8 6e 1b 00 00 call 80102d30 <log_write> brelse(bp); 801011c2: 89 3c 24 mov %edi,(%esp) 801011c5: e8 16 f0 ff ff call 801001e0 <brelse> static void bzero(int dev, int bno) { struct buf *bp; bp = bread(dev, bno); 801011ca: 58 pop %eax 801011cb: 5a pop %edx 801011cc: 56 push %esi 801011cd: ff 75 d8 pushl -0x28(%ebp) 801011d0: e8 fb ee ff ff call 801000d0 <bread> 801011d5: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 801011d7: 8d 40 5c lea 0x5c(%eax),%eax 801011da: 83 c4 0c add $0xc,%esp 801011dd: 68 00 02 00 00 push $0x200 801011e2: 6a 00 push $0x0 801011e4: 50 push %eax 801011e5: e8 c6 32 00 00 call 801044b0 <memset> log_write(bp); 801011ea: 89 1c 24 mov %ebx,(%esp) 801011ed: e8 3e 1b 00 00 call 80102d30 <log_write> brelse(bp); 801011f2: 89 1c 24 mov %ebx,(%esp) 801011f5: e8 e6 ef ff ff call 801001e0 <brelse> } } brelse(bp); } panic("balloc: out of blocks"); } 801011fa: 8d 65 f4 lea -0xc(%ebp),%esp 801011fd: 89 f0 mov %esi,%eax 801011ff: 5b pop %ebx 80101200: 5e pop %esi 80101201: 5f pop %edi 80101202: 5d pop %ebp 80101203: c3 ret 80101204: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010120a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101210 <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) { 80101210: 55 push %ebp 80101211: 89 e5 mov %esp,%ebp 80101213: 57 push %edi 80101214: 56 push %esi 80101215: 53 push %ebx 80101216: 89 c7 mov %eax,%edi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101218: 31 f6 xor %esi,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010121a: bb 14 0a 11 80 mov $0x80110a14,%ebx // 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) { 8010121f: 83 ec 28 sub $0x28,%esp 80101222: 89 55 e4 mov %edx,-0x1c(%ebp) struct inode *ip, *empty; acquire(&icache.lock); 80101225: 68 e0 09 11 80 push $0x801109e0 8010122a: e8 11 31 00 00 call 80104340 <acquire> 8010122f: 83 c4 10 add $0x10,%esp // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101232: 8b 55 e4 mov -0x1c(%ebp),%edx 80101235: eb 1b jmp 80101252 <iget+0x42> 80101237: 89 f6 mov %esi,%esi 80101239: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip->ref++; release(&icache.lock); return ip; } if(empty == 0 && ip->ref == 0) // Remember empty slot. 80101240: 85 f6 test %esi,%esi 80101242: 74 44 je 80101288 <iget+0x78> acquire(&icache.lock); // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101244: 81 c3 90 00 00 00 add $0x90,%ebx 8010124a: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 80101250: 74 4e je 801012a0 <iget+0x90> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 80101252: 8b 4b 08 mov 0x8(%ebx),%ecx 80101255: 85 c9 test %ecx,%ecx 80101257: 7e e7 jle 80101240 <iget+0x30> 80101259: 39 3b cmp %edi,(%ebx) 8010125b: 75 e3 jne 80101240 <iget+0x30> 8010125d: 39 53 04 cmp %edx,0x4(%ebx) 80101260: 75 de jne 80101240 <iget+0x30> ip->ref++; release(&icache.lock); 80101262: 83 ec 0c sub $0xc,%esp // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip->ref++; 80101265: 83 c1 01 add $0x1,%ecx release(&icache.lock); return ip; 80101268: 89 de mov %ebx,%esi // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip->ref++; release(&icache.lock); 8010126a: 68 e0 09 11 80 push $0x801109e0 // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip->ref++; 8010126f: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 80101272: e8 e9 31 00 00 call 80104460 <release> return ip; 80101277: 83 c4 10 add $0x10,%esp ip->ref = 1; ip->valid = 0; release(&icache.lock); return ip; } 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 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip->ref++; release(&icache.lock); return ip; } if(empty == 0 && ip->ref == 0) // Remember empty slot. 80101288: 85 c9 test %ecx,%ecx 8010128a: 0f 44 f3 cmove %ebx,%esi acquire(&icache.lock); // Is the inode already cached? empty = 0; for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010128d: 81 c3 90 00 00 00 add $0x90,%ebx 80101293: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 80101299: 75 b7 jne 80101252 <iget+0x42> 8010129b: 90 nop 8010129c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(empty == 0 && ip->ref == 0) // Remember empty slot. empty = ip; } // Recycle an inode cache entry. if(empty == 0) 801012a0: 85 f6 test %esi,%esi 801012a2: 74 2d je 801012d1 <iget+0xc1> ip = empty; ip->dev = dev; ip->inum = inum; ip->ref = 1; ip->valid = 0; release(&icache.lock); 801012a4: 83 ec 0c sub $0xc,%esp // Recycle an inode cache entry. if(empty == 0) panic("iget: no inodes"); ip = empty; ip->dev = dev; 801012a7: 89 3e mov %edi,(%esi) ip->inum = inum; 801012a9: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 801012ac: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 801012b3: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 801012ba: 68 e0 09 11 80 push $0x801109e0 801012bf: e8 9c 31 00 00 call 80104460 <release> return ip; 801012c4: 83 c4 10 add $0x10,%esp } 801012c7: 8d 65 f4 lea -0xc(%ebp),%esp 801012ca: 89 f0 mov %esi,%eax 801012cc: 5b pop %ebx 801012cd: 5e pop %esi 801012ce: 5f pop %edi 801012cf: 5d pop %ebp 801012d0: c3 ret empty = ip; } // Recycle an inode cache entry. if(empty == 0) panic("iget: no inodes"); 801012d1: 83 ec 0c sub $0xc,%esp 801012d4: 68 35 70 10 80 push $0x80107035 801012d9: e8 92 f0 ff ff call 80100370 <panic> 801012de: 66 90 xchg %ax,%ax 801012e0 <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) { 801012e0: 55 push %ebp 801012e1: 89 e5 mov %esp,%ebp 801012e3: 57 push %edi 801012e4: 56 push %esi 801012e5: 53 push %ebx 801012e6: 89 c6 mov %eax,%esi 801012e8: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 801012eb: 83 fa 0b cmp $0xb,%edx 801012ee: 77 18 ja 80101308 <bmap+0x28> 801012f0: 8d 1c 90 lea (%eax,%edx,4),%ebx if((addr = ip->addrs[bn]) == 0) 801012f3: 8b 43 5c mov 0x5c(%ebx),%eax 801012f6: 85 c0 test %eax,%eax 801012f8: 74 76 je 80101370 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 801012fa: 8d 65 f4 lea -0xc(%ebp),%esp 801012fd: 5b pop %ebx 801012fe: 5e pop %esi 801012ff: 5f pop %edi 80101300: 5d pop %ebp 80101301: c3 ret 80101302: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(bn < NDIRECT){ if((addr = ip->addrs[bn]) == 0) ip->addrs[bn] = addr = balloc(ip->dev); return addr; } bn -= NDIRECT; 80101308: 8d 5a f4 lea -0xc(%edx),%ebx if(bn < NINDIRECT){ 8010130b: 83 fb 7f cmp $0x7f,%ebx 8010130e: 0f 87 83 00 00 00 ja 80101397 <bmap+0xb7> // Load indirect block, allocating if necessary. if((addr = ip->addrs[NDIRECT]) == 0) 80101314: 8b 80 8c 00 00 00 mov 0x8c(%eax),%eax 8010131a: 85 c0 test %eax,%eax 8010131c: 74 6a je 80101388 <bmap+0xa8> ip->addrs[NDIRECT] = addr = balloc(ip->dev); bp = bread(ip->dev, addr); 8010131e: 83 ec 08 sub $0x8,%esp 80101321: 50 push %eax 80101322: ff 36 pushl (%esi) 80101324: e8 a7 ed ff ff call 801000d0 <bread> a = (uint*)bp->data; if((addr = a[bn]) == 0){ 80101329: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx 8010132d: 83 c4 10 add $0x10,%esp if(bn < NINDIRECT){ // Load indirect block, allocating if necessary. if((addr = ip->addrs[NDIRECT]) == 0) ip->addrs[NDIRECT] = addr = balloc(ip->dev); bp = bread(ip->dev, addr); 80101330: 89 c7 mov %eax,%edi a = (uint*)bp->data; if((addr = a[bn]) == 0){ 80101332: 8b 1a mov (%edx),%ebx 80101334: 85 db test %ebx,%ebx 80101336: 75 1d jne 80101355 <bmap+0x75> a[bn] = addr = balloc(ip->dev); 80101338: 8b 06 mov (%esi),%eax 8010133a: 89 55 e4 mov %edx,-0x1c(%ebp) 8010133d: e8 be fd ff ff call 80101100 <balloc> 80101342: 8b 55 e4 mov -0x1c(%ebp),%edx log_write(bp); 80101345: 83 ec 0c sub $0xc,%esp if((addr = ip->addrs[NDIRECT]) == 0) ip->addrs[NDIRECT] = addr = balloc(ip->dev); bp = bread(ip->dev, addr); a = (uint*)bp->data; if((addr = a[bn]) == 0){ a[bn] = addr = balloc(ip->dev); 80101348: 89 c3 mov %eax,%ebx 8010134a: 89 02 mov %eax,(%edx) log_write(bp); 8010134c: 57 push %edi 8010134d: e8 de 19 00 00 call 80102d30 <log_write> 80101352: 83 c4 10 add $0x10,%esp } brelse(bp); 80101355: 83 ec 0c sub $0xc,%esp 80101358: 57 push %edi 80101359: e8 82 ee ff ff call 801001e0 <brelse> 8010135e: 83 c4 10 add $0x10,%esp return addr; } panic("bmap: out of range"); } 80101361: 8d 65 f4 lea -0xc(%ebp),%esp a = (uint*)bp->data; if((addr = a[bn]) == 0){ a[bn] = addr = balloc(ip->dev); log_write(bp); } brelse(bp); 80101364: 89 d8 mov %ebx,%eax return addr; } panic("bmap: out of range"); } 80101366: 5b pop %ebx 80101367: 5e pop %esi 80101368: 5f pop %edi 80101369: 5d pop %ebp 8010136a: c3 ret 8010136b: 90 nop 8010136c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uint addr, *a; struct buf *bp; if(bn < NDIRECT){ if((addr = ip->addrs[bn]) == 0) ip->addrs[bn] = addr = balloc(ip->dev); 80101370: 8b 06 mov (%esi),%eax 80101372: e8 89 fd ff ff call 80101100 <balloc> 80101377: 89 43 5c mov %eax,0x5c(%ebx) brelse(bp); return addr; } panic("bmap: out of range"); } 8010137a: 8d 65 f4 lea -0xc(%ebp),%esp 8010137d: 5b pop %ebx 8010137e: 5e pop %esi 8010137f: 5f pop %edi 80101380: 5d pop %ebp 80101381: c3 ret 80101382: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bn -= NDIRECT; if(bn < NINDIRECT){ // Load indirect block, allocating if necessary. if((addr = ip->addrs[NDIRECT]) == 0) ip->addrs[NDIRECT] = addr = balloc(ip->dev); 80101388: 8b 06 mov (%esi),%eax 8010138a: e8 71 fd ff ff call 80101100 <balloc> 8010138f: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 80101395: eb 87 jmp 8010131e <bmap+0x3e> } brelse(bp); return addr; } panic("bmap: out of range"); 80101397: 83 ec 0c sub $0xc,%esp 8010139a: 68 45 70 10 80 push $0x80107045 8010139f: e8 cc ef ff ff call 80100370 <panic> 801013a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801013aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801013b0 <readsb>: struct superblock sb; // Read the super block. void readsb(int dev, struct superblock *sb) { 801013b0: 55 push %ebp 801013b1: 89 e5 mov %esp,%ebp 801013b3: 56 push %esi 801013b4: 53 push %ebx 801013b5: 8b 75 0c mov 0xc(%ebp),%esi struct buf *bp; bp = bread(dev, 1); 801013b8: 83 ec 08 sub $0x8,%esp 801013bb: 6a 01 push $0x1 801013bd: ff 75 08 pushl 0x8(%ebp) 801013c0: e8 0b ed ff ff call 801000d0 <bread> 801013c5: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 801013c7: 8d 40 5c lea 0x5c(%eax),%eax 801013ca: 83 c4 0c add $0xc,%esp 801013cd: 6a 1c push $0x1c 801013cf: 50 push %eax 801013d0: 56 push %esi 801013d1: e8 8a 31 00 00 call 80104560 <memmove> brelse(bp); 801013d6: 89 5d 08 mov %ebx,0x8(%ebp) 801013d9: 83 c4 10 add $0x10,%esp } 801013dc: 8d 65 f8 lea -0x8(%ebp),%esp 801013df: 5b pop %ebx 801013e0: 5e pop %esi 801013e1: 5d pop %ebp { struct buf *bp; bp = bread(dev, 1); memmove(sb, bp->data, sizeof(*sb)); brelse(bp); 801013e2: e9 f9 ed ff ff jmp 801001e0 <brelse> 801013e7: 89 f6 mov %esi,%esi 801013e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801013f0 <bfree>: } // Free a disk block. static void bfree(int dev, uint b) { 801013f0: 55 push %ebp 801013f1: 89 e5 mov %esp,%ebp 801013f3: 56 push %esi 801013f4: 53 push %ebx 801013f5: 89 d3 mov %edx,%ebx 801013f7: 89 c6 mov %eax,%esi struct buf *bp; int bi, m; readsb(dev, &sb); 801013f9: 83 ec 08 sub $0x8,%esp 801013fc: 68 c0 09 11 80 push $0x801109c0 80101401: 50 push %eax 80101402: e8 a9 ff ff ff call 801013b0 <readsb> bp = bread(dev, BBLOCK(b, sb)); 80101407: 58 pop %eax 80101408: 5a pop %edx 80101409: 89 da mov %ebx,%edx 8010140b: c1 ea 0c shr $0xc,%edx 8010140e: 03 15 d8 09 11 80 add 0x801109d8,%edx 80101414: 52 push %edx 80101415: 56 push %esi 80101416: e8 b5 ec ff ff call 801000d0 <bread> bi = b % BPB; m = 1 << (bi % 8); 8010141b: 89 d9 mov %ebx,%ecx if((bp->data[bi/8] & m) == 0) 8010141d: 81 e3 ff 0f 00 00 and $0xfff,%ebx int bi, m; readsb(dev, &sb); bp = bread(dev, BBLOCK(b, sb)); bi = b % BPB; m = 1 << (bi % 8); 80101423: ba 01 00 00 00 mov $0x1,%edx 80101428: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 8010142b: c1 fb 03 sar $0x3,%ebx 8010142e: 83 c4 10 add $0x10,%esp int bi, m; readsb(dev, &sb); bp = bread(dev, BBLOCK(b, sb)); bi = b % BPB; m = 1 << (bi % 8); 80101431: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0) 80101433: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx 80101438: 85 d1 test %edx,%ecx 8010143a: 74 27 je 80101463 <bfree+0x73> 8010143c: 89 c6 mov %eax,%esi panic("freeing free block"); bp->data[bi/8] &= ~m; 8010143e: f7 d2 not %edx 80101440: 89 c8 mov %ecx,%eax log_write(bp); 80101442: 83 ec 0c sub $0xc,%esp bp = bread(dev, BBLOCK(b, sb)); bi = b % BPB; m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0) panic("freeing free block"); bp->data[bi/8] &= ~m; 80101445: 21 d0 and %edx,%eax 80101447: 88 44 1e 5c mov %al,0x5c(%esi,%ebx,1) log_write(bp); 8010144b: 56 push %esi 8010144c: e8 df 18 00 00 call 80102d30 <log_write> brelse(bp); 80101451: 89 34 24 mov %esi,(%esp) 80101454: e8 87 ed ff ff call 801001e0 <brelse> } 80101459: 83 c4 10 add $0x10,%esp 8010145c: 8d 65 f8 lea -0x8(%ebp),%esp 8010145f: 5b pop %ebx 80101460: 5e pop %esi 80101461: 5d pop %ebp 80101462: c3 ret readsb(dev, &sb); bp = bread(dev, BBLOCK(b, sb)); bi = b % BPB; m = 1 << (bi % 8); if((bp->data[bi/8] & m) == 0) panic("freeing free block"); 80101463: 83 ec 0c sub $0xc,%esp 80101466: 68 58 70 10 80 push $0x80107058 8010146b: e8 00 ef ff ff call 80100370 <panic> 80101470 <iinit>: struct inode inode[NINODE]; } icache; void iinit(int dev) { 80101470: 55 push %ebp 80101471: 89 e5 mov %esp,%ebp 80101473: 53 push %ebx 80101474: bb 20 0a 11 80 mov $0x80110a20,%ebx 80101479: 83 ec 0c sub $0xc,%esp int i = 0; initlock(&icache.lock, "icache"); 8010147c: 68 6b 70 10 80 push $0x8010706b 80101481: 68 e0 09 11 80 push $0x801109e0 80101486: e8 b5 2d 00 00 call 80104240 <initlock> 8010148b: 83 c4 10 add $0x10,%esp 8010148e: 66 90 xchg %ax,%ax for(i = 0; i < NINODE; i++) { initsleeplock(&icache.inode[i].lock, "inode"); 80101490: 83 ec 08 sub $0x8,%esp 80101493: 68 72 70 10 80 push $0x80107072 80101498: 53 push %ebx 80101499: 81 c3 90 00 00 00 add $0x90,%ebx 8010149f: e8 8c 2c 00 00 call 80104130 <initsleeplock> iinit(int dev) { int i = 0; initlock(&icache.lock, "icache"); for(i = 0; i < NINODE; i++) { 801014a4: 83 c4 10 add $0x10,%esp 801014a7: 81 fb 40 26 11 80 cmp $0x80112640,%ebx 801014ad: 75 e1 jne 80101490 <iinit+0x20> initsleeplock(&icache.inode[i].lock, "inode"); } readsb(dev, &sb); 801014af: 83 ec 08 sub $0x8,%esp 801014b2: 68 c0 09 11 80 push $0x801109c0 801014b7: ff 75 08 pushl 0x8(%ebp) 801014ba: e8 f1 fe ff ff call 801013b0 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 801014bf: ff 35 d8 09 11 80 pushl 0x801109d8 801014c5: ff 35 d4 09 11 80 pushl 0x801109d4 801014cb: ff 35 d0 09 11 80 pushl 0x801109d0 801014d1: ff 35 cc 09 11 80 pushl 0x801109cc 801014d7: ff 35 c8 09 11 80 pushl 0x801109c8 801014dd: ff 35 c4 09 11 80 pushl 0x801109c4 801014e3: ff 35 c0 09 11 80 pushl 0x801109c0 801014e9: 68 d8 70 10 80 push $0x801070d8 801014ee: e8 6d f1 ff ff call 80100660 <cprintf> inodestart %d bmap start %d\n", sb.size, sb.nblocks, sb.ninodes, sb.nlog, sb.logstart, sb.inodestart, sb.bmapstart); } 801014f3: 83 c4 30 add $0x30,%esp 801014f6: 8b 5d fc mov -0x4(%ebp),%ebx 801014f9: c9 leave 801014fa: c3 ret 801014fb: 90 nop 801014fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101500 <ialloc>: // Allocate an inode on device dev. // Mark it as allocated by giving it type type. // Returns an unlocked but allocated and referenced inode. struct inode* ialloc(uint dev, short type) { 80101500: 55 push %ebp 80101501: 89 e5 mov %esp,%ebp 80101503: 57 push %edi 80101504: 56 push %esi 80101505: 53 push %ebx 80101506: 83 ec 1c sub $0x1c,%esp int inum; struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ 80101509: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8 // Allocate an inode on device dev. // Mark it as allocated by giving it type type. // Returns an unlocked but allocated and referenced inode. struct inode* ialloc(uint dev, short type) { 80101510: 8b 45 0c mov 0xc(%ebp),%eax 80101513: 8b 75 08 mov 0x8(%ebp),%esi 80101516: 89 45 e4 mov %eax,-0x1c(%ebp) int inum; struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ 80101519: 0f 86 91 00 00 00 jbe 801015b0 <ialloc+0xb0> 8010151f: bb 01 00 00 00 mov $0x1,%ebx 80101524: eb 21 jmp 80101547 <ialloc+0x47> 80101526: 8d 76 00 lea 0x0(%esi),%esi 80101529: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi dip->type = type; log_write(bp); // mark it allocated on the disk brelse(bp); return iget(dev, inum); } brelse(bp); 80101530: 83 ec 0c sub $0xc,%esp { int inum; struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ 80101533: 83 c3 01 add $0x1,%ebx dip->type = type; log_write(bp); // mark it allocated on the disk brelse(bp); return iget(dev, inum); } brelse(bp); 80101536: 57 push %edi 80101537: e8 a4 ec ff ff call 801001e0 <brelse> { int inum; struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ 8010153c: 83 c4 10 add $0x10,%esp 8010153f: 39 1d c8 09 11 80 cmp %ebx,0x801109c8 80101545: 76 69 jbe 801015b0 <ialloc+0xb0> bp = bread(dev, IBLOCK(inum, sb)); 80101547: 89 d8 mov %ebx,%eax 80101549: 83 ec 08 sub $0x8,%esp 8010154c: c1 e8 03 shr $0x3,%eax 8010154f: 03 05 d4 09 11 80 add 0x801109d4,%eax 80101555: 50 push %eax 80101556: 56 push %esi 80101557: e8 74 eb ff ff call 801000d0 <bread> 8010155c: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum%IPB; 8010155e: 89 d8 mov %ebx,%eax if(dip->type == 0){ // a free inode 80101560: 83 c4 10 add $0x10,%esp struct buf *bp; struct dinode *dip; for(inum = 1; inum < sb.ninodes; inum++){ bp = bread(dev, IBLOCK(inum, sb)); dip = (struct dinode*)bp->data + inum%IPB; 80101563: 83 e0 07 and $0x7,%eax 80101566: c1 e0 06 shl $0x6,%eax 80101569: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if(dip->type == 0){ // a free inode 8010156d: 66 83 39 00 cmpw $0x0,(%ecx) 80101571: 75 bd jne 80101530 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80101573: 83 ec 04 sub $0x4,%esp 80101576: 89 4d e0 mov %ecx,-0x20(%ebp) 80101579: 6a 40 push $0x40 8010157b: 6a 00 push $0x0 8010157d: 51 push %ecx 8010157e: e8 2d 2f 00 00 call 801044b0 <memset> dip->type = type; 80101583: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax 80101587: 8b 4d e0 mov -0x20(%ebp),%ecx 8010158a: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 8010158d: 89 3c 24 mov %edi,(%esp) 80101590: e8 9b 17 00 00 call 80102d30 <log_write> brelse(bp); 80101595: 89 3c 24 mov %edi,(%esp) 80101598: e8 43 ec ff ff call 801001e0 <brelse> return iget(dev, inum); 8010159d: 83 c4 10 add $0x10,%esp } brelse(bp); } panic("ialloc: no inodes"); } 801015a0: 8d 65 f4 lea -0xc(%ebp),%esp if(dip->type == 0){ // a free inode memset(dip, 0, sizeof(*dip)); dip->type = type; log_write(bp); // mark it allocated on the disk brelse(bp); return iget(dev, inum); 801015a3: 89 da mov %ebx,%edx 801015a5: 89 f0 mov %esi,%eax } brelse(bp); } panic("ialloc: no inodes"); } 801015a7: 5b pop %ebx 801015a8: 5e pop %esi 801015a9: 5f pop %edi 801015aa: 5d pop %ebp if(dip->type == 0){ // a free inode memset(dip, 0, sizeof(*dip)); dip->type = type; log_write(bp); // mark it allocated on the disk brelse(bp); return iget(dev, inum); 801015ab: e9 60 fc ff ff jmp 80101210 <iget> } brelse(bp); } panic("ialloc: no inodes"); 801015b0: 83 ec 0c sub $0xc,%esp 801015b3: 68 78 70 10 80 push $0x80107078 801015b8: e8 b3 ed ff ff call 80100370 <panic> 801015bd: 8d 76 00 lea 0x0(%esi),%esi 801015c0 <iupdate>: // Must be called after every change to an ip->xxx field // that lives on disk, since i-node cache is write-through. // Caller must hold ip->lock. void iupdate(struct inode *ip) { 801015c0: 55 push %ebp 801015c1: 89 e5 mov %esp,%ebp 801015c3: 56 push %esi 801015c4: 53 push %ebx 801015c5: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf *bp; struct dinode *dip; bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015c8: 83 ec 08 sub $0x8,%esp 801015cb: 8b 43 04 mov 0x4(%ebx),%eax dip->type = ip->type; dip->major = ip->major; dip->minor = ip->minor; dip->nlink = ip->nlink; dip->size = ip->size; memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015ce: 83 c3 5c add $0x5c,%ebx iupdate(struct inode *ip) { struct buf *bp; struct dinode *dip; bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015d1: c1 e8 03 shr $0x3,%eax 801015d4: 03 05 d4 09 11 80 add 0x801109d4,%eax 801015da: 50 push %eax 801015db: ff 73 a4 pushl -0x5c(%ebx) 801015de: e8 ed ea ff ff call 801000d0 <bread> 801015e3: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801015e5: 8b 43 a8 mov -0x58(%ebx),%eax dip->type = ip->type; 801015e8: 0f b7 53 f4 movzwl -0xc(%ebx),%edx dip->major = ip->major; dip->minor = ip->minor; dip->nlink = ip->nlink; dip->size = ip->size; memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015ec: 83 c4 0c add $0xc,%esp { struct buf *bp; struct dinode *dip; bp = bread(ip->dev, IBLOCK(ip->inum, sb)); dip = (struct dinode*)bp->data + ip->inum%IPB; 801015ef: 83 e0 07 and $0x7,%eax 801015f2: c1 e0 06 shl $0x6,%eax 801015f5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 801015f9: 66 89 10 mov %dx,(%eax) dip->major = ip->major; 801015fc: 0f b7 53 f6 movzwl -0xa(%ebx),%edx dip->minor = ip->minor; dip->nlink = ip->nlink; dip->size = ip->size; memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101600: 83 c0 0c add $0xc,%eax struct dinode *dip; bp = bread(ip->dev, IBLOCK(ip->inum, sb)); dip = (struct dinode*)bp->data + ip->inum%IPB; dip->type = ip->type; dip->major = ip->major; 80101603: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 80101607: 0f b7 53 f8 movzwl -0x8(%ebx),%edx 8010160b: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 8010160f: 0f b7 53 fa movzwl -0x6(%ebx),%edx 80101613: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 80101617: 8b 53 fc mov -0x4(%ebx),%edx 8010161a: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010161d: 6a 34 push $0x34 8010161f: 53 push %ebx 80101620: 50 push %eax 80101621: e8 3a 2f 00 00 call 80104560 <memmove> log_write(bp); 80101626: 89 34 24 mov %esi,(%esp) 80101629: e8 02 17 00 00 call 80102d30 <log_write> brelse(bp); 8010162e: 89 75 08 mov %esi,0x8(%ebp) 80101631: 83 c4 10 add $0x10,%esp } 80101634: 8d 65 f8 lea -0x8(%ebp),%esp 80101637: 5b pop %ebx 80101638: 5e pop %esi 80101639: 5d pop %ebp dip->minor = ip->minor; dip->nlink = ip->nlink; dip->size = ip->size; memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); log_write(bp); brelse(bp); 8010163a: e9 a1 eb ff ff jmp 801001e0 <brelse> 8010163f: 90 nop 80101640 <idup>: // Increment reference count for ip. // Returns ip to enable ip = idup(ip1) idiom. struct inode* idup(struct inode *ip) { 80101640: 55 push %ebp 80101641: 89 e5 mov %esp,%ebp 80101643: 53 push %ebx 80101644: 83 ec 10 sub $0x10,%esp 80101647: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010164a: 68 e0 09 11 80 push $0x801109e0 8010164f: e8 ec 2c 00 00 call 80104340 <acquire> ip->ref++; 80101654: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80101658: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010165f: e8 fc 2d 00 00 call 80104460 <release> return ip; } 80101664: 89 d8 mov %ebx,%eax 80101666: 8b 5d fc mov -0x4(%ebp),%ebx 80101669: c9 leave 8010166a: c3 ret 8010166b: 90 nop 8010166c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101670 <ilock>: // Lock the given inode. // Reads the inode from disk if necessary. void ilock(struct inode *ip) { 80101670: 55 push %ebp 80101671: 89 e5 mov %esp,%ebp 80101673: 56 push %esi 80101674: 53 push %ebx 80101675: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf *bp; struct dinode *dip; if(ip == 0 || ip->ref < 1) 80101678: 85 db test %ebx,%ebx 8010167a: 0f 84 b7 00 00 00 je 80101737 <ilock+0xc7> 80101680: 8b 53 08 mov 0x8(%ebx),%edx 80101683: 85 d2 test %edx,%edx 80101685: 0f 8e ac 00 00 00 jle 80101737 <ilock+0xc7> panic("ilock"); acquiresleep(&ip->lock); 8010168b: 8d 43 0c lea 0xc(%ebx),%eax 8010168e: 83 ec 0c sub $0xc,%esp 80101691: 50 push %eax 80101692: e8 d9 2a 00 00 call 80104170 <acquiresleep> if(ip->valid == 0){ 80101697: 8b 43 4c mov 0x4c(%ebx),%eax 8010169a: 83 c4 10 add $0x10,%esp 8010169d: 85 c0 test %eax,%eax 8010169f: 74 0f je 801016b0 <ilock+0x40> brelse(bp); ip->valid = 1; if(ip->type == 0) panic("ilock: no type"); } } 801016a1: 8d 65 f8 lea -0x8(%ebp),%esp 801016a4: 5b pop %ebx 801016a5: 5e pop %esi 801016a6: 5d pop %ebp 801016a7: c3 ret 801016a8: 90 nop 801016a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi panic("ilock"); acquiresleep(&ip->lock); if(ip->valid == 0){ bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016b0: 8b 43 04 mov 0x4(%ebx),%eax 801016b3: 83 ec 08 sub $0x8,%esp 801016b6: c1 e8 03 shr $0x3,%eax 801016b9: 03 05 d4 09 11 80 add 0x801109d4,%eax 801016bf: 50 push %eax 801016c0: ff 33 pushl (%ebx) 801016c2: e8 09 ea ff ff call 801000d0 <bread> 801016c7: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801016c9: 8b 43 04 mov 0x4(%ebx),%eax ip->type = dip->type; ip->major = dip->major; ip->minor = dip->minor; ip->nlink = dip->nlink; ip->size = dip->size; memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016cc: 83 c4 0c add $0xc,%esp acquiresleep(&ip->lock); if(ip->valid == 0){ bp = bread(ip->dev, IBLOCK(ip->inum, sb)); dip = (struct dinode*)bp->data + ip->inum%IPB; 801016cf: 83 e0 07 and $0x7,%eax 801016d2: c1 e0 06 shl $0x6,%eax 801016d5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 801016d9: 0f b7 10 movzwl (%eax),%edx ip->major = dip->major; ip->minor = dip->minor; ip->nlink = dip->nlink; ip->size = dip->size; memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016dc: 83 c0 0c add $0xc,%eax acquiresleep(&ip->lock); if(ip->valid == 0){ bp = bread(ip->dev, IBLOCK(ip->inum, sb)); dip = (struct dinode*)bp->data + ip->inum%IPB; ip->type = dip->type; 801016df: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 801016e3: 0f b7 50 f6 movzwl -0xa(%eax),%edx 801016e7: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 801016eb: 0f b7 50 f8 movzwl -0x8(%eax),%edx 801016ef: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 801016f3: 0f b7 50 fa movzwl -0x6(%eax),%edx 801016f7: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 801016fb: 8b 50 fc mov -0x4(%eax),%edx 801016fe: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101701: 6a 34 push $0x34 80101703: 50 push %eax 80101704: 8d 43 5c lea 0x5c(%ebx),%eax 80101707: 50 push %eax 80101708: e8 53 2e 00 00 call 80104560 <memmove> brelse(bp); 8010170d: 89 34 24 mov %esi,(%esp) 80101710: e8 cb ea ff ff call 801001e0 <brelse> ip->valid = 1; if(ip->type == 0) 80101715: 83 c4 10 add $0x10,%esp 80101718: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->minor = dip->minor; ip->nlink = dip->nlink; ip->size = dip->size; memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); brelse(bp); ip->valid = 1; 8010171d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 80101724: 0f 85 77 ff ff ff jne 801016a1 <ilock+0x31> panic("ilock: no type"); 8010172a: 83 ec 0c sub $0xc,%esp 8010172d: 68 90 70 10 80 push $0x80107090 80101732: e8 39 ec ff ff call 80100370 <panic> { struct buf *bp; struct dinode *dip; if(ip == 0 || ip->ref < 1) panic("ilock"); 80101737: 83 ec 0c sub $0xc,%esp 8010173a: 68 8a 70 10 80 push $0x8010708a 8010173f: e8 2c ec ff ff call 80100370 <panic> 80101744: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010174a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101750 <iunlock>: } // Unlock the given inode. void iunlock(struct inode *ip) { 80101750: 55 push %ebp 80101751: 89 e5 mov %esp,%ebp 80101753: 56 push %esi 80101754: 53 push %ebx 80101755: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80101758: 85 db test %ebx,%ebx 8010175a: 74 28 je 80101784 <iunlock+0x34> 8010175c: 8d 73 0c lea 0xc(%ebx),%esi 8010175f: 83 ec 0c sub $0xc,%esp 80101762: 56 push %esi 80101763: e8 a8 2a 00 00 call 80104210 <holdingsleep> 80101768: 83 c4 10 add $0x10,%esp 8010176b: 85 c0 test %eax,%eax 8010176d: 74 15 je 80101784 <iunlock+0x34> 8010176f: 8b 43 08 mov 0x8(%ebx),%eax 80101772: 85 c0 test %eax,%eax 80101774: 7e 0e jle 80101784 <iunlock+0x34> panic("iunlock"); releasesleep(&ip->lock); 80101776: 89 75 08 mov %esi,0x8(%ebp) } 80101779: 8d 65 f8 lea -0x8(%ebp),%esp 8010177c: 5b pop %ebx 8010177d: 5e pop %esi 8010177e: 5d pop %ebp iunlock(struct inode *ip) { if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) panic("iunlock"); releasesleep(&ip->lock); 8010177f: e9 4c 2a 00 00 jmp 801041d0 <releasesleep> // Unlock the given inode. void iunlock(struct inode *ip) { if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) panic("iunlock"); 80101784: 83 ec 0c sub $0xc,%esp 80101787: 68 9f 70 10 80 push $0x8010709f 8010178c: e8 df eb ff ff call 80100370 <panic> 80101791: eb 0d jmp 801017a0 <iput> 80101793: 90 nop 80101794: 90 nop 80101795: 90 nop 80101796: 90 nop 80101797: 90 nop 80101798: 90 nop 80101799: 90 nop 8010179a: 90 nop 8010179b: 90 nop 8010179c: 90 nop 8010179d: 90 nop 8010179e: 90 nop 8010179f: 90 nop 801017a0 <iput>: // to it, free the inode (and its content) on disk. // All calls to iput() must be inside a transaction in // case it has to free the inode. void iput(struct inode *ip) { 801017a0: 55 push %ebp 801017a1: 89 e5 mov %esp,%ebp 801017a3: 57 push %edi 801017a4: 56 push %esi 801017a5: 53 push %ebx 801017a6: 83 ec 28 sub $0x28,%esp 801017a9: 8b 75 08 mov 0x8(%ebp),%esi acquiresleep(&ip->lock); 801017ac: 8d 7e 0c lea 0xc(%esi),%edi 801017af: 57 push %edi 801017b0: e8 bb 29 00 00 call 80104170 <acquiresleep> if(ip->valid && ip->nlink == 0){ 801017b5: 8b 56 4c mov 0x4c(%esi),%edx 801017b8: 83 c4 10 add $0x10,%esp 801017bb: 85 d2 test %edx,%edx 801017bd: 74 07 je 801017c6 <iput+0x26> 801017bf: 66 83 7e 56 00 cmpw $0x0,0x56(%esi) 801017c4: 74 32 je 801017f8 <iput+0x58> ip->type = 0; iupdate(ip); ip->valid = 0; } } releasesleep(&ip->lock); 801017c6: 83 ec 0c sub $0xc,%esp 801017c9: 57 push %edi 801017ca: e8 01 2a 00 00 call 801041d0 <releasesleep> acquire(&icache.lock); 801017cf: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 801017d6: e8 65 2b 00 00 call 80104340 <acquire> ip->ref--; 801017db: 83 6e 08 01 subl $0x1,0x8(%esi) release(&icache.lock); 801017df: 83 c4 10 add $0x10,%esp 801017e2: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp) } 801017e9: 8d 65 f4 lea -0xc(%ebp),%esp 801017ec: 5b pop %ebx 801017ed: 5e pop %esi 801017ee: 5f pop %edi 801017ef: 5d pop %ebp } releasesleep(&ip->lock); acquire(&icache.lock); ip->ref--; release(&icache.lock); 801017f0: e9 6b 2c 00 00 jmp 80104460 <release> 801017f5: 8d 76 00 lea 0x0(%esi),%esi void iput(struct inode *ip) { acquiresleep(&ip->lock); if(ip->valid && ip->nlink == 0){ acquire(&icache.lock); 801017f8: 83 ec 0c sub $0xc,%esp 801017fb: 68 e0 09 11 80 push $0x801109e0 80101800: e8 3b 2b 00 00 call 80104340 <acquire> int r = ip->ref; 80101805: 8b 5e 08 mov 0x8(%esi),%ebx release(&icache.lock); 80101808: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010180f: e8 4c 2c 00 00 call 80104460 <release> if(r == 1){ 80101814: 83 c4 10 add $0x10,%esp 80101817: 83 fb 01 cmp $0x1,%ebx 8010181a: 75 aa jne 801017c6 <iput+0x26> 8010181c: 8d 8e 8c 00 00 00 lea 0x8c(%esi),%ecx 80101822: 89 7d e4 mov %edi,-0x1c(%ebp) 80101825: 8d 5e 5c lea 0x5c(%esi),%ebx 80101828: 89 cf mov %ecx,%edi 8010182a: eb 0b jmp 80101837 <iput+0x97> 8010182c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101830: 83 c3 04 add $0x4,%ebx { int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80101833: 39 fb cmp %edi,%ebx 80101835: 74 19 je 80101850 <iput+0xb0> if(ip->addrs[i]){ 80101837: 8b 13 mov (%ebx),%edx 80101839: 85 d2 test %edx,%edx 8010183b: 74 f3 je 80101830 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 8010183d: 8b 06 mov (%esi),%eax 8010183f: e8 ac fb ff ff call 801013f0 <bfree> ip->addrs[i] = 0; 80101844: c7 03 00 00 00 00 movl $0x0,(%ebx) 8010184a: eb e4 jmp 80101830 <iput+0x90> 8010184c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } if(ip->addrs[NDIRECT]){ 80101850: 8b 86 8c 00 00 00 mov 0x8c(%esi),%eax 80101856: 8b 7d e4 mov -0x1c(%ebp),%edi 80101859: 85 c0 test %eax,%eax 8010185b: 75 33 jne 80101890 <iput+0xf0> bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; iupdate(ip); 8010185d: 83 ec 0c sub $0xc,%esp brelse(bp); bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; 80101860: c7 46 58 00 00 00 00 movl $0x0,0x58(%esi) iupdate(ip); 80101867: 56 push %esi 80101868: e8 53 fd ff ff call 801015c0 <iupdate> int r = ip->ref; release(&icache.lock); if(r == 1){ // inode has no links and no other references: truncate and free. itrunc(ip); ip->type = 0; 8010186d: 31 c0 xor %eax,%eax 8010186f: 66 89 46 50 mov %ax,0x50(%esi) iupdate(ip); 80101873: 89 34 24 mov %esi,(%esp) 80101876: e8 45 fd ff ff call 801015c0 <iupdate> ip->valid = 0; 8010187b: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) 80101882: 83 c4 10 add $0x10,%esp 80101885: e9 3c ff ff ff jmp 801017c6 <iput+0x26> 8010188a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi ip->addrs[i] = 0; } } if(ip->addrs[NDIRECT]){ bp = bread(ip->dev, ip->addrs[NDIRECT]); 80101890: 83 ec 08 sub $0x8,%esp 80101893: 50 push %eax 80101894: ff 36 pushl (%esi) 80101896: e8 35 e8 ff ff call 801000d0 <bread> 8010189b: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 801018a1: 89 7d e0 mov %edi,-0x20(%ebp) 801018a4: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 801018a7: 8d 58 5c lea 0x5c(%eax),%ebx 801018aa: 83 c4 10 add $0x10,%esp 801018ad: 89 cf mov %ecx,%edi 801018af: eb 0e jmp 801018bf <iput+0x11f> 801018b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801018b8: 83 c3 04 add $0x4,%ebx for(j = 0; j < NINDIRECT; j++){ 801018bb: 39 fb cmp %edi,%ebx 801018bd: 74 0f je 801018ce <iput+0x12e> if(a[j]) 801018bf: 8b 13 mov (%ebx),%edx 801018c1: 85 d2 test %edx,%edx 801018c3: 74 f3 je 801018b8 <iput+0x118> bfree(ip->dev, a[j]); 801018c5: 8b 06 mov (%esi),%eax 801018c7: e8 24 fb ff ff call 801013f0 <bfree> 801018cc: eb ea jmp 801018b8 <iput+0x118> } brelse(bp); 801018ce: 83 ec 0c sub $0xc,%esp 801018d1: ff 75 e4 pushl -0x1c(%ebp) 801018d4: 8b 7d e0 mov -0x20(%ebp),%edi 801018d7: e8 04 e9 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801018dc: 8b 96 8c 00 00 00 mov 0x8c(%esi),%edx 801018e2: 8b 06 mov (%esi),%eax 801018e4: e8 07 fb ff ff call 801013f0 <bfree> ip->addrs[NDIRECT] = 0; 801018e9: c7 86 8c 00 00 00 00 movl $0x0,0x8c(%esi) 801018f0: 00 00 00 801018f3: 83 c4 10 add $0x10,%esp 801018f6: e9 62 ff ff ff jmp 8010185d <iput+0xbd> 801018fb: 90 nop 801018fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101900 <iunlockput>: } // Common idiom: unlock, then put. void iunlockput(struct inode *ip) { 80101900: 55 push %ebp 80101901: 89 e5 mov %esp,%ebp 80101903: 53 push %ebx 80101904: 83 ec 10 sub $0x10,%esp 80101907: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010190a: 53 push %ebx 8010190b: e8 40 fe ff ff call 80101750 <iunlock> iput(ip); 80101910: 89 5d 08 mov %ebx,0x8(%ebp) 80101913: 83 c4 10 add $0x10,%esp } 80101916: 8b 5d fc mov -0x4(%ebp),%ebx 80101919: c9 leave // Common idiom: unlock, then put. void iunlockput(struct inode *ip) { iunlock(ip); iput(ip); 8010191a: e9 81 fe ff ff jmp 801017a0 <iput> 8010191f: 90 nop 80101920 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80101920: 55 push %ebp 80101921: 89 e5 mov %esp,%ebp 80101923: 8b 55 08 mov 0x8(%ebp),%edx 80101926: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80101929: 8b 0a mov (%edx),%ecx 8010192b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010192e: 8b 4a 04 mov 0x4(%edx),%ecx 80101931: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80101934: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80101938: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010193b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010193f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80101943: 8b 52 58 mov 0x58(%edx),%edx 80101946: 89 50 10 mov %edx,0x10(%eax) } 80101949: 5d pop %ebp 8010194a: c3 ret 8010194b: 90 nop 8010194c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101950 <readi>: // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101950: 55 push %ebp 80101951: 89 e5 mov %esp,%ebp 80101953: 57 push %edi 80101954: 56 push %esi 80101955: 53 push %ebx 80101956: 83 ec 1c sub $0x1c,%esp 80101959: 8b 45 08 mov 0x8(%ebp),%eax 8010195c: 8b 7d 0c mov 0xc(%ebp),%edi 8010195f: 8b 75 10 mov 0x10(%ebp),%esi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101962: 66 83 78 50 03 cmpw $0x3,0x50(%eax) // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101967: 89 7d e0 mov %edi,-0x20(%ebp) 8010196a: 8b 7d 14 mov 0x14(%ebp),%edi 8010196d: 89 45 d8 mov %eax,-0x28(%ebp) 80101970: 89 7d e4 mov %edi,-0x1c(%ebp) uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101973: 0f 84 a7 00 00 00 je 80101a20 <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) 80101979: 8b 45 d8 mov -0x28(%ebp),%eax 8010197c: 8b 40 58 mov 0x58(%eax),%eax 8010197f: 39 f0 cmp %esi,%eax 80101981: 0f 82 c1 00 00 00 jb 80101a48 <readi+0xf8> 80101987: 8b 7d e4 mov -0x1c(%ebp),%edi 8010198a: 89 fa mov %edi,%edx 8010198c: 01 f2 add %esi,%edx 8010198e: 0f 82 b4 00 00 00 jb 80101a48 <readi+0xf8> return -1; if(off + n > ip->size) n = ip->size - off; 80101994: 89 c1 mov %eax,%ecx 80101996: 29 f1 sub %esi,%ecx 80101998: 39 d0 cmp %edx,%eax 8010199a: 0f 43 cf cmovae %edi,%ecx for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 8010199d: 31 ff xor %edi,%edi 8010199f: 85 c9 test %ecx,%ecx } if(off > ip->size || off + n < off) return -1; if(off + n > ip->size) n = ip->size - off; 801019a1: 89 4d e4 mov %ecx,-0x1c(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019a4: 74 6d je 80101a13 <readi+0xc3> 801019a6: 8d 76 00 lea 0x0(%esi),%esi 801019a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019b0: 8b 5d d8 mov -0x28(%ebp),%ebx 801019b3: 89 f2 mov %esi,%edx 801019b5: c1 ea 09 shr $0x9,%edx 801019b8: 89 d8 mov %ebx,%eax 801019ba: e8 21 f9 ff ff call 801012e0 <bmap> 801019bf: 83 ec 08 sub $0x8,%esp 801019c2: 50 push %eax 801019c3: ff 33 pushl (%ebx) m = min(n - tot, BSIZE - off%BSIZE); 801019c5: bb 00 02 00 00 mov $0x200,%ebx return -1; if(off + n > ip->size) n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019ca: e8 01 e7 ff ff call 801000d0 <bread> 801019cf: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 801019d1: 8b 45 e4 mov -0x1c(%ebp),%eax 801019d4: 89 f1 mov %esi,%ecx 801019d6: 81 e1 ff 01 00 00 and $0x1ff,%ecx 801019dc: 83 c4 0c add $0xc,%esp memmove(dst, bp->data + off%BSIZE, m); 801019df: 89 55 dc mov %edx,-0x24(%ebp) if(off + n > ip->size) n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); 801019e2: 29 cb sub %ecx,%ebx 801019e4: 29 f8 sub %edi,%eax 801019e6: 39 c3 cmp %eax,%ebx 801019e8: 0f 47 d8 cmova %eax,%ebx memmove(dst, bp->data + off%BSIZE, m); 801019eb: 8d 44 0a 5c lea 0x5c(%edx,%ecx,1),%eax 801019ef: 53 push %ebx if(off > ip->size || off + n < off) return -1; if(off + n > ip->size) n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019f0: 01 df add %ebx,%edi 801019f2: 01 de add %ebx,%esi bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); memmove(dst, bp->data + off%BSIZE, m); 801019f4: 50 push %eax 801019f5: ff 75 e0 pushl -0x20(%ebp) 801019f8: e8 63 2b 00 00 call 80104560 <memmove> brelse(bp); 801019fd: 8b 55 dc mov -0x24(%ebp),%edx 80101a00: 89 14 24 mov %edx,(%esp) 80101a03: e8 d8 e7 ff ff call 801001e0 <brelse> if(off > ip->size || off + n < off) return -1; if(off + n > ip->size) n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a08: 01 5d e0 add %ebx,-0x20(%ebp) 80101a0b: 83 c4 10 add $0x10,%esp 80101a0e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101a11: 77 9d ja 801019b0 <readi+0x60> bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); memmove(dst, bp->data + off%BSIZE, m); brelse(bp); } return n; 80101a13: 8b 45 e4 mov -0x1c(%ebp),%eax } 80101a16: 8d 65 f4 lea -0xc(%ebp),%esp 80101a19: 5b pop %ebx 80101a1a: 5e pop %esi 80101a1b: 5f pop %edi 80101a1c: 5d pop %ebp 80101a1d: c3 ret 80101a1e: 66 90 xchg %ax,%ax { uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101a20: 0f bf 40 52 movswl 0x52(%eax),%eax 80101a24: 66 83 f8 09 cmp $0x9,%ax 80101a28: 77 1e ja 80101a48 <readi+0xf8> 80101a2a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax 80101a31: 85 c0 test %eax,%eax 80101a33: 74 13 je 80101a48 <readi+0xf8> return -1; return devsw[ip->major].read(ip, dst, n); 80101a35: 89 7d 10 mov %edi,0x10(%ebp) m = min(n - tot, BSIZE - off%BSIZE); memmove(dst, bp->data + off%BSIZE, m); brelse(bp); } return n; } 80101a38: 8d 65 f4 lea -0xc(%ebp),%esp 80101a3b: 5b pop %ebx 80101a3c: 5e pop %esi 80101a3d: 5f pop %edi 80101a3e: 5d pop %ebp struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) return -1; return devsw[ip->major].read(ip, dst, n); 80101a3f: ff e0 jmp *%eax 80101a41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) return -1; 80101a48: b8 ff ff ff ff mov $0xffffffff,%eax 80101a4d: eb c7 jmp 80101a16 <readi+0xc6> 80101a4f: 90 nop 80101a50 <writei>: // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a50: 55 push %ebp 80101a51: 89 e5 mov %esp,%ebp 80101a53: 57 push %edi 80101a54: 56 push %esi 80101a55: 53 push %ebx 80101a56: 83 ec 1c sub $0x1c,%esp 80101a59: 8b 45 08 mov 0x8(%ebp),%eax 80101a5c: 8b 75 0c mov 0xc(%ebp),%esi 80101a5f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a62: 66 83 78 50 03 cmpw $0x3,0x50(%eax) // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a67: 89 75 dc mov %esi,-0x24(%ebp) 80101a6a: 89 45 d8 mov %eax,-0x28(%ebp) 80101a6d: 8b 75 10 mov 0x10(%ebp),%esi 80101a70: 89 7d e0 mov %edi,-0x20(%ebp) uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a73: 0f 84 b7 00 00 00 je 80101b30 <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) 80101a79: 8b 45 d8 mov -0x28(%ebp),%eax 80101a7c: 39 70 58 cmp %esi,0x58(%eax) 80101a7f: 0f 82 eb 00 00 00 jb 80101b70 <writei+0x120> 80101a85: 8b 7d e0 mov -0x20(%ebp),%edi 80101a88: 89 f8 mov %edi,%eax 80101a8a: 01 f0 add %esi,%eax return -1; if(off + n > MAXFILE*BSIZE) 80101a8c: 3d 00 18 01 00 cmp $0x11800,%eax 80101a91: 0f 87 d9 00 00 00 ja 80101b70 <writei+0x120> 80101a97: 39 c6 cmp %eax,%esi 80101a99: 0f 87 d1 00 00 00 ja 80101b70 <writei+0x120> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101a9f: 85 ff test %edi,%edi 80101aa1: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101aa8: 74 78 je 80101b22 <writei+0xd2> 80101aaa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ab0: 8b 7d d8 mov -0x28(%ebp),%edi 80101ab3: 89 f2 mov %esi,%edx m = min(n - tot, BSIZE - off%BSIZE); 80101ab5: bb 00 02 00 00 mov $0x200,%ebx return -1; if(off + n > MAXFILE*BSIZE) return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101aba: c1 ea 09 shr $0x9,%edx 80101abd: 89 f8 mov %edi,%eax 80101abf: e8 1c f8 ff ff call 801012e0 <bmap> 80101ac4: 83 ec 08 sub $0x8,%esp 80101ac7: 50 push %eax 80101ac8: ff 37 pushl (%edi) 80101aca: e8 01 e6 ff ff call 801000d0 <bread> 80101acf: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off%BSIZE); 80101ad1: 8b 45 e0 mov -0x20(%ebp),%eax 80101ad4: 2b 45 e4 sub -0x1c(%ebp),%eax 80101ad7: 89 f1 mov %esi,%ecx 80101ad9: 83 c4 0c add $0xc,%esp 80101adc: 81 e1 ff 01 00 00 and $0x1ff,%ecx 80101ae2: 29 cb sub %ecx,%ebx 80101ae4: 39 c3 cmp %eax,%ebx 80101ae6: 0f 47 d8 cmova %eax,%ebx memmove(bp->data + off%BSIZE, src, m); 80101ae9: 8d 44 0f 5c lea 0x5c(%edi,%ecx,1),%eax 80101aed: 53 push %ebx 80101aee: ff 75 dc pushl -0x24(%ebp) if(off > ip->size || off + n < off) return -1; if(off + n > MAXFILE*BSIZE) return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101af1: 01 de add %ebx,%esi bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); memmove(bp->data + off%BSIZE, src, m); 80101af3: 50 push %eax 80101af4: e8 67 2a 00 00 call 80104560 <memmove> log_write(bp); 80101af9: 89 3c 24 mov %edi,(%esp) 80101afc: e8 2f 12 00 00 call 80102d30 <log_write> brelse(bp); 80101b01: 89 3c 24 mov %edi,(%esp) 80101b04: e8 d7 e6 ff ff call 801001e0 <brelse> if(off > ip->size || off + n < off) return -1; if(off + n > MAXFILE*BSIZE) return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b09: 01 5d e4 add %ebx,-0x1c(%ebp) 80101b0c: 01 5d dc add %ebx,-0x24(%ebp) 80101b0f: 83 c4 10 add $0x10,%esp 80101b12: 8b 55 e4 mov -0x1c(%ebp),%edx 80101b15: 39 55 e0 cmp %edx,-0x20(%ebp) 80101b18: 77 96 ja 80101ab0 <writei+0x60> memmove(bp->data + off%BSIZE, src, m); log_write(bp); brelse(bp); } if(n > 0 && off > ip->size){ 80101b1a: 8b 45 d8 mov -0x28(%ebp),%eax 80101b1d: 3b 70 58 cmp 0x58(%eax),%esi 80101b20: 77 36 ja 80101b58 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80101b22: 8b 45 e0 mov -0x20(%ebp),%eax } 80101b25: 8d 65 f4 lea -0xc(%ebp),%esp 80101b28: 5b pop %ebx 80101b29: 5e pop %esi 80101b2a: 5f pop %edi 80101b2b: 5d pop %ebp 80101b2c: c3 ret 80101b2d: 8d 76 00 lea 0x0(%esi),%esi { uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101b30: 0f bf 40 52 movswl 0x52(%eax),%eax 80101b34: 66 83 f8 09 cmp $0x9,%ax 80101b38: 77 36 ja 80101b70 <writei+0x120> 80101b3a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax 80101b41: 85 c0 test %eax,%eax 80101b43: 74 2b je 80101b70 <writei+0x120> return -1; return devsw[ip->major].write(ip, src, n); 80101b45: 89 7d 10 mov %edi,0x10(%ebp) if(n > 0 && off > ip->size){ ip->size = off; iupdate(ip); } return n; } 80101b48: 8d 65 f4 lea -0xc(%ebp),%esp 80101b4b: 5b pop %ebx 80101b4c: 5e pop %esi 80101b4d: 5f pop %edi 80101b4e: 5d pop %ebp struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) return -1; return devsw[ip->major].write(ip, src, n); 80101b4f: ff e0 jmp *%eax 80101b51: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi log_write(bp); brelse(bp); } if(n > 0 && off > ip->size){ ip->size = off; 80101b58: 8b 45 d8 mov -0x28(%ebp),%eax iupdate(ip); 80101b5b: 83 ec 0c sub $0xc,%esp log_write(bp); brelse(bp); } if(n > 0 && off > ip->size){ ip->size = off; 80101b5e: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80101b61: 50 push %eax 80101b62: e8 59 fa ff ff call 801015c0 <iupdate> 80101b67: 83 c4 10 add $0x10,%esp 80101b6a: eb b6 jmp 80101b22 <writei+0xd2> 80101b6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) return -1; 80101b70: b8 ff ff ff ff mov $0xffffffff,%eax 80101b75: eb ae jmp 80101b25 <writei+0xd5> 80101b77: 89 f6 mov %esi,%esi 80101b79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101b80 <namecmp>: // Directories int namecmp(const char *s, const char *t) { 80101b80: 55 push %ebp 80101b81: 89 e5 mov %esp,%ebp 80101b83: 83 ec 0c sub $0xc,%esp return strncmp(s, t, DIRSIZ); 80101b86: 6a 0e push $0xe 80101b88: ff 75 0c pushl 0xc(%ebp) 80101b8b: ff 75 08 pushl 0x8(%ebp) 80101b8e: e8 4d 2a 00 00 call 801045e0 <strncmp> } 80101b93: c9 leave 80101b94: c3 ret 80101b95: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ba0 <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) { 80101ba0: 55 push %ebp 80101ba1: 89 e5 mov %esp,%ebp 80101ba3: 57 push %edi 80101ba4: 56 push %esi 80101ba5: 53 push %ebx 80101ba6: 83 ec 1c sub $0x1c,%esp 80101ba9: 8b 5d 08 mov 0x8(%ebp),%ebx uint off, inum; struct dirent de; if(dp->type != T_DIR) 80101bac: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80101bb1: 0f 85 80 00 00 00 jne 80101c37 <dirlookup+0x97> panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 80101bb7: 8b 53 58 mov 0x58(%ebx),%edx 80101bba: 31 ff xor %edi,%edi 80101bbc: 8d 75 d8 lea -0x28(%ebp),%esi 80101bbf: 85 d2 test %edx,%edx 80101bc1: 75 0d jne 80101bd0 <dirlookup+0x30> 80101bc3: eb 5b jmp 80101c20 <dirlookup+0x80> 80101bc5: 8d 76 00 lea 0x0(%esi),%esi 80101bc8: 83 c7 10 add $0x10,%edi 80101bcb: 39 7b 58 cmp %edi,0x58(%ebx) 80101bce: 76 50 jbe 80101c20 <dirlookup+0x80> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101bd0: 6a 10 push $0x10 80101bd2: 57 push %edi 80101bd3: 56 push %esi 80101bd4: 53 push %ebx 80101bd5: e8 76 fd ff ff call 80101950 <readi> 80101bda: 83 c4 10 add $0x10,%esp 80101bdd: 83 f8 10 cmp $0x10,%eax 80101be0: 75 48 jne 80101c2a <dirlookup+0x8a> panic("dirlookup read"); if(de.inum == 0) 80101be2: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101be7: 74 df je 80101bc8 <dirlookup+0x28> // Directories int namecmp(const char *s, const char *t) { return strncmp(s, t, DIRSIZ); 80101be9: 8d 45 da lea -0x26(%ebp),%eax 80101bec: 83 ec 04 sub $0x4,%esp 80101bef: 6a 0e push $0xe 80101bf1: 50 push %eax 80101bf2: ff 75 0c pushl 0xc(%ebp) 80101bf5: e8 e6 29 00 00 call 801045e0 <strncmp> for(off = 0; off < dp->size; off += sizeof(de)){ if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("dirlookup read"); if(de.inum == 0) continue; if(namecmp(name, de.name) == 0){ 80101bfa: 83 c4 10 add $0x10,%esp 80101bfd: 85 c0 test %eax,%eax 80101bff: 75 c7 jne 80101bc8 <dirlookup+0x28> // entry matches path element if(poff) 80101c01: 8b 45 10 mov 0x10(%ebp),%eax 80101c04: 85 c0 test %eax,%eax 80101c06: 74 05 je 80101c0d <dirlookup+0x6d> *poff = off; 80101c08: 8b 45 10 mov 0x10(%ebp),%eax 80101c0b: 89 38 mov %edi,(%eax) inum = de.inum; return iget(dp->dev, inum); 80101c0d: 0f b7 55 d8 movzwl -0x28(%ebp),%edx 80101c11: 8b 03 mov (%ebx),%eax 80101c13: e8 f8 f5 ff ff call 80101210 <iget> } } return 0; } 80101c18: 8d 65 f4 lea -0xc(%ebp),%esp 80101c1b: 5b pop %ebx 80101c1c: 5e pop %esi 80101c1d: 5f pop %edi 80101c1e: 5d pop %ebp 80101c1f: c3 ret 80101c20: 8d 65 f4 lea -0xc(%ebp),%esp inum = de.inum; return iget(dp->dev, inum); } } return 0; 80101c23: 31 c0 xor %eax,%eax } 80101c25: 5b pop %ebx 80101c26: 5e pop %esi 80101c27: 5f pop %edi 80101c28: 5d pop %ebp 80101c29: c3 ret if(dp->type != T_DIR) panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("dirlookup read"); 80101c2a: 83 ec 0c sub $0xc,%esp 80101c2d: 68 b9 70 10 80 push $0x801070b9 80101c32: e8 39 e7 ff ff call 80100370 <panic> { uint off, inum; struct dirent de; if(dp->type != T_DIR) panic("dirlookup not DIR"); 80101c37: 83 ec 0c sub $0xc,%esp 80101c3a: 68 a7 70 10 80 push $0x801070a7 80101c3f: e8 2c e7 ff ff call 80100370 <panic> 80101c44: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101c4a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101c50 <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) { 80101c50: 55 push %ebp 80101c51: 89 e5 mov %esp,%ebp 80101c53: 57 push %edi 80101c54: 56 push %esi 80101c55: 53 push %ebx 80101c56: 89 cf mov %ecx,%edi 80101c58: 89 c3 mov %eax,%ebx 80101c5a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if(*path == '/') 80101c5d: 80 38 2f cmpb $0x2f,(%eax) // 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: 89 55 e0 mov %edx,-0x20(%ebp) struct inode *ip, *next; if(*path == '/') 80101c63: 0f 84 53 01 00 00 je 80101dbc <namex+0x16c> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c69: e8 12 1b 00 00 call 80103780 <myproc> // Increment reference count for ip. // Returns ip to enable ip = idup(ip1) idiom. struct inode* idup(struct inode *ip) { acquire(&icache.lock); 80101c6e: 83 ec 0c sub $0xc,%esp struct inode *ip, *next; if(*path == '/') ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c71: 8b 70 68 mov 0x68(%eax),%esi // Increment reference count for ip. // Returns ip to enable ip = idup(ip1) idiom. struct inode* idup(struct inode *ip) { acquire(&icache.lock); 80101c74: 68 e0 09 11 80 push $0x801109e0 80101c79: e8 c2 26 00 00 call 80104340 <acquire> ip->ref++; 80101c7e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101c82: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101c89: e8 d2 27 00 00 call 80104460 <release> 80101c8e: 83 c4 10 add $0x10,%esp 80101c91: eb 08 jmp 80101c9b <namex+0x4b> 80101c93: 90 nop 80101c94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi { char *s; int len; while(*path == '/') path++; 80101c98: 83 c3 01 add $0x1,%ebx skipelem(char *path, char *name) { char *s; int len; while(*path == '/') 80101c9b: 0f b6 03 movzbl (%ebx),%eax 80101c9e: 3c 2f cmp $0x2f,%al 80101ca0: 74 f6 je 80101c98 <namex+0x48> path++; if(*path == 0) 80101ca2: 84 c0 test %al,%al 80101ca4: 0f 84 e3 00 00 00 je 80101d8d <namex+0x13d> return 0; s = path; while(*path != '/' && *path != 0) 80101caa: 0f b6 03 movzbl (%ebx),%eax 80101cad: 89 da mov %ebx,%edx 80101caf: 84 c0 test %al,%al 80101cb1: 0f 84 ac 00 00 00 je 80101d63 <namex+0x113> 80101cb7: 3c 2f cmp $0x2f,%al 80101cb9: 75 09 jne 80101cc4 <namex+0x74> 80101cbb: e9 a3 00 00 00 jmp 80101d63 <namex+0x113> 80101cc0: 84 c0 test %al,%al 80101cc2: 74 0a je 80101cce <namex+0x7e> path++; 80101cc4: 83 c2 01 add $0x1,%edx while(*path == '/') path++; if(*path == 0) return 0; s = path; while(*path != '/' && *path != 0) 80101cc7: 0f b6 02 movzbl (%edx),%eax 80101cca: 3c 2f cmp $0x2f,%al 80101ccc: 75 f2 jne 80101cc0 <namex+0x70> 80101cce: 89 d1 mov %edx,%ecx 80101cd0: 29 d9 sub %ebx,%ecx path++; len = path - s; if(len >= DIRSIZ) 80101cd2: 83 f9 0d cmp $0xd,%ecx 80101cd5: 0f 8e 8d 00 00 00 jle 80101d68 <namex+0x118> memmove(name, s, DIRSIZ); 80101cdb: 83 ec 04 sub $0x4,%esp 80101cde: 89 55 e4 mov %edx,-0x1c(%ebp) 80101ce1: 6a 0e push $0xe 80101ce3: 53 push %ebx 80101ce4: 57 push %edi 80101ce5: e8 76 28 00 00 call 80104560 <memmove> path++; if(*path == 0) return 0; s = path; while(*path != '/' && *path != 0) path++; 80101cea: 8b 55 e4 mov -0x1c(%ebp),%edx len = path - s; if(len >= DIRSIZ) memmove(name, s, DIRSIZ); 80101ced: 83 c4 10 add $0x10,%esp path++; if(*path == 0) return 0; s = path; while(*path != '/' && *path != 0) path++; 80101cf0: 89 d3 mov %edx,%ebx memmove(name, s, DIRSIZ); else { memmove(name, s, len); name[len] = 0; } while(*path == '/') 80101cf2: 80 3a 2f cmpb $0x2f,(%edx) 80101cf5: 75 11 jne 80101d08 <namex+0xb8> 80101cf7: 89 f6 mov %esi,%esi 80101cf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi path++; 80101d00: 83 c3 01 add $0x1,%ebx memmove(name, s, DIRSIZ); else { memmove(name, s, len); name[len] = 0; } while(*path == '/') 80101d03: 80 3b 2f cmpb $0x2f,(%ebx) 80101d06: 74 f8 je 80101d00 <namex+0xb0> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); while((path = skipelem(path, name)) != 0){ ilock(ip); 80101d08: 83 ec 0c sub $0xc,%esp 80101d0b: 56 push %esi 80101d0c: e8 5f f9 ff ff call 80101670 <ilock> if(ip->type != T_DIR){ 80101d11: 83 c4 10 add $0x10,%esp 80101d14: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101d19: 0f 85 7f 00 00 00 jne 80101d9e <namex+0x14e> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101d1f: 8b 55 e0 mov -0x20(%ebp),%edx 80101d22: 85 d2 test %edx,%edx 80101d24: 74 09 je 80101d2f <namex+0xdf> 80101d26: 80 3b 00 cmpb $0x0,(%ebx) 80101d29: 0f 84 a3 00 00 00 je 80101dd2 <namex+0x182> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101d2f: 83 ec 04 sub $0x4,%esp 80101d32: 6a 00 push $0x0 80101d34: 57 push %edi 80101d35: 56 push %esi 80101d36: e8 65 fe ff ff call 80101ba0 <dirlookup> 80101d3b: 83 c4 10 add $0x10,%esp 80101d3e: 85 c0 test %eax,%eax 80101d40: 74 5c je 80101d9e <namex+0x14e> // Common idiom: unlock, then put. void iunlockput(struct inode *ip) { iunlock(ip); 80101d42: 83 ec 0c sub $0xc,%esp 80101d45: 89 45 e4 mov %eax,-0x1c(%ebp) 80101d48: 56 push %esi 80101d49: e8 02 fa ff ff call 80101750 <iunlock> iput(ip); 80101d4e: 89 34 24 mov %esi,(%esp) 80101d51: e8 4a fa ff ff call 801017a0 <iput> 80101d56: 8b 45 e4 mov -0x1c(%ebp),%eax 80101d59: 83 c4 10 add $0x10,%esp 80101d5c: 89 c6 mov %eax,%esi 80101d5e: e9 38 ff ff ff jmp 80101c9b <namex+0x4b> while(*path == '/') path++; if(*path == 0) return 0; s = path; while(*path != '/' && *path != 0) 80101d63: 31 c9 xor %ecx,%ecx 80101d65: 8d 76 00 lea 0x0(%esi),%esi path++; len = path - s; if(len >= DIRSIZ) memmove(name, s, DIRSIZ); else { memmove(name, s, len); 80101d68: 83 ec 04 sub $0x4,%esp 80101d6b: 89 55 dc mov %edx,-0x24(%ebp) 80101d6e: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101d71: 51 push %ecx 80101d72: 53 push %ebx 80101d73: 57 push %edi 80101d74: e8 e7 27 00 00 call 80104560 <memmove> name[len] = 0; 80101d79: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101d7c: 8b 55 dc mov -0x24(%ebp),%edx 80101d7f: 83 c4 10 add $0x10,%esp 80101d82: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101d86: 89 d3 mov %edx,%ebx 80101d88: e9 65 ff ff ff jmp 80101cf2 <namex+0xa2> return 0; } iunlockput(ip); ip = next; } if(nameiparent){ 80101d8d: 8b 45 e0 mov -0x20(%ebp),%eax 80101d90: 85 c0 test %eax,%eax 80101d92: 75 54 jne 80101de8 <namex+0x198> 80101d94: 89 f0 mov %esi,%eax iput(ip); return 0; } return ip; } 80101d96: 8d 65 f4 lea -0xc(%ebp),%esp 80101d99: 5b pop %ebx 80101d9a: 5e pop %esi 80101d9b: 5f pop %edi 80101d9c: 5d pop %ebp 80101d9d: c3 ret // Common idiom: unlock, then put. void iunlockput(struct inode *ip) { iunlock(ip); 80101d9e: 83 ec 0c sub $0xc,%esp 80101da1: 56 push %esi 80101da2: e8 a9 f9 ff ff call 80101750 <iunlock> iput(ip); 80101da7: 89 34 24 mov %esi,(%esp) 80101daa: e8 f1 f9 ff ff call 801017a0 <iput> iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ iunlockput(ip); return 0; 80101daf: 83 c4 10 add $0x10,%esp if(nameiparent){ iput(ip); return 0; } return ip; } 80101db2: 8d 65 f4 lea -0xc(%ebp),%esp iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ iunlockput(ip); return 0; 80101db5: 31 c0 xor %eax,%eax if(nameiparent){ iput(ip); return 0; } return ip; } 80101db7: 5b pop %ebx 80101db8: 5e pop %esi 80101db9: 5f pop %edi 80101dba: 5d pop %ebp 80101dbb: c3 ret namex(char *path, int nameiparent, char *name) { struct inode *ip, *next; if(*path == '/') ip = iget(ROOTDEV, ROOTINO); 80101dbc: ba 01 00 00 00 mov $0x1,%edx 80101dc1: b8 01 00 00 00 mov $0x1,%eax 80101dc6: e8 45 f4 ff ff call 80101210 <iget> 80101dcb: 89 c6 mov %eax,%esi 80101dcd: e9 c9 fe ff ff jmp 80101c9b <namex+0x4b> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ // Stop one level early. iunlock(ip); 80101dd2: 83 ec 0c sub $0xc,%esp 80101dd5: 56 push %esi 80101dd6: e8 75 f9 ff ff call 80101750 <iunlock> return ip; 80101ddb: 83 c4 10 add $0x10,%esp if(nameiparent){ iput(ip); return 0; } return ip; } 80101dde: 8d 65 f4 lea -0xc(%ebp),%esp return 0; } if(nameiparent && *path == '\0'){ // Stop one level early. iunlock(ip); return ip; 80101de1: 89 f0 mov %esi,%eax if(nameiparent){ iput(ip); return 0; } return ip; } 80101de3: 5b pop %ebx 80101de4: 5e pop %esi 80101de5: 5f pop %edi 80101de6: 5d pop %ebp 80101de7: c3 ret } iunlockput(ip); ip = next; } if(nameiparent){ iput(ip); 80101de8: 83 ec 0c sub $0xc,%esp 80101deb: 56 push %esi 80101dec: e8 af f9 ff ff call 801017a0 <iput> return 0; 80101df1: 83 c4 10 add $0x10,%esp 80101df4: 31 c0 xor %eax,%eax 80101df6: eb 9e jmp 80101d96 <namex+0x146> 80101df8: 90 nop 80101df9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101e00 <dirlink>: } // Write a new directory entry (name, inum) into the directory dp. int dirlink(struct inode *dp, char *name, uint inum) { 80101e00: 55 push %ebp 80101e01: 89 e5 mov %esp,%ebp 80101e03: 57 push %edi 80101e04: 56 push %esi 80101e05: 53 push %ebx 80101e06: 83 ec 20 sub $0x20,%esp 80101e09: 8b 5d 08 mov 0x8(%ebp),%ebx int off; struct dirent de; struct inode *ip; // Check that name is not present. if((ip = dirlookup(dp, name, 0)) != 0){ 80101e0c: 6a 00 push $0x0 80101e0e: ff 75 0c pushl 0xc(%ebp) 80101e11: 53 push %ebx 80101e12: e8 89 fd ff ff call 80101ba0 <dirlookup> 80101e17: 83 c4 10 add $0x10,%esp 80101e1a: 85 c0 test %eax,%eax 80101e1c: 75 67 jne 80101e85 <dirlink+0x85> iput(ip); return -1; } // Look for an empty dirent. for(off = 0; off < dp->size; off += sizeof(de)){ 80101e1e: 8b 7b 58 mov 0x58(%ebx),%edi 80101e21: 8d 75 d8 lea -0x28(%ebp),%esi 80101e24: 85 ff test %edi,%edi 80101e26: 74 29 je 80101e51 <dirlink+0x51> 80101e28: 31 ff xor %edi,%edi 80101e2a: 8d 75 d8 lea -0x28(%ebp),%esi 80101e2d: eb 09 jmp 80101e38 <dirlink+0x38> 80101e2f: 90 nop 80101e30: 83 c7 10 add $0x10,%edi 80101e33: 39 7b 58 cmp %edi,0x58(%ebx) 80101e36: 76 19 jbe 80101e51 <dirlink+0x51> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e38: 6a 10 push $0x10 80101e3a: 57 push %edi 80101e3b: 56 push %esi 80101e3c: 53 push %ebx 80101e3d: e8 0e fb ff ff call 80101950 <readi> 80101e42: 83 c4 10 add $0x10,%esp 80101e45: 83 f8 10 cmp $0x10,%eax 80101e48: 75 4e jne 80101e98 <dirlink+0x98> panic("dirlink read"); if(de.inum == 0) 80101e4a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101e4f: 75 df jne 80101e30 <dirlink+0x30> break; } strncpy(de.name, name, DIRSIZ); 80101e51: 8d 45 da lea -0x26(%ebp),%eax 80101e54: 83 ec 04 sub $0x4,%esp 80101e57: 6a 0e push $0xe 80101e59: ff 75 0c pushl 0xc(%ebp) 80101e5c: 50 push %eax 80101e5d: e8 ee 27 00 00 call 80104650 <strncpy> de.inum = inum; 80101e62: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e65: 6a 10 push $0x10 80101e67: 57 push %edi 80101e68: 56 push %esi 80101e69: 53 push %ebx if(de.inum == 0) break; } strncpy(de.name, name, DIRSIZ); de.inum = inum; 80101e6a: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e6e: e8 dd fb ff ff call 80101a50 <writei> 80101e73: 83 c4 20 add $0x20,%esp 80101e76: 83 f8 10 cmp $0x10,%eax 80101e79: 75 2a jne 80101ea5 <dirlink+0xa5> panic("dirlink"); return 0; 80101e7b: 31 c0 xor %eax,%eax } 80101e7d: 8d 65 f4 lea -0xc(%ebp),%esp 80101e80: 5b pop %ebx 80101e81: 5e pop %esi 80101e82: 5f pop %edi 80101e83: 5d pop %ebp 80101e84: c3 ret struct dirent de; struct inode *ip; // Check that name is not present. if((ip = dirlookup(dp, name, 0)) != 0){ iput(ip); 80101e85: 83 ec 0c sub $0xc,%esp 80101e88: 50 push %eax 80101e89: e8 12 f9 ff ff call 801017a0 <iput> return -1; 80101e8e: 83 c4 10 add $0x10,%esp 80101e91: b8 ff ff ff ff mov $0xffffffff,%eax 80101e96: eb e5 jmp 80101e7d <dirlink+0x7d> } // Look for an empty dirent. for(off = 0; off < dp->size; off += sizeof(de)){ if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("dirlink read"); 80101e98: 83 ec 0c sub $0xc,%esp 80101e9b: 68 c8 70 10 80 push $0x801070c8 80101ea0: e8 cb e4 ff ff call 80100370 <panic> } strncpy(de.name, name, DIRSIZ); de.inum = inum; if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("dirlink"); 80101ea5: 83 ec 0c sub $0xc,%esp 80101ea8: 68 02 77 10 80 push $0x80107702 80101ead: e8 be e4 ff ff call 80100370 <panic> 80101eb2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101eb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ec0 <namei>: return ip; } struct inode* namei(char *path) { 80101ec0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101ec1: 31 d2 xor %edx,%edx return ip; } struct inode* namei(char *path) { 80101ec3: 89 e5 mov %esp,%ebp 80101ec5: 83 ec 18 sub $0x18,%esp char name[DIRSIZ]; return namex(path, 0, name); 80101ec8: 8b 45 08 mov 0x8(%ebp),%eax 80101ecb: 8d 4d ea lea -0x16(%ebp),%ecx 80101ece: e8 7d fd ff ff call 80101c50 <namex> } 80101ed3: c9 leave 80101ed4: c3 ret 80101ed5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ee0 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101ee0: 55 push %ebp return namex(path, 1, name); 80101ee1: ba 01 00 00 00 mov $0x1,%edx return namex(path, 0, name); } struct inode* nameiparent(char *path, char *name) { 80101ee6: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101ee8: 8b 4d 0c mov 0xc(%ebp),%ecx 80101eeb: 8b 45 08 mov 0x8(%ebp),%eax } 80101eee: 5d pop %ebp } struct inode* nameiparent(char *path, char *name) { return namex(path, 1, name); 80101eef: e9 5c fd ff ff jmp 80101c50 <namex> 80101ef4: 66 90 xchg %ax,%ax 80101ef6: 66 90 xchg %ax,%ax 80101ef8: 66 90 xchg %ax,%ax 80101efa: 66 90 xchg %ax,%ax 80101efc: 66 90 xchg %ax,%ax 80101efe: 66 90 xchg %ax,%ax 80101f00 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80101f00: 55 push %ebp if(b == 0) 80101f01: 85 c0 test %eax,%eax } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80101f03: 89 e5 mov %esp,%ebp 80101f05: 56 push %esi 80101f06: 53 push %ebx if(b == 0) 80101f07: 0f 84 ad 00 00 00 je 80101fba <idestart+0xba> panic("idestart"); if(b->blockno >= FSSIZE) 80101f0d: 8b 58 08 mov 0x8(%eax),%ebx 80101f10: 89 c1 mov %eax,%ecx 80101f12: 81 fb e7 03 00 00 cmp $0x3e7,%ebx 80101f18: 0f 87 8f 00 00 00 ja 80101fad <idestart+0xad> static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80101f1e: ba f7 01 00 00 mov $0x1f7,%edx 80101f23: 90 nop 80101f24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101f28: ec in (%dx),%al static int idewait(int checkerr) { int r; while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80101f29: 83 e0 c0 and $0xffffffc0,%eax 80101f2c: 3c 40 cmp $0x40,%al 80101f2e: 75 f8 jne 80101f28 <idestart+0x28> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80101f30: 31 f6 xor %esi,%esi 80101f32: ba f6 03 00 00 mov $0x3f6,%edx 80101f37: 89 f0 mov %esi,%eax 80101f39: ee out %al,(%dx) 80101f3a: ba f2 01 00 00 mov $0x1f2,%edx 80101f3f: b8 01 00 00 00 mov $0x1,%eax 80101f44: ee out %al,(%dx) 80101f45: ba f3 01 00 00 mov $0x1f3,%edx 80101f4a: 89 d8 mov %ebx,%eax 80101f4c: ee out %al,(%dx) 80101f4d: 89 d8 mov %ebx,%eax 80101f4f: ba f4 01 00 00 mov $0x1f4,%edx 80101f54: c1 f8 08 sar $0x8,%eax 80101f57: ee out %al,(%dx) 80101f58: ba f5 01 00 00 mov $0x1f5,%edx 80101f5d: 89 f0 mov %esi,%eax 80101f5f: ee out %al,(%dx) 80101f60: 0f b6 41 04 movzbl 0x4(%ecx),%eax 80101f64: ba f6 01 00 00 mov $0x1f6,%edx 80101f69: 83 e0 01 and $0x1,%eax 80101f6c: c1 e0 04 shl $0x4,%eax 80101f6f: 83 c8 e0 or $0xffffffe0,%eax 80101f72: ee out %al,(%dx) outb(0x1f2, sector_per_block); // number of sectors outb(0x1f3, sector & 0xff); outb(0x1f4, (sector >> 8) & 0xff); outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); if(b->flags & B_DIRTY){ 80101f73: f6 01 04 testb $0x4,(%ecx) 80101f76: ba f7 01 00 00 mov $0x1f7,%edx 80101f7b: 75 13 jne 80101f90 <idestart+0x90> 80101f7d: b8 20 00 00 00 mov $0x20,%eax 80101f82: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 80101f83: 8d 65 f8 lea -0x8(%ebp),%esp 80101f86: 5b pop %ebx 80101f87: 5e pop %esi 80101f88: 5d pop %ebp 80101f89: c3 ret 80101f8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101f90: b8 30 00 00 00 mov $0x30,%eax 80101f95: ee out %al,(%dx) } static inline void outsl(int port, const void *addr, int cnt) { asm volatile("cld; rep outsl" : 80101f96: ba f0 01 00 00 mov $0x1f0,%edx outb(0x1f4, (sector >> 8) & 0xff); outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); if(b->flags & B_DIRTY){ outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); 80101f9b: 8d 71 5c lea 0x5c(%ecx),%esi 80101f9e: b9 80 00 00 00 mov $0x80,%ecx 80101fa3: fc cld 80101fa4: f3 6f rep outsl %ds:(%esi),(%dx) } else { outb(0x1f7, read_cmd); } } 80101fa6: 8d 65 f8 lea -0x8(%ebp),%esp 80101fa9: 5b pop %ebx 80101faa: 5e pop %esi 80101fab: 5d pop %ebp 80101fac: c3 ret idestart(struct buf *b) { if(b == 0) panic("idestart"); if(b->blockno >= FSSIZE) panic("incorrect blockno"); 80101fad: 83 ec 0c sub $0xc,%esp 80101fb0: 68 34 71 10 80 push $0x80107134 80101fb5: e8 b6 e3 ff ff call 80100370 <panic> // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { if(b == 0) panic("idestart"); 80101fba: 83 ec 0c sub $0xc,%esp 80101fbd: 68 2b 71 10 80 push $0x8010712b 80101fc2: e8 a9 e3 ff ff call 80100370 <panic> 80101fc7: 89 f6 mov %esi,%esi 80101fc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101fd0 <ideinit>: return 0; } void ideinit(void) { 80101fd0: 55 push %ebp 80101fd1: 89 e5 mov %esp,%ebp 80101fd3: 83 ec 10 sub $0x10,%esp int i; initlock(&idelock, "ide"); 80101fd6: 68 46 71 10 80 push $0x80107146 80101fdb: 68 80 a5 10 80 push $0x8010a580 80101fe0: e8 5b 22 00 00 call 80104240 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80101fe5: 58 pop %eax 80101fe6: a1 00 2d 11 80 mov 0x80112d00,%eax 80101feb: 5a pop %edx 80101fec: 83 e8 01 sub $0x1,%eax 80101fef: 50 push %eax 80101ff0: 6a 0e push $0xe 80101ff2: e8 a9 02 00 00 call 801022a0 <ioapicenable> 80101ff7: 83 c4 10 add $0x10,%esp static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80101ffa: ba f7 01 00 00 mov $0x1f7,%edx 80101fff: 90 nop 80102000: ec in (%dx),%al static int idewait(int checkerr) { int r; while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102001: 83 e0 c0 and $0xffffffc0,%eax 80102004: 3c 40 cmp $0x40,%al 80102006: 75 f8 jne 80102000 <ideinit+0x30> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102008: ba f6 01 00 00 mov $0x1f6,%edx 8010200d: b8 f0 ff ff ff mov $0xfffffff0,%eax 80102012: ee out %al,(%dx) 80102013: b9 e8 03 00 00 mov $0x3e8,%ecx static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102018: ba f7 01 00 00 mov $0x1f7,%edx 8010201d: eb 06 jmp 80102025 <ideinit+0x55> 8010201f: 90 nop ioapicenable(IRQ_IDE, ncpu - 1); idewait(0); // Check if disk 1 is present outb(0x1f6, 0xe0 | (1<<4)); for(i=0; i<1000; i++){ 80102020: 83 e9 01 sub $0x1,%ecx 80102023: 74 0f je 80102034 <ideinit+0x64> 80102025: ec in (%dx),%al if(inb(0x1f7) != 0){ 80102026: 84 c0 test %al,%al 80102028: 74 f6 je 80102020 <ideinit+0x50> havedisk1 = 1; 8010202a: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560 80102031: 00 00 00 } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102034: ba f6 01 00 00 mov $0x1f6,%edx 80102039: b8 e0 ff ff ff mov $0xffffffe0,%eax 8010203e: ee out %al,(%dx) } } // Switch back to disk 0. outb(0x1f6, 0xe0 | (0<<4)); } 8010203f: c9 leave 80102040: c3 ret 80102041: eb 0d jmp 80102050 <ideintr> 80102043: 90 nop 80102044: 90 nop 80102045: 90 nop 80102046: 90 nop 80102047: 90 nop 80102048: 90 nop 80102049: 90 nop 8010204a: 90 nop 8010204b: 90 nop 8010204c: 90 nop 8010204d: 90 nop 8010204e: 90 nop 8010204f: 90 nop 80102050 <ideintr>: } // Interrupt handler. void ideintr(void) { 80102050: 55 push %ebp 80102051: 89 e5 mov %esp,%ebp 80102053: 57 push %edi 80102054: 56 push %esi 80102055: 53 push %ebx 80102056: 83 ec 18 sub $0x18,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 80102059: 68 80 a5 10 80 push $0x8010a580 8010205e: e8 dd 22 00 00 call 80104340 <acquire> if((b = idequeue) == 0){ 80102063: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx 80102069: 83 c4 10 add $0x10,%esp 8010206c: 85 db test %ebx,%ebx 8010206e: 74 34 je 801020a4 <ideintr+0x54> release(&idelock); return; } idequeue = b->qnext; 80102070: 8b 43 58 mov 0x58(%ebx),%eax 80102073: a3 64 a5 10 80 mov %eax,0x8010a564 // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) 80102078: 8b 33 mov (%ebx),%esi 8010207a: f7 c6 04 00 00 00 test $0x4,%esi 80102080: 74 3e je 801020c0 <ideintr+0x70> insl(0x1f0, b->data, BSIZE/4); // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 80102082: 83 e6 fb and $0xfffffffb,%esi wakeup(b); 80102085: 83 ec 0c sub $0xc,%esp if(!(b->flags & B_DIRTY) && idewait(1) >= 0) insl(0x1f0, b->data, BSIZE/4); // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 80102088: 83 ce 02 or $0x2,%esi 8010208b: 89 33 mov %esi,(%ebx) wakeup(b); 8010208d: 53 push %ebx 8010208e: e8 4d 1e 00 00 call 80103ee0 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 80102093: a1 64 a5 10 80 mov 0x8010a564,%eax 80102098: 83 c4 10 add $0x10,%esp 8010209b: 85 c0 test %eax,%eax 8010209d: 74 05 je 801020a4 <ideintr+0x54> idestart(idequeue); 8010209f: e8 5c fe ff ff call 80101f00 <idestart> // First queued buffer is the active request. acquire(&idelock); if((b = idequeue) == 0){ release(&idelock); 801020a4: 83 ec 0c sub $0xc,%esp 801020a7: 68 80 a5 10 80 push $0x8010a580 801020ac: e8 af 23 00 00 call 80104460 <release> // Start disk on next buf in queue. if(idequeue != 0) idestart(idequeue); release(&idelock); } 801020b1: 8d 65 f4 lea -0xc(%ebp),%esp 801020b4: 5b pop %ebx 801020b5: 5e pop %esi 801020b6: 5f pop %edi 801020b7: 5d pop %ebp 801020b8: c3 ret 801020b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801020c0: ba f7 01 00 00 mov $0x1f7,%edx 801020c5: 8d 76 00 lea 0x0(%esi),%esi 801020c8: ec in (%dx),%al static int idewait(int checkerr) { int r; while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 801020c9: 89 c1 mov %eax,%ecx 801020cb: 83 e1 c0 and $0xffffffc0,%ecx 801020ce: 80 f9 40 cmp $0x40,%cl 801020d1: 75 f5 jne 801020c8 <ideintr+0x78> ; if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0) 801020d3: a8 21 test $0x21,%al 801020d5: 75 ab jne 80102082 <ideintr+0x32> } idequeue = b->qnext; // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) insl(0x1f0, b->data, BSIZE/4); 801020d7: 8d 7b 5c lea 0x5c(%ebx),%edi } static inline void insl(int port, void *addr, int cnt) { asm volatile("cld; rep insl" : 801020da: b9 80 00 00 00 mov $0x80,%ecx 801020df: ba f0 01 00 00 mov $0x1f0,%edx 801020e4: fc cld 801020e5: f3 6d rep insl (%dx),%es:(%edi) 801020e7: 8b 33 mov (%ebx),%esi 801020e9: eb 97 jmp 80102082 <ideintr+0x32> 801020eb: 90 nop 801020ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801020f0 <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) { 801020f0: 55 push %ebp 801020f1: 89 e5 mov %esp,%ebp 801020f3: 53 push %ebx 801020f4: 83 ec 10 sub $0x10,%esp 801020f7: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if(!holdingsleep(&b->lock)) 801020fa: 8d 43 0c lea 0xc(%ebx),%eax 801020fd: 50 push %eax 801020fe: e8 0d 21 00 00 call 80104210 <holdingsleep> 80102103: 83 c4 10 add $0x10,%esp 80102106: 85 c0 test %eax,%eax 80102108: 0f 84 ad 00 00 00 je 801021bb <iderw+0xcb> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010210e: 8b 03 mov (%ebx),%eax 80102110: 83 e0 06 and $0x6,%eax 80102113: 83 f8 02 cmp $0x2,%eax 80102116: 0f 84 b9 00 00 00 je 801021d5 <iderw+0xe5> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010211c: 8b 53 04 mov 0x4(%ebx),%edx 8010211f: 85 d2 test %edx,%edx 80102121: 74 0d je 80102130 <iderw+0x40> 80102123: a1 60 a5 10 80 mov 0x8010a560,%eax 80102128: 85 c0 test %eax,%eax 8010212a: 0f 84 98 00 00 00 je 801021c8 <iderw+0xd8> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 80102130: 83 ec 0c sub $0xc,%esp 80102133: 68 80 a5 10 80 push $0x8010a580 80102138: e8 03 22 00 00 call 80104340 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010213d: 8b 15 64 a5 10 80 mov 0x8010a564,%edx 80102143: 83 c4 10 add $0x10,%esp panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock // Append b to idequeue. b->qnext = 0; 80102146: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010214d: 85 d2 test %edx,%edx 8010214f: 75 09 jne 8010215a <iderw+0x6a> 80102151: eb 58 jmp 801021ab <iderw+0xbb> 80102153: 90 nop 80102154: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102158: 89 c2 mov %eax,%edx 8010215a: 8b 42 58 mov 0x58(%edx),%eax 8010215d: 85 c0 test %eax,%eax 8010215f: 75 f7 jne 80102158 <iderw+0x68> 80102161: 83 c2 58 add $0x58,%edx ; *pp = b; 80102164: 89 1a mov %ebx,(%edx) // Start disk if necessary. if(idequeue == b) 80102166: 3b 1d 64 a5 10 80 cmp 0x8010a564,%ebx 8010216c: 74 44 je 801021b2 <iderw+0xc2> idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 8010216e: 8b 03 mov (%ebx),%eax 80102170: 83 e0 06 and $0x6,%eax 80102173: 83 f8 02 cmp $0x2,%eax 80102176: 74 23 je 8010219b <iderw+0xab> 80102178: 90 nop 80102179: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(b, &idelock); 80102180: 83 ec 08 sub $0x8,%esp 80102183: 68 80 a5 10 80 push $0x8010a580 80102188: 53 push %ebx 80102189: e8 a2 1b 00 00 call 80103d30 <sleep> // Start disk if necessary. if(idequeue == b) idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 8010218e: 8b 03 mov (%ebx),%eax 80102190: 83 c4 10 add $0x10,%esp 80102193: 83 e0 06 and $0x6,%eax 80102196: 83 f8 02 cmp $0x2,%eax 80102199: 75 e5 jne 80102180 <iderw+0x90> sleep(b, &idelock); } release(&idelock); 8010219b: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp) } 801021a2: 8b 5d fc mov -0x4(%ebp),%ebx 801021a5: c9 leave while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ sleep(b, &idelock); } release(&idelock); 801021a6: e9 b5 22 00 00 jmp 80104460 <release> acquire(&idelock); //DOC:acquire-lock // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 801021ab: ba 64 a5 10 80 mov $0x8010a564,%edx 801021b0: eb b2 jmp 80102164 <iderw+0x74> ; *pp = b; // Start disk if necessary. if(idequeue == b) idestart(b); 801021b2: 89 d8 mov %ebx,%eax 801021b4: e8 47 fd ff ff call 80101f00 <idestart> 801021b9: eb b3 jmp 8010216e <iderw+0x7e> iderw(struct buf *b) { struct buf **pp; if(!holdingsleep(&b->lock)) panic("iderw: buf not locked"); 801021bb: 83 ec 0c sub $0xc,%esp 801021be: 68 4a 71 10 80 push $0x8010714a 801021c3: e8 a8 e1 ff ff call 80100370 <panic> if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) panic("iderw: ide disk 1 not present"); 801021c8: 83 ec 0c sub $0xc,%esp 801021cb: 68 75 71 10 80 push $0x80107175 801021d0: e8 9b e1 ff ff call 80100370 <panic> struct buf **pp; if(!holdingsleep(&b->lock)) panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) panic("iderw: nothing to do"); 801021d5: 83 ec 0c sub $0xc,%esp 801021d8: 68 60 71 10 80 push $0x80107160 801021dd: e8 8e e1 ff ff call 80100370 <panic> 801021e2: 66 90 xchg %ax,%ax 801021e4: 66 90 xchg %ax,%ax 801021e6: 66 90 xchg %ax,%ax 801021e8: 66 90 xchg %ax,%ax 801021ea: 66 90 xchg %ax,%ax 801021ec: 66 90 xchg %ax,%ax 801021ee: 66 90 xchg %ax,%ax 801021f0 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 801021f0: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 801021f1: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634 801021f8: 00 c0 fe ioapic->data = data; } void ioapicinit(void) { 801021fb: 89 e5 mov %esp,%ebp 801021fd: 56 push %esi 801021fe: 53 push %ebx }; static uint ioapicread(int reg) { ioapic->reg = reg; 801021ff: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102206: 00 00 00 return ioapic->data; 80102209: 8b 15 34 26 11 80 mov 0x80112634,%edx 8010220f: 8b 72 10 mov 0x10(%edx),%esi }; static uint ioapicread(int reg) { ioapic->reg = reg; 80102212: c7 02 00 00 00 00 movl $0x0,(%edx) return ioapic->data; 80102218: 8b 0d 34 26 11 80 mov 0x80112634,%ecx int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 8010221e: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx ioapicinit(void) { int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102225: 89 f0 mov %esi,%eax 80102227: c1 e8 10 shr $0x10,%eax 8010222a: 0f b6 f0 movzbl %al,%esi static uint ioapicread(int reg) { ioapic->reg = reg; return ioapic->data; 8010222d: 8b 41 10 mov 0x10(%ecx),%eax int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 80102230: c1 e8 18 shr $0x18,%eax 80102233: 39 d0 cmp %edx,%eax 80102235: 74 16 je 8010224d <ioapicinit+0x5d> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102237: 83 ec 0c sub $0xc,%esp 8010223a: 68 94 71 10 80 push $0x80107194 8010223f: e8 1c e4 ff ff call 80100660 <cprintf> 80102244: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 8010224a: 83 c4 10 add $0x10,%esp 8010224d: 83 c6 21 add $0x21,%esi ioapic->data = data; } void ioapicinit(void) { 80102250: ba 10 00 00 00 mov $0x10,%edx 80102255: b8 20 00 00 00 mov $0x20,%eax 8010225a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 80102260: 89 11 mov %edx,(%ecx) ioapic->data = data; 80102262: 8b 0d 34 26 11 80 mov 0x80112634,%ecx cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); // 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)); 80102268: 89 c3 mov %eax,%ebx 8010226a: 81 cb 00 00 01 00 or $0x10000,%ebx 80102270: 83 c0 01 add $0x1,%eax static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; ioapic->data = data; 80102273: 89 59 10 mov %ebx,0x10(%ecx) 80102276: 8d 5a 01 lea 0x1(%edx),%ebx 80102279: 83 c2 02 add $0x2,%edx if(id != ioapicid) cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for(i = 0; i <= maxintr; i++){ 8010227c: 39 f0 cmp %esi,%eax } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 8010227e: 89 19 mov %ebx,(%ecx) ioapic->data = data; 80102280: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 80102286: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) if(id != ioapicid) cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for(i = 0; i <= maxintr; i++){ 8010228d: 75 d1 jne 80102260 <ioapicinit+0x70> ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); ioapicwrite(REG_TABLE+2*i+1, 0); } } 8010228f: 8d 65 f8 lea -0x8(%ebp),%esp 80102292: 5b pop %ebx 80102293: 5e pop %esi 80102294: 5d pop %ebp 80102295: c3 ret 80102296: 8d 76 00 lea 0x0(%esi),%esi 80102299: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801022a0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801022a0: 55 push %ebp } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 801022a1: 8b 0d 34 26 11 80 mov 0x80112634,%ecx } } void ioapicenable(int irq, int cpunum) { 801022a7: 89 e5 mov %esp,%ebp 801022a9: 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); 801022ac: 8d 50 20 lea 0x20(%eax),%edx 801022af: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 801022b3: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022b5: 8b 0d 34 26 11 80 mov 0x80112634,%ecx } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 801022bb: 83 c0 01 add $0x1,%eax ioapic->data = data; 801022be: 89 51 10 mov %edx,0x10(%ecx) { // 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); ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022c1: 8b 55 0c mov 0xc(%ebp),%edx } static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; 801022c4: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022c6: a1 34 26 11 80 mov 0x80112634,%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); ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022cb: c1 e2 18 shl $0x18,%edx static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; ioapic->data = data; 801022ce: 89 50 10 mov %edx,0x10(%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); ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); } 801022d1: 5d pop %ebp 801022d2: c3 ret 801022d3: 66 90 xchg %ax,%ax 801022d5: 66 90 xchg %ax,%ax 801022d7: 66 90 xchg %ax,%ax 801022d9: 66 90 xchg %ax,%ax 801022db: 66 90 xchg %ax,%ax 801022dd: 66 90 xchg %ax,%ax 801022df: 90 nop 801022e0 <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) { 801022e0: 55 push %ebp 801022e1: 89 e5 mov %esp,%ebp 801022e3: 53 push %ebx 801022e4: 83 ec 04 sub $0x4,%esp 801022e7: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) 801022ea: f7 c3 ff 0f 00 00 test $0xfff,%ebx 801022f0: 75 70 jne 80102362 <kfree+0x82> 801022f2: 81 fb a8 54 11 80 cmp $0x801154a8,%ebx 801022f8: 72 68 jb 80102362 <kfree+0x82> 801022fa: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102300: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102305: 77 5b ja 80102362 <kfree+0x82> panic("kfree"); // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 80102307: 83 ec 04 sub $0x4,%esp 8010230a: 68 00 10 00 00 push $0x1000 8010230f: 6a 01 push $0x1 80102311: 53 push %ebx 80102312: e8 99 21 00 00 call 801044b0 <memset> if(kmem.use_lock) 80102317: 8b 15 74 26 11 80 mov 0x80112674,%edx 8010231d: 83 c4 10 add $0x10,%esp 80102320: 85 d2 test %edx,%edx 80102322: 75 2c jne 80102350 <kfree+0x70> acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; 80102324: a1 78 26 11 80 mov 0x80112678,%eax 80102329: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 8010232b: a1 74 26 11 80 mov 0x80112674,%eax if(kmem.use_lock) acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; kmem.freelist = r; 80102330: 89 1d 78 26 11 80 mov %ebx,0x80112678 if(kmem.use_lock) 80102336: 85 c0 test %eax,%eax 80102338: 75 06 jne 80102340 <kfree+0x60> release(&kmem.lock); } 8010233a: 8b 5d fc mov -0x4(%ebp),%ebx 8010233d: c9 leave 8010233e: c3 ret 8010233f: 90 nop acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; kmem.freelist = r; if(kmem.use_lock) release(&kmem.lock); 80102340: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp) } 80102347: 8b 5d fc mov -0x4(%ebp),%ebx 8010234a: c9 leave acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; kmem.freelist = r; if(kmem.use_lock) release(&kmem.lock); 8010234b: e9 10 21 00 00 jmp 80104460 <release> // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); if(kmem.use_lock) acquire(&kmem.lock); 80102350: 83 ec 0c sub $0xc,%esp 80102353: 68 40 26 11 80 push $0x80112640 80102358: e8 e3 1f 00 00 call 80104340 <acquire> 8010235d: 83 c4 10 add $0x10,%esp 80102360: eb c2 jmp 80102324 <kfree+0x44> kfree(char *v) { struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) panic("kfree"); 80102362: 83 ec 0c sub $0xc,%esp 80102365: 68 c6 71 10 80 push $0x801071c6 8010236a: e8 01 e0 ff ff call 80100370 <panic> 8010236f: 90 nop 80102370 <freerange>: kmem.use_lock = 1; } void freerange(void *vstart, void *vend) { 80102370: 55 push %ebp 80102371: 89 e5 mov %esp,%ebp 80102373: 56 push %esi 80102374: 53 push %ebx char *p; p = (char*)PGROUNDUP((uint)vstart); 80102375: 8b 45 08 mov 0x8(%ebp),%eax kmem.use_lock = 1; } void freerange(void *vstart, void *vend) { 80102378: 8b 75 0c mov 0xc(%ebp),%esi char *p; p = (char*)PGROUNDUP((uint)vstart); 8010237b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102381: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102387: 81 c3 00 10 00 00 add $0x1000,%ebx 8010238d: 39 de cmp %ebx,%esi 8010238f: 72 23 jb 801023b4 <freerange+0x44> 80102391: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102398: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 8010239e: 83 ec 0c sub $0xc,%esp void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023a1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801023a7: 50 push %eax 801023a8: e8 33 ff ff ff call 801022e0 <kfree> void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023ad: 83 c4 10 add $0x10,%esp 801023b0: 39 f3 cmp %esi,%ebx 801023b2: 76 e4 jbe 80102398 <freerange+0x28> kfree(p); } 801023b4: 8d 65 f8 lea -0x8(%ebp),%esp 801023b7: 5b pop %ebx 801023b8: 5e pop %esi 801023b9: 5d pop %ebp 801023ba: c3 ret 801023bb: 90 nop 801023bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801023c0 <kinit1>: // the pages mapped by entrypgdir on free list. // 2. main() calls kinit2() with the rest of the physical pages // after installing a full page table that maps them on all cores. void kinit1(void *vstart, void *vend) { 801023c0: 55 push %ebp 801023c1: 89 e5 mov %esp,%ebp 801023c3: 56 push %esi 801023c4: 53 push %ebx 801023c5: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 801023c8: 83 ec 08 sub $0x8,%esp 801023cb: 68 cc 71 10 80 push $0x801071cc 801023d0: 68 40 26 11 80 push $0x80112640 801023d5: e8 66 1e 00 00 call 80104240 <initlock> void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); 801023da: 8b 45 08 mov 0x8(%ebp),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023dd: 83 c4 10 add $0x10,%esp // after installing a full page table that maps them on all cores. void kinit1(void *vstart, void *vend) { initlock(&kmem.lock, "kmem"); kmem.use_lock = 0; 801023e0: c7 05 74 26 11 80 00 movl $0x0,0x80112674 801023e7: 00 00 00 void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); 801023ea: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801023f0: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023f6: 81 c3 00 10 00 00 add $0x1000,%ebx 801023fc: 39 de cmp %ebx,%esi 801023fe: 72 1c jb 8010241c <kinit1+0x5c> kfree(p); 80102400: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102406: 83 ec 0c sub $0xc,%esp void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102409: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010240f: 50 push %eax 80102410: e8 cb fe ff ff call 801022e0 <kfree> void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102415: 83 c4 10 add $0x10,%esp 80102418: 39 de cmp %ebx,%esi 8010241a: 73 e4 jae 80102400 <kinit1+0x40> kinit1(void *vstart, void *vend) { initlock(&kmem.lock, "kmem"); kmem.use_lock = 0; freerange(vstart, vend); } 8010241c: 8d 65 f8 lea -0x8(%ebp),%esp 8010241f: 5b pop %ebx 80102420: 5e pop %esi 80102421: 5d pop %ebp 80102422: c3 ret 80102423: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102429: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102430 <kinit2>: void kinit2(void *vstart, void *vend) { 80102430: 55 push %ebp 80102431: 89 e5 mov %esp,%ebp 80102433: 56 push %esi 80102434: 53 push %ebx void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); 80102435: 8b 45 08 mov 0x8(%ebp),%eax freerange(vstart, vend); } void kinit2(void *vstart, void *vend) { 80102438: 8b 75 0c mov 0xc(%ebp),%esi void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); 8010243b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102441: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102447: 81 c3 00 10 00 00 add $0x1000,%ebx 8010244d: 39 de cmp %ebx,%esi 8010244f: 72 23 jb 80102474 <kinit2+0x44> 80102451: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102458: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 8010245e: 83 ec 0c sub $0xc,%esp void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102461: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 80102467: 50 push %eax 80102468: e8 73 fe ff ff call 801022e0 <kfree> void freerange(void *vstart, void *vend) { char *p; p = (char*)PGROUNDUP((uint)vstart); for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010246d: 83 c4 10 add $0x10,%esp 80102470: 39 de cmp %ebx,%esi 80102472: 73 e4 jae 80102458 <kinit2+0x28> void kinit2(void *vstart, void *vend) { freerange(vstart, vend); kmem.use_lock = 1; 80102474: c7 05 74 26 11 80 01 movl $0x1,0x80112674 8010247b: 00 00 00 } 8010247e: 8d 65 f8 lea -0x8(%ebp),%esp 80102481: 5b pop %ebx 80102482: 5e pop %esi 80102483: 5d pop %ebp 80102484: c3 ret 80102485: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102489: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102490 <kalloc>: // Allocate one 4096-byte page of physical memory. // Returns a pointer that the kernel can use. // Returns 0 if the memory cannot be allocated. char* kalloc(void) { 80102490: 55 push %ebp 80102491: 89 e5 mov %esp,%ebp 80102493: 53 push %ebx 80102494: 83 ec 04 sub $0x4,%esp struct run *r; if(kmem.use_lock) 80102497: a1 74 26 11 80 mov 0x80112674,%eax 8010249c: 85 c0 test %eax,%eax 8010249e: 75 30 jne 801024d0 <kalloc+0x40> acquire(&kmem.lock); r = kmem.freelist; 801024a0: 8b 1d 78 26 11 80 mov 0x80112678,%ebx if(r) 801024a6: 85 db test %ebx,%ebx 801024a8: 74 1c je 801024c6 <kalloc+0x36> kmem.freelist = r->next; 801024aa: 8b 13 mov (%ebx),%edx 801024ac: 89 15 78 26 11 80 mov %edx,0x80112678 if(kmem.use_lock) 801024b2: 85 c0 test %eax,%eax 801024b4: 74 10 je 801024c6 <kalloc+0x36> release(&kmem.lock); 801024b6: 83 ec 0c sub $0xc,%esp 801024b9: 68 40 26 11 80 push $0x80112640 801024be: e8 9d 1f 00 00 call 80104460 <release> 801024c3: 83 c4 10 add $0x10,%esp return (char*)r; } 801024c6: 89 d8 mov %ebx,%eax 801024c8: 8b 5d fc mov -0x4(%ebp),%ebx 801024cb: c9 leave 801024cc: c3 ret 801024cd: 8d 76 00 lea 0x0(%esi),%esi kalloc(void) { struct run *r; if(kmem.use_lock) acquire(&kmem.lock); 801024d0: 83 ec 0c sub $0xc,%esp 801024d3: 68 40 26 11 80 push $0x80112640 801024d8: e8 63 1e 00 00 call 80104340 <acquire> r = kmem.freelist; 801024dd: 8b 1d 78 26 11 80 mov 0x80112678,%ebx if(r) 801024e3: 83 c4 10 add $0x10,%esp 801024e6: a1 74 26 11 80 mov 0x80112674,%eax 801024eb: 85 db test %ebx,%ebx 801024ed: 75 bb jne 801024aa <kalloc+0x1a> 801024ef: eb c1 jmp 801024b2 <kalloc+0x22> 801024f1: 66 90 xchg %ax,%ax 801024f3: 66 90 xchg %ax,%ax 801024f5: 66 90 xchg %ax,%ax 801024f7: 66 90 xchg %ax,%ax 801024f9: 66 90 xchg %ax,%ax 801024fb: 66 90 xchg %ax,%ax 801024fd: 66 90 xchg %ax,%ax 801024ff: 90 nop 80102500 <kbdgetc>: #include "defs.h" #include "kbd.h" int kbdgetc(void) { 80102500: 55 push %ebp static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102501: ba 64 00 00 00 mov $0x64,%edx 80102506: 89 e5 mov %esp,%ebp 80102508: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) 80102509: a8 01 test $0x1,%al 8010250b: 0f 84 af 00 00 00 je 801025c0 <kbdgetc+0xc0> 80102511: ba 60 00 00 00 mov $0x60,%edx 80102516: ec in (%dx),%al return -1; data = inb(KBDATAP); 80102517: 0f b6 d0 movzbl %al,%edx if(data == 0xE0){ 8010251a: 81 fa e0 00 00 00 cmp $0xe0,%edx 80102520: 74 7e je 801025a0 <kbdgetc+0xa0> shift |= E0ESC; return 0; } else if(data & 0x80){ 80102522: 84 c0 test %al,%al // Key released data = (shift & E0ESC ? data : data & 0x7F); 80102524: 8b 0d b4 a5 10 80 mov 0x8010a5b4,%ecx data = inb(KBDATAP); if(data == 0xE0){ shift |= E0ESC; return 0; } else if(data & 0x80){ 8010252a: 79 24 jns 80102550 <kbdgetc+0x50> // Key released data = (shift & E0ESC ? data : data & 0x7F); 8010252c: f6 c1 40 test $0x40,%cl 8010252f: 75 05 jne 80102536 <kbdgetc+0x36> 80102531: 89 c2 mov %eax,%edx 80102533: 83 e2 7f and $0x7f,%edx shift &= ~(shiftcode[data] | E0ESC); 80102536: 0f b6 82 00 73 10 80 movzbl -0x7fef8d00(%edx),%eax 8010253d: 83 c8 40 or $0x40,%eax 80102540: 0f b6 c0 movzbl %al,%eax 80102543: f7 d0 not %eax 80102545: 21 c8 and %ecx,%eax 80102547: a3 b4 a5 10 80 mov %eax,0x8010a5b4 return 0; 8010254c: 31 c0 xor %eax,%eax c += 'A' - 'a'; else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 8010254e: 5d pop %ebp 8010254f: c3 ret } else if(data & 0x80){ // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ 80102550: f6 c1 40 test $0x40,%cl 80102553: 74 09 je 8010255e <kbdgetc+0x5e> // Last character was an E0 escape; or with 0x80 data |= 0x80; 80102555: 83 c8 80 or $0xffffff80,%eax shift &= ~E0ESC; 80102558: 83 e1 bf and $0xffffffbf,%ecx data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010255b: 0f b6 d0 movzbl %al,%edx shift &= ~E0ESC; } shift |= shiftcode[data]; shift ^= togglecode[data]; 8010255e: 0f b6 82 00 73 10 80 movzbl -0x7fef8d00(%edx),%eax 80102565: 09 c1 or %eax,%ecx 80102567: 0f b6 82 00 72 10 80 movzbl -0x7fef8e00(%edx),%eax 8010256e: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102570: 89 c8 mov %ecx,%eax data |= 0x80; shift &= ~E0ESC; } shift |= shiftcode[data]; shift ^= togglecode[data]; 80102572: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 c = charcode[shift & (CTL | SHIFT)][data]; 80102578: 83 e0 03 and $0x3,%eax if(shift & CAPSLOCK){ 8010257b: 83 e1 08 and $0x8,%ecx shift &= ~E0ESC; } shift |= shiftcode[data]; shift ^= togglecode[data]; c = charcode[shift & (CTL | SHIFT)][data]; 8010257e: 8b 04 85 e0 71 10 80 mov -0x7fef8e20(,%eax,4),%eax 80102585: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if(shift & CAPSLOCK){ 80102589: 74 c3 je 8010254e <kbdgetc+0x4e> if('a' <= c && c <= 'z') 8010258b: 8d 50 9f lea -0x61(%eax),%edx 8010258e: 83 fa 19 cmp $0x19,%edx 80102591: 77 1d ja 801025b0 <kbdgetc+0xb0> c += 'A' - 'a'; 80102593: 83 e8 20 sub $0x20,%eax else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 80102596: 5d pop %ebp 80102597: c3 ret 80102598: 90 nop 80102599: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; data = inb(KBDATAP); if(data == 0xE0){ shift |= E0ESC; return 0; 801025a0: 31 c0 xor %eax,%eax if((st & KBS_DIB) == 0) return -1; data = inb(KBDATAP); if(data == 0xE0){ shift |= E0ESC; 801025a2: 83 0d b4 a5 10 80 40 orl $0x40,0x8010a5b4 c += 'A' - 'a'; else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801025a9: 5d pop %ebp 801025aa: c3 ret 801025ab: 90 nop 801025ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift ^= togglecode[data]; c = charcode[shift & (CTL | SHIFT)][data]; if(shift & CAPSLOCK){ if('a' <= c && c <= 'z') c += 'A' - 'a'; else if('A' <= c && c <= 'Z') 801025b0: 8d 48 bf lea -0x41(%eax),%ecx c += 'a' - 'A'; 801025b3: 8d 50 20 lea 0x20(%eax),%edx } return c; } 801025b6: 5d pop %ebp c = charcode[shift & (CTL | SHIFT)][data]; if(shift & CAPSLOCK){ if('a' <= c && c <= 'z') c += 'A' - 'a'; else if('A' <= c && c <= 'Z') c += 'a' - 'A'; 801025b7: 83 f9 19 cmp $0x19,%ecx 801025ba: 0f 46 c2 cmovbe %edx,%eax } return c; } 801025bd: c3 ret 801025be: 66 90 xchg %ax,%ax }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) return -1; 801025c0: b8 ff ff ff ff mov $0xffffffff,%eax c += 'A' - 'a'; else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801025c5: 5d pop %ebp 801025c6: c3 ret 801025c7: 89 f6 mov %esi,%esi 801025c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801025d0 <kbdintr>: void kbdintr(void) { 801025d0: 55 push %ebp 801025d1: 89 e5 mov %esp,%ebp 801025d3: 83 ec 14 sub $0x14,%esp consoleintr(kbdgetc); 801025d6: 68 00 25 10 80 push $0x80102500 801025db: e8 10 e2 ff ff call 801007f0 <consoleintr> } 801025e0: 83 c4 10 add $0x10,%esp 801025e3: c9 leave 801025e4: c3 ret 801025e5: 66 90 xchg %ax,%ax 801025e7: 66 90 xchg %ax,%ax 801025e9: 66 90 xchg %ax,%ax 801025eb: 66 90 xchg %ax,%ax 801025ed: 66 90 xchg %ax,%ax 801025ef: 90 nop 801025f0 <lapicinit>: } void lapicinit(void) { if(!lapic) 801025f0: a1 7c 26 11 80 mov 0x8011267c,%eax lapic[ID]; // wait for write to finish, by reading } void lapicinit(void) { 801025f5: 55 push %ebp 801025f6: 89 e5 mov %esp,%ebp if(!lapic) 801025f8: 85 c0 test %eax,%eax 801025fa: 0f 84 c8 00 00 00 je 801026c8 <lapicinit+0xd8> volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102600: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax) 80102607: 01 00 00 lapic[ID]; // wait for write to finish, by reading 8010260a: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 8010260d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax) 80102614: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102617: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 8010261a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax) 80102621: 00 02 00 lapic[ID]; // wait for write to finish, by reading 80102624: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102627: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax) 8010262e: 96 98 00 lapic[ID]; // wait for write to finish, by reading 80102631: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102634: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax) 8010263b: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010263e: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102641: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax) 80102648: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010264b: 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) 8010264e: 8b 50 30 mov 0x30(%eax),%edx 80102651: c1 ea 10 shr $0x10,%edx 80102654: 80 fa 03 cmp $0x3,%dl 80102657: 77 77 ja 801026d0 <lapicinit+0xe0> volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102659: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax) 80102660: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102663: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102666: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 8010266d: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102670: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102673: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 8010267a: 00 00 00 lapic[ID]; // wait for write to finish, by reading 8010267d: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102680: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102687: 00 00 00 lapic[ID]; // wait for write to finish, by reading 8010268a: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 8010268d: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax) 80102694: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102697: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 8010269a: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax) 801026a1: 85 08 00 lapic[ID]; // wait for write to finish, by reading 801026a4: 8b 50 20 mov 0x20(%eax),%edx 801026a7: 89 f6 mov %esi,%esi 801026a9: 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) 801026b0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 801026b6: 80 e6 10 and $0x10,%dh 801026b9: 75 f5 jne 801026b0 <lapicinit+0xc0> volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 801026bb: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax) 801026c2: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026c5: 8b 40 20 mov 0x20(%eax),%eax while(lapic[ICRLO] & DELIVS) ; // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 801026c8: 5d pop %ebp 801026c9: c3 ret 801026ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 801026d0: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax) 801026d7: 00 01 00 lapic[ID]; // wait for write to finish, by reading 801026da: 8b 50 20 mov 0x20(%eax),%edx 801026dd: e9 77 ff ff ff jmp 80102659 <lapicinit+0x69> 801026e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801026e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801026f0 <lapicid>: } int lapicid(void) { if (!lapic) 801026f0: a1 7c 26 11 80 mov 0x8011267c,%eax lapicw(TPR, 0); } int lapicid(void) { 801026f5: 55 push %ebp 801026f6: 89 e5 mov %esp,%ebp if (!lapic) 801026f8: 85 c0 test %eax,%eax 801026fa: 74 0c je 80102708 <lapicid+0x18> return 0; return lapic[ID] >> 24; 801026fc: 8b 40 20 mov 0x20(%eax),%eax } 801026ff: 5d pop %ebp int lapicid(void) { if (!lapic) return 0; return lapic[ID] >> 24; 80102700: c1 e8 18 shr $0x18,%eax } 80102703: c3 ret 80102704: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int lapicid(void) { if (!lapic) return 0; 80102708: 31 c0 xor %eax,%eax return lapic[ID] >> 24; } 8010270a: 5d pop %ebp 8010270b: c3 ret 8010270c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102710 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { if(lapic) 80102710: a1 7c 26 11 80 mov 0x8011267c,%eax } // Acknowledge interrupt. void lapiceoi(void) { 80102715: 55 push %ebp 80102716: 89 e5 mov %esp,%ebp if(lapic) 80102718: 85 c0 test %eax,%eax 8010271a: 74 0d je 80102729 <lapiceoi+0x19> volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 8010271c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102723: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102726: 8b 40 20 mov 0x20(%eax),%eax void lapiceoi(void) { if(lapic) lapicw(EOI, 0); } 80102729: 5d pop %ebp 8010272a: c3 ret 8010272b: 90 nop 8010272c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102730 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80102730: 55 push %ebp 80102731: 89 e5 mov %esp,%ebp } 80102733: 5d pop %ebp 80102734: c3 ret 80102735: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102739: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102740 <lapicstartap>: // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 80102740: 55 push %ebp } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102741: ba 70 00 00 00 mov $0x70,%edx 80102746: b8 0f 00 00 00 mov $0xf,%eax 8010274b: 89 e5 mov %esp,%ebp 8010274d: 53 push %ebx 8010274e: 8b 4d 0c mov 0xc(%ebp),%ecx 80102751: 8b 5d 08 mov 0x8(%ebp),%ebx 80102754: ee out %al,(%dx) 80102755: ba 71 00 00 00 mov $0x71,%edx 8010275a: b8 0a 00 00 00 mov $0xa,%eax 8010275f: 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; 80102760: 31 c0 xor %eax,%eax volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102762: c1 e3 18 shl $0x18,%ebx // 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; 80102765: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 8010276b: 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)); 8010276d: c1 e9 0c shr $0xc,%ecx // 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; wrv[1] = addr >> 4; 80102770: c1 e8 04 shr $0x4,%eax volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102773: 89 da mov %ebx,%edx // 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)); 80102775: 80 cd 06 or $0x6,%ch // 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; wrv[1] = addr >> 4; 80102778: 66 a3 69 04 00 80 mov %ax,0x80000469 volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 8010277e: a1 7c 26 11 80 mov 0x8011267c,%eax 80102783: 89 98 10 03 00 00 mov %ebx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 80102789: 8b 58 20 mov 0x20(%eax),%ebx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 8010278c: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 80102793: c5 00 00 lapic[ID]; // wait for write to finish, by reading 80102796: 8b 58 20 mov 0x20(%eax),%ebx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 80102799: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 801027a0: 85 00 00 lapic[ID]; // wait for write to finish, by reading 801027a3: 8b 58 20 mov 0x20(%eax),%ebx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 801027a6: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027ac: 8b 58 20 mov 0x20(%eax),%ebx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 801027af: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801027b5: 8b 58 20 mov 0x20(%eax),%ebx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 801027b8: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027be: 8b 50 20 mov 0x20(%eax),%edx volatile uint *lapic; // Initialized in mp.c static void lapicw(int index, int value) { lapic[index] = value; 801027c1: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801027c7: 8b 40 20 mov 0x20(%eax),%eax for(i = 0; i < 2; i++){ lapicw(ICRHI, apicid<<24); lapicw(ICRLO, STARTUP | (addr>>12)); microdelay(200); } } 801027ca: 5b pop %ebx 801027cb: 5d pop %ebp 801027cc: c3 ret 801027cd: 8d 76 00 lea 0x0(%esi),%esi 801027d0 <cmostime>: r->year = cmos_read(YEAR); } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 801027d0: 55 push %ebp 801027d1: ba 70 00 00 00 mov $0x70,%edx 801027d6: b8 0b 00 00 00 mov $0xb,%eax 801027db: 89 e5 mov %esp,%ebp 801027dd: 57 push %edi 801027de: 56 push %esi 801027df: 53 push %ebx 801027e0: 83 ec 4c sub $0x4c,%esp 801027e3: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801027e4: ba 71 00 00 00 mov $0x71,%edx 801027e9: ec in (%dx),%al 801027ea: 83 e0 04 and $0x4,%eax 801027ed: 8d 75 d0 lea -0x30(%ebp),%esi } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801027f0: 31 db xor %ebx,%ebx 801027f2: 88 45 b7 mov %al,-0x49(%ebp) 801027f5: bf 70 00 00 00 mov $0x70,%edi 801027fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102800: 89 d8 mov %ebx,%eax 80102802: 89 fa mov %edi,%edx 80102804: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102805: b9 71 00 00 00 mov $0x71,%ecx 8010280a: 89 ca mov %ecx,%edx 8010280c: ec in (%dx),%al return inb(CMOS_RETURN); } static void fill_rtcdate(struct rtcdate *r) { r->second = cmos_read(SECS); 8010280d: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102810: 89 fa mov %edi,%edx 80102812: 89 45 b8 mov %eax,-0x48(%ebp) 80102815: b8 02 00 00 00 mov $0x2,%eax 8010281a: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010281b: 89 ca mov %ecx,%edx 8010281d: ec in (%dx),%al r->minute = cmos_read(MINS); 8010281e: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102821: 89 fa mov %edi,%edx 80102823: 89 45 bc mov %eax,-0x44(%ebp) 80102826: b8 04 00 00 00 mov $0x4,%eax 8010282b: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010282c: 89 ca mov %ecx,%edx 8010282e: ec in (%dx),%al r->hour = cmos_read(HOURS); 8010282f: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102832: 89 fa mov %edi,%edx 80102834: 89 45 c0 mov %eax,-0x40(%ebp) 80102837: b8 07 00 00 00 mov $0x7,%eax 8010283c: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010283d: 89 ca mov %ecx,%edx 8010283f: ec in (%dx),%al r->day = cmos_read(DAY); 80102840: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102843: 89 fa mov %edi,%edx 80102845: 89 45 c4 mov %eax,-0x3c(%ebp) 80102848: b8 08 00 00 00 mov $0x8,%eax 8010284d: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010284e: 89 ca mov %ecx,%edx 80102850: ec in (%dx),%al r->month = cmos_read(MONTH); 80102851: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102854: 89 fa mov %edi,%edx 80102856: 89 45 c8 mov %eax,-0x38(%ebp) 80102859: b8 09 00 00 00 mov $0x9,%eax 8010285e: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010285f: 89 ca mov %ecx,%edx 80102861: ec in (%dx),%al r->year = cmos_read(YEAR); 80102862: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102865: 89 fa mov %edi,%edx 80102867: 89 45 cc mov %eax,-0x34(%ebp) 8010286a: b8 0a 00 00 00 mov $0xa,%eax 8010286f: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102870: 89 ca mov %ecx,%edx 80102872: 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) 80102873: 84 c0 test %al,%al 80102875: 78 89 js 80102800 <cmostime+0x30> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102877: 89 d8 mov %ebx,%eax 80102879: 89 fa mov %edi,%edx 8010287b: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010287c: 89 ca mov %ecx,%edx 8010287e: ec in (%dx),%al return inb(CMOS_RETURN); } static void fill_rtcdate(struct rtcdate *r) { r->second = cmos_read(SECS); 8010287f: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102882: 89 fa mov %edi,%edx 80102884: 89 45 d0 mov %eax,-0x30(%ebp) 80102887: b8 02 00 00 00 mov $0x2,%eax 8010288c: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010288d: 89 ca mov %ecx,%edx 8010288f: ec in (%dx),%al r->minute = cmos_read(MINS); 80102890: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102893: 89 fa mov %edi,%edx 80102895: 89 45 d4 mov %eax,-0x2c(%ebp) 80102898: b8 04 00 00 00 mov $0x4,%eax 8010289d: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010289e: 89 ca mov %ecx,%edx 801028a0: ec in (%dx),%al r->hour = cmos_read(HOURS); 801028a1: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028a4: 89 fa mov %edi,%edx 801028a6: 89 45 d8 mov %eax,-0x28(%ebp) 801028a9: b8 07 00 00 00 mov $0x7,%eax 801028ae: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028af: 89 ca mov %ecx,%edx 801028b1: ec in (%dx),%al r->day = cmos_read(DAY); 801028b2: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028b5: 89 fa mov %edi,%edx 801028b7: 89 45 dc mov %eax,-0x24(%ebp) 801028ba: b8 08 00 00 00 mov $0x8,%eax 801028bf: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028c0: 89 ca mov %ecx,%edx 801028c2: ec in (%dx),%al r->month = cmos_read(MONTH); 801028c3: 0f b6 c0 movzbl %al,%eax } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028c6: 89 fa mov %edi,%edx 801028c8: 89 45 e0 mov %eax,-0x20(%ebp) 801028cb: b8 09 00 00 00 mov $0x9,%eax 801028d0: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028d1: 89 ca mov %ecx,%edx 801028d3: ec in (%dx),%al r->year = cmos_read(YEAR); 801028d4: 0f b6 c0 movzbl %al,%eax for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 801028d7: 83 ec 04 sub $0x4,%esp r->second = cmos_read(SECS); r->minute = cmos_read(MINS); r->hour = cmos_read(HOURS); r->day = cmos_read(DAY); r->month = cmos_read(MONTH); r->year = cmos_read(YEAR); 801028da: 89 45 e4 mov %eax,-0x1c(%ebp) for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 801028dd: 8d 45 b8 lea -0x48(%ebp),%eax 801028e0: 6a 18 push $0x18 801028e2: 56 push %esi 801028e3: 50 push %eax 801028e4: e8 17 1c 00 00 call 80104500 <memcmp> 801028e9: 83 c4 10 add $0x10,%esp 801028ec: 85 c0 test %eax,%eax 801028ee: 0f 85 0c ff ff ff jne 80102800 <cmostime+0x30> break; } // convert if(bcd) { 801028f4: 80 7d b7 00 cmpb $0x0,-0x49(%ebp) 801028f8: 75 78 jne 80102972 <cmostime+0x1a2> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 801028fa: 8b 45 b8 mov -0x48(%ebp),%eax 801028fd: 89 c2 mov %eax,%edx 801028ff: 83 e0 0f and $0xf,%eax 80102902: c1 ea 04 shr $0x4,%edx 80102905: 8d 14 92 lea (%edx,%edx,4),%edx 80102908: 8d 04 50 lea (%eax,%edx,2),%eax 8010290b: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 8010290e: 8b 45 bc mov -0x44(%ebp),%eax 80102911: 89 c2 mov %eax,%edx 80102913: 83 e0 0f and $0xf,%eax 80102916: c1 ea 04 shr $0x4,%edx 80102919: 8d 14 92 lea (%edx,%edx,4),%edx 8010291c: 8d 04 50 lea (%eax,%edx,2),%eax 8010291f: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80102922: 8b 45 c0 mov -0x40(%ebp),%eax 80102925: 89 c2 mov %eax,%edx 80102927: 83 e0 0f and $0xf,%eax 8010292a: c1 ea 04 shr $0x4,%edx 8010292d: 8d 14 92 lea (%edx,%edx,4),%edx 80102930: 8d 04 50 lea (%eax,%edx,2),%eax 80102933: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80102936: 8b 45 c4 mov -0x3c(%ebp),%eax 80102939: 89 c2 mov %eax,%edx 8010293b: 83 e0 0f and $0xf,%eax 8010293e: c1 ea 04 shr $0x4,%edx 80102941: 8d 14 92 lea (%edx,%edx,4),%edx 80102944: 8d 04 50 lea (%eax,%edx,2),%eax 80102947: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 8010294a: 8b 45 c8 mov -0x38(%ebp),%eax 8010294d: 89 c2 mov %eax,%edx 8010294f: 83 e0 0f and $0xf,%eax 80102952: c1 ea 04 shr $0x4,%edx 80102955: 8d 14 92 lea (%edx,%edx,4),%edx 80102958: 8d 04 50 lea (%eax,%edx,2),%eax 8010295b: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 8010295e: 8b 45 cc mov -0x34(%ebp),%eax 80102961: 89 c2 mov %eax,%edx 80102963: 83 e0 0f and $0xf,%eax 80102966: c1 ea 04 shr $0x4,%edx 80102969: 8d 14 92 lea (%edx,%edx,4),%edx 8010296c: 8d 04 50 lea (%eax,%edx,2),%eax 8010296f: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 80102972: 8b 75 08 mov 0x8(%ebp),%esi 80102975: 8b 45 b8 mov -0x48(%ebp),%eax 80102978: 89 06 mov %eax,(%esi) 8010297a: 8b 45 bc mov -0x44(%ebp),%eax 8010297d: 89 46 04 mov %eax,0x4(%esi) 80102980: 8b 45 c0 mov -0x40(%ebp),%eax 80102983: 89 46 08 mov %eax,0x8(%esi) 80102986: 8b 45 c4 mov -0x3c(%ebp),%eax 80102989: 89 46 0c mov %eax,0xc(%esi) 8010298c: 8b 45 c8 mov -0x38(%ebp),%eax 8010298f: 89 46 10 mov %eax,0x10(%esi) 80102992: 8b 45 cc mov -0x34(%ebp),%eax 80102995: 89 46 14 mov %eax,0x14(%esi) r->year += 2000; 80102998: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi) } 8010299f: 8d 65 f4 lea -0xc(%ebp),%esp 801029a2: 5b pop %ebx 801029a3: 5e pop %esi 801029a4: 5f pop %edi 801029a5: 5d pop %ebp 801029a6: c3 ret 801029a7: 66 90 xchg %ax,%ax 801029a9: 66 90 xchg %ax,%ax 801029ab: 66 90 xchg %ax,%ax 801029ad: 66 90 xchg %ax,%ax 801029af: 90 nop 801029b0 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 801029b0: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 801029b6: 85 c9 test %ecx,%ecx 801029b8: 0f 8e 85 00 00 00 jle 80102a43 <install_trans+0x93> } // Copy committed blocks from log to their home location static void install_trans(void) { 801029be: 55 push %ebp 801029bf: 89 e5 mov %esp,%ebp 801029c1: 57 push %edi 801029c2: 56 push %esi 801029c3: 53 push %ebx 801029c4: 31 db xor %ebx,%ebx 801029c6: 83 ec 0c sub $0xc,%esp 801029c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi int tail; for (tail = 0; tail < log.lh.n; tail++) { struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 801029d0: a1 b4 26 11 80 mov 0x801126b4,%eax 801029d5: 83 ec 08 sub $0x8,%esp 801029d8: 01 d8 add %ebx,%eax 801029da: 83 c0 01 add $0x1,%eax 801029dd: 50 push %eax 801029de: ff 35 c4 26 11 80 pushl 0x801126c4 801029e4: e8 e7 d6 ff ff call 801000d0 <bread> 801029e9: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 801029eb: 58 pop %eax 801029ec: 5a pop %edx 801029ed: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 801029f4: ff 35 c4 26 11 80 pushl 0x801126c4 static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 801029fa: 83 c3 01 add $0x1,%ebx struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 801029fd: e8 ce d6 ff ff call 801000d0 <bread> 80102a02: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80102a04: 8d 47 5c lea 0x5c(%edi),%eax 80102a07: 83 c4 0c add $0xc,%esp 80102a0a: 68 00 02 00 00 push $0x200 80102a0f: 50 push %eax 80102a10: 8d 46 5c lea 0x5c(%esi),%eax 80102a13: 50 push %eax 80102a14: e8 47 1b 00 00 call 80104560 <memmove> bwrite(dbuf); // write dst to disk 80102a19: 89 34 24 mov %esi,(%esp) 80102a1c: e8 7f d7 ff ff call 801001a0 <bwrite> brelse(lbuf); 80102a21: 89 3c 24 mov %edi,(%esp) 80102a24: e8 b7 d7 ff ff call 801001e0 <brelse> brelse(dbuf); 80102a29: 89 34 24 mov %esi,(%esp) 80102a2c: e8 af d7 ff ff call 801001e0 <brelse> static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102a31: 83 c4 10 add $0x10,%esp 80102a34: 39 1d c8 26 11 80 cmp %ebx,0x801126c8 80102a3a: 7f 94 jg 801029d0 <install_trans+0x20> memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst bwrite(dbuf); // write dst to disk brelse(lbuf); brelse(dbuf); } } 80102a3c: 8d 65 f4 lea -0xc(%ebp),%esp 80102a3f: 5b pop %ebx 80102a40: 5e pop %esi 80102a41: 5f pop %edi 80102a42: 5d pop %ebp 80102a43: f3 c3 repz ret 80102a45: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102a49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102a50 <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) { 80102a50: 55 push %ebp 80102a51: 89 e5 mov %esp,%ebp 80102a53: 53 push %ebx 80102a54: 83 ec 0c sub $0xc,%esp struct buf *buf = bread(log.dev, log.start); 80102a57: ff 35 b4 26 11 80 pushl 0x801126b4 80102a5d: ff 35 c4 26 11 80 pushl 0x801126c4 80102a63: e8 68 d6 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102a68: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx for (i = 0; i < log.lh.n; i++) { 80102a6e: 83 c4 10 add $0x10,%esp // This is the true point at which the // current transaction commits. static void write_head(void) { struct buf *buf = bread(log.dev, log.start); 80102a71: 89 c3 mov %eax,%ebx struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; for (i = 0; i < log.lh.n; i++) { 80102a73: 85 c9 test %ecx,%ecx write_head(void) { struct buf *buf = bread(log.dev, log.start); struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102a75: 89 48 5c mov %ecx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80102a78: 7e 1f jle 80102a99 <write_head+0x49> 80102a7a: 8d 04 8d 00 00 00 00 lea 0x0(,%ecx,4),%eax 80102a81: 31 d2 xor %edx,%edx 80102a83: 90 nop 80102a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi hb->block[i] = log.lh.block[i]; 80102a88: 8b 8a cc 26 11 80 mov -0x7feed934(%edx),%ecx 80102a8e: 89 4c 13 60 mov %ecx,0x60(%ebx,%edx,1) 80102a92: 83 c2 04 add $0x4,%edx { struct buf *buf = bread(log.dev, log.start); struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; for (i = 0; i < log.lh.n; i++) { 80102a95: 39 c2 cmp %eax,%edx 80102a97: 75 ef jne 80102a88 <write_head+0x38> hb->block[i] = log.lh.block[i]; } bwrite(buf); 80102a99: 83 ec 0c sub $0xc,%esp 80102a9c: 53 push %ebx 80102a9d: e8 fe d6 ff ff call 801001a0 <bwrite> brelse(buf); 80102aa2: 89 1c 24 mov %ebx,(%esp) 80102aa5: e8 36 d7 ff ff call 801001e0 <brelse> } 80102aaa: 8b 5d fc mov -0x4(%ebp),%ebx 80102aad: c9 leave 80102aae: c3 ret 80102aaf: 90 nop 80102ab0 <initlog>: static void recover_from_log(void); static void commit(); void initlog(int dev) { 80102ab0: 55 push %ebp 80102ab1: 89 e5 mov %esp,%ebp 80102ab3: 53 push %ebx 80102ab4: 83 ec 2c sub $0x2c,%esp 80102ab7: 8b 5d 08 mov 0x8(%ebp),%ebx if (sizeof(struct logheader) >= BSIZE) panic("initlog: too big logheader"); struct superblock sb; initlock(&log.lock, "log"); 80102aba: 68 00 74 10 80 push $0x80107400 80102abf: 68 80 26 11 80 push $0x80112680 80102ac4: e8 77 17 00 00 call 80104240 <initlock> readsb(dev, &sb); 80102ac9: 58 pop %eax 80102aca: 8d 45 dc lea -0x24(%ebp),%eax 80102acd: 5a pop %edx 80102ace: 50 push %eax 80102acf: 53 push %ebx 80102ad0: e8 db e8 ff ff call 801013b0 <readsb> log.start = sb.logstart; log.size = sb.nlog; 80102ad5: 8b 55 e8 mov -0x18(%ebp),%edx panic("initlog: too big logheader"); struct superblock sb; initlock(&log.lock, "log"); readsb(dev, &sb); log.start = sb.logstart; 80102ad8: 8b 45 ec mov -0x14(%ebp),%eax // Read the log header from disk into the in-memory log header static void read_head(void) { struct buf *buf = bread(log.dev, log.start); 80102adb: 59 pop %ecx struct superblock sb; initlock(&log.lock, "log"); readsb(dev, &sb); log.start = sb.logstart; log.size = sb.nlog; log.dev = dev; 80102adc: 89 1d c4 26 11 80 mov %ebx,0x801126c4 struct superblock sb; initlock(&log.lock, "log"); readsb(dev, &sb); log.start = sb.logstart; log.size = sb.nlog; 80102ae2: 89 15 b8 26 11 80 mov %edx,0x801126b8 panic("initlog: too big logheader"); struct superblock sb; initlock(&log.lock, "log"); readsb(dev, &sb); log.start = sb.logstart; 80102ae8: a3 b4 26 11 80 mov %eax,0x801126b4 // Read the log header from disk into the in-memory log header static void read_head(void) { struct buf *buf = bread(log.dev, log.start); 80102aed: 5a pop %edx 80102aee: 50 push %eax 80102aef: 53 push %ebx 80102af0: e8 db d5 ff ff call 801000d0 <bread> struct logheader *lh = (struct logheader *) (buf->data); int i; log.lh.n = lh->n; 80102af5: 8b 48 5c mov 0x5c(%eax),%ecx for (i = 0; i < log.lh.n; i++) { 80102af8: 83 c4 10 add $0x10,%esp 80102afb: 85 c9 test %ecx,%ecx read_head(void) { struct buf *buf = bread(log.dev, log.start); struct logheader *lh = (struct logheader *) (buf->data); int i; log.lh.n = lh->n; 80102afd: 89 0d c8 26 11 80 mov %ecx,0x801126c8 for (i = 0; i < log.lh.n; i++) { 80102b03: 7e 1c jle 80102b21 <initlog+0x71> 80102b05: 8d 1c 8d 00 00 00 00 lea 0x0(,%ecx,4),%ebx 80102b0c: 31 d2 xor %edx,%edx 80102b0e: 66 90 xchg %ax,%ax log.lh.block[i] = lh->block[i]; 80102b10: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80102b14: 83 c2 04 add $0x4,%edx 80102b17: 89 8a c8 26 11 80 mov %ecx,-0x7feed938(%edx) { struct buf *buf = bread(log.dev, log.start); struct logheader *lh = (struct logheader *) (buf->data); int i; log.lh.n = lh->n; for (i = 0; i < log.lh.n; i++) { 80102b1d: 39 da cmp %ebx,%edx 80102b1f: 75 ef jne 80102b10 <initlog+0x60> log.lh.block[i] = lh->block[i]; } brelse(buf); 80102b21: 83 ec 0c sub $0xc,%esp 80102b24: 50 push %eax 80102b25: e8 b6 d6 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102b2a: e8 81 fe ff ff call 801029b0 <install_trans> log.lh.n = 0; 80102b2f: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102b36: 00 00 00 write_head(); // clear the log 80102b39: e8 12 ff ff ff call 80102a50 <write_head> readsb(dev, &sb); log.start = sb.logstart; log.size = sb.nlog; log.dev = dev; recover_from_log(); } 80102b3e: 8b 5d fc mov -0x4(%ebp),%ebx 80102b41: c9 leave 80102b42: c3 ret 80102b43: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102b49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102b50 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102b50: 55 push %ebp 80102b51: 89 e5 mov %esp,%ebp 80102b53: 83 ec 14 sub $0x14,%esp acquire(&log.lock); 80102b56: 68 80 26 11 80 push $0x80112680 80102b5b: e8 e0 17 00 00 call 80104340 <acquire> 80102b60: 83 c4 10 add $0x10,%esp 80102b63: eb 18 jmp 80102b7d <begin_op+0x2d> 80102b65: 8d 76 00 lea 0x0(%esi),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102b68: 83 ec 08 sub $0x8,%esp 80102b6b: 68 80 26 11 80 push $0x80112680 80102b70: 68 80 26 11 80 push $0x80112680 80102b75: e8 b6 11 00 00 call 80103d30 <sleep> 80102b7a: 83 c4 10 add $0x10,%esp void begin_op(void) { acquire(&log.lock); while(1){ if(log.committing){ 80102b7d: a1 c0 26 11 80 mov 0x801126c0,%eax 80102b82: 85 c0 test %eax,%eax 80102b84: 75 e2 jne 80102b68 <begin_op+0x18> sleep(&log, &log.lock); } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102b86: a1 bc 26 11 80 mov 0x801126bc,%eax 80102b8b: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102b91: 83 c0 01 add $0x1,%eax 80102b94: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102b97: 8d 14 4a lea (%edx,%ecx,2),%edx 80102b9a: 83 fa 1e cmp $0x1e,%edx 80102b9d: 7f c9 jg 80102b68 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102b9f: 83 ec 0c sub $0xc,%esp sleep(&log, &log.lock); } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; 80102ba2: a3 bc 26 11 80 mov %eax,0x801126bc release(&log.lock); 80102ba7: 68 80 26 11 80 push $0x80112680 80102bac: e8 af 18 00 00 call 80104460 <release> break; } } } 80102bb1: 83 c4 10 add $0x10,%esp 80102bb4: c9 leave 80102bb5: c3 ret 80102bb6: 8d 76 00 lea 0x0(%esi),%esi 80102bb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102bc0 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102bc0: 55 push %ebp 80102bc1: 89 e5 mov %esp,%ebp 80102bc3: 57 push %edi 80102bc4: 56 push %esi 80102bc5: 53 push %ebx 80102bc6: 83 ec 18 sub $0x18,%esp int do_commit = 0; acquire(&log.lock); 80102bc9: 68 80 26 11 80 push $0x80112680 80102bce: e8 6d 17 00 00 call 80104340 <acquire> log.outstanding -= 1; 80102bd3: a1 bc 26 11 80 mov 0x801126bc,%eax if(log.committing) 80102bd8: 8b 1d c0 26 11 80 mov 0x801126c0,%ebx 80102bde: 83 c4 10 add $0x10,%esp end_op(void) { int do_commit = 0; acquire(&log.lock); log.outstanding -= 1; 80102be1: 83 e8 01 sub $0x1,%eax if(log.committing) 80102be4: 85 db test %ebx,%ebx end_op(void) { int do_commit = 0; acquire(&log.lock); log.outstanding -= 1; 80102be6: a3 bc 26 11 80 mov %eax,0x801126bc if(log.committing) 80102beb: 0f 85 23 01 00 00 jne 80102d14 <end_op+0x154> panic("log.committing"); if(log.outstanding == 0){ 80102bf1: 85 c0 test %eax,%eax 80102bf3: 0f 85 f7 00 00 00 jne 80102cf0 <end_op+0x130> // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102bf9: 83 ec 0c sub $0xc,%esp log.outstanding -= 1; if(log.committing) panic("log.committing"); if(log.outstanding == 0){ do_commit = 1; log.committing = 1; 80102bfc: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0 80102c03: 00 00 00 } static void commit() { if (log.lh.n > 0) { 80102c06: 31 db xor %ebx,%ebx // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102c08: 68 80 26 11 80 push $0x80112680 80102c0d: e8 4e 18 00 00 call 80104460 <release> } static void commit() { if (log.lh.n > 0) { 80102c12: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102c18: 83 c4 10 add $0x10,%esp 80102c1b: 85 c9 test %ecx,%ecx 80102c1d: 0f 8e 8a 00 00 00 jle 80102cad <end_op+0xed> 80102c23: 90 nop 80102c24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi write_log(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102c28: a1 b4 26 11 80 mov 0x801126b4,%eax 80102c2d: 83 ec 08 sub $0x8,%esp 80102c30: 01 d8 add %ebx,%eax 80102c32: 83 c0 01 add $0x1,%eax 80102c35: 50 push %eax 80102c36: ff 35 c4 26 11 80 pushl 0x801126c4 80102c3c: e8 8f d4 ff ff call 801000d0 <bread> 80102c41: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c43: 58 pop %eax 80102c44: 5a pop %edx 80102c45: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102c4c: ff 35 c4 26 11 80 pushl 0x801126c4 static void write_log(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102c52: 83 c3 01 add $0x1,%ebx struct buf *to = bread(log.dev, log.start+tail+1); // log block struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c55: e8 76 d4 ff ff call 801000d0 <bread> 80102c5a: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102c5c: 8d 40 5c lea 0x5c(%eax),%eax 80102c5f: 83 c4 0c add $0xc,%esp 80102c62: 68 00 02 00 00 push $0x200 80102c67: 50 push %eax 80102c68: 8d 46 5c lea 0x5c(%esi),%eax 80102c6b: 50 push %eax 80102c6c: e8 ef 18 00 00 call 80104560 <memmove> bwrite(to); // write the log 80102c71: 89 34 24 mov %esi,(%esp) 80102c74: e8 27 d5 ff ff call 801001a0 <bwrite> brelse(from); 80102c79: 89 3c 24 mov %edi,(%esp) 80102c7c: e8 5f d5 ff ff call 801001e0 <brelse> brelse(to); 80102c81: 89 34 24 mov %esi,(%esp) 80102c84: e8 57 d5 ff ff call 801001e0 <brelse> static void write_log(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102c89: 83 c4 10 add $0x10,%esp 80102c8c: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx 80102c92: 7c 94 jl 80102c28 <end_op+0x68> static void commit() { if (log.lh.n > 0) { write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102c94: e8 b7 fd ff ff call 80102a50 <write_head> install_trans(); // Now install writes to home locations 80102c99: e8 12 fd ff ff call 801029b0 <install_trans> log.lh.n = 0; 80102c9e: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102ca5: 00 00 00 write_head(); // Erase the transaction from the log 80102ca8: e8 a3 fd ff ff call 80102a50 <write_head> if(do_commit){ // call commit w/o holding locks, since not allowed // to sleep with locks. commit(); acquire(&log.lock); 80102cad: 83 ec 0c sub $0xc,%esp 80102cb0: 68 80 26 11 80 push $0x80112680 80102cb5: e8 86 16 00 00 call 80104340 <acquire> log.committing = 0; wakeup(&log); 80102cba: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) if(do_commit){ // call commit w/o holding locks, since not allowed // to sleep with locks. commit(); acquire(&log.lock); log.committing = 0; 80102cc1: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0 80102cc8: 00 00 00 wakeup(&log); 80102ccb: e8 10 12 00 00 call 80103ee0 <wakeup> release(&log.lock); 80102cd0: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102cd7: e8 84 17 00 00 call 80104460 <release> 80102cdc: 83 c4 10 add $0x10,%esp } } 80102cdf: 8d 65 f4 lea -0xc(%ebp),%esp 80102ce2: 5b pop %ebx 80102ce3: 5e pop %esi 80102ce4: 5f pop %edi 80102ce5: 5d pop %ebp 80102ce6: c3 ret 80102ce7: 89 f6 mov %esi,%esi 80102ce9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi log.committing = 1; } else { // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); 80102cf0: 83 ec 0c sub $0xc,%esp 80102cf3: 68 80 26 11 80 push $0x80112680 80102cf8: e8 e3 11 00 00 call 80103ee0 <wakeup> } release(&log.lock); 80102cfd: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102d04: e8 57 17 00 00 call 80104460 <release> 80102d09: 83 c4 10 add $0x10,%esp acquire(&log.lock); log.committing = 0; wakeup(&log); release(&log.lock); } } 80102d0c: 8d 65 f4 lea -0xc(%ebp),%esp 80102d0f: 5b pop %ebx 80102d10: 5e pop %esi 80102d11: 5f pop %edi 80102d12: 5d pop %ebp 80102d13: c3 ret int do_commit = 0; acquire(&log.lock); log.outstanding -= 1; if(log.committing) panic("log.committing"); 80102d14: 83 ec 0c sub $0xc,%esp 80102d17: 68 04 74 10 80 push $0x80107404 80102d1c: e8 4f d6 ff ff call 80100370 <panic> 80102d21: eb 0d jmp 80102d30 <log_write> 80102d23: 90 nop 80102d24: 90 nop 80102d25: 90 nop 80102d26: 90 nop 80102d27: 90 nop 80102d28: 90 nop 80102d29: 90 nop 80102d2a: 90 nop 80102d2b: 90 nop 80102d2c: 90 nop 80102d2d: 90 nop 80102d2e: 90 nop 80102d2f: 90 nop 80102d30 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102d30: 55 push %ebp 80102d31: 89 e5 mov %esp,%ebp 80102d33: 53 push %ebx 80102d34: 83 ec 04 sub $0x4,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d37: 8b 15 c8 26 11 80 mov 0x801126c8,%edx // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102d3d: 8b 5d 08 mov 0x8(%ebp),%ebx int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d40: 83 fa 1d cmp $0x1d,%edx 80102d43: 0f 8f 97 00 00 00 jg 80102de0 <log_write+0xb0> 80102d49: a1 b8 26 11 80 mov 0x801126b8,%eax 80102d4e: 83 e8 01 sub $0x1,%eax 80102d51: 39 c2 cmp %eax,%edx 80102d53: 0f 8d 87 00 00 00 jge 80102de0 <log_write+0xb0> panic("too big a transaction"); if (log.outstanding < 1) 80102d59: a1 bc 26 11 80 mov 0x801126bc,%eax 80102d5e: 85 c0 test %eax,%eax 80102d60: 0f 8e 87 00 00 00 jle 80102ded <log_write+0xbd> panic("log_write outside of trans"); acquire(&log.lock); 80102d66: 83 ec 0c sub $0xc,%esp 80102d69: 68 80 26 11 80 push $0x80112680 80102d6e: e8 cd 15 00 00 call 80104340 <acquire> for (i = 0; i < log.lh.n; i++) { 80102d73: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102d79: 83 c4 10 add $0x10,%esp 80102d7c: 83 fa 00 cmp $0x0,%edx 80102d7f: 7e 50 jle 80102dd1 <log_write+0xa1> if (log.lh.block[i] == b->blockno) // log absorbtion 80102d81: 8b 4b 08 mov 0x8(%ebx),%ecx panic("too big a transaction"); if (log.outstanding < 1) panic("log_write outside of trans"); acquire(&log.lock); for (i = 0; i < log.lh.n; i++) { 80102d84: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102d86: 3b 0d cc 26 11 80 cmp 0x801126cc,%ecx 80102d8c: 75 0b jne 80102d99 <log_write+0x69> 80102d8e: eb 38 jmp 80102dc8 <log_write+0x98> 80102d90: 39 0c 85 cc 26 11 80 cmp %ecx,-0x7feed934(,%eax,4) 80102d97: 74 2f je 80102dc8 <log_write+0x98> panic("too big a transaction"); if (log.outstanding < 1) panic("log_write outside of trans"); acquire(&log.lock); for (i = 0; i < log.lh.n; i++) { 80102d99: 83 c0 01 add $0x1,%eax 80102d9c: 39 d0 cmp %edx,%eax 80102d9e: 75 f0 jne 80102d90 <log_write+0x60> if (log.lh.block[i] == b->blockno) // log absorbtion break; } log.lh.block[i] = b->blockno; 80102da0: 89 0c 95 cc 26 11 80 mov %ecx,-0x7feed934(,%edx,4) if (i == log.lh.n) log.lh.n++; 80102da7: 83 c2 01 add $0x1,%edx 80102daa: 89 15 c8 26 11 80 mov %edx,0x801126c8 b->flags |= B_DIRTY; // prevent eviction 80102db0: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102db3: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp) } 80102dba: 8b 5d fc mov -0x4(%ebp),%ebx 80102dbd: c9 leave } log.lh.block[i] = b->blockno; if (i == log.lh.n) log.lh.n++; b->flags |= B_DIRTY; // prevent eviction release(&log.lock); 80102dbe: e9 9d 16 00 00 jmp 80104460 <release> 80102dc3: 90 nop 80102dc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi acquire(&log.lock); for (i = 0; i < log.lh.n; i++) { if (log.lh.block[i] == b->blockno) // log absorbtion break; } log.lh.block[i] = b->blockno; 80102dc8: 89 0c 85 cc 26 11 80 mov %ecx,-0x7feed934(,%eax,4) 80102dcf: eb df jmp 80102db0 <log_write+0x80> 80102dd1: 8b 43 08 mov 0x8(%ebx),%eax 80102dd4: a3 cc 26 11 80 mov %eax,0x801126cc if (i == log.lh.n) 80102dd9: 75 d5 jne 80102db0 <log_write+0x80> 80102ddb: eb ca jmp 80102da7 <log_write+0x77> 80102ddd: 8d 76 00 lea 0x0(%esi),%esi log_write(struct buf *b) { int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) panic("too big a transaction"); 80102de0: 83 ec 0c sub $0xc,%esp 80102de3: 68 13 74 10 80 push $0x80107413 80102de8: e8 83 d5 ff ff call 80100370 <panic> if (log.outstanding < 1) panic("log_write outside of trans"); 80102ded: 83 ec 0c sub $0xc,%esp 80102df0: 68 29 74 10 80 push $0x80107429 80102df5: e8 76 d5 ff ff call 80100370 <panic> 80102dfa: 66 90 xchg %ax,%ax 80102dfc: 66 90 xchg %ax,%ax 80102dfe: 66 90 xchg %ax,%ax 80102e00 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102e00: 55 push %ebp 80102e01: 89 e5 mov %esp,%ebp 80102e03: 53 push %ebx 80102e04: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102e07: e8 54 09 00 00 call 80103760 <cpuid> 80102e0c: 89 c3 mov %eax,%ebx 80102e0e: e8 4d 09 00 00 call 80103760 <cpuid> 80102e13: 83 ec 04 sub $0x4,%esp 80102e16: 53 push %ebx 80102e17: 50 push %eax 80102e18: 68 44 74 10 80 push $0x80107444 80102e1d: e8 3e d8 ff ff call 80100660 <cprintf> idtinit(); // load idt register 80102e22: e8 59 29 00 00 call 80105780 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102e27: e8 b4 08 00 00 call 801036e0 <mycpu> 80102e2c: 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" : 80102e2e: b8 01 00 00 00 mov $0x1,%eax 80102e33: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102e3a: e8 01 0c 00 00 call 80103a40 <scheduler> 80102e3f: 90 nop 80102e40 <mpenter>: } // Other CPUs jump here from entryother.S. static void mpenter(void) { 80102e40: 55 push %ebp 80102e41: 89 e5 mov %esp,%ebp 80102e43: 83 ec 08 sub $0x8,%esp switchkvm(); 80102e46: e8 55 3a 00 00 call 801068a0 <switchkvm> seginit(); 80102e4b: e8 50 39 00 00 call 801067a0 <seginit> lapicinit(); 80102e50: e8 9b f7 ff ff call 801025f0 <lapicinit> mpmain(); 80102e55: e8 a6 ff ff ff call 80102e00 <mpmain> 80102e5a: 66 90 xchg %ax,%ax 80102e5c: 66 90 xchg %ax,%ax 80102e5e: 66 90 xchg %ax,%ax 80102e60 <main>: // Bootstrap processor starts running C code here. // Allocate a real stack and switch to it, first // doing some setup required for memory allocator to work. int main(void) { 80102e60: 8d 4c 24 04 lea 0x4(%esp),%ecx 80102e64: 83 e4 f0 and $0xfffffff0,%esp 80102e67: ff 71 fc pushl -0x4(%ecx) 80102e6a: 55 push %ebp 80102e6b: 89 e5 mov %esp,%ebp 80102e6d: 53 push %ebx 80102e6e: 51 push %ecx // 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); for(c = cpus; c < cpus+ncpu; c++){ 80102e6f: bb 80 27 11 80 mov $0x80112780,%ebx // Allocate a real stack and switch to it, first // doing some setup required for memory allocator to work. int main(void) { kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102e74: 83 ec 08 sub $0x8,%esp 80102e77: 68 00 00 40 80 push $0x80400000 80102e7c: 68 a8 54 11 80 push $0x801154a8 80102e81: e8 3a f5 ff ff call 801023c0 <kinit1> kvmalloc(); // kernel page table 80102e86: e8 b5 3e 00 00 call 80106d40 <kvmalloc> mpinit(); // detect other processors 80102e8b: e8 70 01 00 00 call 80103000 <mpinit> lapicinit(); // interrupt controller 80102e90: e8 5b f7 ff ff call 801025f0 <lapicinit> seginit(); // segment descriptors 80102e95: e8 06 39 00 00 call 801067a0 <seginit> picinit(); // disable pic 80102e9a: e8 31 03 00 00 call 801031d0 <picinit> ioapicinit(); // another interrupt controller 80102e9f: e8 4c f3 ff ff call 801021f0 <ioapicinit> consoleinit(); // console hardware 80102ea4: e8 f7 da ff ff call 801009a0 <consoleinit> uartinit(); // serial port 80102ea9: e8 c2 2b 00 00 call 80105a70 <uartinit> pinit(); // process table 80102eae: e8 0d 08 00 00 call 801036c0 <pinit> tvinit(); // trap vectors 80102eb3: e8 28 28 00 00 call 801056e0 <tvinit> binit(); // buffer cache 80102eb8: e8 83 d1 ff ff call 80100040 <binit> fileinit(); // file table 80102ebd: e8 8e de ff ff call 80100d50 <fileinit> ideinit(); // disk 80102ec2: e8 09 f1 ff ff call 80101fd0 <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); 80102ec7: 83 c4 0c add $0xc,%esp 80102eca: 68 8a 00 00 00 push $0x8a 80102ecf: 68 8c a4 10 80 push $0x8010a48c 80102ed4: 68 00 70 00 80 push $0x80007000 80102ed9: e8 82 16 00 00 call 80104560 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80102ede: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102ee5: 00 00 00 80102ee8: 83 c4 10 add $0x10,%esp 80102eeb: 05 80 27 11 80 add $0x80112780,%eax 80102ef0: 39 d8 cmp %ebx,%eax 80102ef2: 76 6f jbe 80102f63 <main+0x103> 80102ef4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(c == mycpu()) // We've started already. 80102ef8: e8 e3 07 00 00 call 801036e0 <mycpu> 80102efd: 39 d8 cmp %ebx,%eax 80102eff: 74 49 je 80102f4a <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(); 80102f01: e8 8a f5 ff ff call 80102490 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; 80102f06: 05 00 10 00 00 add $0x1000,%eax *(void**)(code-8) = mpenter; 80102f0b: c7 05 f8 6f 00 80 40 movl $0x80102e40,0x80006ff8 80102f12: 2e 10 80 *(int**)(code-12) = (void *) V2P(entrypgdir); 80102f15: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4 80102f1c: 90 10 00 // 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(); *(void**)(code-4) = stack + KSTACKSIZE; 80102f1f: a3 fc 6f 00 80 mov %eax,0x80006ffc *(void**)(code-8) = mpenter; *(int**)(code-12) = (void *) V2P(entrypgdir); lapicstartap(c->apicid, V2P(code)); 80102f24: 0f b6 03 movzbl (%ebx),%eax 80102f27: 83 ec 08 sub $0x8,%esp 80102f2a: 68 00 70 00 00 push $0x7000 80102f2f: 50 push %eax 80102f30: e8 0b f8 ff ff call 80102740 <lapicstartap> 80102f35: 83 c4 10 add $0x10,%esp 80102f38: 90 nop 80102f39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi // wait for cpu to finish mpmain() while(c->started == 0) 80102f40: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80102f46: 85 c0 test %eax,%eax 80102f48: 74 f6 je 80102f40 <main+0xe0> // 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); for(c = cpus; c < cpus+ncpu; c++){ 80102f4a: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102f51: 00 00 00 80102f54: 81 c3 b0 00 00 00 add $0xb0,%ebx 80102f5a: 05 80 27 11 80 add $0x80112780,%eax 80102f5f: 39 c3 cmp %eax,%ebx 80102f61: 72 95 jb 80102ef8 <main+0x98> tvinit(); // trap vectors binit(); // buffer cache fileinit(); // file table ideinit(); // disk startothers(); // start other processors kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 80102f63: 83 ec 08 sub $0x8,%esp 80102f66: 68 00 00 00 8e push $0x8e000000 80102f6b: 68 00 00 40 80 push $0x80400000 80102f70: e8 bb f4 ff ff call 80102430 <kinit2> userinit(); // first user process 80102f75: e8 36 08 00 00 call 801037b0 <userinit> mpmain(); // finish this processor's setup 80102f7a: e8 81 fe ff ff call 80102e00 <mpmain> 80102f7f: 90 nop 80102f80 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102f80: 55 push %ebp 80102f81: 89 e5 mov %esp,%ebp 80102f83: 57 push %edi 80102f84: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80102f85: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102f8b: 53 push %ebx uchar *e, *p, *addr; addr = P2V(a); e = addr+len; 80102f8c: 8d 1c 16 lea (%esi,%edx,1),%ebx } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102f8f: 83 ec 0c sub $0xc,%esp uchar *e, *p, *addr; addr = P2V(a); e = addr+len; for(p = addr; p < e; p += sizeof(struct mp)) 80102f92: 39 de cmp %ebx,%esi 80102f94: 73 48 jae 80102fde <mpsearch1+0x5e> 80102f96: 8d 76 00 lea 0x0(%esi),%esi 80102f99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102fa0: 83 ec 04 sub $0x4,%esp 80102fa3: 8d 7e 10 lea 0x10(%esi),%edi 80102fa6: 6a 04 push $0x4 80102fa8: 68 58 74 10 80 push $0x80107458 80102fad: 56 push %esi 80102fae: e8 4d 15 00 00 call 80104500 <memcmp> 80102fb3: 83 c4 10 add $0x10,%esp 80102fb6: 85 c0 test %eax,%eax 80102fb8: 75 1e jne 80102fd8 <mpsearch1+0x58> 80102fba: 8d 7e 10 lea 0x10(%esi),%edi 80102fbd: 89 f2 mov %esi,%edx 80102fbf: 31 c9 xor %ecx,%ecx 80102fc1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi { int i, sum; sum = 0; for(i=0; i<len; i++) sum += addr[i]; 80102fc8: 0f b6 02 movzbl (%edx),%eax 80102fcb: 83 c2 01 add $0x1,%edx 80102fce: 01 c1 add %eax,%ecx sum(uchar *addr, int len) { int i, sum; sum = 0; for(i=0; i<len; i++) 80102fd0: 39 fa cmp %edi,%edx 80102fd2: 75 f4 jne 80102fc8 <mpsearch1+0x48> uchar *e, *p, *addr; addr = P2V(a); e = addr+len; for(p = addr; p < e; p += sizeof(struct mp)) if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102fd4: 84 c9 test %cl,%cl 80102fd6: 74 10 je 80102fe8 <mpsearch1+0x68> { uchar *e, *p, *addr; addr = P2V(a); e = addr+len; for(p = addr; p < e; p += sizeof(struct mp)) 80102fd8: 39 fb cmp %edi,%ebx 80102fda: 89 fe mov %edi,%esi 80102fdc: 77 c2 ja 80102fa0 <mpsearch1+0x20> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) return (struct mp*)p; return 0; } 80102fde: 8d 65 f4 lea -0xc(%ebp),%esp addr = P2V(a); e = addr+len; for(p = addr; p < e; p += sizeof(struct mp)) if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) return (struct mp*)p; return 0; 80102fe1: 31 c0 xor %eax,%eax } 80102fe3: 5b pop %ebx 80102fe4: 5e pop %esi 80102fe5: 5f pop %edi 80102fe6: 5d pop %ebp 80102fe7: c3 ret 80102fe8: 8d 65 f4 lea -0xc(%ebp),%esp 80102feb: 89 f0 mov %esi,%eax 80102fed: 5b pop %ebx 80102fee: 5e pop %esi 80102fef: 5f pop %edi 80102ff0: 5d pop %ebp 80102ff1: c3 ret 80102ff2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102ff9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103000 <mpinit>: return conf; } void mpinit(void) { 80103000: 55 push %ebp 80103001: 89 e5 mov %esp,%ebp 80103003: 57 push %edi 80103004: 56 push %esi 80103005: 53 push %ebx 80103006: 83 ec 1c sub $0x1c,%esp uchar *bda; uint p; struct mp *mp; bda = (uchar *) P2V(0x400); if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 80103009: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80103010: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80103017: c1 e0 08 shl $0x8,%eax 8010301a: 09 d0 or %edx,%eax 8010301c: c1 e0 04 shl $0x4,%eax 8010301f: 85 c0 test %eax,%eax 80103021: 75 1b jne 8010303e <mpinit+0x3e> if((mp = mpsearch1(p, 1024))) return mp; } else { p = ((bda[0x14]<<8)|bda[0x13])*1024; if((mp = mpsearch1(p-1024, 1024))) 80103023: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 8010302a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80103031: c1 e0 08 shl $0x8,%eax 80103034: 09 d0 or %edx,%eax 80103036: c1 e0 0a shl $0xa,%eax 80103039: 2d 00 04 00 00 sub $0x400,%eax uint p; struct mp *mp; bda = (uchar *) P2V(0x400); if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ if((mp = mpsearch1(p, 1024))) 8010303e: ba 00 04 00 00 mov $0x400,%edx 80103043: e8 38 ff ff ff call 80102f80 <mpsearch1> 80103048: 85 c0 test %eax,%eax 8010304a: 89 45 e4 mov %eax,-0x1c(%ebp) 8010304d: 0f 84 37 01 00 00 je 8010318a <mpinit+0x18a> mpconfig(struct mp **pmp) { struct mpconf *conf; struct mp *mp; if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103053: 8b 45 e4 mov -0x1c(%ebp),%eax 80103056: 8b 58 04 mov 0x4(%eax),%ebx 80103059: 85 db test %ebx,%ebx 8010305b: 0f 84 43 01 00 00 je 801031a4 <mpinit+0x1a4> return 0; conf = (struct mpconf*) P2V((uint) mp->physaddr); 80103061: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if(memcmp(conf, "PCMP", 4) != 0) 80103067: 83 ec 04 sub $0x4,%esp 8010306a: 6a 04 push $0x4 8010306c: 68 5d 74 10 80 push $0x8010745d 80103071: 56 push %esi 80103072: e8 89 14 00 00 call 80104500 <memcmp> 80103077: 83 c4 10 add $0x10,%esp 8010307a: 85 c0 test %eax,%eax 8010307c: 0f 85 22 01 00 00 jne 801031a4 <mpinit+0x1a4> return 0; if(conf->version != 1 && conf->version != 4) 80103082: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 80103089: 3c 01 cmp $0x1,%al 8010308b: 74 08 je 80103095 <mpinit+0x95> 8010308d: 3c 04 cmp $0x4,%al 8010308f: 0f 85 0f 01 00 00 jne 801031a4 <mpinit+0x1a4> return 0; if(sum((uchar*)conf, conf->length) != 0) 80103095: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi sum(uchar *addr, int len) { int i, sum; sum = 0; for(i=0; i<len; i++) 8010309c: 85 ff test %edi,%edi 8010309e: 74 21 je 801030c1 <mpinit+0xc1> 801030a0: 31 d2 xor %edx,%edx 801030a2: 31 c0 xor %eax,%eax 801030a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi sum += addr[i]; 801030a8: 0f b6 8c 03 00 00 00 movzbl -0x80000000(%ebx,%eax,1),%ecx 801030af: 80 sum(uchar *addr, int len) { int i, sum; sum = 0; for(i=0; i<len; i++) 801030b0: 83 c0 01 add $0x1,%eax sum += addr[i]; 801030b3: 01 ca add %ecx,%edx sum(uchar *addr, int len) { int i, sum; sum = 0; for(i=0; i<len; i++) 801030b5: 39 c7 cmp %eax,%edi 801030b7: 75 ef jne 801030a8 <mpinit+0xa8> conf = (struct mpconf*) P2V((uint) mp->physaddr); if(memcmp(conf, "PCMP", 4) != 0) return 0; if(conf->version != 1 && conf->version != 4) return 0; if(sum((uchar*)conf, conf->length) != 0) 801030b9: 84 d2 test %dl,%dl 801030bb: 0f 85 e3 00 00 00 jne 801031a4 <mpinit+0x1a4> struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 801030c1: 85 f6 test %esi,%esi 801030c3: 0f 84 db 00 00 00 je 801031a4 <mpinit+0x1a4> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 801030c9: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax 801030cf: a3 7c 26 11 80 mov %eax,0x8011267c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 801030d4: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx 801030db: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) panic("Expect to run on an SMP"); ismp = 1; 801030e1: bb 01 00 00 00 mov $0x1,%ebx lapic = (uint*)conf->lapicaddr; for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 801030e6: 01 d6 add %edx,%esi 801030e8: 90 nop 801030e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801030f0: 39 c6 cmp %eax,%esi 801030f2: 76 23 jbe 80103117 <mpinit+0x117> 801030f4: 0f b6 10 movzbl (%eax),%edx switch(*p){ 801030f7: 80 fa 04 cmp $0x4,%dl 801030fa: 0f 87 c0 00 00 00 ja 801031c0 <mpinit+0x1c0> 80103100: ff 24 95 9c 74 10 80 jmp *-0x7fef8b64(,%edx,4) 80103107: 89 f6 mov %esi,%esi 80103109: 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; 80103110: 83 c0 08 add $0x8,%eax if((conf = mpconfig(&mp)) == 0) panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 80103113: 39 c6 cmp %eax,%esi 80103115: 77 dd ja 801030f4 <mpinit+0xf4> default: ismp = 0; break; } } if(!ismp) 80103117: 85 db test %ebx,%ebx 80103119: 0f 84 92 00 00 00 je 801031b1 <mpinit+0x1b1> panic("Didn't find a suitable machine"); if(mp->imcrp){ 8010311f: 8b 45 e4 mov -0x1c(%ebp),%eax 80103122: 80 78 0c 00 cmpb $0x0,0xc(%eax) 80103126: 74 15 je 8010313d <mpinit+0x13d> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103128: ba 22 00 00 00 mov $0x22,%edx 8010312d: b8 70 00 00 00 mov $0x70,%eax 80103132: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80103133: ba 23 00 00 00 mov $0x23,%edx 80103138: ec in (%dx),%al } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103139: 83 c8 01 or $0x1,%eax 8010313c: ee out %al,(%dx) // 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. } } 8010313d: 8d 65 f4 lea -0xc(%ebp),%esp 80103140: 5b pop %ebx 80103141: 5e pop %esi 80103142: 5f pop %edi 80103143: 5d pop %ebp 80103144: c3 ret 80103145: 8d 76 00 lea 0x0(%esi),%esi lapic = (uint*)conf->lapicaddr; for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ switch(*p){ case MPPROC: proc = (struct mpproc*)p; if(ncpu < NCPU) { 80103148: 8b 0d 00 2d 11 80 mov 0x80112d00,%ecx 8010314e: 83 f9 07 cmp $0x7,%ecx 80103151: 7f 19 jg 8010316c <mpinit+0x16c> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103153: 0f b6 50 01 movzbl 0x1(%eax),%edx 80103157: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi ncpu++; 8010315d: 83 c1 01 add $0x1,%ecx 80103160: 89 0d 00 2d 11 80 mov %ecx,0x80112d00 for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ switch(*p){ case MPPROC: proc = (struct mpproc*)p; if(ncpu < NCPU) { cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103166: 88 97 80 27 11 80 mov %dl,-0x7feed880(%edi) ncpu++; } p += sizeof(struct mpproc); 8010316c: 83 c0 14 add $0x14,%eax continue; 8010316f: e9 7c ff ff ff jmp 801030f0 <mpinit+0xf0> 80103174: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi case MPIOAPIC: ioapic = (struct mpioapic*)p; ioapicid = ioapic->apicno; 80103178: 0f b6 50 01 movzbl 0x1(%eax),%edx p += sizeof(struct mpioapic); 8010317c: 83 c0 08 add $0x8,%eax } p += sizeof(struct mpproc); continue; case MPIOAPIC: ioapic = (struct mpioapic*)p; ioapicid = ioapic->apicno; 8010317f: 88 15 60 27 11 80 mov %dl,0x80112760 p += sizeof(struct mpioapic); continue; 80103185: e9 66 ff ff ff jmp 801030f0 <mpinit+0xf0> } else { p = ((bda[0x14]<<8)|bda[0x13])*1024; if((mp = mpsearch1(p-1024, 1024))) return mp; } return mpsearch1(0xF0000, 0x10000); 8010318a: ba 00 00 01 00 mov $0x10000,%edx 8010318f: b8 00 00 0f 00 mov $0xf0000,%eax 80103194: e8 e7 fd ff ff call 80102f80 <mpsearch1> mpconfig(struct mp **pmp) { struct mpconf *conf; struct mp *mp; if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103199: 85 c0 test %eax,%eax } else { p = ((bda[0x14]<<8)|bda[0x13])*1024; if((mp = mpsearch1(p-1024, 1024))) return mp; } return mpsearch1(0xF0000, 0x10000); 8010319b: 89 45 e4 mov %eax,-0x1c(%ebp) mpconfig(struct mp **pmp) { struct mpconf *conf; struct mp *mp; if((mp = mpsearch()) == 0 || mp->physaddr == 0) 8010319e: 0f 85 af fe ff ff jne 80103053 <mpinit+0x53> struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) panic("Expect to run on an SMP"); 801031a4: 83 ec 0c sub $0xc,%esp 801031a7: 68 62 74 10 80 push $0x80107462 801031ac: e8 bf d1 ff ff call 80100370 <panic> ismp = 0; break; } } if(!ismp) panic("Didn't find a suitable machine"); 801031b1: 83 ec 0c sub $0xc,%esp 801031b4: 68 7c 74 10 80 push $0x8010747c 801031b9: e8 b2 d1 ff ff call 80100370 <panic> 801031be: 66 90 xchg %ax,%ax case MPIOINTR: case MPLINTR: p += 8; continue; default: ismp = 0; 801031c0: 31 db xor %ebx,%ebx 801031c2: e9 30 ff ff ff jmp 801030f7 <mpinit+0xf7> 801031c7: 66 90 xchg %ax,%ax 801031c9: 66 90 xchg %ax,%ax 801031cb: 66 90 xchg %ax,%ax 801031cd: 66 90 xchg %ax,%ax 801031cf: 90 nop 801031d0 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 801031d0: 55 push %ebp 801031d1: ba 21 00 00 00 mov $0x21,%edx 801031d6: b8 ff ff ff ff mov $0xffffffff,%eax 801031db: 89 e5 mov %esp,%ebp 801031dd: ee out %al,(%dx) 801031de: ba a1 00 00 00 mov $0xa1,%edx 801031e3: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 801031e4: 5d pop %ebp 801031e5: c3 ret 801031e6: 66 90 xchg %ax,%ax 801031e8: 66 90 xchg %ax,%ax 801031ea: 66 90 xchg %ax,%ax 801031ec: 66 90 xchg %ax,%ax 801031ee: 66 90 xchg %ax,%ax 801031f0 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 801031f0: 55 push %ebp 801031f1: 89 e5 mov %esp,%ebp 801031f3: 57 push %edi 801031f4: 56 push %esi 801031f5: 53 push %ebx 801031f6: 83 ec 0c sub $0xc,%esp 801031f9: 8b 75 08 mov 0x8(%ebp),%esi 801031fc: 8b 5d 0c mov 0xc(%ebp),%ebx struct pipe *p; p = 0; *f0 = *f1 = 0; 801031ff: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103205: c7 06 00 00 00 00 movl $0x0,(%esi) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 8010320b: e8 60 db ff ff call 80100d70 <filealloc> 80103210: 85 c0 test %eax,%eax 80103212: 89 06 mov %eax,(%esi) 80103214: 0f 84 a8 00 00 00 je 801032c2 <pipealloc+0xd2> 8010321a: e8 51 db ff ff call 80100d70 <filealloc> 8010321f: 85 c0 test %eax,%eax 80103221: 89 03 mov %eax,(%ebx) 80103223: 0f 84 87 00 00 00 je 801032b0 <pipealloc+0xc0> goto bad; if((p = (struct pipe*)kalloc()) == 0) 80103229: e8 62 f2 ff ff call 80102490 <kalloc> 8010322e: 85 c0 test %eax,%eax 80103230: 89 c7 mov %eax,%edi 80103232: 0f 84 b0 00 00 00 je 801032e8 <pipealloc+0xf8> goto bad; p->readopen = 1; p->writeopen = 1; p->nwrite = 0; p->nread = 0; initlock(&p->lock, "pipe"); 80103238: 83 ec 08 sub $0x8,%esp *f0 = *f1 = 0; if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) goto bad; if((p = (struct pipe*)kalloc()) == 0) goto bad; p->readopen = 1; 8010323b: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 80103242: 00 00 00 p->writeopen = 1; 80103245: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 8010324c: 00 00 00 p->nwrite = 0; 8010324f: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 80103256: 00 00 00 p->nread = 0; 80103259: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 80103260: 00 00 00 initlock(&p->lock, "pipe"); 80103263: 68 b0 74 10 80 push $0x801074b0 80103268: 50 push %eax 80103269: e8 d2 0f 00 00 call 80104240 <initlock> (*f0)->type = FD_PIPE; 8010326e: 8b 06 mov (%esi),%eax (*f0)->pipe = p; (*f1)->type = FD_PIPE; (*f1)->readable = 0; (*f1)->writable = 1; (*f1)->pipe = p; return 0; 80103270: 83 c4 10 add $0x10,%esp p->readopen = 1; p->writeopen = 1; p->nwrite = 0; p->nread = 0; initlock(&p->lock, "pipe"); (*f0)->type = FD_PIPE; 80103273: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 80103279: 8b 06 mov (%esi),%eax 8010327b: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 8010327f: 8b 06 mov (%esi),%eax 80103281: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 80103285: 8b 06 mov (%esi),%eax 80103287: 89 78 0c mov %edi,0xc(%eax) (*f1)->type = FD_PIPE; 8010328a: 8b 03 mov (%ebx),%eax 8010328c: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 80103292: 8b 03 mov (%ebx),%eax 80103294: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103298: 8b 03 mov (%ebx),%eax 8010329a: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 8010329e: 8b 03 mov (%ebx),%eax 801032a0: 89 78 0c mov %edi,0xc(%eax) if(*f0) fileclose(*f0); if(*f1) fileclose(*f1); return -1; } 801032a3: 8d 65 f4 lea -0xc(%ebp),%esp (*f0)->pipe = p; (*f1)->type = FD_PIPE; (*f1)->readable = 0; (*f1)->writable = 1; (*f1)->pipe = p; return 0; 801032a6: 31 c0 xor %eax,%eax if(*f0) fileclose(*f0); if(*f1) fileclose(*f1); return -1; } 801032a8: 5b pop %ebx 801032a9: 5e pop %esi 801032aa: 5f pop %edi 801032ab: 5d pop %ebp 801032ac: c3 ret 801032ad: 8d 76 00 lea 0x0(%esi),%esi return 0; bad: if(p) kfree((char*)p); if(*f0) 801032b0: 8b 06 mov (%esi),%eax 801032b2: 85 c0 test %eax,%eax 801032b4: 74 1e je 801032d4 <pipealloc+0xe4> fileclose(*f0); 801032b6: 83 ec 0c sub $0xc,%esp 801032b9: 50 push %eax 801032ba: e8 71 db ff ff call 80100e30 <fileclose> 801032bf: 83 c4 10 add $0x10,%esp if(*f1) 801032c2: 8b 03 mov (%ebx),%eax 801032c4: 85 c0 test %eax,%eax 801032c6: 74 0c je 801032d4 <pipealloc+0xe4> fileclose(*f1); 801032c8: 83 ec 0c sub $0xc,%esp 801032cb: 50 push %eax 801032cc: e8 5f db ff ff call 80100e30 <fileclose> 801032d1: 83 c4 10 add $0x10,%esp return -1; } 801032d4: 8d 65 f4 lea -0xc(%ebp),%esp kfree((char*)p); if(*f0) fileclose(*f0); if(*f1) fileclose(*f1); return -1; 801032d7: b8 ff ff ff ff mov $0xffffffff,%eax } 801032dc: 5b pop %ebx 801032dd: 5e pop %esi 801032de: 5f pop %edi 801032df: 5d pop %ebp 801032e0: c3 ret 801032e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; bad: if(p) kfree((char*)p); if(*f0) 801032e8: 8b 06 mov (%esi),%eax 801032ea: 85 c0 test %eax,%eax 801032ec: 75 c8 jne 801032b6 <pipealloc+0xc6> 801032ee: eb d2 jmp 801032c2 <pipealloc+0xd2> 801032f0 <pipeclose>: return -1; } void pipeclose(struct pipe *p, int writable) { 801032f0: 55 push %ebp 801032f1: 89 e5 mov %esp,%ebp 801032f3: 56 push %esi 801032f4: 53 push %ebx 801032f5: 8b 5d 08 mov 0x8(%ebp),%ebx 801032f8: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 801032fb: 83 ec 0c sub $0xc,%esp 801032fe: 53 push %ebx 801032ff: e8 3c 10 00 00 call 80104340 <acquire> if(writable){ 80103304: 83 c4 10 add $0x10,%esp 80103307: 85 f6 test %esi,%esi 80103309: 74 45 je 80103350 <pipeclose+0x60> p->writeopen = 0; wakeup(&p->nread); 8010330b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103311: 83 ec 0c sub $0xc,%esp void pipeclose(struct pipe *p, int writable) { acquire(&p->lock); if(writable){ p->writeopen = 0; 80103314: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 8010331b: 00 00 00 wakeup(&p->nread); 8010331e: 50 push %eax 8010331f: e8 bc 0b 00 00 call 80103ee0 <wakeup> 80103324: 83 c4 10 add $0x10,%esp } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 80103327: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 8010332d: 85 d2 test %edx,%edx 8010332f: 75 0a jne 8010333b <pipeclose+0x4b> 80103331: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 80103337: 85 c0 test %eax,%eax 80103339: 74 35 je 80103370 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else release(&p->lock); 8010333b: 89 5d 08 mov %ebx,0x8(%ebp) } 8010333e: 8d 65 f8 lea -0x8(%ebp),%esp 80103341: 5b pop %ebx 80103342: 5e pop %esi 80103343: 5d pop %ebp } if(p->readopen == 0 && p->writeopen == 0){ release(&p->lock); kfree((char*)p); } else release(&p->lock); 80103344: e9 17 11 00 00 jmp 80104460 <release> 80103349: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(writable){ p->writeopen = 0; wakeup(&p->nread); } else { p->readopen = 0; wakeup(&p->nwrite); 80103350: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 80103356: 83 ec 0c sub $0xc,%esp acquire(&p->lock); if(writable){ p->writeopen = 0; wakeup(&p->nread); } else { p->readopen = 0; 80103359: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 80103360: 00 00 00 wakeup(&p->nwrite); 80103363: 50 push %eax 80103364: e8 77 0b 00 00 call 80103ee0 <wakeup> 80103369: 83 c4 10 add $0x10,%esp 8010336c: eb b9 jmp 80103327 <pipeclose+0x37> 8010336e: 66 90 xchg %ax,%ax } if(p->readopen == 0 && p->writeopen == 0){ release(&p->lock); 80103370: 83 ec 0c sub $0xc,%esp 80103373: 53 push %ebx 80103374: e8 e7 10 00 00 call 80104460 <release> kfree((char*)p); 80103379: 89 5d 08 mov %ebx,0x8(%ebp) 8010337c: 83 c4 10 add $0x10,%esp } else release(&p->lock); } 8010337f: 8d 65 f8 lea -0x8(%ebp),%esp 80103382: 5b pop %ebx 80103383: 5e pop %esi 80103384: 5d pop %ebp p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ release(&p->lock); kfree((char*)p); 80103385: e9 56 ef ff ff jmp 801022e0 <kfree> 8010338a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103390 <pipewrite>: release(&p->lock); } int pipewrite(struct pipe *p, char *addr, int n) { 80103390: 55 push %ebp 80103391: 89 e5 mov %esp,%ebp 80103393: 57 push %edi 80103394: 56 push %esi 80103395: 53 push %ebx 80103396: 83 ec 28 sub $0x28,%esp 80103399: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 8010339c: 53 push %ebx 8010339d: e8 9e 0f 00 00 call 80104340 <acquire> for(i = 0; i < n; i++){ 801033a2: 8b 45 10 mov 0x10(%ebp),%eax 801033a5: 83 c4 10 add $0x10,%esp 801033a8: 85 c0 test %eax,%eax 801033aa: 0f 8e b9 00 00 00 jle 80103469 <pipewrite+0xd9> 801033b0: 8b 4d 0c mov 0xc(%ebp),%ecx 801033b3: 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); 801033b9: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 801033bf: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 801033c5: 89 4d e4 mov %ecx,-0x1c(%ebp) 801033c8: 03 4d 10 add 0x10(%ebp),%ecx 801033cb: 89 4d e0 mov %ecx,-0x20(%ebp) { int i; acquire(&p->lock); for(i = 0; i < n; i++){ while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801033ce: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 801033d4: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx 801033da: 39 d0 cmp %edx,%eax 801033dc: 74 38 je 80103416 <pipewrite+0x86> 801033de: eb 59 jmp 80103439 <pipewrite+0xa9> if(p->readopen == 0 || myproc()->killed){ 801033e0: e8 9b 03 00 00 call 80103780 <myproc> 801033e5: 8b 48 24 mov 0x24(%eax),%ecx 801033e8: 85 c9 test %ecx,%ecx 801033ea: 75 34 jne 80103420 <pipewrite+0x90> release(&p->lock); return -1; } wakeup(&p->nread); 801033ec: 83 ec 0c sub $0xc,%esp 801033ef: 57 push %edi 801033f0: e8 eb 0a 00 00 call 80103ee0 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 801033f5: 58 pop %eax 801033f6: 5a pop %edx 801033f7: 53 push %ebx 801033f8: 56 push %esi 801033f9: e8 32 09 00 00 call 80103d30 <sleep> { int i; acquire(&p->lock); for(i = 0; i < n; i++){ while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801033fe: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103404: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010340a: 83 c4 10 add $0x10,%esp 8010340d: 05 00 02 00 00 add $0x200,%eax 80103412: 39 c2 cmp %eax,%edx 80103414: 75 2a jne 80103440 <pipewrite+0xb0> if(p->readopen == 0 || myproc()->killed){ 80103416: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 8010341c: 85 c0 test %eax,%eax 8010341e: 75 c0 jne 801033e0 <pipewrite+0x50> release(&p->lock); 80103420: 83 ec 0c sub $0xc,%esp 80103423: 53 push %ebx 80103424: e8 37 10 00 00 call 80104460 <release> return -1; 80103429: 83 c4 10 add $0x10,%esp 8010342c: 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; } 80103431: 8d 65 f4 lea -0xc(%ebp),%esp 80103434: 5b pop %ebx 80103435: 5e pop %esi 80103436: 5f pop %edi 80103437: 5d pop %ebp 80103438: c3 ret { int i; acquire(&p->lock); for(i = 0; i < n; i++){ while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103439: 89 c2 mov %eax,%edx 8010343b: 90 nop 8010343c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; } wakeup(&p->nread); sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep } p->data[p->nwrite++ % PIPESIZE] = addr[i]; 80103440: 8b 4d e4 mov -0x1c(%ebp),%ecx 80103443: 8d 42 01 lea 0x1(%edx),%eax 80103446: 83 45 e4 01 addl $0x1,-0x1c(%ebp) 8010344a: 81 e2 ff 01 00 00 and $0x1ff,%edx 80103450: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 80103456: 0f b6 09 movzbl (%ecx),%ecx 80103459: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) 8010345d: 8b 4d e4 mov -0x1c(%ebp),%ecx pipewrite(struct pipe *p, char *addr, int n) { int i; acquire(&p->lock); for(i = 0; i < n; i++){ 80103460: 3b 4d e0 cmp -0x20(%ebp),%ecx 80103463: 0f 85 65 ff ff ff jne 801033ce <pipewrite+0x3e> wakeup(&p->nread); sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep } p->data[p->nwrite++ % PIPESIZE] = addr[i]; } wakeup(&p->nread); //DOC: pipewrite-wakeup1 80103469: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 8010346f: 83 ec 0c sub $0xc,%esp 80103472: 50 push %eax 80103473: e8 68 0a 00 00 call 80103ee0 <wakeup> release(&p->lock); 80103478: 89 1c 24 mov %ebx,(%esp) 8010347b: e8 e0 0f 00 00 call 80104460 <release> return n; 80103480: 83 c4 10 add $0x10,%esp 80103483: 8b 45 10 mov 0x10(%ebp),%eax 80103486: eb a9 jmp 80103431 <pipewrite+0xa1> 80103488: 90 nop 80103489: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103490 <piperead>: } int piperead(struct pipe *p, char *addr, int n) { 80103490: 55 push %ebp 80103491: 89 e5 mov %esp,%ebp 80103493: 57 push %edi 80103494: 56 push %esi 80103495: 53 push %ebx 80103496: 83 ec 18 sub $0x18,%esp 80103499: 8b 5d 08 mov 0x8(%ebp),%ebx 8010349c: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 8010349f: 53 push %ebx 801034a0: e8 9b 0e 00 00 call 80104340 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 801034a5: 83 c4 10 add $0x10,%esp 801034a8: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 801034ae: 39 83 38 02 00 00 cmp %eax,0x238(%ebx) 801034b4: 75 6a jne 80103520 <piperead+0x90> 801034b6: 8b b3 40 02 00 00 mov 0x240(%ebx),%esi 801034bc: 85 f6 test %esi,%esi 801034be: 0f 84 cc 00 00 00 je 80103590 <piperead+0x100> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 801034c4: 8d b3 34 02 00 00 lea 0x234(%ebx),%esi 801034ca: eb 2d jmp 801034f9 <piperead+0x69> 801034cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801034d0: 83 ec 08 sub $0x8,%esp 801034d3: 53 push %ebx 801034d4: 56 push %esi 801034d5: e8 56 08 00 00 call 80103d30 <sleep> piperead(struct pipe *p, char *addr, int n) { int i; acquire(&p->lock); while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 801034da: 83 c4 10 add $0x10,%esp 801034dd: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax 801034e3: 39 83 34 02 00 00 cmp %eax,0x234(%ebx) 801034e9: 75 35 jne 80103520 <piperead+0x90> 801034eb: 8b 93 40 02 00 00 mov 0x240(%ebx),%edx 801034f1: 85 d2 test %edx,%edx 801034f3: 0f 84 97 00 00 00 je 80103590 <piperead+0x100> if(myproc()->killed){ 801034f9: e8 82 02 00 00 call 80103780 <myproc> 801034fe: 8b 48 24 mov 0x24(%eax),%ecx 80103501: 85 c9 test %ecx,%ecx 80103503: 74 cb je 801034d0 <piperead+0x40> release(&p->lock); 80103505: 83 ec 0c sub $0xc,%esp 80103508: 53 push %ebx 80103509: e8 52 0f 00 00 call 80104460 <release> return -1; 8010350e: 83 c4 10 add $0x10,%esp addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80103511: 8d 65 f4 lea -0xc(%ebp),%esp acquire(&p->lock); while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty if(myproc()->killed){ release(&p->lock); return -1; 80103514: b8 ff ff ff ff mov $0xffffffff,%eax addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80103519: 5b pop %ebx 8010351a: 5e pop %esi 8010351b: 5f pop %edi 8010351c: 5d pop %ebp 8010351d: c3 ret 8010351e: 66 90 xchg %ax,%ax release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep } for(i = 0; i < n; i++){ //DOC: piperead-copy 80103520: 8b 45 10 mov 0x10(%ebp),%eax 80103523: 85 c0 test %eax,%eax 80103525: 7e 69 jle 80103590 <piperead+0x100> if(p->nread == p->nwrite) 80103527: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 8010352d: 31 c9 xor %ecx,%ecx 8010352f: eb 15 jmp 80103546 <piperead+0xb6> 80103531: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103538: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 8010353e: 3b 83 38 02 00 00 cmp 0x238(%ebx),%eax 80103544: 74 5a je 801035a0 <piperead+0x110> break; addr[i] = p->data[p->nread++ % PIPESIZE]; 80103546: 8d 70 01 lea 0x1(%eax),%esi 80103549: 25 ff 01 00 00 and $0x1ff,%eax 8010354e: 89 b3 34 02 00 00 mov %esi,0x234(%ebx) 80103554: 0f b6 44 03 34 movzbl 0x34(%ebx,%eax,1),%eax 80103559: 88 04 0f mov %al,(%edi,%ecx,1) release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep } for(i = 0; i < n; i++){ //DOC: piperead-copy 8010355c: 83 c1 01 add $0x1,%ecx 8010355f: 39 4d 10 cmp %ecx,0x10(%ebp) 80103562: 75 d4 jne 80103538 <piperead+0xa8> if(p->nread == p->nwrite) break; addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup 80103564: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 8010356a: 83 ec 0c sub $0xc,%esp 8010356d: 50 push %eax 8010356e: e8 6d 09 00 00 call 80103ee0 <wakeup> release(&p->lock); 80103573: 89 1c 24 mov %ebx,(%esp) 80103576: e8 e5 0e 00 00 call 80104460 <release> return i; 8010357b: 8b 45 10 mov 0x10(%ebp),%eax 8010357e: 83 c4 10 add $0x10,%esp } 80103581: 8d 65 f4 lea -0xc(%ebp),%esp 80103584: 5b pop %ebx 80103585: 5e pop %esi 80103586: 5f pop %edi 80103587: 5d pop %ebp 80103588: c3 ret 80103589: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep } for(i = 0; i < n; i++){ //DOC: piperead-copy 80103590: c7 45 10 00 00 00 00 movl $0x0,0x10(%ebp) 80103597: eb cb jmp 80103564 <piperead+0xd4> 80103599: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801035a0: 89 4d 10 mov %ecx,0x10(%ebp) 801035a3: eb bf jmp 80103564 <piperead+0xd4> 801035a5: 66 90 xchg %ax,%ax 801035a7: 66 90 xchg %ax,%ax 801035a9: 66 90 xchg %ax,%ax 801035ab: 66 90 xchg %ax,%ax 801035ad: 66 90 xchg %ax,%ax 801035af: 90 nop 801035b0 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 801035b0: 55 push %ebp 801035b1: 89 e5 mov %esp,%ebp 801035b3: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801035b4: bb 54 2d 11 80 mov $0x80112d54,%ebx // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 801035b9: 83 ec 10 sub $0x10,%esp struct proc *p; char *sp; acquire(&ptable.lock); 801035bc: 68 20 2d 11 80 push $0x80112d20 801035c1: e8 7a 0d 00 00 call 80104340 <acquire> 801035c6: 83 c4 10 add $0x10,%esp 801035c9: eb 10 jmp 801035db <allocproc+0x2b> 801035cb: 90 nop 801035cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 801035d0: 83 c3 7c add $0x7c,%ebx 801035d3: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 801035d9: 74 75 je 80103650 <allocproc+0xa0> if(p->state == UNUSED) 801035db: 8b 43 0c mov 0xc(%ebx),%eax 801035de: 85 c0 test %eax,%eax 801035e0: 75 ee jne 801035d0 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 801035e2: a1 04 a0 10 80 mov 0x8010a004,%eax release(&ptable.lock); 801035e7: 83 ec 0c sub $0xc,%esp release(&ptable.lock); return 0; found: p->state = EMBRYO; 801035ea: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->pid = nextpid++; release(&ptable.lock); 801035f1: 68 20 2d 11 80 push $0x80112d20 release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 801035f6: 8d 50 01 lea 0x1(%eax),%edx 801035f9: 89 43 10 mov %eax,0x10(%ebx) 801035fc: 89 15 04 a0 10 80 mov %edx,0x8010a004 release(&ptable.lock); 80103602: e8 59 0e 00 00 call 80104460 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103607: e8 84 ee ff ff call 80102490 <kalloc> 8010360c: 83 c4 10 add $0x10,%esp 8010360f: 85 c0 test %eax,%eax 80103611: 89 43 08 mov %eax,0x8(%ebx) 80103614: 74 51 je 80103667 <allocproc+0xb7> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103616: 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); 8010361c: 83 ec 04 sub $0x4,%esp // Set up new context to start executing at forkret, // which returns to trapret. sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; 8010361f: 05 9c 0f 00 00 add $0xf9c,%eax return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103624: 89 53 18 mov %edx,0x18(%ebx) p->tf = (struct trapframe*)sp; // Set up new context to start executing at forkret, // which returns to trapret. sp -= 4; *(uint*)sp = (uint)trapret; 80103627: c7 40 14 d2 56 10 80 movl $0x801056d2,0x14(%eax) sp -= sizeof *p->context; p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); 8010362e: 6a 14 push $0x14 80103630: 6a 00 push $0x0 80103632: 50 push %eax // which returns to trapret. sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; p->context = (struct context*)sp; 80103633: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 80103636: e8 75 0e 00 00 call 801044b0 <memset> p->context->eip = (uint)forkret; 8010363b: 8b 43 1c mov 0x1c(%ebx),%eax return p; 8010363e: 83 c4 10 add $0x10,%esp *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); p->context->eip = (uint)forkret; 80103641: c7 40 10 70 36 10 80 movl $0x80103670,0x10(%eax) return p; 80103648: 89 d8 mov %ebx,%eax } 8010364a: 8b 5d fc mov -0x4(%ebp),%ebx 8010364d: c9 leave 8010364e: c3 ret 8010364f: 90 nop for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) if(p->state == UNUSED) goto found; release(&ptable.lock); 80103650: 83 ec 0c sub $0xc,%esp 80103653: 68 20 2d 11 80 push $0x80112d20 80103658: e8 03 0e 00 00 call 80104460 <release> return 0; 8010365d: 83 c4 10 add $0x10,%esp 80103660: 31 c0 xor %eax,%eax p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); p->context->eip = (uint)forkret; return p; } 80103662: 8b 5d fc mov -0x4(%ebp),%ebx 80103665: c9 leave 80103666: c3 ret release(&ptable.lock); // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ p->state = UNUSED; 80103667: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 8010366e: eb da jmp 8010364a <allocproc+0x9a> 80103670 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 80103670: 55 push %ebp 80103671: 89 e5 mov %esp,%ebp 80103673: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 80103676: 68 20 2d 11 80 push $0x80112d20 8010367b: e8 e0 0d 00 00 call 80104460 <release> if (first) { 80103680: a1 00 a0 10 80 mov 0x8010a000,%eax 80103685: 83 c4 10 add $0x10,%esp 80103688: 85 c0 test %eax,%eax 8010368a: 75 04 jne 80103690 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 8010368c: c9 leave 8010368d: c3 ret 8010368e: 66 90 xchg %ax,%ax if (first) { // Some initialization functions must be run in the context // of a regular process (e.g., they call sleep), and thus cannot // be run from main(). first = 0; iinit(ROOTDEV); 80103690: 83 ec 0c sub $0xc,%esp if (first) { // Some initialization functions must be run in the context // of a regular process (e.g., they call sleep), and thus cannot // be run from main(). first = 0; 80103693: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000 8010369a: 00 00 00 iinit(ROOTDEV); 8010369d: 6a 01 push $0x1 8010369f: e8 cc dd ff ff call 80101470 <iinit> initlog(ROOTDEV); 801036a4: c7 04 24 01 00 00 00 movl $0x1,(%esp) 801036ab: e8 00 f4 ff ff call 80102ab0 <initlog> 801036b0: 83 c4 10 add $0x10,%esp } // Return to "caller", actually trapret (see allocproc). } 801036b3: c9 leave 801036b4: c3 ret 801036b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801036b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801036c0 <pinit>: static void wakeup1(void *chan); void pinit(void) { 801036c0: 55 push %ebp 801036c1: 89 e5 mov %esp,%ebp 801036c3: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 801036c6: 68 b5 74 10 80 push $0x801074b5 801036cb: 68 20 2d 11 80 push $0x80112d20 801036d0: e8 6b 0b 00 00 call 80104240 <initlock> } 801036d5: 83 c4 10 add $0x10,%esp 801036d8: c9 leave 801036d9: c3 ret 801036da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801036e0 <mycpu>: // Must be called with interrupts disabled to avoid the caller being // rescheduled between reading lapicid and running through the loop. struct cpu* mycpu(void) { 801036e0: 55 push %ebp 801036e1: 89 e5 mov %esp,%ebp 801036e3: 56 push %esi 801036e4: 53 push %ebx static inline uint readeflags(void) { uint eflags; asm volatile("pushfl; popl %0" : "=r" (eflags)); 801036e5: 9c pushf 801036e6: 58 pop %eax int apicid, i; if(readeflags()&FL_IF) 801036e7: f6 c4 02 test $0x2,%ah 801036ea: 75 5b jne 80103747 <mycpu+0x67> panic("mycpu called with interrupts enabled\n"); apicid = lapicid(); 801036ec: e8 ff ef ff ff call 801026f0 <lapicid> // APIC IDs are not guaranteed to be contiguous. Maybe we should have // a reverse map, or reserve a register to store &cpus[i]. for (i = 0; i < ncpu; ++i) { 801036f1: 8b 35 00 2d 11 80 mov 0x80112d00,%esi 801036f7: 85 f6 test %esi,%esi 801036f9: 7e 3f jle 8010373a <mycpu+0x5a> if (cpus[i].apicid == apicid) 801036fb: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx 80103702: 39 d0 cmp %edx,%eax 80103704: 74 30 je 80103736 <mycpu+0x56> 80103706: b9 30 28 11 80 mov $0x80112830,%ecx 8010370b: 31 d2 xor %edx,%edx 8010370d: 8d 76 00 lea 0x0(%esi),%esi panic("mycpu called with interrupts enabled\n"); apicid = lapicid(); // APIC IDs are not guaranteed to be contiguous. Maybe we should have // a reverse map, or reserve a register to store &cpus[i]. for (i = 0; i < ncpu; ++i) { 80103710: 83 c2 01 add $0x1,%edx 80103713: 39 f2 cmp %esi,%edx 80103715: 74 23 je 8010373a <mycpu+0x5a> if (cpus[i].apicid == apicid) 80103717: 0f b6 19 movzbl (%ecx),%ebx 8010371a: 81 c1 b0 00 00 00 add $0xb0,%ecx 80103720: 39 d8 cmp %ebx,%eax 80103722: 75 ec jne 80103710 <mycpu+0x30> return &cpus[i]; 80103724: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax } panic("unknown apicid\n"); } 8010372a: 8d 65 f8 lea -0x8(%ebp),%esp 8010372d: 5b pop %ebx apicid = lapicid(); // APIC IDs are not guaranteed to be contiguous. Maybe we should have // a reverse map, or reserve a register to store &cpus[i]. for (i = 0; i < ncpu; ++i) { if (cpus[i].apicid == apicid) return &cpus[i]; 8010372e: 05 80 27 11 80 add $0x80112780,%eax } panic("unknown apicid\n"); } 80103733: 5e pop %esi 80103734: 5d pop %ebp 80103735: c3 ret panic("mycpu called with interrupts enabled\n"); apicid = lapicid(); // APIC IDs are not guaranteed to be contiguous. Maybe we should have // a reverse map, or reserve a register to store &cpus[i]. for (i = 0; i < ncpu; ++i) { 80103736: 31 d2 xor %edx,%edx 80103738: eb ea jmp 80103724 <mycpu+0x44> if (cpus[i].apicid == apicid) return &cpus[i]; } panic("unknown apicid\n"); 8010373a: 83 ec 0c sub $0xc,%esp 8010373d: 68 bc 74 10 80 push $0x801074bc 80103742: e8 29 cc ff ff call 80100370 <panic> mycpu(void) { int apicid, i; if(readeflags()&FL_IF) panic("mycpu called with interrupts enabled\n"); 80103747: 83 ec 0c sub $0xc,%esp 8010374a: 68 dc 75 10 80 push $0x801075dc 8010374f: e8 1c cc ff ff call 80100370 <panic> 80103754: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010375a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103760 <cpuid>: initlock(&ptable.lock, "ptable"); } // Must be called with interrupts disabled int cpuid() { 80103760: 55 push %ebp 80103761: 89 e5 mov %esp,%ebp 80103763: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 80103766: e8 75 ff ff ff call 801036e0 <mycpu> 8010376b: 2d 80 27 11 80 sub $0x80112780,%eax } 80103770: c9 leave } // Must be called with interrupts disabled int cpuid() { return mycpu()-cpus; 80103771: c1 f8 04 sar $0x4,%eax 80103774: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 8010377a: c3 ret 8010377b: 90 nop 8010377c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103780 <myproc>: } // Disable interrupts so that we are not rescheduled // while reading proc from the cpu structure struct proc* myproc(void) { 80103780: 55 push %ebp 80103781: 89 e5 mov %esp,%ebp 80103783: 53 push %ebx 80103784: 83 ec 04 sub $0x4,%esp struct cpu *c; struct proc *p; pushcli(); 80103787: e8 74 0b 00 00 call 80104300 <pushcli> c = mycpu(); 8010378c: e8 4f ff ff ff call 801036e0 <mycpu> p = c->proc; 80103791: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103797: e8 54 0c 00 00 call 801043f0 <popcli> return p; } 8010379c: 83 c4 04 add $0x4,%esp 8010379f: 89 d8 mov %ebx,%eax 801037a1: 5b pop %ebx 801037a2: 5d pop %ebp 801037a3: c3 ret 801037a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801037aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801037b0 <userinit>: } // Set up first user process. void userinit(void) { 801037b0: 55 push %ebp 801037b1: 89 e5 mov %esp,%ebp 801037b3: 53 push %ebx 801037b4: 83 ec 04 sub $0x4,%esp struct proc *p; extern char _binary_initcode_start[], _binary_initcode_size[]; p = allocproc(); 801037b7: e8 f4 fd ff ff call 801035b0 <allocproc> 801037bc: 89 c3 mov %eax,%ebx initproc = p; 801037be: a3 b8 a5 10 80 mov %eax,0x8010a5b8 if((p->pgdir = setupkvm()) == 0) 801037c3: e8 f8 34 00 00 call 80106cc0 <setupkvm> 801037c8: 85 c0 test %eax,%eax 801037ca: 89 43 04 mov %eax,0x4(%ebx) 801037cd: 0f 84 bd 00 00 00 je 80103890 <userinit+0xe0> panic("userinit: out of memory?"); inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 801037d3: 83 ec 04 sub $0x4,%esp 801037d6: 68 2c 00 00 00 push $0x2c 801037db: 68 60 a4 10 80 push $0x8010a460 801037e0: 50 push %eax 801037e1: e8 ea 31 00 00 call 801069d0 <inituvm> p->sz = PGSIZE; memset(p->tf, 0, sizeof(*p->tf)); 801037e6: 83 c4 0c add $0xc,%esp initproc = p; if((p->pgdir = setupkvm()) == 0) panic("userinit: out of memory?"); inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); p->sz = PGSIZE; 801037e9: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 801037ef: 6a 4c push $0x4c 801037f1: 6a 00 push $0x0 801037f3: ff 73 18 pushl 0x18(%ebx) 801037f6: e8 b5 0c 00 00 call 801044b0 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 801037fb: 8b 43 18 mov 0x18(%ebx),%eax 801037fe: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80103803: b9 23 00 00 00 mov $0x23,%ecx p->tf->ss = p->tf->ds; p->tf->eflags = FL_IF; p->tf->esp = PGSIZE; p->tf->eip = 0; // beginning of initcode.S safestrcpy(p->name, "initcode", sizeof(p->name)); 80103808: 83 c4 0c add $0xc,%esp if((p->pgdir = setupkvm()) == 0) panic("userinit: out of memory?"); inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); p->sz = PGSIZE; memset(p->tf, 0, sizeof(*p->tf)); p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010380b: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010380f: 8b 43 18 mov 0x18(%ebx),%eax 80103812: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 80103816: 8b 43 18 mov 0x18(%ebx),%eax 80103819: 0f b7 50 2c movzwl 0x2c(%eax),%edx 8010381d: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 80103821: 8b 43 18 mov 0x18(%ebx),%eax 80103824: 0f b7 50 2c movzwl 0x2c(%eax),%edx 80103828: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 8010382c: 8b 43 18 mov 0x18(%ebx),%eax 8010382f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 80103836: 8b 43 18 mov 0x18(%ebx),%eax 80103839: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 80103840: 8b 43 18 mov 0x18(%ebx),%eax 80103843: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 8010384a: 8d 43 6c lea 0x6c(%ebx),%eax 8010384d: 6a 10 push $0x10 8010384f: 68 e5 74 10 80 push $0x801074e5 80103854: 50 push %eax 80103855: e8 56 0e 00 00 call 801046b0 <safestrcpy> p->cwd = namei("/"); 8010385a: c7 04 24 ee 74 10 80 movl $0x801074ee,(%esp) 80103861: e8 5a e6 ff ff call 80101ec0 <namei> 80103866: 89 43 68 mov %eax,0x68(%ebx) // this assignment to p->state lets other cores // run this process. the acquire forces the above // writes to be visible, and the lock is also needed // because the assignment might not be atomic. acquire(&ptable.lock); 80103869: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103870: e8 cb 0a 00 00 call 80104340 <acquire> p->state = RUNNABLE; 80103875: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 8010387c: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103883: e8 d8 0b 00 00 call 80104460 <release> } 80103888: 83 c4 10 add $0x10,%esp 8010388b: 8b 5d fc mov -0x4(%ebp),%ebx 8010388e: c9 leave 8010388f: c3 ret p = allocproc(); initproc = p; if((p->pgdir = setupkvm()) == 0) panic("userinit: out of memory?"); 80103890: 83 ec 0c sub $0xc,%esp 80103893: 68 cc 74 10 80 push $0x801074cc 80103898: e8 d3 ca ff ff call 80100370 <panic> 8010389d: 8d 76 00 lea 0x0(%esi),%esi 801038a0 <growproc>: // Grow current process's memory by n bytes. // Return 0 on success, -1 on failure. int growproc(int n) { 801038a0: 55 push %ebp 801038a1: 89 e5 mov %esp,%ebp 801038a3: 56 push %esi 801038a4: 53 push %ebx 801038a5: 8b 75 08 mov 0x8(%ebp),%esi // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 801038a8: e8 53 0a 00 00 call 80104300 <pushcli> c = mycpu(); 801038ad: e8 2e fe ff ff call 801036e0 <mycpu> p = c->proc; 801038b2: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801038b8: e8 33 0b 00 00 call 801043f0 <popcli> { uint sz; struct proc *curproc = myproc(); sz = curproc->sz; if(n > 0){ 801038bd: 83 fe 00 cmp $0x0,%esi growproc(int n) { uint sz; struct proc *curproc = myproc(); sz = curproc->sz; 801038c0: 8b 03 mov (%ebx),%eax if(n > 0){ 801038c2: 7e 34 jle 801038f8 <growproc+0x58> if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 801038c4: 83 ec 04 sub $0x4,%esp 801038c7: 01 c6 add %eax,%esi 801038c9: 56 push %esi 801038ca: 50 push %eax 801038cb: ff 73 04 pushl 0x4(%ebx) 801038ce: e8 3d 32 00 00 call 80106b10 <allocuvm> 801038d3: 83 c4 10 add $0x10,%esp 801038d6: 85 c0 test %eax,%eax 801038d8: 74 36 je 80103910 <growproc+0x70> } else if(n < 0){ if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) return -1; } curproc->sz = sz; switchuvm(curproc); 801038da: 83 ec 0c sub $0xc,%esp return -1; } else if(n < 0){ if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) return -1; } curproc->sz = sz; 801038dd: 89 03 mov %eax,(%ebx) switchuvm(curproc); 801038df: 53 push %ebx 801038e0: e8 db 2f 00 00 call 801068c0 <switchuvm> return 0; 801038e5: 83 c4 10 add $0x10,%esp 801038e8: 31 c0 xor %eax,%eax } 801038ea: 8d 65 f8 lea -0x8(%ebp),%esp 801038ed: 5b pop %ebx 801038ee: 5e pop %esi 801038ef: 5d pop %ebp 801038f0: c3 ret 801038f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sz = curproc->sz; if(n > 0){ if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) return -1; } else if(n < 0){ 801038f8: 74 e0 je 801038da <growproc+0x3a> if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 801038fa: 83 ec 04 sub $0x4,%esp 801038fd: 01 c6 add %eax,%esi 801038ff: 56 push %esi 80103900: 50 push %eax 80103901: ff 73 04 pushl 0x4(%ebx) 80103904: e8 07 33 00 00 call 80106c10 <deallocuvm> 80103909: 83 c4 10 add $0x10,%esp 8010390c: 85 c0 test %eax,%eax 8010390e: 75 ca jne 801038da <growproc+0x3a> struct proc *curproc = myproc(); sz = curproc->sz; if(n > 0){ if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) return -1; 80103910: b8 ff ff ff ff mov $0xffffffff,%eax 80103915: eb d3 jmp 801038ea <growproc+0x4a> 80103917: 89 f6 mov %esi,%esi 80103919: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103920 <fork>: // Create a new process copying p as the parent. // Sets up stack to return as if from system call. // Caller must set state of returned proc to RUNNABLE. int fork(void) { 80103920: 55 push %ebp 80103921: 89 e5 mov %esp,%ebp 80103923: 57 push %edi 80103924: 56 push %esi 80103925: 53 push %ebx 80103926: 83 ec 1c sub $0x1c,%esp // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103929: e8 d2 09 00 00 call 80104300 <pushcli> c = mycpu(); 8010392e: e8 ad fd ff ff call 801036e0 <mycpu> p = c->proc; 80103933: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103939: e8 b2 0a 00 00 call 801043f0 <popcli> int i, pid; struct proc *np; struct proc *curproc = myproc(); // Allocate process. if((np = allocproc()) == 0){ 8010393e: e8 6d fc ff ff call 801035b0 <allocproc> 80103943: 85 c0 test %eax,%eax 80103945: 89 c7 mov %eax,%edi 80103947: 89 45 e4 mov %eax,-0x1c(%ebp) 8010394a: 0f 84 b5 00 00 00 je 80103a05 <fork+0xe5> return -1; } // Copy process state from proc. if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 80103950: 83 ec 08 sub $0x8,%esp 80103953: ff 33 pushl (%ebx) 80103955: ff 73 04 pushl 0x4(%ebx) 80103958: e8 33 34 00 00 call 80106d90 <copyuvm> 8010395d: 83 c4 10 add $0x10,%esp 80103960: 85 c0 test %eax,%eax 80103962: 89 47 04 mov %eax,0x4(%edi) 80103965: 0f 84 a1 00 00 00 je 80103a0c <fork+0xec> kfree(np->kstack); np->kstack = 0; np->state = UNUSED; return -1; } np->sz = curproc->sz; 8010396b: 8b 03 mov (%ebx),%eax 8010396d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80103970: 89 01 mov %eax,(%ecx) np->parent = curproc; 80103972: 89 59 14 mov %ebx,0x14(%ecx) *np->tf = *curproc->tf; 80103975: 89 c8 mov %ecx,%eax 80103977: 8b 79 18 mov 0x18(%ecx),%edi 8010397a: 8b 73 18 mov 0x18(%ebx),%esi 8010397d: b9 13 00 00 00 mov $0x13,%ecx 80103982: f3 a5 rep movsl %ds:(%esi),%es:(%edi) // Clear %eax so that fork returns 0 in the child. np->tf->eax = 0; for(i = 0; i < NOFILE; i++) 80103984: 31 f6 xor %esi,%esi np->sz = curproc->sz; np->parent = curproc; *np->tf = *curproc->tf; // Clear %eax so that fork returns 0 in the child. np->tf->eax = 0; 80103986: 8b 40 18 mov 0x18(%eax),%eax 80103989: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) for(i = 0; i < NOFILE; i++) if(curproc->ofile[i]) 80103990: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 80103994: 85 c0 test %eax,%eax 80103996: 74 13 je 801039ab <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 80103998: 83 ec 0c sub $0xc,%esp 8010399b: 50 push %eax 8010399c: e8 3f d4 ff ff call 80100de0 <filedup> 801039a1: 8b 55 e4 mov -0x1c(%ebp),%edx 801039a4: 83 c4 10 add $0x10,%esp 801039a7: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) *np->tf = *curproc->tf; // Clear %eax so that fork returns 0 in the child. np->tf->eax = 0; for(i = 0; i < NOFILE; i++) 801039ab: 83 c6 01 add $0x1,%esi 801039ae: 83 fe 10 cmp $0x10,%esi 801039b1: 75 dd jne 80103990 <fork+0x70> if(curproc->ofile[i]) np->ofile[i] = filedup(curproc->ofile[i]); np->cwd = idup(curproc->cwd); 801039b3: 83 ec 0c sub $0xc,%esp 801039b6: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 801039b9: 83 c3 6c add $0x6c,%ebx np->tf->eax = 0; for(i = 0; i < NOFILE; i++) if(curproc->ofile[i]) np->ofile[i] = filedup(curproc->ofile[i]); np->cwd = idup(curproc->cwd); 801039bc: e8 7f dc ff ff call 80101640 <idup> 801039c1: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 801039c4: 83 c4 0c add $0xc,%esp np->tf->eax = 0; for(i = 0; i < NOFILE; i++) if(curproc->ofile[i]) np->ofile[i] = filedup(curproc->ofile[i]); np->cwd = idup(curproc->cwd); 801039c7: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 801039ca: 8d 47 6c lea 0x6c(%edi),%eax 801039cd: 6a 10 push $0x10 801039cf: 53 push %ebx 801039d0: 50 push %eax 801039d1: e8 da 0c 00 00 call 801046b0 <safestrcpy> pid = np->pid; 801039d6: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 801039d9: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801039e0: e8 5b 09 00 00 call 80104340 <acquire> np->state = RUNNABLE; 801039e5: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 801039ec: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801039f3: e8 68 0a 00 00 call 80104460 <release> return pid; 801039f8: 83 c4 10 add $0x10,%esp 801039fb: 89 d8 mov %ebx,%eax } 801039fd: 8d 65 f4 lea -0xc(%ebp),%esp 80103a00: 5b pop %ebx 80103a01: 5e pop %esi 80103a02: 5f pop %edi 80103a03: 5d pop %ebp 80103a04: c3 ret struct proc *np; struct proc *curproc = myproc(); // Allocate process. if((np = allocproc()) == 0){ return -1; 80103a05: b8 ff ff ff ff mov $0xffffffff,%eax 80103a0a: eb f1 jmp 801039fd <fork+0xdd> } // Copy process state from proc. if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ kfree(np->kstack); 80103a0c: 8b 7d e4 mov -0x1c(%ebp),%edi 80103a0f: 83 ec 0c sub $0xc,%esp 80103a12: ff 77 08 pushl 0x8(%edi) 80103a15: e8 c6 e8 ff ff call 801022e0 <kfree> np->kstack = 0; 80103a1a: c7 47 08 00 00 00 00 movl $0x0,0x8(%edi) np->state = UNUSED; 80103a21: c7 47 0c 00 00 00 00 movl $0x0,0xc(%edi) return -1; 80103a28: 83 c4 10 add $0x10,%esp 80103a2b: b8 ff ff ff ff mov $0xffffffff,%eax 80103a30: eb cb jmp 801039fd <fork+0xdd> 80103a32: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103a40 <scheduler>: // - swtch to start running that process // - eventually that process transfers control // via swtch back to the scheduler. void scheduler(void) { 80103a40: 55 push %ebp 80103a41: 89 e5 mov %esp,%ebp 80103a43: 57 push %edi 80103a44: 56 push %esi 80103a45: 53 push %ebx 80103a46: 83 ec 0c sub $0xc,%esp struct proc *p; struct cpu *c = mycpu(); 80103a49: e8 92 fc ff ff call 801036e0 <mycpu> 80103a4e: 8d 78 04 lea 0x4(%eax),%edi 80103a51: 89 c6 mov %eax,%esi c->proc = 0; 80103a53: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103a5a: 00 00 00 80103a5d: 8d 76 00 lea 0x0(%esi),%esi } static inline void sti(void) { asm volatile("sti"); 80103a60: fb sti for(;;){ // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); 80103a61: 83 ec 0c sub $0xc,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103a64: bb 54 2d 11 80 mov $0x80112d54,%ebx for(;;){ // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); 80103a69: 68 20 2d 11 80 push $0x80112d20 80103a6e: e8 cd 08 00 00 call 80104340 <acquire> 80103a73: 83 c4 10 add $0x10,%esp 80103a76: eb 13 jmp 80103a8b <scheduler+0x4b> 80103a78: 90 nop 80103a79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103a80: 83 c3 7c add $0x7c,%ebx 80103a83: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103a89: 74 45 je 80103ad0 <scheduler+0x90> if(p->state != RUNNABLE) 80103a8b: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 80103a8f: 75 ef jne 80103a80 <scheduler+0x40> // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. c->proc = p; switchuvm(p); 80103a91: 83 ec 0c sub $0xc,%esp continue; // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. c->proc = p; 80103a94: 89 9e ac 00 00 00 mov %ebx,0xac(%esi) switchuvm(p); 80103a9a: 53 push %ebx // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103a9b: 83 c3 7c add $0x7c,%ebx // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. c->proc = p; switchuvm(p); 80103a9e: e8 1d 2e 00 00 call 801068c0 <switchuvm> p->state = RUNNING; // cprintf("Process %s with pid %d running\n", p->name, p->pid); swtch(&(c->scheduler), p->context); 80103aa3: 58 pop %eax 80103aa4: 5a pop %edx 80103aa5: ff 73 a0 pushl -0x60(%ebx) 80103aa8: 57 push %edi // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. c->proc = p; switchuvm(p); p->state = RUNNING; 80103aa9: c7 43 90 04 00 00 00 movl $0x4,-0x70(%ebx) // cprintf("Process %s with pid %d running\n", p->name, p->pid); swtch(&(c->scheduler), p->context); 80103ab0: e8 56 0c 00 00 call 8010470b <swtch> switchkvm(); 80103ab5: e8 e6 2d 00 00 call 801068a0 <switchkvm> // Process is done running for now. // It should have changed its p->state before coming back. c->proc = 0; 80103aba: 83 c4 10 add $0x10,%esp // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103abd: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx swtch(&(c->scheduler), p->context); switchkvm(); // Process is done running for now. // It should have changed its p->state before coming back. c->proc = 0; 80103ac3: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi) 80103aca: 00 00 00 // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103acd: 75 bc jne 80103a8b <scheduler+0x4b> 80103acf: 90 nop // Process is done running for now. // It should have changed its p->state before coming back. c->proc = 0; } release(&ptable.lock); 80103ad0: 83 ec 0c sub $0xc,%esp 80103ad3: 68 20 2d 11 80 push $0x80112d20 80103ad8: e8 83 09 00 00 call 80104460 <release> } 80103add: 83 c4 10 add $0x10,%esp 80103ae0: e9 7b ff ff ff jmp 80103a60 <scheduler+0x20> 80103ae5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103ae9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103af0 <sched>: // be proc->intena and proc->ncli, but that would // break in the few places where a lock is held but // there's no process. void sched(void) { 80103af0: 55 push %ebp 80103af1: 89 e5 mov %esp,%ebp 80103af3: 56 push %esi 80103af4: 53 push %ebx // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103af5: e8 06 08 00 00 call 80104300 <pushcli> c = mycpu(); 80103afa: e8 e1 fb ff ff call 801036e0 <mycpu> p = c->proc; 80103aff: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103b05: e8 e6 08 00 00 call 801043f0 <popcli> sched(void) { int intena; struct proc *p = myproc(); if(!holding(&ptable.lock)) 80103b0a: 83 ec 0c sub $0xc,%esp 80103b0d: 68 20 2d 11 80 push $0x80112d20 80103b12: e8 a9 07 00 00 call 801042c0 <holding> 80103b17: 83 c4 10 add $0x10,%esp 80103b1a: 85 c0 test %eax,%eax 80103b1c: 74 4f je 80103b6d <sched+0x7d> panic("sched ptable.lock"); if(mycpu()->ncli != 1) 80103b1e: e8 bd fb ff ff call 801036e0 <mycpu> 80103b23: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103b2a: 75 68 jne 80103b94 <sched+0xa4> panic("sched locks"); if(p->state == RUNNING) 80103b2c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80103b30: 74 55 je 80103b87 <sched+0x97> static inline uint readeflags(void) { uint eflags; asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103b32: 9c pushf 80103b33: 58 pop %eax panic("sched running"); if(readeflags()&FL_IF) 80103b34: f6 c4 02 test $0x2,%ah 80103b37: 75 41 jne 80103b7a <sched+0x8a> panic("sched interruptible"); intena = mycpu()->intena; 80103b39: e8 a2 fb ff ff call 801036e0 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103b3e: 83 c3 1c add $0x1c,%ebx panic("sched locks"); if(p->state == RUNNING) panic("sched running"); if(readeflags()&FL_IF) panic("sched interruptible"); intena = mycpu()->intena; 80103b41: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103b47: e8 94 fb ff ff call 801036e0 <mycpu> 80103b4c: 83 ec 08 sub $0x8,%esp 80103b4f: ff 70 04 pushl 0x4(%eax) 80103b52: 53 push %ebx 80103b53: e8 b3 0b 00 00 call 8010470b <swtch> mycpu()->intena = intena; 80103b58: e8 83 fb ff ff call 801036e0 <mycpu> } 80103b5d: 83 c4 10 add $0x10,%esp panic("sched running"); if(readeflags()&FL_IF) panic("sched interruptible"); intena = mycpu()->intena; swtch(&p->context, mycpu()->scheduler); mycpu()->intena = intena; 80103b60: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103b66: 8d 65 f8 lea -0x8(%ebp),%esp 80103b69: 5b pop %ebx 80103b6a: 5e pop %esi 80103b6b: 5d pop %ebp 80103b6c: c3 ret { int intena; struct proc *p = myproc(); if(!holding(&ptable.lock)) panic("sched ptable.lock"); 80103b6d: 83 ec 0c sub $0xc,%esp 80103b70: 68 f0 74 10 80 push $0x801074f0 80103b75: e8 f6 c7 ff ff call 80100370 <panic> if(mycpu()->ncli != 1) panic("sched locks"); if(p->state == RUNNING) panic("sched running"); if(readeflags()&FL_IF) panic("sched interruptible"); 80103b7a: 83 ec 0c sub $0xc,%esp 80103b7d: 68 1c 75 10 80 push $0x8010751c 80103b82: e8 e9 c7 ff ff call 80100370 <panic> if(!holding(&ptable.lock)) panic("sched ptable.lock"); if(mycpu()->ncli != 1) panic("sched locks"); if(p->state == RUNNING) panic("sched running"); 80103b87: 83 ec 0c sub $0xc,%esp 80103b8a: 68 0e 75 10 80 push $0x8010750e 80103b8f: e8 dc c7 ff ff call 80100370 <panic> struct proc *p = myproc(); if(!holding(&ptable.lock)) panic("sched ptable.lock"); if(mycpu()->ncli != 1) panic("sched locks"); 80103b94: 83 ec 0c sub $0xc,%esp 80103b97: 68 02 75 10 80 push $0x80107502 80103b9c: e8 cf c7 ff ff call 80100370 <panic> 80103ba1: eb 0d jmp 80103bb0 <exit> 80103ba3: 90 nop 80103ba4: 90 nop 80103ba5: 90 nop 80103ba6: 90 nop 80103ba7: 90 nop 80103ba8: 90 nop 80103ba9: 90 nop 80103baa: 90 nop 80103bab: 90 nop 80103bac: 90 nop 80103bad: 90 nop 80103bae: 90 nop 80103baf: 90 nop 80103bb0 <exit>: // Exit the current process. Does not return. // An exited process remains in the zombie state // until its parent calls wait() to find out it exited. void exit(void) { 80103bb0: 55 push %ebp 80103bb1: 89 e5 mov %esp,%ebp 80103bb3: 57 push %edi 80103bb4: 56 push %esi 80103bb5: 53 push %ebx 80103bb6: 83 ec 0c sub $0xc,%esp // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103bb9: e8 42 07 00 00 call 80104300 <pushcli> c = mycpu(); 80103bbe: e8 1d fb ff ff call 801036e0 <mycpu> p = c->proc; 80103bc3: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103bc9: e8 22 08 00 00 call 801043f0 <popcli> { struct proc *curproc = myproc(); struct proc *p; int fd; if(curproc == initproc) 80103bce: 39 35 b8 a5 10 80 cmp %esi,0x8010a5b8 80103bd4: 8d 5e 28 lea 0x28(%esi),%ebx 80103bd7: 8d 7e 68 lea 0x68(%esi),%edi 80103bda: 0f 84 e7 00 00 00 je 80103cc7 <exit+0x117> panic("init exiting"); // Close all open files. for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd]){ 80103be0: 8b 03 mov (%ebx),%eax 80103be2: 85 c0 test %eax,%eax 80103be4: 74 12 je 80103bf8 <exit+0x48> fileclose(curproc->ofile[fd]); 80103be6: 83 ec 0c sub $0xc,%esp 80103be9: 50 push %eax 80103bea: e8 41 d2 ff ff call 80100e30 <fileclose> curproc->ofile[fd] = 0; 80103bef: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103bf5: 83 c4 10 add $0x10,%esp 80103bf8: 83 c3 04 add $0x4,%ebx if(curproc == initproc) panic("init exiting"); // Close all open files. for(fd = 0; fd < NOFILE; fd++){ 80103bfb: 39 df cmp %ebx,%edi 80103bfd: 75 e1 jne 80103be0 <exit+0x30> fileclose(curproc->ofile[fd]); curproc->ofile[fd] = 0; } } begin_op(); 80103bff: e8 4c ef ff ff call 80102b50 <begin_op> iput(curproc->cwd); 80103c04: 83 ec 0c sub $0xc,%esp 80103c07: ff 76 68 pushl 0x68(%esi) 80103c0a: e8 91 db ff ff call 801017a0 <iput> end_op(); 80103c0f: e8 ac ef ff ff call 80102bc0 <end_op> curproc->cwd = 0; 80103c14: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103c1b: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103c22: e8 19 07 00 00 call 80104340 <acquire> // Parent might be sleeping in wait(). wakeup1(curproc->parent); 80103c27: 8b 56 14 mov 0x14(%esi),%edx 80103c2a: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c2d: b8 54 2d 11 80 mov $0x80112d54,%eax 80103c32: eb 0e jmp 80103c42 <exit+0x92> 80103c34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103c38: 83 c0 7c add $0x7c,%eax 80103c3b: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103c40: 74 1c je 80103c5e <exit+0xae> if(p->state == SLEEPING && p->chan == chan) 80103c42: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103c46: 75 f0 jne 80103c38 <exit+0x88> 80103c48: 3b 50 20 cmp 0x20(%eax),%edx 80103c4b: 75 eb jne 80103c38 <exit+0x88> p->state = RUNNABLE; 80103c4d: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c54: 83 c0 7c add $0x7c,%eax 80103c57: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103c5c: 75 e4 jne 80103c42 <exit+0x92> wakeup1(curproc->parent); // Pass abandoned children to init. for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->parent == curproc){ p->parent = initproc; 80103c5e: 8b 0d b8 a5 10 80 mov 0x8010a5b8,%ecx 80103c64: ba 54 2d 11 80 mov $0x80112d54,%edx 80103c69: eb 10 jmp 80103c7b <exit+0xcb> 80103c6b: 90 nop 80103c6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi // Parent might be sleeping in wait(). wakeup1(curproc->parent); // Pass abandoned children to init. for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103c70: 83 c2 7c add $0x7c,%edx 80103c73: 81 fa 54 4c 11 80 cmp $0x80114c54,%edx 80103c79: 74 33 je 80103cae <exit+0xfe> if(p->parent == curproc){ 80103c7b: 39 72 14 cmp %esi,0x14(%edx) 80103c7e: 75 f0 jne 80103c70 <exit+0xc0> p->parent = initproc; if(p->state == ZOMBIE) 80103c80: 83 7a 0c 05 cmpl $0x5,0xc(%edx) wakeup1(curproc->parent); // Pass abandoned children to init. for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->parent == curproc){ p->parent = initproc; 80103c84: 89 4a 14 mov %ecx,0x14(%edx) if(p->state == ZOMBIE) 80103c87: 75 e7 jne 80103c70 <exit+0xc0> 80103c89: b8 54 2d 11 80 mov $0x80112d54,%eax 80103c8e: eb 0a jmp 80103c9a <exit+0xea> static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c90: 83 c0 7c add $0x7c,%eax 80103c93: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103c98: 74 d6 je 80103c70 <exit+0xc0> if(p->state == SLEEPING && p->chan == chan) 80103c9a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103c9e: 75 f0 jne 80103c90 <exit+0xe0> 80103ca0: 3b 48 20 cmp 0x20(%eax),%ecx 80103ca3: 75 eb jne 80103c90 <exit+0xe0> p->state = RUNNABLE; 80103ca5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103cac: eb e2 jmp 80103c90 <exit+0xe0> wakeup1(initproc); } } // Jump into the scheduler, never to return. curproc->state = ZOMBIE; 80103cae: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80103cb5: e8 36 fe ff ff call 80103af0 <sched> panic("zombie exit"); 80103cba: 83 ec 0c sub $0xc,%esp 80103cbd: 68 3d 75 10 80 push $0x8010753d 80103cc2: e8 a9 c6 ff ff call 80100370 <panic> struct proc *curproc = myproc(); struct proc *p; int fd; if(curproc == initproc) panic("init exiting"); 80103cc7: 83 ec 0c sub $0xc,%esp 80103cca: 68 30 75 10 80 push $0x80107530 80103ccf: e8 9c c6 ff ff call 80100370 <panic> 80103cd4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103cda: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103ce0 <yield>: } // Give up the CPU for one scheduling round. void yield(void) { 80103ce0: 55 push %ebp 80103ce1: 89 e5 mov %esp,%ebp 80103ce3: 53 push %ebx 80103ce4: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80103ce7: 68 20 2d 11 80 push $0x80112d20 80103cec: e8 4f 06 00 00 call 80104340 <acquire> // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103cf1: e8 0a 06 00 00 call 80104300 <pushcli> c = mycpu(); 80103cf6: e8 e5 f9 ff ff call 801036e0 <mycpu> p = c->proc; 80103cfb: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d01: e8 ea 06 00 00 call 801043f0 <popcli> // Give up the CPU for one scheduling round. void yield(void) { acquire(&ptable.lock); //DOC: yieldlock myproc()->state = RUNNABLE; 80103d06: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 80103d0d: e8 de fd ff ff call 80103af0 <sched> release(&ptable.lock); 80103d12: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103d19: e8 42 07 00 00 call 80104460 <release> } 80103d1e: 83 c4 10 add $0x10,%esp 80103d21: 8b 5d fc mov -0x4(%ebp),%ebx 80103d24: c9 leave 80103d25: c3 ret 80103d26: 8d 76 00 lea 0x0(%esi),%esi 80103d29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103d30 <sleep>: // Atomically release lock and sleep on chan. // Reacquires lock when awakened. void sleep(void *chan, struct spinlock *lk) { 80103d30: 55 push %ebp 80103d31: 89 e5 mov %esp,%ebp 80103d33: 57 push %edi 80103d34: 56 push %esi 80103d35: 53 push %ebx 80103d36: 83 ec 0c sub $0xc,%esp 80103d39: 8b 7d 08 mov 0x8(%ebp),%edi 80103d3c: 8b 75 0c mov 0xc(%ebp),%esi // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103d3f: e8 bc 05 00 00 call 80104300 <pushcli> c = mycpu(); 80103d44: e8 97 f9 ff ff call 801036e0 <mycpu> p = c->proc; 80103d49: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d4f: e8 9c 06 00 00 call 801043f0 <popcli> void sleep(void *chan, struct spinlock *lk) { struct proc *p = myproc(); if(p == 0) 80103d54: 85 db test %ebx,%ebx 80103d56: 0f 84 87 00 00 00 je 80103de3 <sleep+0xb3> panic("sleep"); if(lk == 0) 80103d5c: 85 f6 test %esi,%esi 80103d5e: 74 76 je 80103dd6 <sleep+0xa6> // change p->state and then call sched. // Once we hold ptable.lock, we can be // guaranteed that we won't miss any wakeup // (wakeup runs with ptable.lock locked), // so it's okay to release lk. if(lk != &ptable.lock){ //DOC: sleeplock0 80103d60: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi 80103d66: 74 50 je 80103db8 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 80103d68: 83 ec 0c sub $0xc,%esp 80103d6b: 68 20 2d 11 80 push $0x80112d20 80103d70: e8 cb 05 00 00 call 80104340 <acquire> release(lk); 80103d75: 89 34 24 mov %esi,(%esp) 80103d78: e8 e3 06 00 00 call 80104460 <release> } // Go to sleep. p->chan = chan; 80103d7d: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103d80: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103d87: e8 64 fd ff ff call 80103af0 <sched> // Tidy up. p->chan = 0; 80103d8c: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) // Reacquire original lock. if(lk != &ptable.lock){ //DOC: sleeplock2 release(&ptable.lock); 80103d93: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103d9a: e8 c1 06 00 00 call 80104460 <release> acquire(lk); 80103d9f: 89 75 08 mov %esi,0x8(%ebp) 80103da2: 83 c4 10 add $0x10,%esp } } 80103da5: 8d 65 f4 lea -0xc(%ebp),%esp 80103da8: 5b pop %ebx 80103da9: 5e pop %esi 80103daa: 5f pop %edi 80103dab: 5d pop %ebp p->chan = 0; // Reacquire original lock. if(lk != &ptable.lock){ //DOC: sleeplock2 release(&ptable.lock); acquire(lk); 80103dac: e9 8f 05 00 00 jmp 80104340 <acquire> 80103db1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(lk != &ptable.lock){ //DOC: sleeplock0 acquire(&ptable.lock); //DOC: sleeplock1 release(lk); } // Go to sleep. p->chan = chan; 80103db8: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103dbb: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103dc2: e8 29 fd ff ff call 80103af0 <sched> // Tidy up. p->chan = 0; 80103dc7: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) // Reacquire original lock. if(lk != &ptable.lock){ //DOC: sleeplock2 release(&ptable.lock); acquire(lk); } } 80103dce: 8d 65 f4 lea -0xc(%ebp),%esp 80103dd1: 5b pop %ebx 80103dd2: 5e pop %esi 80103dd3: 5f pop %edi 80103dd4: 5d pop %ebp 80103dd5: c3 ret if(p == 0) panic("sleep"); if(lk == 0) panic("sleep without lk"); 80103dd6: 83 ec 0c sub $0xc,%esp 80103dd9: 68 4f 75 10 80 push $0x8010754f 80103dde: e8 8d c5 ff ff call 80100370 <panic> sleep(void *chan, struct spinlock *lk) { struct proc *p = myproc(); if(p == 0) panic("sleep"); 80103de3: 83 ec 0c sub $0xc,%esp 80103de6: 68 49 75 10 80 push $0x80107549 80103deb: e8 80 c5 ff ff call 80100370 <panic> 80103df0 <wait>: // Wait for a child process to exit and return its pid. // Return -1 if this process has no children. int wait(void) { 80103df0: 55 push %ebp 80103df1: 89 e5 mov %esp,%ebp 80103df3: 56 push %esi 80103df4: 53 push %ebx // while reading proc from the cpu structure struct proc* myproc(void) { struct cpu *c; struct proc *p; pushcli(); 80103df5: e8 06 05 00 00 call 80104300 <pushcli> c = mycpu(); 80103dfa: e8 e1 f8 ff ff call 801036e0 <mycpu> p = c->proc; 80103dff: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103e05: e8 e6 05 00 00 call 801043f0 <popcli> { struct proc *p; int havekids, pid; struct proc *curproc = myproc(); acquire(&ptable.lock); 80103e0a: 83 ec 0c sub $0xc,%esp 80103e0d: 68 20 2d 11 80 push $0x80112d20 80103e12: e8 29 05 00 00 call 80104340 <acquire> 80103e17: 83 c4 10 add $0x10,%esp for(;;){ // Scan through table looking for exited children. havekids = 0; 80103e1a: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e1c: bb 54 2d 11 80 mov $0x80112d54,%ebx 80103e21: eb 10 jmp 80103e33 <wait+0x43> 80103e23: 90 nop 80103e24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103e28: 83 c3 7c add $0x7c,%ebx 80103e2b: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103e31: 74 1d je 80103e50 <wait+0x60> if(p->parent != curproc) 80103e33: 39 73 14 cmp %esi,0x14(%ebx) 80103e36: 75 f0 jne 80103e28 <wait+0x38> continue; havekids = 1; if(p->state == ZOMBIE){ 80103e38: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 80103e3c: 74 30 je 80103e6e <wait+0x7e> acquire(&ptable.lock); for(;;){ // Scan through table looking for exited children. havekids = 0; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e3e: 83 c3 7c add $0x7c,%ebx if(p->parent != curproc) continue; havekids = 1; 80103e41: b8 01 00 00 00 mov $0x1,%eax acquire(&ptable.lock); for(;;){ // Scan through table looking for exited children. havekids = 0; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e46: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103e4c: 75 e5 jne 80103e33 <wait+0x43> 80103e4e: 66 90 xchg %ax,%ax return pid; } } // No point waiting if we don't have any children. if(!havekids || curproc->killed){ 80103e50: 85 c0 test %eax,%eax 80103e52: 74 70 je 80103ec4 <wait+0xd4> 80103e54: 8b 46 24 mov 0x24(%esi),%eax 80103e57: 85 c0 test %eax,%eax 80103e59: 75 69 jne 80103ec4 <wait+0xd4> release(&ptable.lock); return -1; } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep 80103e5b: 83 ec 08 sub $0x8,%esp 80103e5e: 68 20 2d 11 80 push $0x80112d20 80103e63: 56 push %esi 80103e64: e8 c7 fe ff ff call 80103d30 <sleep> } 80103e69: 83 c4 10 add $0x10,%esp 80103e6c: eb ac jmp 80103e1a <wait+0x2a> continue; havekids = 1; if(p->state == ZOMBIE){ // Found one. pid = p->pid; kfree(p->kstack); 80103e6e: 83 ec 0c sub $0xc,%esp 80103e71: ff 73 08 pushl 0x8(%ebx) if(p->parent != curproc) continue; havekids = 1; if(p->state == ZOMBIE){ // Found one. pid = p->pid; 80103e74: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 80103e77: e8 64 e4 ff ff call 801022e0 <kfree> p->kstack = 0; freevm(p->pgdir); 80103e7c: 5a pop %edx 80103e7d: ff 73 04 pushl 0x4(%ebx) havekids = 1; if(p->state == ZOMBIE){ // Found one. pid = p->pid; kfree(p->kstack); p->kstack = 0; 80103e80: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80103e87: e8 b4 2d 00 00 call 80106c40 <freevm> p->pid = 0; 80103e8c: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 80103e93: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 80103e9a: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 80103e9e: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 80103ea5: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80103eac: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103eb3: e8 a8 05 00 00 call 80104460 <release> return pid; 80103eb8: 83 c4 10 add $0x10,%esp } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep } } 80103ebb: 8d 65 f8 lea -0x8(%ebp),%esp p->parent = 0; p->name[0] = 0; p->killed = 0; p->state = UNUSED; release(&ptable.lock); return pid; 80103ebe: 89 f0 mov %esi,%eax } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep } } 80103ec0: 5b pop %ebx 80103ec1: 5e pop %esi 80103ec2: 5d pop %ebp 80103ec3: c3 ret } } // No point waiting if we don't have any children. if(!havekids || curproc->killed){ release(&ptable.lock); 80103ec4: 83 ec 0c sub $0xc,%esp 80103ec7: 68 20 2d 11 80 push $0x80112d20 80103ecc: e8 8f 05 00 00 call 80104460 <release> return -1; 80103ed1: 83 c4 10 add $0x10,%esp } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep } } 80103ed4: 8d 65 f8 lea -0x8(%ebp),%esp } // No point waiting if we don't have any children. if(!havekids || curproc->killed){ release(&ptable.lock); return -1; 80103ed7: b8 ff ff ff ff mov $0xffffffff,%eax } // Wait for children to exit. (See wakeup1 call in proc_exit.) sleep(curproc, &ptable.lock); //DOC: wait-sleep } } 80103edc: 5b pop %ebx 80103edd: 5e pop %esi 80103ede: 5d pop %ebp 80103edf: c3 ret 80103ee0 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80103ee0: 55 push %ebp 80103ee1: 89 e5 mov %esp,%ebp 80103ee3: 53 push %ebx 80103ee4: 83 ec 10 sub $0x10,%esp 80103ee7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 80103eea: 68 20 2d 11 80 push $0x80112d20 80103eef: e8 4c 04 00 00 call 80104340 <acquire> 80103ef4: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103ef7: b8 54 2d 11 80 mov $0x80112d54,%eax 80103efc: eb 0c jmp 80103f0a <wakeup+0x2a> 80103efe: 66 90 xchg %ax,%ax 80103f00: 83 c0 7c add $0x7c,%eax 80103f03: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103f08: 74 1c je 80103f26 <wakeup+0x46> if(p->state == SLEEPING && p->chan == chan) 80103f0a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103f0e: 75 f0 jne 80103f00 <wakeup+0x20> 80103f10: 3b 58 20 cmp 0x20(%eax),%ebx 80103f13: 75 eb jne 80103f00 <wakeup+0x20> p->state = RUNNABLE; 80103f15: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f1c: 83 c0 7c add $0x7c,%eax 80103f1f: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103f24: 75 e4 jne 80103f0a <wakeup+0x2a> void wakeup(void *chan) { acquire(&ptable.lock); wakeup1(chan); release(&ptable.lock); 80103f26: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp) } 80103f2d: 8b 5d fc mov -0x4(%ebp),%ebx 80103f30: c9 leave void wakeup(void *chan) { acquire(&ptable.lock); wakeup1(chan); release(&ptable.lock); 80103f31: e9 2a 05 00 00 jmp 80104460 <release> 80103f36: 8d 76 00 lea 0x0(%esi),%esi 80103f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103f40 <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) { 80103f40: 55 push %ebp 80103f41: 89 e5 mov %esp,%ebp 80103f43: 53 push %ebx 80103f44: 83 ec 10 sub $0x10,%esp 80103f47: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 80103f4a: 68 20 2d 11 80 push $0x80112d20 80103f4f: e8 ec 03 00 00 call 80104340 <acquire> 80103f54: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103f57: b8 54 2d 11 80 mov $0x80112d54,%eax 80103f5c: eb 0c jmp 80103f6a <kill+0x2a> 80103f5e: 66 90 xchg %ax,%ax 80103f60: 83 c0 7c add $0x7c,%eax 80103f63: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103f68: 74 3e je 80103fa8 <kill+0x68> if(p->pid == pid){ 80103f6a: 39 58 10 cmp %ebx,0x10(%eax) 80103f6d: 75 f1 jne 80103f60 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 80103f6f: 83 78 0c 02 cmpl $0x2,0xc(%eax) struct proc *p; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->pid == pid){ p->killed = 1; 80103f73: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) // Wake process from sleep if necessary. if(p->state == SLEEPING) 80103f7a: 74 1c je 80103f98 <kill+0x58> p->state = RUNNABLE; release(&ptable.lock); 80103f7c: 83 ec 0c sub $0xc,%esp 80103f7f: 68 20 2d 11 80 push $0x80112d20 80103f84: e8 d7 04 00 00 call 80104460 <release> return 0; 80103f89: 83 c4 10 add $0x10,%esp 80103f8c: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80103f8e: 8b 5d fc mov -0x4(%ebp),%ebx 80103f91: c9 leave 80103f92: c3 ret 80103f93: 90 nop 80103f94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->pid == pid){ p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) p->state = RUNNABLE; 80103f98: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103f9f: eb db jmp 80103f7c <kill+0x3c> 80103fa1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&ptable.lock); return 0; } } release(&ptable.lock); 80103fa8: 83 ec 0c sub $0xc,%esp 80103fab: 68 20 2d 11 80 push $0x80112d20 80103fb0: e8 ab 04 00 00 call 80104460 <release> return -1; 80103fb5: 83 c4 10 add $0x10,%esp 80103fb8: b8 ff ff ff ff mov $0xffffffff,%eax } 80103fbd: 8b 5d fc mov -0x4(%ebp),%ebx 80103fc0: c9 leave 80103fc1: c3 ret 80103fc2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103fc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103fd0 <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) { 80103fd0: 55 push %ebp 80103fd1: 89 e5 mov %esp,%ebp 80103fd3: 57 push %edi 80103fd4: 56 push %esi 80103fd5: 53 push %ebx 80103fd6: 8d 75 e8 lea -0x18(%ebp),%esi 80103fd9: bb c0 2d 11 80 mov $0x80112dc0,%ebx 80103fde: 83 ec 3c sub $0x3c,%esp 80103fe1: eb 24 jmp 80104007 <procdump+0x37> 80103fe3: 90 nop 80103fe4: 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"); 80103fe8: 83 ec 0c sub $0xc,%esp 80103feb: 68 80 75 10 80 push $0x80107580 80103ff0: e8 6b c6 ff ff call 80100660 <cprintf> 80103ff5: 83 c4 10 add $0x10,%esp 80103ff8: 83 c3 7c add $0x7c,%ebx int i; struct proc *p; char *state; uint pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103ffb: 81 fb c0 4c 11 80 cmp $0x80114cc0,%ebx 80104001: 0f 84 81 00 00 00 je 80104088 <procdump+0xb8> if(p->state == UNUSED) 80104007: 8b 43 a0 mov -0x60(%ebx),%eax 8010400a: 85 c0 test %eax,%eax 8010400c: 74 ea je 80103ff8 <procdump+0x28> continue; if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8010400e: 83 f8 05 cmp $0x5,%eax state = states[p->state]; else state = "???"; 80104011: ba 60 75 10 80 mov $0x80107560,%edx uint pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->state == UNUSED) continue; if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80104016: 77 11 ja 80104029 <procdump+0x59> 80104018: 8b 14 85 04 76 10 80 mov -0x7fef89fc(,%eax,4),%edx state = states[p->state]; else state = "???"; 8010401f: b8 60 75 10 80 mov $0x80107560,%eax 80104024: 85 d2 test %edx,%edx 80104026: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 80104029: 53 push %ebx 8010402a: 52 push %edx 8010402b: ff 73 a4 pushl -0x5c(%ebx) 8010402e: 68 64 75 10 80 push $0x80107564 80104033: e8 28 c6 ff ff call 80100660 <cprintf> if(p->state == SLEEPING){ 80104038: 83 c4 10 add $0x10,%esp 8010403b: 83 7b a0 02 cmpl $0x2,-0x60(%ebx) 8010403f: 75 a7 jne 80103fe8 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 80104041: 8d 45 c0 lea -0x40(%ebp),%eax 80104044: 83 ec 08 sub $0x8,%esp 80104047: 8d 7d c0 lea -0x40(%ebp),%edi 8010404a: 50 push %eax 8010404b: 8b 43 b0 mov -0x50(%ebx),%eax 8010404e: 8b 40 0c mov 0xc(%eax),%eax 80104051: 83 c0 08 add $0x8,%eax 80104054: 50 push %eax 80104055: e8 06 02 00 00 call 80104260 <getcallerpcs> 8010405a: 83 c4 10 add $0x10,%esp 8010405d: 8d 76 00 lea 0x0(%esi),%esi for(i=0; i<10 && pc[i] != 0; i++) 80104060: 8b 17 mov (%edi),%edx 80104062: 85 d2 test %edx,%edx 80104064: 74 82 je 80103fe8 <procdump+0x18> cprintf(" %p", pc[i]); 80104066: 83 ec 08 sub $0x8,%esp 80104069: 83 c7 04 add $0x4,%edi 8010406c: 52 push %edx 8010406d: 68 a1 6f 10 80 push $0x80106fa1 80104072: e8 e9 c5 ff ff call 80100660 <cprintf> else state = "???"; cprintf("%d %s %s", p->pid, state, p->name); if(p->state == SLEEPING){ getcallerpcs((uint*)p->context->ebp+2, pc); for(i=0; i<10 && pc[i] != 0; i++) 80104077: 83 c4 10 add $0x10,%esp 8010407a: 39 f7 cmp %esi,%edi 8010407c: 75 e2 jne 80104060 <procdump+0x90> 8010407e: e9 65 ff ff ff jmp 80103fe8 <procdump+0x18> 80104083: 90 nop 80104084: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf(" %p", pc[i]); } cprintf("\n"); } } 80104088: 8d 65 f4 lea -0xc(%ebp),%esp 8010408b: 5b pop %ebx 8010408c: 5e pop %esi 8010408d: 5f pop %edi 8010408e: 5d pop %ebp 8010408f: c3 ret 80104090 <cps>: int cps() { 80104090: 55 push %ebp 80104091: 89 e5 mov %esp,%ebp 80104093: 53 push %ebx 80104094: 83 ec 10 sub $0x10,%esp } static inline void sti(void) { asm volatile("sti"); 80104097: fb sti struct proc *p; // Enable interrupts on this processor. sti(); // Loop over process table looking for process with pid. acquire(&ptable.lock); 80104098: 68 20 2d 11 80 push $0x80112d20 8010409d: bb c0 2d 11 80 mov $0x80112dc0,%ebx 801040a2: e8 99 02 00 00 call 80104340 <acquire> cprintf("name \t pid \t state \n"); 801040a7: c7 04 24 6d 75 10 80 movl $0x8010756d,(%esp) 801040ae: e8 ad c5 ff ff call 80100660 <cprintf> 801040b3: 83 c4 10 add $0x10,%esp 801040b6: eb 18 jmp 801040d0 <cps+0x40> 801040b8: 90 nop 801040b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if ( p->state == SLEEPING ) cprintf("%s \t %d \t SLEEPING \n ", p->name, p->pid ); else if ( p->state == RUNNING ) 801040c0: 83 f8 04 cmp $0x4,%eax 801040c3: 74 4b je 80104110 <cps+0x80> 801040c5: 83 c3 7c add $0x7c,%ebx // Enable interrupts on this processor. sti(); // Loop over process table looking for process with pid. acquire(&ptable.lock); cprintf("name \t pid \t state \n"); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801040c8: 81 fb c0 4c 11 80 cmp $0x80114cc0,%ebx 801040ce: 74 27 je 801040f7 <cps+0x67> if ( p->state == SLEEPING ) 801040d0: 8b 43 a0 mov -0x60(%ebx),%eax 801040d3: 83 f8 02 cmp $0x2,%eax 801040d6: 75 e8 jne 801040c0 <cps+0x30> cprintf("%s \t %d \t SLEEPING \n ", p->name, p->pid ); 801040d8: 83 ec 04 sub $0x4,%esp 801040db: ff 73 a4 pushl -0x5c(%ebx) 801040de: 53 push %ebx 801040df: 68 82 75 10 80 push $0x80107582 801040e4: 83 c3 7c add $0x7c,%ebx 801040e7: e8 74 c5 ff ff call 80100660 <cprintf> 801040ec: 83 c4 10 add $0x10,%esp // Enable interrupts on this processor. sti(); // Loop over process table looking for process with pid. acquire(&ptable.lock); cprintf("name \t pid \t state \n"); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801040ef: 81 fb c0 4c 11 80 cmp $0x80114cc0,%ebx 801040f5: 75 d9 jne 801040d0 <cps+0x40> if ( p->state == SLEEPING ) cprintf("%s \t %d \t SLEEPING \n ", p->name, p->pid ); else if ( p->state == RUNNING ) cprintf("%s \t %d \t RUNNING \n ", p->name, p->pid ); } release(&ptable.lock); 801040f7: 83 ec 0c sub $0xc,%esp 801040fa: 68 20 2d 11 80 push $0x80112d20 801040ff: e8 5c 03 00 00 call 80104460 <release> return 22; } 80104104: b8 16 00 00 00 mov $0x16,%eax 80104109: 8b 5d fc mov -0x4(%ebp),%ebx 8010410c: c9 leave 8010410d: c3 ret 8010410e: 66 90 xchg %ax,%ax cprintf("name \t pid \t state \n"); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if ( p->state == SLEEPING ) cprintf("%s \t %d \t SLEEPING \n ", p->name, p->pid ); else if ( p->state == RUNNING ) cprintf("%s \t %d \t RUNNING \n ", p->name, p->pid ); 80104110: 83 ec 04 sub $0x4,%esp 80104113: ff 73 a4 pushl -0x5c(%ebx) 80104116: 53 push %ebx 80104117: 68 99 75 10 80 push $0x80107599 8010411c: e8 3f c5 ff ff call 80100660 <cprintf> 80104121: 83 c4 10 add $0x10,%esp 80104124: eb 9f jmp 801040c5 <cps+0x35> 80104126: 66 90 xchg %ax,%ax 80104128: 66 90 xchg %ax,%ax 8010412a: 66 90 xchg %ax,%ax 8010412c: 66 90 xchg %ax,%ax 8010412e: 66 90 xchg %ax,%ax 80104130 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80104130: 55 push %ebp 80104131: 89 e5 mov %esp,%ebp 80104133: 53 push %ebx 80104134: 83 ec 0c sub $0xc,%esp 80104137: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 8010413a: 68 1c 76 10 80 push $0x8010761c 8010413f: 8d 43 04 lea 0x4(%ebx),%eax 80104142: 50 push %eax 80104143: e8 f8 00 00 00 call 80104240 <initlock> lk->name = name; 80104148: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 8010414b: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 80104151: 83 c4 10 add $0x10,%esp initsleeplock(struct sleeplock *lk, char *name) { initlock(&lk->lk, "sleep lock"); lk->name = name; lk->locked = 0; lk->pid = 0; 80104154: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) void initsleeplock(struct sleeplock *lk, char *name) { initlock(&lk->lk, "sleep lock"); lk->name = name; 8010415b: 89 43 38 mov %eax,0x38(%ebx) lk->locked = 0; lk->pid = 0; } 8010415e: 8b 5d fc mov -0x4(%ebp),%ebx 80104161: c9 leave 80104162: c3 ret 80104163: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104170 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80104170: 55 push %ebp 80104171: 89 e5 mov %esp,%ebp 80104173: 56 push %esi 80104174: 53 push %ebx 80104175: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104178: 83 ec 0c sub $0xc,%esp 8010417b: 8d 73 04 lea 0x4(%ebx),%esi 8010417e: 56 push %esi 8010417f: e8 bc 01 00 00 call 80104340 <acquire> while (lk->locked) { 80104184: 8b 13 mov (%ebx),%edx 80104186: 83 c4 10 add $0x10,%esp 80104189: 85 d2 test %edx,%edx 8010418b: 74 16 je 801041a3 <acquiresleep+0x33> 8010418d: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104190: 83 ec 08 sub $0x8,%esp 80104193: 56 push %esi 80104194: 53 push %ebx 80104195: e8 96 fb ff ff call 80103d30 <sleep> void acquiresleep(struct sleeplock *lk) { acquire(&lk->lk); while (lk->locked) { 8010419a: 8b 03 mov (%ebx),%eax 8010419c: 83 c4 10 add $0x10,%esp 8010419f: 85 c0 test %eax,%eax 801041a1: 75 ed jne 80104190 <acquiresleep+0x20> sleep(lk, &lk->lk); } lk->locked = 1; 801041a3: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 801041a9: e8 d2 f5 ff ff call 80103780 <myproc> 801041ae: 8b 40 10 mov 0x10(%eax),%eax 801041b1: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 801041b4: 89 75 08 mov %esi,0x8(%ebp) } 801041b7: 8d 65 f8 lea -0x8(%ebp),%esp 801041ba: 5b pop %ebx 801041bb: 5e pop %esi 801041bc: 5d pop %ebp while (lk->locked) { sleep(lk, &lk->lk); } lk->locked = 1; lk->pid = myproc()->pid; release(&lk->lk); 801041bd: e9 9e 02 00 00 jmp 80104460 <release> 801041c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801041c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801041d0 <releasesleep>: } void releasesleep(struct sleeplock *lk) { 801041d0: 55 push %ebp 801041d1: 89 e5 mov %esp,%ebp 801041d3: 56 push %esi 801041d4: 53 push %ebx 801041d5: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 801041d8: 83 ec 0c sub $0xc,%esp 801041db: 8d 73 04 lea 0x4(%ebx),%esi 801041de: 56 push %esi 801041df: e8 5c 01 00 00 call 80104340 <acquire> lk->locked = 0; 801041e4: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 801041ea: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 801041f1: 89 1c 24 mov %ebx,(%esp) 801041f4: e8 e7 fc ff ff call 80103ee0 <wakeup> release(&lk->lk); 801041f9: 89 75 08 mov %esi,0x8(%ebp) 801041fc: 83 c4 10 add $0x10,%esp } 801041ff: 8d 65 f8 lea -0x8(%ebp),%esp 80104202: 5b pop %ebx 80104203: 5e pop %esi 80104204: 5d pop %ebp { acquire(&lk->lk); lk->locked = 0; lk->pid = 0; wakeup(lk); release(&lk->lk); 80104205: e9 56 02 00 00 jmp 80104460 <release> 8010420a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104210 <holdingsleep>: } int holdingsleep(struct sleeplock *lk) { 80104210: 55 push %ebp 80104211: 89 e5 mov %esp,%ebp 80104213: 56 push %esi 80104214: 53 push %ebx 80104215: 8b 75 08 mov 0x8(%ebp),%esi int r; acquire(&lk->lk); 80104218: 83 ec 0c sub $0xc,%esp 8010421b: 8d 5e 04 lea 0x4(%esi),%ebx 8010421e: 53 push %ebx 8010421f: e8 1c 01 00 00 call 80104340 <acquire> r = lk->locked; 80104224: 8b 36 mov (%esi),%esi release(&lk->lk); 80104226: 89 1c 24 mov %ebx,(%esp) 80104229: e8 32 02 00 00 call 80104460 <release> return r; } 8010422e: 8d 65 f8 lea -0x8(%ebp),%esp 80104231: 89 f0 mov %esi,%eax 80104233: 5b pop %ebx 80104234: 5e pop %esi 80104235: 5d pop %ebp 80104236: c3 ret 80104237: 66 90 xchg %ax,%ax 80104239: 66 90 xchg %ax,%ax 8010423b: 66 90 xchg %ax,%ax 8010423d: 66 90 xchg %ax,%ax 8010423f: 90 nop 80104240 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104240: 55 push %ebp 80104241: 89 e5 mov %esp,%ebp 80104243: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104246: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104249: c7 00 00 00 00 00 movl $0x0,(%eax) #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { lk->name = name; 8010424f: 89 50 04 mov %edx,0x4(%eax) lk->locked = 0; lk->cpu = 0; 80104252: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104259: 5d pop %ebp 8010425a: c3 ret 8010425b: 90 nop 8010425c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104260 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104260: 55 push %ebp 80104261: 89 e5 mov %esp,%ebp 80104263: 53 push %ebx uint *ebp; int i; ebp = (uint*)v - 2; 80104264: 8b 45 08 mov 0x8(%ebp),%eax } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104267: 8b 4d 0c mov 0xc(%ebp),%ecx uint *ebp; int i; ebp = (uint*)v - 2; 8010426a: 8d 50 f8 lea -0x8(%eax),%edx for(i = 0; i < 10; i++){ 8010426d: 31 c0 xor %eax,%eax 8010426f: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104270: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx 80104276: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 8010427c: 77 1a ja 80104298 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 8010427e: 8b 5a 04 mov 0x4(%edx),%ebx 80104281: 89 1c 81 mov %ebx,(%ecx,%eax,4) { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104284: 83 c0 01 add $0x1,%eax if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp 80104287: 8b 12 mov (%edx),%edx { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104289: 83 f8 0a cmp $0xa,%eax 8010428c: 75 e2 jne 80104270 <getcallerpcs+0x10> pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) pcs[i] = 0; } 8010428e: 5b pop %ebx 8010428f: 5d pop %ebp 80104290: c3 ret 80104291: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) pcs[i] = 0; 80104298: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) 8010429f: 83 c0 01 add $0x1,%eax 801042a2: 83 f8 0a cmp $0xa,%eax 801042a5: 74 e7 je 8010428e <getcallerpcs+0x2e> pcs[i] = 0; 801042a7: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) 801042ae: 83 c0 01 add $0x1,%eax 801042b1: 83 f8 0a cmp $0xa,%eax 801042b4: 75 e2 jne 80104298 <getcallerpcs+0x38> 801042b6: eb d6 jmp 8010428e <getcallerpcs+0x2e> 801042b8: 90 nop 801042b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801042c0 <holding>: } // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { 801042c0: 55 push %ebp 801042c1: 89 e5 mov %esp,%ebp 801042c3: 53 push %ebx 801042c4: 83 ec 04 sub $0x4,%esp 801042c7: 8b 55 08 mov 0x8(%ebp),%edx return lock->locked && lock->cpu == mycpu(); 801042ca: 8b 02 mov (%edx),%eax 801042cc: 85 c0 test %eax,%eax 801042ce: 75 10 jne 801042e0 <holding+0x20> } 801042d0: 83 c4 04 add $0x4,%esp 801042d3: 31 c0 xor %eax,%eax 801042d5: 5b pop %ebx 801042d6: 5d pop %ebp 801042d7: c3 ret 801042d8: 90 nop 801042d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 801042e0: 8b 5a 08 mov 0x8(%edx),%ebx 801042e3: e8 f8 f3 ff ff call 801036e0 <mycpu> 801042e8: 39 c3 cmp %eax,%ebx 801042ea: 0f 94 c0 sete %al } 801042ed: 83 c4 04 add $0x4,%esp // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 801042f0: 0f b6 c0 movzbl %al,%eax } 801042f3: 5b pop %ebx 801042f4: 5d pop %ebp 801042f5: c3 ret 801042f6: 8d 76 00 lea 0x0(%esi),%esi 801042f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104300 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 80104300: 55 push %ebp 80104301: 89 e5 mov %esp,%ebp 80104303: 53 push %ebx 80104304: 83 ec 04 sub $0x4,%esp static inline uint readeflags(void) { uint eflags; asm volatile("pushfl; popl %0" : "=r" (eflags)); 80104307: 9c pushf 80104308: 5b pop %ebx } static inline void cli(void) { asm volatile("cli"); 80104309: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 8010430a: e8 d1 f3 ff ff call 801036e0 <mycpu> 8010430f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 80104315: 85 c0 test %eax,%eax 80104317: 75 11 jne 8010432a <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 80104319: 81 e3 00 02 00 00 and $0x200,%ebx 8010431f: e8 bc f3 ff ff call 801036e0 <mycpu> 80104324: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 8010432a: e8 b1 f3 ff ff call 801036e0 <mycpu> 8010432f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 80104336: 83 c4 04 add $0x4,%esp 80104339: 5b pop %ebx 8010433a: 5d pop %ebp 8010433b: c3 ret 8010433c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104340 <acquire>: // Loops (spins) until the lock is acquired. // Holding a lock for a long time may cause // other CPUs to waste time spinning to acquire it. void acquire(struct spinlock *lk) { 80104340: 55 push %ebp 80104341: 89 e5 mov %esp,%ebp 80104343: 56 push %esi 80104344: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104345: e8 b6 ff ff ff call 80104300 <pushcli> if(holding(lk)) 8010434a: 8b 5d 08 mov 0x8(%ebp),%ebx // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 8010434d: 8b 03 mov (%ebx),%eax 8010434f: 85 c0 test %eax,%eax 80104351: 75 7d jne 801043d0 <acquire+0x90> xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 80104353: ba 01 00 00 00 mov $0x1,%edx 80104358: eb 09 jmp 80104363 <acquire+0x23> 8010435a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104360: 8b 5d 08 mov 0x8(%ebp),%ebx 80104363: 89 d0 mov %edx,%eax 80104365: f0 87 03 lock xchg %eax,(%ebx) pushcli(); // disable interrupts to avoid deadlock. if(holding(lk)) panic("acquire"); // The xchg is atomic. while(xchg(&lk->locked, 1) != 0) 80104368: 85 c0 test %eax,%eax 8010436a: 75 f4 jne 80104360 <acquire+0x20> ; // 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(); 8010436c: f0 83 0c 24 00 lock orl $0x0,(%esp) // Record info about lock acquisition for debugging. lk->cpu = mycpu(); 80104371: 8b 5d 08 mov 0x8(%ebp),%ebx 80104374: e8 67 f3 ff ff call 801036e0 <mycpu> getcallerpcs(void *v, uint pcs[]) { uint *ebp; int i; ebp = (uint*)v - 2; 80104379: 89 ea mov %ebp,%edx // references happen after the lock is acquired. __sync_synchronize(); // Record info about lock acquisition for debugging. lk->cpu = mycpu(); getcallerpcs(&lk, lk->pcs); 8010437b: 8d 4b 0c lea 0xc(%ebx),%ecx // past this point, to ensure that the critical section's memory // references happen after the lock is acquired. __sync_synchronize(); // Record info about lock acquisition for debugging. lk->cpu = mycpu(); 8010437e: 89 43 08 mov %eax,0x8(%ebx) { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 80104381: 31 c0 xor %eax,%eax 80104383: 90 nop 80104384: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104388: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx 8010438e: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 80104394: 77 1a ja 801043b0 <acquire+0x70> break; pcs[i] = ebp[1]; // saved %eip 80104396: 8b 5a 04 mov 0x4(%edx),%ebx 80104399: 89 1c 81 mov %ebx,(%ecx,%eax,4) { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 8010439c: 83 c0 01 add $0x1,%eax if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp 8010439f: 8b 12 mov (%edx),%edx { uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 801043a1: 83 f8 0a cmp $0xa,%eax 801043a4: 75 e2 jne 80104388 <acquire+0x48> __sync_synchronize(); // Record info about lock acquisition for debugging. lk->cpu = mycpu(); getcallerpcs(&lk, lk->pcs); } 801043a6: 8d 65 f8 lea -0x8(%ebp),%esp 801043a9: 5b pop %ebx 801043aa: 5e pop %esi 801043ab: 5d pop %ebp 801043ac: c3 ret 801043ad: 8d 76 00 lea 0x0(%esi),%esi break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) pcs[i] = 0; 801043b0: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) 801043b7: 83 c0 01 add $0x1,%eax 801043ba: 83 f8 0a cmp $0xa,%eax 801043bd: 74 e7 je 801043a6 <acquire+0x66> pcs[i] = 0; 801043bf: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) break; pcs[i] = ebp[1]; // saved %eip ebp = (uint*)ebp[0]; // saved %ebp } for(; i < 10; i++) 801043c6: 83 c0 01 add $0x1,%eax 801043c9: 83 f8 0a cmp $0xa,%eax 801043cc: 75 e2 jne 801043b0 <acquire+0x70> 801043ce: eb d6 jmp 801043a6 <acquire+0x66> // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 801043d0: 8b 73 08 mov 0x8(%ebx),%esi 801043d3: e8 08 f3 ff ff call 801036e0 <mycpu> 801043d8: 39 c6 cmp %eax,%esi 801043da: 0f 85 73 ff ff ff jne 80104353 <acquire+0x13> void acquire(struct spinlock *lk) { pushcli(); // disable interrupts to avoid deadlock. if(holding(lk)) panic("acquire"); 801043e0: 83 ec 0c sub $0xc,%esp 801043e3: 68 27 76 10 80 push $0x80107627 801043e8: e8 83 bf ff ff call 80100370 <panic> 801043ed: 8d 76 00 lea 0x0(%esi),%esi 801043f0 <popcli>: mycpu()->ncli += 1; } void popcli(void) { 801043f0: 55 push %ebp 801043f1: 89 e5 mov %esp,%ebp 801043f3: 83 ec 08 sub $0x8,%esp static inline uint readeflags(void) { uint eflags; 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 52 jne 8010444f <popcli+0x5f> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 801043fd: e8 de f2 ff ff call 801036e0 <mycpu> 80104402: 8b 88 a4 00 00 00 mov 0xa4(%eax),%ecx 80104408: 8d 51 ff lea -0x1(%ecx),%edx 8010440b: 85 d2 test %edx,%edx 8010440d: 89 90 a4 00 00 00 mov %edx,0xa4(%eax) 80104413: 78 2d js 80104442 <popcli+0x52> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 80104415: e8 c6 f2 ff ff call 801036e0 <mycpu> 8010441a: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80104420: 85 d2 test %edx,%edx 80104422: 74 0c je 80104430 <popcli+0x40> sti(); } 80104424: c9 leave 80104425: c3 ret 80104426: 8d 76 00 lea 0x0(%esi),%esi 80104429: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi { if(readeflags()&FL_IF) panic("popcli - interruptible"); if(--mycpu()->ncli < 0) panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 80104430: e8 ab f2 ff ff call 801036e0 <mycpu> 80104435: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 8010443b: 85 c0 test %eax,%eax 8010443d: 74 e5 je 80104424 <popcli+0x34> } static inline void sti(void) { asm volatile("sti"); 8010443f: fb sti sti(); } 80104440: c9 leave 80104441: c3 ret popcli(void) { if(readeflags()&FL_IF) panic("popcli - interruptible"); if(--mycpu()->ncli < 0) panic("popcli"); 80104442: 83 ec 0c sub $0xc,%esp 80104445: 68 46 76 10 80 push $0x80107646 8010444a: e8 21 bf ff ff call 80100370 <panic> void popcli(void) { if(readeflags()&FL_IF) panic("popcli - interruptible"); 8010444f: 83 ec 0c sub $0xc,%esp 80104452: 68 2f 76 10 80 push $0x8010762f 80104457: e8 14 bf ff ff call 80100370 <panic> 8010445c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104460 <release>: } // Release the lock. void release(struct spinlock *lk) { 80104460: 55 push %ebp 80104461: 89 e5 mov %esp,%ebp 80104463: 56 push %esi 80104464: 53 push %ebx 80104465: 8b 5d 08 mov 0x8(%ebp),%ebx // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 80104468: 8b 03 mov (%ebx),%eax 8010446a: 85 c0 test %eax,%eax 8010446c: 75 12 jne 80104480 <release+0x20> // Release the lock. void release(struct spinlock *lk) { if(!holding(lk)) panic("release"); 8010446e: 83 ec 0c sub $0xc,%esp 80104471: 68 4d 76 10 80 push $0x8010764d 80104476: e8 f5 be ff ff call 80100370 <panic> 8010447b: 90 nop 8010447c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi // Check whether this cpu is holding the lock. int holding(struct spinlock *lock) { return lock->locked && lock->cpu == mycpu(); 80104480: 8b 73 08 mov 0x8(%ebx),%esi 80104483: e8 58 f2 ff ff call 801036e0 <mycpu> 80104488: 39 c6 cmp %eax,%esi 8010448a: 75 e2 jne 8010446e <release+0xe> release(struct spinlock *lk) { if(!holding(lk)) panic("release"); lk->pcs[0] = 0; 8010448c: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 80104493: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) // Tell the C compiler and the processor to not move loads or stores // past this point, to ensure that all the stores in the critical // section are visible to other cores before the lock is released. // Both the C compiler and the hardware may re-order loads and // stores; __sync_synchronize() tells them both not to. __sync_synchronize(); 8010449a: 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) : ); 8010449f: c7 03 00 00 00 00 movl $0x0,(%ebx) popcli(); } 801044a5: 8d 65 f8 lea -0x8(%ebp),%esp 801044a8: 5b pop %ebx 801044a9: 5e pop %esi 801044aa: 5d pop %ebp // 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) : ); popcli(); 801044ab: e9 40 ff ff ff jmp 801043f0 <popcli> 801044b0 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 801044b0: 55 push %ebp 801044b1: 89 e5 mov %esp,%ebp 801044b3: 57 push %edi 801044b4: 53 push %ebx 801044b5: 8b 55 08 mov 0x8(%ebp),%edx 801044b8: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst%4 == 0 && n%4 == 0){ 801044bb: f6 c2 03 test $0x3,%dl 801044be: 75 05 jne 801044c5 <memset+0x15> 801044c0: f6 c1 03 test $0x3,%cl 801044c3: 74 13 je 801044d8 <memset+0x28> } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 801044c5: 89 d7 mov %edx,%edi 801044c7: 8b 45 0c mov 0xc(%ebp),%eax 801044ca: fc cld 801044cb: 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; } 801044cd: 5b pop %ebx 801044ce: 89 d0 mov %edx,%eax 801044d0: 5f pop %edi 801044d1: 5d pop %ebp 801044d2: c3 ret 801044d3: 90 nop 801044d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi void* memset(void *dst, int c, uint n) { if ((int)dst%4 == 0 && n%4 == 0){ c &= 0xFF; 801044d8: 0f b6 7d 0c movzbl 0xc(%ebp),%edi } static inline void stosl(void *addr, int data, int cnt) { asm volatile("cld; rep stosl" : 801044dc: c1 e9 02 shr $0x2,%ecx 801044df: 89 fb mov %edi,%ebx 801044e1: 89 f8 mov %edi,%eax 801044e3: c1 e3 18 shl $0x18,%ebx 801044e6: c1 e0 10 shl $0x10,%eax 801044e9: 09 d8 or %ebx,%eax 801044eb: 09 f8 or %edi,%eax 801044ed: c1 e7 08 shl $0x8,%edi 801044f0: 09 f8 or %edi,%eax 801044f2: 89 d7 mov %edx,%edi 801044f4: fc cld 801044f5: f3 ab rep stos %eax,%es:(%edi) stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); } else stosb(dst, c, n); return dst; } 801044f7: 5b pop %ebx 801044f8: 89 d0 mov %edx,%eax 801044fa: 5f pop %edi 801044fb: 5d pop %ebp 801044fc: c3 ret 801044fd: 8d 76 00 lea 0x0(%esi),%esi 80104500 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 80104500: 55 push %ebp 80104501: 89 e5 mov %esp,%ebp 80104503: 57 push %edi 80104504: 56 push %esi 80104505: 8b 45 10 mov 0x10(%ebp),%eax 80104508: 53 push %ebx 80104509: 8b 75 0c mov 0xc(%ebp),%esi 8010450c: 8b 5d 08 mov 0x8(%ebp),%ebx const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 8010450f: 85 c0 test %eax,%eax 80104511: 74 29 je 8010453c <memcmp+0x3c> if(*s1 != *s2) 80104513: 0f b6 13 movzbl (%ebx),%edx 80104516: 0f b6 0e movzbl (%esi),%ecx 80104519: 38 d1 cmp %dl,%cl 8010451b: 75 2b jne 80104548 <memcmp+0x48> 8010451d: 8d 78 ff lea -0x1(%eax),%edi 80104520: 31 c0 xor %eax,%eax 80104522: eb 14 jmp 80104538 <memcmp+0x38> 80104524: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104528: 0f b6 54 03 01 movzbl 0x1(%ebx,%eax,1),%edx 8010452d: 83 c0 01 add $0x1,%eax 80104530: 0f b6 0c 06 movzbl (%esi,%eax,1),%ecx 80104534: 38 ca cmp %cl,%dl 80104536: 75 10 jne 80104548 <memcmp+0x48> { const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 80104538: 39 f8 cmp %edi,%eax 8010453a: 75 ec jne 80104528 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 8010453c: 5b pop %ebx if(*s1 != *s2) return *s1 - *s2; s1++, s2++; } return 0; 8010453d: 31 c0 xor %eax,%eax } 8010453f: 5e pop %esi 80104540: 5f pop %edi 80104541: 5d pop %ebp 80104542: c3 ret 80104543: 90 nop 80104544: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi s1 = v1; s2 = v2; while(n-- > 0){ if(*s1 != *s2) return *s1 - *s2; 80104548: 0f b6 c2 movzbl %dl,%eax s1++, s2++; } return 0; } 8010454b: 5b pop %ebx s1 = v1; s2 = v2; while(n-- > 0){ if(*s1 != *s2) return *s1 - *s2; 8010454c: 29 c8 sub %ecx,%eax s1++, s2++; } return 0; } 8010454e: 5e pop %esi 8010454f: 5f pop %edi 80104550: 5d pop %ebp 80104551: c3 ret 80104552: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104559: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104560 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80104560: 55 push %ebp 80104561: 89 e5 mov %esp,%ebp 80104563: 56 push %esi 80104564: 53 push %ebx 80104565: 8b 45 08 mov 0x8(%ebp),%eax 80104568: 8b 75 0c mov 0xc(%ebp),%esi 8010456b: 8b 5d 10 mov 0x10(%ebp),%ebx const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 8010456e: 39 c6 cmp %eax,%esi 80104570: 73 2e jae 801045a0 <memmove+0x40> 80104572: 8d 0c 1e lea (%esi,%ebx,1),%ecx 80104575: 39 c8 cmp %ecx,%eax 80104577: 73 27 jae 801045a0 <memmove+0x40> s += n; d += n; while(n-- > 0) 80104579: 85 db test %ebx,%ebx 8010457b: 8d 53 ff lea -0x1(%ebx),%edx 8010457e: 74 17 je 80104597 <memmove+0x37> *--d = *--s; 80104580: 29 d9 sub %ebx,%ecx 80104582: 89 cb mov %ecx,%ebx 80104584: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104588: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 8010458c: 88 0c 10 mov %cl,(%eax,%edx,1) s = src; d = dst; if(s < d && s + n > d){ s += n; d += n; while(n-- > 0) 8010458f: 83 ea 01 sub $0x1,%edx 80104592: 83 fa ff cmp $0xffffffff,%edx 80104595: 75 f1 jne 80104588 <memmove+0x28> } else while(n-- > 0) *d++ = *s++; return dst; } 80104597: 5b pop %ebx 80104598: 5e pop %esi 80104599: 5d pop %ebp 8010459a: c3 ret 8010459b: 90 nop 8010459c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi s += n; d += n; while(n-- > 0) *--d = *--s; } else while(n-- > 0) 801045a0: 31 d2 xor %edx,%edx 801045a2: 85 db test %ebx,%ebx 801045a4: 74 f1 je 80104597 <memmove+0x37> 801045a6: 8d 76 00 lea 0x0(%esi),%esi 801045a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi *d++ = *s++; 801045b0: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 801045b4: 88 0c 10 mov %cl,(%eax,%edx,1) 801045b7: 83 c2 01 add $0x1,%edx s += n; d += n; while(n-- > 0) *--d = *--s; } else while(n-- > 0) 801045ba: 39 d3 cmp %edx,%ebx 801045bc: 75 f2 jne 801045b0 <memmove+0x50> *d++ = *s++; return dst; } 801045be: 5b pop %ebx 801045bf: 5e pop %esi 801045c0: 5d pop %ebp 801045c1: c3 ret 801045c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801045c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801045d0 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 801045d0: 55 push %ebp 801045d1: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 801045d3: 5d pop %ebp // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { return memmove(dst, src, n); 801045d4: eb 8a jmp 80104560 <memmove> 801045d6: 8d 76 00 lea 0x0(%esi),%esi 801045d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801045e0 <strncmp>: } int strncmp(const char *p, const char *q, uint n) { 801045e0: 55 push %ebp 801045e1: 89 e5 mov %esp,%ebp 801045e3: 57 push %edi 801045e4: 56 push %esi 801045e5: 8b 4d 10 mov 0x10(%ebp),%ecx 801045e8: 53 push %ebx 801045e9: 8b 7d 08 mov 0x8(%ebp),%edi 801045ec: 8b 75 0c mov 0xc(%ebp),%esi while(n > 0 && *p && *p == *q) 801045ef: 85 c9 test %ecx,%ecx 801045f1: 74 37 je 8010462a <strncmp+0x4a> 801045f3: 0f b6 17 movzbl (%edi),%edx 801045f6: 0f b6 1e movzbl (%esi),%ebx 801045f9: 84 d2 test %dl,%dl 801045fb: 74 3f je 8010463c <strncmp+0x5c> 801045fd: 38 d3 cmp %dl,%bl 801045ff: 75 3b jne 8010463c <strncmp+0x5c> 80104601: 8d 47 01 lea 0x1(%edi),%eax 80104604: 01 cf add %ecx,%edi 80104606: eb 1b jmp 80104623 <strncmp+0x43> 80104608: 90 nop 80104609: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104610: 0f b6 10 movzbl (%eax),%edx 80104613: 84 d2 test %dl,%dl 80104615: 74 21 je 80104638 <strncmp+0x58> 80104617: 0f b6 19 movzbl (%ecx),%ebx 8010461a: 83 c0 01 add $0x1,%eax 8010461d: 89 ce mov %ecx,%esi 8010461f: 38 da cmp %bl,%dl 80104621: 75 19 jne 8010463c <strncmp+0x5c> 80104623: 39 c7 cmp %eax,%edi n--, p++, q++; 80104625: 8d 4e 01 lea 0x1(%esi),%ecx } int strncmp(const char *p, const char *q, uint n) { while(n > 0 && *p && *p == *q) 80104628: 75 e6 jne 80104610 <strncmp+0x30> n--, p++, q++; if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 8010462a: 5b pop %ebx strncmp(const char *p, const char *q, uint n) { while(n > 0 && *p && *p == *q) n--, p++, q++; if(n == 0) return 0; 8010462b: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; } 8010462d: 5e pop %esi 8010462e: 5f pop %edi 8010462f: 5d pop %ebp 80104630: c3 ret 80104631: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104638: 0f b6 5e 01 movzbl 0x1(%esi),%ebx { while(n > 0 && *p && *p == *q) n--, p++, q++; if(n == 0) return 0; return (uchar)*p - (uchar)*q; 8010463c: 0f b6 c2 movzbl %dl,%eax 8010463f: 29 d8 sub %ebx,%eax } 80104641: 5b pop %ebx 80104642: 5e pop %esi 80104643: 5f pop %edi 80104644: 5d pop %ebp 80104645: c3 ret 80104646: 8d 76 00 lea 0x0(%esi),%esi 80104649: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104650 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80104650: 55 push %ebp 80104651: 89 e5 mov %esp,%ebp 80104653: 56 push %esi 80104654: 53 push %ebx 80104655: 8b 45 08 mov 0x8(%ebp),%eax 80104658: 8b 5d 0c mov 0xc(%ebp),%ebx 8010465b: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 8010465e: 89 c2 mov %eax,%edx 80104660: eb 19 jmp 8010467b <strncpy+0x2b> 80104662: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104668: 83 c3 01 add $0x1,%ebx 8010466b: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 8010466f: 83 c2 01 add $0x1,%edx 80104672: 84 c9 test %cl,%cl 80104674: 88 4a ff mov %cl,-0x1(%edx) 80104677: 74 09 je 80104682 <strncpy+0x32> 80104679: 89 f1 mov %esi,%ecx 8010467b: 85 c9 test %ecx,%ecx 8010467d: 8d 71 ff lea -0x1(%ecx),%esi 80104680: 7f e6 jg 80104668 <strncpy+0x18> ; while(n-- > 0) 80104682: 31 c9 xor %ecx,%ecx 80104684: 85 f6 test %esi,%esi 80104686: 7e 17 jle 8010469f <strncpy+0x4f> 80104688: 90 nop 80104689: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 80104690: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 80104694: 89 f3 mov %esi,%ebx 80104696: 83 c1 01 add $0x1,%ecx 80104699: 29 cb sub %ecx,%ebx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) ; while(n-- > 0) 8010469b: 85 db test %ebx,%ebx 8010469d: 7f f1 jg 80104690 <strncpy+0x40> *s++ = 0; return os; } 8010469f: 5b pop %ebx 801046a0: 5e pop %esi 801046a1: 5d pop %ebp 801046a2: c3 ret 801046a3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801046a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046b0 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 801046b0: 55 push %ebp 801046b1: 89 e5 mov %esp,%ebp 801046b3: 56 push %esi 801046b4: 53 push %ebx 801046b5: 8b 4d 10 mov 0x10(%ebp),%ecx 801046b8: 8b 45 08 mov 0x8(%ebp),%eax 801046bb: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 801046be: 85 c9 test %ecx,%ecx 801046c0: 7e 26 jle 801046e8 <safestrcpy+0x38> 801046c2: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 801046c6: 89 c1 mov %eax,%ecx 801046c8: eb 17 jmp 801046e1 <safestrcpy+0x31> 801046ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 801046d0: 83 c2 01 add $0x1,%edx 801046d3: 0f b6 5a ff movzbl -0x1(%edx),%ebx 801046d7: 83 c1 01 add $0x1,%ecx 801046da: 84 db test %bl,%bl 801046dc: 88 59 ff mov %bl,-0x1(%ecx) 801046df: 74 04 je 801046e5 <safestrcpy+0x35> 801046e1: 39 f2 cmp %esi,%edx 801046e3: 75 eb jne 801046d0 <safestrcpy+0x20> ; *s = 0; 801046e5: c6 01 00 movb $0x0,(%ecx) return os; } 801046e8: 5b pop %ebx 801046e9: 5e pop %esi 801046ea: 5d pop %ebp 801046eb: c3 ret 801046ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801046f0 <strlen>: int strlen(const char *s) { 801046f0: 55 push %ebp int n; for(n = 0; s[n]; n++) 801046f1: 31 c0 xor %eax,%eax return os; } int strlen(const char *s) { 801046f3: 89 e5 mov %esp,%ebp 801046f5: 8b 55 08 mov 0x8(%ebp),%edx int n; for(n = 0; s[n]; n++) 801046f8: 80 3a 00 cmpb $0x0,(%edx) 801046fb: 74 0c je 80104709 <strlen+0x19> 801046fd: 8d 76 00 lea 0x0(%esi),%esi 80104700: 83 c0 01 add $0x1,%eax 80104703: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 80104707: 75 f7 jne 80104700 <strlen+0x10> ; return n; } 80104709: 5d pop %ebp 8010470a: c3 ret 8010470b <swtch>: # Save current register context in old # and then load register context from new. .globl swtch swtch: movl 4(%esp), %eax 8010470b: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 8010470f: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-save registers pushl %ebp 80104713: 55 push %ebp pushl %ebx 80104714: 53 push %ebx pushl %esi 80104715: 56 push %esi pushl %edi 80104716: 57 push %edi # Switch stacks movl %esp, (%eax) 80104717: 89 20 mov %esp,(%eax) movl %edx, %esp 80104719: 89 d4 mov %edx,%esp # Load new callee-save registers popl %edi 8010471b: 5f pop %edi popl %esi 8010471c: 5e pop %esi popl %ebx 8010471d: 5b pop %ebx popl %ebp 8010471e: 5d pop %ebp ret 8010471f: c3 ret 80104720 <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) { 80104720: 55 push %ebp 80104721: 89 e5 mov %esp,%ebp 80104723: 53 push %ebx 80104724: 83 ec 04 sub $0x4,%esp 80104727: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 8010472a: e8 51 f0 ff ff call 80103780 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 8010472f: 8b 00 mov (%eax),%eax 80104731: 39 d8 cmp %ebx,%eax 80104733: 76 1b jbe 80104750 <fetchint+0x30> 80104735: 8d 53 04 lea 0x4(%ebx),%edx 80104738: 39 d0 cmp %edx,%eax 8010473a: 72 14 jb 80104750 <fetchint+0x30> return -1; *ip = *(int*)(addr); 8010473c: 8b 45 0c mov 0xc(%ebp),%eax 8010473f: 8b 13 mov (%ebx),%edx 80104741: 89 10 mov %edx,(%eax) return 0; 80104743: 31 c0 xor %eax,%eax } 80104745: 83 c4 04 add $0x4,%esp 80104748: 5b pop %ebx 80104749: 5d pop %ebp 8010474a: c3 ret 8010474b: 90 nop 8010474c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fetchint(uint addr, int *ip) { struct proc *curproc = myproc(); if(addr >= curproc->sz || addr+4 > curproc->sz) return -1; 80104750: b8 ff ff ff ff mov $0xffffffff,%eax 80104755: eb ee jmp 80104745 <fetchint+0x25> 80104757: 89 f6 mov %esi,%esi 80104759: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104760 <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) { 80104760: 55 push %ebp 80104761: 89 e5 mov %esp,%ebp 80104763: 53 push %ebx 80104764: 83 ec 04 sub $0x4,%esp 80104767: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 8010476a: e8 11 f0 ff ff call 80103780 <myproc> if(addr >= curproc->sz) 8010476f: 39 18 cmp %ebx,(%eax) 80104771: 76 29 jbe 8010479c <fetchstr+0x3c> return -1; *pp = (char*)addr; 80104773: 8b 4d 0c mov 0xc(%ebp),%ecx 80104776: 89 da mov %ebx,%edx 80104778: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 8010477a: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 8010477c: 39 c3 cmp %eax,%ebx 8010477e: 73 1c jae 8010479c <fetchstr+0x3c> if(*s == 0) 80104780: 80 3b 00 cmpb $0x0,(%ebx) 80104783: 75 10 jne 80104795 <fetchstr+0x35> 80104785: eb 29 jmp 801047b0 <fetchstr+0x50> 80104787: 89 f6 mov %esi,%esi 80104789: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104790: 80 3a 00 cmpb $0x0,(%edx) 80104793: 74 1b je 801047b0 <fetchstr+0x50> if(addr >= curproc->sz) return -1; *pp = (char*)addr; ep = (char*)curproc->sz; for(s = *pp; s < ep; s++){ 80104795: 83 c2 01 add $0x1,%edx 80104798: 39 d0 cmp %edx,%eax 8010479a: 77 f4 ja 80104790 <fetchstr+0x30> if(*s == 0) return s - *pp; } return -1; } 8010479c: 83 c4 04 add $0x4,%esp { char *s, *ep; struct proc *curproc = myproc(); if(addr >= curproc->sz) return -1; 8010479f: b8 ff ff ff ff mov $0xffffffff,%eax for(s = *pp; s < ep; s++){ if(*s == 0) return s - *pp; } return -1; } 801047a4: 5b pop %ebx 801047a5: 5d pop %ebp 801047a6: c3 ret 801047a7: 89 f6 mov %esi,%esi 801047a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801047b0: 83 c4 04 add $0x4,%esp return -1; *pp = (char*)addr; ep = (char*)curproc->sz; for(s = *pp; s < ep; s++){ if(*s == 0) return s - *pp; 801047b3: 89 d0 mov %edx,%eax 801047b5: 29 d8 sub %ebx,%eax } return -1; } 801047b7: 5b pop %ebx 801047b8: 5d pop %ebp 801047b9: c3 ret 801047ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801047c0 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 801047c0: 55 push %ebp 801047c1: 89 e5 mov %esp,%ebp 801047c3: 56 push %esi 801047c4: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801047c5: e8 b6 ef ff ff call 80103780 <myproc> 801047ca: 8b 40 18 mov 0x18(%eax),%eax 801047cd: 8b 55 08 mov 0x8(%ebp),%edx 801047d0: 8b 40 44 mov 0x44(%eax),%eax 801047d3: 8d 1c 90 lea (%eax,%edx,4),%ebx // Fetch the int at addr from the current process. int fetchint(uint addr, int *ip) { struct proc *curproc = myproc(); 801047d6: e8 a5 ef ff ff call 80103780 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 801047db: 8b 00 mov (%eax),%eax // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801047dd: 8d 73 04 lea 0x4(%ebx),%esi int fetchint(uint addr, int *ip) { struct proc *curproc = myproc(); if(addr >= curproc->sz || addr+4 > curproc->sz) 801047e0: 39 c6 cmp %eax,%esi 801047e2: 73 1c jae 80104800 <argint+0x40> 801047e4: 8d 53 08 lea 0x8(%ebx),%edx 801047e7: 39 d0 cmp %edx,%eax 801047e9: 72 15 jb 80104800 <argint+0x40> return -1; *ip = *(int*)(addr); 801047eb: 8b 45 0c mov 0xc(%ebp),%eax 801047ee: 8b 53 04 mov 0x4(%ebx),%edx 801047f1: 89 10 mov %edx,(%eax) return 0; 801047f3: 31 c0 xor %eax,%eax // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); } 801047f5: 5b pop %ebx 801047f6: 5e pop %esi 801047f7: 5d pop %ebp 801047f8: c3 ret 801047f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi fetchint(uint addr, int *ip) { struct proc *curproc = myproc(); if(addr >= curproc->sz || addr+4 > curproc->sz) return -1; 80104800: b8 ff ff ff ff mov $0xffffffff,%eax 80104805: eb ee jmp 801047f5 <argint+0x35> 80104807: 89 f6 mov %esi,%esi 80104809: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104810 <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) { 80104810: 55 push %ebp 80104811: 89 e5 mov %esp,%ebp 80104813: 56 push %esi 80104814: 53 push %ebx 80104815: 83 ec 10 sub $0x10,%esp 80104818: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 8010481b: e8 60 ef ff ff call 80103780 <myproc> 80104820: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 80104822: 8d 45 f4 lea -0xc(%ebp),%eax 80104825: 83 ec 08 sub $0x8,%esp 80104828: 50 push %eax 80104829: ff 75 08 pushl 0x8(%ebp) 8010482c: e8 8f ff ff ff call 801047c0 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 80104831: c1 e8 1f shr $0x1f,%eax 80104834: 83 c4 10 add $0x10,%esp 80104837: 84 c0 test %al,%al 80104839: 75 2d jne 80104868 <argptr+0x58> 8010483b: 89 d8 mov %ebx,%eax 8010483d: c1 e8 1f shr $0x1f,%eax 80104840: 84 c0 test %al,%al 80104842: 75 24 jne 80104868 <argptr+0x58> 80104844: 8b 16 mov (%esi),%edx 80104846: 8b 45 f4 mov -0xc(%ebp),%eax 80104849: 39 c2 cmp %eax,%edx 8010484b: 76 1b jbe 80104868 <argptr+0x58> 8010484d: 01 c3 add %eax,%ebx 8010484f: 39 da cmp %ebx,%edx 80104851: 72 15 jb 80104868 <argptr+0x58> return -1; *pp = (char*)i; 80104853: 8b 55 0c mov 0xc(%ebp),%edx 80104856: 89 02 mov %eax,(%edx) return 0; 80104858: 31 c0 xor %eax,%eax } 8010485a: 8d 65 f8 lea -0x8(%ebp),%esp 8010485d: 5b pop %ebx 8010485e: 5e pop %esi 8010485f: 5d pop %ebp 80104860: c3 ret 80104861: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct proc *curproc = myproc(); if(argint(n, &i) < 0) return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) return -1; 80104868: b8 ff ff ff ff mov $0xffffffff,%eax 8010486d: eb eb jmp 8010485a <argptr+0x4a> 8010486f: 90 nop 80104870 <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) { 80104870: 55 push %ebp 80104871: 89 e5 mov %esp,%ebp 80104873: 83 ec 20 sub $0x20,%esp int addr; if(argint(n, &addr) < 0) 80104876: 8d 45 f4 lea -0xc(%ebp),%eax 80104879: 50 push %eax 8010487a: ff 75 08 pushl 0x8(%ebp) 8010487d: e8 3e ff ff ff call 801047c0 <argint> 80104882: 83 c4 10 add $0x10,%esp 80104885: 85 c0 test %eax,%eax 80104887: 78 17 js 801048a0 <argstr+0x30> return -1; return fetchstr(addr, pp); 80104889: 83 ec 08 sub $0x8,%esp 8010488c: ff 75 0c pushl 0xc(%ebp) 8010488f: ff 75 f4 pushl -0xc(%ebp) 80104892: e8 c9 fe ff ff call 80104760 <fetchstr> 80104897: 83 c4 10 add $0x10,%esp } 8010489a: c9 leave 8010489b: c3 ret 8010489c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int argstr(int n, char **pp) { int addr; if(argint(n, &addr) < 0) return -1; 801048a0: b8 ff ff ff ff mov $0xffffffff,%eax return fetchstr(addr, pp); } 801048a5: c9 leave 801048a6: c3 ret 801048a7: 89 f6 mov %esi,%esi 801048a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801048b0 <syscall>: [SYS_cps] sys_cps, }; void syscall(void) { 801048b0: 55 push %ebp 801048b1: 89 e5 mov %esp,%ebp 801048b3: 56 push %esi 801048b4: 53 push %ebx int num; struct proc *curproc = myproc(); 801048b5: e8 c6 ee ff ff call 80103780 <myproc> num = curproc->tf->eax; 801048ba: 8b 70 18 mov 0x18(%eax),%esi void syscall(void) { int num; struct proc *curproc = myproc(); 801048bd: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 801048bf: 8b 46 1c mov 0x1c(%esi),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 801048c2: 8d 50 ff lea -0x1(%eax),%edx 801048c5: 83 fa 15 cmp $0x15,%edx 801048c8: 77 1e ja 801048e8 <syscall+0x38> 801048ca: 8b 14 85 80 76 10 80 mov -0x7fef8980(,%eax,4),%edx 801048d1: 85 d2 test %edx,%edx 801048d3: 74 13 je 801048e8 <syscall+0x38> curproc->tf->eax = syscalls[num](); 801048d5: ff d2 call *%edx 801048d7: 89 46 1c mov %eax,0x1c(%esi) } else { cprintf("%d %s: unknown sys call %d\n", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } 801048da: 8d 65 f8 lea -0x8(%ebp),%esp 801048dd: 5b pop %ebx 801048de: 5e pop %esi 801048df: 5d pop %ebp 801048e0: c3 ret 801048e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi num = curproc->tf->eax; if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { curproc->tf->eax = syscalls[num](); } else { cprintf("%d %s: unknown sys call %d\n", 801048e8: 50 push %eax curproc->pid, curproc->name, num); 801048e9: 8d 43 6c lea 0x6c(%ebx),%eax num = curproc->tf->eax; if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { curproc->tf->eax = syscalls[num](); } else { cprintf("%d %s: unknown sys call %d\n", 801048ec: 50 push %eax 801048ed: ff 73 10 pushl 0x10(%ebx) 801048f0: 68 55 76 10 80 push $0x80107655 801048f5: e8 66 bd ff ff call 80100660 <cprintf> curproc->pid, curproc->name, num); curproc->tf->eax = -1; 801048fa: 8b 43 18 mov 0x18(%ebx),%eax 801048fd: 83 c4 10 add $0x10,%esp 80104900: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } } 80104907: 8d 65 f8 lea -0x8(%ebp),%esp 8010490a: 5b pop %ebx 8010490b: 5e pop %esi 8010490c: 5d pop %ebp 8010490d: c3 ret 8010490e: 66 90 xchg %ax,%ax 80104910 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104910: 55 push %ebp 80104911: 89 e5 mov %esp,%ebp 80104913: 57 push %edi 80104914: 56 push %esi 80104915: 53 push %ebx uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80104916: 8d 75 da lea -0x26(%ebp),%esi return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104919: 83 ec 44 sub $0x44,%esp 8010491c: 89 4d c0 mov %ecx,-0x40(%ebp) 8010491f: 8b 4d 08 mov 0x8(%ebp),%ecx uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80104922: 56 push %esi 80104923: 50 push %eax return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104924: 89 55 c4 mov %edx,-0x3c(%ebp) 80104927: 89 4d bc mov %ecx,-0x44(%ebp) uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 8010492a: e8 b1 d5 ff ff call 80101ee0 <nameiparent> 8010492f: 83 c4 10 add $0x10,%esp 80104932: 85 c0 test %eax,%eax 80104934: 0f 84 f6 00 00 00 je 80104a30 <create+0x120> return 0; ilock(dp); 8010493a: 83 ec 0c sub $0xc,%esp 8010493d: 89 c7 mov %eax,%edi 8010493f: 50 push %eax 80104940: e8 2b cd ff ff call 80101670 <ilock> if((ip = dirlookup(dp, name, &off)) != 0){ 80104945: 8d 45 d4 lea -0x2c(%ebp),%eax 80104948: 83 c4 0c add $0xc,%esp 8010494b: 50 push %eax 8010494c: 56 push %esi 8010494d: 57 push %edi 8010494e: e8 4d d2 ff ff call 80101ba0 <dirlookup> 80104953: 83 c4 10 add $0x10,%esp 80104956: 85 c0 test %eax,%eax 80104958: 89 c3 mov %eax,%ebx 8010495a: 74 54 je 801049b0 <create+0xa0> iunlockput(dp); 8010495c: 83 ec 0c sub $0xc,%esp 8010495f: 57 push %edi 80104960: e8 9b cf ff ff call 80101900 <iunlockput> ilock(ip); 80104965: 89 1c 24 mov %ebx,(%esp) 80104968: e8 03 cd ff ff call 80101670 <ilock> if(type == T_FILE && ip->type == T_FILE) 8010496d: 83 c4 10 add $0x10,%esp 80104970: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp) 80104975: 75 19 jne 80104990 <create+0x80> 80104977: 66 83 7b 50 02 cmpw $0x2,0x50(%ebx) 8010497c: 89 d8 mov %ebx,%eax 8010497e: 75 10 jne 80104990 <create+0x80> panic("create: dirlink"); iunlockput(dp); return ip; } 80104980: 8d 65 f4 lea -0xc(%ebp),%esp 80104983: 5b pop %ebx 80104984: 5e pop %esi 80104985: 5f pop %edi 80104986: 5d pop %ebp 80104987: c3 ret 80104988: 90 nop 80104989: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if((ip = dirlookup(dp, name, &off)) != 0){ iunlockput(dp); ilock(ip); if(type == T_FILE && ip->type == T_FILE) return ip; iunlockput(ip); 80104990: 83 ec 0c sub $0xc,%esp 80104993: 53 push %ebx 80104994: e8 67 cf ff ff call 80101900 <iunlockput> return 0; 80104999: 83 c4 10 add $0x10,%esp panic("create: dirlink"); iunlockput(dp); return ip; } 8010499c: 8d 65 f4 lea -0xc(%ebp),%esp iunlockput(dp); ilock(ip); if(type == T_FILE && ip->type == T_FILE) return ip; iunlockput(ip); return 0; 8010499f: 31 c0 xor %eax,%eax panic("create: dirlink"); iunlockput(dp); return ip; } 801049a1: 5b pop %ebx 801049a2: 5e pop %esi 801049a3: 5f pop %edi 801049a4: 5d pop %ebp 801049a5: c3 ret 801049a6: 8d 76 00 lea 0x0(%esi),%esi 801049a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return ip; iunlockput(ip); return 0; } if((ip = ialloc(dp->dev, type)) == 0) 801049b0: 0f bf 45 c4 movswl -0x3c(%ebp),%eax 801049b4: 83 ec 08 sub $0x8,%esp 801049b7: 50 push %eax 801049b8: ff 37 pushl (%edi) 801049ba: e8 41 cb ff ff call 80101500 <ialloc> 801049bf: 83 c4 10 add $0x10,%esp 801049c2: 85 c0 test %eax,%eax 801049c4: 89 c3 mov %eax,%ebx 801049c6: 0f 84 cc 00 00 00 je 80104a98 <create+0x188> panic("create: ialloc"); ilock(ip); 801049cc: 83 ec 0c sub $0xc,%esp 801049cf: 50 push %eax 801049d0: e8 9b cc ff ff call 80101670 <ilock> ip->major = major; 801049d5: 0f b7 45 c0 movzwl -0x40(%ebp),%eax 801049d9: 66 89 43 52 mov %ax,0x52(%ebx) ip->minor = minor; 801049dd: 0f b7 45 bc movzwl -0x44(%ebp),%eax 801049e1: 66 89 43 54 mov %ax,0x54(%ebx) ip->nlink = 1; 801049e5: b8 01 00 00 00 mov $0x1,%eax 801049ea: 66 89 43 56 mov %ax,0x56(%ebx) iupdate(ip); 801049ee: 89 1c 24 mov %ebx,(%esp) 801049f1: e8 ca cb ff ff call 801015c0 <iupdate> if(type == T_DIR){ // Create . and .. entries. 801049f6: 83 c4 10 add $0x10,%esp 801049f9: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp) 801049fe: 74 40 je 80104a40 <create+0x130> // No ip->nlink++ for ".": avoid cyclic ref count. if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) panic("create dots"); } if(dirlink(dp, name, ip->inum) < 0) 80104a00: 83 ec 04 sub $0x4,%esp 80104a03: ff 73 04 pushl 0x4(%ebx) 80104a06: 56 push %esi 80104a07: 57 push %edi 80104a08: e8 f3 d3 ff ff call 80101e00 <dirlink> 80104a0d: 83 c4 10 add $0x10,%esp 80104a10: 85 c0 test %eax,%eax 80104a12: 78 77 js 80104a8b <create+0x17b> panic("create: dirlink"); iunlockput(dp); 80104a14: 83 ec 0c sub $0xc,%esp 80104a17: 57 push %edi 80104a18: e8 e3 ce ff ff call 80101900 <iunlockput> return ip; 80104a1d: 83 c4 10 add $0x10,%esp } 80104a20: 8d 65 f4 lea -0xc(%ebp),%esp if(dirlink(dp, name, ip->inum) < 0) panic("create: dirlink"); iunlockput(dp); return ip; 80104a23: 89 d8 mov %ebx,%eax } 80104a25: 5b pop %ebx 80104a26: 5e pop %esi 80104a27: 5f pop %edi 80104a28: 5d pop %ebp 80104a29: c3 ret 80104a2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) return 0; 80104a30: 31 c0 xor %eax,%eax 80104a32: e9 49 ff ff ff jmp 80104980 <create+0x70> 80104a37: 89 f6 mov %esi,%esi 80104a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip->minor = minor; ip->nlink = 1; iupdate(ip); if(type == T_DIR){ // Create . and .. entries. dp->nlink++; // for ".." 80104a40: 66 83 47 56 01 addw $0x1,0x56(%edi) iupdate(dp); 80104a45: 83 ec 0c sub $0xc,%esp 80104a48: 57 push %edi 80104a49: e8 72 cb ff ff call 801015c0 <iupdate> // No ip->nlink++ for ".": avoid cyclic ref count. if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80104a4e: 83 c4 0c add $0xc,%esp 80104a51: ff 73 04 pushl 0x4(%ebx) 80104a54: 68 f8 76 10 80 push $0x801076f8 80104a59: 53 push %ebx 80104a5a: e8 a1 d3 ff ff call 80101e00 <dirlink> 80104a5f: 83 c4 10 add $0x10,%esp 80104a62: 85 c0 test %eax,%eax 80104a64: 78 18 js 80104a7e <create+0x16e> 80104a66: 83 ec 04 sub $0x4,%esp 80104a69: ff 77 04 pushl 0x4(%edi) 80104a6c: 68 f7 76 10 80 push $0x801076f7 80104a71: 53 push %ebx 80104a72: e8 89 d3 ff ff call 80101e00 <dirlink> 80104a77: 83 c4 10 add $0x10,%esp 80104a7a: 85 c0 test %eax,%eax 80104a7c: 79 82 jns 80104a00 <create+0xf0> panic("create dots"); 80104a7e: 83 ec 0c sub $0xc,%esp 80104a81: 68 eb 76 10 80 push $0x801076eb 80104a86: e8 e5 b8 ff ff call 80100370 <panic> } if(dirlink(dp, name, ip->inum) < 0) panic("create: dirlink"); 80104a8b: 83 ec 0c sub $0xc,%esp 80104a8e: 68 fa 76 10 80 push $0x801076fa 80104a93: e8 d8 b8 ff ff call 80100370 <panic> iunlockput(ip); return 0; } if((ip = ialloc(dp->dev, type)) == 0) panic("create: ialloc"); 80104a98: 83 ec 0c sub $0xc,%esp 80104a9b: 68 dc 76 10 80 push $0x801076dc 80104aa0: e8 cb b8 ff ff call 80100370 <panic> 80104aa5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104aa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104ab0 <argfd.constprop.0>: #include "fcntl.h" // Fetch the nth word-sized system call argument as a file descriptor // and return both the descriptor and the corresponding struct file. static int argfd(int n, int *pfd, struct file **pf) 80104ab0: 55 push %ebp 80104ab1: 89 e5 mov %esp,%ebp 80104ab3: 56 push %esi 80104ab4: 53 push %ebx 80104ab5: 89 c6 mov %eax,%esi { int fd; struct file *f; if(argint(n, &fd) < 0) 80104ab7: 8d 45 f4 lea -0xc(%ebp),%eax #include "fcntl.h" // Fetch the nth word-sized system call argument as a file descriptor // and return both the descriptor and the corresponding struct file. static int argfd(int n, int *pfd, struct file **pf) 80104aba: 89 d3 mov %edx,%ebx 80104abc: 83 ec 18 sub $0x18,%esp { int fd; struct file *f; if(argint(n, &fd) < 0) 80104abf: 50 push %eax 80104ac0: 6a 00 push $0x0 80104ac2: e8 f9 fc ff ff call 801047c0 <argint> 80104ac7: 83 c4 10 add $0x10,%esp 80104aca: 85 c0 test %eax,%eax 80104acc: 78 32 js 80104b00 <argfd.constprop.0+0x50> return -1; if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80104ace: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80104ad2: 77 2c ja 80104b00 <argfd.constprop.0+0x50> 80104ad4: e8 a7 ec ff ff call 80103780 <myproc> 80104ad9: 8b 55 f4 mov -0xc(%ebp),%edx 80104adc: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80104ae0: 85 c0 test %eax,%eax 80104ae2: 74 1c je 80104b00 <argfd.constprop.0+0x50> return -1; if(pfd) 80104ae4: 85 f6 test %esi,%esi 80104ae6: 74 02 je 80104aea <argfd.constprop.0+0x3a> *pfd = fd; 80104ae8: 89 16 mov %edx,(%esi) if(pf) 80104aea: 85 db test %ebx,%ebx 80104aec: 74 22 je 80104b10 <argfd.constprop.0+0x60> *pf = f; 80104aee: 89 03 mov %eax,(%ebx) return 0; 80104af0: 31 c0 xor %eax,%eax } 80104af2: 8d 65 f8 lea -0x8(%ebp),%esp 80104af5: 5b pop %ebx 80104af6: 5e pop %esi 80104af7: 5d pop %ebp 80104af8: c3 ret 80104af9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104b00: 8d 65 f8 lea -0x8(%ebp),%esp { int fd; struct file *f; if(argint(n, &fd) < 0) return -1; 80104b03: b8 ff ff ff ff mov $0xffffffff,%eax if(pfd) *pfd = fd; if(pf) *pf = f; return 0; } 80104b08: 5b pop %ebx 80104b09: 5e pop %esi 80104b0a: 5d pop %ebp 80104b0b: c3 ret 80104b0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; if(pfd) *pfd = fd; if(pf) *pf = f; return 0; 80104b10: 31 c0 xor %eax,%eax 80104b12: eb de jmp 80104af2 <argfd.constprop.0+0x42> 80104b14: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104b1a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104b20 <sys_dup>: return -1; } int sys_dup(void) { 80104b20: 55 push %ebp struct file *f; int fd; if(argfd(0, 0, &f) < 0) 80104b21: 31 c0 xor %eax,%eax return -1; } int sys_dup(void) { 80104b23: 89 e5 mov %esp,%ebp 80104b25: 56 push %esi 80104b26: 53 push %ebx struct file *f; int fd; if(argfd(0, 0, &f) < 0) 80104b27: 8d 55 f4 lea -0xc(%ebp),%edx return -1; } int sys_dup(void) { 80104b2a: 83 ec 10 sub $0x10,%esp struct file *f; int fd; if(argfd(0, 0, &f) < 0) 80104b2d: e8 7e ff ff ff call 80104ab0 <argfd.constprop.0> 80104b32: 85 c0 test %eax,%eax 80104b34: 78 1a js 80104b50 <sys_dup+0x30> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 80104b36: 31 db xor %ebx,%ebx struct file *f; int fd; if(argfd(0, 0, &f) < 0) return -1; if((fd=fdalloc(f)) < 0) 80104b38: 8b 75 f4 mov -0xc(%ebp),%esi // Takes over file reference from caller on success. static int fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); 80104b3b: e8 40 ec ff ff call 80103780 <myproc> for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ 80104b40: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80104b44: 85 d2 test %edx,%edx 80104b46: 74 18 je 80104b60 <sys_dup+0x40> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 80104b48: 83 c3 01 add $0x1,%ebx 80104b4b: 83 fb 10 cmp $0x10,%ebx 80104b4e: 75 f0 jne 80104b40 <sys_dup+0x20> return -1; if((fd=fdalloc(f)) < 0) return -1; filedup(f); return fd; } 80104b50: 8d 65 f8 lea -0x8(%ebp),%esp { struct file *f; int fd; if(argfd(0, 0, &f) < 0) return -1; 80104b53: b8 ff ff ff ff mov $0xffffffff,%eax if((fd=fdalloc(f)) < 0) return -1; filedup(f); return fd; } 80104b58: 5b pop %ebx 80104b59: 5e pop %esi 80104b5a: 5d pop %ebp 80104b5b: c3 ret 80104b5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ curproc->ofile[fd] = f; 80104b60: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) if(argfd(0, 0, &f) < 0) return -1; if((fd=fdalloc(f)) < 0) return -1; filedup(f); 80104b64: 83 ec 0c sub $0xc,%esp 80104b67: ff 75 f4 pushl -0xc(%ebp) 80104b6a: e8 71 c2 ff ff call 80100de0 <filedup> return fd; 80104b6f: 83 c4 10 add $0x10,%esp } 80104b72: 8d 65 f8 lea -0x8(%ebp),%esp if(argfd(0, 0, &f) < 0) return -1; if((fd=fdalloc(f)) < 0) return -1; filedup(f); return fd; 80104b75: 89 d8 mov %ebx,%eax } 80104b77: 5b pop %ebx 80104b78: 5e pop %esi 80104b79: 5d pop %ebp 80104b7a: c3 ret 80104b7b: 90 nop 80104b7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104b80 <sys_read>: int sys_read(void) { 80104b80: 55 push %ebp struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104b81: 31 c0 xor %eax,%eax return fd; } int sys_read(void) { 80104b83: 89 e5 mov %esp,%ebp 80104b85: 83 ec 18 sub $0x18,%esp struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104b88: 8d 55 ec lea -0x14(%ebp),%edx 80104b8b: e8 20 ff ff ff call 80104ab0 <argfd.constprop.0> 80104b90: 85 c0 test %eax,%eax 80104b92: 78 4c js 80104be0 <sys_read+0x60> 80104b94: 8d 45 f0 lea -0x10(%ebp),%eax 80104b97: 83 ec 08 sub $0x8,%esp 80104b9a: 50 push %eax 80104b9b: 6a 02 push $0x2 80104b9d: e8 1e fc ff ff call 801047c0 <argint> 80104ba2: 83 c4 10 add $0x10,%esp 80104ba5: 85 c0 test %eax,%eax 80104ba7: 78 37 js 80104be0 <sys_read+0x60> 80104ba9: 8d 45 f4 lea -0xc(%ebp),%eax 80104bac: 83 ec 04 sub $0x4,%esp 80104baf: ff 75 f0 pushl -0x10(%ebp) 80104bb2: 50 push %eax 80104bb3: 6a 01 push $0x1 80104bb5: e8 56 fc ff ff call 80104810 <argptr> 80104bba: 83 c4 10 add $0x10,%esp 80104bbd: 85 c0 test %eax,%eax 80104bbf: 78 1f js 80104be0 <sys_read+0x60> return -1; return fileread(f, p, n); 80104bc1: 83 ec 04 sub $0x4,%esp 80104bc4: ff 75 f0 pushl -0x10(%ebp) 80104bc7: ff 75 f4 pushl -0xc(%ebp) 80104bca: ff 75 ec pushl -0x14(%ebp) 80104bcd: e8 7e c3 ff ff call 80100f50 <fileread> 80104bd2: 83 c4 10 add $0x10,%esp } 80104bd5: c9 leave 80104bd6: c3 ret 80104bd7: 89 f6 mov %esi,%esi 80104bd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) return -1; 80104be0: b8 ff ff ff ff mov $0xffffffff,%eax return fileread(f, p, n); } 80104be5: c9 leave 80104be6: c3 ret 80104be7: 89 f6 mov %esi,%esi 80104be9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104bf0 <sys_write>: int sys_write(void) { 80104bf0: 55 push %ebp struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104bf1: 31 c0 xor %eax,%eax return fileread(f, p, n); } int sys_write(void) { 80104bf3: 89 e5 mov %esp,%ebp 80104bf5: 83 ec 18 sub $0x18,%esp struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104bf8: 8d 55 ec lea -0x14(%ebp),%edx 80104bfb: e8 b0 fe ff ff call 80104ab0 <argfd.constprop.0> 80104c00: 85 c0 test %eax,%eax 80104c02: 78 4c js 80104c50 <sys_write+0x60> 80104c04: 8d 45 f0 lea -0x10(%ebp),%eax 80104c07: 83 ec 08 sub $0x8,%esp 80104c0a: 50 push %eax 80104c0b: 6a 02 push $0x2 80104c0d: e8 ae fb ff ff call 801047c0 <argint> 80104c12: 83 c4 10 add $0x10,%esp 80104c15: 85 c0 test %eax,%eax 80104c17: 78 37 js 80104c50 <sys_write+0x60> 80104c19: 8d 45 f4 lea -0xc(%ebp),%eax 80104c1c: 83 ec 04 sub $0x4,%esp 80104c1f: ff 75 f0 pushl -0x10(%ebp) 80104c22: 50 push %eax 80104c23: 6a 01 push $0x1 80104c25: e8 e6 fb ff ff call 80104810 <argptr> 80104c2a: 83 c4 10 add $0x10,%esp 80104c2d: 85 c0 test %eax,%eax 80104c2f: 78 1f js 80104c50 <sys_write+0x60> return -1; return filewrite(f, p, n); 80104c31: 83 ec 04 sub $0x4,%esp 80104c34: ff 75 f0 pushl -0x10(%ebp) 80104c37: ff 75 f4 pushl -0xc(%ebp) 80104c3a: ff 75 ec pushl -0x14(%ebp) 80104c3d: e8 9e c3 ff ff call 80100fe0 <filewrite> 80104c42: 83 c4 10 add $0x10,%esp } 80104c45: c9 leave 80104c46: c3 ret 80104c47: 89 f6 mov %esi,%esi 80104c49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi struct file *f; int n; char *p; if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) return -1; 80104c50: b8 ff ff ff ff mov $0xffffffff,%eax return filewrite(f, p, n); } 80104c55: c9 leave 80104c56: c3 ret 80104c57: 89 f6 mov %esi,%esi 80104c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c60 <sys_close>: int sys_close(void) { 80104c60: 55 push %ebp 80104c61: 89 e5 mov %esp,%ebp 80104c63: 83 ec 18 sub $0x18,%esp int fd; struct file *f; if(argfd(0, &fd, &f) < 0) 80104c66: 8d 55 f4 lea -0xc(%ebp),%edx 80104c69: 8d 45 f0 lea -0x10(%ebp),%eax 80104c6c: e8 3f fe ff ff call 80104ab0 <argfd.constprop.0> 80104c71: 85 c0 test %eax,%eax 80104c73: 78 2b js 80104ca0 <sys_close+0x40> return -1; myproc()->ofile[fd] = 0; 80104c75: e8 06 eb ff ff call 80103780 <myproc> 80104c7a: 8b 55 f0 mov -0x10(%ebp),%edx fileclose(f); 80104c7d: 83 ec 0c sub $0xc,%esp int fd; struct file *f; if(argfd(0, &fd, &f) < 0) return -1; myproc()->ofile[fd] = 0; 80104c80: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80104c87: 00 fileclose(f); 80104c88: ff 75 f4 pushl -0xc(%ebp) 80104c8b: e8 a0 c1 ff ff call 80100e30 <fileclose> return 0; 80104c90: 83 c4 10 add $0x10,%esp 80104c93: 31 c0 xor %eax,%eax } 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 { int fd; struct file *f; if(argfd(0, &fd, &f) < 0) return -1; 80104ca0: b8 ff ff ff ff mov $0xffffffff,%eax myproc()->ofile[fd] = 0; fileclose(f); return 0; } 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_fstat>: int sys_fstat(void) { 80104cb0: 55 push %ebp struct file *f; struct stat *st; if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104cb1: 31 c0 xor %eax,%eax return 0; } int sys_fstat(void) { 80104cb3: 89 e5 mov %esp,%ebp 80104cb5: 83 ec 18 sub $0x18,%esp struct file *f; struct stat *st; if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104cb8: 8d 55 f0 lea -0x10(%ebp),%edx 80104cbb: e8 f0 fd ff ff call 80104ab0 <argfd.constprop.0> 80104cc0: 85 c0 test %eax,%eax 80104cc2: 78 2c js 80104cf0 <sys_fstat+0x40> 80104cc4: 8d 45 f4 lea -0xc(%ebp),%eax 80104cc7: 83 ec 04 sub $0x4,%esp 80104cca: 6a 14 push $0x14 80104ccc: 50 push %eax 80104ccd: 6a 01 push $0x1 80104ccf: e8 3c fb ff ff call 80104810 <argptr> 80104cd4: 83 c4 10 add $0x10,%esp 80104cd7: 85 c0 test %eax,%eax 80104cd9: 78 15 js 80104cf0 <sys_fstat+0x40> return -1; return filestat(f, st); 80104cdb: 83 ec 08 sub $0x8,%esp 80104cde: ff 75 f4 pushl -0xc(%ebp) 80104ce1: ff 75 f0 pushl -0x10(%ebp) 80104ce4: e8 17 c2 ff ff call 80100f00 <filestat> 80104ce9: 83 c4 10 add $0x10,%esp } 80104cec: c9 leave 80104ced: c3 ret 80104cee: 66 90 xchg %ax,%ax { struct file *f; struct stat *st; if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) return -1; 80104cf0: b8 ff ff ff ff mov $0xffffffff,%eax return filestat(f, st); } 80104cf5: c9 leave 80104cf6: c3 ret 80104cf7: 89 f6 mov %esi,%esi 80104cf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d00 <sys_link>: // Create the path new as a link to the same inode as old. int sys_link(void) { 80104d00: 55 push %ebp 80104d01: 89 e5 mov %esp,%ebp 80104d03: 57 push %edi 80104d04: 56 push %esi 80104d05: 53 push %ebx char name[DIRSIZ], *new, *old; struct inode *dp, *ip; if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104d06: 8d 45 d4 lea -0x2c(%ebp),%eax } // Create the path new as a link to the same inode as old. int sys_link(void) { 80104d09: 83 ec 34 sub $0x34,%esp char name[DIRSIZ], *new, *old; struct inode *dp, *ip; if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104d0c: 50 push %eax 80104d0d: 6a 00 push $0x0 80104d0f: e8 5c fb ff ff call 80104870 <argstr> 80104d14: 83 c4 10 add $0x10,%esp 80104d17: 85 c0 test %eax,%eax 80104d19: 0f 88 fb 00 00 00 js 80104e1a <sys_link+0x11a> 80104d1f: 8d 45 d0 lea -0x30(%ebp),%eax 80104d22: 83 ec 08 sub $0x8,%esp 80104d25: 50 push %eax 80104d26: 6a 01 push $0x1 80104d28: e8 43 fb ff ff call 80104870 <argstr> 80104d2d: 83 c4 10 add $0x10,%esp 80104d30: 85 c0 test %eax,%eax 80104d32: 0f 88 e2 00 00 00 js 80104e1a <sys_link+0x11a> return -1; begin_op(); 80104d38: e8 13 de ff ff call 80102b50 <begin_op> if((ip = namei(old)) == 0){ 80104d3d: 83 ec 0c sub $0xc,%esp 80104d40: ff 75 d4 pushl -0x2c(%ebp) 80104d43: e8 78 d1 ff ff call 80101ec0 <namei> 80104d48: 83 c4 10 add $0x10,%esp 80104d4b: 85 c0 test %eax,%eax 80104d4d: 89 c3 mov %eax,%ebx 80104d4f: 0f 84 f3 00 00 00 je 80104e48 <sys_link+0x148> end_op(); return -1; } ilock(ip); 80104d55: 83 ec 0c sub $0xc,%esp 80104d58: 50 push %eax 80104d59: e8 12 c9 ff ff call 80101670 <ilock> if(ip->type == T_DIR){ 80104d5e: 83 c4 10 add $0x10,%esp 80104d61: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104d66: 0f 84 c4 00 00 00 je 80104e30 <sys_link+0x130> iunlockput(ip); end_op(); return -1; } ip->nlink++; 80104d6c: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(ip); 80104d71: 83 ec 0c sub $0xc,%esp iunlock(ip); if((dp = nameiparent(new, name)) == 0) 80104d74: 8d 7d da lea -0x26(%ebp),%edi end_op(); return -1; } ip->nlink++; iupdate(ip); 80104d77: 53 push %ebx 80104d78: e8 43 c8 ff ff call 801015c0 <iupdate> iunlock(ip); 80104d7d: 89 1c 24 mov %ebx,(%esp) 80104d80: e8 cb c9 ff ff call 80101750 <iunlock> if((dp = nameiparent(new, name)) == 0) 80104d85: 58 pop %eax 80104d86: 5a pop %edx 80104d87: 57 push %edi 80104d88: ff 75 d0 pushl -0x30(%ebp) 80104d8b: e8 50 d1 ff ff call 80101ee0 <nameiparent> 80104d90: 83 c4 10 add $0x10,%esp 80104d93: 85 c0 test %eax,%eax 80104d95: 89 c6 mov %eax,%esi 80104d97: 74 5b je 80104df4 <sys_link+0xf4> goto bad; ilock(dp); 80104d99: 83 ec 0c sub $0xc,%esp 80104d9c: 50 push %eax 80104d9d: e8 ce c8 ff ff call 80101670 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 80104da2: 83 c4 10 add $0x10,%esp 80104da5: 8b 03 mov (%ebx),%eax 80104da7: 39 06 cmp %eax,(%esi) 80104da9: 75 3d jne 80104de8 <sys_link+0xe8> 80104dab: 83 ec 04 sub $0x4,%esp 80104dae: ff 73 04 pushl 0x4(%ebx) 80104db1: 57 push %edi 80104db2: 56 push %esi 80104db3: e8 48 d0 ff ff call 80101e00 <dirlink> 80104db8: 83 c4 10 add $0x10,%esp 80104dbb: 85 c0 test %eax,%eax 80104dbd: 78 29 js 80104de8 <sys_link+0xe8> iunlockput(dp); goto bad; } iunlockput(dp); 80104dbf: 83 ec 0c sub $0xc,%esp 80104dc2: 56 push %esi 80104dc3: e8 38 cb ff ff call 80101900 <iunlockput> iput(ip); 80104dc8: 89 1c 24 mov %ebx,(%esp) 80104dcb: e8 d0 c9 ff ff call 801017a0 <iput> end_op(); 80104dd0: e8 eb dd ff ff call 80102bc0 <end_op> return 0; 80104dd5: 83 c4 10 add $0x10,%esp 80104dd8: 31 c0 xor %eax,%eax ip->nlink--; iupdate(ip); iunlockput(ip); end_op(); return -1; } 80104dda: 8d 65 f4 lea -0xc(%ebp),%esp 80104ddd: 5b pop %ebx 80104dde: 5e pop %esi 80104ddf: 5f pop %edi 80104de0: 5d pop %ebp 80104de1: c3 ret 80104de2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if((dp = nameiparent(new, name)) == 0) goto bad; ilock(dp); if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ iunlockput(dp); 80104de8: 83 ec 0c sub $0xc,%esp 80104deb: 56 push %esi 80104dec: e8 0f cb ff ff call 80101900 <iunlockput> goto bad; 80104df1: 83 c4 10 add $0x10,%esp end_op(); return 0; bad: ilock(ip); 80104df4: 83 ec 0c sub $0xc,%esp 80104df7: 53 push %ebx 80104df8: e8 73 c8 ff ff call 80101670 <ilock> ip->nlink--; 80104dfd: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104e02: 89 1c 24 mov %ebx,(%esp) 80104e05: e8 b6 c7 ff ff call 801015c0 <iupdate> iunlockput(ip); 80104e0a: 89 1c 24 mov %ebx,(%esp) 80104e0d: e8 ee ca ff ff call 80101900 <iunlockput> end_op(); 80104e12: e8 a9 dd ff ff call 80102bc0 <end_op> return -1; 80104e17: 83 c4 10 add $0x10,%esp } 80104e1a: 8d 65 f4 lea -0xc(%ebp),%esp ilock(ip); ip->nlink--; iupdate(ip); iunlockput(ip); end_op(); return -1; 80104e1d: b8 ff ff ff ff mov $0xffffffff,%eax } 80104e22: 5b pop %ebx 80104e23: 5e pop %esi 80104e24: 5f pop %edi 80104e25: 5d pop %ebp 80104e26: c3 ret 80104e27: 89 f6 mov %esi,%esi 80104e29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; } ilock(ip); if(ip->type == T_DIR){ iunlockput(ip); 80104e30: 83 ec 0c sub $0xc,%esp 80104e33: 53 push %ebx 80104e34: e8 c7 ca ff ff call 80101900 <iunlockput> end_op(); 80104e39: e8 82 dd ff ff call 80102bc0 <end_op> return -1; 80104e3e: 83 c4 10 add $0x10,%esp 80104e41: b8 ff ff ff ff mov $0xffffffff,%eax 80104e46: eb 92 jmp 80104dda <sys_link+0xda> if(argstr(0, &old) < 0 || argstr(1, &new) < 0) return -1; begin_op(); if((ip = namei(old)) == 0){ end_op(); 80104e48: e8 73 dd ff ff call 80102bc0 <end_op> return -1; 80104e4d: b8 ff ff ff ff mov $0xffffffff,%eax 80104e52: eb 86 jmp 80104dda <sys_link+0xda> 80104e54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104e5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104e60 <sys_unlink>: return 1; } int sys_unlink(void) { 80104e60: 55 push %ebp 80104e61: 89 e5 mov %esp,%ebp 80104e63: 57 push %edi 80104e64: 56 push %esi 80104e65: 53 push %ebx struct inode *ip, *dp; struct dirent de; char name[DIRSIZ], *path; uint off; if(argstr(0, &path) < 0) 80104e66: 8d 45 c0 lea -0x40(%ebp),%eax return 1; } int sys_unlink(void) { 80104e69: 83 ec 54 sub $0x54,%esp struct inode *ip, *dp; struct dirent de; char name[DIRSIZ], *path; uint off; if(argstr(0, &path) < 0) 80104e6c: 50 push %eax 80104e6d: 6a 00 push $0x0 80104e6f: e8 fc f9 ff ff call 80104870 <argstr> 80104e74: 83 c4 10 add $0x10,%esp 80104e77: 85 c0 test %eax,%eax 80104e79: 0f 88 82 01 00 00 js 80105001 <sys_unlink+0x1a1> return -1; begin_op(); if((dp = nameiparent(path, name)) == 0){ 80104e7f: 8d 5d ca lea -0x36(%ebp),%ebx uint off; if(argstr(0, &path) < 0) return -1; begin_op(); 80104e82: e8 c9 dc ff ff call 80102b50 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80104e87: 83 ec 08 sub $0x8,%esp 80104e8a: 53 push %ebx 80104e8b: ff 75 c0 pushl -0x40(%ebp) 80104e8e: e8 4d d0 ff ff call 80101ee0 <nameiparent> 80104e93: 83 c4 10 add $0x10,%esp 80104e96: 85 c0 test %eax,%eax 80104e98: 89 45 b4 mov %eax,-0x4c(%ebp) 80104e9b: 0f 84 6a 01 00 00 je 8010500b <sys_unlink+0x1ab> end_op(); return -1; } ilock(dp); 80104ea1: 8b 75 b4 mov -0x4c(%ebp),%esi 80104ea4: 83 ec 0c sub $0xc,%esp 80104ea7: 56 push %esi 80104ea8: e8 c3 c7 ff ff call 80101670 <ilock> // Cannot unlink "." or "..". if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80104ead: 58 pop %eax 80104eae: 5a pop %edx 80104eaf: 68 f8 76 10 80 push $0x801076f8 80104eb4: 53 push %ebx 80104eb5: e8 c6 cc ff ff call 80101b80 <namecmp> 80104eba: 83 c4 10 add $0x10,%esp 80104ebd: 85 c0 test %eax,%eax 80104ebf: 0f 84 fc 00 00 00 je 80104fc1 <sys_unlink+0x161> 80104ec5: 83 ec 08 sub $0x8,%esp 80104ec8: 68 f7 76 10 80 push $0x801076f7 80104ecd: 53 push %ebx 80104ece: e8 ad cc ff ff call 80101b80 <namecmp> 80104ed3: 83 c4 10 add $0x10,%esp 80104ed6: 85 c0 test %eax,%eax 80104ed8: 0f 84 e3 00 00 00 je 80104fc1 <sys_unlink+0x161> goto bad; if((ip = dirlookup(dp, name, &off)) == 0) 80104ede: 8d 45 c4 lea -0x3c(%ebp),%eax 80104ee1: 83 ec 04 sub $0x4,%esp 80104ee4: 50 push %eax 80104ee5: 53 push %ebx 80104ee6: 56 push %esi 80104ee7: e8 b4 cc ff ff call 80101ba0 <dirlookup> 80104eec: 83 c4 10 add $0x10,%esp 80104eef: 85 c0 test %eax,%eax 80104ef1: 89 c3 mov %eax,%ebx 80104ef3: 0f 84 c8 00 00 00 je 80104fc1 <sys_unlink+0x161> goto bad; ilock(ip); 80104ef9: 83 ec 0c sub $0xc,%esp 80104efc: 50 push %eax 80104efd: e8 6e c7 ff ff call 80101670 <ilock> if(ip->nlink < 1) 80104f02: 83 c4 10 add $0x10,%esp 80104f05: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80104f0a: 0f 8e 24 01 00 00 jle 80105034 <sys_unlink+0x1d4> panic("unlink: nlink < 1"); if(ip->type == T_DIR && !isdirempty(ip)){ 80104f10: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104f15: 8d 75 d8 lea -0x28(%ebp),%esi 80104f18: 74 66 je 80104f80 <sys_unlink+0x120> iunlockput(ip); goto bad; } memset(&de, 0, sizeof(de)); 80104f1a: 83 ec 04 sub $0x4,%esp 80104f1d: 6a 10 push $0x10 80104f1f: 6a 00 push $0x0 80104f21: 56 push %esi 80104f22: e8 89 f5 ff ff call 801044b0 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104f27: 6a 10 push $0x10 80104f29: ff 75 c4 pushl -0x3c(%ebp) 80104f2c: 56 push %esi 80104f2d: ff 75 b4 pushl -0x4c(%ebp) 80104f30: e8 1b cb ff ff call 80101a50 <writei> 80104f35: 83 c4 20 add $0x20,%esp 80104f38: 83 f8 10 cmp $0x10,%eax 80104f3b: 0f 85 e6 00 00 00 jne 80105027 <sys_unlink+0x1c7> panic("unlink: writei"); if(ip->type == T_DIR){ 80104f41: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104f46: 0f 84 9c 00 00 00 je 80104fe8 <sys_unlink+0x188> dp->nlink--; iupdate(dp); } iunlockput(dp); 80104f4c: 83 ec 0c sub $0xc,%esp 80104f4f: ff 75 b4 pushl -0x4c(%ebp) 80104f52: e8 a9 c9 ff ff call 80101900 <iunlockput> ip->nlink--; 80104f57: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104f5c: 89 1c 24 mov %ebx,(%esp) 80104f5f: e8 5c c6 ff ff call 801015c0 <iupdate> iunlockput(ip); 80104f64: 89 1c 24 mov %ebx,(%esp) 80104f67: e8 94 c9 ff ff call 80101900 <iunlockput> end_op(); 80104f6c: e8 4f dc ff ff call 80102bc0 <end_op> return 0; 80104f71: 83 c4 10 add $0x10,%esp 80104f74: 31 c0 xor %eax,%eax bad: iunlockput(dp); end_op(); return -1; } 80104f76: 8d 65 f4 lea -0xc(%ebp),%esp 80104f79: 5b pop %ebx 80104f7a: 5e pop %esi 80104f7b: 5f pop %edi 80104f7c: 5d pop %ebp 80104f7d: c3 ret 80104f7e: 66 90 xchg %ax,%ax isdirempty(struct inode *dp) { int off; struct dirent de; for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80104f80: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80104f84: 76 94 jbe 80104f1a <sys_unlink+0xba> 80104f86: bf 20 00 00 00 mov $0x20,%edi 80104f8b: eb 0f jmp 80104f9c <sys_unlink+0x13c> 80104f8d: 8d 76 00 lea 0x0(%esi),%esi 80104f90: 83 c7 10 add $0x10,%edi 80104f93: 3b 7b 58 cmp 0x58(%ebx),%edi 80104f96: 0f 83 7e ff ff ff jae 80104f1a <sys_unlink+0xba> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104f9c: 6a 10 push $0x10 80104f9e: 57 push %edi 80104f9f: 56 push %esi 80104fa0: 53 push %ebx 80104fa1: e8 aa c9 ff ff call 80101950 <readi> 80104fa6: 83 c4 10 add $0x10,%esp 80104fa9: 83 f8 10 cmp $0x10,%eax 80104fac: 75 6c jne 8010501a <sys_unlink+0x1ba> panic("isdirempty: readi"); if(de.inum != 0) 80104fae: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80104fb3: 74 db je 80104f90 <sys_unlink+0x130> ilock(ip); if(ip->nlink < 1) panic("unlink: nlink < 1"); if(ip->type == T_DIR && !isdirempty(ip)){ iunlockput(ip); 80104fb5: 83 ec 0c sub $0xc,%esp 80104fb8: 53 push %ebx 80104fb9: e8 42 c9 ff ff call 80101900 <iunlockput> goto bad; 80104fbe: 83 c4 10 add $0x10,%esp end_op(); return 0; bad: iunlockput(dp); 80104fc1: 83 ec 0c sub $0xc,%esp 80104fc4: ff 75 b4 pushl -0x4c(%ebp) 80104fc7: e8 34 c9 ff ff call 80101900 <iunlockput> end_op(); 80104fcc: e8 ef db ff ff call 80102bc0 <end_op> return -1; 80104fd1: 83 c4 10 add $0x10,%esp } 80104fd4: 8d 65 f4 lea -0xc(%ebp),%esp return 0; bad: iunlockput(dp); end_op(); return -1; 80104fd7: b8 ff ff ff ff mov $0xffffffff,%eax } 80104fdc: 5b pop %ebx 80104fdd: 5e pop %esi 80104fde: 5f pop %edi 80104fdf: 5d pop %ebp 80104fe0: c3 ret 80104fe1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi memset(&de, 0, sizeof(de)); if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("unlink: writei"); if(ip->type == T_DIR){ dp->nlink--; 80104fe8: 8b 45 b4 mov -0x4c(%ebp),%eax iupdate(dp); 80104feb: 83 ec 0c sub $0xc,%esp memset(&de, 0, sizeof(de)); if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("unlink: writei"); if(ip->type == T_DIR){ dp->nlink--; 80104fee: 66 83 68 56 01 subw $0x1,0x56(%eax) iupdate(dp); 80104ff3: 50 push %eax 80104ff4: e8 c7 c5 ff ff call 801015c0 <iupdate> 80104ff9: 83 c4 10 add $0x10,%esp 80104ffc: e9 4b ff ff ff jmp 80104f4c <sys_unlink+0xec> struct dirent de; char name[DIRSIZ], *path; uint off; if(argstr(0, &path) < 0) return -1; 80105001: b8 ff ff ff ff mov $0xffffffff,%eax 80105006: e9 6b ff ff ff jmp 80104f76 <sys_unlink+0x116> begin_op(); if((dp = nameiparent(path, name)) == 0){ end_op(); 8010500b: e8 b0 db ff ff call 80102bc0 <end_op> return -1; 80105010: b8 ff ff ff ff mov $0xffffffff,%eax 80105015: e9 5c ff ff ff jmp 80104f76 <sys_unlink+0x116> int off; struct dirent de; for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("isdirempty: readi"); 8010501a: 83 ec 0c sub $0xc,%esp 8010501d: 68 1c 77 10 80 push $0x8010771c 80105022: e8 49 b3 ff ff call 80100370 <panic> goto bad; } memset(&de, 0, sizeof(de)); if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) panic("unlink: writei"); 80105027: 83 ec 0c sub $0xc,%esp 8010502a: 68 2e 77 10 80 push $0x8010772e 8010502f: e8 3c b3 ff ff call 80100370 <panic> if((ip = dirlookup(dp, name, &off)) == 0) goto bad; ilock(ip); if(ip->nlink < 1) panic("unlink: nlink < 1"); 80105034: 83 ec 0c sub $0xc,%esp 80105037: 68 0a 77 10 80 push $0x8010770a 8010503c: e8 2f b3 ff ff call 80100370 <panic> 80105041: eb 0d jmp 80105050 <sys_open> 80105043: 90 nop 80105044: 90 nop 80105045: 90 nop 80105046: 90 nop 80105047: 90 nop 80105048: 90 nop 80105049: 90 nop 8010504a: 90 nop 8010504b: 90 nop 8010504c: 90 nop 8010504d: 90 nop 8010504e: 90 nop 8010504f: 90 nop 80105050 <sys_open>: return ip; } int sys_open(void) { 80105050: 55 push %ebp 80105051: 89 e5 mov %esp,%ebp 80105053: 57 push %edi 80105054: 56 push %esi 80105055: 53 push %ebx char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 80105056: 8d 45 e0 lea -0x20(%ebp),%eax return ip; } int sys_open(void) { 80105059: 83 ec 24 sub $0x24,%esp char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 8010505c: 50 push %eax 8010505d: 6a 00 push $0x0 8010505f: e8 0c f8 ff ff call 80104870 <argstr> 80105064: 83 c4 10 add $0x10,%esp 80105067: 85 c0 test %eax,%eax 80105069: 0f 88 9e 00 00 00 js 8010510d <sys_open+0xbd> 8010506f: 8d 45 e4 lea -0x1c(%ebp),%eax 80105072: 83 ec 08 sub $0x8,%esp 80105075: 50 push %eax 80105076: 6a 01 push $0x1 80105078: e8 43 f7 ff ff call 801047c0 <argint> 8010507d: 83 c4 10 add $0x10,%esp 80105080: 85 c0 test %eax,%eax 80105082: 0f 88 85 00 00 00 js 8010510d <sys_open+0xbd> return -1; begin_op(); 80105088: e8 c3 da ff ff call 80102b50 <begin_op> if(omode & O_CREATE){ 8010508d: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80105091: 0f 85 89 00 00 00 jne 80105120 <sys_open+0xd0> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 80105097: 83 ec 0c sub $0xc,%esp 8010509a: ff 75 e0 pushl -0x20(%ebp) 8010509d: e8 1e ce ff ff call 80101ec0 <namei> 801050a2: 83 c4 10 add $0x10,%esp 801050a5: 85 c0 test %eax,%eax 801050a7: 89 c6 mov %eax,%esi 801050a9: 0f 84 8e 00 00 00 je 8010513d <sys_open+0xed> end_op(); return -1; } ilock(ip); 801050af: 83 ec 0c sub $0xc,%esp 801050b2: 50 push %eax 801050b3: e8 b8 c5 ff ff call 80101670 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 801050b8: 83 c4 10 add $0x10,%esp 801050bb: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 801050c0: 0f 84 d2 00 00 00 je 80105198 <sys_open+0x148> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 801050c6: e8 a5 bc ff ff call 80100d70 <filealloc> 801050cb: 85 c0 test %eax,%eax 801050cd: 89 c7 mov %eax,%edi 801050cf: 74 2b je 801050fc <sys_open+0xac> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 801050d1: 31 db xor %ebx,%ebx // Takes over file reference from caller on success. static int fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); 801050d3: e8 a8 e6 ff ff call 80103780 <myproc> 801050d8: 90 nop 801050d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ 801050e0: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 801050e4: 85 d2 test %edx,%edx 801050e6: 74 68 je 80105150 <sys_open+0x100> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 801050e8: 83 c3 01 add $0x1,%ebx 801050eb: 83 fb 10 cmp $0x10,%ebx 801050ee: 75 f0 jne 801050e0 <sys_open+0x90> } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ if(f) fileclose(f); 801050f0: 83 ec 0c sub $0xc,%esp 801050f3: 57 push %edi 801050f4: e8 37 bd ff ff call 80100e30 <fileclose> 801050f9: 83 c4 10 add $0x10,%esp iunlockput(ip); 801050fc: 83 ec 0c sub $0xc,%esp 801050ff: 56 push %esi 80105100: e8 fb c7 ff ff call 80101900 <iunlockput> end_op(); 80105105: e8 b6 da ff ff call 80102bc0 <end_op> return -1; 8010510a: 83 c4 10 add $0x10,%esp f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); f->writable = (omode & O_WRONLY) || (omode & O_RDWR); return fd; } 8010510d: 8d 65 f4 lea -0xc(%ebp),%esp if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ if(f) fileclose(f); iunlockput(ip); end_op(); return -1; 80105110: b8 ff ff ff ff mov $0xffffffff,%eax f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); f->writable = (omode & O_WRONLY) || (omode & O_RDWR); return fd; } 80105115: 5b pop %ebx 80105116: 5e pop %esi 80105117: 5f pop %edi 80105118: 5d pop %ebp 80105119: c3 ret 8010511a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; begin_op(); if(omode & O_CREATE){ ip = create(path, T_FILE, 0, 0); 80105120: 83 ec 0c sub $0xc,%esp 80105123: 8b 45 e0 mov -0x20(%ebp),%eax 80105126: 31 c9 xor %ecx,%ecx 80105128: 6a 00 push $0x0 8010512a: ba 02 00 00 00 mov $0x2,%edx 8010512f: e8 dc f7 ff ff call 80104910 <create> if(ip == 0){ 80105134: 83 c4 10 add $0x10,%esp 80105137: 85 c0 test %eax,%eax return -1; begin_op(); if(omode & O_CREATE){ ip = create(path, T_FILE, 0, 0); 80105139: 89 c6 mov %eax,%esi if(ip == 0){ 8010513b: 75 89 jne 801050c6 <sys_open+0x76> end_op(); 8010513d: e8 7e da ff ff call 80102bc0 <end_op> return -1; 80105142: b8 ff ff ff ff mov $0xffffffff,%eax 80105147: eb 43 jmp 8010518c <sys_open+0x13c> 80105149: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105150: 83 ec 0c sub $0xc,%esp int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ curproc->ofile[fd] = f; 80105153: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105157: 56 push %esi 80105158: e8 f3 c5 ff ff call 80101750 <iunlock> end_op(); 8010515d: e8 5e da ff ff call 80102bc0 <end_op> f->type = FD_INODE; 80105162: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 80105168: 8b 55 e4 mov -0x1c(%ebp),%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 8010516b: 83 c4 10 add $0x10,%esp } iunlock(ip); end_op(); f->type = FD_INODE; f->ip = ip; 8010516e: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 80105171: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 80105178: 89 d0 mov %edx,%eax 8010517a: 83 e0 01 and $0x1,%eax 8010517d: 83 f0 01 xor $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105180: 83 e2 03 and $0x3,%edx end_op(); f->type = FD_INODE; f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 80105183: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105186: 0f 95 47 09 setne 0x9(%edi) return fd; 8010518a: 89 d8 mov %ebx,%eax } 8010518c: 8d 65 f4 lea -0xc(%ebp),%esp 8010518f: 5b pop %ebx 80105190: 5e pop %esi 80105191: 5f pop %edi 80105192: 5d pop %ebp 80105193: c3 ret 80105194: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((ip = namei(path)) == 0){ end_op(); return -1; } ilock(ip); if(ip->type == T_DIR && omode != O_RDONLY){ 80105198: 8b 4d e4 mov -0x1c(%ebp),%ecx 8010519b: 85 c9 test %ecx,%ecx 8010519d: 0f 84 23 ff ff ff je 801050c6 <sys_open+0x76> 801051a3: e9 54 ff ff ff jmp 801050fc <sys_open+0xac> 801051a8: 90 nop 801051a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801051b0 <sys_mkdir>: return fd; } int sys_mkdir(void) { 801051b0: 55 push %ebp 801051b1: 89 e5 mov %esp,%ebp 801051b3: 83 ec 18 sub $0x18,%esp char *path; struct inode *ip; begin_op(); 801051b6: e8 95 d9 ff ff call 80102b50 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 801051bb: 8d 45 f4 lea -0xc(%ebp),%eax 801051be: 83 ec 08 sub $0x8,%esp 801051c1: 50 push %eax 801051c2: 6a 00 push $0x0 801051c4: e8 a7 f6 ff ff call 80104870 <argstr> 801051c9: 83 c4 10 add $0x10,%esp 801051cc: 85 c0 test %eax,%eax 801051ce: 78 30 js 80105200 <sys_mkdir+0x50> 801051d0: 83 ec 0c sub $0xc,%esp 801051d3: 8b 45 f4 mov -0xc(%ebp),%eax 801051d6: 31 c9 xor %ecx,%ecx 801051d8: 6a 00 push $0x0 801051da: ba 01 00 00 00 mov $0x1,%edx 801051df: e8 2c f7 ff ff call 80104910 <create> 801051e4: 83 c4 10 add $0x10,%esp 801051e7: 85 c0 test %eax,%eax 801051e9: 74 15 je 80105200 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 801051eb: 83 ec 0c sub $0xc,%esp 801051ee: 50 push %eax 801051ef: e8 0c c7 ff ff call 80101900 <iunlockput> end_op(); 801051f4: e8 c7 d9 ff ff call 80102bc0 <end_op> return 0; 801051f9: 83 c4 10 add $0x10,%esp 801051fc: 31 c0 xor %eax,%eax } 801051fe: c9 leave 801051ff: c3 ret char *path; struct inode *ip; begin_op(); if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ end_op(); 80105200: e8 bb d9 ff ff call 80102bc0 <end_op> return -1; 80105205: b8 ff ff ff ff mov $0xffffffff,%eax } iunlockput(ip); end_op(); return 0; } 8010520a: c9 leave 8010520b: c3 ret 8010520c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105210 <sys_mknod>: int sys_mknod(void) { 80105210: 55 push %ebp 80105211: 89 e5 mov %esp,%ebp 80105213: 83 ec 18 sub $0x18,%esp struct inode *ip; char *path; int major, minor; begin_op(); 80105216: e8 35 d9 ff ff call 80102b50 <begin_op> if((argstr(0, &path)) < 0 || 8010521b: 8d 45 ec lea -0x14(%ebp),%eax 8010521e: 83 ec 08 sub $0x8,%esp 80105221: 50 push %eax 80105222: 6a 00 push $0x0 80105224: e8 47 f6 ff ff call 80104870 <argstr> 80105229: 83 c4 10 add $0x10,%esp 8010522c: 85 c0 test %eax,%eax 8010522e: 78 60 js 80105290 <sys_mknod+0x80> argint(1, &major) < 0 || 80105230: 8d 45 f0 lea -0x10(%ebp),%eax 80105233: 83 ec 08 sub $0x8,%esp 80105236: 50 push %eax 80105237: 6a 01 push $0x1 80105239: e8 82 f5 ff ff call 801047c0 <argint> struct inode *ip; char *path; int major, minor; begin_op(); if((argstr(0, &path)) < 0 || 8010523e: 83 c4 10 add $0x10,%esp 80105241: 85 c0 test %eax,%eax 80105243: 78 4b js 80105290 <sys_mknod+0x80> argint(1, &major) < 0 || argint(2, &minor) < 0 || 80105245: 8d 45 f4 lea -0xc(%ebp),%eax 80105248: 83 ec 08 sub $0x8,%esp 8010524b: 50 push %eax 8010524c: 6a 02 push $0x2 8010524e: e8 6d f5 ff ff call 801047c0 <argint> char *path; int major, minor; begin_op(); if((argstr(0, &path)) < 0 || argint(1, &major) < 0 || 80105253: 83 c4 10 add $0x10,%esp 80105256: 85 c0 test %eax,%eax 80105258: 78 36 js 80105290 <sys_mknod+0x80> argint(2, &minor) < 0 || 8010525a: 0f bf 45 f4 movswl -0xc(%ebp),%eax 8010525e: 83 ec 0c sub $0xc,%esp 80105261: 0f bf 4d f0 movswl -0x10(%ebp),%ecx 80105265: ba 03 00 00 00 mov $0x3,%edx 8010526a: 50 push %eax 8010526b: 8b 45 ec mov -0x14(%ebp),%eax 8010526e: e8 9d f6 ff ff call 80104910 <create> 80105273: 83 c4 10 add $0x10,%esp 80105276: 85 c0 test %eax,%eax 80105278: 74 16 je 80105290 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ end_op(); return -1; } iunlockput(ip); 8010527a: 83 ec 0c sub $0xc,%esp 8010527d: 50 push %eax 8010527e: e8 7d c6 ff ff call 80101900 <iunlockput> end_op(); 80105283: e8 38 d9 ff ff call 80102bc0 <end_op> return 0; 80105288: 83 c4 10 add $0x10,%esp 8010528b: 31 c0 xor %eax,%eax } 8010528d: c9 leave 8010528e: c3 ret 8010528f: 90 nop begin_op(); if((argstr(0, &path)) < 0 || argint(1, &major) < 0 || argint(2, &minor) < 0 || (ip = create(path, T_DEV, major, minor)) == 0){ end_op(); 80105290: e8 2b d9 ff ff call 80102bc0 <end_op> return -1; 80105295: b8 ff ff ff ff mov $0xffffffff,%eax } iunlockput(ip); end_op(); return 0; } 8010529a: c9 leave 8010529b: c3 ret 8010529c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801052a0 <sys_chdir>: int sys_chdir(void) { 801052a0: 55 push %ebp 801052a1: 89 e5 mov %esp,%ebp 801052a3: 56 push %esi 801052a4: 53 push %ebx 801052a5: 83 ec 10 sub $0x10,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 801052a8: e8 d3 e4 ff ff call 80103780 <myproc> 801052ad: 89 c6 mov %eax,%esi begin_op(); 801052af: e8 9c d8 ff ff call 80102b50 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 801052b4: 8d 45 f4 lea -0xc(%ebp),%eax 801052b7: 83 ec 08 sub $0x8,%esp 801052ba: 50 push %eax 801052bb: 6a 00 push $0x0 801052bd: e8 ae f5 ff ff call 80104870 <argstr> 801052c2: 83 c4 10 add $0x10,%esp 801052c5: 85 c0 test %eax,%eax 801052c7: 78 77 js 80105340 <sys_chdir+0xa0> 801052c9: 83 ec 0c sub $0xc,%esp 801052cc: ff 75 f4 pushl -0xc(%ebp) 801052cf: e8 ec cb ff ff call 80101ec0 <namei> 801052d4: 83 c4 10 add $0x10,%esp 801052d7: 85 c0 test %eax,%eax 801052d9: 89 c3 mov %eax,%ebx 801052db: 74 63 je 80105340 <sys_chdir+0xa0> end_op(); return -1; } ilock(ip); 801052dd: 83 ec 0c sub $0xc,%esp 801052e0: 50 push %eax 801052e1: e8 8a c3 ff ff call 80101670 <ilock> if(ip->type != T_DIR){ 801052e6: 83 c4 10 add $0x10,%esp 801052e9: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 801052ee: 75 30 jne 80105320 <sys_chdir+0x80> iunlockput(ip); end_op(); return -1; } iunlock(ip); 801052f0: 83 ec 0c sub $0xc,%esp 801052f3: 53 push %ebx 801052f4: e8 57 c4 ff ff call 80101750 <iunlock> iput(curproc->cwd); 801052f9: 58 pop %eax 801052fa: ff 76 68 pushl 0x68(%esi) 801052fd: e8 9e c4 ff ff call 801017a0 <iput> end_op(); 80105302: e8 b9 d8 ff ff call 80102bc0 <end_op> curproc->cwd = ip; 80105307: 89 5e 68 mov %ebx,0x68(%esi) return 0; 8010530a: 83 c4 10 add $0x10,%esp 8010530d: 31 c0 xor %eax,%eax } 8010530f: 8d 65 f8 lea -0x8(%ebp),%esp 80105312: 5b pop %ebx 80105313: 5e pop %esi 80105314: 5d pop %ebp 80105315: c3 ret 80105316: 8d 76 00 lea 0x0(%esi),%esi 80105319: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi end_op(); return -1; } ilock(ip); if(ip->type != T_DIR){ iunlockput(ip); 80105320: 83 ec 0c sub $0xc,%esp 80105323: 53 push %ebx 80105324: e8 d7 c5 ff ff call 80101900 <iunlockput> end_op(); 80105329: e8 92 d8 ff ff call 80102bc0 <end_op> return -1; 8010532e: 83 c4 10 add $0x10,%esp 80105331: b8 ff ff ff ff mov $0xffffffff,%eax 80105336: eb d7 jmp 8010530f <sys_chdir+0x6f> 80105338: 90 nop 80105339: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct inode *ip; struct proc *curproc = myproc(); begin_op(); if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ end_op(); 80105340: e8 7b d8 ff ff call 80102bc0 <end_op> return -1; 80105345: b8 ff ff ff ff mov $0xffffffff,%eax 8010534a: eb c3 jmp 8010530f <sys_chdir+0x6f> 8010534c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105350 <sys_exec>: return 0; } int sys_exec(void) { 80105350: 55 push %ebp 80105351: 89 e5 mov %esp,%ebp 80105353: 57 push %edi 80105354: 56 push %esi 80105355: 53 push %ebx char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105356: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax return 0; } int sys_exec(void) { 8010535c: 81 ec a4 00 00 00 sub $0xa4,%esp char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105362: 50 push %eax 80105363: 6a 00 push $0x0 80105365: e8 06 f5 ff ff call 80104870 <argstr> 8010536a: 83 c4 10 add $0x10,%esp 8010536d: 85 c0 test %eax,%eax 8010536f: 78 7f js 801053f0 <sys_exec+0xa0> 80105371: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 80105377: 83 ec 08 sub $0x8,%esp 8010537a: 50 push %eax 8010537b: 6a 01 push $0x1 8010537d: e8 3e f4 ff ff call 801047c0 <argint> 80105382: 83 c4 10 add $0x10,%esp 80105385: 85 c0 test %eax,%eax 80105387: 78 67 js 801053f0 <sys_exec+0xa0> return -1; } memset(argv, 0, sizeof(argv)); 80105389: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 8010538f: 83 ec 04 sub $0x4,%esp 80105392: 8d b5 68 ff ff ff lea -0x98(%ebp),%esi 80105398: 68 80 00 00 00 push $0x80 8010539d: 6a 00 push $0x0 8010539f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 801053a5: 50 push %eax 801053a6: 31 db xor %ebx,%ebx 801053a8: e8 03 f1 ff ff call 801044b0 <memset> 801053ad: 83 c4 10 add $0x10,%esp for(i=0;; i++){ if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) 801053b0: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 801053b6: 83 ec 08 sub $0x8,%esp 801053b9: 57 push %edi 801053ba: 8d 04 98 lea (%eax,%ebx,4),%eax 801053bd: 50 push %eax 801053be: e8 5d f3 ff ff call 80104720 <fetchint> 801053c3: 83 c4 10 add $0x10,%esp 801053c6: 85 c0 test %eax,%eax 801053c8: 78 26 js 801053f0 <sys_exec+0xa0> return -1; if(uarg == 0){ 801053ca: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 801053d0: 85 c0 test %eax,%eax 801053d2: 74 2c je 80105400 <sys_exec+0xb0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 801053d4: 83 ec 08 sub $0x8,%esp 801053d7: 56 push %esi 801053d8: 50 push %eax 801053d9: e8 82 f3 ff ff call 80104760 <fetchstr> 801053de: 83 c4 10 add $0x10,%esp 801053e1: 85 c0 test %eax,%eax 801053e3: 78 0b js 801053f0 <sys_exec+0xa0> if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ return -1; } memset(argv, 0, sizeof(argv)); for(i=0;; i++){ 801053e5: 83 c3 01 add $0x1,%ebx 801053e8: 83 c6 04 add $0x4,%esi if(i >= NELEM(argv)) 801053eb: 83 fb 20 cmp $0x20,%ebx 801053ee: 75 c0 jne 801053b0 <sys_exec+0x60> } if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); } 801053f0: 8d 65 f4 lea -0xc(%ebp),%esp char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ return -1; 801053f3: b8 ff ff ff ff mov $0xffffffff,%eax } if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); } 801053f8: 5b pop %ebx 801053f9: 5e pop %esi 801053fa: 5f pop %edi 801053fb: 5d pop %ebp 801053fc: c3 ret 801053fd: 8d 76 00 lea 0x0(%esi),%esi break; } if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); 80105400: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105406: 83 ec 08 sub $0x8,%esp if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ argv[i] = 0; 80105409: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 80105410: 00 00 00 00 break; } if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); 80105414: 50 push %eax 80105415: ff b5 5c ff ff ff pushl -0xa4(%ebp) 8010541b: e8 d0 b5 ff ff call 801009f0 <exec> 80105420: 83 c4 10 add $0x10,%esp } 80105423: 8d 65 f4 lea -0xc(%ebp),%esp 80105426: 5b pop %ebx 80105427: 5e pop %esi 80105428: 5f pop %edi 80105429: 5d pop %ebp 8010542a: c3 ret 8010542b: 90 nop 8010542c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105430 <sys_pipe>: int sys_pipe(void) { 80105430: 55 push %ebp 80105431: 89 e5 mov %esp,%ebp 80105433: 57 push %edi 80105434: 56 push %esi 80105435: 53 push %ebx int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 80105436: 8d 45 dc lea -0x24(%ebp),%eax return exec(path, argv); } int sys_pipe(void) { 80105439: 83 ec 20 sub $0x20,%esp int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 8010543c: 6a 08 push $0x8 8010543e: 50 push %eax 8010543f: 6a 00 push $0x0 80105441: e8 ca f3 ff ff call 80104810 <argptr> 80105446: 83 c4 10 add $0x10,%esp 80105449: 85 c0 test %eax,%eax 8010544b: 78 4a js 80105497 <sys_pipe+0x67> return -1; if(pipealloc(&rf, &wf) < 0) 8010544d: 8d 45 e4 lea -0x1c(%ebp),%eax 80105450: 83 ec 08 sub $0x8,%esp 80105453: 50 push %eax 80105454: 8d 45 e0 lea -0x20(%ebp),%eax 80105457: 50 push %eax 80105458: e8 93 dd ff ff call 801031f0 <pipealloc> 8010545d: 83 c4 10 add $0x10,%esp 80105460: 85 c0 test %eax,%eax 80105462: 78 33 js 80105497 <sys_pipe+0x67> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 80105464: 31 db xor %ebx,%ebx if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) return -1; if(pipealloc(&rf, &wf) < 0) return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80105466: 8b 7d e0 mov -0x20(%ebp),%edi // Takes over file reference from caller on success. static int fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); 80105469: e8 12 e3 ff ff call 80103780 <myproc> 8010546e: 66 90 xchg %ax,%ax for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ 80105470: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 80105474: 85 f6 test %esi,%esi 80105476: 74 30 je 801054a8 <sys_pipe+0x78> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 80105478: 83 c3 01 add $0x1,%ebx 8010547b: 83 fb 10 cmp $0x10,%ebx 8010547e: 75 f0 jne 80105470 <sys_pipe+0x40> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ if(fd0 >= 0) myproc()->ofile[fd0] = 0; fileclose(rf); 80105480: 83 ec 0c sub $0xc,%esp 80105483: ff 75 e0 pushl -0x20(%ebp) 80105486: e8 a5 b9 ff ff call 80100e30 <fileclose> fileclose(wf); 8010548b: 58 pop %eax 8010548c: ff 75 e4 pushl -0x1c(%ebp) 8010548f: e8 9c b9 ff ff call 80100e30 <fileclose> return -1; 80105494: 83 c4 10 add $0x10,%esp } fd[0] = fd0; fd[1] = fd1; return 0; } 80105497: 8d 65 f4 lea -0xc(%ebp),%esp if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ if(fd0 >= 0) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; 8010549a: b8 ff ff ff ff mov $0xffffffff,%eax } fd[0] = fd0; fd[1] = fd1; return 0; } 8010549f: 5b pop %ebx 801054a0: 5e pop %esi 801054a1: 5f pop %edi 801054a2: 5d pop %ebp 801054a3: c3 ret 801054a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ curproc->ofile[fd] = f; 801054a8: 8d 73 08 lea 0x8(%ebx),%esi 801054ab: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) return -1; if(pipealloc(&rf, &wf) < 0) return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 801054af: 8b 7d e4 mov -0x1c(%ebp),%edi // Takes over file reference from caller on success. static int fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); 801054b2: e8 c9 e2 ff ff call 80103780 <myproc> for(fd = 0; fd < NOFILE; fd++){ 801054b7: 31 d2 xor %edx,%edx 801054b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(curproc->ofile[fd] == 0){ 801054c0: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 801054c4: 85 c9 test %ecx,%ecx 801054c6: 74 18 je 801054e0 <sys_pipe+0xb0> fdalloc(struct file *f) { int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ 801054c8: 83 c2 01 add $0x1,%edx 801054cb: 83 fa 10 cmp $0x10,%edx 801054ce: 75 f0 jne 801054c0 <sys_pipe+0x90> if(pipealloc(&rf, &wf) < 0) return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ if(fd0 >= 0) myproc()->ofile[fd0] = 0; 801054d0: e8 ab e2 ff ff call 80103780 <myproc> 801054d5: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 801054dc: 00 801054dd: eb a1 jmp 80105480 <sys_pipe+0x50> 801054df: 90 nop int fd; struct proc *curproc = myproc(); for(fd = 0; fd < NOFILE; fd++){ if(curproc->ofile[fd] == 0){ curproc->ofile[fd] = f; 801054e0: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 801054e4: 8b 45 dc mov -0x24(%ebp),%eax 801054e7: 89 18 mov %ebx,(%eax) fd[1] = fd1; 801054e9: 8b 45 dc mov -0x24(%ebp),%eax 801054ec: 89 50 04 mov %edx,0x4(%eax) return 0; } 801054ef: 8d 65 f4 lea -0xc(%ebp),%esp fileclose(wf); return -1; } fd[0] = fd0; fd[1] = fd1; return 0; 801054f2: 31 c0 xor %eax,%eax } 801054f4: 5b pop %ebx 801054f5: 5e pop %esi 801054f6: 5f pop %edi 801054f7: 5d pop %ebp 801054f8: c3 ret 801054f9: 66 90 xchg %ax,%ax 801054fb: 66 90 xchg %ax,%ax 801054fd: 66 90 xchg %ax,%ax 801054ff: 90 nop 80105500 <sys_cps>: #include "mmu.h" #include "proc.h" int sys_cps(void) { 80105500: 55 push %ebp 80105501: 89 e5 mov %esp,%ebp return cps(); } 80105503: 5d pop %ebp #include "proc.h" int sys_cps(void) { return cps(); 80105504: e9 87 eb ff ff jmp 80104090 <cps> 80105509: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105510 <sys_fork>: } int sys_fork(void) { 80105510: 55 push %ebp 80105511: 89 e5 mov %esp,%ebp return fork(); } 80105513: 5d pop %ebp } int sys_fork(void) { return fork(); 80105514: e9 07 e4 ff ff jmp 80103920 <fork> 80105519: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105520 <sys_exit>: } int sys_exit(void) { 80105520: 55 push %ebp 80105521: 89 e5 mov %esp,%ebp 80105523: 83 ec 08 sub $0x8,%esp exit(); 80105526: e8 85 e6 ff ff call 80103bb0 <exit> return 0; // not reached } 8010552b: 31 c0 xor %eax,%eax 8010552d: c9 leave 8010552e: c3 ret 8010552f: 90 nop 80105530 <sys_wait>: int sys_wait(void) { 80105530: 55 push %ebp 80105531: 89 e5 mov %esp,%ebp return wait(); } 80105533: 5d pop %ebp } int sys_wait(void) { return wait(); 80105534: e9 b7 e8 ff ff jmp 80103df0 <wait> 80105539: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105540 <sys_kill>: } int sys_kill(void) { 80105540: 55 push %ebp 80105541: 89 e5 mov %esp,%ebp 80105543: 83 ec 20 sub $0x20,%esp int pid; if(argint(0, &pid) < 0) 80105546: 8d 45 f4 lea -0xc(%ebp),%eax 80105549: 50 push %eax 8010554a: 6a 00 push $0x0 8010554c: e8 6f f2 ff ff call 801047c0 <argint> 80105551: 83 c4 10 add $0x10,%esp 80105554: 85 c0 test %eax,%eax 80105556: 78 18 js 80105570 <sys_kill+0x30> return -1; return kill(pid); 80105558: 83 ec 0c sub $0xc,%esp 8010555b: ff 75 f4 pushl -0xc(%ebp) 8010555e: e8 dd e9 ff ff call 80103f40 <kill> 80105563: 83 c4 10 add $0x10,%esp } 80105566: c9 leave 80105567: c3 ret 80105568: 90 nop 80105569: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sys_kill(void) { int pid; if(argint(0, &pid) < 0) return -1; 80105570: b8 ff ff ff ff mov $0xffffffff,%eax return kill(pid); } 80105575: c9 leave 80105576: c3 ret 80105577: 89 f6 mov %esi,%esi 80105579: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105580 <sys_getpid>: int sys_getpid(void) { 80105580: 55 push %ebp 80105581: 89 e5 mov %esp,%ebp 80105583: 83 ec 08 sub $0x8,%esp return myproc()->pid; 80105586: e8 f5 e1 ff ff call 80103780 <myproc> 8010558b: 8b 40 10 mov 0x10(%eax),%eax } 8010558e: c9 leave 8010558f: c3 ret 80105590 <sys_sbrk>: int sys_sbrk(void) { 80105590: 55 push %ebp 80105591: 89 e5 mov %esp,%ebp 80105593: 53 push %ebx int addr; int n; if(argint(0, &n) < 0) 80105594: 8d 45 f4 lea -0xc(%ebp),%eax return myproc()->pid; } int sys_sbrk(void) { 80105597: 83 ec 1c sub $0x1c,%esp int addr; int n; if(argint(0, &n) < 0) 8010559a: 50 push %eax 8010559b: 6a 00 push $0x0 8010559d: e8 1e f2 ff ff call 801047c0 <argint> 801055a2: 83 c4 10 add $0x10,%esp 801055a5: 85 c0 test %eax,%eax 801055a7: 78 27 js 801055d0 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 801055a9: e8 d2 e1 ff ff call 80103780 <myproc> if(growproc(n) < 0) 801055ae: 83 ec 0c sub $0xc,%esp int addr; int n; if(argint(0, &n) < 0) return -1; addr = myproc()->sz; 801055b1: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 801055b3: ff 75 f4 pushl -0xc(%ebp) 801055b6: e8 e5 e2 ff ff call 801038a0 <growproc> 801055bb: 83 c4 10 add $0x10,%esp 801055be: 85 c0 test %eax,%eax 801055c0: 78 0e js 801055d0 <sys_sbrk+0x40> return -1; return addr; 801055c2: 89 d8 mov %ebx,%eax } 801055c4: 8b 5d fc mov -0x4(%ebp),%ebx 801055c7: c9 leave 801055c8: c3 ret 801055c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi { int addr; int n; if(argint(0, &n) < 0) return -1; 801055d0: b8 ff ff ff ff mov $0xffffffff,%eax 801055d5: eb ed jmp 801055c4 <sys_sbrk+0x34> 801055d7: 89 f6 mov %esi,%esi 801055d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801055e0 <sys_sleep>: return addr; } int sys_sleep(void) { 801055e0: 55 push %ebp 801055e1: 89 e5 mov %esp,%ebp 801055e3: 53 push %ebx int n; uint ticks0; if(argint(0, &n) < 0) 801055e4: 8d 45 f4 lea -0xc(%ebp),%eax return addr; } int sys_sleep(void) { 801055e7: 83 ec 1c sub $0x1c,%esp int n; uint ticks0; if(argint(0, &n) < 0) 801055ea: 50 push %eax 801055eb: 6a 00 push $0x0 801055ed: e8 ce f1 ff ff call 801047c0 <argint> 801055f2: 83 c4 10 add $0x10,%esp 801055f5: 85 c0 test %eax,%eax 801055f7: 0f 88 8a 00 00 00 js 80105687 <sys_sleep+0xa7> return -1; acquire(&tickslock); 801055fd: 83 ec 0c sub $0xc,%esp 80105600: 68 60 4c 11 80 push $0x80114c60 80105605: e8 36 ed ff ff call 80104340 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 8010560a: 8b 55 f4 mov -0xc(%ebp),%edx 8010560d: 83 c4 10 add $0x10,%esp uint ticks0; if(argint(0, &n) < 0) return -1; acquire(&tickslock); ticks0 = ticks; 80105610: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx while(ticks - ticks0 < n){ 80105616: 85 d2 test %edx,%edx 80105618: 75 27 jne 80105641 <sys_sleep+0x61> 8010561a: eb 54 jmp 80105670 <sys_sleep+0x90> 8010561c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 80105620: 83 ec 08 sub $0x8,%esp 80105623: 68 60 4c 11 80 push $0x80114c60 80105628: 68 a0 54 11 80 push $0x801154a0 8010562d: e8 fe e6 ff ff call 80103d30 <sleep> if(argint(0, &n) < 0) return -1; acquire(&tickslock); ticks0 = ticks; while(ticks - ticks0 < n){ 80105632: a1 a0 54 11 80 mov 0x801154a0,%eax 80105637: 83 c4 10 add $0x10,%esp 8010563a: 29 d8 sub %ebx,%eax 8010563c: 3b 45 f4 cmp -0xc(%ebp),%eax 8010563f: 73 2f jae 80105670 <sys_sleep+0x90> if(myproc()->killed){ 80105641: e8 3a e1 ff ff call 80103780 <myproc> 80105646: 8b 40 24 mov 0x24(%eax),%eax 80105649: 85 c0 test %eax,%eax 8010564b: 74 d3 je 80105620 <sys_sleep+0x40> release(&tickslock); 8010564d: 83 ec 0c sub $0xc,%esp 80105650: 68 60 4c 11 80 push $0x80114c60 80105655: e8 06 ee ff ff call 80104460 <release> return -1; 8010565a: 83 c4 10 add $0x10,%esp 8010565d: b8 ff ff ff ff mov $0xffffffff,%eax } sleep(&ticks, &tickslock); } release(&tickslock); return 0; } 80105662: 8b 5d fc mov -0x4(%ebp),%ebx 80105665: c9 leave 80105666: c3 ret 80105667: 89 f6 mov %esi,%esi 80105669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); return -1; } sleep(&ticks, &tickslock); } release(&tickslock); 80105670: 83 ec 0c sub $0xc,%esp 80105673: 68 60 4c 11 80 push $0x80114c60 80105678: e8 e3 ed ff ff call 80104460 <release> return 0; 8010567d: 83 c4 10 add $0x10,%esp 80105680: 31 c0 xor %eax,%eax } 80105682: 8b 5d fc mov -0x4(%ebp),%ebx 80105685: c9 leave 80105686: c3 ret { int n; uint ticks0; if(argint(0, &n) < 0) return -1; 80105687: b8 ff ff ff ff mov $0xffffffff,%eax 8010568c: eb d4 jmp 80105662 <sys_sleep+0x82> 8010568e: 66 90 xchg %ax,%ax 80105690 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 80105690: 55 push %ebp 80105691: 89 e5 mov %esp,%ebp 80105693: 53 push %ebx 80105694: 83 ec 10 sub $0x10,%esp uint xticks; acquire(&tickslock); 80105697: 68 60 4c 11 80 push $0x80114c60 8010569c: e8 9f ec ff ff call 80104340 <acquire> xticks = ticks; 801056a1: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx release(&tickslock); 801056a7: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 801056ae: e8 ad ed ff ff call 80104460 <release> return xticks; } 801056b3: 89 d8 mov %ebx,%eax 801056b5: 8b 5d fc mov -0x4(%ebp),%ebx 801056b8: c9 leave 801056b9: c3 ret 801056ba <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 801056ba: 1e push %ds pushl %es 801056bb: 06 push %es pushl %fs 801056bc: 0f a0 push %fs pushl %gs 801056be: 0f a8 push %gs pushal 801056c0: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 801056c1: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 801056c5: 8e d8 mov %eax,%ds movw %ax, %es 801056c7: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 801056c9: 54 push %esp call trap 801056ca: e8 e1 00 00 00 call 801057b0 <trap> addl $4, %esp 801056cf: 83 c4 04 add $0x4,%esp 801056d2 <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 801056d2: 61 popa popl %gs 801056d3: 0f a9 pop %gs popl %fs 801056d5: 0f a1 pop %fs popl %es 801056d7: 07 pop %es popl %ds 801056d8: 1f pop %ds addl $0x8, %esp # trapno and errcode 801056d9: 83 c4 08 add $0x8,%esp iret 801056dc: cf iret 801056dd: 66 90 xchg %ax,%ax 801056df: 90 nop 801056e0 <tvinit>: void tvinit(void) { int i; for(i = 0; i < 256; i++) 801056e0: 31 c0 xor %eax,%eax 801056e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 801056e8: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx 801056ef: b9 08 00 00 00 mov $0x8,%ecx 801056f4: c6 04 c5 a4 4c 11 80 movb $0x0,-0x7feeb35c(,%eax,8) 801056fb: 00 801056fc: 66 89 0c c5 a2 4c 11 mov %cx,-0x7feeb35e(,%eax,8) 80105703: 80 80105704: c6 04 c5 a5 4c 11 80 movb $0x8e,-0x7feeb35b(,%eax,8) 8010570b: 8e 8010570c: 66 89 14 c5 a0 4c 11 mov %dx,-0x7feeb360(,%eax,8) 80105713: 80 80105714: c1 ea 10 shr $0x10,%edx 80105717: 66 89 14 c5 a6 4c 11 mov %dx,-0x7feeb35a(,%eax,8) 8010571e: 80 void tvinit(void) { int i; for(i = 0; i < 256; i++) 8010571f: 83 c0 01 add $0x1,%eax 80105722: 3d 00 01 00 00 cmp $0x100,%eax 80105727: 75 bf jne 801056e8 <tvinit+0x8> struct spinlock tickslock; uint ticks; void tvinit(void) { 80105729: 55 push %ebp int i; for(i = 0; i < 256; i++) SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 8010572a: ba 08 00 00 00 mov $0x8,%edx struct spinlock tickslock; uint ticks; void tvinit(void) { 8010572f: 89 e5 mov %esp,%ebp 80105731: 83 ec 10 sub $0x10,%esp int i; for(i = 0; i < 256; i++) SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105734: a1 08 a1 10 80 mov 0x8010a108,%eax initlock(&tickslock, "time"); 80105739: 68 3d 77 10 80 push $0x8010773d 8010573e: 68 60 4c 11 80 push $0x80114c60 { int i; for(i = 0; i < 256; i++) SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80105743: 66 89 15 a2 4e 11 80 mov %dx,0x80114ea2 8010574a: c6 05 a4 4e 11 80 00 movb $0x0,0x80114ea4 80105751: 66 a3 a0 4e 11 80 mov %ax,0x80114ea0 80105757: c1 e8 10 shr $0x10,%eax 8010575a: c6 05 a5 4e 11 80 ef movb $0xef,0x80114ea5 80105761: 66 a3 a6 4e 11 80 mov %ax,0x80114ea6 initlock(&tickslock, "time"); 80105767: e8 d4 ea ff ff call 80104240 <initlock> } 8010576c: 83 c4 10 add $0x10,%esp 8010576f: c9 leave 80105770: c3 ret 80105771: eb 0d jmp 80105780 <idtinit> 80105773: 90 nop 80105774: 90 nop 80105775: 90 nop 80105776: 90 nop 80105777: 90 nop 80105778: 90 nop 80105779: 90 nop 8010577a: 90 nop 8010577b: 90 nop 8010577c: 90 nop 8010577d: 90 nop 8010577e: 90 nop 8010577f: 90 nop 80105780 <idtinit>: void idtinit(void) { 80105780: 55 push %ebp static inline void lidt(struct gatedesc *p, int size) { volatile ushort pd[3]; pd[0] = size-1; 80105781: b8 ff 07 00 00 mov $0x7ff,%eax 80105786: 89 e5 mov %esp,%ebp 80105788: 83 ec 10 sub $0x10,%esp 8010578b: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 8010578f: b8 a0 4c 11 80 mov $0x80114ca0,%eax 80105794: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 80105798: c1 e8 10 shr $0x10,%eax 8010579b: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 8010579f: 8d 45 fa lea -0x6(%ebp),%eax 801057a2: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 801057a5: c9 leave 801057a6: c3 ret 801057a7: 89 f6 mov %esi,%esi 801057a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801057b0 <trap>: void trap(struct trapframe *tf) { 801057b0: 55 push %ebp 801057b1: 89 e5 mov %esp,%ebp 801057b3: 57 push %edi 801057b4: 56 push %esi 801057b5: 53 push %ebx 801057b6: 83 ec 1c sub $0x1c,%esp 801057b9: 8b 7d 08 mov 0x8(%ebp),%edi if(tf->trapno == T_SYSCALL){ 801057bc: 8b 47 30 mov 0x30(%edi),%eax 801057bf: 83 f8 40 cmp $0x40,%eax 801057c2: 0f 84 88 01 00 00 je 80105950 <trap+0x1a0> if(myproc()->killed) exit(); return; } switch(tf->trapno){ 801057c8: 83 e8 20 sub $0x20,%eax 801057cb: 83 f8 1f cmp $0x1f,%eax 801057ce: 77 10 ja 801057e0 <trap+0x30> 801057d0: ff 24 85 e4 77 10 80 jmp *-0x7fef881c(,%eax,4) 801057d7: 89 f6 mov %esi,%esi 801057d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi cpuid(), tf->cs, tf->eip); lapiceoi(); break; default: if(myproc() == 0 || (tf->cs&3) == 0){ 801057e0: e8 9b df ff ff call 80103780 <myproc> 801057e5: 85 c0 test %eax,%eax 801057e7: 0f 84 d7 01 00 00 je 801059c4 <trap+0x214> 801057ed: f6 47 3c 03 testb $0x3,0x3c(%edi) 801057f1: 0f 84 cd 01 00 00 je 801059c4 <trap+0x214> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 801057f7: 0f 20 d1 mov %cr2,%ecx 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 " 801057fa: 8b 57 38 mov 0x38(%edi),%edx 801057fd: 89 4d d8 mov %ecx,-0x28(%ebp) 80105800: 89 55 dc mov %edx,-0x24(%ebp) 80105803: e8 58 df ff ff call 80103760 <cpuid> 80105808: 8b 77 34 mov 0x34(%edi),%esi 8010580b: 8b 5f 30 mov 0x30(%edi),%ebx 8010580e: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105811: e8 6a df ff ff call 80103780 <myproc> 80105816: 89 45 e0 mov %eax,-0x20(%ebp) 80105819: e8 62 df ff ff call 80103780 <myproc> 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 " 8010581e: 8b 4d d8 mov -0x28(%ebp),%ecx 80105821: 8b 55 dc mov -0x24(%ebp),%edx 80105824: 51 push %ecx 80105825: 52 push %edx "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105826: 8b 55 e0 mov -0x20(%ebp),%edx 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 " 80105829: ff 75 e4 pushl -0x1c(%ebp) 8010582c: 56 push %esi 8010582d: 53 push %ebx "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 8010582e: 83 c2 6c add $0x6c,%edx 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 " 80105831: 52 push %edx 80105832: ff 70 10 pushl 0x10(%eax) 80105835: 68 a0 77 10 80 push $0x801077a0 8010583a: e8 21 ae ff ff call 80100660 <cprintf> "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 8010583f: 83 c4 20 add $0x20,%esp 80105842: e8 39 df ff ff call 80103780 <myproc> 80105847: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) 8010584e: 66 90 xchg %ax,%ax } // 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) 80105850: e8 2b df ff ff call 80103780 <myproc> 80105855: 85 c0 test %eax,%eax 80105857: 74 0c je 80105865 <trap+0xb5> 80105859: e8 22 df ff ff call 80103780 <myproc> 8010585e: 8b 50 24 mov 0x24(%eax),%edx 80105861: 85 d2 test %edx,%edx 80105863: 75 4b jne 801058b0 <trap+0x100> 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 && 80105865: e8 16 df ff ff call 80103780 <myproc> 8010586a: 85 c0 test %eax,%eax 8010586c: 74 0b je 80105879 <trap+0xc9> 8010586e: e8 0d df ff ff call 80103780 <myproc> 80105873: 83 78 0c 04 cmpl $0x4,0xc(%eax) 80105877: 74 4f je 801058c8 <trap+0x118> 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) 80105879: e8 02 df ff ff call 80103780 <myproc> 8010587e: 85 c0 test %eax,%eax 80105880: 74 1d je 8010589f <trap+0xef> 80105882: e8 f9 de ff ff call 80103780 <myproc> 80105887: 8b 40 24 mov 0x24(%eax),%eax 8010588a: 85 c0 test %eax,%eax 8010588c: 74 11 je 8010589f <trap+0xef> 8010588e: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80105892: 83 e0 03 and $0x3,%eax 80105895: 66 83 f8 03 cmp $0x3,%ax 80105899: 0f 84 da 00 00 00 je 80105979 <trap+0x1c9> exit(); } 8010589f: 8d 65 f4 lea -0xc(%ebp),%esp 801058a2: 5b pop %ebx 801058a3: 5e pop %esi 801058a4: 5f pop %edi 801058a5: 5d pop %ebp 801058a6: c3 ret 801058a7: 89 f6 mov %esi,%esi 801058a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi } // 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) 801058b0: 0f b7 47 3c movzwl 0x3c(%edi),%eax 801058b4: 83 e0 03 and $0x3,%eax 801058b7: 66 83 f8 03 cmp $0x3,%ax 801058bb: 75 a8 jne 80105865 <trap+0xb5> exit(); 801058bd: e8 ee e2 ff ff call 80103bb0 <exit> 801058c2: eb a1 jmp 80105865 <trap+0xb5> 801058c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi // 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 && 801058c8: 83 7f 30 20 cmpl $0x20,0x30(%edi) 801058cc: 75 ab jne 80105879 <trap+0xc9> tf->trapno == T_IRQ0+IRQ_TIMER) yield(); 801058ce: e8 0d e4 ff ff call 80103ce0 <yield> 801058d3: eb a4 jmp 80105879 <trap+0xc9> 801058d5: 8d 76 00 lea 0x0(%esi),%esi return; } switch(tf->trapno){ case T_IRQ0 + IRQ_TIMER: if(cpuid() == 0){ 801058d8: e8 83 de ff ff call 80103760 <cpuid> 801058dd: 85 c0 test %eax,%eax 801058df: 0f 84 ab 00 00 00 je 80105990 <trap+0x1e0> } lapiceoi(); break; case T_IRQ0 + IRQ_IDE: ideintr(); lapiceoi(); 801058e5: e8 26 ce ff ff call 80102710 <lapiceoi> break; 801058ea: e9 61 ff ff ff jmp 80105850 <trap+0xa0> 801058ef: 90 nop case T_IRQ0 + IRQ_IDE+1: // Bochs generates spurious IDE1 interrupts. break; case T_IRQ0 + IRQ_KBD: kbdintr(); 801058f0: e8 db cc ff ff call 801025d0 <kbdintr> lapiceoi(); 801058f5: e8 16 ce ff ff call 80102710 <lapiceoi> break; 801058fa: e9 51 ff ff ff jmp 80105850 <trap+0xa0> 801058ff: 90 nop case T_IRQ0 + IRQ_COM1: uartintr(); 80105900: e8 5b 02 00 00 call 80105b60 <uartintr> lapiceoi(); 80105905: e8 06 ce ff ff call 80102710 <lapiceoi> break; 8010590a: e9 41 ff ff ff jmp 80105850 <trap+0xa0> 8010590f: 90 nop case T_IRQ0 + 7: case T_IRQ0 + IRQ_SPURIOUS: cprintf("cpu%d: spurious interrupt at %x:%x\n", 80105910: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 80105914: 8b 77 38 mov 0x38(%edi),%esi 80105917: e8 44 de ff ff call 80103760 <cpuid> 8010591c: 56 push %esi 8010591d: 53 push %ebx 8010591e: 50 push %eax 8010591f: 68 48 77 10 80 push $0x80107748 80105924: e8 37 ad ff ff call 80100660 <cprintf> cpuid(), tf->cs, tf->eip); lapiceoi(); 80105929: e8 e2 cd ff ff call 80102710 <lapiceoi> break; 8010592e: 83 c4 10 add $0x10,%esp 80105931: e9 1a ff ff ff jmp 80105850 <trap+0xa0> 80105936: 8d 76 00 lea 0x0(%esi),%esi 80105939: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); } lapiceoi(); break; case T_IRQ0 + IRQ_IDE: ideintr(); 80105940: e8 0b c7 ff ff call 80102050 <ideintr> 80105945: eb 9e jmp 801058e5 <trap+0x135> 80105947: 89 f6 mov %esi,%esi 80105949: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi void trap(struct trapframe *tf) { if(tf->trapno == T_SYSCALL){ if(myproc()->killed) 80105950: e8 2b de ff ff call 80103780 <myproc> 80105955: 8b 58 24 mov 0x24(%eax),%ebx 80105958: 85 db test %ebx,%ebx 8010595a: 75 2c jne 80105988 <trap+0x1d8> exit(); myproc()->tf = tf; 8010595c: e8 1f de ff ff call 80103780 <myproc> 80105961: 89 78 18 mov %edi,0x18(%eax) syscall(); 80105964: e8 47 ef ff ff call 801048b0 <syscall> if(myproc()->killed) 80105969: e8 12 de ff ff call 80103780 <myproc> 8010596e: 8b 48 24 mov 0x24(%eax),%ecx 80105971: 85 c9 test %ecx,%ecx 80105973: 0f 84 26 ff ff ff je 8010589f <trap+0xef> yield(); // Check if the process has been killed since we yielded if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) exit(); } 80105979: 8d 65 f4 lea -0xc(%ebp),%esp 8010597c: 5b pop %ebx 8010597d: 5e pop %esi 8010597e: 5f pop %edi 8010597f: 5d pop %ebp if(myproc()->killed) exit(); myproc()->tf = tf; syscall(); if(myproc()->killed) exit(); 80105980: e9 2b e2 ff ff jmp 80103bb0 <exit> 80105985: 8d 76 00 lea 0x0(%esi),%esi void trap(struct trapframe *tf) { if(tf->trapno == T_SYSCALL){ if(myproc()->killed) exit(); 80105988: e8 23 e2 ff ff call 80103bb0 <exit> 8010598d: eb cd jmp 8010595c <trap+0x1ac> 8010598f: 90 nop } switch(tf->trapno){ case T_IRQ0 + IRQ_TIMER: if(cpuid() == 0){ acquire(&tickslock); 80105990: 83 ec 0c sub $0xc,%esp 80105993: 68 60 4c 11 80 push $0x80114c60 80105998: e8 a3 e9 ff ff call 80104340 <acquire> ticks++; wakeup(&ticks); 8010599d: c7 04 24 a0 54 11 80 movl $0x801154a0,(%esp) switch(tf->trapno){ case T_IRQ0 + IRQ_TIMER: if(cpuid() == 0){ acquire(&tickslock); ticks++; 801059a4: 83 05 a0 54 11 80 01 addl $0x1,0x801154a0 wakeup(&ticks); 801059ab: e8 30 e5 ff ff call 80103ee0 <wakeup> release(&tickslock); 801059b0: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 801059b7: e8 a4 ea ff ff call 80104460 <release> 801059bc: 83 c4 10 add $0x10,%esp 801059bf: e9 21 ff ff ff jmp 801058e5 <trap+0x135> 801059c4: 0f 20 d6 mov %cr2,%esi break; default: if(myproc() == 0 || (tf->cs&3) == 0){ // In kernel, it must be our mistake. cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 801059c7: 8b 5f 38 mov 0x38(%edi),%ebx 801059ca: e8 91 dd ff ff call 80103760 <cpuid> 801059cf: 83 ec 0c sub $0xc,%esp 801059d2: 56 push %esi 801059d3: 53 push %ebx 801059d4: 50 push %eax 801059d5: ff 77 30 pushl 0x30(%edi) 801059d8: 68 6c 77 10 80 push $0x8010776c 801059dd: e8 7e ac ff ff call 80100660 <cprintf> tf->trapno, cpuid(), tf->eip, rcr2()); panic("trap"); 801059e2: 83 c4 14 add $0x14,%esp 801059e5: 68 42 77 10 80 push $0x80107742 801059ea: e8 81 a9 ff ff call 80100370 <panic> 801059ef: 90 nop 801059f0 <uartgetc>: } static int uartgetc(void) { if(!uart) 801059f0: a1 bc a5 10 80 mov 0x8010a5bc,%eax outb(COM1+0, c); } static int uartgetc(void) { 801059f5: 55 push %ebp 801059f6: 89 e5 mov %esp,%ebp if(!uart) 801059f8: 85 c0 test %eax,%eax 801059fa: 74 1c je 80105a18 <uartgetc+0x28> static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801059fc: ba fd 03 00 00 mov $0x3fd,%edx 80105a01: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 80105a02: a8 01 test $0x1,%al 80105a04: 74 12 je 80105a18 <uartgetc+0x28> 80105a06: ba f8 03 00 00 mov $0x3f8,%edx 80105a0b: ec in (%dx),%al return -1; return inb(COM1+0); 80105a0c: 0f b6 c0 movzbl %al,%eax } 80105a0f: 5d pop %ebp 80105a10: c3 ret 80105a11: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi static int uartgetc(void) { if(!uart) return -1; 80105a18: b8 ff ff ff ff mov $0xffffffff,%eax if(!(inb(COM1+5) & 0x01)) return -1; return inb(COM1+0); } 80105a1d: 5d pop %ebp 80105a1e: c3 ret 80105a1f: 90 nop 80105a20 <uartputc.part.0>: for(p="xv6...\n"; *p; p++) uartputc(*p); } void uartputc(int c) 80105a20: 55 push %ebp 80105a21: 89 e5 mov %esp,%ebp 80105a23: 57 push %edi 80105a24: 56 push %esi 80105a25: 53 push %ebx 80105a26: 89 c7 mov %eax,%edi 80105a28: bb 80 00 00 00 mov $0x80,%ebx 80105a2d: be fd 03 00 00 mov $0x3fd,%esi 80105a32: 83 ec 0c sub $0xc,%esp 80105a35: eb 1b jmp 80105a52 <uartputc.part.0+0x32> 80105a37: 89 f6 mov %esi,%esi 80105a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi int i; if(!uart) return; for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) microdelay(10); 80105a40: 83 ec 0c sub $0xc,%esp 80105a43: 6a 0a push $0xa 80105a45: e8 e6 cc ff ff call 80102730 <microdelay> { int i; if(!uart) return; for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 80105a4a: 83 c4 10 add $0x10,%esp 80105a4d: 83 eb 01 sub $0x1,%ebx 80105a50: 74 07 je 80105a59 <uartputc.part.0+0x39> 80105a52: 89 f2 mov %esi,%edx 80105a54: ec in (%dx),%al 80105a55: a8 20 test $0x20,%al 80105a57: 74 e7 je 80105a40 <uartputc.part.0+0x20> } static inline void outb(ushort port, uchar data) { asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80105a59: ba f8 03 00 00 mov $0x3f8,%edx 80105a5e: 89 f8 mov %edi,%eax 80105a60: ee out %al,(%dx) microdelay(10); outb(COM1+0, c); } 80105a61: 8d 65 f4 lea -0xc(%ebp),%esp 80105a64: 5b pop %ebx 80105a65: 5e pop %esi 80105a66: 5f pop %edi 80105a67: 5d pop %ebp 80105a68: c3 ret 80105a69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105a70 <uartinit>: static int uart; // is there a uart? void uartinit(void) { 80105a70: 55 push %ebp 80105a71: 31 c9 xor %ecx,%ecx 80105a73: 89 c8 mov %ecx,%eax 80105a75: 89 e5 mov %esp,%ebp 80105a77: 57 push %edi 80105a78: 56 push %esi 80105a79: 53 push %ebx 80105a7a: bb fa 03 00 00 mov $0x3fa,%ebx 80105a7f: 89 da mov %ebx,%edx 80105a81: 83 ec 0c sub $0xc,%esp 80105a84: ee out %al,(%dx) 80105a85: bf fb 03 00 00 mov $0x3fb,%edi 80105a8a: b8 80 ff ff ff mov $0xffffff80,%eax 80105a8f: 89 fa mov %edi,%edx 80105a91: ee out %al,(%dx) 80105a92: b8 0c 00 00 00 mov $0xc,%eax 80105a97: ba f8 03 00 00 mov $0x3f8,%edx 80105a9c: ee out %al,(%dx) 80105a9d: be f9 03 00 00 mov $0x3f9,%esi 80105aa2: 89 c8 mov %ecx,%eax 80105aa4: 89 f2 mov %esi,%edx 80105aa6: ee out %al,(%dx) 80105aa7: b8 03 00 00 00 mov $0x3,%eax 80105aac: 89 fa mov %edi,%edx 80105aae: ee out %al,(%dx) 80105aaf: ba fc 03 00 00 mov $0x3fc,%edx 80105ab4: 89 c8 mov %ecx,%eax 80105ab6: ee out %al,(%dx) 80105ab7: b8 01 00 00 00 mov $0x1,%eax 80105abc: 89 f2 mov %esi,%edx 80105abe: ee out %al,(%dx) static inline uchar inb(ushort port) { uchar data; asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105abf: ba fd 03 00 00 mov $0x3fd,%edx 80105ac4: ec in (%dx),%al outb(COM1+3, 0x03); // Lock divisor, 8 data bits. outb(COM1+4, 0); outb(COM1+1, 0x01); // Enable receive interrupts. // If status is 0xFF, no serial port. if(inb(COM1+5) == 0xFF) 80105ac5: 3c ff cmp $0xff,%al 80105ac7: 74 5a je 80105b23 <uartinit+0xb3> return; uart = 1; 80105ac9: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc 80105ad0: 00 00 00 80105ad3: 89 da mov %ebx,%edx 80105ad5: ec in (%dx),%al 80105ad6: ba f8 03 00 00 mov $0x3f8,%edx 80105adb: ec in (%dx),%al // Acknowledge pre-existing interrupt conditions; // enable interrupts. inb(COM1+2); inb(COM1+0); ioapicenable(IRQ_COM1, 0); 80105adc: 83 ec 08 sub $0x8,%esp 80105adf: bb 64 78 10 80 mov $0x80107864,%ebx 80105ae4: 6a 00 push $0x0 80105ae6: 6a 04 push $0x4 80105ae8: e8 b3 c7 ff ff call 801022a0 <ioapicenable> 80105aed: 83 c4 10 add $0x10,%esp 80105af0: b8 78 00 00 00 mov $0x78,%eax 80105af5: eb 13 jmp 80105b0a <uartinit+0x9a> 80105af7: 89 f6 mov %esi,%esi 80105af9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi // Announce that we're here. for(p="xv6...\n"; *p; p++) 80105b00: 83 c3 01 add $0x1,%ebx 80105b03: 0f be 03 movsbl (%ebx),%eax 80105b06: 84 c0 test %al,%al 80105b08: 74 19 je 80105b23 <uartinit+0xb3> void uartputc(int c) { int i; if(!uart) 80105b0a: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx 80105b10: 85 d2 test %edx,%edx 80105b12: 74 ec je 80105b00 <uartinit+0x90> inb(COM1+2); inb(COM1+0); ioapicenable(IRQ_COM1, 0); // Announce that we're here. for(p="xv6...\n"; *p; p++) 80105b14: 83 c3 01 add $0x1,%ebx 80105b17: e8 04 ff ff ff call 80105a20 <uartputc.part.0> 80105b1c: 0f be 03 movsbl (%ebx),%eax 80105b1f: 84 c0 test %al,%al 80105b21: 75 e7 jne 80105b0a <uartinit+0x9a> uartputc(*p); } 80105b23: 8d 65 f4 lea -0xc(%ebp),%esp 80105b26: 5b pop %ebx 80105b27: 5e pop %esi 80105b28: 5f pop %edi 80105b29: 5d pop %ebp 80105b2a: c3 ret 80105b2b: 90 nop 80105b2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105b30 <uartputc>: void uartputc(int c) { int i; if(!uart) 80105b30: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx uartputc(*p); } void uartputc(int c) { 80105b36: 55 push %ebp 80105b37: 89 e5 mov %esp,%ebp int i; if(!uart) 80105b39: 85 d2 test %edx,%edx uartputc(*p); } void uartputc(int c) { 80105b3b: 8b 45 08 mov 0x8(%ebp),%eax int i; if(!uart) 80105b3e: 74 10 je 80105b50 <uartputc+0x20> return; for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) microdelay(10); outb(COM1+0, c); } 80105b40: 5d pop %ebp 80105b41: e9 da fe ff ff jmp 80105a20 <uartputc.part.0> 80105b46: 8d 76 00 lea 0x0(%esi),%esi 80105b49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105b50: 5d pop %ebp 80105b51: c3 ret 80105b52: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105b59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105b60 <uartintr>: return inb(COM1+0); } void uartintr(void) { 80105b60: 55 push %ebp 80105b61: 89 e5 mov %esp,%ebp 80105b63: 83 ec 14 sub $0x14,%esp consoleintr(uartgetc); 80105b66: 68 f0 59 10 80 push $0x801059f0 80105b6b: e8 80 ac ff ff call 801007f0 <consoleintr> } 80105b70: 83 c4 10 add $0x10,%esp 80105b73: c9 leave 80105b74: c3 ret 80105b75 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80105b75: 6a 00 push $0x0 pushl $0 80105b77: 6a 00 push $0x0 jmp alltraps 80105b79: e9 3c fb ff ff jmp 801056ba <alltraps> 80105b7e <vector1>: .globl vector1 vector1: pushl $0 80105b7e: 6a 00 push $0x0 pushl $1 80105b80: 6a 01 push $0x1 jmp alltraps 80105b82: e9 33 fb ff ff jmp 801056ba <alltraps> 80105b87 <vector2>: .globl vector2 vector2: pushl $0 80105b87: 6a 00 push $0x0 pushl $2 80105b89: 6a 02 push $0x2 jmp alltraps 80105b8b: e9 2a fb ff ff jmp 801056ba <alltraps> 80105b90 <vector3>: .globl vector3 vector3: pushl $0 80105b90: 6a 00 push $0x0 pushl $3 80105b92: 6a 03 push $0x3 jmp alltraps 80105b94: e9 21 fb ff ff jmp 801056ba <alltraps> 80105b99 <vector4>: .globl vector4 vector4: pushl $0 80105b99: 6a 00 push $0x0 pushl $4 80105b9b: 6a 04 push $0x4 jmp alltraps 80105b9d: e9 18 fb ff ff jmp 801056ba <alltraps> 80105ba2 <vector5>: .globl vector5 vector5: pushl $0 80105ba2: 6a 00 push $0x0 pushl $5 80105ba4: 6a 05 push $0x5 jmp alltraps 80105ba6: e9 0f fb ff ff jmp 801056ba <alltraps> 80105bab <vector6>: .globl vector6 vector6: pushl $0 80105bab: 6a 00 push $0x0 pushl $6 80105bad: 6a 06 push $0x6 jmp alltraps 80105baf: e9 06 fb ff ff jmp 801056ba <alltraps> 80105bb4 <vector7>: .globl vector7 vector7: pushl $0 80105bb4: 6a 00 push $0x0 pushl $7 80105bb6: 6a 07 push $0x7 jmp alltraps 80105bb8: e9 fd fa ff ff jmp 801056ba <alltraps> 80105bbd <vector8>: .globl vector8 vector8: pushl $8 80105bbd: 6a 08 push $0x8 jmp alltraps 80105bbf: e9 f6 fa ff ff jmp 801056ba <alltraps> 80105bc4 <vector9>: .globl vector9 vector9: pushl $0 80105bc4: 6a 00 push $0x0 pushl $9 80105bc6: 6a 09 push $0x9 jmp alltraps 80105bc8: e9 ed fa ff ff jmp 801056ba <alltraps> 80105bcd <vector10>: .globl vector10 vector10: pushl $10 80105bcd: 6a 0a push $0xa jmp alltraps 80105bcf: e9 e6 fa ff ff jmp 801056ba <alltraps> 80105bd4 <vector11>: .globl vector11 vector11: pushl $11 80105bd4: 6a 0b push $0xb jmp alltraps 80105bd6: e9 df fa ff ff jmp 801056ba <alltraps> 80105bdb <vector12>: .globl vector12 vector12: pushl $12 80105bdb: 6a 0c push $0xc jmp alltraps 80105bdd: e9 d8 fa ff ff jmp 801056ba <alltraps> 80105be2 <vector13>: .globl vector13 vector13: pushl $13 80105be2: 6a 0d push $0xd jmp alltraps 80105be4: e9 d1 fa ff ff jmp 801056ba <alltraps> 80105be9 <vector14>: .globl vector14 vector14: pushl $14 80105be9: 6a 0e push $0xe jmp alltraps 80105beb: e9 ca fa ff ff jmp 801056ba <alltraps> 80105bf0 <vector15>: .globl vector15 vector15: pushl $0 80105bf0: 6a 00 push $0x0 pushl $15 80105bf2: 6a 0f push $0xf jmp alltraps 80105bf4: e9 c1 fa ff ff jmp 801056ba <alltraps> 80105bf9 <vector16>: .globl vector16 vector16: pushl $0 80105bf9: 6a 00 push $0x0 pushl $16 80105bfb: 6a 10 push $0x10 jmp alltraps 80105bfd: e9 b8 fa ff ff jmp 801056ba <alltraps> 80105c02 <vector17>: .globl vector17 vector17: pushl $17 80105c02: 6a 11 push $0x11 jmp alltraps 80105c04: e9 b1 fa ff ff jmp 801056ba <alltraps> 80105c09 <vector18>: .globl vector18 vector18: pushl $0 80105c09: 6a 00 push $0x0 pushl $18 80105c0b: 6a 12 push $0x12 jmp alltraps 80105c0d: e9 a8 fa ff ff jmp 801056ba <alltraps> 80105c12 <vector19>: .globl vector19 vector19: pushl $0 80105c12: 6a 00 push $0x0 pushl $19 80105c14: 6a 13 push $0x13 jmp alltraps 80105c16: e9 9f fa ff ff jmp 801056ba <alltraps> 80105c1b <vector20>: .globl vector20 vector20: pushl $0 80105c1b: 6a 00 push $0x0 pushl $20 80105c1d: 6a 14 push $0x14 jmp alltraps 80105c1f: e9 96 fa ff ff jmp 801056ba <alltraps> 80105c24 <vector21>: .globl vector21 vector21: pushl $0 80105c24: 6a 00 push $0x0 pushl $21 80105c26: 6a 15 push $0x15 jmp alltraps 80105c28: e9 8d fa ff ff jmp 801056ba <alltraps> 80105c2d <vector22>: .globl vector22 vector22: pushl $0 80105c2d: 6a 00 push $0x0 pushl $22 80105c2f: 6a 16 push $0x16 jmp alltraps 80105c31: e9 84 fa ff ff jmp 801056ba <alltraps> 80105c36 <vector23>: .globl vector23 vector23: pushl $0 80105c36: 6a 00 push $0x0 pushl $23 80105c38: 6a 17 push $0x17 jmp alltraps 80105c3a: e9 7b fa ff ff jmp 801056ba <alltraps> 80105c3f <vector24>: .globl vector24 vector24: pushl $0 80105c3f: 6a 00 push $0x0 pushl $24 80105c41: 6a 18 push $0x18 jmp alltraps 80105c43: e9 72 fa ff ff jmp 801056ba <alltraps> 80105c48 <vector25>: .globl vector25 vector25: pushl $0 80105c48: 6a 00 push $0x0 pushl $25 80105c4a: 6a 19 push $0x19 jmp alltraps 80105c4c: e9 69 fa ff ff jmp 801056ba <alltraps> 80105c51 <vector26>: .globl vector26 vector26: pushl $0 80105c51: 6a 00 push $0x0 pushl $26 80105c53: 6a 1a push $0x1a jmp alltraps 80105c55: e9 60 fa ff ff jmp 801056ba <alltraps> 80105c5a <vector27>: .globl vector27 vector27: pushl $0 80105c5a: 6a 00 push $0x0 pushl $27 80105c5c: 6a 1b push $0x1b jmp alltraps 80105c5e: e9 57 fa ff ff jmp 801056ba <alltraps> 80105c63 <vector28>: .globl vector28 vector28: pushl $0 80105c63: 6a 00 push $0x0 pushl $28 80105c65: 6a 1c push $0x1c jmp alltraps 80105c67: e9 4e fa ff ff jmp 801056ba <alltraps> 80105c6c <vector29>: .globl vector29 vector29: pushl $0 80105c6c: 6a 00 push $0x0 pushl $29 80105c6e: 6a 1d push $0x1d jmp alltraps 80105c70: e9 45 fa ff ff jmp 801056ba <alltraps> 80105c75 <vector30>: .globl vector30 vector30: pushl $0 80105c75: 6a 00 push $0x0 pushl $30 80105c77: 6a 1e push $0x1e jmp alltraps 80105c79: e9 3c fa ff ff jmp 801056ba <alltraps> 80105c7e <vector31>: .globl vector31 vector31: pushl $0 80105c7e: 6a 00 push $0x0 pushl $31 80105c80: 6a 1f push $0x1f jmp alltraps 80105c82: e9 33 fa ff ff jmp 801056ba <alltraps> 80105c87 <vector32>: .globl vector32 vector32: pushl $0 80105c87: 6a 00 push $0x0 pushl $32 80105c89: 6a 20 push $0x20 jmp alltraps 80105c8b: e9 2a fa ff ff jmp 801056ba <alltraps> 80105c90 <vector33>: .globl vector33 vector33: pushl $0 80105c90: 6a 00 push $0x0 pushl $33 80105c92: 6a 21 push $0x21 jmp alltraps 80105c94: e9 21 fa ff ff jmp 801056ba <alltraps> 80105c99 <vector34>: .globl vector34 vector34: pushl $0 80105c99: 6a 00 push $0x0 pushl $34 80105c9b: 6a 22 push $0x22 jmp alltraps 80105c9d: e9 18 fa ff ff jmp 801056ba <alltraps> 80105ca2 <vector35>: .globl vector35 vector35: pushl $0 80105ca2: 6a 00 push $0x0 pushl $35 80105ca4: 6a 23 push $0x23 jmp alltraps 80105ca6: e9 0f fa ff ff jmp 801056ba <alltraps> 80105cab <vector36>: .globl vector36 vector36: pushl $0 80105cab: 6a 00 push $0x0 pushl $36 80105cad: 6a 24 push $0x24 jmp alltraps 80105caf: e9 06 fa ff ff jmp 801056ba <alltraps> 80105cb4 <vector37>: .globl vector37 vector37: pushl $0 80105cb4: 6a 00 push $0x0 pushl $37 80105cb6: 6a 25 push $0x25 jmp alltraps 80105cb8: e9 fd f9 ff ff jmp 801056ba <alltraps> 80105cbd <vector38>: .globl vector38 vector38: pushl $0 80105cbd: 6a 00 push $0x0 pushl $38 80105cbf: 6a 26 push $0x26 jmp alltraps 80105cc1: e9 f4 f9 ff ff jmp 801056ba <alltraps> 80105cc6 <vector39>: .globl vector39 vector39: pushl $0 80105cc6: 6a 00 push $0x0 pushl $39 80105cc8: 6a 27 push $0x27 jmp alltraps 80105cca: e9 eb f9 ff ff jmp 801056ba <alltraps> 80105ccf <vector40>: .globl vector40 vector40: pushl $0 80105ccf: 6a 00 push $0x0 pushl $40 80105cd1: 6a 28 push $0x28 jmp alltraps 80105cd3: e9 e2 f9 ff ff jmp 801056ba <alltraps> 80105cd8 <vector41>: .globl vector41 vector41: pushl $0 80105cd8: 6a 00 push $0x0 pushl $41 80105cda: 6a 29 push $0x29 jmp alltraps 80105cdc: e9 d9 f9 ff ff jmp 801056ba <alltraps> 80105ce1 <vector42>: .globl vector42 vector42: pushl $0 80105ce1: 6a 00 push $0x0 pushl $42 80105ce3: 6a 2a push $0x2a jmp alltraps 80105ce5: e9 d0 f9 ff ff jmp 801056ba <alltraps> 80105cea <vector43>: .globl vector43 vector43: pushl $0 80105cea: 6a 00 push $0x0 pushl $43 80105cec: 6a 2b push $0x2b jmp alltraps 80105cee: e9 c7 f9 ff ff jmp 801056ba <alltraps> 80105cf3 <vector44>: .globl vector44 vector44: pushl $0 80105cf3: 6a 00 push $0x0 pushl $44 80105cf5: 6a 2c push $0x2c jmp alltraps 80105cf7: e9 be f9 ff ff jmp 801056ba <alltraps> 80105cfc <vector45>: .globl vector45 vector45: pushl $0 80105cfc: 6a 00 push $0x0 pushl $45 80105cfe: 6a 2d push $0x2d jmp alltraps 80105d00: e9 b5 f9 ff ff jmp 801056ba <alltraps> 80105d05 <vector46>: .globl vector46 vector46: pushl $0 80105d05: 6a 00 push $0x0 pushl $46 80105d07: 6a 2e push $0x2e jmp alltraps 80105d09: e9 ac f9 ff ff jmp 801056ba <alltraps> 80105d0e <vector47>: .globl vector47 vector47: pushl $0 80105d0e: 6a 00 push $0x0 pushl $47 80105d10: 6a 2f push $0x2f jmp alltraps 80105d12: e9 a3 f9 ff ff jmp 801056ba <alltraps> 80105d17 <vector48>: .globl vector48 vector48: pushl $0 80105d17: 6a 00 push $0x0 pushl $48 80105d19: 6a 30 push $0x30 jmp alltraps 80105d1b: e9 9a f9 ff ff jmp 801056ba <alltraps> 80105d20 <vector49>: .globl vector49 vector49: pushl $0 80105d20: 6a 00 push $0x0 pushl $49 80105d22: 6a 31 push $0x31 jmp alltraps 80105d24: e9 91 f9 ff ff jmp 801056ba <alltraps> 80105d29 <vector50>: .globl vector50 vector50: pushl $0 80105d29: 6a 00 push $0x0 pushl $50 80105d2b: 6a 32 push $0x32 jmp alltraps 80105d2d: e9 88 f9 ff ff jmp 801056ba <alltraps> 80105d32 <vector51>: .globl vector51 vector51: pushl $0 80105d32: 6a 00 push $0x0 pushl $51 80105d34: 6a 33 push $0x33 jmp alltraps 80105d36: e9 7f f9 ff ff jmp 801056ba <alltraps> 80105d3b <vector52>: .globl vector52 vector52: pushl $0 80105d3b: 6a 00 push $0x0 pushl $52 80105d3d: 6a 34 push $0x34 jmp alltraps 80105d3f: e9 76 f9 ff ff jmp 801056ba <alltraps> 80105d44 <vector53>: .globl vector53 vector53: pushl $0 80105d44: 6a 00 push $0x0 pushl $53 80105d46: 6a 35 push $0x35 jmp alltraps 80105d48: e9 6d f9 ff ff jmp 801056ba <alltraps> 80105d4d <vector54>: .globl vector54 vector54: pushl $0 80105d4d: 6a 00 push $0x0 pushl $54 80105d4f: 6a 36 push $0x36 jmp alltraps 80105d51: e9 64 f9 ff ff jmp 801056ba <alltraps> 80105d56 <vector55>: .globl vector55 vector55: pushl $0 80105d56: 6a 00 push $0x0 pushl $55 80105d58: 6a 37 push $0x37 jmp alltraps 80105d5a: e9 5b f9 ff ff jmp 801056ba <alltraps> 80105d5f <vector56>: .globl vector56 vector56: pushl $0 80105d5f: 6a 00 push $0x0 pushl $56 80105d61: 6a 38 push $0x38 jmp alltraps 80105d63: e9 52 f9 ff ff jmp 801056ba <alltraps> 80105d68 <vector57>: .globl vector57 vector57: pushl $0 80105d68: 6a 00 push $0x0 pushl $57 80105d6a: 6a 39 push $0x39 jmp alltraps 80105d6c: e9 49 f9 ff ff jmp 801056ba <alltraps> 80105d71 <vector58>: .globl vector58 vector58: pushl $0 80105d71: 6a 00 push $0x0 pushl $58 80105d73: 6a 3a push $0x3a jmp alltraps 80105d75: e9 40 f9 ff ff jmp 801056ba <alltraps> 80105d7a <vector59>: .globl vector59 vector59: pushl $0 80105d7a: 6a 00 push $0x0 pushl $59 80105d7c: 6a 3b push $0x3b jmp alltraps 80105d7e: e9 37 f9 ff ff jmp 801056ba <alltraps> 80105d83 <vector60>: .globl vector60 vector60: pushl $0 80105d83: 6a 00 push $0x0 pushl $60 80105d85: 6a 3c push $0x3c jmp alltraps 80105d87: e9 2e f9 ff ff jmp 801056ba <alltraps> 80105d8c <vector61>: .globl vector61 vector61: pushl $0 80105d8c: 6a 00 push $0x0 pushl $61 80105d8e: 6a 3d push $0x3d jmp alltraps 80105d90: e9 25 f9 ff ff jmp 801056ba <alltraps> 80105d95 <vector62>: .globl vector62 vector62: pushl $0 80105d95: 6a 00 push $0x0 pushl $62 80105d97: 6a 3e push $0x3e jmp alltraps 80105d99: e9 1c f9 ff ff jmp 801056ba <alltraps> 80105d9e <vector63>: .globl vector63 vector63: pushl $0 80105d9e: 6a 00 push $0x0 pushl $63 80105da0: 6a 3f push $0x3f jmp alltraps 80105da2: e9 13 f9 ff ff jmp 801056ba <alltraps> 80105da7 <vector64>: .globl vector64 vector64: pushl $0 80105da7: 6a 00 push $0x0 pushl $64 80105da9: 6a 40 push $0x40 jmp alltraps 80105dab: e9 0a f9 ff ff jmp 801056ba <alltraps> 80105db0 <vector65>: .globl vector65 vector65: pushl $0 80105db0: 6a 00 push $0x0 pushl $65 80105db2: 6a 41 push $0x41 jmp alltraps 80105db4: e9 01 f9 ff ff jmp 801056ba <alltraps> 80105db9 <vector66>: .globl vector66 vector66: pushl $0 80105db9: 6a 00 push $0x0 pushl $66 80105dbb: 6a 42 push $0x42 jmp alltraps 80105dbd: e9 f8 f8 ff ff jmp 801056ba <alltraps> 80105dc2 <vector67>: .globl vector67 vector67: pushl $0 80105dc2: 6a 00 push $0x0 pushl $67 80105dc4: 6a 43 push $0x43 jmp alltraps 80105dc6: e9 ef f8 ff ff jmp 801056ba <alltraps> 80105dcb <vector68>: .globl vector68 vector68: pushl $0 80105dcb: 6a 00 push $0x0 pushl $68 80105dcd: 6a 44 push $0x44 jmp alltraps 80105dcf: e9 e6 f8 ff ff jmp 801056ba <alltraps> 80105dd4 <vector69>: .globl vector69 vector69: pushl $0 80105dd4: 6a 00 push $0x0 pushl $69 80105dd6: 6a 45 push $0x45 jmp alltraps 80105dd8: e9 dd f8 ff ff jmp 801056ba <alltraps> 80105ddd <vector70>: .globl vector70 vector70: pushl $0 80105ddd: 6a 00 push $0x0 pushl $70 80105ddf: 6a 46 push $0x46 jmp alltraps 80105de1: e9 d4 f8 ff ff jmp 801056ba <alltraps> 80105de6 <vector71>: .globl vector71 vector71: pushl $0 80105de6: 6a 00 push $0x0 pushl $71 80105de8: 6a 47 push $0x47 jmp alltraps 80105dea: e9 cb f8 ff ff jmp 801056ba <alltraps> 80105def <vector72>: .globl vector72 vector72: pushl $0 80105def: 6a 00 push $0x0 pushl $72 80105df1: 6a 48 push $0x48 jmp alltraps 80105df3: e9 c2 f8 ff ff jmp 801056ba <alltraps> 80105df8 <vector73>: .globl vector73 vector73: pushl $0 80105df8: 6a 00 push $0x0 pushl $73 80105dfa: 6a 49 push $0x49 jmp alltraps 80105dfc: e9 b9 f8 ff ff jmp 801056ba <alltraps> 80105e01 <vector74>: .globl vector74 vector74: pushl $0 80105e01: 6a 00 push $0x0 pushl $74 80105e03: 6a 4a push $0x4a jmp alltraps 80105e05: e9 b0 f8 ff ff jmp 801056ba <alltraps> 80105e0a <vector75>: .globl vector75 vector75: pushl $0 80105e0a: 6a 00 push $0x0 pushl $75 80105e0c: 6a 4b push $0x4b jmp alltraps 80105e0e: e9 a7 f8 ff ff jmp 801056ba <alltraps> 80105e13 <vector76>: .globl vector76 vector76: pushl $0 80105e13: 6a 00 push $0x0 pushl $76 80105e15: 6a 4c push $0x4c jmp alltraps 80105e17: e9 9e f8 ff ff jmp 801056ba <alltraps> 80105e1c <vector77>: .globl vector77 vector77: pushl $0 80105e1c: 6a 00 push $0x0 pushl $77 80105e1e: 6a 4d push $0x4d jmp alltraps 80105e20: e9 95 f8 ff ff jmp 801056ba <alltraps> 80105e25 <vector78>: .globl vector78 vector78: pushl $0 80105e25: 6a 00 push $0x0 pushl $78 80105e27: 6a 4e push $0x4e jmp alltraps 80105e29: e9 8c f8 ff ff jmp 801056ba <alltraps> 80105e2e <vector79>: .globl vector79 vector79: pushl $0 80105e2e: 6a 00 push $0x0 pushl $79 80105e30: 6a 4f push $0x4f jmp alltraps 80105e32: e9 83 f8 ff ff jmp 801056ba <alltraps> 80105e37 <vector80>: .globl vector80 vector80: pushl $0 80105e37: 6a 00 push $0x0 pushl $80 80105e39: 6a 50 push $0x50 jmp alltraps 80105e3b: e9 7a f8 ff ff jmp 801056ba <alltraps> 80105e40 <vector81>: .globl vector81 vector81: pushl $0 80105e40: 6a 00 push $0x0 pushl $81 80105e42: 6a 51 push $0x51 jmp alltraps 80105e44: e9 71 f8 ff ff jmp 801056ba <alltraps> 80105e49 <vector82>: .globl vector82 vector82: pushl $0 80105e49: 6a 00 push $0x0 pushl $82 80105e4b: 6a 52 push $0x52 jmp alltraps 80105e4d: e9 68 f8 ff ff jmp 801056ba <alltraps> 80105e52 <vector83>: .globl vector83 vector83: pushl $0 80105e52: 6a 00 push $0x0 pushl $83 80105e54: 6a 53 push $0x53 jmp alltraps 80105e56: e9 5f f8 ff ff jmp 801056ba <alltraps> 80105e5b <vector84>: .globl vector84 vector84: pushl $0 80105e5b: 6a 00 push $0x0 pushl $84 80105e5d: 6a 54 push $0x54 jmp alltraps 80105e5f: e9 56 f8 ff ff jmp 801056ba <alltraps> 80105e64 <vector85>: .globl vector85 vector85: pushl $0 80105e64: 6a 00 push $0x0 pushl $85 80105e66: 6a 55 push $0x55 jmp alltraps 80105e68: e9 4d f8 ff ff jmp 801056ba <alltraps> 80105e6d <vector86>: .globl vector86 vector86: pushl $0 80105e6d: 6a 00 push $0x0 pushl $86 80105e6f: 6a 56 push $0x56 jmp alltraps 80105e71: e9 44 f8 ff ff jmp 801056ba <alltraps> 80105e76 <vector87>: .globl vector87 vector87: pushl $0 80105e76: 6a 00 push $0x0 pushl $87 80105e78: 6a 57 push $0x57 jmp alltraps 80105e7a: e9 3b f8 ff ff jmp 801056ba <alltraps> 80105e7f <vector88>: .globl vector88 vector88: pushl $0 80105e7f: 6a 00 push $0x0 pushl $88 80105e81: 6a 58 push $0x58 jmp alltraps 80105e83: e9 32 f8 ff ff jmp 801056ba <alltraps> 80105e88 <vector89>: .globl vector89 vector89: pushl $0 80105e88: 6a 00 push $0x0 pushl $89 80105e8a: 6a 59 push $0x59 jmp alltraps 80105e8c: e9 29 f8 ff ff jmp 801056ba <alltraps> 80105e91 <vector90>: .globl vector90 vector90: pushl $0 80105e91: 6a 00 push $0x0 pushl $90 80105e93: 6a 5a push $0x5a jmp alltraps 80105e95: e9 20 f8 ff ff jmp 801056ba <alltraps> 80105e9a <vector91>: .globl vector91 vector91: pushl $0 80105e9a: 6a 00 push $0x0 pushl $91 80105e9c: 6a 5b push $0x5b jmp alltraps 80105e9e: e9 17 f8 ff ff jmp 801056ba <alltraps> 80105ea3 <vector92>: .globl vector92 vector92: pushl $0 80105ea3: 6a 00 push $0x0 pushl $92 80105ea5: 6a 5c push $0x5c jmp alltraps 80105ea7: e9 0e f8 ff ff jmp 801056ba <alltraps> 80105eac <vector93>: .globl vector93 vector93: pushl $0 80105eac: 6a 00 push $0x0 pushl $93 80105eae: 6a 5d push $0x5d jmp alltraps 80105eb0: e9 05 f8 ff ff jmp 801056ba <alltraps> 80105eb5 <vector94>: .globl vector94 vector94: pushl $0 80105eb5: 6a 00 push $0x0 pushl $94 80105eb7: 6a 5e push $0x5e jmp alltraps 80105eb9: e9 fc f7 ff ff jmp 801056ba <alltraps> 80105ebe <vector95>: .globl vector95 vector95: pushl $0 80105ebe: 6a 00 push $0x0 pushl $95 80105ec0: 6a 5f push $0x5f jmp alltraps 80105ec2: e9 f3 f7 ff ff jmp 801056ba <alltraps> 80105ec7 <vector96>: .globl vector96 vector96: pushl $0 80105ec7: 6a 00 push $0x0 pushl $96 80105ec9: 6a 60 push $0x60 jmp alltraps 80105ecb: e9 ea f7 ff ff jmp 801056ba <alltraps> 80105ed0 <vector97>: .globl vector97 vector97: pushl $0 80105ed0: 6a 00 push $0x0 pushl $97 80105ed2: 6a 61 push $0x61 jmp alltraps 80105ed4: e9 e1 f7 ff ff jmp 801056ba <alltraps> 80105ed9 <vector98>: .globl vector98 vector98: pushl $0 80105ed9: 6a 00 push $0x0 pushl $98 80105edb: 6a 62 push $0x62 jmp alltraps 80105edd: e9 d8 f7 ff ff jmp 801056ba <alltraps> 80105ee2 <vector99>: .globl vector99 vector99: pushl $0 80105ee2: 6a 00 push $0x0 pushl $99 80105ee4: 6a 63 push $0x63 jmp alltraps 80105ee6: e9 cf f7 ff ff jmp 801056ba <alltraps> 80105eeb <vector100>: .globl vector100 vector100: pushl $0 80105eeb: 6a 00 push $0x0 pushl $100 80105eed: 6a 64 push $0x64 jmp alltraps 80105eef: e9 c6 f7 ff ff jmp 801056ba <alltraps> 80105ef4 <vector101>: .globl vector101 vector101: pushl $0 80105ef4: 6a 00 push $0x0 pushl $101 80105ef6: 6a 65 push $0x65 jmp alltraps 80105ef8: e9 bd f7 ff ff jmp 801056ba <alltraps> 80105efd <vector102>: .globl vector102 vector102: pushl $0 80105efd: 6a 00 push $0x0 pushl $102 80105eff: 6a 66 push $0x66 jmp alltraps 80105f01: e9 b4 f7 ff ff jmp 801056ba <alltraps> 80105f06 <vector103>: .globl vector103 vector103: pushl $0 80105f06: 6a 00 push $0x0 pushl $103 80105f08: 6a 67 push $0x67 jmp alltraps 80105f0a: e9 ab f7 ff ff jmp 801056ba <alltraps> 80105f0f <vector104>: .globl vector104 vector104: pushl $0 80105f0f: 6a 00 push $0x0 pushl $104 80105f11: 6a 68 push $0x68 jmp alltraps 80105f13: e9 a2 f7 ff ff jmp 801056ba <alltraps> 80105f18 <vector105>: .globl vector105 vector105: pushl $0 80105f18: 6a 00 push $0x0 pushl $105 80105f1a: 6a 69 push $0x69 jmp alltraps 80105f1c: e9 99 f7 ff ff jmp 801056ba <alltraps> 80105f21 <vector106>: .globl vector106 vector106: pushl $0 80105f21: 6a 00 push $0x0 pushl $106 80105f23: 6a 6a push $0x6a jmp alltraps 80105f25: e9 90 f7 ff ff jmp 801056ba <alltraps> 80105f2a <vector107>: .globl vector107 vector107: pushl $0 80105f2a: 6a 00 push $0x0 pushl $107 80105f2c: 6a 6b push $0x6b jmp alltraps 80105f2e: e9 87 f7 ff ff jmp 801056ba <alltraps> 80105f33 <vector108>: .globl vector108 vector108: pushl $0 80105f33: 6a 00 push $0x0 pushl $108 80105f35: 6a 6c push $0x6c jmp alltraps 80105f37: e9 7e f7 ff ff jmp 801056ba <alltraps> 80105f3c <vector109>: .globl vector109 vector109: pushl $0 80105f3c: 6a 00 push $0x0 pushl $109 80105f3e: 6a 6d push $0x6d jmp alltraps 80105f40: e9 75 f7 ff ff jmp 801056ba <alltraps> 80105f45 <vector110>: .globl vector110 vector110: pushl $0 80105f45: 6a 00 push $0x0 pushl $110 80105f47: 6a 6e push $0x6e jmp alltraps 80105f49: e9 6c f7 ff ff jmp 801056ba <alltraps> 80105f4e <vector111>: .globl vector111 vector111: pushl $0 80105f4e: 6a 00 push $0x0 pushl $111 80105f50: 6a 6f push $0x6f jmp alltraps 80105f52: e9 63 f7 ff ff jmp 801056ba <alltraps> 80105f57 <vector112>: .globl vector112 vector112: pushl $0 80105f57: 6a 00 push $0x0 pushl $112 80105f59: 6a 70 push $0x70 jmp alltraps 80105f5b: e9 5a f7 ff ff jmp 801056ba <alltraps> 80105f60 <vector113>: .globl vector113 vector113: pushl $0 80105f60: 6a 00 push $0x0 pushl $113 80105f62: 6a 71 push $0x71 jmp alltraps 80105f64: e9 51 f7 ff ff jmp 801056ba <alltraps> 80105f69 <vector114>: .globl vector114 vector114: pushl $0 80105f69: 6a 00 push $0x0 pushl $114 80105f6b: 6a 72 push $0x72 jmp alltraps 80105f6d: e9 48 f7 ff ff jmp 801056ba <alltraps> 80105f72 <vector115>: .globl vector115 vector115: pushl $0 80105f72: 6a 00 push $0x0 pushl $115 80105f74: 6a 73 push $0x73 jmp alltraps 80105f76: e9 3f f7 ff ff jmp 801056ba <alltraps> 80105f7b <vector116>: .globl vector116 vector116: pushl $0 80105f7b: 6a 00 push $0x0 pushl $116 80105f7d: 6a 74 push $0x74 jmp alltraps 80105f7f: e9 36 f7 ff ff jmp 801056ba <alltraps> 80105f84 <vector117>: .globl vector117 vector117: pushl $0 80105f84: 6a 00 push $0x0 pushl $117 80105f86: 6a 75 push $0x75 jmp alltraps 80105f88: e9 2d f7 ff ff jmp 801056ba <alltraps> 80105f8d <vector118>: .globl vector118 vector118: pushl $0 80105f8d: 6a 00 push $0x0 pushl $118 80105f8f: 6a 76 push $0x76 jmp alltraps 80105f91: e9 24 f7 ff ff jmp 801056ba <alltraps> 80105f96 <vector119>: .globl vector119 vector119: pushl $0 80105f96: 6a 00 push $0x0 pushl $119 80105f98: 6a 77 push $0x77 jmp alltraps 80105f9a: e9 1b f7 ff ff jmp 801056ba <alltraps> 80105f9f <vector120>: .globl vector120 vector120: pushl $0 80105f9f: 6a 00 push $0x0 pushl $120 80105fa1: 6a 78 push $0x78 jmp alltraps 80105fa3: e9 12 f7 ff ff jmp 801056ba <alltraps> 80105fa8 <vector121>: .globl vector121 vector121: pushl $0 80105fa8: 6a 00 push $0x0 pushl $121 80105faa: 6a 79 push $0x79 jmp alltraps 80105fac: e9 09 f7 ff ff jmp 801056ba <alltraps> 80105fb1 <vector122>: .globl vector122 vector122: pushl $0 80105fb1: 6a 00 push $0x0 pushl $122 80105fb3: 6a 7a push $0x7a jmp alltraps 80105fb5: e9 00 f7 ff ff jmp 801056ba <alltraps> 80105fba <vector123>: .globl vector123 vector123: pushl $0 80105fba: 6a 00 push $0x0 pushl $123 80105fbc: 6a 7b push $0x7b jmp alltraps 80105fbe: e9 f7 f6 ff ff jmp 801056ba <alltraps> 80105fc3 <vector124>: .globl vector124 vector124: pushl $0 80105fc3: 6a 00 push $0x0 pushl $124 80105fc5: 6a 7c push $0x7c jmp alltraps 80105fc7: e9 ee f6 ff ff jmp 801056ba <alltraps> 80105fcc <vector125>: .globl vector125 vector125: pushl $0 80105fcc: 6a 00 push $0x0 pushl $125 80105fce: 6a 7d push $0x7d jmp alltraps 80105fd0: e9 e5 f6 ff ff jmp 801056ba <alltraps> 80105fd5 <vector126>: .globl vector126 vector126: pushl $0 80105fd5: 6a 00 push $0x0 pushl $126 80105fd7: 6a 7e push $0x7e jmp alltraps 80105fd9: e9 dc f6 ff ff jmp 801056ba <alltraps> 80105fde <vector127>: .globl vector127 vector127: pushl $0 80105fde: 6a 00 push $0x0 pushl $127 80105fe0: 6a 7f push $0x7f jmp alltraps 80105fe2: e9 d3 f6 ff ff jmp 801056ba <alltraps> 80105fe7 <vector128>: .globl vector128 vector128: pushl $0 80105fe7: 6a 00 push $0x0 pushl $128 80105fe9: 68 80 00 00 00 push $0x80 jmp alltraps 80105fee: e9 c7 f6 ff ff jmp 801056ba <alltraps> 80105ff3 <vector129>: .globl vector129 vector129: pushl $0 80105ff3: 6a 00 push $0x0 pushl $129 80105ff5: 68 81 00 00 00 push $0x81 jmp alltraps 80105ffa: e9 bb f6 ff ff jmp 801056ba <alltraps> 80105fff <vector130>: .globl vector130 vector130: pushl $0 80105fff: 6a 00 push $0x0 pushl $130 80106001: 68 82 00 00 00 push $0x82 jmp alltraps 80106006: e9 af f6 ff ff jmp 801056ba <alltraps> 8010600b <vector131>: .globl vector131 vector131: pushl $0 8010600b: 6a 00 push $0x0 pushl $131 8010600d: 68 83 00 00 00 push $0x83 jmp alltraps 80106012: e9 a3 f6 ff ff jmp 801056ba <alltraps> 80106017 <vector132>: .globl vector132 vector132: pushl $0 80106017: 6a 00 push $0x0 pushl $132 80106019: 68 84 00 00 00 push $0x84 jmp alltraps 8010601e: e9 97 f6 ff ff jmp 801056ba <alltraps> 80106023 <vector133>: .globl vector133 vector133: pushl $0 80106023: 6a 00 push $0x0 pushl $133 80106025: 68 85 00 00 00 push $0x85 jmp alltraps 8010602a: e9 8b f6 ff ff jmp 801056ba <alltraps> 8010602f <vector134>: .globl vector134 vector134: pushl $0 8010602f: 6a 00 push $0x0 pushl $134 80106031: 68 86 00 00 00 push $0x86 jmp alltraps 80106036: e9 7f f6 ff ff jmp 801056ba <alltraps> 8010603b <vector135>: .globl vector135 vector135: pushl $0 8010603b: 6a 00 push $0x0 pushl $135 8010603d: 68 87 00 00 00 push $0x87 jmp alltraps 80106042: e9 73 f6 ff ff jmp 801056ba <alltraps> 80106047 <vector136>: .globl vector136 vector136: pushl $0 80106047: 6a 00 push $0x0 pushl $136 80106049: 68 88 00 00 00 push $0x88 jmp alltraps 8010604e: e9 67 f6 ff ff jmp 801056ba <alltraps> 80106053 <vector137>: .globl vector137 vector137: pushl $0 80106053: 6a 00 push $0x0 pushl $137 80106055: 68 89 00 00 00 push $0x89 jmp alltraps 8010605a: e9 5b f6 ff ff jmp 801056ba <alltraps> 8010605f <vector138>: .globl vector138 vector138: pushl $0 8010605f: 6a 00 push $0x0 pushl $138 80106061: 68 8a 00 00 00 push $0x8a jmp alltraps 80106066: e9 4f f6 ff ff jmp 801056ba <alltraps> 8010606b <vector139>: .globl vector139 vector139: pushl $0 8010606b: 6a 00 push $0x0 pushl $139 8010606d: 68 8b 00 00 00 push $0x8b jmp alltraps 80106072: e9 43 f6 ff ff jmp 801056ba <alltraps> 80106077 <vector140>: .globl vector140 vector140: pushl $0 80106077: 6a 00 push $0x0 pushl $140 80106079: 68 8c 00 00 00 push $0x8c jmp alltraps 8010607e: e9 37 f6 ff ff jmp 801056ba <alltraps> 80106083 <vector141>: .globl vector141 vector141: pushl $0 80106083: 6a 00 push $0x0 pushl $141 80106085: 68 8d 00 00 00 push $0x8d jmp alltraps 8010608a: e9 2b f6 ff ff jmp 801056ba <alltraps> 8010608f <vector142>: .globl vector142 vector142: pushl $0 8010608f: 6a 00 push $0x0 pushl $142 80106091: 68 8e 00 00 00 push $0x8e jmp alltraps 80106096: e9 1f f6 ff ff jmp 801056ba <alltraps> 8010609b <vector143>: .globl vector143 vector143: pushl $0 8010609b: 6a 00 push $0x0 pushl $143 8010609d: 68 8f 00 00 00 push $0x8f jmp alltraps 801060a2: e9 13 f6 ff ff jmp 801056ba <alltraps> 801060a7 <vector144>: .globl vector144 vector144: pushl $0 801060a7: 6a 00 push $0x0 pushl $144 801060a9: 68 90 00 00 00 push $0x90 jmp alltraps 801060ae: e9 07 f6 ff ff jmp 801056ba <alltraps> 801060b3 <vector145>: .globl vector145 vector145: pushl $0 801060b3: 6a 00 push $0x0 pushl $145 801060b5: 68 91 00 00 00 push $0x91 jmp alltraps 801060ba: e9 fb f5 ff ff jmp 801056ba <alltraps> 801060bf <vector146>: .globl vector146 vector146: pushl $0 801060bf: 6a 00 push $0x0 pushl $146 801060c1: 68 92 00 00 00 push $0x92 jmp alltraps 801060c6: e9 ef f5 ff ff jmp 801056ba <alltraps> 801060cb <vector147>: .globl vector147 vector147: pushl $0 801060cb: 6a 00 push $0x0 pushl $147 801060cd: 68 93 00 00 00 push $0x93 jmp alltraps 801060d2: e9 e3 f5 ff ff jmp 801056ba <alltraps> 801060d7 <vector148>: .globl vector148 vector148: pushl $0 801060d7: 6a 00 push $0x0 pushl $148 801060d9: 68 94 00 00 00 push $0x94 jmp alltraps 801060de: e9 d7 f5 ff ff jmp 801056ba <alltraps> 801060e3 <vector149>: .globl vector149 vector149: pushl $0 801060e3: 6a 00 push $0x0 pushl $149 801060e5: 68 95 00 00 00 push $0x95 jmp alltraps 801060ea: e9 cb f5 ff ff jmp 801056ba <alltraps> 801060ef <vector150>: .globl vector150 vector150: pushl $0 801060ef: 6a 00 push $0x0 pushl $150 801060f1: 68 96 00 00 00 push $0x96 jmp alltraps 801060f6: e9 bf f5 ff ff jmp 801056ba <alltraps> 801060fb <vector151>: .globl vector151 vector151: pushl $0 801060fb: 6a 00 push $0x0 pushl $151 801060fd: 68 97 00 00 00 push $0x97 jmp alltraps 80106102: e9 b3 f5 ff ff jmp 801056ba <alltraps> 80106107 <vector152>: .globl vector152 vector152: pushl $0 80106107: 6a 00 push $0x0 pushl $152 80106109: 68 98 00 00 00 push $0x98 jmp alltraps 8010610e: e9 a7 f5 ff ff jmp 801056ba <alltraps> 80106113 <vector153>: .globl vector153 vector153: pushl $0 80106113: 6a 00 push $0x0 pushl $153 80106115: 68 99 00 00 00 push $0x99 jmp alltraps 8010611a: e9 9b f5 ff ff jmp 801056ba <alltraps> 8010611f <vector154>: .globl vector154 vector154: pushl $0 8010611f: 6a 00 push $0x0 pushl $154 80106121: 68 9a 00 00 00 push $0x9a jmp alltraps 80106126: e9 8f f5 ff ff jmp 801056ba <alltraps> 8010612b <vector155>: .globl vector155 vector155: pushl $0 8010612b: 6a 00 push $0x0 pushl $155 8010612d: 68 9b 00 00 00 push $0x9b jmp alltraps 80106132: e9 83 f5 ff ff jmp 801056ba <alltraps> 80106137 <vector156>: .globl vector156 vector156: pushl $0 80106137: 6a 00 push $0x0 pushl $156 80106139: 68 9c 00 00 00 push $0x9c jmp alltraps 8010613e: e9 77 f5 ff ff jmp 801056ba <alltraps> 80106143 <vector157>: .globl vector157 vector157: pushl $0 80106143: 6a 00 push $0x0 pushl $157 80106145: 68 9d 00 00 00 push $0x9d jmp alltraps 8010614a: e9 6b f5 ff ff jmp 801056ba <alltraps> 8010614f <vector158>: .globl vector158 vector158: pushl $0 8010614f: 6a 00 push $0x0 pushl $158 80106151: 68 9e 00 00 00 push $0x9e jmp alltraps 80106156: e9 5f f5 ff ff jmp 801056ba <alltraps> 8010615b <vector159>: .globl vector159 vector159: pushl $0 8010615b: 6a 00 push $0x0 pushl $159 8010615d: 68 9f 00 00 00 push $0x9f jmp alltraps 80106162: e9 53 f5 ff ff jmp 801056ba <alltraps> 80106167 <vector160>: .globl vector160 vector160: pushl $0 80106167: 6a 00 push $0x0 pushl $160 80106169: 68 a0 00 00 00 push $0xa0 jmp alltraps 8010616e: e9 47 f5 ff ff jmp 801056ba <alltraps> 80106173 <vector161>: .globl vector161 vector161: pushl $0 80106173: 6a 00 push $0x0 pushl $161 80106175: 68 a1 00 00 00 push $0xa1 jmp alltraps 8010617a: e9 3b f5 ff ff jmp 801056ba <alltraps> 8010617f <vector162>: .globl vector162 vector162: pushl $0 8010617f: 6a 00 push $0x0 pushl $162 80106181: 68 a2 00 00 00 push $0xa2 jmp alltraps 80106186: e9 2f f5 ff ff jmp 801056ba <alltraps> 8010618b <vector163>: .globl vector163 vector163: pushl $0 8010618b: 6a 00 push $0x0 pushl $163 8010618d: 68 a3 00 00 00 push $0xa3 jmp alltraps 80106192: e9 23 f5 ff ff jmp 801056ba <alltraps> 80106197 <vector164>: .globl vector164 vector164: pushl $0 80106197: 6a 00 push $0x0 pushl $164 80106199: 68 a4 00 00 00 push $0xa4 jmp alltraps 8010619e: e9 17 f5 ff ff jmp 801056ba <alltraps> 801061a3 <vector165>: .globl vector165 vector165: pushl $0 801061a3: 6a 00 push $0x0 pushl $165 801061a5: 68 a5 00 00 00 push $0xa5 jmp alltraps 801061aa: e9 0b f5 ff ff jmp 801056ba <alltraps> 801061af <vector166>: .globl vector166 vector166: pushl $0 801061af: 6a 00 push $0x0 pushl $166 801061b1: 68 a6 00 00 00 push $0xa6 jmp alltraps 801061b6: e9 ff f4 ff ff jmp 801056ba <alltraps> 801061bb <vector167>: .globl vector167 vector167: pushl $0 801061bb: 6a 00 push $0x0 pushl $167 801061bd: 68 a7 00 00 00 push $0xa7 jmp alltraps 801061c2: e9 f3 f4 ff ff jmp 801056ba <alltraps> 801061c7 <vector168>: .globl vector168 vector168: pushl $0 801061c7: 6a 00 push $0x0 pushl $168 801061c9: 68 a8 00 00 00 push $0xa8 jmp alltraps 801061ce: e9 e7 f4 ff ff jmp 801056ba <alltraps> 801061d3 <vector169>: .globl vector169 vector169: pushl $0 801061d3: 6a 00 push $0x0 pushl $169 801061d5: 68 a9 00 00 00 push $0xa9 jmp alltraps 801061da: e9 db f4 ff ff jmp 801056ba <alltraps> 801061df <vector170>: .globl vector170 vector170: pushl $0 801061df: 6a 00 push $0x0 pushl $170 801061e1: 68 aa 00 00 00 push $0xaa jmp alltraps 801061e6: e9 cf f4 ff ff jmp 801056ba <alltraps> 801061eb <vector171>: .globl vector171 vector171: pushl $0 801061eb: 6a 00 push $0x0 pushl $171 801061ed: 68 ab 00 00 00 push $0xab jmp alltraps 801061f2: e9 c3 f4 ff ff jmp 801056ba <alltraps> 801061f7 <vector172>: .globl vector172 vector172: pushl $0 801061f7: 6a 00 push $0x0 pushl $172 801061f9: 68 ac 00 00 00 push $0xac jmp alltraps 801061fe: e9 b7 f4 ff ff jmp 801056ba <alltraps> 80106203 <vector173>: .globl vector173 vector173: pushl $0 80106203: 6a 00 push $0x0 pushl $173 80106205: 68 ad 00 00 00 push $0xad jmp alltraps 8010620a: e9 ab f4 ff ff jmp 801056ba <alltraps> 8010620f <vector174>: .globl vector174 vector174: pushl $0 8010620f: 6a 00 push $0x0 pushl $174 80106211: 68 ae 00 00 00 push $0xae jmp alltraps 80106216: e9 9f f4 ff ff jmp 801056ba <alltraps> 8010621b <vector175>: .globl vector175 vector175: pushl $0 8010621b: 6a 00 push $0x0 pushl $175 8010621d: 68 af 00 00 00 push $0xaf jmp alltraps 80106222: e9 93 f4 ff ff jmp 801056ba <alltraps> 80106227 <vector176>: .globl vector176 vector176: pushl $0 80106227: 6a 00 push $0x0 pushl $176 80106229: 68 b0 00 00 00 push $0xb0 jmp alltraps 8010622e: e9 87 f4 ff ff jmp 801056ba <alltraps> 80106233 <vector177>: .globl vector177 vector177: pushl $0 80106233: 6a 00 push $0x0 pushl $177 80106235: 68 b1 00 00 00 push $0xb1 jmp alltraps 8010623a: e9 7b f4 ff ff jmp 801056ba <alltraps> 8010623f <vector178>: .globl vector178 vector178: pushl $0 8010623f: 6a 00 push $0x0 pushl $178 80106241: 68 b2 00 00 00 push $0xb2 jmp alltraps 80106246: e9 6f f4 ff ff jmp 801056ba <alltraps> 8010624b <vector179>: .globl vector179 vector179: pushl $0 8010624b: 6a 00 push $0x0 pushl $179 8010624d: 68 b3 00 00 00 push $0xb3 jmp alltraps 80106252: e9 63 f4 ff ff jmp 801056ba <alltraps> 80106257 <vector180>: .globl vector180 vector180: pushl $0 80106257: 6a 00 push $0x0 pushl $180 80106259: 68 b4 00 00 00 push $0xb4 jmp alltraps 8010625e: e9 57 f4 ff ff jmp 801056ba <alltraps> 80106263 <vector181>: .globl vector181 vector181: pushl $0 80106263: 6a 00 push $0x0 pushl $181 80106265: 68 b5 00 00 00 push $0xb5 jmp alltraps 8010626a: e9 4b f4 ff ff jmp 801056ba <alltraps> 8010626f <vector182>: .globl vector182 vector182: pushl $0 8010626f: 6a 00 push $0x0 pushl $182 80106271: 68 b6 00 00 00 push $0xb6 jmp alltraps 80106276: e9 3f f4 ff ff jmp 801056ba <alltraps> 8010627b <vector183>: .globl vector183 vector183: pushl $0 8010627b: 6a 00 push $0x0 pushl $183 8010627d: 68 b7 00 00 00 push $0xb7 jmp alltraps 80106282: e9 33 f4 ff ff jmp 801056ba <alltraps> 80106287 <vector184>: .globl vector184 vector184: pushl $0 80106287: 6a 00 push $0x0 pushl $184 80106289: 68 b8 00 00 00 push $0xb8 jmp alltraps 8010628e: e9 27 f4 ff ff jmp 801056ba <alltraps> 80106293 <vector185>: .globl vector185 vector185: pushl $0 80106293: 6a 00 push $0x0 pushl $185 80106295: 68 b9 00 00 00 push $0xb9 jmp alltraps 8010629a: e9 1b f4 ff ff jmp 801056ba <alltraps> 8010629f <vector186>: .globl vector186 vector186: pushl $0 8010629f: 6a 00 push $0x0 pushl $186 801062a1: 68 ba 00 00 00 push $0xba jmp alltraps 801062a6: e9 0f f4 ff ff jmp 801056ba <alltraps> 801062ab <vector187>: .globl vector187 vector187: pushl $0 801062ab: 6a 00 push $0x0 pushl $187 801062ad: 68 bb 00 00 00 push $0xbb jmp alltraps 801062b2: e9 03 f4 ff ff jmp 801056ba <alltraps> 801062b7 <vector188>: .globl vector188 vector188: pushl $0 801062b7: 6a 00 push $0x0 pushl $188 801062b9: 68 bc 00 00 00 push $0xbc jmp alltraps 801062be: e9 f7 f3 ff ff jmp 801056ba <alltraps> 801062c3 <vector189>: .globl vector189 vector189: pushl $0 801062c3: 6a 00 push $0x0 pushl $189 801062c5: 68 bd 00 00 00 push $0xbd jmp alltraps 801062ca: e9 eb f3 ff ff jmp 801056ba <alltraps> 801062cf <vector190>: .globl vector190 vector190: pushl $0 801062cf: 6a 00 push $0x0 pushl $190 801062d1: 68 be 00 00 00 push $0xbe jmp alltraps 801062d6: e9 df f3 ff ff jmp 801056ba <alltraps> 801062db <vector191>: .globl vector191 vector191: pushl $0 801062db: 6a 00 push $0x0 pushl $191 801062dd: 68 bf 00 00 00 push $0xbf jmp alltraps 801062e2: e9 d3 f3 ff ff jmp 801056ba <alltraps> 801062e7 <vector192>: .globl vector192 vector192: pushl $0 801062e7: 6a 00 push $0x0 pushl $192 801062e9: 68 c0 00 00 00 push $0xc0 jmp alltraps 801062ee: e9 c7 f3 ff ff jmp 801056ba <alltraps> 801062f3 <vector193>: .globl vector193 vector193: pushl $0 801062f3: 6a 00 push $0x0 pushl $193 801062f5: 68 c1 00 00 00 push $0xc1 jmp alltraps 801062fa: e9 bb f3 ff ff jmp 801056ba <alltraps> 801062ff <vector194>: .globl vector194 vector194: pushl $0 801062ff: 6a 00 push $0x0 pushl $194 80106301: 68 c2 00 00 00 push $0xc2 jmp alltraps 80106306: e9 af f3 ff ff jmp 801056ba <alltraps> 8010630b <vector195>: .globl vector195 vector195: pushl $0 8010630b: 6a 00 push $0x0 pushl $195 8010630d: 68 c3 00 00 00 push $0xc3 jmp alltraps 80106312: e9 a3 f3 ff ff jmp 801056ba <alltraps> 80106317 <vector196>: .globl vector196 vector196: pushl $0 80106317: 6a 00 push $0x0 pushl $196 80106319: 68 c4 00 00 00 push $0xc4 jmp alltraps 8010631e: e9 97 f3 ff ff jmp 801056ba <alltraps> 80106323 <vector197>: .globl vector197 vector197: pushl $0 80106323: 6a 00 push $0x0 pushl $197 80106325: 68 c5 00 00 00 push $0xc5 jmp alltraps 8010632a: e9 8b f3 ff ff jmp 801056ba <alltraps> 8010632f <vector198>: .globl vector198 vector198: pushl $0 8010632f: 6a 00 push $0x0 pushl $198 80106331: 68 c6 00 00 00 push $0xc6 jmp alltraps 80106336: e9 7f f3 ff ff jmp 801056ba <alltraps> 8010633b <vector199>: .globl vector199 vector199: pushl $0 8010633b: 6a 00 push $0x0 pushl $199 8010633d: 68 c7 00 00 00 push $0xc7 jmp alltraps 80106342: e9 73 f3 ff ff jmp 801056ba <alltraps> 80106347 <vector200>: .globl vector200 vector200: pushl $0 80106347: 6a 00 push $0x0 pushl $200 80106349: 68 c8 00 00 00 push $0xc8 jmp alltraps 8010634e: e9 67 f3 ff ff jmp 801056ba <alltraps> 80106353 <vector201>: .globl vector201 vector201: pushl $0 80106353: 6a 00 push $0x0 pushl $201 80106355: 68 c9 00 00 00 push $0xc9 jmp alltraps 8010635a: e9 5b f3 ff ff jmp 801056ba <alltraps> 8010635f <vector202>: .globl vector202 vector202: pushl $0 8010635f: 6a 00 push $0x0 pushl $202 80106361: 68 ca 00 00 00 push $0xca jmp alltraps 80106366: e9 4f f3 ff ff jmp 801056ba <alltraps> 8010636b <vector203>: .globl vector203 vector203: pushl $0 8010636b: 6a 00 push $0x0 pushl $203 8010636d: 68 cb 00 00 00 push $0xcb jmp alltraps 80106372: e9 43 f3 ff ff jmp 801056ba <alltraps> 80106377 <vector204>: .globl vector204 vector204: pushl $0 80106377: 6a 00 push $0x0 pushl $204 80106379: 68 cc 00 00 00 push $0xcc jmp alltraps 8010637e: e9 37 f3 ff ff jmp 801056ba <alltraps> 80106383 <vector205>: .globl vector205 vector205: pushl $0 80106383: 6a 00 push $0x0 pushl $205 80106385: 68 cd 00 00 00 push $0xcd jmp alltraps 8010638a: e9 2b f3 ff ff jmp 801056ba <alltraps> 8010638f <vector206>: .globl vector206 vector206: pushl $0 8010638f: 6a 00 push $0x0 pushl $206 80106391: 68 ce 00 00 00 push $0xce jmp alltraps 80106396: e9 1f f3 ff ff jmp 801056ba <alltraps> 8010639b <vector207>: .globl vector207 vector207: pushl $0 8010639b: 6a 00 push $0x0 pushl $207 8010639d: 68 cf 00 00 00 push $0xcf jmp alltraps 801063a2: e9 13 f3 ff ff jmp 801056ba <alltraps> 801063a7 <vector208>: .globl vector208 vector208: pushl $0 801063a7: 6a 00 push $0x0 pushl $208 801063a9: 68 d0 00 00 00 push $0xd0 jmp alltraps 801063ae: e9 07 f3 ff ff jmp 801056ba <alltraps> 801063b3 <vector209>: .globl vector209 vector209: pushl $0 801063b3: 6a 00 push $0x0 pushl $209 801063b5: 68 d1 00 00 00 push $0xd1 jmp alltraps 801063ba: e9 fb f2 ff ff jmp 801056ba <alltraps> 801063bf <vector210>: .globl vector210 vector210: pushl $0 801063bf: 6a 00 push $0x0 pushl $210 801063c1: 68 d2 00 00 00 push $0xd2 jmp alltraps 801063c6: e9 ef f2 ff ff jmp 801056ba <alltraps> 801063cb <vector211>: .globl vector211 vector211: pushl $0 801063cb: 6a 00 push $0x0 pushl $211 801063cd: 68 d3 00 00 00 push $0xd3 jmp alltraps 801063d2: e9 e3 f2 ff ff jmp 801056ba <alltraps> 801063d7 <vector212>: .globl vector212 vector212: pushl $0 801063d7: 6a 00 push $0x0 pushl $212 801063d9: 68 d4 00 00 00 push $0xd4 jmp alltraps 801063de: e9 d7 f2 ff ff jmp 801056ba <alltraps> 801063e3 <vector213>: .globl vector213 vector213: pushl $0 801063e3: 6a 00 push $0x0 pushl $213 801063e5: 68 d5 00 00 00 push $0xd5 jmp alltraps 801063ea: e9 cb f2 ff ff jmp 801056ba <alltraps> 801063ef <vector214>: .globl vector214 vector214: pushl $0 801063ef: 6a 00 push $0x0 pushl $214 801063f1: 68 d6 00 00 00 push $0xd6 jmp alltraps 801063f6: e9 bf f2 ff ff jmp 801056ba <alltraps> 801063fb <vector215>: .globl vector215 vector215: pushl $0 801063fb: 6a 00 push $0x0 pushl $215 801063fd: 68 d7 00 00 00 push $0xd7 jmp alltraps 80106402: e9 b3 f2 ff ff jmp 801056ba <alltraps> 80106407 <vector216>: .globl vector216 vector216: pushl $0 80106407: 6a 00 push $0x0 pushl $216 80106409: 68 d8 00 00 00 push $0xd8 jmp alltraps 8010640e: e9 a7 f2 ff ff jmp 801056ba <alltraps> 80106413 <vector217>: .globl vector217 vector217: pushl $0 80106413: 6a 00 push $0x0 pushl $217 80106415: 68 d9 00 00 00 push $0xd9 jmp alltraps 8010641a: e9 9b f2 ff ff jmp 801056ba <alltraps> 8010641f <vector218>: .globl vector218 vector218: pushl $0 8010641f: 6a 00 push $0x0 pushl $218 80106421: 68 da 00 00 00 push $0xda jmp alltraps 80106426: e9 8f f2 ff ff jmp 801056ba <alltraps> 8010642b <vector219>: .globl vector219 vector219: pushl $0 8010642b: 6a 00 push $0x0 pushl $219 8010642d: 68 db 00 00 00 push $0xdb jmp alltraps 80106432: e9 83 f2 ff ff jmp 801056ba <alltraps> 80106437 <vector220>: .globl vector220 vector220: pushl $0 80106437: 6a 00 push $0x0 pushl $220 80106439: 68 dc 00 00 00 push $0xdc jmp alltraps 8010643e: e9 77 f2 ff ff jmp 801056ba <alltraps> 80106443 <vector221>: .globl vector221 vector221: pushl $0 80106443: 6a 00 push $0x0 pushl $221 80106445: 68 dd 00 00 00 push $0xdd jmp alltraps 8010644a: e9 6b f2 ff ff jmp 801056ba <alltraps> 8010644f <vector222>: .globl vector222 vector222: pushl $0 8010644f: 6a 00 push $0x0 pushl $222 80106451: 68 de 00 00 00 push $0xde jmp alltraps 80106456: e9 5f f2 ff ff jmp 801056ba <alltraps> 8010645b <vector223>: .globl vector223 vector223: pushl $0 8010645b: 6a 00 push $0x0 pushl $223 8010645d: 68 df 00 00 00 push $0xdf jmp alltraps 80106462: e9 53 f2 ff ff jmp 801056ba <alltraps> 80106467 <vector224>: .globl vector224 vector224: pushl $0 80106467: 6a 00 push $0x0 pushl $224 80106469: 68 e0 00 00 00 push $0xe0 jmp alltraps 8010646e: e9 47 f2 ff ff jmp 801056ba <alltraps> 80106473 <vector225>: .globl vector225 vector225: pushl $0 80106473: 6a 00 push $0x0 pushl $225 80106475: 68 e1 00 00 00 push $0xe1 jmp alltraps 8010647a: e9 3b f2 ff ff jmp 801056ba <alltraps> 8010647f <vector226>: .globl vector226 vector226: pushl $0 8010647f: 6a 00 push $0x0 pushl $226 80106481: 68 e2 00 00 00 push $0xe2 jmp alltraps 80106486: e9 2f f2 ff ff jmp 801056ba <alltraps> 8010648b <vector227>: .globl vector227 vector227: pushl $0 8010648b: 6a 00 push $0x0 pushl $227 8010648d: 68 e3 00 00 00 push $0xe3 jmp alltraps 80106492: e9 23 f2 ff ff jmp 801056ba <alltraps> 80106497 <vector228>: .globl vector228 vector228: pushl $0 80106497: 6a 00 push $0x0 pushl $228 80106499: 68 e4 00 00 00 push $0xe4 jmp alltraps 8010649e: e9 17 f2 ff ff jmp 801056ba <alltraps> 801064a3 <vector229>: .globl vector229 vector229: pushl $0 801064a3: 6a 00 push $0x0 pushl $229 801064a5: 68 e5 00 00 00 push $0xe5 jmp alltraps 801064aa: e9 0b f2 ff ff jmp 801056ba <alltraps> 801064af <vector230>: .globl vector230 vector230: pushl $0 801064af: 6a 00 push $0x0 pushl $230 801064b1: 68 e6 00 00 00 push $0xe6 jmp alltraps 801064b6: e9 ff f1 ff ff jmp 801056ba <alltraps> 801064bb <vector231>: .globl vector231 vector231: pushl $0 801064bb: 6a 00 push $0x0 pushl $231 801064bd: 68 e7 00 00 00 push $0xe7 jmp alltraps 801064c2: e9 f3 f1 ff ff jmp 801056ba <alltraps> 801064c7 <vector232>: .globl vector232 vector232: pushl $0 801064c7: 6a 00 push $0x0 pushl $232 801064c9: 68 e8 00 00 00 push $0xe8 jmp alltraps 801064ce: e9 e7 f1 ff ff jmp 801056ba <alltraps> 801064d3 <vector233>: .globl vector233 vector233: pushl $0 801064d3: 6a 00 push $0x0 pushl $233 801064d5: 68 e9 00 00 00 push $0xe9 jmp alltraps 801064da: e9 db f1 ff ff jmp 801056ba <alltraps> 801064df <vector234>: .globl vector234 vector234: pushl $0 801064df: 6a 00 push $0x0 pushl $234 801064e1: 68 ea 00 00 00 push $0xea jmp alltraps 801064e6: e9 cf f1 ff ff jmp 801056ba <alltraps> 801064eb <vector235>: .globl vector235 vector235: pushl $0 801064eb: 6a 00 push $0x0 pushl $235 801064ed: 68 eb 00 00 00 push $0xeb jmp alltraps 801064f2: e9 c3 f1 ff ff jmp 801056ba <alltraps> 801064f7 <vector236>: .globl vector236 vector236: pushl $0 801064f7: 6a 00 push $0x0 pushl $236 801064f9: 68 ec 00 00 00 push $0xec jmp alltraps 801064fe: e9 b7 f1 ff ff jmp 801056ba <alltraps> 80106503 <vector237>: .globl vector237 vector237: pushl $0 80106503: 6a 00 push $0x0 pushl $237 80106505: 68 ed 00 00 00 push $0xed jmp alltraps 8010650a: e9 ab f1 ff ff jmp 801056ba <alltraps> 8010650f <vector238>: .globl vector238 vector238: pushl $0 8010650f: 6a 00 push $0x0 pushl $238 80106511: 68 ee 00 00 00 push $0xee jmp alltraps 80106516: e9 9f f1 ff ff jmp 801056ba <alltraps> 8010651b <vector239>: .globl vector239 vector239: pushl $0 8010651b: 6a 00 push $0x0 pushl $239 8010651d: 68 ef 00 00 00 push $0xef jmp alltraps 80106522: e9 93 f1 ff ff jmp 801056ba <alltraps> 80106527 <vector240>: .globl vector240 vector240: pushl $0 80106527: 6a 00 push $0x0 pushl $240 80106529: 68 f0 00 00 00 push $0xf0 jmp alltraps 8010652e: e9 87 f1 ff ff jmp 801056ba <alltraps> 80106533 <vector241>: .globl vector241 vector241: pushl $0 80106533: 6a 00 push $0x0 pushl $241 80106535: 68 f1 00 00 00 push $0xf1 jmp alltraps 8010653a: e9 7b f1 ff ff jmp 801056ba <alltraps> 8010653f <vector242>: .globl vector242 vector242: pushl $0 8010653f: 6a 00 push $0x0 pushl $242 80106541: 68 f2 00 00 00 push $0xf2 jmp alltraps 80106546: e9 6f f1 ff ff jmp 801056ba <alltraps> 8010654b <vector243>: .globl vector243 vector243: pushl $0 8010654b: 6a 00 push $0x0 pushl $243 8010654d: 68 f3 00 00 00 push $0xf3 jmp alltraps 80106552: e9 63 f1 ff ff jmp 801056ba <alltraps> 80106557 <vector244>: .globl vector244 vector244: pushl $0 80106557: 6a 00 push $0x0 pushl $244 80106559: 68 f4 00 00 00 push $0xf4 jmp alltraps 8010655e: e9 57 f1 ff ff jmp 801056ba <alltraps> 80106563 <vector245>: .globl vector245 vector245: pushl $0 80106563: 6a 00 push $0x0 pushl $245 80106565: 68 f5 00 00 00 push $0xf5 jmp alltraps 8010656a: e9 4b f1 ff ff jmp 801056ba <alltraps> 8010656f <vector246>: .globl vector246 vector246: pushl $0 8010656f: 6a 00 push $0x0 pushl $246 80106571: 68 f6 00 00 00 push $0xf6 jmp alltraps 80106576: e9 3f f1 ff ff jmp 801056ba <alltraps> 8010657b <vector247>: .globl vector247 vector247: pushl $0 8010657b: 6a 00 push $0x0 pushl $247 8010657d: 68 f7 00 00 00 push $0xf7 jmp alltraps 80106582: e9 33 f1 ff ff jmp 801056ba <alltraps> 80106587 <vector248>: .globl vector248 vector248: pushl $0 80106587: 6a 00 push $0x0 pushl $248 80106589: 68 f8 00 00 00 push $0xf8 jmp alltraps 8010658e: e9 27 f1 ff ff jmp 801056ba <alltraps> 80106593 <vector249>: .globl vector249 vector249: pushl $0 80106593: 6a 00 push $0x0 pushl $249 80106595: 68 f9 00 00 00 push $0xf9 jmp alltraps 8010659a: e9 1b f1 ff ff jmp 801056ba <alltraps> 8010659f <vector250>: .globl vector250 vector250: pushl $0 8010659f: 6a 00 push $0x0 pushl $250 801065a1: 68 fa 00 00 00 push $0xfa jmp alltraps 801065a6: e9 0f f1 ff ff jmp 801056ba <alltraps> 801065ab <vector251>: .globl vector251 vector251: pushl $0 801065ab: 6a 00 push $0x0 pushl $251 801065ad: 68 fb 00 00 00 push $0xfb jmp alltraps 801065b2: e9 03 f1 ff ff jmp 801056ba <alltraps> 801065b7 <vector252>: .globl vector252 vector252: pushl $0 801065b7: 6a 00 push $0x0 pushl $252 801065b9: 68 fc 00 00 00 push $0xfc jmp alltraps 801065be: e9 f7 f0 ff ff jmp 801056ba <alltraps> 801065c3 <vector253>: .globl vector253 vector253: pushl $0 801065c3: 6a 00 push $0x0 pushl $253 801065c5: 68 fd 00 00 00 push $0xfd jmp alltraps 801065ca: e9 eb f0 ff ff jmp 801056ba <alltraps> 801065cf <vector254>: .globl vector254 vector254: pushl $0 801065cf: 6a 00 push $0x0 pushl $254 801065d1: 68 fe 00 00 00 push $0xfe jmp alltraps 801065d6: e9 df f0 ff ff jmp 801056ba <alltraps> 801065db <vector255>: .globl vector255 vector255: pushl $0 801065db: 6a 00 push $0x0 pushl $255 801065dd: 68 ff 00 00 00 push $0xff jmp alltraps 801065e2: e9 d3 f0 ff ff jmp 801056ba <alltraps> 801065e7: 66 90 xchg %ax,%ax 801065e9: 66 90 xchg %ax,%ax 801065eb: 66 90 xchg %ax,%ax 801065ed: 66 90 xchg %ax,%ax 801065ef: 90 nop 801065f0 <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) { 801065f0: 55 push %ebp 801065f1: 89 e5 mov %esp,%ebp 801065f3: 57 push %edi 801065f4: 56 push %esi 801065f5: 53 push %ebx 801065f6: 89 d3 mov %edx,%ebx pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 801065f8: c1 ea 16 shr $0x16,%edx 801065fb: 8d 3c 90 lea (%eax,%edx,4),%edi // 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) { 801065fe: 83 ec 0c sub $0xc,%esp pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; if(*pde & PTE_P){ 80106601: 8b 07 mov (%edi),%eax 80106603: a8 01 test $0x1,%al 80106605: 74 29 je 80106630 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 80106607: 25 00 f0 ff ff and $0xfffff000,%eax 8010660c: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi // 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)]; } 80106612: 8d 65 f4 lea -0xc(%ebp),%esp // 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)]; 80106615: c1 eb 0a shr $0xa,%ebx 80106618: 81 e3 fc 0f 00 00 and $0xffc,%ebx 8010661e: 8d 04 1e lea (%esi,%ebx,1),%eax } 80106621: 5b pop %ebx 80106622: 5e pop %esi 80106623: 5f pop %edi 80106624: 5d pop %ebp 80106625: c3 ret 80106626: 8d 76 00 lea 0x0(%esi),%esi 80106629: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pde = &pgdir[PDX(va)]; if(*pde & PTE_P){ pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); } else { if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 80106630: 85 c9 test %ecx,%ecx 80106632: 74 2c je 80106660 <walkpgdir+0x70> 80106634: e8 57 be ff ff call 80102490 <kalloc> 80106639: 85 c0 test %eax,%eax 8010663b: 89 c6 mov %eax,%esi 8010663d: 74 21 je 80106660 <walkpgdir+0x70> return 0; // Make sure all those PTE_P bits are zero. memset(pgtab, 0, PGSIZE); 8010663f: 83 ec 04 sub $0x4,%esp 80106642: 68 00 10 00 00 push $0x1000 80106647: 6a 00 push $0x0 80106649: 50 push %eax 8010664a: e8 61 de ff ff call 801044b0 <memset> // 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; 8010664f: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106655: 83 c4 10 add $0x10,%esp 80106658: 83 c8 07 or $0x7,%eax 8010665b: 89 07 mov %eax,(%edi) 8010665d: eb b3 jmp 80106612 <walkpgdir+0x22> 8010665f: 90 nop } return &pgtab[PTX(va)]; } 80106660: 8d 65 f4 lea -0xc(%ebp),%esp pde = &pgdir[PDX(va)]; if(*pde & PTE_P){ pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); } else { if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) return 0; 80106663: 31 c0 xor %eax,%eax // 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)]; } 80106665: 5b pop %ebx 80106666: 5e pop %esi 80106667: 5f pop %edi 80106668: 5d pop %ebp 80106669: c3 ret 8010666a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106670 <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) { 80106670: 55 push %ebp 80106671: 89 e5 mov %esp,%ebp 80106673: 57 push %edi 80106674: 56 push %esi 80106675: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80106676: 89 d3 mov %edx,%ebx 80106678: 81 e3 00 f0 ff ff and $0xfffff000,%ebx // 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) { 8010667e: 83 ec 1c sub $0x1c,%esp 80106681: 89 45 e4 mov %eax,-0x1c(%ebp) char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80106684: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80106688: 8b 7d 08 mov 0x8(%ebp),%edi 8010668b: 25 00 f0 ff ff and $0xfffff000,%eax 80106690: 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; 80106693: 8b 45 0c mov 0xc(%ebp),%eax 80106696: 29 df sub %ebx,%edi 80106698: 83 c8 01 or $0x1,%eax 8010669b: 89 45 dc mov %eax,-0x24(%ebp) 8010669e: eb 15 jmp 801066b5 <mappages+0x45> a = (char*)PGROUNDDOWN((uint)va); last = (char*)PGROUNDDOWN(((uint)va) + size - 1); for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) 801066a0: f6 00 01 testb $0x1,(%eax) 801066a3: 75 45 jne 801066ea <mappages+0x7a> panic("remap"); *pte = pa | perm | PTE_P; 801066a5: 0b 75 dc or -0x24(%ebp),%esi if(a == last) 801066a8: 3b 5d e0 cmp -0x20(%ebp),%ebx for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) panic("remap"); *pte = pa | perm | PTE_P; 801066ab: 89 30 mov %esi,(%eax) if(a == last) 801066ad: 74 31 je 801066e0 <mappages+0x70> break; a += PGSIZE; 801066af: 81 c3 00 10 00 00 add $0x1000,%ebx pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); last = (char*)PGROUNDDOWN(((uint)va) + size - 1); for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) 801066b5: 8b 45 e4 mov -0x1c(%ebp),%eax 801066b8: b9 01 00 00 00 mov $0x1,%ecx 801066bd: 89 da mov %ebx,%edx 801066bf: 8d 34 3b lea (%ebx,%edi,1),%esi 801066c2: e8 29 ff ff ff call 801065f0 <walkpgdir> 801066c7: 85 c0 test %eax,%eax 801066c9: 75 d5 jne 801066a0 <mappages+0x30> break; a += PGSIZE; pa += PGSIZE; } return 0; } 801066cb: 8d 65 f4 lea -0xc(%ebp),%esp a = (char*)PGROUNDDOWN((uint)va); last = (char*)PGROUNDDOWN(((uint)va) + size - 1); for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; 801066ce: b8 ff ff ff ff mov $0xffffffff,%eax break; a += PGSIZE; pa += PGSIZE; } return 0; } 801066d3: 5b pop %ebx 801066d4: 5e pop %esi 801066d5: 5f pop %edi 801066d6: 5d pop %ebp 801066d7: c3 ret 801066d8: 90 nop 801066d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801066e0: 8d 65 f4 lea -0xc(%ebp),%esp if(a == last) break; a += PGSIZE; pa += PGSIZE; } return 0; 801066e3: 31 c0 xor %eax,%eax } 801066e5: 5b pop %ebx 801066e6: 5e pop %esi 801066e7: 5f pop %edi 801066e8: 5d pop %ebp 801066e9: c3 ret last = (char*)PGROUNDDOWN(((uint)va) + size - 1); for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) panic("remap"); 801066ea: 83 ec 0c sub $0xc,%esp 801066ed: 68 6c 78 10 80 push $0x8010786c 801066f2: e8 79 9c ff ff call 80100370 <panic> 801066f7: 89 f6 mov %esi,%esi 801066f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106700 <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) 80106700: 55 push %ebp 80106701: 89 e5 mov %esp,%ebp 80106703: 57 push %edi 80106704: 56 push %esi 80106705: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 80106706: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx // 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) 8010670c: 89 c7 mov %eax,%edi uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 8010670e: 81 e3 00 f0 ff ff and $0xfffff000,%ebx // 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) 80106714: 83 ec 1c sub $0x1c,%esp 80106717: 89 4d e0 mov %ecx,-0x20(%ebp) if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); for(; a < oldsz; a += PGSIZE){ 8010671a: 39 d3 cmp %edx,%ebx 8010671c: 73 66 jae 80106784 <deallocuvm.part.0+0x84> 8010671e: 89 d6 mov %edx,%esi 80106720: eb 3d jmp 8010675f <deallocuvm.part.0+0x5f> 80106722: 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){ 80106728: 8b 10 mov (%eax),%edx 8010672a: f6 c2 01 test $0x1,%dl 8010672d: 74 26 je 80106755 <deallocuvm.part.0+0x55> pa = PTE_ADDR(*pte); if(pa == 0) 8010672f: 81 e2 00 f0 ff ff and $0xfffff000,%edx 80106735: 74 58 je 8010678f <deallocuvm.part.0+0x8f> panic("kfree"); char *v = P2V(pa); kfree(v); 80106737: 83 ec 0c sub $0xc,%esp 8010673a: 81 c2 00 00 00 80 add $0x80000000,%edx 80106740: 89 45 e4 mov %eax,-0x1c(%ebp) 80106743: 52 push %edx 80106744: e8 97 bb ff ff call 801022e0 <kfree> *pte = 0; 80106749: 8b 45 e4 mov -0x1c(%ebp),%eax 8010674c: 83 c4 10 add $0x10,%esp 8010674f: c7 00 00 00 00 00 movl $0x0,(%eax) if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); for(; a < oldsz; a += PGSIZE){ 80106755: 81 c3 00 10 00 00 add $0x1000,%ebx 8010675b: 39 f3 cmp %esi,%ebx 8010675d: 73 25 jae 80106784 <deallocuvm.part.0+0x84> pte = walkpgdir(pgdir, (char*)a, 0); 8010675f: 31 c9 xor %ecx,%ecx 80106761: 89 da mov %ebx,%edx 80106763: 89 f8 mov %edi,%eax 80106765: e8 86 fe ff ff call 801065f0 <walkpgdir> if(!pte) 8010676a: 85 c0 test %eax,%eax 8010676c: 75 ba jne 80106728 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 8010676e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106774: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); for(; a < oldsz; a += PGSIZE){ 8010677a: 81 c3 00 10 00 00 add $0x1000,%ebx 80106780: 39 f3 cmp %esi,%ebx 80106782: 72 db jb 8010675f <deallocuvm.part.0+0x5f> kfree(v); *pte = 0; } } return newsz; } 80106784: 8b 45 e0 mov -0x20(%ebp),%eax 80106787: 8d 65 f4 lea -0xc(%ebp),%esp 8010678a: 5b pop %ebx 8010678b: 5e pop %esi 8010678c: 5f pop %edi 8010678d: 5d pop %ebp 8010678e: c3 ret if(!pte) a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; else if((*pte & PTE_P) != 0){ pa = PTE_ADDR(*pte); if(pa == 0) panic("kfree"); 8010678f: 83 ec 0c sub $0xc,%esp 80106792: 68 c6 71 10 80 push $0x801071c6 80106797: e8 d4 9b ff ff call 80100370 <panic> 8010679c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801067a0 <seginit>: // Set up CPU's kernel segment descriptors. // Run once on entry on each CPU. void seginit(void) { 801067a0: 55 push %ebp 801067a1: 89 e5 mov %esp,%ebp 801067a3: 83 ec 18 sub $0x18,%esp // Map "logical" addresses to virtual addresses using identity map. // Cannot share a CODE descriptor for both kernel and user // because it would have to have DPL_USR, but the CPU forbids // an interrupt from CPL=0 to DPL=3. c = &cpus[cpuid()]; 801067a6: e8 b5 cf ff ff call 80103760 <cpuid> c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 801067ab: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax 801067b1: 31 c9 xor %ecx,%ecx 801067b3: ba ff ff ff ff mov $0xffffffff,%edx 801067b8: 66 89 90 f8 27 11 80 mov %dx,-0x7feed808(%eax) 801067bf: 66 89 88 fa 27 11 80 mov %cx,-0x7feed806(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801067c6: ba ff ff ff ff mov $0xffffffff,%edx 801067cb: 31 c9 xor %ecx,%ecx 801067cd: 66 89 90 00 28 11 80 mov %dx,-0x7feed800(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 801067d4: ba ff ff ff ff mov $0xffffffff,%edx // Cannot share a CODE descriptor for both kernel and user // because it would have to have DPL_USR, but the CPU forbids // an interrupt from CPL=0 to DPL=3. c = &cpus[cpuid()]; c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801067d9: 66 89 88 02 28 11 80 mov %cx,-0x7feed7fe(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 801067e0: 31 c9 xor %ecx,%ecx 801067e2: 66 89 90 08 28 11 80 mov %dx,-0x7feed7f8(%eax) 801067e9: 66 89 88 0a 28 11 80 mov %cx,-0x7feed7f6(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 801067f0: ba ff ff ff ff mov $0xffffffff,%edx 801067f5: 31 c9 xor %ecx,%ecx 801067f7: 66 89 90 10 28 11 80 mov %dx,-0x7feed7f0(%eax) // Map "logical" addresses to virtual addresses using identity map. // Cannot share a CODE descriptor for both kernel and user // because it would have to have DPL_USR, but the CPU forbids // an interrupt from CPL=0 to DPL=3. c = &cpus[cpuid()]; c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 801067fe: c6 80 fc 27 11 80 00 movb $0x0,-0x7feed804(%eax) static inline void lgdt(struct segdesc *p, int size) { volatile ushort pd[3]; pd[0] = size-1; 80106805: ba 2f 00 00 00 mov $0x2f,%edx 8010680a: c6 80 fd 27 11 80 9a movb $0x9a,-0x7feed803(%eax) 80106811: c6 80 fe 27 11 80 cf movb $0xcf,-0x7feed802(%eax) 80106818: c6 80 ff 27 11 80 00 movb $0x0,-0x7feed801(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 8010681f: c6 80 04 28 11 80 00 movb $0x0,-0x7feed7fc(%eax) 80106826: c6 80 05 28 11 80 92 movb $0x92,-0x7feed7fb(%eax) 8010682d: c6 80 06 28 11 80 cf movb $0xcf,-0x7feed7fa(%eax) 80106834: c6 80 07 28 11 80 00 movb $0x0,-0x7feed7f9(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 8010683b: c6 80 0c 28 11 80 00 movb $0x0,-0x7feed7f4(%eax) 80106842: c6 80 0d 28 11 80 fa movb $0xfa,-0x7feed7f3(%eax) 80106849: c6 80 0e 28 11 80 cf movb $0xcf,-0x7feed7f2(%eax) 80106850: c6 80 0f 28 11 80 00 movb $0x0,-0x7feed7f1(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 80106857: 66 89 88 12 28 11 80 mov %cx,-0x7feed7ee(%eax) 8010685e: c6 80 14 28 11 80 00 movb $0x0,-0x7feed7ec(%eax) 80106865: c6 80 15 28 11 80 f2 movb $0xf2,-0x7feed7eb(%eax) 8010686c: c6 80 16 28 11 80 cf movb $0xcf,-0x7feed7ea(%eax) 80106873: c6 80 17 28 11 80 00 movb $0x0,-0x7feed7e9(%eax) lgdt(c->gdt, sizeof(c->gdt)); 8010687a: 05 f0 27 11 80 add $0x801127f0,%eax 8010687f: 66 89 55 f2 mov %dx,-0xe(%ebp) pd[1] = (uint)p; 80106883: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 80106887: c1 e8 10 shr $0x10,%eax 8010688a: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 8010688e: 8d 45 f2 lea -0xe(%ebp),%eax 80106891: 0f 01 10 lgdtl (%eax) } 80106894: c9 leave 80106895: c3 ret 80106896: 8d 76 00 lea 0x0(%esi),%esi 80106899: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801068a0 <switchkvm>: } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 801068a0: a1 a4 54 11 80 mov 0x801154a4,%eax // Switch h/w page table register to the kernel-only page table, // for when no process is running. void switchkvm(void) { 801068a5: 55 push %ebp 801068a6: 89 e5 mov %esp,%ebp 801068a8: 05 00 00 00 80 add $0x80000000,%eax 801068ad: 0f 22 d8 mov %eax,%cr3 lcr3(V2P(kpgdir)); // switch to the kernel page table } 801068b0: 5d pop %ebp 801068b1: c3 ret 801068b2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801068b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801068c0 <switchuvm>: // Switch TSS and h/w page table to correspond to process p. void switchuvm(struct proc *p) { 801068c0: 55 push %ebp 801068c1: 89 e5 mov %esp,%ebp 801068c3: 57 push %edi 801068c4: 56 push %esi 801068c5: 53 push %ebx 801068c6: 83 ec 1c sub $0x1c,%esp 801068c9: 8b 75 08 mov 0x8(%ebp),%esi if(p == 0) 801068cc: 85 f6 test %esi,%esi 801068ce: 0f 84 cd 00 00 00 je 801069a1 <switchuvm+0xe1> panic("switchuvm: no process"); if(p->kstack == 0) 801068d4: 8b 46 08 mov 0x8(%esi),%eax 801068d7: 85 c0 test %eax,%eax 801068d9: 0f 84 dc 00 00 00 je 801069bb <switchuvm+0xfb> panic("switchuvm: no kstack"); if(p->pgdir == 0) 801068df: 8b 7e 04 mov 0x4(%esi),%edi 801068e2: 85 ff test %edi,%edi 801068e4: 0f 84 c4 00 00 00 je 801069ae <switchuvm+0xee> panic("switchuvm: no pgdir"); pushcli(); 801068ea: e8 11 da ff ff call 80104300 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 801068ef: e8 ec cd ff ff call 801036e0 <mycpu> 801068f4: 89 c3 mov %eax,%ebx 801068f6: e8 e5 cd ff ff call 801036e0 <mycpu> 801068fb: 89 c7 mov %eax,%edi 801068fd: e8 de cd ff ff call 801036e0 <mycpu> 80106902: 89 45 e4 mov %eax,-0x1c(%ebp) 80106905: 83 c7 08 add $0x8,%edi 80106908: e8 d3 cd ff ff call 801036e0 <mycpu> 8010690d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106910: 83 c0 08 add $0x8,%eax 80106913: ba 67 00 00 00 mov $0x67,%edx 80106918: c1 e8 18 shr $0x18,%eax 8010691b: 66 89 93 98 00 00 00 mov %dx,0x98(%ebx) 80106922: 66 89 bb 9a 00 00 00 mov %di,0x9a(%ebx) 80106929: c6 83 9d 00 00 00 99 movb $0x99,0x9d(%ebx) 80106930: c6 83 9e 00 00 00 40 movb $0x40,0x9e(%ebx) 80106937: 83 c1 08 add $0x8,%ecx 8010693a: 88 83 9f 00 00 00 mov %al,0x9f(%ebx) 80106940: c1 e9 10 shr $0x10,%ecx 80106943: 88 8b 9c 00 00 00 mov %cl,0x9c(%ebx) mycpu()->gdt[SEG_TSS].s = 0; mycpu()->ts.ss0 = SEG_KDATA << 3; mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; // setting IOPL=0 in eflags *and* iomb beyond the tss segment limit // forbids I/O instructions (e.g., inb and outb) from user space mycpu()->ts.iomb = (ushort) 0xFFFF; 80106949: bb ff ff ff ff mov $0xffffffff,%ebx panic("switchuvm: no pgdir"); pushcli(); mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, sizeof(mycpu()->ts)-1, 0); mycpu()->gdt[SEG_TSS].s = 0; 8010694e: e8 8d cd ff ff call 801036e0 <mycpu> 80106953: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 8010695a: e8 81 cd ff ff call 801036e0 <mycpu> 8010695f: b9 10 00 00 00 mov $0x10,%ecx 80106964: 66 89 48 10 mov %cx,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 80106968: e8 73 cd ff ff call 801036e0 <mycpu> 8010696d: 8b 56 08 mov 0x8(%esi),%edx 80106970: 8d 8a 00 10 00 00 lea 0x1000(%edx),%ecx 80106976: 89 48 0c mov %ecx,0xc(%eax) // setting IOPL=0 in eflags *and* iomb beyond the tss segment limit // forbids I/O instructions (e.g., inb and outb) from user space mycpu()->ts.iomb = (ushort) 0xFFFF; 80106979: e8 62 cd ff ff call 801036e0 <mycpu> 8010697e: 66 89 58 6e mov %bx,0x6e(%eax) } static inline void ltr(ushort sel) { asm volatile("ltr %0" : : "r" (sel)); 80106982: b8 28 00 00 00 mov $0x28,%eax 80106987: 0f 00 d8 ltr %ax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 8010698a: 8b 46 04 mov 0x4(%esi),%eax 8010698d: 05 00 00 00 80 add $0x80000000,%eax 80106992: 0f 22 d8 mov %eax,%cr3 ltr(SEG_TSS << 3); lcr3(V2P(p->pgdir)); // switch to process's address space popcli(); } 80106995: 8d 65 f4 lea -0xc(%ebp),%esp 80106998: 5b pop %ebx 80106999: 5e pop %esi 8010699a: 5f pop %edi 8010699b: 5d pop %ebp // setting IOPL=0 in eflags *and* iomb beyond the tss segment limit // forbids I/O instructions (e.g., inb and outb) from user space mycpu()->ts.iomb = (ushort) 0xFFFF; ltr(SEG_TSS << 3); lcr3(V2P(p->pgdir)); // switch to process's address space popcli(); 8010699c: e9 4f da ff ff jmp 801043f0 <popcli> // Switch TSS and h/w page table to correspond to process p. void switchuvm(struct proc *p) { if(p == 0) panic("switchuvm: no process"); 801069a1: 83 ec 0c sub $0xc,%esp 801069a4: 68 72 78 10 80 push $0x80107872 801069a9: e8 c2 99 ff ff call 80100370 <panic> if(p->kstack == 0) panic("switchuvm: no kstack"); if(p->pgdir == 0) panic("switchuvm: no pgdir"); 801069ae: 83 ec 0c sub $0xc,%esp 801069b1: 68 9d 78 10 80 push $0x8010789d 801069b6: e8 b5 99 ff ff call 80100370 <panic> switchuvm(struct proc *p) { if(p == 0) panic("switchuvm: no process"); if(p->kstack == 0) panic("switchuvm: no kstack"); 801069bb: 83 ec 0c sub $0xc,%esp 801069be: 68 88 78 10 80 push $0x80107888 801069c3: e8 a8 99 ff ff call 80100370 <panic> 801069c8: 90 nop 801069c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801069d0 <inituvm>: // Load the initcode into address 0 of pgdir. // sz must be less than a page. void inituvm(pde_t *pgdir, char *init, uint sz) { 801069d0: 55 push %ebp 801069d1: 89 e5 mov %esp,%ebp 801069d3: 57 push %edi 801069d4: 56 push %esi 801069d5: 53 push %ebx 801069d6: 83 ec 1c sub $0x1c,%esp 801069d9: 8b 75 10 mov 0x10(%ebp),%esi 801069dc: 8b 45 08 mov 0x8(%ebp),%eax 801069df: 8b 7d 0c mov 0xc(%ebp),%edi char *mem; if(sz >= PGSIZE) 801069e2: 81 fe ff 0f 00 00 cmp $0xfff,%esi // Load the initcode into address 0 of pgdir. // sz must be less than a page. void inituvm(pde_t *pgdir, char *init, uint sz) { 801069e8: 89 45 e4 mov %eax,-0x1c(%ebp) char *mem; if(sz >= PGSIZE) 801069eb: 77 49 ja 80106a36 <inituvm+0x66> panic("inituvm: more than a page"); mem = kalloc(); 801069ed: e8 9e ba ff ff call 80102490 <kalloc> memset(mem, 0, PGSIZE); 801069f2: 83 ec 04 sub $0x4,%esp { char *mem; if(sz >= PGSIZE) panic("inituvm: more than a page"); mem = kalloc(); 801069f5: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 801069f7: 68 00 10 00 00 push $0x1000 801069fc: 6a 00 push $0x0 801069fe: 50 push %eax 801069ff: e8 ac da ff ff call 801044b0 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 80106a04: 58 pop %eax 80106a05: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106a0b: b9 00 10 00 00 mov $0x1000,%ecx 80106a10: 5a pop %edx 80106a11: 6a 06 push $0x6 80106a13: 50 push %eax 80106a14: 31 d2 xor %edx,%edx 80106a16: 8b 45 e4 mov -0x1c(%ebp),%eax 80106a19: e8 52 fc ff ff call 80106670 <mappages> memmove(mem, init, sz); 80106a1e: 89 75 10 mov %esi,0x10(%ebp) 80106a21: 89 7d 0c mov %edi,0xc(%ebp) 80106a24: 83 c4 10 add $0x10,%esp 80106a27: 89 5d 08 mov %ebx,0x8(%ebp) } 80106a2a: 8d 65 f4 lea -0xc(%ebp),%esp 80106a2d: 5b pop %ebx 80106a2e: 5e pop %esi 80106a2f: 5f pop %edi 80106a30: 5d pop %ebp if(sz >= PGSIZE) panic("inituvm: more than a page"); mem = kalloc(); memset(mem, 0, PGSIZE); mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); memmove(mem, init, sz); 80106a31: e9 2a db ff ff jmp 80104560 <memmove> inituvm(pde_t *pgdir, char *init, uint sz) { char *mem; if(sz >= PGSIZE) panic("inituvm: more than a page"); 80106a36: 83 ec 0c sub $0xc,%esp 80106a39: 68 b1 78 10 80 push $0x801078b1 80106a3e: e8 2d 99 ff ff call 80100370 <panic> 80106a43: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106a49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106a50 <loaduvm>: // Load a program segment into pgdir. addr must be page-aligned // and the pages from addr to addr+sz must already be mapped. int loaduvm(pde_t *pgdir, char *addr, struct inode *ip, uint offset, uint sz) { 80106a50: 55 push %ebp 80106a51: 89 e5 mov %esp,%ebp 80106a53: 57 push %edi 80106a54: 56 push %esi 80106a55: 53 push %ebx 80106a56: 83 ec 0c sub $0xc,%esp uint i, pa, n; pte_t *pte; if((uint) addr % PGSIZE != 0) 80106a59: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80106a60: 0f 85 91 00 00 00 jne 80106af7 <loaduvm+0xa7> panic("loaduvm: addr must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ 80106a66: 8b 75 18 mov 0x18(%ebp),%esi 80106a69: 31 db xor %ebx,%ebx 80106a6b: 85 f6 test %esi,%esi 80106a6d: 75 1a jne 80106a89 <loaduvm+0x39> 80106a6f: eb 6f jmp 80106ae0 <loaduvm+0x90> 80106a71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106a78: 81 c3 00 10 00 00 add $0x1000,%ebx 80106a7e: 81 ee 00 10 00 00 sub $0x1000,%esi 80106a84: 39 5d 18 cmp %ebx,0x18(%ebp) 80106a87: 76 57 jbe 80106ae0 <loaduvm+0x90> if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 80106a89: 8b 55 0c mov 0xc(%ebp),%edx 80106a8c: 8b 45 08 mov 0x8(%ebp),%eax 80106a8f: 31 c9 xor %ecx,%ecx 80106a91: 01 da add %ebx,%edx 80106a93: e8 58 fb ff ff call 801065f0 <walkpgdir> 80106a98: 85 c0 test %eax,%eax 80106a9a: 74 4e je 80106aea <loaduvm+0x9a> panic("loaduvm: address should exist"); pa = PTE_ADDR(*pte); 80106a9c: 8b 00 mov (%eax),%eax if(sz - i < PGSIZE) n = sz - i; else n = PGSIZE; if(readi(ip, P2V(pa), offset+i, n) != n) 80106a9e: 8b 4d 14 mov 0x14(%ebp),%ecx panic("loaduvm: addr must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) panic("loaduvm: address should exist"); pa = PTE_ADDR(*pte); if(sz - i < PGSIZE) 80106aa1: bf 00 10 00 00 mov $0x1000,%edi if((uint) addr % PGSIZE != 0) panic("loaduvm: addr must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) panic("loaduvm: address should exist"); pa = PTE_ADDR(*pte); 80106aa6: 25 00 f0 ff ff and $0xfffff000,%eax if(sz - i < PGSIZE) 80106aab: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80106ab1: 0f 46 fe cmovbe %esi,%edi n = sz - i; else n = PGSIZE; if(readi(ip, P2V(pa), offset+i, n) != n) 80106ab4: 01 d9 add %ebx,%ecx 80106ab6: 05 00 00 00 80 add $0x80000000,%eax 80106abb: 57 push %edi 80106abc: 51 push %ecx 80106abd: 50 push %eax 80106abe: ff 75 10 pushl 0x10(%ebp) 80106ac1: e8 8a ae ff ff call 80101950 <readi> 80106ac6: 83 c4 10 add $0x10,%esp 80106ac9: 39 c7 cmp %eax,%edi 80106acb: 74 ab je 80106a78 <loaduvm+0x28> return -1; } return 0; } 80106acd: 8d 65 f4 lea -0xc(%ebp),%esp if(sz - i < PGSIZE) n = sz - i; else n = PGSIZE; if(readi(ip, P2V(pa), offset+i, n) != n) return -1; 80106ad0: b8 ff ff ff ff mov $0xffffffff,%eax } return 0; } 80106ad5: 5b pop %ebx 80106ad6: 5e pop %esi 80106ad7: 5f pop %edi 80106ad8: 5d pop %ebp 80106ad9: c3 ret 80106ada: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106ae0: 8d 65 f4 lea -0xc(%ebp),%esp else n = PGSIZE; if(readi(ip, P2V(pa), offset+i, n) != n) return -1; } return 0; 80106ae3: 31 c0 xor %eax,%eax } 80106ae5: 5b pop %ebx 80106ae6: 5e pop %esi 80106ae7: 5f pop %edi 80106ae8: 5d pop %ebp 80106ae9: c3 ret if((uint) addr % PGSIZE != 0) panic("loaduvm: addr must be page aligned"); for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) panic("loaduvm: address should exist"); 80106aea: 83 ec 0c sub $0xc,%esp 80106aed: 68 cb 78 10 80 push $0x801078cb 80106af2: e8 79 98 ff ff call 80100370 <panic> { uint i, pa, n; pte_t *pte; if((uint) addr % PGSIZE != 0) panic("loaduvm: addr must be page aligned"); 80106af7: 83 ec 0c sub $0xc,%esp 80106afa: 68 6c 79 10 80 push $0x8010796c 80106aff: e8 6c 98 ff ff call 80100370 <panic> 80106b04: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106b0a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106b10 <allocuvm>: // Allocate page tables and physical memory to grow process from oldsz to // newsz, which need not be page aligned. Returns new size or 0 on error. int allocuvm(pde_t *pgdir, uint oldsz, uint newsz) { 80106b10: 55 push %ebp 80106b11: 89 e5 mov %esp,%ebp 80106b13: 57 push %edi 80106b14: 56 push %esi 80106b15: 53 push %ebx 80106b16: 83 ec 0c sub $0xc,%esp 80106b19: 8b 7d 10 mov 0x10(%ebp),%edi char *mem; uint a; if(newsz >= KERNBASE) 80106b1c: 85 ff test %edi,%edi 80106b1e: 0f 88 ca 00 00 00 js 80106bee <allocuvm+0xde> return 0; if(newsz < oldsz) 80106b24: 3b 7d 0c cmp 0xc(%ebp),%edi return oldsz; 80106b27: 8b 45 0c mov 0xc(%ebp),%eax char *mem; uint a; if(newsz >= KERNBASE) return 0; if(newsz < oldsz) 80106b2a: 0f 82 82 00 00 00 jb 80106bb2 <allocuvm+0xa2> return oldsz; a = PGROUNDUP(oldsz); 80106b30: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80106b36: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 80106b3c: 39 df cmp %ebx,%edi 80106b3e: 77 43 ja 80106b83 <allocuvm+0x73> 80106b40: e9 bb 00 00 00 jmp 80106c00 <allocuvm+0xf0> 80106b45: 8d 76 00 lea 0x0(%esi),%esi if(mem == 0){ cprintf("allocuvm out of memory\n"); deallocuvm(pgdir, newsz, oldsz); return 0; } memset(mem, 0, PGSIZE); 80106b48: 83 ec 04 sub $0x4,%esp 80106b4b: 68 00 10 00 00 push $0x1000 80106b50: 6a 00 push $0x0 80106b52: 50 push %eax 80106b53: e8 58 d9 ff ff call 801044b0 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 80106b58: 58 pop %eax 80106b59: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106b5f: b9 00 10 00 00 mov $0x1000,%ecx 80106b64: 5a pop %edx 80106b65: 6a 06 push $0x6 80106b67: 50 push %eax 80106b68: 89 da mov %ebx,%edx 80106b6a: 8b 45 08 mov 0x8(%ebp),%eax 80106b6d: e8 fe fa ff ff call 80106670 <mappages> 80106b72: 83 c4 10 add $0x10,%esp 80106b75: 85 c0 test %eax,%eax 80106b77: 78 47 js 80106bc0 <allocuvm+0xb0> return 0; if(newsz < oldsz) return oldsz; a = PGROUNDUP(oldsz); for(; a < newsz; a += PGSIZE){ 80106b79: 81 c3 00 10 00 00 add $0x1000,%ebx 80106b7f: 39 df cmp %ebx,%edi 80106b81: 76 7d jbe 80106c00 <allocuvm+0xf0> mem = kalloc(); 80106b83: e8 08 b9 ff ff call 80102490 <kalloc> if(mem == 0){ 80106b88: 85 c0 test %eax,%eax if(newsz < oldsz) return oldsz; a = PGROUNDUP(oldsz); for(; a < newsz; a += PGSIZE){ mem = kalloc(); 80106b8a: 89 c6 mov %eax,%esi if(mem == 0){ 80106b8c: 75 ba jne 80106b48 <allocuvm+0x38> cprintf("allocuvm out of memory\n"); 80106b8e: 83 ec 0c sub $0xc,%esp 80106b91: 68 e9 78 10 80 push $0x801078e9 80106b96: e8 c5 9a ff ff call 80100660 <cprintf> deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { pte_t *pte; uint a, pa; if(newsz >= oldsz) 80106b9b: 83 c4 10 add $0x10,%esp 80106b9e: 3b 7d 0c cmp 0xc(%ebp),%edi 80106ba1: 76 4b jbe 80106bee <allocuvm+0xde> 80106ba3: 8b 4d 0c mov 0xc(%ebp),%ecx 80106ba6: 8b 45 08 mov 0x8(%ebp),%eax 80106ba9: 89 fa mov %edi,%edx 80106bab: e8 50 fb ff ff call 80106700 <deallocuvm.part.0> for(; a < newsz; a += PGSIZE){ mem = kalloc(); if(mem == 0){ cprintf("allocuvm out of memory\n"); deallocuvm(pgdir, newsz, oldsz); return 0; 80106bb0: 31 c0 xor %eax,%eax kfree(mem); return 0; } } return newsz; } 80106bb2: 8d 65 f4 lea -0xc(%ebp),%esp 80106bb5: 5b pop %ebx 80106bb6: 5e pop %esi 80106bb7: 5f pop %edi 80106bb8: 5d pop %ebp 80106bb9: c3 ret 80106bba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi deallocuvm(pgdir, newsz, oldsz); return 0; } memset(mem, 0, PGSIZE); if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ cprintf("allocuvm out of memory (2)\n"); 80106bc0: 83 ec 0c sub $0xc,%esp 80106bc3: 68 01 79 10 80 push $0x80107901 80106bc8: e8 93 9a ff ff call 80100660 <cprintf> deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { pte_t *pte; uint a, pa; if(newsz >= oldsz) 80106bcd: 83 c4 10 add $0x10,%esp 80106bd0: 3b 7d 0c cmp 0xc(%ebp),%edi 80106bd3: 76 0d jbe 80106be2 <allocuvm+0xd2> 80106bd5: 8b 4d 0c mov 0xc(%ebp),%ecx 80106bd8: 8b 45 08 mov 0x8(%ebp),%eax 80106bdb: 89 fa mov %edi,%edx 80106bdd: e8 1e fb ff ff call 80106700 <deallocuvm.part.0> } memset(mem, 0, PGSIZE); if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ cprintf("allocuvm out of memory (2)\n"); deallocuvm(pgdir, newsz, oldsz); kfree(mem); 80106be2: 83 ec 0c sub $0xc,%esp 80106be5: 56 push %esi 80106be6: e8 f5 b6 ff ff call 801022e0 <kfree> return 0; 80106beb: 83 c4 10 add $0x10,%esp } } return newsz; } 80106bee: 8d 65 f4 lea -0xc(%ebp),%esp memset(mem, 0, PGSIZE); if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ cprintf("allocuvm out of memory (2)\n"); deallocuvm(pgdir, newsz, oldsz); kfree(mem); return 0; 80106bf1: 31 c0 xor %eax,%eax } } return newsz; } 80106bf3: 5b pop %ebx 80106bf4: 5e pop %esi 80106bf5: 5f pop %edi 80106bf6: 5d pop %ebp 80106bf7: c3 ret 80106bf8: 90 nop 80106bf9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106c00: 8d 65 f4 lea -0xc(%ebp),%esp return 0; if(newsz < oldsz) return oldsz; a = PGROUNDUP(oldsz); for(; a < newsz; a += PGSIZE){ 80106c03: 89 f8 mov %edi,%eax kfree(mem); return 0; } } return newsz; } 80106c05: 5b pop %ebx 80106c06: 5e pop %esi 80106c07: 5f pop %edi 80106c08: 5d pop %ebp 80106c09: c3 ret 80106c0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106c10 <deallocuvm>: // 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) { 80106c10: 55 push %ebp 80106c11: 89 e5 mov %esp,%ebp 80106c13: 8b 55 0c mov 0xc(%ebp),%edx 80106c16: 8b 4d 10 mov 0x10(%ebp),%ecx 80106c19: 8b 45 08 mov 0x8(%ebp),%eax pte_t *pte; uint a, pa; if(newsz >= oldsz) 80106c1c: 39 d1 cmp %edx,%ecx 80106c1e: 73 10 jae 80106c30 <deallocuvm+0x20> kfree(v); *pte = 0; } } return newsz; } 80106c20: 5d pop %ebp 80106c21: e9 da fa ff ff jmp 80106700 <deallocuvm.part.0> 80106c26: 8d 76 00 lea 0x0(%esi),%esi 80106c29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106c30: 89 d0 mov %edx,%eax 80106c32: 5d pop %ebp 80106c33: c3 ret 80106c34: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106c3a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106c40 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80106c40: 55 push %ebp 80106c41: 89 e5 mov %esp,%ebp 80106c43: 57 push %edi 80106c44: 56 push %esi 80106c45: 53 push %ebx 80106c46: 83 ec 0c sub $0xc,%esp 80106c49: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 80106c4c: 85 f6 test %esi,%esi 80106c4e: 74 59 je 80106ca9 <freevm+0x69> 80106c50: 31 c9 xor %ecx,%ecx 80106c52: ba 00 00 00 80 mov $0x80000000,%edx 80106c57: 89 f0 mov %esi,%eax 80106c59: e8 a2 fa ff ff call 80106700 <deallocuvm.part.0> 80106c5e: 89 f3 mov %esi,%ebx 80106c60: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80106c66: eb 0f jmp 80106c77 <freevm+0x37> 80106c68: 90 nop 80106c69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106c70: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 80106c73: 39 fb cmp %edi,%ebx 80106c75: 74 23 je 80106c9a <freevm+0x5a> if(pgdir[i] & PTE_P){ 80106c77: 8b 03 mov (%ebx),%eax 80106c79: a8 01 test $0x1,%al 80106c7b: 74 f3 je 80106c70 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); kfree(v); 80106c7d: 25 00 f0 ff ff and $0xfffff000,%eax 80106c82: 83 ec 0c sub $0xc,%esp 80106c85: 83 c3 04 add $0x4,%ebx 80106c88: 05 00 00 00 80 add $0x80000000,%eax 80106c8d: 50 push %eax 80106c8e: e8 4d b6 ff ff call 801022e0 <kfree> 80106c93: 83 c4 10 add $0x10,%esp uint i; if(pgdir == 0) panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 80106c96: 39 fb cmp %edi,%ebx 80106c98: 75 dd jne 80106c77 <freevm+0x37> if(pgdir[i] & PTE_P){ char * v = P2V(PTE_ADDR(pgdir[i])); kfree(v); } } kfree((char*)pgdir); 80106c9a: 89 75 08 mov %esi,0x8(%ebp) } 80106c9d: 8d 65 f4 lea -0xc(%ebp),%esp 80106ca0: 5b pop %ebx 80106ca1: 5e pop %esi 80106ca2: 5f pop %edi 80106ca3: 5d pop %ebp if(pgdir[i] & PTE_P){ char * v = P2V(PTE_ADDR(pgdir[i])); kfree(v); } } kfree((char*)pgdir); 80106ca4: e9 37 b6 ff ff jmp 801022e0 <kfree> freevm(pde_t *pgdir) { uint i; if(pgdir == 0) panic("freevm: no pgdir"); 80106ca9: 83 ec 0c sub $0xc,%esp 80106cac: 68 1d 79 10 80 push $0x8010791d 80106cb1: e8 ba 96 ff ff call 80100370 <panic> 80106cb6: 8d 76 00 lea 0x0(%esi),%esi 80106cb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106cc0 <setupkvm>: }; // Set up kernel part of a page table. pde_t* setupkvm(void) { 80106cc0: 55 push %ebp 80106cc1: 89 e5 mov %esp,%ebp 80106cc3: 56 push %esi 80106cc4: 53 push %ebx pde_t *pgdir; struct kmap *k; if((pgdir = (pde_t*)kalloc()) == 0) 80106cc5: e8 c6 b7 ff ff call 80102490 <kalloc> 80106cca: 85 c0 test %eax,%eax 80106ccc: 74 6a je 80106d38 <setupkvm+0x78> return 0; memset(pgdir, 0, PGSIZE); 80106cce: 83 ec 04 sub $0x4,%esp 80106cd1: 89 c6 mov %eax,%esi if (P2V(PHYSTOP) > (void*)DEVSPACE) panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106cd3: bb 20 a4 10 80 mov $0x8010a420,%ebx pde_t *pgdir; struct kmap *k; if((pgdir = (pde_t*)kalloc()) == 0) return 0; memset(pgdir, 0, PGSIZE); 80106cd8: 68 00 10 00 00 push $0x1000 80106cdd: 6a 00 push $0x0 80106cdf: 50 push %eax 80106ce0: e8 cb d7 ff ff call 801044b0 <memset> 80106ce5: 83 c4 10 add $0x10,%esp if (P2V(PHYSTOP) > (void*)DEVSPACE) panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80106ce8: 8b 43 04 mov 0x4(%ebx),%eax 80106ceb: 8b 4b 08 mov 0x8(%ebx),%ecx 80106cee: 83 ec 08 sub $0x8,%esp 80106cf1: 8b 13 mov (%ebx),%edx 80106cf3: ff 73 0c pushl 0xc(%ebx) 80106cf6: 50 push %eax 80106cf7: 29 c1 sub %eax,%ecx 80106cf9: 89 f0 mov %esi,%eax 80106cfb: e8 70 f9 ff ff call 80106670 <mappages> 80106d00: 83 c4 10 add $0x10,%esp 80106d03: 85 c0 test %eax,%eax 80106d05: 78 19 js 80106d20 <setupkvm+0x60> if((pgdir = (pde_t*)kalloc()) == 0) return 0; memset(pgdir, 0, PGSIZE); if (P2V(PHYSTOP) > (void*)DEVSPACE) panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106d07: 83 c3 10 add $0x10,%ebx 80106d0a: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx 80106d10: 75 d6 jne 80106ce8 <setupkvm+0x28> 80106d12: 89 f0 mov %esi,%eax (uint)k->phys_start, k->perm) < 0) { freevm(pgdir); return 0; } return pgdir; } 80106d14: 8d 65 f8 lea -0x8(%ebp),%esp 80106d17: 5b pop %ebx 80106d18: 5e pop %esi 80106d19: 5d pop %ebp 80106d1a: c3 ret 80106d1b: 90 nop 80106d1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (P2V(PHYSTOP) > (void*)DEVSPACE) panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, (uint)k->phys_start, k->perm) < 0) { freevm(pgdir); 80106d20: 83 ec 0c sub $0xc,%esp 80106d23: 56 push %esi 80106d24: e8 17 ff ff ff call 80106c40 <freevm> return 0; 80106d29: 83 c4 10 add $0x10,%esp } return pgdir; } 80106d2c: 8d 65 f8 lea -0x8(%ebp),%esp panic("PHYSTOP too high"); for(k = kmap; k < &kmap[NELEM(kmap)]; k++) if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, (uint)k->phys_start, k->perm) < 0) { freevm(pgdir); return 0; 80106d2f: 31 c0 xor %eax,%eax } return pgdir; } 80106d31: 5b pop %ebx 80106d32: 5e pop %esi 80106d33: 5d pop %ebp 80106d34: c3 ret 80106d35: 8d 76 00 lea 0x0(%esi),%esi { pde_t *pgdir; struct kmap *k; if((pgdir = (pde_t*)kalloc()) == 0) return 0; 80106d38: 31 c0 xor %eax,%eax 80106d3a: eb d8 jmp 80106d14 <setupkvm+0x54> 80106d3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106d40 <kvmalloc>: // Allocate one page table for the machine for the kernel address // space for scheduler processes. void kvmalloc(void) { 80106d40: 55 push %ebp 80106d41: 89 e5 mov %esp,%ebp 80106d43: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80106d46: e8 75 ff ff ff call 80106cc0 <setupkvm> 80106d4b: a3 a4 54 11 80 mov %eax,0x801154a4 80106d50: 05 00 00 00 80 add $0x80000000,%eax 80106d55: 0f 22 d8 mov %eax,%cr3 switchkvm(); } 80106d58: c9 leave 80106d59: c3 ret 80106d5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106d60 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80106d60: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106d61: 31 c9 xor %ecx,%ecx // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80106d63: 89 e5 mov %esp,%ebp 80106d65: 83 ec 08 sub $0x8,%esp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106d68: 8b 55 0c mov 0xc(%ebp),%edx 80106d6b: 8b 45 08 mov 0x8(%ebp),%eax 80106d6e: e8 7d f8 ff ff call 801065f0 <walkpgdir> if(pte == 0) 80106d73: 85 c0 test %eax,%eax 80106d75: 74 05 je 80106d7c <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 80106d77: 83 20 fb andl $0xfffffffb,(%eax) } 80106d7a: c9 leave 80106d7b: c3 ret { pte_t *pte; pte = walkpgdir(pgdir, uva, 0); if(pte == 0) panic("clearpteu"); 80106d7c: 83 ec 0c sub $0xc,%esp 80106d7f: 68 2e 79 10 80 push $0x8010792e 80106d84: e8 e7 95 ff ff call 80100370 <panic> 80106d89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106d90 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 80106d90: 55 push %ebp 80106d91: 89 e5 mov %esp,%ebp 80106d93: 57 push %edi 80106d94: 56 push %esi 80106d95: 53 push %ebx 80106d96: 83 ec 1c sub $0x1c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 80106d99: e8 22 ff ff ff call 80106cc0 <setupkvm> 80106d9e: 85 c0 test %eax,%eax 80106da0: 89 45 e0 mov %eax,-0x20(%ebp) 80106da3: 0f 84 b2 00 00 00 je 80106e5b <copyuvm+0xcb> return 0; for(i = 0; i < sz; i += PGSIZE){ 80106da9: 8b 4d 0c mov 0xc(%ebp),%ecx 80106dac: 85 c9 test %ecx,%ecx 80106dae: 0f 84 9c 00 00 00 je 80106e50 <copyuvm+0xc0> 80106db4: 31 f6 xor %esi,%esi 80106db6: eb 4a jmp 80106e02 <copyuvm+0x72> 80106db8: 90 nop 80106db9: 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); 80106dc0: 83 ec 04 sub $0x4,%esp 80106dc3: 81 c7 00 00 00 80 add $0x80000000,%edi 80106dc9: 68 00 10 00 00 push $0x1000 80106dce: 57 push %edi 80106dcf: 50 push %eax 80106dd0: e8 8b d7 ff ff call 80104560 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) 80106dd5: 58 pop %eax 80106dd6: 5a pop %edx 80106dd7: 8d 93 00 00 00 80 lea -0x80000000(%ebx),%edx 80106ddd: 8b 45 e0 mov -0x20(%ebp),%eax 80106de0: ff 75 e4 pushl -0x1c(%ebp) 80106de3: b9 00 10 00 00 mov $0x1000,%ecx 80106de8: 52 push %edx 80106de9: 89 f2 mov %esi,%edx 80106deb: e8 80 f8 ff ff call 80106670 <mappages> 80106df0: 83 c4 10 add $0x10,%esp 80106df3: 85 c0 test %eax,%eax 80106df5: 78 3e js 80106e35 <copyuvm+0xa5> uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) return 0; for(i = 0; i < sz; i += PGSIZE){ 80106df7: 81 c6 00 10 00 00 add $0x1000,%esi 80106dfd: 39 75 0c cmp %esi,0xc(%ebp) 80106e00: 76 4e jbe 80106e50 <copyuvm+0xc0> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 80106e02: 8b 45 08 mov 0x8(%ebp),%eax 80106e05: 31 c9 xor %ecx,%ecx 80106e07: 89 f2 mov %esi,%edx 80106e09: e8 e2 f7 ff ff call 801065f0 <walkpgdir> 80106e0e: 85 c0 test %eax,%eax 80106e10: 74 5a je 80106e6c <copyuvm+0xdc> panic("copyuvm: pte should exist"); if(!(*pte & PTE_P)) 80106e12: 8b 18 mov (%eax),%ebx 80106e14: f6 c3 01 test $0x1,%bl 80106e17: 74 46 je 80106e5f <copyuvm+0xcf> panic("copyuvm: page not present"); pa = PTE_ADDR(*pte); 80106e19: 89 df mov %ebx,%edi flags = PTE_FLAGS(*pte); 80106e1b: 81 e3 ff 0f 00 00 and $0xfff,%ebx 80106e21: 89 5d e4 mov %ebx,-0x1c(%ebp) for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) panic("copyuvm: pte should exist"); if(!(*pte & PTE_P)) panic("copyuvm: page not present"); pa = PTE_ADDR(*pte); 80106e24: 81 e7 00 f0 ff ff and $0xfffff000,%edi flags = PTE_FLAGS(*pte); if((mem = kalloc()) == 0) 80106e2a: e8 61 b6 ff ff call 80102490 <kalloc> 80106e2f: 85 c0 test %eax,%eax 80106e31: 89 c3 mov %eax,%ebx 80106e33: 75 8b jne 80106dc0 <copyuvm+0x30> goto bad; } return d; bad: freevm(d); 80106e35: 83 ec 0c sub $0xc,%esp 80106e38: ff 75 e0 pushl -0x20(%ebp) 80106e3b: e8 00 fe ff ff call 80106c40 <freevm> return 0; 80106e40: 83 c4 10 add $0x10,%esp 80106e43: 31 c0 xor %eax,%eax } 80106e45: 8d 65 f4 lea -0xc(%ebp),%esp 80106e48: 5b pop %ebx 80106e49: 5e pop %esi 80106e4a: 5f pop %edi 80106e4b: 5d pop %ebp 80106e4c: c3 ret 80106e4d: 8d 76 00 lea 0x0(%esi),%esi uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) return 0; for(i = 0; i < sz; i += PGSIZE){ 80106e50: 8b 45 e0 mov -0x20(%ebp),%eax return d; bad: freevm(d); return 0; } 80106e53: 8d 65 f4 lea -0xc(%ebp),%esp 80106e56: 5b pop %ebx 80106e57: 5e pop %esi 80106e58: 5f pop %edi 80106e59: 5d pop %ebp 80106e5a: c3 ret pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) return 0; 80106e5b: 31 c0 xor %eax,%eax 80106e5d: eb e6 jmp 80106e45 <copyuvm+0xb5> for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) panic("copyuvm: pte should exist"); if(!(*pte & PTE_P)) panic("copyuvm: page not present"); 80106e5f: 83 ec 0c sub $0xc,%esp 80106e62: 68 52 79 10 80 push $0x80107952 80106e67: e8 04 95 ff ff call 80100370 <panic> if((d = setupkvm()) == 0) return 0; for(i = 0; i < sz; i += PGSIZE){ if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) panic("copyuvm: pte should exist"); 80106e6c: 83 ec 0c sub $0xc,%esp 80106e6f: 68 38 79 10 80 push $0x80107938 80106e74: e8 f7 94 ff ff call 80100370 <panic> 80106e79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106e80 <uva2ka>: } // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 80106e80: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106e81: 31 c9 xor %ecx,%ecx } // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 80106e83: 89 e5 mov %esp,%ebp 80106e85: 83 ec 08 sub $0x8,%esp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106e88: 8b 55 0c mov 0xc(%ebp),%edx 80106e8b: 8b 45 08 mov 0x8(%ebp),%eax 80106e8e: e8 5d f7 ff ff call 801065f0 <walkpgdir> if((*pte & PTE_P) == 0) 80106e93: 8b 00 mov (%eax),%eax return 0; if((*pte & PTE_U) == 0) 80106e95: 89 c2 mov %eax,%edx 80106e97: 83 e2 05 and $0x5,%edx 80106e9a: 83 fa 05 cmp $0x5,%edx 80106e9d: 75 11 jne 80106eb0 <uva2ka+0x30> return 0; return (char*)P2V(PTE_ADDR(*pte)); 80106e9f: 25 00 f0 ff ff and $0xfffff000,%eax } 80106ea4: c9 leave pte = walkpgdir(pgdir, uva, 0); if((*pte & PTE_P) == 0) return 0; if((*pte & PTE_U) == 0) return 0; return (char*)P2V(PTE_ADDR(*pte)); 80106ea5: 05 00 00 00 80 add $0x80000000,%eax } 80106eaa: c3 ret 80106eab: 90 nop 80106eac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi pte = walkpgdir(pgdir, uva, 0); if((*pte & PTE_P) == 0) return 0; if((*pte & PTE_U) == 0) return 0; 80106eb0: 31 c0 xor %eax,%eax return (char*)P2V(PTE_ADDR(*pte)); } 80106eb2: c9 leave 80106eb3: c3 ret 80106eb4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106eba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106ec0 <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) { 80106ec0: 55 push %ebp 80106ec1: 89 e5 mov %esp,%ebp 80106ec3: 57 push %edi 80106ec4: 56 push %esi 80106ec5: 53 push %ebx 80106ec6: 83 ec 1c sub $0x1c,%esp 80106ec9: 8b 5d 14 mov 0x14(%ebp),%ebx 80106ecc: 8b 55 0c mov 0xc(%ebp),%edx 80106ecf: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80106ed2: 85 db test %ebx,%ebx 80106ed4: 75 40 jne 80106f16 <copyout+0x56> 80106ed6: eb 70 jmp 80106f48 <copyout+0x88> 80106ed8: 90 nop 80106ed9: 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); 80106ee0: 8b 55 e4 mov -0x1c(%ebp),%edx 80106ee3: 89 f1 mov %esi,%ecx 80106ee5: 29 d1 sub %edx,%ecx 80106ee7: 81 c1 00 10 00 00 add $0x1000,%ecx 80106eed: 39 d9 cmp %ebx,%ecx 80106eef: 0f 47 cb cmova %ebx,%ecx if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 80106ef2: 29 f2 sub %esi,%edx 80106ef4: 83 ec 04 sub $0x4,%esp 80106ef7: 01 d0 add %edx,%eax 80106ef9: 51 push %ecx 80106efa: 57 push %edi 80106efb: 50 push %eax 80106efc: 89 4d e4 mov %ecx,-0x1c(%ebp) 80106eff: e8 5c d6 ff ff call 80104560 <memmove> len -= n; buf += n; 80106f04: 8b 4d e4 mov -0x1c(%ebp),%ecx { char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80106f07: 83 c4 10 add $0x10,%esp if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); len -= n; buf += n; va = va0 + PGSIZE; 80106f0a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx n = PGSIZE - (va - va0); if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); len -= n; buf += n; 80106f10: 01 cf add %ecx,%edi { char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80106f12: 29 cb sub %ecx,%ebx 80106f14: 74 32 je 80106f48 <copyout+0x88> va0 = (uint)PGROUNDDOWN(va); 80106f16: 89 d6 mov %edx,%esi pa0 = uva2ka(pgdir, (char*)va0); 80106f18: 83 ec 08 sub $0x8,%esp char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ va0 = (uint)PGROUNDDOWN(va); 80106f1b: 89 55 e4 mov %edx,-0x1c(%ebp) 80106f1e: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80106f24: 56 push %esi 80106f25: ff 75 08 pushl 0x8(%ebp) 80106f28: e8 53 ff ff ff call 80106e80 <uva2ka> if(pa0 == 0) 80106f2d: 83 c4 10 add $0x10,%esp 80106f30: 85 c0 test %eax,%eax 80106f32: 75 ac jne 80106ee0 <copyout+0x20> len -= n; buf += n; va = va0 + PGSIZE; } return 0; } 80106f34: 8d 65 f4 lea -0xc(%ebp),%esp buf = (char*)p; while(len > 0){ va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if(pa0 == 0) return -1; 80106f37: b8 ff ff ff ff mov $0xffffffff,%eax len -= n; buf += n; va = va0 + PGSIZE; } return 0; } 80106f3c: 5b pop %ebx 80106f3d: 5e pop %esi 80106f3e: 5f pop %edi 80106f3f: 5d pop %ebp 80106f40: c3 ret 80106f41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106f48: 8d 65 f4 lea -0xc(%ebp),%esp memmove(pa0 + (va - va0), buf, n); len -= n; buf += n; va = va0 + PGSIZE; } return 0; 80106f4b: 31 c0 xor %eax,%eax } 80106f4d: 5b pop %ebx 80106f4e: 5e pop %esi 80106f4f: 5f pop %edi 80106f50: 5d pop %ebp 80106f51: c3 ret
33.230896
74
0.532062
b8d282b541aed1887866563c16c50284a189bd9c
107
asm
Assembly
tests/misc/sjasm_cpp/sjasm_coverage.asm
fengjixuchui/sjasmplus
df0fabd2411bf89e23637fce46d273f52dafbe16
[ "BSD-3-Clause" ]
220
2016-10-22T19:44:39.000Z
2022-03-29T20:57:04.000Z
tests/misc/sjasm_cpp/sjasm_coverage.asm
ped7g/sjasmplus
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
[ "BSD-3-Clause" ]
153
2018-05-07T10:31:23.000Z
2022-03-30T04:35:59.000Z
tests/misc/sjasm_cpp/sjasm_coverage.asm
ped7g/sjasmplus
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
[ "BSD-3-Clause" ]
51
2016-05-12T21:27:36.000Z
2022-03-27T15:16:16.000Z
MODULE TestModule x: nop ; do not ENDMODULE here (to verify InitPass handles this situation)
26.75
71
0.691589
ea912ce4a4eb7ab333927efe6ea65a5a5be8b717
736
asm
Assembly
oeis/198/A198900.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/198/A198900.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/198/A198900.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A198900: Number of n X 2 0..4 arrays with values 0..4 introduced in row major order and no element equal to any horizontal or vertical neighbor. ; Submitted by Jon Maiga ; 1,4,33,380,4801,62004,804833,10459180,135958401,1767426404,22976444833,298693487580,3883014452801,50479185229204,656229400008033,8530982176189580,110902768218720001,1441735986628126404,18742567825519942433,243653381729822149180,3167493962481876632001,41177421512246962294004,535306479659158208056033,6958984235568899799430380,90466795062395226676700801,1176068335811136534649428004,15288888365544770713999516833,198755548752082006572664577180,2583822133777066047316652078401 mov $1,13 pow $1,$0 add $0,1 add $1,4 mov $2,3 pow $2,$0 add $1,$2 mov $0,$1 div $0,6
52.571429
476
0.847826
c88b1993f268e7286733ff0afc62d6eaaea5c0ab
13,130
asm
Assembly
MasmEd/Addins/Project/NewTemplate.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
11
2016-12-03T16:35:42.000Z
2022-03-26T06:02:53.000Z
MasmEd/Addins/Project/NewTemplate.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
1
2018-02-24T20:17:46.000Z
2018-03-02T08:57:40.000Z
MasmEd/Addins/Project/NewTemplate.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
4
2018-10-19T01:14:55.000Z
2021-09-11T18:51:48.000Z
;NewTemplate.dlg IDD_DLGNEWTEMPLATE equ 2000 IDC_EDTDESCRIPTION equ 1001 IDC_LSTFILES equ 1002 IDC_BTNADD equ 1003 IDC_BTNDEL equ 1004 IDC_EDTFILENAME equ 1005 IDC_BTNFILENAME equ 1006 IDC_CBOTBLBUILD equ 1008 .const TPLFilterString db 'Template (*.tpl)',0,'*.tpl',0,0 szTplFile db 'tpl',0 ALLFilterString db 'All files (*.*)',0,'*.*',0,0 szDefTxt db '.asm.inc.rc.def.txt.xml.',0 szDefBin db '.tbr.obj.lib.res.bmp.ico.cur.',0 szErrNoMain db 'No main file is selected or the selected file is not a .asm file.',0 szErrNotInPath db 'The file is not in the path of the main file.',0Dh,0Ah,0 szErrUnknownType db 'The file type is unknown.',0Dh,0Ah,0 szInclude db 'include',0 szLibrary db 'library',0 .data? szTxt db 256 dup(?) szBin db 256 dup(?) .code IsFileType proc uses ebx esi edi,lpFileName:DWORD,lpFileTypes:DWORD LOCAL filetype[MAX_PATH]:BYTE mov filetype,0 mov esi,lpFileName invoke lstrlen,esi .while eax .if byte ptr [esi+eax]=='.' invoke lstrcpy,addr filetype,addr [esi+eax] invoke lstrcat,addr filetype,offset szDot .break .endif dec eax .endw .if filetype mov esi,lpFileTypes lea edi,filetype .while TRUE xor ecx,ecx .while byte ptr [edi+ecx] mov al,[edi+ecx] mov ah,[esi+ecx] .if al>='a' && al<='z' and al,5Fh .endif .if ah>='a' && ah<='z' and ah,5Fh .endif .break .if al!=ah inc ecx .endw .if !byte ptr [edi+ecx] mov eax,TRUE jmp Ex .endif inc esi .while byte ptr [esi]!='.' inc esi .endw .break .if !byte ptr [esi+1] .endw .endif xor eax,eax Ex: ret IsFileType endp CreateTemplate proc uses ebx esi edi,hWin:HWND LOCAL buffer[MAX_PATH]:BYTE LOCAL buffer1[MAX_PATH]:BYTE LOCAL path[MAX_PATH]:BYTE LOCAL main[MAX_PATH]:BYTE LOCAL hTplMem:HGLOBAL LOCAL hFile:HANDLE LOCAL bytes:DWORD invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETCURSEL,0,0 .if eax!=LB_ERR mov edx,eax invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETTEXT,edx,addr path invoke lstrlen,addr path lea ebx,path[eax-3] invoke lstrcmpi,ebx,offset szAsmFile .if !eax && byte ptr [ebx-1]=='.' ;Get path and filename from main file invoke lstrlen,addr path .while eax .if byte ptr path[eax]=='\' push eax invoke lstrcpy,addr main,addr path[eax+1] pop eax mov path[eax+1],0 .break .endif dec eax .endw invoke lstrlen,addr main .while eax .if byte ptr main[eax]=='.' mov main[eax],0 .break .endif dec eax .endw ;Check if all files is in the path of the main file xor ebx,ebx .while TRUE invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETTEXT,ebx,addr buffer .if eax!=LB_ERR invoke IsLine,addr buffer,addr path,TRUE .if !eax invoke lstrcpy,offset tempbuff,offset szErrNotInPath invoke lstrcat,offset tempbuff,addr buffer invoke MessageBox,hWin,offset tempbuff,offset szMenuItem,MB_OK or MB_ICONERROR xor eax,eax jmp Ex .endif .else .break .endif inc ebx .endw ;Check if all files is of a known file type xor ebx,ebx .while TRUE invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETTEXT,ebx,addr buffer .if eax!=LB_ERR invoke IsFileType,addr buffer,offset szTxt .if !eax invoke IsFileType,addr buffer,offset szBin .endif .if !eax invoke lstrcpy,offset tempbuff,offset szErrUnknownType invoke lstrcat,offset tempbuff,addr buffer invoke MessageBox,hWin,offset tempbuff,offset szMenuItem,MB_OK or MB_ICONERROR xor eax,eax jmp Ex .endif .else .break .endif inc ebx .endw invoke GlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,1024*1024 mov hTplMem,eax ; Add description mov edi,hTplMem invoke GetDlgItemText,hWin,IDC_EDTDESCRIPTION,edi,1024 lea edi,[edi+eax] mov word ptr [edi],0A0Dh lea edi,[edi+2] ; Add make option invoke lstrcpy,edi,offset szMAKE lea edi,[edi+9] invoke SendDlgItemMessage,hWin,IDC_CBOTBLBUILD,CB_GETCURSEL,0,0 or eax,30h mov [edi],al lea edi,[edi+1] mov word ptr [edi],0A0Dh lea edi,[edi+2] ; Add main file invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETCURSEL,0,0 mov ebx,eax invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETTEXT,ebx,addr buffer invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_DELETESTRING,ebx,0 call AddTxtFile ; Add the rest of the files xor ebx,ebx .while TRUE invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETTEXT,ebx,addr buffer .break .if eax==LB_ERR invoke IsFileType,addr buffer,offset szTxt .if eax call AddTxtFile .else call AddBinFile .endif inc ebx .endw invoke GetDlgItemText,hWin,IDC_EDTFILENAME,addr buffer,sizeof buffer invoke CreateFile,addr buffer,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL .if eax!=INVALID_HANDLE_VALUE mov hFile,eax sub edi,hTplMem invoke WriteFile,hFile,hTplMem,edi,addr bytes,NULL invoke CloseHandle,hFile .endif invoke GlobalFree,hTplMem mov eax,TRUE .else call ErrNoMain xor eax,eax jmp Ex .endif .else call ErrNoMain xor eax,eax jmp Ex .endif Ex: ret ErrNoMain: invoke MessageBox,hWin,offset szErrNoMain,offset szMenuItem,MB_OK or MB_ICONERROR retn AddFileName: push esi invoke lstrlen,addr path lea esi,buffer[eax] invoke IsLine,esi,addr main,TRUE .if eax invoke lstrcpy,edi,offset szPROJECTNAME invoke lstrlen,addr main lea esi,[esi+eax] invoke lstrcat,edi,esi .else invoke lstrcpy,edi,esi .endif invoke lstrlen,edi lea edi,[edi+eax] mov word ptr [edi],0A0Dh lea edi,[edi+2] pop esi retn AddWhiteSpace: .while byte ptr [esi]==VK_TAB || byte ptr [esi]==VK_SPACE mov al,[esi] mov [edi],al inc esi inc edi .endw retn AddWord: .while byte ptr [esi]!=VK_TAB && byte ptr [esi]!=VK_SPACE mov al,[esi] mov [edi],al inc esi inc edi .endw retn AddLine: .while byte ptr [esi]!=VK_RETURN && byte ptr [esi] mov al,[esi] mov [edi],al inc esi inc edi .endw .if byte ptr [esi]==VK_RETURN mov al,[esi] mov [edi],al inc esi inc edi .endif .if byte ptr [esi]==0Ah mov al,[esi] mov [edi],al inc esi inc edi .endif retn AddTxtLine: call AddWhiteSpace invoke IsLine,esi,offset szInclude,TRUE .if eax @@: call AddWord call AddWhiteSpace invoke IsLine,esi,addr main,TRUE .if eax invoke lstrcpy,edi,offset szPROJECTNAME lea edi,[edi+15] invoke lstrlen,addr main lea esi,[esi+eax] .endif .else invoke IsLine,esi,offset szLibrary,TRUE or eax,eax jne @b .endif call AddLine retn AddTxtFile: invoke lstrcpy,edi,offset szBEGINTXT lea edi,[edi+12] mov word ptr [edi],0A0Dh lea edi,[edi+2] call AddFileName invoke GlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,1024*1024 mov esi,eax push eax invoke CreateFile,addr buffer,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL .if eax!=INVALID_HANDLE_VALUE mov hFile,eax invoke GetFileSize,hFile,NULL mov edx,eax invoke ReadFile,hFile,esi,edx,addr bytes,NULL invoke CloseHandle,hFile .while byte ptr [esi] call AddTxtLine .endw .if byte ptr [edi-1]!=0Ah mov word ptr [edi],0A0Dh lea edi,[edi+2] .endif .endif pop eax invoke GlobalFree,eax invoke lstrcpy,edi,offset szENDTXT lea edi,[edi+10] mov word ptr [edi],0A0Dh lea edi,[edi+2] retn AddBinFile: invoke lstrcpy,edi,offset szBEGINBIN lea edi,[edi+12] mov word ptr [edi],0A0Dh lea edi,[edi+2] call AddFileName invoke GlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,1024*1024 mov esi,eax push eax invoke CreateFile,addr buffer,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL .if eax!=INVALID_HANDLE_VALUE mov hFile,eax invoke GetFileSize,hFile,NULL mov edx,eax invoke ReadFile,hFile,esi,edx,addr bytes,NULL invoke CloseHandle,hFile xor ecx,ecx .while ecx<bytes .if ecx test ecx,0Fh .if ZERO? mov word ptr [edi],0A0Dh lea edi,[edi+2] .endif .endif mov al,[esi+ecx] mov ah,al shr al,4 and ah,0Fh .if al<=9 or al,30h .else add al,'A'-10 .endif .if ah<=9 or ah,30h .else add ah,'A'-10 .endif mov [edi],ax lea edi,[edi+2] inc ecx .endw mov word ptr [edi],0A0Dh lea edi,[edi+2] .endif pop eax invoke GlobalFree,eax invoke lstrcpy,edi,offset szENDBIN lea edi,[edi+10] mov word ptr [edi],0A0Dh lea edi,[edi+2] retn CreateTemplate endp NewTemplateDialogProc proc uses ebx esi edi,hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM LOCAL ofn:OPENFILENAME LOCAL buffer[MAX_PATH]:BYTE LOCAL buffer1[MAX_PATH]:BYTE LOCAL path[MAX_PATH]:BYTE mov eax,uMsg .if eax==WM_INITDIALOG mov ebx,lpHandles mov ebx,[ebx].ADDINHANDLES.hCbo xor esi,esi .while TRUE invoke SendMessage,ebx,CB_GETLBTEXT,esi,addr buffer .break .if eax==LB_ERR invoke SendDlgItemMessage,hWin,IDC_CBOTBLBUILD,CB_ADDSTRING,0,addr buffer inc esi .endw invoke SendDlgItemMessage,hWin,IDC_CBOTBLBUILD,CB_SETCURSEL,0,0 .elseif eax==WM_COMMAND mov edx,wParam movzx eax,dx shr edx,16 .if edx==BN_CLICKED .if eax==IDOK invoke CreateTemplate,hWin .if eax invoke SendMessage,hWin,WM_CLOSE,NULL,NULL .endif .elseif eax==IDCANCEL invoke SendMessage,hWin,WM_CLOSE,NULL,NULL .elseif eax==IDC_BTNFILENAME invoke RtlZeroMemory,addr ofn,SizeOf OPENFILENAME mov ofn.lStructSize,SizeOf OPENFILENAME mov eax,hWin mov ofn.hwndOwner,eax mov eax,hInstance mov ofn.hInstance,eax mov eax,lpData invoke lstrcpy,offset tempbuff,addr [eax].ADDINDATA.AppPath invoke lstrcat,offset tempbuff,offset szTemplatesPath mov ofn.lpstrInitialDir,offset tempbuff mov ofn.lpstrFilter,offset TPLFilterString mov ofn.lpstrDefExt,offset szTplFile mov buffer,0 lea eax,buffer mov ofn.lpstrFile,eax mov ofn.nMaxFile,sizeof buffer mov ofn.Flags,OFN_EXPLORER or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST or OFN_OVERWRITEPROMPT invoke GetSaveFileName,addr ofn .if eax invoke SetDlgItemText,hWin,IDC_EDTFILENAME,addr buffer .endif .elseif eax==IDC_BTNADD invoke RtlZeroMemory,addr ofn,SizeOf OPENFILENAME mov ofn.lStructSize,SizeOf OPENFILENAME mov eax,hWin mov ofn.hwndOwner,eax mov eax,hInstance mov ofn.hInstance,eax mov ofn.lpstrInitialDir,offset ProjectPath mov ofn.lpstrFilter,offset ALLFilterString mov tempbuff,0 mov ofn.lpstrFile,offset tempbuff mov ofn.nMaxFile,sizeof buffer mov ofn.Flags,OFN_EXPLORER or OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST or OFN_ALLOWMULTISELECT or OFN_EXPLORER invoke GetOpenFileName,addr ofn .if eax mov esi,offset tempbuff invoke lstrlen,esi lea eax,[esi+eax+1] .if byte ptr [eax] push eax invoke lstrcpy,addr path,esi pop esi .while byte ptr [esi] invoke lstrcpy,addr buffer,addr path invoke lstrcat,addr buffer,offset szBS invoke lstrcat,addr buffer,esi call IsFileAdded .if !eax invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_ADDSTRING,0,addr buffer .endif invoke lstrlen,esi lea esi,[esi+eax+1] .endw .else invoke lstrcpy,addr buffer,esi call IsFileAdded .if !eax invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_ADDSTRING,0,addr buffer .endif .endif .endif .elseif eax==IDC_BTNDEL invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETCURSEL,0,0 .if eax!=LB_ERR invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_DELETESTRING,eax,0 .endif .endif .elseif edx==EN_CHANGE .if eax==IDC_EDTFILENAME invoke GetDlgItem,hWin,IDOK push eax invoke GetDlgItemText,hWin,IDC_EDTFILENAME,addr buffer,sizeof buffer movzx eax,buffer pop edx invoke EnableWindow,edx,eax .endif .elseif edx==LBN_SELCHANGE .endif .elseif eax==WM_CLOSE invoke EndDialog,hWin,NULL .else mov eax,FALSE ret .endif mov eax,TRUE ret IsFileAdded: xor ebx,ebx .while TRUE invoke SendDlgItemMessage,hWin,IDC_LSTFILES,LB_GETTEXT,ebx,addr buffer1 .if eax!=LB_ERR invoke lstrcmp,addr buffer,addr buffer1 .if !eax mov eax,TRUE .break .endif .else xor eax,eax .break .endif inc ebx .endw retn NewTemplateDialogProc endp
24.867424
134
0.665804
7de266dd95a46bdb67123ea0738e9fb4164ac633
9,612
asm
Assembly
bench/ge_add.asm
dsprenkels/curve13318-ivybridge
fa9ffbf5a11eaa22910df9b5f77f95082af129c0
[ "CC0-1.0" ]
2
2019-10-12T17:52:36.000Z
2020-06-01T09:54:00.000Z
bench/ge_add.asm
dsprenkels/curve13318-ivybridge
fa9ffbf5a11eaa22910df9b5f77f95082af129c0
[ "CC0-1.0" ]
null
null
null
bench/ge_add.asm
dsprenkels/curve13318-ivybridge
fa9ffbf5a11eaa22910df9b5f77f95082af129c0
[ "CC0-1.0" ]
null
null
null
; Doubling of group elements ; ; Author: Daan Sprenkels <hello@dsprenkels.com> %include "bench.asm" %include "fe12_mul.mac" global crypto_scalarmult_curve13318_ref12_ge_double section .rodata _bench1_name: db `ge_add_asm\0` align 8, db 0 _bench_fns_arr: dq ge_add_asm _bench_names_arr: dq _bench1_name _bench_fns: dq _bench_fns_arr _bench_names: dq _bench_names_arr _bench_fns_n: dd 1 section .bss align 32 scratch_space: resb 1536 section .text ge_add_asm: ; The next chain of procedures is an adapted version of Algorithm 4 ; from the Renes-Costello-Batina addition laws. [Renes2016] ; fe12_squeeze guarantees that every processed double is always divisible ; by 2^k and bounded by 1.01 * 2^21 * 2^k, with k the limb's offset ; (0, 22, 43, etc.). This theorem (3.2) is proven in [Hash127] by Daniel ; Bernstein, although it needs to be adapted to this instance. ; Precondition of the theorem is that the input to fe12_squeeze is divisible ; by 2^k and bounded by 0.98 * 2^53 * 2^k. ; In other words: Any product limbs produced by fe12_mul (uncarried), must be ; bounded by ±0.98 * 2^53. In fe12_mul, the lowest limb is multiplied by the ; largest value, namely ±(11*19 + 1)*x*y = ±210*x*y for x the largest possible ; 22-bit limbs. This means that the summed limb bits of the 2 multiplied ; operands cannot exceed ±0.98 * 2^53 / 210. Rounded down this computes to ; ~±2^45.2 > ±1.1*2^45. So if we restrict ourselves to a multiplied upper bound ; of ±1.1*2^45, we should be all right. ; We would manage this by multiplying 2^21 values with 2^24 values ; (because 21 + 24 ≤ 45), but for example 2^23 * 2^23 is *forbidden* as it ; may overflow (23 + 23 > 45). ; ; TODO(dsprenkels) Check everywhere around fe12_mul whether its loads/stores ; are actually necessary. bench_prologue %push ge_add_ctx %xdefine x3 rel scratch_space %xdefine y3 rel scratch_space + 12*8 %xdefine z3 rel scratch_space + 24*8 %xdefine x1 rel scratch_space + 36*8 %xdefine y1 rel scratch_space + 36*8 + 12*8 %xdefine z1 rel scratch_space + 36*8 + 24*8 %xdefine x2 rel scratch_space + 72*8 %xdefine y2 rel scratch_space + 72*8 + 12*8 %xdefine z2 rel scratch_space + 72*8 + 24*8 %xdefine t0 rsp %xdefine t1 rsp + 1*384 %xdefine t2 rsp + 2*384 %xdefine t3 rsp + 3*384 %xdefine t4 rsp + 4*384 ; FIXME t5 is not used in this function %xdefine t5 rsp + 5*384 %xdefine scratch rsp + 6*384 %xdefine stack_size 6*384 + 768 ; build stack frame push rbp mov rbp, rsp and rsp, -32 sub rsp, stack_size ; assume forall v in {x, y, z} : |v| ≤ 1.01 * 2^22 %assign i 0 %rep 12 vbroadcastsd ymm0, qword [x1 + i*8] ; [x1, x1, x1, x1] vbroadcastsd ymm1, qword [y1 + i*8] ; [y1, y1, y1, y1] vbroadcastsd ymm2, qword [z1 + i*8] ; [z1, z1, z1, z1] vbroadcastsd ymm3, qword [x2 + i*8] ; [x2, x2, x2, x2] vbroadcastsd ymm4, qword [y2 + i*8] ; [y2, y2, y2, y2] vbroadcastsd ymm5, qword [z2 + i*8] ; [z2, z2, z2, z2] vblendpd ymm6, ymm0, ymm1, 0b1000 ; [x1, x1, x1, y1] vblendpd ymm7, ymm1, ymm2, 0b1001 ; [z1, y1, y1, z1] vaddpd ymm6, ymm6, ymm7 ; computing [v14, v4, v4, v9] ≤ 1.01 * 2^22 vmovapd yword [t3 + 32*i], ymm6 ; t3 = [??, ??, v4, v9] vblendpd ymm8, ymm3, ymm4, 0b1000 ; [x2, x2, x2, y2] vblendpd ymm9, ymm4, ymm5, 0b1001 ; [z2, y2, y2, z2] vaddpd ymm8, ymm8, ymm9 ; computing [v15, v5, v5, v10] ≤ 1.01 * 2^22 vmovapd yword [t4 + 32*i], ymm8 ; t4 = [??, ??, v5, v10] vblendpd ymm7, ymm7, ymm0, 0b0010 ; [z1, x1, y1, z1] vblendpd ymm7, ymm7, ymm6, 0b0001 ; [v14, x1, y1, z1] vmovapd yword [t0 + 32*i], ymm7 ; t0 = [v14, x1, y1, z1] vblendpd ymm9, ymm9, ymm3, 0b0010 ; [z2, x2, y2, z2] vblendpd ymm9, ymm9, ymm8, 0b0001 ; [v15, x2, y2, z2] vmovapd yword [t1 + 32*i], ymm9 ; t1 = [v15, x2, y2, z2] %assign i i+1 %endrep fe12x4_mul t2, t0, t1, scratch ; computing [v16, v1, v2, v3] ≤ 1.01 * 2^21 vmovsd xmm15, qword [rel .const_13318] ; [b] vmovapd ymm14, yword [rel .const_3_3_3_3] ; [3, 3, 3, 3] vxorpd ymm9, ymm9, ymm9 ; [0, 0, 0, 0] %assign i 0 %rep 12 ; We will need more registers here than we have available in ymm12-ymm15, ; so we will need to spill *some*, but not all, registers to the stack. %push ge_add_ctx_1 %if i >= 8 %xdefine v16v1v2v3 8 vmovapd ymm%[v16v1v2v3], yword [t2 + 32*i] ; [v16, v1, v2, v3] %else %xdefine v16v1v2v3 i %endif vextractf128 xmm13, ymm%[v16v1v2v3], 0b1 ; [v2, v3] vunpckhpd xmm12, xmm%[v16v1v2v3], xmm13 ; [v1, v3] vmovddup xmm13, xmm13 ; [v2, v2] vaddpd xmm13, xmm13, xmm12 ; computing [v7, v12] ≤ 1.01 * 2^22 vinsertf128 ymm10, ymm9, xmm13, 0b1 ; [0, 0, v7, v12] vmovapd yword [t1 + 32*i], ymm10 ; t1 = [0, 0, v7, v12] vpermilpd xmm11, xmm12, 0b01 ; [v3, v1] vaddsd xmm10, xmm12, xmm11 ; computing v17 ≤ 1.01 * 2^22 vsubsd xmm10, xmm%[v16v1v2v3], xmm10 ; computing v18 ≤ 1.52 * 2^22 vmulsd xmm8, xmm11, xmm15 ; computing v19 ≤ 1.65 * 2^34 vsubsd xmm8, xmm10, xmm8 ; computing v20 ≤ 1.66 * 2^34 vmulsd xmm10, xmm10, xmm15 ; computing v25 ≤ 1.24 * 2^36 vmulsd xmm13, xmm11, xmm14 ; computing v27 ≤ 1.52 * 2^22 vsubsd xmm10, xmm10, xmm13 ; computing v28 ≤ 1.25 * 2^36 vblendpd xmm11, xmm11, xmm10, 0b01 ; [v28, v1] vsubpd xmm12, xmm11, xmm12 ; computing [v29 ≤ 1.26 * 2^36, v34 ≤ 1.01 * 2^22] vinsertf128 ymm12, ymm8, xmm12, 0b1 ; [v20, ??, v29, v34] vmulpd ymm%[v16v1v2v3], ymm12, ymm14 ; computing [v22, ??, v31, v33] %if i >= 8 vmovapd yword [t5 + 32*i], ymm%[v16v1v2v3] %endif %pop ge_add_ctx_1 %assign i i+1 %endrep %assign i 8 %rep 4 vmovapd ymm%[i], yword [t5 + 32*i] ; reload {ymm8-ymm11} %assign i i+1 %endrep fe12x4_squeeze_body %assign i 0 %rep 12 vmovapd xmm13, oword [t2 + 32*i + 16] ; [v2, v3] vextractf128 xmm15, ymm%[i], 0b1 ; [v31, v33] vpermilpd xmm14, xmm15, 0b01 ; [v33, v31] vsubsd xmm12, xmm13, xmm%[i] ; computing v23 ≤ 1.01 * 2^22 vaddsd xmm13, xmm13, xmm%[i] ; computing v24 ≤ 1.01 * 2^22 vblendpd xmm12, xmm15, xmm12, 0b01 ; [v23, v33] vblendpd xmm13, xmm14, xmm13, 0b01 ; [v24, v31] vmovapd oword [t3 + 32*i], xmm12 ; t3 = [v23, v33, v4, v9] vmovapd oword [t4 + 32*i], xmm13 ; t4 = [v24, v31, v5, v10] vblendpd xmm14, xmm12, xmm13, 0b01 ; [v24, v33] vblendpd xmm15, xmm12, xmm13, 0b10 ; [v23, v31] vmovapd oword [t0 + 32*i + 0], xmm14 ; t0 = [v24, v33, ??, ??] vmovapd oword [t0 + 32*i + 16], xmm15 ; t0 = [v24, v33, v23, v31] %assign i i+1 %endrep fe12x4_mul t2, t3, t4, scratch ; computing [v37, v36, v6, v11] ≤ 1.01 * 2^21 %assign i 0 %rep 12 vsubpd ymm%[i], ymm%[i], yword [t1 + 32*i] ; computing [v37, v36, v8, v13] ≤ 1.01 * 2^22 vpermilpd xmm15, xmm%[i], 0b01 ; [v36, v37] vaddsd xmm15, xmm%[i], xmm15 ; computing v38 ≤ 1.01 * 2^22 vmovsd qword [y3 + i*8], xmm15 ; store y3 vperm2f128 ymm15, ymm%[i], ymm%[i], 0b00010001 ; [v8, v13, v8, v13] vpermilpd ymm15, ymm15, 0b1100 ; [v8, v8, v13, v13] vmovapd yword [t1 + 32*i], ymm15 ; t1 = [v8, v8, v13, v13] %assign i i+1 %endrep fe12x4_mul t2, t0, t1, scratch ; computing [v39, v42, v41, v35] ≤ 1.01 * 2^21 %assign i 0 %rep 12 vextractf128 xmm15, ymm%[i], 0b1 ; [v41, v35] vpermilpd xmm14, xmm%[i], 0b01 ; [v42, v39] vaddsd xmm14, xmm15, xmm14 ; computing v43 ≤ 1.01 * 2^22 vmovsd qword [z3 + i*8], xmm14 ; store z3 vpermilpd xmm13, xmm15, 0b01 ; [v35, v41] vsubsd xmm13, xmm%[i], xmm13 ; computing v40 ≤ 1.01 * 2^22 vmovsd qword [x3 + i*8], xmm13 ; store x3 %assign i i+1 %endrep ; restore stack frame mov rsp, rbp pop rbp %pop ge_add_ctx bench_epilogue ret section .rodata fe12x4_mul_consts fe12x4_squeeze_consts align 32, db 0 .const_3_3_3_3: dq 3.0,3.0,3.0,3.0 align 8, db 0 .const_13318: dq 13318.0
40.902128
106
0.520391
55551f6fbce64e6f846e8baaeaa1fce59f9265f0
642
asm
Assembly
oeis/131/A131607.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/131/A131607.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/131/A131607.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A131607: Pell companion numbers A001333 without last digit. ; 1,4,9,23,57,139,336,811,1960,4732,11424,27580,66585,160752,388089,936931,2261953,5460839,13183632,31828103,76839840,185507784,447855408,1081218600,2610292609,6301803820,15213900249,36729604319,88673108889,214075822099,516824753088,1247725328275,3012275409640,7272276147556,17556827704752,42385931557060,102328690818873,247043313194808,596415317208489,1439873947611787,3476163212432065,8392200372475919,20260563957383904,48913328287243727,118087220531871360,285087769350986448,688262759233844256 add $0,4 seq $0,131037 ; Sequence A001333 with last digits set to zero. div $0,10
91.714286
496
0.867601
96f77d69872b99162b0c5c913a19c83088266d45
794
asm
Assembly
oeis/219/A219660.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/219/A219660.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/219/A219660.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A219660: a(n) = number of bit-positions where Fibonacci numbers F(n) and F(n+1) contain both an 1-bit in their binary representation. ; Submitted by Jon Maiga ; 0,1,0,1,1,0,1,2,0,2,2,1,1,4,2,3,4,3,1,4,3,1,5,4,3,3,5,7,8,4,4,3,4,8,5,4,6,6,4,7,7,10,7,11,7,8,8,4,8,12,8,9,7,8,10,13,8,8,10,8,6,12,11,12,13,10,8,7,10,13,9,9,14,12,11,9,11,13,13,13,17,17,12,10,19,19,13,13,12,16,16,20,15,14,17,13,14,16,22,20 add $0,1 mov $5,$0 sub $0,1 seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. seq $5,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. mov $2,$5 seq $2,70939 ; Length of binary representation of n. lpb $2 mov $3,$0 div $0,2 mod $3,2 mov $4,$5 mod $4,2 add $3,$4 div $3,2 add $1,$3 sub $2,1 div $5,2 lpe mov $0,$1
31.76
241
0.59068
afef1584324f1aefab9939f10214efca4e4b8470
2,692
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_54_154.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_54_154.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_54_154.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 %r11 push %r13 push %r8 push %r9 push %rbx push %rcx push %rdi // Store mov $0x645, %r8 nop nop nop sub $32304, %rbx movl $0x51525354, (%r8) nop nop nop nop dec %rcx // Store mov $0x585, %r13 nop nop nop nop dec %r11 movb $0x51, (%r13) nop nop nop nop nop xor %r13, %r13 // Load mov $0xd85, %rbx nop nop nop cmp %r8, %r8 movups (%rbx), %xmm1 vpextrq $0, %xmm1, %rcx sub %r11, %r11 // Store lea addresses_PSE+0x18985, %r8 nop nop nop nop nop xor %rcx, %rcx mov $0x5152535455565758, %r9 movq %r9, %xmm7 movups %xmm7, (%r8) nop nop nop nop inc %r8 // Load lea addresses_RW+0x601d, %r8 nop nop nop nop nop cmp $20537, %r9 vmovups (%r8), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $1, %xmm6, %r13 nop nop nop nop nop cmp $18499, %rdi // Store lea addresses_UC+0x8745, %rbx nop nop nop cmp $26720, %rdi movw $0x5152, (%rbx) nop nop xor $46384, %rdi // Load lea addresses_RW+0xd4a5, %r8 nop nop nop and %rdi, %rdi mov (%r8), %bx nop xor %r11, %r11 // Faulty Load lea addresses_normal+0x2585, %r9 nop nop nop nop nop xor $16764, %rbx vmovntdqa (%r9), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %rdi lea oracles, %rcx and $0xff, %rdi shlq $12, %rdi mov (%rcx,%rdi,1), %rdi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_P', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 2}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0}} <gen_prepare_buffer> {'00': 54} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
17.946667
161
0.632987
038d361e5995ff2940348e84a7c9f61a5b991690
7,801
asm
Assembly
Appl/Calendar/DayEvent/dayeventDraw.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Appl/Calendar/DayEvent/dayeventDraw.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Appl/Calendar/DayEvent/dayeventDraw.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1989 -- All Rights Reserved PROJECT: PC GEOS MODULE: Calendar/DayEvent FILE: dayeventDraw.asm AUTHOR: Don Reeves, April 4, 1991 ROUTINES: Name Description ---- ----------- DayEventDraw Draws a DayEvent object & children DayEventDrawIcon Draw the proper icon (bell or repeat) DayEventDrawSelect Draw the selection box, if appropriate REVISION HISTORY: Name Date Description ---- ---- ----------- Don 04/05/89 Initial revision (from dayevent.asm) DESCRIPTION: Defines the "DayEvent" drawing procedures $Id: dayeventDraw.asm,v 1.1 97/04/04 14:47:22 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ include system.def DayEventCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayEventDraw %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Draw the time string, and call to draw children CALLED BY: UI (MSG_VIS_DRAW) PASS: ES = Dgroup DS:*SI = DayEventClass instance data DS:DI = DayEventClass specific instance data BP = GState CL = DrawFlags RETURN: Nothing DESTROYED: AX, BX, DX, DI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 6/89 Initial version Don 7/24/89 Brought to new UI %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayEventDraw method DayEventClass, MSG_VIS_DRAW ; First set up the GState ; push cx, di ; save DrawFlags mov di, bp ; GState to DI mov ax, CF_INDEX shl 8 or TEXT_COLOR call GrSetLineColor call GrSetTextColor ; set the foreground colors movdw bxax, es:[eventBGColor] call GrSetAreaColor ; set the background color pop cx, di ; restore the DrawFlags test cl, mask DF_PRINT ; are we printing ?? jnz complete ; if so, we're done ; Wash the window (background color) ; push cx, di ; save DrawFlags, instance data clr cl call VisGetBounds ; get my bounds mov di, bp ; GState to DI call GrFillRect ; draw the rectangle pop cx, di ; restore saved data ; Now draw the bitmap ; test ds:[di].DEI_stateFlags, mask EIF_HEADER jnz outline ; if a header, no bitmap call DayEventDrawIcon ; draw the lousy icon ; Draw the outline ?? ; outline: test ds:[di].DEI_actFlags, DE_SELECT ; select bit set jz complete mov ax, MSG_DE_DRAW_SELECT call ObjCallInstanceNoLock ; Call my superclass to continue the draw ; complete: mov ax, MSG_VIS_DRAW ; send draw to my SuperClass mov di, offset DayEventClass ; ES:DI is my class call ObjCallSuperNoLock ; call my superclass ret DayEventDraw endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayEventDrawIcon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Draws the appropriate icon (bell or repeat) CALLED BY: DayEventDraw PASS: *DS:SI = DayEvent object DS:DI = DayEvent instance data ES = DGroup BP = GState RETURN: Nothing DESTROYED: AX, BX, DX PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 10/20/89 Initial version Don 6/20/90 Changed to a near routine sean 4/6/95 To Do list changes sean 8/10/95 Responder changes sean 10/3/95 Cleaned up/EC code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayEventDrawIcon proc near uses cx, di, si, ds .enter ; Some set up work ; test es:[features], mask CF_ALARMS jz done ; if no alarms, don't draw bell mov di, bp ; GState to DI mov ah, CF_INDEX ; set the color index mov al, C_BLACK call GrSetAreaColor clr cl ; no flags for VisGetBounds call VisGetBounds ; upper bound in BX push bx ; save top push ax ; save left mov bx, handle DataBlock call MemLock ; lock the block ; Determine the bell to be drawn (bitmap handle to SI) ; mov di, ds:[si] ; dereference the handle add di, ds:[di].DayEvent_offset ; access my instance data mov si, offset DataBlock:RepeatIconMoniker test ds:[di].DEI_stateFlags, mask EIF_REPEAT jne drawIcon mov si, offset DataBlock:AlarmIconOnMoniker test ds:[di].DEI_stateFlags, mask EIF_ALARM_ON jnz drawIcon ; if alarm on, draw ON bell mov si, offset DataBlock:AlarmIconOffMoniker ; Draw the appropriate icon (bitmap handle in SI) ; drawIcon: mov ds, ax ; set the DataBlock segment mov si, ds:[si] ; dereference BM handle pop ax ; left bound of DayEvent add ax, EVENT_LR_MARGIN ; add in the left/right margin pop bx ; upper bound of DayEvent add bx, es:[yIconOffset] clr cx clr dx ; no call back routine mov di, bp ; GState to DI call GrDrawBitmap ; draw it ; Clean up ; cleanUp:: mov bx, handle DataBlock call MemUnlock done: .leave ret DayEventDrawIcon endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayEventDrawNoStartTime %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Draw a hyphen if there is no start time for the current event CALLED BY: DayEventDraw PASS: ds:di = DayEventInstance *ds:si = DayEvent object es = dgroup bp = GState handle RETURN: nothing DESTROYED: ds REVISION HISTORY: Name Date Description ---- ---- ----------- jang 2/ 4/97 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DayEventDrawSelect %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Draw the select box CALLED BY: INTERNAL (MSG_DE_DRAW_SELECT) PASS: DS:*SI = DayEvent instance data BP = GState CL = DrawFlags RETURN: Nothing DESTROYED: AX, BX, DI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 1/4/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DayEventDrawSelect method DayEventClass, MSG_DE_DRAW_SELECT uses cx, dx .enter ; First draw the bounding box ; test cl, mask DF_PRINT ; are we printing ?? jnz exit ; if so, do nothing clr cl ; want true bounds call VisGetBounds ; fill AX, BX, CX, DX inc ax ; left bounds++ dec cx ; right bounds-- dec cx ; right bounds-2 dec dx ; bottom bounds-- mov di, bp ; GState to DI call GrDrawRect ; draw the rectangle ; Now draw the divider, unless we are a header event ; mov bp, ds:[si] ; dereference the handle add bp, ds:[bp].DayEvent_offset ; access my instance data test ds:[bp].DEI_stateFlags, mask EIF_HEADER jnz done ; if a header, don't draw this mov bp, ds:[bp].DEI_textHandle ; text object => DS:*BX mov bp, ds:[bp] ; dereference the handle add bp, ds:[bp].Vis_offset ; access my visual data mov cx, ds:[bp].VI_bounds.R_left ; right side => CX ;;; mov al, SDM_50 ; fifty-percent draw pattern ;;; call GrSetLineMask ; set the mask, dude! mov ax, cx dec ax ; left side => AX inc bx ; move top down by 1 dec dx ; move bottom up by one call GrDrawRect ; draw a line ;;; mov al, SDM_100 ; reset the mask ;;; call GrSetLineMask done: mov bp, di ; GState => BP exit: .leave ret DayEventDrawSelect endp DayEventCode ends
25.245955
79
0.577746
152decbd6e228a2d3d2b141a55872aa95f6c3a0d
127
asm
Assembly
q3.asm
tatticoder/Simple-Code
ba7a48d12154c347cdf3a1f7ea1b46f32e1d64ba
[ "MIT" ]
null
null
null
q3.asm
tatticoder/Simple-Code
ba7a48d12154c347cdf3a1f7ea1b46f32e1d64ba
[ "MIT" ]
null
null
null
q3.asm
tatticoder/Simple-Code
ba7a48d12154c347cdf3a1f7ea1b46f32e1d64ba
[ "MIT" ]
null
null
null
.MODE SMALL .CODE .386 .STARTUP MOV AX,1H MOV BX,2H MOV CX,6H MOV DX,3H ADD AX,BX ADD CX,DX ADD AX,CX .EXIT END
8.466667
12
0.622047
cf7a09633acef6283afecf3a26d3b2af3af80574
188
asm
Assembly
languages/x86/hello.asm
octonion/examples
5d142697b9f781e37c61f32217fdb6d661902d42
[ "MIT" ]
4
2017-12-14T04:00:10.000Z
2018-03-31T07:12:13.000Z
languages/x86/hello.asm
octonion/examples
5d142697b9f781e37c61f32217fdb6d661902d42
[ "MIT" ]
null
null
null
languages/x86/hello.asm
octonion/examples
5d142697b9f781e37c61f32217fdb6d661902d42
[ "MIT" ]
null
null
null
section .data msg db "Hello, world!$" section .text global _start _start: mov rax, 1 mov rdi, 1 mov rsi, msg mov rdx, 13 syscall mov rax, 60 mov rdi, 0 syscall
13.428571
24
0.611702
8b984105fdcce7ea7bb74d4a6c87bf47483f1ebb
211
asm
Assembly
programs/oeis/271/A271907.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/271/A271907.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/271/A271907.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A271907: Size of the largest subset S of the points of an n X n square grid such that no three of the points of S form an isosceles triangle. ; 1,2,4,6,8,10,12,14,16,18 mul $0,2 pow $1,$0 add $1,$0 mov $0,$1
26.375
143
0.687204
a76f10e38df95c46a6987f6ff014538e59664bf3
1,786
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_7_419.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_7_419.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_7_419.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 lea addresses_WT_ht+0x1b20d, %r15 nop nop nop nop inc %r14 movups (%r15), %xmm2 vpextrq $1, %xmm2, %r10 cmp $15466, %r12 pop %r15 pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r15 push %r8 push %rax push %rbx push %rdi push %rdx // Store lea addresses_WC+0x1a94d, %rdx nop nop inc %r10 movw $0x5152, (%rdx) nop nop nop nop cmp %r15, %r15 // Load lea addresses_WT+0xb54d, %rax nop nop inc %rdi vmovups (%rax), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $1, %xmm6, %rbx nop nop nop nop sub $35679, %r8 // Load lea addresses_US+0x12a6d, %rax cmp %rdi, %rdi mov (%rax), %r8 nop nop add $627, %r8 // Faulty Load lea addresses_normal+0x14d, %r8 sub $51353, %rdi mov (%r8), %rbx lea oracles, %r15 and $0xff, %rbx shlq $12, %rbx mov (%r15,%rbx,1), %rbx pop %rdx pop %rdi pop %rbx pop %rax pop %r8 pop %r15 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}} {'34': 7} 34 34 34 34 34 34 34 */
18.412371
125
0.639418
d22c76d7632a54fc19bb3a499cc09f82a9b9a0bd
3,092
asm
Assembly
src/shaders/post_processing/gen5_6/Common/PL8x8_Save_PA.asm
tizenorg/platform.upstream.libva-intel-driver
9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90
[ "MIT" ]
null
null
null
src/shaders/post_processing/gen5_6/Common/PL8x8_Save_PA.asm
tizenorg/platform.upstream.libva-intel-driver
9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90
[ "MIT" ]
null
null
null
src/shaders/post_processing/gen5_6/Common/PL8x8_Save_PA.asm
tizenorg/platform.upstream.libva-intel-driver
9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90
[ "MIT" ]
null
null
null
/* * All Video Processing kernels * Copyright © <2010>, Intel Corporation. * * This program is licensed under the terms and conditions of the * Eclipse Public License (EPL), version 1.0. The full text of the EPL is at * http://www.opensource.org/licenses/eclipse-1.0.php. * */ // Module name: PL8x8_Save_PA.asm // // Save planar YUV422 to packed YUV422 format data // // Note: SRC_* must reference to regions with data type "BYTE" // in order to save to byte-aligned byte location #include "PL8x8_Save_PA.inc" add (4) pCF_Y_OFFSET<1>:uw ubDEST_CF_OFFSET<4;4,1>:ub nDEST_YUV_REG*nGRFWIB:w // Initial Y,U,V offset in YUV422 block // Pack Y $for(0; <nY_NUM_OF_ROWS; 1) { mov (16) r[pCF_Y_OFFSET, %1*nGRFWIB]<2> ubSRC_Y(0,%1*32) } // Pack U/V $for(0; <nUV_NUM_OF_ROWS; 1) { mov (8) r[pCF_U_OFFSET, %1*nGRFWIB]<4> ubSRC_U(0, %1*16) mov (8) r[pCF_V_OFFSET, %1*nGRFWIB]<4> ubSRC_V(0, %1*16) } shl (1) rMSGSRC.0<1>:d wORIX<0;1,0>:w 1:w { NoDDClr } // H. block origin need to be doubled mov (1) rMSGSRC.1<1>:d wORIY<0;1,0>:w { NoDDClr, NoDDChk } // Block origin mov (1) rMSGSRC.2<1>:ud nDPW_BLOCK_SIZE_YUV:ud { NoDDChk } // Block width and height (32x8) mov (8) mMSGHDR<1>:ud rMSGSRC<8;8,1>:ud //Use the mask to determine which pixels shouldn't be over-written and (1) acc0.0<1>:ud udBLOCK_MASK<0;1,0>:ud 0x00FFFFFF:ud cmp.ge.f0.0(1) dNULLREG acc0.0<0;1,0>:ud 0x00FFFFFF:ud //Check if all pixels in the block need to be modified (f0.0) jmpi WritePackedToDataPort //If mask is not all 1's, then load the entire 32x8 block //so that only those bytes may be modified that need to be (using the mask) // Load 32x8 packed YUV 422 ---------------------------------------------------- send (8) udSRC_YUV(0)<1> mMSGHDR udDUMMY_NULL nDATAPORT_READ nDPMR_MSGDSC+nDPR_MSG_SIZE_YUV+nBI_DESTINATION_YUV:ud mov (8) mMSGHDR<1>:ud rMSGSRC<8;8,1>:ud //Merge the data mov (1) f0.0:uw ubBLOCK_MASK_V:ub //Load the mask on flag reg (f0.0) mov (8) rMASK_TEMP<1>:uw uwBLOCK_MASK_H:uw (-f0.0) mov (8) rMASK_TEMP<1>:uw 0:uw // Destination is Byte aligned $for(0; <nY_NUM_OF_ROWS; 1) { mov (1) f0.1:uw uwMASK_TEMP(0,%1)<0;1,0> (-f0.1) mov (16) uwDEST_YUV(%1)<1> uwSRC_YUV(%1) //check the UV merge - vK } WritePackedToDataPort: // Packed YUV data are stored in one of the I/O regions before moving to MRF // Note: This is necessary since indirect addressing is not supported for MRF. // Packed data block should be saved as 32x8 pixel block $for(0; <nY_NUM_OF_ROWS; 1) { mov (8) mudMSGPAYLOAD(%1)<1> udDEST_YUV(%1)REGION(8,1) } send (8) dNULLREG mMSGHDR udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nDPW_MSG_SIZE_YUV+nBI_DESTINATION_YUV:ud // End of PL8x8_Save_PA
42.944444
131
0.601552
fb7ba6765cf984320cf27bd31c090bda1533a79d
597
asm
Assembly
programs/oeis/182/A182780.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/182/A182780.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/182/A182780.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A182780: Twice A024537. ; 2,4,8,18,42,100,240,578,1394,3364,8120,19602,47322,114244,275808,665858,1607522,3880900,9369320,22619538,54608394,131836324,318281040,768398402,1855077842,4478554084,10812186008,26102926098,63018038202,152139002500,367296043200,886731088898,2140758220994,5168247530884,12477253282760,30122754096402,72722761475562,175568277047524,423859315570608,1023286908188738,2470433131948082,5964153172084900 mov $1,2 mov $2,1 lpb $0,1 sub $0,1 add $1,$2 sub $1,$3 mov $4,$3 trn $4,6 add $4,$2 add $3,$4 add $1,$3 mov $2,$1 sub $2,$4 sub $2,1 mov $3,1 lpe
29.85
398
0.757119
52918fc892fdf772371e8b2d80ee87aefbea5942
1,505
asm
Assembly
Operating-Systems-Homeworks/HW2/141044058_HW02/141044058_AliYasin_Eser/Parallel.asm
aliyasineser/GTU_Homeworks
d98502674788b86683edefce442989bb4f7a464b
[ "Apache-2.0" ]
7
2018-10-20T12:50:00.000Z
2021-11-29T23:47:06.000Z
Operating-Systems-Homeworks/HW2/141044058_HW02/141044058_AliYasin_Eser/Parallel.asm
aliyasineser/GTU_Homeworks
d98502674788b86683edefce442989bb4f7a464b
[ "Apache-2.0" ]
null
null
null
Operating-Systems-Homeworks/HW2/141044058_HW02/141044058_AliYasin_Eser/Parallel.asm
aliyasineser/GTU_Homeworks
d98502674788b86683edefce442989bb4f7a464b
[ "Apache-2.0" ]
null
null
null
; 8080 assembler code .hexfile Parallel.hex .binfile Parallel.com ; try "hex" for downloading in hex format .download bin .objcopy gobjcopy .postbuild echo "OK!" ;.nodump ; OS call list PRINT_B equ 1 PRINT_MEM equ 2 READ_B equ 3 READ_MEM equ 4 PRINT_STR equ 5 READ_STR equ 6 FORK equ 7 EXEC equ 8 WAITPID equ 9 ; Position for stack pointer stack equ 04000h org 000H jmp begin ; Start of our Operating System GTU_OS: PUSH D push D push H push psw nop ; This is where we run our OS in C++, see the CPU8080::isSystemCall() ; function for the detail. pop psw pop h pop d pop D ret ; --------------------------------------------------------------- ; YOU SHOULD NOT CHANGE ANYTHING ABOVE THIS LINE ;This program executes 3 programs. printNumbersProg: dw "PrintNumbers.com", 00H printNumbersRevProg: dw "PrintNumbersRev.com", 00H sumProg: dw "sum.com", 00H begin: LXI SP,stack ; always initialize the stack pointer MVI A, FORK ; store the OS call code to A call GTU_OS ; call the OS mvi a, 0 cmp b jnz PARENTZERO lxi b, printNumbersProg mvi a, EXEC call GTU_OS JMP ENDPROC HLT PARENTZERO: MVI A, FORK ; store the OS call code to A call GTU_OS ; call the OS mvi a, 0 cmp b jnz PARENTONE lxi b, printNumbersRevProg mvi a, EXEC call GTU_OS JMP ENDPROC HLT PARENTONE: lxi b, sumProg mvi a, EXEC call GTU_OS JMP ENDPROC HLT ENDPROC: HLT
15.677083
74
0.638538
a8f549c517f28c5236a101dd1bdc36fa0ff129c6
9,455
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2_notsx.log_989_397.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_notsx.log_989_397.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_notsx.log_989_397.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 %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x19c32, %rsi lea addresses_WT_ht+0x1df32, %rdi nop nop and %rbp, %rbp mov $5, %rcx rep movsw nop nop nop and $54888, %rdx lea addresses_A_ht+0x16432, %r10 nop nop nop nop cmp %r12, %r12 and $0xffffffffffffffc0, %r10 vmovaps (%r10), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %rbp nop nop sub %rcx, %rcx lea addresses_WC_ht+0x15542, %r12 nop nop nop nop inc %r10 movups (%r12), %xmm4 vpextrq $1, %xmm4, %rcx cmp $36462, %rdx lea addresses_WC_ht+0x18932, %r12 nop add %rsi, %rsi movl $0x61626364, (%r12) nop nop nop nop cmp $24774, %rdx lea addresses_UC_ht+0x12832, %rsi lea addresses_UC_ht+0x17932, %rdi nop nop nop nop nop cmp $65186, %rbx mov $22, %rcx rep movsl nop nop add %rbx, %rbx lea addresses_UC_ht+0x10232, %rsi lea addresses_A_ht+0xd5d5, %rdi add %r10, %r10 mov $13, %rcx rep movsq nop nop nop inc %rbx lea addresses_A_ht+0x10eb2, %rsi lea addresses_A_ht+0xa832, %rdi sub %r12, %r12 mov $4, %rcx rep movsb nop nop nop nop nop and %rbp, %rbp lea addresses_D_ht+0x9432, %rdx nop nop add %rbx, %rbx movw $0x6162, (%rdx) nop nop nop nop xor $36830, %rdi lea addresses_normal_ht+0x99f2, %r10 sub %rbx, %rbx mov $0x6162636465666768, %rsi movq %rsi, (%r10) nop add %rcx, %rcx lea addresses_WT_ht+0x13ff2, %rsi nop nop and %rbx, %rbx mov $0x6162636465666768, %rbp movq %rbp, %xmm6 vmovups %ymm6, (%rsi) nop sub $994, %rsi lea addresses_normal_ht+0x133ba, %rsi lea addresses_WT_ht+0xc474, %rdi nop sub %rbp, %rbp mov $47, %rcx rep movsw nop nop nop nop nop add $13895, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %rcx push %rdi push %rdx push %rsi // Store lea addresses_D+0x91b2, %rdx nop nop nop nop xor $45713, %rsi mov $0x5152535455565758, %r10 movq %r10, %xmm2 vmovups %ymm2, (%rdx) nop add $19902, %rsi // Load lea addresses_WT+0x1a232, %r14 nop nop nop nop dec %r13 vmovups (%r14), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $1, %xmm5, %rdx nop nop nop nop nop sub %r14, %r14 // Store lea addresses_normal+0x16e72, %rdx nop nop nop cmp %r11, %r11 movl $0x51525354, (%rdx) nop nop add $56502, %r14 // Store lea addresses_WT+0x4d02, %rsi dec %r10 movl $0x51525354, (%rsi) nop sub $45959, %rcx // Store lea addresses_A+0x15032, %r11 clflush (%r11) nop nop nop nop nop and $22384, %rdx movb $0x51, (%r11) add $15441, %r10 // REPMOV lea addresses_UC+0x11df2, %rsi lea addresses_D+0x9032, %rdi nop inc %r11 mov $98, %rcx rep movsl nop add %r11, %r11 // Store mov $0x32, %rdi nop nop nop add %rcx, %rcx mov $0x5152535455565758, %rdx movq %rdx, %xmm4 movups %xmm4, (%rdi) add $46518, %r14 // Store lea addresses_WT+0x185be, %r10 nop nop nop nop dec %r13 movw $0x5152, (%r10) sub $976, %r13 // Store mov $0xe32, %rcx cmp %r10, %r10 movb $0x51, (%rcx) nop nop nop cmp %r13, %r13 // Store lea addresses_normal+0x1c832, %r10 nop nop cmp %r14, %r14 mov $0x5152535455565758, %rdi movq %rdi, %xmm2 movups %xmm2, (%r10) nop nop add $10499, %r14 // Faulty Load lea addresses_normal+0x1c832, %rsi nop nop nop nop nop xor %rcx, %rcx movups (%rsi), %xmm1 vpextrq $1, %xmm1, %r13 lea oracles, %rcx and $0xff, %r13 shlq $12, %r13 mov (%rcx,%r13,1), %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 10, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}} {'00': 989} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
30.401929
2,966
0.653094
c9938203a69ebec97d1f8b10bc0200f0a4984105
1,785
asm
Assembly
x86-Win-NASM/src/Tables/pair_positions.asm
gramai/school-related
152d67b4e475c3ba7c9370d6de39b38fc453392d
[ "MIT" ]
null
null
null
x86-Win-NASM/src/Tables/pair_positions.asm
gramai/school-related
152d67b4e475c3ba7c9370d6de39b38fc453392d
[ "MIT" ]
null
null
null
x86-Win-NASM/src/Tables/pair_positions.asm
gramai/school-related
152d67b4e475c3ba7c9370d6de39b38fc453392d
[ "MIT" ]
null
null
null
;English ;Print on the screen the sum of the elements on pair positions ;Exemple 1: ;x DB 1,9,3,4,5,8 ;n DB 6 ;This will print 9 (the sum of x[0], x[2], x[4]) ;Exemple 2: ;x DB 1,9,3,4,5,8,2 ;n DB 7 ;This will print: 11 (the sum of x[0], x[2], x[4], x[6]) ;French ;Affichage sur l'écran de l'émulateur la somme des ;éléments de la position même pour un tableau. ;Exemple 1: ;x DB 1,9,3,4,5,8 ;n DB 6 ;La valeur doit être imprimée est: 9 (somme de x [0], x ;[2], x [4]) ;Exemple 2: ;x DB 1,9,3,4,5,8,2 ;n DB 7 ;La valeur doit être imprimée est: 11 (somme de x [0], x ;[2], x [4], x [6]) org 100h include "emu8086.inc" .data : x DW 1,9,3,4,5,8,2 ; define the table n DW 7 ;define the number of elements as a word msgsum db 0dh, 0ah, "Sum of elements on pair positions is ",0 msgstop db 0dh, 0ah, "Stopping...",0 .code MOV CX, [n] ; CX gets the value of the word n LEA SI, x MOV AX, 0 ;AX will hold the sum MOV BX, 1 ;BX will work as a FLAG: it will be BX == 1, if the element is pair, 0 otherwise looper: CMP BX, 1 JE pair JL npair continue: ADD SI,2 LOOP looper JMP print pair: ADD AX, [SI] ;adds the value of the current element of the table to AX MOV BX, 0 ; BX takes the value 0, because the next element will be on IMPAIR indice JMP continue npair: MOV BX,1 ; Next element will be on pair indice JMP continue print: LEA SI, msgsum call print_string call print_num stop: LEA SI, msgstop call print_string MOV AH, 0 INT 16h RET DEFINE_GET_STRING DEFINE_PRINT_STRING DEFINE_PRINT_NUM DEFINE_PRINT_NUM_UNS DEFINE_SCAN_NUM END
21.506024
91
0.6
8ad1678e30af3ebe0685d64bad6dbbf79c433d26
141
asm
Assembly
malban/Release/VRelease/Release.History/VRelease_2017_04_23/Song/track_1A_02.asm
mikepea/vectrex-playground
0de7d2d6db0914d915f4334402f747ab3bcdc7e6
[ "0BSD" ]
5
2018-01-14T10:03:50.000Z
2020-01-17T13:53:49.000Z
malban/Release/VRelease/Release.History/VRelease_2017_04_23/Song/track_1A_02.asm
mikepea/vectrex-playground
0de7d2d6db0914d915f4334402f747ab3bcdc7e6
[ "0BSD" ]
null
null
null
malban/Release/VRelease/Release.History/VRelease_2017_04_23/Song/track_1A_02.asm
mikepea/vectrex-playground
0de7d2d6db0914d915f4334402f747ab3bcdc7e6
[ "0BSD" ]
null
null
null
dw $0010 track_1A_02: db $FF, $B4, $A6, $3F, $18, $F9, $5A, $96, $3D, $6D db $29, $8F, $26, $3C, $18, $ED, $5A, $96, $3A, $6D db $29, $80
28.2
52
0.475177
f42901913a506e669bf28326f5c9d0d32c320f6b
246
asm
Assembly
programs/oeis/204/A204689.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/204/A204689.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/204/A204689.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A204689: a(n) = n^n (mod 4). ; 1,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0 pow $1,$0 gcd $1,$0 pow $1,7 mod $1,4
30.75
175
0.495935
ae6b52fc0ddd605e708bcc7109224692d57b569f
1,710
asm
Assembly
programs/oeis/080/A080861.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/080/A080861.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/080/A080861.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A080861: 15*n^2 + 6*n + 1. ; 1,22,73,154,265,406,577,778,1009,1270,1561,1882,2233,2614,3025,3466,3937,4438,4969,5530,6121,6742,7393,8074,8785,9526,10297,11098,11929,12790,13681,14602,15553,16534,17545,18586,19657,20758,21889,23050,24241,25462,26713,27994,29305,30646,32017,33418,34849,36310,37801,39322,40873,42454,44065,45706,47377,49078,50809,52570,54361,56182,58033,59914,61825,63766,65737,67738,69769,71830,73921,76042,78193,80374,82585,84826,87097,89398,91729,94090,96481,98902,101353,103834,106345,108886,111457,114058,116689,119350,122041,124762,127513,130294,133105,135946,138817,141718,144649,147610,150601,153622,156673,159754,162865,166006,169177,172378,175609,178870,182161,185482,188833,192214,195625,199066,202537,206038,209569,213130,216721,220342,223993,227674,231385,235126,238897,242698,246529,250390,254281,258202,262153,266134,270145,274186,278257,282358,286489,290650,294841,299062,303313,307594,311905,316246,320617,325018,329449,333910,338401,342922,347473,352054,356665,361306,365977,370678,375409,380170,384961,389782,394633,399514,404425,409366,414337,419338,424369,429430,434521,439642,444793,449974,455185,460426,465697,470998,476329,481690,487081,492502,497953,503434,508945,514486,520057,525658,531289,536950,542641,548362,554113,559894,565705,571546,577417,583318,589249,595210,601201,607222,613273,619354,625465,631606,637777,643978,650209,656470,662761,669082,675433,681814,688225,694666,701137,707638,714169,720730,727321,733942,740593,747274,753985,760726,767497,774298,781129,787990,794881,801802,808753,815734,822745,829786,836857,843958,851089,858250,865441,872662,879913,887194,894505,901846,909217,916618,924049,931510 mov $1,15 mul $1,$0 add $1,6 mul $1,$0 add $1,1
190
1,631
0.830409
98c5984fd7237620d2685e69cfeb0bdfe4b3043e
592
asm
Assembly
programs/oeis/033/A033121.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/033/A033121.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/033/A033121.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A033121: Base-3 digits are, in order, the first n terms of the periodic sequence with initial period 1,0,1. ; 1,3,10,31,93,280,841,2523,7570,22711,68133,204400,613201,1839603,5518810,16556431,49669293,149007880,447023641,1341070923,4023212770,12069638311,36208914933,108626744800,325880234401,977640703203,2932922109610,8798766328831,26396298986493,79188896959480,237566690878441,712700072635323,2138100217905970,6414300653717911 mov $3,14 mov $4,15 mov $5,6 lpb $0 sub $0,1 mul $4,3 lpe add $0,$3 mov $1,$0 add $2,$4 mul $5,3 sub $5,5 div $2,$5 mul $1,$2 sub $1,14 div $1,14 add $1,1
28.190476
321
0.768581
fc99cbce4539d0b97fb3676db6b4a90d5099cfd6
356
asm
Assembly
programs/oeis/083/A083661.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/083/A083661.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/083/A083661.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A083661: G.f.: 1/(1-x) * sum(k>=0, x^2^(k+2)/(1+x^2^k)). ; 0,0,0,1,0,1,0,2,1,1,0,2,1,1,0,3,2,2,1,2,1,1,0,3,2,2,1,2,1,1,0,4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0,4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1,4,3,3,2,3,2,2,1,3,2,2,1,2,1 sub $0,1 mov $1,2 lpb $0,1 mov $2,2 gcd $2,$0 div $0,2 sub $0,1 add $1,$2 sub $1,1 lpe sub $1,2
23.733333
187
0.480337
8ac3655b62032251a9c4deb96a4a1b843a6e07db
7,177
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1559.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1559.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1559.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0xa2e8, %rax nop nop nop nop cmp $35168, %r11 movb (%rax), %bl nop and %r8, %r8 lea addresses_D_ht+0x14528, %rsi lea addresses_normal_ht+0x56f2, %rdi inc %r13 mov $82, %rcx rep movsb nop nop nop nop nop inc %r11 lea addresses_D_ht+0x1980, %r13 clflush (%r13) nop nop inc %r11 mov (%r13), %rdi xor $61016, %r13 lea addresses_WT_ht+0x1c928, %r11 nop nop nop nop add %rcx, %rcx mov $0x6162636465666768, %rbx movq %rbx, %xmm1 movups %xmm1, (%r11) nop nop nop nop nop and %r13, %r13 lea addresses_A_ht+0x11be8, %rsi lea addresses_D_ht+0x1e808, %rdi clflush (%rsi) nop nop nop nop cmp %rbx, %rbx mov $111, %rcx rep movsq nop nop nop nop xor %rbx, %rbx lea addresses_D_ht+0xa8, %rdi nop nop nop sub $15831, %rcx mov $0x6162636465666768, %rbx movq %rbx, %xmm2 movups %xmm2, (%rdi) nop nop nop dec %rsi lea addresses_D_ht+0x1e668, %rax nop nop nop nop and %rdi, %rdi mov $0x6162636465666768, %rsi movq %rsi, %xmm7 vmovups %ymm7, (%rax) nop nop nop nop nop and %rsi, %rsi lea addresses_D_ht+0xc468, %r8 clflush (%r8) nop nop nop nop sub $58405, %r11 mov $0x6162636465666768, %rdi movq %rdi, (%r8) nop nop nop and %rdi, %rdi lea addresses_normal_ht+0x17468, %rdi nop nop nop nop xor %rbx, %rbx movw $0x6162, (%rdi) nop nop nop nop add %rax, %rax lea addresses_WC_ht+0x13fb0, %rsi lea addresses_normal_ht+0x1b1b8, %rdi nop nop nop nop nop add %r13, %r13 mov $62, %rcx rep movsq nop xor %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r9 push %rax push %rbx push %rcx push %rdx // Store lea addresses_normal+0xd1f8, %r15 clflush (%r15) nop nop nop nop and %rdx, %rdx movb $0x51, (%r15) nop nop nop nop xor $46139, %r15 // Store lea addresses_WC+0xd868, %rax nop nop nop dec %r14 mov $0x5152535455565758, %rcx movq %rcx, (%rax) nop nop xor $30073, %r9 // Faulty Load lea addresses_UC+0xd868, %r14 nop nop nop add $17421, %r9 vmovups (%r14), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rbx lea oracles, %r9 and $0xff, %rbx shlq $12, %rbx mov (%r9,%rbx,1), %rbx pop %rdx pop %rcx pop %rbx pop %rax pop %r9 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC', 'congruent': 11}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 7}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 3, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 2}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 10}, 'OP': 'STOR'} {'dst': {'same': True, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
32.183857
2,999
0.659189
46f8d2df6ddf97e71035314d35d7090016d6e614
229
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/ldexp.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/ldexp.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/ldexp.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
null
null
null
SECTION code_fp_math16 PUBLIC f16_ldexp EXTERN cm16_sccz80_ldexp defc f16_ldexp = cm16_sccz80_ldexp ; SDCC bridge for Classic IF __CLASSIC PUBLIC _f16_ldexp EXTERN cm16_sdcc_ldexp defc _f16_ldexp = cm16_sdcc_ldexp ENDIF
14.3125
35
0.834061
069534942fd38027a719299c94d7c452c5b4af82
1,449
asm
Assembly
src/naos.asm
Fisch03/NaOS
e1d49e4a536e1d55e72a9f7f9c2952d8e7e6480a
[ "Unlicense" ]
2
2020-05-11T20:04:27.000Z
2020-05-11T21:00:17.000Z
src/naos.asm
Fisch03/NaOS
e1d49e4a536e1d55e72a9f7f9c2952d8e7e6480a
[ "Unlicense" ]
null
null
null
src/naos.asm
Fisch03/NaOS
e1d49e4a536e1d55e72a9f7f9c2952d8e7e6480a
[ "Unlicense" ]
null
null
null
BITS 16 start: ; Set up 4k of stack space mov ax, 07C0h add ax, 288 mov ss, ax mov sp, 4069 ; Set data segment mov ax, 07C0h mov ds, ax mov si, loading_string call print_string mov bh, 09h call wait_dot mov si, welcome_string call print_string call wait_for_key mov si, exit_string call print_string mov bh, 05h call wait_dot call shutdown mov si, error_string call print_string jmp $ newline db 0x0D, 0x0A, 0 loading_string db 'Loading', 0 welcome_string db 'Welcome to NaOS!', 0x0D, 0x0A, 'Press any key to continue...', 0x0D, 0x0A, 0 exit_string db 'Thank you for using NaOS!', 0x0D, 0x0A, 'Exiting', 0 error_string db 'If you can read this something has gone terribly wrong. Blame the devs or something.', 0x0D, 0x0A, 0 print_string: mov ah, 0Eh .loop: lodsb cmp al, 0 je .done int 10h jmp .loop .done: ret wait_dot: mov al, 0 mov dx, 0 .loop: dec bh cmp bh, 0 je .done mov ah, 86h mov cx, 09h int 15h mov al, '.' mov ah, 0Eh int 10h jmp .loop .done: mov si, newline call print_string ret wait_for_key: mov ah, 00h int 16h ret shutdown: mov ax, 0x1000 mov ax, ss mov sp, 0xF000 mov ax, 0x5307 mov bx, 0x0001 mov cx, 0x0003 int 15h ret end: times 510-($-$$) db 0 dw 0xAA55
15.75
121
0.596963
7d607766eba74989d3f8308826c62f286d722461
180
asm
Assembly
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/l_f32_ne.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/l_f32_ne.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/l_f32_ne.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_fp_am9511 PUBLIC l_f32_ne EXTERN asm_am9511_compare_callee .l_f32_ne call asm_am9511_compare_callee scf ret NZ ccf dec hl ret
12.857143
37
0.677778
79ca760b9a57d455f0f143531acd6a6f25bf35bb
50,346
asm
Assembly
hangman.asm
ViswaDecoders/Hangman
ec96d4a3cec0b649021bf52ab9eaaae50a2addce
[ "Apache-2.0" ]
3
2020-10-07T07:45:47.000Z
2021-08-20T11:30:12.000Z
hangman.asm
ViswaDecoders/Hangman
ec96d4a3cec0b649021bf52ab9eaaae50a2addce
[ "Apache-2.0" ]
null
null
null
hangman.asm
ViswaDecoders/Hangman
ec96d4a3cec0b649021bf52ab9eaaae50a2addce
[ "Apache-2.0" ]
null
null
null
data segment welcome db "********************************************************** ",13,10 db "** _ _ _ _ _____ __ __ _ _ ** ",13,10 db "** | | | | /\ | \ | |/ ____| \/ | /\ | \ | | ** +-------+ ",13,10 db "** | |__| | / \ | \| | | __| \ / | / \ | \| | ** | | ",13,10 db "** | __ | / /\ \ | . ` | | |_ | |\/| | / /\ \ | . ` | ** | | ",13,10 db "** | | | |/ ____ \| |\ | |__| | | | |/ ____ \| |\ | ** | O ",13,10 db "** |_| |_/_/ \_\_| \_|\_____|_| |_/_/ \_\_| \_| ** | /|\ ",13,10 db "** _____ __ __ ______ ** | | ",13,10 db "** / ____| /\ | \/ | ____| ** | / \ ",13,10 db "** | | __ / \ | \ / | |__ ** | ",13,10 db "** | | |_ | / /\ \ | |\/| | __| ** +----------+",13,10 db "** | |__| |/ ____ \| | | | |____ ** | | ",13,10 db "** \_____/_/ \_\_| |_|______| ** | |",13,10 db "** ** +----------+",13,10 db "********************************************************** ",13,10 db " ",13,10 db " ",13,10 db " ",13,10 db " ",13,10 db " ---Presents--- ",13,10 db " 19BPS1014 A.L.Viswanath ",13,10 db " 19BPS1010 G.Anurag ",13,10 db " ",13,10 db " ",13,10 db "$" welcome_message db " HANGMAN - GAME $" mode_sel db 13,10,13,10,"Select th mode: ",13,10,"1. 1-Player mode ",13,10,"2. 2-Player mode ",13,10,"3. Rapid Mode",13,10,"4. Time-Limit mode$" sel_opt db 13,10,13,10,"Enter the mode number: $" ;13-for next line,10- carrriage return type_message db "Type a letter: $" new_line db 13,10,"$" win_message db "YOU WIN!$" win_message1 db "Correct Guesss!!!$" lose_message db "YOU LOSE!$" lose_message1 db "OOpss!! out of lives...$" tie_message db 13,10,13,10,"Tie$" word db "bollywood$" discovered_word db 9 dup("_"),"$" word_size db 9 lives db 5 hits db 0 errors db 0 bell db 7 msg_lives db 13,10,13,10,"Lives: $" msg_topic db 13,10,13,10,"Enter the Genre: $" msg_topics db 13,10,13,10,"Genre : $" topic1 db 50,?,50 dup('$') ;50 is size,? is empty value,fill 50 value with $ msg_fplname db 13,10,13,10,"Please enter the first player's name: $" fplname db 50,?,50 dup('$') msg_splname db 13,10,13,10,"Please enter the second player's name: $" splname db 50,?,50 dup('$') msg1 db 13,10,13,10,"player 1 name: $" msg2 db 13,10,13,10,"player 2 name: $" topic2 db 50,?,50 dup('$') msg_fplword db 13,10,13,10,"Player1 enter your secret word: $" fplword db 50,?,50 dup("$") fplword_len db ? dis_fplword db 50,?,50 dup("$") msg_fpl db 13,10,13,10,"Player 1 turn: $",13,10,13,10 msg_splword db 13,10,13,10,"Player2 enter your secret word: $" splword db 50,?,50 dup("$") splword_len db ? dis_splword db 50,?,50 dup("$") msg_spl db 13,10,13,10,"Player 2 turn: $",13,10,13,10 msg_win1 db 13,10,13,10,"the winner is : $" msg_score db 13,10,13,10,"Total Score(Out of 10) is : $" fp_lives db 5 fp_hits db 0 fp_errors db 0 fp_score db 0 sp_lives db 5 sp_hits db 0 sp_errors db 0 sp_score db 0 string1 db "canoe$" str1_dword db 5 dup("_"),"$" str1_size db 5h string2 db "doberman$" str2_dword db 8 dup("_"),"$" str2_size db 8h string3 db "frame$" str3_dword db 5 dup("_"),"$" str3_size db 5h string4 db "banana$" str4_dword db 6 dup("_"),"$" str4_size db 6h string5 db "orange$" str5_dword db 6 dup("_"),"$" str5_size db 6h string6 db "frigate$" str6_dword db 7 dup("_"),"$" str6_size db 7h string7 db "ketchup$" str7_dword db 7 dup("_"),"$" str7_size db 7h string8 db "postal$" str8_dword db 6 dup("_"),"$" str8_size db 6h string9 db "basket$" str9_dword db 6 dup("_"),"$" str9_size db 6h string10 db "cabinet$" str10_dword db 7 dup("_"),"$" str10_size db 7h score db 0 msg_time db 13,10,13,10,"Enter the time-limit :$" mtime dw ? cnt dw 0 word1 db "pneumonoultramicroscopicsilicovolcanoconiosis$" dis_wrd db 45 dup("_"),"$" wrd_len db 45 data ends print macro str ;to print the string lea dx,str mov ah,09h int 21h endm ring macro bell mov dl,bell mov ah,02h int 21h endm type macro num mov dl,num mov ah,02h int 21h endm scan macro str ; read a string from keyboard and return to al lea dx,str mov ah,0ah int 21h endm check macro lives,errors,word_size,hits mov bl,lives mov bh,errors cmp bl,bh je game_over mov bl,word_size mov bh,hits cmp bl,bh je game_win endm check1 macro lives,errors,word_size,hits mov bl,lives mov bh,errors cmp bl,bh je game_over1 mov bl,word_size mov bh,hits cmp bl,bh je game_win1 endm check2 macro lives,errors,word_size,hits mov bl,lives mov bh,errors cmp bl,bh je game_over2 mov bl,word_size mov bh,hits cmp bl,bh je game_win2 endm update macro word,discovered_word,hits,errors LOCAL update_loop,increment,equals,end_word,end_update ; note: while using macros need to do that if we are calling macros in repeatitions lea si,word lea di,discovered_word mov bx,0 update_loop: cmp ds:[si],"$" je end_word ; check if letter is already taken cmp ds:[di],al je increment ; check if letter is on the word cmp ds:[si],al je equals increment: inc si inc di jmp update_loop equals: mov ds:[di],al inc hits mov bx,1 jmp increment end_word: cmp bx,1 je end_update inc errors end_update: endm code segment start: ; set segment registers mov ax,data mov ds,ax main: print welcome ; main mov cx,500 lp: loop lp call clear_screen print welcome_message print mode_sel print sel_opt call read_keyboard cmp al,'1' je main_loop cmp al,'2' je main_loop2 cmp al,'3' je rapid cmp al,'4' je time main_loop: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print discovered_word print new_line print new_line check lives,errors,word_size,hits print type_message call read_keyboard update word,discovered_word,hits,errors ring bell call clear_screen loop main_loop main_loop2: call clear_screen ; first player details print welcome_message print msg_fplname scan fplname print msg1 print fplname+2 print msg_topic scan topic1 print msg_fplword scan fplword mov bl,fplword+1 ;add bl,30h mov fplword_len,bl xor cx,cx ; to create dicovered word of first player with "-" mov cl,fplword_len lea si,dis_fplword l1: mov al,'_' mov [si],al inc si loop l1 call clear_screen ; second player details print welcome_message print msg_splname scan splname print msg2 print splname+2 print msg_topic scan topic2 print msg_splword scan splword xor cx,cx mov bl,splword+1 ; to store the int value in variable ;add bl,30h ; add will give ascii value of 4 mov splword_len,bl mov cl,splword_len lea si,dis_splword l2: mov al,'_' mov [si],al inc si loop l2 fpl: call clear_screen print welcome_message print msg_fpl print msg_topics print topic1+2 print new_line print new_line print msg_lives mov bl,5h sub bl,fp_errors add bl,30h type bl print new_line print new_line print dis_splword print new_line print new_line check1 fp_lives,fp_errors,splword_len,fp_hits print type_message call read_keyboard update splword+2,dis_splword,fp_hits,fp_errors ring bell call clear_screen loop fpl spl: call clear_screen print welcome_message print msg_spl print msg_topics print topic2+2 print new_line print new_line print msg_lives mov bl,5h sub bl,sp_errors add bl,30h type bl print new_line print new_line print dis_fplword print new_line print new_line check2 sp_lives,sp_errors,fplword_len,sp_hits print type_message call read_keyboard update fplword+2,dis_fplword,sp_hits,sp_errors ring bell call clear_screen loop spl rapid: call clear_screen print welcome_message MOV AH, 00h ; interrupts to get system time INT 1AH ; CX:DX now hold number of clock ticks since midnight mov ax, dx xor dx, dx mov cx, 4 div cx ; here dx contains the remainder of the division - from 0 to 3 mov ch,0FFh ; resetting cx mov cl,0FFh add dl, '0' ; to ascii from '0' to '9' cmp dl,'0' je r0 cmp dl,'1' je r1 cmp dl,'2' je r2 cmp dl,'3' je r3 r0: ; random words in order of 1,2,3,...,10 s1: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str1_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc11 mov bl,str1_size mov bh,hits cmp bl,bh je sc1 print type_message call read_keyboard update string1,str1_dword,hits,errors ring bell loop s1 sc1:inc score sc11:mov hits,0h mov errors,0h s2: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str2_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc22 mov bl,str2_size mov bh,hits cmp bl,bh je sc2 print type_message call read_keyboard update string2,str2_dword,hits,errors ring bell loop s2 sc2:inc score sc22:mov hits,0h mov errors,0h s3: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str3_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc33 mov bl,str3_size mov bh,hits cmp bl,bh je sc3 print type_message call read_keyboard update string3,str3_dword,hits,errors ring bell loop s3 sc3:inc score sc33:mov hits,0h mov errors,0h s4: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str4_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc44 mov bl,str4_size mov bh,hits cmp bl,bh je sc4 print type_message call read_keyboard update string4,str4_dword,hits,errors ring bell loop s4 sc4:inc score sc44:mov hits,0h mov errors,0h s5: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str5_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc55 mov bl,str5_size mov bh,hits cmp bl,bh je sc5 print type_message call read_keyboard update string5,str5_dword,hits,errors ring bell loop s5 sc5:inc score sc55:mov hits,0h mov errors,0h s6: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str6_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc66 mov bl,str6_size mov bh,hits cmp bl,bh je sc6 print type_message call read_keyboard update string6,str6_dword,hits,errors ring bell loop s6 sc6:inc score sc66:mov hits,0h mov errors,0h s7: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str7_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc77 mov bl,str7_size mov bh,hits cmp bl,bh je sc7 print type_message call read_keyboard update string7,str7_dword,hits,errors ring bell loop s7 sc7:inc score sc77:mov hits,0h mov errors,0h s8: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str8_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc88 mov bl,str8_size mov bh,hits cmp bl,bh je sc8 print type_message call read_keyboard update string8,str8_dword,hits,errors ring bell loop s8 sc8:inc score sc88:mov hits,0h mov errors,0h s9: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str9_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc99 mov bl,str9_size mov bh,hits cmp bl,bh je sc9 print type_message call read_keyboard update string9,str9_dword,hits,errors ring bell loop s9 sc9:inc score sc99:mov hits,0h mov errors,0h s10:call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str10_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc00 mov bl,str10_size mov bh,hits cmp bl,bh je sc0 print type_message call read_keyboard update string10,str10_dword,hits,errors ring bell loop s10 sc0:inc score sc00:mov hits,0h mov errors,0h jmp scoreboard r1: ; random order in 5,2,9,8,7,6,3,10,4,1 s_5: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str5_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_55 mov bl,str5_size mov bh,hits cmp bl,bh je sc_5 print type_message call read_keyboard update string5,str5_dword,hits,errors ring bell loop s_5 sc_5:inc score sc_55:mov hits,0h mov errors,0h s_2: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str2_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_22 mov bl,str2_size mov bh,hits cmp bl,bh je sc_2 print type_message call read_keyboard update string2,str2_dword,hits,errors ring bell loop s_2 sc_2:inc score sc_22:mov hits,0h mov errors,0h s_9: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str9_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_99 mov bl,str9_size mov bh,hits cmp bl,bh je sc_9 print type_message call read_keyboard update string9,str9_dword,hits,errors ring bell loop s_9 sc_9:inc score sc_99:mov hits,0h mov errors,0h s_8: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str8_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_88 mov bl,str8_size mov bh,hits cmp bl,bh je sc_8 print type_message call read_keyboard update string8,str8_dword,hits,errors ring bell loop s_8 sc_8:inc score sc_88:mov hits,0h mov errors,0h s_7: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str7_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_77 mov bl,str7_size mov bh,hits cmp bl,bh je sc_7 print type_message call read_keyboard update string7,str7_dword,hits,errors ring bell loop s_7 sc_7:inc score sc_77:mov hits,0h mov errors,0h s_6: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str6_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_66 mov bl,str6_size mov bh,hits cmp bl,bh je sc_6 print type_message call read_keyboard update string6,str6_dword,hits,errors ring bell loop s_6 sc_6:inc score sc_66:mov hits,0h mov errors,0h s_10:call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str10_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_00 mov bl,str10_size mov bh,hits cmp bl,bh je sc_0 print type_message call read_keyboard update string10,str10_dword,hits,errors ring bell loop s_10 s_3: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str3_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_33 mov bl,str3_size mov bh,hits cmp bl,bh je sc_3 print type_message call read_keyboard update string3,str3_dword,hits,errors ring bell loop s_3 sc_3:inc score sc_33:mov hits,0h mov errors,0h sc_0:inc score sc_00:mov hits,0h mov errors,0h s_4: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str4_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_44 mov bl,str4_size mov bh,hits cmp bl,bh je sc_4 print type_message call read_keyboard update string4,str4_dword,hits,errors ring bell loop s_4 sc_4:inc score sc_44:mov hits,0h mov errors,0h s_1: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str1_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc_11 mov bl,str1_size mov bh,hits cmp bl,bh je sc_1 print type_message call read_keyboard update string1,str1_dword,hits,errors ring bell loop s_1 sc_1:inc score sc_11:mov hits,0h mov errors,0h jmp scoreboard r2: ; random order of 7,6,3,2,1,9,4,8,10,5 s\7: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str7_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\77 mov bl,str7_size mov bh,hits cmp bl,bh je sc\7 print type_message call read_keyboard update string7,str7_dword,hits,errors ring bell loop s\7 sc\7:inc score sc\77:mov hits,0h mov errors,0h s\6: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str6_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\66 mov bl,str6_size mov bh,hits cmp bl,bh je sc\6 print type_message call read_keyboard update string6,str6_dword,hits,errors ring bell loop s\6 sc\6:inc score sc\66:mov hits,0h mov errors,0h s\3: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str3_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\33 mov bl,str3_size mov bh,hits cmp bl,bh je sc\3 print type_message call read_keyboard update string3,str3_dword,hits,errors ring bell loop s\3 sc\3:inc score sc\33:mov hits,0h mov errors,0h s\2: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str2_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\22 mov bl,str2_size mov bh,hits cmp bl,bh je sc\2 print type_message call read_keyboard update string2,str2_dword,hits,errors ring bell loop s\2 sc\2:inc score sc\22:mov hits,0h mov errors,0h s\1: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str1_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\11 mov bl,str1_size mov bh,hits cmp bl,bh je sc\1 print type_message call read_keyboard update string1,str1_dword,hits,errors ring bell loop s\1 sc\1:inc score sc\11:mov hits,0h mov errors,0h s\9: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str9_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\99 mov bl,str9_size mov bh,hits cmp bl,bh je sc\9 print type_message call read_keyboard update string9,str9_dword,hits,errors ring bell loop s\9 sc\9:inc score sc\99:mov hits,0h mov errors,0h s\4: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str4_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\44 mov bl,str4_size mov bh,hits cmp bl,bh je sc\4 print type_message call read_keyboard update string4,str4_dword,hits,errors ring bell loop s\4 sc\4:inc score sc\44:mov hits,0h mov errors,0h s\8: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str8_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\88 mov bl,str8_size mov bh,hits cmp bl,bh je sc\8 print type_message call read_keyboard update string8,str8_dword,hits,errors ring bell loop s\8 sc\8:inc score sc\88:mov hits,0h mov errors,0h s\10:call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str10_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\00 mov bl,str10_size mov bh,hits cmp bl,bh je sc\0 print type_message call read_keyboard update string10,str10_dword,hits,errors ring bell loop s\10 sc\0:inc score sc\00:mov hits,0h mov errors,0h s\5: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str5_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc\55 mov bl,str5_size mov bh,hits cmp bl,bh je sc\5 print type_message call read_keyboard update string5,str5_dword,hits,errors ring bell loop s\5 sc\5:inc score sc\55:mov hits,0h mov errors,0h jmp scoreboard r3: ; random order of 9,3,10,7,1,6,8,5,2,4 s`9: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str9_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`99 mov bl,str9_size mov bh,hits cmp bl,bh je sc`9 print type_message call read_keyboard update string9,str9_dword,hits,errors ring bell loop s`9 sc`9:inc score sc`99:mov hits,0h mov errors,0h s`3: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str3_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`33 mov bl,str3_size mov bh,hits cmp bl,bh je sc`3 print type_message call read_keyboard update string3,str3_dword,hits,errors ring bell loop s`3 sc`3:inc score sc`33:mov hits,0h mov errors,0h s`10:call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str10_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`00 mov bl,str10_size mov bh,hits cmp bl,bh je sc`0 print type_message call read_keyboard update string10,str10_dword,hits,errors ring bell loop s`10 sc`0:inc score sc`00:mov hits,0h mov errors,0h s`7: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str7_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`77 mov bl,str7_size mov bh,hits cmp bl,bh je sc`7 print type_message call read_keyboard update string7,str7_dword,hits,errors ring bell loop s`7 sc`7:inc score sc`77:mov hits,0h mov errors,0h s`1: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str1_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`11 mov bl,str1_size mov bh,hits cmp bl,bh je sc`1 print type_message call read_keyboard update string1,str1_dword,hits,errors ring bell loop s`1 sc`1:inc score sc`11:mov hits,0h mov errors,0h s`6: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str6_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`66 mov bl,str6_size mov bh,hits cmp bl,bh je sc`6 print type_message call read_keyboard update string6,str6_dword,hits,errors ring bell loop s`6 sc`6:inc score sc`66:mov hits,0h mov errors,0h s`8: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str8_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`88 mov bl,str8_size mov bh,hits cmp bl,bh je sc`8 print type_message call read_keyboard update string8,str8_dword,hits,errors ring bell loop s`8 sc`8:inc score sc`88:mov hits,0h mov errors,0h s`5: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str5_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`55 mov bl,str5_size mov bh,hits cmp bl,bh je sc`5 print type_message call read_keyboard update string5,str5_dword,hits,errors ring bell loop s`5 sc`5:inc score sc`55:mov hits,0h mov errors,0h s`2: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str2_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`22 mov bl,str2_size mov bh,hits cmp bl,bh je sc`2 print type_message call read_keyboard update string2,str2_dword,hits,errors ring bell loop s`2 sc`2:inc score sc`22:mov hits,0h mov errors,0h s`4: call clear_screen print welcome_message print new_line print new_line print msg_lives mov bl,5h sub bl,errors add bl,30h type bl print new_line print new_line print str4_dword print new_line print new_line mov bl,lives mov bh,errors cmp bl,bh je sc`44 mov bl,str4_size mov bh,hits cmp bl,bh je sc`4 print type_message call read_keyboard update string4,str4_dword,hits,errors ring bell loop s`4 sc`4:inc score sc`44:mov hits,0h mov errors,0h jmp scoreboard time: call clear_screen print welcome_message print msg_time xor ax,ax mov ah,1h int 21h mov bx,60 mul bx mov bx,130 mul bx mov mtime,ax call clear_screen k: print welcome_message print new_line print new_line print new_line print dis_wrd print new_line print new_line mov bl,wrd_len mov bh,hits cmp bl,bh je m print type_message call read_keyboard update word1,dis_wrd,hits,errors ring bell inc cnt call clear_screen loop k m: mov ax,mtime mov bx,cnt cmp ax,bx jge m1 jle m2 m1: print new_line print new_line call game_over m2: print new_line print new_line call game_win game_over: print lose_message jmp fim game_win: print win_message jmp fim game_over1: print lose_message1 mov cx,600 l: loop l jmp spl game_win1: print win_message1 inc fp_score mov cx,600 ll: loop ll jmp spl game_over2: print lose_message1 mov cx,600 l3: loop l3 jmp winner game_win2: print win_message1 inc sp_score mov cx,600 ll1: loop ll1 jmp winner winner: call clear_screen print welcome_message mov bl,fp_score mov cl,sp_score cmp bl,cl je tie jge greater print msg_win1 print fplname+2 jmp fim greater: print msg_win1 print splname+2 jmp fim tie: print tie_message jmp fim scoreboard: call clear_screen print welcome_message print msg_score mov bl,score add bl,30h type bl jmp fim clear_screen: ; get and set video mode mov ah,0fh int 10h mov ah,0 int 10h ret read_keyboard: ; read keyborad and return in al mov ah,01h int 21h ret fim: jmp fim code ends end start
23.570225
150
0.420192
17148332e48ad9a82c007363d7b3dd3b6fdab75c
466
asm
Assembly
chapter04/02-Fill/Fill.asm
TheVainBoy/nand2tetris
fff82a86c39e68698775d238efbd3817cf6e6261
[ "MIT" ]
1
2016-03-04T18:08:41.000Z
2016-03-04T18:08:41.000Z
chapter04/02-Fill/Fill.asm
TheVainBoy/nand2tetris
fff82a86c39e68698775d238efbd3817cf6e6261
[ "MIT" ]
null
null
null
chapter04/02-Fill/Fill.asm
TheVainBoy/nand2tetris
fff82a86c39e68698775d238efbd3817cf6e6261
[ "MIT" ]
null
null
null
@24576 D=A @KEY M=D (KEY-LOOP) @KEY A=M D=M @SET-COLOR-WHITE D;JEQ // SET-COLOUR-BLACK @COLOUR M=-1 @DRAW-SCREEN 0;JMP (SET-COLOR-WHITE) @COLOUR M=0 @DRAW-SCREEN 0;JMP (DRAW-SCREEN) @SCREEN D=A @ADDR M=D @24576 D=A @SCREEN-END M=D (DRAW-LOOP) @ADDR D=M @SCREEN-END D=M-D @KEY-LOOP D;JEQ @COLOUR D=M @ADDR A=M M=D @ADDR M=M+1 @DRAW-LOOP 0;JMP
9.32
23
0.48927
2823a9baf5eb4e29fa8ed2a18d72ddd90fbb2569
604
asm
Assembly
Lab 5/lab5q1.asm
ipsitmantri/EE-337-Microprocessors-Laboratory
47aef5481969bc2c863d01ae22a5a8000e78a6bd
[ "MIT" ]
null
null
null
Lab 5/lab5q1.asm
ipsitmantri/EE-337-Microprocessors-Laboratory
47aef5481969bc2c863d01ae22a5a8000e78a6bd
[ "MIT" ]
null
null
null
Lab 5/lab5q1.asm
ipsitmantri/EE-337-Microprocessors-Laboratory
47aef5481969bc2c863d01ae22a5a8000e78a6bd
[ "MIT" ]
null
null
null
ORG 0H; LJMP MAIN; MAIN: MOV TMOD, #01H; MOV P1, #0FFH; START: MOV A, #20H; LOWER BYTE CPL A; ADD A, #1D; MOV R0, A; MOV A, #4EH; UPPER BYTE ACALL CHECK_CARRY; MOV R2, #200D; CPL P1.4; CPL P1.5; CPL P1.6; CPL P1.7; ACALL DELAY; CPL P1.4; CPL P1.5; CPL P1.6; CPL P1.7; MOV R2, #200D; ACALL DELAY; LJMP START; DELAY: AGAIN: MOV TL0, R0; MOV TH0, R1; SETB TR0; HERE: JNB TF0, HERE; CLR TR0; CLR TF0; DJNZ R2, AGAIN; RET; CHECK_CARRY: CPL A; JNC GO; ADD A, #1D; GO: MOV R1, A; RET; END;
14.731707
30
0.518212
74a61b978bf9161800f6947844e29ad305eb6a3b
903
asm
Assembly
ded32/HashTable/fnv1a_linux.asm
abel1502/mipt_2s
8a493b7c71b8b156ff471308c5ab8f37a1c3f062
[ "MIT" ]
1
2021-04-26T08:43:52.000Z
2021-04-26T08:43:52.000Z
ded32/HashTable/fnv1a_linux.asm
abel1502/mipt_2s
8a493b7c71b8b156ff471308c5ab8f37a1c3f062
[ "MIT" ]
null
null
null
ded32/HashTable/fnv1a_linux.asm
abel1502/mipt_2s
8a493b7c71b8b156ff471308c5ab8f37a1c3f062
[ "MIT" ]
null
null
null
section .text code ; uint64_t fnv1a_64(const char *data, size_t size) global fnv1a_64_asm fnv1a_64_asm: %push fnv1a_64 %define aData rdi %define aSize rsi %define lHash r8 mov lHash, 0CBF29CE484222325h mov r9, 100000001B3h xor rax, rax add rsi, aData ; TODO: Maybe (especially since size is constant) we could operate on bigger chunks of memory? .loop: cmp aData, rsi jae .end mov al, [aData] xor lHash, rax imul lHash, r9 inc aData jmp .loop .end: mov rax, lHash ret %pop fnv1a_64 ; extern "C" uint64_t crc32_asm(const char *data, size_t size); global crc32_asm crc32_asm: %push crc32_asm xor rax, rax crc32 rax, qword [rdi] crc32 rax, qword [rdi+8h] crc32 rax, qword [rdi+10h] crc32 rax, qword [rdi+18h] crc32 rax, qword [rdi+20h] crc32 rax, qword [rdi+28h] crc32 rax, qword [rdi+30h] crc32 rax, qword [rdi+38h] ret %pop crc32_asm
17.365385
94
0.693245
3afe1ff4d544fcb1e44b9deac4d60ac5fb8dea36
153
asm
Assembly
other.7z/SFC.7z/SFC/ソースデータ/srd13-SFCマリオコレクション/export/mario-z/linkp/mario_n3/mn_hp_mr3bg2st.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/srd13-SFCマリオコレクション/export/mario-z/linkp/mario_n3/mn_hp_mr3bg2st.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/srd13-SFCマリオコレクション/export/mario-z/linkp/mario_n3/mn_hp_mr3bg2st.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: mn_hp_mr3bg2st.asm Type: file Size: 164792 Last-Modified: '1993-08-27T02:07:08Z' SHA-1: A99E7CCC7DC07CCE382B2A0A4723304C7EAB2919 Description: null
21.857143
47
0.823529
7a1575e1fad84e4b1ecb017f9fa264f88b9c4b24
984
asm
Assembly
samples/SVP_speed_test/macros.asm
jdesiloniz/svpdev
13438d71c9cd45c8f78f9768732c40ddec2548d9
[ "MIT" ]
42
2021-02-09T18:15:27.000Z
2022-03-21T23:51:05.000Z
samples/SVP_tests/macros.asm
jdesiloniz/ssp16asm
13438d71c9cd45c8f78f9768732c40ddec2548d9
[ "MIT" ]
2
2021-02-16T21:07:07.000Z
2021-02-16T21:08:31.000Z
samples/SVP_tests/macros.asm
jdesiloniz/ssp16asm
13438d71c9cd45c8f78f9768732c40ddec2548d9
[ "MIT" ]
3
2021-02-22T08:08:27.000Z
2021-12-22T20:21:07.000Z
;************************************************************** ; VRAM WRITE MACROS ;************************************************************** ; Some utility macros to help generate addresses and commands for ; writing data to video memory, since they're tricky (and ; error prone) to calculate manually. ; The resulting command and address is written to the VDP's ; control port, ready to accept data in the data port. ;************************************************************** ; Set the VRAM (video RAM) address to write to next SetVRAMWrite: macro addr move.l #(vdp_cmd_vram_write)|((\addr)&$3FFF)<<16|(\addr)>>14, vdp_control endm ; Set the CRAM (colour RAM) address to write to next SetCRAMWrite: macro addr move.l #(vdp_cmd_cram_write)|((\addr)&$3FFF)<<16|(\addr)>>14, vdp_control endm ; Set the VSRAM (vertical scroll RAM) address to write to next SetVSRAMWrite: macro addr move.l #(vdp_cmd_vsram_write)|((\addr)&$3FFF)<<16|(\addr)>>14, vdp_control endm
41
76
0.591463
4691d9e3f0a791b8649e0cc8026e6917e7890a1a
643
asm
Assembly
T1AA.asm
cecilianogranados96/-AA-Proyecto-0
f7f83fe02533d2342bc9aec80439e6b6e67ce86c
[ "MIT" ]
1
2018-06-17T21:29:20.000Z
2018-06-17T21:29:20.000Z
T1AA.asm
cecilianogranados96/-AA-Proyecto-0
f7f83fe02533d2342bc9aec80439e6b6e67ce86c
[ "MIT" ]
null
null
null
T1AA.asm
cecilianogranados96/-AA-Proyecto-0
f7f83fe02533d2342bc9aec80439e6b6e67ce86c
[ "MIT" ]
null
null
null
global f_vaciaE global f_estandarE global f_antiguaE section .text f_vaciaE: xor eax,eax ; deja en cero eax ret f_estandarE: mov eax, edi ; edi = A, esi = B mul esi ; multiplica A por B ret f_antiguaE: mov edx, edi ; edx = A mov ebx, esi ; ebx = B xor eax, eax ; eax = P BNoEsCero: ; mientras B no sea cero cmp ebx, 0 je BEsCero ; si B es 0 sale del while test ebx, 1 ; Test hace un and con edx con 1 jnz esImpar ; Si es impar va a quedar prendido el bit 1 jmp esPar esImpar: add eax, edx ; P = P + A esPar: add edx, edx ; A = A + A shr ebx, 1 ; B = B/2 jmp BNoEsCero BEsCero: ret
15.682927
57
0.625194
b90db6b13ad273125b60dc90923256177d5fb74c
490
asm
Assembly
program/fibonacci_nth.asm
doowzs/BuggyOS
4138261de7b25bd13ab7d343f3492a4e26939ae3
[ "Naumen", "Condor-1.1", "MS-PL" ]
7
2019-01-02T15:30:10.000Z
2020-12-10T20:15:57.000Z
program/fibonacci_nth.asm
doowzs/BuggyOS
4138261de7b25bd13ab7d343f3492a4e26939ae3
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
program/fibonacci_nth.asm
doowzs/BuggyOS
4138261de7b25bd13ab7d343f3492a4e26939ae3
[ "Naumen", "Condor-1.1", "MS-PL" ]
4
2019-07-18T13:13:01.000Z
2020-12-14T02:41:34.000Z
_init: addi $a0, $zero, 0x7 jal fibonacci j _test_fin fibonacci: #save return addr in stack sw $ra, ($sp) subi $sp, $sp, 0x4 add $t0, $zero, $a0 addi $t1, $zero, 0x0 addi $t2, $zero, 0x1 xor $t3, $t3, $t3 _fibo_loop: beq $t0, $zero, _fido_ret subi $t0, $t0, 0x1 add $t3, $t2, $t1 add $t1, $zero, $t2 add $t2, $zero, $t3 j _fibo_loop #return $t1 _fido_ret: add $v0, $zero, $t1 #recover return addr from stack addi $sp, $sp, 0x4 lw $ra, ($sp) jr $ra _test_fin: addi $s6, $zero, 0x99
13.243243
31
0.636735
df965620531f5b2a036b7809d4131b47cca68adf
603
asm
Assembly
MASM/HelloWorld.asm
secana/Assembler-Examples
4b67a32e702d5456ac00380ca081028c2e8d0baf
[ "Apache-2.0" ]
8
2018-06-02T21:45:08.000Z
2022-03-16T07:35:29.000Z
MASM/HelloWorld.asm
secana/Assembler-Examples
4b67a32e702d5456ac00380ca081028c2e8d0baf
[ "Apache-2.0" ]
null
null
null
MASM/HelloWorld.asm
secana/Assembler-Examples
4b67a32e702d5456ac00380ca081028c2e8d0baf
[ "Apache-2.0" ]
7
2017-12-05T16:51:23.000Z
2021-03-15T23:01:08.000Z
; Assemble.bat HelloWorldConsole.asm ; general options .386 ; CPU architecture .model flat,stdcall ; Use stdcall calling convention option casemap:none ; Be case sensitive ; Inlcude header include \masm32\include\windows.inc include \masm32\include\masm32.inc include \masm32\include\kernel32.inc ; Include libraries includelib \masm32\lib\kernel32.lib includelib \masm32\lib\masm32.lib ; Data section .data szText db "Hello World",10,0 ; 10 = LF, 0 = Zero terminated string (sz) ; Code section .code start: push offset szText call StdOut push 0 call ExitProcess end start
20.793103
72
0.749585
4ea45a8fb239915175f7b6ac7d806093a5baba0a
704
asm
Assembly
oeis/265/A265028.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/265/A265028.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/265/A265028.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A265028: First differences of A264618. ; Submitted by Stefano Spezia ; 5,12,10,38,20,14,20,138,40,28,40,22,40,28,40,530,80,56,80,44,80,56,80,38,80,56,80,44,80,56,80,2082,160,112,160,88,160,112,160,76,160,112,160,88,160,112,160,70,160,112,160,88,160,112,160,76,160,112,160,88,160,112,160,8258,320,224,320,176,320,224,320,152,320,224,320,176,320,224,320,140,320,224,320,176,320,224,320,152,320,224,320,176,320,224,320,134,320,224,320,176 mov $2,$0 mov $3,2 lpb $3 mov $0,$2 sub $3,1 add $0,$3 max $0,0 seq $0,264618 ; Working in binary, write n followed by 0 then n-reversed (including leading zeros); show result in base 10. add $1,$4 mov $4,$0 lpe min $2,1 mul $2,$4 sub $1,$2 mov $0,$1
35.2
366
0.684659
e319437570239a81de3e0703c3c8df1f008ddf4c
990
asm
Assembly
libsrc/_DEVELOPMENT/alloc/malloc/z80/asm_malloc_unlocked.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/alloc/malloc/z80/asm_malloc_unlocked.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/alloc/malloc/z80/asm_malloc_unlocked.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; =============================================================== ; Dec 2013 ; =============================================================== ; ; void *malloc_unlocked(size_t size) ; ; Allocate size bytes from the current thread's heap, returning ; ptr to the allocated memory or 0 with carry set on failure. ; ; Returns 0 if size == 0 without indicating error. ; ; =============================================================== SECTION code_alloc_malloc PUBLIC asm_malloc_unlocked EXTERN __malloc_heap EXTERN asm_heap_alloc_unlocked asm_malloc_unlocked: ; Allocate memory from the thread's default heap without locking ; ; enter : hl = size ; ; exit : success ; ; hl = address of allocated memory, 0 if size == 0 ; carry reset ; ; fail on insufficient memory ; ; hl = 0 ; carry set, errno = ENOMEM ; ; uses : af, bc, de, hl ld de,(__malloc_heap) jp asm_heap_alloc_unlocked
23.023256
67
0.511111
34d2abb35ae605e052f1ae54302208e0378a7fdd
6,082
asm
Assembly
Aurora/Aurora/x64/Debug/vm_backdoor.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
8
2021-07-19T04:46:35.000Z
2022-03-12T17:56:00.000Z
Aurora/Aurora/x64/Debug/vm_backdoor.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
null
null
null
Aurora/Aurora/x64/Debug/vm_backdoor.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
null
null
null
; Listing generated by Microsoft (R) Optimizing Compiler Version 17.00.50727.1 include listing.inc INCLUDELIB LIBCMT INCLUDELIB OLDNAMES _BSS SEGMENT vmware_aware DB 01H DUP (?) _BSS ENDS PUBLIC ?vm_backdoor_mouse_init@@YAX_N@Z ; vm_backdoor_mouse_init PUBLIC ?vmbackdoor_mouse_get_packet@@YA_NPEAU_mouse_packet_@@@Z ; vmbackdoor_mouse_get_packet PUBLIC ?vmbackdoor_mouse_aware@@YA_NXZ ; vmbackdoor_mouse_aware EXTRN vm_backdoor_in:PROC EXTRN vm_backdoor_get_ecx:PROC EXTRN vm_backdoor_get_edx:PROC EXTRN vm_backdoor_get_ebx:PROC pdata SEGMENT $pdata$?vm_backdoor_mouse_init@@YAX_N@Z DD imagerel $LN7 DD imagerel $LN7+162 DD imagerel $unwind$?vm_backdoor_mouse_init@@YAX_N@Z $pdata$?vmbackdoor_mouse_get_packet@@YA_NPEAU_mouse_packet_@@@Z DD imagerel $LN6 DD imagerel $LN6+189 DD imagerel $unwind$?vmbackdoor_mouse_get_packet@@YA_NPEAU_mouse_packet_@@@Z pdata ENDS xdata SEGMENT $unwind$?vm_backdoor_mouse_init@@YAX_N@Z DD 010801H DD 06208H $unwind$?vmbackdoor_mouse_get_packet@@YA_NPEAU_mouse_packet_@@@Z DD 010901H DD 06209H xdata ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\vm_backdoor.cpp _TEXT SEGMENT ?vmbackdoor_mouse_aware@@YA_NXZ PROC ; vmbackdoor_mouse_aware ; 73 : return vmware_aware; movzx eax, BYTE PTR vmware_aware ; 74 : } ret 0 ?vmbackdoor_mouse_aware@@YA_NXZ ENDP ; vmbackdoor_mouse_aware _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\vm_backdoor.cpp _TEXT SEGMENT eax$ = 32 ecx$ = 36 words_to_read$1 = 40 packet$ = 64 ?vmbackdoor_mouse_get_packet@@YA_NPEAU_mouse_packet_@@@Z PROC ; vmbackdoor_mouse_get_packet ; 42 : bool vmbackdoor_mouse_get_packet (vm_mouse_packet *packet) { $LN6: mov QWORD PTR [rsp+8], rcx sub rsp, 56 ; 00000038H ; 43 : uint32_t eax; ; 44 : eax = vm_backdoor_in (0,BDOOR_CMD_GETVERSION); mov edx, 10 xor ecx, ecx call vm_backdoor_in mov DWORD PTR eax$[rsp], eax ; 45 : uint32_t ecx = vm_backdoor_get_ecx(); call vm_backdoor_get_ecx mov DWORD PTR ecx$[rsp], eax ; 46 : if (ecx <= 0x4) { cmp DWORD PTR ecx$[rsp], 4 ja $LN3@vmbackdoor ; 47 : ; 48 : const uint32_t words_to_read = 4; mov DWORD PTR words_to_read$1[rsp], 4 ; 49 : ; 50 : eax = vm_backdoor_in (0,BDOOR_CMD_ABSPOINTER_STATUS); mov edx, 40 ; 00000028H xor ecx, ecx call vm_backdoor_in mov DWORD PTR eax$[rsp], eax ; 51 : ; 52 : if ((eax & 0x0000ffff) < words_to_read) { mov eax, DWORD PTR eax$[rsp] and eax, 65535 ; 0000ffffH cmp eax, 4 jae SHORT $LN2@vmbackdoor ; 53 : //printf ("No Mouse packet available\n"); ; 54 : return false; xor al, al jmp SHORT $LN4@vmbackdoor $LN2@vmbackdoor: ; 55 : } ; 56 : ; 57 : eax = vm_backdoor_in (words_to_read, BDOOR_CMD_ABSPOINTER_DATA); mov edx, 39 ; 00000027H mov ecx, 4 call vm_backdoor_in mov DWORD PTR eax$[rsp], eax ; 58 : ; 59 : packet->x = vm_backdoor_get_ebx(); call vm_backdoor_get_ebx mov rcx, QWORD PTR packet$[rsp] mov DWORD PTR [rcx+8], eax ; 60 : packet->y = vm_backdoor_get_ecx(); call vm_backdoor_get_ecx mov rcx, QWORD PTR packet$[rsp] mov DWORD PTR [rcx+12], eax ; 61 : packet->z = vm_backdoor_get_edx(); call vm_backdoor_get_edx mov rcx, QWORD PTR packet$[rsp] mov DWORD PTR [rcx+16], eax ; 62 : packet->flags = eax >> 16; mov eax, DWORD PTR eax$[rsp] shr eax, 16 mov rcx, QWORD PTR packet$[rsp] mov DWORD PTR [rcx], eax ; 63 : packet->buttons = eax & 0xFFFF; mov eax, DWORD PTR eax$[rsp] and eax, 65535 ; 0000ffffH mov rcx, QWORD PTR packet$[rsp] mov DWORD PTR [rcx+4], eax ; 64 : ; 65 : return true; mov al, 1 jmp SHORT $LN4@vmbackdoor ; 66 : } ; 67 : else jmp SHORT $LN1@vmbackdoor $LN3@vmbackdoor: ; 68 : return false; xor al, al $LN1@vmbackdoor: $LN4@vmbackdoor: ; 69 : } add rsp, 56 ; 00000038H ret 0 ?vmbackdoor_mouse_get_packet@@YA_NPEAU_mouse_packet_@@@Z ENDP ; vmbackdoor_mouse_get_packet _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\vm_backdoor.cpp _TEXT SEGMENT eax$ = 32 tv84 = 36 ecx$ = 40 absolute$ = 64 ?vm_backdoor_mouse_init@@YAX_N@Z PROC ; vm_backdoor_mouse_init ; 24 : void vm_backdoor_mouse_init (bool absolute) { $LN7: mov BYTE PTR [rsp+8], cl sub rsp, 56 ; 00000038H ; 25 : uint32_t eax; ; 26 : eax = vm_backdoor_in (0,BDOOR_CMD_GETVERSION); mov edx, 10 xor ecx, ecx call vm_backdoor_in mov DWORD PTR eax$[rsp], eax ; 27 : uint32_t ecx = vm_backdoor_get_ecx(); call vm_backdoor_get_ecx mov DWORD PTR ecx$[rsp], eax ; 28 : if (ecx <= 0x4) { cmp DWORD PTR ecx$[rsp], 4 ja SHORT $LN2@vm_backdoo ; 29 : vmware_aware = true; mov BYTE PTR vmware_aware, 1 $LN2@vm_backdoo: ; 30 : } ; 31 : ; 32 : if (vmware_aware){ movzx eax, BYTE PTR vmware_aware test eax, eax je SHORT $LN1@vm_backdoo ; 33 : eax = vm_backdoor_in (VMMOUSE_CMD_READ_ID,BDOOR_CMD_ABSPOINTER_COMMAND); mov edx, 41 ; 00000029H mov ecx, 1161905490 ; 45414552H call vm_backdoor_in mov DWORD PTR eax$[rsp], eax ; 34 : eax = vm_backdoor_in (0, BDOOR_CMD_ABSPOINTER_STATUS); mov edx, 40 ; 00000028H xor ecx, ecx call vm_backdoor_in mov DWORD PTR eax$[rsp], eax ; 35 : eax = vm_backdoor_in(1, BDOOR_CMD_ABSPOINTER_DATA); mov edx, 39 ; 00000027H mov ecx, 1 call vm_backdoor_in mov DWORD PTR eax$[rsp], eax ; 36 : eax = vm_backdoor_in (absolute ? VMMOUSE_CMD_REQUEST_ABSOLUTE : VMMOUSE_CMD_REQUEST_RELATIVE, ; 37 : BDOOR_CMD_ABSPOINTER_COMMAND); movzx eax, BYTE PTR absolute$[rsp] test eax, eax je SHORT $LN5@vm_backdoo mov DWORD PTR tv84[rsp], 1396851026 ; 53424152H jmp SHORT $LN6@vm_backdoo $LN5@vm_backdoo: mov DWORD PTR tv84[rsp], 1279611474 ; 4c455252H $LN6@vm_backdoo: mov edx, 41 ; 00000029H mov ecx, DWORD PTR tv84[rsp] call vm_backdoor_in mov DWORD PTR eax$[rsp], eax $LN1@vm_backdoo: ; 38 : } ; 39 : } add rsp, 56 ; 00000038H ret 0 ?vm_backdoor_mouse_init@@YAX_N@Z ENDP ; vm_backdoor_mouse_init _TEXT ENDS END
22.950943
103
0.710293
d8d0ad99be79755dd48d18deb8f2cd129ce85e30
205
asm
Assembly
libsrc/_DEVELOPMENT/arch/zxn/memory/c/sdcc/zxn_read_mmu_state_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zxn/memory/c/sdcc/zxn_read_mmu_state_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zxn/memory/c/sdcc/zxn_read_mmu_state_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void zxn_read_mmu_state(uint8_t *dst) SECTION code_clib SECTION code_arch PUBLIC _zxn_read_mmu_state_fastcall EXTERN asm_zxn_read_mmu_state defc _zxn_read_mmu_state_fastcall = asm_zxn_read_mmu_state
18.636364
58
0.878049
a1a8cdea89181e2cc5fbc63a17ffb23842d5de11
1,904
asm
Assembly
programs/oeis/239/A239024.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/239/A239024.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/239/A239024.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A239024: Number of n X 2 0..2 arrays with no element equal to the sum of elements to its left or one plus the sum of elements above it, modulo 3. ; 1,3,4,11,16,43,64,171,256,683,1024,2731,4096,10923,16384,43691,65536,174763,262144,699051,1048576,2796203,4194304,11184811,16777216,44739243,67108864,178956971,268435456,715827883,1073741824,2863311531,4294967296,11453246123,17179869184,45812984491,68719476736,183251937963,274877906944,733007751851,1099511627776,2932031007403,4398046511104,11728124029611,17592186044416,46912496118443,70368744177664,187649984473771,281474976710656,750599937895083,1125899906842624,3002399751580331,4503599627370496,12009599006321323,18014398509481984,48038396025285291,72057594037927936,192153584101141163,288230376151711744,768614336404564651,1152921504606846976,3074457345618258603,4611686018427387904,12297829382473034411,18446744073709551616,49191317529892137643,73786976294838206464,196765270119568550571,295147905179352825856,787061080478274202283,1180591620717411303424,3148244321913096809131,4722366482869645213696,12592977287652387236523,18889465931478580854784,50371909150609548946091,75557863725914323419136,201487636602438195784363,302231454903657293676544,805950546409752783137451,1208925819614629174706176,3223802185639011132549803,4835703278458516698824704,12895208742556044530199211,19342813113834066795298816,51580834970224178120796843,77371252455336267181195264,206323339880896712483187371,309485009821345068724781056,825293359523586849932749483,1237940039285380274899124224,3301173438094347399730997931,4951760157141521099596496896,13204693752377389598923991723,19807040628566084398385987584,52818775009509558395695966891,79228162514264337593543950336,211275100038038233582783867563,316912650057057350374175801344,845100400152152934331135470251 add $0,1 lpb $0 mov $1,$0 sub $0,2 add $2,2 mul $2,4 lpe mul $1,$2 div $1,8 add $1,1 mov $0,$1
126.933333
1,651
0.89916
2c7456a08ac0e4d8d6132c351fb99854bc94fa41
722
asm
Assembly
oeis/291/A291703.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/291/A291703.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/291/A291703.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A291703: Number of connected dominating sets in the complete tripartite graph K_{n,n,n}. ; Submitted by Stefano Spezia ; 7,54,490,4050,32674,261954,2096770,16776450,134216194,1073738754,8589928450,68719464450,549755789314,4398046461954,35184371990530,281474976514050,2251799813292034,18014398508695554,144115188074283010,1152921504603701250,9223372036848484354,73786976294825623554,590295810358680485890,4722366482869594882050,37778931862957061046274,302231454903657092349954,2417851639229257946759170,19342813113834065989992450,154742504910672532751777794,1237940039285380271677898754,9903520314283042192750542850 mov $1,8 pow $1,$0 mov $2,2 pow $2,$0 sub $1,$2 mov $0,$1 mul $0,4 add $0,$2 mul $0,2 trn $0,5 add $0,7
45.125
495
0.84903
bdfa5ea773fa6167b86775aaaa0ff513c8c69fab
4,543
asm
Assembly
bootloader.asm
TralahM/explore_asm
f86eab170f1dd38050af379ecd857610d7bfa138
[ "MIT" ]
2
2020-03-06T00:10:44.000Z
2022-02-24T02:04:55.000Z
bootloader.asm
TralahM/explore_asm
f86eab170f1dd38050af379ecd857610d7bfa138
[ "MIT" ]
null
null
null
bootloader.asm
TralahM/explore_asm
f86eab170f1dd38050af379ecd857610d7bfa138
[ "MIT" ]
null
null
null
; inline assembly, line 2 [bits 16] [org 0x7c00] ; [ function: start() ] start: push ebp mov ebp, esp sub esp, 1 ; allocate space for local variables ; ch = [ebp - 1], byte ; line: 16, func_call: clear_screen call clear_screen ; for loop, line 18 ; line 18 mov al, 65 mov byte[ebp - 1], al .for_loop1: ; condition checking, line 18 cmp byte[ebp - 1], 90 jg .exit_for_loop1 ; line 19 mov al, byte[ebp - 1] ; assignment ch mov byte[pchar], al ; line: 20, func_call: print_char call print_char ; line 18 inc byte[ebp - 1] ; ++ jmp .for_loop1 ; jmp to for loop .exit_for_loop1: ; line: 23, func_call: goto_newline call goto_newline ; line 25 mov al, 84 mov byte[vbuffer], al ; line 26 mov al, 121 mov byte[vbuffer + 1], al ; line 27 mov al, 112 mov byte[vbuffer + 2], al ; line 28 mov al, 101 mov byte[vbuffer + 3], al ; line 29 mov al, 58 mov byte[vbuffer + 4], al ; line 30 mov eax, 0 mov byte[vbuffer + 5], al ; line: 32, func_call: print_array call print_array ; line: 33, func_call: goto_newline call goto_newline ; line: 33, func_call: goto_newline call goto_newline ; line: 35, func_call: input_test call input_test ._exit_start: mov esp, ebp pop ebp ret ; [ function: print_array() ] print_array: push ebp mov ebp, esp sub esp, 1 ; allocate space for local variables ; i = [ebp - 1], byte ; for loop, line 40 ; line 40 mov eax, 0 mov byte[ebp - 1], al .for_loop1: ; condition checking, line 40 cmp byte[ebp - 1], 32 jge .exit_for_loop1 ; line 41 xor ecx, ecx mov cl, byte[ebp - 1] mov al, byte[vbuffer + ecx * 1] mov byte[pchar], al ; line: 41 ; condition checking, line 42 cmp byte[pchar], 0 je .if_label1 jmp .else_label1 .if_label1: jmp .exit_for_loop1 ; break loop, line 43 jmp .exit_if1 .else_label1: ; line: 45, func_call: print_char call print_char .exit_if1: ; line 40 inc byte[ebp - 1] ; ++ jmp .for_loop1 ; jmp to for loop .exit_for_loop1: ._exit_print_array: mov esp, ebp pop ebp ret ; [ function: input_test() ] input_test: push ebp mov ebp, esp sub esp, 3 ; allocate space for local variables ; key_code = [ebp - 3], byte ; key = [ebp - 2], word ; while loop, line 56 .while_loop1: ; condition checking, line 56 ; line: 57, func_call: read_key call read_key mov dword[ebp - 2], eax ; line: 57, assign ; cast expression, line 58 mov al, byte[ebp - 2] mov byte[pchar], al ; line: 58 ; line 59 xor eax, eax xor edx, edx mov eax, dword[ebp - 2] ; key mov ebx, 240 and eax, ebx mov word[ebp - 2], ax ; line 60 mov ax, word[ebp - 2] ; assignment key mov byte[ebp - 3], al ; condition checking, line 61 mov al, byte[enter_key] cmp byte[ebp - 3], al je .if_label1 jmp .else_label1 .if_label1: ; line: 62, func_call: goto_newline call goto_newline jmp .exit_if1 .else_label1: ; line: 64, func_call: print_char call print_char .exit_if1: jmp .while_loop1 ; jmp to while loop .exit_while_loop1: ._exit_input_test: mov esp, ebp pop ebp ret ; [ function: goto_newline() ] goto_newline: push ebp mov ebp, esp ; line 70 inc byte[y_pos] ; ++ ; line 71 mov eax, 0 mov byte[x_pos], al ; line: 72, func_call: gotoxy call gotoxy ._exit_goto_newline: mov esp, ebp pop ebp ret ; [ function: read_key() ] read_key: push ebp mov ebp, esp ; inline assembly, line 79 mov ax,0x00 int 0x16 ._exit_read_key: mov esp, ebp pop ebp ret ; [ function: gotoxy() ] gotoxy: push ebp mov ebp, esp ; inline assembly, line 86 mov ah, 0x02 mov bh, 0x00 mov dl, byte[x_pos] mov dh, byte[y_pos] int 0x10 ._exit_gotoxy: mov esp, ebp pop ebp ret ; [ function: print_char() ] print_char: push ebp mov ebp, esp ; inline assembly, line 97 xor bx, bx mov bl, 10 mov al, byte[pchar] mov ah, 0x0E int 0x10 ._exit_print_char: mov esp, ebp pop ebp ret ; [ function: clear_screen() ] clear_screen: push ebp mov ebp, esp ; inline assembly, line 107 mov al, 2 mov ah, 0 int 0x10 ._exit_clear_screen: mov esp, ebp pop ebp ret ; inline assembly, line 114 times (510 - ($ - $$)) db 0x00 dw 0xAA55 section .data pchar db 0 enter_key db 0x1c section .bss vbuffer resb 32 x_pos resb 1 y_pos resb 1
20.28125
54
0.616333
20c46a30ff679328357d8ad08891e418868ca2f9
460
asm
Assembly
AlgorithmsFromTheBook/multiplication.asm
MateoParrado/AlgorithmsFromTheBook
7062cfea0822070970c1ab373a34fb56b1f54a2b
[ "MIT" ]
null
null
null
AlgorithmsFromTheBook/multiplication.asm
MateoParrado/AlgorithmsFromTheBook
7062cfea0822070970c1ab373a34fb56b1f54a2b
[ "MIT" ]
null
null
null
AlgorithmsFromTheBook/multiplication.asm
MateoParrado/AlgorithmsFromTheBook
7062cfea0822070970c1ab373a34fb56b1f54a2b
[ "MIT" ]
1
2020-06-08T22:02:25.000Z
2020-06-08T22:02:25.000Z
PUBLIC asm_multiply .386 .model flat, c .code asm_multiply PROC ;get the two parameters, put one in ebc and the other in edx push ebp mov ebp, esp mov ebx, [ebp + 8] mov edx, [ebp + TYPE DWORD + 8] mov eax, 0 mov cl, 31 Redo: ;if ecx is zero, youre done cmp edx, 0 jne notZero pop ebp ret notZero: test edx, 80000000h jz shift mov esi, [ebp + 8] shl esi, cl add eax, esi shift: shl edx, 1 dec cl jmp redo asm_multiply ENDP end
10.454545
61
0.665217
044b2e6565d7f2847baff801885c49f875582375
744
asm
Assembly
programs/oeis/292/A292246.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/292/A292246.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/292/A292246.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A292246: Base-2 expansion of a(n) encodes the steps where numbers of the form 3k+2 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n. ; 0,1,0,2,3,0,4,1,2,14,5,12,6,7,8,2,1,0,0,9,26,22,3,20,6,5,16,10,29,10,4,11,30,2,25,60,56,13,28,54,15,48,24,17,44,8,5,12,38,3,30,26,1,24,20,1,18,6,19,62,14,53,4,14,45,0,42,7,124,118,41,50,58,13,116,106,11,40,104,33,32,98,21,92,6,59,88,18,21,82,76,9,34,36,23,74,64,61,62,58 mul $0,2 seq $0,64989 ; Multiplicative with a(2^e) = 1 and a(p^e) = prevprime(p)^e for odd primes p. seq $0,261693 ; Irregular triangle read by rows in which row n lists the positive odd numbers in decreasing order starting with 2^n - 1. T(0, 1) = 0 and T(n, k) for n >= 1, 1 <= k <= 2^(n-1). div $0,2
93
272
0.662634
bc60242ce73ecf98964d6dbdd97eda219e90bfe4
1,191
asm
Assembly
programs/oeis/032/A032378.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/032/A032378.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/032/A032378.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A032378: Noncubes such that n is divisible by floor(n^(1/3)). ; 2,3,4,5,6,7,10,12,14,16,18,20,22,24,26,30,33,36,39,42,45,48,51,54,57,60,63,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,222,228,234,240,246,252,258,264,270,276,282,288,294,300,306,312,318,324,330,336,342,350,357,364,371,378,385,392,399,406,413,420,427,434,441,448,455,462,469,476,483,490,497,504,511,520,528,536,544,552,560,568,576,584,592,600,608,616,624,632,640,648,656,664,672,680,688,696,704,712,720,728,738,747,756,765,774,783,792,801,810,819,828,837,846,855,864,873,882,891,900,909,918,927,936,945,954,963,972,981,990,999,1010,1020,1030,1040,1050,1060,1070,1080,1090,1100,1110,1120,1130,1140,1150,1160,1170,1180,1190,1200,1210,1220,1230,1240,1250,1260,1270,1280,1290,1300,1310,1320,1330,1342,1353,1364,1375,1386,1397,1408,1419,1430,1441,1452,1463,1474,1485,1496,1507,1518,1529,1540,1551,1562,1573,1584,1595,1606,1617,1628,1639,1650,1661,1672,1683,1694,1705,1716,1727,1740,1752,1764,1776,1788,1800,1812,1824,1836,1848,1860,1872,1884,1896,1908,1920,1932,1944,1956 add $0,1 lpb $0 add $1,$0 sub $0,3 add $1,1 add $2,3 trn $0,$2 lpe
99.25
1,048
0.738035
4c0a66636d5d7f926b6948d9c089214d4e2e535e
1,253
asm
Assembly
Assembly Language/x86 Basic/Lesson_02/Ex002/asm_test.asm
Jasonchan35/SimpleTalkCpp_Tutorial
b193074c25e33e77ce15004a053bcc037054282e
[ "MIT" ]
44
2017-11-08T14:20:55.000Z
2021-03-18T14:22:52.000Z
Assembly Language/x86 Basic/Lesson_02/Ex002/asm_test.asm
Jasonchan35/SimpleTalkCpp_Tutorial
b193074c25e33e77ce15004a053bcc037054282e
[ "MIT" ]
null
null
null
Assembly Language/x86 Basic/Lesson_02/Ex002/asm_test.asm
Jasonchan35/SimpleTalkCpp_Tutorial
b193074c25e33e77ce15004a053bcc037054282e
[ "MIT" ]
19
2017-08-01T12:59:29.000Z
2021-04-11T08:09:59.000Z
.386 ;.model flat, stdcall .model flat, c option casemap :none .data my_msg db "Good Morning", 0 .code my_hello PROTO my_print_int PROTO v0:DWORD, v1:DWORD, v2:DWORD my_print_int_stdcall PROTO stdcall v0:DWORD, v1:DWORD, v2:DWORD ; Obsoleted ; my_print_int__pascal PROTO pascal v0:DWORD, v1:DWORD, v2:DWORD my_print_string PROTO pStr:DWORD MessageBoxA PROTO stdcall arg_hwnd:DWORD, arg_caption:DWORD, arg_msg:DWORD, arg_flag:DWORD my_func PROC mov eax, 1234H call [my_hello] ret my_func ENDP my_func_local_var PROC local v_a[4] : DWORD mov ecx, 0 label0: mov DWORD PTR [v_a + ecx * 4], ecx inc ecx cmp ecx, 4 jl label0 ret my_func_local_var ENDP my_asm_func PROC ;----------- call [my_func] ;----------- call [my_func_local_var] ;----------- push 1 push 2 push 3 call [my_print_int] add esp, 12; caller cleans the stack after the call ;----------- invoke my_print_int, 4, 5, 6 ;----------- push 1 push 2 push 3 call [my_print_int_stdcall] ;----------- invoke my_print_int_stdcall, 4, 5, 6 ;----------- invoke my_print_string, addr my_msg ;----------- invoke MessageBoxA, 0, addr my_msg, 0, 0 ret my_asm_func ENDP END
15.860759
91
0.635275
7d0048cc18a30f5d971c748e9bb9f8736cfb4324
7,674
asm
Assembly
Transynther/x86/_processed/US/_st_4k_sm_/i7-7700_9_0xca.log_21829_1008.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_st_4k_sm_/i7-7700_9_0xca.log_21829_1008.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_st_4k_sm_/i7-7700_9_0xca.log_21829_1008.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 %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x11262, %rdx nop xor %r12, %r12 vmovups (%rdx), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %rax nop xor $3770, %r14 lea addresses_UC_ht+0xece2, %rsi lea addresses_WT_ht+0x6fca, %rdi nop and $62242, %r9 mov $94, %rcx rep movsq nop nop nop nop nop xor $3439, %rcx lea addresses_A_ht+0x1d46a, %rdx nop nop nop sub $55281, %r9 movb $0x61, (%rdx) nop nop nop xor $62489, %r9 lea addresses_A_ht+0x100c2, %rax nop nop dec %r14 mov $0x6162636465666768, %r12 movq %r12, (%rax) and %rdi, %rdi lea addresses_normal_ht+0x1132c, %rdx nop nop and %rax, %rax mov (%rdx), %rcx nop nop nop inc %rax lea addresses_UC_ht+0x1d242, %r12 nop nop nop nop nop add %r9, %r9 mov (%r12), %rdi nop nop nop nop nop inc %r12 lea addresses_A_ht+0x72c2, %rsi lea addresses_WC_ht+0x14952, %rdi nop cmp %rax, %rax mov $36, %rcx rep movsw sub %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r13 push %r15 push %rdx push %rsi // Store mov $0xc2, %r15 nop nop nop add %r12, %r12 mov $0x5152535455565758, %r11 movq %r11, (%r15) nop nop nop cmp $65168, %r15 // Store lea addresses_RW+0xd4c2, %r15 nop nop nop and $46626, %r13 mov $0x5152535455565758, %r11 movq %r11, %xmm7 vmovups %ymm7, (%r15) nop nop nop nop and $61945, %r10 // Store lea addresses_PSE+0x1f0a, %r10 nop nop nop nop add %r12, %r12 mov $0x5152535455565758, %r11 movq %r11, %xmm2 movups %xmm2, (%r10) nop xor $60358, %r11 // Store lea addresses_A+0x1c3c6, %r10 and %rsi, %rsi movb $0x51, (%r10) nop nop sub $59247, %rdx // Store lea addresses_RW+0xf162, %r12 nop nop nop cmp $61949, %rdx movw $0x5152, (%r12) nop cmp $64316, %rdx // Store lea addresses_US+0x1dcc2, %rdx inc %r10 mov $0x5152535455565758, %r12 movq %r12, %xmm7 movups %xmm7, (%rdx) cmp %r10, %r10 // Load lea addresses_US+0xd572, %r13 xor $58804, %r15 mov (%r13), %r11 nop nop cmp $1306, %r11 // Load lea addresses_normal+0x1c142, %r10 nop nop nop sub $35986, %rdx mov (%r10), %r12 nop nop xor %rsi, %rsi // Faulty Load lea addresses_US+0x1dcc2, %r11 nop nop nop nop nop sub $23902, %rdx movups (%r11), %xmm2 vpextrq $0, %xmm2, %r10 lea oracles, %r15 and $0xff, %r10 shlq $12, %r10 mov (%r15,%r10,1), %r10 pop %rsi pop %rdx pop %r15 pop %r13 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_P'}} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_RW'}} {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_PSE'}} {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A'}} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_RW'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_US'}} {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}} {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
33.077586
2,999
0.651029
e7d4423dde09ae1bc434bcca2e86cd11ab389838
6,197
asm
Assembly
smsq/qxl/comm/messpr.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
smsq/qxl/comm/messpr.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
smsq/qxl/comm/messpr.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; SMS (QXL) Message Processing  1998 Tony Tebby ; 2005.01.10 1.01 added QXL restart (BC) ; 2006.10.01 1.02 added led updates, creates qmp_kbd_llck & uses it (BC) ; 2006.10.20 1.03 BLAT macro definitions commented out - macro wasn't used (wl) section comm xdef qxl_mess_pr xdef qxl_mess_prnext xdef qmp_updt_led xref spp_rxser xref cv_dtmrt xref ioq_pbyt xref kbd_pc84x xref qxl_mess_add xref pt_xmode xref cn_copy_clear include 'dev8_smsq_qxl_keys' include 'dev8_smsq_qxl_comm_keys' include 'dev8_keys_qdos_sms' include 'dev8_keys_sys' include 'dev8_keys_con' include 'dev8_mac_assert' qmp.reg reg d0/d1/a1-a3 * xref blatt *blat macro blv * move.b [blv],-(sp) * jsr blatt * add.w #2,sp * endm * xref blattl *blatl macro blv * move.l [blv],-(sp) * jsr blattl * addq.l #4,sp * endm ;+++ ; This routine processes the messages received ; ; a6 c p system variable base ; ;--- qxl_mess_pr move.l qxl_pcqx_mess,a4 ; messages received qxl_mess_prnext qmp_loop moveq #0,d0 move.b (a4),d0 beq.s qmp_exit move.w qmp_table-1(pc,d0.w),d0 jmp qmp_table(pc,d0.w) qmp_table dc.w qmp_setup-qmp_table ; PC setup $01 dc.w qmp_flow-qmp_table ; Flow control dc.w qmp_rtcu-qmp_table ; RTC dc.w qmp_kbdd-qmp_table ; Keyboard data dc.w qmp_vmack-qmp_table ; Video mode set acknowledge dc.w qmp_rstrt-qmp_table ; QXL restart dc.w qmp_exit-qmp_table ; nop dc.w qmp_exit-qmp_table ; nop dc.w qmp_nop4-qmp_table ; port opened $11 dc.w qmp_nop4-qmp_table ; port closed! dc.w qmp_nop4-qmp_table ; port status dc.w spp_rxser-qmp_table ; rx data dc.w qmp_physr-qmp_table ; physical sector read dc.w qmp_rpfail-qmp_table ; physical sector read failed dc.w qmp_physw-qmp_table ; physical sector written dc.w qmp_wpfail-qmp_table ; physical sector write failed dc.w qmp_exit-qmp_table ; report plug-in $21 dc.w qmp_exit-qmp_table ; message from plug-in dc.w qmp_exit-qmp_table ; channel opened dc.w qmp_exit-qmp_table ; nop dc.w qmp_exit-qmp_table ; data read dc.w qmp_exit-qmp_table ; data read failed dc.w qmp_exit-qmp_table ; data written dc.w qmp_exit-qmp_table ; data write failed dc.w qmp_drivf-qmp_table ; drive formatted $31 dc.w qmp_mouse-qmp_table ; mouse update qmp_exit move.l qxl_pcqx_mess,a4 clr.w (a4) ; unnecessary, but shows that we have done rts qmp_nop4 addq.l #4,a4 bra qmp_loop qmp_setup ; *** do not junk setup messages move.l qxl_message,a5 ; copy message to save area ; tst.b $2817f ; beq.s xx ; blat (a4) ; blatl a5 ;xx move.l (a4)+,qxl_ms_pcset(a5) move.l (a4)+,qxl_ms_pcset+4(a5) bra qmp_loop qmp_flow move.l (a4)+,d1 addq.l #4,a4 move.l qxl_spp_link,d0 ; put ser/par flow control in spp link beq qmp_loop move.l d0,a3 move.l d1,spd_qxlflow(a3) bra qmp_loop qmp_rtcu lea (a4),a1 ; date add.w #1980-qxm.rtcu<<8,(a4) ; adjust year jsr cv_dtmrt ; set date move.l d1,sys_rtc(a6) addq.l #8,a4 bra qmp_loop qmp_kbdd lea (a4),a0 move.w (a0)+,d2 moveq #0,d0 move.b d2,d0 addq.w #5,d0 and.w #$fc,d0 add.l d0,a4 ; next message move.l qxl_kbd_link,d0 beq qmp_loop move.l d0,a3 qmp_kbdloop move.b (a0)+,d0 jsr kbd_pc84x ; convert AT keyboard byte subq.b #1,d2 bne.s qmp_kbdloop bra qmp_loop qmp_vmack addq.l #4,a4 ; next message move.l qxl_scr_work,a2 clr.b qxl_vhold(a2) ; display updates no longer held lea qmp_qrt_flg(pc),a5 tst.b (a5) ; QXL restart? beq qmp_loop ; no cmp.b #ptd.16,qxl_vcolr(a2) ; 16 bit depth? beq qmp_loop ; yes move.l sys_clnk(a6),a3 ; console linkage move.b pt_dmode(a3),d1 jsr pt_xmode lea qmp_kbd_llck(pc),a2 st (a2) ; force led update at restart bsr.s qmp_updt_led sf (a5) ; QXL restart finished bra qmp_loop ;+++ ; This routine sends the qxm.flowqx message when a led update is needed ; ; a6 c p system variable base ; ;--- qmp_updt_led movem.l qmp.reg,-(sp) move.w sys_caps(a6),d0 ; read sys_caps... move.b sys_dfrz(a6),d0 ; ...and sys_dfrz rol.w #1,d0 and.b #$03,d0 lea qmp_kbd_llck(pc),a2 cmp.b (a2),d0 ; status change? beq.s qmp_updt_led_exit ; no move.b d0,(a2) ; save current status move.l qxl_message,a3 lea qxl_ms_flow+qxl_ms_len(a3),a1 move.l #qxm.flowlen<<16+qxm.flowqx<<8,(a1) ; ... msg length and key move.b d0,qxm_fkbd-qxl_ms_len(a1) qmp_updt_led_exit movem.l (sp)+,qmp.reg rts qmp_kbd_llck dc.b $00 ; last kbd lock status qmp_qrt_flg dc.b $00 qmp_rstrt addq.l #4,a4 ; next message lea qmp_qrt_flg(pc),a5 ; QXL restart... st (a5) ; ...in progress move.l qxl_scr_work,a2 ; screen work area st qxl_vhold(a2) ; hold display updates jsr cn_copy_clear move.l qxl_message,a3 ; message area lea qxl_ms_vmode+qxl_ms_len(a3),a1 ; mode message length move.l #4<<16+qxm.vmode<<8,(a1) ; ... message length and key move.b qxl_vcolr(a2),d0 ; internal colour beq.s qrt_sclr ; QL mode subq.b #1,d0 ; VGA mode is one different qrt_sclr move.b d0,qxm_vclr-qxl_ms_len(a1) ; set colour move.b qxl_vsize(a2),d0 bpl.s qrt_ssiz ; QL mode? addq.b #1,d0 ; yes qrt_ssiz move.b d0,qxm_vres-qxl_ms_len(a1) ; set size jsr qxl_mess_add ; add message to queue bra qmp_loop ; ; Physical sector successfully read ; qmp_physr move.l qxl_message,a5 lea qxl_ms_phys(a5),a2 assert qxm_rdata,4 move.l (a4)+,(a2)+ ; the message moveq #512/16-1,d0 qpr_loop move.l (a4)+,(a2)+ move.l (a4)+,(a2)+ move.l (a4)+,(a2)+ move.l (a4)+,(a2)+ dbra d0,qpr_loop qmp_physack tst.b qxl_junk bne qmp_loop ; if junking messages, do not mark it st qxl_ms_len+qxl_ms_phys(a5) ; done flag bra qmp_loop ; ; Physical sector read fail or physical sector write ack ; qmp_rpfail qmp_physw qmp_wpfail move.l qxl_message,a5 move.l (a4)+,qxl_ms_phys(a5) ; the message bra qmp_physack ; ; Format ack ; qmp_drivf move.l qxl_message,a5 lea qxl_ms_phys(a5),a2 move.l (a4)+,(a2)+ ; the message move.l (a4)+,(a2)+ ; the total move.l (a4)+,(a2)+ ; good bra qmp_physack ; ; Mouse update ; qmp_mouse move.l qxl_message,a5 lea qxl_ms_mouse(a5),a2 move.w (a4)+,(a2)+ ; the message and the buttons move.l (a4)+,d0 add.l d0,(a2)+ ; update the totals addq.l #2,a4 ; the spare at the end bra qmp_loop end
22.132143
79
0.702114
7e4ae29e679e69230d1ebe50964a36e43da39e97
8,402
asm
Assembly
src/spawner/statistics.asm
mvdhout1992/ts-patches
a426970abeb6993eea6703d1a756fd74489ffed2
[ "MIT" ]
33
2016-07-30T14:17:28.000Z
2021-12-19T15:45:19.000Z
src/spawner/statistics.asm
A-Productions/ts-patches
326db731f7226d9e803feab475777c730688634e
[ "MIT" ]
73
2018-08-17T00:25:19.000Z
2021-05-10T08:31:15.000Z
src/spawner/statistics.asm
A-Productions/ts-patches
326db731f7226d9e803feab475777c730688634e
[ "MIT" ]
18
2017-05-16T11:28:06.000Z
2022-03-20T20:41:03.000Z
%include "macros/patch.inc" %include "macros/datatypes.inc" %include "TiberianSun.inc" cextern SpawnerActive cextern IsSpectatorArray cextern SpawnLocationsArray @LJMP 0x004BAC2C, _HouseClass__HouseClass_Allocate_UnitTrackerClass_Stuff @LJMP 0x0060A79C, _Send_Statistics_Packet_Write_Statistics_Dump @LJMP 0x005B4333, _sub_5B4290_Send_Statistics_Spawner @LJMP 0x005B1E94, _Queue_AI_Multiplayer_Send_Statistics_Spawner @LJMP 0x00509220, _sub_508A40_Send_Statistics_Spawner1 @LJMP 0x0050927A, _sub_508A40_Send_Statistics_Spawner2 @LJMP 0x005B4FAE, _Execute_DoList_Send_Statistics_Game_Leave @LJMP 0x005B4FD3, _Execute_DoList_Send_Statistics_Game_Leave2 @LJMP 0x00609810, UseInternalMapNameInsteadFilename @LJMP 0x006097FD, AddACCNField @LJMP 0x00609D73, AddMyIdField @LJMP 0x00609F40, _Send_Statistics_Packet_Write_New_Fields section .rdata str_MyIdField db "MYID",0 str_AccountNameField db "ACCN",0 str_stats_dmp: db "stats.dmp",0 str_HASH db "HASH",0 cextern MapHash section .text _Send_Statistics_Packet_Write_New_Fields: push eax lea ecx, [esp+0x18] call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *) ; write 'SPC' mov byte [0x0070FD0C], 0x53 mov byte [0x0070FD0D], 0x50 mov byte [0x0070FD0E], 0x43 ; player number mov byte [0x0070FD0F], bl mov edi, [esi+0x20] ; value mov edi, [IsSpectatorArray+edi*4] push 10h call 0x006B51D7 ; operator new(uint) add esp, 4 test eax, eax jz .new_failed1 push edi push 0x0070FD0C mov ecx, eax call 0x00498A70 ; FieldClass::FieldClass(char *,ulong) jmp short .Write_Alliances .new_failed1: xor eax, eax .Write_Alliances: push eax lea ecx, [esp+0x18] call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *) ; write 'ALY' mov byte [0x0070FD0C], 0x41 mov byte [0x0070FD0D], 0x4c mov byte [0x0070FD0E], 0x59 ; player number mov byte [0x0070FD0F], bl mov edi, [esi+0x578] ; value push 10h call 0x006B51D7 ; operator new(uint) add esp, 4 test eax, eax jz .new_failed2 push edi push 0x0070FD0C mov ecx, eax call 0x00498A70 ; FieldClass::FieldClass(char *,ulong) jmp short .Write_Spawns .new_failed2: xor eax, eax .Write_Spawns: push eax lea ecx, [esp+0x18] call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *) ; write 'SPA' mov byte [0x0070FD0C], 0x53 mov byte [0x0070FD0D], 0x50 mov byte [0x0070FD0E], 0x41 ; player number mov byte [0x0070FD0F], bl mov edi, [esi+0x20] ; value mov edi, [SpawnLocationsArray+edi*4] push 10h call 0x006B51D7 ; operator new(uint) add esp, 4 test eax, eax jz .new_failed3 push edi push 0x0070FD0C mov ecx, eax call 0x00498A70 ; FieldClass::FieldClass(char *,ulong) jmp short .ret .new_failed3: xor eax, eax .ret: ; Reset field name to 'COL' mov byte [0x0070FD0C], 0x43 mov byte [0x0070FD0D], 0x4f mov byte [0x0070FD0E], 0x4c push eax lea ecx, [esp+0x18] jmp 0x00609F45 hack 0x00609825, 0x0060982F _Send_Statistics_Packet_Write_MapHash: push eax lea ecx, [esp+0x18] call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *) push 10h call 0x006B51D7 ; operator new(uint) add esp, 4 test eax, eax jz .new_failed4 push MapHash push str_HASH mov ecx, eax call 0x00498AD0 ; FieldClass::FieldClass(char *, char *) jmp .ret .new_failed4: xor eax, eax .ret: push eax lea ecx, [esp+0x18] call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *) jmp hackend AddMyIdField: add bl, 0x30 mov eax, dword[PlayerPtr] cmp eax, esi jnz .out push 0x10 call 0x006B51D7 ; OperatorNew add esp, 4 test eax, eax jz .fail xor ecx, ecx mov cl, bl sub cl, '0' push ecx push str_MyIdField mov ecx, eax call 0x00498A70 ; FieldClass::FieldClass jmp .noFail .fail: xor eax, eax .noFail: push eax lea ecx, [esp+0x18] call 0x005A22D0 ;PacketClass__Add_Field .out: push 0x10 jmp 0x00609D78 AddACCNField: call 0x005A22D0 push 0x10 call 0x006B51D7 ; OperatorNew add esp, 4 cmp eax, edi je .fail mov ecx, dword[PlayerPtr] lea ecx, [ecx+0x10DE4] ; 0x10DE4 = HC_PLAYER_NAME push ecx push str_AccountNameField mov ecx, eax call 0x00498AD0 ; FieldClass__FieldClass_String jmp .noFail .fail: xor eax, eax .noFail: push eax lea ecx, [esp+0x18] call 0x005A22D0 ;PacketClass__Add_Field jmp 0x00609802 UseInternalMapNameInsteadFilename: mov ecx, dword[0x7E2438] add ecx, 0x904 push ecx jmp 0x00609815 _Execute_DoList_Send_Statistics_Game_Leave2: mov edx, [SessionType] cmp dword [SpawnerActive], 0 jz .Normal_Code cmp dword [SessionType], 0 jz .Normal_Code jmp .Send .Send: jmp 0x005B4FDE .Dont_Send: jmp 0x005B500C .Normal_Code: mov edx, [SessionType] cmp edx, 4 jnz .Dont_Send jmp .Send _Execute_DoList_Send_Statistics_Game_Leave: mov edx, [SessionType] cmp dword [SpawnerActive], 0 jz .Normal_Code cmp dword [SessionType], 0 jz .Normal_Code jmp 0x005B4FB9 .Dont_Send: jmp 0x005B500C .Normal_Code: mov edx, [SessionType] cmp edx, 4 jnz .Dont_Send jmp 0x005B4FB9 _sub_508A40_Send_Statistics_Spawner2: cmp dword [SpawnerActive], 0 jz .Normal_Code cmp dword [SessionType], 0 jz .Normal_Code jmp .Send .Send: jmp 0x00509283 .Dont_Send: jmp 0x005092A5 .Normal_Code: cmp dword [SessionType], 4 jnz .Dont_Send jmp .Send _sub_508A40_Send_Statistics_Spawner1: cmp dword [SpawnerActive], 0 jz .Normal_Code cmp dword [SessionType], 0 jz .Normal_Code jmp .Send .Send: jmp 0x00509229 .Dont_Send: jmp 0x0050924B .Normal_Code: cmp dword [SessionType], 4 jnz .Dont_Send jmp .Send _Queue_AI_Multiplayer_Send_Statistics_Spawner: cmp dword [SpawnerActive], 0 jz .Normal_Code cmp dword [SessionType], 0 jz .Normal_Code jmp .Send .Send: jmp 0x005B1EA0 .Dont_Send: jmp 0x005B1F21 .Normal_Code: cmp dword [SessionType], 4 jnz .Dont_Send jmp .Send _sub_5B4290_Send_Statistics_Spawner: cmp dword [SpawnerActive], 0 jz .Normal_Code cmp dword [SessionType], 0 jz .Normal_Code jmp .Send .Send: jmp 0x005B433C .Dont_Send: jmp 0x005B439F .Normal_Code: cmp dword [SessionType], 4 jnz .Dont_Send jmp .Send _Send_Statistics_Packet_Write_Statistics_Dump: cmp dword [SpawnerActive], 0 jz .Normal_Code call Write_Stats_File mov dword [StatisticsPacketSent], 1 jmp 0x0060A7DF .Normal_Code: mov edx, [0x0080CA48] jmp 0x0060A7A2 Write_Stats_File: push ebp mov ebp, esp %define stats_buf EBP-4 %define stats_length EBP-4-4 %define stats_file EBP-4-4-256 sub esp,4+4+256 lea ebx, [stats_buf] mov [ebx], eax lea ebx,[stats_length] mov edx, [0x0080CA48] ; packet size mov [ebx],edx lea ecx,[stats_file] push str_stats_dmp call FileClass__FileClass push 3 lea ecx, [stats_file] call FileClass__Open test eax, eax je .exit mov ebx, [stats_length] push ebx mov edx,[stats_buf] push edx lea ecx, [stats_file] CALL FileClass__Write lea ecx,[stats_file] CALL FileClass__Close .exit: MOV eax,1 mov esp,ebp pop ebp retn _HouseClass__HouseClass_Allocate_UnitTrackerClass_Stuff: cmp dword [SpawnerActive], 0 jz .Normal_Code cmp dword [SessionType], 0 jz .Normal_Code jmp .Allocate .Normal_Code: jmp .Allocate .Allocate: jmp 0x004BAC39 .Dont_Allocate: jmp 0x004BADB0 %ifdef STATS @SET 0x0042F79E, { cmp eax, 3 } @SET 0x00457E7A, { cmp dword[SessionType], 3 } @SET 0x004C220B, { cmp dword[SessionType], 3 } @SET 0x004C2255, { cmp dword[SessionType], 3 } @SET 0x004C229F, { cmp dword[SessionType], 3 } @SET 0x004C22E5, { cmp dword[SessionType], 3 } @SET 0x0063388A, { cmp dword[SessionType], 3 } @SET 0x006338F4, { cmp dword[SessionType], 3 } @SET 0x0063395C, { cmp dword[SessionType], 3 } @SET 0x00633928, { cmp dword[SessionType], 3 } %endif
19.095455
73
0.676744
3727c1d5d5063570fd15f18c3d3ac3ae922edf19
1,341
asm
Assembly
lib/crt/classic/crt_section_standard.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
lib/crt/classic/crt_section_standard.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
lib/crt/classic/crt_section_standard.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; Classic Memory map and section setup ; ; This layout suits all the classic machines. Memory placement is ; affected by: ; ; CRT_MODEL: RAM/ROM configuration ; CRT_ORG_CODE: Where code starts executing from ; CRT_ORG_BSS: Where uninitialised global variables are placed ; CRT_ORG_GRAPHICS: Where graphics routines + variables are stored (certain ports only) ; ; Contains the generic variables + features ; ; crt_model = 0 ; everything in RAM ; crt_model = 1 ; ROM model, data section copied ; crt_model = 2 ; ROM model, data section compressed (zx7) ; crt_model = 3 ; ROM model, data section compressed (zx0) INCLUDE "crt/classic/crt_section_code.inc" INCLUDE "crt/classic/crt_section_rodata.inc" SECTION ROMABLE_END IF !__crt_model INCLUDE "crt/classic/crt_section_data.inc" ENDIF INCLUDE "crt/classic/crt_section_bss.inc" IF __crt_model > 0 SECTION DATA org -1 defb 0 ; control name of data binary INCLUDE "crt/classic/crt_section_data.inc" ENDIF SECTION BSS_END IF __crt_org_graphics SECTION HIMEM org __crt_org_graphics SECTION smc_clib SECTION code_graphics SECTION code_himem SECTION rodata_graphics SECTION rodata_himem SECTION data_himem SECTION data_graphics SECTION bss_graphics SECTION bss_himem SECTION HIMEM_END ENDIF
25.788462
87
0.743475
b12dac32fab731af0bbc6e518228ffbedaabfd96
6,087
asm
Assembly
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_377.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_377.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_377.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r15 push %r9 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_WT_ht+0x4b6e, %r9 nop nop nop nop xor $46146, %r13 mov $0x6162636465666768, %rax movq %rax, %xmm0 movups %xmm0, (%r9) nop nop nop nop nop dec %rbp lea addresses_D_ht+0x1382e, %rbp clflush (%rbp) nop nop nop nop nop sub %r9, %r9 movups (%rbp), %xmm1 vpextrq $0, %xmm1, %r15 nop nop nop nop add $5822, %rbp lea addresses_WT_ht+0x282e, %r10 sub %rcx, %rcx mov $0x6162636465666768, %r13 movq %r13, %xmm5 and $0xffffffffffffffc0, %r10 movaps %xmm5, (%r10) nop nop nop nop inc %r9 lea addresses_A_ht+0x10a2e, %rsi lea addresses_D_ht+0xaa4e, %rdi nop xor %r9, %r9 mov $82, %rcx rep movsw nop nop nop lfence lea addresses_normal_ht+0xfc1e, %r10 add $38553, %rdi mov $0x6162636465666768, %rax movq %rax, (%r10) nop nop nop dec %rbp lea addresses_normal_ht+0x17576, %rsi lea addresses_normal_ht+0x752e, %rdi clflush (%rdi) nop nop nop xor $40206, %r9 mov $115, %rcx rep movsb nop nop nop nop nop inc %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r15 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r8 push %r9 push %rax push %rdi push %rdx push %rsi // Store lea addresses_WC+0x14c2e, %rdi nop xor %r8, %r8 movb $0x51, (%rdi) xor $59091, %r13 // Store lea addresses_D+0x8c2e, %r8 nop nop inc %rsi mov $0x5152535455565758, %r9 movq %r9, %xmm7 movups %xmm7, (%r8) nop cmp $61002, %rsi // Faulty Load lea addresses_D+0x8c2e, %r8 clflush (%r8) nop nop nop nop add %r9, %r9 mov (%r8), %edi lea oracles, %rdx and $0xff, %rdi shlq $12, %rdi mov (%rdx,%rdi,1), %rdi pop %rsi pop %rdx pop %rdi pop %rax pop %r9 pop %r8 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} {'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 11, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
36.890909
2,999
0.660424
4970202b3974517faf30277722710c283cc5e352
527
asm
Assembly
Examples/ch08/ModSum/_display.asm
satadriver/LiunuxOS
693174ac2b3e503d72782fc7a14f18c8a4f2756c
[ "Apache-2.0" ]
null
null
null
Examples/ch08/ModSum/_display.asm
satadriver/LiunuxOS
693174ac2b3e503d72782fc7a14f18c8a4f2756c
[ "Apache-2.0" ]
null
null
null
Examples/ch08/ModSum/_display.asm
satadriver/LiunuxOS
693174ac2b3e503d72782fc7a14f18c8a4f2756c
[ "Apache-2.0" ]
null
null
null
TITLE DisplaySum Procedure (_display.asm) INCLUDE Sum.inc .code ;----------------------------------------------------- DisplaySum PROC, ptrPrompt:PTR BYTE, ; prompt string theSum:DWORD ; the array sum ; ; Displays the sum on the console. ; Returns: nothing ;----------------------------------------------------- push eax push edx mov edx,ptrPrompt ; pointer to prompt call WriteString mov eax,theSum call WriteInt ; display EAX call Crlf pop edx pop eax ret DisplaySum ENDP END
18.821429
55
0.548387
8090b7c47c695ba27721fa5cf2e1b4de0c3964a3
536
asm
Assembly
programs/oeis/003/A003991.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/003/A003991.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/003/A003991.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A003991: Multiplication table read by antidiagonals: T(i,j) = i*j, i>=1, j>=1. ; 1,2,2,3,4,3,4,6,6,4,5,8,9,8,5,6,10,12,12,10,6,7,12,15,16,15,12,7,8,14,18,20,20,18,14,8,9,16,21,24,25,24,21,16,9,10,18,24,28,30,30,28,24,18,10,11,20,27,32,35,36,35,32,27,20,11,12,22,30,36,40,42,42,40,36,30,22,12,13,24,33,40,45,48,49,48,45,40,33,24,13,14,26,36,44,50,54,56,56,54 seq $0,224195 ; Ordered sequence of numbers of form (2^n - 1)*2^m + 1 where n >= 1, m >= 1. seq $0,161511 ; Number of 1...0 pairs in the binary representation of 2n. sub $0,1
76.571429
278
0.643657
9370f5cc51b8ab20e7e35756c17aa794a4175114
314
asm
Assembly
tests/nasm/lea-nop.asm
brenden7158/v86
c9e274dc6e8cc619d1b36d57a69299aee6a45a91
[ "BSD-2-Clause" ]
12,700
2015-01-04T15:03:42.000Z
2022-03-31T06:43:06.000Z
tests/nasm/lea-nop.asm
brenden7158/v86
c9e274dc6e8cc619d1b36d57a69299aee6a45a91
[ "BSD-2-Clause" ]
566
2015-01-01T18:16:40.000Z
2022-03-31T19:59:10.000Z
tests/nasm/lea-nop.asm
brenden7158/v86
c9e274dc6e8cc619d1b36d57a69299aee6a45a91
[ "BSD-2-Clause" ]
1,182
2015-01-05T09:20:48.000Z
2022-03-31T12:16:52.000Z
global _start %include "header.inc" ; nops lea edx, [edx] db 8Dh, 40h, 00h db 8Dh, 0B6h, 00h, 00h, 00h, 00h db 8Dh, 0BCh, 27h, 00h, 00h, 00h, 00h ; non-nops, but similar encodings lea eax, [bx+si] lea cx, [bx+di] lea edx, [edx+42] lea ebp, [ebp*2] %include "footer.inc"
17.444444
41
0.570064
31a3a88aaf14523d7cd824987cd2f003701dbaa5
7,369
asm
Assembly
Transynther/x86/_processed/NONE/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_415.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_415.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_415.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r8 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_UC_ht+0xbfdb, %rsi lea addresses_UC_ht+0x1687b, %rdi clflush (%rdi) nop nop nop nop nop sub $6872, %r12 mov $81, %rcx rep movsw nop nop xor %r12, %r12 lea addresses_WT_ht+0x1ce33, %r9 xor $32529, %r8 mov (%r9), %r15 nop nop nop nop xor %rcx, %rcx lea addresses_WC_ht+0x4a7b, %rsi lea addresses_A_ht+0x36fb, %rdi nop nop nop nop dec %rbp mov $76, %rcx rep movsb nop xor %r8, %r8 lea addresses_WC_ht+0x18bbb, %rdi nop nop nop and $3478, %rbp mov (%rdi), %r8w sub %rbp, %rbp lea addresses_A_ht+0xe873, %rsi lea addresses_UC_ht+0x1b07b, %rdi nop nop nop sub %r8, %r8 mov $97, %rcx rep movsb nop nop nop nop xor %rdi, %rdi lea addresses_A_ht+0x1e3cf, %rsi lea addresses_WC_ht+0x4c3b, %rdi clflush (%rsi) nop nop nop sub %r15, %r15 mov $37, %rcx rep movsw nop nop nop nop and %r8, %r8 lea addresses_WT_ht+0x69bb, %rsi lea addresses_WT_ht+0xfa1b, %rdi nop nop nop cmp %r12, %r12 mov $22, %rcx rep movsb nop cmp %r9, %r9 lea addresses_normal_ht+0x1807b, %r9 add %rdi, %rdi movw $0x6162, (%r9) nop nop nop nop sub %r12, %r12 lea addresses_D_ht+0xfdab, %rdi nop nop nop nop nop cmp $14658, %rbp mov $0x6162636465666768, %r8 movq %r8, (%rdi) nop nop nop nop and $51306, %rcx lea addresses_UC_ht+0x1523b, %rsi lea addresses_D_ht+0x1e7b, %rdi clflush (%rsi) nop and $15752, %r15 mov $90, %rcx rep movsb nop nop nop sub %rbp, %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r8 push %rax push %rbx push %rcx push %rdx // Store lea addresses_A+0x154ab, %rcx nop xor $27921, %r8 mov $0x5152535455565758, %r12 movq %r12, (%rcx) nop nop nop nop cmp %rbx, %rbx // Store mov $0x87b, %rax nop nop nop add $32760, %rdx mov $0x5152535455565758, %rcx movq %rcx, (%rax) nop add $64818, %rcx // Load mov $0x4241640000000bfb, %rcx nop nop nop nop nop cmp $64693, %rbx mov (%rcx), %r12 nop nop nop sub %rdx, %rdx // Faulty Load lea addresses_A+0x1b07b, %r13 cmp %rbx, %rbx movups (%r13), %xmm6 vpextrq $1, %xmm6, %rax lea oracles, %r8 and $0xff, %rax shlq $12, %rax mov (%r8,%rax,1), %rax pop %rdx pop %rcx pop %rbx pop %rax pop %r8 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}, 'dst': {'same': True, 'congruent': 7, 'type': 'addresses_A_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'dst': {'same': True, 'congruent': 10, 'type': 'addresses_UC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'dst': {'same': True, 'congruent': 7, 'type': 'addresses_D_ht'}} {'00': 9147, '45': 12297, '48': 385} 00 45 45 00 00 45 45 45 00 45 00 00 45 45 00 00 00 00 45 00 45 45 45 45 00 00 00 00 45 00 00 45 00 00 48 45 00 45 45 45 45 45 45 00 00 00 45 45 45 45 45 45 45 00 45 45 00 45 45 00 45 00 45 45 00 45 45 00 48 45 00 45 00 00 45 45 45 45 45 00 45 00 00 45 00 00 45 00 45 45 00 45 00 00 45 00 00 45 45 45 00 45 00 45 45 45 45 45 45 45 00 00 00 45 45 45 45 45 00 45 00 48 45 00 45 45 45 45 45 00 45 45 45 00 45 00 00 00 45 00 45 00 45 45 45 00 45 45 00 00 45 00 45 00 00 45 45 00 45 00 00 00 45 45 45 45 00 45 45 00 45 45 00 45 45 45 45 48 45 45 00 00 45 00 00 45 45 00 45 00 00 45 00 00 45 45 00 00 45 00 45 45 00 45 45 00 48 45 00 00 45 00 45 00 00 45 00 00 45 45 45 45 00 00 45 00 45 45 45 00 45 00 00 00 45 00 45 45 00 45 00 45 45 45 00 45 45 45 45 45 00 00 45 00 45 45 00 45 00 00 45 45 00 45 45 00 45 45 45 45 00 00 00 00 45 00 45 00 45 00 45 00 45 45 45 45 45 45 45 00 45 45 45 00 00 00 45 00 45 00 00 45 00 45 45 00 00 45 45 00 45 45 45 00 00 00 00 00 00 00 00 45 00 45 45 00 45 45 45 45 45 45 00 45 00 45 45 00 45 00 00 00 45 45 45 45 45 00 45 45 45 00 45 00 45 00 45 00 00 00 00 45 00 00 45 00 45 45 00 00 45 45 45 45 45 45 00 45 45 45 45 00 45 00 45 45 00 00 45 00 45 45 45 45 00 00 45 45 45 45 45 45 45 00 45 45 00 45 00 00 45 45 45 45 00 45 45 45 45 00 00 45 00 45 00 00 45 45 00 45 45 00 00 00 00 00 45 00 48 45 45 48 00 00 45 45 00 45 45 00 00 45 45 00 00 45 00 00 00 45 00 45 45 00 45 00 45 45 45 45 00 45 45 45 45 45 00 45 00 45 00 45 45 00 45 00 00 00 45 45 45 45 00 45 45 45 45 00 00 45 45 00 45 00 00 45 00 45 45 00 45 00 00 00 00 45 00 00 45 45 00 45 45 45 45 45 00 00 45 00 00 00 45 00 45 45 00 00 45 45 45 45 45 45 00 00 45 45 00 45 45 00 00 45 00 45 00 45 00 00 45 45 45 00 45 00 45 45 00 45 00 00 45 45 00 45 45 48 45 45 00 45 00 45 45 00 45 45 45 00 45 45 00 45 00 45 45 45 00 45 00 00 45 45 00 00 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 00 45 45 48 45 45 00 00 00 45 00 45 45 00 45 00 00 00 45 45 00 45 00 00 00 00 45 45 45 00 45 00 45 45 45 45 45 00 45 45 45 00 45 00 00 45 45 00 45 45 45 45 45 00 00 00 45 45 00 45 45 45 45 45 00 45 00 00 45 00 45 45 45 45 45 00 45 45 45 45 45 45 45 00 45 00 45 45 00 45 00 00 45 00 45 00 00 45 45 45 45 45 00 45 00 45 00 00 00 45 00 45 00 45 45 00 48 00 00 45 00 45 00 45 00 45 45 00 45 45 00 45 45 00 45 00 45 00 00 45 45 45 45 00 00 45 00 48 00 00 45 45 00 45 45 00 00 45 00 00 00 45 00 45 45 00 45 45 00 45 00 45 45 00 00 00 45 45 00 45 45 00 45 00 00 45 00 00 45 00 45 00 00 45 45 45 00 00 45 45 00 45 00 00 45 45 45 45 45 00 45 45 00 45 00 45 45 45 45 45 45 00 45 45 00 45 45 45 00 00 45 00 00 00 00 45 00 45 45 45 45 45 45 45 00 00 45 45 45 00 45 00 45 00 45 45 45 00 45 00 45 00 00 45 00 48 45 45 45 45 00 00 48 00 00 45 00 48 00 00 45 45 45 45 00 45 00 45 00 00 45 00 00 00 00 45 00 45 00 00 00 45 45 00 45 00 45 45 00 45 00 00 45 00 45 00 45 00 00 45 45 00 45 00 00 45 00 00 45 45 00 45 00 45 45 45 00 00 45 00 45 45 45 00 45 00 00 45 00 00 45 45 45 45 00 00 00 45 00 00 45 45 45 48 45 00 45 00 00 45 00 00 45 00 00 45 */
33.648402
2,999
0.655041
6004f70ff35def9ea79d4ae0c76d63bb7062356a
396
asm
Assembly
programs/oeis/274/A274743.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/274/A274743.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/274/A274743.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A274743: Repunits with odd indices multiplied by 99, i.e., 99*(1, 111, 11111, 1111111, ...). ; 99,10989,1099989,109999989,10999999989,1099999999989,109999999999989,10999999999999989,1099999999999999989,109999999999999999989,10999999999999999999989,1099999999999999999999989,109999999999999999999999989,10999999999999999999999999989 mov $1,100 pow $1,$0 sub $1,1 mul $1,110 add $1,99 mov $0,$1
39.6
238
0.810606
2edee260c2af5293eab1c112ef12d2b136e5f303
8,628
asm
Assembly
ee/ptr/init.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
ee/ptr/init.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
ee/ptr/init.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
* Pointer initiaisation code V1.07  1985 Tony Tebby QJUMP * * 1.05 modified for new modes (wl) * 2006-03-21 1.06 modified for background I/O support (MK) * 2006-05-15 1.07 disable new CTRL+C behaviour of common scheduler code (MK) * 2018-04-28 1.08 refer to pt_sched_qdos, not pt_sched (MK) * section driver * xdef pt_init * xref pt_open xref pt_sched_qdos xref pt_io xref pt_ioxf xref pt_close xref pt_closu xref pt_copyc xref pt_linkc xref pt_isspr xref pt_bginit xref pt_bgprocs xref sp_table xref pv_table xref.l pt.spsln * include 'dev8_mac_assert' include 'dev8_keys_qdos_sms' include 'dev8_keys_qdos_ioa' include 'dev8_keys_qdos_io' include 'dev8_keys_err' include 'dev8_keys_sys' include 'dev8_keys_iod' include 'dev8_keys_chn' include 'dev8_keys_qlv' include 'dev8_keys_jcb' include 'dev8_keys_con' include 'dev8_mac_proc' proc_tab proc_stt proc_def CKEYON proc_def CKEYOFF proc_end proc_stt proc_end pt_con dc.w 8,'CON__232' pt.dq2 equ 232-sd.dq2 * * a3 r base of linkage block * pt_init reglist reg d4/d5/d6/d7/a4/a5 movem.l reglist,-(sp) lea proc_tab,a1 ; new procedures move.w sb.inipr,a2 jsr (a2) lea pt_bgprocs,a1 move.w sb.inipr,a2 jsr (a2) moveq #0,d0 trap #1 move.l a0,a4 ; a4 = sysvars moveq #sms.achp,d0 ; first allocate the memory required move.l #pt_end+pt.spsln,d1 ; ... for the linkage and the sprite moveq #0,d2 ; owned by 0 trap #1 tst.l d0 bne.l exit * lea pt_end(a0),a5 ; set save area address move.l a5,pt_spsav(a0) move.l a0,a5 ; save linkage block address * move.l #pt.ident,pt_ident(a5) move.l a5,sys_clnk(a4) ; save console linkage * move.l #$01000040,pt_pos(a5) ; position above centre of screen move.l pt_pos(a5),pt_npos(a5) move.b #pt.supky,pt_pstat(a5) set pointer suppressed * move.w #pt.kaccl,pt_kaccl(a5) set default accelerators move.w #pt.xaccl,pt_xaccl(a5) move.w #pt.yaccl,pt_yaccl(a5) move.b #pt.wake,pt_wake(a5) move.b #pt.relax,pt_relax(a5) move.b #pt.stuf1,pt_stuf1(a5) set default stuff characters move.b #pt.stuf2,pt_stuf2(a5) * * now the mode change flag and dummy keyboard channel * moveq #sms.info,d0 get sysvar trap #1 move.l sys_ckyq(a0),a3 save keyboard queue clr.l sys_ckyq(a0) clear keyboard queue pointer * * Unlink any modified console driver before opening our * channel. * trap #0 doing odd things, use supervisor mode move.l a0,a4 keep system variables move.l sys_iodl(a4),a2 and old driver list move.l a2,d0 smashable copy move.l #$c000,d1 ROM ends here loop beq.s openfunny no ROM drivers, wow!!!!!! move.l d0,a0 point to driver linkage cmp.l pt_aio-pt_liod(a0),d1 is the driver in ROM? bgt.s relink yes, make this first driver move.l (a0),d0 no, try next one bra.s loop relink move.l a0,sys_iodl(a4) smash driver list * openfunny lea pt_con(pc),a0 open our funny channel moveq #ioa.open,d0 moveq #0,d3 moveq #0,d1 trap #2 * move.l a2,sys_iodl(a4) restore driver list move #0,sr hack over, back to user mode now tst.l d0 OK? bne.l exit bonk * moveq #iow.xtop,d0 do screen extop to set window size zero moveq #-1,d3 ... and find channel block, scr size lea pt_extop(pc),a2 trap #3 move.l d1,a0 lea pt_sbase(a5),a2 move.l (a0)+,(a2)+ screen base move.l (a0)+,(a2)+ size!! move.w (a0)+,(a2)+ bytes per line move.l (a0),(a2) screen size * move.l a4,a0 restore sysvars (may be superfluous) move.l sys_ckyq(a0),a2 get dummy keyboard queue address move.l a2,pt_dumq1(a5) set dummy keyboard queue address move.l a2,d0 set keyboard queue offset sub.l a1,d0 move.l d0,pt_kqoff(a5) move.l a3,sys_ckyq(a0) restore keyboard queue pointer moveq #sd.dq1l,d1 very short dummy queue 1 move.w ioq.setq,a3 reset it jsr (a3) move.l a2,(a2) point to myself!!! should be already!! * move.l a2,a4 lea sd.dq2(a2),a2 dummy keyboard queue 2 moveq #pt.dq2,d1 reasonable length move.w ioq.setq,a3 jsr (a3) set up queue move.l a4,(a2) and link to dummy 1 * move.l a1,pt_mtest(a5) save flag channel address st sd_cattr(a1) and set it move.l a1,d7 save channel base address page * * Take a copy of the ROM driver linkage * move.l chn_drvr(a1),a0 get ROM driver address move.l a0,d5 save it addq.l #iod_ioad-iod_iolk,a0 point to I/O entry assert iod_ioad,iod_open-4,iod_clos-8 assert pt_aiorm,pt_aoprm-4,pt_aclrm-8 lea pt_aiorm(a5),a1 move.l (a0)+,(a1)+ copy I/O address move.l (a0)+,(a1)+ and open address move.l (a0)+,(a1)+ and close address lea pt_romdr(a5),a0 point to... move.l a0,d4 ...ROM equivalent linkage * * Now link in our scheduler routine * lea pt_sched_qdos(pc),a1 set scheduler loop driver address move.l a1,pt_aschd(a5) lea pt_lschd(a5),a0 moveq #sms.lshd,d0 trap #1 * * Normal IO and close entry points * lea pt_io(pc),a1 io move.l a1,pt_aio(a5) in proper linkage lea pt_close(pc),a1 close move.l a1,pt_aclos(a5) in proper linkage * * Special IO and close for previously unused channels * lea pt_ioxf(pc),a1 special IO move.l a1,pt_aiodm(a5) in dummy linkage lea pt_open(pc),a1 open (only one) move.l a1,pt_aopdm(a5) in dummy linkage lea pt_closu(pc),a1 special close move.l a1,pt_acldm(a5) in dummy linkage lea pt_liodm(a5),a0 moveq #sms.liod,d0 and link in trap #1 * * set null close routine * lea pt_ok,a0 null close move.l a0,pt_ptrok(a5) OK page * * Go through the channel table, changing all old consoles into new * ones, and changing the channel table entries accordingly. Any job * waiting for IO needs its flag address changed, too. * trap #0 go to supervisor mode move.l a6,-(sp) set sysvar pointer * moveq #sms.info,d0 find the system variables trap #1 move.l a0,a6 * move.l sys_chtb(a6),a2 go through all channels move.l (a2),d1 channel 0 base bmi pti_exno not open, bad news move.l d1,a0 OK * move.l chn_drvr(a0),a3 get driver address move.l a3,d6 and keep it for later move.l iod_open-iod_iolk(a3),pt_copen(a5) and keep old open routine lea -pt_liod(a3),a3 ... base of linkage block move.l a3,pt_clink(a5) ... saved for link through move.l a5,a3 set linkage base * ch_loop move.l (a2)+,d1 checking if this is the console driver blt.s ch_eloop ... not open cmp.l d1,d7 is it our own funny channel? beq.s ch_eloop ... yes, don't move that move.l d1,a0 move.l chn_drvr(a0),d1 get the driver address cmp.l d1,d6 channel 0 console? beq.s ch_mkptr yes, make it a Pointer Interface channel cmp.l d1,d5 ROM console? bne.s ch_eloop no, ignore it move.l d4,chn_drvr(a0) yes, ensure MODE doesn't see it bra.s ch_eloop * ch_mkptr jsr pt_copyc(pc) copy channel to new area move.l a0,-4(a2) and change entry in channel table sub.w #pt_liod-pt_liodm,a3 point to special linkage jsr pt_linkc(pc) and link in the channel * * Now check to see if a job is waiting for IO. We need to change * its flag address if there is one. * lea chn_stat(a0),a4 pointer to status byte tst.b (a4) job waiting? beq.s ch_eloop ... no * move.l chn_jbwt(a0),d1 get waiting job's ID moveq #0,d2 moveq #sms.injb,d0 and information on it trap #1 move.l a4,jcb_rflg-jcb_end(a0) point its hold flag to the new status * ch_eloop cmp.l sys_chtt(a6),a2 blt.s ch_loop * exsv move.l (sp)+,a6 restore a6 and.w #$d8ff,sr back to user mode exit movem.l (sp)+,reglist tst.l d0 if OK a3 is set bne.s exit2 pea pv_table move.l (sp)+,pt_vecs(a3) ; install con vectors jsr pt_isspr bne.s exit jsr pt_bginit ; init background I/O data move.w #-1,pt_swwin(a3) ; disable new CTRL+C switch movem.l d1-d7/a0-a5,-(a7) sys_sprt moveq #sms.info,d0 trap #do.smsq move.l sys_clnk(a0),d0 beq.s ss_exit move.l d0,a3 move.l pt_vecs(a3),a2 lea sp_table,a4 move.l a4,a5 move.w (a4)+,d5 ; that many sprites moveq #0,d1 ss_loop move.l (a4)+,a1 ; get pointer to sprite add.l a5,a1 jsr pv_sspr(a2) addq.w #1,d1 cmp.w d5,d1 blt.s ss_loop ss_exit movem.l (sp)+,d1-d7/a0-a5 tst.l d0 exit2 rts pti_exno moveq #err.ichn,d0 channel was invalid bra.s exsv exit from supervisor mode, too! * * $$$$$$$ Magic Numbers * pt_extop lea bm_scren(a3),a3 screen parameters moveq #$fffffff7,d0 and.b sys_qlmr(a6),d0 mode 0 or 8? bne.s pt_exset ... no lea pt_wsize,a3 ... yes, standard sizes pt_exset move.l a3,d1 linkage address lea $18(a0),a2 clear all to zero lea $64(a0),a3 up to end pt_exclr clr.l (a2)+ cmp.l a3,a2 blt.s pt_exclr * st sd_curf(a0) enable cursor move.l a0,a1 return base address of channel block pt_ok moveq #0,d0 ok rts pt_wsize dc.l $20000,$8000 dc.w $80,$200,$100 standard sizes end
25.008696
78
0.706653
7ff081d9823029706ba4c59421649183e59c65fe
339
asm
Assembly
Etapa 01/Aula 02 - Estrutura dos Programas/codes/hello.asm
bellorini/unioeste
8c3d1f1e26dc3680160820c7219954b6076c9d5e
[ "MIT" ]
6
2021-11-03T20:19:10.000Z
2022-02-23T17:57:58.000Z
Etapa 01/Aula 02 - Estrutura dos Programas/codes/hello.asm
bellorini/unioeste
8c3d1f1e26dc3680160820c7219954b6076c9d5e
[ "MIT" ]
null
null
null
Etapa 01/Aula 02 - Estrutura dos Programas/codes/hello.asm
bellorini/unioeste
8c3d1f1e26dc3680160820c7219954b6076c9d5e
[ "MIT" ]
5
2022-02-02T15:48:45.000Z
2022-02-22T18:17:52.000Z
; Aula 01 - Introdução ; hello.asm ; Meu primeiro assembly! ; nasm -f elf64 hello.asm ; ld hello.o -o hello.x section .data strOla : db "Ola", 10 strOlaL: equ $ - strOla section .text global _start _start: mov rax, 1 mov rdi, 1 lea rsi, [strOla] mov edx, strOlaL syscall mov rax, 60 mov rdi, 0 syscall
14.73913
49
0.628319
d8935a4b4f4b08531f7a64a59afe0117147aab0c
756
asm
Assembly
oeis/130/A130087.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/130/A130087.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/130/A130087.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A130087: Denominator of product{k=1 to n} k^mu(k), where mu is the Moebius function A008683. ; Submitted by Christian Krause ; 1,2,6,6,30,5,35,35,35,7,77,77,1001,143,143,143,2431,2431,46189,46189,46189,4199,96577,96577,96577,7429,7429,7429,215441,215441,6678671,6678671,6678671,392863,392863,392863,14535931,765049,765049,765049,31367009,31367009,1348781387,1348781387,1348781387,58642669,2756205443,2756205443,2756205443,2756205443,2756205443,2756205443,146078888479,146078888479,146078888479,146078888479,146078888479,5037203051,297194980009,297194980009,18128893780549,584803025179,584803025179,584803025179,584803025179 mov $1,1 lpb $0 mov $2,$0 add $2,1 add $3,$1 mul $3,$0 sub $0,1 mul $1,$2 lpe pow $3,2 gcd $3,$1 div $1,$3 mov $0,$1
42
498
0.780423
406f2cab5b6488966c7e557854433a868b180bdb
17,096
asm
Assembly
Ouroboros/External/libjpegTurbo/simd/jiss2fst-64.asm
jiangzhu1212/oooii
fc00ff81e74adaafd9c98ba7c055f55d95a36e3b
[ "MIT" ]
null
null
null
Ouroboros/External/libjpegTurbo/simd/jiss2fst-64.asm
jiangzhu1212/oooii
fc00ff81e74adaafd9c98ba7c055f55d95a36e3b
[ "MIT" ]
null
null
null
Ouroboros/External/libjpegTurbo/simd/jiss2fst-64.asm
jiangzhu1212/oooii
fc00ff81e74adaafd9c98ba7c055f55d95a36e3b
[ "MIT" ]
null
null
null
; ; jiss2fst-64.asm - fast integer IDCT (64-bit SSE2) ; ; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB ; Copyright 2009 D. R. Commander ; ; Based on ; x86 SIMD extension for IJG JPEG library ; Copyright (C) 1999-2006, MIYASAKA Masaru. ; For conditions of distribution and use, see copyright notice in jsimdext.inc ; ; This file should be assembled with NASM (Netwide Assembler), ; can *not* be assembled with Microsoft's MASM or any compatible ; assembler (including Borland's Turbo Assembler). ; NASM is available from http://nasm.sourceforge.net/ or ; http://sourceforge.net/projecpt/showfiles.php?group_id=6208 ; ; This file contains a fast, not so accurate integer implementation of ; the inverse DCT (Discrete Cosine Transform). The following code is ; based directly on the IJG's original jidctfst.c; see the jidctfst.c ; for more details. ; ; [TAB8] %include "jsimdext.inc" %include "jdct.inc" ; -------------------------------------------------------------------------- %define CONST_BITS 8 ; 14 is also OK. %define PASS1_BITS 2 %if IFAST_SCALE_BITS != PASS1_BITS %error "'IFAST_SCALE_BITS' must be equal to 'PASS1_BITS'." %endif %if CONST_BITS == 8 F_1_082 equ 277 ; FIX(1.082392200) F_1_414 equ 362 ; FIX(1.414213562) F_1_847 equ 473 ; FIX(1.847759065) F_2_613 equ 669 ; FIX(2.613125930) F_1_613 equ (F_2_613 - 256) ; FIX(2.613125930) - FIX(1) %else ; NASM cannot do compile-time arithmetic on floating-point constants. %define DESCALE(x,n) (((x)+(1<<((n)-1)))>>(n)) F_1_082 equ DESCALE(1162209775,30-CONST_BITS) ; FIX(1.082392200) F_1_414 equ DESCALE(1518500249,30-CONST_BITS) ; FIX(1.414213562) F_1_847 equ DESCALE(1984016188,30-CONST_BITS) ; FIX(1.847759065) F_2_613 equ DESCALE(2805822602,30-CONST_BITS) ; FIX(2.613125930) F_1_613 equ (F_2_613 - (1 << CONST_BITS)) ; FIX(2.613125930) - FIX(1) %endif ; -------------------------------------------------------------------------- SECTION SEG_CONST ; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow) ; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw) %define PRE_MULTIPLY_SCALE_BITS 2 %define CONST_SHIFT (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS) alignz 16 global EXTN(jconst_idct_ifast_sse2) EXTN(jconst_idct_ifast_sse2): PW_F1414 times 8 dw F_1_414 << CONST_SHIFT PW_F1847 times 8 dw F_1_847 << CONST_SHIFT PW_MF1613 times 8 dw -F_1_613 << CONST_SHIFT PW_F1082 times 8 dw F_1_082 << CONST_SHIFT PB_CENTERJSAMP times 16 db CENTERJSAMPLE alignz 16 ; -------------------------------------------------------------------------- SECTION SEG_TEXT BITS 64 ; ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) ; jsimd_idct_ifast_sse2 (void * dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; ; r10 = jpeg_component_info * compptr ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13 = JDIMENSION output_col %define original_rbp rbp+0 %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 2 align 16 global EXTN(jsimd_idct_ifast_sse2) EXTN(jsimd_idct_ifast_sse2): push rbp mov rax,rsp ; rax = original rbp sub rsp, byte 4 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits mov [rsp],rax mov rbp,rsp ; rbp = aligned rbp lea rsp, [wk(0)] collect_args ; ---- Pass 1: process columns from input. mov rdx, r10 ; quantptr mov rsi, r11 ; inptr %ifndef NO_ZERO_COLUMN_TEST_IFAST_SSE2 mov eax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)] or eax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)] jnz near .columnDCT movdqa xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] por xmm1,xmm0 packsswb xmm1,xmm1 packsswb xmm1,xmm1 movd eax,xmm1 test rax,rax jnz short .columnDCT ; -- AC terms all zero movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] pmullw xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm7,xmm0 ; xmm0=in0=(00 01 02 03 04 05 06 07) punpcklwd xmm0,xmm0 ; xmm0=(00 00 01 01 02 02 03 03) punpckhwd xmm7,xmm7 ; xmm7=(04 04 05 05 06 06 07 07) pshufd xmm6,xmm0,0x00 ; xmm6=col0=(00 00 00 00 00 00 00 00) pshufd xmm2,xmm0,0x55 ; xmm2=col1=(01 01 01 01 01 01 01 01) pshufd xmm5,xmm0,0xAA ; xmm5=col2=(02 02 02 02 02 02 02 02) pshufd xmm0,xmm0,0xFF ; xmm0=col3=(03 03 03 03 03 03 03 03) pshufd xmm1,xmm7,0x00 ; xmm1=col4=(04 04 04 04 04 04 04 04) pshufd xmm4,xmm7,0x55 ; xmm4=col5=(05 05 05 05 05 05 05 05) pshufd xmm3,xmm7,0xAA ; xmm3=col6=(06 06 06 06 06 06 06 06) pshufd xmm7,xmm7,0xFF ; xmm7=col7=(07 07 07 07 07 07 07 07) movdqa XMMWORD [wk(0)], xmm2 ; wk(0)=col1 movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=col3 jmp near .column_end %endif .columnDCT: ; -- Even part movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] pmullw xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_IFAST_MULT_TYPE)] pmullw xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_IFAST_MULT_TYPE)] movdqa xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] pmullw xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_IFAST_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_IFAST_MULT_TYPE)] movdqa xmm4,xmm0 movdqa xmm5,xmm1 psubw xmm0,xmm2 ; xmm0=tmp11 psubw xmm1,xmm3 paddw xmm4,xmm2 ; xmm4=tmp10 paddw xmm5,xmm3 ; xmm5=tmp13 psllw xmm1,PRE_MULTIPLY_SCALE_BITS pmulhw xmm1,[rel PW_F1414] psubw xmm1,xmm5 ; xmm1=tmp12 movdqa xmm6,xmm4 movdqa xmm7,xmm0 psubw xmm4,xmm5 ; xmm4=tmp3 psubw xmm0,xmm1 ; xmm0=tmp2 paddw xmm6,xmm5 ; xmm6=tmp0 paddw xmm7,xmm1 ; xmm7=tmp1 movdqa XMMWORD [wk(1)], xmm4 ; wk(1)=tmp3 movdqa XMMWORD [wk(0)], xmm0 ; wk(0)=tmp2 ; -- Odd part movdqa xmm2, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] pmullw xmm2, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_IFAST_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_IFAST_MULT_TYPE)] movdqa xmm5, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] pmullw xmm5, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_IFAST_MULT_TYPE)] pmullw xmm1, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_IFAST_MULT_TYPE)] movdqa xmm4,xmm2 movdqa xmm0,xmm5 psubw xmm2,xmm1 ; xmm2=z12 psubw xmm5,xmm3 ; xmm5=z10 paddw xmm4,xmm1 ; xmm4=z11 paddw xmm0,xmm3 ; xmm0=z13 movdqa xmm1,xmm5 ; xmm1=z10(unscaled) psllw xmm2,PRE_MULTIPLY_SCALE_BITS psllw xmm5,PRE_MULTIPLY_SCALE_BITS movdqa xmm3,xmm4 psubw xmm4,xmm0 paddw xmm3,xmm0 ; xmm3=tmp7 psllw xmm4,PRE_MULTIPLY_SCALE_BITS pmulhw xmm4,[rel PW_F1414] ; xmm4=tmp11 ; To avoid overflow... ; ; (Original) ; tmp12 = -2.613125930 * z10 + z5; ; ; (This implementation) ; tmp12 = (-1.613125930 - 1) * z10 + z5; ; = -1.613125930 * z10 - z10 + z5; movdqa xmm0,xmm5 paddw xmm5,xmm2 pmulhw xmm5,[rel PW_F1847] ; xmm5=z5 pmulhw xmm0,[rel PW_MF1613] pmulhw xmm2,[rel PW_F1082] psubw xmm0,xmm1 psubw xmm2,xmm5 ; xmm2=tmp10 paddw xmm0,xmm5 ; xmm0=tmp12 ; -- Final output stage psubw xmm0,xmm3 ; xmm0=tmp6 movdqa xmm1,xmm6 movdqa xmm5,xmm7 paddw xmm6,xmm3 ; xmm6=data0=(00 01 02 03 04 05 06 07) paddw xmm7,xmm0 ; xmm7=data1=(10 11 12 13 14 15 16 17) psubw xmm1,xmm3 ; xmm1=data7=(70 71 72 73 74 75 76 77) psubw xmm5,xmm0 ; xmm5=data6=(60 61 62 63 64 65 66 67) psubw xmm4,xmm0 ; xmm4=tmp5 movdqa xmm3,xmm6 ; transpose coefficients(phase 1) punpcklwd xmm6,xmm7 ; xmm6=(00 10 01 11 02 12 03 13) punpckhwd xmm3,xmm7 ; xmm3=(04 14 05 15 06 16 07 17) movdqa xmm0,xmm5 ; transpose coefficients(phase 1) punpcklwd xmm5,xmm1 ; xmm5=(60 70 61 71 62 72 63 73) punpckhwd xmm0,xmm1 ; xmm0=(64 74 65 75 66 76 67 77) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=tmp2 movdqa xmm1, XMMWORD [wk(1)] ; xmm1=tmp3 movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(60 70 61 71 62 72 63 73) movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=(64 74 65 75 66 76 67 77) paddw xmm2,xmm4 ; xmm2=tmp4 movdqa xmm5,xmm7 movdqa xmm0,xmm1 paddw xmm7,xmm4 ; xmm7=data2=(20 21 22 23 24 25 26 27) paddw xmm1,xmm2 ; xmm1=data4=(40 41 42 43 44 45 46 47) psubw xmm5,xmm4 ; xmm5=data5=(50 51 52 53 54 55 56 57) psubw xmm0,xmm2 ; xmm0=data3=(30 31 32 33 34 35 36 37) movdqa xmm4,xmm7 ; transpose coefficients(phase 1) punpcklwd xmm7,xmm0 ; xmm7=(20 30 21 31 22 32 23 33) punpckhwd xmm4,xmm0 ; xmm4=(24 34 25 35 26 36 27 37) movdqa xmm2,xmm1 ; transpose coefficients(phase 1) punpcklwd xmm1,xmm5 ; xmm1=(40 50 41 51 42 52 43 53) punpckhwd xmm2,xmm5 ; xmm2=(44 54 45 55 46 56 47 57) movdqa xmm0,xmm3 ; transpose coefficients(phase 2) punpckldq xmm3,xmm4 ; xmm3=(04 14 24 34 05 15 25 35) punpckhdq xmm0,xmm4 ; xmm0=(06 16 26 36 07 17 27 37) movdqa xmm5,xmm6 ; transpose coefficients(phase 2) punpckldq xmm6,xmm7 ; xmm6=(00 10 20 30 01 11 21 31) punpckhdq xmm5,xmm7 ; xmm5=(02 12 22 32 03 13 23 33) movdqa xmm4, XMMWORD [wk(0)] ; xmm4=(60 70 61 71 62 72 63 73) movdqa xmm7, XMMWORD [wk(1)] ; xmm7=(64 74 65 75 66 76 67 77) movdqa XMMWORD [wk(0)], xmm3 ; wk(0)=(04 14 24 34 05 15 25 35) movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=(06 16 26 36 07 17 27 37) movdqa xmm3,xmm1 ; transpose coefficients(phase 2) punpckldq xmm1,xmm4 ; xmm1=(40 50 60 70 41 51 61 71) punpckhdq xmm3,xmm4 ; xmm3=(42 52 62 72 43 53 63 73) movdqa xmm0,xmm2 ; transpose coefficients(phase 2) punpckldq xmm2,xmm7 ; xmm2=(44 54 64 74 45 55 65 75) punpckhdq xmm0,xmm7 ; xmm0=(46 56 66 76 47 57 67 77) movdqa xmm4,xmm6 ; transpose coefficients(phase 3) punpcklqdq xmm6,xmm1 ; xmm6=col0=(00 10 20 30 40 50 60 70) punpckhqdq xmm4,xmm1 ; xmm4=col1=(01 11 21 31 41 51 61 71) movdqa xmm7,xmm5 ; transpose coefficients(phase 3) punpcklqdq xmm5,xmm3 ; xmm5=col2=(02 12 22 32 42 52 62 72) punpckhqdq xmm7,xmm3 ; xmm7=col3=(03 13 23 33 43 53 63 73) movdqa xmm1, XMMWORD [wk(0)] ; xmm1=(04 14 24 34 05 15 25 35) movdqa xmm3, XMMWORD [wk(1)] ; xmm3=(06 16 26 36 07 17 27 37) movdqa XMMWORD [wk(0)], xmm4 ; wk(0)=col1 movdqa XMMWORD [wk(1)], xmm7 ; wk(1)=col3 movdqa xmm4,xmm1 ; transpose coefficients(phase 3) punpcklqdq xmm1,xmm2 ; xmm1=col4=(04 14 24 34 44 54 64 74) punpckhqdq xmm4,xmm2 ; xmm4=col5=(05 15 25 35 45 55 65 75) movdqa xmm7,xmm3 ; transpose coefficients(phase 3) punpcklqdq xmm3,xmm0 ; xmm3=col6=(06 16 26 36 46 56 66 76) punpckhqdq xmm7,xmm0 ; xmm7=col7=(07 17 27 37 47 57 67 77) .column_end: ; -- Prefetch the next coefficient block prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32] ; ---- Pass 2: process rows from work array, store into output array. mov rax, [original_rbp] mov rdi, r12 ; (JSAMPROW *) mov rax, r13 ; -- Even part ; xmm6=col0, xmm5=col2, xmm1=col4, xmm3=col6 movdqa xmm2,xmm6 movdqa xmm0,xmm5 psubw xmm6,xmm1 ; xmm6=tmp11 psubw xmm5,xmm3 paddw xmm2,xmm1 ; xmm2=tmp10 paddw xmm0,xmm3 ; xmm0=tmp13 psllw xmm5,PRE_MULTIPLY_SCALE_BITS pmulhw xmm5,[rel PW_F1414] psubw xmm5,xmm0 ; xmm5=tmp12 movdqa xmm1,xmm2 movdqa xmm3,xmm6 psubw xmm2,xmm0 ; xmm2=tmp3 psubw xmm6,xmm5 ; xmm6=tmp2 paddw xmm1,xmm0 ; xmm1=tmp0 paddw xmm3,xmm5 ; xmm3=tmp1 movdqa xmm0, XMMWORD [wk(0)] ; xmm0=col1 movdqa xmm5, XMMWORD [wk(1)] ; xmm5=col3 movdqa XMMWORD [wk(0)], xmm2 ; wk(0)=tmp3 movdqa XMMWORD [wk(1)], xmm6 ; wk(1)=tmp2 ; -- Odd part ; xmm0=col1, xmm5=col3, xmm4=col5, xmm7=col7 movdqa xmm2,xmm0 movdqa xmm6,xmm4 psubw xmm0,xmm7 ; xmm0=z12 psubw xmm4,xmm5 ; xmm4=z10 paddw xmm2,xmm7 ; xmm2=z11 paddw xmm6,xmm5 ; xmm6=z13 movdqa xmm7,xmm4 ; xmm7=z10(unscaled) psllw xmm0,PRE_MULTIPLY_SCALE_BITS psllw xmm4,PRE_MULTIPLY_SCALE_BITS movdqa xmm5,xmm2 psubw xmm2,xmm6 paddw xmm5,xmm6 ; xmm5=tmp7 psllw xmm2,PRE_MULTIPLY_SCALE_BITS pmulhw xmm2,[rel PW_F1414] ; xmm2=tmp11 ; To avoid overflow... ; ; (Original) ; tmp12 = -2.613125930 * z10 + z5; ; ; (This implementation) ; tmp12 = (-1.613125930 - 1) * z10 + z5; ; = -1.613125930 * z10 - z10 + z5; movdqa xmm6,xmm4 paddw xmm4,xmm0 pmulhw xmm4,[rel PW_F1847] ; xmm4=z5 pmulhw xmm6,[rel PW_MF1613] pmulhw xmm0,[rel PW_F1082] psubw xmm6,xmm7 psubw xmm0,xmm4 ; xmm0=tmp10 paddw xmm6,xmm4 ; xmm6=tmp12 ; -- Final output stage psubw xmm6,xmm5 ; xmm6=tmp6 movdqa xmm7,xmm1 movdqa xmm4,xmm3 paddw xmm1,xmm5 ; xmm1=data0=(00 10 20 30 40 50 60 70) paddw xmm3,xmm6 ; xmm3=data1=(01 11 21 31 41 51 61 71) psraw xmm1,(PASS1_BITS+3) ; descale psraw xmm3,(PASS1_BITS+3) ; descale psubw xmm7,xmm5 ; xmm7=data7=(07 17 27 37 47 57 67 77) psubw xmm4,xmm6 ; xmm4=data6=(06 16 26 36 46 56 66 76) psraw xmm7,(PASS1_BITS+3) ; descale psraw xmm4,(PASS1_BITS+3) ; descale psubw xmm2,xmm6 ; xmm2=tmp5 packsswb xmm1,xmm4 ; xmm1=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) packsswb xmm3,xmm7 ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm5, XMMWORD [wk(1)] ; xmm5=tmp2 movdqa xmm6, XMMWORD [wk(0)] ; xmm6=tmp3 paddw xmm0,xmm2 ; xmm0=tmp4 movdqa xmm4,xmm5 movdqa xmm7,xmm6 paddw xmm5,xmm2 ; xmm5=data2=(02 12 22 32 42 52 62 72) paddw xmm6,xmm0 ; xmm6=data4=(04 14 24 34 44 54 64 74) psraw xmm5,(PASS1_BITS+3) ; descale psraw xmm6,(PASS1_BITS+3) ; descale psubw xmm4,xmm2 ; xmm4=data5=(05 15 25 35 45 55 65 75) psubw xmm7,xmm0 ; xmm7=data3=(03 13 23 33 43 53 63 73) psraw xmm4,(PASS1_BITS+3) ; descale psraw xmm7,(PASS1_BITS+3) ; descale movdqa xmm2,[rel PB_CENTERJSAMP] ; xmm2=[rel PB_CENTERJSAMP] packsswb xmm5,xmm6 ; xmm5=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74) packsswb xmm7,xmm4 ; xmm7=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75) paddb xmm1,xmm2 paddb xmm3,xmm2 paddb xmm5,xmm2 paddb xmm7,xmm2 movdqa xmm0,xmm1 ; transpose coefficients(phase 1) punpcklbw xmm1,xmm3 ; xmm1=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71) punpckhbw xmm0,xmm3 ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77) movdqa xmm6,xmm5 ; transpose coefficients(phase 1) punpcklbw xmm5,xmm7 ; xmm5=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73) punpckhbw xmm6,xmm7 ; xmm6=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75) movdqa xmm4,xmm1 ; transpose coefficients(phase 2) punpcklwd xmm1,xmm5 ; xmm1=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33) punpckhwd xmm4,xmm5 ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73) movdqa xmm2,xmm6 ; transpose coefficients(phase 2) punpcklwd xmm6,xmm0 ; xmm6=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37) punpckhwd xmm2,xmm0 ; xmm2=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77) movdqa xmm3,xmm1 ; transpose coefficients(phase 3) punpckldq xmm1,xmm6 ; xmm1=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17) punpckhdq xmm3,xmm6 ; xmm3=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37) movdqa xmm7,xmm4 ; transpose coefficients(phase 3) punpckldq xmm4,xmm2 ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57) punpckhdq xmm7,xmm2 ; xmm7=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77) pshufd xmm5,xmm1,0x4E ; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07) pshufd xmm0,xmm3,0x4E ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27) pshufd xmm6,xmm4,0x4E ; xmm6=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47) pshufd xmm2,xmm7,0x4E ; xmm2=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67) mov rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm1 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3 mov rdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm7 mov rdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm5 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0 mov rdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm2 uncollect_args mov rsp,rbp ; rsp <- aligned rbp pop rsp ; rsp <- original rbp pop rbp ret ret ; For some reason, the OS X linker does not honor the request to align the ; segment unless we do this. align 16
34.677485
80
0.67934
9859ba9ada2e12508c2da4c55885638094a760d5
540
asm
Assembly
oeis/016/A016775.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/016/A016775.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/016/A016775.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A016775: (3*n)^11. ; 0,177147,362797056,31381059609,743008370688,8649755859375,64268410079232,350277500542221,1521681143169024,5559060566555523,17714700000000000,50542106513726817,131621703842267136,317475837322472439,717368321110468608,1532278301220703125,3116402981210161152,6071163615208263051,11384956040305711104,20635899893042801193,36279705600000000000,62050608388552823487,103510234140112521216,168787390185178426269,269561249468963094528,422351360321044921875,650190514836423555072,984770902183611232881 pow $0,11 mul $0,177147
90
493
0.909259
24acb0cbf006cb106b665d8713e0ff39191f1c6e
130
asm
Assembly
MULTIPLICATION.asm
apsrcreatix/8086
11b9e79a2980fcbfc1b2b5e74f4f38253e583101
[ "CC0-1.0" ]
40
2017-12-27T22:58:38.000Z
2022-03-15T03:44:03.000Z
MULTIPLICATION.asm
carlpaez/8086
11b9e79a2980fcbfc1b2b5e74f4f38253e583101
[ "CC0-1.0" ]
null
null
null
MULTIPLICATION.asm
carlpaez/8086
11b9e79a2980fcbfc1b2b5e74f4f38253e583101
[ "CC0-1.0" ]
15
2018-02-14T07:42:16.000Z
2022-03-15T03:16:34.000Z
ASSUME CS : CODE , DS :DATA CODE SEGMENT START : MOV AX,002H MOV BX,003H MUL BX ENDS ENDS START
10
28
0.538462
1b51cca416e0baaf91a943d01848c9de47c0ec0b
2,251
asm
Assembly
Library/Compress/compressManager.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Compress/compressManager.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Compress/compressManager.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC/GEOS MODULE: Compress -- Compress FILE: compressManager.asm AUTHOR: David Loftesness, April 26, 1992 REVISION HISTORY: Name Date Description ---- ---- ----------- dl 04/26/92 Initial revision. DESCRIPTION: Manager for this module. $Id: compressManager.asm,v 1.1 97/04/04 17:49:09 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ _Compress = 1 ;Standard include files include geos.def include geode.def include ec.def include library.def include geode.def include resource.def include object.def include graphics.def include gstring.def include win.def include heap.def include lmem.def include timer.def include timedate.def include system.def include file.def include fileEnum.def include vm.def include chunkarr.def include thread.def include sem.def DefLib compress.def ;------------------------------------------------------------------------------ ; Include definitions. ;------------------------------------------------------------------------------ include compressConstant.def ;------------------------------------------------------------------------------ ; Local variables. ;------------------------------------------------------------------------------ include compressVariable.def ;------------------------------------------------------------------------------ ; Misc. Functions (from PKWARE library) ;------------------------------------------------------------------------------ ;PK_TEXT segment private 'CODE' ; ; We'll have to deal with the "segment for XXXX unknown" warnings. It doesn't ; hurt anything. There's no way to map to a "private" segment ; global IMPLODE:far global EXPLODE:far ;PK_TEXT ends ;------------------------------------------------------------------------------ ; Here comes the code... ;------------------------------------------------------------------------------ CompressCode segment resource include compressIO.asm include compressMain.asm ; Main code file for this module. CompressCode ends
26.482353
80
0.466015
42fd88d98115e936ccfbbc61c6ba14adc59ea6e5
338
asm
Assembly
programs/oeis/201/A201208.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/201/A201208.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/201/A201208.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A201208: One 1, two 2's, three 1's, four 2's, five 1's, ... ; 1,2,2,1,1,1,2,2,2,2,1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2 lpb $0 add $1,1 sub $0,$1 trn $0,1 lpe mod $1,2 add $1,1 mov $0,$1
28.166667
201
0.508876
2b72ef97e9fbd5d2bcbb6488f3823329aee7551d
1,431
asm
Assembly
scripts/blueshouse.asm
etdv-thevoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
1
2022-01-09T05:28:52.000Z
2022-01-09T05:28:52.000Z
scripts/blueshouse.asm
ETDV-TheVoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
null
null
null
scripts/blueshouse.asm
ETDV-TheVoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
null
null
null
BluesHouseScript: call EnableAutoTextBoxDrawing ld hl, BluesHouseScriptPointers ld a, [wBluesHouseCurScript] jp CallFunctionInTable BluesHouseScriptPointers: dw BluesHouseScript0 dw BluesHouseScript1 BluesHouseScript0: SetEvent EVENT_ENTERED_BLUES_HOUSE ; trigger the next script ld a, 1 ld [wBluesHouseCurScript], a ret BluesHouseScript1: ret BluesHouseTextPointers: dw BluesHouseText1 dw BluesHouseText2 dw BluesHouseText3 BluesHouseText1: TX_ASM CheckEvent EVENT_GOT_TOWN_MAP jr nz, .GotMap CheckEvent EVENT_GOT_POKEDEX jr nz, .GiveMap ld hl, DaisyInitialText call PrintText jr .done .GiveMap ld hl, DaisyOfferMapText call PrintText lb bc, TOWN_MAP, 1 call GiveItem jr nc, .BagFull ld a, HS_TOWN_MAP ld [wMissableObjectIndex], a predef HideObject ; hide table map object ld hl, GotMapText call PrintText SetEvent EVENT_GOT_TOWN_MAP jr .done .GotMap ld hl, DaisyUseMapText call PrintText jr .done .BagFull ld hl, DaisyBagFullText call PrintText .done jp TextScriptEnd DaisyInitialText: TX_FAR _DaisyInitialText db "@" DaisyOfferMapText: TX_FAR _DaisyOfferMapText db "@" GotMapText: TX_FAR _GotMapText TX_SFX_KEY_ITEM db "@" DaisyBagFullText: TX_FAR _DaisyBagFullText db "@" DaisyUseMapText: TX_FAR _DaisyUseMapText db "@" BluesHouseText2: ; Daisy, walking around TX_FAR _BluesHouseText2 db "@" BluesHouseText3: ; map on table TX_FAR _BluesHouseText3 db "@"
15.9
42
0.790356
04a5038f17b52a455fad76b5342aade37fed4ef4
1,432
asm
Assembly
programs/oeis/053/A053439.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/053/A053439.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/053/A053439.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A053439: Expansion of (1+x+2*x^3)/((1-x)*(1-x^2)^2). ; 1,2,4,8,11,18,22,32,37,50,56,72,79,98,106,128,137,162,172,200,211,242,254,288,301,338,352,392,407,450,466,512,529,578,596,648,667,722,742,800,821,882,904,968,991,1058,1082,1152,1177,1250,1276,1352,1379,1458,1486,1568,1597,1682,1712,1800,1831,1922,1954,2048,2081,2178,2212,2312,2347,2450,2486,2592,2629,2738,2776,2888,2927,3042,3082,3200,3241,3362,3404,3528,3571,3698,3742,3872,3917,4050,4096,4232,4279,4418,4466,4608,4657,4802,4852,5000,5051,5202,5254,5408,5461,5618,5672,5832,5887,6050,6106,6272,6329,6498,6556,6728,6787,6962,7022,7200,7261,7442,7504,7688,7751,7938,8002,8192,8257,8450,8516,8712,8779,8978,9046,9248,9317,9522,9592,9800,9871,10082,10154,10368,10441,10658,10732,10952,11027,11250,11326,11552,11629,11858,11936,12168,12247,12482,12562,12800,12881,13122,13204,13448,13531,13778,13862,14112,14197,14450,14536,14792,14879,15138,15226,15488,15577,15842,15932,16200,16291,16562,16654,16928,17021,17298,17392,17672,17767,18050,18146,18432,18529,18818,18916,19208,19307,19602,19702,20000,20101,20402,20504,20808,20911,21218,21322,21632,21737,22050,22156,22472,22579,22898,23006,23328,23437,23762,23872,24200,24311,24642,24754,25088,25201,25538,25652,25992,26107,26450,26566,26912,27029,27378,27496,27848,27967,28322,28442,28800,28921,29282,29404,29768,29891,30258,30382,30752,30877,31250 mov $2,$0 mov $3,$0 div $3,2 sub $2,$3 mul $0,$2 mov $1,$0 add $1,1 add $1,$3
119.333333
1,297
0.778631
7e7b696b3ac092de797e7f187819dee4feee16bd
727
asm
Assembly
oeis/177/A177970.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/177/A177970.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/177/A177970.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A177970: Array T(n,m) = A177944(2*n,2*m) read by antidiagonals. ; Submitted by Christian Krause ; 1,1,1,1,26,1,1,99,99,1,1,244,622,244,1,1,485,2300,2300,485,1,1,846,6423,12000,6423,846,1,1,1351,15001,45031,45031,15001,1351,1,1,2024,30924,136120,218774,136120,30924,2024,1,1,2889,58122,352698,831384,831384,352698,58122,2889,1,1,3970,101725,813940,2645350,3879856,2645350,813940,101725,3970,1,1,5291,168223,1716077,7354688,14872836,14872836,7354688,1716077,168223,5291,1,1,6876,265626,3364876,18386751,49031376,67603876,49031376,18386751,3364876,265626,6876,1,1,8749,403624,6216184,42181399 mul $0,2 lpb $0 add $2,2 sub $0,$2 mov $1,$2 bin $1,$0 sub $1,1 lpe add $2,1 mul $2,2 mul $2,$1 mov $0,$2 div $0,2 add $0,1
38.263158
493
0.734525
0683bc064a47a990d19f49ef05119c72ab965b18
407
asm
Assembly
oeis/136/A136550.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/136/A136550.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/136/A136550.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A136550: a(n) = C(2^n + 2*n, n) * 2^n / (2^n + 2*n); a(n) = coefficient of x^n in Catalan(x)^(2^n). ; Submitted by Christian Krause ; 1,2,14,208,7084,648128,184100160,179176044032,630345044388960,8204566969800002560,398166559635173802124288,72163718410109803095272136704,48857217948449362973220983661357056 mov $1,$0 mov $2,2 pow $2,$0 dif $2,2 add $0,$2 mul $0,2 bin $0,$1 mul $0,$2 add $2,$1 div $0,$2
27.133333
174
0.702703
df1bc0927b80265ddfd4a7ac9aa6dfe711d73656
3,136
asm
Assembly
2nd set/ask2.2.asm
PolyviosPap/Microprocessors_Laboratory_NTUA
859d8041e6199aea8652c46ba7bdf975d5b440c4
[ "MIT" ]
null
null
null
2nd set/ask2.2.asm
PolyviosPap/Microprocessors_Laboratory_NTUA
859d8041e6199aea8652c46ba7bdf975d5b440c4
[ "MIT" ]
null
null
null
2nd set/ask2.2.asm
PolyviosPap/Microprocessors_Laboratory_NTUA
859d8041e6199aea8652c46ba7bdf975d5b440c4
[ "MIT" ]
null
null
null
READ MACRO MOV AH,8 INT 21H ENDM PRINT MACRO CHAR ;Print a char. MOV DL,CHAR MOV AH,2 INT 21H ENDM PRINT_STR MACRO STRING ;Print string. MOV DX,OFFSET STRING MOV AH,9 INT 21H ENDM DATA SEGMENT MS1 DB "Give 3 dec digits: ", '$' MS2 DB 0AH,0DH,'$' MS3 DB "Hex: ", '$' VR1 DB 100D VR2 DB 10D DATA ENDS CODE SEGMENT ASSUME CS:CODE, DS:DATA, SS:STACK IS_NUMBER PROC NEAR ADD AL,30H PRINT AL RET IS_LETTER PROC NEAR ADD AL,37H PRINT AL RET MAIN PROC FAR MOV AX,DATA MOV DS,AX START: PRINT_STR MS1; ;Print start message. READ_D1: READ ;Read 1st digit. CMP AL,51H ;Check if it is 'Q' JE THE_END ;or 'q' and if so, terminate CMP AL,71H ;the program. JE THE_END CMP AL,30H ;Now check if it is valid, JL READ_D1 ;if not ignore it and CMP AL,39H ;repeat. JG READ_D1 AND AH,00H PUSH AX ;Save it as ASCII. READ_D2: READ ;Read 2nd digit. CMP AL,51H ;Same logic. JE THE_END CMP AL,71H JE THE_END CMP AL,30H JL READ_D2 CMP AL,39H JG READ_D2 AND AH,00H PUSH AX ;Save the 2nd one. READ_D3: READ ;Read 3rd digit. CMP AL,51H ;Same logic. JE THE_END CMP AL,71H JE THE_END CMP AL,30H JL READ_D3 CMP AL,39H JG READ_D3 AND AH,00H PUSH AX ;Save the 3rd, READ_TILL_ENTER: ;Read the last key. READ CMP AL,0DH ;If it is 'ENTER' JE PRINT_DEC ;print the dec num. CMP AL,51H ;Check if you have to JE THE_END ;terminate the program. CMP AL,71H JE THE_END CMP AL,30H ;And now check if it is valid. JL READ_TILL_ENTER ;If not, read again. CMP AL,39H JG READ_TILL_ENTER POP BX ;The (now) 2nd digit. POP CX ;The (now) 1st digit. POP DX ;We don't need that anymore. AND AH,00H PUSH CX ;Save the 1st, PUSH BX ;etc. PUSH AX JMP READ_TILL_ENTER ;Repeat. PRINT_DEC: POP CX ;3rd digit. POP BX ;2nd digit. POP AX ;1st digit. PUSH BX PUSH CX PRINT AL ;Print the 1st digit. AND AH,00H AND AL,0FH ;Convert it into hex, MUL VR1 ;multiply it by 100 MOV BX,AX ;and store it into BX. POP CX ;3rd didit. POP AX ;2nd digit. PRINT AL ;Same logic. AND AH,00H AND AL,0FH MUL VR2 ;Multiply it by 10 ADD BX,AX ;and add it to BX. MOV AX,CX ;3rd digit. PRINT AL ;Same logic. AND AH,00H AND AL,0FH ADD BX,AX PRINT_STR MS2 ;Change line. PRINT_STR MS3 ;Print second message. MOV AX,BX ;BX holds the number. MOV AL,AH ;Move the 1st hex digit to AL. CMP AL,09H ;Check if it's a number or JLE L1 ;a letter. CALL IS_LETTER JMP L2 L1: CALL IS_NUMBER L2: MOV AX,BX ;Same logic. AND AL,11110000b ROR AL,4 CMP AL,09H JLE L3 CALL IS_LETTER JMP L4 L3: CALL IS_NUMBER L4: MOV AX,BX AND AL,00001111b CMP AL,09H JLE L5 CALL IS_LETTER JMP L6 L5: CALL IS_NUMBER L6: PRINT_STR MS2 ;Change line. JMP START THE_END: ;Terminate the program. MOV AH, 0 INT 21H MAIN ENDP CODE ENDS END MAIN
17.92
46
0.612564
a870662204ae8e33ddb05015f7cee99cf052e194
7,129
asm
Assembly
hypervisor/hypervisor.asm
TheMachine02/Sorcery
ee657f5a64049bee0c947add7ff2cb92d7281ec1
[ "MIT" ]
14
2020-05-27T13:20:35.000Z
2022-02-10T01:19:54.000Z
hypervisor/hypervisor.asm
TheMachine02/Sorcery
ee657f5a64049bee0c947add7ff2cb92d7281ec1
[ "MIT" ]
10
2020-06-12T20:53:03.000Z
2021-03-21T23:11:44.000Z
hypervisor/hypervisor.asm
TheMachine02/Sorcery
ee657f5a64049bee0c947add7ff2cb92d7281ec1
[ "MIT" ]
84
2020-06-11T06:27:03.000Z
2021-05-29T17:06:24.000Z
define VM_HYPERVISOR_FLAG $D00080 define VM_HYPERVISOR_SETTINGS -1 define VM_HYPERVISOR_DATA -4 define VM_HYPERVISOR_ADRESS $0BF000 define VM_HYPERVISOR_RAM_ADRESS $D3F000 define VM_HYPERVISOR_RAM $D00000 ; some scratch RAM define VM_HYPERVISOR_LUT 0 define VM_HYPERVISOR_AWARE $DEC0ADDE _sprintf equ 00000BCh _os_GetSystemStats equ 0021ED4h virtual at VM_HYPERVISOR_RAM vm_guest_count: db 0 ; guest table pointing to "header" of leaf file vm_guest_table: rb 54 vm_cursor: db 0 vm_delay: db 0 vm_second: db 0 vm_string_boot: rb 64 end virtual hypervisor_ram:=$ hypervisor_offset:= $ - VM_HYPERVISOR_ADRESS guest_tios_interrupt_jp_ram:= guest_tios_interrupt_jp + hypervisor_offset guest_tios_nmi_jp_ram:= guest_tios_nmi_jp + hypervisor_offset guest_tios_boot_jp_ram:= guest_tios_boot_jp + hypervisor_offset guest_tios_name_ram:= guest_tios_name + hypervisor_offset org VM_HYPERVISOR_ADRESS hypercall: jr .flash_unlock dw 0 jr .flash_lock dw 0 ; other if needed .flash_unlock: ; need to be in privileged flash actually in0 a, ($06) or a, 4 out0 ($06), a ; flash sequence ld a, 4 di jr $+2 di rsmix im 1 out0 ($28), a in0 a, ($28) bit 2, a ret .flash_lock: xor a, a out0 ($28), a in0 a, ($06) res 2, a out0 ($06), a ret ; guest data ; guest_tios: ; header jr .init dw $0000 .interrupt: guest_tios_interrupt_jp:=$+1 jp $0 .nmi: guest_tios_nmi_jp:=$+1 jp $0 dd VM_HYPERVISOR_AWARE guest_tios_name:=$ db "TI-os version 0.0.0", 0 .init: ; cleanup LCD state ld hl, $E4002D ld a, l ld de, $D40000 ld bc, 76800*2 ldir ld ($E30018), a ; actual jump pointer guest_tios_boot_jp:=$+1 jp $0 guest_custom: ; custom image should be leaf file exposing a 'special' header at entry point ; jp .init / jp .interrupt / jp .nmi / dd VM_HYPERVISOR_AWARE / NAME / db 0 hypervisor: ; NOTE : we check for value = 0, but overriding the value in RAM could be *very* bad either way .init: call .boot_detect bit VM_HYPERVISOR_LUT, (iy+VM_HYPERVISOR_SETTINGS) jr z, guest_tios.init ld hl, (iy+VM_HYPERVISOR_DATA) add hl, de or a, a sbc hl, de jr z, .init_failure ld bc, 8 add hl, bc .init_failure: jp (hl) .interrupt: bit VM_HYPERVISOR_LUT, (iy+VM_HYPERVISOR_SETTINGS) jr z, guest_tios.interrupt ld hl, (iy+VM_HYPERVISOR_DATA) add hl, de or a, a sbc hl, de jr z, .interrupt_failure jp (hl) .interrupt_failure: ; we'll need to acknowledge interrupt ourselves if we are in this very special case where interrupt are on, but we have not yet reached boot code (stupid boot 5.0.0) ld hl, ($F00014) ld ($F00008), hl pop hl pop iy pop ix exx ex af, af' ei ret .nmi: bit VM_HYPERVISOR_LUT, (iy+VM_HYPERVISOR_SETTINGS) jr z, guest_tios.nmi push hl push af ld hl, VM_HYPERVISOR_FLAG+VM_HYPERVISOR_DATA ld hl, (hl) add hl, de or a, a sbc hl, de jr z, .nmi_restart pop af inc hl inc hl inc hl inc hl ex (sp), hl ret .nmi_restart: pop af pop hl ; nothing loaded ? Boot reset rst $08 .boot_detect: di xor a, a sbc hl, hl ld (VM_HYPERVISOR_DATA), hl ; NOTE : does there is even a TI OS installed ? ; (in theory, we answer always here, since we chained ourselves to the TIOS, and we will fall with it) ; try to detect ti os version ld hl, guest_tios ld (vm_guest_table), hl ld (vm_cursor), a inc a ld (vm_guest_count), a ; we have the correct substring version, and entry point with guest_tios ; we need to parse tifs and find leaf file that could be launched call .boot_search_leaf ; the table was filled ; minimal LCD init ld hl, $D40000 ld ($E30010), hl ld a,$27 ld ($E30018), a ld ($E30200), hl ; palette cleanup ld hl, $E4FFFF ld ($E30202), hl ld de, $E30204 ld bc, 508 ldir or a, a sbc hl, hl ld ix, $000100 ld bc, .boot_string_choose call .putstring ld hl, vm_delay ld (hl), 60 inc hl ld (hl), 4 .boot_choose_loop: ld bc, $00083c .wait: call .vsync ld hl, vm_delay dec (hl) jr nz, .no_decrement ld (hl), c inc hl dec (hl) jp z, .boot_do .no_decrement: djnz .wait ld hl, vm_second ld c, (hl) push bc ld bc, .boot_string_enter push bc inc hl push hl call _sprintf pop bc ld hl, 6 add hl, sp ld sp, hl ld hl, 19*256+0 ld ix, $000100 call .putstring lea hl, ix+3 .boot_display_name: ld a, (vm_guest_count) ld b, a .boot_display_loop: push hl push bc ld a, (vm_cursor) inc a ld ix, $000100 cp a, h jr nz, .boot_reverse_color ld ix, $010001 .boot_reverse_color: ;; ld hl, 2*256+3 push hl ld a, h dec a or a, a sbc hl, hl ld l, a add hl, hl add hl, hl add hl, hl ld bc, vm_guest_table add hl, bc ld hl, (hl) ld bc, 16 add hl, bc push hl pop bc pop hl call .putstring pop bc pop hl inc h djnz .boot_display_loop ld hl, $F50000 ld (hl), 2 xor a, a .scan_wait: cp a, (hl) jr nz, .scan_wait ld l, $1E ld a, (hl) ld hl, vm_cursor rra jr nc, .boot_next0 inc (hl) call .boot_reset_time .boot_next0: bit 2, a jr z, .boot_next1 dec (hl) call .boot_reset_time .boot_next1: jp p, .boot_still_pos ld (hl), b .boot_still_pos: ld a, (vm_guest_count) dec a cp a, (hl) jr nc, .boot_still_up ld (hl), a .boot_still_up: ld a, ($F5001C) rra jp nc, .boot_choose_loop .boot_do: ld iy, VM_HYPERVISOR_FLAG ld a, (vm_cursor) or a, a res VM_HYPERVISOR_LUT, (iy+VM_HYPERVISOR_SETTINGS) ret z sbc hl, hl ld l, a add hl, hl add hl, hl add hl, hl ld bc, vm_guest_table add hl, bc ld ix, (hl) inc hl inc hl inc hl inc hl ld hl, (hl) ld (iy+VM_HYPERVISOR_DATA), hl set VM_HYPERVISOR_LUT, (iy+VM_HYPERVISOR_SETTINGS) lea iy, ix-16 jp leaf.exec_static .boot_reset_time: push hl ld hl, vm_delay ld (hl), 60 inc hl ld (hl), 4 pop hl ret .boot_search_leaf: ld b, $34 ld hl, $0C0000 .boot_parse: push bc ; create an inode for each file found and fill it ld a, (hl) cp a, $F0 jr nz, .boot_invalid_sector inc hl push hl .boot_parse_sector: ld a, (hl) ; unexpected value, quit current sector cp a, $F0 jr z, .boot_skip_file cp a, $FC jr z, .boot_check_file .boot_parse_sector_continue: pop hl .boot_invalid_sector: ld bc, 65536 add hl, bc ld h, b ld l, c pop bc djnz .boot_parse ret .boot_skip_file: inc hl inc.s bc ld c, (hl) inc hl ld b, (hl) inc hl add hl, bc jr .boot_parse_sector .boot_check_file: inc hl inc.s bc ld c, (hl) inc hl ld b, (hl) inc hl push hl add hl, bc ex (sp), hl ld a, (hl) ; file type ld bc, 6 cp a, c jr nz, .boot_next add hl, bc ; goes directly to NAME ld c, (hl) add hl, bc ; skiped name, now five byte to skip ld c, 5 add hl, bc ; hl = start of file push hl pop iy call leaf.check_file jr nz, .boot_next ; it is one of our ! ld a, (vm_guest_count) or a, a sbc hl, hl ld l, a add hl, hl add hl, hl add hl, hl ld bc, vm_guest_table add hl, bc lea iy, iy + LEAF_HEADER_SIZE ld (hl), iy inc hl inc hl inc hl inc hl ld bc, (iy+LEAF_HEADER_ENTRY-LEAF_HEADER_SIZE) inc bc inc bc inc bc inc bc ld (hl), bc inc a ld (vm_guest_count), a .boot_next: pop hl jp .boot_parse_sector .boot_string_choose: db "Choose OS to boot from :", 0 .boot_string_enter: db "Press Enter to boot. Boot selected in %2d second(s)", 0
16.464203
165
0.693225
3634884db41601c1bf221aca862e885cafd97d58
749
asm
Assembly
oeis/264/A264656.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/264/A264656.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/264/A264656.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A264656: Number of n X 1 arrays of permutations of 0..n*1-1 with rows nondecreasing modulo 2 and columns nondecreasing modulo 5. ; Submitted by Jamie Morken(w1) ; 1,1,1,1,1,2,4,8,16,32,96,288,864,2592,7776,31104,124416,497664,1990656,7962624,39813120,199065600,995328000,4976640000,24883200000,149299200000,895795200000,5374771200000,32248627200000,193491763200000,1354442342400000,9481096396800000,66367674777600000,464573723443200000,3252016064102400000,26016128512819200000,208129028102553600000,1665032224820428800000,13320257798563430400000,106562062388507443200000,959058561496566988800000,8631527053469102899200000,77683743481221926092800000 mov $3,2 lpb $0 mov $2,$0 sub $0,1 div $2,5 mul $2,$3 add $3,$2 lpe mov $0,$3 div $0,2
49.933333
487
0.82243
e7e13abaa767e4f7586fc84e421a7dd28b3d9951
195
asm
Assembly
untested/ARM/intSqrt.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
untested/ARM/intSqrt.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
untested/ARM/intSqrt.asm
GabrielRavier/Generic-Assembly-Samples
fbf803960a14307b7fce0165058d0d4048abaf42
[ "Unlicense" ]
null
null
null
code32 format ELF public _intSqrt section '.text' executable align 16 _intSqrt: vmov s15, r0 vcvt.f64.s32 d6, s15 vsqrt.f64 d7, d6 vcvt.s32.f64 s0, d7 vmov r0, s0 bx lr
12.1875
35
0.651282
f0e0977a05ad3554e2ab981361c3fcfd40272eeb
427
asm
Assembly
rando/src/asm-disabled/progressive-items.asm
konkers/neutopia
770dbbc3dd6a61d418f38683f43ccfb729ea1039
[ "MIT" ]
1
2020-07-02T21:01:53.000Z
2020-07-02T21:01:53.000Z
rando/src/asm-disabled/progressive-items.asm
konkers/neutopia
770dbbc3dd6a61d418f38683f43ccfb729ea1039
[ "MIT" ]
2
2020-07-04T20:54:33.000Z
2020-07-06T17:34:55.000Z
rando/src/asm-disabled/progressive-items.asm
konkers/neutopia
770dbbc3dd6a61d418f38683f43ccfb729ea1039
[ "MIT" ]
1
2020-07-03T19:26:32.000Z
2020-07-03T19:26:32.000Z
arch pce.cpu macro seek(variable offset) { origin (offset - $6000) base offset } seek($ddf1); get_sword_handler: dw handle_progressive_item dw handle_progressive_item dw handle_progressive_item seek($df52); handle_progressive_item: ldx $35d0 inc $2e44,x // Store the value back to $35d1 so the rest of the code knows // which item to show. lda $2e44,x sta $35d1 jmp $de79
17.08
66
0.674473
86c3d5ac61bf97e088b49502110ec1fc0966c601
771
asm
Assembly
artwork/goblin/goblin_idle.asm
fjpena/sword-of-ianna-zx
fdd6bdb5775933756e75402a7c6be80d5334702d
[ "Apache-2.0" ]
67
2017-10-07T18:48:05.000Z
2022-02-01T20:37:40.000Z
artwork/goblin/goblin_idle.asm
fjpena/sword-of-ianna-zx
fdd6bdb5775933756e75402a7c6be80d5334702d
[ "Apache-2.0" ]
null
null
null
artwork/goblin/goblin_idle.asm
fjpena/sword-of-ianna-zx
fdd6bdb5775933756e75402a7c6be80d5334702d
[ "Apache-2.0" ]
9
2017-10-06T21:02:55.000Z
2022-01-06T03:11:58.000Z
; ASM source file created by SevenuP v1.20 ; SevenuP (C) Copyright 2002-2006 by Jaime Tejedor Gomez, aka Metalbrain ;GRAPHIC DATA: ;Pixel Size: ( 24, 32) ;Char Size: ( 3, 4) ;Sort Priorities: X char, Char line, Y char ;Data Outputted: Gfx ;Interleave: Sprite ;Mask: No goblin_idle: DEFB 0, 4,128, 0, 8, 0, 0, 13 DEFB 192, 0, 19,224, 0, 12, 0, 0 DEFB 4, 64, 1,197,224, 2,229,144 DEFB 3,161,240, 5,195, 0, 4, 18 DEFB 176, 14,137,224, 15, 68, 0, 14 DEFB 130, 32, 5, 65, 80, 16,128,128 DEFB 60, 0,144, 16,131, 64, 5, 76 DEFB 32, 14,128, 0, 7, 85, 56, 6 DEFB 128, 72, 3, 0,104, 27,207,104 DEFB 19,149,104, 1,128,104, 0, 32 DEFB 104, 1, 69,112, 0,138, 0, 1 DEFB 197, 0, 1,242,128, 2,169, 64
32.125
72
0.575875
fa90a95ba3e0b1667bfdc51fce4410ead2985150
571
a51
Assembly
LED Interfacing/Patterns/Pattern2.a51
dmdhrumilmistry/8051-Codes
f7c1051daddb17851befe0ebc959ecc444d6def9
[ "MIT" ]
null
null
null
LED Interfacing/Patterns/Pattern2.a51
dmdhrumilmistry/8051-Codes
f7c1051daddb17851befe0ebc959ecc444d6def9
[ "MIT" ]
null
null
null
LED Interfacing/Patterns/Pattern2.a51
dmdhrumilmistry/8051-Codes
f7c1051daddb17851befe0ebc959ecc444d6def9
[ "MIT" ]
null
null
null
// PATTERN 2 ON PORT 2 // // . . // . . . . // . . . . . . // . . . . . . . . // 0 1 2 3 4 5 6 7 // MAIN PROGRAM REPEAT: MOV P2, #00H ACALL DELAY SETB P2.3 SETB P2.4 ACALL DELAY SETB P2.2 SETB P2.5 ACALL DELAY SETB P2.1 SETB P2.6 ACALL DELAY SETB P2.0 SETB P2.7 ACALL DELAY SJMP REPEAT // DELAY FOR 50MS DELAY: MOV TMOD,#10H MOV TL1,#0B0H MOV TH1,#3CH MOV TCON,#40H WAIT: JNB TF1, WAIT CLR TF1 CLR TR1 RET // DELAY 500MS = 0.5S DELAY500: MOV R7,#0AH BACK: ACALL DELAY DJNZ R1, BACK RET END
13.926829
22
0.539405
7d6fdcac7a61996f0c4c8c8f1eb1fdf62e09a373
635
asm
Assembly
programs/oeis/100/A100287.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/100/A100287.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/100/A100287.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A100287: First occurrence of n in A100002; the least k such that A100002(k) = n. ; 1,2,5,9,15,25,31,43,61,67,87,103,123,139,169,183,219,241,259,301,331,361,391,447,463,511,553,589,643,687,723,783,819,867,931,979,1027,1099,1179,1227,1309,1347,1393,1479,1539,1603,1699,1759,1863,1909,2019,2029,2163,2263,2311,2439,2527,2559,2707,2779,2851,2979,3073,3159,3207,3373,3447,3553,3691,3819,3883,3987,4123,4239,4347,4429,4621,4681,4843,4899,5149,5173,5329,5539,5563,5763,5893,6013,6121,6283,6399,6579,6723,6859,6939,7201,7309,7419,7683,7743 mov $1,$0 lpb $1 mul $0,$1 sub $1,1 mov $2,$1 cmp $2,0 add $1,$2 div $0,$1 lpe add $0,1
45.357143
450
0.71811
07a9e54f8722401b5eae9bc68fc3331445adcf25
710
asm
Assembly
Working Disassembly/Levels/LBZ/Misc Object Data/Map - Cup Elevator.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
5
2021-07-09T08:17:56.000Z
2022-02-27T19:57:47.000Z
Working Disassembly/Levels/LBZ/Misc Object Data/Map - Cup Elevator.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Working Disassembly/Levels/LBZ/Misc Object Data/Map - Cup Elevator.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
7e8a2c5df02271615ff4cae529521e6b1560d6b1
[ "Apache-2.0" ]
null
null
null
Map_22619A: dc.w Frame_2261A4-Map_22619A ; ... dc.w Frame_2261B2-Map_22619A dc.w Frame_2261BA-Map_22619A dc.w Frame_2261C8-Map_22619A dc.w Frame_2261DC-Map_22619A Frame_2261A4: dc.w 2 dc.b $F0, $F, 0, 0,$FF,$E0 dc.b $F0, $F, 8, 0, 0, 0 Frame_2261B2: dc.w 1 dc.b $F8, 5, 0,$10,$FF,$F8 Frame_2261BA: dc.w 2 dc.b $F4, 6, 0,$14,$FF,$F0 dc.b $F4, 6, 8,$14, 0, 0 Frame_2261C8: dc.w 3 dc.b $D0, 7, 0,$1A,$FF,$F8 dc.b $F0, 7, 0,$1A,$FF,$F8 dc.b $10, 7, 0,$1A,$FF,$F8 Frame_2261DC: dc.w 6 dc.b $A0, 7, 0,$1A,$FF,$F8 dc.b $C0, 7, 0,$1A,$FF,$F8 dc.b $E0, 7, 0,$1A,$FF,$F8 dc.b 0, 7, 0,$1A,$FF,$F8 dc.b $20, 7, 0,$1A,$FF,$F8 dc.b $40, 7, 0,$1A,$FF,$F8
28.4
46
0.549296
7d1390ff7132cf0fc214479f957e3ec26538806d
6,415
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48_notsx.log_21829_633.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48_notsx.log_21829_633.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48_notsx.log_21829_633.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 %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x140ea, %rsi lea addresses_normal_ht+0x23ca, %rdi nop nop dec %r13 mov $48, %rcx rep movsq nop nop nop nop add $49299, %r14 lea addresses_WC_ht+0x47aa, %rsi lea addresses_D_ht+0xcaec, %rdi nop nop cmp $16454, %r13 mov $111, %rcx rep movsq nop nop nop nop nop add %rsi, %rsi lea addresses_UC_ht+0x978a, %rsi lea addresses_WC_ht+0xbb6a, %rdi and %r12, %r12 mov $59, %rcx rep movsl nop nop nop nop inc %rdi lea addresses_D_ht+0x12eea, %rcx nop nop nop nop nop add %rbx, %rbx mov $0x6162636465666768, %rdi movq %rdi, %xmm7 movups %xmm7, (%rcx) nop nop nop nop cmp $2726, %r14 lea addresses_WC_ht+0x4dba, %rcx nop nop sub %r14, %r14 mov (%rcx), %r12 nop nop nop inc %rsi lea addresses_WT_ht+0x1136a, %rsi nop nop sub $43100, %r12 movb $0x61, (%rsi) nop nop nop sub $8976, %rbx lea addresses_WT_ht+0xab7e, %r13 nop nop nop nop nop cmp %r12, %r12 mov $0x6162636465666768, %rcx movq %rcx, %xmm7 vmovups %ymm7, (%r13) nop nop nop nop sub $23344, %r14 lea addresses_UC_ht+0xbfa, %r13 nop nop nop nop xor %rcx, %rcx movb $0x61, (%r13) nop nop nop nop add $4199, %r14 lea addresses_normal_ht+0x1b4ea, %rsi nop nop nop xor $61259, %r13 mov $0x6162636465666768, %r12 movq %r12, (%rsi) lfence lea addresses_D_ht+0x1d3c7, %r12 nop dec %r13 movl $0x61626364, (%r12) nop add %rbx, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r14 push %r9 push %rax push %rcx push %rsi // Faulty Load mov $0x2e191a0000000f6a, %rax nop dec %r9 mov (%rax), %esi lea oracles, %r9 and $0xff, %rsi shlq $12, %rsi mov (%r9,%rsi,1), %rsi pop %rsi pop %rcx pop %rax pop %r9 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_NC', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_NC', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D_ht', 'congruent': 6}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 2}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 0}, 'OP': 'STOR'} {'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 7}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 0}, 'OP': 'STOR'} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
37.296512
2,999
0.660639
e11817073049461d0e56940d31fd517adf6b9cc9
276
asm
Assembly
libsrc/_DEVELOPMENT/arch/hbios/c/sccz80/hbios_a_dehl.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/hbios/c/sccz80/hbios_a_dehl.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/hbios/c/sccz80/hbios_a_dehl.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; uint8_t hbios_a_dehl(uint16_t func_device, uint32_t arg) __smallc SECTION code_clib SECTION code_arch PUBLIC hbios_a_dehl EXTERN asm_hbios_a .hbios_a_dehl pop af pop hl pop de pop bc push bc push de push hl push af jp asm_hbios_a
11.5
67
0.699275
13b2918c5bfaf47a33f9dd4a624a9162123f2373
209
asm
Assembly
Tests/yasm-regression/iret.asm
13xforever/x86-assembly-textmate-bundle
f1bb62f77b776d87d0fd85b0276d4237ff72c43c
[ "MIT" ]
69
2015-04-16T18:01:22.000Z
2022-02-15T07:54:26.000Z
Tests/yasm-regression/iret.asm
javiercbk/x86-assembly-textmate-bundle
62d700e0196f62ef4353a9b95c2e64beb0a6afda
[ "MIT" ]
17
2016-09-20T08:49:09.000Z
2021-02-19T15:01:04.000Z
Tests/yasm-regression/iret.asm
javiercbk/x86-assembly-textmate-bundle
62d700e0196f62ef4353a9b95c2e64beb0a6afda
[ "MIT" ]
19
2016-05-31T07:11:14.000Z
2021-07-19T10:17:12.000Z
[bits 16] iret ; out: cf iretw ; out: cf iretd ; out: 66 cf [bits 32] iret ; out: cf iretw ; out: 66 cf iretd ; out: cf [bits 64] iret ; out: cf iretw ; out: 66 cf iretd ; out: cf iretq ; out: 48 cf
14.928571
19
0.588517
0d4e9382426c4ba74913edb2599ae1eaff856d19
14,896
asm
Assembly
src/bak/demo0.asm
vbguyny/c64kernel
0c9c63e822aca3b9e834025da8992c825d38e733
[ "Unlicense" ]
2
2020-10-10T21:48:25.000Z
2021-04-20T03:00:10.000Z
src/bak/demo0.asm
vbguyny/c64kernel
0c9c63e822aca3b9e834025da8992c825d38e733
[ "Unlicense" ]
1
2021-07-25T15:17:04.000Z
2021-07-27T14:49:14.000Z
src/bak/demo0.asm
vbguyny/c64kernel
0c9c63e822aca3b9e834025da8992c825d38e733
[ "Unlicense" ]
null
null
null
incasm "kernel.hdr" ;incasm "kernel.asm" ; NOTE: If you are using an enumator, ensure that the RS232 is enabled ; prior to running this demo. main @loop jsr console.clear$ ;jsr disk.reset$ lda #color.white$ sta console.setcharactercolor.color$ jsr console.setcharactercolor$ lda #<title sta console.writestr.straddress$ lda #>title sta console.writestr.straddress$+1 jsr console.writestr$ jsr console.writeln$ lda #<options sta console.writestr.straddress$ lda #>options sta console.writestr.straddress$+1 jsr console.writestr$ jsr console.writeln$ jsr console.readchr$ lda console.readchr.char$ cmp #'1' bne @not1 jsr Do1 @not1 cmp #'2' bne @not2 jsr Do2 @not2 cmp #'x' bne @notexit jsr GoBack @notexit jmp @loop rts GoBack lda #<fnback sta filename lda #>fnback sta filename+1 jsr DoLoad rts NextPrg sta fnnext+6 ; Modify the string value directly lda #<fnnext sta filename lda #>fnnext sta filename+1 jsr DoLoad rts DoLoad lda filename sta disk.loadfile.filename$ lda filename+1 sta disk.loadfile.filename$+1 jsr disk.loadfile$ jsr audio.beep$ jsr console.writeln$ jsr console.writeln$ lda #color.red$ sta console.setcharactercolor.color$ jsr console.setcharactercolor$ lda #<failed sta console.writestr.straddress$ lda #>failed sta console.writestr.straddress$+1 jsr console.writestr$ lda filename sta console.writestr.straddress$ lda filename+1 sta console.writestr.straddress$+1 jsr console.writestr$ jsr console.readchr$ lda #$00 rts PressAnyKey jsr console.writeln$ jsr console.writeln$ lda #<anykey sta console.writestr.straddress$ lda #>anykey sta console.writestr.straddress$+1 jsr console.writestr$ jsr console.readchr$ lda #$00 rts PleaseWait lda #<wait sta console.writestr.straddress$ lda #>wait sta console.writestr.straddress$+1 jsr console.writestr$ rts OpenMsg lda #<open sta console.writestr.straddress$ lda #>open sta console.writestr.straddress$+1 jsr console.writestr$ rts CloseMsg lda #<close sta console.writestr.straddress$ lda #>close sta console.writestr.straddress$+1 jsr console.writestr$ rts SendMsg lda #<send sta console.writestr.straddress$ lda #>send sta console.writestr.straddress$+1 jsr console.writestr$ rts RecvMsg lda #<recv sta console.writestr.straddress$ lda #>recv sta console.writestr.straddress$+1 jsr console.writestr$ rts DoneMsg lda #<done sta console.writestr.straddress$ lda #>done sta console.writestr.straddress$+1 jsr console.writestr$ rts Do1 ; Note: In order to run this demo you need to have one of the two environments: ; 1. An emulator that has RS232 support (such as VICE) along with ; a null modem driver (such as com0com) and a server on the workstation ; which can receive the incoming communications (such as NullEchoServer). ; ; 2. An actual C64 which has an adapter for user port to RS232/COM which ; is connected to a PC which is running a server which can process ; the incoming communications (such as NullEchoServer). ; Note: the C64 will freeze if it cannot send any data to the server. ; Note: Although RS232 supports all characters, when communicating with ; the server it is best to only use upper-cased characters. ; Note: The Kernel routines are hardcoded to transfer data at 1200 baud. ; Note: Due to a weird bug with how the C64 handles serial communications ; the kernel will discard the first byte. You don't need to do any ; special coding here but this fact needs to be known if you plan ; on writting your own server. It is best to refer to the source for ; NullEchoServer. jsr console.clear$ lda #$01 sta serial.discard_byte$ sta serial.send_eot$ sta serial.recv_eot$ ; Prompt for string lda #<sendtxt sta console.writestr.straddress$ lda #>sendtxt sta console.writestr.straddress$+1 jsr console.writestr$ jsr console.readstr$ lda console.readstr.straddress$ sta sendstr lda console.readstr.straddress$+1 sta sendstr+1 jsr console.writeln$ jsr console.writeln$ ; Open connection jsr OpenMsg jsr time.halt$ ; Need to add this otherwise the open msg prints after the open finishes. jsr serial.open$ jsr DoneMsg ; Send string to server jsr SendMsg lda sendstr sta serial.send.address$ lda sendstr+1 sta serial.send.address$+1 jsr serial.send$ jsr DoneMsg ; Receive response from server jsr RecvMsg lda #$ff sta memory.allocate.length$ lda #$00 sta memory.allocate.length$+1 jsr memory.allocate$ lda memory.allocate.address$ sta recvstr lda memory.allocate.address$+1 sta recvstr+1 lda recvstr sta serial.recv.address$ lda recvstr+1 sta serial.recv.address$+1 jsr serial.recv$ jsr DoneMsg ; Close connection jsr CloseMsg jsr serial.close$ jsr DoneMsg ; Display response lda #<recvtxt sta console.writestr.straddress$ lda #>recvtxt sta console.writestr.straddress$+1 jsr console.writestr$ lda recvstr sta console.writestr.straddress$ lda recvstr+1 sta console.writestr.straddress$+1 jsr console.writestr$ jsr PressAnyKey ; Deallocate strings lda sendstr sta memory.deallocate.address$ lda sendstr+1 sta memory.deallocate.address$+1 jsr memory.deallocate$ lda recvstr sta memory.deallocate.address$ lda recvstr+1 sta memory.deallocate.address$+1 jsr memory.deallocate$ rts Do2 ; Note: In order to run this demo you need to have one of the two environments: ; 1. An emulator that has RS232 support (such as VICE) along with ; a null modem driver (such as com0com) and a server on the workstation ; which can receive the incoming communications (such as NullModemServer). ; ; 2. An actual C64 which has an adapter for user port to RS232/COM which ; is connected to a PC which is running a server which can process ; the incoming communications (such as NullEchoServer). ; Note: the C64 will freeze if it cannot send any data to the server. ; Note: Although RS232 supports all characters, when communicating with ; the server it is best to only use upper-cased characters. ; Note: The Kernel routines are hardcoded to transfer data at 1200 baud. jsr console.clear$ lda #<inf1 sta console.writestr.straddress$ lda #>inf1 sta console.writestr.straddress$+1 jsr console.writestr$ ; Allocate buffer lda #$ff sta memory.allocate.length$ lda #$00 sta memory.allocate.length$+1 jsr memory.allocate$ lda memory.allocate.address$ sta resp lda memory.allocate.address$+1 sta resp+1 lda #8 ; 8 = 1200 sta serial.baud$ jsr serial.open$ ; open5,2,0,chr$(8):poke665,73-(peek(678)*30) lda #$00 sta serial.recv_eot$ sta serial.discard_byte$ lda #$01 sta serial.send_eot$ ; print#5,"at&p1e1" lda #<msg1 sta serial.send.address$ lda #>msg1 sta serial.send.address$+1 jsr serial.send$ ; print#5,"at&p1e1" jsr serial.send$ lda #$00 sta serial.discard_byte$ sta serial.send_eot$ sta serial.recv_eot$ @get_data ; Reset the buffer lda resp sta memory.fill.address$ lda resp+1 sta memory.fill.address$+1 lda #serial.eot$ sta memory.fill.value$ lda #$ff sta memory.fill.length$ jsr memory.fill$ lda resp sta serial.recv.address$ lda resp+1 sta serial.recv.address$+1 jsr serial.recv$ ; get#5,a$ jsr ProcessResp @print_resp ; printa$ lda resp sta console.writestr.straddress$ lda resp+1 sta console.writestr.straddress$+1 jsr console.writestr$ @get_char ; geta$ jsr ReadKey bcc @print_requ jmp @get_data @print_requ ; print#5,a$; sta requ ; Store the key pressed cmp #$1f ; left arrow beq @Done lda #<requ sta serial.send.address$ lda #>requ sta serial.send.address$+1 jsr serial.send$ jmp @get_data @Done ; Close the serial connection jsr serial.close$ ; Deallocate the buffer lda resp sta memory.deallocate.address$ lda resp+1 sta memory.deallocate.address$+1 jsr memory.deallocate$ jsr PressAnyKey rts align $100 ReadKey.Prev byte $00 ReadKey ; Read the key from the keyboard jsr console.readkey$ ; Determine if anything was pressed lda console.readkey.state$ cmp #console.readkey.state.ok$ beq @StateOk ; Clear the previous key press lda #$00 sta ReadKey.Prev sec rts @StateOk ; Confirm that we have a valid character lda console.readkey.char$ cmp #console.readkey.char.invalid$ beq @CheckSpecial ; Check if the shift key was pressed lda console.readkey.shift2$ and #console.readkey.shift2.left_shift$ cmp #console.readkey.shift2.left_shift$ beq @ShiftPressed lda console.readkey.shift2$ and #console.readkey.shift2.right_shift$ cmp #console.readkey.shift2.right_shift$ beq @ShiftPressed lda console.readkey.char$ cmp #$01 bcs @Alpha1 ; A >= $01 jmp @End @Alpha1 cmp #$1b bcc @Alhpa2 ; A < $1b jmp @End @Alhpa2 clc adc #$40 jmp @End @ShiftPressed ; If a valid character was pressed while the shift key was pressed, ; return the upper-cased version of the character ldx console.readkey.char$ lda console.getkey.KeyTableShift$,x cmp #console.readkey.char.invalid$ bne @ShiftOk sec rts @ShiftOk clc ;adc #$40 jmp @End2 @CheckSpecial ; If the return key is pressed, return null lda console.readkey.shift1$ cmp #console.readkey.shift1.return$ beq @ReturnNull cmp #console.readkey.shift1.insert_delete$ beq @ReturnBackSpace sec rts @ReturnNull lda #13 jmp @Wait @ReturnBackSpace lda #console.backspace$ lda #20 jmp @Wait @Wait ;pha ;jsr time.halt$ ;jsr time.halt$ ;jsr time.halt$ ;pla @End ; Check to see if same key was previously pressed cmp ReadKey.Prev bne @Ok sec rts @Ok sta ReadKey.Prev @End2 clc rts align $100 ProcessResp lda resp sta $ae lda resp+1 sta $af @skip ldy #$00 @Loop lda ($ae),y cmp #$ff beq @Null_Yes jmp @Null_No @Null_Yes jmp @Done @Null_No cmp #10 beq @Skip_Yes jmp @Skip_No @Skip_Yes lda #'-' jmp @NextChar @Skip_No cmp #13 beq @NewLine_Yes jmp @NewLine_No @NewLine_Yes lda #console.newline$ jmp @NextChar @NewLine_No cmp #20 beq @BackSpace_Yes jmp @BackSpace_No @BackSpace_Yes lda #console.backspace$ sta console.writechr.char$ jsr console.writechr$ lda #' ' sta console.writechr.char$ jsr console.writechr$ lda #console.backspace$ jmp @NextChar @BackSpace_No cmp #$41 bcs @Alpha1 ; A >= $41 jmp @NotAlpha1 @Alpha1 cmp #$5b bcc @Alpha2 ; A < $5b jmp @NotAlpha2 @Alpha2 sec sbc #$40 jmp @NextChar @NotAlpha1 @NotAlpha2 cmp #$61 bcs @Alpha12 ; A >= $41 jmp @NotAlpha12 @Alpha12 cmp #$7b bcc @Alpha22 ; A < $7b jmp @NotAlpha22 @Alpha22 sec sbc #$20 jmp @NextChar @NotAlpha12 @NotAlpha22 @NextChar sta ($ae),y inc $ae beq @inc_af jmp @Loop @inc_af inc $af jmp @Loop @Done rts title text 'Serial', console.newline$, console.newline$ text 'Please select one of the options below:', console.newline$, console.null$ options text '1. Send/Receive (Echo)', console.newline$ text '2. Modem Test', console.newline$ text 'x. Exit', console.newline$ text console.null$ anykey text 'Press any key to go back', console.null$ filename word $0000 fnnext text 'DEMO0-X', console.null$ fnback text 'MAIN', console.null$ failed text 'Failed to load ', console.null$ wait text console.newline$, 'Please wait... ', console.null$ done text 'Done!', console.newline$, console.newline$, console.null$ open text 'Opening connection... ', console.null$ close text 'Closing connection... ', console.null$ send text 'Sending data... ', console.null$ recv text 'Receiving data... ', console.null$ sendtxt text 'Enter some text: ', console.null$ sendstr word $0000 recvtxt text 'Received from server: ', console.null$ recvstr word $0000 inf1 text 'Press ', $1f, ' (End) to go exit.', console.newline$, console.null$ msg1 text "at&p1e1", serial.eot$ requ text $00, serial.eot$ resp word $0000
22.002954
96
0.576128
df16d232459ae197f94fb20ec758ce4b9ba56d15
834
asm
Assembly
oeis/142/A142489.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142489.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142489.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142489: Primes congruent to 22 mod 51. ; Submitted by Simon Strandgaard ; 73,277,379,787,991,1093,1297,1399,2011,2113,2521,3541,3643,3847,4051,4153,4357,4561,4663,4969,5479,5581,5683,6091,6397,6703,6907,7213,7417,7621,7723,7927,8233,8539,8641,9049,9151,9661,9967,10069,10273,10477,10987,11497,11701,12007,12109,12211,12517,12619,12721,12823,13537,14149,14251,14557,15271,15373,15679,16087,16189,16699,16903,17107,17209,17923,18127,18229,18433,18637,19249,19759,19861,19963,20269,20983,21187,21391,21493,21799,22003,22717,22921,23227,23431,24043,24247,24859,25471,25981 mov $1,36 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,2 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,51 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,101
34.75
496
0.730216