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
bc01af43c8ac830769aaf4c2a536ca991148237b
371
asm
Assembly
programs/oeis/139/A139704.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/139/A139704.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/139/A139704.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A139704: Nearly palindromic numbers: non-palindromes that can be made palindromic by inserting an extra digit. ; 10,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,56,57,58,59,60,61,62,63,64,65,67,68,69,70,71,72,73,74,75,76,78,79,80,81,82,83,84,85 add $0,9 mul $0,11 div $0,10 mov $1,$0 add $1,1
41.222222
208
0.692722
b8cd35d85ef1ad7049a22bc6e5179fdb2cd12189
202
asm
Assembly
caches.asm
LeifBloomquist/ArtilleryDuel
7f42f069284ba6067136c29e2ade80d3ac9b5583
[ "MIT" ]
1
2015-06-01T08:53:18.000Z
2015-06-01T08:53:18.000Z
caches.asm
LeifBloomquist/ArtilleryDuel
7f42f069284ba6067136c29e2ade80d3ac9b5583
[ "MIT" ]
null
null
null
caches.asm
LeifBloomquist/ArtilleryDuel
7f42f069284ba6067136c29e2ade80d3ac9b5583
[ "MIT" ]
null
null
null
;CACHES ;ARP CACHE HOLDS 10 entries ARP_CACHE ARP_CACHE_MAC ds.b 60,0 ARP_CACHE_IP ds.b 40,0 DNS_CACHE ;DNS CACHE HOLDS 10 entries of 40 char max DNS_CACHE_NAME ds.b 400,0 DNS_CACHE_IP ds.b 40,0
14.428571
42
0.767327
6e0f7403c21f36fad14c4e3534919973747d88e9
353
asm
Assembly
programs/oeis/038/A038223.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/038/A038223.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/038/A038223.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A038223: Bottom line of 3-wave sequence A038196, also bisection of A006356. ; 1,6,31,157,793,4004,20216,102069,515338,2601899,13136773,66326481,334876920,1690765888,8536537209,43100270734,217609704247,1098693409021,5547212203625,28007415880892,141407127676248 mov $1,1 mov $2,1 lpb $0,1 sub $0,1 add $2,$1 add $1,$2 add $3,$1 add $1,$3 lpe
27.153846
183
0.750708
d2135642c181a58e978e426f51bbffe1b4c1ab9a
4,957
asm
Assembly
6309/zx0_6309_turbo.asm
nowhereman999/zx0-6x09
6c9053d19057ef1a9a3c5c2fabcea5911e450dac
[ "Zlib" ]
1
2021-10-02T18:33:50.000Z
2021-10-02T18:33:50.000Z
6309/zx0_6309_turbo.asm
nowhereman999/zx0-6x09
6c9053d19057ef1a9a3c5c2fabcea5911e450dac
[ "Zlib" ]
null
null
null
6309/zx0_6309_turbo.asm
nowhereman999/zx0-6x09
6c9053d19057ef1a9a3c5c2fabcea5911e450dac
[ "Zlib" ]
null
null
null
; zx0_6309_turbo.asm - ZX0 decompressor for H6309 - 126 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. ; rotate next bit into elias value zx0_elias_rotate macro lsla ; get next bit rolw ; rotate bit into elias value lsla ; get next bit endm ; get elias value zx0_get_elias macro lsla ; get next bit bne a@ ; is bit stream empty? no, branch lda ,x+ ; load another group of 8 bits rola ; get next bit a@ bcs b@ ; are we done? yes, branch bsr zx0_elias_more ; more processing required for elias b@ equ * endm ;------------------------------------------------------------------------------ ; 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 ;------------------------------------------------------------------------------ zx0_decompress ldq #$ffff0001 ; init offset = -1 and elias = 1 tfr d,v ; preserve offset lda #$80 ; init bit stream bra zx0_literals ; start with literals ; 1 - copy from new offset (repeat N bytes from new offset) zx0_new_offset zx0_get_elias ; obtain MSB offset comf ; adjust for negative offset (set carry for RORW below) incf ; " " " " beq zx0_rts ; eof? (length = 256) if so exit tfr f,e ; move to MSB position ldf ,x+ ; obtain LSB offset rorw ; last offset bit becomes first length bit tfr w,v ; preserve offset value ldw #1 ; set elias = 1 bcs skip@ ; test first length bit bsr zx0_elias_more ; get elias but skip first bit skip@ incw ; elias = elias + 1 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 bcs zx0_new_offset ; branch if next block is new offset ; 0 - literal (copy next N bytes) zx0_literals zx0_get_elias ; obtain length tfm x+,u+ ; copy literals incw ; set elias = 1 lsla ; copy from last offset or new offset? bcs zx0_new_offset ; branch if next block is new offset ; 0 - copy from last offset (repeat N bytes from last offset) zx0_get_elias bra zx0_copy ; go copy last offset block ; interlaced elias gamma coding zx0_elias_more zx0_elias_rotate bcc zx0_elias_more ; loop until done beq zx0_reload ; is bit stream empty? if yes, refill it zx0_rts rts ; return loop@ zx0_elias_rotate zx0_reload lda ,x+ ; load another group of 8 bits rola ; get next bit bcs zx0_rts zx0_elias_rotate bcs zx0_rts zx0_elias_rotate bcs zx0_rts zx0_elias_rotate bcc loop@ rts
45.898148
94
0.495663
2b82eef2de5f7e1dcacabf9ae5ace2e6f909e8d8
457
asm
Assembly
programs/oeis/124/A124925.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/124/A124925.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/124/A124925.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A124925: Interlaced triples: a(3n+1)=1, a(3n+2) = 2n+3, a(3n+3)= A028387(n). ; 1,3,1,1,5,5,1,7,11,1,9,19,1,11,29,1,13,41,1,15,55,1,17,71,1,19,89,1,21,109,1,23,131,1,25,155,1,27,181,1,29,209,1,31,239,1,33,271,1,35,305,1,37,341,1,39,379,1,41,419,1,43,461,1,45,505,1,47,551,1,49,599,1,51,649,1,53,701,1,55,755,1,57,811,1,59,869,1,61,929,1,63,991,1,65,1055,1,67,1121,1 add $0,6 lpb $0 sub $0,3 add $1,1 lpe bin $1,$0 sub $1,1 mul $1,2 add $1,1 mov $0,$1
32.642857
287
0.61488
6120c5a854b238ed796459c268865a990522f2a9
382
asm
Assembly
programs/oeis/044/A044543.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/044/A044543.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/044/A044543.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A044543: Numbers n such that string 3,3 occurs in the base 7 representation of n but not of n+1. ; 24,73,122,174,220,269,318,367,416,465,517,563,612,661,710,759,808,860,906,955,1004,1053,1102,1151,1224,1249,1298,1347,1396,1445,1494,1546,1592,1641,1690,1739,1788,1837,1889,1935,1984 mov $3,$0 mul $0,6 add $0,3 mov $1,49 gcd $1,$0 div $1,2 add $1,24 mov $2,$3 mul $2,49 add $1,$2
27.285714
184
0.704188
dd7896a6a11b786461cd9ba2b066035e930eb8ed
14,298
asm
Assembly
Appl/Calendar/Main/mainCalc.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Appl/Calendar/Main/mainCalc.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Appl/Calendar/Main/mainCalc.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\Main FILE: mainCalc.asm AUTHOR: Don Reeves, March 25, 1991 ROUTINES: Name Who Description ---- --- ----------- CalcDateAltered GLB Get date from offset to current date CalcDaysInRange GLB Get number of days in passed range CalcDayOfWeek GLB Calculate day of week for passed date IsLeapYear GLB Determines if year is a leap year CalcDaysInMonth GLB Get number of days in the passed month CheckFiftyThreeWeeks GLB Tells if there's 53 weeks in a year CalcWeekNumber GLB Calculates the week number for a date MinutesToTime GLB Convert no. of minutes to time. REVISION HISTORY: Name Date Description ---- ---- ----------- Don 3/25/91 Broken out from mainCalendar.asm DESCRIPTION: Contains all the date calculation code $Id: mainCalc.asm,v 1.1 97/04/04 14:47:59 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CommonCode segment resource include data.def ; month length & starting info COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CalcDateAltered %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calculate a date N days before or after the current date CALLED BY: GLOBAL PASS: BP = Year DH = Month DL = Day CX = Days to desired date (+ or -) RETURN: BP = New year DH = New month DL = New day Carry = Clear if a valid year = Set if not (less than 1900, greater than 9999) DESTROYED: Nothing PSEUDO CODE/STRATEGY: Loop forward or backward in time, until CX is a positive number less than or equal to the number of days in the current month. KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 11/17/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CalcDateAltered proc far uses ax, bx, cx .enter ; Determine direction to loop ; mov bx, cx ; store day offset in CX mov cl, dl clr ch ; today's day in CH cmp bx, 0 jl backward ; Set up the forward looping ; add bx, cx loopForward: call CalcDaysInMonth mov cl, ch clr ch cmp bx, cx ; cur day with days in month jle done ; we're done sub bx, cx inc dh cmp dh, 12 jle loopForward mov dh, 1 inc bp jmp loopForward ; Set up the backward looping ; backward: add bx, cx loopBackward: cmp bx, 0 ; a positive day jg done dec dh ; back up one month jg LB_10 mov dh, 12 dec bp LB_10: call CalcDaysInMonth mov cl, ch clr ch add bx, cx jmp loopBackward ; We're done - clean up (set carry if invalid year) ; done: mov dl, bl ; store the new day in DL cmp bp, LOW_YEAR ; compare with low year jl exit ; jump if less (carry set) cmp bp, HIGH_YEAR+1 ; compare with the high year cmc ; invert the carry flag exit: .leave ret CalcDateAltered endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CalcDaysInRange %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calculate the number of days in a range M/D/Y -> M/D/Y CALLED BY: GLOBAL PASS: ES:BP = RangeStruct RETURN: CX = # of days in the range DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 12/6/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CalcDaysInRange proc far uses bx, dx, si .enter ; Perform some set-up work ; mov si, bp ; ES:SI points to the struct mov bp, es:[si].RS_startYear ; starting year mov dx, {word} es:[si].RS_startDay ; starting month & day clr bx ; clear the counter ; Loop through the months, adding up the days ; dayLoop: cmp bp, es:[si].RS_endYear jne calc cmp dh, es:[si].RS_endMonth je done ; we're done calc: call CalcDaysInMonth ; get the days in the month sub ch, dl ; take care of starting day mov cl, ch clr ch add bx, cx ; keep a running total clr dl ; first day this month inc dh cmp dh, 12 jle dayLoop mov dh, 1 inc bp jmp dayLoop ; We're done, except for difference in the current month ; done: mov cl, es:[si].RS_endDay clr ch sub cl, dl ; subtract start from end add bx, cx ; add to the running total inc bx ; must add one day mov cx, bx ; move total to CX mov bp, si ; SS:BP points to RangeStruct .leave ret CalcDaysInRange endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CalcDayOfWeek %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calculate 1st day of week of for given (month,year) CALLED BY: MonthDraw PASS: BP = desired year DH = desired month (Jan = 1; Dec = 12) DL = desired day RETURN: CL = day of the week DESTROYED: CH PSEUDO CODE/STRATEGY: Calculate day "shifts" between base year and needed year DayofWeek = ((this year - base year) + leap years in that interval + monthOffset[this month]) mod (daysinWeek = 7) KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 6/12/89 Initial version Don 7/6/89 Fixed up leap year stuff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CalcDayOfWeek proc far uses ax, bx, si, es .enter ; Calculate difference between this year and base year ; mov bx, bp ; move year sub bx, BASE_YEAR ; find difference jz almostDone ; if 1900, skip this mess mov cx, bx ; diff in CX mov ax, bx ; diff in AX ; Now account for leap years (running total in BX) ; dec cx ; ignore the current year shr cx, 1 shr cx, 1 ; divide by 4 add bx, cx ; add in leap years ; No leap years on century marks ; dec ax ; ignore the current year push dx ; save the reg clr dx mov cx, 100 ; set up divide div cx ; divide sub bx, ax ; update count pop dx ; restore this register ; Except on years evenly divisible by 400 ; add al, 3 ; ease the math shr ax, 1 shr ax, 1 ; divide by 4 add bx, ax ; update the count ; What if this year is a leap year ?? ; cmp dh, 2 ; compare month with Feb jle almostDone ; leap year doesn't matter call IsLeapYear ; is this year a leap year ? jnc almostDone ; carry clear - not a leap year inc bx ; add one day for leap year ; Add in the base day & month offset ; almostDone: add bx, BASE_DAY ; add in base day mov ax, bx ; total day offset to AX mov bl, dh clr bh mov cl, {byte}cs:[monthOffsets][bx] ; add month offset add cl, dl ; account for day of month dec cl ; 1st day is zero offset clr ch add ax, cx ; update total day offset ; Finally - one big divide ; push dx ; save the month & day clr dx mov cx, 7 ; set up divide div cx ; days mod 7 mov cl, dl ; day of week to CL pop dx ; restore this registers .leave ret CalcDayOfWeek endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IsLeapYear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Determines if the given year is a leap year CALLED BY: GLOBAL PASS: BP = Year RETURN: Carry = Set if a leap year = Clear if not DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 10/30/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ IsLeapYear proc far uses ax, cx, dx .enter ; Is the year divisible by 4 ; mov ax, bp ; year to BP and ax, 3 ; is a leap year? jnz done ; carry is clear ; Maybe a leap year - check for divisible by 100 ; mov ax, bp ; get the year again clr dx ; clear the high byte mov cx, 100 ; set up divisor div cx ; is it a century ?? tst dx ; check remainder jne setCarry ; a leap year - carry clear ; Still a leap year if divisible by 400 (at this point by 4) ; and ax, 3 ; is evenly divisble by 4 ?? jnz done ; no setCarry: stc ; set carry for leap year done: .leave ret IsLeapYear endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CalcDaysInMonth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calculate the number of days in a month CALLED BY: GLOBAL PASS: BP = Year DH = Month RETURN: CH = Days in the month DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Don 11/2/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CalcDaysInMonth proc far uses ax, bx, si, es .enter ; First get number of days in this month ; mov bl, dh ; month to BL clr bh ; make it a word mov ch, {byte}cs:[monthLengths][bx] ; get days in this month ; Now look for a leap year ; cmp dh, 2 ; is the month February jne done ; no - we're done call IsLeapYear ; is it a leap year ? jnc done inc ch ; add a day done: .leave ret CalcDaysInMonth endp if WEEK_NUMBERING COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckFiftyThreeWeeks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Tells if there's 53 weeks in year passed. CALLED BY: Global PASS: bp = year RETURN: carry set = YES, fifty-three weeks in year carry clear = NO, only fifty-two weeks in year DESTROYED: nothing SIDE EFFECTS: none PSEUDO CODE/STRATEGY: We have 53 weeks in year if the following conditions apply: 1) Jan 1 starts on a Thursday 2) Jan 1 starts on Wednesday & this is a leap year. REVISION HISTORY: Name Date Description ---- ---- ----------- sean 4/ 4/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckFiftyThreeWeeks proc far uses cx,dx .enter ; Get day of week for Jan 1. ; mov dl, 1 mov dh, 1 call CalcDayOfWeek ; cl = dow for Jan 1 ; If Jan 1 was Thurday, then there are 53 weeks for that year ; cmp cl, 4 ; Thursday ? stc ; assume yes je exit ; If Jan 1 was Wednesday, then there are 53 weeks only if ; it's a leap year. ; cmp cl, 3 ; Wednesday ? je testLeapYear ; yes--test leap year clc ; not 53 weeks exit: .leave ret testLeapYear: mov dx, bp ; dx = year test dl, 00000011b ; leap year ? ( /4 equally) stc ; assume yes jz exit clc ; not leap year--52 weeks in year jmp exit CheckFiftyThreeWeeks endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CalcWeekNumber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calculates the week number for a date CALLED BY: Global PASS: ax = Year bl = Month (1-12) bh = Day (1-31) RETURN: ax = Week number DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: calculate days between Jan 1 and passed date ; MUST ADD DAYS WHICH ARE MISSING IN FIRST WEEK (sean 12/12/95) ; divide it by 7 and add 1 to get week number REVISION HISTORY: Name Date Description ---- ---- ----------- RR 4/20/95 Initial version sean 10/5/95 Fixed one day too many bug sean 12/12/95 Fixed bugs #48617 & #48114 sean 4/4/96 Fixed 53 week year problem. Fixes #54031. awu 1/21/97 Moved over and modified from MonthDrawWeekNumbers. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CalcWeekNumber proc far range local RangeStruct ; Jan 1 to month 1 totalWeeks local byte uses bx,cx,dx,si,di,bp .enter mov range.RS_startDay, 1 mov range.RS_startMonth, 1 mov range.RS_endDay, bh mov range.RS_endMonth, bl mov range.RS_startYear, ax mov range.RS_endYear, ax ;; How many weeks are there this year? mov totalWeeks, 52 push bp mov bp, ax call CheckFiftyThreeWeeks pop bp jnc not53 mov totalWeeks, 53 not53: push es, bp segmov es, ss, ax lea bp, range call CalcDaysInRange ; days in cx dec cx ; range inclusive--decrement(sean) pop es, bp mov ax, cx push bp mov dl, 1 mov dh, 1 mov bp, range.RS_startYear call CalcDayOfWeek ; cl = dow for Jan 1 pop bp ; if Jan 1 is fri, sat, or sun, add 1 to week # tst cl ; check for sunday jne checkFri dec ax ; Year starts Jan 2 jmp doDivide checkFri: cmp cl, 5 jne checkSat ; check fri sub ax, 3 ; year starts Jan 4 jmp doDivide checkSat: cmp cl, 6 jne notFriSatSun sub ax, 2 ; year starts Jan 3 jmp doDivide ; We have to add the number of days that we're missing in ; first week. For example, if Jan 1st is on a Wed., then ; the first week can only hold 5 days, and we must add two ; days for our upcoming division. sean 12/12/95. Fixes ; #48114 & #48617. ; notFriSatSun: dec cl ; cl = number of days missing clr ch add ax, cx ; in first week of year doDivide: tst ax jge normalOp push bp mov bp, range.RS_startYear ;; Check previous year dec bp call CheckFiftyThreeWeeks pop bp mov ax, 53 jc exit mov ax, 52 jmp exit normalOp: mov dl, 7 ; divide range by 7 to get week # div dl inc al ; al = week # ;; Check that we don't go past week 52 (or 53 if this year has an ;; extra week cmp al, totalWeeks jle exit sub al, totalWeeks exit: clr ah .leave ret CalcWeekNumber endp endif CommonCode ends
22.201863
79
0.560848
776735127a9872feadc12a874b1ae50670dcac18
8,429
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_526.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_526.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_526.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r14 push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x12061, %rdi nop nop nop add %rsi, %rsi movl $0x61626364, (%rdi) add $34693, %r14 lea addresses_D_ht+0x12318, %r13 nop nop nop nop dec %rdx mov $0x6162636465666768, %r12 movq %r12, %xmm1 movups %xmm1, (%r13) nop nop nop nop nop sub %r12, %r12 lea addresses_WT_ht+0x1f50, %r13 and $11802, %r11 mov (%r13), %edi xor $46214, %rdx lea addresses_UC_ht+0xe918, %r13 nop nop nop lfence and $0xffffffffffffffc0, %r13 movaps (%r13), %xmm2 vpextrq $0, %xmm2, %rsi nop nop cmp %r12, %r12 lea addresses_D_ht+0x10e18, %r11 nop xor %r12, %r12 mov $0x6162636465666768, %rdx movq %rdx, (%r11) nop add $59406, %r14 lea addresses_D_ht+0x145d8, %r12 add $57539, %r13 mov (%r12), %rsi nop nop nop nop nop add %r13, %r13 lea addresses_UC_ht+0xfc8, %rsi nop nop nop dec %r13 movw $0x6162, (%rsi) mfence lea addresses_UC_ht+0x19b98, %rsi lea addresses_WC_ht+0x118da, %rdi clflush (%rdi) nop nop nop nop nop add %r11, %r11 mov $22, %rcx rep movsw nop nop nop nop nop xor $37864, %rdi lea addresses_WT_ht+0x1be18, %r14 nop nop and $46685, %r13 mov $0x6162636465666768, %r12 movq %r12, (%r14) nop nop nop nop nop xor %r14, %r14 lea addresses_UC_ht+0x3b18, %r14 nop nop nop nop cmp %rcx, %rcx movl $0x61626364, (%r14) nop nop nop nop add %rdx, %rdx lea addresses_UC_ht+0xcf18, %rsi lea addresses_UC_ht+0x1cf18, %rdi sub $21858, %rdx mov $72, %rcx rep movsl nop nop nop sub $57911, %rsi lea addresses_UC_ht+0xea70, %rdi inc %rsi mov $0x6162636465666768, %rcx movq %rcx, (%rdi) nop nop nop nop cmp %r14, %r14 lea addresses_WT_ht+0x12f18, %rsi lea addresses_normal_ht+0x193d0, %rdi sub %r12, %r12 mov $31, %rcx rep movsw xor $20050, %rdi lea addresses_A_ht+0x1318, %rsi lea addresses_WC_ht+0x19d18, %rdi sub %r12, %r12 mov $62, %rcx rep movsb xor %rcx, %rcx lea addresses_A_ht+0x6318, %rdx add $10569, %r14 movb $0x61, (%rdx) nop nop nop nop nop xor %rdi, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %r14 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r15 push %r8 push %r9 push %rbp push %rdx // Store mov $0x2b8, %r15 nop nop inc %rbp mov $0x5152535455565758, %r8 movq %r8, %xmm3 movups %xmm3, (%r15) nop nop nop nop nop add %r9, %r9 // Store lea addresses_A+0x13260, %r9 clflush (%r9) nop nop nop nop nop xor $42265, %r14 movw $0x5152, (%r9) nop nop nop nop nop xor %rbp, %rbp // Store lea addresses_A+0xe218, %r12 nop nop nop xor %rbp, %rbp movw $0x5152, (%r12) sub %rbp, %rbp // Faulty Load lea addresses_D+0x11718, %rdx nop nop nop inc %r15 mov (%rdx), %r14d lea oracles, %rdx and $0xff, %r14 shlq $12, %r14 mov (%rdx,%r14,1), %r14 pop %rdx pop %rbp pop %r9 pop %r8 pop %r15 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 9, 'size': 16, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 8, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': True}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
32.419231
2,999
0.654051
3403733aeb7c999d9adcebd734018609df05797c
311
asm
Assembly
libsrc/stdio/sorcerer/fgetc_cons.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/stdio/sorcerer/fgetc_cons.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/stdio/sorcerer/fgetc_cons.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; ; Keyboard routines for the Sorcerer Exidy ; By Stefano Bodrato - 23/05/2011 (exactly 8 years after the Nascom ones !) ; ; getkey() Wait for keypress ; ; ; $Id: fgetc_cons.asm,v 1.2 2015/01/19 01:33:21 pauloscustodio Exp $ ; PUBLIC fgetc_cons .fgetc_cons call $e009 jr z,fgetc_cons ld l,a ld h,0 ret
16.368421
75
0.700965
2bf56879d42a1b6cf2f6b9930220abfc961172ed
954
asm
Assembly
programs/oeis/016/A016130.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/016/A016130.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/016/A016130.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A016130: Expansion of 1/((1-2x)(1-7x)). ; 1,9,67,477,3355,23517,164683,1152909,8070619,56494845,395464939,2768256621,19377800443,135644611293,949512295435,6646586100813,46526102771227,325682719529661,2279779036969771,15958453259312685,111709172816237371,781964209715758749,5473749468014505547,38316246276109927437,268213723932786269275,1877496067529537439357,13142472472706829184363,91997307308947938508269,643981151162635837993339,4507868058138451402824285,31555076406969160893511819,220885534848784128402066381,1546198743941488903109431963,10823391207590422330355958333,75763738453132956329671577515,530346169171930694342060780973,3712423184203514860463144943547,25986962289424604023379453558301,181908736025972228163931052815051,1273361152181805597148067125519245,8913528065272639180037569390262491,62394696456908474260265184755092989,436762875198359319821860691332162027 add $0,1 mov $1,7 pow $1,$0 mov $2,2 pow $2,$0 sub $1,$2 div $1,5 mov $0,$1
79.5
834
0.896226
dbb64c3020766d760bd4d8ef67d2ce96b1e22707
208
asm
Assembly
libsrc/_DEVELOPMENT/libgen/c/sccz80/basename.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/libgen/c/sccz80/basename.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/libgen/c/sccz80/basename.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; char *basename(char *path) SECTION code_string PUBLIC basename EXTERN asm_basename defc basename = asm_basename ; SDCC bridge for Classic IF __CLASSIC PUBLIC _basename defc _basename = basename ENDIF
12.235294
28
0.798077
2d3b7ae6cc02ddb97c6eeed5c14c5df8de7e5735
321,560
asm
Assembly
usertests.asm
dylsugar/cs461_hw7
0eacc005942b80f081e5643af7d8a00ff9920af9
[ "MIT-0" ]
null
null
null
usertests.asm
dylsugar/cs461_hw7
0eacc005942b80f081e5643af7d8a00ff9920af9
[ "MIT-0" ]
null
null
null
usertests.asm
dylsugar/cs461_hw7
0eacc005942b80f081e5643af7d8a00ff9920af9
[ "MIT-0" ]
null
null
null
_usertests: file format elf64-x86-64 Disassembly of section .text: 0000000000001000 <failexit>: char name[3]; char *echoargv[] = { "echo", "ALL", "TESTS", "PASSED", 0 }; void failexit(const char * const msg) { 1000: f3 0f 1e fa endbr64 1004: 55 push %rbp 1005: 48 89 e5 mov %rsp,%rbp 1008: 48 83 ec 10 sub $0x10,%rsp 100c: 48 89 7d f8 mov %rdi,-0x8(%rbp) printf(1, "!! FAILED %s\n", msg); 1010: 48 8b 45 f8 mov -0x8(%rbp),%rax 1014: 48 89 c2 mov %rax,%rdx 1017: 48 be 2e 6d 00 00 00 movabs $0x6d2e,%rsi 101e: 00 00 00 1021: bf 01 00 00 00 mov $0x1,%edi 1026: b8 00 00 00 00 mov $0x0,%eax 102b: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 1032: 00 00 00 1035: ff d1 callq *%rcx exit(); 1037: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 103e: 00 00 00 1041: ff d0 callq *%rax 0000000000001043 <iputtest>: } // does chdir() call iput(p->cwd) in a transaction? void iputtest(void) { 1043: f3 0f 1e fa endbr64 1047: 55 push %rbp 1048: 48 89 e5 mov %rsp,%rbp printf(1, "iput test\n"); 104b: 48 be 3c 6d 00 00 00 movabs $0x6d3c,%rsi 1052: 00 00 00 1055: bf 01 00 00 00 mov $0x1,%edi 105a: b8 00 00 00 00 mov $0x0,%eax 105f: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1066: 00 00 00 1069: ff d2 callq *%rdx if(mkdir("iputdir") < 0){ 106b: 48 bf 47 6d 00 00 00 movabs $0x6d47,%rdi 1072: 00 00 00 1075: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 107c: 00 00 00 107f: ff d0 callq *%rax 1081: 85 c0 test %eax,%eax 1083: 79 16 jns 109b <iputtest+0x58> failexit("mkdir"); 1085: 48 bf 4f 6d 00 00 00 movabs $0x6d4f,%rdi 108c: 00 00 00 108f: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1096: 00 00 00 1099: ff d0 callq *%rax } if(chdir("iputdir") < 0){ 109b: 48 bf 47 6d 00 00 00 movabs $0x6d47,%rdi 10a2: 00 00 00 10a5: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 10ac: 00 00 00 10af: ff d0 callq *%rax 10b1: 85 c0 test %eax,%eax 10b3: 79 16 jns 10cb <iputtest+0x88> failexit("chdir iputdir"); 10b5: 48 bf 55 6d 00 00 00 movabs $0x6d55,%rdi 10bc: 00 00 00 10bf: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 10c6: 00 00 00 10c9: ff d0 callq *%rax } if(unlink("../iputdir") < 0){ 10cb: 48 bf 63 6d 00 00 00 movabs $0x6d63,%rdi 10d2: 00 00 00 10d5: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 10dc: 00 00 00 10df: ff d0 callq *%rax 10e1: 85 c0 test %eax,%eax 10e3: 79 16 jns 10fb <iputtest+0xb8> failexit("unlink ../iputdir"); 10e5: 48 bf 6e 6d 00 00 00 movabs $0x6d6e,%rdi 10ec: 00 00 00 10ef: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 10f6: 00 00 00 10f9: ff d0 callq *%rax } if(chdir("/") < 0){ 10fb: 48 bf 80 6d 00 00 00 movabs $0x6d80,%rdi 1102: 00 00 00 1105: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 110c: 00 00 00 110f: ff d0 callq *%rax 1111: 85 c0 test %eax,%eax 1113: 79 16 jns 112b <iputtest+0xe8> failexit("chdir /"); 1115: 48 bf 82 6d 00 00 00 movabs $0x6d82,%rdi 111c: 00 00 00 111f: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1126: 00 00 00 1129: ff d0 callq *%rax } printf(1, "iput test ok\n"); 112b: 48 be 8a 6d 00 00 00 movabs $0x6d8a,%rsi 1132: 00 00 00 1135: bf 01 00 00 00 mov $0x1,%edi 113a: b8 00 00 00 00 mov $0x0,%eax 113f: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1146: 00 00 00 1149: ff d2 callq *%rdx } 114b: 90 nop 114c: 5d pop %rbp 114d: c3 retq 000000000000114e <exitiputtest>: // does exit() call iput(p->cwd) in a transaction? void exitiputtest(void) { 114e: f3 0f 1e fa endbr64 1152: 55 push %rbp 1153: 48 89 e5 mov %rsp,%rbp 1156: 48 83 ec 10 sub $0x10,%rsp int pid; printf(1, "exitiput test\n"); 115a: 48 be 98 6d 00 00 00 movabs $0x6d98,%rsi 1161: 00 00 00 1164: bf 01 00 00 00 mov $0x1,%edi 1169: b8 00 00 00 00 mov $0x0,%eax 116e: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1175: 00 00 00 1178: ff d2 callq *%rdx pid = fork(); 117a: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 1181: 00 00 00 1184: ff d0 callq *%rax 1186: 89 45 fc mov %eax,-0x4(%rbp) if(pid < 0){ 1189: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 118d: 79 16 jns 11a5 <exitiputtest+0x57> failexit("fork"); 118f: 48 bf a7 6d 00 00 00 movabs $0x6da7,%rdi 1196: 00 00 00 1199: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 11a0: 00 00 00 11a3: ff d0 callq *%rax } if(pid == 0){ 11a5: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 11a9: 0f 85 9c 00 00 00 jne 124b <exitiputtest+0xfd> if(mkdir("iputdir") < 0){ 11af: 48 bf 47 6d 00 00 00 movabs $0x6d47,%rdi 11b6: 00 00 00 11b9: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 11c0: 00 00 00 11c3: ff d0 callq *%rax 11c5: 85 c0 test %eax,%eax 11c7: 79 16 jns 11df <exitiputtest+0x91> failexit("mkdir"); 11c9: 48 bf 4f 6d 00 00 00 movabs $0x6d4f,%rdi 11d0: 00 00 00 11d3: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 11da: 00 00 00 11dd: ff d0 callq *%rax } if(chdir("iputdir") < 0){ 11df: 48 bf 47 6d 00 00 00 movabs $0x6d47,%rdi 11e6: 00 00 00 11e9: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 11f0: 00 00 00 11f3: ff d0 callq *%rax 11f5: 85 c0 test %eax,%eax 11f7: 79 16 jns 120f <exitiputtest+0xc1> failexit("child chdir"); 11f9: 48 bf ac 6d 00 00 00 movabs $0x6dac,%rdi 1200: 00 00 00 1203: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 120a: 00 00 00 120d: ff d0 callq *%rax } if(unlink("../iputdir") < 0){ 120f: 48 bf 63 6d 00 00 00 movabs $0x6d63,%rdi 1216: 00 00 00 1219: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 1220: 00 00 00 1223: ff d0 callq *%rax 1225: 85 c0 test %eax,%eax 1227: 79 16 jns 123f <exitiputtest+0xf1> failexit("unlink ../iputdir"); 1229: 48 bf 6e 6d 00 00 00 movabs $0x6d6e,%rdi 1230: 00 00 00 1233: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 123a: 00 00 00 123d: ff d0 callq *%rax } exit(); 123f: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1246: 00 00 00 1249: ff d0 callq *%rax } wait(); 124b: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 1252: 00 00 00 1255: ff d0 callq *%rax printf(1, "exitiput test ok\n"); 1257: 48 be b8 6d 00 00 00 movabs $0x6db8,%rsi 125e: 00 00 00 1261: bf 01 00 00 00 mov $0x1,%edi 1266: b8 00 00 00 00 mov $0x0,%eax 126b: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1272: 00 00 00 1275: ff d2 callq *%rdx } 1277: 90 nop 1278: c9 leaveq 1279: c3 retq 000000000000127a <openiputtest>: // for(i = 0; i < 10000; i++) // yield(); // } void openiputtest(void) { 127a: f3 0f 1e fa endbr64 127e: 55 push %rbp 127f: 48 89 e5 mov %rsp,%rbp 1282: 48 83 ec 10 sub $0x10,%rsp int pid; printf(1, "openiput test\n"); 1286: 48 be ca 6d 00 00 00 movabs $0x6dca,%rsi 128d: 00 00 00 1290: bf 01 00 00 00 mov $0x1,%edi 1295: b8 00 00 00 00 mov $0x0,%eax 129a: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 12a1: 00 00 00 12a4: ff d2 callq *%rdx if(mkdir("oidir") < 0){ 12a6: 48 bf d9 6d 00 00 00 movabs $0x6dd9,%rdi 12ad: 00 00 00 12b0: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 12b7: 00 00 00 12ba: ff d0 callq *%rax 12bc: 85 c0 test %eax,%eax 12be: 79 16 jns 12d6 <openiputtest+0x5c> failexit("mkdir oidir"); 12c0: 48 bf df 6d 00 00 00 movabs $0x6ddf,%rdi 12c7: 00 00 00 12ca: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 12d1: 00 00 00 12d4: ff d0 callq *%rax } pid = fork(); 12d6: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 12dd: 00 00 00 12e0: ff d0 callq *%rax 12e2: 89 45 fc mov %eax,-0x4(%rbp) if(pid < 0){ 12e5: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 12e9: 79 16 jns 1301 <openiputtest+0x87> failexit("fork"); 12eb: 48 bf a7 6d 00 00 00 movabs $0x6da7,%rdi 12f2: 00 00 00 12f5: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 12fc: 00 00 00 12ff: ff d0 callq *%rax } if(pid == 0){ 1301: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 1305: 75 46 jne 134d <openiputtest+0xd3> int fd = open("oidir", O_RDWR); 1307: be 02 00 00 00 mov $0x2,%esi 130c: 48 bf d9 6d 00 00 00 movabs $0x6dd9,%rdi 1313: 00 00 00 1316: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 131d: 00 00 00 1320: ff d0 callq *%rax 1322: 89 45 f8 mov %eax,-0x8(%rbp) if(fd >= 0){ 1325: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 1329: 78 16 js 1341 <openiputtest+0xc7> failexit("open directory for write succeeded"); 132b: 48 bf f0 6d 00 00 00 movabs $0x6df0,%rdi 1332: 00 00 00 1335: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 133c: 00 00 00 133f: ff d0 callq *%rax } exit(); 1341: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1348: 00 00 00 134b: ff d0 callq *%rax } sleep(1); 134d: bf 01 00 00 00 mov $0x1,%edi 1352: 48 b8 f7 63 00 00 00 movabs $0x63f7,%rax 1359: 00 00 00 135c: ff d0 callq *%rax if(unlink("oidir") != 0){ 135e: 48 bf d9 6d 00 00 00 movabs $0x6dd9,%rdi 1365: 00 00 00 1368: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 136f: 00 00 00 1372: ff d0 callq *%rax 1374: 85 c0 test %eax,%eax 1376: 74 16 je 138e <openiputtest+0x114> failexit("unlink"); 1378: 48 bf 13 6e 00 00 00 movabs $0x6e13,%rdi 137f: 00 00 00 1382: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1389: 00 00 00 138c: ff d0 callq *%rax } wait(); 138e: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 1395: 00 00 00 1398: ff d0 callq *%rax printf(1, "openiput test ok\n"); 139a: 48 be 1a 6e 00 00 00 movabs $0x6e1a,%rsi 13a1: 00 00 00 13a4: bf 01 00 00 00 mov $0x1,%edi 13a9: b8 00 00 00 00 mov $0x0,%eax 13ae: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 13b5: 00 00 00 13b8: ff d2 callq *%rdx } 13ba: 90 nop 13bb: c9 leaveq 13bc: c3 retq 00000000000013bd <opentest>: // simple file system tests void opentest(void) { 13bd: f3 0f 1e fa endbr64 13c1: 55 push %rbp 13c2: 48 89 e5 mov %rsp,%rbp 13c5: 48 83 ec 10 sub $0x10,%rsp int fd; printf(1, "open test\n"); 13c9: 48 be 2c 6e 00 00 00 movabs $0x6e2c,%rsi 13d0: 00 00 00 13d3: bf 01 00 00 00 mov $0x1,%edi 13d8: b8 00 00 00 00 mov $0x0,%eax 13dd: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 13e4: 00 00 00 13e7: ff d2 callq *%rdx fd = open("echo", 0); 13e9: be 00 00 00 00 mov $0x0,%esi 13ee: 48 bf 18 6d 00 00 00 movabs $0x6d18,%rdi 13f5: 00 00 00 13f8: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 13ff: 00 00 00 1402: ff d0 callq *%rax 1404: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 1407: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 140b: 79 16 jns 1423 <opentest+0x66> failexit("open echo"); 140d: 48 bf 37 6e 00 00 00 movabs $0x6e37,%rdi 1414: 00 00 00 1417: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 141e: 00 00 00 1421: ff d0 callq *%rax } close(fd); 1423: 8b 45 fc mov -0x4(%rbp),%eax 1426: 89 c7 mov %eax,%edi 1428: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 142f: 00 00 00 1432: ff d0 callq *%rax fd = open("doesnotexist", 0); 1434: be 00 00 00 00 mov $0x0,%esi 1439: 48 bf 41 6e 00 00 00 movabs $0x6e41,%rdi 1440: 00 00 00 1443: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 144a: 00 00 00 144d: ff d0 callq *%rax 144f: 89 45 fc mov %eax,-0x4(%rbp) if(fd >= 0){ 1452: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 1456: 78 16 js 146e <opentest+0xb1> failexit("open doesnotexist succeeded!"); 1458: 48 bf 4e 6e 00 00 00 movabs $0x6e4e,%rdi 145f: 00 00 00 1462: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1469: 00 00 00 146c: ff d0 callq *%rax } printf(1, "open test ok\n"); 146e: 48 be 6b 6e 00 00 00 movabs $0x6e6b,%rsi 1475: 00 00 00 1478: bf 01 00 00 00 mov $0x1,%edi 147d: b8 00 00 00 00 mov $0x0,%eax 1482: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1489: 00 00 00 148c: ff d2 callq *%rdx } 148e: 90 nop 148f: c9 leaveq 1490: c3 retq 0000000000001491 <writetest>: void writetest(void) { 1491: f3 0f 1e fa endbr64 1495: 55 push %rbp 1496: 48 89 e5 mov %rsp,%rbp 1499: 48 83 ec 10 sub $0x10,%rsp int fd; int i; printf(1, "small file test\n"); 149d: 48 be 79 6e 00 00 00 movabs $0x6e79,%rsi 14a4: 00 00 00 14a7: bf 01 00 00 00 mov $0x1,%edi 14ac: b8 00 00 00 00 mov $0x0,%eax 14b1: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 14b8: 00 00 00 14bb: ff d2 callq *%rdx fd = open("small", O_CREATE|O_RDWR); 14bd: be 02 02 00 00 mov $0x202,%esi 14c2: 48 bf 8a 6e 00 00 00 movabs $0x6e8a,%rdi 14c9: 00 00 00 14cc: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 14d3: 00 00 00 14d6: ff d0 callq *%rax 14d8: 89 45 f8 mov %eax,-0x8(%rbp) if(fd < 0){ 14db: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 14df: 79 16 jns 14f7 <writetest+0x66> failexit("error: creat small"); 14e1: 48 bf 90 6e 00 00 00 movabs $0x6e90,%rdi 14e8: 00 00 00 14eb: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 14f2: 00 00 00 14f5: ff d0 callq *%rax } for(i = 0; i < 100; i++){ 14f7: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 14fe: e9 b0 00 00 00 jmpq 15b3 <writetest+0x122> if(write(fd, "aaaaaaaaaa", 10) != 10){ 1503: 8b 45 f8 mov -0x8(%rbp),%eax 1506: ba 0a 00 00 00 mov $0xa,%edx 150b: 48 be a3 6e 00 00 00 movabs $0x6ea3,%rsi 1512: 00 00 00 1515: 89 c7 mov %eax,%edi 1517: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 151e: 00 00 00 1521: ff d0 callq *%rax 1523: 83 f8 0a cmp $0xa,%eax 1526: 74 31 je 1559 <writetest+0xc8> printf(1, "error: write aa %d new file failed\n", i); 1528: 8b 45 fc mov -0x4(%rbp),%eax 152b: 89 c2 mov %eax,%edx 152d: 48 be b0 6e 00 00 00 movabs $0x6eb0,%rsi 1534: 00 00 00 1537: bf 01 00 00 00 mov $0x1,%edi 153c: b8 00 00 00 00 mov $0x0,%eax 1541: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 1548: 00 00 00 154b: ff d1 callq *%rcx exit(); 154d: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1554: 00 00 00 1557: ff d0 callq *%rax } if(write(fd, "bbbbbbbbbb", 10) != 10){ 1559: 8b 45 f8 mov -0x8(%rbp),%eax 155c: ba 0a 00 00 00 mov $0xa,%edx 1561: 48 be d4 6e 00 00 00 movabs $0x6ed4,%rsi 1568: 00 00 00 156b: 89 c7 mov %eax,%edi 156d: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 1574: 00 00 00 1577: ff d0 callq *%rax 1579: 83 f8 0a cmp $0xa,%eax 157c: 74 31 je 15af <writetest+0x11e> printf(1, "error: write bb %d new file failed\n", i); 157e: 8b 45 fc mov -0x4(%rbp),%eax 1581: 89 c2 mov %eax,%edx 1583: 48 be e0 6e 00 00 00 movabs $0x6ee0,%rsi 158a: 00 00 00 158d: bf 01 00 00 00 mov $0x1,%edi 1592: b8 00 00 00 00 mov $0x0,%eax 1597: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 159e: 00 00 00 15a1: ff d1 callq *%rcx exit(); 15a3: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 15aa: 00 00 00 15ad: ff d0 callq *%rax for(i = 0; i < 100; i++){ 15af: 83 45 fc 01 addl $0x1,-0x4(%rbp) 15b3: 83 7d fc 63 cmpl $0x63,-0x4(%rbp) 15b7: 0f 8e 46 ff ff ff jle 1503 <writetest+0x72> } } close(fd); 15bd: 8b 45 f8 mov -0x8(%rbp),%eax 15c0: 89 c7 mov %eax,%edi 15c2: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 15c9: 00 00 00 15cc: ff d0 callq *%rax fd = open("small", O_RDONLY); 15ce: be 00 00 00 00 mov $0x0,%esi 15d3: 48 bf 8a 6e 00 00 00 movabs $0x6e8a,%rdi 15da: 00 00 00 15dd: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 15e4: 00 00 00 15e7: ff d0 callq *%rax 15e9: 89 45 f8 mov %eax,-0x8(%rbp) if(fd < 0){ 15ec: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 15f0: 79 16 jns 1608 <writetest+0x177> failexit("error: open small"); 15f2: 48 bf 04 6f 00 00 00 movabs $0x6f04,%rdi 15f9: 00 00 00 15fc: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1603: 00 00 00 1606: ff d0 callq *%rax } i = read(fd, buf, 2000); 1608: 8b 45 f8 mov -0x8(%rbp),%eax 160b: ba d0 07 00 00 mov $0x7d0,%edx 1610: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 1617: 00 00 00 161a: 89 c7 mov %eax,%edi 161c: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 1623: 00 00 00 1626: ff d0 callq *%rax 1628: 89 45 fc mov %eax,-0x4(%rbp) if(i != 2000){ 162b: 81 7d fc d0 07 00 00 cmpl $0x7d0,-0x4(%rbp) 1632: 74 16 je 164a <writetest+0x1b9> failexit("read"); 1634: 48 bf 16 6f 00 00 00 movabs $0x6f16,%rdi 163b: 00 00 00 163e: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1645: 00 00 00 1648: ff d0 callq *%rax } close(fd); 164a: 8b 45 f8 mov -0x8(%rbp),%eax 164d: 89 c7 mov %eax,%edi 164f: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 1656: 00 00 00 1659: ff d0 callq *%rax if(unlink("small") < 0){ 165b: 48 bf 8a 6e 00 00 00 movabs $0x6e8a,%rdi 1662: 00 00 00 1665: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 166c: 00 00 00 166f: ff d0 callq *%rax 1671: 85 c0 test %eax,%eax 1673: 79 22 jns 1697 <writetest+0x206> failexit("unlink small"); 1675: 48 bf 1b 6f 00 00 00 movabs $0x6f1b,%rdi 167c: 00 00 00 167f: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1686: 00 00 00 1689: ff d0 callq *%rax exit(); 168b: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1692: 00 00 00 1695: ff d0 callq *%rax } printf(1, "small file test ok\n"); 1697: 48 be 28 6f 00 00 00 movabs $0x6f28,%rsi 169e: 00 00 00 16a1: bf 01 00 00 00 mov $0x1,%edi 16a6: b8 00 00 00 00 mov $0x0,%eax 16ab: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 16b2: 00 00 00 16b5: ff d2 callq *%rdx } 16b7: 90 nop 16b8: c9 leaveq 16b9: c3 retq 00000000000016ba <writetest1>: void writetest1(void) { 16ba: f3 0f 1e fa endbr64 16be: 55 push %rbp 16bf: 48 89 e5 mov %rsp,%rbp 16c2: 48 83 ec 10 sub $0x10,%rsp int i, fd, n; printf(1, "big files test\n"); 16c6: 48 be 3c 6f 00 00 00 movabs $0x6f3c,%rsi 16cd: 00 00 00 16d0: bf 01 00 00 00 mov $0x1,%edi 16d5: b8 00 00 00 00 mov $0x0,%eax 16da: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 16e1: 00 00 00 16e4: ff d2 callq *%rdx fd = open("big", O_CREATE|O_RDWR); 16e6: be 02 02 00 00 mov $0x202,%esi 16eb: 48 bf 4c 6f 00 00 00 movabs $0x6f4c,%rdi 16f2: 00 00 00 16f5: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 16fc: 00 00 00 16ff: ff d0 callq *%rax 1701: 89 45 f4 mov %eax,-0xc(%rbp) if(fd < 0){ 1704: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 1708: 79 16 jns 1720 <writetest1+0x66> failexit("error: creat big"); 170a: 48 bf 50 6f 00 00 00 movabs $0x6f50,%rdi 1711: 00 00 00 1714: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 171b: 00 00 00 171e: ff d0 callq *%rax } for(i = 0; i < MAXFILE; i++){ 1720: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 1727: eb 50 jmp 1779 <writetest1+0xbf> ((int*)buf)[0] = i; 1729: 48 ba 00 8c 00 00 00 movabs $0x8c00,%rdx 1730: 00 00 00 1733: 8b 45 fc mov -0x4(%rbp),%eax 1736: 89 02 mov %eax,(%rdx) if(write(fd, buf, 512) != 512){ 1738: 8b 45 f4 mov -0xc(%rbp),%eax 173b: ba 00 02 00 00 mov $0x200,%edx 1740: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 1747: 00 00 00 174a: 89 c7 mov %eax,%edi 174c: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 1753: 00 00 00 1756: ff d0 callq *%rax 1758: 3d 00 02 00 00 cmp $0x200,%eax 175d: 74 16 je 1775 <writetest1+0xbb> failexit("error: write big file"); 175f: 48 bf 61 6f 00 00 00 movabs $0x6f61,%rdi 1766: 00 00 00 1769: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1770: 00 00 00 1773: ff d0 callq *%rax for(i = 0; i < MAXFILE; i++){ 1775: 83 45 fc 01 addl $0x1,-0x4(%rbp) 1779: 8b 45 fc mov -0x4(%rbp),%eax 177c: 3d 8b 00 00 00 cmp $0x8b,%eax 1781: 76 a6 jbe 1729 <writetest1+0x6f> } } close(fd); 1783: 8b 45 f4 mov -0xc(%rbp),%eax 1786: 89 c7 mov %eax,%edi 1788: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 178f: 00 00 00 1792: ff d0 callq *%rax fd = open("big", O_RDONLY); 1794: be 00 00 00 00 mov $0x0,%esi 1799: 48 bf 4c 6f 00 00 00 movabs $0x6f4c,%rdi 17a0: 00 00 00 17a3: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 17aa: 00 00 00 17ad: ff d0 callq *%rax 17af: 89 45 f4 mov %eax,-0xc(%rbp) if(fd < 0){ 17b2: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 17b6: 79 16 jns 17ce <writetest1+0x114> failexit("error: open big"); 17b8: 48 bf 77 6f 00 00 00 movabs $0x6f77,%rdi 17bf: 00 00 00 17c2: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 17c9: 00 00 00 17cc: ff d0 callq *%rax } n = 0; 17ce: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) for(;;){ i = read(fd, buf, 512); 17d5: 8b 45 f4 mov -0xc(%rbp),%eax 17d8: ba 00 02 00 00 mov $0x200,%edx 17dd: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 17e4: 00 00 00 17e7: 89 c7 mov %eax,%edi 17e9: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 17f0: 00 00 00 17f3: ff d0 callq *%rax 17f5: 89 45 fc mov %eax,-0x4(%rbp) if(i == 0){ 17f8: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 17fc: 75 3e jne 183c <writetest1+0x182> if(n == MAXFILE - 1){ 17fe: 81 7d f8 8b 00 00 00 cmpl $0x8b,-0x8(%rbp) 1805: 0f 85 c5 00 00 00 jne 18d0 <writetest1+0x216> printf(1, "read only %d blocks from big. failed", n); 180b: 8b 45 f8 mov -0x8(%rbp),%eax 180e: 89 c2 mov %eax,%edx 1810: 48 be 88 6f 00 00 00 movabs $0x6f88,%rsi 1817: 00 00 00 181a: bf 01 00 00 00 mov $0x1,%edi 181f: b8 00 00 00 00 mov $0x0,%eax 1824: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 182b: 00 00 00 182e: ff d1 callq *%rcx exit(); 1830: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1837: 00 00 00 183a: ff d0 callq *%rax } break; } else if(i != 512){ 183c: 81 7d fc 00 02 00 00 cmpl $0x200,-0x4(%rbp) 1843: 74 31 je 1876 <writetest1+0x1bc> printf(1, "read failed %d\n", i); 1845: 8b 45 fc mov -0x4(%rbp),%eax 1848: 89 c2 mov %eax,%edx 184a: 48 be ad 6f 00 00 00 movabs $0x6fad,%rsi 1851: 00 00 00 1854: bf 01 00 00 00 mov $0x1,%edi 1859: b8 00 00 00 00 mov $0x0,%eax 185e: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 1865: 00 00 00 1868: ff d1 callq *%rcx exit(); 186a: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1871: 00 00 00 1874: ff d0 callq *%rax } if(((int*)buf)[0] != n){ 1876: 48 b8 00 8c 00 00 00 movabs $0x8c00,%rax 187d: 00 00 00 1880: 8b 00 mov (%rax),%eax 1882: 39 45 f8 cmp %eax,-0x8(%rbp) 1885: 74 40 je 18c7 <writetest1+0x20d> printf(1, "read content of block %d is %d. failed\n", n, ((int*)buf)[0]); 1887: 48 b8 00 8c 00 00 00 movabs $0x8c00,%rax 188e: 00 00 00 printf(1, "read content of block %d is %d. failed\n", 1891: 8b 10 mov (%rax),%edx 1893: 8b 45 f8 mov -0x8(%rbp),%eax 1896: 89 d1 mov %edx,%ecx 1898: 89 c2 mov %eax,%edx 189a: 48 be c0 6f 00 00 00 movabs $0x6fc0,%rsi 18a1: 00 00 00 18a4: bf 01 00 00 00 mov $0x1,%edi 18a9: b8 00 00 00 00 mov $0x0,%eax 18ae: 49 b8 04 66 00 00 00 movabs $0x6604,%r8 18b5: 00 00 00 18b8: 41 ff d0 callq *%r8 exit(); 18bb: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 18c2: 00 00 00 18c5: ff d0 callq *%rax } n++; 18c7: 83 45 f8 01 addl $0x1,-0x8(%rbp) i = read(fd, buf, 512); 18cb: e9 05 ff ff ff jmpq 17d5 <writetest1+0x11b> break; 18d0: 90 nop } close(fd); 18d1: 8b 45 f4 mov -0xc(%rbp),%eax 18d4: 89 c7 mov %eax,%edi 18d6: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 18dd: 00 00 00 18e0: ff d0 callq *%rax if(unlink("big") < 0){ 18e2: 48 bf 4c 6f 00 00 00 movabs $0x6f4c,%rdi 18e9: 00 00 00 18ec: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 18f3: 00 00 00 18f6: ff d0 callq *%rax 18f8: 85 c0 test %eax,%eax 18fa: 79 22 jns 191e <writetest1+0x264> failexit("unlink big"); 18fc: 48 bf e8 6f 00 00 00 movabs $0x6fe8,%rdi 1903: 00 00 00 1906: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 190d: 00 00 00 1910: ff d0 callq *%rax exit(); 1912: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1919: 00 00 00 191c: ff d0 callq *%rax } printf(1, "big files ok\n"); 191e: 48 be f3 6f 00 00 00 movabs $0x6ff3,%rsi 1925: 00 00 00 1928: bf 01 00 00 00 mov $0x1,%edi 192d: b8 00 00 00 00 mov $0x0,%eax 1932: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1939: 00 00 00 193c: ff d2 callq *%rdx } 193e: 90 nop 193f: c9 leaveq 1940: c3 retq 0000000000001941 <createtest>: void createtest(void) { 1941: f3 0f 1e fa endbr64 1945: 55 push %rbp 1946: 48 89 e5 mov %rsp,%rbp 1949: 48 83 ec 10 sub $0x10,%rsp int i, fd; printf(1, "many creates, followed by unlink test\n"); 194d: 48 be 08 70 00 00 00 movabs $0x7008,%rsi 1954: 00 00 00 1957: bf 01 00 00 00 mov $0x1,%edi 195c: b8 00 00 00 00 mov $0x0,%eax 1961: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1968: 00 00 00 196b: ff d2 callq *%rdx name[0] = 'a'; 196d: 48 b8 00 ac 00 00 00 movabs $0xac00,%rax 1974: 00 00 00 1977: c6 00 61 movb $0x61,(%rax) name[2] = '\0'; 197a: 48 b8 00 ac 00 00 00 movabs $0xac00,%rax 1981: 00 00 00 1984: c6 40 02 00 movb $0x0,0x2(%rax) for(i = 0; i < 52; i++){ 1988: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 198f: eb 48 jmp 19d9 <createtest+0x98> name[1] = '0' + i; 1991: 8b 45 fc mov -0x4(%rbp),%eax 1994: 83 c0 30 add $0x30,%eax 1997: 89 c2 mov %eax,%edx 1999: 48 b8 00 ac 00 00 00 movabs $0xac00,%rax 19a0: 00 00 00 19a3: 88 50 01 mov %dl,0x1(%rax) fd = open(name, O_CREATE|O_RDWR); 19a6: be 02 02 00 00 mov $0x202,%esi 19ab: 48 bf 00 ac 00 00 00 movabs $0xac00,%rdi 19b2: 00 00 00 19b5: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 19bc: 00 00 00 19bf: ff d0 callq *%rax 19c1: 89 45 f8 mov %eax,-0x8(%rbp) close(fd); 19c4: 8b 45 f8 mov -0x8(%rbp),%eax 19c7: 89 c7 mov %eax,%edi 19c9: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 19d0: 00 00 00 19d3: ff d0 callq *%rax for(i = 0; i < 52; i++){ 19d5: 83 45 fc 01 addl $0x1,-0x4(%rbp) 19d9: 83 7d fc 33 cmpl $0x33,-0x4(%rbp) 19dd: 7e b2 jle 1991 <createtest+0x50> } for(i = 0; i < 52; i++){ 19df: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 19e6: eb 2f jmp 1a17 <createtest+0xd6> name[1] = '0' + i; 19e8: 8b 45 fc mov -0x4(%rbp),%eax 19eb: 83 c0 30 add $0x30,%eax 19ee: 89 c2 mov %eax,%edx 19f0: 48 b8 00 ac 00 00 00 movabs $0xac00,%rax 19f7: 00 00 00 19fa: 88 50 01 mov %dl,0x1(%rax) unlink(name); 19fd: 48 bf 00 ac 00 00 00 movabs $0xac00,%rdi 1a04: 00 00 00 1a07: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 1a0e: 00 00 00 1a11: ff d0 callq *%rax for(i = 0; i < 52; i++){ 1a13: 83 45 fc 01 addl $0x1,-0x4(%rbp) 1a17: 83 7d fc 33 cmpl $0x33,-0x4(%rbp) 1a1b: 7e cb jle 19e8 <createtest+0xa7> } for(i = 0; i < 52; i++){ 1a1d: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 1a24: eb 53 jmp 1a79 <createtest+0x138> name[1] = '0' + i; 1a26: 8b 45 fc mov -0x4(%rbp),%eax 1a29: 83 c0 30 add $0x30,%eax 1a2c: 89 c2 mov %eax,%edx 1a2e: 48 b8 00 ac 00 00 00 movabs $0xac00,%rax 1a35: 00 00 00 1a38: 88 50 01 mov %dl,0x1(%rax) fd = open(name, O_RDWR); 1a3b: be 02 00 00 00 mov $0x2,%esi 1a40: 48 bf 00 ac 00 00 00 movabs $0xac00,%rdi 1a47: 00 00 00 1a4a: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 1a51: 00 00 00 1a54: ff d0 callq *%rax 1a56: 89 45 f8 mov %eax,-0x8(%rbp) if(fd >= 0) { 1a59: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 1a5d: 78 16 js 1a75 <createtest+0x134> failexit("open should fail."); 1a5f: 48 bf 2f 70 00 00 00 movabs $0x702f,%rdi 1a66: 00 00 00 1a69: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1a70: 00 00 00 1a73: ff d0 callq *%rax for(i = 0; i < 52; i++){ 1a75: 83 45 fc 01 addl $0x1,-0x4(%rbp) 1a79: 83 7d fc 33 cmpl $0x33,-0x4(%rbp) 1a7d: 7e a7 jle 1a26 <createtest+0xe5> } } printf(1, "many creates, followed by unlink; ok\n"); 1a7f: 48 be 48 70 00 00 00 movabs $0x7048,%rsi 1a86: 00 00 00 1a89: bf 01 00 00 00 mov $0x1,%edi 1a8e: b8 00 00 00 00 mov $0x0,%eax 1a93: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1a9a: 00 00 00 1a9d: ff d2 callq *%rdx } 1a9f: 90 nop 1aa0: c9 leaveq 1aa1: c3 retq 0000000000001aa2 <dirtest>: void dirtest(void) { 1aa2: f3 0f 1e fa endbr64 1aa6: 55 push %rbp 1aa7: 48 89 e5 mov %rsp,%rbp printf(1, "mkdir test\n"); 1aaa: 48 be 6e 70 00 00 00 movabs $0x706e,%rsi 1ab1: 00 00 00 1ab4: bf 01 00 00 00 mov $0x1,%edi 1ab9: b8 00 00 00 00 mov $0x0,%eax 1abe: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1ac5: 00 00 00 1ac8: ff d2 callq *%rdx if(mkdir("dir0") < 0){ 1aca: 48 bf 7a 70 00 00 00 movabs $0x707a,%rdi 1ad1: 00 00 00 1ad4: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 1adb: 00 00 00 1ade: ff d0 callq *%rax 1ae0: 85 c0 test %eax,%eax 1ae2: 79 16 jns 1afa <dirtest+0x58> failexit("mkdir"); 1ae4: 48 bf 4f 6d 00 00 00 movabs $0x6d4f,%rdi 1aeb: 00 00 00 1aee: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1af5: 00 00 00 1af8: ff d0 callq *%rax } if(chdir("dir0") < 0){ 1afa: 48 bf 7a 70 00 00 00 movabs $0x707a,%rdi 1b01: 00 00 00 1b04: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 1b0b: 00 00 00 1b0e: ff d0 callq *%rax 1b10: 85 c0 test %eax,%eax 1b12: 79 16 jns 1b2a <dirtest+0x88> failexit("chdir dir0"); 1b14: 48 bf 7f 70 00 00 00 movabs $0x707f,%rdi 1b1b: 00 00 00 1b1e: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1b25: 00 00 00 1b28: ff d0 callq *%rax } if(chdir("..") < 0){ 1b2a: 48 bf 8a 70 00 00 00 movabs $0x708a,%rdi 1b31: 00 00 00 1b34: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 1b3b: 00 00 00 1b3e: ff d0 callq *%rax 1b40: 85 c0 test %eax,%eax 1b42: 79 16 jns 1b5a <dirtest+0xb8> failexit("chdir .."); 1b44: 48 bf 8d 70 00 00 00 movabs $0x708d,%rdi 1b4b: 00 00 00 1b4e: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1b55: 00 00 00 1b58: ff d0 callq *%rax } if(unlink("dir0") < 0){ 1b5a: 48 bf 7a 70 00 00 00 movabs $0x707a,%rdi 1b61: 00 00 00 1b64: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 1b6b: 00 00 00 1b6e: ff d0 callq *%rax 1b70: 85 c0 test %eax,%eax 1b72: 79 16 jns 1b8a <dirtest+0xe8> failexit("unlink dir0"); 1b74: 48 bf 96 70 00 00 00 movabs $0x7096,%rdi 1b7b: 00 00 00 1b7e: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1b85: 00 00 00 1b88: ff d0 callq *%rax } printf(1, "mkdir test ok\n"); 1b8a: 48 be a2 70 00 00 00 movabs $0x70a2,%rsi 1b91: 00 00 00 1b94: bf 01 00 00 00 mov $0x1,%edi 1b99: b8 00 00 00 00 mov $0x0,%eax 1b9e: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1ba5: 00 00 00 1ba8: ff d2 callq *%rdx } 1baa: 90 nop 1bab: 5d pop %rbp 1bac: c3 retq 0000000000001bad <exectest>: void exectest(void) { 1bad: f3 0f 1e fa endbr64 1bb1: 55 push %rbp 1bb2: 48 89 e5 mov %rsp,%rbp printf(1, "exec test\n"); 1bb5: 48 be b1 70 00 00 00 movabs $0x70b1,%rsi 1bbc: 00 00 00 1bbf: bf 01 00 00 00 mov $0x1,%edi 1bc4: b8 00 00 00 00 mov $0x0,%eax 1bc9: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1bd0: 00 00 00 1bd3: ff d2 callq *%rdx if(exec("echo", echoargv) < 0){ 1bd5: 48 be a0 8b 00 00 00 movabs $0x8ba0,%rsi 1bdc: 00 00 00 1bdf: 48 bf 18 6d 00 00 00 movabs $0x6d18,%rdi 1be6: 00 00 00 1be9: 48 b8 68 63 00 00 00 movabs $0x6368,%rax 1bf0: 00 00 00 1bf3: ff d0 callq *%rax 1bf5: 85 c0 test %eax,%eax 1bf7: 79 16 jns 1c0f <exectest+0x62> failexit("exec echo"); 1bf9: 48 bf bc 70 00 00 00 movabs $0x70bc,%rdi 1c00: 00 00 00 1c03: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1c0a: 00 00 00 1c0d: ff d0 callq *%rax } printf(1, "exec test ok\n"); 1c0f: 48 be c6 70 00 00 00 movabs $0x70c6,%rsi 1c16: 00 00 00 1c19: bf 01 00 00 00 mov $0x1,%edi 1c1e: b8 00 00 00 00 mov $0x0,%eax 1c23: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1c2a: 00 00 00 1c2d: ff d2 callq *%rdx } 1c2f: 90 nop 1c30: 5d pop %rbp 1c31: c3 retq 0000000000001c32 <nullptr>: void nullptr(void) { 1c32: f3 0f 1e fa endbr64 1c36: 55 push %rbp 1c37: 48 89 e5 mov %rsp,%rbp 1c3a: 48 83 ec 10 sub $0x10,%rsp printf(1, "null pointer test\n"); 1c3e: 48 be d4 70 00 00 00 movabs $0x70d4,%rsi 1c45: 00 00 00 1c48: bf 01 00 00 00 mov $0x1,%edi 1c4d: b8 00 00 00 00 mov $0x0,%eax 1c52: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1c59: 00 00 00 1c5c: ff d2 callq *%rdx printf(1, "expect one killed process\n"); 1c5e: 48 be e7 70 00 00 00 movabs $0x70e7,%rsi 1c65: 00 00 00 1c68: bf 01 00 00 00 mov $0x1,%edi 1c6d: b8 00 00 00 00 mov $0x0,%eax 1c72: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1c79: 00 00 00 1c7c: ff d2 callq *%rdx int ppid = getpid(); 1c7e: 48 b8 dd 63 00 00 00 movabs $0x63dd,%rax 1c85: 00 00 00 1c88: ff d0 callq *%rax 1c8a: 89 45 fc mov %eax,-0x4(%rbp) if (fork() == 0) { 1c8d: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 1c94: 00 00 00 1c97: ff d0 callq *%rax 1c99: 85 c0 test %eax,%eax 1c9b: 75 49 jne 1ce6 <nullptr+0xb4> *(addr_t *)(0) = 10; 1c9d: b8 00 00 00 00 mov $0x0,%eax 1ca2: 48 c7 00 0a 00 00 00 movq $0xa,(%rax) printf(1, "can write to unmapped page 0, failed"); 1ca9: 48 be 08 71 00 00 00 movabs $0x7108,%rsi 1cb0: 00 00 00 1cb3: bf 01 00 00 00 mov $0x1,%edi 1cb8: b8 00 00 00 00 mov $0x0,%eax 1cbd: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1cc4: 00 00 00 1cc7: ff d2 callq *%rdx kill(ppid); 1cc9: 8b 45 fc mov -0x4(%rbp),%eax 1ccc: 89 c7 mov %eax,%edi 1cce: 48 b8 5b 63 00 00 00 movabs $0x635b,%rax 1cd5: 00 00 00 1cd8: ff d0 callq *%rax exit(); 1cda: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1ce1: 00 00 00 1ce4: ff d0 callq *%rax } else { wait(); 1ce6: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 1ced: 00 00 00 1cf0: ff d0 callq *%rax } printf(1, "null pointer test ok\n"); 1cf2: 48 be 2d 71 00 00 00 movabs $0x712d,%rsi 1cf9: 00 00 00 1cfc: bf 01 00 00 00 mov $0x1,%edi 1d01: b8 00 00 00 00 mov $0x0,%eax 1d06: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1d0d: 00 00 00 1d10: ff d2 callq *%rdx } 1d12: 90 nop 1d13: c9 leaveq 1d14: c3 retq 0000000000001d15 <pipe1>: // simple fork and pipe read/write void pipe1(void) { 1d15: f3 0f 1e fa endbr64 1d19: 55 push %rbp 1d1a: 48 89 e5 mov %rsp,%rbp 1d1d: 48 83 ec 20 sub $0x20,%rsp int fds[2], pid; int seq, i, n, cc, total; if(pipe(fds) != 0){ 1d21: 48 8d 45 e0 lea -0x20(%rbp),%rax 1d25: 48 89 c7 mov %rax,%rdi 1d28: 48 b8 27 63 00 00 00 movabs $0x6327,%rax 1d2f: 00 00 00 1d32: ff d0 callq *%rax 1d34: 85 c0 test %eax,%eax 1d36: 74 16 je 1d4e <pipe1+0x39> failexit("pipe()"); 1d38: 48 bf 43 71 00 00 00 movabs $0x7143,%rdi 1d3f: 00 00 00 1d42: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1d49: 00 00 00 1d4c: ff d0 callq *%rax } pid = fork(); 1d4e: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 1d55: 00 00 00 1d58: ff d0 callq *%rax 1d5a: 89 45 e8 mov %eax,-0x18(%rbp) seq = 0; 1d5d: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) if(pid == 0){ 1d64: 83 7d e8 00 cmpl $0x0,-0x18(%rbp) 1d68: 0f 85 a0 00 00 00 jne 1e0e <pipe1+0xf9> close(fds[0]); 1d6e: 8b 45 e0 mov -0x20(%rbp),%eax 1d71: 89 c7 mov %eax,%edi 1d73: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 1d7a: 00 00 00 1d7d: ff d0 callq *%rax for(n = 0; n < 5; n++){ 1d7f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) 1d86: eb 74 jmp 1dfc <pipe1+0xe7> for(i = 0; i < 1033; i++) 1d88: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) 1d8f: eb 21 jmp 1db2 <pipe1+0x9d> buf[i] = seq++; 1d91: 8b 45 fc mov -0x4(%rbp),%eax 1d94: 8d 50 01 lea 0x1(%rax),%edx 1d97: 89 55 fc mov %edx,-0x4(%rbp) 1d9a: 89 c1 mov %eax,%ecx 1d9c: 48 ba 00 8c 00 00 00 movabs $0x8c00,%rdx 1da3: 00 00 00 1da6: 8b 45 f8 mov -0x8(%rbp),%eax 1da9: 48 98 cltq 1dab: 88 0c 02 mov %cl,(%rdx,%rax,1) for(i = 0; i < 1033; i++) 1dae: 83 45 f8 01 addl $0x1,-0x8(%rbp) 1db2: 81 7d f8 08 04 00 00 cmpl $0x408,-0x8(%rbp) 1db9: 7e d6 jle 1d91 <pipe1+0x7c> if(write(fds[1], buf, 1033) != 1033){ 1dbb: 8b 45 e4 mov -0x1c(%rbp),%eax 1dbe: ba 09 04 00 00 mov $0x409,%edx 1dc3: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 1dca: 00 00 00 1dcd: 89 c7 mov %eax,%edi 1dcf: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 1dd6: 00 00 00 1dd9: ff d0 callq *%rax 1ddb: 3d 09 04 00 00 cmp $0x409,%eax 1de0: 74 16 je 1df8 <pipe1+0xe3> failexit("pipe1 oops 1"); 1de2: 48 bf 4a 71 00 00 00 movabs $0x714a,%rdi 1de9: 00 00 00 1dec: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1df3: 00 00 00 1df6: ff d0 callq *%rax for(n = 0; n < 5; n++){ 1df8: 83 45 f4 01 addl $0x1,-0xc(%rbp) 1dfc: 83 7d f4 04 cmpl $0x4,-0xc(%rbp) 1e00: 7e 86 jle 1d88 <pipe1+0x73> } } exit(); 1e02: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1e09: 00 00 00 1e0c: ff d0 callq *%rax } else if(pid > 0){ 1e0e: 83 7d e8 00 cmpl $0x0,-0x18(%rbp) 1e12: 0f 8e 17 01 00 00 jle 1f2f <pipe1+0x21a> close(fds[1]); 1e18: 8b 45 e4 mov -0x1c(%rbp),%eax 1e1b: 89 c7 mov %eax,%edi 1e1d: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 1e24: 00 00 00 1e27: ff d0 callq *%rax total = 0; 1e29: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%rbp) cc = 1; 1e30: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%rbp) while((n = read(fds[0], buf, cc)) > 0){ 1e37: eb 72 jmp 1eab <pipe1+0x196> for(i = 0; i < n; i++){ 1e39: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) 1e40: eb 47 jmp 1e89 <pipe1+0x174> if((buf[i] & 0xff) != (seq++ & 0xff)){ 1e42: 48 ba 00 8c 00 00 00 movabs $0x8c00,%rdx 1e49: 00 00 00 1e4c: 8b 45 f8 mov -0x8(%rbp),%eax 1e4f: 48 98 cltq 1e51: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax 1e55: 0f be c8 movsbl %al,%ecx 1e58: 8b 45 fc mov -0x4(%rbp),%eax 1e5b: 8d 50 01 lea 0x1(%rax),%edx 1e5e: 89 55 fc mov %edx,-0x4(%rbp) 1e61: 31 c8 xor %ecx,%eax 1e63: 0f b6 c0 movzbl %al,%eax 1e66: 85 c0 test %eax,%eax 1e68: 74 1b je 1e85 <pipe1+0x170> failexit("pipe1 oops 2"); 1e6a: 48 bf 57 71 00 00 00 movabs $0x7157,%rdi 1e71: 00 00 00 1e74: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1e7b: 00 00 00 1e7e: ff d0 callq *%rax 1e80: e9 e0 00 00 00 jmpq 1f65 <pipe1+0x250> for(i = 0; i < n; i++){ 1e85: 83 45 f8 01 addl $0x1,-0x8(%rbp) 1e89: 8b 45 f8 mov -0x8(%rbp),%eax 1e8c: 3b 45 f4 cmp -0xc(%rbp),%eax 1e8f: 7c b1 jl 1e42 <pipe1+0x12d> return; } } total += n; 1e91: 8b 45 f4 mov -0xc(%rbp),%eax 1e94: 01 45 ec add %eax,-0x14(%rbp) cc = cc * 2; 1e97: d1 65 f0 shll -0x10(%rbp) if(cc > sizeof(buf)) 1e9a: 8b 45 f0 mov -0x10(%rbp),%eax 1e9d: 3d 00 20 00 00 cmp $0x2000,%eax 1ea2: 76 07 jbe 1eab <pipe1+0x196> cc = sizeof(buf); 1ea4: c7 45 f0 00 20 00 00 movl $0x2000,-0x10(%rbp) while((n = read(fds[0], buf, cc)) > 0){ 1eab: 8b 45 e0 mov -0x20(%rbp),%eax 1eae: 8b 55 f0 mov -0x10(%rbp),%edx 1eb1: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 1eb8: 00 00 00 1ebb: 89 c7 mov %eax,%edi 1ebd: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 1ec4: 00 00 00 1ec7: ff d0 callq *%rax 1ec9: 89 45 f4 mov %eax,-0xc(%rbp) 1ecc: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 1ed0: 0f 8f 63 ff ff ff jg 1e39 <pipe1+0x124> } if(total != 5 * 1033){ 1ed6: 81 7d ec 2d 14 00 00 cmpl $0x142d,-0x14(%rbp) 1edd: 74 31 je 1f10 <pipe1+0x1fb> printf(1, "pipe1 oops 3 total %d\n", total); 1edf: 8b 45 ec mov -0x14(%rbp),%eax 1ee2: 89 c2 mov %eax,%edx 1ee4: 48 be 64 71 00 00 00 movabs $0x7164,%rsi 1eeb: 00 00 00 1eee: bf 01 00 00 00 mov $0x1,%edi 1ef3: b8 00 00 00 00 mov $0x0,%eax 1ef8: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 1eff: 00 00 00 1f02: ff d1 callq *%rcx exit(); 1f04: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 1f0b: 00 00 00 1f0e: ff d0 callq *%rax } close(fds[0]); 1f10: 8b 45 e0 mov -0x20(%rbp),%eax 1f13: 89 c7 mov %eax,%edi 1f15: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 1f1c: 00 00 00 1f1f: ff d0 callq *%rax wait(); 1f21: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 1f28: 00 00 00 1f2b: ff d0 callq *%rax 1f2d: eb 16 jmp 1f45 <pipe1+0x230> } else { failexit("fork()"); 1f2f: 48 bf 7b 71 00 00 00 movabs $0x717b,%rdi 1f36: 00 00 00 1f39: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 1f40: 00 00 00 1f43: ff d0 callq *%rax } printf(1, "pipe1 ok\n"); 1f45: 48 be 82 71 00 00 00 movabs $0x7182,%rsi 1f4c: 00 00 00 1f4f: bf 01 00 00 00 mov $0x1,%edi 1f54: b8 00 00 00 00 mov $0x0,%eax 1f59: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1f60: 00 00 00 1f63: ff d2 callq *%rdx } 1f65: c9 leaveq 1f66: c3 retq 0000000000001f67 <preempt>: // meant to be run w/ at most two CPUs void preempt(void) { 1f67: f3 0f 1e fa endbr64 1f6b: 55 push %rbp 1f6c: 48 89 e5 mov %rsp,%rbp 1f6f: 48 83 ec 20 sub $0x20,%rsp int pid1, pid2, pid3; int pfds[2]; printf(1, "preempt: "); 1f73: 48 be 8c 71 00 00 00 movabs $0x718c,%rsi 1f7a: 00 00 00 1f7d: bf 01 00 00 00 mov $0x1,%edi 1f82: b8 00 00 00 00 mov $0x0,%eax 1f87: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 1f8e: 00 00 00 1f91: ff d2 callq *%rdx pid1 = fork(); 1f93: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 1f9a: 00 00 00 1f9d: ff d0 callq *%rax 1f9f: 89 45 fc mov %eax,-0x4(%rbp) if(pid1 == 0) 1fa2: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 1fa6: 75 02 jne 1faa <preempt+0x43> for(;;) 1fa8: eb fe jmp 1fa8 <preempt+0x41> ; pid2 = fork(); 1faa: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 1fb1: 00 00 00 1fb4: ff d0 callq *%rax 1fb6: 89 45 f8 mov %eax,-0x8(%rbp) if(pid2 == 0) 1fb9: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 1fbd: 75 02 jne 1fc1 <preempt+0x5a> for(;;) 1fbf: eb fe jmp 1fbf <preempt+0x58> ; pipe(pfds); 1fc1: 48 8d 45 ec lea -0x14(%rbp),%rax 1fc5: 48 89 c7 mov %rax,%rdi 1fc8: 48 b8 27 63 00 00 00 movabs $0x6327,%rax 1fcf: 00 00 00 1fd2: ff d0 callq *%rax pid3 = fork(); 1fd4: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 1fdb: 00 00 00 1fde: ff d0 callq *%rax 1fe0: 89 45 f4 mov %eax,-0xc(%rbp) if(pid3 == 0){ 1fe3: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 1fe7: 75 69 jne 2052 <preempt+0xeb> close(pfds[0]); 1fe9: 8b 45 ec mov -0x14(%rbp),%eax 1fec: 89 c7 mov %eax,%edi 1fee: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 1ff5: 00 00 00 1ff8: ff d0 callq *%rax if(write(pfds[1], "x", 1) != 1) 1ffa: 8b 45 f0 mov -0x10(%rbp),%eax 1ffd: ba 01 00 00 00 mov $0x1,%edx 2002: 48 be 96 71 00 00 00 movabs $0x7196,%rsi 2009: 00 00 00 200c: 89 c7 mov %eax,%edi 200e: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 2015: 00 00 00 2018: ff d0 callq *%rax 201a: 83 f8 01 cmp $0x1,%eax 201d: 74 20 je 203f <preempt+0xd8> printf(1, "preempt write error"); 201f: 48 be 98 71 00 00 00 movabs $0x7198,%rsi 2026: 00 00 00 2029: bf 01 00 00 00 mov $0x1,%edi 202e: b8 00 00 00 00 mov $0x0,%eax 2033: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 203a: 00 00 00 203d: ff d2 callq *%rdx close(pfds[1]); 203f: 8b 45 f0 mov -0x10(%rbp),%eax 2042: 89 c7 mov %eax,%edi 2044: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 204b: 00 00 00 204e: ff d0 callq *%rax for(;;) 2050: eb fe jmp 2050 <preempt+0xe9> ; } close(pfds[1]); 2052: 8b 45 f0 mov -0x10(%rbp),%eax 2055: 89 c7 mov %eax,%edi 2057: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 205e: 00 00 00 2061: ff d0 callq *%rax if(read(pfds[0], buf, sizeof(buf)) != 1){ 2063: 8b 45 ec mov -0x14(%rbp),%eax 2066: ba 00 20 00 00 mov $0x2000,%edx 206b: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 2072: 00 00 00 2075: 89 c7 mov %eax,%edi 2077: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 207e: 00 00 00 2081: ff d0 callq *%rax 2083: 83 f8 01 cmp $0x1,%eax 2086: 74 25 je 20ad <preempt+0x146> printf(1, "preempt read error"); 2088: 48 be ac 71 00 00 00 movabs $0x71ac,%rsi 208f: 00 00 00 2092: bf 01 00 00 00 mov $0x1,%edi 2097: b8 00 00 00 00 mov $0x0,%eax 209c: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 20a3: 00 00 00 20a6: ff d2 callq *%rdx 20a8: e9 c8 00 00 00 jmpq 2175 <preempt+0x20e> return; } close(pfds[0]); 20ad: 8b 45 ec mov -0x14(%rbp),%eax 20b0: 89 c7 mov %eax,%edi 20b2: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 20b9: 00 00 00 20bc: ff d0 callq *%rax printf(1, "kill... "); 20be: 48 be bf 71 00 00 00 movabs $0x71bf,%rsi 20c5: 00 00 00 20c8: bf 01 00 00 00 mov $0x1,%edi 20cd: b8 00 00 00 00 mov $0x0,%eax 20d2: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 20d9: 00 00 00 20dc: ff d2 callq *%rdx kill(pid1); 20de: 8b 45 fc mov -0x4(%rbp),%eax 20e1: 89 c7 mov %eax,%edi 20e3: 48 b8 5b 63 00 00 00 movabs $0x635b,%rax 20ea: 00 00 00 20ed: ff d0 callq *%rax kill(pid2); 20ef: 8b 45 f8 mov -0x8(%rbp),%eax 20f2: 89 c7 mov %eax,%edi 20f4: 48 b8 5b 63 00 00 00 movabs $0x635b,%rax 20fb: 00 00 00 20fe: ff d0 callq *%rax kill(pid3); 2100: 8b 45 f4 mov -0xc(%rbp),%eax 2103: 89 c7 mov %eax,%edi 2105: 48 b8 5b 63 00 00 00 movabs $0x635b,%rax 210c: 00 00 00 210f: ff d0 callq *%rax printf(1, "wait... "); 2111: 48 be c8 71 00 00 00 movabs $0x71c8,%rsi 2118: 00 00 00 211b: bf 01 00 00 00 mov $0x1,%edi 2120: b8 00 00 00 00 mov $0x0,%eax 2125: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 212c: 00 00 00 212f: ff d2 callq *%rdx wait(); 2131: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 2138: 00 00 00 213b: ff d0 callq *%rax wait(); 213d: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 2144: 00 00 00 2147: ff d0 callq *%rax wait(); 2149: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 2150: 00 00 00 2153: ff d0 callq *%rax printf(1, "preempt ok\n"); 2155: 48 be d1 71 00 00 00 movabs $0x71d1,%rsi 215c: 00 00 00 215f: bf 01 00 00 00 mov $0x1,%edi 2164: b8 00 00 00 00 mov $0x0,%eax 2169: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2170: 00 00 00 2173: ff d2 callq *%rdx } 2175: c9 leaveq 2176: c3 retq 0000000000002177 <exitwait>: // try to find any races between exit and wait void exitwait(void) { 2177: f3 0f 1e fa endbr64 217b: 55 push %rbp 217c: 48 89 e5 mov %rsp,%rbp 217f: 48 83 ec 10 sub $0x10,%rsp int i, pid; for(i = 0; i < 100; i++){ 2183: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 218a: e9 80 00 00 00 jmpq 220f <exitwait+0x98> pid = fork(); 218f: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 2196: 00 00 00 2199: ff d0 callq *%rax 219b: 89 45 f8 mov %eax,-0x8(%rbp) if(pid < 0){ 219e: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 21a2: 79 22 jns 21c6 <exitwait+0x4f> printf(1, "fork"); 21a4: 48 be a7 6d 00 00 00 movabs $0x6da7,%rsi 21ab: 00 00 00 21ae: bf 01 00 00 00 mov $0x1,%edi 21b3: b8 00 00 00 00 mov $0x0,%eax 21b8: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 21bf: 00 00 00 21c2: ff d2 callq *%rdx return; 21c4: eb 73 jmp 2239 <exitwait+0xc2> } if(pid){ 21c6: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 21ca: 74 33 je 21ff <exitwait+0x88> if(wait() != pid){ 21cc: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 21d3: 00 00 00 21d6: ff d0 callq *%rax 21d8: 39 45 f8 cmp %eax,-0x8(%rbp) 21db: 74 2e je 220b <exitwait+0x94> printf(1, "wait wrong pid\n"); 21dd: 48 be dd 71 00 00 00 movabs $0x71dd,%rsi 21e4: 00 00 00 21e7: bf 01 00 00 00 mov $0x1,%edi 21ec: b8 00 00 00 00 mov $0x0,%eax 21f1: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 21f8: 00 00 00 21fb: ff d2 callq *%rdx return; 21fd: eb 3a jmp 2239 <exitwait+0xc2> } } else { exit(); 21ff: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 2206: 00 00 00 2209: ff d0 callq *%rax for(i = 0; i < 100; i++){ 220b: 83 45 fc 01 addl $0x1,-0x4(%rbp) 220f: 83 7d fc 63 cmpl $0x63,-0x4(%rbp) 2213: 0f 8e 76 ff ff ff jle 218f <exitwait+0x18> } } printf(1, "exitwait ok\n"); 2219: 48 be ed 71 00 00 00 movabs $0x71ed,%rsi 2220: 00 00 00 2223: bf 01 00 00 00 mov $0x1,%edi 2228: b8 00 00 00 00 mov $0x0,%eax 222d: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2234: 00 00 00 2237: ff d2 callq *%rdx } 2239: c9 leaveq 223a: c3 retq 000000000000223b <mem>: void mem(void) { 223b: f3 0f 1e fa endbr64 223f: 55 push %rbp 2240: 48 89 e5 mov %rsp,%rbp 2243: 48 83 ec 20 sub $0x20,%rsp void *m1, *m2; int pid, ppid; printf(1, "mem test\n"); 2247: 48 be fa 71 00 00 00 movabs $0x71fa,%rsi 224e: 00 00 00 2251: bf 01 00 00 00 mov $0x1,%edi 2256: b8 00 00 00 00 mov $0x0,%eax 225b: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2262: 00 00 00 2265: ff d2 callq *%rdx ppid = getpid(); 2267: 48 b8 dd 63 00 00 00 movabs $0x63dd,%rax 226e: 00 00 00 2271: ff d0 callq *%rax 2273: 89 45 f4 mov %eax,-0xc(%rbp) if((pid = fork()) == 0){ 2276: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 227d: 00 00 00 2280: ff d0 callq *%rax 2282: 89 45 f0 mov %eax,-0x10(%rbp) 2285: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 2289: 0f 85 20 01 00 00 jne 23af <mem+0x174> m1 = 0; 228f: 48 c7 45 f8 00 00 00 movq $0x0,-0x8(%rbp) 2296: 00 while((m2 = malloc(100001)) != 0){ 2297: eb 13 jmp 22ac <mem+0x71> //printf(1, "m2 %p\n", m2); *(void**)m2 = m1; 2299: 48 8b 45 e8 mov -0x18(%rbp),%rax 229d: 48 8b 55 f8 mov -0x8(%rbp),%rdx 22a1: 48 89 10 mov %rdx,(%rax) m1 = m2; 22a4: 48 8b 45 e8 mov -0x18(%rbp),%rax 22a8: 48 89 45 f8 mov %rax,-0x8(%rbp) while((m2 = malloc(100001)) != 0){ 22ac: bf a1 86 01 00 mov $0x186a1,%edi 22b1: 48 b8 c9 6b 00 00 00 movabs $0x6bc9,%rax 22b8: 00 00 00 22bb: ff d0 callq *%rax 22bd: 48 89 45 e8 mov %rax,-0x18(%rbp) 22c1: 48 83 7d e8 00 cmpq $0x0,-0x18(%rbp) 22c6: 75 d1 jne 2299 <mem+0x5e> } printf(1, "alloc ended\n"); 22c8: 48 be 04 72 00 00 00 movabs $0x7204,%rsi 22cf: 00 00 00 22d2: bf 01 00 00 00 mov $0x1,%edi 22d7: b8 00 00 00 00 mov $0x0,%eax 22dc: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 22e3: 00 00 00 22e6: ff d2 callq *%rdx while(m1){ 22e8: eb 26 jmp 2310 <mem+0xd5> m2 = *(void**)m1; 22ea: 48 8b 45 f8 mov -0x8(%rbp),%rax 22ee: 48 8b 00 mov (%rax),%rax 22f1: 48 89 45 e8 mov %rax,-0x18(%rbp) free(m1); 22f5: 48 8b 45 f8 mov -0x8(%rbp),%rax 22f9: 48 89 c7 mov %rax,%rdi 22fc: 48 b8 14 6a 00 00 00 movabs $0x6a14,%rax 2303: 00 00 00 2306: ff d0 callq *%rax m1 = m2; 2308: 48 8b 45 e8 mov -0x18(%rbp),%rax 230c: 48 89 45 f8 mov %rax,-0x8(%rbp) while(m1){ 2310: 48 83 7d f8 00 cmpq $0x0,-0x8(%rbp) 2315: 75 d3 jne 22ea <mem+0xaf> } m1 = malloc(1024*20); 2317: bf 00 50 00 00 mov $0x5000,%edi 231c: 48 b8 c9 6b 00 00 00 movabs $0x6bc9,%rax 2323: 00 00 00 2326: ff d0 callq *%rax 2328: 48 89 45 f8 mov %rax,-0x8(%rbp) if(m1 == 0){ 232c: 48 83 7d f8 00 cmpq $0x0,-0x8(%rbp) 2331: 75 3d jne 2370 <mem+0x135> printf(1, "couldn't allocate mem?!!\n"); 2333: 48 be 11 72 00 00 00 movabs $0x7211,%rsi 233a: 00 00 00 233d: bf 01 00 00 00 mov $0x1,%edi 2342: b8 00 00 00 00 mov $0x0,%eax 2347: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 234e: 00 00 00 2351: ff d2 callq *%rdx kill(ppid); 2353: 8b 45 f4 mov -0xc(%rbp),%eax 2356: 89 c7 mov %eax,%edi 2358: 48 b8 5b 63 00 00 00 movabs $0x635b,%rax 235f: 00 00 00 2362: ff d0 callq *%rax exit(); 2364: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 236b: 00 00 00 236e: ff d0 callq *%rax } free(m1); 2370: 48 8b 45 f8 mov -0x8(%rbp),%rax 2374: 48 89 c7 mov %rax,%rdi 2377: 48 b8 14 6a 00 00 00 movabs $0x6a14,%rax 237e: 00 00 00 2381: ff d0 callq *%rax printf(1, "mem ok\n"); 2383: 48 be 2b 72 00 00 00 movabs $0x722b,%rsi 238a: 00 00 00 238d: bf 01 00 00 00 mov $0x1,%edi 2392: b8 00 00 00 00 mov $0x0,%eax 2397: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 239e: 00 00 00 23a1: ff d2 callq *%rdx exit(); 23a3: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 23aa: 00 00 00 23ad: ff d0 callq *%rax } else { wait(); 23af: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 23b6: 00 00 00 23b9: ff d0 callq *%rax } } 23bb: 90 nop 23bc: c9 leaveq 23bd: c3 retq 00000000000023be <sharedfd>: // two processes write to the same file descriptor // is the offset shared? does inode locking work? void sharedfd(void) { 23be: f3 0f 1e fa endbr64 23c2: 55 push %rbp 23c3: 48 89 e5 mov %rsp,%rbp 23c6: 48 83 ec 30 sub $0x30,%rsp int fd, pid, i, n, nc, np; char buf[10]; printf(1, "sharedfd test\n"); 23ca: 48 be 33 72 00 00 00 movabs $0x7233,%rsi 23d1: 00 00 00 23d4: bf 01 00 00 00 mov $0x1,%edi 23d9: b8 00 00 00 00 mov $0x0,%eax 23de: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 23e5: 00 00 00 23e8: ff d2 callq *%rdx unlink("sharedfd"); 23ea: 48 bf 42 72 00 00 00 movabs $0x7242,%rdi 23f1: 00 00 00 23f4: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 23fb: 00 00 00 23fe: ff d0 callq *%rax fd = open("sharedfd", O_CREATE|O_RDWR); 2400: be 02 02 00 00 mov $0x202,%esi 2405: 48 bf 42 72 00 00 00 movabs $0x7242,%rdi 240c: 00 00 00 240f: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2416: 00 00 00 2419: ff d0 callq *%rax 241b: 89 45 f0 mov %eax,-0x10(%rbp) if(fd < 0){ 241e: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 2422: 79 25 jns 2449 <sharedfd+0x8b> printf(1, "fstests: cannot open sharedfd for writing"); 2424: 48 be 50 72 00 00 00 movabs $0x7250,%rsi 242b: 00 00 00 242e: bf 01 00 00 00 mov $0x1,%edi 2433: b8 00 00 00 00 mov $0x0,%eax 2438: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 243f: 00 00 00 2442: ff d2 callq *%rdx return; 2444: e9 0d 02 00 00 jmpq 2656 <sharedfd+0x298> } pid = fork(); 2449: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 2450: 00 00 00 2453: ff d0 callq *%rax 2455: 89 45 ec mov %eax,-0x14(%rbp) memset(buf, pid==0?'c':'p', sizeof(buf)); 2458: 83 7d ec 00 cmpl $0x0,-0x14(%rbp) 245c: 75 07 jne 2465 <sharedfd+0xa7> 245e: b9 63 00 00 00 mov $0x63,%ecx 2463: eb 05 jmp 246a <sharedfd+0xac> 2465: b9 70 00 00 00 mov $0x70,%ecx 246a: 48 8d 45 de lea -0x22(%rbp),%rax 246e: ba 0a 00 00 00 mov $0xa,%edx 2473: 89 ce mov %ecx,%esi 2475: 48 89 c7 mov %rax,%rdi 2478: 48 b8 d8 60 00 00 00 movabs $0x60d8,%rax 247f: 00 00 00 2482: ff d0 callq *%rax for(i = 0; i < 1000; i++){ 2484: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 248b: eb 48 jmp 24d5 <sharedfd+0x117> if(write(fd, buf, sizeof(buf)) != sizeof(buf)){ 248d: 48 8d 4d de lea -0x22(%rbp),%rcx 2491: 8b 45 f0 mov -0x10(%rbp),%eax 2494: ba 0a 00 00 00 mov $0xa,%edx 2499: 48 89 ce mov %rcx,%rsi 249c: 89 c7 mov %eax,%edi 249e: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 24a5: 00 00 00 24a8: ff d0 callq *%rax 24aa: 83 f8 0a cmp $0xa,%eax 24ad: 74 22 je 24d1 <sharedfd+0x113> printf(1, "fstests: write sharedfd failed\n"); 24af: 48 be 80 72 00 00 00 movabs $0x7280,%rsi 24b6: 00 00 00 24b9: bf 01 00 00 00 mov $0x1,%edi 24be: b8 00 00 00 00 mov $0x0,%eax 24c3: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 24ca: 00 00 00 24cd: ff d2 callq *%rdx break; 24cf: eb 0d jmp 24de <sharedfd+0x120> for(i = 0; i < 1000; i++){ 24d1: 83 45 fc 01 addl $0x1,-0x4(%rbp) 24d5: 81 7d fc e7 03 00 00 cmpl $0x3e7,-0x4(%rbp) 24dc: 7e af jle 248d <sharedfd+0xcf> } } if(pid == 0) 24de: 83 7d ec 00 cmpl $0x0,-0x14(%rbp) 24e2: 75 0c jne 24f0 <sharedfd+0x132> exit(); 24e4: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 24eb: 00 00 00 24ee: ff d0 callq *%rax else wait(); 24f0: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 24f7: 00 00 00 24fa: ff d0 callq *%rax close(fd); 24fc: 8b 45 f0 mov -0x10(%rbp),%eax 24ff: 89 c7 mov %eax,%edi 2501: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 2508: 00 00 00 250b: ff d0 callq *%rax fd = open("sharedfd", 0); 250d: be 00 00 00 00 mov $0x0,%esi 2512: 48 bf 42 72 00 00 00 movabs $0x7242,%rdi 2519: 00 00 00 251c: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2523: 00 00 00 2526: ff d0 callq *%rax 2528: 89 45 f0 mov %eax,-0x10(%rbp) if(fd < 0){ 252b: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 252f: 79 25 jns 2556 <sharedfd+0x198> printf(1, "fstests: cannot open sharedfd for reading\n"); 2531: 48 be a0 72 00 00 00 movabs $0x72a0,%rsi 2538: 00 00 00 253b: bf 01 00 00 00 mov $0x1,%edi 2540: b8 00 00 00 00 mov $0x0,%eax 2545: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 254c: 00 00 00 254f: ff d2 callq *%rdx return; 2551: e9 00 01 00 00 jmpq 2656 <sharedfd+0x298> } nc = np = 0; 2556: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) 255d: 8b 45 f4 mov -0xc(%rbp),%eax 2560: 89 45 f8 mov %eax,-0x8(%rbp) while((n = read(fd, buf, sizeof(buf))) > 0){ 2563: eb 39 jmp 259e <sharedfd+0x1e0> for(i = 0; i < sizeof(buf); i++){ 2565: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 256c: eb 28 jmp 2596 <sharedfd+0x1d8> if(buf[i] == 'c') 256e: 8b 45 fc mov -0x4(%rbp),%eax 2571: 48 98 cltq 2573: 0f b6 44 05 de movzbl -0x22(%rbp,%rax,1),%eax 2578: 3c 63 cmp $0x63,%al 257a: 75 04 jne 2580 <sharedfd+0x1c2> nc++; 257c: 83 45 f8 01 addl $0x1,-0x8(%rbp) if(buf[i] == 'p') 2580: 8b 45 fc mov -0x4(%rbp),%eax 2583: 48 98 cltq 2585: 0f b6 44 05 de movzbl -0x22(%rbp,%rax,1),%eax 258a: 3c 70 cmp $0x70,%al 258c: 75 04 jne 2592 <sharedfd+0x1d4> np++; 258e: 83 45 f4 01 addl $0x1,-0xc(%rbp) for(i = 0; i < sizeof(buf); i++){ 2592: 83 45 fc 01 addl $0x1,-0x4(%rbp) 2596: 8b 45 fc mov -0x4(%rbp),%eax 2599: 83 f8 09 cmp $0x9,%eax 259c: 76 d0 jbe 256e <sharedfd+0x1b0> while((n = read(fd, buf, sizeof(buf))) > 0){ 259e: 48 8d 4d de lea -0x22(%rbp),%rcx 25a2: 8b 45 f0 mov -0x10(%rbp),%eax 25a5: ba 0a 00 00 00 mov $0xa,%edx 25aa: 48 89 ce mov %rcx,%rsi 25ad: 89 c7 mov %eax,%edi 25af: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 25b6: 00 00 00 25b9: ff d0 callq *%rax 25bb: 89 45 e8 mov %eax,-0x18(%rbp) 25be: 83 7d e8 00 cmpl $0x0,-0x18(%rbp) 25c2: 7f a1 jg 2565 <sharedfd+0x1a7> } } close(fd); 25c4: 8b 45 f0 mov -0x10(%rbp),%eax 25c7: 89 c7 mov %eax,%edi 25c9: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 25d0: 00 00 00 25d3: ff d0 callq *%rax unlink("sharedfd"); 25d5: 48 bf 42 72 00 00 00 movabs $0x7242,%rdi 25dc: 00 00 00 25df: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 25e6: 00 00 00 25e9: ff d0 callq *%rax if(nc == 10000 && np == 10000){ 25eb: 81 7d f8 10 27 00 00 cmpl $0x2710,-0x8(%rbp) 25f2: 75 2b jne 261f <sharedfd+0x261> 25f4: 81 7d f4 10 27 00 00 cmpl $0x2710,-0xc(%rbp) 25fb: 75 22 jne 261f <sharedfd+0x261> printf(1, "sharedfd ok\n"); 25fd: 48 be cb 72 00 00 00 movabs $0x72cb,%rsi 2604: 00 00 00 2607: bf 01 00 00 00 mov $0x1,%edi 260c: b8 00 00 00 00 mov $0x0,%eax 2611: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2618: 00 00 00 261b: ff d2 callq *%rdx 261d: eb 37 jmp 2656 <sharedfd+0x298> } else { printf(1, "sharedfd oops %d %d\n", nc, np); 261f: 8b 55 f4 mov -0xc(%rbp),%edx 2622: 8b 45 f8 mov -0x8(%rbp),%eax 2625: 89 d1 mov %edx,%ecx 2627: 89 c2 mov %eax,%edx 2629: 48 be d8 72 00 00 00 movabs $0x72d8,%rsi 2630: 00 00 00 2633: bf 01 00 00 00 mov $0x1,%edi 2638: b8 00 00 00 00 mov $0x0,%eax 263d: 49 b8 04 66 00 00 00 movabs $0x6604,%r8 2644: 00 00 00 2647: 41 ff d0 callq *%r8 exit(); 264a: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 2651: 00 00 00 2654: ff d0 callq *%rax } } 2656: c9 leaveq 2657: c3 retq 0000000000002658 <fourfiles>: // four processes write different files at the same // time, to test block allocation. void fourfiles(void) { 2658: f3 0f 1e fa endbr64 265c: 55 push %rbp 265d: 48 89 e5 mov %rsp,%rbp 2660: 48 83 ec 50 sub $0x50,%rsp int fd, pid, i, j, n, total, pi; char *names[] = { "f0", "f1", "f2", "f3" }; 2664: 48 b8 ed 72 00 00 00 movabs $0x72ed,%rax 266b: 00 00 00 266e: 48 89 45 b0 mov %rax,-0x50(%rbp) 2672: 48 b8 f0 72 00 00 00 movabs $0x72f0,%rax 2679: 00 00 00 267c: 48 89 45 b8 mov %rax,-0x48(%rbp) 2680: 48 b8 f3 72 00 00 00 movabs $0x72f3,%rax 2687: 00 00 00 268a: 48 89 45 c0 mov %rax,-0x40(%rbp) 268e: 48 b8 f6 72 00 00 00 movabs $0x72f6,%rax 2695: 00 00 00 2698: 48 89 45 c8 mov %rax,-0x38(%rbp) char *fname; printf(1, "fourfiles test\n"); 269c: 48 be f9 72 00 00 00 movabs $0x72f9,%rsi 26a3: 00 00 00 26a6: bf 01 00 00 00 mov $0x1,%edi 26ab: b8 00 00 00 00 mov $0x0,%eax 26b0: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 26b7: 00 00 00 26ba: ff d2 callq *%rdx for(pi = 0; pi < 4; pi++){ 26bc: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%rbp) 26c3: e9 30 01 00 00 jmpq 27f8 <fourfiles+0x1a0> fname = names[pi]; 26c8: 8b 45 f0 mov -0x10(%rbp),%eax 26cb: 48 98 cltq 26cd: 48 8b 44 c5 b0 mov -0x50(%rbp,%rax,8),%rax 26d2: 48 89 45 e8 mov %rax,-0x18(%rbp) unlink(fname); 26d6: 48 8b 45 e8 mov -0x18(%rbp),%rax 26da: 48 89 c7 mov %rax,%rdi 26dd: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 26e4: 00 00 00 26e7: ff d0 callq *%rax pid = fork(); 26e9: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 26f0: 00 00 00 26f3: ff d0 callq *%rax 26f5: 89 45 dc mov %eax,-0x24(%rbp) if(pid < 0){ 26f8: 83 7d dc 00 cmpl $0x0,-0x24(%rbp) 26fc: 79 16 jns 2714 <fourfiles+0xbc> failexit("fork"); 26fe: 48 bf a7 6d 00 00 00 movabs $0x6da7,%rdi 2705: 00 00 00 2708: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 270f: 00 00 00 2712: ff d0 callq *%rax } if(pid == 0){ 2714: 83 7d dc 00 cmpl $0x0,-0x24(%rbp) 2718: 0f 85 d6 00 00 00 jne 27f4 <fourfiles+0x19c> fd = open(fname, O_CREATE | O_RDWR); 271e: 48 8b 45 e8 mov -0x18(%rbp),%rax 2722: be 02 02 00 00 mov $0x202,%esi 2727: 48 89 c7 mov %rax,%rdi 272a: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2731: 00 00 00 2734: ff d0 callq *%rax 2736: 89 45 e4 mov %eax,-0x1c(%rbp) if(fd < 0){ 2739: 83 7d e4 00 cmpl $0x0,-0x1c(%rbp) 273d: 79 16 jns 2755 <fourfiles+0xfd> failexit("create"); 273f: 48 bf 09 73 00 00 00 movabs $0x7309,%rdi 2746: 00 00 00 2749: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2750: 00 00 00 2753: ff d0 callq *%rax } memset(buf, '0'+pi, 512); 2755: 8b 45 f0 mov -0x10(%rbp),%eax 2758: 83 c0 30 add $0x30,%eax 275b: ba 00 02 00 00 mov $0x200,%edx 2760: 89 c6 mov %eax,%esi 2762: 48 bf 00 8c 00 00 00 movabs $0x8c00,%rdi 2769: 00 00 00 276c: 48 b8 d8 60 00 00 00 movabs $0x60d8,%rax 2773: 00 00 00 2776: ff d0 callq *%rax for(i = 0; i < 12; i++){ 2778: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 277f: eb 61 jmp 27e2 <fourfiles+0x18a> if((n = write(fd, buf, 500)) != 500){ 2781: 8b 45 e4 mov -0x1c(%rbp),%eax 2784: ba f4 01 00 00 mov $0x1f4,%edx 2789: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 2790: 00 00 00 2793: 89 c7 mov %eax,%edi 2795: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 279c: 00 00 00 279f: ff d0 callq *%rax 27a1: 89 45 e0 mov %eax,-0x20(%rbp) 27a4: 81 7d e0 f4 01 00 00 cmpl $0x1f4,-0x20(%rbp) 27ab: 74 31 je 27de <fourfiles+0x186> printf(1, "write failed %d\n", n); 27ad: 8b 45 e0 mov -0x20(%rbp),%eax 27b0: 89 c2 mov %eax,%edx 27b2: 48 be 10 73 00 00 00 movabs $0x7310,%rsi 27b9: 00 00 00 27bc: bf 01 00 00 00 mov $0x1,%edi 27c1: b8 00 00 00 00 mov $0x0,%eax 27c6: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 27cd: 00 00 00 27d0: ff d1 callq *%rcx exit(); 27d2: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 27d9: 00 00 00 27dc: ff d0 callq *%rax for(i = 0; i < 12; i++){ 27de: 83 45 fc 01 addl $0x1,-0x4(%rbp) 27e2: 83 7d fc 0b cmpl $0xb,-0x4(%rbp) 27e6: 7e 99 jle 2781 <fourfiles+0x129> } } exit(); 27e8: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 27ef: 00 00 00 27f2: ff d0 callq *%rax for(pi = 0; pi < 4; pi++){ 27f4: 83 45 f0 01 addl $0x1,-0x10(%rbp) 27f8: 83 7d f0 03 cmpl $0x3,-0x10(%rbp) 27fc: 0f 8e c6 fe ff ff jle 26c8 <fourfiles+0x70> } } for(pi = 0; pi < 4; pi++){ 2802: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%rbp) 2809: eb 10 jmp 281b <fourfiles+0x1c3> wait(); 280b: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 2812: 00 00 00 2815: ff d0 callq *%rax for(pi = 0; pi < 4; pi++){ 2817: 83 45 f0 01 addl $0x1,-0x10(%rbp) 281b: 83 7d f0 03 cmpl $0x3,-0x10(%rbp) 281f: 7e ea jle 280b <fourfiles+0x1b3> } for(i = 0; i < 2; i++){ 2821: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 2828: e9 0e 01 00 00 jmpq 293b <fourfiles+0x2e3> fname = names[i]; 282d: 8b 45 fc mov -0x4(%rbp),%eax 2830: 48 98 cltq 2832: 48 8b 44 c5 b0 mov -0x50(%rbp,%rax,8),%rax 2837: 48 89 45 e8 mov %rax,-0x18(%rbp) fd = open(fname, 0); 283b: 48 8b 45 e8 mov -0x18(%rbp),%rax 283f: be 00 00 00 00 mov $0x0,%esi 2844: 48 89 c7 mov %rax,%rdi 2847: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 284e: 00 00 00 2851: ff d0 callq *%rax 2853: 89 45 e4 mov %eax,-0x1c(%rbp) total = 0; 2856: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) while((n = read(fd, buf, sizeof(buf))) > 0){ 285d: eb 51 jmp 28b0 <fourfiles+0x258> for(j = 0; j < n; j++){ 285f: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) 2866: eb 3a jmp 28a2 <fourfiles+0x24a> if(buf[j] != '0'+i){ 2868: 48 ba 00 8c 00 00 00 movabs $0x8c00,%rdx 286f: 00 00 00 2872: 8b 45 f8 mov -0x8(%rbp),%eax 2875: 48 98 cltq 2877: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax 287b: 0f be c0 movsbl %al,%eax 287e: 8b 55 fc mov -0x4(%rbp),%edx 2881: 83 c2 30 add $0x30,%edx 2884: 39 d0 cmp %edx,%eax 2886: 74 16 je 289e <fourfiles+0x246> failexit("wrong char"); 2888: 48 bf 21 73 00 00 00 movabs $0x7321,%rdi 288f: 00 00 00 2892: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2899: 00 00 00 289c: ff d0 callq *%rax for(j = 0; j < n; j++){ 289e: 83 45 f8 01 addl $0x1,-0x8(%rbp) 28a2: 8b 45 f8 mov -0x8(%rbp),%eax 28a5: 3b 45 e0 cmp -0x20(%rbp),%eax 28a8: 7c be jl 2868 <fourfiles+0x210> } } total += n; 28aa: 8b 45 e0 mov -0x20(%rbp),%eax 28ad: 01 45 f4 add %eax,-0xc(%rbp) while((n = read(fd, buf, sizeof(buf))) > 0){ 28b0: 8b 45 e4 mov -0x1c(%rbp),%eax 28b3: ba 00 20 00 00 mov $0x2000,%edx 28b8: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 28bf: 00 00 00 28c2: 89 c7 mov %eax,%edi 28c4: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 28cb: 00 00 00 28ce: ff d0 callq *%rax 28d0: 89 45 e0 mov %eax,-0x20(%rbp) 28d3: 83 7d e0 00 cmpl $0x0,-0x20(%rbp) 28d7: 7f 86 jg 285f <fourfiles+0x207> } close(fd); 28d9: 8b 45 e4 mov -0x1c(%rbp),%eax 28dc: 89 c7 mov %eax,%edi 28de: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 28e5: 00 00 00 28e8: ff d0 callq *%rax if(total != 12*500){ 28ea: 81 7d f4 70 17 00 00 cmpl $0x1770,-0xc(%rbp) 28f1: 74 31 je 2924 <fourfiles+0x2cc> printf(1, "wrong length %d\n", total); 28f3: 8b 45 f4 mov -0xc(%rbp),%eax 28f6: 89 c2 mov %eax,%edx 28f8: 48 be 2c 73 00 00 00 movabs $0x732c,%rsi 28ff: 00 00 00 2902: bf 01 00 00 00 mov $0x1,%edi 2907: b8 00 00 00 00 mov $0x0,%eax 290c: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 2913: 00 00 00 2916: ff d1 callq *%rcx exit(); 2918: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 291f: 00 00 00 2922: ff d0 callq *%rax } unlink(fname); 2924: 48 8b 45 e8 mov -0x18(%rbp),%rax 2928: 48 89 c7 mov %rax,%rdi 292b: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 2932: 00 00 00 2935: ff d0 callq *%rax for(i = 0; i < 2; i++){ 2937: 83 45 fc 01 addl $0x1,-0x4(%rbp) 293b: 83 7d fc 01 cmpl $0x1,-0x4(%rbp) 293f: 0f 8e e8 fe ff ff jle 282d <fourfiles+0x1d5> } printf(1, "fourfiles ok\n"); 2945: 48 be 3d 73 00 00 00 movabs $0x733d,%rsi 294c: 00 00 00 294f: bf 01 00 00 00 mov $0x1,%edi 2954: b8 00 00 00 00 mov $0x0,%eax 2959: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2960: 00 00 00 2963: ff d2 callq *%rdx } 2965: 90 nop 2966: c9 leaveq 2967: c3 retq 0000000000002968 <createdelete>: // four processes create and delete different files in same directory void createdelete(void) { 2968: f3 0f 1e fa endbr64 296c: 55 push %rbp 296d: 48 89 e5 mov %rsp,%rbp 2970: 48 83 ec 30 sub $0x30,%rsp enum { N = 20 }; int pid, i, fd, pi; char name[32]; printf(1, "createdelete test\n"); 2974: 48 be 4b 73 00 00 00 movabs $0x734b,%rsi 297b: 00 00 00 297e: bf 01 00 00 00 mov $0x1,%edi 2983: b8 00 00 00 00 mov $0x0,%eax 2988: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 298f: 00 00 00 2992: ff d2 callq *%rdx for(pi = 0; pi < 4; pi++){ 2994: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) 299b: e9 0c 01 00 00 jmpq 2aac <createdelete+0x144> pid = fork(); 29a0: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 29a7: 00 00 00 29aa: ff d0 callq *%rax 29ac: 89 45 f0 mov %eax,-0x10(%rbp) if(pid < 0){ 29af: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 29b3: 79 16 jns 29cb <createdelete+0x63> failexit("fork"); 29b5: 48 bf a7 6d 00 00 00 movabs $0x6da7,%rdi 29bc: 00 00 00 29bf: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 29c6: 00 00 00 29c9: ff d0 callq *%rax } if(pid == 0){ 29cb: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 29cf: 0f 85 d3 00 00 00 jne 2aa8 <createdelete+0x140> name[0] = 'p' + pi; 29d5: 8b 45 f8 mov -0x8(%rbp),%eax 29d8: 83 c0 70 add $0x70,%eax 29db: 88 45 d0 mov %al,-0x30(%rbp) name[2] = '\0'; 29de: c6 45 d2 00 movb $0x0,-0x2e(%rbp) for(i = 0; i < N; i++){ 29e2: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 29e9: e9 a4 00 00 00 jmpq 2a92 <createdelete+0x12a> name[1] = '0' + i; 29ee: 8b 45 fc mov -0x4(%rbp),%eax 29f1: 83 c0 30 add $0x30,%eax 29f4: 88 45 d1 mov %al,-0x2f(%rbp) fd = open(name, O_CREATE | O_RDWR); 29f7: 48 8d 45 d0 lea -0x30(%rbp),%rax 29fb: be 02 02 00 00 mov $0x202,%esi 2a00: 48 89 c7 mov %rax,%rdi 2a03: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2a0a: 00 00 00 2a0d: ff d0 callq *%rax 2a0f: 89 45 f4 mov %eax,-0xc(%rbp) if(fd < 0){ 2a12: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 2a16: 79 16 jns 2a2e <createdelete+0xc6> failexit("create"); 2a18: 48 bf 09 73 00 00 00 movabs $0x7309,%rdi 2a1f: 00 00 00 2a22: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2a29: 00 00 00 2a2c: ff d0 callq *%rax } close(fd); 2a2e: 8b 45 f4 mov -0xc(%rbp),%eax 2a31: 89 c7 mov %eax,%edi 2a33: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 2a3a: 00 00 00 2a3d: ff d0 callq *%rax if(i > 0 && (i % 2 ) == 0){ 2a3f: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 2a43: 7e 49 jle 2a8e <createdelete+0x126> 2a45: 8b 45 fc mov -0x4(%rbp),%eax 2a48: 83 e0 01 and $0x1,%eax 2a4b: 85 c0 test %eax,%eax 2a4d: 75 3f jne 2a8e <createdelete+0x126> name[1] = '0' + (i / 2); 2a4f: 8b 45 fc mov -0x4(%rbp),%eax 2a52: 89 c2 mov %eax,%edx 2a54: c1 ea 1f shr $0x1f,%edx 2a57: 01 d0 add %edx,%eax 2a59: d1 f8 sar %eax 2a5b: 83 c0 30 add $0x30,%eax 2a5e: 88 45 d1 mov %al,-0x2f(%rbp) if(unlink(name) < 0){ 2a61: 48 8d 45 d0 lea -0x30(%rbp),%rax 2a65: 48 89 c7 mov %rax,%rdi 2a68: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 2a6f: 00 00 00 2a72: ff d0 callq *%rax 2a74: 85 c0 test %eax,%eax 2a76: 79 16 jns 2a8e <createdelete+0x126> failexit("unlink"); 2a78: 48 bf 13 6e 00 00 00 movabs $0x6e13,%rdi 2a7f: 00 00 00 2a82: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2a89: 00 00 00 2a8c: ff d0 callq *%rax for(i = 0; i < N; i++){ 2a8e: 83 45 fc 01 addl $0x1,-0x4(%rbp) 2a92: 83 7d fc 13 cmpl $0x13,-0x4(%rbp) 2a96: 0f 8e 52 ff ff ff jle 29ee <createdelete+0x86> } } } exit(); 2a9c: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 2aa3: 00 00 00 2aa6: ff d0 callq *%rax for(pi = 0; pi < 4; pi++){ 2aa8: 83 45 f8 01 addl $0x1,-0x8(%rbp) 2aac: 83 7d f8 03 cmpl $0x3,-0x8(%rbp) 2ab0: 0f 8e ea fe ff ff jle 29a0 <createdelete+0x38> } } for(pi = 0; pi < 4; pi++){ 2ab6: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) 2abd: eb 10 jmp 2acf <createdelete+0x167> wait(); 2abf: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 2ac6: 00 00 00 2ac9: ff d0 callq *%rax for(pi = 0; pi < 4; pi++){ 2acb: 83 45 f8 01 addl $0x1,-0x8(%rbp) 2acf: 83 7d f8 03 cmpl $0x3,-0x8(%rbp) 2ad3: 7e ea jle 2abf <createdelete+0x157> } name[0] = name[1] = name[2] = 0; 2ad5: c6 45 d2 00 movb $0x0,-0x2e(%rbp) 2ad9: 0f b6 45 d2 movzbl -0x2e(%rbp),%eax 2add: 88 45 d1 mov %al,-0x2f(%rbp) 2ae0: 0f b6 45 d1 movzbl -0x2f(%rbp),%eax 2ae4: 88 45 d0 mov %al,-0x30(%rbp) for(i = 0; i < N; i++){ 2ae7: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 2aee: e9 ec 00 00 00 jmpq 2bdf <createdelete+0x277> for(pi = 0; pi < 4; pi++){ 2af3: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) 2afa: e9 d2 00 00 00 jmpq 2bd1 <createdelete+0x269> name[0] = 'p' + pi; 2aff: 8b 45 f8 mov -0x8(%rbp),%eax 2b02: 83 c0 70 add $0x70,%eax 2b05: 88 45 d0 mov %al,-0x30(%rbp) name[1] = '0' + i; 2b08: 8b 45 fc mov -0x4(%rbp),%eax 2b0b: 83 c0 30 add $0x30,%eax 2b0e: 88 45 d1 mov %al,-0x2f(%rbp) fd = open(name, 0); 2b11: 48 8d 45 d0 lea -0x30(%rbp),%rax 2b15: be 00 00 00 00 mov $0x0,%esi 2b1a: 48 89 c7 mov %rax,%rdi 2b1d: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2b24: 00 00 00 2b27: ff d0 callq *%rax 2b29: 89 45 f4 mov %eax,-0xc(%rbp) if((i == 0 || i >= N/2) && fd < 0){ 2b2c: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 2b30: 74 06 je 2b38 <createdelete+0x1d0> 2b32: 83 7d fc 09 cmpl $0x9,-0x4(%rbp) 2b36: 7e 39 jle 2b71 <createdelete+0x209> 2b38: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 2b3c: 79 33 jns 2b71 <createdelete+0x209> printf(1, "oops createdelete %s didn't exist\n", name); 2b3e: 48 8d 45 d0 lea -0x30(%rbp),%rax 2b42: 48 89 c2 mov %rax,%rdx 2b45: 48 be 60 73 00 00 00 movabs $0x7360,%rsi 2b4c: 00 00 00 2b4f: bf 01 00 00 00 mov $0x1,%edi 2b54: b8 00 00 00 00 mov $0x0,%eax 2b59: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 2b60: 00 00 00 2b63: ff d1 callq *%rcx exit(); 2b65: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 2b6c: 00 00 00 2b6f: ff d0 callq *%rax } else if((i >= 1 && i < N/2) && fd >= 0){ 2b71: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 2b75: 7e 3f jle 2bb6 <createdelete+0x24e> 2b77: 83 7d fc 09 cmpl $0x9,-0x4(%rbp) 2b7b: 7f 39 jg 2bb6 <createdelete+0x24e> 2b7d: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 2b81: 78 33 js 2bb6 <createdelete+0x24e> printf(1, "oops createdelete %s did exist\n", name); 2b83: 48 8d 45 d0 lea -0x30(%rbp),%rax 2b87: 48 89 c2 mov %rax,%rdx 2b8a: 48 be 88 73 00 00 00 movabs $0x7388,%rsi 2b91: 00 00 00 2b94: bf 01 00 00 00 mov $0x1,%edi 2b99: b8 00 00 00 00 mov $0x0,%eax 2b9e: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 2ba5: 00 00 00 2ba8: ff d1 callq *%rcx exit(); 2baa: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 2bb1: 00 00 00 2bb4: ff d0 callq *%rax } if(fd >= 0) 2bb6: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 2bba: 78 11 js 2bcd <createdelete+0x265> close(fd); 2bbc: 8b 45 f4 mov -0xc(%rbp),%eax 2bbf: 89 c7 mov %eax,%edi 2bc1: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 2bc8: 00 00 00 2bcb: ff d0 callq *%rax for(pi = 0; pi < 4; pi++){ 2bcd: 83 45 f8 01 addl $0x1,-0x8(%rbp) 2bd1: 83 7d f8 03 cmpl $0x3,-0x8(%rbp) 2bd5: 0f 8e 24 ff ff ff jle 2aff <createdelete+0x197> for(i = 0; i < N; i++){ 2bdb: 83 45 fc 01 addl $0x1,-0x4(%rbp) 2bdf: 83 7d fc 13 cmpl $0x13,-0x4(%rbp) 2be3: 0f 8e 0a ff ff ff jle 2af3 <createdelete+0x18b> } } for(i = 0; i < N; i++){ 2be9: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 2bf0: eb 3c jmp 2c2e <createdelete+0x2c6> for(pi = 0; pi < 4; pi++){ 2bf2: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) 2bf9: eb 29 jmp 2c24 <createdelete+0x2bc> name[0] = 'p' + i; 2bfb: 8b 45 fc mov -0x4(%rbp),%eax 2bfe: 83 c0 70 add $0x70,%eax 2c01: 88 45 d0 mov %al,-0x30(%rbp) name[1] = '0' + i; 2c04: 8b 45 fc mov -0x4(%rbp),%eax 2c07: 83 c0 30 add $0x30,%eax 2c0a: 88 45 d1 mov %al,-0x2f(%rbp) unlink(name); 2c0d: 48 8d 45 d0 lea -0x30(%rbp),%rax 2c11: 48 89 c7 mov %rax,%rdi 2c14: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 2c1b: 00 00 00 2c1e: ff d0 callq *%rax for(pi = 0; pi < 4; pi++){ 2c20: 83 45 f8 01 addl $0x1,-0x8(%rbp) 2c24: 83 7d f8 03 cmpl $0x3,-0x8(%rbp) 2c28: 7e d1 jle 2bfb <createdelete+0x293> for(i = 0; i < N; i++){ 2c2a: 83 45 fc 01 addl $0x1,-0x4(%rbp) 2c2e: 83 7d fc 13 cmpl $0x13,-0x4(%rbp) 2c32: 7e be jle 2bf2 <createdelete+0x28a> } } printf(1, "createdelete ok\n"); 2c34: 48 be a8 73 00 00 00 movabs $0x73a8,%rsi 2c3b: 00 00 00 2c3e: bf 01 00 00 00 mov $0x1,%edi 2c43: b8 00 00 00 00 mov $0x0,%eax 2c48: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2c4f: 00 00 00 2c52: ff d2 callq *%rdx } 2c54: 90 nop 2c55: c9 leaveq 2c56: c3 retq 0000000000002c57 <unlinkread>: // can I unlink a file and still read it? void unlinkread(void) { 2c57: f3 0f 1e fa endbr64 2c5b: 55 push %rbp 2c5c: 48 89 e5 mov %rsp,%rbp 2c5f: 48 83 ec 10 sub $0x10,%rsp int fd, fd1; printf(1, "unlinkread test\n"); 2c63: 48 be b9 73 00 00 00 movabs $0x73b9,%rsi 2c6a: 00 00 00 2c6d: bf 01 00 00 00 mov $0x1,%edi 2c72: b8 00 00 00 00 mov $0x0,%eax 2c77: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2c7e: 00 00 00 2c81: ff d2 callq *%rdx fd = open("unlinkread", O_CREATE | O_RDWR); 2c83: be 02 02 00 00 mov $0x202,%esi 2c88: 48 bf ca 73 00 00 00 movabs $0x73ca,%rdi 2c8f: 00 00 00 2c92: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2c99: 00 00 00 2c9c: ff d0 callq *%rax 2c9e: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 2ca1: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 2ca5: 79 16 jns 2cbd <unlinkread+0x66> failexit("create unlinkread"); 2ca7: 48 bf d5 73 00 00 00 movabs $0x73d5,%rdi 2cae: 00 00 00 2cb1: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2cb8: 00 00 00 2cbb: ff d0 callq *%rax } write(fd, "hello", 5); 2cbd: 8b 45 fc mov -0x4(%rbp),%eax 2cc0: ba 05 00 00 00 mov $0x5,%edx 2cc5: 48 be e7 73 00 00 00 movabs $0x73e7,%rsi 2ccc: 00 00 00 2ccf: 89 c7 mov %eax,%edi 2cd1: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 2cd8: 00 00 00 2cdb: ff d0 callq *%rax close(fd); 2cdd: 8b 45 fc mov -0x4(%rbp),%eax 2ce0: 89 c7 mov %eax,%edi 2ce2: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 2ce9: 00 00 00 2cec: ff d0 callq *%rax fd = open("unlinkread", O_RDWR); 2cee: be 02 00 00 00 mov $0x2,%esi 2cf3: 48 bf ca 73 00 00 00 movabs $0x73ca,%rdi 2cfa: 00 00 00 2cfd: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2d04: 00 00 00 2d07: ff d0 callq *%rax 2d09: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 2d0c: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 2d10: 79 16 jns 2d28 <unlinkread+0xd1> failexit("open unlinkread"); 2d12: 48 bf ed 73 00 00 00 movabs $0x73ed,%rdi 2d19: 00 00 00 2d1c: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2d23: 00 00 00 2d26: ff d0 callq *%rax } if(unlink("unlinkread") != 0){ 2d28: 48 bf ca 73 00 00 00 movabs $0x73ca,%rdi 2d2f: 00 00 00 2d32: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 2d39: 00 00 00 2d3c: ff d0 callq *%rax 2d3e: 85 c0 test %eax,%eax 2d40: 74 16 je 2d58 <unlinkread+0x101> failexit("unlink unlinkread"); 2d42: 48 bf fd 73 00 00 00 movabs $0x73fd,%rdi 2d49: 00 00 00 2d4c: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2d53: 00 00 00 2d56: ff d0 callq *%rax } fd1 = open("unlinkread", O_CREATE | O_RDWR); 2d58: be 02 02 00 00 mov $0x202,%esi 2d5d: 48 bf ca 73 00 00 00 movabs $0x73ca,%rdi 2d64: 00 00 00 2d67: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2d6e: 00 00 00 2d71: ff d0 callq *%rax 2d73: 89 45 f8 mov %eax,-0x8(%rbp) write(fd1, "yyy", 3); 2d76: 8b 45 f8 mov -0x8(%rbp),%eax 2d79: ba 03 00 00 00 mov $0x3,%edx 2d7e: 48 be 0f 74 00 00 00 movabs $0x740f,%rsi 2d85: 00 00 00 2d88: 89 c7 mov %eax,%edi 2d8a: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 2d91: 00 00 00 2d94: ff d0 callq *%rax close(fd1); 2d96: 8b 45 f8 mov -0x8(%rbp),%eax 2d99: 89 c7 mov %eax,%edi 2d9b: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 2da2: 00 00 00 2da5: ff d0 callq *%rax if(read(fd, buf, sizeof(buf)) != 5){ 2da7: 8b 45 fc mov -0x4(%rbp),%eax 2daa: ba 00 20 00 00 mov $0x2000,%edx 2daf: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 2db6: 00 00 00 2db9: 89 c7 mov %eax,%edi 2dbb: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 2dc2: 00 00 00 2dc5: ff d0 callq *%rax 2dc7: 83 f8 05 cmp $0x5,%eax 2dca: 74 16 je 2de2 <unlinkread+0x18b> failexit("unlinkread read failed"); 2dcc: 48 bf 13 74 00 00 00 movabs $0x7413,%rdi 2dd3: 00 00 00 2dd6: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2ddd: 00 00 00 2de0: ff d0 callq *%rax } if(buf[0] != 'h'){ 2de2: 48 b8 00 8c 00 00 00 movabs $0x8c00,%rax 2de9: 00 00 00 2dec: 0f b6 00 movzbl (%rax),%eax 2def: 3c 68 cmp $0x68,%al 2df1: 74 16 je 2e09 <unlinkread+0x1b2> failexit("unlinkread wrong data"); 2df3: 48 bf 2a 74 00 00 00 movabs $0x742a,%rdi 2dfa: 00 00 00 2dfd: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2e04: 00 00 00 2e07: ff d0 callq *%rax } if(write(fd, buf, 10) != 10){ 2e09: 8b 45 fc mov -0x4(%rbp),%eax 2e0c: ba 0a 00 00 00 mov $0xa,%edx 2e11: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 2e18: 00 00 00 2e1b: 89 c7 mov %eax,%edi 2e1d: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 2e24: 00 00 00 2e27: ff d0 callq *%rax 2e29: 83 f8 0a cmp $0xa,%eax 2e2c: 74 16 je 2e44 <unlinkread+0x1ed> failexit("unlinkread write"); 2e2e: 48 bf 40 74 00 00 00 movabs $0x7440,%rdi 2e35: 00 00 00 2e38: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2e3f: 00 00 00 2e42: ff d0 callq *%rax } close(fd); 2e44: 8b 45 fc mov -0x4(%rbp),%eax 2e47: 89 c7 mov %eax,%edi 2e49: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 2e50: 00 00 00 2e53: ff d0 callq *%rax unlink("unlinkread"); 2e55: 48 bf ca 73 00 00 00 movabs $0x73ca,%rdi 2e5c: 00 00 00 2e5f: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 2e66: 00 00 00 2e69: ff d0 callq *%rax printf(1, "unlinkread ok\n"); 2e6b: 48 be 51 74 00 00 00 movabs $0x7451,%rsi 2e72: 00 00 00 2e75: bf 01 00 00 00 mov $0x1,%edi 2e7a: b8 00 00 00 00 mov $0x0,%eax 2e7f: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2e86: 00 00 00 2e89: ff d2 callq *%rdx } 2e8b: 90 nop 2e8c: c9 leaveq 2e8d: c3 retq 0000000000002e8e <linktest>: void linktest(void) { 2e8e: f3 0f 1e fa endbr64 2e92: 55 push %rbp 2e93: 48 89 e5 mov %rsp,%rbp 2e96: 48 83 ec 10 sub $0x10,%rsp int fd; printf(1, "linktest\n"); 2e9a: 48 be 60 74 00 00 00 movabs $0x7460,%rsi 2ea1: 00 00 00 2ea4: bf 01 00 00 00 mov $0x1,%edi 2ea9: b8 00 00 00 00 mov $0x0,%eax 2eae: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 2eb5: 00 00 00 2eb8: ff d2 callq *%rdx unlink("lf1"); 2eba: 48 bf 6a 74 00 00 00 movabs $0x746a,%rdi 2ec1: 00 00 00 2ec4: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 2ecb: 00 00 00 2ece: ff d0 callq *%rax unlink("lf2"); 2ed0: 48 bf 6e 74 00 00 00 movabs $0x746e,%rdi 2ed7: 00 00 00 2eda: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 2ee1: 00 00 00 2ee4: ff d0 callq *%rax fd = open("lf1", O_CREATE|O_RDWR); 2ee6: be 02 02 00 00 mov $0x202,%esi 2eeb: 48 bf 6a 74 00 00 00 movabs $0x746a,%rdi 2ef2: 00 00 00 2ef5: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2efc: 00 00 00 2eff: ff d0 callq *%rax 2f01: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 2f04: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 2f08: 79 16 jns 2f20 <linktest+0x92> failexit("create lf1"); 2f0a: 48 bf 72 74 00 00 00 movabs $0x7472,%rdi 2f11: 00 00 00 2f14: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2f1b: 00 00 00 2f1e: ff d0 callq *%rax } if(write(fd, "hello", 5) != 5){ 2f20: 8b 45 fc mov -0x4(%rbp),%eax 2f23: ba 05 00 00 00 mov $0x5,%edx 2f28: 48 be e7 73 00 00 00 movabs $0x73e7,%rsi 2f2f: 00 00 00 2f32: 89 c7 mov %eax,%edi 2f34: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 2f3b: 00 00 00 2f3e: ff d0 callq *%rax 2f40: 83 f8 05 cmp $0x5,%eax 2f43: 74 16 je 2f5b <linktest+0xcd> failexit("write lf1"); 2f45: 48 bf 7d 74 00 00 00 movabs $0x747d,%rdi 2f4c: 00 00 00 2f4f: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2f56: 00 00 00 2f59: ff d0 callq *%rax } close(fd); 2f5b: 8b 45 fc mov -0x4(%rbp),%eax 2f5e: 89 c7 mov %eax,%edi 2f60: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 2f67: 00 00 00 2f6a: ff d0 callq *%rax if(link("lf1", "lf2") < 0){ 2f6c: 48 be 6e 74 00 00 00 movabs $0x746e,%rsi 2f73: 00 00 00 2f76: 48 bf 6a 74 00 00 00 movabs $0x746a,%rdi 2f7d: 00 00 00 2f80: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 2f87: 00 00 00 2f8a: ff d0 callq *%rax 2f8c: 85 c0 test %eax,%eax 2f8e: 79 16 jns 2fa6 <linktest+0x118> failexit("link lf1 lf2"); 2f90: 48 bf 87 74 00 00 00 movabs $0x7487,%rdi 2f97: 00 00 00 2f9a: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2fa1: 00 00 00 2fa4: ff d0 callq *%rax } unlink("lf1"); 2fa6: 48 bf 6a 74 00 00 00 movabs $0x746a,%rdi 2fad: 00 00 00 2fb0: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 2fb7: 00 00 00 2fba: ff d0 callq *%rax if(open("lf1", 0) >= 0){ 2fbc: be 00 00 00 00 mov $0x0,%esi 2fc1: 48 bf 6a 74 00 00 00 movabs $0x746a,%rdi 2fc8: 00 00 00 2fcb: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 2fd2: 00 00 00 2fd5: ff d0 callq *%rax 2fd7: 85 c0 test %eax,%eax 2fd9: 78 16 js 2ff1 <linktest+0x163> failexit("unlinked lf1 but it is still there!"); 2fdb: 48 bf 98 74 00 00 00 movabs $0x7498,%rdi 2fe2: 00 00 00 2fe5: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 2fec: 00 00 00 2fef: ff d0 callq *%rax } fd = open("lf2", 0); 2ff1: be 00 00 00 00 mov $0x0,%esi 2ff6: 48 bf 6e 74 00 00 00 movabs $0x746e,%rdi 2ffd: 00 00 00 3000: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3007: 00 00 00 300a: ff d0 callq *%rax 300c: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 300f: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 3013: 79 16 jns 302b <linktest+0x19d> failexit("open lf2"); 3015: 48 bf bc 74 00 00 00 movabs $0x74bc,%rdi 301c: 00 00 00 301f: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3026: 00 00 00 3029: ff d0 callq *%rax } if(read(fd, buf, sizeof(buf)) != 5){ 302b: 8b 45 fc mov -0x4(%rbp),%eax 302e: ba 00 20 00 00 mov $0x2000,%edx 3033: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 303a: 00 00 00 303d: 89 c7 mov %eax,%edi 303f: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 3046: 00 00 00 3049: ff d0 callq *%rax 304b: 83 f8 05 cmp $0x5,%eax 304e: 74 16 je 3066 <linktest+0x1d8> failexit("read lf2"); 3050: 48 bf c5 74 00 00 00 movabs $0x74c5,%rdi 3057: 00 00 00 305a: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3061: 00 00 00 3064: ff d0 callq *%rax } close(fd); 3066: 8b 45 fc mov -0x4(%rbp),%eax 3069: 89 c7 mov %eax,%edi 306b: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3072: 00 00 00 3075: ff d0 callq *%rax if(link("lf2", "lf2") >= 0){ 3077: 48 be 6e 74 00 00 00 movabs $0x746e,%rsi 307e: 00 00 00 3081: 48 bf 6e 74 00 00 00 movabs $0x746e,%rdi 3088: 00 00 00 308b: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 3092: 00 00 00 3095: ff d0 callq *%rax 3097: 85 c0 test %eax,%eax 3099: 78 16 js 30b1 <linktest+0x223> failexit("link lf2 lf2 succeeded! oops"); 309b: 48 bf ce 74 00 00 00 movabs $0x74ce,%rdi 30a2: 00 00 00 30a5: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 30ac: 00 00 00 30af: ff d0 callq *%rax } unlink("lf2"); 30b1: 48 bf 6e 74 00 00 00 movabs $0x746e,%rdi 30b8: 00 00 00 30bb: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 30c2: 00 00 00 30c5: ff d0 callq *%rax if(link("lf2", "lf1") >= 0){ 30c7: 48 be 6a 74 00 00 00 movabs $0x746a,%rsi 30ce: 00 00 00 30d1: 48 bf 6e 74 00 00 00 movabs $0x746e,%rdi 30d8: 00 00 00 30db: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 30e2: 00 00 00 30e5: ff d0 callq *%rax 30e7: 85 c0 test %eax,%eax 30e9: 78 16 js 3101 <linktest+0x273> failexit("link non-existant succeeded! oops"); 30eb: 48 bf f0 74 00 00 00 movabs $0x74f0,%rdi 30f2: 00 00 00 30f5: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 30fc: 00 00 00 30ff: ff d0 callq *%rax } if(link(".", "lf1") >= 0){ 3101: 48 be 6a 74 00 00 00 movabs $0x746a,%rsi 3108: 00 00 00 310b: 48 bf 12 75 00 00 00 movabs $0x7512,%rdi 3112: 00 00 00 3115: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 311c: 00 00 00 311f: ff d0 callq *%rax 3121: 85 c0 test %eax,%eax 3123: 78 16 js 313b <linktest+0x2ad> failexit("link . lf1 succeeded! oops"); 3125: 48 bf 14 75 00 00 00 movabs $0x7514,%rdi 312c: 00 00 00 312f: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3136: 00 00 00 3139: ff d0 callq *%rax } printf(1, "linktest ok\n"); 313b: 48 be 2f 75 00 00 00 movabs $0x752f,%rsi 3142: 00 00 00 3145: bf 01 00 00 00 mov $0x1,%edi 314a: b8 00 00 00 00 mov $0x0,%eax 314f: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 3156: 00 00 00 3159: ff d2 callq *%rdx } 315b: 90 nop 315c: c9 leaveq 315d: c3 retq 000000000000315e <concreate>: // test concurrent create/link/unlink of the same file void concreate(void) { 315e: f3 0f 1e fa endbr64 3162: 55 push %rbp 3163: 48 89 e5 mov %rsp,%rbp 3166: 48 83 ec 50 sub $0x50,%rsp struct { ushort inum; char name[14]; } de; printf(1, "concreate test\n"); 316a: 48 be 3c 75 00 00 00 movabs $0x753c,%rsi 3171: 00 00 00 3174: bf 01 00 00 00 mov $0x1,%edi 3179: b8 00 00 00 00 mov $0x0,%eax 317e: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 3185: 00 00 00 3188: ff d2 callq *%rdx file[0] = 'C'; 318a: c6 45 ed 43 movb $0x43,-0x13(%rbp) file[2] = '\0'; 318e: c6 45 ef 00 movb $0x0,-0x11(%rbp) for(i = 0; i < 40; i++){ 3192: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 3199: e9 55 01 00 00 jmpq 32f3 <concreate+0x195> file[1] = '0' + i; 319e: 8b 45 fc mov -0x4(%rbp),%eax 31a1: 83 c0 30 add $0x30,%eax 31a4: 88 45 ee mov %al,-0x12(%rbp) unlink(file); 31a7: 48 8d 45 ed lea -0x13(%rbp),%rax 31ab: 48 89 c7 mov %rax,%rdi 31ae: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 31b5: 00 00 00 31b8: ff d0 callq *%rax pid = fork(); 31ba: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 31c1: 00 00 00 31c4: ff d0 callq *%rax 31c6: 89 45 f0 mov %eax,-0x10(%rbp) if(pid && (i % 3) == 1){ 31c9: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 31cd: 74 4c je 321b <concreate+0xbd> 31cf: 8b 4d fc mov -0x4(%rbp),%ecx 31d2: 48 63 c1 movslq %ecx,%rax 31d5: 48 69 c0 56 55 55 55 imul $0x55555556,%rax,%rax 31dc: 48 c1 e8 20 shr $0x20,%rax 31e0: 48 89 c2 mov %rax,%rdx 31e3: 89 c8 mov %ecx,%eax 31e5: c1 f8 1f sar $0x1f,%eax 31e8: 29 c2 sub %eax,%edx 31ea: 89 d0 mov %edx,%eax 31ec: 01 c0 add %eax,%eax 31ee: 01 d0 add %edx,%eax 31f0: 29 c1 sub %eax,%ecx 31f2: 89 ca mov %ecx,%edx 31f4: 83 fa 01 cmp $0x1,%edx 31f7: 75 22 jne 321b <concreate+0xbd> link("C0", file); 31f9: 48 8d 45 ed lea -0x13(%rbp),%rax 31fd: 48 89 c6 mov %rax,%rsi 3200: 48 bf 4c 75 00 00 00 movabs $0x754c,%rdi 3207: 00 00 00 320a: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 3211: 00 00 00 3214: ff d0 callq *%rax 3216: e9 b6 00 00 00 jmpq 32d1 <concreate+0x173> } else if(pid == 0 && (i % 5) == 1){ 321b: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 321f: 75 4b jne 326c <concreate+0x10e> 3221: 8b 4d fc mov -0x4(%rbp),%ecx 3224: 48 63 c1 movslq %ecx,%rax 3227: 48 69 c0 67 66 66 66 imul $0x66666667,%rax,%rax 322e: 48 c1 e8 20 shr $0x20,%rax 3232: 89 c2 mov %eax,%edx 3234: d1 fa sar %edx 3236: 89 c8 mov %ecx,%eax 3238: c1 f8 1f sar $0x1f,%eax 323b: 29 c2 sub %eax,%edx 323d: 89 d0 mov %edx,%eax 323f: c1 e0 02 shl $0x2,%eax 3242: 01 d0 add %edx,%eax 3244: 29 c1 sub %eax,%ecx 3246: 89 ca mov %ecx,%edx 3248: 83 fa 01 cmp $0x1,%edx 324b: 75 1f jne 326c <concreate+0x10e> link("C0", file); 324d: 48 8d 45 ed lea -0x13(%rbp),%rax 3251: 48 89 c6 mov %rax,%rsi 3254: 48 bf 4c 75 00 00 00 movabs $0x754c,%rdi 325b: 00 00 00 325e: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 3265: 00 00 00 3268: ff d0 callq *%rax 326a: eb 65 jmp 32d1 <concreate+0x173> } else { fd = open(file, O_CREATE | O_RDWR); 326c: 48 8d 45 ed lea -0x13(%rbp),%rax 3270: be 02 02 00 00 mov $0x202,%esi 3275: 48 89 c7 mov %rax,%rdi 3278: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 327f: 00 00 00 3282: ff d0 callq *%rax 3284: 89 45 f4 mov %eax,-0xc(%rbp) if(fd < 0){ 3287: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 328b: 79 33 jns 32c0 <concreate+0x162> printf(1, "concreate create %s failed\n", file); 328d: 48 8d 45 ed lea -0x13(%rbp),%rax 3291: 48 89 c2 mov %rax,%rdx 3294: 48 be 4f 75 00 00 00 movabs $0x754f,%rsi 329b: 00 00 00 329e: bf 01 00 00 00 mov $0x1,%edi 32a3: b8 00 00 00 00 mov $0x0,%eax 32a8: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 32af: 00 00 00 32b2: ff d1 callq *%rcx exit(); 32b4: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 32bb: 00 00 00 32be: ff d0 callq *%rax } close(fd); 32c0: 8b 45 f4 mov -0xc(%rbp),%eax 32c3: 89 c7 mov %eax,%edi 32c5: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 32cc: 00 00 00 32cf: ff d0 callq *%rax } if(pid == 0) 32d1: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 32d5: 75 0c jne 32e3 <concreate+0x185> exit(); 32d7: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 32de: 00 00 00 32e1: ff d0 callq *%rax else wait(); 32e3: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 32ea: 00 00 00 32ed: ff d0 callq *%rax for(i = 0; i < 40; i++){ 32ef: 83 45 fc 01 addl $0x1,-0x4(%rbp) 32f3: 83 7d fc 27 cmpl $0x27,-0x4(%rbp) 32f7: 0f 8e a1 fe ff ff jle 319e <concreate+0x40> } memset(fa, 0, sizeof(fa)); 32fd: 48 8d 45 c0 lea -0x40(%rbp),%rax 3301: ba 28 00 00 00 mov $0x28,%edx 3306: be 00 00 00 00 mov $0x0,%esi 330b: 48 89 c7 mov %rax,%rdi 330e: 48 b8 d8 60 00 00 00 movabs $0x60d8,%rax 3315: 00 00 00 3318: ff d0 callq *%rax fd = open(".", 0); 331a: be 00 00 00 00 mov $0x0,%esi 331f: 48 bf 12 75 00 00 00 movabs $0x7512,%rdi 3326: 00 00 00 3329: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3330: 00 00 00 3333: ff d0 callq *%rax 3335: 89 45 f4 mov %eax,-0xc(%rbp) n = 0; 3338: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) while(read(fd, &de, sizeof(de)) > 0){ 333f: e9 cb 00 00 00 jmpq 340f <concreate+0x2b1> if(de.inum == 0) 3344: 0f b7 45 b0 movzwl -0x50(%rbp),%eax 3348: 66 85 c0 test %ax,%ax 334b: 75 05 jne 3352 <concreate+0x1f4> continue; 334d: e9 bd 00 00 00 jmpq 340f <concreate+0x2b1> if(de.name[0] == 'C' && de.name[2] == '\0'){ 3352: 0f b6 45 b2 movzbl -0x4e(%rbp),%eax 3356: 3c 43 cmp $0x43,%al 3358: 0f 85 b1 00 00 00 jne 340f <concreate+0x2b1> 335e: 0f b6 45 b4 movzbl -0x4c(%rbp),%eax 3362: 84 c0 test %al,%al 3364: 0f 85 a5 00 00 00 jne 340f <concreate+0x2b1> i = de.name[1] - '0'; 336a: 0f b6 45 b3 movzbl -0x4d(%rbp),%eax 336e: 0f be c0 movsbl %al,%eax 3371: 83 e8 30 sub $0x30,%eax 3374: 89 45 fc mov %eax,-0x4(%rbp) if(i < 0 || i >= sizeof(fa)){ 3377: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 337b: 78 08 js 3385 <concreate+0x227> 337d: 8b 45 fc mov -0x4(%rbp),%eax 3380: 83 f8 27 cmp $0x27,%eax 3383: 76 37 jbe 33bc <concreate+0x25e> printf(1, "concreate weird file %s\n", de.name); 3385: 48 8d 45 b0 lea -0x50(%rbp),%rax 3389: 48 83 c0 02 add $0x2,%rax 338d: 48 89 c2 mov %rax,%rdx 3390: 48 be 6b 75 00 00 00 movabs $0x756b,%rsi 3397: 00 00 00 339a: bf 01 00 00 00 mov $0x1,%edi 339f: b8 00 00 00 00 mov $0x0,%eax 33a4: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 33ab: 00 00 00 33ae: ff d1 callq *%rcx exit(); 33b0: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 33b7: 00 00 00 33ba: ff d0 callq *%rax } if(fa[i]){ 33bc: 8b 45 fc mov -0x4(%rbp),%eax 33bf: 48 98 cltq 33c1: 0f b6 44 05 c0 movzbl -0x40(%rbp,%rax,1),%eax 33c6: 84 c0 test %al,%al 33c8: 74 37 je 3401 <concreate+0x2a3> printf(1, "concreate duplicate file %s\n", de.name); 33ca: 48 8d 45 b0 lea -0x50(%rbp),%rax 33ce: 48 83 c0 02 add $0x2,%rax 33d2: 48 89 c2 mov %rax,%rdx 33d5: 48 be 84 75 00 00 00 movabs $0x7584,%rsi 33dc: 00 00 00 33df: bf 01 00 00 00 mov $0x1,%edi 33e4: b8 00 00 00 00 mov $0x0,%eax 33e9: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 33f0: 00 00 00 33f3: ff d1 callq *%rcx exit(); 33f5: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 33fc: 00 00 00 33ff: ff d0 callq *%rax } fa[i] = 1; 3401: 8b 45 fc mov -0x4(%rbp),%eax 3404: 48 98 cltq 3406: c6 44 05 c0 01 movb $0x1,-0x40(%rbp,%rax,1) n++; 340b: 83 45 f8 01 addl $0x1,-0x8(%rbp) while(read(fd, &de, sizeof(de)) > 0){ 340f: 48 8d 4d b0 lea -0x50(%rbp),%rcx 3413: 8b 45 f4 mov -0xc(%rbp),%eax 3416: ba 10 00 00 00 mov $0x10,%edx 341b: 48 89 ce mov %rcx,%rsi 341e: 89 c7 mov %eax,%edi 3420: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 3427: 00 00 00 342a: ff d0 callq *%rax 342c: 85 c0 test %eax,%eax 342e: 0f 8f 10 ff ff ff jg 3344 <concreate+0x1e6> } } close(fd); 3434: 8b 45 f4 mov -0xc(%rbp),%eax 3437: 89 c7 mov %eax,%edi 3439: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3440: 00 00 00 3443: ff d0 callq *%rax if(n != 40){ 3445: 83 7d f8 28 cmpl $0x28,-0x8(%rbp) 3449: 74 16 je 3461 <concreate+0x303> failexit("concreate not enough files in directory listing"); 344b: 48 bf a8 75 00 00 00 movabs $0x75a8,%rdi 3452: 00 00 00 3455: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 345c: 00 00 00 345f: ff d0 callq *%rax } for(i = 0; i < 40; i++){ 3461: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 3468: e9 a7 01 00 00 jmpq 3614 <concreate+0x4b6> file[1] = '0' + i; 346d: 8b 45 fc mov -0x4(%rbp),%eax 3470: 83 c0 30 add $0x30,%eax 3473: 88 45 ee mov %al,-0x12(%rbp) pid = fork(); 3476: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 347d: 00 00 00 3480: ff d0 callq *%rax 3482: 89 45 f0 mov %eax,-0x10(%rbp) if(pid < 0){ 3485: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 3489: 79 16 jns 34a1 <concreate+0x343> failexit("fork"); 348b: 48 bf a7 6d 00 00 00 movabs $0x6da7,%rdi 3492: 00 00 00 3495: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 349c: 00 00 00 349f: ff d0 callq *%rax } if(((i % 3) == 0 && pid == 0) || 34a1: 8b 4d fc mov -0x4(%rbp),%ecx 34a4: 48 63 c1 movslq %ecx,%rax 34a7: 48 69 c0 56 55 55 55 imul $0x55555556,%rax,%rax 34ae: 48 c1 e8 20 shr $0x20,%rax 34b2: 48 89 c2 mov %rax,%rdx 34b5: 89 c8 mov %ecx,%eax 34b7: c1 f8 1f sar $0x1f,%eax 34ba: 89 d6 mov %edx,%esi 34bc: 29 c6 sub %eax,%esi 34be: 89 f0 mov %esi,%eax 34c0: 89 c2 mov %eax,%edx 34c2: 01 d2 add %edx,%edx 34c4: 01 c2 add %eax,%edx 34c6: 89 c8 mov %ecx,%eax 34c8: 29 d0 sub %edx,%eax 34ca: 85 c0 test %eax,%eax 34cc: 75 06 jne 34d4 <concreate+0x376> 34ce: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 34d2: 74 38 je 350c <concreate+0x3ae> ((i % 3) == 1 && pid != 0)){ 34d4: 8b 4d fc mov -0x4(%rbp),%ecx 34d7: 48 63 c1 movslq %ecx,%rax 34da: 48 69 c0 56 55 55 55 imul $0x55555556,%rax,%rax 34e1: 48 c1 e8 20 shr $0x20,%rax 34e5: 48 89 c2 mov %rax,%rdx 34e8: 89 c8 mov %ecx,%eax 34ea: c1 f8 1f sar $0x1f,%eax 34ed: 29 c2 sub %eax,%edx 34ef: 89 d0 mov %edx,%eax 34f1: 01 c0 add %eax,%eax 34f3: 01 d0 add %edx,%eax 34f5: 29 c1 sub %eax,%ecx 34f7: 89 ca mov %ecx,%edx if(((i % 3) == 0 && pid == 0) || 34f9: 83 fa 01 cmp $0x1,%edx 34fc: 0f 85 a4 00 00 00 jne 35a6 <concreate+0x448> ((i % 3) == 1 && pid != 0)){ 3502: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 3506: 0f 84 9a 00 00 00 je 35a6 <concreate+0x448> close(open(file, 0)); 350c: 48 8d 45 ed lea -0x13(%rbp),%rax 3510: be 00 00 00 00 mov $0x0,%esi 3515: 48 89 c7 mov %rax,%rdi 3518: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 351f: 00 00 00 3522: ff d0 callq *%rax 3524: 89 c7 mov %eax,%edi 3526: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 352d: 00 00 00 3530: ff d0 callq *%rax close(open(file, 0)); 3532: 48 8d 45 ed lea -0x13(%rbp),%rax 3536: be 00 00 00 00 mov $0x0,%esi 353b: 48 89 c7 mov %rax,%rdi 353e: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3545: 00 00 00 3548: ff d0 callq *%rax 354a: 89 c7 mov %eax,%edi 354c: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3553: 00 00 00 3556: ff d0 callq *%rax close(open(file, 0)); 3558: 48 8d 45 ed lea -0x13(%rbp),%rax 355c: be 00 00 00 00 mov $0x0,%esi 3561: 48 89 c7 mov %rax,%rdi 3564: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 356b: 00 00 00 356e: ff d0 callq *%rax 3570: 89 c7 mov %eax,%edi 3572: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3579: 00 00 00 357c: ff d0 callq *%rax close(open(file, 0)); 357e: 48 8d 45 ed lea -0x13(%rbp),%rax 3582: be 00 00 00 00 mov $0x0,%esi 3587: 48 89 c7 mov %rax,%rdi 358a: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3591: 00 00 00 3594: ff d0 callq *%rax 3596: 89 c7 mov %eax,%edi 3598: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 359f: 00 00 00 35a2: ff d0 callq *%rax 35a4: eb 4c jmp 35f2 <concreate+0x494> } else { unlink(file); 35a6: 48 8d 45 ed lea -0x13(%rbp),%rax 35aa: 48 89 c7 mov %rax,%rdi 35ad: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 35b4: 00 00 00 35b7: ff d0 callq *%rax unlink(file); 35b9: 48 8d 45 ed lea -0x13(%rbp),%rax 35bd: 48 89 c7 mov %rax,%rdi 35c0: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 35c7: 00 00 00 35ca: ff d0 callq *%rax unlink(file); 35cc: 48 8d 45 ed lea -0x13(%rbp),%rax 35d0: 48 89 c7 mov %rax,%rdi 35d3: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 35da: 00 00 00 35dd: ff d0 callq *%rax unlink(file); 35df: 48 8d 45 ed lea -0x13(%rbp),%rax 35e3: 48 89 c7 mov %rax,%rdi 35e6: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 35ed: 00 00 00 35f0: ff d0 callq *%rax } if(pid == 0) 35f2: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 35f6: 75 0c jne 3604 <concreate+0x4a6> exit(); 35f8: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 35ff: 00 00 00 3602: ff d0 callq *%rax else wait(); 3604: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 360b: 00 00 00 360e: ff d0 callq *%rax for(i = 0; i < 40; i++){ 3610: 83 45 fc 01 addl $0x1,-0x4(%rbp) 3614: 83 7d fc 27 cmpl $0x27,-0x4(%rbp) 3618: 0f 8e 4f fe ff ff jle 346d <concreate+0x30f> } printf(1, "concreate ok\n"); 361e: 48 be d8 75 00 00 00 movabs $0x75d8,%rsi 3625: 00 00 00 3628: bf 01 00 00 00 mov $0x1,%edi 362d: b8 00 00 00 00 mov $0x0,%eax 3632: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 3639: 00 00 00 363c: ff d2 callq *%rdx } 363e: 90 nop 363f: c9 leaveq 3640: c3 retq 0000000000003641 <linkunlink>: // another concurrent link/unlink/create test, // to look for deadlocks. void linkunlink() { 3641: f3 0f 1e fa endbr64 3645: 55 push %rbp 3646: 48 89 e5 mov %rsp,%rbp 3649: 48 83 ec 10 sub $0x10,%rsp int pid, i; printf(1, "linkunlink test\n"); 364d: 48 be e6 75 00 00 00 movabs $0x75e6,%rsi 3654: 00 00 00 3657: bf 01 00 00 00 mov $0x1,%edi 365c: b8 00 00 00 00 mov $0x0,%eax 3661: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 3668: 00 00 00 366b: ff d2 callq *%rdx unlink("x"); 366d: 48 bf 96 71 00 00 00 movabs $0x7196,%rdi 3674: 00 00 00 3677: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 367e: 00 00 00 3681: ff d0 callq *%rax pid = fork(); 3683: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 368a: 00 00 00 368d: ff d0 callq *%rax 368f: 89 45 f4 mov %eax,-0xc(%rbp) if(pid < 0){ 3692: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 3696: 79 16 jns 36ae <linkunlink+0x6d> failexit("fork"); 3698: 48 bf a7 6d 00 00 00 movabs $0x6da7,%rdi 369f: 00 00 00 36a2: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 36a9: 00 00 00 36ac: ff d0 callq *%rax } unsigned int x = (pid ? 1 : 97); 36ae: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 36b2: 74 07 je 36bb <linkunlink+0x7a> 36b4: b8 01 00 00 00 mov $0x1,%eax 36b9: eb 05 jmp 36c0 <linkunlink+0x7f> 36bb: b8 61 00 00 00 mov $0x61,%eax 36c0: 89 45 f8 mov %eax,-0x8(%rbp) for(i = 0; i < 100; i++){ 36c3: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 36ca: e9 bf 00 00 00 jmpq 378e <linkunlink+0x14d> x = x * 1103515245 + 12345; 36cf: 8b 45 f8 mov -0x8(%rbp),%eax 36d2: 69 c0 6d 4e c6 41 imul $0x41c64e6d,%eax,%eax 36d8: 05 39 30 00 00 add $0x3039,%eax 36dd: 89 45 f8 mov %eax,-0x8(%rbp) if((x % 3) == 0){ 36e0: 8b 4d f8 mov -0x8(%rbp),%ecx 36e3: 89 ca mov %ecx,%edx 36e5: b8 ab aa aa aa mov $0xaaaaaaab,%eax 36ea: 48 0f af c2 imul %rdx,%rax 36ee: 48 c1 e8 20 shr $0x20,%rax 36f2: d1 e8 shr %eax 36f4: 89 c2 mov %eax,%edx 36f6: 01 d2 add %edx,%edx 36f8: 01 c2 add %eax,%edx 36fa: 89 c8 mov %ecx,%eax 36fc: 29 d0 sub %edx,%eax 36fe: 85 c0 test %eax,%eax 3700: 75 2b jne 372d <linkunlink+0xec> close(open("x", O_RDWR | O_CREATE)); 3702: be 02 02 00 00 mov $0x202,%esi 3707: 48 bf 96 71 00 00 00 movabs $0x7196,%rdi 370e: 00 00 00 3711: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3718: 00 00 00 371b: ff d0 callq *%rax 371d: 89 c7 mov %eax,%edi 371f: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3726: 00 00 00 3729: ff d0 callq *%rax 372b: eb 5d jmp 378a <linkunlink+0x149> } else if((x % 3) == 1){ 372d: 8b 4d f8 mov -0x8(%rbp),%ecx 3730: 89 ca mov %ecx,%edx 3732: b8 ab aa aa aa mov $0xaaaaaaab,%eax 3737: 48 0f af c2 imul %rdx,%rax 373b: 48 c1 e8 20 shr $0x20,%rax 373f: 89 c2 mov %eax,%edx 3741: d1 ea shr %edx 3743: 89 d0 mov %edx,%eax 3745: 01 c0 add %eax,%eax 3747: 01 d0 add %edx,%eax 3749: 29 c1 sub %eax,%ecx 374b: 89 ca mov %ecx,%edx 374d: 83 fa 01 cmp $0x1,%edx 3750: 75 22 jne 3774 <linkunlink+0x133> link("cat", "x"); 3752: 48 be 96 71 00 00 00 movabs $0x7196,%rsi 3759: 00 00 00 375c: 48 bf f7 75 00 00 00 movabs $0x75f7,%rdi 3763: 00 00 00 3766: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 376d: 00 00 00 3770: ff d0 callq *%rax 3772: eb 16 jmp 378a <linkunlink+0x149> } else { unlink("x"); 3774: 48 bf 96 71 00 00 00 movabs $0x7196,%rdi 377b: 00 00 00 377e: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 3785: 00 00 00 3788: ff d0 callq *%rax for(i = 0; i < 100; i++){ 378a: 83 45 fc 01 addl $0x1,-0x4(%rbp) 378e: 83 7d fc 63 cmpl $0x63,-0x4(%rbp) 3792: 0f 8e 37 ff ff ff jle 36cf <linkunlink+0x8e> } } if(pid) 3798: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 379c: 74 0e je 37ac <linkunlink+0x16b> wait(); 379e: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 37a5: 00 00 00 37a8: ff d0 callq *%rax 37aa: eb 0c jmp 37b8 <linkunlink+0x177> else exit(); 37ac: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 37b3: 00 00 00 37b6: ff d0 callq *%rax printf(1, "linkunlink ok\n"); 37b8: 48 be fb 75 00 00 00 movabs $0x75fb,%rsi 37bf: 00 00 00 37c2: bf 01 00 00 00 mov $0x1,%edi 37c7: b8 00 00 00 00 mov $0x0,%eax 37cc: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 37d3: 00 00 00 37d6: ff d2 callq *%rdx } 37d8: 90 nop 37d9: c9 leaveq 37da: c3 retq 00000000000037db <bigdir>: // directory that uses indirect blocks void bigdir(void) { 37db: f3 0f 1e fa endbr64 37df: 55 push %rbp 37e0: 48 89 e5 mov %rsp,%rbp 37e3: 48 83 ec 20 sub $0x20,%rsp int i, fd; char name[10]; printf(1, "bigdir test\n"); 37e7: 48 be 0a 76 00 00 00 movabs $0x760a,%rsi 37ee: 00 00 00 37f1: bf 01 00 00 00 mov $0x1,%edi 37f6: b8 00 00 00 00 mov $0x0,%eax 37fb: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 3802: 00 00 00 3805: ff d2 callq *%rdx unlink("bd"); 3807: 48 bf 17 76 00 00 00 movabs $0x7617,%rdi 380e: 00 00 00 3811: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 3818: 00 00 00 381b: ff d0 callq *%rax fd = open("bd", O_CREATE); 381d: be 00 02 00 00 mov $0x200,%esi 3822: 48 bf 17 76 00 00 00 movabs $0x7617,%rdi 3829: 00 00 00 382c: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3833: 00 00 00 3836: ff d0 callq *%rax 3838: 89 45 f8 mov %eax,-0x8(%rbp) if(fd < 0){ 383b: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 383f: 79 16 jns 3857 <bigdir+0x7c> failexit("bigdir create"); 3841: 48 bf 1a 76 00 00 00 movabs $0x761a,%rdi 3848: 00 00 00 384b: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3852: 00 00 00 3855: ff d0 callq *%rax } close(fd); 3857: 8b 45 f8 mov -0x8(%rbp),%eax 385a: 89 c7 mov %eax,%edi 385c: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3863: 00 00 00 3866: ff d0 callq *%rax for(i = 0; i < 500; i++){ 3868: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 386f: eb 6b jmp 38dc <bigdir+0x101> name[0] = 'x'; 3871: c6 45 ee 78 movb $0x78,-0x12(%rbp) name[1] = '0' + (i / 64); 3875: 8b 45 fc mov -0x4(%rbp),%eax 3878: 8d 50 3f lea 0x3f(%rax),%edx 387b: 85 c0 test %eax,%eax 387d: 0f 48 c2 cmovs %edx,%eax 3880: c1 f8 06 sar $0x6,%eax 3883: 83 c0 30 add $0x30,%eax 3886: 88 45 ef mov %al,-0x11(%rbp) name[2] = '0' + (i % 64); 3889: 8b 45 fc mov -0x4(%rbp),%eax 388c: 99 cltd 388d: c1 ea 1a shr $0x1a,%edx 3890: 01 d0 add %edx,%eax 3892: 83 e0 3f and $0x3f,%eax 3895: 29 d0 sub %edx,%eax 3897: 83 c0 30 add $0x30,%eax 389a: 88 45 f0 mov %al,-0x10(%rbp) name[3] = '\0'; 389d: c6 45 f1 00 movb $0x0,-0xf(%rbp) if(link("bd", name) != 0){ 38a1: 48 8d 45 ee lea -0x12(%rbp),%rax 38a5: 48 89 c6 mov %rax,%rsi 38a8: 48 bf 17 76 00 00 00 movabs $0x7617,%rdi 38af: 00 00 00 38b2: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 38b9: 00 00 00 38bc: ff d0 callq *%rax 38be: 85 c0 test %eax,%eax 38c0: 74 16 je 38d8 <bigdir+0xfd> failexit("bigdir link"); 38c2: 48 bf 28 76 00 00 00 movabs $0x7628,%rdi 38c9: 00 00 00 38cc: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 38d3: 00 00 00 38d6: ff d0 callq *%rax for(i = 0; i < 500; i++){ 38d8: 83 45 fc 01 addl $0x1,-0x4(%rbp) 38dc: 81 7d fc f3 01 00 00 cmpl $0x1f3,-0x4(%rbp) 38e3: 7e 8c jle 3871 <bigdir+0x96> } } unlink("bd"); 38e5: 48 bf 17 76 00 00 00 movabs $0x7617,%rdi 38ec: 00 00 00 38ef: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 38f6: 00 00 00 38f9: ff d0 callq *%rax for(i = 0; i < 500; i++){ 38fb: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 3902: eb 61 jmp 3965 <bigdir+0x18a> name[0] = 'x'; 3904: c6 45 ee 78 movb $0x78,-0x12(%rbp) name[1] = '0' + (i / 64); 3908: 8b 45 fc mov -0x4(%rbp),%eax 390b: 8d 50 3f lea 0x3f(%rax),%edx 390e: 85 c0 test %eax,%eax 3910: 0f 48 c2 cmovs %edx,%eax 3913: c1 f8 06 sar $0x6,%eax 3916: 83 c0 30 add $0x30,%eax 3919: 88 45 ef mov %al,-0x11(%rbp) name[2] = '0' + (i % 64); 391c: 8b 45 fc mov -0x4(%rbp),%eax 391f: 99 cltd 3920: c1 ea 1a shr $0x1a,%edx 3923: 01 d0 add %edx,%eax 3925: 83 e0 3f and $0x3f,%eax 3928: 29 d0 sub %edx,%eax 392a: 83 c0 30 add $0x30,%eax 392d: 88 45 f0 mov %al,-0x10(%rbp) name[3] = '\0'; 3930: c6 45 f1 00 movb $0x0,-0xf(%rbp) if(unlink(name) != 0){ 3934: 48 8d 45 ee lea -0x12(%rbp),%rax 3938: 48 89 c7 mov %rax,%rdi 393b: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 3942: 00 00 00 3945: ff d0 callq *%rax 3947: 85 c0 test %eax,%eax 3949: 74 16 je 3961 <bigdir+0x186> failexit("bigdir unlink failed"); 394b: 48 bf 34 76 00 00 00 movabs $0x7634,%rdi 3952: 00 00 00 3955: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 395c: 00 00 00 395f: ff d0 callq *%rax for(i = 0; i < 500; i++){ 3961: 83 45 fc 01 addl $0x1,-0x4(%rbp) 3965: 81 7d fc f3 01 00 00 cmpl $0x1f3,-0x4(%rbp) 396c: 7e 96 jle 3904 <bigdir+0x129> } } printf(1, "bigdir ok\n"); 396e: 48 be 49 76 00 00 00 movabs $0x7649,%rsi 3975: 00 00 00 3978: bf 01 00 00 00 mov $0x1,%edi 397d: b8 00 00 00 00 mov $0x0,%eax 3982: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 3989: 00 00 00 398c: ff d2 callq *%rdx } 398e: 90 nop 398f: c9 leaveq 3990: c3 retq 0000000000003991 <subdir>: void subdir(void) { 3991: f3 0f 1e fa endbr64 3995: 55 push %rbp 3996: 48 89 e5 mov %rsp,%rbp 3999: 48 83 ec 10 sub $0x10,%rsp int fd, cc; printf(1, "subdir test\n"); 399d: 48 be 54 76 00 00 00 movabs $0x7654,%rsi 39a4: 00 00 00 39a7: bf 01 00 00 00 mov $0x1,%edi 39ac: b8 00 00 00 00 mov $0x0,%eax 39b1: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 39b8: 00 00 00 39bb: ff d2 callq *%rdx unlink("ff"); 39bd: 48 bf 61 76 00 00 00 movabs $0x7661,%rdi 39c4: 00 00 00 39c7: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 39ce: 00 00 00 39d1: ff d0 callq *%rax if(mkdir("dd") != 0){ 39d3: 48 bf 64 76 00 00 00 movabs $0x7664,%rdi 39da: 00 00 00 39dd: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 39e4: 00 00 00 39e7: ff d0 callq *%rax 39e9: 85 c0 test %eax,%eax 39eb: 74 16 je 3a03 <subdir+0x72> failexit("subdir mkdir dd"); 39ed: 48 bf 67 76 00 00 00 movabs $0x7667,%rdi 39f4: 00 00 00 39f7: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 39fe: 00 00 00 3a01: ff d0 callq *%rax } fd = open("dd/ff", O_CREATE | O_RDWR); 3a03: be 02 02 00 00 mov $0x202,%esi 3a08: 48 bf 77 76 00 00 00 movabs $0x7677,%rdi 3a0f: 00 00 00 3a12: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3a19: 00 00 00 3a1c: ff d0 callq *%rax 3a1e: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 3a21: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 3a25: 79 16 jns 3a3d <subdir+0xac> failexit("create dd/ff"); 3a27: 48 bf 7d 76 00 00 00 movabs $0x767d,%rdi 3a2e: 00 00 00 3a31: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3a38: 00 00 00 3a3b: ff d0 callq *%rax } write(fd, "ff", 2); 3a3d: 8b 45 fc mov -0x4(%rbp),%eax 3a40: ba 02 00 00 00 mov $0x2,%edx 3a45: 48 be 61 76 00 00 00 movabs $0x7661,%rsi 3a4c: 00 00 00 3a4f: 89 c7 mov %eax,%edi 3a51: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 3a58: 00 00 00 3a5b: ff d0 callq *%rax close(fd); 3a5d: 8b 45 fc mov -0x4(%rbp),%eax 3a60: 89 c7 mov %eax,%edi 3a62: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3a69: 00 00 00 3a6c: ff d0 callq *%rax if(unlink("dd") >= 0){ 3a6e: 48 bf 64 76 00 00 00 movabs $0x7664,%rdi 3a75: 00 00 00 3a78: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 3a7f: 00 00 00 3a82: ff d0 callq *%rax 3a84: 85 c0 test %eax,%eax 3a86: 78 16 js 3a9e <subdir+0x10d> failexit("unlink dd (non-empty dir) succeeded!"); 3a88: 48 bf 90 76 00 00 00 movabs $0x7690,%rdi 3a8f: 00 00 00 3a92: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3a99: 00 00 00 3a9c: ff d0 callq *%rax } if(mkdir("/dd/dd") != 0){ 3a9e: 48 bf b5 76 00 00 00 movabs $0x76b5,%rdi 3aa5: 00 00 00 3aa8: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 3aaf: 00 00 00 3ab2: ff d0 callq *%rax 3ab4: 85 c0 test %eax,%eax 3ab6: 74 16 je 3ace <subdir+0x13d> failexit("subdir mkdir dd/dd"); 3ab8: 48 bf bc 76 00 00 00 movabs $0x76bc,%rdi 3abf: 00 00 00 3ac2: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3ac9: 00 00 00 3acc: ff d0 callq *%rax } fd = open("dd/dd/ff", O_CREATE | O_RDWR); 3ace: be 02 02 00 00 mov $0x202,%esi 3ad3: 48 bf cf 76 00 00 00 movabs $0x76cf,%rdi 3ada: 00 00 00 3add: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3ae4: 00 00 00 3ae7: ff d0 callq *%rax 3ae9: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 3aec: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 3af0: 79 16 jns 3b08 <subdir+0x177> failexit("create dd/dd/ff"); 3af2: 48 bf d8 76 00 00 00 movabs $0x76d8,%rdi 3af9: 00 00 00 3afc: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3b03: 00 00 00 3b06: ff d0 callq *%rax } write(fd, "FF", 2); 3b08: 8b 45 fc mov -0x4(%rbp),%eax 3b0b: ba 02 00 00 00 mov $0x2,%edx 3b10: 48 be e8 76 00 00 00 movabs $0x76e8,%rsi 3b17: 00 00 00 3b1a: 89 c7 mov %eax,%edi 3b1c: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 3b23: 00 00 00 3b26: ff d0 callq *%rax close(fd); 3b28: 8b 45 fc mov -0x4(%rbp),%eax 3b2b: 89 c7 mov %eax,%edi 3b2d: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3b34: 00 00 00 3b37: ff d0 callq *%rax fd = open("dd/dd/../ff", 0); 3b39: be 00 00 00 00 mov $0x0,%esi 3b3e: 48 bf eb 76 00 00 00 movabs $0x76eb,%rdi 3b45: 00 00 00 3b48: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3b4f: 00 00 00 3b52: ff d0 callq *%rax 3b54: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 3b57: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 3b5b: 79 16 jns 3b73 <subdir+0x1e2> failexit("open dd/dd/../ff"); 3b5d: 48 bf f7 76 00 00 00 movabs $0x76f7,%rdi 3b64: 00 00 00 3b67: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3b6e: 00 00 00 3b71: ff d0 callq *%rax } cc = read(fd, buf, sizeof(buf)); 3b73: 8b 45 fc mov -0x4(%rbp),%eax 3b76: ba 00 20 00 00 mov $0x2000,%edx 3b7b: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 3b82: 00 00 00 3b85: 89 c7 mov %eax,%edi 3b87: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 3b8e: 00 00 00 3b91: ff d0 callq *%rax 3b93: 89 45 f8 mov %eax,-0x8(%rbp) if(cc != 2 || buf[0] != 'f'){ 3b96: 83 7d f8 02 cmpl $0x2,-0x8(%rbp) 3b9a: 75 11 jne 3bad <subdir+0x21c> 3b9c: 48 b8 00 8c 00 00 00 movabs $0x8c00,%rax 3ba3: 00 00 00 3ba6: 0f b6 00 movzbl (%rax),%eax 3ba9: 3c 66 cmp $0x66,%al 3bab: 74 16 je 3bc3 <subdir+0x232> failexit("dd/dd/../ff wrong content"); 3bad: 48 bf 08 77 00 00 00 movabs $0x7708,%rdi 3bb4: 00 00 00 3bb7: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3bbe: 00 00 00 3bc1: ff d0 callq *%rax } close(fd); 3bc3: 8b 45 fc mov -0x4(%rbp),%eax 3bc6: 89 c7 mov %eax,%edi 3bc8: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3bcf: 00 00 00 3bd2: ff d0 callq *%rax if(link("dd/dd/ff", "dd/dd/ffff") != 0){ 3bd4: 48 be 22 77 00 00 00 movabs $0x7722,%rsi 3bdb: 00 00 00 3bde: 48 bf cf 76 00 00 00 movabs $0x76cf,%rdi 3be5: 00 00 00 3be8: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 3bef: 00 00 00 3bf2: ff d0 callq *%rax 3bf4: 85 c0 test %eax,%eax 3bf6: 74 16 je 3c0e <subdir+0x27d> failexit("link dd/dd/ff dd/dd/ffff"); 3bf8: 48 bf 2d 77 00 00 00 movabs $0x772d,%rdi 3bff: 00 00 00 3c02: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3c09: 00 00 00 3c0c: ff d0 callq *%rax } if(unlink("dd/dd/ff") != 0){ 3c0e: 48 bf cf 76 00 00 00 movabs $0x76cf,%rdi 3c15: 00 00 00 3c18: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 3c1f: 00 00 00 3c22: ff d0 callq *%rax 3c24: 85 c0 test %eax,%eax 3c26: 74 16 je 3c3e <subdir+0x2ad> failexit("unlink dd/dd/ff"); 3c28: 48 bf 46 77 00 00 00 movabs $0x7746,%rdi 3c2f: 00 00 00 3c32: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3c39: 00 00 00 3c3c: ff d0 callq *%rax } if(open("dd/dd/ff", O_RDONLY) >= 0){ 3c3e: be 00 00 00 00 mov $0x0,%esi 3c43: 48 bf cf 76 00 00 00 movabs $0x76cf,%rdi 3c4a: 00 00 00 3c4d: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3c54: 00 00 00 3c57: ff d0 callq *%rax 3c59: 85 c0 test %eax,%eax 3c5b: 78 16 js 3c73 <subdir+0x2e2> failexit("open (unlinked) dd/dd/ff succeeded"); 3c5d: 48 bf 58 77 00 00 00 movabs $0x7758,%rdi 3c64: 00 00 00 3c67: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3c6e: 00 00 00 3c71: ff d0 callq *%rax } if(chdir("dd") != 0){ 3c73: 48 bf 64 76 00 00 00 movabs $0x7664,%rdi 3c7a: 00 00 00 3c7d: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 3c84: 00 00 00 3c87: ff d0 callq *%rax 3c89: 85 c0 test %eax,%eax 3c8b: 74 16 je 3ca3 <subdir+0x312> failexit("chdir dd"); 3c8d: 48 bf 7b 77 00 00 00 movabs $0x777b,%rdi 3c94: 00 00 00 3c97: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3c9e: 00 00 00 3ca1: ff d0 callq *%rax } if(chdir("dd/../../dd") != 0){ 3ca3: 48 bf 84 77 00 00 00 movabs $0x7784,%rdi 3caa: 00 00 00 3cad: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 3cb4: 00 00 00 3cb7: ff d0 callq *%rax 3cb9: 85 c0 test %eax,%eax 3cbb: 74 16 je 3cd3 <subdir+0x342> failexit("chdir dd/../../dd"); 3cbd: 48 bf 90 77 00 00 00 movabs $0x7790,%rdi 3cc4: 00 00 00 3cc7: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3cce: 00 00 00 3cd1: ff d0 callq *%rax } if(chdir("dd/../../../dd") != 0){ 3cd3: 48 bf a2 77 00 00 00 movabs $0x77a2,%rdi 3cda: 00 00 00 3cdd: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 3ce4: 00 00 00 3ce7: ff d0 callq *%rax 3ce9: 85 c0 test %eax,%eax 3ceb: 74 16 je 3d03 <subdir+0x372> failexit("chdir dd/../../dd"); 3ced: 48 bf 90 77 00 00 00 movabs $0x7790,%rdi 3cf4: 00 00 00 3cf7: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3cfe: 00 00 00 3d01: ff d0 callq *%rax } if(chdir("./..") != 0){ 3d03: 48 bf b1 77 00 00 00 movabs $0x77b1,%rdi 3d0a: 00 00 00 3d0d: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 3d14: 00 00 00 3d17: ff d0 callq *%rax 3d19: 85 c0 test %eax,%eax 3d1b: 74 16 je 3d33 <subdir+0x3a2> failexit("chdir ./.."); 3d1d: 48 bf b6 77 00 00 00 movabs $0x77b6,%rdi 3d24: 00 00 00 3d27: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3d2e: 00 00 00 3d31: ff d0 callq *%rax } fd = open("dd/dd/ffff", 0); 3d33: be 00 00 00 00 mov $0x0,%esi 3d38: 48 bf 22 77 00 00 00 movabs $0x7722,%rdi 3d3f: 00 00 00 3d42: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3d49: 00 00 00 3d4c: ff d0 callq *%rax 3d4e: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 3d51: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 3d55: 79 16 jns 3d6d <subdir+0x3dc> failexit("open dd/dd/ffff"); 3d57: 48 bf c1 77 00 00 00 movabs $0x77c1,%rdi 3d5e: 00 00 00 3d61: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3d68: 00 00 00 3d6b: ff d0 callq *%rax } if(read(fd, buf, sizeof(buf)) != 2){ 3d6d: 8b 45 fc mov -0x4(%rbp),%eax 3d70: ba 00 20 00 00 mov $0x2000,%edx 3d75: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 3d7c: 00 00 00 3d7f: 89 c7 mov %eax,%edi 3d81: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 3d88: 00 00 00 3d8b: ff d0 callq *%rax 3d8d: 83 f8 02 cmp $0x2,%eax 3d90: 74 16 je 3da8 <subdir+0x417> failexit("read dd/dd/ffff wrong len"); 3d92: 48 bf d1 77 00 00 00 movabs $0x77d1,%rdi 3d99: 00 00 00 3d9c: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3da3: 00 00 00 3da6: ff d0 callq *%rax } close(fd); 3da8: 8b 45 fc mov -0x4(%rbp),%eax 3dab: 89 c7 mov %eax,%edi 3dad: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 3db4: 00 00 00 3db7: ff d0 callq *%rax if(open("dd/dd/ff", O_RDONLY) >= 0){ 3db9: be 00 00 00 00 mov $0x0,%esi 3dbe: 48 bf cf 76 00 00 00 movabs $0x76cf,%rdi 3dc5: 00 00 00 3dc8: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3dcf: 00 00 00 3dd2: ff d0 callq *%rax 3dd4: 85 c0 test %eax,%eax 3dd6: 78 16 js 3dee <subdir+0x45d> failexit("open (unlinked) dd/dd/ff succeeded"); 3dd8: 48 bf 58 77 00 00 00 movabs $0x7758,%rdi 3ddf: 00 00 00 3de2: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3de9: 00 00 00 3dec: ff d0 callq *%rax } if(open("dd/ff/ff", O_CREATE|O_RDWR) >= 0){ 3dee: be 02 02 00 00 mov $0x202,%esi 3df3: 48 bf eb 77 00 00 00 movabs $0x77eb,%rdi 3dfa: 00 00 00 3dfd: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3e04: 00 00 00 3e07: ff d0 callq *%rax 3e09: 85 c0 test %eax,%eax 3e0b: 78 16 js 3e23 <subdir+0x492> failexit("create dd/ff/ff succeeded"); 3e0d: 48 bf f4 77 00 00 00 movabs $0x77f4,%rdi 3e14: 00 00 00 3e17: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3e1e: 00 00 00 3e21: ff d0 callq *%rax } if(open("dd/xx/ff", O_CREATE|O_RDWR) >= 0){ 3e23: be 02 02 00 00 mov $0x202,%esi 3e28: 48 bf 0e 78 00 00 00 movabs $0x780e,%rdi 3e2f: 00 00 00 3e32: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3e39: 00 00 00 3e3c: ff d0 callq *%rax 3e3e: 85 c0 test %eax,%eax 3e40: 78 16 js 3e58 <subdir+0x4c7> failexit("create dd/xx/ff succeeded"); 3e42: 48 bf 17 78 00 00 00 movabs $0x7817,%rdi 3e49: 00 00 00 3e4c: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3e53: 00 00 00 3e56: ff d0 callq *%rax } if(open("dd", O_CREATE) >= 0){ 3e58: be 00 02 00 00 mov $0x200,%esi 3e5d: 48 bf 64 76 00 00 00 movabs $0x7664,%rdi 3e64: 00 00 00 3e67: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3e6e: 00 00 00 3e71: ff d0 callq *%rax 3e73: 85 c0 test %eax,%eax 3e75: 78 16 js 3e8d <subdir+0x4fc> failexit("create dd succeeded"); 3e77: 48 bf 31 78 00 00 00 movabs $0x7831,%rdi 3e7e: 00 00 00 3e81: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3e88: 00 00 00 3e8b: ff d0 callq *%rax } if(open("dd", O_RDWR) >= 0){ 3e8d: be 02 00 00 00 mov $0x2,%esi 3e92: 48 bf 64 76 00 00 00 movabs $0x7664,%rdi 3e99: 00 00 00 3e9c: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3ea3: 00 00 00 3ea6: ff d0 callq *%rax 3ea8: 85 c0 test %eax,%eax 3eaa: 78 16 js 3ec2 <subdir+0x531> failexit("open dd rdwr succeeded"); 3eac: 48 bf 45 78 00 00 00 movabs $0x7845,%rdi 3eb3: 00 00 00 3eb6: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3ebd: 00 00 00 3ec0: ff d0 callq *%rax } if(open("dd", O_WRONLY) >= 0){ 3ec2: be 01 00 00 00 mov $0x1,%esi 3ec7: 48 bf 64 76 00 00 00 movabs $0x7664,%rdi 3ece: 00 00 00 3ed1: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 3ed8: 00 00 00 3edb: ff d0 callq *%rax 3edd: 85 c0 test %eax,%eax 3edf: 78 16 js 3ef7 <subdir+0x566> failexit("open dd wronly succeeded"); 3ee1: 48 bf 5c 78 00 00 00 movabs $0x785c,%rdi 3ee8: 00 00 00 3eeb: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3ef2: 00 00 00 3ef5: ff d0 callq *%rax } if(link("dd/ff/ff", "dd/dd/xx") == 0){ 3ef7: 48 be 75 78 00 00 00 movabs $0x7875,%rsi 3efe: 00 00 00 3f01: 48 bf eb 77 00 00 00 movabs $0x77eb,%rdi 3f08: 00 00 00 3f0b: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 3f12: 00 00 00 3f15: ff d0 callq *%rax 3f17: 85 c0 test %eax,%eax 3f19: 75 16 jne 3f31 <subdir+0x5a0> failexit("link dd/ff/ff dd/dd/xx succeeded"); 3f1b: 48 bf 80 78 00 00 00 movabs $0x7880,%rdi 3f22: 00 00 00 3f25: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3f2c: 00 00 00 3f2f: ff d0 callq *%rax } if(link("dd/xx/ff", "dd/dd/xx") == 0){ 3f31: 48 be 75 78 00 00 00 movabs $0x7875,%rsi 3f38: 00 00 00 3f3b: 48 bf 0e 78 00 00 00 movabs $0x780e,%rdi 3f42: 00 00 00 3f45: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 3f4c: 00 00 00 3f4f: ff d0 callq *%rax 3f51: 85 c0 test %eax,%eax 3f53: 75 16 jne 3f6b <subdir+0x5da> failexit("link dd/xx/ff dd/dd/xx succeededn"); 3f55: 48 bf a8 78 00 00 00 movabs $0x78a8,%rdi 3f5c: 00 00 00 3f5f: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3f66: 00 00 00 3f69: ff d0 callq *%rax } if(link("dd/ff", "dd/dd/ffff") == 0){ 3f6b: 48 be 22 77 00 00 00 movabs $0x7722,%rsi 3f72: 00 00 00 3f75: 48 bf 77 76 00 00 00 movabs $0x7677,%rdi 3f7c: 00 00 00 3f7f: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 3f86: 00 00 00 3f89: ff d0 callq *%rax 3f8b: 85 c0 test %eax,%eax 3f8d: 75 16 jne 3fa5 <subdir+0x614> failexit("link dd/ff dd/dd/ffff succeeded"); 3f8f: 48 bf d0 78 00 00 00 movabs $0x78d0,%rdi 3f96: 00 00 00 3f99: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3fa0: 00 00 00 3fa3: ff d0 callq *%rax } if(mkdir("dd/ff/ff") == 0){ 3fa5: 48 bf eb 77 00 00 00 movabs $0x77eb,%rdi 3fac: 00 00 00 3faf: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 3fb6: 00 00 00 3fb9: ff d0 callq *%rax 3fbb: 85 c0 test %eax,%eax 3fbd: 75 16 jne 3fd5 <subdir+0x644> failexit("mkdir dd/ff/ff succeeded"); 3fbf: 48 bf f0 78 00 00 00 movabs $0x78f0,%rdi 3fc6: 00 00 00 3fc9: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 3fd0: 00 00 00 3fd3: ff d0 callq *%rax } if(mkdir("dd/xx/ff") == 0){ 3fd5: 48 bf 0e 78 00 00 00 movabs $0x780e,%rdi 3fdc: 00 00 00 3fdf: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 3fe6: 00 00 00 3fe9: ff d0 callq *%rax 3feb: 85 c0 test %eax,%eax 3fed: 75 16 jne 4005 <subdir+0x674> failexit("mkdir dd/xx/ff succeeded"); 3fef: 48 bf 09 79 00 00 00 movabs $0x7909,%rdi 3ff6: 00 00 00 3ff9: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4000: 00 00 00 4003: ff d0 callq *%rax } if(mkdir("dd/dd/ffff") == 0){ 4005: 48 bf 22 77 00 00 00 movabs $0x7722,%rdi 400c: 00 00 00 400f: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 4016: 00 00 00 4019: ff d0 callq *%rax 401b: 85 c0 test %eax,%eax 401d: 75 16 jne 4035 <subdir+0x6a4> failexit("mkdir dd/dd/ffff succeeded"); 401f: 48 bf 22 79 00 00 00 movabs $0x7922,%rdi 4026: 00 00 00 4029: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4030: 00 00 00 4033: ff d0 callq *%rax } if(unlink("dd/xx/ff") == 0){ 4035: 48 bf 0e 78 00 00 00 movabs $0x780e,%rdi 403c: 00 00 00 403f: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4046: 00 00 00 4049: ff d0 callq *%rax 404b: 85 c0 test %eax,%eax 404d: 75 16 jne 4065 <subdir+0x6d4> failexit("unlink dd/xx/ff succeeded"); 404f: 48 bf 3d 79 00 00 00 movabs $0x793d,%rdi 4056: 00 00 00 4059: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4060: 00 00 00 4063: ff d0 callq *%rax } if(unlink("dd/ff/ff") == 0){ 4065: 48 bf eb 77 00 00 00 movabs $0x77eb,%rdi 406c: 00 00 00 406f: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4076: 00 00 00 4079: ff d0 callq *%rax 407b: 85 c0 test %eax,%eax 407d: 75 16 jne 4095 <subdir+0x704> failexit("unlink dd/ff/ff succeeded"); 407f: 48 bf 57 79 00 00 00 movabs $0x7957,%rdi 4086: 00 00 00 4089: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4090: 00 00 00 4093: ff d0 callq *%rax } if(chdir("dd/ff") == 0){ 4095: 48 bf 77 76 00 00 00 movabs $0x7677,%rdi 409c: 00 00 00 409f: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 40a6: 00 00 00 40a9: ff d0 callq *%rax 40ab: 85 c0 test %eax,%eax 40ad: 75 16 jne 40c5 <subdir+0x734> failexit("chdir dd/ff succeeded"); 40af: 48 bf 71 79 00 00 00 movabs $0x7971,%rdi 40b6: 00 00 00 40b9: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 40c0: 00 00 00 40c3: ff d0 callq *%rax } if(chdir("dd/xx") == 0){ 40c5: 48 bf 87 79 00 00 00 movabs $0x7987,%rdi 40cc: 00 00 00 40cf: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 40d6: 00 00 00 40d9: ff d0 callq *%rax 40db: 85 c0 test %eax,%eax 40dd: 75 16 jne 40f5 <subdir+0x764> failexit("chdir dd/xx succeeded"); 40df: 48 bf 8d 79 00 00 00 movabs $0x798d,%rdi 40e6: 00 00 00 40e9: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 40f0: 00 00 00 40f3: ff d0 callq *%rax } if(unlink("dd/dd/ffff") != 0){ 40f5: 48 bf 22 77 00 00 00 movabs $0x7722,%rdi 40fc: 00 00 00 40ff: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4106: 00 00 00 4109: ff d0 callq *%rax 410b: 85 c0 test %eax,%eax 410d: 74 16 je 4125 <subdir+0x794> failexit("unlink dd/dd/ff"); 410f: 48 bf 46 77 00 00 00 movabs $0x7746,%rdi 4116: 00 00 00 4119: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4120: 00 00 00 4123: ff d0 callq *%rax } if(unlink("dd/ff") != 0){ 4125: 48 bf 77 76 00 00 00 movabs $0x7677,%rdi 412c: 00 00 00 412f: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4136: 00 00 00 4139: ff d0 callq *%rax 413b: 85 c0 test %eax,%eax 413d: 74 16 je 4155 <subdir+0x7c4> failexit("unlink dd/ff"); 413f: 48 bf a3 79 00 00 00 movabs $0x79a3,%rdi 4146: 00 00 00 4149: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4150: 00 00 00 4153: ff d0 callq *%rax } if(unlink("dd") == 0){ 4155: 48 bf 64 76 00 00 00 movabs $0x7664,%rdi 415c: 00 00 00 415f: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4166: 00 00 00 4169: ff d0 callq *%rax 416b: 85 c0 test %eax,%eax 416d: 75 16 jne 4185 <subdir+0x7f4> failexit("unlink non-empty dd succeeded"); 416f: 48 bf b0 79 00 00 00 movabs $0x79b0,%rdi 4176: 00 00 00 4179: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4180: 00 00 00 4183: ff d0 callq *%rax } if(unlink("dd/dd") < 0){ 4185: 48 bf ce 79 00 00 00 movabs $0x79ce,%rdi 418c: 00 00 00 418f: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4196: 00 00 00 4199: ff d0 callq *%rax 419b: 85 c0 test %eax,%eax 419d: 79 16 jns 41b5 <subdir+0x824> failexit("unlink dd/dd"); 419f: 48 bf d4 79 00 00 00 movabs $0x79d4,%rdi 41a6: 00 00 00 41a9: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 41b0: 00 00 00 41b3: ff d0 callq *%rax } if(unlink("dd") < 0){ 41b5: 48 bf 64 76 00 00 00 movabs $0x7664,%rdi 41bc: 00 00 00 41bf: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 41c6: 00 00 00 41c9: ff d0 callq *%rax 41cb: 85 c0 test %eax,%eax 41cd: 79 16 jns 41e5 <subdir+0x854> failexit("unlink dd"); 41cf: 48 bf e1 79 00 00 00 movabs $0x79e1,%rdi 41d6: 00 00 00 41d9: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 41e0: 00 00 00 41e3: ff d0 callq *%rax } printf(1, "subdir ok\n"); 41e5: 48 be eb 79 00 00 00 movabs $0x79eb,%rsi 41ec: 00 00 00 41ef: bf 01 00 00 00 mov $0x1,%edi 41f4: b8 00 00 00 00 mov $0x0,%eax 41f9: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4200: 00 00 00 4203: ff d2 callq *%rdx } 4205: 90 nop 4206: c9 leaveq 4207: c3 retq 0000000000004208 <bigwrite>: // test writes that are larger than the log. void bigwrite(void) { 4208: f3 0f 1e fa endbr64 420c: 55 push %rbp 420d: 48 89 e5 mov %rsp,%rbp 4210: 48 83 ec 10 sub $0x10,%rsp int fd, sz; printf(1, "bigwrite test\n"); 4214: 48 be f6 79 00 00 00 movabs $0x79f6,%rsi 421b: 00 00 00 421e: bf 01 00 00 00 mov $0x1,%edi 4223: b8 00 00 00 00 mov $0x0,%eax 4228: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 422f: 00 00 00 4232: ff d2 callq *%rdx unlink("bigwrite"); 4234: 48 bf 05 7a 00 00 00 movabs $0x7a05,%rdi 423b: 00 00 00 423e: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4245: 00 00 00 4248: ff d0 callq *%rax for(sz = 499; sz < 12*512; sz += 471){ 424a: c7 45 fc f3 01 00 00 movl $0x1f3,-0x4(%rbp) 4251: e9 db 00 00 00 jmpq 4331 <bigwrite+0x129> fd = open("bigwrite", O_CREATE | O_RDWR); 4256: be 02 02 00 00 mov $0x202,%esi 425b: 48 bf 05 7a 00 00 00 movabs $0x7a05,%rdi 4262: 00 00 00 4265: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 426c: 00 00 00 426f: ff d0 callq *%rax 4271: 89 45 f4 mov %eax,-0xc(%rbp) if(fd < 0){ 4274: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 4278: 79 16 jns 4290 <bigwrite+0x88> failexit("cannot create bigwrite"); 427a: 48 bf 0e 7a 00 00 00 movabs $0x7a0e,%rdi 4281: 00 00 00 4284: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 428b: 00 00 00 428e: ff d0 callq *%rax } int i; for(i = 0; i < 2; i++){ 4290: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) 4297: eb 64 jmp 42fd <bigwrite+0xf5> int cc = write(fd, buf, sz); 4299: 8b 55 fc mov -0x4(%rbp),%edx 429c: 8b 45 f4 mov -0xc(%rbp),%eax 429f: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 42a6: 00 00 00 42a9: 89 c7 mov %eax,%edi 42ab: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 42b2: 00 00 00 42b5: ff d0 callq *%rax 42b7: 89 45 f0 mov %eax,-0x10(%rbp) if(cc != sz){ 42ba: 8b 45 f0 mov -0x10(%rbp),%eax 42bd: 3b 45 fc cmp -0x4(%rbp),%eax 42c0: 74 37 je 42f9 <bigwrite+0xf1> printf(1, "write(%d) ret %d\n", sz, cc); 42c2: 8b 55 f0 mov -0x10(%rbp),%edx 42c5: 8b 45 fc mov -0x4(%rbp),%eax 42c8: 89 d1 mov %edx,%ecx 42ca: 89 c2 mov %eax,%edx 42cc: 48 be 25 7a 00 00 00 movabs $0x7a25,%rsi 42d3: 00 00 00 42d6: bf 01 00 00 00 mov $0x1,%edi 42db: b8 00 00 00 00 mov $0x0,%eax 42e0: 49 b8 04 66 00 00 00 movabs $0x6604,%r8 42e7: 00 00 00 42ea: 41 ff d0 callq *%r8 exit(); 42ed: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 42f4: 00 00 00 42f7: ff d0 callq *%rax for(i = 0; i < 2; i++){ 42f9: 83 45 f8 01 addl $0x1,-0x8(%rbp) 42fd: 83 7d f8 01 cmpl $0x1,-0x8(%rbp) 4301: 7e 96 jle 4299 <bigwrite+0x91> } } close(fd); 4303: 8b 45 f4 mov -0xc(%rbp),%eax 4306: 89 c7 mov %eax,%edi 4308: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 430f: 00 00 00 4312: ff d0 callq *%rax unlink("bigwrite"); 4314: 48 bf 05 7a 00 00 00 movabs $0x7a05,%rdi 431b: 00 00 00 431e: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4325: 00 00 00 4328: ff d0 callq *%rax for(sz = 499; sz < 12*512; sz += 471){ 432a: 81 45 fc d7 01 00 00 addl $0x1d7,-0x4(%rbp) 4331: 81 7d fc ff 17 00 00 cmpl $0x17ff,-0x4(%rbp) 4338: 0f 8e 18 ff ff ff jle 4256 <bigwrite+0x4e> } printf(1, "bigwrite ok\n"); 433e: 48 be 37 7a 00 00 00 movabs $0x7a37,%rsi 4345: 00 00 00 4348: bf 01 00 00 00 mov $0x1,%edi 434d: b8 00 00 00 00 mov $0x0,%eax 4352: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4359: 00 00 00 435c: ff d2 callq *%rdx } 435e: 90 nop 435f: c9 leaveq 4360: c3 retq 0000000000004361 <bigfile>: void bigfile(void) { 4361: f3 0f 1e fa endbr64 4365: 55 push %rbp 4366: 48 89 e5 mov %rsp,%rbp 4369: 48 83 ec 10 sub $0x10,%rsp int fd, i, total, cc; printf(1, "bigfile test\n"); 436d: 48 be 44 7a 00 00 00 movabs $0x7a44,%rsi 4374: 00 00 00 4377: bf 01 00 00 00 mov $0x1,%edi 437c: b8 00 00 00 00 mov $0x0,%eax 4381: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4388: 00 00 00 438b: ff d2 callq *%rdx unlink("bigfile"); 438d: 48 bf 52 7a 00 00 00 movabs $0x7a52,%rdi 4394: 00 00 00 4397: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 439e: 00 00 00 43a1: ff d0 callq *%rax fd = open("bigfile", O_CREATE | O_RDWR); 43a3: be 02 02 00 00 mov $0x202,%esi 43a8: 48 bf 52 7a 00 00 00 movabs $0x7a52,%rdi 43af: 00 00 00 43b2: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 43b9: 00 00 00 43bc: ff d0 callq *%rax 43be: 89 45 f4 mov %eax,-0xc(%rbp) if(fd < 0){ 43c1: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 43c5: 79 16 jns 43dd <bigfile+0x7c> failexit("cannot create bigfile"); 43c7: 48 bf 5a 7a 00 00 00 movabs $0x7a5a,%rdi 43ce: 00 00 00 43d1: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 43d8: 00 00 00 43db: ff d0 callq *%rax } for(i = 0; i < 20; i++){ 43dd: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 43e4: eb 61 jmp 4447 <bigfile+0xe6> memset(buf, i, 600); 43e6: 8b 45 fc mov -0x4(%rbp),%eax 43e9: ba 58 02 00 00 mov $0x258,%edx 43ee: 89 c6 mov %eax,%esi 43f0: 48 bf 00 8c 00 00 00 movabs $0x8c00,%rdi 43f7: 00 00 00 43fa: 48 b8 d8 60 00 00 00 movabs $0x60d8,%rax 4401: 00 00 00 4404: ff d0 callq *%rax if(write(fd, buf, 600) != 600){ 4406: 8b 45 f4 mov -0xc(%rbp),%eax 4409: ba 58 02 00 00 mov $0x258,%edx 440e: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 4415: 00 00 00 4418: 89 c7 mov %eax,%edi 441a: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 4421: 00 00 00 4424: ff d0 callq *%rax 4426: 3d 58 02 00 00 cmp $0x258,%eax 442b: 74 16 je 4443 <bigfile+0xe2> failexit("write bigfile"); 442d: 48 bf 70 7a 00 00 00 movabs $0x7a70,%rdi 4434: 00 00 00 4437: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 443e: 00 00 00 4441: ff d0 callq *%rax for(i = 0; i < 20; i++){ 4443: 83 45 fc 01 addl $0x1,-0x4(%rbp) 4447: 83 7d fc 13 cmpl $0x13,-0x4(%rbp) 444b: 7e 99 jle 43e6 <bigfile+0x85> } } close(fd); 444d: 8b 45 f4 mov -0xc(%rbp),%eax 4450: 89 c7 mov %eax,%edi 4452: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 4459: 00 00 00 445c: ff d0 callq *%rax fd = open("bigfile", 0); 445e: be 00 00 00 00 mov $0x0,%esi 4463: 48 bf 52 7a 00 00 00 movabs $0x7a52,%rdi 446a: 00 00 00 446d: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4474: 00 00 00 4477: ff d0 callq *%rax 4479: 89 45 f4 mov %eax,-0xc(%rbp) if(fd < 0){ 447c: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 4480: 79 16 jns 4498 <bigfile+0x137> failexit("cannot open bigfile"); 4482: 48 bf 7e 7a 00 00 00 movabs $0x7a7e,%rdi 4489: 00 00 00 448c: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4493: 00 00 00 4496: ff d0 callq *%rax } total = 0; 4498: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) for(i = 0; ; i++){ 449f: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) cc = read(fd, buf, 300); 44a6: 8b 45 f4 mov -0xc(%rbp),%eax 44a9: ba 2c 01 00 00 mov $0x12c,%edx 44ae: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 44b5: 00 00 00 44b8: 89 c7 mov %eax,%edi 44ba: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 44c1: 00 00 00 44c4: ff d0 callq *%rax 44c6: 89 45 f0 mov %eax,-0x10(%rbp) if(cc < 0){ 44c9: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 44cd: 79 16 jns 44e5 <bigfile+0x184> failexit("read bigfile"); 44cf: 48 bf 92 7a 00 00 00 movabs $0x7a92,%rdi 44d6: 00 00 00 44d9: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 44e0: 00 00 00 44e3: ff d0 callq *%rax } if(cc == 0) 44e5: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 44e9: 0f 84 88 00 00 00 je 4577 <bigfile+0x216> break; if(cc != 300){ 44ef: 81 7d f0 2c 01 00 00 cmpl $0x12c,-0x10(%rbp) 44f6: 74 16 je 450e <bigfile+0x1ad> failexit("short read bigfile"); 44f8: 48 bf 9f 7a 00 00 00 movabs $0x7a9f,%rdi 44ff: 00 00 00 4502: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4509: 00 00 00 450c: ff d0 callq *%rax } if(buf[0] != i/2 || buf[299] != i/2){ 450e: 48 b8 00 8c 00 00 00 movabs $0x8c00,%rax 4515: 00 00 00 4518: 0f b6 00 movzbl (%rax),%eax 451b: 0f be d0 movsbl %al,%edx 451e: 8b 45 fc mov -0x4(%rbp),%eax 4521: 89 c1 mov %eax,%ecx 4523: c1 e9 1f shr $0x1f,%ecx 4526: 01 c8 add %ecx,%eax 4528: d1 f8 sar %eax 452a: 39 c2 cmp %eax,%edx 452c: 75 24 jne 4552 <bigfile+0x1f1> 452e: 48 b8 00 8c 00 00 00 movabs $0x8c00,%rax 4535: 00 00 00 4538: 0f b6 80 2b 01 00 00 movzbl 0x12b(%rax),%eax 453f: 0f be d0 movsbl %al,%edx 4542: 8b 45 fc mov -0x4(%rbp),%eax 4545: 89 c1 mov %eax,%ecx 4547: c1 e9 1f shr $0x1f,%ecx 454a: 01 c8 add %ecx,%eax 454c: d1 f8 sar %eax 454e: 39 c2 cmp %eax,%edx 4550: 74 16 je 4568 <bigfile+0x207> failexit("read bigfile wrong data"); 4552: 48 bf b2 7a 00 00 00 movabs $0x7ab2,%rdi 4559: 00 00 00 455c: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4563: 00 00 00 4566: ff d0 callq *%rax } total += cc; 4568: 8b 45 f0 mov -0x10(%rbp),%eax 456b: 01 45 f8 add %eax,-0x8(%rbp) for(i = 0; ; i++){ 456e: 83 45 fc 01 addl $0x1,-0x4(%rbp) cc = read(fd, buf, 300); 4572: e9 2f ff ff ff jmpq 44a6 <bigfile+0x145> break; 4577: 90 nop } close(fd); 4578: 8b 45 f4 mov -0xc(%rbp),%eax 457b: 89 c7 mov %eax,%edi 457d: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 4584: 00 00 00 4587: ff d0 callq *%rax if(total != 20*600){ 4589: 81 7d f8 e0 2e 00 00 cmpl $0x2ee0,-0x8(%rbp) 4590: 74 16 je 45a8 <bigfile+0x247> failexit("read bigfile wrong total"); 4592: 48 bf ca 7a 00 00 00 movabs $0x7aca,%rdi 4599: 00 00 00 459c: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 45a3: 00 00 00 45a6: ff d0 callq *%rax } unlink("bigfile"); 45a8: 48 bf 52 7a 00 00 00 movabs $0x7a52,%rdi 45af: 00 00 00 45b2: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 45b9: 00 00 00 45bc: ff d0 callq *%rax printf(1, "bigfile test ok\n"); 45be: 48 be e3 7a 00 00 00 movabs $0x7ae3,%rsi 45c5: 00 00 00 45c8: bf 01 00 00 00 mov $0x1,%edi 45cd: b8 00 00 00 00 mov $0x0,%eax 45d2: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 45d9: 00 00 00 45dc: ff d2 callq *%rdx } 45de: 90 nop 45df: c9 leaveq 45e0: c3 retq 00000000000045e1 <fourteen>: void fourteen(void) { 45e1: f3 0f 1e fa endbr64 45e5: 55 push %rbp 45e6: 48 89 e5 mov %rsp,%rbp 45e9: 48 83 ec 10 sub $0x10,%rsp int fd; // DIRSIZ is 14. printf(1, "fourteen test\n"); 45ed: 48 be f4 7a 00 00 00 movabs $0x7af4,%rsi 45f4: 00 00 00 45f7: bf 01 00 00 00 mov $0x1,%edi 45fc: b8 00 00 00 00 mov $0x0,%eax 4601: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4608: 00 00 00 460b: ff d2 callq *%rdx if(mkdir("12345678901234") != 0){ 460d: 48 bf 03 7b 00 00 00 movabs $0x7b03,%rdi 4614: 00 00 00 4617: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 461e: 00 00 00 4621: ff d0 callq *%rax 4623: 85 c0 test %eax,%eax 4625: 74 16 je 463d <fourteen+0x5c> failexit("mkdir 12345678901234"); 4627: 48 bf 12 7b 00 00 00 movabs $0x7b12,%rdi 462e: 00 00 00 4631: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4638: 00 00 00 463b: ff d0 callq *%rax } if(mkdir("12345678901234/123456789012345") != 0){ 463d: 48 bf 28 7b 00 00 00 movabs $0x7b28,%rdi 4644: 00 00 00 4647: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 464e: 00 00 00 4651: ff d0 callq *%rax 4653: 85 c0 test %eax,%eax 4655: 74 16 je 466d <fourteen+0x8c> failexit("mkdir 12345678901234/123456789012345"); 4657: 48 bf 48 7b 00 00 00 movabs $0x7b48,%rdi 465e: 00 00 00 4661: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4668: 00 00 00 466b: ff d0 callq *%rax } fd = open("123456789012345/123456789012345/123456789012345", O_CREATE); 466d: be 00 02 00 00 mov $0x200,%esi 4672: 48 bf 70 7b 00 00 00 movabs $0x7b70,%rdi 4679: 00 00 00 467c: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4683: 00 00 00 4686: ff d0 callq *%rax 4688: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 468b: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 468f: 79 16 jns 46a7 <fourteen+0xc6> failexit("create 123456789012345/123456789012345/123456789012345"); 4691: 48 bf a0 7b 00 00 00 movabs $0x7ba0,%rdi 4698: 00 00 00 469b: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 46a2: 00 00 00 46a5: ff d0 callq *%rax } close(fd); 46a7: 8b 45 fc mov -0x4(%rbp),%eax 46aa: 89 c7 mov %eax,%edi 46ac: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 46b3: 00 00 00 46b6: ff d0 callq *%rax fd = open("12345678901234/12345678901234/12345678901234", 0); 46b8: be 00 00 00 00 mov $0x0,%esi 46bd: 48 bf d8 7b 00 00 00 movabs $0x7bd8,%rdi 46c4: 00 00 00 46c7: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 46ce: 00 00 00 46d1: ff d0 callq *%rax 46d3: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 46d6: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 46da: 79 16 jns 46f2 <fourteen+0x111> failexit("open 12345678901234/12345678901234/12345678901234"); 46dc: 48 bf 08 7c 00 00 00 movabs $0x7c08,%rdi 46e3: 00 00 00 46e6: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 46ed: 00 00 00 46f0: ff d0 callq *%rax } close(fd); 46f2: 8b 45 fc mov -0x4(%rbp),%eax 46f5: 89 c7 mov %eax,%edi 46f7: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 46fe: 00 00 00 4701: ff d0 callq *%rax if(mkdir("12345678901234/12345678901234") == 0){ 4703: 48 bf 3a 7c 00 00 00 movabs $0x7c3a,%rdi 470a: 00 00 00 470d: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 4714: 00 00 00 4717: ff d0 callq *%rax 4719: 85 c0 test %eax,%eax 471b: 75 16 jne 4733 <fourteen+0x152> failexit("mkdir 12345678901234/12345678901234 succeeded"); 471d: 48 bf 58 7c 00 00 00 movabs $0x7c58,%rdi 4724: 00 00 00 4727: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 472e: 00 00 00 4731: ff d0 callq *%rax } if(mkdir("123456789012345/12345678901234") == 0){ 4733: 48 bf 88 7c 00 00 00 movabs $0x7c88,%rdi 473a: 00 00 00 473d: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 4744: 00 00 00 4747: ff d0 callq *%rax 4749: 85 c0 test %eax,%eax 474b: 75 16 jne 4763 <fourteen+0x182> failexit("mkdir 12345678901234/123456789012345 succeeded"); 474d: 48 bf a8 7c 00 00 00 movabs $0x7ca8,%rdi 4754: 00 00 00 4757: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 475e: 00 00 00 4761: ff d0 callq *%rax } printf(1, "fourteen ok\n"); 4763: 48 be d7 7c 00 00 00 movabs $0x7cd7,%rsi 476a: 00 00 00 476d: bf 01 00 00 00 mov $0x1,%edi 4772: b8 00 00 00 00 mov $0x0,%eax 4777: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 477e: 00 00 00 4781: ff d2 callq *%rdx } 4783: 90 nop 4784: c9 leaveq 4785: c3 retq 0000000000004786 <rmdot>: void rmdot(void) { 4786: f3 0f 1e fa endbr64 478a: 55 push %rbp 478b: 48 89 e5 mov %rsp,%rbp printf(1, "rmdot test\n"); 478e: 48 be e4 7c 00 00 00 movabs $0x7ce4,%rsi 4795: 00 00 00 4798: bf 01 00 00 00 mov $0x1,%edi 479d: b8 00 00 00 00 mov $0x0,%eax 47a2: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 47a9: 00 00 00 47ac: ff d2 callq *%rdx if(mkdir("dots") != 0){ 47ae: 48 bf f0 7c 00 00 00 movabs $0x7cf0,%rdi 47b5: 00 00 00 47b8: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 47bf: 00 00 00 47c2: ff d0 callq *%rax 47c4: 85 c0 test %eax,%eax 47c6: 74 16 je 47de <rmdot+0x58> failexit("mkdir dots"); 47c8: 48 bf f5 7c 00 00 00 movabs $0x7cf5,%rdi 47cf: 00 00 00 47d2: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 47d9: 00 00 00 47dc: ff d0 callq *%rax } if(chdir("dots") != 0){ 47de: 48 bf f0 7c 00 00 00 movabs $0x7cf0,%rdi 47e5: 00 00 00 47e8: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 47ef: 00 00 00 47f2: ff d0 callq *%rax 47f4: 85 c0 test %eax,%eax 47f6: 74 16 je 480e <rmdot+0x88> failexit("chdir dots"); 47f8: 48 bf 00 7d 00 00 00 movabs $0x7d00,%rdi 47ff: 00 00 00 4802: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4809: 00 00 00 480c: ff d0 callq *%rax } if(unlink(".") == 0){ 480e: 48 bf 12 75 00 00 00 movabs $0x7512,%rdi 4815: 00 00 00 4818: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 481f: 00 00 00 4822: ff d0 callq *%rax 4824: 85 c0 test %eax,%eax 4826: 75 16 jne 483e <rmdot+0xb8> failexit("rm . worked"); 4828: 48 bf 0b 7d 00 00 00 movabs $0x7d0b,%rdi 482f: 00 00 00 4832: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4839: 00 00 00 483c: ff d0 callq *%rax } if(unlink("..") == 0){ 483e: 48 bf 8a 70 00 00 00 movabs $0x708a,%rdi 4845: 00 00 00 4848: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 484f: 00 00 00 4852: ff d0 callq *%rax 4854: 85 c0 test %eax,%eax 4856: 75 16 jne 486e <rmdot+0xe8> failexit("rm .. worked"); 4858: 48 bf 17 7d 00 00 00 movabs $0x7d17,%rdi 485f: 00 00 00 4862: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4869: 00 00 00 486c: ff d0 callq *%rax } if(chdir("/") != 0){ 486e: 48 bf 80 6d 00 00 00 movabs $0x6d80,%rdi 4875: 00 00 00 4878: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 487f: 00 00 00 4882: ff d0 callq *%rax 4884: 85 c0 test %eax,%eax 4886: 74 16 je 489e <rmdot+0x118> failexit("chdir /"); 4888: 48 bf 82 6d 00 00 00 movabs $0x6d82,%rdi 488f: 00 00 00 4892: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4899: 00 00 00 489c: ff d0 callq *%rax } if(unlink("dots/.") == 0){ 489e: 48 bf 24 7d 00 00 00 movabs $0x7d24,%rdi 48a5: 00 00 00 48a8: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 48af: 00 00 00 48b2: ff d0 callq *%rax 48b4: 85 c0 test %eax,%eax 48b6: 75 16 jne 48ce <rmdot+0x148> failexit("unlink dots/. worked"); 48b8: 48 bf 2b 7d 00 00 00 movabs $0x7d2b,%rdi 48bf: 00 00 00 48c2: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 48c9: 00 00 00 48cc: ff d0 callq *%rax } if(unlink("dots/..") == 0){ 48ce: 48 bf 40 7d 00 00 00 movabs $0x7d40,%rdi 48d5: 00 00 00 48d8: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 48df: 00 00 00 48e2: ff d0 callq *%rax 48e4: 85 c0 test %eax,%eax 48e6: 75 16 jne 48fe <rmdot+0x178> failexit("unlink dots/.. worked"); 48e8: 48 bf 48 7d 00 00 00 movabs $0x7d48,%rdi 48ef: 00 00 00 48f2: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 48f9: 00 00 00 48fc: ff d0 callq *%rax } if(unlink("dots") != 0){ 48fe: 48 bf f0 7c 00 00 00 movabs $0x7cf0,%rdi 4905: 00 00 00 4908: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 490f: 00 00 00 4912: ff d0 callq *%rax 4914: 85 c0 test %eax,%eax 4916: 74 16 je 492e <rmdot+0x1a8> failexit("unlink dots"); 4918: 48 bf 5e 7d 00 00 00 movabs $0x7d5e,%rdi 491f: 00 00 00 4922: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4929: 00 00 00 492c: ff d0 callq *%rax } printf(1, "rmdot ok\n"); 492e: 48 be 6a 7d 00 00 00 movabs $0x7d6a,%rsi 4935: 00 00 00 4938: bf 01 00 00 00 mov $0x1,%edi 493d: b8 00 00 00 00 mov $0x0,%eax 4942: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4949: 00 00 00 494c: ff d2 callq *%rdx } 494e: 90 nop 494f: 5d pop %rbp 4950: c3 retq 0000000000004951 <dirfile>: void dirfile(void) { 4951: f3 0f 1e fa endbr64 4955: 55 push %rbp 4956: 48 89 e5 mov %rsp,%rbp 4959: 48 83 ec 10 sub $0x10,%rsp int fd; printf(1, "dir vs file\n"); 495d: 48 be 74 7d 00 00 00 movabs $0x7d74,%rsi 4964: 00 00 00 4967: bf 01 00 00 00 mov $0x1,%edi 496c: b8 00 00 00 00 mov $0x0,%eax 4971: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4978: 00 00 00 497b: ff d2 callq *%rdx fd = open("dirfile", O_CREATE); 497d: be 00 02 00 00 mov $0x200,%esi 4982: 48 bf 81 7d 00 00 00 movabs $0x7d81,%rdi 4989: 00 00 00 498c: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4993: 00 00 00 4996: ff d0 callq *%rax 4998: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0){ 499b: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 499f: 79 16 jns 49b7 <dirfile+0x66> failexit("create dirfile"); 49a1: 48 bf 89 7d 00 00 00 movabs $0x7d89,%rdi 49a8: 00 00 00 49ab: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 49b2: 00 00 00 49b5: ff d0 callq *%rax } close(fd); 49b7: 8b 45 fc mov -0x4(%rbp),%eax 49ba: 89 c7 mov %eax,%edi 49bc: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 49c3: 00 00 00 49c6: ff d0 callq *%rax if(chdir("dirfile") == 0){ 49c8: 48 bf 81 7d 00 00 00 movabs $0x7d81,%rdi 49cf: 00 00 00 49d2: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 49d9: 00 00 00 49dc: ff d0 callq *%rax 49de: 85 c0 test %eax,%eax 49e0: 75 16 jne 49f8 <dirfile+0xa7> failexit("chdir dirfile succeeded"); 49e2: 48 bf 98 7d 00 00 00 movabs $0x7d98,%rdi 49e9: 00 00 00 49ec: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 49f3: 00 00 00 49f6: ff d0 callq *%rax } fd = open("dirfile/xx", 0); 49f8: be 00 00 00 00 mov $0x0,%esi 49fd: 48 bf b0 7d 00 00 00 movabs $0x7db0,%rdi 4a04: 00 00 00 4a07: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4a0e: 00 00 00 4a11: ff d0 callq *%rax 4a13: 89 45 fc mov %eax,-0x4(%rbp) if(fd >= 0){ 4a16: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 4a1a: 78 16 js 4a32 <dirfile+0xe1> failexit("create dirfile/xx succeeded"); 4a1c: 48 bf bb 7d 00 00 00 movabs $0x7dbb,%rdi 4a23: 00 00 00 4a26: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4a2d: 00 00 00 4a30: ff d0 callq *%rax } fd = open("dirfile/xx", O_CREATE); 4a32: be 00 02 00 00 mov $0x200,%esi 4a37: 48 bf b0 7d 00 00 00 movabs $0x7db0,%rdi 4a3e: 00 00 00 4a41: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4a48: 00 00 00 4a4b: ff d0 callq *%rax 4a4d: 89 45 fc mov %eax,-0x4(%rbp) if(fd >= 0){ 4a50: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 4a54: 78 16 js 4a6c <dirfile+0x11b> failexit("create dirfile/xx succeeded"); 4a56: 48 bf bb 7d 00 00 00 movabs $0x7dbb,%rdi 4a5d: 00 00 00 4a60: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4a67: 00 00 00 4a6a: ff d0 callq *%rax } if(mkdir("dirfile/xx") == 0){ 4a6c: 48 bf b0 7d 00 00 00 movabs $0x7db0,%rdi 4a73: 00 00 00 4a76: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 4a7d: 00 00 00 4a80: ff d0 callq *%rax 4a82: 85 c0 test %eax,%eax 4a84: 75 16 jne 4a9c <dirfile+0x14b> failexit("mkdir dirfile/xx succeeded"); 4a86: 48 bf d7 7d 00 00 00 movabs $0x7dd7,%rdi 4a8d: 00 00 00 4a90: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4a97: 00 00 00 4a9a: ff d0 callq *%rax } if(unlink("dirfile/xx") == 0){ 4a9c: 48 bf b0 7d 00 00 00 movabs $0x7db0,%rdi 4aa3: 00 00 00 4aa6: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4aad: 00 00 00 4ab0: ff d0 callq *%rax 4ab2: 85 c0 test %eax,%eax 4ab4: 75 16 jne 4acc <dirfile+0x17b> failexit("unlink dirfile/xx succeeded"); 4ab6: 48 bf f2 7d 00 00 00 movabs $0x7df2,%rdi 4abd: 00 00 00 4ac0: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4ac7: 00 00 00 4aca: ff d0 callq *%rax } if(link("README", "dirfile/xx") == 0){ 4acc: 48 be b0 7d 00 00 00 movabs $0x7db0,%rsi 4ad3: 00 00 00 4ad6: 48 bf 0e 7e 00 00 00 movabs $0x7e0e,%rdi 4add: 00 00 00 4ae0: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 4ae7: 00 00 00 4aea: ff d0 callq *%rax 4aec: 85 c0 test %eax,%eax 4aee: 75 16 jne 4b06 <dirfile+0x1b5> failexit("link to dirfile/xx succeeded"); 4af0: 48 bf 15 7e 00 00 00 movabs $0x7e15,%rdi 4af7: 00 00 00 4afa: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4b01: 00 00 00 4b04: ff d0 callq *%rax } if(unlink("dirfile") != 0){ 4b06: 48 bf 81 7d 00 00 00 movabs $0x7d81,%rdi 4b0d: 00 00 00 4b10: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4b17: 00 00 00 4b1a: ff d0 callq *%rax 4b1c: 85 c0 test %eax,%eax 4b1e: 74 16 je 4b36 <dirfile+0x1e5> failexit("unlink dirfile"); 4b20: 48 bf 32 7e 00 00 00 movabs $0x7e32,%rdi 4b27: 00 00 00 4b2a: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4b31: 00 00 00 4b34: ff d0 callq *%rax } fd = open(".", O_RDWR); 4b36: be 02 00 00 00 mov $0x2,%esi 4b3b: 48 bf 12 75 00 00 00 movabs $0x7512,%rdi 4b42: 00 00 00 4b45: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4b4c: 00 00 00 4b4f: ff d0 callq *%rax 4b51: 89 45 fc mov %eax,-0x4(%rbp) if(fd >= 0){ 4b54: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 4b58: 78 16 js 4b70 <dirfile+0x21f> failexit("open . for writing succeeded"); 4b5a: 48 bf 41 7e 00 00 00 movabs $0x7e41,%rdi 4b61: 00 00 00 4b64: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4b6b: 00 00 00 4b6e: ff d0 callq *%rax } fd = open(".", 0); 4b70: be 00 00 00 00 mov $0x0,%esi 4b75: 48 bf 12 75 00 00 00 movabs $0x7512,%rdi 4b7c: 00 00 00 4b7f: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4b86: 00 00 00 4b89: ff d0 callq *%rax 4b8b: 89 45 fc mov %eax,-0x4(%rbp) if(write(fd, "x", 1) > 0){ 4b8e: 8b 45 fc mov -0x4(%rbp),%eax 4b91: ba 01 00 00 00 mov $0x1,%edx 4b96: 48 be 96 71 00 00 00 movabs $0x7196,%rsi 4b9d: 00 00 00 4ba0: 89 c7 mov %eax,%edi 4ba2: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 4ba9: 00 00 00 4bac: ff d0 callq *%rax 4bae: 85 c0 test %eax,%eax 4bb0: 7e 16 jle 4bc8 <dirfile+0x277> failexit("write . succeeded"); 4bb2: 48 bf 5e 7e 00 00 00 movabs $0x7e5e,%rdi 4bb9: 00 00 00 4bbc: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4bc3: 00 00 00 4bc6: ff d0 callq *%rax } close(fd); 4bc8: 8b 45 fc mov -0x4(%rbp),%eax 4bcb: 89 c7 mov %eax,%edi 4bcd: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 4bd4: 00 00 00 4bd7: ff d0 callq *%rax printf(1, "dir vs file OK\n"); 4bd9: 48 be 70 7e 00 00 00 movabs $0x7e70,%rsi 4be0: 00 00 00 4be3: bf 01 00 00 00 mov $0x1,%edi 4be8: b8 00 00 00 00 mov $0x0,%eax 4bed: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4bf4: 00 00 00 4bf7: ff d2 callq *%rdx } 4bf9: 90 nop 4bfa: c9 leaveq 4bfb: c3 retq 0000000000004bfc <iref>: // test that iput() is called at the end of _namei() void iref(void) { 4bfc: f3 0f 1e fa endbr64 4c00: 55 push %rbp 4c01: 48 89 e5 mov %rsp,%rbp 4c04: 48 83 ec 10 sub $0x10,%rsp int i, fd; printf(1, "empty file name\n"); 4c08: 48 be 80 7e 00 00 00 movabs $0x7e80,%rsi 4c0f: 00 00 00 4c12: bf 01 00 00 00 mov $0x1,%edi 4c17: b8 00 00 00 00 mov $0x0,%eax 4c1c: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4c23: 00 00 00 4c26: ff d2 callq *%rdx // the 50 is NINODE for(i = 0; i < 50 + 1; i++){ 4c28: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 4c2f: e9 1a 01 00 00 jmpq 4d4e <iref+0x152> if(mkdir("irefd") != 0){ 4c34: 48 bf 91 7e 00 00 00 movabs $0x7e91,%rdi 4c3b: 00 00 00 4c3e: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 4c45: 00 00 00 4c48: ff d0 callq *%rax 4c4a: 85 c0 test %eax,%eax 4c4c: 74 16 je 4c64 <iref+0x68> failexit("mkdir irefd"); 4c4e: 48 bf 97 7e 00 00 00 movabs $0x7e97,%rdi 4c55: 00 00 00 4c58: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4c5f: 00 00 00 4c62: ff d0 callq *%rax } if(chdir("irefd") != 0){ 4c64: 48 bf 91 7e 00 00 00 movabs $0x7e91,%rdi 4c6b: 00 00 00 4c6e: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 4c75: 00 00 00 4c78: ff d0 callq *%rax 4c7a: 85 c0 test %eax,%eax 4c7c: 74 16 je 4c94 <iref+0x98> failexit("chdir irefd"); 4c7e: 48 bf a3 7e 00 00 00 movabs $0x7ea3,%rdi 4c85: 00 00 00 4c88: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4c8f: 00 00 00 4c92: ff d0 callq *%rax } mkdir(""); 4c94: 48 bf af 7e 00 00 00 movabs $0x7eaf,%rdi 4c9b: 00 00 00 4c9e: 48 b8 b6 63 00 00 00 movabs $0x63b6,%rax 4ca5: 00 00 00 4ca8: ff d0 callq *%rax link("README", ""); 4caa: 48 be af 7e 00 00 00 movabs $0x7eaf,%rsi 4cb1: 00 00 00 4cb4: 48 bf 0e 7e 00 00 00 movabs $0x7e0e,%rdi 4cbb: 00 00 00 4cbe: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 4cc5: 00 00 00 4cc8: ff d0 callq *%rax fd = open("", O_CREATE); 4cca: be 00 02 00 00 mov $0x200,%esi 4ccf: 48 bf af 7e 00 00 00 movabs $0x7eaf,%rdi 4cd6: 00 00 00 4cd9: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4ce0: 00 00 00 4ce3: ff d0 callq *%rax 4ce5: 89 45 f8 mov %eax,-0x8(%rbp) if(fd >= 0) 4ce8: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 4cec: 78 11 js 4cff <iref+0x103> close(fd); 4cee: 8b 45 f8 mov -0x8(%rbp),%eax 4cf1: 89 c7 mov %eax,%edi 4cf3: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 4cfa: 00 00 00 4cfd: ff d0 callq *%rax fd = open("xx", O_CREATE); 4cff: be 00 02 00 00 mov $0x200,%esi 4d04: 48 bf b0 7e 00 00 00 movabs $0x7eb0,%rdi 4d0b: 00 00 00 4d0e: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 4d15: 00 00 00 4d18: ff d0 callq *%rax 4d1a: 89 45 f8 mov %eax,-0x8(%rbp) if(fd >= 0) 4d1d: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 4d21: 78 11 js 4d34 <iref+0x138> close(fd); 4d23: 8b 45 f8 mov -0x8(%rbp),%eax 4d26: 89 c7 mov %eax,%edi 4d28: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 4d2f: 00 00 00 4d32: ff d0 callq *%rax unlink("xx"); 4d34: 48 bf b0 7e 00 00 00 movabs $0x7eb0,%rdi 4d3b: 00 00 00 4d3e: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 4d45: 00 00 00 4d48: ff d0 callq *%rax for(i = 0; i < 50 + 1; i++){ 4d4a: 83 45 fc 01 addl $0x1,-0x4(%rbp) 4d4e: 83 7d fc 32 cmpl $0x32,-0x4(%rbp) 4d52: 0f 8e dc fe ff ff jle 4c34 <iref+0x38> } chdir("/"); 4d58: 48 bf 80 6d 00 00 00 movabs $0x6d80,%rdi 4d5f: 00 00 00 4d62: 48 b8 c3 63 00 00 00 movabs $0x63c3,%rax 4d69: 00 00 00 4d6c: ff d0 callq *%rax printf(1, "empty file name OK\n"); 4d6e: 48 be b3 7e 00 00 00 movabs $0x7eb3,%rsi 4d75: 00 00 00 4d78: bf 01 00 00 00 mov $0x1,%edi 4d7d: b8 00 00 00 00 mov $0x0,%eax 4d82: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4d89: 00 00 00 4d8c: ff d2 callq *%rdx } 4d8e: 90 nop 4d8f: c9 leaveq 4d90: c3 retq 0000000000004d91 <forktest>: // test that fork fails gracefully // the forktest binary also does this, but it runs out of proc entries first. // inside the bigger usertests binary, we run out of memory first. void forktest(void) { 4d91: f3 0f 1e fa endbr64 4d95: 55 push %rbp 4d96: 48 89 e5 mov %rsp,%rbp 4d99: 48 83 ec 10 sub $0x10,%rsp int n, pid; printf(1, "fork test\n"); 4d9d: 48 be c7 7e 00 00 00 movabs $0x7ec7,%rsi 4da4: 00 00 00 4da7: bf 01 00 00 00 mov $0x1,%edi 4dac: b8 00 00 00 00 mov $0x0,%eax 4db1: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4db8: 00 00 00 4dbb: ff d2 callq *%rdx for(n=0; n<1000; n++){ 4dbd: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 4dc4: eb 2b jmp 4df1 <forktest+0x60> pid = fork(); 4dc6: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 4dcd: 00 00 00 4dd0: ff d0 callq *%rax 4dd2: 89 45 f8 mov %eax,-0x8(%rbp) if(pid < 0) 4dd5: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 4dd9: 78 21 js 4dfc <forktest+0x6b> break; if(pid == 0) 4ddb: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 4ddf: 75 0c jne 4ded <forktest+0x5c> exit(); 4de1: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 4de8: 00 00 00 4deb: ff d0 callq *%rax for(n=0; n<1000; n++){ 4ded: 83 45 fc 01 addl $0x1,-0x4(%rbp) 4df1: 81 7d fc e7 03 00 00 cmpl $0x3e7,-0x4(%rbp) 4df8: 7e cc jle 4dc6 <forktest+0x35> 4dfa: eb 01 jmp 4dfd <forktest+0x6c> break; 4dfc: 90 nop } if(n == 1000){ 4dfd: 81 7d fc e8 03 00 00 cmpl $0x3e8,-0x4(%rbp) 4e04: 75 42 jne 4e48 <forktest+0xb7> failexit("fork claimed to work 1000 times"); 4e06: 48 bf d8 7e 00 00 00 movabs $0x7ed8,%rdi 4e0d: 00 00 00 4e10: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4e17: 00 00 00 4e1a: ff d0 callq *%rax } for(; n > 0; n--){ 4e1c: eb 2a jmp 4e48 <forktest+0xb7> if(wait() < 0){ 4e1e: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 4e25: 00 00 00 4e28: ff d0 callq *%rax 4e2a: 85 c0 test %eax,%eax 4e2c: 79 16 jns 4e44 <forktest+0xb3> failexit("wait stopped early"); 4e2e: 48 bf f8 7e 00 00 00 movabs $0x7ef8,%rdi 4e35: 00 00 00 4e38: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4e3f: 00 00 00 4e42: ff d0 callq *%rax for(; n > 0; n--){ 4e44: 83 6d fc 01 subl $0x1,-0x4(%rbp) 4e48: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 4e4c: 7f d0 jg 4e1e <forktest+0x8d> } } if(wait() != -1){ 4e4e: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 4e55: 00 00 00 4e58: ff d0 callq *%rax 4e5a: 83 f8 ff cmp $0xffffffff,%eax 4e5d: 74 16 je 4e75 <forktest+0xe4> failexit("wait got too many"); 4e5f: 48 bf 0b 7f 00 00 00 movabs $0x7f0b,%rdi 4e66: 00 00 00 4e69: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4e70: 00 00 00 4e73: ff d0 callq *%rax } printf(1, "fork test OK\n"); 4e75: 48 be 1d 7f 00 00 00 movabs $0x7f1d,%rsi 4e7c: 00 00 00 4e7f: bf 01 00 00 00 mov $0x1,%edi 4e84: b8 00 00 00 00 mov $0x0,%eax 4e89: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4e90: 00 00 00 4e93: ff d2 callq *%rdx } 4e95: 90 nop 4e96: c9 leaveq 4e97: c3 retq 0000000000004e98 <sbrktest>: void sbrktest(void) { 4e98: f3 0f 1e fa endbr64 4e9c: 55 push %rbp 4e9d: 48 89 e5 mov %rsp,%rbp 4ea0: 48 81 ec 90 00 00 00 sub $0x90,%rsp int fds[2], pid, pids[10], ppid; char *a, *b, *c, *lastaddr, *oldbrk, *p, scratch; uint amt; printf(1, "sbrk test\n"); 4ea7: 48 be 2b 7f 00 00 00 movabs $0x7f2b,%rsi 4eae: 00 00 00 4eb1: bf 01 00 00 00 mov $0x1,%edi 4eb6: b8 00 00 00 00 mov $0x0,%eax 4ebb: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 4ec2: 00 00 00 4ec5: ff d2 callq *%rdx oldbrk = sbrk(0); 4ec7: bf 00 00 00 00 mov $0x0,%edi 4ecc: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 4ed3: 00 00 00 4ed6: ff d0 callq *%rax 4ed8: 48 89 45 e8 mov %rax,-0x18(%rbp) // can one sbrk() less than a page? a = sbrk(0); 4edc: bf 00 00 00 00 mov $0x0,%edi 4ee1: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 4ee8: 00 00 00 4eeb: ff d0 callq *%rax 4eed: 48 89 45 f8 mov %rax,-0x8(%rbp) int i; for(i = 0; i < 5000; i++){ 4ef1: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) 4ef8: eb 76 jmp 4f70 <sbrktest+0xd8> b = sbrk(1); 4efa: bf 01 00 00 00 mov $0x1,%edi 4eff: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 4f06: 00 00 00 4f09: ff d0 callq *%rax 4f0b: 48 89 45 b0 mov %rax,-0x50(%rbp) if(b != a){ 4f0f: 48 8b 45 b0 mov -0x50(%rbp),%rax 4f13: 48 3b 45 f8 cmp -0x8(%rbp),%rax 4f17: 74 40 je 4f59 <sbrktest+0xc1> printf(1, "sbrk test failed %d %p %p\n", i, a, b); 4f19: 48 8b 4d b0 mov -0x50(%rbp),%rcx 4f1d: 48 8b 55 f8 mov -0x8(%rbp),%rdx 4f21: 8b 45 f4 mov -0xc(%rbp),%eax 4f24: 49 89 c8 mov %rcx,%r8 4f27: 48 89 d1 mov %rdx,%rcx 4f2a: 89 c2 mov %eax,%edx 4f2c: 48 be 36 7f 00 00 00 movabs $0x7f36,%rsi 4f33: 00 00 00 4f36: bf 01 00 00 00 mov $0x1,%edi 4f3b: b8 00 00 00 00 mov $0x0,%eax 4f40: 49 b9 04 66 00 00 00 movabs $0x6604,%r9 4f47: 00 00 00 4f4a: 41 ff d1 callq *%r9 exit(); 4f4d: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 4f54: 00 00 00 4f57: ff d0 callq *%rax } *b = 1; 4f59: 48 8b 45 b0 mov -0x50(%rbp),%rax 4f5d: c6 00 01 movb $0x1,(%rax) a = b + 1; 4f60: 48 8b 45 b0 mov -0x50(%rbp),%rax 4f64: 48 83 c0 01 add $0x1,%rax 4f68: 48 89 45 f8 mov %rax,-0x8(%rbp) for(i = 0; i < 5000; i++){ 4f6c: 83 45 f4 01 addl $0x1,-0xc(%rbp) 4f70: 81 7d f4 87 13 00 00 cmpl $0x1387,-0xc(%rbp) 4f77: 7e 81 jle 4efa <sbrktest+0x62> } pid = fork(); 4f79: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 4f80: 00 00 00 4f83: ff d0 callq *%rax 4f85: 89 45 e4 mov %eax,-0x1c(%rbp) if(pid < 0){ 4f88: 83 7d e4 00 cmpl $0x0,-0x1c(%rbp) 4f8c: 79 16 jns 4fa4 <sbrktest+0x10c> failexit("sbrk test fork"); 4f8e: 48 bf 51 7f 00 00 00 movabs $0x7f51,%rdi 4f95: 00 00 00 4f98: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4f9f: 00 00 00 4fa2: ff d0 callq *%rax } c = sbrk(1); 4fa4: bf 01 00 00 00 mov $0x1,%edi 4fa9: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 4fb0: 00 00 00 4fb3: ff d0 callq *%rax 4fb5: 48 89 45 d8 mov %rax,-0x28(%rbp) c = sbrk(1); 4fb9: bf 01 00 00 00 mov $0x1,%edi 4fbe: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 4fc5: 00 00 00 4fc8: ff d0 callq *%rax 4fca: 48 89 45 d8 mov %rax,-0x28(%rbp) if(c != a + 1){ 4fce: 48 8b 45 f8 mov -0x8(%rbp),%rax 4fd2: 48 83 c0 01 add $0x1,%rax 4fd6: 48 39 45 d8 cmp %rax,-0x28(%rbp) 4fda: 74 16 je 4ff2 <sbrktest+0x15a> failexit("sbrk test failed post-fork"); 4fdc: 48 bf 60 7f 00 00 00 movabs $0x7f60,%rdi 4fe3: 00 00 00 4fe6: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 4fed: 00 00 00 4ff0: ff d0 callq *%rax } if(pid == 0) 4ff2: 83 7d e4 00 cmpl $0x0,-0x1c(%rbp) 4ff6: 75 0c jne 5004 <sbrktest+0x16c> exit(); 4ff8: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 4fff: 00 00 00 5002: ff d0 callq *%rax wait(); 5004: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 500b: 00 00 00 500e: ff d0 callq *%rax // can one grow address space to something big? #define BIG (100*1024*1024) a = sbrk(0); 5010: bf 00 00 00 00 mov $0x0,%edi 5015: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 501c: 00 00 00 501f: ff d0 callq *%rax 5021: 48 89 45 f8 mov %rax,-0x8(%rbp) amt = (BIG) - (addr_t)a; 5025: 48 8b 45 f8 mov -0x8(%rbp),%rax 5029: ba 00 00 40 06 mov $0x6400000,%edx 502e: 29 c2 sub %eax,%edx 5030: 89 d0 mov %edx,%eax 5032: 89 45 d4 mov %eax,-0x2c(%rbp) p = sbrk(amt); 5035: 8b 45 d4 mov -0x2c(%rbp),%eax 5038: 48 89 c7 mov %rax,%rdi 503b: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 5042: 00 00 00 5045: ff d0 callq *%rax 5047: 48 89 45 c8 mov %rax,-0x38(%rbp) if (p != a) { 504b: 48 8b 45 c8 mov -0x38(%rbp),%rax 504f: 48 3b 45 f8 cmp -0x8(%rbp),%rax 5053: 74 16 je 506b <sbrktest+0x1d3> failexit("sbrk test failed to grow big address space; enough phys mem?"); 5055: 48 bf 80 7f 00 00 00 movabs $0x7f80,%rdi 505c: 00 00 00 505f: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 5066: 00 00 00 5069: ff d0 callq *%rax } lastaddr = (char*) (BIG-1); 506b: 48 c7 45 c0 ff ff 3f movq $0x63fffff,-0x40(%rbp) 5072: 06 *lastaddr = 99; 5073: 48 8b 45 c0 mov -0x40(%rbp),%rax 5077: c6 00 63 movb $0x63,(%rax) // can one de-allocate? a = sbrk(0); 507a: bf 00 00 00 00 mov $0x0,%edi 507f: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 5086: 00 00 00 5089: ff d0 callq *%rax 508b: 48 89 45 f8 mov %rax,-0x8(%rbp) c = sbrk(-4096); 508f: 48 c7 c7 00 f0 ff ff mov $0xfffffffffffff000,%rdi 5096: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 509d: 00 00 00 50a0: ff d0 callq *%rax 50a2: 48 89 45 d8 mov %rax,-0x28(%rbp) if(c == (char*)0xffffffff){ 50a6: b8 ff ff ff ff mov $0xffffffff,%eax 50ab: 48 39 45 d8 cmp %rax,-0x28(%rbp) 50af: 75 16 jne 50c7 <sbrktest+0x22f> failexit("sbrk could not deallocate"); 50b1: 48 bf bd 7f 00 00 00 movabs $0x7fbd,%rdi 50b8: 00 00 00 50bb: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 50c2: 00 00 00 50c5: ff d0 callq *%rax } c = sbrk(0); 50c7: bf 00 00 00 00 mov $0x0,%edi 50cc: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 50d3: 00 00 00 50d6: ff d0 callq *%rax 50d8: 48 89 45 d8 mov %rax,-0x28(%rbp) if(c != a - 4096){ 50dc: 48 8b 45 f8 mov -0x8(%rbp),%rax 50e0: 48 2d 00 10 00 00 sub $0x1000,%rax 50e6: 48 39 45 d8 cmp %rax,-0x28(%rbp) 50ea: 74 3b je 5127 <sbrktest+0x28f> printf(1, "sbrk deallocation produced wrong address, a %p c %p\n", a, c); 50ec: 48 8b 55 d8 mov -0x28(%rbp),%rdx 50f0: 48 8b 45 f8 mov -0x8(%rbp),%rax 50f4: 48 89 d1 mov %rdx,%rcx 50f7: 48 89 c2 mov %rax,%rdx 50fa: 48 be d8 7f 00 00 00 movabs $0x7fd8,%rsi 5101: 00 00 00 5104: bf 01 00 00 00 mov $0x1,%edi 5109: b8 00 00 00 00 mov $0x0,%eax 510e: 49 b8 04 66 00 00 00 movabs $0x6604,%r8 5115: 00 00 00 5118: 41 ff d0 callq *%r8 exit(); 511b: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 5122: 00 00 00 5125: ff d0 callq *%rax } // can one re-allocate that page? a = sbrk(0); 5127: bf 00 00 00 00 mov $0x0,%edi 512c: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 5133: 00 00 00 5136: ff d0 callq *%rax 5138: 48 89 45 f8 mov %rax,-0x8(%rbp) c = sbrk(4096); 513c: bf 00 10 00 00 mov $0x1000,%edi 5141: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 5148: 00 00 00 514b: ff d0 callq *%rax 514d: 48 89 45 d8 mov %rax,-0x28(%rbp) if(c != a || sbrk(0) != a + 4096){ 5151: 48 8b 45 d8 mov -0x28(%rbp),%rax 5155: 48 3b 45 f8 cmp -0x8(%rbp),%rax 5159: 75 21 jne 517c <sbrktest+0x2e4> 515b: bf 00 00 00 00 mov $0x0,%edi 5160: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 5167: 00 00 00 516a: ff d0 callq *%rax 516c: 48 8b 55 f8 mov -0x8(%rbp),%rdx 5170: 48 81 c2 00 10 00 00 add $0x1000,%rdx 5177: 48 39 d0 cmp %rdx,%rax 517a: 74 3b je 51b7 <sbrktest+0x31f> printf(1, "sbrk re-allocation failed, a %p c %p\n", a, c); 517c: 48 8b 55 d8 mov -0x28(%rbp),%rdx 5180: 48 8b 45 f8 mov -0x8(%rbp),%rax 5184: 48 89 d1 mov %rdx,%rcx 5187: 48 89 c2 mov %rax,%rdx 518a: 48 be 10 80 00 00 00 movabs $0x8010,%rsi 5191: 00 00 00 5194: bf 01 00 00 00 mov $0x1,%edi 5199: b8 00 00 00 00 mov $0x0,%eax 519e: 49 b8 04 66 00 00 00 movabs $0x6604,%r8 51a5: 00 00 00 51a8: 41 ff d0 callq *%r8 exit(); 51ab: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 51b2: 00 00 00 51b5: ff d0 callq *%rax } if(*lastaddr == 99){ 51b7: 48 8b 45 c0 mov -0x40(%rbp),%rax 51bb: 0f b6 00 movzbl (%rax),%eax 51be: 3c 63 cmp $0x63,%al 51c0: 75 16 jne 51d8 <sbrktest+0x340> // should be zero failexit("sbrk de-allocation didn't really deallocate"); 51c2: 48 bf 38 80 00 00 00 movabs $0x8038,%rdi 51c9: 00 00 00 51cc: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 51d3: 00 00 00 51d6: ff d0 callq *%rax } a = sbrk(0); 51d8: bf 00 00 00 00 mov $0x0,%edi 51dd: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 51e4: 00 00 00 51e7: ff d0 callq *%rax 51e9: 48 89 45 f8 mov %rax,-0x8(%rbp) c = sbrk(-(sbrk(0) - oldbrk)); 51ed: bf 00 00 00 00 mov $0x0,%edi 51f2: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 51f9: 00 00 00 51fc: ff d0 callq *%rax 51fe: 48 8b 55 e8 mov -0x18(%rbp),%rdx 5202: 48 29 c2 sub %rax,%rdx 5205: 48 89 d0 mov %rdx,%rax 5208: 48 89 c7 mov %rax,%rdi 520b: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 5212: 00 00 00 5215: ff d0 callq *%rax 5217: 48 89 45 d8 mov %rax,-0x28(%rbp) if(c != a){ 521b: 48 8b 45 d8 mov -0x28(%rbp),%rax 521f: 48 3b 45 f8 cmp -0x8(%rbp),%rax 5223: 74 3b je 5260 <sbrktest+0x3c8> printf(1, "sbrk downsize failed, a %p c %p\n", a, c); 5225: 48 8b 55 d8 mov -0x28(%rbp),%rdx 5229: 48 8b 45 f8 mov -0x8(%rbp),%rax 522d: 48 89 d1 mov %rdx,%rcx 5230: 48 89 c2 mov %rax,%rdx 5233: 48 be 68 80 00 00 00 movabs $0x8068,%rsi 523a: 00 00 00 523d: bf 01 00 00 00 mov $0x1,%edi 5242: b8 00 00 00 00 mov $0x0,%eax 5247: 49 b8 04 66 00 00 00 movabs $0x6604,%r8 524e: 00 00 00 5251: 41 ff d0 callq *%r8 exit(); 5254: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 525b: 00 00 00 525e: ff d0 callq *%rax } printf(1, "expecting 10 killed processes:\n"); 5260: 48 be 90 80 00 00 00 movabs $0x8090,%rsi 5267: 00 00 00 526a: bf 01 00 00 00 mov $0x1,%edi 526f: b8 00 00 00 00 mov $0x0,%eax 5274: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 527b: 00 00 00 527e: ff d2 callq *%rdx // can we read the kernel's memory? for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+1000000); a += 100000){ 5280: 48 b8 00 00 00 00 00 movabs $0xffff800000000000,%rax 5287: 80 ff ff 528a: 48 89 45 f8 mov %rax,-0x8(%rbp) 528e: e9 a5 00 00 00 jmpq 5338 <sbrktest+0x4a0> ppid = getpid(); 5293: 48 b8 dd 63 00 00 00 movabs $0x63dd,%rax 529a: 00 00 00 529d: ff d0 callq *%rax 529f: 89 45 b8 mov %eax,-0x48(%rbp) pid = fork(); 52a2: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 52a9: 00 00 00 52ac: ff d0 callq *%rax 52ae: 89 45 e4 mov %eax,-0x1c(%rbp) if(pid < 0){ 52b1: 83 7d e4 00 cmpl $0x0,-0x1c(%rbp) 52b5: 79 16 jns 52cd <sbrktest+0x435> failexit("fork"); 52b7: 48 bf a7 6d 00 00 00 movabs $0x6da7,%rdi 52be: 00 00 00 52c1: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 52c8: 00 00 00 52cb: ff d0 callq *%rax } if(pid == 0){ 52cd: 83 7d e4 00 cmpl $0x0,-0x1c(%rbp) 52d1: 75 51 jne 5324 <sbrktest+0x48c> printf(1, "oops could read %p = %c\n", a, *a); 52d3: 48 8b 45 f8 mov -0x8(%rbp),%rax 52d7: 0f b6 00 movzbl (%rax),%eax 52da: 0f be d0 movsbl %al,%edx 52dd: 48 8b 45 f8 mov -0x8(%rbp),%rax 52e1: 89 d1 mov %edx,%ecx 52e3: 48 89 c2 mov %rax,%rdx 52e6: 48 be b0 80 00 00 00 movabs $0x80b0,%rsi 52ed: 00 00 00 52f0: bf 01 00 00 00 mov $0x1,%edi 52f5: b8 00 00 00 00 mov $0x0,%eax 52fa: 49 b8 04 66 00 00 00 movabs $0x6604,%r8 5301: 00 00 00 5304: 41 ff d0 callq *%r8 kill(ppid); 5307: 8b 45 b8 mov -0x48(%rbp),%eax 530a: 89 c7 mov %eax,%edi 530c: 48 b8 5b 63 00 00 00 movabs $0x635b,%rax 5313: 00 00 00 5316: ff d0 callq *%rax exit(); 5318: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 531f: 00 00 00 5322: ff d0 callq *%rax } wait(); 5324: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 532b: 00 00 00 532e: ff d0 callq *%rax for(a = (char*)(KERNBASE); a < (char*) (KERNBASE+1000000); a += 100000){ 5330: 48 81 45 f8 a0 86 01 addq $0x186a0,-0x8(%rbp) 5337: 00 5338: 48 b8 3f 42 0f 00 00 movabs $0xffff8000000f423f,%rax 533f: 80 ff ff 5342: 48 39 45 f8 cmp %rax,-0x8(%rbp) 5346: 0f 86 47 ff ff ff jbe 5293 <sbrktest+0x3fb> } // if we run the system out of memory, does it clean up the last // failed allocation? if(pipe(fds) != 0){ 534c: 48 8d 45 a8 lea -0x58(%rbp),%rax 5350: 48 89 c7 mov %rax,%rdi 5353: 48 b8 27 63 00 00 00 movabs $0x6327,%rax 535a: 00 00 00 535d: ff d0 callq *%rax 535f: 85 c0 test %eax,%eax 5361: 74 16 je 5379 <sbrktest+0x4e1> failexit("pipe()"); 5363: 48 bf 43 71 00 00 00 movabs $0x7143,%rdi 536a: 00 00 00 536d: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 5374: 00 00 00 5377: ff d0 callq *%rax } printf(1, "expecting failed sbrk()s:\n"); 5379: 48 be c9 80 00 00 00 movabs $0x80c9,%rsi 5380: 00 00 00 5383: bf 01 00 00 00 mov $0x1,%edi 5388: b8 00 00 00 00 mov $0x0,%eax 538d: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5394: 00 00 00 5397: ff d2 callq *%rdx for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ 5399: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) 53a0: e9 e0 00 00 00 jmpq 5485 <sbrktest+0x5ed> if((pids[i] = fork()) == 0){ 53a5: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 53ac: 00 00 00 53af: ff d0 callq *%rax 53b1: 8b 55 f4 mov -0xc(%rbp),%edx 53b4: 48 63 d2 movslq %edx,%rdx 53b7: 89 44 95 80 mov %eax,-0x80(%rbp,%rdx,4) 53bb: 8b 45 f4 mov -0xc(%rbp),%eax 53be: 48 98 cltq 53c0: 8b 44 85 80 mov -0x80(%rbp,%rax,4),%eax 53c4: 85 c0 test %eax,%eax 53c6: 0f 85 87 00 00 00 jne 5453 <sbrktest+0x5bb> // allocate a lot of memory int ret = (int)(addr_t)sbrk(BIG - (addr_t)sbrk(0)); 53cc: bf 00 00 00 00 mov $0x0,%edi 53d1: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 53d8: 00 00 00 53db: ff d0 callq *%rax 53dd: ba 00 00 40 06 mov $0x6400000,%edx 53e2: 48 29 c2 sub %rax,%rdx 53e5: 48 89 d0 mov %rdx,%rax 53e8: 48 89 c7 mov %rax,%rdi 53eb: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 53f2: 00 00 00 53f5: ff d0 callq *%rax 53f7: 89 45 bc mov %eax,-0x44(%rbp) if(ret < 0) 53fa: 83 7d bc 00 cmpl $0x0,-0x44(%rbp) 53fe: 79 20 jns 5420 <sbrktest+0x588> printf(1, "sbrk returned -1 as expected\n"); 5400: 48 be e4 80 00 00 00 movabs $0x80e4,%rsi 5407: 00 00 00 540a: bf 01 00 00 00 mov $0x1,%edi 540f: b8 00 00 00 00 mov $0x0,%eax 5414: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 541b: 00 00 00 541e: ff d2 callq *%rdx write(fds[1], "x", 1); 5420: 8b 45 ac mov -0x54(%rbp),%eax 5423: ba 01 00 00 00 mov $0x1,%edx 5428: 48 be 96 71 00 00 00 movabs $0x7196,%rsi 542f: 00 00 00 5432: 89 c7 mov %eax,%edi 5434: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 543b: 00 00 00 543e: ff d0 callq *%rax // sit around until killed for(;;) sleep(1000); 5440: bf e8 03 00 00 mov $0x3e8,%edi 5445: 48 b8 f7 63 00 00 00 movabs $0x63f7,%rax 544c: 00 00 00 544f: ff d0 callq *%rax 5451: eb ed jmp 5440 <sbrktest+0x5a8> } if(pids[i] != -1) 5453: 8b 45 f4 mov -0xc(%rbp),%eax 5456: 48 98 cltq 5458: 8b 44 85 80 mov -0x80(%rbp,%rax,4),%eax 545c: 83 f8 ff cmp $0xffffffff,%eax 545f: 74 20 je 5481 <sbrktest+0x5e9> read(fds[0], &scratch, 1); // wait 5461: 8b 45 a8 mov -0x58(%rbp),%eax 5464: 48 8d 8d 7f ff ff ff lea -0x81(%rbp),%rcx 546b: ba 01 00 00 00 mov $0x1,%edx 5470: 48 89 ce mov %rcx,%rsi 5473: 89 c7 mov %eax,%edi 5475: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 547c: 00 00 00 547f: ff d0 callq *%rax for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ 5481: 83 45 f4 01 addl $0x1,-0xc(%rbp) 5485: 8b 45 f4 mov -0xc(%rbp),%eax 5488: 83 f8 09 cmp $0x9,%eax 548b: 0f 86 14 ff ff ff jbe 53a5 <sbrktest+0x50d> } // if those failed allocations freed up the pages they did allocate, // we'll be able to allocate one here c = sbrk(4096); 5491: bf 00 10 00 00 mov $0x1000,%edi 5496: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 549d: 00 00 00 54a0: ff d0 callq *%rax 54a2: 48 89 45 d8 mov %rax,-0x28(%rbp) for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ 54a6: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) 54ad: eb 38 jmp 54e7 <sbrktest+0x64f> if(pids[i] == -1) 54af: 8b 45 f4 mov -0xc(%rbp),%eax 54b2: 48 98 cltq 54b4: 8b 44 85 80 mov -0x80(%rbp,%rax,4),%eax 54b8: 83 f8 ff cmp $0xffffffff,%eax 54bb: 74 25 je 54e2 <sbrktest+0x64a> continue; kill(pids[i]); 54bd: 8b 45 f4 mov -0xc(%rbp),%eax 54c0: 48 98 cltq 54c2: 8b 44 85 80 mov -0x80(%rbp,%rax,4),%eax 54c6: 89 c7 mov %eax,%edi 54c8: 48 b8 5b 63 00 00 00 movabs $0x635b,%rax 54cf: 00 00 00 54d2: ff d0 callq *%rax wait(); 54d4: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 54db: 00 00 00 54de: ff d0 callq *%rax 54e0: eb 01 jmp 54e3 <sbrktest+0x64b> continue; 54e2: 90 nop for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ 54e3: 83 45 f4 01 addl $0x1,-0xc(%rbp) 54e7: 8b 45 f4 mov -0xc(%rbp),%eax 54ea: 83 f8 09 cmp $0x9,%eax 54ed: 76 c0 jbe 54af <sbrktest+0x617> } if(c == (char*)0xffffffff){ // ? 54ef: b8 ff ff ff ff mov $0xffffffff,%eax 54f4: 48 39 45 d8 cmp %rax,-0x28(%rbp) 54f8: 75 16 jne 5510 <sbrktest+0x678> failexit("failed sbrk leaked memory"); 54fa: 48 bf 02 81 00 00 00 movabs $0x8102,%rdi 5501: 00 00 00 5504: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 550b: 00 00 00 550e: ff d0 callq *%rax } if(sbrk(0) > oldbrk) 5510: bf 00 00 00 00 mov $0x0,%edi 5515: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 551c: 00 00 00 551f: ff d0 callq *%rax 5521: 48 39 45 e8 cmp %rax,-0x18(%rbp) 5525: 73 2a jae 5551 <sbrktest+0x6b9> sbrk(-(sbrk(0) - oldbrk)); 5527: bf 00 00 00 00 mov $0x0,%edi 552c: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 5533: 00 00 00 5536: ff d0 callq *%rax 5538: 48 8b 55 e8 mov -0x18(%rbp),%rdx 553c: 48 29 c2 sub %rax,%rdx 553f: 48 89 d0 mov %rdx,%rax 5542: 48 89 c7 mov %rax,%rdi 5545: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 554c: 00 00 00 554f: ff d0 callq *%rax printf(1, "sbrk test OK\n"); 5551: 48 be 1c 81 00 00 00 movabs $0x811c,%rsi 5558: 00 00 00 555b: bf 01 00 00 00 mov $0x1,%edi 5560: b8 00 00 00 00 mov $0x0,%eax 5565: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 556c: 00 00 00 556f: ff d2 callq *%rdx } 5571: 90 nop 5572: c9 leaveq 5573: c3 retq 0000000000005574 <validatetest>: void validatetest(void) { 5574: f3 0f 1e fa endbr64 5578: 55 push %rbp 5579: 48 89 e5 mov %rsp,%rbp 557c: 48 83 ec 10 sub $0x10,%rsp int hi; addr_t p; printf(1, "validate test\n"); 5580: 48 be 2a 81 00 00 00 movabs $0x812a,%rsi 5587: 00 00 00 558a: bf 01 00 00 00 mov $0x1,%edi 558f: b8 00 00 00 00 mov $0x0,%eax 5594: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 559b: 00 00 00 559e: ff d2 callq *%rdx hi = 1100*1024; 55a0: c7 45 f4 00 30 11 00 movl $0x113000,-0xc(%rbp) // first page not mapped for(p = 4096; p <= (uint)hi; p += 4096){ 55a7: 48 c7 45 f8 00 10 00 movq $0x1000,-0x8(%rbp) 55ae: 00 55af: eb 40 jmp 55f1 <validatetest+0x7d> // try to crash the kernel by passing in a bad string pointer if(link("nosuchfile", (char*)p) != -1){ 55b1: 48 8b 45 f8 mov -0x8(%rbp),%rax 55b5: 48 89 c6 mov %rax,%rsi 55b8: 48 bf 39 81 00 00 00 movabs $0x8139,%rdi 55bf: 00 00 00 55c2: 48 b8 a9 63 00 00 00 movabs $0x63a9,%rax 55c9: 00 00 00 55cc: ff d0 callq *%rax 55ce: 83 f8 ff cmp $0xffffffff,%eax 55d1: 74 16 je 55e9 <validatetest+0x75> failexit("link should not succeed."); 55d3: 48 bf 44 81 00 00 00 movabs $0x8144,%rdi 55da: 00 00 00 55dd: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 55e4: 00 00 00 55e7: ff d0 callq *%rax for(p = 4096; p <= (uint)hi; p += 4096){ 55e9: 48 81 45 f8 00 10 00 addq $0x1000,-0x8(%rbp) 55f0: 00 55f1: 8b 45 f4 mov -0xc(%rbp),%eax 55f4: 89 c0 mov %eax,%eax 55f6: 48 39 45 f8 cmp %rax,-0x8(%rbp) 55fa: 76 b5 jbe 55b1 <validatetest+0x3d> } } printf(1, "validate ok\n"); 55fc: 48 be 5d 81 00 00 00 movabs $0x815d,%rsi 5603: 00 00 00 5606: bf 01 00 00 00 mov $0x1,%edi 560b: b8 00 00 00 00 mov $0x0,%eax 5610: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5617: 00 00 00 561a: ff d2 callq *%rdx } 561c: 90 nop 561d: c9 leaveq 561e: c3 retq 000000000000561f <bsstest>: // does unintialized data start out zero? char uninit[10000]; void bsstest(void) { 561f: f3 0f 1e fa endbr64 5623: 55 push %rbp 5624: 48 89 e5 mov %rsp,%rbp 5627: 48 83 ec 10 sub $0x10,%rsp int i; printf(1, "bss test\n"); 562b: 48 be 6a 81 00 00 00 movabs $0x816a,%rsi 5632: 00 00 00 5635: bf 01 00 00 00 mov $0x1,%edi 563a: b8 00 00 00 00 mov $0x0,%eax 563f: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5646: 00 00 00 5649: ff d2 callq *%rdx for(i = 0; i < sizeof(uninit); i++){ 564b: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 5652: eb 31 jmp 5685 <bsstest+0x66> if(uninit[i] != '\0'){ 5654: 48 ba 20 ac 00 00 00 movabs $0xac20,%rdx 565b: 00 00 00 565e: 8b 45 fc mov -0x4(%rbp),%eax 5661: 48 98 cltq 5663: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax 5667: 84 c0 test %al,%al 5669: 74 16 je 5681 <bsstest+0x62> failexit("bss test"); 566b: 48 bf 74 81 00 00 00 movabs $0x8174,%rdi 5672: 00 00 00 5675: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 567c: 00 00 00 567f: ff d0 callq *%rax for(i = 0; i < sizeof(uninit); i++){ 5681: 83 45 fc 01 addl $0x1,-0x4(%rbp) 5685: 8b 45 fc mov -0x4(%rbp),%eax 5688: 3d 0f 27 00 00 cmp $0x270f,%eax 568d: 76 c5 jbe 5654 <bsstest+0x35> } } printf(1, "bss test ok\n"); 568f: 48 be 7d 81 00 00 00 movabs $0x817d,%rsi 5696: 00 00 00 5699: bf 01 00 00 00 mov $0x1,%edi 569e: b8 00 00 00 00 mov $0x0,%eax 56a3: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 56aa: 00 00 00 56ad: ff d2 callq *%rdx } 56af: 90 nop 56b0: c9 leaveq 56b1: c3 retq 00000000000056b2 <bigargtest>: // does exec return an error if the arguments // are larger than a page? or does it write // below the stack and wreck the instructions/data? void bigargtest(void) { 56b2: f3 0f 1e fa endbr64 56b6: 55 push %rbp 56b7: 48 89 e5 mov %rsp,%rbp 56ba: 48 83 ec 10 sub $0x10,%rsp int pid, fd; unlink("bigarg-ok"); 56be: 48 bf 8a 81 00 00 00 movabs $0x818a,%rdi 56c5: 00 00 00 56c8: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 56cf: 00 00 00 56d2: ff d0 callq *%rax pid = fork(); 56d4: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 56db: 00 00 00 56de: ff d0 callq *%rax 56e0: 89 45 f8 mov %eax,-0x8(%rbp) if(pid == 0){ 56e3: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 56e7: 0f 85 e0 00 00 00 jne 57cd <bigargtest+0x11b> static char *args[MAXARG]; int i; for(i = 0; i < MAXARG-1; i++) 56ed: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 56f4: eb 21 jmp 5717 <bigargtest+0x65> args[i] = "bigargs test: failed\n "; 56f6: 48 ba 40 d3 00 00 00 movabs $0xd340,%rdx 56fd: 00 00 00 5700: 8b 45 fc mov -0x4(%rbp),%eax 5703: 48 98 cltq 5705: 48 b9 98 81 00 00 00 movabs $0x8198,%rcx 570c: 00 00 00 570f: 48 89 0c c2 mov %rcx,(%rdx,%rax,8) for(i = 0; i < MAXARG-1; i++) 5713: 83 45 fc 01 addl $0x1,-0x4(%rbp) 5717: 83 7d fc 1e cmpl $0x1e,-0x4(%rbp) 571b: 7e d9 jle 56f6 <bigargtest+0x44> args[MAXARG-1] = 0; 571d: 48 b8 40 d3 00 00 00 movabs $0xd340,%rax 5724: 00 00 00 5727: 48 c7 80 f8 00 00 00 movq $0x0,0xf8(%rax) 572e: 00 00 00 00 printf(1, "bigarg test\n"); 5732: 48 be 75 82 00 00 00 movabs $0x8275,%rsi 5739: 00 00 00 573c: bf 01 00 00 00 mov $0x1,%edi 5741: b8 00 00 00 00 mov $0x0,%eax 5746: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 574d: 00 00 00 5750: ff d2 callq *%rdx exec("echo", args); 5752: 48 be 40 d3 00 00 00 movabs $0xd340,%rsi 5759: 00 00 00 575c: 48 bf 18 6d 00 00 00 movabs $0x6d18,%rdi 5763: 00 00 00 5766: 48 b8 68 63 00 00 00 movabs $0x6368,%rax 576d: 00 00 00 5770: ff d0 callq *%rax printf(1, "bigarg test ok\n"); 5772: 48 be 82 82 00 00 00 movabs $0x8282,%rsi 5779: 00 00 00 577c: bf 01 00 00 00 mov $0x1,%edi 5781: b8 00 00 00 00 mov $0x0,%eax 5786: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 578d: 00 00 00 5790: ff d2 callq *%rdx fd = open("bigarg-ok", O_CREATE); 5792: be 00 02 00 00 mov $0x200,%esi 5797: 48 bf 8a 81 00 00 00 movabs $0x818a,%rdi 579e: 00 00 00 57a1: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 57a8: 00 00 00 57ab: ff d0 callq *%rax 57ad: 89 45 f4 mov %eax,-0xc(%rbp) close(fd); 57b0: 8b 45 f4 mov -0xc(%rbp),%eax 57b3: 89 c7 mov %eax,%edi 57b5: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 57bc: 00 00 00 57bf: ff d0 callq *%rax exit(); 57c1: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 57c8: 00 00 00 57cb: ff d0 callq *%rax } else if(pid < 0){ 57cd: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 57d1: 79 16 jns 57e9 <bigargtest+0x137> failexit("bigargtest: fork"); 57d3: 48 bf 92 82 00 00 00 movabs $0x8292,%rdi 57da: 00 00 00 57dd: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 57e4: 00 00 00 57e7: ff d0 callq *%rax } wait(); 57e9: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 57f0: 00 00 00 57f3: ff d0 callq *%rax fd = open("bigarg-ok", 0); 57f5: be 00 00 00 00 mov $0x0,%esi 57fa: 48 bf 8a 81 00 00 00 movabs $0x818a,%rdi 5801: 00 00 00 5804: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 580b: 00 00 00 580e: ff d0 callq *%rax 5810: 89 45 f4 mov %eax,-0xc(%rbp) if(fd < 0){ 5813: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 5817: 79 16 jns 582f <bigargtest+0x17d> failexit("bigarg test"); 5819: 48 bf a3 82 00 00 00 movabs $0x82a3,%rdi 5820: 00 00 00 5823: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 582a: 00 00 00 582d: ff d0 callq *%rax } close(fd); 582f: 8b 45 f4 mov -0xc(%rbp),%eax 5832: 89 c7 mov %eax,%edi 5834: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 583b: 00 00 00 583e: ff d0 callq *%rax unlink("bigarg-ok"); 5840: 48 bf 8a 81 00 00 00 movabs $0x818a,%rdi 5847: 00 00 00 584a: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 5851: 00 00 00 5854: ff d0 callq *%rax } 5856: 90 nop 5857: c9 leaveq 5858: c3 retq 0000000000005859 <fsfull>: // what happens when the file system runs out of blocks? // answer: balloc panics, so this test is not useful. void fsfull() { 5859: f3 0f 1e fa endbr64 585d: 55 push %rbp 585e: 48 89 e5 mov %rsp,%rbp 5861: 48 83 ec 60 sub $0x60,%rsp int nfiles; int fsblocks = 0; 5865: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%rbp) printf(1, "fsfull test\n"); 586c: 48 be af 82 00 00 00 movabs $0x82af,%rsi 5873: 00 00 00 5876: bf 01 00 00 00 mov $0x1,%edi 587b: b8 00 00 00 00 mov $0x0,%eax 5880: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5887: 00 00 00 588a: ff d2 callq *%rdx for(nfiles = 0; ; nfiles++){ 588c: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) char name[64]; name[0] = 'f'; 5893: c6 45 a0 66 movb $0x66,-0x60(%rbp) name[1] = '0' + nfiles / 1000; 5897: 8b 45 fc mov -0x4(%rbp),%eax 589a: 48 63 d0 movslq %eax,%rdx 589d: 48 69 d2 d3 4d 62 10 imul $0x10624dd3,%rdx,%rdx 58a4: 48 c1 ea 20 shr $0x20,%rdx 58a8: c1 fa 06 sar $0x6,%edx 58ab: c1 f8 1f sar $0x1f,%eax 58ae: 29 c2 sub %eax,%edx 58b0: 89 d0 mov %edx,%eax 58b2: 83 c0 30 add $0x30,%eax 58b5: 88 45 a1 mov %al,-0x5f(%rbp) name[2] = '0' + (nfiles % 1000) / 100; 58b8: 8b 55 fc mov -0x4(%rbp),%edx 58bb: 48 63 c2 movslq %edx,%rax 58be: 48 69 c0 d3 4d 62 10 imul $0x10624dd3,%rax,%rax 58c5: 48 c1 e8 20 shr $0x20,%rax 58c9: 89 c1 mov %eax,%ecx 58cb: c1 f9 06 sar $0x6,%ecx 58ce: 89 d0 mov %edx,%eax 58d0: c1 f8 1f sar $0x1f,%eax 58d3: 29 c1 sub %eax,%ecx 58d5: 89 c8 mov %ecx,%eax 58d7: 69 c0 e8 03 00 00 imul $0x3e8,%eax,%eax 58dd: 29 c2 sub %eax,%edx 58df: 89 d0 mov %edx,%eax 58e1: 48 63 d0 movslq %eax,%rdx 58e4: 48 69 d2 1f 85 eb 51 imul $0x51eb851f,%rdx,%rdx 58eb: 48 c1 ea 20 shr $0x20,%rdx 58ef: c1 fa 05 sar $0x5,%edx 58f2: c1 f8 1f sar $0x1f,%eax 58f5: 29 c2 sub %eax,%edx 58f7: 89 d0 mov %edx,%eax 58f9: 83 c0 30 add $0x30,%eax 58fc: 88 45 a2 mov %al,-0x5e(%rbp) name[3] = '0' + (nfiles % 100) / 10; 58ff: 8b 55 fc mov -0x4(%rbp),%edx 5902: 48 63 c2 movslq %edx,%rax 5905: 48 69 c0 1f 85 eb 51 imul $0x51eb851f,%rax,%rax 590c: 48 c1 e8 20 shr $0x20,%rax 5910: 89 c1 mov %eax,%ecx 5912: c1 f9 05 sar $0x5,%ecx 5915: 89 d0 mov %edx,%eax 5917: c1 f8 1f sar $0x1f,%eax 591a: 29 c1 sub %eax,%ecx 591c: 89 c8 mov %ecx,%eax 591e: 6b c0 64 imul $0x64,%eax,%eax 5921: 29 c2 sub %eax,%edx 5923: 89 d0 mov %edx,%eax 5925: 48 63 d0 movslq %eax,%rdx 5928: 48 69 d2 67 66 66 66 imul $0x66666667,%rdx,%rdx 592f: 48 c1 ea 20 shr $0x20,%rdx 5933: c1 fa 02 sar $0x2,%edx 5936: c1 f8 1f sar $0x1f,%eax 5939: 29 c2 sub %eax,%edx 593b: 89 d0 mov %edx,%eax 593d: 83 c0 30 add $0x30,%eax 5940: 88 45 a3 mov %al,-0x5d(%rbp) name[4] = '0' + (nfiles % 10); 5943: 8b 4d fc mov -0x4(%rbp),%ecx 5946: 48 63 c1 movslq %ecx,%rax 5949: 48 69 c0 67 66 66 66 imul $0x66666667,%rax,%rax 5950: 48 c1 e8 20 shr $0x20,%rax 5954: 89 c2 mov %eax,%edx 5956: c1 fa 02 sar $0x2,%edx 5959: 89 c8 mov %ecx,%eax 595b: c1 f8 1f sar $0x1f,%eax 595e: 29 c2 sub %eax,%edx 5960: 89 d0 mov %edx,%eax 5962: c1 e0 02 shl $0x2,%eax 5965: 01 d0 add %edx,%eax 5967: 01 c0 add %eax,%eax 5969: 29 c1 sub %eax,%ecx 596b: 89 ca mov %ecx,%edx 596d: 89 d0 mov %edx,%eax 596f: 83 c0 30 add $0x30,%eax 5972: 88 45 a4 mov %al,-0x5c(%rbp) name[5] = '\0'; 5975: c6 45 a5 00 movb $0x0,-0x5b(%rbp) printf(1, "writing %s\n", name); 5979: 48 8d 45 a0 lea -0x60(%rbp),%rax 597d: 48 89 c2 mov %rax,%rdx 5980: 48 be bc 82 00 00 00 movabs $0x82bc,%rsi 5987: 00 00 00 598a: bf 01 00 00 00 mov $0x1,%edi 598f: b8 00 00 00 00 mov $0x0,%eax 5994: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 599b: 00 00 00 599e: ff d1 callq *%rcx int fd = open(name, O_CREATE|O_RDWR); 59a0: 48 8d 45 a0 lea -0x60(%rbp),%rax 59a4: be 02 02 00 00 mov $0x202,%esi 59a9: 48 89 c7 mov %rax,%rdi 59ac: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 59b3: 00 00 00 59b6: ff d0 callq *%rax 59b8: 89 45 f0 mov %eax,-0x10(%rbp) if(fd < 0){ 59bb: 83 7d f0 00 cmpl $0x0,-0x10(%rbp) 59bf: 79 2c jns 59ed <fsfull+0x194> printf(1, "open %s failed\n", name); 59c1: 48 8d 45 a0 lea -0x60(%rbp),%rax 59c5: 48 89 c2 mov %rax,%rdx 59c8: 48 be c8 82 00 00 00 movabs $0x82c8,%rsi 59cf: 00 00 00 59d2: bf 01 00 00 00 mov $0x1,%edi 59d7: b8 00 00 00 00 mov $0x0,%eax 59dc: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 59e3: 00 00 00 59e6: ff d1 callq *%rcx break; 59e8: e9 86 00 00 00 jmpq 5a73 <fsfull+0x21a> } int total = 0; 59ed: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) while(1){ int cc = write(fd, buf, 512); 59f4: 8b 45 f0 mov -0x10(%rbp),%eax 59f7: ba 00 02 00 00 mov $0x200,%edx 59fc: 48 be 00 8c 00 00 00 movabs $0x8c00,%rsi 5a03: 00 00 00 5a06: 89 c7 mov %eax,%edi 5a08: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 5a0f: 00 00 00 5a12: ff d0 callq *%rax 5a14: 89 45 ec mov %eax,-0x14(%rbp) if(cc < 512) 5a17: 81 7d ec ff 01 00 00 cmpl $0x1ff,-0x14(%rbp) 5a1e: 7e 0c jle 5a2c <fsfull+0x1d3> break; total += cc; 5a20: 8b 45 ec mov -0x14(%rbp),%eax 5a23: 01 45 f4 add %eax,-0xc(%rbp) fsblocks++; 5a26: 83 45 f8 01 addl $0x1,-0x8(%rbp) while(1){ 5a2a: eb c8 jmp 59f4 <fsfull+0x19b> break; 5a2c: 90 nop } printf(1, "wrote %d bytes\n", total); 5a2d: 8b 45 f4 mov -0xc(%rbp),%eax 5a30: 89 c2 mov %eax,%edx 5a32: 48 be d8 82 00 00 00 movabs $0x82d8,%rsi 5a39: 00 00 00 5a3c: bf 01 00 00 00 mov $0x1,%edi 5a41: b8 00 00 00 00 mov $0x0,%eax 5a46: 48 b9 04 66 00 00 00 movabs $0x6604,%rcx 5a4d: 00 00 00 5a50: ff d1 callq *%rcx close(fd); 5a52: 8b 45 f0 mov -0x10(%rbp),%eax 5a55: 89 c7 mov %eax,%edi 5a57: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 5a5e: 00 00 00 5a61: ff d0 callq *%rax if(total == 0) 5a63: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 5a67: 74 09 je 5a72 <fsfull+0x219> for(nfiles = 0; ; nfiles++){ 5a69: 83 45 fc 01 addl $0x1,-0x4(%rbp) 5a6d: e9 21 fe ff ff jmpq 5893 <fsfull+0x3a> break; 5a72: 90 nop } while(nfiles >= 0){ 5a73: e9 fd 00 00 00 jmpq 5b75 <fsfull+0x31c> char name[64]; name[0] = 'f'; 5a78: c6 45 a0 66 movb $0x66,-0x60(%rbp) name[1] = '0' + nfiles / 1000; 5a7c: 8b 45 fc mov -0x4(%rbp),%eax 5a7f: 48 63 d0 movslq %eax,%rdx 5a82: 48 69 d2 d3 4d 62 10 imul $0x10624dd3,%rdx,%rdx 5a89: 48 c1 ea 20 shr $0x20,%rdx 5a8d: c1 fa 06 sar $0x6,%edx 5a90: c1 f8 1f sar $0x1f,%eax 5a93: 29 c2 sub %eax,%edx 5a95: 89 d0 mov %edx,%eax 5a97: 83 c0 30 add $0x30,%eax 5a9a: 88 45 a1 mov %al,-0x5f(%rbp) name[2] = '0' + (nfiles % 1000) / 100; 5a9d: 8b 55 fc mov -0x4(%rbp),%edx 5aa0: 48 63 c2 movslq %edx,%rax 5aa3: 48 69 c0 d3 4d 62 10 imul $0x10624dd3,%rax,%rax 5aaa: 48 c1 e8 20 shr $0x20,%rax 5aae: 89 c1 mov %eax,%ecx 5ab0: c1 f9 06 sar $0x6,%ecx 5ab3: 89 d0 mov %edx,%eax 5ab5: c1 f8 1f sar $0x1f,%eax 5ab8: 29 c1 sub %eax,%ecx 5aba: 89 c8 mov %ecx,%eax 5abc: 69 c0 e8 03 00 00 imul $0x3e8,%eax,%eax 5ac2: 29 c2 sub %eax,%edx 5ac4: 89 d0 mov %edx,%eax 5ac6: 48 63 d0 movslq %eax,%rdx 5ac9: 48 69 d2 1f 85 eb 51 imul $0x51eb851f,%rdx,%rdx 5ad0: 48 c1 ea 20 shr $0x20,%rdx 5ad4: c1 fa 05 sar $0x5,%edx 5ad7: c1 f8 1f sar $0x1f,%eax 5ada: 29 c2 sub %eax,%edx 5adc: 89 d0 mov %edx,%eax 5ade: 83 c0 30 add $0x30,%eax 5ae1: 88 45 a2 mov %al,-0x5e(%rbp) name[3] = '0' + (nfiles % 100) / 10; 5ae4: 8b 55 fc mov -0x4(%rbp),%edx 5ae7: 48 63 c2 movslq %edx,%rax 5aea: 48 69 c0 1f 85 eb 51 imul $0x51eb851f,%rax,%rax 5af1: 48 c1 e8 20 shr $0x20,%rax 5af5: 89 c1 mov %eax,%ecx 5af7: c1 f9 05 sar $0x5,%ecx 5afa: 89 d0 mov %edx,%eax 5afc: c1 f8 1f sar $0x1f,%eax 5aff: 29 c1 sub %eax,%ecx 5b01: 89 c8 mov %ecx,%eax 5b03: 6b c0 64 imul $0x64,%eax,%eax 5b06: 29 c2 sub %eax,%edx 5b08: 89 d0 mov %edx,%eax 5b0a: 48 63 d0 movslq %eax,%rdx 5b0d: 48 69 d2 67 66 66 66 imul $0x66666667,%rdx,%rdx 5b14: 48 c1 ea 20 shr $0x20,%rdx 5b18: c1 fa 02 sar $0x2,%edx 5b1b: c1 f8 1f sar $0x1f,%eax 5b1e: 29 c2 sub %eax,%edx 5b20: 89 d0 mov %edx,%eax 5b22: 83 c0 30 add $0x30,%eax 5b25: 88 45 a3 mov %al,-0x5d(%rbp) name[4] = '0' + (nfiles % 10); 5b28: 8b 4d fc mov -0x4(%rbp),%ecx 5b2b: 48 63 c1 movslq %ecx,%rax 5b2e: 48 69 c0 67 66 66 66 imul $0x66666667,%rax,%rax 5b35: 48 c1 e8 20 shr $0x20,%rax 5b39: 89 c2 mov %eax,%edx 5b3b: c1 fa 02 sar $0x2,%edx 5b3e: 89 c8 mov %ecx,%eax 5b40: c1 f8 1f sar $0x1f,%eax 5b43: 29 c2 sub %eax,%edx 5b45: 89 d0 mov %edx,%eax 5b47: c1 e0 02 shl $0x2,%eax 5b4a: 01 d0 add %edx,%eax 5b4c: 01 c0 add %eax,%eax 5b4e: 29 c1 sub %eax,%ecx 5b50: 89 ca mov %ecx,%edx 5b52: 89 d0 mov %edx,%eax 5b54: 83 c0 30 add $0x30,%eax 5b57: 88 45 a4 mov %al,-0x5c(%rbp) name[5] = '\0'; 5b5a: c6 45 a5 00 movb $0x0,-0x5b(%rbp) unlink(name); 5b5e: 48 8d 45 a0 lea -0x60(%rbp),%rax 5b62: 48 89 c7 mov %rax,%rdi 5b65: 48 b8 8f 63 00 00 00 movabs $0x638f,%rax 5b6c: 00 00 00 5b6f: ff d0 callq *%rax nfiles--; 5b71: 83 6d fc 01 subl $0x1,-0x4(%rbp) while(nfiles >= 0){ 5b75: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 5b79: 0f 89 f9 fe ff ff jns 5a78 <fsfull+0x21f> } printf(1, "fsfull test finished\n"); 5b7f: 48 be e8 82 00 00 00 movabs $0x82e8,%rsi 5b86: 00 00 00 5b89: bf 01 00 00 00 mov $0x1,%edi 5b8e: b8 00 00 00 00 mov $0x0,%eax 5b93: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5b9a: 00 00 00 5b9d: ff d2 callq *%rdx } 5b9f: 90 nop 5ba0: c9 leaveq 5ba1: c3 retq 0000000000005ba2 <uio>: void uio() { 5ba2: f3 0f 1e fa endbr64 5ba6: 55 push %rbp 5ba7: 48 89 e5 mov %rsp,%rbp 5baa: 48 83 ec 10 sub $0x10,%rsp #define RTC_ADDR 0x70 #define RTC_DATA 0x71 ushort port = 0; 5bae: 66 c7 45 fe 00 00 movw $0x0,-0x2(%rbp) uchar val = 0; 5bb4: c6 45 fd 00 movb $0x0,-0x3(%rbp) int pid; printf(1, "uio test\n"); 5bb8: 48 be fe 82 00 00 00 movabs $0x82fe,%rsi 5bbf: 00 00 00 5bc2: bf 01 00 00 00 mov $0x1,%edi 5bc7: b8 00 00 00 00 mov $0x0,%eax 5bcc: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5bd3: 00 00 00 5bd6: ff d2 callq *%rdx pid = fork(); 5bd8: 48 b8 00 63 00 00 00 movabs $0x6300,%rax 5bdf: 00 00 00 5be2: ff d0 callq *%rax 5be4: 89 45 f8 mov %eax,-0x8(%rbp) if(pid == 0){ 5be7: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 5beb: 75 4f jne 5c3c <uio+0x9a> port = RTC_ADDR; 5bed: 66 c7 45 fe 70 00 movw $0x70,-0x2(%rbp) val = 0x09; /* year */ 5bf3: c6 45 fd 09 movb $0x9,-0x3(%rbp) /* http://wiki.osdev.org/Inline_Assembly/Examples */ asm volatile("outb %0,%1"::"a"(val), "d" (port)); 5bf7: 0f b6 45 fd movzbl -0x3(%rbp),%eax 5bfb: 0f b7 55 fe movzwl -0x2(%rbp),%edx 5bff: ee out %al,(%dx) port = RTC_DATA; 5c00: 66 c7 45 fe 71 00 movw $0x71,-0x2(%rbp) asm volatile("inb %1,%0" : "=a" (val) : "d" (port)); 5c06: 0f b7 45 fe movzwl -0x2(%rbp),%eax 5c0a: 89 c2 mov %eax,%edx 5c0c: ec in (%dx),%al 5c0d: 88 45 fd mov %al,-0x3(%rbp) printf(1, "uio test succeeded\n"); 5c10: 48 be 08 83 00 00 00 movabs $0x8308,%rsi 5c17: 00 00 00 5c1a: bf 01 00 00 00 mov $0x1,%edi 5c1f: b8 00 00 00 00 mov $0x0,%eax 5c24: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5c2b: 00 00 00 5c2e: ff d2 callq *%rdx exit(); 5c30: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 5c37: 00 00 00 5c3a: ff d0 callq *%rax } else if(pid < 0){ 5c3c: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 5c40: 79 16 jns 5c58 <uio+0xb6> failexit("fork"); 5c42: 48 bf a7 6d 00 00 00 movabs $0x6da7,%rdi 5c49: 00 00 00 5c4c: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 5c53: 00 00 00 5c56: ff d0 callq *%rax } wait(); 5c58: 48 b8 1a 63 00 00 00 movabs $0x631a,%rax 5c5f: 00 00 00 5c62: ff d0 callq *%rax printf(1, "uio test done\n"); 5c64: 48 be 1c 83 00 00 00 movabs $0x831c,%rsi 5c6b: 00 00 00 5c6e: bf 01 00 00 00 mov $0x1,%edi 5c73: b8 00 00 00 00 mov $0x0,%eax 5c78: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5c7f: 00 00 00 5c82: ff d2 callq *%rdx } 5c84: 90 nop 5c85: c9 leaveq 5c86: c3 retq 0000000000005c87 <argptest>: void argptest() { 5c87: f3 0f 1e fa endbr64 5c8b: 55 push %rbp 5c8c: 48 89 e5 mov %rsp,%rbp 5c8f: 48 83 ec 10 sub $0x10,%rsp int fd; fd = open("init", O_RDONLY); 5c93: be 00 00 00 00 mov $0x0,%esi 5c98: 48 bf 2b 83 00 00 00 movabs $0x832b,%rdi 5c9f: 00 00 00 5ca2: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 5ca9: 00 00 00 5cac: ff d0 callq *%rax 5cae: 89 45 fc mov %eax,-0x4(%rbp) if (fd < 0) { 5cb1: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 5cb5: 79 16 jns 5ccd <argptest+0x46> failexit("open"); 5cb7: 48 bf 30 83 00 00 00 movabs $0x8330,%rdi 5cbe: 00 00 00 5cc1: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 5cc8: 00 00 00 5ccb: ff d0 callq *%rax } read(fd, sbrk(0) - 1, -1); 5ccd: bf 00 00 00 00 mov $0x0,%edi 5cd2: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 5cd9: 00 00 00 5cdc: ff d0 callq *%rax 5cde: 48 8d 48 ff lea -0x1(%rax),%rcx 5ce2: 8b 45 fc mov -0x4(%rbp),%eax 5ce5: ba ff ff ff ff mov $0xffffffff,%edx 5cea: 48 89 ce mov %rcx,%rsi 5ced: 89 c7 mov %eax,%edi 5cef: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 5cf6: 00 00 00 5cf9: ff d0 callq *%rax close(fd); 5cfb: 8b 45 fc mov -0x4(%rbp),%eax 5cfe: 89 c7 mov %eax,%edi 5d00: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 5d07: 00 00 00 5d0a: ff d0 callq *%rax printf(1, "arg test passed\n"); 5d0c: 48 be 35 83 00 00 00 movabs $0x8335,%rsi 5d13: 00 00 00 5d16: bf 01 00 00 00 mov $0x1,%edi 5d1b: b8 00 00 00 00 mov $0x0,%eax 5d20: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5d27: 00 00 00 5d2a: ff d2 callq *%rdx } 5d2c: 90 nop 5d2d: c9 leaveq 5d2e: c3 retq 0000000000005d2f <rand>: unsigned long randstate = 1; unsigned int rand() { 5d2f: f3 0f 1e fa endbr64 5d33: 55 push %rbp 5d34: 48 89 e5 mov %rsp,%rbp randstate = randstate * 1664525 + 1013904223; 5d37: 48 b8 c8 8b 00 00 00 movabs $0x8bc8,%rax 5d3e: 00 00 00 5d41: 48 8b 00 mov (%rax),%rax 5d44: 48 69 c0 0d 66 19 00 imul $0x19660d,%rax,%rax 5d4b: 48 8d 90 5f f3 6e 3c lea 0x3c6ef35f(%rax),%rdx 5d52: 48 b8 c8 8b 00 00 00 movabs $0x8bc8,%rax 5d59: 00 00 00 5d5c: 48 89 10 mov %rdx,(%rax) return randstate; 5d5f: 48 b8 c8 8b 00 00 00 movabs $0x8bc8,%rax 5d66: 00 00 00 5d69: 48 8b 00 mov (%rax),%rax } 5d6c: 5d pop %rbp 5d6d: c3 retq 0000000000005d6e <main>: int main(int argc, char *argv[]) { 5d6e: f3 0f 1e fa endbr64 5d72: 55 push %rbp 5d73: 48 89 e5 mov %rsp,%rbp 5d76: 48 83 ec 10 sub $0x10,%rsp 5d7a: 89 7d fc mov %edi,-0x4(%rbp) 5d7d: 48 89 75 f0 mov %rsi,-0x10(%rbp) printf(1, "usertests starting\n"); 5d81: 48 be 46 83 00 00 00 movabs $0x8346,%rsi 5d88: 00 00 00 5d8b: bf 01 00 00 00 mov $0x1,%edi 5d90: b8 00 00 00 00 mov $0x0,%eax 5d95: 48 ba 04 66 00 00 00 movabs $0x6604,%rdx 5d9c: 00 00 00 5d9f: ff d2 callq *%rdx if(open("usertests.ran", 0) >= 0){ 5da1: be 00 00 00 00 mov $0x0,%esi 5da6: 48 bf 5a 83 00 00 00 movabs $0x835a,%rdi 5dad: 00 00 00 5db0: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 5db7: 00 00 00 5dba: ff d0 callq *%rax 5dbc: 85 c0 test %eax,%eax 5dbe: 78 16 js 5dd6 <main+0x68> failexit("already ran user tests -- rebuild fs.img"); 5dc0: 48 bf 68 83 00 00 00 movabs $0x8368,%rdi 5dc7: 00 00 00 5dca: 48 b8 00 10 00 00 00 movabs $0x1000,%rax 5dd1: 00 00 00 5dd4: ff d0 callq *%rax } close(open("usertests.ran", O_CREATE)); 5dd6: be 00 02 00 00 mov $0x200,%esi 5ddb: 48 bf 5a 83 00 00 00 movabs $0x835a,%rdi 5de2: 00 00 00 5de5: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 5dec: 00 00 00 5def: ff d0 callq *%rax 5df1: 89 c7 mov %eax,%edi 5df3: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 5dfa: 00 00 00 5dfd: ff d0 callq *%rax argptest(); 5dff: b8 00 00 00 00 mov $0x0,%eax 5e04: 48 ba 87 5c 00 00 00 movabs $0x5c87,%rdx 5e0b: 00 00 00 5e0e: ff d2 callq *%rdx createdelete(); 5e10: 48 b8 68 29 00 00 00 movabs $0x2968,%rax 5e17: 00 00 00 5e1a: ff d0 callq *%rax linkunlink(); 5e1c: b8 00 00 00 00 mov $0x0,%eax 5e21: 48 ba 41 36 00 00 00 movabs $0x3641,%rdx 5e28: 00 00 00 5e2b: ff d2 callq *%rdx concreate(); 5e2d: 48 b8 5e 31 00 00 00 movabs $0x315e,%rax 5e34: 00 00 00 5e37: ff d0 callq *%rax fourfiles(); 5e39: 48 b8 58 26 00 00 00 movabs $0x2658,%rax 5e40: 00 00 00 5e43: ff d0 callq *%rax sharedfd(); 5e45: 48 b8 be 23 00 00 00 movabs $0x23be,%rax 5e4c: 00 00 00 5e4f: ff d0 callq *%rax bigargtest(); 5e51: 48 b8 b2 56 00 00 00 movabs $0x56b2,%rax 5e58: 00 00 00 5e5b: ff d0 callq *%rax bigwrite(); 5e5d: 48 b8 08 42 00 00 00 movabs $0x4208,%rax 5e64: 00 00 00 5e67: ff d0 callq *%rax bigargtest(); 5e69: 48 b8 b2 56 00 00 00 movabs $0x56b2,%rax 5e70: 00 00 00 5e73: ff d0 callq *%rax bsstest(); 5e75: 48 b8 1f 56 00 00 00 movabs $0x561f,%rax 5e7c: 00 00 00 5e7f: ff d0 callq *%rax sbrktest(); 5e81: 48 b8 98 4e 00 00 00 movabs $0x4e98,%rax 5e88: 00 00 00 5e8b: ff d0 callq *%rax validatetest(); 5e8d: 48 b8 74 55 00 00 00 movabs $0x5574,%rax 5e94: 00 00 00 5e97: ff d0 callq *%rax opentest(); 5e99: 48 b8 bd 13 00 00 00 movabs $0x13bd,%rax 5ea0: 00 00 00 5ea3: ff d0 callq *%rax writetest(); 5ea5: 48 b8 91 14 00 00 00 movabs $0x1491,%rax 5eac: 00 00 00 5eaf: ff d0 callq *%rax writetest1(); 5eb1: 48 b8 ba 16 00 00 00 movabs $0x16ba,%rax 5eb8: 00 00 00 5ebb: ff d0 callq *%rax createtest(); 5ebd: 48 b8 41 19 00 00 00 movabs $0x1941,%rax 5ec4: 00 00 00 5ec7: ff d0 callq *%rax openiputtest(); 5ec9: 48 b8 7a 12 00 00 00 movabs $0x127a,%rax 5ed0: 00 00 00 5ed3: ff d0 callq *%rax exitiputtest(); 5ed5: 48 b8 4e 11 00 00 00 movabs $0x114e,%rax 5edc: 00 00 00 5edf: ff d0 callq *%rax iputtest(); 5ee1: 48 b8 43 10 00 00 00 movabs $0x1043,%rax 5ee8: 00 00 00 5eeb: ff d0 callq *%rax mem(); 5eed: 48 b8 3b 22 00 00 00 movabs $0x223b,%rax 5ef4: 00 00 00 5ef7: ff d0 callq *%rax pipe1(); 5ef9: 48 b8 15 1d 00 00 00 movabs $0x1d15,%rax 5f00: 00 00 00 5f03: ff d0 callq *%rax preempt(); 5f05: 48 b8 67 1f 00 00 00 movabs $0x1f67,%rax 5f0c: 00 00 00 5f0f: ff d0 callq *%rax exitwait(); 5f11: 48 b8 77 21 00 00 00 movabs $0x2177,%rax 5f18: 00 00 00 5f1b: ff d0 callq *%rax nullptr(); 5f1d: 48 b8 32 1c 00 00 00 movabs $0x1c32,%rax 5f24: 00 00 00 5f27: ff d0 callq *%rax rmdot(); 5f29: 48 b8 86 47 00 00 00 movabs $0x4786,%rax 5f30: 00 00 00 5f33: ff d0 callq *%rax fourteen(); 5f35: 48 b8 e1 45 00 00 00 movabs $0x45e1,%rax 5f3c: 00 00 00 5f3f: ff d0 callq *%rax bigfile(); 5f41: 48 b8 61 43 00 00 00 movabs $0x4361,%rax 5f48: 00 00 00 5f4b: ff d0 callq *%rax subdir(); 5f4d: 48 b8 91 39 00 00 00 movabs $0x3991,%rax 5f54: 00 00 00 5f57: ff d0 callq *%rax linktest(); 5f59: 48 b8 8e 2e 00 00 00 movabs $0x2e8e,%rax 5f60: 00 00 00 5f63: ff d0 callq *%rax unlinkread(); 5f65: 48 b8 57 2c 00 00 00 movabs $0x2c57,%rax 5f6c: 00 00 00 5f6f: ff d0 callq *%rax dirfile(); 5f71: 48 b8 51 49 00 00 00 movabs $0x4951,%rax 5f78: 00 00 00 5f7b: ff d0 callq *%rax iref(); 5f7d: 48 b8 fc 4b 00 00 00 movabs $0x4bfc,%rax 5f84: 00 00 00 5f87: ff d0 callq *%rax forktest(); 5f89: 48 b8 91 4d 00 00 00 movabs $0x4d91,%rax 5f90: 00 00 00 5f93: ff d0 callq *%rax bigdir(); // slow 5f95: 48 b8 db 37 00 00 00 movabs $0x37db,%rax 5f9c: 00 00 00 5f9f: ff d0 callq *%rax uio(); 5fa1: b8 00 00 00 00 mov $0x0,%eax 5fa6: 48 ba a2 5b 00 00 00 movabs $0x5ba2,%rdx 5fad: 00 00 00 5fb0: ff d2 callq *%rdx exectest(); // will exit 5fb2: 48 b8 ad 1b 00 00 00 movabs $0x1bad,%rax 5fb9: 00 00 00 5fbc: ff d0 callq *%rax exit(); 5fbe: 48 b8 0d 63 00 00 00 movabs $0x630d,%rax 5fc5: 00 00 00 5fc8: ff d0 callq *%rax 0000000000005fca <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 5fca: f3 0f 1e fa endbr64 5fce: 55 push %rbp 5fcf: 48 89 e5 mov %rsp,%rbp 5fd2: 48 83 ec 10 sub $0x10,%rsp 5fd6: 48 89 7d f8 mov %rdi,-0x8(%rbp) 5fda: 89 75 f4 mov %esi,-0xc(%rbp) 5fdd: 89 55 f0 mov %edx,-0x10(%rbp) asm volatile("cld; rep stosb" : 5fe0: 48 8b 4d f8 mov -0x8(%rbp),%rcx 5fe4: 8b 55 f0 mov -0x10(%rbp),%edx 5fe7: 8b 45 f4 mov -0xc(%rbp),%eax 5fea: 48 89 ce mov %rcx,%rsi 5fed: 48 89 f7 mov %rsi,%rdi 5ff0: 89 d1 mov %edx,%ecx 5ff2: fc cld 5ff3: f3 aa rep stos %al,%es:(%rdi) 5ff5: 89 ca mov %ecx,%edx 5ff7: 48 89 fe mov %rdi,%rsi 5ffa: 48 89 75 f8 mov %rsi,-0x8(%rbp) 5ffe: 89 55 f0 mov %edx,-0x10(%rbp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 6001: 90 nop 6002: c9 leaveq 6003: c3 retq 0000000000006004 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 6004: f3 0f 1e fa endbr64 6008: 55 push %rbp 6009: 48 89 e5 mov %rsp,%rbp 600c: 48 83 ec 20 sub $0x20,%rsp 6010: 48 89 7d e8 mov %rdi,-0x18(%rbp) 6014: 48 89 75 e0 mov %rsi,-0x20(%rbp) char *os; os = s; 6018: 48 8b 45 e8 mov -0x18(%rbp),%rax 601c: 48 89 45 f8 mov %rax,-0x8(%rbp) while((*s++ = *t++) != 0) 6020: 90 nop 6021: 48 8b 55 e0 mov -0x20(%rbp),%rdx 6025: 48 8d 42 01 lea 0x1(%rdx),%rax 6029: 48 89 45 e0 mov %rax,-0x20(%rbp) 602d: 48 8b 45 e8 mov -0x18(%rbp),%rax 6031: 48 8d 48 01 lea 0x1(%rax),%rcx 6035: 48 89 4d e8 mov %rcx,-0x18(%rbp) 6039: 0f b6 12 movzbl (%rdx),%edx 603c: 88 10 mov %dl,(%rax) 603e: 0f b6 00 movzbl (%rax),%eax 6041: 84 c0 test %al,%al 6043: 75 dc jne 6021 <strcpy+0x1d> ; return os; 6045: 48 8b 45 f8 mov -0x8(%rbp),%rax } 6049: c9 leaveq 604a: c3 retq 000000000000604b <strcmp>: int strcmp(const char *p, const char *q) { 604b: f3 0f 1e fa endbr64 604f: 55 push %rbp 6050: 48 89 e5 mov %rsp,%rbp 6053: 48 83 ec 10 sub $0x10,%rsp 6057: 48 89 7d f8 mov %rdi,-0x8(%rbp) 605b: 48 89 75 f0 mov %rsi,-0x10(%rbp) while(*p && *p == *q) 605f: eb 0a jmp 606b <strcmp+0x20> p++, q++; 6061: 48 83 45 f8 01 addq $0x1,-0x8(%rbp) 6066: 48 83 45 f0 01 addq $0x1,-0x10(%rbp) while(*p && *p == *q) 606b: 48 8b 45 f8 mov -0x8(%rbp),%rax 606f: 0f b6 00 movzbl (%rax),%eax 6072: 84 c0 test %al,%al 6074: 74 12 je 6088 <strcmp+0x3d> 6076: 48 8b 45 f8 mov -0x8(%rbp),%rax 607a: 0f b6 10 movzbl (%rax),%edx 607d: 48 8b 45 f0 mov -0x10(%rbp),%rax 6081: 0f b6 00 movzbl (%rax),%eax 6084: 38 c2 cmp %al,%dl 6086: 74 d9 je 6061 <strcmp+0x16> return (uchar)*p - (uchar)*q; 6088: 48 8b 45 f8 mov -0x8(%rbp),%rax 608c: 0f b6 00 movzbl (%rax),%eax 608f: 0f b6 d0 movzbl %al,%edx 6092: 48 8b 45 f0 mov -0x10(%rbp),%rax 6096: 0f b6 00 movzbl (%rax),%eax 6099: 0f b6 c0 movzbl %al,%eax 609c: 29 c2 sub %eax,%edx 609e: 89 d0 mov %edx,%eax } 60a0: c9 leaveq 60a1: c3 retq 00000000000060a2 <strlen>: uint strlen(char *s) { 60a2: f3 0f 1e fa endbr64 60a6: 55 push %rbp 60a7: 48 89 e5 mov %rsp,%rbp 60aa: 48 83 ec 18 sub $0x18,%rsp 60ae: 48 89 7d e8 mov %rdi,-0x18(%rbp) int n; for(n = 0; s[n]; n++) 60b2: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 60b9: eb 04 jmp 60bf <strlen+0x1d> 60bb: 83 45 fc 01 addl $0x1,-0x4(%rbp) 60bf: 8b 45 fc mov -0x4(%rbp),%eax 60c2: 48 63 d0 movslq %eax,%rdx 60c5: 48 8b 45 e8 mov -0x18(%rbp),%rax 60c9: 48 01 d0 add %rdx,%rax 60cc: 0f b6 00 movzbl (%rax),%eax 60cf: 84 c0 test %al,%al 60d1: 75 e8 jne 60bb <strlen+0x19> ; return n; 60d3: 8b 45 fc mov -0x4(%rbp),%eax } 60d6: c9 leaveq 60d7: c3 retq 00000000000060d8 <memset>: void* memset(void *dst, int c, uint n) { 60d8: f3 0f 1e fa endbr64 60dc: 55 push %rbp 60dd: 48 89 e5 mov %rsp,%rbp 60e0: 48 83 ec 10 sub $0x10,%rsp 60e4: 48 89 7d f8 mov %rdi,-0x8(%rbp) 60e8: 89 75 f4 mov %esi,-0xc(%rbp) 60eb: 89 55 f0 mov %edx,-0x10(%rbp) stosb(dst, c, n); 60ee: 8b 55 f0 mov -0x10(%rbp),%edx 60f1: 8b 4d f4 mov -0xc(%rbp),%ecx 60f4: 48 8b 45 f8 mov -0x8(%rbp),%rax 60f8: 89 ce mov %ecx,%esi 60fa: 48 89 c7 mov %rax,%rdi 60fd: 48 b8 ca 5f 00 00 00 movabs $0x5fca,%rax 6104: 00 00 00 6107: ff d0 callq *%rax return dst; 6109: 48 8b 45 f8 mov -0x8(%rbp),%rax } 610d: c9 leaveq 610e: c3 retq 000000000000610f <strchr>: char* strchr(const char *s, char c) { 610f: f3 0f 1e fa endbr64 6113: 55 push %rbp 6114: 48 89 e5 mov %rsp,%rbp 6117: 48 83 ec 10 sub $0x10,%rsp 611b: 48 89 7d f8 mov %rdi,-0x8(%rbp) 611f: 89 f0 mov %esi,%eax 6121: 88 45 f4 mov %al,-0xc(%rbp) for(; *s; s++) 6124: eb 17 jmp 613d <strchr+0x2e> if(*s == c) 6126: 48 8b 45 f8 mov -0x8(%rbp),%rax 612a: 0f b6 00 movzbl (%rax),%eax 612d: 38 45 f4 cmp %al,-0xc(%rbp) 6130: 75 06 jne 6138 <strchr+0x29> return (char*)s; 6132: 48 8b 45 f8 mov -0x8(%rbp),%rax 6136: eb 15 jmp 614d <strchr+0x3e> for(; *s; s++) 6138: 48 83 45 f8 01 addq $0x1,-0x8(%rbp) 613d: 48 8b 45 f8 mov -0x8(%rbp),%rax 6141: 0f b6 00 movzbl (%rax),%eax 6144: 84 c0 test %al,%al 6146: 75 de jne 6126 <strchr+0x17> return 0; 6148: b8 00 00 00 00 mov $0x0,%eax } 614d: c9 leaveq 614e: c3 retq 000000000000614f <gets>: char* gets(char *buf, int max) { 614f: f3 0f 1e fa endbr64 6153: 55 push %rbp 6154: 48 89 e5 mov %rsp,%rbp 6157: 48 83 ec 20 sub $0x20,%rsp 615b: 48 89 7d e8 mov %rdi,-0x18(%rbp) 615f: 89 75 e4 mov %esi,-0x1c(%rbp) int i, cc; char c; for(i=0; i+1 < max; ){ 6162: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 6169: eb 4f jmp 61ba <gets+0x6b> cc = read(0, &c, 1); 616b: 48 8d 45 f7 lea -0x9(%rbp),%rax 616f: ba 01 00 00 00 mov $0x1,%edx 6174: 48 89 c6 mov %rax,%rsi 6177: bf 00 00 00 00 mov $0x0,%edi 617c: 48 b8 34 63 00 00 00 movabs $0x6334,%rax 6183: 00 00 00 6186: ff d0 callq *%rax 6188: 89 45 f8 mov %eax,-0x8(%rbp) if(cc < 1) 618b: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 618f: 7e 36 jle 61c7 <gets+0x78> break; buf[i++] = c; 6191: 8b 45 fc mov -0x4(%rbp),%eax 6194: 8d 50 01 lea 0x1(%rax),%edx 6197: 89 55 fc mov %edx,-0x4(%rbp) 619a: 48 63 d0 movslq %eax,%rdx 619d: 48 8b 45 e8 mov -0x18(%rbp),%rax 61a1: 48 01 c2 add %rax,%rdx 61a4: 0f b6 45 f7 movzbl -0x9(%rbp),%eax 61a8: 88 02 mov %al,(%rdx) if(c == '\n' || c == '\r') 61aa: 0f b6 45 f7 movzbl -0x9(%rbp),%eax 61ae: 3c 0a cmp $0xa,%al 61b0: 74 16 je 61c8 <gets+0x79> 61b2: 0f b6 45 f7 movzbl -0x9(%rbp),%eax 61b6: 3c 0d cmp $0xd,%al 61b8: 74 0e je 61c8 <gets+0x79> for(i=0; i+1 < max; ){ 61ba: 8b 45 fc mov -0x4(%rbp),%eax 61bd: 83 c0 01 add $0x1,%eax 61c0: 39 45 e4 cmp %eax,-0x1c(%rbp) 61c3: 7f a6 jg 616b <gets+0x1c> 61c5: eb 01 jmp 61c8 <gets+0x79> break; 61c7: 90 nop break; } buf[i] = '\0'; 61c8: 8b 45 fc mov -0x4(%rbp),%eax 61cb: 48 63 d0 movslq %eax,%rdx 61ce: 48 8b 45 e8 mov -0x18(%rbp),%rax 61d2: 48 01 d0 add %rdx,%rax 61d5: c6 00 00 movb $0x0,(%rax) return buf; 61d8: 48 8b 45 e8 mov -0x18(%rbp),%rax } 61dc: c9 leaveq 61dd: c3 retq 00000000000061de <stat>: int stat(char *n, struct stat *st) { 61de: f3 0f 1e fa endbr64 61e2: 55 push %rbp 61e3: 48 89 e5 mov %rsp,%rbp 61e6: 48 83 ec 20 sub $0x20,%rsp 61ea: 48 89 7d e8 mov %rdi,-0x18(%rbp) 61ee: 48 89 75 e0 mov %rsi,-0x20(%rbp) int fd; int r; fd = open(n, O_RDONLY); 61f2: 48 8b 45 e8 mov -0x18(%rbp),%rax 61f6: be 00 00 00 00 mov $0x0,%esi 61fb: 48 89 c7 mov %rax,%rdi 61fe: 48 b8 75 63 00 00 00 movabs $0x6375,%rax 6205: 00 00 00 6208: ff d0 callq *%rax 620a: 89 45 fc mov %eax,-0x4(%rbp) if(fd < 0) 620d: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 6211: 79 07 jns 621a <stat+0x3c> return -1; 6213: b8 ff ff ff ff mov $0xffffffff,%eax 6218: eb 2f jmp 6249 <stat+0x6b> r = fstat(fd, st); 621a: 48 8b 55 e0 mov -0x20(%rbp),%rdx 621e: 8b 45 fc mov -0x4(%rbp),%eax 6221: 48 89 d6 mov %rdx,%rsi 6224: 89 c7 mov %eax,%edi 6226: 48 b8 9c 63 00 00 00 movabs $0x639c,%rax 622d: 00 00 00 6230: ff d0 callq *%rax 6232: 89 45 f8 mov %eax,-0x8(%rbp) close(fd); 6235: 8b 45 fc mov -0x4(%rbp),%eax 6238: 89 c7 mov %eax,%edi 623a: 48 b8 4e 63 00 00 00 movabs $0x634e,%rax 6241: 00 00 00 6244: ff d0 callq *%rax return r; 6246: 8b 45 f8 mov -0x8(%rbp),%eax } 6249: c9 leaveq 624a: c3 retq 000000000000624b <atoi>: int atoi(const char *s) { 624b: f3 0f 1e fa endbr64 624f: 55 push %rbp 6250: 48 89 e5 mov %rsp,%rbp 6253: 48 83 ec 18 sub $0x18,%rsp 6257: 48 89 7d e8 mov %rdi,-0x18(%rbp) int n; n = 0; 625b: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) while('0' <= *s && *s <= '9') 6262: eb 28 jmp 628c <atoi+0x41> n = n*10 + *s++ - '0'; 6264: 8b 55 fc mov -0x4(%rbp),%edx 6267: 89 d0 mov %edx,%eax 6269: c1 e0 02 shl $0x2,%eax 626c: 01 d0 add %edx,%eax 626e: 01 c0 add %eax,%eax 6270: 89 c1 mov %eax,%ecx 6272: 48 8b 45 e8 mov -0x18(%rbp),%rax 6276: 48 8d 50 01 lea 0x1(%rax),%rdx 627a: 48 89 55 e8 mov %rdx,-0x18(%rbp) 627e: 0f b6 00 movzbl (%rax),%eax 6281: 0f be c0 movsbl %al,%eax 6284: 01 c8 add %ecx,%eax 6286: 83 e8 30 sub $0x30,%eax 6289: 89 45 fc mov %eax,-0x4(%rbp) while('0' <= *s && *s <= '9') 628c: 48 8b 45 e8 mov -0x18(%rbp),%rax 6290: 0f b6 00 movzbl (%rax),%eax 6293: 3c 2f cmp $0x2f,%al 6295: 7e 0b jle 62a2 <atoi+0x57> 6297: 48 8b 45 e8 mov -0x18(%rbp),%rax 629b: 0f b6 00 movzbl (%rax),%eax 629e: 3c 39 cmp $0x39,%al 62a0: 7e c2 jle 6264 <atoi+0x19> return n; 62a2: 8b 45 fc mov -0x4(%rbp),%eax } 62a5: c9 leaveq 62a6: c3 retq 00000000000062a7 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 62a7: f3 0f 1e fa endbr64 62ab: 55 push %rbp 62ac: 48 89 e5 mov %rsp,%rbp 62af: 48 83 ec 28 sub $0x28,%rsp 62b3: 48 89 7d e8 mov %rdi,-0x18(%rbp) 62b7: 48 89 75 e0 mov %rsi,-0x20(%rbp) 62bb: 89 55 dc mov %edx,-0x24(%rbp) char *dst, *src; dst = vdst; 62be: 48 8b 45 e8 mov -0x18(%rbp),%rax 62c2: 48 89 45 f8 mov %rax,-0x8(%rbp) src = vsrc; 62c6: 48 8b 45 e0 mov -0x20(%rbp),%rax 62ca: 48 89 45 f0 mov %rax,-0x10(%rbp) while(n-- > 0) 62ce: eb 1d jmp 62ed <memmove+0x46> *dst++ = *src++; 62d0: 48 8b 55 f0 mov -0x10(%rbp),%rdx 62d4: 48 8d 42 01 lea 0x1(%rdx),%rax 62d8: 48 89 45 f0 mov %rax,-0x10(%rbp) 62dc: 48 8b 45 f8 mov -0x8(%rbp),%rax 62e0: 48 8d 48 01 lea 0x1(%rax),%rcx 62e4: 48 89 4d f8 mov %rcx,-0x8(%rbp) 62e8: 0f b6 12 movzbl (%rdx),%edx 62eb: 88 10 mov %dl,(%rax) while(n-- > 0) 62ed: 8b 45 dc mov -0x24(%rbp),%eax 62f0: 8d 50 ff lea -0x1(%rax),%edx 62f3: 89 55 dc mov %edx,-0x24(%rbp) 62f6: 85 c0 test %eax,%eax 62f8: 7f d6 jg 62d0 <memmove+0x29> return vdst; 62fa: 48 8b 45 e8 mov -0x18(%rbp),%rax } 62fe: c9 leaveq 62ff: c3 retq 0000000000006300 <fork>: mov $SYS_ ## name, %rax; \ mov %rcx, %r10 ;\ syscall ;\ ret SYSCALL(fork) 6300: 48 c7 c0 01 00 00 00 mov $0x1,%rax 6307: 49 89 ca mov %rcx,%r10 630a: 0f 05 syscall 630c: c3 retq 000000000000630d <exit>: SYSCALL(exit) 630d: 48 c7 c0 02 00 00 00 mov $0x2,%rax 6314: 49 89 ca mov %rcx,%r10 6317: 0f 05 syscall 6319: c3 retq 000000000000631a <wait>: SYSCALL(wait) 631a: 48 c7 c0 03 00 00 00 mov $0x3,%rax 6321: 49 89 ca mov %rcx,%r10 6324: 0f 05 syscall 6326: c3 retq 0000000000006327 <pipe>: SYSCALL(pipe) 6327: 48 c7 c0 04 00 00 00 mov $0x4,%rax 632e: 49 89 ca mov %rcx,%r10 6331: 0f 05 syscall 6333: c3 retq 0000000000006334 <read>: SYSCALL(read) 6334: 48 c7 c0 05 00 00 00 mov $0x5,%rax 633b: 49 89 ca mov %rcx,%r10 633e: 0f 05 syscall 6340: c3 retq 0000000000006341 <write>: SYSCALL(write) 6341: 48 c7 c0 10 00 00 00 mov $0x10,%rax 6348: 49 89 ca mov %rcx,%r10 634b: 0f 05 syscall 634d: c3 retq 000000000000634e <close>: SYSCALL(close) 634e: 48 c7 c0 15 00 00 00 mov $0x15,%rax 6355: 49 89 ca mov %rcx,%r10 6358: 0f 05 syscall 635a: c3 retq 000000000000635b <kill>: SYSCALL(kill) 635b: 48 c7 c0 06 00 00 00 mov $0x6,%rax 6362: 49 89 ca mov %rcx,%r10 6365: 0f 05 syscall 6367: c3 retq 0000000000006368 <exec>: SYSCALL(exec) 6368: 48 c7 c0 07 00 00 00 mov $0x7,%rax 636f: 49 89 ca mov %rcx,%r10 6372: 0f 05 syscall 6374: c3 retq 0000000000006375 <open>: SYSCALL(open) 6375: 48 c7 c0 0f 00 00 00 mov $0xf,%rax 637c: 49 89 ca mov %rcx,%r10 637f: 0f 05 syscall 6381: c3 retq 0000000000006382 <mknod>: SYSCALL(mknod) 6382: 48 c7 c0 11 00 00 00 mov $0x11,%rax 6389: 49 89 ca mov %rcx,%r10 638c: 0f 05 syscall 638e: c3 retq 000000000000638f <unlink>: SYSCALL(unlink) 638f: 48 c7 c0 12 00 00 00 mov $0x12,%rax 6396: 49 89 ca mov %rcx,%r10 6399: 0f 05 syscall 639b: c3 retq 000000000000639c <fstat>: SYSCALL(fstat) 639c: 48 c7 c0 08 00 00 00 mov $0x8,%rax 63a3: 49 89 ca mov %rcx,%r10 63a6: 0f 05 syscall 63a8: c3 retq 00000000000063a9 <link>: SYSCALL(link) 63a9: 48 c7 c0 13 00 00 00 mov $0x13,%rax 63b0: 49 89 ca mov %rcx,%r10 63b3: 0f 05 syscall 63b5: c3 retq 00000000000063b6 <mkdir>: SYSCALL(mkdir) 63b6: 48 c7 c0 14 00 00 00 mov $0x14,%rax 63bd: 49 89 ca mov %rcx,%r10 63c0: 0f 05 syscall 63c2: c3 retq 00000000000063c3 <chdir>: SYSCALL(chdir) 63c3: 48 c7 c0 09 00 00 00 mov $0x9,%rax 63ca: 49 89 ca mov %rcx,%r10 63cd: 0f 05 syscall 63cf: c3 retq 00000000000063d0 <dup>: SYSCALL(dup) 63d0: 48 c7 c0 0a 00 00 00 mov $0xa,%rax 63d7: 49 89 ca mov %rcx,%r10 63da: 0f 05 syscall 63dc: c3 retq 00000000000063dd <getpid>: SYSCALL(getpid) 63dd: 48 c7 c0 0b 00 00 00 mov $0xb,%rax 63e4: 49 89 ca mov %rcx,%r10 63e7: 0f 05 syscall 63e9: c3 retq 00000000000063ea <sbrk>: SYSCALL(sbrk) 63ea: 48 c7 c0 0c 00 00 00 mov $0xc,%rax 63f1: 49 89 ca mov %rcx,%r10 63f4: 0f 05 syscall 63f6: c3 retq 00000000000063f7 <sleep>: SYSCALL(sleep) 63f7: 48 c7 c0 0d 00 00 00 mov $0xd,%rax 63fe: 49 89 ca mov %rcx,%r10 6401: 0f 05 syscall 6403: c3 retq 0000000000006404 <uptime>: SYSCALL(uptime) 6404: 48 c7 c0 0e 00 00 00 mov $0xe,%rax 640b: 49 89 ca mov %rcx,%r10 640e: 0f 05 syscall 6410: c3 retq 0000000000006411 <aread>: SYSCALL(aread) 6411: 48 c7 c0 16 00 00 00 mov $0x16,%rax 6418: 49 89 ca mov %rcx,%r10 641b: 0f 05 syscall 641d: c3 retq 000000000000641e <putc>: #include <stdarg.h> static void putc(int fd, char c) { 641e: f3 0f 1e fa endbr64 6422: 55 push %rbp 6423: 48 89 e5 mov %rsp,%rbp 6426: 48 83 ec 10 sub $0x10,%rsp 642a: 89 7d fc mov %edi,-0x4(%rbp) 642d: 89 f0 mov %esi,%eax 642f: 88 45 f8 mov %al,-0x8(%rbp) write(fd, &c, 1); 6432: 48 8d 4d f8 lea -0x8(%rbp),%rcx 6436: 8b 45 fc mov -0x4(%rbp),%eax 6439: ba 01 00 00 00 mov $0x1,%edx 643e: 48 89 ce mov %rcx,%rsi 6441: 89 c7 mov %eax,%edi 6443: 48 b8 41 63 00 00 00 movabs $0x6341,%rax 644a: 00 00 00 644d: ff d0 callq *%rax } 644f: 90 nop 6450: c9 leaveq 6451: c3 retq 0000000000006452 <print_x64>: static char digits[] = "0123456789abcdef"; static void print_x64(int fd, addr_t x) { 6452: f3 0f 1e fa endbr64 6456: 55 push %rbp 6457: 48 89 e5 mov %rsp,%rbp 645a: 48 83 ec 20 sub $0x20,%rsp 645e: 89 7d ec mov %edi,-0x14(%rbp) 6461: 48 89 75 e0 mov %rsi,-0x20(%rbp) int i; for (i = 0; i < (sizeof(addr_t) * 2); i++, x <<= 4) 6465: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 646c: eb 35 jmp 64a3 <print_x64+0x51> putc(fd, digits[x >> (sizeof(addr_t) * 8 - 4)]); 646e: 48 8b 45 e0 mov -0x20(%rbp),%rax 6472: 48 c1 e8 3c shr $0x3c,%rax 6476: 48 ba d0 8b 00 00 00 movabs $0x8bd0,%rdx 647d: 00 00 00 6480: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax 6484: 0f be d0 movsbl %al,%edx 6487: 8b 45 ec mov -0x14(%rbp),%eax 648a: 89 d6 mov %edx,%esi 648c: 89 c7 mov %eax,%edi 648e: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 6495: 00 00 00 6498: ff d0 callq *%rax for (i = 0; i < (sizeof(addr_t) * 2); i++, x <<= 4) 649a: 83 45 fc 01 addl $0x1,-0x4(%rbp) 649e: 48 c1 65 e0 04 shlq $0x4,-0x20(%rbp) 64a3: 8b 45 fc mov -0x4(%rbp),%eax 64a6: 83 f8 0f cmp $0xf,%eax 64a9: 76 c3 jbe 646e <print_x64+0x1c> } 64ab: 90 nop 64ac: 90 nop 64ad: c9 leaveq 64ae: c3 retq 00000000000064af <print_x32>: static void print_x32(int fd, uint x) { 64af: f3 0f 1e fa endbr64 64b3: 55 push %rbp 64b4: 48 89 e5 mov %rsp,%rbp 64b7: 48 83 ec 20 sub $0x20,%rsp 64bb: 89 7d ec mov %edi,-0x14(%rbp) 64be: 89 75 e8 mov %esi,-0x18(%rbp) int i; for (i = 0; i < (sizeof(uint) * 2); i++, x <<= 4) 64c1: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) 64c8: eb 36 jmp 6500 <print_x32+0x51> putc(fd, digits[x >> (sizeof(uint) * 8 - 4)]); 64ca: 8b 45 e8 mov -0x18(%rbp),%eax 64cd: c1 e8 1c shr $0x1c,%eax 64d0: 89 c2 mov %eax,%edx 64d2: 48 b8 d0 8b 00 00 00 movabs $0x8bd0,%rax 64d9: 00 00 00 64dc: 89 d2 mov %edx,%edx 64de: 0f b6 04 10 movzbl (%rax,%rdx,1),%eax 64e2: 0f be d0 movsbl %al,%edx 64e5: 8b 45 ec mov -0x14(%rbp),%eax 64e8: 89 d6 mov %edx,%esi 64ea: 89 c7 mov %eax,%edi 64ec: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 64f3: 00 00 00 64f6: ff d0 callq *%rax for (i = 0; i < (sizeof(uint) * 2); i++, x <<= 4) 64f8: 83 45 fc 01 addl $0x1,-0x4(%rbp) 64fc: c1 65 e8 04 shll $0x4,-0x18(%rbp) 6500: 8b 45 fc mov -0x4(%rbp),%eax 6503: 83 f8 07 cmp $0x7,%eax 6506: 76 c2 jbe 64ca <print_x32+0x1b> } 6508: 90 nop 6509: 90 nop 650a: c9 leaveq 650b: c3 retq 000000000000650c <print_d>: static void print_d(int fd, int v) { 650c: f3 0f 1e fa endbr64 6510: 55 push %rbp 6511: 48 89 e5 mov %rsp,%rbp 6514: 48 83 ec 30 sub $0x30,%rsp 6518: 89 7d dc mov %edi,-0x24(%rbp) 651b: 89 75 d8 mov %esi,-0x28(%rbp) char buf[16]; int64 x = v; 651e: 8b 45 d8 mov -0x28(%rbp),%eax 6521: 48 98 cltq 6523: 48 89 45 f8 mov %rax,-0x8(%rbp) if (v < 0) 6527: 83 7d d8 00 cmpl $0x0,-0x28(%rbp) 652b: 79 04 jns 6531 <print_d+0x25> x = -x; 652d: 48 f7 5d f8 negq -0x8(%rbp) int i = 0; 6531: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) do { buf[i++] = digits[x % 10]; 6538: 48 8b 4d f8 mov -0x8(%rbp),%rcx 653c: 48 ba 67 66 66 66 66 movabs $0x6666666666666667,%rdx 6543: 66 66 66 6546: 48 89 c8 mov %rcx,%rax 6549: 48 f7 ea imul %rdx 654c: 48 c1 fa 02 sar $0x2,%rdx 6550: 48 89 c8 mov %rcx,%rax 6553: 48 c1 f8 3f sar $0x3f,%rax 6557: 48 29 c2 sub %rax,%rdx 655a: 48 89 d0 mov %rdx,%rax 655d: 48 c1 e0 02 shl $0x2,%rax 6561: 48 01 d0 add %rdx,%rax 6564: 48 01 c0 add %rax,%rax 6567: 48 29 c1 sub %rax,%rcx 656a: 48 89 ca mov %rcx,%rdx 656d: 8b 45 f4 mov -0xc(%rbp),%eax 6570: 8d 48 01 lea 0x1(%rax),%ecx 6573: 89 4d f4 mov %ecx,-0xc(%rbp) 6576: 48 b9 d0 8b 00 00 00 movabs $0x8bd0,%rcx 657d: 00 00 00 6580: 0f b6 14 11 movzbl (%rcx,%rdx,1),%edx 6584: 48 98 cltq 6586: 88 54 05 e0 mov %dl,-0x20(%rbp,%rax,1) x /= 10; 658a: 48 8b 4d f8 mov -0x8(%rbp),%rcx 658e: 48 ba 67 66 66 66 66 movabs $0x6666666666666667,%rdx 6595: 66 66 66 6598: 48 89 c8 mov %rcx,%rax 659b: 48 f7 ea imul %rdx 659e: 48 c1 fa 02 sar $0x2,%rdx 65a2: 48 89 c8 mov %rcx,%rax 65a5: 48 c1 f8 3f sar $0x3f,%rax 65a9: 48 29 c2 sub %rax,%rdx 65ac: 48 89 d0 mov %rdx,%rax 65af: 48 89 45 f8 mov %rax,-0x8(%rbp) } while(x != 0); 65b3: 48 83 7d f8 00 cmpq $0x0,-0x8(%rbp) 65b8: 0f 85 7a ff ff ff jne 6538 <print_d+0x2c> if (v < 0) 65be: 83 7d d8 00 cmpl $0x0,-0x28(%rbp) 65c2: 79 32 jns 65f6 <print_d+0xea> buf[i++] = '-'; 65c4: 8b 45 f4 mov -0xc(%rbp),%eax 65c7: 8d 50 01 lea 0x1(%rax),%edx 65ca: 89 55 f4 mov %edx,-0xc(%rbp) 65cd: 48 98 cltq 65cf: c6 44 05 e0 2d movb $0x2d,-0x20(%rbp,%rax,1) while (--i >= 0) 65d4: eb 20 jmp 65f6 <print_d+0xea> putc(fd, buf[i]); 65d6: 8b 45 f4 mov -0xc(%rbp),%eax 65d9: 48 98 cltq 65db: 0f b6 44 05 e0 movzbl -0x20(%rbp,%rax,1),%eax 65e0: 0f be d0 movsbl %al,%edx 65e3: 8b 45 dc mov -0x24(%rbp),%eax 65e6: 89 d6 mov %edx,%esi 65e8: 89 c7 mov %eax,%edi 65ea: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 65f1: 00 00 00 65f4: ff d0 callq *%rax while (--i >= 0) 65f6: 83 6d f4 01 subl $0x1,-0xc(%rbp) 65fa: 83 7d f4 00 cmpl $0x0,-0xc(%rbp) 65fe: 79 d6 jns 65d6 <print_d+0xca> } 6600: 90 nop 6601: 90 nop 6602: c9 leaveq 6603: c3 retq 0000000000006604 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 6604: f3 0f 1e fa endbr64 6608: 55 push %rbp 6609: 48 89 e5 mov %rsp,%rbp 660c: 48 81 ec f0 00 00 00 sub $0xf0,%rsp 6613: 89 bd 1c ff ff ff mov %edi,-0xe4(%rbp) 6619: 48 89 b5 10 ff ff ff mov %rsi,-0xf0(%rbp) 6620: 48 89 95 60 ff ff ff mov %rdx,-0xa0(%rbp) 6627: 48 89 8d 68 ff ff ff mov %rcx,-0x98(%rbp) 662e: 4c 89 85 70 ff ff ff mov %r8,-0x90(%rbp) 6635: 4c 89 8d 78 ff ff ff mov %r9,-0x88(%rbp) 663c: 84 c0 test %al,%al 663e: 74 20 je 6660 <printf+0x5c> 6640: 0f 29 45 80 movaps %xmm0,-0x80(%rbp) 6644: 0f 29 4d 90 movaps %xmm1,-0x70(%rbp) 6648: 0f 29 55 a0 movaps %xmm2,-0x60(%rbp) 664c: 0f 29 5d b0 movaps %xmm3,-0x50(%rbp) 6650: 0f 29 65 c0 movaps %xmm4,-0x40(%rbp) 6654: 0f 29 6d d0 movaps %xmm5,-0x30(%rbp) 6658: 0f 29 75 e0 movaps %xmm6,-0x20(%rbp) 665c: 0f 29 7d f0 movaps %xmm7,-0x10(%rbp) va_list ap; int i, c; char *s; va_start(ap, fmt); 6660: c7 85 20 ff ff ff 10 movl $0x10,-0xe0(%rbp) 6667: 00 00 00 666a: c7 85 24 ff ff ff 30 movl $0x30,-0xdc(%rbp) 6671: 00 00 00 6674: 48 8d 45 10 lea 0x10(%rbp),%rax 6678: 48 89 85 28 ff ff ff mov %rax,-0xd8(%rbp) 667f: 48 8d 85 50 ff ff ff lea -0xb0(%rbp),%rax 6686: 48 89 85 30 ff ff ff mov %rax,-0xd0(%rbp) for (i = 0; (c = fmt[i] & 0xff) != 0; i++) { 668d: c7 85 4c ff ff ff 00 movl $0x0,-0xb4(%rbp) 6694: 00 00 00 6697: e9 41 03 00 00 jmpq 69dd <printf+0x3d9> if (c != '%') { 669c: 83 bd 3c ff ff ff 25 cmpl $0x25,-0xc4(%rbp) 66a3: 74 24 je 66c9 <printf+0xc5> putc(fd, c); 66a5: 8b 85 3c ff ff ff mov -0xc4(%rbp),%eax 66ab: 0f be d0 movsbl %al,%edx 66ae: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 66b4: 89 d6 mov %edx,%esi 66b6: 89 c7 mov %eax,%edi 66b8: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 66bf: 00 00 00 66c2: ff d0 callq *%rax continue; 66c4: e9 0d 03 00 00 jmpq 69d6 <printf+0x3d2> } c = fmt[++i] & 0xff; 66c9: 83 85 4c ff ff ff 01 addl $0x1,-0xb4(%rbp) 66d0: 8b 85 4c ff ff ff mov -0xb4(%rbp),%eax 66d6: 48 63 d0 movslq %eax,%rdx 66d9: 48 8b 85 10 ff ff ff mov -0xf0(%rbp),%rax 66e0: 48 01 d0 add %rdx,%rax 66e3: 0f b6 00 movzbl (%rax),%eax 66e6: 0f be c0 movsbl %al,%eax 66e9: 25 ff 00 00 00 and $0xff,%eax 66ee: 89 85 3c ff ff ff mov %eax,-0xc4(%rbp) if (c == 0) 66f4: 83 bd 3c ff ff ff 00 cmpl $0x0,-0xc4(%rbp) 66fb: 0f 84 0f 03 00 00 je 6a10 <printf+0x40c> break; switch(c) { 6701: 83 bd 3c ff ff ff 25 cmpl $0x25,-0xc4(%rbp) 6708: 0f 84 74 02 00 00 je 6982 <printf+0x37e> 670e: 83 bd 3c ff ff ff 25 cmpl $0x25,-0xc4(%rbp) 6715: 0f 8c 82 02 00 00 jl 699d <printf+0x399> 671b: 83 bd 3c ff ff ff 78 cmpl $0x78,-0xc4(%rbp) 6722: 0f 8f 75 02 00 00 jg 699d <printf+0x399> 6728: 83 bd 3c ff ff ff 63 cmpl $0x63,-0xc4(%rbp) 672f: 0f 8c 68 02 00 00 jl 699d <printf+0x399> 6735: 8b 85 3c ff ff ff mov -0xc4(%rbp),%eax 673b: 83 e8 63 sub $0x63,%eax 673e: 83 f8 15 cmp $0x15,%eax 6741: 0f 87 56 02 00 00 ja 699d <printf+0x399> 6747: 89 c0 mov %eax,%eax 6749: 48 8d 14 c5 00 00 00 lea 0x0(,%rax,8),%rdx 6750: 00 6751: 48 b8 a0 83 00 00 00 movabs $0x83a0,%rax 6758: 00 00 00 675b: 48 01 d0 add %rdx,%rax 675e: 48 8b 00 mov (%rax),%rax 6761: 3e ff e0 notrack jmpq *%rax case 'c': putc(fd, va_arg(ap, int)); 6764: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax 676a: 83 f8 2f cmp $0x2f,%eax 676d: 77 23 ja 6792 <printf+0x18e> 676f: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax 6776: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 677c: 89 d2 mov %edx,%edx 677e: 48 01 d0 add %rdx,%rax 6781: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 6787: 83 c2 08 add $0x8,%edx 678a: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp) 6790: eb 12 jmp 67a4 <printf+0x1a0> 6792: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax 6799: 48 8d 50 08 lea 0x8(%rax),%rdx 679d: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp) 67a4: 8b 00 mov (%rax),%eax 67a6: 0f be d0 movsbl %al,%edx 67a9: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 67af: 89 d6 mov %edx,%esi 67b1: 89 c7 mov %eax,%edi 67b3: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 67ba: 00 00 00 67bd: ff d0 callq *%rax break; 67bf: e9 12 02 00 00 jmpq 69d6 <printf+0x3d2> case 'd': print_d(fd, va_arg(ap, int)); 67c4: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax 67ca: 83 f8 2f cmp $0x2f,%eax 67cd: 77 23 ja 67f2 <printf+0x1ee> 67cf: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax 67d6: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 67dc: 89 d2 mov %edx,%edx 67de: 48 01 d0 add %rdx,%rax 67e1: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 67e7: 83 c2 08 add $0x8,%edx 67ea: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp) 67f0: eb 12 jmp 6804 <printf+0x200> 67f2: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax 67f9: 48 8d 50 08 lea 0x8(%rax),%rdx 67fd: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp) 6804: 8b 10 mov (%rax),%edx 6806: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 680c: 89 d6 mov %edx,%esi 680e: 89 c7 mov %eax,%edi 6810: 48 b8 0c 65 00 00 00 movabs $0x650c,%rax 6817: 00 00 00 681a: ff d0 callq *%rax break; 681c: e9 b5 01 00 00 jmpq 69d6 <printf+0x3d2> case 'x': print_x32(fd, va_arg(ap, uint)); 6821: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax 6827: 83 f8 2f cmp $0x2f,%eax 682a: 77 23 ja 684f <printf+0x24b> 682c: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax 6833: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 6839: 89 d2 mov %edx,%edx 683b: 48 01 d0 add %rdx,%rax 683e: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 6844: 83 c2 08 add $0x8,%edx 6847: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp) 684d: eb 12 jmp 6861 <printf+0x25d> 684f: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax 6856: 48 8d 50 08 lea 0x8(%rax),%rdx 685a: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp) 6861: 8b 10 mov (%rax),%edx 6863: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 6869: 89 d6 mov %edx,%esi 686b: 89 c7 mov %eax,%edi 686d: 48 b8 af 64 00 00 00 movabs $0x64af,%rax 6874: 00 00 00 6877: ff d0 callq *%rax break; 6879: e9 58 01 00 00 jmpq 69d6 <printf+0x3d2> case 'p': print_x64(fd, va_arg(ap, addr_t)); 687e: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax 6884: 83 f8 2f cmp $0x2f,%eax 6887: 77 23 ja 68ac <printf+0x2a8> 6889: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax 6890: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 6896: 89 d2 mov %edx,%edx 6898: 48 01 d0 add %rdx,%rax 689b: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 68a1: 83 c2 08 add $0x8,%edx 68a4: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp) 68aa: eb 12 jmp 68be <printf+0x2ba> 68ac: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax 68b3: 48 8d 50 08 lea 0x8(%rax),%rdx 68b7: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp) 68be: 48 8b 10 mov (%rax),%rdx 68c1: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 68c7: 48 89 d6 mov %rdx,%rsi 68ca: 89 c7 mov %eax,%edi 68cc: 48 b8 52 64 00 00 00 movabs $0x6452,%rax 68d3: 00 00 00 68d6: ff d0 callq *%rax break; 68d8: e9 f9 00 00 00 jmpq 69d6 <printf+0x3d2> case 's': if ((s = va_arg(ap, char*)) == 0) 68dd: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax 68e3: 83 f8 2f cmp $0x2f,%eax 68e6: 77 23 ja 690b <printf+0x307> 68e8: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax 68ef: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 68f5: 89 d2 mov %edx,%edx 68f7: 48 01 d0 add %rdx,%rax 68fa: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx 6900: 83 c2 08 add $0x8,%edx 6903: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp) 6909: eb 12 jmp 691d <printf+0x319> 690b: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax 6912: 48 8d 50 08 lea 0x8(%rax),%rdx 6916: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp) 691d: 48 8b 00 mov (%rax),%rax 6920: 48 89 85 40 ff ff ff mov %rax,-0xc0(%rbp) 6927: 48 83 bd 40 ff ff ff cmpq $0x0,-0xc0(%rbp) 692e: 00 692f: 75 41 jne 6972 <printf+0x36e> s = "(null)"; 6931: 48 b8 98 83 00 00 00 movabs $0x8398,%rax 6938: 00 00 00 693b: 48 89 85 40 ff ff ff mov %rax,-0xc0(%rbp) while (*s) 6942: eb 2e jmp 6972 <printf+0x36e> putc(fd, *(s++)); 6944: 48 8b 85 40 ff ff ff mov -0xc0(%rbp),%rax 694b: 48 8d 50 01 lea 0x1(%rax),%rdx 694f: 48 89 95 40 ff ff ff mov %rdx,-0xc0(%rbp) 6956: 0f b6 00 movzbl (%rax),%eax 6959: 0f be d0 movsbl %al,%edx 695c: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 6962: 89 d6 mov %edx,%esi 6964: 89 c7 mov %eax,%edi 6966: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 696d: 00 00 00 6970: ff d0 callq *%rax while (*s) 6972: 48 8b 85 40 ff ff ff mov -0xc0(%rbp),%rax 6979: 0f b6 00 movzbl (%rax),%eax 697c: 84 c0 test %al,%al 697e: 75 c4 jne 6944 <printf+0x340> break; 6980: eb 54 jmp 69d6 <printf+0x3d2> case '%': putc(fd, '%'); 6982: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 6988: be 25 00 00 00 mov $0x25,%esi 698d: 89 c7 mov %eax,%edi 698f: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 6996: 00 00 00 6999: ff d0 callq *%rax break; 699b: eb 39 jmp 69d6 <printf+0x3d2> default: // Print unknown % sequence to draw attention. putc(fd, '%'); 699d: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 69a3: be 25 00 00 00 mov $0x25,%esi 69a8: 89 c7 mov %eax,%edi 69aa: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 69b1: 00 00 00 69b4: ff d0 callq *%rax putc(fd, c); 69b6: 8b 85 3c ff ff ff mov -0xc4(%rbp),%eax 69bc: 0f be d0 movsbl %al,%edx 69bf: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax 69c5: 89 d6 mov %edx,%esi 69c7: 89 c7 mov %eax,%edi 69c9: 48 b8 1e 64 00 00 00 movabs $0x641e,%rax 69d0: 00 00 00 69d3: ff d0 callq *%rax break; 69d5: 90 nop for (i = 0; (c = fmt[i] & 0xff) != 0; i++) { 69d6: 83 85 4c ff ff ff 01 addl $0x1,-0xb4(%rbp) 69dd: 8b 85 4c ff ff ff mov -0xb4(%rbp),%eax 69e3: 48 63 d0 movslq %eax,%rdx 69e6: 48 8b 85 10 ff ff ff mov -0xf0(%rbp),%rax 69ed: 48 01 d0 add %rdx,%rax 69f0: 0f b6 00 movzbl (%rax),%eax 69f3: 0f be c0 movsbl %al,%eax 69f6: 25 ff 00 00 00 and $0xff,%eax 69fb: 89 85 3c ff ff ff mov %eax,-0xc4(%rbp) 6a01: 83 bd 3c ff ff ff 00 cmpl $0x0,-0xc4(%rbp) 6a08: 0f 85 8e fc ff ff jne 669c <printf+0x98> } } } 6a0e: eb 01 jmp 6a11 <printf+0x40d> break; 6a10: 90 nop } 6a11: 90 nop 6a12: c9 leaveq 6a13: c3 retq 0000000000006a14 <free>: static Header base; static Header *freep; void free(void *ap) { 6a14: f3 0f 1e fa endbr64 6a18: 55 push %rbp 6a19: 48 89 e5 mov %rsp,%rbp 6a1c: 48 83 ec 18 sub $0x18,%rsp 6a20: 48 89 7d e8 mov %rdi,-0x18(%rbp) Header *bp, *p; bp = (Header*)ap - 1; 6a24: 48 8b 45 e8 mov -0x18(%rbp),%rax 6a28: 48 83 e8 10 sub $0x10,%rax 6a2c: 48 89 45 f0 mov %rax,-0x10(%rbp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6a30: 48 b8 50 d4 00 00 00 movabs $0xd450,%rax 6a37: 00 00 00 6a3a: 48 8b 00 mov (%rax),%rax 6a3d: 48 89 45 f8 mov %rax,-0x8(%rbp) 6a41: eb 2f jmp 6a72 <free+0x5e> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6a43: 48 8b 45 f8 mov -0x8(%rbp),%rax 6a47: 48 8b 00 mov (%rax),%rax 6a4a: 48 39 45 f8 cmp %rax,-0x8(%rbp) 6a4e: 72 17 jb 6a67 <free+0x53> 6a50: 48 8b 45 f0 mov -0x10(%rbp),%rax 6a54: 48 3b 45 f8 cmp -0x8(%rbp),%rax 6a58: 77 2f ja 6a89 <free+0x75> 6a5a: 48 8b 45 f8 mov -0x8(%rbp),%rax 6a5e: 48 8b 00 mov (%rax),%rax 6a61: 48 39 45 f0 cmp %rax,-0x10(%rbp) 6a65: 72 22 jb 6a89 <free+0x75> for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6a67: 48 8b 45 f8 mov -0x8(%rbp),%rax 6a6b: 48 8b 00 mov (%rax),%rax 6a6e: 48 89 45 f8 mov %rax,-0x8(%rbp) 6a72: 48 8b 45 f0 mov -0x10(%rbp),%rax 6a76: 48 3b 45 f8 cmp -0x8(%rbp),%rax 6a7a: 76 c7 jbe 6a43 <free+0x2f> 6a7c: 48 8b 45 f8 mov -0x8(%rbp),%rax 6a80: 48 8b 00 mov (%rax),%rax 6a83: 48 39 45 f0 cmp %rax,-0x10(%rbp) 6a87: 73 ba jae 6a43 <free+0x2f> break; if(bp + bp->s.size == p->s.ptr){ 6a89: 48 8b 45 f0 mov -0x10(%rbp),%rax 6a8d: 8b 40 08 mov 0x8(%rax),%eax 6a90: 89 c0 mov %eax,%eax 6a92: 48 c1 e0 04 shl $0x4,%rax 6a96: 48 89 c2 mov %rax,%rdx 6a99: 48 8b 45 f0 mov -0x10(%rbp),%rax 6a9d: 48 01 c2 add %rax,%rdx 6aa0: 48 8b 45 f8 mov -0x8(%rbp),%rax 6aa4: 48 8b 00 mov (%rax),%rax 6aa7: 48 39 c2 cmp %rax,%rdx 6aaa: 75 2d jne 6ad9 <free+0xc5> bp->s.size += p->s.ptr->s.size; 6aac: 48 8b 45 f0 mov -0x10(%rbp),%rax 6ab0: 8b 50 08 mov 0x8(%rax),%edx 6ab3: 48 8b 45 f8 mov -0x8(%rbp),%rax 6ab7: 48 8b 00 mov (%rax),%rax 6aba: 8b 40 08 mov 0x8(%rax),%eax 6abd: 01 c2 add %eax,%edx 6abf: 48 8b 45 f0 mov -0x10(%rbp),%rax 6ac3: 89 50 08 mov %edx,0x8(%rax) bp->s.ptr = p->s.ptr->s.ptr; 6ac6: 48 8b 45 f8 mov -0x8(%rbp),%rax 6aca: 48 8b 00 mov (%rax),%rax 6acd: 48 8b 10 mov (%rax),%rdx 6ad0: 48 8b 45 f0 mov -0x10(%rbp),%rax 6ad4: 48 89 10 mov %rdx,(%rax) 6ad7: eb 0e jmp 6ae7 <free+0xd3> } else bp->s.ptr = p->s.ptr; 6ad9: 48 8b 45 f8 mov -0x8(%rbp),%rax 6add: 48 8b 10 mov (%rax),%rdx 6ae0: 48 8b 45 f0 mov -0x10(%rbp),%rax 6ae4: 48 89 10 mov %rdx,(%rax) if(p + p->s.size == bp){ 6ae7: 48 8b 45 f8 mov -0x8(%rbp),%rax 6aeb: 8b 40 08 mov 0x8(%rax),%eax 6aee: 89 c0 mov %eax,%eax 6af0: 48 c1 e0 04 shl $0x4,%rax 6af4: 48 89 c2 mov %rax,%rdx 6af7: 48 8b 45 f8 mov -0x8(%rbp),%rax 6afb: 48 01 d0 add %rdx,%rax 6afe: 48 39 45 f0 cmp %rax,-0x10(%rbp) 6b02: 75 27 jne 6b2b <free+0x117> p->s.size += bp->s.size; 6b04: 48 8b 45 f8 mov -0x8(%rbp),%rax 6b08: 8b 50 08 mov 0x8(%rax),%edx 6b0b: 48 8b 45 f0 mov -0x10(%rbp),%rax 6b0f: 8b 40 08 mov 0x8(%rax),%eax 6b12: 01 c2 add %eax,%edx 6b14: 48 8b 45 f8 mov -0x8(%rbp),%rax 6b18: 89 50 08 mov %edx,0x8(%rax) p->s.ptr = bp->s.ptr; 6b1b: 48 8b 45 f0 mov -0x10(%rbp),%rax 6b1f: 48 8b 10 mov (%rax),%rdx 6b22: 48 8b 45 f8 mov -0x8(%rbp),%rax 6b26: 48 89 10 mov %rdx,(%rax) 6b29: eb 0b jmp 6b36 <free+0x122> } else p->s.ptr = bp; 6b2b: 48 8b 45 f8 mov -0x8(%rbp),%rax 6b2f: 48 8b 55 f0 mov -0x10(%rbp),%rdx 6b33: 48 89 10 mov %rdx,(%rax) freep = p; 6b36: 48 ba 50 d4 00 00 00 movabs $0xd450,%rdx 6b3d: 00 00 00 6b40: 48 8b 45 f8 mov -0x8(%rbp),%rax 6b44: 48 89 02 mov %rax,(%rdx) } 6b47: 90 nop 6b48: c9 leaveq 6b49: c3 retq 0000000000006b4a <morecore>: static Header* morecore(uint nu) { 6b4a: f3 0f 1e fa endbr64 6b4e: 55 push %rbp 6b4f: 48 89 e5 mov %rsp,%rbp 6b52: 48 83 ec 20 sub $0x20,%rsp 6b56: 89 7d ec mov %edi,-0x14(%rbp) char *p; Header *hp; if(nu < 4096) 6b59: 81 7d ec ff 0f 00 00 cmpl $0xfff,-0x14(%rbp) 6b60: 77 07 ja 6b69 <morecore+0x1f> nu = 4096; 6b62: c7 45 ec 00 10 00 00 movl $0x1000,-0x14(%rbp) p = sbrk(nu * sizeof(Header)); 6b69: 8b 45 ec mov -0x14(%rbp),%eax 6b6c: 48 c1 e0 04 shl $0x4,%rax 6b70: 48 89 c7 mov %rax,%rdi 6b73: 48 b8 ea 63 00 00 00 movabs $0x63ea,%rax 6b7a: 00 00 00 6b7d: ff d0 callq *%rax 6b7f: 48 89 45 f8 mov %rax,-0x8(%rbp) if(p == (char*)-1) 6b83: 48 83 7d f8 ff cmpq $0xffffffffffffffff,-0x8(%rbp) 6b88: 75 07 jne 6b91 <morecore+0x47> return 0; 6b8a: b8 00 00 00 00 mov $0x0,%eax 6b8f: eb 36 jmp 6bc7 <morecore+0x7d> hp = (Header*)p; 6b91: 48 8b 45 f8 mov -0x8(%rbp),%rax 6b95: 48 89 45 f0 mov %rax,-0x10(%rbp) hp->s.size = nu; 6b99: 48 8b 45 f0 mov -0x10(%rbp),%rax 6b9d: 8b 55 ec mov -0x14(%rbp),%edx 6ba0: 89 50 08 mov %edx,0x8(%rax) free((void*)(hp + 1)); 6ba3: 48 8b 45 f0 mov -0x10(%rbp),%rax 6ba7: 48 83 c0 10 add $0x10,%rax 6bab: 48 89 c7 mov %rax,%rdi 6bae: 48 b8 14 6a 00 00 00 movabs $0x6a14,%rax 6bb5: 00 00 00 6bb8: ff d0 callq *%rax return freep; 6bba: 48 b8 50 d4 00 00 00 movabs $0xd450,%rax 6bc1: 00 00 00 6bc4: 48 8b 00 mov (%rax),%rax } 6bc7: c9 leaveq 6bc8: c3 retq 0000000000006bc9 <malloc>: void* malloc(uint nbytes) { 6bc9: f3 0f 1e fa endbr64 6bcd: 55 push %rbp 6bce: 48 89 e5 mov %rsp,%rbp 6bd1: 48 83 ec 30 sub $0x30,%rsp 6bd5: 89 7d dc mov %edi,-0x24(%rbp) Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6bd8: 8b 45 dc mov -0x24(%rbp),%eax 6bdb: 48 83 c0 0f add $0xf,%rax 6bdf: 48 c1 e8 04 shr $0x4,%rax 6be3: 83 c0 01 add $0x1,%eax 6be6: 89 45 ec mov %eax,-0x14(%rbp) if((prevp = freep) == 0){ 6be9: 48 b8 50 d4 00 00 00 movabs $0xd450,%rax 6bf0: 00 00 00 6bf3: 48 8b 00 mov (%rax),%rax 6bf6: 48 89 45 f0 mov %rax,-0x10(%rbp) 6bfa: 48 83 7d f0 00 cmpq $0x0,-0x10(%rbp) 6bff: 75 4a jne 6c4b <malloc+0x82> base.s.ptr = freep = prevp = &base; 6c01: 48 b8 40 d4 00 00 00 movabs $0xd440,%rax 6c08: 00 00 00 6c0b: 48 89 45 f0 mov %rax,-0x10(%rbp) 6c0f: 48 ba 50 d4 00 00 00 movabs $0xd450,%rdx 6c16: 00 00 00 6c19: 48 8b 45 f0 mov -0x10(%rbp),%rax 6c1d: 48 89 02 mov %rax,(%rdx) 6c20: 48 b8 50 d4 00 00 00 movabs $0xd450,%rax 6c27: 00 00 00 6c2a: 48 8b 00 mov (%rax),%rax 6c2d: 48 ba 40 d4 00 00 00 movabs $0xd440,%rdx 6c34: 00 00 00 6c37: 48 89 02 mov %rax,(%rdx) base.s.size = 0; 6c3a: 48 b8 40 d4 00 00 00 movabs $0xd440,%rax 6c41: 00 00 00 6c44: c7 40 08 00 00 00 00 movl $0x0,0x8(%rax) } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6c4b: 48 8b 45 f0 mov -0x10(%rbp),%rax 6c4f: 48 8b 00 mov (%rax),%rax 6c52: 48 89 45 f8 mov %rax,-0x8(%rbp) if(p->s.size >= nunits){ 6c56: 48 8b 45 f8 mov -0x8(%rbp),%rax 6c5a: 8b 40 08 mov 0x8(%rax),%eax 6c5d: 39 45 ec cmp %eax,-0x14(%rbp) 6c60: 77 65 ja 6cc7 <malloc+0xfe> if(p->s.size == nunits) 6c62: 48 8b 45 f8 mov -0x8(%rbp),%rax 6c66: 8b 40 08 mov 0x8(%rax),%eax 6c69: 39 45 ec cmp %eax,-0x14(%rbp) 6c6c: 75 10 jne 6c7e <malloc+0xb5> prevp->s.ptr = p->s.ptr; 6c6e: 48 8b 45 f8 mov -0x8(%rbp),%rax 6c72: 48 8b 10 mov (%rax),%rdx 6c75: 48 8b 45 f0 mov -0x10(%rbp),%rax 6c79: 48 89 10 mov %rdx,(%rax) 6c7c: eb 2e jmp 6cac <malloc+0xe3> else { p->s.size -= nunits; 6c7e: 48 8b 45 f8 mov -0x8(%rbp),%rax 6c82: 8b 40 08 mov 0x8(%rax),%eax 6c85: 2b 45 ec sub -0x14(%rbp),%eax 6c88: 89 c2 mov %eax,%edx 6c8a: 48 8b 45 f8 mov -0x8(%rbp),%rax 6c8e: 89 50 08 mov %edx,0x8(%rax) p += p->s.size; 6c91: 48 8b 45 f8 mov -0x8(%rbp),%rax 6c95: 8b 40 08 mov 0x8(%rax),%eax 6c98: 89 c0 mov %eax,%eax 6c9a: 48 c1 e0 04 shl $0x4,%rax 6c9e: 48 01 45 f8 add %rax,-0x8(%rbp) p->s.size = nunits; 6ca2: 48 8b 45 f8 mov -0x8(%rbp),%rax 6ca6: 8b 55 ec mov -0x14(%rbp),%edx 6ca9: 89 50 08 mov %edx,0x8(%rax) } freep = prevp; 6cac: 48 ba 50 d4 00 00 00 movabs $0xd450,%rdx 6cb3: 00 00 00 6cb6: 48 8b 45 f0 mov -0x10(%rbp),%rax 6cba: 48 89 02 mov %rax,(%rdx) return (void*)(p + 1); 6cbd: 48 8b 45 f8 mov -0x8(%rbp),%rax 6cc1: 48 83 c0 10 add $0x10,%rax 6cc5: eb 4e jmp 6d15 <malloc+0x14c> } if(p == freep) 6cc7: 48 b8 50 d4 00 00 00 movabs $0xd450,%rax 6cce: 00 00 00 6cd1: 48 8b 00 mov (%rax),%rax 6cd4: 48 39 45 f8 cmp %rax,-0x8(%rbp) 6cd8: 75 23 jne 6cfd <malloc+0x134> if((p = morecore(nunits)) == 0) 6cda: 8b 45 ec mov -0x14(%rbp),%eax 6cdd: 89 c7 mov %eax,%edi 6cdf: 48 b8 4a 6b 00 00 00 movabs $0x6b4a,%rax 6ce6: 00 00 00 6ce9: ff d0 callq *%rax 6ceb: 48 89 45 f8 mov %rax,-0x8(%rbp) 6cef: 48 83 7d f8 00 cmpq $0x0,-0x8(%rbp) 6cf4: 75 07 jne 6cfd <malloc+0x134> return 0; 6cf6: b8 00 00 00 00 mov $0x0,%eax 6cfb: eb 18 jmp 6d15 <malloc+0x14c> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6cfd: 48 8b 45 f8 mov -0x8(%rbp),%rax 6d01: 48 89 45 f0 mov %rax,-0x10(%rbp) 6d05: 48 8b 45 f8 mov -0x8(%rbp),%rax 6d09: 48 8b 00 mov (%rax),%rax 6d0c: 48 89 45 f8 mov %rax,-0x8(%rbp) if(p->s.size >= nunits){ 6d10: e9 41 ff ff ff jmpq 6c56 <malloc+0x8d> } } 6d15: c9 leaveq 6d16: c3 retq
38.212715
240
0.476925
2dc6b4d3b09905128477a87fd36a01018fbd703b
526
asm
Assembly
libsrc/oz/ozgfx/ozrestorescreen.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/oz/ozgfx/ozrestorescreen.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/oz/ozgfx/ozrestorescreen.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; ; Sharp OZ family functions ; ; ported from the OZ-7xx SDK by by Alexander R. Pruss ; by Stefano Bodrato - Oct. 2003 ; ; ; ; ; ------ ; $Id: ozrestorescreen.asm,v 1.3 2016-06-28 14:48:17 dom Exp $ ; SECTION code_clib PUBLIC ozrestorescreen PUBLIC _ozrestorescreen EXTERN ozsccopy EXTERN ozactivepage .ozrestorescreen ._ozrestorescreen ld de,968h push de ld hl,0 push hl ld h,4 ;; l=0 still ld de,(ozactivepage) jp ozsccopy
15.939394
62
0.593156
938f683e43e24182626326ba7345a30b98a2850a
520
asm
Assembly
programs/oeis/293/A293168.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/293/A293168.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/293/A293168.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A293168: Partial sums of A054868. ; 0,1,2,3,4,5,6,8,9,10,11,13,14,16,18,19,20,21,22,24,25,27,29,30,31,33,35,36,38,39,40,42,43,44,45,47,48,50,52,53,54,56,58,59,61,62,63,65,66,68,70,71,73,74,75,77,79,80,81,83,84,86,88,90,91,92,93,95,96,98,100,101,102,104,106 mov $6,$0 mov $7,$0 lpb $6,1 mov $0,$7 sub $6,1 sub $0,$6 mov $2,$0 add $2,$0 mov $4,$0 lpb $2,1 gcd $2,32 mov $3,$4 lpb $4,1 div $3,2 sub $4,$3 lpe sub $2,1 lpe mul $4,4 mov $5,$4 div $5,4 add $1,$5 lpe
19.259259
222
0.544231
9f618bc471cd17ae3266a5f59dc9cef0fc80e55f
946
asm
Assembly
dv3/qxl/fd/hold.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
dv3/qxl/fd/hold.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
dv3/qxl/fd/hold.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; DV3 QXL Floppy Disk Hold / Release controller  1998 Tony Tebby section dv3 xdef fd_hold xdef fd_release include 'dev8_dv3_keys' include 'dev8_dv3_fd_keys' include 'dev8_keys_sys' include 'dev8_keys_err' include 'dev8_mac_assert' ;+++ ; This routine is called to take the disk controller ; ; d0 cr p preserved if OK ; d7 c p drive ID / number ; a3 c p linkage block ; a4 c p drive definition ; ; status return 0, err.nc, err.mchk ;--- fd_hold bset #7,sys_stiu(a6) ; take the sector transfer buffer bne.s fdh_nc move.b fdl_apnd(a3),fdl_actm(a3) ; ... reactivate when we've done cmp.b d0,d0 fdh_rts rts fdh_nc moveq #err.nc,d0 rts ;+++ ; This routine is called to release the disk controller ; ; d0 c p ; d7 c p drive ID / number ; a3 c p linkage block ; a4 c p drive definition ; ; status return accoding to d0 ;--- fd_release bclr #7,sys_stiu(a6) ; relase the sector transfer buffer tst.l d0 rts end
18.192308
70
0.700846
f053b221714e442219bc839ae6fd888c125120bf
790
asm
Assembly
sound/sfxasm/B8.asm
NatsumiFox/Sonic-3-93-Nov-03
032e4fc25f243636d458639c4a4311caca898f96
[ "MIT" ]
7
2019-12-05T00:35:57.000Z
2022-02-27T20:00:33.000Z
sound/sfxasm/B8.asm
NatsumiFox/Sonic-3-93-Nov-03
032e4fc25f243636d458639c4a4311caca898f96
[ "MIT" ]
null
null
null
sound/sfxasm/B8.asm
NatsumiFox/Sonic-3-93-Nov-03
032e4fc25f243636d458639c4a4311caca898f96
[ "MIT" ]
null
null
null
B8_Header: sHeaderInit ; Z80 offset is $D7A4 sHeaderPatch B8_Patches sHeaderTick $01 sHeaderCh $01 sHeaderSFX $80, $05, B8_FM5, $F0, $00 B8_FM5: sPatFM $00 ssModZ80 $01, $01, $F7, $EA B8_Loop1: dc.b nAb5, $02, $03, nRst, $02 saVolFM $06 sLoop $00, $0E, B8_Loop1 sStop B8_Patches: ; Patch $00 ; $45 ; $3F, $4F, $FF, $4F, $18, $18, $17, $10 ; $00, $00, $02, $06, $0B, $1C, $18, $1D ; $10, $1B, $1B, $02, $37, $80, $80, $80 spAlgorithm $05 spFeedback $00 spDetune $03, $0F, $04, $04 spMultiple $0F, $0F, $0F, $0F spRateScale $00, $00, $00, $00 spAttackRt $18, $17, $18, $10 spAmpMod $00, $00, $00, $00 spSustainRt $00, $02, $00, $06 spSustainLv $01, $01, $01, $00 spDecayRt $0B, $18, $1C, $1D spReleaseRt $00, $0B, $0B, $02 spTotalLv $37, $00, $00, $00
21.351351
41
0.583544
23cb6101f37cf3c15e0bf20ebd425d1682380e29
755
asm
Assembly
oeis/249/A249995.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/249/A249995.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/249/A249995.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A249995: Expansion of 1/((1+2*x)*(1-3*x)*(1-4*x)). ; Submitted by Christian Krause ; 1,5,27,121,539,2289,9619,39737,162987,663553,2690051,10865673,43783195,176086097,707220723,2837479129,11375770763,45580514721,182554616035,730915611305,2925754935291,11709295114225,46856010770387,187480525633401,750091566966379,3000874627609409,12005023656778179,48024669931916617,192112405910513627,768490801653725073,3074086741723653811,12296717570073392153,49187982094124866635,196755263809403426017,787031061553505451683,3148154265127337311209,12592707117318015235003,50371098639560619957041 mov $1,2 mov $2,2 lpb $0 sub $0,1 mov $3,$2 mul $2,2 pow $3,2 mul $4,2 add $3,$4 mul $3,3 mov $4,$1 add $1,$3 add $4,1 lpe mov $0,$1 div $0,3 add $0,1
34.318182
497
0.786755
f6b7e3c66c8c80758107ed4b61f838154118d978
826
asm
Assembly
oeis/142/A142916.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142916.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142916.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142916: Primes congruent to 47 mod 63. ; Submitted by Jon Maiga ; 47,173,677,929,1181,1307,1433,1559,1811,2063,2441,2693,2819,3323,3449,3701,4079,4457,4583,5087,5591,5717,5843,6221,6473,6599,6977,7103,7229,7481,7607,8111,8237,8363,8741,8867,9371,9497,9623,9749,10253,10631,10883,11261,12143,12269,12647,12899,13151,13781,13907,14033,14159,14411,14537,15671,15797,15923,16301,16427,16553,16931,17183,17939,18191,18443,18947,19073,19577,20333,20963,21089,21341,21467,22349,22727,22853,23357,23609,24113,24239,25121,25247,25373,26003,26633,26759,27011,27767,27893 mov $1,23 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 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,63 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,125
34.416667
496
0.727603
11912a958716f8ccab4f4af069a665ecb47fd953
3,603
asm
Assembly
src/Native/Runtime/amd64/StubDispatch.asm
kouvel/corert
c6af4cfc8b625851b91823d9be746c4f7abdc667
[ "MIT" ]
3,223
2015-11-18T16:04:48.000Z
2022-03-25T14:40:43.000Z
src/Native/Runtime/amd64/StubDispatch.asm
kouvel/corert
c6af4cfc8b625851b91823d9be746c4f7abdc667
[ "MIT" ]
4,032
2015-11-18T15:44:29.000Z
2020-11-01T06:32:44.000Z
src/Native/Runtime/amd64/StubDispatch.asm
kouvel/corert
c6af4cfc8b625851b91823d9be746c4f7abdc667
[ "MIT" ]
678
2015-11-18T15:43:40.000Z
2022-03-25T07:44:21.000Z
;; Licensed to the .NET Foundation under one or more agreements. ;; The .NET Foundation licenses this file to you under the MIT license. include AsmMacros.inc ifdef FEATURE_CACHED_INTERFACE_DISPATCH EXTERN RhpCidResolve : PROC EXTERN RhpUniversalTransition_DebugStepTailCall : PROC ;; Macro that generates code to check a single cache entry. CHECK_CACHE_ENTRY macro entry NextLabel textequ @CatStr( Attempt, %entry+1 ) cmp rax, [r11 + OFFSETOF__InterfaceDispatchCache__m_rgEntries + (entry * 16)] jne NextLabel jmp qword ptr [r11 + OFFSETOF__InterfaceDispatchCache__m_rgEntries + (entry * 16) + 8] NextLabel: endm ;; Macro that generates a stub consuming a cache with the given number of entries. DEFINE_INTERFACE_DISPATCH_STUB macro entries StubName textequ @CatStr( RhpInterfaceDispatch, entries ) LEAF_ENTRY StubName, _TEXT ;EXTERN CID_g_cInterfaceDispatches : DWORD ;inc [CID_g_cInterfaceDispatches] ;; r10 currently contains the indirection cell address. ;; load r11 to point to the cache block. mov r11, [r10 + OFFSETOF__InterfaceDispatchCell__m_pCache] ;; Load the EEType from the object instance in rcx. mov rax, [rcx] CurrentEntry = 0 while CurrentEntry lt entries CHECK_CACHE_ENTRY %CurrentEntry CurrentEntry = CurrentEntry + 1 endm ;; r10 still contains the the indirection cell address. jmp RhpInterfaceDispatchSlow LEAF_END StubName, _TEXT endm ;; DEFINE_INTERFACE_DISPATCH_STUB ;; Define all the stub routines we currently need. ;; ;; The mrt100dbi requires these be exported to identify mrt100 code that dispatches back into managed. ;; If you change or add any new dispatch stubs, please also change slr.def and dbi\process.cpp CordbProcess::GetExportStepInfo ;; DEFINE_INTERFACE_DISPATCH_STUB 1 DEFINE_INTERFACE_DISPATCH_STUB 2 DEFINE_INTERFACE_DISPATCH_STUB 4 DEFINE_INTERFACE_DISPATCH_STUB 8 DEFINE_INTERFACE_DISPATCH_STUB 16 DEFINE_INTERFACE_DISPATCH_STUB 32 DEFINE_INTERFACE_DISPATCH_STUB 64 ;; Stub dispatch routine for dispatch to a vtable slot LEAF_ENTRY RhpVTableOffsetDispatch, _TEXT ;; r10 currently contains the indirection cell address. ;; load rax to point to the vtable offset (which is stored in the m_pCache field). mov rax, [r10 + OFFSETOF__InterfaceDispatchCell__m_pCache] ;; Load the EEType from the object instance in rcx, and add it to the vtable offset ;; to get the address in the vtable of what we want to dereference add rax, [rcx] ;; Load the target address of the vtable into rax mov rax, [rax] TAILJMP_RAX LEAF_END RhpVTableOffsetDispatch, _TEXT ;; Initial dispatch on an interface when we don't have a cache yet. LEAF_ENTRY RhpInitialInterfaceDispatch, _TEXT ALTERNATE_ENTRY RhpInitialDynamicInterfaceDispatch ;; Just tail call to the cache miss helper. jmp RhpInterfaceDispatchSlow LEAF_END RhpInitialInterfaceDispatch, _TEXT ;; Cache miss case, call the runtime to resolve the target and update the cache. ;; Use universal transition helper to allow an exception to flow out of resolution LEAF_ENTRY RhpInterfaceDispatchSlow, _TEXT ;; r10 contains indirection cell address, move to r11 where it will be passed by ;; the universal transition thunk as an argument to RhpCidResolve mov r11, r10 lea r10, RhpCidResolve jmp RhpUniversalTransition_DebugStepTailCall LEAF_END RhpInterfaceDispatchSlow, _TEXT endif ;; FEATURE_CACHED_INTERFACE_DISPATCH end
33.055046
126
0.752429
f64fb2fb2a21e697ae82acbc713f196477c9d734
22,734
asm
Assembly
libsrc/_DEVELOPMENT/stdio/z80/asm_vfprintf_unlocked.asm
dp304/z88dk
1c4a0451ab85f7b0eee6fcec706f135076a66e2d
[ "ClArtistic" ]
4
2021-11-20T19:35:01.000Z
2022-01-01T16:08:42.000Z
libsrc/_DEVELOPMENT/stdio/z80/asm_vfprintf_unlocked.asm
dp304/z88dk
1c4a0451ab85f7b0eee6fcec706f135076a66e2d
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/stdio/z80/asm_vfprintf_unlocked.asm
dp304/z88dk
1c4a0451ab85f7b0eee6fcec706f135076a66e2d
[ "ClArtistic" ]
1
2021-11-27T15:58:02.000Z
2021-11-27T15:58:02.000Z
; =============================================================== ; Jan 2014 ; =============================================================== ; ; int vfprintf_unlocked(FILE *stream, const char *format, void *arg) ; ; See C11 specification. ; ; =============================================================== IFNDEF CLIB_OPT_PRINTF INCLUDE "config_private.inc" defc CLIB_OPT_PRINTF = __CLIB_OPT_PRINTF defc CLIB_OPT_PRINTF_2 = __CLIB_OPT_PRINTF_2 ENDIF SECTION code_clib SECTION code_stdio PUBLIC asm_vfprintf_unlocked PUBLIC asm0_vfprintf_unlocked, asm1_vfprintf_unlocked EXTERN __stdio_verify_output, asm_strchrnul, __stdio_send_output_buffer EXTERN l_utod_hl, l_neg_hl, error_einval_zc EXTERN __stdio_nextarg_de, l_atou, __stdio_length_modifier, error_erange_zc GLOBAL CLIB_32BIT_FLOATS asm_vfprintf_unlocked: ; enter : ix = FILE * ; de = char *format ; bc = void *stack_param = arg ; ; exit : ix = FILE * ; de = char *format (next unexamined char) ; ; success ; ; hl = number of chars output on stream ; carry reset ; ; fail ; ; hl = - (chars output + 1) < 0 ; carry set, errno set as below ; ; eacces = stream not open for writing ; eacces = stream is in an error state ; erange = width or precision out of range ; einval = unknown printf conversion ; ; more errors may be set by underlying driver ; ; uses : all except ix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_STDIO & $01 EXTERN __stdio_verify_valid call __stdio_verify_valid ret c ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; asm1_vfprintf_unlocked: call __stdio_verify_output ; check that output on stream is ok ret c ; if output on stream not possible asm0_vfprintf_unlocked: IF (CLIB_OPT_PRINTF != 0) || ((CLIB_OPT_PRINTF_2 != 0) && __SDCC) ld hl,-44 add hl,sp ld sp,hl ; create 44 bytes of workspace push bc ENDIF exx ld hl,0 ; initial output count is zero exx ;****************************** ; * FORMAT STRING LOOP ******** format_loop_printf: ; de = char *format ; stack = WORKSPACE_44, stack_param ld l,e ld h,d __format_loop_printf: ld c,'%' call asm_strchrnul ; output format string chars up to '%' push hl or a sbc hl,de ld c,l ld b,h ; bc = num chars to output ex de,hl ; hl = char *format call nz, __stdio_send_output_buffer pop de IF (CLIB_OPT_PRINTF = 0) && ((CLIB_OPT_PRINTF_2 = 0) || __SCCZ80) jr c, error_stream_printf ; if stream error ELSE jp c, error_stream_printf ; if stream error ENDIF ; de = address of format char stopped on ('%' or '\0') ; stack = WORKSPACE_44, stack_param ld a,(de) or a jr z, format_end_printf ; if stopped on string terminator inc de ; next format char to examine ld a,(de) cp '%' jr nz, interpret_printf ; %% ld l,e ld h,d inc hl ; next char to examine is past %% jr __format_loop_printf format_end_printf: ; de = address of format char '\0' ; stack = WORKSPACE_44, stack_param IF (CLIB_OPT_PRINTF != 0) || ((CLIB_OPT_PRINTF_2 != 0) && __SDCC) ld hl,46 add hl,sp ld sp,hl ; repair stack ENDIF exx push hl exx pop hl ; hl = number of chars output or a jp l_utod_hl ; hl = max $7fff ; * AA ******************************************************** IF (CLIB_OPT_PRINTF = 0) && ((CLIB_OPT_PRINTF_2 = 0) || __SCCZ80) ; completely disable % logic ; printf can only be used to output format text interpret_printf: ; de = address of format char after '%' call error_einval_zc ;;;; jr error_stream_printf ; could probably just fall through but let's be safe ENDIF ; * BB ******************************************************** IF (CLIB_OPT_PRINTF != 0) || ((CLIB_OPT_PRINTF_2 != 0) && __SDCC) ; regular % processing flag_chars_printf: defb '+', $40 defb ' ', $20 defb '#', $10 defb '0', $08 defb '-', $04 interpret_printf: dec de ld c,0 ;****************************** ; * FLAGS FIELD *************** flags_printf: ; consume optional flags "-+ #0" ; default flags is none set inc de ; advance to next char in format string ; de = address of next format char to examine ; c = conversion_flags ; stack = WORKSPACE_44, stack_param ld a,(de) ld hl,flag_chars_printf ld b,5 flags_id_printf: cp (hl) inc hl jr z, flag_found_printf inc hl djnz flags_id_printf ld (ix+5),c ; store conversion_flags ;****************************** ; * width FIELD *************** width_printf: ; consume optional width specifier ; default width is zero ; a = next format char ; de = address of next format char to examine ; stack = WORKSPACE_44, stack_param cp '*' jr nz, width_from_format_printf ; asterisk means width comes from parameter list pop hl inc de ; consume '*' push de ; hl = stack_param ; stack = WORKSPACE_44, address of next format char to examine call __stdio_nextarg_de ; de = width ex de,hl ; hl = width ; de = stack_param ; stack = WORKSPACE_44, address of next format char to examine bit 7,h jr z, width_positive_printf ; negative field width call l_neg_hl ; width made positive set 2,(ix+5) ; '-' flag set width_positive_printf: ex (sp),hl ex de,hl push hl ; de = address of next format char to examine ; stack = WORKSPACE_44, width, stack_param jr precision_printf flag_found_printf: ld a,(hl) or c ld c,a jr flags_printf width_from_format_printf: ; read width from format string, default = 0 ; de = address of next format char to examine ; stack = WORKSPACE_44, stack_param call l_atou ; hl = width jp c, error_format_width_printf ; width out of range bit 7,h jp nz, error_format_width_printf ; width out of range ex (sp),hl push hl ;****************************** ; * precision FIELD *********** precision_printf: ; consume optional precision specifier ; default precision is one ; de = address of next format char to examine ; stack = WORKSPACE_44, width, stack_param ld hl,1 ; default precision ld a,(de) cp '.' jr nz, end_precision_printf set 0,(ix+5) ; indicate precision is specified inc de ; consume '.' ld a,(de) cp '*' jr nz, precision_from_format_printf ; asterisk means precision comes from parameter list pop hl inc de ; consume '*' push de ; hl = stack_param ; stack = WORKSPACE_44, width, address of next format char to examine call __stdio_nextarg_de ; de = precision ex de,hl ; hl = precision ; de = stack_param ; stack = WORKSPACE_44, width, address of next format char to examine bit 7,h jr z, precision_positive_printf ; negative precision means precision is ignored ld hl,1 ; precision takes default value res 0,(ix+5) ; indicate precision is not specified precision_positive_printf: ex (sp),hl ex de,hl push hl ; de = address of next format char to examine ; stack = WORKSPACE_44, width, precision, stack_param jr length_modifier_printf precision_from_format_printf: ; read precision from format string ; de = address of next format char to examine ; stack = WORKSPACE_44, width, stack_param call l_atou ; hl = precision jp c, error_format_precision_printf ; precision out of range bit 7,h jp nz, error_format_precision_printf ; precision out of range end_precision_printf: ; hl = precision ; de = address of next format char to examine ; stack = WORKSPACE_44, width, stack_param ex (sp),hl push hl ;****************************** ; * LENGTH MODIFIER *********** length_modifier_printf: ; consume optional length modifier ; de = address of next format char to examine ; stack = WORKSPACE_44, width, precision, stack_param call __stdio_length_modifier ;****************************** ; * CONVERSION SPECIFIER ****** converter_specifier_printf: ; identify conversion "aABcdeEfFgGinopsuxIX" ; long modifies "BdinopuxX" not "aAceEfFgGsI" ; de = address of next format char to examine ; c = length modifier id ; stack = WORKSPACE_44, width, precision, stack_param ld a,(de) ; a = specifier inc de IF CLIB_OPT_PRINTF & $800 cp 'I' jr z, printf_I ; converter does not fit tables ENDIF ld b,a ; b = specifier ld a,c and $30 ; only pay attention to long and longlong modifiers sub $10 ; carry must be reset here jr nc, long_spec_printf ; if long or longlong modifier selected ;;; without long spec IF CLIB_OPT_PRINTF & $1ff ld hl,rcon_tbl_printf ; converters without long spec call match_con_printf jr c, printf_return_is_2 ENDIF common_spec_printf: IF CLIB_OPT_PRINTF & $600 ld hl,acon_tbl_printf ; converters independent of long spec call match_con_printf jr c, printf_return_is_2 ENDIF IF CLIB_OPT_PRINTF & $3fc00000 ld hl,fcon_tbl_printf ; float converters are independent of long spec call match_con_printf IF __SDCC | __SDCC_IX | __SDCC_IY jr c, printf_return_is_4 ELSE jr c, printf_return_is_6 ENDIF ENDIF ;;; converter unrecognized unrecognized_printf: ; de = address of next format char to examine ; stack = WORKSPACE_44, width, precision, stack_param call error_einval_zc ; set errno ld hl,50 jp __error_stream_printf IF CLIB_OPT_PRINTF_2 && __SDCC ;;; with longlong spec longlong_spec_printf: ld hl,llcon_tbl_printf ; converters with longlong spec call match_con_printf jr c, printf_return_is_8 jr common_spec_printf ENDIF ;;; with long spec long_spec_printf: IF CLIB_OPT_PRINTF_2 && __SDCC jr nz, longlong_spec_printf ELSE jr nz, common_spec_printf ENDIF IF CLIB_OPT_PRINTF & $1ff000 ld hl,lcon_tbl_printf ; converters with long spec call match_con_printf ENDIF jr nc, common_spec_printf ;;; conversion matched IF (CLIB_OPT_PRINTF & $1ff800) || ((__SDCC) && (CLIB_OPT_PRINTF & $3fc00000)) printf_return_is_4: ld bc,printf_return_4 jr printf_invoke_flags ENDIF IF CLIB_OPT_PRINTF & $800 printf_I: EXTERN __stdio_printf_ii ld hl,__stdio_printf_ii ld a,$80 jr printf_return_is_4 ENDIF IF CLIB_OPT_PRINTF_2 && __SDCC printf_return_is_8: ld bc,printf_return_8 jr printf_invoke_flags ENDIF IF (__SCCZ80 | __ASM) && (CLIB_OPT_PRINTF & $3fc00000) ; This is used for floats only so we can check the library spec printf_return_is_6: ld a,CLIB_32BIT_FLOATS and a ld bc,printf_return_6 jr Z,printf_invoke_flags ld bc,printf_return_4 jr printf_invoke_flags ENDIF IF CLIB_OPT_PRINTF & $7ff printf_return_is_2: ld bc,printf_return_2 ENDIF printf_invoke_flags: ; a = invoke flags ; hl = & printf converter ; bc = return address after conversion ; de = address of next format char to examine ; stack = WORKSPACE_44, width, precision, stack_param bit 5,a jr z, skip_00_printf set 1,(ix+5) ; indicates octal conversion skip_00_printf: bit 4,a jr z, skip_11_printf res 4,(ix+5) ; suppress base indicator skip_11_printf: and $c0 ld (ix+4),a ; capitalize & signed conversion indicators printf_invoke: ; hl = & printf_converter ; de = address of next format char to examine ; bc = return address after printf conversion ; stack = WORKSPACE_44, width, precision, stack_param ex (sp),hl ; push & printf_converter push hl ; de = char *format ; bc = return address ; stack = WORKSPACE_44, width, precision, & converter, stack_param ld hl,15 add hl,sp ld (hl),d dec hl ld (hl),e ; store address of next format char dec hl pop de ; de = stack_param ld (hl),d dec hl ld (hl),e ; store stack_param dec hl ld (hl),b dec hl ld (hl),c ; store return address after printf dec hl ld c,l ld b,h ld hl,10 add hl,bc ; hl = buffer_digits ld a,h ld (bc),a dec bc ld a,l ld (bc),a ; store buffer_digits ex de,hl ; ix = FILE * ; hl = void *stack_param ; de = void *buffer_digits ; stack = WORKSPACE_42, return addr, buffer_digits, width, precision, & printf_conv ; WORSPACE_44 low to high addresses ; ; offset size purpose ; ; 0 2 void *buffer_digits ; 2 2 return address following printf conversion ; 4 2 void *stack_param ; 6 2 address of next format char ; 8 3 prefix buffer space for printf conversion ; 11 33 buffer_digits[] (space for printf conversion) ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; match_con_printf: ; enter : b = conversion specifier ; hl = conversion table ; ; exit : b = conversion specifier ; ; if matched ; ; a = flags ; hl = & printf converter ; carry set ; ; if unmatched ; ; carry reset ld a,(hl) inc hl or a ret z cp b jr z, match_ret_printf inc hl inc hl inc hl jr match_con_printf match_ret_printf: ld a,(hl) ; a = flags inc hl ld b,(hl) inc hl ld h,(hl) ld l,b ; hl = & printf converter scf ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF CLIB_OPT_PRINTF & $600 acon_tbl_printf: IF CLIB_OPT_PRINTF & $200 defb 's', $80 EXTERN __stdio_printf_s defw __stdio_printf_s ENDIF IF CLIB_OPT_PRINTF & $400 defb 'c', $80 EXTERN __stdio_printf_c defw __stdio_printf_c ENDIF defb 0 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF CLIB_OPT_PRINTF & $1ff rcon_tbl_printf: IF CLIB_OPT_PRINTF & $01 defb 'd', $d0 EXTERN __stdio_printf_d defw __stdio_printf_d ENDIF IF CLIB_OPT_PRINTF & $02 defb 'u', $90 EXTERN __stdio_printf_u defw __stdio_printf_u ENDIF IF CLIB_OPT_PRINTF & $04 defb 'x', $00 EXTERN __stdio_printf_x defw __stdio_printf_x ENDIF IF CLIB_OPT_PRINTF & $08 defb 'X', $80 EXTERN __stdio_printf_x defw __stdio_printf_x ENDIF IF CLIB_OPT_PRINTF & $10 defb 'o', $a0 EXTERN __stdio_printf_o defw __stdio_printf_o ENDIF IF CLIB_OPT_PRINTF & $20 defb 'n', $80 EXTERN __stdio_printf_n defw __stdio_printf_n ENDIF IF CLIB_OPT_PRINTF & $40 defb 'i', $d0 EXTERN __stdio_printf_d defw __stdio_printf_d ENDIF IF CLIB_OPT_PRINTF & $80 defb 'p', $80 EXTERN __stdio_printf_p defw __stdio_printf_p ENDIF IF CLIB_OPT_PRINTF & $100 defb 'B', $90 EXTERN __stdio_printf_bb defw __stdio_printf_bb ENDIF defb 0 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF CLIB_OPT_PRINTF & $3fc00000 fcon_tbl_printf: IF CLIB_OPT_PRINTF & $10000000 defb 'g', $00 EXTERN __stdio_printf_g defw __stdio_printf_g ENDIF IF CLIB_OPT_PRINTF & $20000000 defb 'G', $80 EXTERN __stdio_printf_g defw __stdio_printf_g ENDIF IF CLIB_OPT_PRINTF & $4000000 defb 'f', $00 EXTERN __stdio_printf_f defw __stdio_printf_f ENDIF IF CLIB_OPT_PRINTF & $8000000 defb 'F', $80 EXTERN __stdio_printf_f defw __stdio_printf_f ENDIF IF CLIB_OPT_PRINTF & $1000000 defb 'e', $00 EXTERN __stdio_printf_e defw __stdio_printf_e ENDIF IF CLIB_OPT_PRINTF & $2000000 defb 'E', $80 EXTERN __stdio_printf_e defw __stdio_printf_e ENDIF IF CLIB_OPT_PRINTF & $400000 defb 'a', $00 EXTERN __stdio_printf_a defw __stdio_printf_a ENDIF IF CLIB_OPT_PRINTF & $800000 defb 'A', $80 EXTERN __stdio_printf_a defw __stdio_printf_a ENDIF defb 0 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF CLIB_OPT_PRINTF & $1ff000 lcon_tbl_printf: IF CLIB_OPT_PRINTF & $1000 defb 'd', $d0 EXTERN __stdio_printf_ld defw __stdio_printf_ld ENDIF IF CLIB_OPT_PRINTF & $2000 defb 'u', $90 EXTERN __stdio_printf_lu defw __stdio_printf_lu ENDIF IF CLIB_OPT_PRINTF & $4000 defb 'x', $00 EXTERN __stdio_printf_lx defw __stdio_printf_lx ENDIF IF CLIB_OPT_PRINTF & $8000 defb 'X', $80 EXTERN __stdio_printf_lx defw __stdio_printf_lx ENDIF IF CLIB_OPT_PRINTF & $10000 defb 'o', $a0 EXTERN __stdio_printf_lo defw __stdio_printf_lo ENDIF IF CLIB_OPT_PRINTF & $20000 defb 'n', $80 EXTERN __stdio_printf_ln defw __stdio_printf_ln ENDIF IF CLIB_OPT_PRINTF & $40000 defb 'i', $d0 EXTERN __stdio_printf_ld defw __stdio_printf_ld ENDIF IF CLIB_OPT_PRINTF & $80000 defb 'p', $80 EXTERN __stdio_printf_lp defw __stdio_printf_lp ENDIF IF CLIB_OPT_PRINTF & $100000 defb 'B', $90 EXTERN __stdio_printf_lbb defw __stdio_printf_lbb ENDIF defb 0 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF CLIB_OPT_PRINTF_2 && __SDCC llcon_tbl_printf: IF CLIB_OPT_PRINTF_2 & $01 defb 'd', $d0 EXTERN __stdio_printf_lld defw __stdio_printf_lld ENDIF IF CLIB_OPT_PRINTF_2 & $02 defb 'u', $90 EXTERN __stdio_printf_llu defw __stdio_printf_llu ENDIF IF CLIB_OPT_PRINTF_2 & $04 defb 'x', $00 EXTERN __stdio_printf_llx defw __stdio_printf_llx ENDIF IF CLIB_OPT_PRINTF_2 & $08 defb 'X', $80 EXTERN __stdio_printf_llx defw __stdio_printf_llx ENDIF IF CLIB_OPT_PRINTF_2 & $10 defb 'o', $a0 EXTERN __stdio_printf_llo defw __stdio_printf_llo ENDIF IF CLIB_OPT_PRINTF_2 & $40 defb 'i', $d0 EXTERN __stdio_printf_lld defw __stdio_printf_lld ENDIF defb 0 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF CLIB_OPT_PRINTF_2 && __SDCC printf_return_8: ; printf converters that read eight bytes from stack_param return here ; ; carry set if error ; stack = WORKSPACE_36, char *format, void *stack_param pop bc __return_join_8_printf: ;****************************** IF __SDCC | __SDCC_IX | __SDCC_IY ;****************************** inc bc inc bc ; bc = stack_param += 2 ;****************************** ELSE ;****************************** dec bc dec bc ; bc = stack_param += 2 ;****************************** ENDIF ;****************************** jr _return_join_6_printf ENDIF IF ((__SCCZ80 | __ASM) && (CLIB_OPT_PRINTF & $3fc00000)) || (CLIB_OPT_PRINTF_2 && __SDCC) printf_return_6: ; printf converters that read six bytes from stack_param return here ; ; carry set if error ; stack = WORKSPACE_36, char *format, void *stack_param pop bc _return_join_6_printf: ;****************************** IF __SDCC | __SDCC_IX | __SDCC_IY ;****************************** inc bc inc bc ; bc = stack_param += 2 ;****************************** ELSE ;****************************** dec bc dec bc ; bc = stack_param += 2 ;****************************** ENDIF ;****************************** jr _return_join_4_printf ENDIF printf_return_4: ; printf converters that read four bytes from stack_param return here ; ; carry set if error ; stack = WORKSPACE_36, char *format, void *stack_param pop bc _return_join_4_printf: ;****************************** IF __SDCC | __SDCC_IX | __SDCC_IY ;****************************** inc bc inc bc ; bc = stack_param += 2 ;****************************** ELSE ;****************************** dec bc dec bc ; bc = stack_param += 2 ;****************************** ENDIF ;****************************** jr _return_join_2_printf printf_return_2: ; printf converters that read two bytes from stack_param return here ; ; carry set if error ; stack = WORKSPACE_36, char *format, void *stack_param pop bc _return_join_2_printf: ;****************************** IF __SDCC | __SDCC_IX | __SDCC_IY ;****************************** inc bc inc bc ; bc = stack_param += 2 ;****************************** ELSE ;****************************** dec bc dec bc ; bc = stack_param += 2 ;****************************** ENDIF ;****************************** pop de ; de = char *format jr c, error_printf_converter_printf ld hl,-8 add hl,sp ld sp,hl push bc ; format_loop_printf expects this: ; ; de = char *format ; stack = WORKSPACE_44, stack_param jp format_loop_printf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; error_format_precision_printf: ; de = address of next format char to examine ; stack = WORKSPACE_44, width, stack_param pop bc ; junk one item ; fall through error_format_width_printf: ; de = address of next format char to examine ; stack = WORKSPACE_44, stack_param call error_erange_zc ; set errno ; fall through ENDIF ; ** AA BB **************************************************** ; all clib options have this code error_stream_printf: IF (CLIB_OPT_PRINTF != 0) || ((CLIB_OPT_PRINTF_2 != 0) && __SDCC) ; de = address of format char stopped on ('%' or '\0') ; stack = WORKSPACE_44, stack_param ld hl,46 __error_stream_printf: add hl,sp ld sp,hl ; repair stack ENDIF exx push hl exx pop hl ; hl = number of chars transmitted call l_utod_hl ; hl = max $7fff inc hl scf ; indicate error jp l_neg_hl ; hl = - (chars out + 1) < 0 IF (CLIB_OPT_PRINTF != 0) || ((CLIB_OPT_PRINTF_2 != 0) && __SDCC) error_printf_converter_printf: ; de = address of next format char to examine ; stack = WORKSPACE_36 ld hl,36 jr __error_stream_printf ENDIF
18.129187
94
0.584763
88f1544280abef4702a9eb7b96c725f05cdc53e0
1,324
asm
Assembly
tests/exec/div/div.asm
ykskb/dax86
d7c90afb4a306f04bd840da2b32faedec01bef93
[ "MIT" ]
12
2020-09-17T13:33:24.000Z
2022-03-13T21:48:52.000Z
tests/exec/div/div.asm
ykusakabe/dax86
d7c90afb4a306f04bd840da2b32faedec01bef93
[ "MIT" ]
2
2020-07-03T03:12:01.000Z
2021-06-11T00:31:19.000Z
tests/exec/div/div.asm
ykusakabe/dax86
d7c90afb4a306f04bd840da2b32faedec01bef93
[ "MIT" ]
5
2020-07-04T16:59:29.000Z
2021-11-26T17:14:07.000Z
BITS 32 org 0x7c00 ; div rm8 ; sub esp, 16 ; ESP: 7BF0 mov ebp, esp ; EBP: 7BF0 mov byte [ebp], 0xF mov al, 0xF div byte [ebp] push eax ; 7BEC: 0x01 mov byte [ebp], 0x2 mov al, 0x7 div byte [ebp] push eax ; 7BE8: 00 00 01 03 ; div rm32 ; mov dword [ebp], 0xFFFFFFFE ; 4294967294 mov edx, 0x1 mov eax, 0x11111111 ; 4581298449 div dword [ebp] push edx ; 7BE4: 0x1F ; 0x11111113(rem: 286331155) push eax ; 7BE0: 0x1 mov dword [ebp], 0xFFFFFFFF ; 4294967295 mov edx, 0x0 ; mov eax, 0xFFFFFFFF div dword [ebp] push edx ; 7BDC: 0x0 push eax ; 7BD8: 0x1 ; idiv rm8 ; mov byte [ebp], 0xF mov al, 0xF idiv byte [ebp] push eax ; 7BD4: 0x01 mov byte [ebp], -2 mov al, 7 idiv byte [ebp] push eax ; 7BD0: 00 00 01(1: same sign as dividend) FD(1111 1101 = -3) ; idiv rm32 ; mov eax, 0 mov dword [ebp], 0 mov dword [ebp], 3 mov edx, -1 mov eax, -1 idiv dword [ebp] push eax ; 7BCC: 0x0 push edx ; 7BC8: -1 (0xFFFFFFFF) mov dword [ebp], 0x7FFFFFFF ; 2147483647 mov edx, 0x7FFF mov eax, 0xFFFFFFFF ; 0x7FFF FFFF FFFF: 140737488355327 idiv dword [ebp] push eax ; 7BC4: 0x10000 (65536) push edx ; 7BC0: 0xFFFF (65535) jmp 0
20.060606
74
0.571752
faecee63155083f8b0fafd4159d948c3b09b724c
6,401
asm
Assembly
Examples/interprocess-communication/pipedemo6.asm
agguro/linux-nasm
3e72083c3db6d7118eb2aa430b73e0d20e88456b
[ "Unlicense" ]
6
2020-07-19T18:34:43.000Z
2022-03-26T10:21:09.000Z
Examples/interprocess-communication/pipedemo6.asm
NrdyBhu1/linux-nasm
3e72083c3db6d7118eb2aa430b73e0d20e88456b
[ "Unlicense" ]
null
null
null
Examples/interprocess-communication/pipedemo6.asm
NrdyBhu1/linux-nasm
3e72083c3db6d7118eb2aa430b73e0d20e88456b
[ "Unlicense" ]
3
2020-07-19T18:35:10.000Z
2021-07-25T17:34:50.000Z
;Name: pipedemo6.asm ; ;Build: nasm -felf64 pipedemo6.asm -l pipedemo6.lst -o pipedemo6.o ; ld -s -melf_x86_64 -o pipedemo6 pipedemo6.o ; ;Description: Most examples about pipes with fork are about how a parent reads from a child ; process and put the result on screen. All these examples requires a buffer of ; fixed size. This time we send the data one byte at once through the pipe. ; As extra in this demonstration we let the parent inform the client that his work is done ; and that the client can terminate too. When child terminates his job, the parent terminates ; too and the demo ends. It's a technique I found on stackoverflow to avoid the child to end ; his job before the parent has ended his. ; Don't be confused however, the example works without the extra pipe. ; ;Source: http://stackoverflow.com/questions/12649170/c-pipe-parent-to-read-from-child-before-child-ends bits 64 [list -] %include "unistd.inc" [list +] section .bss ; first pipe for child-parent communication p0: .read: resd 1 ; read end .write: resd 1 ; write end ; second pipe for parent-child communication, this one informs our child to ; stop execution and exit. p1: .read: resd 1 ; read end .write: resd 1 ; write end ; at least one byte for our buffer is needed to read byte by byte from child process buffer: resb 1 section .data message: db 10, "One of the fundamental features that makes Linux and other Unices useful is the 'pipe'.", 10 db "Pipes allow separate processes to communicate without having been designed explicitly to work together.", 10 db "This allows tools quite narrow in their function to be combined in complex ways.", 10 db "In this example the child process reads this message and writes it into the write end of the first pipe, one by one.", 10 db "The parent process will read the bytes from the read end of the first pipe and writes it to STDOUT, one by one.", 10 db "When all bytes are read the parent informs the child that it can terminate by writing into the second pipe.", 10, 0 datareceived: db 10, "--- end of data ---", 10 .length: equ $-datareceived pipeerror: db "pipe call error" .length: equ $-pipeerror forkerror: db "fork error" .length: equ $-forkerror section .text global _start _start: ; create pipe for child-parent communication syscall pipe, p0 js errorpipe ; on error inform user and exit program ; create pipe for parent-child communication syscall pipe, p1 js errorpipe ; on error inform user and exit program ; so far, so good now clone our program with fork syscall fork and rax, rax js errorfork ; if rax < 0 then inform user of error and exit jnz parent ; here the child process starts child: ; close read end of p0 (child to parent mov edi, dword[p0.read] syscall close, rdi ; close write end of 2nd pipe mov edi, dword[p1.write] syscall close, rdi ; we are going to put the bytes one at the time in the write end of p0 ; read start address of message mov rsi, message ; leave this before the start of the loop .repeat: lodsb ; read byte in al and al, al ; when al is zero then we've reached end of message jz .done mov byte[buffer], al ;inc rsi ; next byte in message push rsi ; write byte into p0 mov edi, dword[p0.write] syscall write, rdi, buffer, 1 pop rsi ; restore byte offset jmp .repeat .done: ; close write end of p0 mov edi, dword[p0.write] syscall close, rdi ; Let the child wait until it can read a byte from the second pipe. As long as ; there is nothing in the pipe, the syscall read seems to hang. When the parent ; writes a byte in it, the child process continues and exits. From then the parent ; is informed and terminates too. mov edi, dword[p1.read] syscall read, rdi, buffer, 1 ; here we have received something from the parent, so we know that the parent ; is done with his job, so the cild can terminate too. Once the child exits his ; process, the wait syscall in the parents process will be triggered and the parent ; knows that the child is done too. The parent process can be terminated too. syscall exit, 0 ; here the parent process starts parent: ; close write end of first pipe p0 mov edi, dword[p0.write] syscall close, rdi ; close the read end of second pipe mov edi, dword[p1.read] syscall close, rdi ; here we are going to repeat reading data from p0 one byte at the time and writing it to stdout ; when the result, of the read syscall in rax, is zero, we can terminate the loop and inform the ; child that he can terminate. .repeat: ; read message from first pipe mov edi, dword[p0.read] syscall read, rdi, buffer, 1 ; if nbytesReceived in rax is zero then we terminate this loop and rax, rax jz allReceived ; write to stdout syscall write, stdout, buffer, 1 jmp .repeat ; rax is zero, all bytes are received. allReceived: ; write the received data on screen syscall write, stdout, datareceived, datareceived.length ; close read end of first pipe mov edi, dword[p0.read] syscall close, rdi ; write into second pipe to inform child that it can terminate ; don't forget this or your program waits into enternity mov edi, dword[p1.write] syscall write, rdi, buffer, 1 ; wait for child to exit syscall wait4, 0, 0, 0 ; exit syscall exit, 0 errorpipe: syscall write, stdout, pipeerror, pipeerror.length syscall exit, 0 errorfork: syscall write, stdout, forkerror, forkerror.length syscall exit, 0
39.030488
149
0.625371
6e1356987f99aa8927069af391d0c06cd198d68d
4,955
asm
Assembly
asm/interrupt.asm
PenetratingShot/OS
942f86390e4873d9fd678f7d743d5deab4966499
[ "MIT" ]
11
2020-02-06T04:32:13.000Z
2020-03-16T20:54:04.000Z
asm/interrupt.asm
PenetratingShot/os
942f86390e4873d9fd678f7d743d5deab4966499
[ "MIT" ]
2
2019-09-01T22:19:37.000Z
2019-09-01T22:28:13.000Z
asm/interrupt.asm
PenetratingShot/os
942f86390e4873d9fd678f7d743d5deab4966499
[ "MIT" ]
2
2020-09-30T11:47:39.000Z
2020-09-30T12:33:22.000Z
; Defined in isr.c [extern isr_handler] [extern irq_handler] %macro pushaq 0 push rax push rbx push rcx push rdx push rbp push rsi push rdi push r8 push r9 push r10 push r11 push r12 push r13 push r14 push r15 %endmacro %macro popaq 0 pop r15 pop r14 pop r13 pop r12 pop r11 pop r10 pop r9 pop r8 pop rdi pop rsi pop rbp pop rdx pop rcx pop rbx pop rax %endmacro isr_common: pushaq cld xor rax, rax mov rdi, rsp call isr_handler popaq ; Remove the error code and interrupt number add rsp, 16 iretq irq_common: pushaq cld xor rax, rax mov rdi, rsp call irq_handler popaq ; Remove the error code and interrupt number add rsp, 16 iretq global isr0 global isr1 global isr2 global isr3 global isr4 global isr5 global isr6 global isr7 global isr8 global isr9 global isr10 global isr11 global isr12 global isr13 global isr14 global isr15 global isr16 global isr17 global isr18 global isr19 global isr20 global isr21 global isr22 global isr23 global isr24 global isr25 global isr26 global isr27 global isr28 global isr29 global isr30 global isr31 ; IRQs global irq0 global irq1 global irq2 global irq3 global irq4 global irq5 global irq6 global irq7 global irq8 global irq9 global irq10 global irq11 global irq12 global irq13 global irq14 global irq15 ; 0: Divide By Zero Exception isr0: push byte 0 push byte 0 jmp isr_common ; 1: Debug Exception isr1: push byte 0 push byte 1 jmp isr_common ; 2: Non Maskable Interrupt Exception isr2: push byte 0 push byte 2 jmp isr_common ; 3: Int 3 Exception isr3: push byte 0 push byte 3 jmp isr_common ; 4: INTO Exception isr4: push byte 0 push byte 4 jmp isr_common ; 5: Out of Bounds Exception isr5: push byte 0 push byte 5 jmp isr_common ; 6: Invalid Opcode Exception isr6: push byte 0 push byte 6 jmp isr_common ; 7: Coprocessor Not Available Exception isr7: push byte 0 push byte 7 jmp isr_common ; 8: Double Fault Exception (With Error Code!) isr8: push byte 8 jmp isr_common ; 9: Coprocessor Segment Overrun Exception isr9: push byte 0 push byte 9 jmp isr_common ; 10: Bad TSS Exception (With Error Code!) isr10: push byte 10 jmp isr_common ; 11: Segment Not Present Exception (With Error Code!) isr11: push byte 11 jmp isr_common ; 12: Stack Fault Exception (With Error Code!) isr12: push byte 12 jmp isr_common ; 13: General Protection Fault Exception (With Error Code!) isr13: push byte 13 jmp isr_common ; 14: Page Fault Exception (With Error Code!) isr14: push byte 14 jmp isr_common ; 15: Reserved Exception isr15: push byte 0 push byte 15 jmp isr_common ; 16: Floating Point Exception isr16: push byte 0 push byte 16 jmp isr_common ; 17: Alignment Check Exception isr17: push byte 0 push byte 17 jmp isr_common ; 18: Machine Check Exception isr18: push byte 0 push byte 18 jmp isr_common ; 19: Reserved isr19: push byte 0 push byte 19 jmp isr_common ; 20: Reserved isr20: push byte 0 push byte 20 jmp isr_common ; 21: Reserved isr21: push byte 0 push byte 21 jmp isr_common ; 22: Reserved isr22: push byte 0 push byte 22 jmp isr_common ; 23: Reserved isr23: push byte 0 push byte 23 jmp isr_common ; 24: Reserved isr24: push byte 0 push byte 24 jmp isr_common ; 25: Reserved isr25: push byte 0 push byte 25 jmp isr_common ; 26: Reserved isr26: push byte 0 push byte 26 jmp isr_common ; 27: Reserved isr27: push byte 0 push byte 27 jmp isr_common ; 28: Reserved isr28: push byte 0 push byte 28 jmp isr_common ; 29: Reserved isr29: push byte 0 push byte 29 jmp isr_common ; 30: Reserved isr30: push byte 0 push byte 30 jmp isr_common ; 31: Reserved isr31: push byte 0 push byte 31 jmp isr_common ; IRQ handlers irq0: push byte 0 push byte 32 jmp irq_common irq1: push byte 1 push byte 33 jmp irq_common irq2: push byte 2 push byte 34 jmp irq_common irq3: push byte 3 push byte 35 jmp irq_common irq4: push byte 4 push byte 36 jmp irq_common irq5: push byte 5 push byte 37 jmp irq_common irq6: push byte 6 push byte 38 jmp irq_common irq7: push byte 7 push byte 39 jmp irq_common irq8: push byte 8 push byte 40 jmp irq_common irq9: push byte 9 push byte 41 jmp irq_common irq10: push byte 10 push byte 42 jmp irq_common irq11: push byte 11 push byte 43 jmp irq_common irq12: push byte 12 push byte 44 jmp irq_common irq13: push byte 13 push byte 45 jmp irq_common irq14: push byte 14 push byte 46 jmp irq_common irq15: push byte 15 push byte 47 jmp irq_common
13.108466
59
0.677296
2725b79901e1245574e657574261fb1f917a162e
6,620
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_764.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.log_21829_764.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.log_21829_764.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x774d, %rdi nop nop nop inc %rsi mov $0x6162636465666768, %r10 movq %r10, %xmm4 and $0xffffffffffffffc0, %rdi movaps %xmm4, (%rdi) nop nop and %rcx, %rcx lea addresses_WC_ht+0x4ccd, %r9 and %rax, %rax mov (%r9), %rbx nop nop sub %r9, %r9 lea addresses_UC_ht+0x188d, %r9 nop nop nop nop nop and $23258, %rcx mov $0x6162636465666768, %rax movq %rax, %xmm0 vmovups %ymm0, (%r9) nop nop nop nop nop and %rcx, %rcx lea addresses_UC_ht+0x151ad, %rsi lea addresses_normal_ht+0xa94d, %rdi nop nop nop nop add $6416, %r11 mov $40, %rcx rep movsb nop and $11133, %rsi lea addresses_UC_ht+0x1ba4d, %rsi lea addresses_D_ht+0xa0cd, %rdi nop nop sub %rax, %rax mov $81, %rcx rep movsb nop nop nop nop inc %rcx lea addresses_WT_ht+0xb2cd, %rbx nop nop nop nop and $49935, %rcx vmovups (%rbx), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %rax add %rsi, %rsi lea addresses_UC_ht+0xe8cd, %r9 nop nop nop nop mfence movl $0x61626364, (%r9) nop nop nop and $36510, %rsi lea addresses_A_ht+0xebcd, %rsi lea addresses_WC_ht+0x14305, %rdi clflush (%rsi) clflush (%rdi) nop cmp $48852, %r10 mov $93, %rcx rep movsw nop nop nop nop nop xor %rax, %rax lea addresses_WT_ht+0xcd, %rax clflush (%rax) nop nop nop inc %rdi movups (%rax), %xmm3 vpextrq $0, %xmm3, %r9 nop nop nop sub %rbx, %rbx lea addresses_A_ht+0x128cd, %rsi lea addresses_UC_ht+0x1d0cd, %rdi and %rbx, %rbx mov $59, %rcx rep movsw nop nop nop nop cmp $39614, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %rax push %rbp push %rsi // Faulty Load lea addresses_normal+0x1d0cd, %rbp nop xor $23422, %r15 mov (%rbp), %ax lea oracles, %r15 and $0xff, %rax shlq $12, %rax mov (%r15,%rax,1), %rax pop %rsi pop %rbp pop %rax pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 16}} {'src': {'NT': False, 'same': True, 'congruent': 10, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}} {'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}} {'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': True, 'same': True, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4}} {'src': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}} {'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 */
36.98324
2,999
0.661329
435815348a71291fc1b2d453164657e731e1266c
9,536
asm
Assembly
ports/C28x/Generic/CCS/os_cpu_a.asm
SijWoo/micrium-os-base
e5641b9e97d0a81dcf6ae26d61c8090491baa445
[ "Apache-2.0" ]
1
2021-05-03T15:03:28.000Z
2021-05-03T15:03:28.000Z
Ports/C28x/Generic/CCS/os_cpu_a.asm
Hackerdd/uC-OS3
a52c14a74a94576ff691b996983498ba01d6834e
[ "Apache-2.0" ]
null
null
null
Ports/C28x/Generic/CCS/os_cpu_a.asm
Hackerdd/uC-OS3
a52c14a74a94576ff691b996983498ba01d6834e
[ "Apache-2.0" ]
null
null
null
;******************************************************************************************************** ; uC/OS-III ; The Real-Time Kernel ; ; Copyright 2009-2020 Silicon Laboratories Inc. www.silabs.com ; ; SPDX-License-Identifier: APACHE-2.0 ; ; This software is subject to an open source license and is distributed by ; Silicon Laboratories Inc. pursuant to the terms of the Apache License, ; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0. ; ;******************************************************************************************************** ;******************************************************************************************************** ; ; TI C28x Port ; ; File : os_cpu_a.asm ; Version : V3.08.00 ;******************************************************************************************************** ; For : TI C28x ; Mode : C28 Object mode ; Toolchain : TI C/C++ Compiler ;******************************************************************************************************** ;******************************************************************************************************** ; INCLUDE FILES ;******************************************************************************************************** .include "os_cpu_i.asm" ;******************************************************************************************************** ; PUBLIC FUNCTIONS ;******************************************************************************************************** .def _OS_CPU_GetST0 .def _OS_CPU_GetST1 .def _OSStartHighRdy .def _OS_CPU_RTOSINT_Handler .def _OS_CPU_INT_Handler ;******************************************************************************************************** ; EXTERNAL GLOBAL VARIABLES ;******************************************************************************************************** .ref _OSTCBCurPtr ; Declared as OS_TCB * , 32-bit long .ref _OSTCBHighRdyPtr ; Declared as OS_TCB * , 32-bit long .ref _OSPrioCur ; Declared as INT8U , 16-bit long .ref _OSPrioHighRdy ; Declared as INT8U , 16-bit long .ref _OSTaskSwHook .ref _OS_CPU_IntHandler ;******************************************************************************************************** ; CODE GENERATION DIRECTIVES ;******************************************************************************************************** ; Set text section and reset local labels. .text .newblock ;******************************************************************************************************** ; GET ST0 and ST1 ; ; Description : Wrapper function to get ST0 and ST1 registers from a C function. ; ; Prototypes : CPU_INT16U OS_CPU_GetST0(void); ; CPU_INT16U OS_CPU_GetST1(void); ;******************************************************************************************************** .asmfunc _OS_CPU_GetST0: PUSH ST0 POP AL LRETR .endasmfunc .asmfunc _OS_CPU_GetST1: PUSH ST1 POP AL LRETR .endasmfunc ;********************************************************************************************************* ; START MULTITASKING ; ; Description : This function is called by OSStart() to start the highest priority task that was created ; by your application before calling OSStart(). ; ; Arguments : none ; ; Note(s) : 1) OSStartHighRdy() MUST: ; a) Call OSTaskSwHook(). ; b) Restore context for OSTCBCurPtr. ; c) IRET into highest ready task. ;********************************************************************************************************* .asmfunc _OSStartHighRdy: ; Call OSTaskSwHook() LCR #_OSTaskSwHook ; Restore context. MOVL XAR0, #_OSTCBCurPtr ; Get the process's SP. MOVL XAR1, *XAR0 MOV AL , *AR1 MOV @SP , AL ; Restore registers. OS_CTX_RESTORE ; IRET into task. IRET .endasmfunc ; Catch start high failure. OSStartHang: SB OSStartHang, UNC ;******************************************************************************************************** ; GENERIC INTERRUPT HANDLER ; void OS_CPU_INT_Handler(void) ; ; Note(s) : 1) Assembly wrapper for ISRs. ; ; 2) Saves task context before servicing the interrupt and maintains the value of IER across ; interrupts. ;******************************************************************************************************** .asmfunc _OS_CPU_INT_Handler: OS_CTX_SAVE ASP LCR #_OS_CPU_IntHandler NASP OS_CTX_RESTORE IRET .endasmfunc ;******************************************************************************************************** ; HANDLE RTOSINT INTERRUPT ; void OS_CPU_RTOSINT_Handler(void) ; ; Note(s) : 1) The RTOSINT interrupt is used to perform a context switch. The C28x core saves the ; ST0, T, ACC, P, AR0, AR1, ST1, DP, IER, DBGSTAT (shadow) registers and the Return ; Address. ; The remaining registers AR1H, AR0H, XAR2..XAR7, XT and RPC are saved by the handler. ; ; 2) The context switching RTOSINT handler pseudo-code is: ; a) Save remaining registers on the process stack; ; b) Save the process SP in its TCB, OSTCBCurPtr->OSTCBStkPtr = SP; ; c) Call OSTaskSwHook(); ; d) Get current high priority, OSPrioCur = OSPrioHighRdy; ; e) Get current ready thread TCB, OSTCBCurPtr = OSTCBHighRdyPtr; ; f) Get new process SP from TCB, SP = OSTCBHighRdyPtr->OSTCBStkPtr; ; g) Restore AR1H, AR0H, XAR2..XAR7, XT and RPC registers from the new process stack; ; h) Overwrite the previously saved (at context switch out) IER register with current IER. ; i) Perform exception return which will restore remaining context. ; ; 3) On entry into RTOSINT handler: ; a) The following have been saved on the process stack (by processor): ; ST0, T, ACC, P, AR0, AR1, ST1, DP, IER, DBGSTAT (shadow) registers and the Return ; Address. ; b) OSTCBCurPtr points to the OS_TCB of the task to suspend ; OSTCBHighRdyPtr points to the OS_TCB of the task to resume ; ; 4) This function MUST be placed in entry 16 (for RTOSINT) of the C28x interrupt table. ;******************************************************************************************************** .asmfunc _OS_CPU_RTOSINT_Handler: ; Save registers. OS_CTX_SAVE ; Save SP to current process. MOVL XAR0, #_OSTCBCurPtr ; Get the process's SP. MOVL XAR1, *XAR0 MOV AL , @SP MOV *AR1, AL ASP ; Align the stack pointer. ; Call OSTaskSwHook. LCR #_OSTaskSwHook NASP ; Restore alignement of the stack pointer. ; OSPrioCur = OSPrioHighRdy MOVL XAR0, #_OSPrioHighRdy MOVL XAR1, #_OSPrioCur MOV ACC, *XAR0 MOV *XAR1, ACC ; OSTCBCurPtr = OSTCBHighRdyPtr MOVL XAR0, #_OSTCBHighRdyPtr MOVL XAR1, #_OSTCBCurPtr MOVL ACC, *XAR0 MOVL *XAR1, ACC ; Get SP from new process. MOVL XAR0, *XAR1 MOV AL , *AR0 MOV @SP , AL OS_CTX_RESTORE ; Return from interrupt to restore remaining registers. IRET .endasmfunc ;******************************************************************************************************** ; OS-III ASSEMBLY PORT FILE END ;******************************************************************************************************** .end
43.149321
119
0.352559
27af4b624c313a1f5d57e676c4a5e17f723e7b0d
594
asm
Assembly
smsq/q68/hdop/sms.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
smsq/q68/hdop/sms.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
smsq/q68/hdop/sms.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; Q68 SMS HDOPs  1988 Tony Tebby ;  2016 W. Lenerz section sms xdef sms_hdop xref hdop_keyr xref hdop_beep xref hdop_bpof include 'dev8_keys_err' include 'dev8_smsq_smsq_base_keys' sms_hdop move.l sms.rte,-(sp) ; return to RTE move.l a3,-(sp) move.b (a3)+,d0 ; hdop command cmp.b #9,d0 ; is it kbd read? beq.l hdop_keyr ; ... yes cmp.b #$a,d0 ; is it beep? beq.s hdop_beep ; ... yes cmp.b #$b,d0 ; beep off? beq.l hdop_bpof ; ... yes move.l (sp)+,a3 moveq #0,d1 ; no return moveq #err.ipar,d0 ; ... because it's none of these rts end
19.16129
54
0.621212
2cf2d572ab29282d1c7f072e0d7fce580bf3a6a9
7,327
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1981.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1981.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1981.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r8 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0xbc55, %r13 nop add $5725, %rbx movb (%r13), %dl nop nop nop nop nop add %r11, %r11 lea addresses_UC_ht+0x3147, %rdi and $37800, %rsi movb $0x61, (%rdi) sub $46794, %r13 lea addresses_WT_ht+0x238f, %rbx dec %rdx movb $0x61, (%rbx) nop nop nop nop dec %r11 lea addresses_UC_ht+0x12c7, %rdi nop nop nop nop cmp $48750, %r11 mov (%rdi), %rbx nop nop cmp $19977, %r8 lea addresses_A_ht+0x161f7, %rdx nop nop nop nop add %r13, %r13 movw $0x6162, (%rdx) nop nop nop add $44396, %rdi lea addresses_A_ht+0x31a7, %rsi lea addresses_normal_ht+0x6ec7, %rdi nop nop nop nop nop inc %rdx mov $94, %rcx rep movsb nop cmp %rdi, %rdi lea addresses_A_ht+0xb4c7, %rsi lea addresses_A_ht+0x18ec7, %rdi dec %rdx mov $78, %rcx rep movsw nop add %r8, %r8 lea addresses_normal_ht+0xdd8f, %rdi cmp $56948, %rdx movw $0x6162, (%rdi) nop nop nop nop nop inc %rdi lea addresses_D_ht+0x126c7, %rsi lea addresses_WT_ht+0xe2c7, %rdi clflush (%rdi) nop nop dec %r13 mov $55, %rcx rep movsw nop nop nop sub $2284, %rdi lea addresses_A_ht+0x2273, %rbx clflush (%rbx) nop nop nop nop nop cmp %rcx, %rcx mov (%rbx), %rdx nop cmp %rbx, %rbx lea addresses_A_ht+0x97c7, %r11 nop nop nop nop nop sub %r13, %r13 mov $0x6162636465666768, %rcx movq %rcx, %xmm2 vmovups %ymm2, (%r11) xor %r11, %r11 lea addresses_UC_ht+0x170c7, %rsi nop nop sub %rcx, %rcx movw $0x6162, (%rsi) xor %rdx, %rdx lea addresses_UC_ht+0x11827, %r11 nop nop nop nop nop inc %r8 movw $0x6162, (%r11) nop nop nop sub $25501, %r8 lea addresses_WT_ht+0x1a39f, %r11 nop inc %rdx mov $0x6162636465666768, %rdi movq %rdi, %xmm1 vmovups %ymm1, (%r11) nop nop nop inc %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r15 push %r8 push %rbp push %rdi push %rdx push %rsi // Faulty Load lea addresses_WC+0x13ac7, %rsi dec %rbp vmovups (%rsi), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %rdx lea oracles, %r8 and $0xff, %rdx shlq $12, %rdx mov (%r8,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rbp pop %r8 pop %r15 ret /* <gen_faulty_load> [REF] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}} {'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 1, 'NT': True, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': True}} {'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
35.741463
2,999
0.655657
eac3871a520f740229d913e7ba1dbf22b8db1e66
3,035
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_6_1217.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_6_1217.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_6_1217.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r14 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x716f, %rsi lea addresses_WT_ht+0x169c9, %rdi nop nop nop nop sub $42558, %rdx mov $10, %rcx rep movsl nop add %r14, %r14 lea addresses_A_ht+0x19c7f, %rbx nop nop nop xor $13339, %rsi movb (%rbx), %r14b nop inc %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r14 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %rax push %rbp push %rcx push %rdi push %rdx // Load lea addresses_PSE+0x55af, %r12 nop nop nop nop cmp %rcx, %rcx movups (%r12), %xmm4 vpextrq $1, %xmm4, %rdx nop xor $59350, %rdx // Store mov $0x2007690000000cef, %rax nop nop nop nop inc %rbp movl $0x51525354, (%rax) // Exception!!! nop nop nop nop nop mov (0), %r12 nop nop nop xor %r13, %r13 // Store lea addresses_UC+0x130cf, %rax nop and %rdx, %rdx mov $0x5152535455565758, %rcx movq %rcx, %xmm1 vmovups %ymm1, (%rax) nop nop xor %rdi, %rdi // Store mov $0x12d4e100000004ef, %rdi nop nop nop nop add $25296, %r12 mov $0x5152535455565758, %rax movq %rax, %xmm2 vmovaps %ymm2, (%rdi) nop nop nop inc %rdi // Store lea addresses_WC+0x17bc1, %rdx add %r12, %r12 mov $0x5152535455565758, %r13 movq %r13, (%rdx) add $13226, %rbp // Store lea addresses_D+0x175c7, %rcx nop inc %rax mov $0x5152535455565758, %r13 movq %r13, %xmm0 movups %xmm0, (%rcx) nop nop nop nop nop dec %rbp // Faulty Load mov $0x4f435200000004ef, %rax nop nop xor %rbp, %rbp vmovups (%rax), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %rcx lea oracles, %rdx and $0xff, %rcx shlq $12, %rcx mov (%rdx,%rcx,1), %rcx pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_NC', 'AVXalign': False, 'size': 4}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_UC', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_NC', 'AVXalign': True, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WC', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_D', 'AVXalign': False, 'size': 16}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'00': 6} 00 00 00 00 00 00 */
18.393939
148
0.64514
37b3aaedfc03470dceaad3e8327a10a6208835e2
261
asm
Assembly
programs/oeis/156/A156821.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/156/A156821.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/156/A156821.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A156821: Prime factors of 13! listed with multiplicity. ; 2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,5,5,7,11,13 sub $0,5 trn $0,3 mov $2,1 mov $3,1 lpb $0 add $0,1 sub $3,1 add $0,$3 trn $0,7 add $0,$2 mov $1,$0 mul $2,2 mov $3,$0 lpe add $3,1 add $1,$3
13.05
57
0.551724
40dfd40bad187ebb94b19a8475d3c75043849a02
1,252
asm
Assembly
ch8/src/userapp.asm
impact-eintr/x86
114ef9240898cfc4cc8b4b19ba800ef0cd171a5c
[ "MIT" ]
null
null
null
ch8/src/userapp.asm
impact-eintr/x86
114ef9240898cfc4cc8b4b19ba800ef0cd171a5c
[ "MIT" ]
null
null
null
ch8/src/userapp.asm
impact-eintr/x86
114ef9240898cfc4cc8b4b19ba800ef0cd171a5c
[ "MIT" ]
null
null
null
SECTION header VSTART=0 ;程序的头部 progran_length: dd program_end ;程序的总长度 ;; 用户程序入口点 code_entry: dw start ;偏移地址 dd section.code.start ;段地址 ;; 段重定位表项个数 realloc_tbl_len dw (segtbl_end-segtbl_begin)/4 ;; 段重定位表 segtbl_begin: code_segment dd section.code.start ;[0x0C] data_segment dd section.data.start ;[0x10] stack_segment dd section.stack.start ;[0x14] segtbl_end: ;; ================================================================= SECTION code ALIGN=16 VSTART=0 start: ;; 初识执行时 DS 和 ES 指向用户程序头部段 mov ax, [stack_segment] mov ss, ax mov sp, stack_pointer ;设置初识的栈顶指针 mov ax, [data_segment] ;设置用户程序自己的数据段 mov ds, ax mov ax, 0xb800 mov es, ax mov si, message mov di, 0 next: mov al, [si] cmp al, 0 je exit mov byte [es:di], al mov byte [es:di], 0x07 inc si add di, 2 jmp next exit: jmp $ ;; ================================================================= SECTION data ALIGN=16 VSTART=0 message: db 'hello world.', 0 ;; ================================================================= SECTION stack ALIGN=16 VSTART=0 resb 256 stack_pointer: ;; ================================================================= SECTION trail ALIGN=16 program_end:
19.873016
68
0.523962
44c47482c9f06b33ed91d914d8f8121ce68d1d5b
39
asm
Assembly
pkgs/tools/yasm/src/modules/parsers/gas/tests/gas-instlabel.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
64
2015-03-06T00:30:56.000Z
2022-03-24T13:26:53.000Z
pkgs/tools/yasm/src/modules/parsers/gas/tests/gas-instlabel.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
12
2020-12-15T08:30:19.000Z
2022-03-13T03:54:24.000Z
pkgs/tools/yasm/src/modules/parsers/gas/tests/gas-instlabel.asm
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
40
2015-02-26T15:31:16.000Z
2022-03-03T23:23:37.000Z
.globl SUB .type SUB, @function SUB:
9.75
21
0.666667
9925c296505cfd3bfe2847c5e5b70213a9060453
486
asm
Assembly
oeis/111/A111917.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/111/A111917.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/111/A111917.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A111917: The i-th term of the generalized Fibonacci sequence [0,k,k,2k,3k,...] is given by the formula F(i) = round( k/sqrt(5) * phi^i ) provided i >= s(k); a(n) = smallest value of k such that s(k) = n. ; Submitted by Christian Krause ; 2,3,5,8,13,21,33,53,85,138,223,361,583,943,1525,2468,3993,6461,10453,16913,27365,44278 mov $1,1 mov $2,2 mov $3,2 mov $4,4 lpb $0 sub $0,1 add $2,$3 mov $3,$4 add $4,$1 mov $1,$2 div $3,$2 mov $2,$4 lpe div $2,2 mov $0,$2 add $0,1
23.142857
205
0.619342
27e4b0c669f77f6b9d5c1b95cab0669b8696149c
661
asm
Assembly
oeis/291/A291662.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/291/A291662.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/291/A291662.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A291662: Number of ordered rooted trees with 2n non-root nodes such that the maximal outdegree equals n. ; 1,1,8,53,326,1997,12370,77513,490306,3124541,20030000,129024469,834451788,5414950283,35240152706,229911617041,1503232609082,9847379391133,64617565719052,424655979547781,2794563003870310,18412956934908669,121455445321173578,801957983888792617,5300174441392685376,35059031427432595727,232087615286578676830,1537519631667900668453,10192557090712725924980,67611245311352111172211,448755316337720114153346,2980152968042881646503457,19801165182011110939937578,131629284070068266150382429 mov $1,$0 sub $1,1 add $1,$0 mov $2,$0 add $0,$1 bin $0,$1 sub $0,$2
60.090909
483
0.859304
0798f83f11b953cc06bdc49882abd46c9b3d60b9
565
asm
Assembly
programs/oeis/305/A305069.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/305/A305069.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/305/A305069.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A305069: a(n) = 117*n - 72 (n>=1). ; 45,162,279,396,513,630,747,864,981,1098,1215,1332,1449,1566,1683,1800,1917,2034,2151,2268,2385,2502,2619,2736,2853,2970,3087,3204,3321,3438,3555,3672,3789,3906,4023,4140,4257,4374,4491,4608,4725,4842,4959,5076,5193,5310,5427,5544,5661,5778,5895,6012,6129,6246,6363,6480,6597,6714,6831,6948,7065,7182,7299,7416,7533,7650,7767,7884,8001,8118,8235,8352,8469,8586,8703,8820,8937,9054,9171,9288,9405,9522,9639,9756,9873,9990,10107,10224,10341,10458,10575,10692,10809,10926,11043,11160,11277,11394,11511,11628 mul $0,117 add $0,45
94.166667
505
0.768142
1626aae1b196720fb53adeb9bb8c82b0810ac4d0
9,095
asm
Assembly
Sopa_Letras.asm
EduardaSRBastos/Assembly-2020
65fd798bd2b9a4f4520256f71aac7bd91398a7fd
[ "MIT" ]
null
null
null
Sopa_Letras.asm
EduardaSRBastos/Assembly-2020
65fd798bd2b9a4f4520256f71aac7bd91398a7fd
[ "MIT" ]
null
null
null
Sopa_Letras.asm
EduardaSRBastos/Assembly-2020
65fd798bd2b9a4f4520256f71aac7bd91398a7fd
[ "MIT" ]
null
null
null
name "Sopa_Letras" org 100h ;Eduarda Bastos - 70647 ;Rui Duarte - 70650 ;mostrar sopa de letras mov ah, 9 lea dx, linha1 int 21h mov ah, 9 lea dx, linha2 int 21h mov ah, 9 lea dx, linha3 int 21h mov ah, 9 lea dx, linha4 int 21h mov ah, 9 lea dx, linha5 int 21h mov ah, 9 lea dx, linha6 int 21h mov ah, 9 lea dx, linha7 int 21h mov ah, 9 lea dx, linha8 int 21h mov ah, 9 lea dx, linha9 int 21h mov ah, 9 lea dx, linha10 int 21h inicio: ;verificar se encontrou todas as palavras mov al, total3 cmp al, 48 je acabar ;mostrar quantas palavras faltam encontrar mov ah, 9 lea dx, total int 21h mov ah, 9 lea dx, total3 int 21h mov ah, 9 lea dx, total2 int 21h ;mostrar texto principal mov ah, 9 lea dx, texto1 int 21h ;palavra introduzida pelo user mov cx, 21 mov si, 0 introduzir: mov ah, 1 int 21h cmp al, 13 ;verificar se inseriu [ENTER] je fim mov str[si], al ;inserir letra a letra no vetor inc si loop introduzir fim: mov cx, 15 mov si, 0 ;comparar se palavra introduzida esta correta compara: mov al, str[si] cmp al, assem[si] je sim cmp al, bin[si] je sim2 cmp al, en[si] je sim3 cmp al, reg[si] je sim4 cmp al, mem[si] je sim5 cmp al, log[si] je sim6 cmp al, assem2[si] je sim cmp al, bin2[si] je sim2 cmp al, en2[si] je sim3 cmp al, reg2[si] je sim4 cmp al, mem2[si] je sim5 cmp al, log2[si] je sim6 jne falha ;comparar palavra com tamanho da variavel sim: cmp si, len-1 je assembly jne au sim2: cmp si, len2-1 je binario jne au sim3: cmp si, len3-2 je endereco jne au sim4: cmp si, len4-2 je registo jne au sim5: cmp si, len5-1 je memoria jne au sim6: cmp si, len6-1 je logica jne au au: inc si jne compara ;inserir na sopa de letras palavra encontrada assembly: cmp flag, 0 je repetido dec total3 mov bp,OFFSET linhaA2 mov ah,13h mov al,01h xor bh,bh mov bl,6 ; cor mov cx,15 ; tamanho mov dh,3 ; linha mov dl,22 ; coluna int 10h mov dl, 0 ;posicao x mov dh, 21 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, texto2 int 21h mov flag, 0 ;esperar 1 segundo MOV CX, 0FH MOV DX, 4240H MOV AH, 86H INT 15H jmp limparLinha binario: cmp flag2, 0 je repetido dec total3 mov bp,OFFSET linhaA5 mov ah,13h mov al,01h xor bh,bh mov bl,6 ; cor mov cx,13 ; tamanho mov dh,9 ; linha mov dl,4 ; coluna int 10h mov dl, 0 ;posicao x mov dh, 21 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, texto2 int 21h mov flag2, 0 ;esperar 1 segundo MOV CX, 0FH MOV DX, 4240H MOV AH, 86H INT 15H jmp limparLinha endereco: cmp flag3, 0 je repetido dec total3 mov bp,OFFSET linhaA7 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,15 mov dh,13 mov dl,2 int 10h mov dl, 0 ;posicao x mov dh, 21 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, texto2 int 21h mov flag3, 0 ;esperar 1 segundo MOV CX, 0FH MOV DX, 4240H MOV AH, 86H INT 15H jmp limparLinha registo: cmp flag4, 0 je repetido dec total3 mov bp,OFFSET linhaA9 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,13 mov dh,17 mov dl,20 int 10h mov dl, 0 ;posicao x mov dh, 21 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, texto2 int 21h mov flag4, 0 ;esperar 1 segundo MOV CX, 0FH MOV DX, 4240H MOV AH, 86H INT 15H jmp limparLinha memoria: cmp flag5, 0 je repetido dec total3 mov bp,OFFSET linhaM1 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,1 mov dl,28 int 10h mov bp,OFFSET linhaM2 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,3 mov dl,28 int 10h mov bp,OFFSET linhaM3 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,5 mov dl,28 int 10h mov bp,OFFSET linhaM4 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,7 mov dl,28 int 10h mov bp,OFFSET linhaM5 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,9 mov dl,28 int 10h mov bp,OFFSET linhaM6 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,11 mov dl,28 int 10h mov bp,OFFSET linhaM7 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,13 mov dl,28 int 10h mov dl, 0 mov dh, 21 mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, texto2 int 21h mov flag5, 0 ;esperar 1 segundo MOV CX, 0FH MOV DX, 4240H MOV AH, 86H INT 15H jmp limparLinha logica: cmp flag6, 0 je repetido dec total3 mov bp,OFFSET linhaL1 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,7 mov dl,18 int 10h mov bp,OFFSET linhaL2 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,9 mov dl,18 int 10h mov bp,OFFSET linhaL3 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,11 mov dl,18 int 10h mov bp,OFFSET linhaL4 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,13 mov dl,18 int 10h mov bp,OFFSET linhaL5 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,15 mov dl,18 int 10h mov bp,OFFSET linhaL6 mov ah,13h mov al,01h xor bh,bh mov bl,6 mov cx,1 mov dh,17 mov dl,18 int 10h mov dl, 0 ;posicao x mov dh, 21 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, texto2 int 21h mov flag6, 0 ;esperar 1 segundo MOV CX, 0FH MOV DX, 4240H MOV AH, 86H INT 15H jmp limparLinha ;palavra errada falha: mov ah, 9 lea dx, texto3 int 21h ;esperar 1 segundo mov cx, 0fh mov dx, 4240h mov ah, 86h int 15h jmp limparlinha ;limpar linhas e ir para a linha de novo limparLinha: mov dl, 0 ;posicao x mov dh, 19 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, limpar int 21h mov dl, 0 ;posicao x mov dh, 20 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, limpar int 21h mov dl, 0 ;posicao x mov dh, 21 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, limpar int 21h mov dl, 0 ;posicao x mov dh, 22 ;posicao y mov ah, 2 mov bh, 0 int 10h mov ah, 9 lea dx, limpar int 21h mov dl, 0 ;posicao x mov dh, 19 ;posicao y mov ah, 2 mov bh, 0 int 10h mov cx, 15 mov si, 0 branco: mov str[si], ' ' inc si loop branco jmp inicio ;se palavra for repetida, nao pode ser encontrada outra vez repetido: mov ah, 9 lea dx, igual int 21h ;esperar 1 segundo MOV CX, 0FH MOV DX, 4240H MOV AH, 86H INT 15H jmp limparLinha loopne inicio ;sai fora do loop para encontrar a palavra, e acaba acabar: mov ah, 9 lea dx, final int 21h mov ah, 4ch int 21h ret linha1 DB 13,10,'F O E I D K E F N N A L R U M Z A T W L$' linha2 DB 13,10,13,10, "W Q N C T Y H X E Q I A S S E M B L Y L$" linha3 DB 13,10,13,10, "F G C G O P M O O D W E O R M O C C Y K$" linha4 DB 13,10,13,10, "K W G O R I N E T L O W C H O C G W E J$" linha5 DB 13,10,13,10, "W E B I N A R I O O N F Y Y R Z Z O M C$" linha6 DB 13,10,13,10, "Q W M F E J F Z D G E Q V Z I R V J Y V$" linha7 DB 13,10,13,10, "D E N D E R E C O I V V W M A H F B M W$" linha8 DB 13,10,13,10, "K V F A C C N M H C V Y J U K P Z U C U$" linha9 DB 13,10,13,10, "V S W F E A I F Q A R E G I S T O V J D$" linha10 DB 13,10,13,10, "G J V R E M O P Q F D G Q G U W E K Z P$" sair1 db 13,10,13,10, 'Clique em [ESC] para sair.$' texto1 db 0ah, 0dh, 'Escreva a palavra: $' texto2 db 0ah, 0dh,'Parabens!$' texto3 db 0ah, 0dh,'Essa palavra nao existe. Tente outra vez!$' texto4 db 0ah, 0dh,'Sair - Obrigado.$' limpar db 0ah, 0dh,' $' igual db 13,10,13,10, 'Ja encontrou esta palavra antes.$' final db 13,10,13,10, 'Encontrou todas as palavras. Parabens!$' ;lista: binario, memoria, assembly, logica, registo, endereco flag db 1 flag2 db 1 flag3 db 1 flag4 db 1 flag5 db 1 flag6 db 1 total3 db "6$" total db 13,10,"Falta encontrar $" total2 db " palavra(s)$" linhaM1 DB 'M$' linhaM2 DB "E$" linhaM3 DB "M$" linhaM4 DB "O$" linhaM5 DB "R$" linhaM6 DB "I$" linhaM7 DB "A$" linhaA2 DB "A S S E M B L Y$" str db " $" assem db "ASSEMBLY" len equ $ - assem assem2 db "assembly" bin db "BINARIO" len2 equ $ - bin bin2 db "binario" en db "ENDERECO" len3 equ $ - en en2 db "endereco" reg db "REGISTO" len4 equ $ - reg reg2 db "registo" mem db "MEMORIA" len5 equ $ - mem mem2 db "memoria" log db "LOGICA" len6 equ $ - log log2 db "logica" mudarlinha db 13, 10, '$' linhaA5 DB , "B I N A R I O$" linhaA7 DB , "E N D E R E C O$" linhaA9 DB , "R E G I S T O$" linhaL1 DB "L$" linhaL2 DB "O$" linhaL3 DB "G$" linhaL4 DB "I$" linhaL5 DB "C$" linhaL6 DB "A$"
15.082919
66
0.60099
e8b243f945d0cbe25d4d3f82b9629fd9ae886743
297
asm
Assembly
programs/oeis/175/A175833.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/175/A175833.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/175/A175833.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A175833: Periodic sequence: repeat 4,7,11. ; 4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11,4,7,11 mod $0,3 mov $1,$0 mul $1,4 trn $1,1 add $1,4
33
204
0.585859
c1f83fb1890eb6cf225db2a2a081496ecc456a2a
426
asm
Assembly
lib/seccomp-tools/templates/asm.amd64.asm
epson12332/seccomp-tools
bebece209ceb175ead7a60c28e9eebe24c717497
[ "MIT" ]
707
2017-06-25T17:57:15.000Z
2022-03-31T12:35:31.000Z
lib/seccomp-tools/templates/asm.amd64.asm
FDlucifer/seccomp-tools
8c907128c59884069df5c0a34c262334ff25aaf2
[ "MIT" ]
51
2017-07-04T06:25:19.000Z
2022-01-02T07:22:44.000Z
lib/seccomp-tools/templates/asm.amd64.asm
FDlucifer/seccomp-tools
8c907128c59884069df5c0a34c262334ff25aaf2
[ "MIT" ]
71
2017-08-08T11:45:39.000Z
2022-03-14T06:39:52.000Z
install_seccomp: push rbp mov rbp, rsp push 38 pop rdi push 0x1 pop rsi xor eax, eax mov al, 0x9d syscall push 22 pop rdi lea rdx, [rip + _filter] push rdx /* .filter */ push _filter_end - _filter >> 3 /* .len */ mov rdx, rsp push 0x2 pop rsi xor eax, eax mov al, 0x9d syscall leave ret _filter: .ascii "<TO_BE_REPLACED>" _filter_end:
15.777778
46
0.56338
cc4aabea9ba782a6dc236b235c822370157a5d6a
149
asm
Assembly
progs/modulo-cpup.gen.asm
CoderPuppy/viluons-machine
ec8fe27234baa2722767495fe7d02ee990c3c127
[ "MIT" ]
null
null
null
progs/modulo-cpup.gen.asm
CoderPuppy/viluons-machine
ec8fe27234baa2722767495fe7d02ee990c3c127
[ "MIT" ]
null
null
null
progs/modulo-cpup.gen.asm
CoderPuppy/viluons-machine
ec8fe27234baa2722767495fe7d02ee990c3c127
[ "MIT" ]
null
null
null
?K8 18 ?K2 2 K2-- JMP -3 ?K8 5 ?K7 8 K7-- K8-- K2++ JMP -6 ?K2 -7 K8++ K2-- JMP -4 ?K2 4 K2-- K7++ K8++ JMP -5
7.45
8
0.355705
33f5b53ef5bfa8c66aad5ea914b7fd5442403d13
442
asm
Assembly
programs/oeis/194/A194055.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/194/A194055.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/194/A194055.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A194055: Natural fractal sequence of A000071 (Fibonacci numbers minus 1; a rectangular array, by antidiagonals. ; 1,1,2,1,2,3,1,2,3,4,5,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 mov $1,$0 lpb $0,1 sub $0,1 trn $2,1 add $2,1 mov $3,$1 mov $1,$0 sub $3,$0 trn $0,$2 add $2,$3 lpe add $1,1
27.625
201
0.606335
48b0815bdc74f00104ddca550db6cb4180655b9d
1,124
asm
Assembly
libsrc/target/z1013/games/joystick.asm
dikdom/z88dk
40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0
[ "ClArtistic" ]
1
2022-03-08T11:55:58.000Z
2022-03-08T11:55:58.000Z
libsrc/target/z1013/games/joystick.asm
dikdom/z88dk
40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0
[ "ClArtistic" ]
2
2022-03-20T22:17:35.000Z
2022-03-24T16:10:00.000Z
libsrc/target/z1013/games/joystick.asm
jorgegv/z88dk
127130cf11f9ff268ba53e308138b12d2b9be90a
[ "ClArtistic" ]
null
null
null
SECTION code_clib PUBLIC joystick PUBLIC _joystick EXTERN getk joystick: _joystick: ld a,l ld c,$20 cp 1 jr z,read_stick ld c,$40 cp 2 jr z,read_stick cp 3 jr nz,no_stick_qaop INCLUDE "games/joystick_qaop.as1" no_stick_qaop: cp 4 jr nz,no_stick_8246 INCLUDE "games/joystick_8246.as1" no_stick_8246: ld hl,0 ret ; practic 1/88 ; ; Bit 0 - links ; 1 - rechts ; 2 - runter ; 3 - hoch ; 4 - Aktionstast ; ; Left and right are swapped from z88dk ; Read a joystick ; Entry: c = stick address, $20,$40 ; Exit: hl = keys read_stick: ld a,$CF out ($01),a ld a,$1f out ($01),a ld a,c ;c=$20/$40 for sticks out ($00),a in a,($00) and 31 ld hl,0 ret z normalise_stick: cpl and 31 ld c,0 rra ;Left rl c rrca ;Right rl c rla rla and @00011100 or c ld l,a ld h,0 ret
16.057143
41
0.470641
4639d040fafd0621583db2ebdafe554dc2b996c7
1,328
asm
Assembly
programs/oeis/158/A158561.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/158/A158561.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/158/A158561.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A158561: a(n)=((2^n)*((2^n)+1) - (2^(n-1))*((2^(n-1))+1))/2, a(1)=3. ; 3,7,26,100,392,1552,6176,24640,98432,393472,1573376,6292480,25167872,100667392,402661376,1610629120,6442483712,25769869312,103079346176,412317122560,1649267965952,6597070815232,26388281163776,105553120460800,422212473454592,1688849877041152,6755399474610176,27021597831331840,108086391191109632,432345564496003072,1729382257447141376,6917529028714823680,27670116112711811072,110680464446552276992,442721857777619173376,1770887431093296824320,7083549724338827558912,28334198897286590758912,113336795589008924082176,453347182355760818421760,1813388729422493517873152,7253554917688874559864832,29014219670753299216203776,116056878683008798818304000,464227514732026399180193792,1856910058928088004534730752,7427640235712316833766834176,29710560942849196966323159040,118842243771396647127804280832,475368975085586307036240412672,1901475900342344665195008229376,7605903601369377534880126074880,30423614405477507887720690614272,121694457621910027047283135086592,486777830487640099181933285605376,1947111321950560378713334632939520,7788445287802241478824541512794112,31153781151208965843240572013248512,124615124604835863228847099977138176,498460498419343452627158023756840960 mov $1,2 pow $1,$0 mul $1,6 add $1,1 pow $1,2 sub $1,51 div $1,24 add $1,3 mov $0,$1
102.153846
1,170
0.889307
418ae8d456b2ff75b9da72649e96815e6627a8d2
604
asm
Assembly
oeis/105/A105309.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/105/A105309.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/105/A105309.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A105309: a(n) = |b(n)|^2 = x^2 + 3*y*2 where (x,y,y,y) is the quaternion b(n) of the sequence b of quaternions defined by b(0)=1,b(1)=1, b(n) = b(n-1) + b(n-2)*(0,c,c,c) where c = 1/sqrt(3). ; Submitted by Jon Maiga ; 1,1,2,5,9,20,41,85,178,369,769,1600,3329,6929,14418,30005,62441,129940,270409,562725,1171042,2436961,5071361,10553600,21962241,45703841,95110562,197926885,411889609,857150100,1783745641,3712008565 trn $0,1 seq $0,240513 ; Number of n X 2 0..1 arrays with no element equal to exactly two horizontal and vertical neighbors, with new values 0..1 introduced in row major order. sub $0,1
75.5
198
0.715232
29fce2025bb70e3344430915af4580c560456ac4
4,343
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1490.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1490.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1490.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 %r8 push %rax push %rdi push %rdx push %rsi lea addresses_UC_ht+0x19095, %rsi nop nop nop nop nop xor %r11, %r11 mov $0x6162636465666768, %rdi movq %rdi, %xmm0 movups %xmm0, (%rsi) nop nop add $25574, %rax lea addresses_WT_ht+0xe255, %rdx nop nop and %r8, %r8 movb $0x61, (%rdx) nop and %rax, %rax pop %rsi pop %rdx pop %rdi pop %rax pop %r8 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r8 push %r9 push %rax push %rdx // Faulty Load lea addresses_normal+0x2415, %rax nop nop add %r8, %r8 movups (%rax), %xmm3 vpextrq $1, %xmm3, %rdx lea oracles, %r11 and $0xff, %rdx shlq $12, %rdx mov (%r11,%rdx,1), %rdx pop %rdx pop %rax pop %r9 pop %r8 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
56.402597
2,999
0.662215
51c31df647e7c0f554b7ee56cfeb0a1ee9ab563f
461
asm
Assembly
oeis/036/A036702.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/036/A036702.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/036/A036702.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A036702: a(n)=number of Gaussian integers z=a+bi satisfying |z|<=n, a>=0, 0<=b<=a. ; Submitted by Christian Krause ; 1,2,4,7,10,15,20,25,32,40,49,57,66,78,89,102,114,128,142,158,175,190,209,227,245,267,288,310,331,354,379,402,429,455,483,512,538,569,597,631,663,693,727,761,798,834,868,906,943,983 lpb $0 mov $2,$0 sub $0,1 seq $2,36703 ; a(n)=number of Gaussian integers z=a+bi satisfying n-1<|z|<=n, a>=0, 0<=b<=a. add $3,$2 lpe mov $0,$3 add $0,1
35.461538
182
0.652928
fc0be1966bab87bec157f1beae2e0e77dab01725
3,628
asm
Assembly
edk2/ArmPkg/Library/ArmLib/ArmV7/ArmV7ArchTimerSupport.asm
awwiniot/Aw1689UEFI
968033cea6432cf3121ef933f2e7f073d11363fb
[ "MIT" ]
21
2016-11-20T16:47:01.000Z
2022-03-04T12:10:19.000Z
edk2/ArmPkg/Library/ArmLib/ArmV7/ArmV7ArchTimerSupport.asm
awwiniot/Aw1689UEFI
968033cea6432cf3121ef933f2e7f073d11363fb
[ "MIT" ]
3
2017-01-07T18:05:32.000Z
2017-06-09T05:47:20.000Z
edk2/ArmPkg/Library/ArmLib/ArmV7/ArmV7ArchTimerSupport.asm
awwiniot/Aw1689UEFI
968033cea6432cf3121ef933f2e7f073d11363fb
[ "MIT" ]
8
2017-01-09T07:44:28.000Z
2020-05-10T00:09:54.000Z
//------------------------------------------------------------------------------ // // Copyright (c) 2011, ARM Limited. All rights reserved. // // This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License // which accompanies this distribution. The full text of the license may be found at // http://opensource.org/licenses/bsd-license.php // // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // //------------------------------------------------------------------------------ EXPORT ArmReadCntFrq EXPORT ArmWriteCntFrq EXPORT ArmReadCntPct EXPORT ArmReadCntkCtl EXPORT ArmWriteCntkCtl EXPORT ArmReadCntpTval EXPORT ArmWriteCntpTval EXPORT ArmReadCntpCtl EXPORT ArmWriteCntpCtl EXPORT ArmReadCntvTval EXPORT ArmWriteCntvTval EXPORT ArmReadCntvCtl EXPORT ArmWriteCntvCtl EXPORT ArmReadCntvCt EXPORT ArmReadCntpCval EXPORT ArmWriteCntpCval EXPORT ArmReadCntvCval EXPORT ArmWriteCntvCval EXPORT ArmReadCntvOff EXPORT ArmWriteCntvOff AREA ArmV7ArchTimerSupport, CODE, READONLY PRESERVE8 ArmReadCntFrq mrc p15, 0, r0, c14, c0, 0 ; Read CNTFRQ bx lr ArmWriteCntFrq mcr p15, 0, r0, c14, c0, 0 ; Write to CNTFRQ bx lr ArmReadCntPct mrrc p15, 0, r0, r1, c14 ; Read CNTPT (Physical counter register) bx lr ArmReadCntkCtl mrc p15, 0, r0, c14, c1, 0 ; Read CNTK_CTL (Timer PL1 Control Register) bx lr ArmWriteCntkCtl mcr p15, 0, r0, c14, c1, 0 ; Write to CNTK_CTL (Timer PL1 Control Register) bx lr ArmReadCntpTval mrc p15, 0, r0, c14, c2, 0 ; Read CNTP_TVAL (PL1 physical timer value register) bx lr ArmWriteCntpTval mcr p15, 0, r0, c14, c2, 0 ; Write to CNTP_TVAL (PL1 physical timer value register) bx lr ArmReadCntpCtl mrc p15, 0, r0, c14, c2, 1 ; Read CNTP_CTL (PL1 Physical Timer Control Register) bx lr ArmWriteCntpCtl mcr p15, 0, r0, c14, c2, 1 ; Write to CNTP_CTL (PL1 Physical Timer Control Register) bx lr ArmReadCntvTval mrc p15, 0, r0, c14, c3, 0 ; Read CNTV_TVAL (Virtual Timer Value register) bx lr ArmWriteCntvTval mcr p15, 0, r0, c14, c3, 0 ; Write to CNTV_TVAL (Virtual Timer Value register) bx lr ArmReadCntvCtl mrc p15, 0, r0, c14, c3, 1 ; Read CNTV_CTL (Virtual Timer Control Register) bx lr ArmWriteCntvCtl mcr p15, 0, r0, c14, c3, 1 ; Write to CNTV_CTL (Virtual Timer Control Register) bx lr ArmReadCntvCt mrrc p15, 1, r0, r1, c14 ; Read CNTVCT (Virtual Count Register) bx lr ArmReadCntpCval mrrc p15, 2, r0, r1, c14 ; Read CNTP_CTVAL (Physical Timer Compare Value Register) bx lr ArmWriteCntpCval mcrr p15, 2, r0, r1, c14 ; Write to CNTP_CTVAL (Physical Timer Compare Value Register) bx lr ArmReadCntvCval mrrc p15, 3, r0, r1, c14 ; Read CNTV_CTVAL (Virtual Timer Compare Value Register) bx lr ArmWriteCntvCval mcrr p15, 3, r0, r1, c14 ; write to CNTV_CTVAL (Virtual Timer Compare Value Register) bx lr ArmReadCntvOff mrrc p15, 4, r0, r1, c14 ; Read CNTVOFF (virtual Offset register) bx lr ArmWriteCntvOff mcrr p15, 4, r0, r1, c14 ; Write to CNTVOFF (Virtual Offset register) bx lr END
30.233333
97
0.622657
1eaf123d812448354636404fac5cb35f9a062bfe
6,470
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_zr_4k_/i9-9900K_12_0xca.log_21829_70.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_4k_/i9-9900K_12_0xca.log_21829_70.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_4k_/i9-9900K_12_0xca.log_21829_70.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 %r8 push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0x1a7be, %r13 nop nop nop sub $17247, %r10 movl $0x61626364, (%r13) nop nop nop nop sub $49947, %r8 lea addresses_WC_ht+0x1156e, %rsi lea addresses_WT_ht+0x257e, %rdi sub $7123, %rdx mov $83, %rcx rep movsq nop add $32038, %r8 lea addresses_A_ht+0x95ee, %r8 nop nop nop nop nop cmp %rdx, %rdx movl $0x61626364, (%r8) nop nop nop nop nop sub %r10, %r10 lea addresses_WC_ht+0xe52e, %rsi nop nop and %r8, %r8 movb (%rsi), %cl and $41713, %r13 lea addresses_normal_ht+0xbd3f, %r10 clflush (%r10) nop xor %rdi, %rdi movb (%r10), %r8b xor %r13, %r13 lea addresses_D_ht+0xe5ee, %r8 nop nop xor $17388, %r13 movups (%r8), %xmm2 vpextrq $1, %xmm2, %rdx nop nop nop nop add $32269, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r9 push %rcx push %rdx push %rsi // Store mov $0x5ee, %r13 cmp $23708, %rdx movl $0x51525354, (%r13) nop sub $11627, %r13 // Store lea addresses_D+0xe2ae, %rsi nop dec %rcx movb $0x51, (%rsi) nop nop nop and $5780, %rcx // Store lea addresses_US+0x15aee, %r9 nop cmp $1938, %r13 movb $0x51, (%r9) nop nop nop nop nop sub %rcx, %rcx // Store lea addresses_RW+0x271a, %rsi nop nop nop nop dec %rcx mov $0x5152535455565758, %r11 movq %r11, (%rsi) nop nop nop nop sub %r12, %r12 // Store mov $0x2f23130000000dee, %r9 dec %rsi movb $0x51, (%r9) nop cmp %r12, %r12 // Faulty Load lea addresses_UC+0x3dee, %rsi nop nop nop nop nop and %r9, %r9 mov (%rsi), %r12 lea oracles, %r9 and $0xff, %r12 shlq $12, %r12 mov (%r9,%r12,1), %r12 pop %rsi pop %rdx pop %rcx pop %r9 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 11}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': True, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 4}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 4}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': True, 'congruent': 11}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': True, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 7}} {'51': 21827, '00': 2} 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 */
36.348315
2,999
0.649923
c27a3364a2b9d3d10fcd963f883e329b3f13f480
28,508
asm
Assembly
base/boot/bootcode/etfs/i386/etfsboot.asm
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/boot/bootcode/etfs/i386/etfsboot.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/boot/bootcode/etfs/i386/etfsboot.asm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
;++ ; ;Copyright (c) 1995 Compaq Computer Corporation ; ;Module Name: ; ; etfsboot.asm ; ;Abstract: ; ; The ROM in the IBM PC starts the boot process by performing a hardware ; initialization and a verification of all external devices. If an El ; Torito CD-ROM with no-emulation support is detected, it will then load ; the "image" pointed to in the Boot Catalog. This "image" is placed at ; the physical address specified in the Boot Catalog (which should be 07C00h). ; ; The code in this "image" is responsible for locating NTLDR, loading the ; first sector of NTLDR into memory at 2000:0000, and branching to it. ; ; There are only two errors possible during execution of this code. ; 1 - NTLDR does not exist ; 2 - BIOS read error ; ; In both cases, a short message is printed, and the user is prompted to ; reboot the system. ; ; ;Author: ; ; Steve Collins (stevec) 25-Oct-1995 ; ;Environment: ; ; Image has been loaded at 7C0:0000 by BIOS. (or 0000:7C00 to support some broken BIOSes) ; Real mode ; ISO 9660 El Torito no-emulation CD-ROM Boot support ; DL = El Torito drive number we booted from ; ;Revision History: ; ; Calin Negreanu (calinn) 25-May-1998 - added safety check at the beginning of the code ; - added code for loading and executing BOOTFIX.BIN ; - modified error path ;-- page ,132 title boot - NTLDR ETFS loader name etfsboot EtfsCodeSize EQU 2048 BootSeg segment at 07c0h BootSeg ends DirSeg segment at 1000h DirSeg ends LoadSeg segment at 2000h LoadSeg ends BootCode segment ;would like to use BootSeg here, but LINK flips its lid ASSUME CS:BootCode,DS:NOTHING,ES:NOTHING,SS:NOTHING public ETFSBOOT ETFSBOOT proc far cli ;WARNING!!! DO NOT CHANGE THE STACK SETUP. BOOTFIX NEEDS THIS TO BE HERE. xor ax,ax ; Setup the stack to a known good spot mov ss,ax ; Stack is set to 0000:7c00, which is just below this code mov sp,7c00h sti mov ax,cs ; Set DS to our code segment (should be 07C0h) mov ds,ax assume DS:BootCode ; ; Save the Drive Number for later use ; push dx ; ; Let's do some safety checks here. We are going to check for three things: ; 1. We are loaded at 07c0:0000 or 0000:7C00 ; 2. Boot Drive Number looks good (80h-FFh) ; 3. Our code was completely loaded by the BIOS ; call NextInstr NextInstr: pop si ; Get IP from the stack sub si,OFFSET NextInstr ; See if we run with ORIGIN 0 jz NormalCase ; Yes cmp si,7C00h ; See if, at least we run with ORIGIN 7C00H jne BootErr$wof1 ; If not, try to display some message mov ax,cs ; If offset is 7C00H, segment should be 0 cmp ax,0000h jne BootErr$wof2 ; If not, try to display some message ; We are loaded at 0000:7C00 instead of 07C0:0000. This could mess up ; some stuff so we are going to fix it. ; hack to execute JMP 07c0:BootOK db 0eah dw OFFSET BootOK dw BootSeg NormalCase: mov MSG_BAD_BIOS_CODE, '3' mov ax,cs ; See if segment is 07C0H cmp ax,07c0h jne BootErr$wnb ; If not, try to display some message BootOK: ; ; Reset ds in case we needed to change code segment ; mov ax,cs mov ds,ax ; ; OK so far. Let's try to see if drive letter looks good (80h-FFh) ; mov MSG_BAD_BIOS_CODE, '4' cmp dl,80h jb BootErr$wnb ; ; OK so far. Let's try to see if all our code was loaded. ; We look for our signature at the end of the code. ; mov MSG_BAD_BIOS_CODE, '5' mov bx, EtfsCodeSize - 2 mov ax, WORD PTR DS:[bx] cmp ax, 0AA55h jne BootErr$wnb ; ; Finally, everything looks good. ; ; ; Save the Drive Number for later use - right now drive number is pushed on the stack ; pop dx mov DriveNum,dl ; ; Let's try to load and run BOOTFIX.BIN ; .386 push OFFSET BOOTFIXNAME push 11 push LoadSeg call LoadFile jc FindSetupLdr ; ; We have BOOTFIX.BIN loaded. We call that code to see if we should boot from CD. If we shouldn't ; we'll not come back here. ; .286 pusha push ds push es ; ; BOOTFIX requires: ; DL = INT 13 drive number we booted from ; mov dl, DriveNum ; DL = CD drive number ;hack to execute CALL LoadSeg:0000 db 9Ah dw 0000h dw LoadSeg pop es pop ds popa .8086 FindSetupldr: ; ; Scan for the presence of SETUPLDR.BIN ; .386 push OFFSET LOADERNAME push 12 push LoadSeg call LoadFile jc BootErr$bnf ; ; SETUPLDR requires: ; DL = INT 13 drive number we booted from ; mov dl, DriveNum ; DL = CD drive number xor ax,ax .386 push LoadSeg push ax retf ; "return" to NTLDR (LoadSeg:0000h). Will not come back here. ETFSBOOT endp ; ; BootErr - print error message and hang the system. ; BootErr proc BootErr$wof1: ; we were loaded at a wrong address - Code 1 PUSH SI MOV BX, SI ADD BX, OFFSET MSG_BAD_BIOS_CODE MOV BYTE PTR DS:[BX], '1' ADD SI, OFFSET MSG_BAD_BIOS JMP BootErr2 BootErr$wof2: ; we were loaded at a wrong address - Code 2 PUSH SI MOV BX, SI ADD BX, OFFSET MSG_BAD_BIOS_CODE MOV BYTE PTR DS:[BX], '2' ADD SI, OFFSET MSG_BAD_BIOS JMP BootErr2 BootErr$wnb: ; some other BIOS problem PUSH 0 MOV SI, OFFSET MSG_BAD_BIOS JMP BootErr2 BootErr$bnf: ; NTLDR not found PUSH 0 MOV SI, OFFSET MSG_NO_NTLDR JMP BootErr2 BootErr$mof: ; memory overflow PUSH 0 MOV SI, OFFSET MSG_MEM_OVERFLOW JMP BootErr2 BootErr2: CALL BootErrPrint POP SI JMP BootFromHD BootErrPrint: LODSB ; Get next character OR AL, AL JZ BEdone MOV AH, 14 ; Write teletype MOV BX, 7 ; Attribute INT 10H ; Print it JMP BootErrPrint BEdone: RET BootErr endp ; ; we are trying to boot from HD. We need to move ourself out of ; this area because we are going to load MBR here ; BootFromHD: ; ; let's wait here for two seconds, so the user gets a chance to see the message ; ; ; hook INT08 ; MOV [SI+TicksCount], 24H ; two seconds delay CLI PUSH ES XOR AX, AX MOV ES, AX MOV BX, 0020H MOV AX, ES:[BX] MOV WORD PTR [SI+OldInt08], AX MOV AX, ES:[BX+2] MOV WORD PTR [SI+OldInt08+2], AX MOV ES:[BX], SI ADD ES:[BX], OFFSET NewInt08 MOV ES:[BX+2], CS POP ES STI ; ; now let's actively wait for TicksCount to become zero ; Delay: CMP [SI+TicksCount], 0 JNE Delay ; ; unhook INT08 ; cli push es xor ax,ax mov es,ax mov bx,08h * 4 mov ax,WORD PTR [SI+OldInt08] mov es:[bx],ax mov ax,WORD PTR [SI+OldInt08+2] mov es:[bx+2],ax pop es sti ; ; now let's move ourselves away from here because we are going to load MBR here ; MoveCode: push ds push es mov ax, LoadSeg mov es, ax mov ax, cs mov ds, ax ;si is already set xor di, di mov cx, EtfsCodeSize rep movsb pop es pop ds ;hack to execute JMP LoadSeg:AfterMoveLabel db 0eah dw OFFSET AfterMoveLabel dw LoadSeg AfterMoveLabel: ; ; finally load MBR ; push es mov ax, BootSeg mov es, ax mov bx, 0000h mov ax, 0201h ;read function, one sector mov cx, 0001h mov dx, 0080h int 13h jnc MbrOk ; ; there was an error, nothing else to do ; jmp $ MbrOk: pop es ; ; now let's return into MBR code ; mov dl,80h ;hack to execute JMP 0000:7C00 db 0eah dw 7c00h dw 0000h ; ; We rely on the fact that SI is not changed when this INT occurs ; This is a pretty good assumption since this code is active only ; within the tight loop near Delay label. The odds are that some ; other IRQ occures, enables interrupts, changes SI and then INT08 ; occures. This should not happen. ; NewInt08: PUSHF CLI CMP CS:[SI+TicksCount], 0 JE Default08 DEC WORD PTR CS:[SI+TicksCount] Default08: POPF PUSH WORD PTR CS:[SI+OldInt08+2] PUSH WORD PTR CS:[SI+OldInt08] RETF include etfsboot.inc ; message text ; ; ScanForEntry - Scan for an entry in a directory ; ; Entry: ; ES:0 points to the beginning of the directory to search ; Directory length in bytes is in ExtentLen1 and Extend_Len_0 ; ; Exit: ; CF set on error, clear on success. ; ES:BX points to record containing entry if match is found ; ScanForEntry proc near mov ScanIncCount, 0 mov cx,ExtentLen0 ; CX = length of root directory in bytes (low word only) cld ; Work up for string compares xor bx,bx xor dx,dx ScanLoop: mov si, EntryToFind mov dl,byte ptr es:[bx] ; directory record length -> DL cmp dl,0 jz Skip00 ; if the "record length" assume it is "system use" and skip it mov ax,bx add ax,021h ; file identifier is at offset 21h in directory record mov di,ax ; ES:DI now points to file identifier push cx xor cx,cx mov cl,EntryLen ; compare bytes repe cmpsb pop cx jz ScanEnd ; do we have a match? CheckCountUnderFlow: ; If CX is about to underflow or be 0 we need to reset CX, ES and BX if ExtentLen1 is non-0 cmp dx,cx jae ResetCount0 sub cx,dx ; update CX to contain number of bytes left in directory cmp ScanIncCount, 1 je ScanAdd1ToCount AdjustScanPtr: ; Adjust ES:BX to point to next record add dx,bx mov bx,dx and bx,0fh push cx mov cl,4 shr dx,cl pop cx mov ax,es add ax,dx mov es,ax jmp ScanLoop Skip00: mov dx,1 ; Skip past this byte jmp CheckCountUnderFlow ScanAdd1ToCount: inc cx mov ScanIncCount,0 jmp AdjustScanPtr S0: mov ScanIncCount,1 ; We'll need to increment Count next time we get a chance jmp SetNewCount ResetCount0: cmp ExtentLen1,0 ; Do we still have at least 64K bytes left to scan? jne ResetContinue stc ; We overran the end of the directory - corrupt/invalid directory ret ResetContinue: sub ExtentLen1,1 add bx,dx ; Adjust ES:BX to point to next record - we cross seg boundary here push bx push cx mov cl,4 shr bx,cl pop cx mov ax,es add ax,bx mov es,ax pop bx and bx,0fh sub dx,cx ; Get overflow amount je S0 ; If we ended right on the boundary we need to make special adjustments dec dx SetNewCount: mov ax,0ffffh sub ax,dx ; and subtract it from 10000h mov cx,ax ; - this is the new count jmp ScanLoop ScanEnd: cmp IsDir,1 je CheckDir test byte ptr es:[bx][25],2 ; Is this a file? jnz CheckCountUnderFlow ; No - go to next record jmp CheckLen CheckDir: test byte ptr es:[bx][25],2 ; Is this a directory? jz CheckCountUnderFlow ; No - go to next record CheckLen: mov al,EntryLen cmp byte ptr es:[bx][32],al ; Is the identifier length correct? jnz CheckCountUnderFlow ; No - go to next record clc ret ScanForEntry endp ; ; ExtRead - Do an INT 13h extended read ; NOTE: I force the offset of the Transfer buffer address to be 0 ; I force the high 2 words of the Starting absolute block number to be 0 ; - This allows for a max 4 GB medium - a safe assumption for now ; ; Entry: ; Arg1 - word 0 (low word) of Number of 2048-byte blocks to transfer ; Arg2 - word 1 (high word) of Number of 2048-byte blocks to transfer ; Arg3 - segment of Transfer buffer address ; Arg4 - word 0 (low word) of Starting absolute block number ; Arg5 - word 1 of Starting absolute block number ; ; Exit ; The following are modified: ; Count0 ; Count1 ; Dest ; Source0 ; Source1 ; PartialRead ; NumBlocks ; Disk Address Packet [DiskAddPack] ; ExtRead proc near push bp ; set up stack frame so we can get args mov bp,sp push bx ; Save registers used during this routine push si push dx push ax mov bx,offset DiskAddPack ; Use BX as base to index into Disk Address Packet ; Set up constant fields mov [bx][0],byte ptr 010h ; Offset 0: Packet size = 16 bytes mov [bx][1],byte ptr 0h ; Offset 1: Reserved (must be 0) mov [bx][3],byte ptr 0h ; Offset 3: Reserved (must be 0) mov [bx][4],word ptr 0h ; Offset 4: Offset of Transfer buffer address (force 0) mov [bx][12],word ptr 0h ; Offset 12: Word 2 of Starting absolute block number (force 0) mov [bx][14],word ptr 0h ; Offset 14: Word 3 (high word) of Starting absolute block number (force 0) ; ; Initialize loop variables ; mov ax,[bp][12] ; set COUNT to number of blocks to transfer mov Count0,ax mov ax,[bp][10] mov Count1,ax mov ax,[bp][8] ; set DEST to destination segment mov Dest,ax mov ax,[bp][6] ; set SOURCE to source lbn mov Source0,ax mov ax,[bp][4] mov Source1,ax ExtReadLoop: ; ; First check if COUNT <= 32 ; cmp Count1,word ptr 0h ; Is upper word 0? jne SetupPartialRead ; No - we're trying to read at least 64K blocks (128 MB) cmp Count0,word ptr 20h ; Is lower word greater than 32? jg SetupPartialRead ; Yes - only read in 32-block increments mov PartialRead,0 ; Clear flag to indicate we are doing a full read mov ax,Count0 ; NUMBLOCKS = COUNT mov NumBlocks,al ; Since Count0 < 32 we're OK just using low byte jmp DoExtRead ; Do read SetupPartialRead: ; ; Since COUNT > 32, ; Set flag indicating we are only doing a partial read ; mov PartialRead,1 mov NumBlocks,20h ; NUMBYTES = 32 DoExtRead: ; ; Perform Extended Read ; mov al,NumBlocks ; Offset 2: Number of 2048-byte blocks to transfer mov [bx][2],al mov ax,Dest ; Offset 6: Segment of Transfer buffer address mov [bx][6],ax mov ax,Source0 ; Offset 8: Word 0 (low word) of Starting absolute block number mov [bx][8],ax mov ax,Source1 ; Offset 10: Word 1 of Starting absolute block number mov [bx][10],ax mov si,offset DiskAddPack ; Disk Address Packet in DS:SI mov ah,042h ; Function = Extended Read mov dl,DriveNum ; CD-ROM drive number int 13h ; ; Determine if we are done reading ; cmp PartialRead,1 ; Did we just do a partial read? jne ExtReadDone ; No - we're done ReadjustValues: ; ; We're not done reading yet, so ; COUNT = COUNT - 32 ; sub Count0,020h ; Subtract low-order words sbb Count1,0h ; Subtract high-order words ; ; Just read 32 blocks and have more to read ; Increment DEST to next 64K segment (this equates to adding 1000h to the segment) ; add Dest,1000h jc BootErr$mof ; Error if we overflowed ; ; SOURCE = SOURCE + 32 blocks ; add Source0,word ptr 020h ; Add low order words adc Source1,word ptr 0h ; Add high order words ; NOTE - I don't account for overflow - probably OK now since we already account for 4 GB medium ; ; jump back to top of loop to do another read ; jmp ExtReadLoop ExtReadDone: pop ax ; Restore registers used during this routine pop dx pop si pop bx mov sp,bp ; restore BP and SP pop bp ret ExtRead endp ; ; ReadExtent - Read in an extent ; ; Arg1 - segment to transfer extent to ; ; Entry: ; ExtentLen0 = word 0 (low word) of extent length in bytes ; ExtentLen1 = word 1 (high word) of extent length in bytes ; ExtentLoc0 = word 0 (low word) of starting absolute block number of extent ; ExtentLoc1 = word 1 of starting absolute block number of extent ; ; Exit: ; ExtRead exit mods ; ReadExtent proc near push bp ; set up stack frame so we can get args mov bp,sp push cx ; Save registers used during this routine push bx push ax mov cl,11 ; Convert length in bytes to 2048-byte blocks mov bx,ExtentLen1 ; Directory length = BX:AX mov ax,ExtentLen0 .386 shrd ax,bx,cl ; Shift AX, filling with BX .8086 shr bx,cl ; BX:AX = number of blocks (rounded down) test ExtentLen0,07ffh ; If any of the low-order 11 bits are set we need to round up jz ReadExtentNoRoundUp add ax,1 ; We need to round up by incrementing AX, and adc bx,0 ; adding the carry to BX ReadExtentNoRoundUp: push ax ; Word 0 (low word) of Transfer size = AX push bx ; Word 1 (high word) of Transfer size = BX .286 push [bp][4] ; Segment used to transfer extent .8086 push ExtentLoc0 ; Word 0 (low word) of Starting absolute block number push ExtentLoc1 ; Word 1 of Starting absolute block number call ExtRead add sp,10 ; Clean 5 arguments off the stack pop ax ; Restore registers used during this routine pop bx pop cx mov sp,bp ; restore BP and SP pop bp ret ReadExtent endp ; ; GetExtentInfo - Get extent location ; ; Entry: ; ES:BX points to record ; Exit: ; Location -> ExtentLoc1 and ExtentLoc0 ; Length -> ExtentLen1 and ExtentLen0 ; GetExtentInfo proc near push ax ; Save registers used during this routine mov ax,es:[bx][2] ; 32-bit LBN of extent mov ExtentLoc0,ax ; store low word mov ax,es:[bx][4] mov ExtentLoc1,ax ; store high word mov ax,es:[bx][10] ; 32-bit file length in bytes mov ExtentLen0,ax ; store low word mov ax,es:[bx][12] mov ExtentLen1,ax ; store high word pop ax ; Restore registers used during this routine ret GetExtentInfo endp LoadFile proc near push bp mov bp, sp ; ; First thing, we need to read in the Primary Volume Descriptor so we can locate the root directory ; .286 push 01h ; Word 0 (low word) of Transfer size = 1 block (2048 bytes) push 0h ; Word 1 (high word) of Transfer size = 0 push DirSeg ; Segment of Transfer buffer = DirSeg push 010h ; Word 0 (low word) of Starting absolute block number = 10h push 0h ; Word 1 of Starting absolute block number = 0 .8086 call ExtRead add sp,10 ; Clean 5 arguments off the stack ; ; Determine the root directory location LBN -> ExtentLoc1:ExtentLoc0 ; determine the root directory data length in bytes -> ExtentLen1:ExtentLen0 ; mov ax,DirSeg ; ES is set to segment used for storing PVD and directories mov es,ax ASSUME ES:DirSeg mov ax,es:[09eh] ; 32-bit LBN of extent at offset 158 in Primary Volume Descriptor mov ExtentLoc0,ax ; store low word mov ax,es:[0a0h] mov ExtentLoc1,ax ; store high word mov ax,es:[0a6h] ; 32-bit Root directory data length in bytes at offset 166 in Primary Volume Descriptor mov ExtentLen0,ax ; store low word mov ax,es:[0a8h] mov ExtentLen1,ax ; store high word ; ; Now read in the root directory ; .286 push DirSeg ; Segment used for transfer = DirSeg .8086 call ReadExtent add sp,2 ; Clean 1 argument off the stack ; ; Scan for the presence of the I386 directory ; ES points to directory segment ; mov EntryToFind, offset I386DIRNAME mov EntryLen,4 mov IsDir,1 call ScanForEntry jc EntryNotFound ; ; We found the I386 directory entry, so now get its extent location (offset -31 from filename ID) ; ES:[BX] still points to the directory record for the I386 directory ; call GetExtentInfo ; ; Now read in the I386 directory ; .286 push DirSeg ; Segment used for transfer = DirSeg .8086 call ReadExtent add sp,2 ; Clean 1 argument off the stack ; ; Scan for the presence of the file that we need ; ES points to directory segment ; mov ax, DirSeg mov es, ax mov ax, [bp][8] mov EntryToFind, ax mov al, [bp][6] mov EntryLen, al mov IsDir,0 call ScanForEntry jc EntryNotFound ; ; We found the needed file, so now get its extent location (offset -31 from filename ID) ; ES:[BX] still points to the directory record for that code ; call GetExtentInfo ; ; Now, go read the file ; .286 push [bp][4] ; Segment used for transfer .8086 call ReadExtent add sp,2 ; Clean 1 argument off the stack EntryNotFound: pop bp ret LoadFile endp OldInt08 DD ? ; Default Int08 vector TicksCount dw 24H ; two seconds DiskAddPack db 16 dup (?) ; Disk Address Packet PartialRead db 0 ; Boolean indicating whether or not we are doing a partial read LOADERNAME db "SETUPLDR.BIN" BOOTFIXNAME db "BOOTFIX.BIN" I386DIRNAME db "I386" DriveNum db ? ; Drive number used for INT 13h extended reads ExtentLoc0 dw ? ; Loader LBN - low word ExtentLoc1 dw ? ; Loader LBN - high word ExtentLen0 dw ? ; Loader Length - low word ExtentLen1 dw ? ; Loader Length - high word Count0 dw ? ; Read Count - low word Count1 dw ? ; Read Count - high word Dest dw ? ; Read Destination segment Source0 dw ? ; Read Source - word 0 (low word) Source1 dw ? ; Read Source - word 1 NumBlocks db ? ; Number of blocks to Read EntryToFind dw ? ; Offset of string trying to match in ScanForEntry EntryLen db ? ; Length in bytes of entry to match in ScanForEntry IsDir db ? ; Boolean indicating whether or not entry to match in ScanForEntry is a directory ScanIncCount db ? ; Boolean indicating if we need to add 1 to Count after adjustment in ScanForEntry .errnz ($-ETFSBOOT) GT (EtfsCodeSize - 2) ; FATAL PROBLEM: boot sector is too large org (EtfsCodeSize - 2) db 55h,0aah BootSectorEnd label dword BootCode ends END ETFSBOOT
33.071926
136
0.497089
9d4d93012f314eae86ecb096f3665f9c75366498
784
asm
Assembly
oeis/226/A226705.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/226/A226705.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/226/A226705.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A226705: G.f.: 1 / (1 + 12*x*G(x)^4 - 16*x*G^5) where G(x) = 1 + x*G(x)^6 is the g.f. of A002295. ; Submitted by Christian Krause ; 1,4,48,600,7856,105684,1447392,20075416,281086416,3964453368,56240518128,801624722232,11470976280960,164691196943212,2371222443727584,34224696393237360,495036708728067088,7173892793100898728,104135761805147016096,1513892435551302963792,22038120029359538166096,321204966935519976819732,4686727047771407759936864,68453344121913122137547328,1000738214719371376823408256,14642484251649327122287099584,214411924463767156482532212240,3141938022443784176598530205000,46072116572335313516249093836224 mov $3,$0 mov $5,$0 add $5,1 lpb $5 mov $0,$3 mul $2,5 sub $5,1 sub $0,$5 add $0,$2 bin $0,$2 mov $2,$3 mul $4,-2 add $4,$0 lpe mov $0,$4
39.2
494
0.780612
25637d5ec8dd9e22793c425d45f83b4c8136a35a
6,763
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1512.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_0xa0.log_21829_1512.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_0xa0.log_21829_1512.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 %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x13975, %rbx nop nop nop sub %rax, %rax mov (%rbx), %di nop nop nop nop nop and $11995, %r12 lea addresses_UC_ht+0xbc55, %rsi lea addresses_UC_ht+0x10e55, %rdi clflush (%rdi) nop nop nop nop nop xor $52936, %r8 mov $3, %rcx rep movsw nop nop nop cmp %rcx, %rcx lea addresses_D_ht+0x1b655, %r8 nop nop inc %rbx movb $0x61, (%r8) nop nop nop nop nop sub $8607, %rcx lea addresses_D_ht+0x1a55, %r12 nop and %rdi, %rdi movw $0x6162, (%r12) nop nop sub $62595, %rdi lea addresses_UC_ht+0x1efc5, %rsi lea addresses_WC_ht+0x11c55, %rdi nop nop nop nop add %r15, %r15 mov $38, %rcx rep movsw nop nop nop inc %r15 lea addresses_D_ht+0xd0d5, %r8 nop nop sub %rdi, %rdi vmovups (%r8), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $1, %xmm2, %r15 and %rdi, %rdi lea addresses_WT_ht+0x85b5, %rsi lea addresses_UC_ht+0x2455, %rdi nop nop nop and $38393, %rbx mov $118, %rcx rep movsl sub %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r13 push %r14 push %rax push %rdi // Store mov $0x1ca1380000000a69, %rax dec %r14 movl $0x51525354, (%rax) nop nop nop cmp $46643, %r10 // Store lea addresses_US+0x10855, %r11 nop nop nop nop nop sub $51645, %rdi movb $0x51, (%r11) nop add $57803, %r12 // Store lea addresses_A+0x15f55, %rdi cmp %r13, %r13 mov $0x5152535455565758, %r11 movq %r11, %xmm6 vmovups %ymm6, (%rdi) nop nop nop nop xor $13888, %r14 // Store lea addresses_normal+0x1c5f5, %r14 nop nop nop nop sub $31652, %rax movl $0x51525354, (%r14) nop nop sub $4108, %r11 // Faulty Load lea addresses_US+0x1fc55, %r12 nop nop nop dec %r13 vmovaps (%r12), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %r11 lea oracles, %r13 and $0xff, %r11 shlq $12, %r11 mov (%r13,%r11,1), %r11 pop %rdi pop %rax pop %r14 pop %r13 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_NC', 'AVXalign': False, 'size': 4}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_US', 'AVXalign': True, 'size': 1}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_A', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 5, 'type': 'addresses_normal', 'AVXalign': False, 'size': 4}} [Faulty Load] {'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': True, 'size': 32}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 1}} {'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 8, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}} {'src': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 10, 'type': 'addresses_WC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
34.860825
2,999
0.65607
75f194be6ce4efbf55d498f3c9cd2cc5317bb961
1,217
asm
Assembly
memory-allocator/memo_alloc_in_asm.asm
cyberc00z/legacy
3d8d9e79e5ed707b225137f6af901ce7bb58b54c
[ "MIT" ]
2
2021-03-26T19:10:13.000Z
2021-04-12T08:32:07.000Z
memory-allocator/memo_alloc_in_asm.asm
xadhrit/C-python
3d8d9e79e5ed707b225137f6af901ce7bb58b54c
[ "MIT" ]
null
null
null
memory-allocator/memo_alloc_in_asm.asm
xadhrit/C-python
3d8d9e79e5ed707b225137f6af901ce7bb58b54c
[ "MIT" ]
1
2021-05-21T10:48:57.000Z
2021-05-21T10:48:57.000Z
; We have to use sys_brk() call provided from the kernal ;; sys_brk() system call is provided by the kernal , to allocate memory without the need of moving it later. This call allocates memory right behind the application image in the memory. This system function allows you to set the highest available address in the data section. ; in any case of error, sys_brk() returns -1 ; a following program will allocate 16kb of memory using sys_brk() system call section .data msg db "Allocated 4kb of memory", 10 len equ $-msg section .data global _start _start: mov eax, 45 ;call number 45 for sys_brk() xor ebx, eax ;; cleaning the eax register int 0x80 ; kernal call add eax, 4096 ;let's allocate 4kb of memory mov ebx, eax mov eax, 45 int 0x80 cmp eax, 0 jl exit ;exit if something went wrong mov edi, eax ;edi - highest ava.. addr sub edi, 4 mov ecx, 1024 ;numbers of DWORDS allocated xor eax, eax std rep stosd cld mov eax, 4 mov ebx, 1 mov ecx, msg mov edx, len int 0x80 exit: mov eax, 1 xor ebx, ebx int 0x80
22.962264
275
0.62613
c6a10b7b7980ce9c25042df172e5691c199ae3ac
19,539
asm
Assembly
dimension/system/frustration/osw.asm
ekscrypto/Unununium
4b67e7c5e63cf1be2157382ffd4c1e9d12957a1f
[ "BSD-2-Clause" ]
7
2019-03-04T08:53:33.000Z
2022-01-28T19:32:12.000Z
dimension/system/frustration/osw.asm
ekscrypto/Unununium
4b67e7c5e63cf1be2157382ffd4c1e9d12957a1f
[ "BSD-2-Clause" ]
null
null
null
dimension/system/frustration/osw.asm
ekscrypto/Unununium
4b67e7c5e63cf1be2157382ffd4c1e9d12957a1f
[ "BSD-2-Clause" ]
null
null
null
;; $Header: /cvsroot/uuu/dimension/system/frustration/osw.asm,v 1.4 2009/05/20 00:40:41 instinc Exp $ ;; ;; FRuSTRaTiON OS-Wrapper, for Unununium Core revision 2 ;; [bits 32] section .bss resb 1024 section .text ; ----------------------------------- ; configuration ;============================================================================== ;; amount of memory to use, TODO: if undefined auto-detect %assign _ASSUME_MEMORY_ 4 ; in MiB ;; the shell to start; undefined to run no shell %define _SHELL_ "/bin/ish" ;; device to mount as root after core init; undef to mount nothing %define _ROOT_DEVICE_ "/dev/fd/0" ;; how many terminal will be created (only if a shell is being run) %define _TERMINAL_COUNT_ 4 ;; enable debugging (this doesn't do anything, does it? :P ) ;%define _DEBUG_ ;; enable a utility that will check between each cell init to see if the ;; registers have been corrupted. To use it _SHELL_ should be undefined. ;%define _REG_CORRUPTION_CHECK_ ;; trace the contents of the registers between the init of each cell ;%define _REG_TRACING_ ;; define the little info splert that is printed at init %define _DISTRO_INFO_ "FRuSTRaTiON CVS $Name: $" ; ----------------------------------- ; includes ;============================================================================== ; ----------------------------------- ; strucs ;============================================================================== struc print_file .fd: resb file_descriptor_size .width: resd 1 ; width of the display, in bytes .size: resd 1 ; size of the console, in bytes .cur: resd 1 ; cursor pos, within video memory endstruc struc buf_file .fd: resb file_descriptor_size .buf: resd 1 ; ptr to current buffer .size: resd 1 ; size of current buffer .cur: resd 1 ; current location within buffer endstruc ; ----------------------------------- ; OSW Entry Point ;============================================================================== global _start _start: ; cmp eax, 0x2BADB002 ; multiboot loader sets eax=0x2BADB002 ; jz short $ ;- Blank the screen and set a blue status bar mov edi, 0xB8000 xor eax, eax mov ecx, (80*50*2)/4 repz stosd ;- Masking all irq mov al, 0xFF ; irq mask out 0x21, al ; master pic out 0xA1, al ; slave pic ;\/--------------[ NEW INIT SEQUENCE ]-------------\/ ;- Initialize starting registers extern __INIT_SEQUENCE_LOCATION__ mov esi, __INIT_SEQUENCE_LOCATION__ xor ebx, ebx ; set process header = 0 push dword [esi + 12] ; number of .c_init calls push dword [esi + 8] ; number of zeroize push dword [esi + 4] ; number of .c_onetime_init calls mov edx, [esi] ; number of moves add esi, 16 ; go past init struc, and hit the move struc osw_move_cells: ; dec edx ; check if there is an operation to perform js short .completed ; in case there isn't, done that part push esi ; backup pointer to start of move operation mov al, 'M' call display_init_status mov ecx, dword [esi + 10] ; get length to move (in dword) mov edi, dword [esi + 6] ; set destination of the block mov esi, dword [esi + 2] ; get block origin rep movsd ; move it pop esi ; restore pointer to start of move operation add esi, byte 14 ; advance pointer to next op jmp short osw_move_cells ; .completed: ; ; ; perform calls phase 1 operations ;--------------------------------- pop ecx ; restore number of .c_onetime_init calls jecxz osw_call1_cells.completed osw_call1_cells: ; pushad ; backup all regs, they will be destroyed mov al, 'O' call display_init_status mov eax, [esi + 2] ; destination to call movzx ecx, byte [esi + 10] ; number of arguments mov esi, [esi + 6] ; ptr to parameter array call eax ; call cell .c_onetime_init popad ; restore all regs, cell doesn't have to do it add esi, byte 11 ; move to next entry dec ecx ; optimize for speed, don't use loop :P jnz short osw_call1_cells ; .completed: ; ; ; perform zeroize operations ;--------------------------- pop edx ; restore the number of zeroize op to do osw_zero_bss: ; dec edx ; check if there's an op to perform js short .completed ; in case not, we are done mov al, 'Z' call display_init_status mov edi, dword [esi + 2] ; offset to start zeroizing mov ecx, dword [esi + 6] ; number of dword to zeroize xor eax, eax ; zeroizer value = 0 rep stosd ; zeroize that section add esi, byte 10 ; move to next op jmp osw_zero_bss ; continue zeroizing .completed: ; ;- set up lanthane to use some fake ttyish files we provide mov eax, __SYSLOG_TYPE_DEBUG__ mov ebx, print_fd externfunc sys_log.set_echo_file mov eax, __SYSLOG_TYPE_INFO__ externfunc sys_log.set_echo_file mov eax, __SYSLOG_TYPE_LOADINFO__ externfunc sys_log.set_echo_file mov eax, __SYSLOG_TYPE_WARNING__ externfunc sys_log.set_echo_file mov eax, __SYSLOG_TYPE_FATALERR__ externfunc sys_log.set_echo_file mov eax, __SYSLOG_TYPE_DEBUG__ mov ebx, buf_fd externfunc sys_log.set_print_file mov eax, __SYSLOG_TYPE_INFO__ externfunc sys_log.set_print_file mov eax, __SYSLOG_TYPE_LOADINFO__ externfunc sys_log.set_print_file mov eax, __SYSLOG_TYPE_WARNING__ externfunc sys_log.set_print_file mov eax, __SYSLOG_TYPE_FATALERR__ externfunc sys_log.set_print_file ; gives some memory to the memory manager extern __END_OF_EXPORT__ mov eax, __END_OF_EXPORT__ mov ecx, (_ASSUME_MEMORY_ * 1024 * 1024) sub ecx, eax externfunc mem.dealloc_forced_range extern __STACK_LOCATION__ mov eax, __STACK_LOCATION__ mov ecx, 0xA0000 sub ecx, eax externfunc mem.dealloc_forced_range ; perform .c_init calls ;---------------------- pop ecx ; restore number of .c_init call to perform jecxz osw_call2_cells.completed osw_call2_cells: ;calls for .c_init of cells pushad ; backup all regs, cell don't have to do it mov al, 'I' call display_init_status push esi mov eax, [esi + 2] ; destination to call movzx ecx, byte [esi + 10] ; number of arguments mov esi, [esi + 6] ; ptr to parameter array call eax ; call .c_init pop esi jc near display_init_failed movzx esi, word [esi] extern __INFO_REDIRECTOR_TABLE__ mov esi, [esi*4 + __INFO_REDIRECTOR_TABLE__ - 4] movzx eax, byte [esi + 3] push eax mov al, [esi + 2] push eax mov al, [esi + 1] push eax mov al, [esi] push eax mov esi, dword [esi + 4] push esi push byte 1 push dword string_initialized externfunc sys_log.print add esp, byte 28 - 8 popad ; restore all regs, cell don't have to do it add esi, byte 11 ; move to next op dec ecx ; jnz osw_call2_cells ; .completed: ; call init_completed ; ----------------------------------- ; create terminals with silver, if any ;============================================================================== %if _TERMINAL_COUNT_ create_terminals: push byte _TERMINAL_COUNT_ .create_term: externfunc terminal.create dec dword[esp] jnz .create_term pop ecx %else %error no terminals are being created in init. %endif ; ----------------------------------- ; open a terminal to serve as stdin/out/err ;============================================================================== open_terminal: mov esi, terminal_str externfunc vfs.open jnc .terminal_opened push eax push __SYSLOG_TYPE_FATALERR__ push unable_to_open_tty externfunc sys_log.print add esp, byte 4 push __SYSLOG_TYPE_FATALERR__ push tty_enter_to_reboot externfunc sys_log.print jmp reboot.wait .terminal_opened: mov [shell_proc_info+process_info.stdin], ebx mov [shell_proc_info+process_info.stdout], ebx mov [shell_proc_info+process_info.stderr], ebx mov ebp, [ebx] ; ----------------------------------- ; set lanthane to use the terminal ;============================================================================== mov eax, __SYSLOG_TYPE_DEBUG__ externfunc sys_log.set_echo_file mov eax, __SYSLOG_TYPE_FATALERR__ externfunc sys_log.set_echo_file push ebx xor ebx, ebx mov eax, __SYSLOG_TYPE_INFO__ externfunc sys_log.set_echo_file mov eax, __SYSLOG_TYPE_LOADINFO__ externfunc sys_log.set_echo_file mov eax, __SYSLOG_TYPE_WARNING__ externfunc sys_log.set_echo_file pop ebx ; ----------------------------------- ; now that the terminal is open, announce our presence ;============================================================================== mov esi, init_running_str mov ecx, init_running_len call [ebp+file_op_table.write] ; ----------------------------------- ; register the VOiD symbols in the core with hydrogen ;============================================================================== register_void_syms: mov esi, registering_syms_str mov ecx, registering_syms_len call [ebp+file_op_table.write] ; register all of the VOiD syms with hydrogen extern __SYMBOLS_LINKAGE__ mov esi, __SYMBOLS_LINKAGE__ + 4 mov ecx, [esi - 4] jecxz .done .register_sym: push ecx mov edx, [esi] movzx ecx, word [esi + 6] push ecx movzx ecx, word [esi + 4] add esi, byte 8 .registering_global_prov: dec ecx js short .done_providers lodsd xchg eax, edi externfunc void.add_global jmp short .registering_global_prov .done_providers: pop ecx externfunc void.lookup_global .registering_global_dep: dec ecx js short .done lodsd xchg eax, edi externfunc void.add_hook jmp short .registering_global_dep .done: pop ecx dec ecx jnz short .register_sym ; ----------------------------------- ; set up an empty environment ;============================================================================== set_up_env: mov esi, initing_env_str mov ecx, initing_env_len call [ebp+file_op_table.write] ; set up an empty environment mov ecx, 4 externfunc mem.alloc jnc .no_error push eax mov esi, mem_alloc_error_str mov ecx, mem_alloc_error_len call [ebp+file_op_table.write] pop edx externfunc lib.string.print_dec_no_pad jmp reboot .no_error: mov [edi], dword 0 mov [shell_proc_info+process_info.env], edi mov esi, done_str mov ecx, done_len call [ebp+file_op_table.write] ; ----------------------------------- ; mount a root device, if any ;============================================================================== %ifdef _ROOT_DEVICE_ mount_root: mov esi, mounting_str mov ecx, mounting_len call [ebp+file_op_table.write] mov esi, root_device_str externfunc lib.string.find_length call [ebp+file_op_table.write] mov esi, mounting_str2 mov ecx, mounting_len2 call [ebp+file_op_table.write] mov esi, root_dir_str mov eax, root_device_str mov edx, __FS_TYPE_EXT2__ externfunc vfs.mount mov ebx, [shell_proc_info+process_info.stdout] mov ebp, [ebx] jnc .mounted mov esi, unable_to_mount_str mov ecx, unable_to_mount_len call [ebp+file_op_table.write] mov edx, eax externfunc lib.string.print_dec_no_pad jmp reboot .mounted: mov esi, done_str mov ecx, done_len call [ebp+file_op_table.write] %else %error no root device is being mounted in init. %endif ; ----------------------------------- ; execute the shell ;============================================================================== execute_shell: mov esi, running_shell_str mov ecx, running_shell_len call [ebp+file_op_table.write] mov esi, shell_bin_str externfunc lib.string.find_length call [ebp+file_op_table.write] mov al, 0xa externfunc lib.string.print_char mov ebx, shell_proc_info mov edi, shell_argv mov ecx, shell_argc xor eax, eax externfunc process.create externfunc process.kill_self ; ----------------------------------- ; reboot the system ;============================================================================== reboot: mov esi, init_terminating_str mov ecx, init_terminating_len call [ebp+file_op_table.write] .wait: externfunc debug.diable.wait ; init complete, reboot the system mov al, 0xFE out 0x64, al mov al, 0x01 out 0x92, al ; should have rebooted, but lock to be sure cli jmp short $ ; ----------------------------------- ; _print_write ;============================================================================== _print_write: ; write function for our print pseudo-files pushad mov ah, 0x07 mov edi, [ebx+print_file.cur] .write_char: cmp edi, [ebx+print_file.size] jae .scroll .scroll_ret: mov al, [esi] cmp al, 0xa jz .nl mov [0xb80A0+edi], ax add edi, byte 2 .next_char: inc esi dec ecx jnz .write_char mov [ebx+print_file.cur], edi popad clc retn .scroll: push esi push ecx mov edi, 0xb80A0 mov ecx, [ebx+print_file.size] mov esi, edi sub ecx, [ebx+print_file.width] add esi, [ebx+print_file.width] shr ecx, 2 repz movsd mov ecx, [ebx+print_file.width] mov eax, 0x07200720 shr ecx, 2 repz stosd mov edi, [ebx+print_file.size] sub edi, [ebx+print_file.width] pop ecx pop esi jmp short .scroll_ret .nl: mov eax, edi xor edx, edx div dword[ebx+print_file.width] sub edi, edx mov ah, 0x7 add edi, [ebx+print_file.width] jmp short .next_char ; ----------------------------------- ; _buf_write ;============================================================================== _buf_write: ; fake write function for our fake buffer write files pushad .check_size: mov edx, [ebx+buf_file.size] sub edx, [ebx+buf_file.cur] cmp ecx, edx ja .resize mov edi, [ebx+buf_file.buf] add edi, [ebx+buf_file.cur] repz movsb sub edi, [ebx+buf_file.buf] mov [ebx+buf_file.cur], edi popad clc retn .resize: push ecx mov eax, [ebx+buf_file.buf] test eax, eax jz .create_new mov ecx, [ebx+buf_file.size] add ecx, 0x1000 externfunc mem.realloc mov [ebx+buf_file.buf], edi mov [ebx+buf_file.size], ecx pop ecx jmp short .check_size .create_new: mov ecx, 0x1000 externfunc mem.alloc mov [ebx+buf_file.buf], edi mov [ebx+buf_file.size], ecx pop ecx jmp short .check_size ; ----------------------------------- ; sys_log.get_log_pointer ;============================================================================== globalfunc sys_log.get_log_pointer mov ebx, buf_fd retn ; ----------------------------------- ; display_init_status ;============================================================================== display_init_failed: extern __INFO_REDIRECTOR_TABLE__ movzx esi, word [esi] mov esi, [esi*4 + __INFO_REDIRECTOR_TABLE__ -4] push eax push dword [esi + 4] push byte __SYSLOG_TYPE_FATALERR__ push dword string_init_failed externfunc sys_log.print jmp short $ init_completed: pushad mov esi, string_export_completed mov al, '-' jmp short display_init_status.string_set section .data string_export_completed: db "Export completed. Proceeding with standard initialization.",0 string_exported: db "%s Exported",0x0A,0 string_initialized: db "%s version %u.%u.%u.%u Initialized.",0x0A,0 string_init_failed: db "%s initialization failed with error code: %x",0 section .text display_init_status: pushad movzx ebx, word [esi] extern __INFO_REDIRECTOR_TABLE__ mov esi, [ebx*4 + __INFO_REDIRECTOR_TABLE__ -4] mov esi, [esi + 4] .string_set: mov edi, 0xB8000 cbw shl eax, 16 or eax, 0x1F001700+'[' stosd mov al, ']' stosw mov al, ' ' push byte 77 pop ecx .display: stosw lodsb dec ecx jz short .quit test al, al jnz short .display rep stosw .quit: popad retn ; ----------------------------------- ; DATA ;============================================================================== section .data %ifdef _SHELL_ %ifdef _ROOT_DEVICE_ root_dir_str: db "/",0 root_device_str: db _ROOT_DEVICE_,0 unable_to_mount_str: db "vfs.mount returned error " unable_to_mount_len: equ $-unable_to_mount_str mounting_str: db 'mounting "' mounting_len: equ $-mounting_str mounting_str2: db '" as root...' mounting_len2: equ $-mounting_str2 %endif ; _ROOT_DEVICE_ shell_argv: dd shell_bin_str, 0 shell_argc: equ ($-shell_argv) / 4 - 1 shell_proc_info: times process_info_size db 0 terminal_str: db "/dev/tty/0",0 shell_bin_str: db _SHELL_,0 init_running_str: db 'init $Revision: 1.4 $ running. Hello world!',0xa,_DISTRO_INFO_,0xa init_running_len: equ $-init_running_str registering_syms_str: db 'registering VOiD symbols...' registering_syms_len: equ $-registering_syms_str register_done_str: db ' symbols registered',0xa register_done_len: equ $-register_done_str register_err_str: db 'void.add_global returned error ' register_err_len: equ $-register_err_str unable_to_exec_str: db 'process.exec returned error ' unable_to_exec_len: equ $-unable_to_exec_str returned_error_str: db 'shell returned error ' returned_error_len: equ $-returned_error_str mem_alloc_error_str: db "mem alloc returned error " mem_alloc_error_len: equ $-mem_alloc_error_str init_terminating_str: db 0xa,"init $Revision: 1.4 $ terminating",0xa,"press enter to reboot; have a nice day!" init_terminating_len: equ $-init_terminating_str done_str: db "done",0xa done_len: equ $-done_str initing_env_str: db "initializing environment..." initing_env_len: equ $-initing_env_str running_shell_str: db 'executing shell ' running_shell_len: equ $-running_shell_str %ifdef _TERMINAL_COUNT_ unable_to_open_tty: db "unable to open terminal, error %u",0xa,0 tty_enter_to_reboot: db "press enter to reboot",0 %endif %endif ; _SHELL_ print_fd: istruc print_file at file_descriptor.op_table, dd print_op_table at print_file.width, dd 80*2 at print_file.size, dd 80*24*2*2 at print_file.cur, dd 0 iend print_op_table: istruc file_op_table at file_op_table.write, dd _print_write iend buf_fd: istruc buf_file at file_descriptor.op_table, dd buf_op_table iend buf_op_table: istruc file_op_table at file_op_table.write, dd _buf_write iend
27.793741
110
0.588874
b27cfcaacd9fd60680ce270212b779c91358d1e6
249
asm
Assembly
programs/oeis/040/A040133.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/040/A040133.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/040/A040133.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A040133: Continued fraction for sqrt(146). ; 12,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12,24,12 pow $1,$0 sub $1,2 gcd $1,$0 mul $1,12
31.125
163
0.654618
b14c1d4947efb549968873d193075e0ca34db037
412
asm
Assembly
oeis/004/A004528.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/004/A004528.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/004/A004528.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A004528: Ratios of successive terms are 1,2,2,2,3,4,4,4,5,6,6,6,7... ; Submitted by Christian Krause ; 1,1,2,4,8,24,96,384,1536,7680,46080,276480,1658880,11612160,92897280,743178240,5945425920,53508833280,535088332800,5350883328000,53508833280000,588597166080000,7063165992960000 mov $1,3 mov $2,1 mov $4,1 lpb $0 sub $0,1 add $1,3 mov $3,$2 add $2,$1 mod $3,2 add $5,$3 mul $4,$5 lpe mov $0,$4
22.888889
178
0.699029
bdd5931167eddb36a62572e9d6058ff8996d501f
267
asm
Assembly
smsq/sbas/procs/instr.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
smsq/sbas/procs/instr.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
smsq/sbas/procs/instr.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; SBAS_PROCS_INSTR - SBASIC INSTR control V2.00  1994 Tony Tebby section exten xdef instr_case xref ut_gxin1 include 'dev8_keys_sbasic' ;+++ ; INSTR_CASE 0/1 ;--- instr_case jsr ut_gxin1 tst.w (a6,a1.l) sne sb_cinst(a6) ; set instr flag rts end
13.35
69
0.692884
767a8f30795dd47879b4646a466d704254cbbfc0
2,242
asm
Assembly
maps/OreburghPokemonCenter1F.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
maps/OreburghPokemonCenter1F.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
maps/OreburghPokemonCenter1F.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
2
2021-08-11T19:47:07.000Z
2022-01-01T07:07:56.000Z
object_const_def ; object_event constants OreburghPokemonCenter1F_MapScripts: db 0 ; scene scripts db 0 ; callbacks OreburghPokemonCenter1F_NurseScript: jumpstd pokecenternurse OreburghPokemonCenter1F_PCGirlScript: jumptextfaceplayer .Text .Text: text "Switch on the PC" line "at any #MON" cont "CENTER." para "Connect to" line "“SOMEONE's PC” and" cont "access the #MON" cont "STORAGE SYSTEM." para "That's all you need" line "to do to store or" cont "bring out your" cont "#MON." done OreburghPokemonCenter1F_TeamGalacticGuyScript: jumptextfaceplayer .Text .Text: text "Hmmm!" para "What, or who, is" line "TEAM GALACTIC?!" para "They make" line "wonderful claims" cont "of a dream energy" cont "source on one" cont "hand…" para "But rumor has it," line "they steal #MON" cont "from others by" cont "force." para "It's a mystery!" line "They're mysterious!" para "Isn't anyone" line "investigating" cont "them?" done OreburghPokemonCenter1F_MapEvents: db 0, 0 ; filler db 3 ; warp events warp_event 3, 7, OREBURGH_CITY, 6 warp_event 4, 7, OREBURGH_CITY, 6 warp_event 0, 7, POKECENTER_2F, 1 db 0 ; coord events db 0 ; bg events db 3 ; object events object_event 3, 1, SPRITE_NURSE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, OreburghPokemonCenter1F_NurseScript, -1 object_event 1, 3, SPRITE_COOLTRAINER_F, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 1, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, OreburghPokemonCenter1F_PCGirlScript, -1 ; object_event 2, 5, SPRITE_SUPER_NERD, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, OreburghPokemonCenter1F_, -1 ; object_event 8, 6, SPRITE_BUG_CATCHER, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 1, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, OreburghPokemonCenter1F_, -1 object_event 6, 7, SPRITE_GENTLEMAN, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, OreburghPokemonCenter1F_TeamGalacticGuyScript, -1 ; object_event 7, 3, SPRITE_GAMEBOY_KID, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, OreburghPokemonCenter1F_, -1 ; object_event 8, 3, SPRITE_GAMEBOY_KID, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, OreburghPokemonCenter1F_, -1
29.5
156
0.745317
2001df5f4c704c63292fd7460bda4caed856e62f
678
asm
Assembly
oeis/072/A072352.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/072/A072352.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/072/A072352.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A072352: a(n) is the largest n-digit Fibonacci number. ; Submitted by Jamie Morken(s3) ; 8,89,987,6765,75025,832040,9227465,63245986,701408733,7778742049,86267571272,956722026041,6557470319842,72723460248141,806515533049393,8944394323791464,99194853094755497,679891637638612258,7540113804746346429,83621143489848422977,927372692193078999176,6356306993006846248183,70492524767089125814114,781774079430987230203437,8670007398507948658051921,96151855463018422468774568,659034621587630041982498215,7308805952221443105020355490,81055900096023504197206408605,898923707008479989274290850145 seq $0,173833 ; 10^n - 3. seq $0,87172 ; Greatest Fibonacci number that does not exceed n.
96.857143
496
0.877581
e2c630a60d84b4839e2caf1b425a014966d483db
7,432
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_932.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_932.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_932.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r15 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_WC_ht+0x9700, %rsi lea addresses_A_ht+0xc500, %rdi clflush (%rsi) nop nop nop dec %r9 mov $115, %rcx rep movsl nop nop nop nop nop cmp $6024, %rcx lea addresses_normal_ht+0x2100, %r13 nop nop and $45324, %r12 movb $0x61, (%r13) xor %rdi, %rdi lea addresses_A_ht+0x12d60, %rcx nop nop nop cmp $6341, %rdi mov $0x6162636465666768, %r9 movq %r9, %xmm5 movups %xmm5, (%rcx) cmp $41692, %r13 lea addresses_normal_ht+0xbb80, %rcx nop nop nop xor %rdi, %rdi mov (%rcx), %r13w nop nop nop nop sub %rdi, %rdi lea addresses_WC_ht+0x4ea0, %r13 add $42526, %r12 mov (%r13), %r15w add $27862, %r9 lea addresses_D_ht+0x1ed00, %rcx nop nop nop nop nop xor $33226, %r12 movb (%rcx), %r13b xor %rdi, %rdi lea addresses_UC_ht+0x5100, %rsi lea addresses_UC_ht+0x392, %rdi nop cmp %r9, %r9 mov $59, %rcx rep movsw nop nop xor %rsi, %rsi lea addresses_WC_ht+0x12080, %r9 nop nop cmp %rsi, %rsi mov $0x6162636465666768, %rdi movq %rdi, (%r9) nop nop nop lfence lea addresses_normal_ht+0x1bef7, %rsi lea addresses_A_ht+0x5d00, %rdi nop nop nop nop nop cmp %rbp, %rbp mov $76, %rcx rep movsw nop nop cmp %r15, %r15 lea addresses_normal_ht+0xa700, %r9 nop sub $50361, %rdi movl $0x61626364, (%r9) nop nop nop nop nop inc %r12 lea addresses_UC_ht+0x10c80, %rsi lea addresses_WT_ht+0x6640, %rdi nop nop cmp %r9, %r9 mov $100, %rcx rep movsl and $55925, %rcx pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r15 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r15 push %r9 push %rbx push %rdi // Load mov $0x200, %rbx nop nop nop xor %rdi, %rdi movaps (%rbx), %xmm4 vpextrq $0, %xmm4, %r12 nop nop dec %r12 // Load mov $0x1fcac00000000000, %r10 nop nop nop dec %r15 movb (%r10), %r14b nop nop nop nop nop and $7221, %r14 // Store lea addresses_WC+0x16300, %r10 cmp %r14, %r14 mov $0x5152535455565758, %rbx movq %rbx, %xmm5 vmovups %ymm5, (%r10) nop nop nop and $64952, %r10 // Faulty Load lea addresses_A+0x6100, %rdi nop nop add $64136, %r9 mov (%rdi), %r15 lea oracles, %r9 and $0xff, %r15 shlq $12, %r15 mov (%r9,%r15,1), %r15 pop %rdi pop %rbx pop %r9 pop %r15 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': True, 'congruent': 6}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 9}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': True, 'AVXalign': True, 'congruent': 7}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_normal_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 5}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
34.567442
2,999
0.655005
25c0cbfa4fb614bebaf888f650fad48a9f5309a4
166
asm
Assembly
libsrc/_DEVELOPMENT/adt/wv_stack/c/sccz80/wv_stack_top.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
8
2017-01-18T12:02:17.000Z
2021-06-12T09:40:28.000Z
libsrc/_DEVELOPMENT/adt/wv_stack/c/sccz80/wv_stack_top.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
1
2017-03-06T07:41:56.000Z
2017-03-06T07:41:56.000Z
libsrc/_DEVELOPMENT/adt/wv_stack/c/sccz80/wv_stack_top.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
3
2017-03-07T03:19:40.000Z
2021-09-15T17:59:19.000Z
; void *wv_stack_top(wv_stack_t *s) SECTION code_clib SECTION code_adt_wv_stack PUBLIC wv_stack_top EXTERN asm_wv_stack_top defc wv_stack_top = asm_wv_stack_top
13.833333
36
0.837349
b2886364d0117f4906cff66af862871b736fc59c
648
asm
Assembly
oeis/081/A081893.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/081/A081893.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/081/A081893.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A081893: Third binomial transform of C(n+2,2). ; Submitted by Jon Maiga ; 1,6,33,172,864,4224,20224,95232,442368,2031616,9240576,41680896,186646528,830472192,3674210304,16173236224,70866960384,309237645312,1344324763648,5823975653376,25151328485376,108301895335936,465093418549248,1992315069530112,8514618045497344,36310271995674624,154529762214150144,656399645689249792,2783224569714966528,11781416625201217536,49791797480208203776,210119944214597861376,885443715538058477568,3726242302889329426432,15661285718579409321984,65744195878700841959424,275668143437515539349504 add $0,8 mov $1,4 pow $1,$0 bin $0,2 sub $0,12 mul $0,$1 div $0,1048576
54
500
0.861111
a57eb88c541b466390a4910f8a2aaa352672f97e
21,404
asm
Assembly
simple.asm
tpisto/pasm
5ade5841f3493dd8faab17bda3616a6ad25be238
[ "MIT" ]
103
2015-01-26T16:50:33.000Z
2021-12-20T04:20:54.000Z
simple.asm
tpisto/pasm
5ade5841f3493dd8faab17bda3616a6ad25be238
[ "MIT" ]
4
2015-10-21T09:15:35.000Z
2019-08-02T10:47:13.000Z
simple.asm
tpisto/pasm
5ade5841f3493dd8faab17bda3616a6ad25be238
[ "MIT" ]
16
2015-06-01T12:07:02.000Z
2021-02-09T15:22:22.000Z
inc si ;; KFX kernel - The bootloader loads this to 0x0800:0000 and jumps to 0008 ;[bits 16] ;[org 0x8000] ; use absolute origin 0x8000 (32k) ; ;kernel_header: ; header is 8 bytes ;db 'KFX', 0 ; signature 4 bytes ;;db kernel_length ; kernel length 1 byte in blocks ;db 123 ;db 0 ; padding 3 bytes ;db 0 ;db 0 ; ;boot_16: ; kernel code starts here in 16-bit real mode ;cli ; disable interrupts ;push es ; show red boot screen ;mov ax, 0xb800 ;mov es, ax ;mov ax, 0x4700 ;mov edi, 0x0000 ;mov ecx, 2000 ;cld ;;rep stosw ;;pop es ;;lgdt [gdt32_desc] ; load 32-bit Global Descriptor Table ;;lidt [idt32_desc] ; load 32-bit Interrupt Descriptor Table ;mov eax, cr0 ; set bit 0 (PE) of CR0 (protected environment enable) ;or eax, 0x00000001 ;mov eax, 0x00000011 ;mov cr0, eax ;mov eax, cr4 ; set bit 5 (PAE) of CR4 (physical address extension) ;or eax, 0x00000020 ;mov cr4, eax ;;jmp KERNEL32_CODE32:init_32 ; long jump to 32-bit code ; ;[bits 32] ;init_32: ; protected mode 32-bit code starts here ;;mov ax, KERNEL32_DATA ;mov ds, ax ; update data segment ;;mov es, ax ; update alt1 data segment ;;mov fs, ax ; update alt2 data segment ;;mov gs, ax ; update alt3 data segment ;;mov ss, ax ; update stack segment ;;mov esp, 0x00040000 ; stack pointer at 0x00040000 (256k) ;;in al, 0x92 ; Fast enable A20 ;;or al, 2 ;out 0x92, al ;;jmp boot_32 ;check_longmode: ;mov eax, 80000000h ; Extended-function 8000000h. ;cpuid ; Is largest extended function ;cmp eax, 80000000h ; any function > 80000000h? ;jbe no_long_mode ; If not, no long mode. ;mov eax, 80000001h ; Extended-function 8000001h. ;cpuid ; Now EDX = extended-features flags. ;bt edx, 29 ; Test if long mode is supported. ;jnc no_long_mode ; Exit if not supported. ;jmp boot_32 ; ;no_long_mode: ; CPU won't support 64-bit mode ;mov byte [0xb8000], '3' ;mov byte [0xb8002], '2' ;hlt ;jmp $ ; ;boot_32: ;cld ;mov ax, 0x6700 ; show yellow boot screen ;mov edi, 0xb8000 ;mov ecx, 2000 ;rep stosw ; ;init_pml4_table: ; initialize page map level 4 pointers ;cld ;mov edi, pml4_table ; clear everything with zeroes ;xor eax, eax ;mov ecx, 1024 ; 1024 x 32 bits (512 entries) ;rep stosd ;mov edi, pml4_table ; first entry points to pdp_table ;mov eax, pdp_table ;or eax, 0x00000007 ; ..., cachedis(0), wrthru(0), user(1), r/w(1), present(1) ;stosd ;xor eax, eax ; zero higher 32 bits ;stosd ; ;init_pdp_table: ; initialize page directory pointers ;cld ;mov edi, pdp_table ; clear everything with zeroes ;xor eax, eax ;mov ecx, 1024 ; 1024 x 32 bits (512 entries) ;rep stosd ;mov edi, pdp_table ; first entry points to page_directory ;mov eax, page_directory ;or eax, 0x00000007 ; ..., cachedis(0), wrthru(0), user(1), r/w(1), present(1) ;stosd ;xor eax, eax ;stosd ; zero higher 32 bits ; ;init_page_directory: ; initialize page directory ;cld ;mov edi, page_directory ; clear everything with zeroes ;xor eax, eax ;mov ecx, 1024 ; 1024 x 32 bit (512 entries) ;rep stosd ;mov edi, page_directory ; first entry points to identity_table ;mov eax, identity_table ;or eax, 0x00000007 ; ..., cachedis(0), wrthru(0), user(1), r/w(1), present(1) ;stosd ;xor eax, eax ; zero higher 32 bits ;stosd ; ;init_identity_table: ; identity table will map first 1MB to itself ;cld ;mov edi, identity_table ; clear everything with zeroes ;xor eax, eax ;mov ecx, 1024 ; 1024 x 32 bit (512 entries) ;rep stosd ;mov edi, identity_table ; generate 512 entries ;mov ecx, 512 ;mov ebx, 0x00000000 ; use ebx for the increasing pointer (0k, 4k, 8k..) ;init_identity_loop: ;mov eax, ebx ; lower 32 bits of entry ;or eax, 0x00000007 ; ..., cachedis(0), wrthru(0), user(1), r/w(1), present(1) ;stosd ;xor eax, eax ; higher 32 bits of entry ;stosd ;add ebx, 0x1000 ; increment in 4k blocks ;dec ecx ;jnz init_identity_loop ; ;enter_long_mode: ;cld ;mov ax, 0x7f00 ; show gray boot screen ;mov edi, 0xb8000 ;mov ecx, 2000 ;rep stosw ; ;; Step 1: EFER.LME=1 (enable long mode) ;mov byte [0xb8000], '1' ;mov ecx, 0x0c0000080 ; specify EFER MSR ;rdmsr ; read EFER MSR into EAX ;or eax, 0x00000100 ; set bit 8 (LME) of EFER (IA-32e mode enable) ;wrmsr ; write EFER MSR from EAX ; ;; Step 2: CR3=PML4 (store PML4 address) ;mov byte [0xb8000], '2' ;mov eax, pml4_table ;mov cr3, eax ; store Page Map Level 4 Table address in CR3 ; ;; Step 3: LGDT GDT64 (load 64-bit GDT) ;mov byte [0xb8000], '3' ;lgdt [gdt64_desc] ; ;; Step 4: CR0.PG=1 (enable paging) ;mov byte [0xb8000], '4' ;mov eax, cr0 ; set bit 31 (PG) of CR0 (enable paging) ;or eax, 0x80000000 ;mov cr0, eax ; ;; 32-bit compatibility mode. Next instruction must be long jump to 64-bit code. ;jmp KERNEL64_CODE:boot_64 ; long jump to 64-bit code ; ;[bits 64] ;boot_64: ; long mode 64-bit code starts here ;lgdt [gdt64_desc] ; reload GDT in 64-bit mode ;mov eax, KERNEL64_DATA ; reset segment registers ;mov ss, eax ;mov ds, eax ;mov es, eax ;mov fs, eax ;mov gs, eax ;mov rsp, 0x00040000 ; stack pointer at 0x00040000 (256k) ; ;init_idt_64: ; setup ISR gate descriptors ;mov rdi, idt64 ;mov rax, isr_00 ;call set_idt_desc ;mov rax, isr_01 ;call set_idt_desc ;mov rax, isr_02 ;call set_idt_desc ;mov rax, isr_03 ;call set_idt_desc ;mov rax, isr_04 ;call set_idt_desc ;mov rax, isr_05 ;call set_idt_desc ;mov rax, isr_06 ;call set_idt_desc ;mov rax, isr_07 ;call set_idt_desc ;mov rax, isr_08 ;call set_idt_desc ;mov rax, isr_09 ;call set_idt_desc ;mov rax, isr_0a ;call set_idt_desc ;mov rax, isr_0b ;call set_idt_desc ;mov rax, isr_0c ;call set_idt_desc ;mov rax, isr_0d ;call set_idt_desc ;mov rax, isr_0e ;call set_idt_desc ;mov rax, isr_0f ;call set_idt_desc ; ;lidt [idt64_desc] ; load 64-bit IDT ;jmp kernel_64 ; ;set_idt_desc: ; routine to set IDT descriptor at RDI to handler at RAX ;push rax ;push rbx ;push rcx ;push rdx ; ;; Build the lower 64-bit word in RBX ; ;mov rbx, rax ; target offset 31-16 (0x00000000ffff0000) at low 0xffff000000000000 ;shl rbx, 32 ;mov rcx, 0xffff000000000000 ;and rbx, rcx ; ;mov rcx, 0x00008e0000000000 ; flags (16 bits) at low 0x0000ffff00000000 ;or rbx, rcx ; flags: P:1(1) DP:2(00) 0:1(0), Type:4(0x0e), Reserved:5(00000), IST:3(000) ; ;mov rdx, KERNEL64_CODE ; target selector (16 bits) (0x000000000000ffff) at low 0x00000000ffff0000 ;shl rdx, 16 ;mov rcx, 0x00000000ffff0000 ;and rdx, rcx ;or rbx, rdx ; ;mov rdx, rax ; target offset 15-0 (0x000000000000ffff) at low 0x000000000000ffff ;mov rcx, 0x000000000000ffff ;and rdx, rcx ;or rbx, rdx ; ;; Build the higher 64-bit word in RDX ; ;mov rdx, rax ; high 0xffffffff00000000 must be zero ;shr rdx, 32 ; target offset 64-32 (0xffffffff00000000) at high 0x00000000ffffffff ; ;mov rax, rbx ; First store lower 64-bit word ;stosq ; ;mov rax, rdx ; Then the higher 64-bit word ;stosq ; ;pop rdx ;pop rcx ;pop rbx ;pop rax ;ret ; at end, RDI will point to the next descriptor ; ;kernel_64: ;mov ax, 0x1700 ; show blue boot screen ;call sub_clear_screen ;mov byte [0x00000000000b8000], ':' ;mov byte [0x00000000000b8002], '-' ;mov byte [0x00000000000b8004], ')' ;mov rsi, msg_kernel_boot ;call sub_printl ;cmp dword [kernel_magic], 0xcaccaac0 ; make sure whole kernel loaded ;je magic_ok ;mov rsi, msg_kernel_bad_magic ;call sub_prints ;mov rsi, [kernel_magic] ;mov rcx, 4 ;call sub_printhexs ;call sub_newl ;magic_ok: ;mov rsi, msg_kernel_booted ;call sub_printl ;call sub_print_idt ;sti ; re-enable interrupts ;jmp main_loop ; ;main_loop: ;hlt ;jmp main_loop ; ;read_keyboard: ;push rax ;push rbx ;push rsi ; ;in al, 0x64 ;and al, 0x01 ;jz .end ;in al, 0x60 ;mov bl, al ;and bl, 0x80 ;jnz .end ;.keydown: ;and rax, 0x7f ;mov bl, al ;mov rsi, keyboard_map ;add rsi, rax ;mov al, [rsi] ;or al, al ;jz .unknown ;cmp al, 13 ;je .enter ;.ascii: ; process ascii key, ascii in AL, scancode in BL ;mov rcx, [command_pos] ;mov [command_buffer+rcx], al ;inc byte [command_pos] ;call sub_printc ;call sub_flush ;jmp .end ;.unknown: ; process unknown key, scancode in BL ;mov al, '<' ;call sub_printc ;mov al, bl ;call sub_printhexc ;mov al, '>' ;call sub_printc ;call sub_flush ;jmp .end ;.enter: ; process enter pressed ;call sub_newl ;call parse_command ;mov byte [command_pos], 0 ;.end: ;pop rsi ;pop rbx ;pop rax ;ret ; ;parse_command: ;mov rsi, msg_unknown_command ;call sub_prints ;mov rcx, [command_pos] ;mov byte [command_buffer+rcx], 0 ;mov rsi, command_buffer ;call sub_printl ;ret ; ;; Hang ;kernel_panic: ;mov rsi, msg_kernel_panic ;call sub_printl ;kernel_panic_halt: ;hlt ;jmp kernel_panic_halt ; ;; Display the IDT ;sub_print_idt: ;push rax ;push rbx ;push rcx ;push rsi ; ;mov rsi, msg_idt_start ;call sub_printl ; ;mov rsi, idt64 ; start printing IDT ;mov rcx, 16 ; print N entries ;mov rax, 0 ;sub_print_idt_loop: ;call sub_print_idt_entry ;inc rax ;dec rcx ;jnz sub_print_idt_loop ; ;mov rsi, msg_idt_end ;call sub_printl ; ;pop rsi ;pop rcx ;pop rbx ;pop rax ;ret ; ;; Display IDT entry #RAX at memory RSI ;sub_print_idt_entry: ;push rax ;push rcx ; ;push rsi ;mov rsi, msg_idt_entry ;call sub_prints ;call sub_printhexc ; print AL from RAX ;mov al, ' ' ;call sub_printc ;pop rsi ;mov rcx, 16 ;call sub_printhexs ; print 16 bytes of RSI and increase ;push rsi ;call sub_newl ;pop rsi ; ;pop rcx ;pop rax ;ret ; ;sub_update_int_status: ;push rax ;push rbx ;push rcx ;push rdx ;push rsi ;push rdi ; ;mov rdi, 0x00000000000b8000 ;mov rsi, isr_counters ;mov rdx, 16 ; ;.loopint: ;add rdi, 159 ;mov rcx, 8 ; ;.loopbyte: ;cld ;lodsb ; load next byte to RAX ;mov rbx, rax ; ;std ;mov rax, 0x4f ; color ;stosb ;mov rax, rbx ;and al, 0x0f ;cmp al, 9 ;jg .hex1 ;add al, '0' ;jmp .go1 ;.hex1: ;add al, 'a'-10 ;.go1: ;stosb ; print nibble to screen ; ;mov rax, 0x4f ; color ;stosb ;mov rax, rbx ;shr al, 4 ;and al, 0x0f ;cmp al, 9 ;jg .hex2 ;add al, '0' ;jmp .go2 ;.hex2: ;add al, 'a'-10 ;.go2: ;stosb ; print nibble to screen ; ;loopnz .loopbyte ; ;add rdi, 16*2+1 ;dec rdx ;jnz .loopint ; ;pop rdi ;pop rsi ;pop rdx ;pop rcx ;pop rbx ;pop rax ;ret ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Subroutines ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ;; Interrupt Service Routines ; ;align 8 ;isr_counters: ;isr_00_counter dq 0 ;isr_01_counter dq 0 ;isr_02_counter dq 0 ;isr_03_counter dq 0 ;isr_04_counter dq 0 ;isr_05_counter dq 0 ;isr_06_counter dq 0 ;isr_07_counter dq 0 ;isr_08_counter dq 0 ;isr_09_counter dq 0 ;isr_0a_counter dq 0 ;isr_0b_counter dq 0 ;isr_0c_counter dq 0 ;isr_0d_counter dq 0 ;isr_0e_counter dq 0 ;isr_0f_counter dq 0 ; ;align 8 ;isr_00: ;inc qword [isr_00_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_01: ;inc qword [isr_01_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_02: ; NMI ;inc qword [isr_02_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_03: ;inc qword [isr_03_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_04: ;inc qword [isr_04_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_05: ;inc qword [isr_05_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_06: ;inc qword [isr_06_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_07: ;inc qword [isr_07_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_08: ; IRQ0 - System Timer 18.2 times/second ;inc qword [isr_08_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_09: ; IRQ1 - Keyboard Data Ready ;inc qword [isr_09_counter] ;call sub_update_int_status ;call read_keyboard ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_0a: ;inc qword [isr_0a_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_0b: ;inc qword [isr_0b_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_0c: ;inc qword [isr_0c_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_0d: ;inc qword [isr_0d_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_0e: ;inc qword [isr_0e_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ;isr_0f: ;inc qword [isr_0f_counter] ;call sub_update_int_status ;mov al, 0x20 ; acknowledge interrupt ;out 0x20, al ;iretq ; ; ;; Update cursor to VGA ; ;sub_updatecursor: ;push rax ;push rcx ;push rdx ;mov cx, [console_cursor] ;shr cx, 1 ; divide by 2 ;mov dx, 0x3d4 ;mov al, 15 ;out dx, al ;mov dx, 0x3d5 ;mov al, cl ;out dx, al ;mov dx, 0x3d4 ;mov al, 14 ;out dx, al ;mov dx, 0x3d5 ;mov al, ch ;out dx, al ;pop rdx ;pop rcx ;pop rax ;ret ; ;; Flush current text buffer to VGA ;sub_flush: ;pushf ;push rcx ;push rsi ;push rdi ;mov rcx, 4000 ;mov rsi, console_buffer ;mov rdi, 0xb8000 ;cld ;rep movsb ;call sub_updatecursor ;pop rdi ;pop rsi ;pop rcx ;popf ;ret ; ;; Clear textmode screen, AX=0x1700 for standard color ;sub_clear_screen: ;push rax ;push rcx ;push rdi ;mov rdi, console_buffer ; clear screen buffer ;mov rcx, 2000 ;rep stosw ;xor rcx, rcx ; move cursor to 0,0 ;mov [console_cursor], rcx ;pop rdi ;pop rcx ;pop rax ;call sub_flush ;ret ; ;sub_scroll_line: ;push rax ;push rcx ;push rsi ;push rdi ;mov rax, [console_cursor] ; get current cursor ;sub rax, 160 ; move it one row upwards ;mov [console_cursor], rax ; store new cursor ;mov rcx, 4000-160 ; move n-1 rows of screen buffer ;mov rsi, console_buffer ;add rsi, 160 ;mov rdi, console_buffer ;rep movsb ;mov rcx, 80 ; clear last row of screen buffer ;mov rdi, console_buffer ;add rdi, 4000-160 ;mov ax, 0x1700 ;rep stosw ;pop rdi ;pop rsi ;pop rcx ;pop rax ;ret ; ;; Goto beginning of next line ;sub_newl: ;pushf ;push rax ;push rbx ;push rcx ;push rdx ;mov rax, [console_cursor] ; get current cursor position ;xor rdx, rdx ;mov rbx, 160 ;div rbx ; divide by 160 => eax contains row, edx column ;inc rax ; add one row ;xor rdx, rdx ;mul rbx ; multiply by 160 => eax contains new position ;mov [console_cursor], rax ; set new cursor position ;cmp rax, 4000 ;jne sub_newl_no_scroll ;call sub_scroll_line ;sub_newl_no_scroll: ;pop rdx ;pop rcx ;pop rbx ;pop rax ;popf ;call sub_flush ;ret ; ;; Print char ;; AL=char ;sub_printc: ;push rbx ;push rsi ;mov rbx, [console_cursor] ;mov rsi, console_buffer ;add rsi, rbx ;mov byte [rsi], al ;inc rsi ;mov byte [rsi], 0x17 ;inc rbx ;inc rbx ;mov [console_cursor], rbx ;cmp rbx, 4000 ;jne sub_printc_no_scroll ;call sub_scroll_line ;sub_printc_no_scroll: ;pop rsi ;pop rbx ;ret ; ;; Print string ;; RSI=string start ;sub_prints: ;pushf ;push rax ;push rsi ;sub_prints_next: ;mov al, [rsi] ;cmp al, 0 ;je sub_prints_done ;call sub_printc ;inc rsi ;jmp sub_prints_next ;sub_prints_done: ;pop rsi ;pop rax ;popf ;ret ; ;; Print string and newline ;; RSI=string start ;sub_printl: ;call sub_prints ;call sub_newl ;ret ; ;; Print hex nibble ;; AL=nibble ;sub_printhexnib: ;push rax ;and al, 0x0f ;cmp al, 0x0a ;jge sub_printhexnib_letter ;add al, '0' ;jmp sub_printhexnib_move ;sub_printhexnib_letter: ;add al, 'a'-0x0a ;sub_printhexnib_move: ;call sub_printc ;pop rax ;ret ; ;; Print hex char (byte) ;; AL=byte ;sub_printhexc: ;push rax ;push rdx ;mov dl, al ;shr al, 4 ;call sub_printhexnib ;mov al, dl ;call sub_printhexnib ;pop rdx ;pop rax ;ret ; ;; Print hex string, advance RSI to end ;; RSI=data ;; RCX=len ;sub_printhexs: ;push rcx ;or rcx, rcx ;jz sub_printhexs_exit ;sub_printhexs_next: ;mov al, [rsi] ;call sub_printhexc ;inc rsi ;dec rcx ;jz sub_printhexs_exit ;jmp sub_printhexs_next ;sub_printhexs_exit: ;pop rcx ;ret ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Data ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ;msg_kernel_boot db 'KFX kernel booting...', 0 ;msg_kernel_bad_magic db 'Bad kernel magic: ', 0 ;msg_kernel_booted db 'Kernel booted successfully.', 0 ;msg_kernel_panic db 'Panic - System halted.', 0 ;msg_idt_start db 'Interrupt Descriptor Table:', 0 ;msg_idt_entry db 'INT ', 0 ;msg_idt_end db 'End of IDT.', 0 ;msg_key_down db 'Key down: ', 0 ;msg_key_up db 'Key up: ', 0 ;msg_unknown_command db 'Unknown command: ', 0 ;keyboard_map db 0, 27, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '+', 0, 0, 0 ;db 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 0, '^', 13, 0 ;db 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 0, 0, 0x27, 0, 0 ;db 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '-' ;times 255-($-keyboard_map) db 0 ;console_cursor dq 0 ;console_buffer times 2000 dw 0 ;command_buffer times 256 db 0 ;command_pos dq 0 ; ;align 8 ;idt32_desc: ; Interrupt Descriptor Table info ;dw 0x0000 ; IDT length (16-bit) ;dd 0x00000000 ; IDT location (32-bit) ; ;align 8 ;gdt32: ;gdt32_null: ;dq 0x0000000000000000 ; null segment ; ;KERNEL32_CODE16 equ $-gdt32 ;gdt32_code16: ; 16-bit code segment with base 0x00000000 limit 0xfffff * 4kb = 4GB ;dw 0xffff ; segment limiter bits 0-15 ;dw 0x0000 ; base address bits 0-15 ;db 0x00 ; base address bits 16-23 ;db 10011010b ; present(1), privilege(00), data/code(1), code(1), conform(0), readable(1), access(0) ;db 10001111b ; granularity(1), 32bitmode(1) reserved(0), prog(0), segment limiter bits 16-19 (1111) ;db 0x00 ; base address bits 24-31 ; ;KERNEL32_CODE32 equ $-gdt32 ;gdt32_code32: ; 32-bit code segment with base 0x00000000 limit 0xfffff * 4kb = 4GB ;dw 0xffff ; segment limiter bits 0-15 ;dw 0x0000 ; base address bits 0-15 ;db 0x00 ; base address bits 16-23 ;db 10011010b ; present(1), privilege(00), data/code(1), code(1), conform(0), readable(1), access(0) ;db 11001111b ; granularity(1), 32bitmode(1) reserved(0), prog(0), segment limiter bits 16-19 (1111) ;db 0x00 ; base address bits 24-31 ; ; ;KERNEL32_DATA equ $-gdt32 ;gdt32_data: ; Data segment with base 0x00000000 limit 0xfffff * 4kb = 4GB ;dw 0xffff ; segment limiter bits 0-15 ;dw 0x0000 ; base address bits 0-15 ;db 0x00 ; base address bits 16-23 ;db 10010010b ; present(1), privilege(00), data/code(1), data(0), direction(0), writable(1), access(0) ;db 11001111b ; granularity(1), 32bitmode(1), reserved(0), prog(0), segment limiter bits 16-19 (1111) ;db 0x00 ; base address bits 24-31 ; ;gdt32_end: ; ;align 8 ;gdt32_desc: ; Global Descriptor Table info ;dw gdt32_end - gdt32 - 1 ; GDT32 length (16 bit) ;dd gdt32 ; GDT32 location (32 bit) ; ;idt64: ; 64-bit Interrupt Descriptor Table ;times 256 dq 0x0000000000000000 ; space for 256 x 128-bit descriptors ;times 256 dq 0x0000000000000000 ;idt64_end: ; ;align 8 ;idt64_desc: ; 64-bit Interrupt Descriptor Table info ;dw idt64_end - idt64 - 1 ; IDT length (16-bit) ;dq idt64 ; IDT location (64-bit) ; ;align 8 ;gdt64: ;gdt64_null: ;dq 0x0000000000000000 ; null segment ; ;KERNEL64_CODE equ $-gdt64 ;gdt64_code: ; Code segment ;dw 0x0000 ; segment-limit-15-0 ;dw 0x0000 ; base-address-15-0 ;db 0x00 ; base-address-23-16 ;db 10011000b ; P(1), DPL(00), always(11), C(0), R(0), A(0) ;db 00100000b ; G(0), CS.D(0), CS.L(1), AVL(0), segment-limit-19-16(0) ;db 0x00 ; base-address-31-24 ; ;KERNEL64_DATA equ $-gdt64 ;gdt64_data: ; Data segment ;dw 0x0000 ; segment-limit-15-0 ;dw 0x0000 ; base-address-15-0 ;db 0x00 ; base-address-23-16 ;db 10010010b ; P(1), DPL(00), always(10), E(0), W(1), A(0) ;db 00000000b ; G(0), D/B(0), ?(0), AVL(0), segment-limit-19-16(0) ;db 0x00 ; base-address-31-24 ; ;gdt64_end: ;gdt64_desc: ;dw gdt64_end - gdt64 - 1 ; 64-bit Global Descriptor Table info ;dq gdt64 ; ;times 20480-4 - ($-$$) db 0 ; pad to 20kb - 2 bytes ;kernel_magic dd 0xcaccaac0 ; add kernel magic at end ;kernel_length equ (($-kernel_header)/512)+2 ; calculate kernel length macro ; ;; Paging table data area, not loaded into memory, just reserved. ;; These tables must be 4kb aligned in memory ; ;align 4096 ;pml4_table: ; Page Map Level 4 Table (loc 0x0d000) ;times 512 dq 0 ; 512 x 64-bit entries (initialized in code) ; ;align 4096 ;pdp_table: ; Page Directory Pointer Table (loc 0x0e000) ;times 512 dq 0 ; 512 x 64-bit entries (initialized in code) ; ;align 4096 ;page_directory: ; Page Directory (loc 0x0f000) ;times 512 dq 0 ; 512 x 64-bit entries (initialized in code) ; ;align 4096 ;identity_table: ; Identity Page Pable (loc 0x10000) ;times 512 dq 0 ; 512 x 64-bit entries (initialized in code) ; ; ;; Pad to 10MB ;times 10079*1024 + 512 - ($-$$) db 0 ;
22.721868
104
0.672631
523321129fd55d43958fa8b0b46dad0367a59045
828
asm
Assembly
exercises/avg.asm
amirshnll/assembly-exercises
473d970bfa48655b51ca238f961e434700f21ced
[ "MIT" ]
4
2019-11-17T02:35:34.000Z
2022-01-08T10:30:29.000Z
exercises/avg.asm
amirshnll/assembly-exercises
473d970bfa48655b51ca238f961e434700f21ced
[ "MIT" ]
null
null
null
exercises/avg.asm
amirshnll/assembly-exercises
473d970bfa48655b51ca238f961e434700f21ced
[ "MIT" ]
null
null
null
include io.h cr equ 10 lf equ 13 .model small .stack 200h .data newline db cr,lf,0 sum dw 0 str_in db 10 dup(?) prompt db cr,lf,'insert n : ',0 prompt2 db cr,lf,'insert number : ',0 result db 10 dup(?) max dw 10 dup(?) avg dw 10 dup(?) .code main proc mov ax,@data mov ds,ax ;------------------------------------------- clrscr output prompt inputs max atoi max mov cx,ax forin: output prompt2 inputs str_in atoi str_in add sum,ax loop forin ;-------------------------------------------- mov dx,0 mov ax,sum mov bx,max div bx mov avg,ax itoa result,avg output newline output result ;----------------------------------------------------------------- mov ax,4c00h int 21h main endp end main
16.56
69
0.469807
deb8dac069f3ccd63a3b907821b26486a517d14d
559
asm
Assembly
programs/oeis/075/A075881.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/075/A075881.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/075/A075881.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A075881: a(n) = the sum of the prime factors of Sum_{i=1..n} prime(i). ; 2,5,7,17,9,41,31,18,7,46,7,197,26,281,43,130,18,170,73,74,91,120,44,110,60,46,81,460,44,62,50,620,80,712,571,812,38,108,80,10,96,386,126,1280,74,1412,326,138,62,67,114,26,71,2030,3171,71,239,230,3711,7699,322,336,622,8893,4605,196,394,125,492,213,288,1664,226,460,6361,411,97,1546,68,97,3781,5182,501,92,428,833,57,93,380,303,107,1556,10275,302,675,22039,1884,99,988,24133 seq $0,237589 ; Sum of first n odd noncomposite numbers. seq $0,8472 ; Sum of the distinct primes dividing n.
93.166667
374
0.719141
79ec016e2a0c0d7f7787914103c5befcb8a7a125
297
asm
Assembly
oeis/180/A180973.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/180/A180973.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/180/A180973.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A180973: Numbers n such that 9^10 + n^2 is a square. ; Submitted by Jamie Morken(w1) ; 0,78732,262440,796068,2391120,7174332,21523320,64570068,193710240,581130732,1743392200 mov $2,$0 lpb $0 sub $0,1 mov $3,3 mov $4,$2 sub $2,2 add $4,8 pow $3,$4 add $1,$3 lpe mov $0,$1 mul $0,4
17.470588
88
0.653199
1e84f6a153758c1c2b8549d7bb2b2ec4525b4dcc
666
asm
Assembly
programs/oeis/111/A111144.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/111/A111144.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/111/A111144.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A111144: a(n) = n*(n+13)*(n+14)/6. ; 0,35,80,136,204,285,380,490,616,759,920,1100,1300,1521,1764,2030,2320,2635,2976,3344,3740,4165,4620,5106,5624,6175,6760,7380,8036,8729,9460,10230,11040,11891,12784,13720,14700,15725,16796,17914,19080,20295,21560,22876,24244,25665,27140,28670,30256,31899,33600,35360,37180,39061,41004,43010,45080,47215,49416,51684,54020,56425,58900,61446,64064,66755,69520,72360,75276,78269,81340,84490,87720,91031,94424,97900,101460,105105,108836,112654,116560,120555,124640,128816,133084,137445,141900,146450,151096,155839,160680,165620,170660,175801,181044,186390,191840,197395,203056,208824 mov $1,$0 add $1,14 bin $1,2 mul $0,$1 div $0,3
74
579
0.782282
5e1d6f0f1f2633f7fbd07dce48dfb4613d84d265
384
asm
Assembly
programs/oeis/054/A054608.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/054/A054608.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/054/A054608.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A054608: a(n) = Sum_{d|9} phi(d)*n^(9/d). ; 0,9,540,19755,262296,1953405,10078164,40354335,134218800,387422001,1000002060,2357950419,5159783880,10604503845,20661052356,38443366215,68719485024,118587886425,198359302140,322687711611,512000016120 mov $1,$0 pow $0,8 add $0,6 mov $2,$1 mov $3,$1 mov $1,$0 mul $1,$2 mov $0,$1 mov $4,$3 mul $4,$3 mul $4,$3 mov $5,$4 mul $5,2 add $0,$5
21.333333
201
0.705729
fb8d1a54dbcc3bf369adf79ee65f1d7074dee687
272
asm
Assembly
asm/linux-helloworld.asm
icefoxen/lang
628185020123aabe4753f96c6ab4378637a2dbf5
[ "MIT" ]
null
null
null
asm/linux-helloworld.asm
icefoxen/lang
628185020123aabe4753f96c6ab4378637a2dbf5
[ "MIT" ]
null
null
null
asm/linux-helloworld.asm
icefoxen/lang
628185020123aabe4753f96c6ab4378637a2dbf5
[ "MIT" ]
null
null
null
msg: db 'Hello world!',0x0A,0 msgend: db 0 global _start _start: mov eax, 4 ; "Write" system call mov ebx, 1 ; stdout mov ecx, msg ; String mov edx, msgend - msg ; String length int 0x80 mov eax, 1 ; "_exit" system call mov ebx, 0 ; EXIT_SUCCESS int 0x80
16
39
0.658088
d5e1e95c8b3862c8110cc01e6c8bc784b9d9060b
672
asm
Assembly
unordnung_auch_assembler/asm/attiny13/sleepIRQ/withoutSleep_but_INT0.asm
no-go/Blink_atmega328p
a81e41906c4a6d843a7fb87962288a0894105bd7
[ "Unlicense" ]
null
null
null
unordnung_auch_assembler/asm/attiny13/sleepIRQ/withoutSleep_but_INT0.asm
no-go/Blink_atmega328p
a81e41906c4a6d843a7fb87962288a0894105bd7
[ "Unlicense" ]
null
null
null
unordnung_auch_assembler/asm/attiny13/sleepIRQ/withoutSleep_but_INT0.asm
no-go/Blink_atmega328p
a81e41906c4a6d843a7fb87962288a0894105bd7
[ "Unlicense" ]
null
null
null
.include "myTiny13.h" .equ LED,0 .equ TASTER,1 ;irq Vector .org 0x0000 rjmp Main rjmp EXT_INT0 ; IRQ0 Handler ; IRQ routine ----------------- .org 0x0010 EXT_INT0: ; toggleLED sbis PORTB,LED ; if LED = 1 then rjmp setLED cbi PORTB,LED ; LED := 0; return; reti setLED: ; else sbi PORTB,LED ; LED := 1; return; reti .org 0x0030 Main: sbi DDRB,LED ; output cbi DDRB,TASTER ; input ; configure Sleepmode to power-down mode: SM[1:0] = 10 ; INTO on logical change ISC0[1:0] = 01 ldi A,0b00010001 out MCUCR,A ; Enable int0 IRQ ldi A,0b01000000 out GIMSK,A sei mainLoop: ;sbis PORTB,LED ; if LED = 1 skip sleep ;sleep rjmp mainLoop
16.8
55
0.650298
bfa68753212f14f285c91aef43a3b6ea7e4c36ed
669
asm
Assembly
programs/oeis/206/A206807.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/206/A206807.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/206/A206807.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A206807: Position of 3^n when {2^j} and {3^k} are jointly ranked; complement of A206805. ; 2,5,7,10,12,15,18,20,23,25,28,31,33,36,38,41,43,46,49,51,54,56,59,62,64,67,69,72,74,77,80,82,85,87,90,93,95,98,100,103,105,108,111,113,116,118,121,124,126,129,131,134,137,139,142,144,147,149,152,155 mov $3,$0 add $3,1 mov $5,$0 lpb $3 mov $0,$5 sub $3,1 sub $0,$3 mov $7,2 mov $9,$0 lpb $7 sub $7,1 add $0,$7 sub $0,1 mov $2,1 add $2,$0 mul $2,24 sub $2,1 div $2,41 mov $4,$2 mov $6,$7 lpb $6 sub $6,1 mov $8,$4 lpe lpe lpb $9 sub $8,$4 mov $9,0 lpe mov $4,$8 add $4,2 add $1,$4 lpe
18.081081
200
0.536622
250f8fd81aaf5e9f156de622a4a79c54c810189f
5,775
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_1543.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_1543.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_1543.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 %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x151a5, %rcx nop nop sub %r11, %r11 mov (%rcx), %r15 nop nop nop nop nop and %r14, %r14 lea addresses_UC_ht+0x12b25, %rsi lea addresses_WC_ht+0xafd5, %rdi clflush (%rdi) nop cmp %rbx, %rbx mov $16, %rcx rep movsl dec %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %rax push %rcx push %rdi push %rsi // REPMOV lea addresses_PSE+0xf929, %rsi lea addresses_A+0x161c1, %rdi clflush (%rsi) nop and $47683, %rax mov $68, %rcx rep movsb nop nop nop nop and %rax, %rax // Load lea addresses_normal+0x13b25, %rsi nop nop nop and $28308, %rax mov (%rsi), %cx xor %r10, %r10 // Store lea addresses_PSE+0xfd95, %rdi clflush (%rdi) nop nop nop dec %rax mov $0x5152535455565758, %rcx movq %rcx, %xmm5 vmovups %ymm5, (%rdi) nop and %rax, %rax // REPMOV lea addresses_PSE+0xc725, %rsi lea addresses_D+0x3a5, %rdi nop nop nop nop nop xor $17117, %r10 mov $19, %rcx rep movsl nop nop nop nop cmp %rdi, %rdi // Store lea addresses_D+0xc585, %rdi nop nop nop nop nop inc %rcx mov $0x5152535455565758, %rsi movq %rsi, (%rdi) nop nop nop nop nop sub %rdi, %rdi // Faulty Load lea addresses_normal+0x13b25, %rdi nop nop nop cmp $18385, %r10 mov (%rdi), %r12 lea oracles, %rdi and $0xff, %r12 shlq $12, %r12 mov (%rdi,%r12,1), %r12 pop %rsi pop %rdi pop %rcx pop %rax pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_PSE'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_A'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_PSE'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'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 */
37.258065
2,999
0.658182
d55c9f571deb8ec0e7c2a783ffac539232935117
1,055
asm
Assembly
oeis/287/A287194.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/287/A287194.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/287/A287194.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A287194: Binary representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 259", based on the 5-celled von Neumann neighborhood. ; 1,11,1,1100,1,111100,1,11111100,1,1111111100,1,111111111100,1,11111111111100,1,1111111111111100,1,111111111111111100,1,11111111111111111100,1,1111111111111111111100,1,111111111111111111111100,1,11111111111111111111111100,1,1111111111111111111111111100,1,111111111111111111111111111100,1,11111111111111111111111111111100,1,1111111111111111111111111111111100,1,111111111111111111111111111111111100,1,11111111111111111111111111111111111100,1,1111111111111111111111111111111111111100,1 seq $0,287197 ; Decimal representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 259", based on the 5-celled von Neumann neighborhood. seq $0,7088 ; The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.
175.833333
483
0.843602
218c3addb97fd18260bbc2631bb8d2ac74d4df3c
5,830
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48_notsx.log_21829_6.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_6.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_6.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 %r8 push %r9 push %rcx push %rdi push %rsi lea addresses_WT_ht+0x1d97a, %rsi lea addresses_A_ht+0x17686, %rdi nop and %r11, %r11 mov $69, %rcx rep movsl nop nop nop add %r14, %r14 lea addresses_D_ht+0x1cf76, %rcx nop nop nop nop nop add $40421, %r9 movb (%rcx), %r8b dec %rcx pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r8 push %r9 push %rbx push %rdi push %rsi // Store lea addresses_PSE+0x11b06, %r13 clflush (%r13) nop nop nop nop cmp $12861, %r8 movl $0x51525354, (%r13) nop nop nop xor $15330, %r8 // Store lea addresses_PSE+0xba6, %r8 nop nop nop nop nop xor %r11, %r11 movb $0x51, (%r8) nop nop mfence // Load lea addresses_WT+0x11946, %rsi nop nop nop add %r9, %r9 mov (%rsi), %r11 nop nop nop nop nop sub $35829, %r8 // Store lea addresses_D+0x15c86, %r8 inc %rsi mov $0x5152535455565758, %rbx movq %rbx, %xmm2 vmovups %ymm2, (%r8) xor %r13, %r13 // Store lea addresses_RW+0x1ef58, %rbx nop nop nop inc %r11 mov $0x5152535455565758, %rdi movq %rdi, %xmm1 movups %xmm1, (%rbx) and $58464, %rdi // Store lea addresses_A+0x13246, %r9 nop nop nop dec %rdi movl $0x51525354, (%r9) nop and %r11, %r11 // Faulty Load mov $0x22797a0000000886, %rsi nop nop nop nop add $44978, %r8 movb (%rsi), %bl lea oracles, %rdi and $0xff, %rbx shlq $12, %rbx mov (%rdi,%rbx,1), %rbx pop %rsi pop %rdi pop %rbx pop %r9 pop %r8 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_NC', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_PSE', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_PSE', 'congruent': 5}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT', 'congruent': 5}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_RW', 'congruent': 0}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_A', 'congruent': 6}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_NC', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 3}} {'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.133758
2,999
0.653859
15cda257f0340cbb57ffd4cfa7a48feb79bfff5a
95
asm
Assembly
tests/asm/16/test16.asm
ReneNyffenegger/udis86
6b6122c3552925d4d0216beac29b09800440f2fe
[ "BSD-2-Clause" ]
710
2015-01-05T05:16:09.000Z
2022-03-23T14:24:53.000Z
tests/asm/16/test16.asm
ReneNyffenegger/udis86
6b6122c3552925d4d0216beac29b09800440f2fe
[ "BSD-2-Clause" ]
28
2015-01-17T23:19:45.000Z
2021-12-23T21:39:49.000Z
tests/asm/16/test16.asm
ReneNyffenegger/udis86
6b6122c3552925d4d0216beac29b09800440f2fe
[ "BSD-2-Clause" ]
227
2015-01-05T21:24:53.000Z
2022-03-10T18:24:43.000Z
[bits 16] movzx eax, word [bx] iretd dpps xmm2, xmm1, 0x10 blendvpd xmm1, xmm2
15.833333
25
0.6
97a6c56d42d6599a0182b4a4f519182fe42673ac
1,788
asm
Assembly
boot/boot.asm
Twometer/nekosys
cbcdaddaf8087cde1c375dbc19c576475965f5b4
[ "Apache-2.0" ]
1
2021-08-28T19:50:32.000Z
2021-08-28T19:50:32.000Z
boot/boot.asm
Twometer/nekosys
cbcdaddaf8087cde1c375dbc19c576475965f5b4
[ "Apache-2.0" ]
null
null
null
boot/boot.asm
Twometer/nekosys
cbcdaddaf8087cde1c375dbc19c576475965f5b4
[ "Apache-2.0" ]
null
null
null
bits 16 ; 16-bit org 0x7C00 ; BIOS offset ; entry point boot: ; Reset segment registers xor ax, ax mov ds, ax ; Data segment mov es, ax ; Extra segment ; Make sure that we are at 0:0x7C00 and the BIOS didn't mess with us jmp 0:startup startup: equ $ ; Let's make a stack (4k in size) mov ax, 0x0900 mov ss, ax mov sp, 0x1000 ; Save the disk number mov [disk], dl ; Load stage 2 mov ah, 0x2 ; op mov al, 0x2 ; sector count: TWO SECTORS mov ch, 0x0 ; cyl mov cl, 0x2 ; sector mov dh, 0x0 ; head mov bx, 0x8000 ; put it at 0x8000 mov dl, [disk] ;diskno int 0x13 jc readfail ; if carry is set: instant error cmp ah, 0 je readok ; if ah is zero, read readfail: ; write an error message push ioerr call print cli ; and halt hlt readok: ; write a success message push iogood call print jmp 0x8000 ; and transfer execution to the big chungus fat16 loader ; Shouldn't get here... cli ; clear interrupts hlt ; halt execution print: push bp ; save stack frame mov bp, sp pusha ;save register states to stack mov si, [bp+4] ; get argument from stack mov ah, 0x0e ; set mode to tty nextchar: mov al, [si] ; load char int 0x10 ; call video int inc si ; increment si cmp byte [si], 0 ; check if we reached the end jne nextchar; if not, write next char popa ;load register states back from stack mov sp, bp ;return stack frame pop bp ret ; memory disk: db 0x0 ; messages ioerr: db "Failed to access boot disk", 0xa,0xd,0 iogood: db "Bootloader loaded",0xa,0xd,0 ; boot sector times 510 - ($-$$) db 0 ; pad to full sector dw 0xaa55 ; boot signature
19.866667
72
0.616331
299f08d4a606460fc37998e96e80d70f9871131b
8,249
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1358.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1358.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1358.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 %r8 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x42b0, %rsi lea addresses_UC_ht+0x18798, %rdi xor %rdx, %rdx mov $115, %rcx rep movsl nop nop dec %rax lea addresses_UC_ht+0x16390, %rax nop cmp %r9, %r9 mov $0x6162636465666768, %rcx movq %rcx, %xmm6 vmovups %ymm6, (%rax) nop nop nop nop nop inc %r9 lea addresses_WC_ht+0xfee4, %rsi nop nop nop cmp %r9, %r9 movw $0x6162, (%rsi) nop add $12226, %r9 lea addresses_WT_ht+0x18406, %rsi lea addresses_A_ht+0xc964, %rdi sub $44147, %r8 mov $121, %rcx rep movsw nop nop nop nop inc %r8 lea addresses_D_ht+0xa6e4, %r9 cmp $52693, %r8 mov $0x6162636465666768, %rax movq %rax, %xmm6 movups %xmm6, (%r9) nop nop nop nop xor %r8, %r8 lea addresses_WC_ht+0x67c4, %rsi lea addresses_D_ht+0x3c44, %rdi clflush (%rdi) nop nop nop nop and $65040, %r11 mov $118, %rcx rep movsl nop nop nop nop nop and $6016, %rsi lea addresses_D_ht+0xf6e4, %rsi clflush (%rsi) nop nop nop nop cmp $21935, %r9 mov (%rsi), %rdi nop nop nop and %rsi, %rsi lea addresses_A_ht+0x6224, %r8 nop nop nop and %r9, %r9 movb (%r8), %dl nop nop nop and $14679, %rsi lea addresses_UC_ht+0x8dcc, %rdx nop nop nop nop inc %r11 movb (%rdx), %al nop nop nop sub %r8, %r8 lea addresses_WT_ht+0xee4, %rdi nop nop nop nop xor $53052, %rax movb $0x61, (%rdi) nop nop nop nop add $38581, %rax lea addresses_UC_ht+0x5364, %rsi lea addresses_WT_ht+0xf4e4, %rdi clflush (%rdi) nop nop and $29558, %r8 mov $21, %rcx rep movsb nop nop nop mfence lea addresses_UC_ht+0x173e4, %rsi lea addresses_D_ht+0x10ee4, %rdi nop nop nop sub $31301, %r9 mov $70, %rcx rep movsb nop nop nop nop add %r9, %r9 lea addresses_D_ht+0xebe4, %r9 nop nop inc %rcx movl $0x61626364, (%r9) nop nop xor $11306, %r11 lea addresses_UC_ht+0x1b264, %rdx nop nop xor $7462, %r8 movw $0x6162, (%rdx) nop nop add $63372, %rdx lea addresses_normal_ht+0xf622, %rsi lea addresses_WT_ht+0xb4e4, %rdi nop nop nop inc %r11 mov $6, %rcx rep movsw nop nop sub %r8, %r8 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %r8 push %r9 push %rbp push %rbx push %rsi // Store lea addresses_UC+0x32e4, %r11 nop nop nop nop dec %rbp mov $0x5152535455565758, %rsi movq %rsi, %xmm6 vmovups %ymm6, (%r11) sub $25685, %r9 // Load lea addresses_RW+0x44, %r9 nop nop nop dec %r8 mov (%r9), %r15w nop and %rsi, %rsi // Faulty Load lea addresses_WC+0xd6e4, %rsi nop nop nop nop nop inc %r11 mov (%rsi), %ebx lea oracles, %r8 and $0xff, %rbx shlq $12, %rbx mov (%r8,%rbx,1), %rbx pop %rsi pop %rbx pop %rbp pop %r9 pop %r8 pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}} {'src': {'same': False, 'congruent': 4, 'NT': True, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': True, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': True}} {'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': True, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 7, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
31.365019
2,999
0.65511
c4e909a80db5b044099c7069cae45c043e301385
243
asm
Assembly
factorial.asm
talhakanyilmaz/mips
2ee3cf9f784d329ca9134dde153960fd6a2283e6
[ "MIT" ]
null
null
null
factorial.asm
talhakanyilmaz/mips
2ee3cf9f784d329ca9134dde153960fd6a2283e6
[ "MIT" ]
null
null
null
factorial.asm
talhakanyilmaz/mips
2ee3cf9f784d329ca9134dde153960fd6a2283e6
[ "MIT" ]
null
null
null
.data .text main: addi $6, $0, 5 addi $7, $0, -1 addi $8, $0, 1 for: mult $6, $8 mflo $8 add $6, $6, $7 bgtz $6, for finish: add $4, $0, $8 addi $2, $0, 1 syscall addi $2, $0, 10 syscall
12.15
19
0.419753
599d730b799bf4b6191ddb976cd060ac5225d517
3,084
asm
Assembly
RTOS/PRUSS/PRU1_button/PRU1_button.asm
embedded92/TestGit
0c106d7931224db7077fbb9778876519ad494617
[ "MIT" ]
null
null
null
RTOS/PRUSS/PRU1_button/PRU1_button.asm
embedded92/TestGit
0c106d7931224db7077fbb9778876519ad494617
[ "MIT" ]
1
2020-09-20T03:35:59.000Z
2020-09-20T03:35:59.000Z
RTOS/PRUSS/PRU1_button/PRU1_button.asm
embedded92/TestGit
0c106d7931224db7077fbb9778876519ad494617
[ "MIT" ]
null
null
null
; PRUSS program to to handle two buttons connected to enhanced GPIO pins. ; ; This program runs on PRU1. ; ; The PRUSS program halts if it detects that the word in the shared memory location, ; at offset +0x000c, is not equal to zero. This halt condition is generated when ; the user presses both buttons simultaneously. ; ; author: Takis Zourntos (takis.zourntos@emads.org) .cdecls "main.c" .clink .global BEGIN .asg 0x00010000, SM_ba .asg 0x0001000c, HALT_ba .asg 0xffffffff, HALT_val BEGIN: LDI32 r0, SM_ba ; place shared memory address in register r0, where delay is LDI32 r1, 0 ; clear r1 LDI32 r2, 0 ; clear r2 LDI32 r3, 0 ; clear r3 LDI32 r4, 0 ; clear r4 LDI32 r5, 0 ; clear r5 LDI32 r6, 0 ; clear r6 LDI32 r7, 0 ; clear r7 LBBO &r6, r0, 4, 4 ; store MIN_DELAY in r6 LBBO &r7, r0, 8, 4 ; place MAX_DELAY in r7 LDI32 r8, 0 ; clear r8 BUTTON_CHK: MOV r1, r31.w0 ; load button status of Button 1 CLR r1, r1.t0 ; ignore other button state LSR r1, r1, 1 ; place Button 1 state in bit 0 of r1 MOV r3, r31.w0 ; load button status of Button 2 CLR r3, r3.t1 ; ignore other button state LSR r3, r3, 1 ; place Button 2 state in bit 0 of r3 AND r4, r1, r3 ; r4 = r1 && r3; if r4=1 then both buttons are pressed, else r4=0 QBGT END, r4, 0 ; if r4 > 0, we have a HALT condition (both buttons are pressed) MOV r8, r6 ; prepare for quick human-scale LSL r8, r8, 4 ; delay of 160ms (similar to an RTOS tick) SM_DELAY: ; give user time to get off the button SUB r8, r8, 1 ; decrement delay counter QBNE SM_DELAY, r8, 0 ; typical 2-instruction delay loop LBBO &r2, r0, 0, 4 ; load current delay into r2 (initialized by host program) QBEQ SKIPDEC, r1, 0 ; no decrement needed if Button 1 not pressed QBEQ SKIPDEC, r2, r6 ; skip the decrement if we're at MIN_DELAY SUB r5, r2, r6 ; r5 = current_delay - MIN_DELAY SBBO &r5, r0, 0, 4 ; store updated delay SKIPDEC: QBEQ BUTTON_CHK, r3, 0 ; no increment needed if Button 2 not pressed, loop QBEQ BUTTON_CHK, r2, r7 ; skip increment if we're at MAX_DELAY, loop ADD r5, r2, r6 ; otherwise, increment delay, r5 = r2 + MIN_DELAY SBBO &r5, r0, 0, 4 ; store updated delay JMP BUTTON_CHK ; resume checking buttons END: LDI32 r0, HALT_ba ; store halt condition base address in r0 LDI32 r1, HALT_val ; store halt value in r1 SBBO &r1, r0, 0, 4 ; store that value to inform other PRU HALT ; halt the pru program
46.029851
98
0.549611
5be811da4790d9d7c9bdcec4f38d806675aae26f
773
asm
Assembly
S5/AO/Assembler/String/TailleChaineDeCaractaire.asm
Momellouky/S5
3357722927dd4a9f16968b10f1477d99afc4acfa
[ "MIT" ]
1
2021-11-25T22:54:49.000Z
2021-11-25T22:54:49.000Z
S5/AO/Assembler/String/TailleChaineDeCaractaire.asm
Momellouky/S5
3357722927dd4a9f16968b10f1477d99afc4acfa
[ "MIT" ]
null
null
null
S5/AO/Assembler/String/TailleChaineDeCaractaire.asm
Momellouky/S5
3357722927dd4a9f16968b10f1477d99afc4acfa
[ "MIT" ]
null
null
null
; multi-segment executable file template. data segment msj dw "ethernet$" ends code segment start: ; set segment registers: mov ax, data mov ds, ax mov es, ax call tailleChaine afficher: mov dx, ax add dx, 48 mov ah, 02h int 21h jmp fin tailleChaine proc ; mov dx, offset msj mov ax, 0 ;; taille mov si, 0 mov cx, '$' boucle: cmp msj[si], cx je afficher inc si inc ax jmp boucle ret tailleChaine endp fin: mov ax, 4c00h ; exit to operating system. int 21h ends end start ; set entry point and stop the assembler.
14.865385
51
0.490298
874cdb785dd41f57b8fd634b756646fd11e612e1
36
asm
Assembly
src/main/fragment/mos6502-common/vwum1=vwum2_rol_8.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/main/fragment/mos6502-common/vwum1=vwum2_rol_8.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/main/fragment/mos6502-common/vwum1=vwum2_rol_8.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
lda {m2} sta {m1}+1 lda #0 sta {m1}
7.2
10
0.555556
a53ddb612213f707ba0131160e8d33f1bb2218e4
177
asm
Assembly
data/wildPokemon/pokemontower3.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
null
null
null
data/wildPokemon/pokemontower3.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
null
null
null
data/wildPokemon/pokemontower3.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
null
null
null
TowerMons3: db $0A db 20,HOOTHOOT db 21,GASTLY db 22,CUBONE db 23,GASTLY db 24,GASTLY db 19,MISDREAVUS db 18,GASTLY db 25,VULPIX db 20,HAUNTER db 25,HAUNTER db $00
11.8
17
0.711864
894652baaeaa61360579d88ef886fec8f00b6fd5
817
asm
Assembly
oeis/192/A192959.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/192/A192959.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/192/A192959.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A192959: Coefficient of x in the reduction by x^2 -> x+1 of the polynomial p(n,x) defined at Comments. ; 0,1,0,3,10,27,60,121,228,411,718,1227,2064,3433,5664,9291,15178,24723,40188,65233,105780,171411,277630,449523,727680,1177777,1906080,3084531,4991338,8076651,13068828,21146377,34216164,55363563,89580814,144945531,234527568,379474393,614003328,993479163,1607484010,2600964771,4208450460,6809416993,11017869300,17827288227,28845159550,46672449891,75517611648,122190063841,197707677888,319897744227,517605424714,837503171643,1355108599164,2192611773721,3547720375908,5740332152763,9288052531918 mov $1,$0 seq $1,192968 ; Coefficient of x in the reduction by x^2 -> x+1 of the polynomial p(n,x) defined at Comments. mov $3,$0 mul $0,2 sub $0,1 sub $3,$0 mov $0,$1 mov $2,92 add $2,$1 add $2,$3 add $0,$2 sub $0,93
51.0625
492
0.78825
05d7708c4c7a01547c55d4358d372c9c147e2fd0
457
asm
Assembly
programs/oeis/072/A072442.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/072/A072442.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/072/A072442.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A072442: Least k such that Sum( Cos(1/Sqrt(i)) i=1..k) > n. ; 1,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74 mov $4,$0 lpb $0 add $0,1 add $2,1 add $3,4 mov $1,$3 sub $1,2 add $3,$1 mul $1,2 trn $0,$1 mul $3,2 add $3,1 lpe mov $1,$2 lpb $4 add $1,1 sub $4,1 lpe add $1,1
19.869565
207
0.571116
6ee11f5c6ad1f83aa5be5c31e07905fef8b79dde
1,204
asm
Assembly
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/arrayfree.asm
gb-archive/really-old-stuff
ffb39a518cad47e23353b3420b88e2f3521fd3d7
[ "Apache-2.0" ]
10
2016-10-27T20:46:02.000Z
2021-11-01T15:49:13.000Z
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/arrayfree.asm
gb-archive/really-old-stuff
ffb39a518cad47e23353b3420b88e2f3521fd3d7
[ "Apache-2.0" ]
null
null
null
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/arrayfree.asm
gb-archive/really-old-stuff
ffb39a518cad47e23353b3420b88e2f3521fd3d7
[ "Apache-2.0" ]
2
2015-03-11T14:28:08.000Z
2017-11-02T10:57:57.000Z
; This routine is in charge of freeing an array of strings from memory ; HL = Pointer to start of array in memory ; Top of the stack = Number of elements of the array #include once <free.asm> __ARRAY_FREE: PROC LOCAL __ARRAY_LOOP ex de, hl pop hl ; (ret address) ex (sp), hl ; Callee -> HL = Number of elements ex de, hl __ARRAY_FREE_FAST: ; Fastcall entry: DE = Number of elements ld a, h or l ret z ; ret if NULL ld b, d ld c, e ld e, (hl) inc hl ld d, (hl) inc hl ; DE = Number of dimensions ex de, hl add hl, hl ; HL = HL * 2 add hl, de inc hl ; HL now points to the element start __ARRAY_LOOP: ld e, (hl) inc hl ld d, (hl) inc hl ; DE = (HL) = String Pointer push hl push bc ex de, hl call __MEM_FREE ; Frees it from memory pop bc pop hl dec bc ld a, b or c jp nz, __ARRAY_LOOP ret ; Frees it and return ENDP __ARRAY_FREE_MEM: ; like the above, buf also frees the array itself ex de, hl pop hl ; (ret address) ex (sp), hl ; Callee -> HL = Number of elements ex de, hl push hl ; Saves array pointer for later call __ARRAY_FREE_FAST pop hl ; recovers array block pointer jp __MEM_FREE ; Frees it and returns from __MEM_FREE
17.2
70
0.666944
03ccdd142b43d24177430ded9e51a336a15bb2e6
252
asm
Assembly
projects/TestMASM/testMasm.asm
jay3ss/co-sci-917
1f6e0536c944286000dc74cf05a266667409312d
[ "BSD-3-Clause" ]
null
null
null
projects/TestMASM/testMasm.asm
jay3ss/co-sci-917
1f6e0536c944286000dc74cf05a266667409312d
[ "BSD-3-Clause" ]
null
null
null
projects/TestMASM/testMasm.asm
jay3ss/co-sci-917
1f6e0536c944286000dc74cf05a266667409312d
[ "BSD-3-Clause" ]
null
null
null
; test program from page 54 .386 .model flat,stdcall .stack 4096 ExitProcess proto,dwExitCode:dword .code main proc mov eax,5 ; move 5 to the eax register add eax,6 ; add 6 to the eax register invoke ExitProcess,0 ; end the program main endp
19.384615
42
0.738095
9d97d7655ba57631e70cb7f13aad5a47fcb6391c
728
asm
Assembly
nand2tetris/04/mult/Mult.asm
linroid/my_practice
74490cf296d6373fe04304c9d7d4827e0aea8741
[ "MIT" ]
3
2016-11-29T06:13:05.000Z
2021-03-12T17:56:21.000Z
nand2tetris/04/mult/Mult.asm
linroid/my_practice
74490cf296d6373fe04304c9d7d4827e0aea8741
[ "MIT" ]
null
null
null
nand2tetris/04/mult/Mult.asm
linroid/my_practice
74490cf296d6373fe04304c9d7d4827e0aea8741
[ "MIT" ]
null
null
null
// This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT Press. // File name: projects/04/Mult.asm // Multiplies R0 and R1 and stores the result in R2. // (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.) // // This program only needs to handle arguments that satisfy // R0 >= 0, R1 >= 0, and R0*R1 < 32768. // Put your code here. // i=0 @i M=0 // sum=0 @R2 M=0 // go to end if RAM[0] == 0 @R0 D=M @END D;JEQ (LOOP) // if (i - RAM[1] <= 0) goto END @R1 D=M @i D=D-M @END D;JLE // sum = sum + M[0] @R2 D=M @R0 D=D+M @R2 M=D // i = i + 1 @i D=M+1 M=D @LOOP 0;JEQ (END) @END 0;JEQ
12.77193
67
0.553571
a20adb4c7cdc203ca32ec8615ae581ab098b559f
399
asm
Assembly
oeis/209/A209983.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/209/A209983.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/209/A209983.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A209983: (A209982)/2. ; Submitted by Jon Maiga ; 0,10,26,58,90,154,186,282,346,442,506,666,730,922,1018,1146,1274,1530,1626,1914,2042,2234,2394,2746,2874,3194,3386,3674,3866,4314,4442,4922,5178,5498,5754,6138,6330,6906,7194,7578,7834 mov $2,3 lpb $0 sub $0,1 mov $2,$0 mov $0,0 max $2,0 seq $2,137243 ; Number of coprime pairs (a,b) with -n <= a,b <= n. lpe mov $0,$2 sub $0,3 mul $0,2
24.9375
186
0.66416
4a4d0cc69bae3afa9281fe570d52254a7201ea4a
4,205
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1094.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.log_21829_1094.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.log_21829_1094.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 %r14 push %rax push %rcx push %rdi push %rdx push %rsi // Store lea addresses_UC+0x196b6, %rdi nop nop nop xor %rax, %rax movl $0x51525354, (%rdi) nop nop nop nop nop and $43056, %rcx // Store lea addresses_US+0x10db6, %rdi and $53791, %rdx movb $0x51, (%rdi) nop nop nop nop and $28549, %rcx // Faulty Load mov $0x172b400000000c36, %rcx nop nop nop nop cmp $13358, %r14 movb (%rcx), %dl lea oracles, %rsi and $0xff, %rdx shlq $12, %rdx mov (%rsi,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'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 */
58.402778
2,999
0.659929
87e19d4b9343c228eaf04834102e5ca574c71482
505
asm
Assembly
oeis/065/A065075.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/065/A065075.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/065/A065075.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A065075: Sum of digits of the sum of the preceding numbers. ; Submitted by Jon Maiga ; 1,1,2,4,8,7,5,10,11,13,8,7,14,10,2,4,8,7,5,10,11,13,8,16,14,19,11,13,8,7,14,10,11,13,8,7,5,10,11,13,17,16,14,10,11,13,8,16,14,19,20,13,8,16,14,19,20,13,8,16,14,19,20,22,17,16,14,19,20,13,17,16,14,19,20,13,17,16,14,19,20,4,8,7,5,10,11,13,8,16,14,19,11,13,8,7,14,10,11,13 seq $0,4207 ; a(0) = 1, a(n) = sum of digits of all previous terms. seq $0,7953 ; Digital sum (i.e., sum of digits) of n; also called digsum(n).
72.142857
271
0.651485
5d62a4b14362e803c5c51f2d9ceee89ce061eedf
827
asm
Assembly
oeis/142/A142771.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142771.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142771.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142771: Primes congruent to 44 mod 59. ; Submitted by Jon Maiga ; 103,457,811,929,1283,1637,1873,2699,3407,3643,3761,5059,5413,5531,6121,6829,6947,7537,8009,8363,8599,9661,10133,10369,10487,10723,11549,11903,12611,15443,15679,15797,16033,16741,17449,17921,19219,19927,20399,20753,21107,22051,22877,25237,26417,27361,27479,28069,28541,29131,31019,31727,31963,32789,33851,34913,35149,35267,36683,36919,37273,38453,39043,39161,39397,39869,40459,40577,40813,41521,42701,42937,43291,45061,45179,45533,45887,46477,46831,47303,47657,48247,49663,51197,51551,51787,52259 mov $1,51 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 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,59 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,117
34.458333
497
0.73156
38f76c4bf129d4b596ff42a8593c348e9687c06a
17,135
asm
Assembly
Microsoft Word for Windows Version 1.1a/Word 1.1a CHM Distribution/Opus/asm/nattrans.asm
lborgav/Historical-Source-Codes
c0aeaae1d482718e3b469d9eb7a6d0002faa1ff5
[ "MIT" ]
7
2017-01-12T17:48:48.000Z
2021-11-28T04:37:34.000Z
Microsoft Word for Windows Version 1.1a/Word 1.1a CHM Distribution/Opus/asm/nattrans.asm
lborgav/Historical-Source-Codes
c0aeaae1d482718e3b469d9eb7a6d0002faa1ff5
[ "MIT" ]
null
null
null
Microsoft Word for Windows Version 1.1a/Word 1.1a CHM Distribution/Opus/asm/nattrans.asm
lborgav/Historical-Source-Codes
c0aeaae1d482718e3b469d9eb7a6d0002faa1ff5
[ "MIT" ]
5
2017-03-28T08:04:30.000Z
2020-03-25T14:25:29.000Z
include w2.inc include noxport.inc include consts.inc include windows.inc errNull equ 0 errDiv0 equ (errNull+7) errVal equ (errDiv0+8) errRef equ (errVal+8) errName equ (errRef+6) errNum equ (errName+7) errNa equ (errNum+6) errMax equ (errNa+5) errNil equ errMax createSeg trans,trans,byte,public,CODE externFP <DADD,DMUL,DSUB,DDIV,DNEG,DINT,SFLOAT,FIX,DDIV2> externFP <SetSbCur, ReloadSb> OverErr EQU 0001H ;Overflow error indicator UnderErr EQU 0002H ;Underflow error indicator DivBy0 EQU 0004H ;Divide by 0 indicator TransErr EQU 0008H ;Transcendental error indicator POLY1 EQU 8000h ; flag for leading 1 in poly EXPMASK EQU 07FF0h EXPBIAS EQU 03FF0h EXPSHFT EQU 4 MANBITS EQU 53 OF_EXP EQU 6 OF_SGN EQU 7 sBegin data externW mpsbps externW pdAcc externW fError externW AC_HI externW AC_LO externB round_flag externW round_exp externW f8087 ArgTran DQ ? TempTran1 DQ ? TempTran2 DQ ? TempTran3 DQ ? SgnTrig DB ? ; sign/cosine flag ILNinterval DQ 03FF71547652B82FER ; 1/ln(2) ISQRbase DQ 03FE6A09E667F3BCDR ; 1/sqr(2) LNXMAX DQ 040862E42FEFA39EER ; 1024*ln(2)-2eps LNXMIN DQ 0C086232BDD7ABCD1R ; -1022*ln(2)+2eps ExpC1 DQ 03FE6300000000000R ; ln(2) ExpC2 DQ 0BF2BD0105C610CA8R LogATab DW 2 DQ 0BFE94415B356BD29R ;-0.78956112887491257267E+00 DQ 04030624A2016AFEDR ;+0.16383943563021534222E+02 DQ 0C05007FF12B3B59AR ;-0.64124943423745581147E+02 LogBTab DW 3 numOne DQ 03FF0000000000000R ;+0.10000000000000000000E+01 DQ 0C041D5804B67CE0FR ;-0.35667977739034646171E+02 DQ 040738083FA15267ER ;+0.31203222091924532844E+03 DQ 0C0880BFE9C0D9077R ;-0.76949932108494879777E+03 ExpPTab DW 2 DQ 03EF152A46F58DC1CR ;+0.165203300268279130E-04 DQ 03F7C70E46FB3F6E0R ;+0.694360001511792852E-02 DQ 03FD0000000000000R ;+0.249999999999999993E+00 ExpQTab DW 2 DQ 03F403F996FDE3809R ;+0.495862884905441294E-03 DQ 03FAC718E714251B3R ;+0.555538666969001188E-01 numHalf DQ 03FE0000000000000R ;+0.500000000000000000E+00 sEnd data sBegin trans assumes cs,trans assumes ds,dgroup assumes ss,dgroup ; %%Function:LOGNAT %%Owner:bryanl cProc LOGNAT,<PUBLIC,NEAR> LocalQ LOG_LO LocalQ LOG_HI cBegin call ResetSbTrans mov ax,[si+of_exp] ; save copy of sign:exp:himan mov bx,ax AND BX,8000h+expmask ;Taking log of zero? jg LnPos mov [ferror],TransErr jmp LnExit LnPos: call LogCore mov ax,dataOffset AC_HI cCall DADD,<ax> lea ax,LOG_HI cCall DADD,<ax> ; AC = log(x) (normal precision) LnExit: cEnd LogCore: AND AX,not expmask OR AX,expbias-(1 shl expshft) mov [si+of_exp],ax ; Convert DAC to range [.5,1) XCHG AX,BX SUB AX,expbias-(1 shl expshft) ; Convert exponent to 16-bit integer mov cl,expshft sar ax,cl ; shift to integer PUSH AX mov di,dataOffset ArgTran call dstdi ; At this point AC = Y mov ax,dataOffset ISQRbase cCall DSUB,<ax> ;AC < 1/SQR(base) mov si,[si+of_exp] call dlddi or si,si pop si ; get exponent mov cl,00010000b ; assume in range AC < 1.0 jg dlog1 ; No - in range dec si ; and adjust exponent down 1 add word ptr [pdAcc+of_exp],1 shl expshft ; * 2 mov cl,00001000b ; Y >= 1.0 divide adjustment dlog1: push cx ; save divide adjustment call dstdi cCall SFLOAT,<si> ; AC = XN mov si,dataOffset TempTran1 mov bx,si call dst mov ax,dataOffset ExpC2 cCall DMUL,<ax> lea bx,LOG_LO call dst ; LOG_LO = XN*C2 mov bx,si call dld mov ax,dataOffset ExpC1 cCall DMUL,<ax> lea bx,LOG_HI call dst mov ax,word ptr [pdAcc+of_exp] ; get exponent and ax,expmask shl ax,1 ; shift into highest bits mov [ROUND_EXP],ax ; set round threshold call dlddi mov ax,dataOffset numOne cCall DSUB,<ax> ; AC = Y-1 pop ax mov [ROUND_FLAG],al ; set special round flag for divide cCall DDIV2,<di> ; AC = 2*(Y-1)/(Y+1) (trick divide) mov bx,dataOffset LogATab mov cx,dataOffset LogBTab call z3p_q ; z^3*A(z*z)/B(z*z) mov ax,dataOffset AC_LO cCall DADD,<ax> lea si,LOG_LO cCall DADD,<si> ; LOG_LO = XN*C2+lo(S)+S*r(S^2) ret ; %%Function:LN %%Owner:bryanl cProc LN,<PUBLIC,FAR>,<si,di> cBegin cCall LOGNAT cEnd ;*** EXP - exponential function ; %%Function:ETOX %%Owner:bryanl cProc ETOX,<PUBLIC,NEAR> cBegin call ResetSbTrans mov di,dataOffset ArgTran ; save X in argtran call dstdi call EXPrange ; check for proper range MOV AX,word ptr [SI+of_exp] ; get exponent AND AX,expmask ; mask off sign, hi mantissa CMP AX,expbias-((manbits+1) shl expshft) ; less than 2^(-54) jae exp1 ; ; Return ONE ; mov bx,dataOffset numOne call dld jmp short ExpRet ; ; Return Zero ; retzero: mov di,dataOffset pdAcc push ss pop es xor ax,ax stosw stosw stosw stosw jmp short ExpRet ; ; Overflow ; ovrflw2: pop ax ; toss one more level off stack ovrflw: mov [fError],OverErr jmp short ExpRet ; ; No errors, proceed ; exp1: CALL EXPM1 EXPadjust: ; finish up EXP PUSH AX ; save integer part mov ax,dataOffset numHalf cCall DADD,<ax> ; AC = 0.5+g*P(z)/(Q(z)-g*P(z)) POP AX ; restore n inc ax mov cl,expshft sal ax,cl add word ptr [si+of_exp],ax ; adjust exponent expRet: cEnd EXPM1: mov di,dataOffset ILNinterval cCall DMUL,<di> ; x/ln(interval) mov al,[si+of_sgn] ; get sign mov [SgnTrig],al and byte ptr [si+of_sgn],01111111b ; make it positive mov ax,dataOffset numHalf cCall DADD,<ax> ; round to nearest int cCall FIX ; get the int test [SgnTrig],10000000b ; test the sign jz expos neg ax expos: call LNreduce ; reduce ARG by ax*LN(2) EXPM1reduced: ; compute (EXP(X)-1)/2 push ax ; save n mov bx,dataOffset ExpPTab mov cx,dataOffset ExpQTab call p_q mov si,dataOffset TempTran3 ; point to z cCall DMUL,<si> ; ac = z*P(z*z) mov bx,si call dst ; Temp3 = z*P(z*z) cCall DNEG ; ac = -z*P(z*z) mov di,dataOffset TempTran1 ; point to Q(z*z) cCall DADD,<di> ; ac = Q(z*z)-z*P(z*z) call dstdi ; Temp1 = ac mov bx,si call dld ; ac = z*P(z*z) cCall DDIV,<di> ; AC = z*P(z*z)/(Q(z*z)-z*P(z*z)) mov si,dataOffset pdAcc ; si = ac pop ax ; get integer part ret LNreduce: ; reduce ARG by LN(2) push ax ; save n cCall SFLOAT,<ax> ; XN mov bx,dataOffset ExpC1 mov cx,dataOffset ExpC2 call REDUCE pop ax ; get integer part ret overflowrange: mov ax,transOffset ovrflw2 ; overflow on upper limit jmp short range EXPrange: mov bx,transOffset retzero ; standard returns for EXP mov ax,transOffset ovrflw ; overflow on upper limit range: push ax push bx mov ax,dataOffset LNXMAX cCall DSUB,<ax> cmp byte ptr [si+of_sgn],0 jg rangeax ; overflow on upper limit mov di,dataOffset ArgTran call dlddi mov ax,dataOffset LNXMIN cCall DSUB,<ax> cmp byte ptr [si+of_sgn],0 ; check lower limit jl rangebx call dlddi add sp,4 ; clean ax,bx off stack ret rangeax: pop bx pop ax pop bx ; toss return address jmp ax ; return for x > LNXMAX rangebx: pop bx pop ax pop ax ; toss return address jmp bx ; return for x < LNXMIN ; %%Function:EXP %%Owner:bryanl cProc EXP,<PUBLIC,FAR>,<si,di> cBegin cCall ETOX cEnd ;*** SQR - Double precision square root ; ; This routine takes the square root of the number in the accumulator, ; and leaves the result in the accumulator. ; ; Algorithm: x is initially adjusted so that the exponent is even ; (when the exponent is odd the exponent is incremented and the ; mantissa is shifted right one bit). The exponent is then divided ; by two and resaved. A single word estimate of y (the root of ; x) accurate to 5 bits is produced using a wordlength implementation ; of a linear polynomial approximation of sqrt x. Three or four ; Newton-Raphson iterations are then computed as follows: ; ; 1) qa*ya+r1a=xa:0h,ya=(ya+qa)/2 ; 2) qa*ya+r1a=xa:xb,ya=(ya+qa)/2 ; 3) qa*ya+r1a=xa:xb,qb*ya+r2a=r1a:xc,ya:yb=(ya:yb+qa:qb)/2 ; *** iteration 4 implemented with standard divide *** ; 4) qa*ya+r1a=xa:xb,p1a:p1b=qa*yb, ; if p1a<r1a continue ; if p1a=r1a ; if p1b=xc continue else r1a=r1a+ya,qa=qa-1 endif, ; else r1a=r1a+ya,qa=qa-1,p1a:p1b=p1a:p1b-yb endif, ; r1a:r1b=r1a:xc-p1a:p1b, ; qb:ya+r2a=r1a:r1b,p2a:p2b=qb*yb, ; if p2a<r2a continue ; if p2a=r2a ; if p2b=xd continue else r2a=r2a+ya,qb=qb-1 endif, ; else r2a=r2a+ya,qb=qb-1,p2a:p2b=p2a:p2b-yb endif, ; r2a:r2b=r2a:xd-p2a:p2b, ; qc*ya+r3a=r2a:r2b,p3a:p3b=qc*yb, ; if p3a>=r3a then r3a=r3a+ya,qc=qc-1 endif, ; r3a=r3a-p3a,qd*ya+r4a=r3a:0h, ; ya:yb:yc:yd=(ya:yb:0h:0h+qa:qb:qc:qd)/2 ; %%Function:SQRT %%Owner:bryanl cProc SQRT,<PUBLIC,NEAR,ATOMIC> cBegin push bp call ResetSbTrans mov di,dataOffset TempTran1 MOV AX,[SI+6] MOV BH,AL ; Save hi mantissa TEST AX,07FF0h ; Test exponent jz sqrxv ; Zero - return 0 AND AX,0FFF0h ; Mask off hi mantissa jns sqr1 ; Negative - error mov [fError],TransErr ; set transcendental error sqrxv: jmp sqrx sqr1: SUB AX,03FE0h ; Remove excess from exponent MOV BL,[SI+5] MOV CX,[SI+3] MOV DX,[SI+1] ;get first three mantissa words of x SHL DX,1 RCL CX,1 RCL BX,1 SHL DX,1 RCL CX,1 RCL BX,1 SHL DX,1 RCL CX,1 RCL BX,1 OR BH,080h ;implied leading 1 now explicit TEST AL,16 ;if exponent is even JZ EXPEVEN ; bypass adjust ADD AX,16 ;increment exponent SHR BX,1 RCR CX,1 RCR DX,1 ;divide mantissa by 2 EXPEVEN: SAR AX,1 ;divide exponent by 2 ADD AX,03FE0h ; Bias the exponent MOV [DI+6],AX ; Store exponent of y CMP BX,0FFFEH ;if mantissa < 0.FFFEh JB NOTNEARONE1 ; perform main root routine STC ;otherwise x to become (1+x)/2 JMP SHORT SINGLEDONE ;single precision complete NOTNEARONE1: PUSH DX ;save third mantissa word MOV AX,0AFB1H ;AX=.AFB1h MUL BX ;DX=.AFB1h*x MOV BP,057D8H ;BP=.57D8h ADD BP,DX ;BP=.AFB1h*x+.57D8h JNC NORMEST ;if y is more than one MOV BP,0FFFFH ; replace y with .FFFFh NORMEST: MOV DX,BX XOR AX,AX ;load divide regs with xa:0h DIV BP ;qa*ya+r1a=xa:0h ADD BP,AX ;ya=ya+qa RCR BP,1 ;ya=ya/2 MOV DX,BX MOV AX,CX ;load divide regs with xa:xb DIV BP ;qa*ya+r1a=xa:xb STC ;add one to qa for better rounding ADC BP,AX ;ya=ya+qa RCR BP,1 ;ya=ya/2 MOV DX,BX MOV AX,CX ;load divide regs with xa:xb DIV BP ;qa*ya+r1a=xa:xb MOV SI,AX ;save qa POP AX ;load divide regs with r1a:xc DIV BP ;qb*ya+r2a=r1a:xc MOV BX,BP MOV CX,AX ;move qa:qb ;no need to round with floating point operations following ; ADD CX,1 ;add one to qa:qb for better rounding ; ADC BX,SI ;ya:yb=ya:0h+qa:qb ADD BX,SI ;ya:yb=ya:0h+qa:qb SINGLEDONE: ;We now have BX:CX = (ya:yb)*2=ya:0h+qa:qb XOR AX,AX SHL CX,1 RCL BX,1 RCL AX,1 SHL CX,1 RCL BX,1 RCL AX,1 SHL CX,1 RCL BX,1 RCL AX,1 SHL CX,1 RCL BX,1 RCL AX,1 ;back to IEEE format OR [DI+6],AL MOV [DI+4],BX MOV [DI+2],CX MOV WORD PTR [DI],0 ;save ya:yb:0h:0h cCall DDIV,<di> ;accumulator (x)=x/y cCall DADD,<di> ;accumulator (x)=y+x/y SUB WORD PTR [pdAcc+of_exp],16 ;accumulator (x)=(y+x/y)/2 sqrx: pop bp cEnd ; %%Function:SQR %%Owner:bryanl cProc SQR,<PUBLIC,FAR>,<si,di> cBegin cCall SQRT cEnd ;*** special common subexpression subroutine for transcendentals ResetSbTrans: mov ax,sbDds cCall SetSbCur,<ax> mov si,dataOffset pdAcc ret ;*** reduce - perform high precision reduction ; ; Function: ; compute ac = (x - xn*c1) - xn*c2 ; ; Inputs: ; ARG = x ; AC = xn ; BX = c1 ; CX = c2 REDUCE: push bx push cx mov si,dataOffset TempTran1 mov bx,si call dst ; xnT = xn (TempTran1) cCall DMUL ;,<cx> ; ac = xn*c2 mov bx,dataOffset TempTran2 call dst mov bx,si call dld ; ac = xn cCall DMUL ;,<bx> ; ac = xn*c1 cCall DNEG ; ac = -xn*c1 mov ax,dataOffset ArgTran cCall DADD,<ax> ; ac = arg-xn*c1 mov ax,dataOffset TempTran2 cCall DSUB,<ax> ; ac = arg-xn*c1-xn*c2 ret ; EVEN: mov ax,[si+of_exp] ; get exponent and sign mov ch,al ; save hign mantissa byte and ax,expmask ; test for 0 jz evenxit ; yes - return even sub ax,expbias-((7-expshft) shl expshft) cmp ax,(manbits-1+7-expshft) shl expshft ja evenxit ; too big - assume even mov cl,expshft shr ax,cl mov cl,al and cl,7 ; get bit within byte inc cx ; bump shift count by 1 shr al,1 shr al,1 shr al,1 cbw mov bx,ax neg bx ; bx = byte offset or ch,1 shl expshft ; set implied mantissa bit xchg [si+of_exp],ch ; swap with memory mov al,[si+bx+of_exp] shl al,cl ; bit in 'C', to tell us even or odd mov [si+of_exp],ch ; restore high mantissa byte evenxit: ret ; z2p_q ; ; Function: ; compute z*z*P(z*z)/Q(z*z) z2p_q: push cx call p_q pop cx jcxz nodiv mov ax,dataOffset TempTran1 cCall DDIV,<ax> ; P(z*z)/Q(z*z) nodiv: mov di,dataOffset TempTran2 cCall DMUL,<di> ret ; z3p_q ; ; Function: ; compute z*z*z*P(z*z)/Q(z*z) z3p_q: call z2p_q mov di,dataOffset TempTran3 cCall DMUL,<di> ; ac = z^3*P(z*z)/Q(z*z) ret ; p_q ; ; Function: ; computes ; z = ac ; zz = z*z ; if Q ; pzz = p(zz) ; ac = q(zz) ; else ; ac = p(zz) ; ; Inputs: ; BX = address of P table ; CX = address of Q table p_q: push bx push cx mov di,dataOffset TempTran3 ; temp3=z call dstdi cCall DMUL,<di> mov di,dataOffset TempTran2 call dstdi ; temp2 = z*z pop bx ; get Q table or bx,bx jz noq call poly mov bx,dataOffset TempTran1 call dst ; TempTran1 = Q(z*z) mov bx,dataOffset TempTran2 call dld noq: pop bx ; call poly ; ac = P(z*z) ; ret ;*** POLY - Evaluate DP polynomial ; ; Inputs: ; BX = Address of list of coefficients. First byte in list is number of ; coefficients, followed by the constants ordered from highest ; power to lowest. ; AC = argument. ; Function: ; Evaluate polynomial by Horner's method ; Outputs: ; Result in AC. ; Registers: ; ALL destroyed. POLY: push ss pop es mov si,dataOffset pdAcc mov di,dataOffset ArgTran movsw movsw movsw movsw mov si,bx ; Point to coefficient table lodsw ; Number of coefficients xchg ax,cx ; Count in CX or cx,cx ; check for implied 1.0 as 1st jns polymove ; no - normal poly xor ch,ch ; clear flag so we can count down push cx ; save count jmp short polyone ; jump into middle of poly loop polymove: mov di,dataOffset pdAcc ; Move first coefficient into AC movsw movsw movsw movsw jcxz polyxit polyloop: push cx mov ax,dataOffset ArgTran cCall DMUL,<ax> ; Multiply by argument polyone: ; alternate entry for implied 1.0 cCall DADD,<si> ; Add coefficient pop cx add si,8 ; Bump to next coefficient loop polyloop polyxit: ret ; ; Load num pointed by AX into pdacc ; dlddi: mov bx,di dld: mov ax,[bx ] mov [pdAcc ],ax mov ax,[bx+2] mov [pdAcc+2],ax mov ax,[bx+4] mov [pdAcc+4],ax mov ax,[bx+6] mov [pdAcc+6],ax ret ; ; Load pdacc into num pointed to by AX ; dstdi: mov bx,di dst: mov ax,[pdAcc ] mov [bx ],ax mov ax,[pdAcc+2] mov [bx+2],ax mov ax,[pdAcc+4] mov [bx+4],ax mov ax,[pdAcc+6] mov [bx+6],ax ret rgnumKonst DQ 03ff0000000000000R ; 1 DQ 04000000000000000R ; 2 DQ 0bff0000000000000R ; -1 DQ 04024000000000000R ; 10 DQ 04059000000000000R ; 100 DQ 040026bb1bbb55516R ; Ln(10) DQ 03fe0000000000000R ; 1/2 DQ 0cca8e45e1df3b078R ; large negative for sort (-2*10**60) ; %%Function:DLdC %%Owner:bryanl cProc DLdC,<PUBLIC,FAR>,<si,di,ds> ParmW ic cBegin mov si, ic mov cl, 3 shl si, cl add si, offset rgnumKonst mov di, dataOffset pdAcc push ds pop es push cs pop ds movsw movsw movsw movsw cEnd ifdef NOTUSED ; The next two routines are no longer required by the mathpack. ; %%Function:DldHp %%Owner:NOTUSED cProc DldHp,<PUBLIC,FAR> ; ParmD hp cBegin nogen mov bx,sp push si mov si,[bx+4] ; get offset of huge pointer mov bx,[bx+6] call GetPSfromSB cld lods word ptr es:[si] mov word ptr [pdAcc ],ax lods word ptr es:[si] mov word ptr [pdAcc +2],ax lods word ptr es:[si] mov word ptr [pdAcc +4],ax lods word ptr es:[si] mov word ptr [pdAcc +6],ax pop si ret 4 cEnd nogen ; %%Function:DstHp %%Owner:NOTUSED cProc DstHp,<PUBLIC,FAR> ; ParmD hp cBegin nogen mov bx,sp push si push di mov di,[bx+4] ; get offset of huge pointer mov bx,[bx+6] call GetPSfromSB mov si,dataOffset pdAcc cld movsw movsw movsw movsw pop di pop si ret 4 cEnd nogen endif ;NOTUSED GetPSfromSB: shl bx,1 mov ax,[mpsbps+bx] mov es,ax shr ax,1 jc mrs MyReloadSB: push dx push bx push cx cCall ReloadSb,<> pop cx pop bx pop dx mrs: ret sEnd trans end
21.312189
72
0.654975
33d8dc2edfe56c706a34ef092d7a157deefd501f
647
asm
Assembly
oeis/146/A146559.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/146/A146559.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/146/A146559.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A146559: Expansion of (1-x)/(1 - 2*x + 2*x^2). ; 1,1,0,-2,-4,-4,0,8,16,16,0,-32,-64,-64,0,128,256,256,0,-512,-1024,-1024,0,2048,4096,4096,0,-8192,-16384,-16384,0,32768,65536,65536,0,-131072,-262144,-262144,0,524288,1048576,1048576,0,-2097152,-4194304,-4194304,0,8388608,16777216,16777216,0,-33554432,-67108864,-67108864,0,134217728,268435456,268435456,0,-536870912,-1073741824,-1073741824,0,2147483648,4294967296,4294967296,0,-8589934592,-17179869184,-17179869184,0,34359738368,68719476736,68719476736,0,-137438953472,-274877906944,-274877906944,0 mov $1,1 mov $2,2 lpb $0 sub $0,1 add $2,$1 add $1,1 mul $1,2 sub $1,$2 lpe mov $0,$1
46.214286
500
0.715611
3f043e0af4a45a48d8cbeb78a1fd2beeecaeb65c
1,037
asm
Assembly
Solution/4.asm
1813355042-Kamal/CSE331L-Section-1-Fall20-NSU
0d6ce50d466ef5cc2f8a1ee35eea1b5be673bcb6
[ "MIT" ]
null
null
null
Solution/4.asm
1813355042-Kamal/CSE331L-Section-1-Fall20-NSU
0d6ce50d466ef5cc2f8a1ee35eea1b5be673bcb6
[ "MIT" ]
null
null
null
Solution/4.asm
1813355042-Kamal/CSE331L-Section-1-Fall20-NSU
0d6ce50d466ef5cc2f8a1ee35eea1b5be673bcb6
[ "MIT" ]
null
null
null
.model small .stack 100h .data msg1 db 10,13,'ENTER A HEX DIGIT:$' msg2 db 10,13,'IN DECIMAL IS IT:$' msg3 db 10,13,'Invalid$' .code again: mov ax,@data mov ds,ax lea dx,msg1 mov ah,9 int 21h mov ah,1 int 21h mov bl,al jmp go go: cmp bl,'9' ja hex jb num je num hex: cmp bl,'F' ja illegal lea dx,msg2 mov ah,9 int 21h mov dl,49d mov ah,2 int 21h sub bl,17d mov dl,bl mov ah,2 int 21h num: cmp bl,'0' jb illegal lea dx,msg2 mov ah,9 int 21h mov dl,bl mov ah,2 int 21h illegal: lea dx,msg3 mov ah,9 int 21h mov ah,1 int 21h mov bl,al jmp go exit:
9.971154
36
0.366442
bf190f94f640e747f60d7831102874e110083d09
1,434
asm
Assembly
hookflash-core/webRTC/webRTC_ios/third_party/libvpx/source/config/linux/arm-neon/asm_enc_offsets.asm
ilin-in/OP
bf3e87d90008e2a4106ee70360fbe15b0d694e77
[ "Unlicense" ]
1
2020-02-19T09:55:55.000Z
2020-02-19T09:55:55.000Z
hookflash-core/webRTC/webRTC_ios/third_party/libvpx/source/config/linux/arm/asm_enc_offsets.asm
ilin-in/OP
bf3e87d90008e2a4106ee70360fbe15b0d694e77
[ "Unlicense" ]
null
null
null
hookflash-core/webRTC/webRTC_ios/third_party/libvpx/source/config/linux/arm/asm_enc_offsets.asm
ilin-in/OP
bf3e87d90008e2a4106ee70360fbe15b0d694e77
[ "Unlicense" ]
null
null
null
@ This file was created from a .asm file @ using the ads2gas.pl script. .equ DO1STROUNDING, 0 .equ vp8_block_coeff , 4 .equ vp8_block_zbin , 20 .equ vp8_block_round , 28 .equ vp8_block_quant , 8 .equ vp8_block_quant_fast , 12 .equ vp8_block_zbin_extra , 32 .equ vp8_block_zrun_zbin_boost , 24 .equ vp8_block_quant_shift , 16 .equ vp8_blockd_qcoeff , 0 .equ vp8_blockd_dequant , 12 .equ vp8_blockd_dqcoeff , 4 .equ vp8_blockd_eob , 20 .equ vp8_block_base_src , 36 .equ vp8_block_src , 40 .equ vp8_block_src_diff , 0 .equ vp8_block_src_stride , 44 .equ vp8_blockd_predictor , 8 .equ vp8_writer_lowvalue , 0 .equ vp8_writer_range , 4 .equ vp8_writer_count , 8 .equ vp8_writer_pos , 12 .equ vp8_writer_buffer , 16 .equ vp8_writer_buffer_end , 20 .equ vp8_writer_error , 24 .equ tokenextra_token , 6 .equ tokenextra_extra , 4 .equ tokenextra_context_tree , 0 .equ tokenextra_skip_eob_node , 7 .equ TOKENEXTRA_SZ , 8 .equ vp8_extra_bit_struct_sz , 16 .equ vp8_token_value , 0 .equ vp8_token_len , 4 .equ vp8_extra_bit_struct_tree , 0 .equ vp8_extra_bit_struct_prob , 4 .equ vp8_extra_bit_struct_len , 8 .equ vp8_extra_bit_struct_base_val , 12 .equ vp8_comp_tplist , 167104 .equ vp8_comp_common , 103296 .equ vp8_comp_bc , 112656 .equ vp8_writer_sz , 36 .equ tokenlist_start , 0 .equ tokenlist_stop , 4 .equ TOKENLIST_SZ , 8 .equ vp8_common_mb_rows , 2392 .section .note.GNU-stack,"",%progbits
29.265306
40
0.758717
8e9dc1dd645d95edc1133f6b4207f3ed223c770e
4,964
asm
Assembly
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_21829_1774.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_21829_1774.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0.log_21829_1774.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r15 push %r8 push %rdi push %rsi lea addresses_WT_ht+0x12086, %rsi nop nop cmp %rdi, %rdi mov (%rsi), %r8 nop inc %r13 lea addresses_D_ht+0x3ce6, %r13 xor %rsi, %rsi mov (%r13), %r15 inc %rsi lea addresses_normal_ht+0xfb06, %r8 nop nop add $49048, %r14 mov $0x6162636465666768, %r13 movq %r13, %xmm4 vmovups %ymm4, (%r8) nop nop add $1440, %r15 pop %rsi pop %rdi pop %r8 pop %r15 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r9 push %rax push %rbp push %rdi // Store lea addresses_RW+0x1c1d6, %rbp nop nop xor %rax, %rax movb $0x51, (%rbp) nop nop sub %rdi, %rdi // Load lea addresses_WT+0x8a06, %r9 nop nop xor $33877, %r12 mov (%r9), %eax nop nop nop nop nop and %rdi, %rdi // Faulty Load mov $0x47f51f0000000e06, %r11 sub %rbp, %rbp mov (%r11), %r9w lea oracles, %rax and $0xff, %r9 shlq $12, %r9 mov (%rax,%r9,1), %r9 pop %rdi pop %rbp pop %rax pop %r9 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_RW', 'AVXalign': True, 'size': 1}} {'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WT', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32}} {'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 */
48.194175
2,999
0.655318
ecc904ba9c31732f2daaea093c04ba37315c7ab0
341
asm
Assembly
programs/oeis/330/A330025.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/330/A330025.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/330/A330025.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A330025: a(n) = (-1)^floor(n/5) * sign(mod(n, 5)). ; 0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1,-1,-1,-1,0,1,1,1,1,0,-1 add $0,10 seq $0,163812 ; Expansion of (1 - x^5) * (1 - x^6) / ((1 - x) * (1 - x^10)) in powers of x.
56.833333
184
0.44868
513de8f8ecb43e1235547647a5c2a046859c0552
612
asm
Assembly
data/pokemon/base_stats/weepinbell.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
data/pokemon/base_stats/weepinbell.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
data/pokemon/base_stats/weepinbell.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
db DEX_WEEPINBELL ; pokedex id db 65, 90, 50, 55, 85 ; hp atk def spd spc db GRASS, POISON ; type db 120 ; catch rate db 151 ; base exp INCBIN "gfx/pokemon/front/weepinbell.pic", 0, 1 ; sprite dimensions dw WeepinbellPicFront, WeepinbellPicBack db VINE_WHIP, GROWTH, WRAP, NO_MOVE ; level 1 learnset db GROWTH_MEDIUM_SLOW ; growth rate ; tm/hm learnset tmhm SWORDS_DANCE, TOXIC, TAKE_DOWN, DOUBLE_EDGE, RAGE, \ MEGA_DRAIN, SOLARBEAM, MIMIC, DOUBLE_TEAM, REFLECT, \ BIDE, REST, SUBSTITUTE, CUT ; end db 0 ; padding
26.608696
77
0.633987
d59e41a587b740279a873296660cac06a1442a3b
598
asm
Assembly
libsrc/_DEVELOPMENT/arch/zx/bifrost_h/c/sdcc/BIFROSTH_drawTileH.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zx/bifrost_h/c/sdcc/BIFROSTH_drawTileH.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zx/bifrost_h/c/sdcc/BIFROSTH_drawTileH.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; ---------------------------------------------------------------- ; Z88DK INTERFACE LIBRARY FOR THE BIFROST* ENGINE - RELEASE 1.2/L ; ; See "bifrost_h.h" for further details ; ---------------------------------------------------------------- ; void BIFROSTH_drawTileH(unsigned char lin,unsigned char col,unsigned char tile) SECTION code_clib SECTION code_bifrost_h PUBLIC _BIFROSTH_drawTileH EXTERN asm_BIFROSTH_drawTileH _BIFROSTH_drawTileH: ld hl,2 add hl,sp ld d,(hl) ; D = lin inc hl ld e,(hl) ; E = col inc hl ld a,(hl) ; A = tile jp asm_BIFROSTH_drawTileH
22.148148
81
0.553512
7599a0a866ec2cc10e5849cd426c90d49cc6cea8
302
asm
Assembly
programs/oeis/023/A023806.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/023/A023806.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/023/A023806.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A023806: Xenodromes: all digits in base 12 are different. ; 0,1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,40,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,66,67,68,69,70,71,72,73 mov $1,275 mul $1,$0 div $1,254 mov $0,$1
37.75
198
0.655629
f4e224920dfd7bcd3bda7835d2499dfdb3cb8a01
1,113
asm
Assembly
src/features/gdt.asm
FranchuFranchu/fran-os
30e14b587dd66039511d08a54f516ad65c4375ff
[ "0BSD" ]
1
2020-10-24T17:09:05.000Z
2020-10-24T17:09:05.000Z
src/features/gdt.asm
FranchuFranchu/fran-os
30e14b587dd66039511d08a54f516ad65c4375ff
[ "0BSD" ]
null
null
null
src/features/gdt.asm
FranchuFranchu/fran-os
30e14b587dd66039511d08a54f516ad65c4375ff
[ "0BSD" ]
null
null
null
kernel_gdt: kernel_gdt_null: dw 0 dw 0 db 0 db 0 db 0 db 0 kernel_gdt_code: .limit_0_15 dw 0xFFFF .base_0_15 dw 0 .base_16_23 db 0 .access db 10011010b .limit_and_flags db 11001111b .base_24_31 db 0 kernel_gdt_data: .limit_0_15 dw 0xFFFF .base_0_15 dw 0x0 .base_16_23 db 0x0 .access db 10010010b .limit_and_flags db 11001111b .base_24_31 db 0 kernel_gdt_user_code: .limit_0_15 dw 0xFFFF .base_0_15 dw 0 .base_16_23 db 0 .access db 11111010b .limit_and_flags db 11001111b .base_24_31 db 0 kernel_gdt_user_data: .limit_0_15 dw 0xFFFF .base_0_15 dw 0x0 .base_16_23 db 0x0 .access db 11110010b .limit_and_flags db 11001111b .base_24_31 db 0x0 kernel_gdt_task_state_segment: ; We don't know the values of these yet; kernel_userspace_setup will set them .limit_0_15 dw 0 .base_0_15 dw 0x0 .base_16_23 db 0x0 ; Note that the "present" flag is cleared. .access db 01101001b .limit_and_flags db 00000000b .base_24_31 db 0x0 kernel_gdt_end: kernel_gdt_desc: .size: dw kernel_gdt_end - kernel_gdt - 1 .offset: dd kernel_gdt
17.951613
79
0.735849
efac8f346961b4c7f68754dd8ee4ca940f1e2da7
386
asm
Assembly
programs/oeis/336/A336754.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/336/A336754.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/336/A336754.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A336754: Perimeters in increasing order of integer-sided triangles whose sides a < b < c are in arithmetic progression. ; 9,12,15,15,18,18,21,21,21,24,24,24,27,27,27,27,30,30,30,30,33,33,33,33,33,36,36,36,36,36,39,39,39,39,39,39,42,42,42,42,42,42,45,45,45,45,45,45,45,48,48,48,48,48,48,48,51,51,51,51,51,51,51,51 mul $0,2 mov $1,1 lpb $0 add $1,1 sub $0,$1 lpe add $1,2 mul $1,3
32.166667
192
0.673575
cefc2ba5583854609aa4df109c8aa8e47daf4e56
3,929
asm
Assembly
sim/func_level/bin/branch_predictor.asm
cpulabs/mist1032isa
ae90e1afda5aed4690aeff20dcd258ab3c23dba7
[ "BSD-2-Clause" ]
3
2017-02-09T13:05:39.000Z
2021-05-13T23:34:34.000Z
sim/func_level/bin/branch_predictor.asm
cpulabs/mist1032isa
ae90e1afda5aed4690aeff20dcd258ab3c23dba7
[ "BSD-2-Clause" ]
null
null
null
sim/func_level/bin/branch_predictor.asm
cpulabs/mist1032isa
ae90e1afda5aed4690aeff20dcd258ab3c23dba7
[ "BSD-2-Clause" ]
1
2022-01-16T15:32:30.000Z
2022-01-16T15:32:30.000Z
./out/branch_predictor.out: file format elf32-mist32 Disassembly of section .text: 00000000 <_start>: 0: 0d 40 00 00 wl16 r0,0x0 4: 0d 60 00 0f wh16 r0,0xf 8: 1c 00 00 00 srspw r0 c: 14 30 00 1a br 74 <target>,#al 00000010 <mem_print>: 10: 0d 40 02 08 wl16 r16,0x8 14: 0d 60 02 02 wh16 r16,0x2 18: 10 a0 00 10 st32 r0,r16 1c: 14 40 03 e0 b rret,#al 00000020 <error>: 20: 0d 40 03 20 wl16 r25,0x0 24: 0d 60 03 22 wh16 r25,0x2 28: 0e c0 03 40 lil r26,0 2c: 10 a0 03 59 st32 r26,r25 30: 0d 40 03 30 wl16 r25,0x10 34: 0d 60 03 22 wh16 r25,0x2 38: 10 a0 03 79 st32 r27,r25 3c: 0d 40 03 2c wl16 r25,0xc 40: 0d 60 03 22 wh16 r25,0x2 44: 10 a0 03 99 st32 r28,r25 48: 0d 40 03 34 wl16 r25,0x14 4c: 0d 60 03 22 wh16 r25,0x2 50: 10 a0 03 b9 st32 rglobl,r25 54: 0d 40 03 38 wl16 r25,0x18 58: 0d 60 03 22 wh16 r25,0x2 5c: 10 a0 03 d9 st32 rbase,r25 00000060 <finish>: 60: 0d 40 03 24 wl16 r25,0x4 64: 0d 60 03 22 wh16 r25,0x2 68: 0e c0 03 41 lil r26,1 6c: 10 a0 03 59 st32 r26,r25 70: 14 30 00 00 br 70 <finish+0x10>,#al 00000074 <target>: 74: 0d c0 00 c0 clr r6 78: 0d c0 00 e0 clr rtmp 7c: 1a 80 00 00 srfrcr 80: 1a c0 00 00 srfrchr r0 84: 1a a0 00 20 srfrclr r1 88: 00 d0 00 e0 cmp rtmp,0 8c: 14 31 00 01 br 90 <lat0>,#eq 00000090 <lat0>: 90: 1a 80 00 00 srfrcr 94: 1a c0 00 40 srfrchr r2 98: 1a a0 00 60 srfrclr r3 9c: 20 40 00 a3 move r5,r3 a0: 00 20 00 a1 sub r5,r1 a4: 0d c0 00 80 clr r4 a8: 00 00 00 c5 add r6,r5 ac: 1a 80 00 00 srfrcr b0: 1a c0 00 00 srfrchr r0 b4: 1a a0 00 20 srfrclr r1 b8: 00 d0 00 e0 cmp rtmp,0 bc: 14 31 00 01 br c0 <lat1>,#eq 000000c0 <lat1>: c0: 1a 80 00 00 srfrcr c4: 1a c0 00 40 srfrchr r2 c8: 1a a0 00 60 srfrclr r3 cc: 20 40 00 a3 move r5,r3 d0: 00 20 00 a1 sub r5,r1 d4: 0d c0 00 80 clr r4 d8: 00 00 00 c5 add r6,r5 dc: 1a 80 00 00 srfrcr e0: 1a c0 00 00 srfrchr r0 e4: 1a a0 00 20 srfrclr r1 e8: 00 d0 00 e0 cmp rtmp,0 ec: 14 31 00 01 br f0 <lat2>,#eq 000000f0 <lat2>: f0: 1a 80 00 00 srfrcr f4: 1a c0 00 40 srfrchr r2 f8: 1a a0 00 60 srfrclr r3 fc: 20 40 00 a3 move r5,r3 100: 00 20 00 a1 sub r5,r1 104: 0d c0 00 80 clr r4 108: 00 00 00 c5 add r6,r5 10c: 1a 80 00 00 srfrcr 110: 1a c0 00 00 srfrchr r0 114: 1a a0 00 20 srfrclr r1 118: 00 d0 00 e0 cmp rtmp,0 11c: 14 31 00 01 br 120 <lat3>,#eq 00000120 <lat3>: 120: 1a 80 00 00 srfrcr 124: 1a c0 00 40 srfrchr r2 128: 1a a0 00 60 srfrclr r3 12c: 20 40 00 a3 move r5,r3 130: 00 20 00 a1 sub r5,r1 134: 0d c0 00 80 clr r4 138: 00 00 00 c5 add r6,r5 0000013c <lat_average>: 13c: 08 30 00 c2 shr r6,0x2 140: 20 40 00 06 move r0,r6 144: 00 10 00 02 add r0,2 148: 20 40 01 60 move r11,r0 14c: 0d c0 01 00 clr r8 150: 0d 40 05 00 wl16 r8,0x20 154: 0d c0 00 00 clr r0 158: 0d c0 00 20 clr r1 0000015c <lp0>: 15c: 1a 80 00 00 srfrcr 160: 1a c0 00 40 srfrchr r2 164: 1a a0 00 60 srfrclr r3 168: 20 40 00 a3 move r5,r3 16c: 00 20 00 a1 sub r5,r1 170: 0d c0 00 80 clr r4 174: 20 40 00 05 move r0,r5 178: 20 70 03 e2 movepc rret,8 17c: 14 30 ff a5 br 10 <mem_print>,#al 180: 1a 80 00 00 srfrcr 184: 1a c0 00 00 srfrchr r0 188: 1a a0 00 20 srfrclr r1 18c: 00 30 01 01 sub r8,1 190: 14 38 ff f3 br 15c <lp0>,#geu 194: 14 30 ff b3 br 60 <finish>,#al Disassembly of section .assert: 00020000 <CHECK_FLAG>: 20000: 00 00 00 01 add r0,r1 00020004 <CHECK_FINISH>: 20004: 00 00 00 00 add r0,r0 00020008 <CHECK_LOG>: 20008: 00 00 00 00 add r0,r0 0002000c <ERROR_TYPE>: 2000c: 00 00 00 00 add r0,r0 00020010 <ERROR_NUMBER>: 20010: 00 00 00 00 add r0,r0 00020014 <ERROR_RESULT>: 20014: 00 00 00 00 add r0,r0 00020018 <ERROR_EXPECT>: 20018: 00 00 00 00 add r0,r0 Disassembly of section .stack: 000f0000 <STACK_INDEX>: f0000: 00 00 00 00 add r0,r0
24.867089
56
0.635531